From c241ab45d5b4077d7a4a7de08bf99f66f8a7fa38 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Mon, 23 Mar 2020 01:20:06 -0400 Subject: [PATCH 001/419] fix bunch of sigs & client instance --- Horion/DrawUtils.cpp | 4 ++-- Memory/GameData.cpp | 2 +- Memory/Hooks.cpp | 36 ++++++++++++++--------------- SDK/CClientInstance.h | 54 +++++++++++++++++-------------------------- 4 files changed, 42 insertions(+), 54 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 049b5176..31f881e3 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -67,9 +67,9 @@ void DrawUtils::setColor(float r, float g, float b, float a) { } C_Font* DrawUtils::getFont(Fonts font) { - static bool check = strcmp(GameData::getGameVersion()->getText(), "1.14.0"); + /*static bool check = strcmp(GameData::getGameVersion()->getText(), "1.14.0"); if (check == 0) - return g_Data.getClientInstance()->N0000080D->getOldFont(); + return g_Data.getClientInstance()->N0000080D->getOldFont();*/ switch (font) { case Fonts::SMOOTH: return g_Data.getClientInstance()->N0000080D->getTheGoodFontThankYou(); diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 1e83c1ee..f475d1e5 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -5,7 +5,7 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; if (clientInstanceOffset == 0x0) { - uintptr_t sigOffset = FindSignature("4C 8B 2D ?? ?? ?? ?? 49 8D 43 ?? 48 89 44 24 ??"); + uintptr_t sigOffset = FindSignature("4C 89 35 ?? ?? ?? ?? 48 8B 5C 24 ?? 48 8B 6C 24 ?? 48 83 C4 ??"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index f96a09d3..b5ee1545 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -41,7 +41,7 @@ void Hooks::Init() { // LocalPlayer::vtable { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 ?? ?? 49 8D ?? ?? ?? ?? ?? ?? 4D 8B"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 48 8B 89 ?? ?? ?? ?? 48 8B 01 ?? ?? ?? ?? ?? ?? 90 48 8B 08"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** localPlayerVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (localPlayerVtable == 0x0 || sigOffset == 0x0) @@ -84,7 +84,7 @@ void Hooks::Init() { { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } - g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("4C 8B DC 53 48 81 EC ?? ?? ?? ?? 49 C7 43 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B D9 33 C0"), Hooks::ReturnTrue); + //g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("4C 8B DC 53 48 81 EC ?? ?? ?? ?? 49 C7 43 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B D9 33 C0"), Hooks::ReturnTrue); } } @@ -103,10 +103,10 @@ void Hooks::Init() { void* setupRender = reinterpret_cast(FindSignature("40 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8B F9 33 D2 ?? ?? ?? ?? ?? ?? 48 8D 4C 24 30 E8 ?? ?? ?? ?? 4C 8B CF 4C 8B C3 48 8B 57 ?? 48 8D 4C 24")); g_Hooks.UIScene_setupAndRenderHook = std::make_unique(setupRender, Hooks::UIScene_setupAndRender); - void* render = reinterpret_cast(FindSignature("40 56 57 41 56 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B FA 48 8B D9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 30 41 8B 04 36 39 05 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 33 C0")); + void* render = reinterpret_cast(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 48 8B DA 48 8B F9 B9 ? ? ? ? 65 48 8B 04 25 ? ? ? ? 48 8B 10 8B 04 11 39 05 ? ? ? ?")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); - void* fogColorFunc = reinterpret_cast(FindSignature("0F 28 C2 C7 42 0C 00 00 80 3F F3")); + void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 00 48 8B C2 0F 11 02")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); @@ -126,11 +126,11 @@ void Hooks::Init() { void* autoComplete = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 41 8B F9")); g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); - void* sendtoServer = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 ?? ?? ?? ?? ?? ?? 0F B6 41 ?? 48 8B FA 88 42 ?? 48 8D 54 24 ?? 48 8B 59 ?? 48 8B CB E8 ?? ?? ?? ?? 45 33 C9")); - g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(sendtoServer, Hooks::LoopbackPacketSender_sendToServer); + //void* sendtoServer = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 ?? ?? ?? ?? ?? ?? 0F B6 41 ?? 48 8B FA 88 42 ?? 48 8D 54 24 ?? 48 8B 59 ?? 48 8B CB E8 ?? ?? ?? ?? 45 33 C9")); + //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(sendtoServer, Hooks::LoopbackPacketSender_sendToServer); - void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 0F 29 74 24 ?? 0F 29 7C 24 ?? 44 0F 29 44 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ??")); - g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); + //void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 0F 29 74 24 ?? 0F 29 7C 24 ?? 44 0F 29 44 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ??")); + //g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); @@ -138,8 +138,8 @@ void Hooks::Init() { void* keyMouseFunc = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0F 29 74 24 70 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 E0 49 8B F8 48 8B F1 45 33 ED 41 8B DD 89 5D DC 49 8B C8 E8")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); - void* renderLevel = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B D8 48 8B FA 48 8B F1 33 D2")); - g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); + //void* renderLevel = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B D8 48 8B FA 48 8B F1 33 D2")); + //g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 57 41 54 41 55 41 56 41 57 48 83 EC 60 44 ?? ?? ?? ?? ?? ?? ?? ?? 33 F6")); g_Hooks.ClickFuncHook = std::make_unique(clickHook, Hooks::ClickFunc); @@ -147,17 +147,17 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC 40 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ??")); - g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); + //void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC 40 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ??")); + //g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); - void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 ?? ?? ?? ?? ?? E8")); - g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); + //void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 ?? ?? ?? ?? ?? E8")); + //g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); - void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 48 8B F1 80 B9 ?? ?? ?? ?? ?? 74 51 C6 81 ?? ?? ?? ?? ?? 66 ?? ?? ?? ?? ?? ?? ?? 74 40 48 8D 45")); - g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); + //void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 48 8B F1 80 B9 ?? ?? ?? ?? ?? 74 51 C6 81 ?? ?? ?? ?? ?? 66 ?? ?? ?? ?? ?? ?? ?? 74 40 48 8D 45")); + //g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D ?? ?? ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 ?? ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B D9 4C")); g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); @@ -165,8 +165,8 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 C7 85 ?? ?? ?? ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F2")); - g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); + //void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 C7 85 ?? ?? ?? ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F2")); + //g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); #ifdef TEST_DEBUG void* addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 55ef83b3..7e0b1eeb 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -46,35 +46,23 @@ struct C_FontRepository { __int64 unknown; // 0x0030 public: C_FontRepository_FontList* fontList; //0x0038 - C_FontRepository_FontList* fontList1; //0x0040 + //C_FontRepository_FontList* fontList1; //0x0040 }; class MinecraftGame { private: - char filler[0xA0]; //0x0000 + char filler[0x130]; //0x0000 public: - uintptr_t defaultFont; //0x00A0 + C_FontRepository* fontRepository; //0x130 private: - char pad_0x00A8[0x78]; //0x00A8 + char pad_0x128[0xF0]; //0x138 public: - C_FontRepository* fontRepository; //0x120 -private: - char pad_0x128[0x28]; //0x128 -public: - C_FontRepository* fontRepository1; //0x150 -private: - char pad_0x0158[0xC0]; //0x158 -public: - bool canUseKeys; //0x0218 + bool canUseKeys; //0x228 C_Font* getTheGoodFontThankYou() { return fontRepository->fontList->fontEntries[7].font; }; - C_Font* getOldFont() { - return fontRepository1->fontList1->fontEntries[6].font; - }; - C_Font* getTheBetterFontYes() { return fontRepository->fontList->fontEntries[0].font; } @@ -152,37 +140,37 @@ struct PtrToGameSettings1 { class C_ClientInstance { private: - char firstPad[0x40]; //0x0008 + char firstPad[0x90]; //0x0008 public: - MinecraftGame* minecraftGame; //0x0048 + MinecraftGame* minecraftGame; //0x0098 private: - MinecraftGame* N0000080C; //0x0050 + MinecraftGame* N0000080C; //0x00A0 public: - MinecraftGame* N0000080D; //0x0058 + MinecraftGame* N0000080D; //0x00A8 private: - MinecraftGame* N0000080E; //0x0060 + MinecraftGame* N0000080E; //0x00B0 public: - Minecraft* minecraft; //0x0068 + Minecraft* minecraft; //0x00B8 private: - char pad_0x0068[0x8]; //0x0070 + char pad_0x0068[0x8]; //0x00C0 public: - LevelRenderer* levelRenderer; //0x0078 + LevelRenderer* levelRenderer; //0x00C8 private: - char pad_0x0078[0x8]; //0x0080 + char pad_0x0078[0x8]; //0x00D0 public: - C_LoopbackPacketSender* loopbackPacketSender; //0x0088 + C_LoopbackPacketSender* loopbackPacketSender; //0x00D8 private: - char pad_0x0088[0x18]; //0x0090 + char pad_0x0088[0x18]; //0x00E0 public: - PtrToGameSettings1* ptr; //0x00A8 + PtrToGameSettings1* ptr; //0x00F8 private: - char pad_0x00B0[0x8]; //0x00B0 + char pad_0x00B0[0x8]; //0x0100 public: - HitDetectSystem* hitDetectSystem; //0x00B8 + HitDetectSystem* hitDetectSystem; //0x0108 private: - char pad_0x00B8[0x30]; //0x00C0 + char pad_0x00B8[0x30]; //0x0110 public: - C_LocalPlayer* localPlayer; //0x00F0 + C_LocalPlayer* localPlayer; //0x0140 private: virtual __int64 destructorClientInstance(); From b5e5bb58916750e2c635b37c60468ec9ad46feda Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Mon, 23 Mar 2020 22:09:57 -0400 Subject: [PATCH 002/419] fix --- Horion.vcxproj | 152 ++++++++- Horion.vcxproj.filters | 490 ++++++++++++++++++++-------- Horion/Module/ModuleManager.cpp | 1 - Horion/Module/ModuleManager.h | 1 - Horion/Module/Modules/AirSwim.cpp | 31 -- Horion/Module/Modules/AirSwim.h | 13 - Horion/Module/Modules/HudModule.cpp | 4 +- Memory/Hooks.cpp | 55 ++-- Memory/Hooks.h | 2 - SDK/CClientInstance.h | 14 +- SDK/CEntity.h | 100 +++--- SDK/CInventory.h | 8 +- SDK/Tag.h | 8 +- 13 files changed, 592 insertions(+), 287 deletions(-) delete mode 100644 Horion/Module/Modules/AirSwim.cpp delete mode 100644 Horion/Module/Modules/AirSwim.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 0799fa2f..26b13f79 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -213,7 +213,81 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -236,7 +310,81 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Horion.vcxproj.filters b/Horion.vcxproj.filters index 4eb36de2..60b3213b 100644 --- a/Horion.vcxproj.filters +++ b/Horion.vcxproj.filters @@ -967,73 +967,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2915,6 +2848,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3520,73 +3631,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5874,6 +5918,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index be77ab66..678df7e1 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -50,7 +50,6 @@ void ModuleManager::initModules() { this->moduleList.push_back(new Hitbox()); this->moduleList.push_back(new Reach()); this->moduleList.push_back(new FullBright()); - this->moduleList.push_back(new AirSwim()); this->moduleList.push_back(new InventoryMove()); this->moduleList.push_back(new HighJump()); this->moduleList.push_back(new NoWeb()); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 58538c97..2e25a9a5 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -7,7 +7,6 @@ #include "../../Utils/Json.hpp" #include "Modules/Aimbot.h" #include "Modules/AirJump.h" -#include "Modules/AirSwim.h" #include "Modules/AntiBot.h" #include "Modules/AutoArmor.h" #include "Modules/AutoClicker.h" diff --git a/Horion/Module/Modules/AirSwim.cpp b/Horion/Module/Modules/AirSwim.cpp deleted file mode 100644 index 6a520f8c..00000000 --- a/Horion/Module/Modules/AirSwim.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "AirSwim.h" - -AirSwim::AirSwim() : IModule(0x0, Category::MOVEMENT, "Swim even though your in air") { -} - -AirSwim::~AirSwim() { -} - -const char* AirSwim::getModuleName() { - return ("AirSwim"); -} - -void AirSwim::onEnable() { - if (g_Data.getLocalPlayer() == nullptr) - return; - g_Data.getLocalPlayer()->didEnterWaterBool = true; - g_Data.getLocalPlayer()->startSwimming(); -} - -void AirSwim::onTick(C_GameMode* gm) { - g_Data.getLocalPlayer()->didEnterWaterBool = true; - g_Data.getLocalPlayer()->doWaterSplashEffect(); - g_Data.getLocalPlayer()->startSwimming(); -} - -void AirSwim::onDisable() { - if (g_Data.getLocalPlayer() == nullptr) - return; - g_Data.getLocalPlayer()->didEnterWaterBool = false; - g_Data.getLocalPlayer()->stopSwimming(); -} diff --git a/Horion/Module/Modules/AirSwim.h b/Horion/Module/Modules/AirSwim.h deleted file mode 100644 index 50c7d742..00000000 --- a/Horion/Module/Modules/AirSwim.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once -#include "Module.h" -class AirSwim : public IModule { -public: - AirSwim(); - ~AirSwim(); - - // Inherited via IModule - virtual const char* getModuleName() override; - virtual void onEnable() override; - virtual void onTick(C_GameMode* gm) override; - virtual void onDisable() override; -}; diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index c4474c28..2156be7a 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -64,7 +64,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { DrawUtils::drawText(textPos, &coordsZ, MC_Color(200, 200, 200), 1.f); } } - { // ArmorHUD + /*{ // ArmorHUD if (!(g_Data.getLocalPlayer() == nullptr || !this->displayArmor || !GameData::canUseMoveKeys())) { static float constexpr scale = 1.f; static float constexpr opacity = 0.25f; @@ -95,5 +95,5 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { DrawUtils::drawKeystroke(*input->rightKey, vec2_t(54, windowSize.y - 52)); DrawUtils::drawKeystroke(*input->spaceBarKey, vec2_t(10, windowSize.y - 30)); } - } + }*/ } \ No newline at end of file diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b5ee1545..88430a5e 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -47,8 +47,6 @@ void Hooks::Init() { if (localPlayerVtable == 0x0 || sigOffset == 0x0) logF("C_LocalPlayer signature not working!!!"); else { - g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[61], Hooks::Actor_isInWater); - g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[181], Hooks::Actor_startSwimming); g_Hooks.Actor_ladderUpHook = std::make_unique(localPlayerVtable[321], Hooks::Actor_ladderUp); @@ -128,9 +126,13 @@ void Hooks::Init() { //void* sendtoServer = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 ?? ?? ?? ?? ?? ?? 0F B6 41 ?? 48 8B FA 88 42 ?? 48 8D 54 24 ?? 48 8B 59 ?? 48 8B CB E8 ?? ?? ?? ?? 45 33 C9")); //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(sendtoServer, Hooks::LoopbackPacketSender_sendToServer); + uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); + g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); //void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 0F 29 74 24 ?? 0F 29 7C 24 ?? 44 0F 29 44 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ??")); //g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); + void* getFov = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ?? 0F 29 74 24 ? 0F 29 7C 24 ? 44 0F 29 44 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F 28 C1")); + g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); @@ -140,6 +142,8 @@ void Hooks::Init() { //void* renderLevel = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B D8 48 8B FA 48 8B F1 33 D2")); //g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); + void* renderLevel = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 56 41 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ? ? ? ?")); + g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 57 41 54 41 55 41 56 41 57 48 83 EC 60 44 ?? ?? ?? ?? ?? ?? ?? ?? 33 F6")); g_Hooks.ClickFuncHook = std::make_unique(clickHook, Hooks::ClickFunc); @@ -208,32 +212,32 @@ void Hooks::SurvivalMode_tick(C_GameMode* _this) { void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { static auto oSendMessage = g_Hooks.ChatScreenController_sendChatMessageHook->GetFastcall(); - using addCommandToChatHistory_t = void(__fastcall*)(__int64*, char*); + using addCommandToChatHistory_t = void(__fastcall*)(__int64, char*); static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? ?? 48 8B FA 48 8B D9 76 46 48 8B 41 ?? 48 89 74 24 ?? 33 F6")); - uintptr_t* textLength = reinterpret_cast(_this + 0x710); + uintptr_t* textLength = reinterpret_cast(_this + 0xA80); if (*textLength) { - char* message = reinterpret_cast(_this + 0x700); - if (*reinterpret_cast<__int64*>(_this + 0x718) >= 0x10) + char* message = reinterpret_cast(_this + 0xA70); + if (*reinterpret_cast<__int64*>(_this + 0xA88) >= 0x10) message = *reinterpret_cast(message); if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - __int64* a1 = (__int64*)(*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0x668) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0x668) + 0x20i64)); - addCommandToChatHistory(a1, (char*)(_this + 0x700)); // This will put the command in the chat history (Arrow up/down) + __int64 a1 = (*(__int64 (__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x970i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; - __int64* v15 = *(__int64**)(*(__int64*)(_this + 0x668) + 0x20i64); + __int64* v15 = *(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64); __int64 v16 = *v15; - if (*(BYTE*)(_this + 0x72A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x968))(v15); + if (*(BYTE*)(_this + 0xA9A)) + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x978))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x960))(v15); - *(DWORD*)(_this + 0x724) = *(DWORD*)(v17 + 0x20); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x970))(v15); + *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); - *reinterpret_cast<__int64*>(_this + 0x710) = 0i64; + *reinterpret_cast<__int64*>(_this + 0xA80) = 0i64; *message = 0x0; // Remove command in textbox *textLength = 0x0; // text length return; @@ -802,7 +806,8 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) static syncShit_t syncShit = nullptr; static __int64* winrt_ptr; if (syncShit == nullptr) { - uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 49 8B D6 FF 90 ?? 04"); // The 04 at the end might get invalid in the future + //uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 49 8B D6 FF 90 ?? 04"); // The 04 at the end might get invalid in the future + uintptr_t sigOffset = FindSignature("48 89 0D ? ? ? ? E8 ? ? ? ? B0 ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 83 C4"); int offset = *reinterpret_cast(sigOffset + 3); winrt_ptr = *reinterpret_cast<__int64**>(sigOffset + offset + 7); int vtOffset = *reinterpret_cast(sigOffset + 15); @@ -979,7 +984,9 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe float Hooks::LevelRendererPlayer_getFov(__int64 _this, float a2, bool a3) { static auto oGetFov = g_Hooks.LevelRendererPlayer_getFovHook->GetFastcall(); static void* renderItemInHand = reinterpret_cast(FindSignature("0F 28 F0 F3 44 0F 10 3D ?? ?? ?? ?? F3 41 0F 59 F7")); - static void* setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ?? ?? ?? ?? 41 0F B6 4E ??")); + + //static void* setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ?? ?? ?? ?? 41 0F B6 4E ??")); + static void* setupCamera = reinterpret_cast(FindSignature("0F 28 F8 F3 0F 59 3D ? ? ? ? 41 0F B6 4E ? 88 4C 24 ?? 44 0F B6 E1")); static auto zoomModule = moduleMgr->getModule(); @@ -1086,7 +1093,8 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) static auto oFunc = g_Hooks.LevelRenderer_renderLevelHook->GetFastcall<__int64, __int64, __int64, __int64>(); using reloadShit_t = void(__fastcall*)(__int64); - static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B F9 4C")); + //static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B F9 4C")); + static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 ?? EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ?? 48 89 68 ?? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9")); static auto xrayMod = moduleMgr->getModule(); @@ -1148,19 +1156,6 @@ __int64 Hooks::GetGamma(__int64 a1) { return oFunc(a1); } -bool Hooks::Actor_isInWater(C_Entity* _this) { - static auto oFunc = g_Hooks.Actor_isInWaterHook->GetFastcall(); - - if (g_Data.getLocalPlayer() != _this) - return oFunc(_this); - - static auto airSwimModule = moduleMgr->getModule(); - if (airSwimModule->isEnabled()) - return true; - - return oFunc(_this); -} - void Hooks::JumpPower(C_Entity* a1, float a2) { static auto oFunc = g_Hooks.JumpPowerHook->GetFastcall(); static auto highJumpMod = moduleMgr->getModule(); diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 43d39ef0..d6f099c0 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -68,7 +68,6 @@ class Hooks { static __int64 MoveInputHandler_tick(C_MoveInputHandler* _this, C_Entity* a2); static __int64 ChestScreenController_tick(C_ChestScreenController* _this); static __int64 GetGamma(__int64 a1); - static bool Actor_isInWater(C_Entity* _this); static void JumpPower(C_Entity* _this, float a2); static __int64 MinecraftGame_onAppSuspended(__int64 _this); static void Actor_ladderUp(C_Entity* _this); @@ -107,7 +106,6 @@ class Hooks { std::unique_ptr MoveInputHandler_tickHook; std::unique_ptr ChestScreenController_tickHook; std::unique_ptr GetGammaHook; - std::unique_ptr Actor_isInWaterHook; std::unique_ptr JumpPowerHook; std::unique_ptr MinecraftGame_onAppSuspendedHook; std::unique_ptr Actor_ladderUpHook; diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 7e0b1eeb..385e154d 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -15,9 +15,9 @@ class Minecraft { class LevelRenderer { private: - char pad_0x0000[0x860]; //0x0000 + char pad_0x0000[0x870]; //0x0000 public: - vec3_t origin; //0x0860 + vec3_t origin; //0x0870 }; class HitDetectSystem; @@ -109,7 +109,7 @@ class C_GuiData { } void displayClientMessage(std::string* a2) { using displayClientMessage = void(__thiscall*)(void*, TextHolder); // This signature actually exists 2 times but we got luck that our function is the first in memory - static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("4C 8B DC 53 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 48 8B D9 49 ?? ?? ?? ?? ?? ?? ?? 33 C0 49 89 43 D8 41 88 43 C8 49")); + static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("4C 8B DC 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 49 C7 43 ? ? ? ? ? 33 C0 49 89 43 ?? 41 88 43 ?? 49 C7 43")); TextHolder text = TextHolder(*a2); @@ -709,19 +709,19 @@ class C_ClientInstance { glmatrixf* getRefDef() { uintptr_t _this = reinterpret_cast(this); //logF("refderf %llX", _this + 0x258); - return reinterpret_cast(_this + 0x298); + return reinterpret_cast(_this + 0x2E8); }; vec2_t* getMousePos() { uintptr_t _this = reinterpret_cast(this); - return reinterpret_cast(_this + 0x400); + return reinterpret_cast(_this + 0x450); } vec2_t getFov() { uintptr_t _this = reinterpret_cast(this); vec2_t fov; - fov.x = *reinterpret_cast(_this + 0x600); - fov.y = *reinterpret_cast(_this + 0x614); + fov.x = *reinterpret_cast(_this + 0x650); + fov.y = *reinterpret_cast(_this + 0x664); return fov; } diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 71badb6c..1743d979 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -43,85 +43,80 @@ class C_Entity { public: vec3_t eyePos0; //0x0110 private: - char pad_0x11C[0x5C]; //0x11C + char pad_0x11C[0x70]; //0x11C public: - bool onGround; //0x0178 + float fallDistance; //0x18C + bool onGround; //0x0190 private: - char pad_0x179[0x1B]; //0x179 -public: - float fallDistance; //0x194 -private: - char pad_0x198[0x7C]; //0x0198 + char pad_0x179[0x83]; //0x191 public: float spectatorMode; //0x0214 + float stepHeight; //0x218 private: - char pad_0x218[0x8]; //0x218 + char pad_0x228[0x10]; //0x21C public: - float stepHeight; //0x0220 + float web; //0x022C private: - char pad_0x228[0x14]; //0x224 + char pad_0x23C[0x5]; //0x0230 public: - float web; //0x0238 + bool didEnterWaterBool; //0x0235 private: - char pad_0x23C[0x1]; //0x023C + char pad_023E[0x4E]; //0x0236 public: - bool didEnterWaterBool; //0x023D + int ticksAlive; //0x0284 private: - char pad_023E[0x4E]; //0x023E + char pad_0290[0xB0]; //0x0288 public: - int ticksAlive; //0x028C + C_BlockSource *region; //0x338 private: - char pad_0290[0xB8]; //0x0290 + char pad_0x350[0xE0]; //0x340 public: - C_BlockSource *region; //0x348 + AABB aabb; //0x0420 private: - char pad_0x350[0xE0]; //0x350 + char pad_0x448[0x4]; //0x0438 public: - AABB aabb; //0x0430 + float width; //0x043C + float height; //0x0440 + vec3_t currentPos; //0x0444 + vec3_t oldPos; //0x0450 + vec3_t velocity; //0x045C private: - char pad_0x448[0x4]; //0x0448 + char pad_0x0478[0x58]; //0x468 public: - float width; //0x044C - float height; //0x0450 - vec3_t currentPos; //0x0454 - vec3_t oldPos; //0x0460 - vec3_t velocity; //0x046C + __int64 entityRuntimeId; //0x4C0 //4B8 private: - char pad_0x0478[0x58]; //0x478 + char pad_0478[0x120]; //0x04C8 public: - __int64 entityRuntimeId; //0x4D0 + float bodyYaw; //0x05E8 + float oldBodyYaw; //0x05EC + float yawUnused1; //0x05F0 + float yawUnused2; //0x05F4 + int damageTime; //0x05F8 private: - char pad_0478[0x338]; //0x04D8 + char pad_0824[0x88]; //0x05FC public: - float bodyYaw; //0x0810 - float oldBodyYaw; //0x0814 - float yawUnused1; //0x0818 - float yawUnused2; //0x081C - int damageTime; //0x0820 + int timeSinceDeath; //0x0684 private: - char pad_0824[0x88]; //0x0824 + char pad_08B0[0x1E0]; //0x0688 public: - int timeSinceDeath; //0x08AC + bool canFly; //0x0868 private: - char pad_08B0[0x1E0]; //0x08B0 + char pad_0x0A95[0x61F]; //0x0869 public: - bool canFly; //0x0A90 -private: - char pad_0x0A95[0x62F]; //0x0A91 - int16_t itemData; //0x10C0 - int16_t itemId; //0x10C2 + int16_t itemData; //0x0E88 + int16_t itemId; //0x0E8A private: - char pad_10CC[0x1FC]; //0x10C4 + char pad_10CC[0x1FC]; //0x0E8C public: - C_InventoryTransactionManager transac; //0x12C0 + C_InventoryTransactionManager transac; //0x1088 private: - char pad_0x1324[0xA6C]; //0x1324 + char pad_0x1324[0xA80]; //0x10EC public: - int gamemode; //0x1D94 + int gamemode; //0x1B6C private: - char pad_1DA4[0x198]; //0x1D98 + char pad_1DA4[0x198]; //0x1B70 public: - TextHolder uuid; //0x1F30 + TextHolder uuid; //0x1D08 public: virtual bool hasComponent(__int64 const &) const; @@ -341,8 +336,8 @@ class C_Entity { virtual __int64 consumeTotem(void); public: - virtual __int64 save(CompoundTag*); - virtual __int64 saveWithoutId(CompoundTag*); + virtual __int64 save(CompoundTag *); + virtual __int64 saveWithoutId(CompoundTag *); private: virtual __int64 load(__int64 const &, __int64 &); @@ -664,7 +659,7 @@ class C_Entity { return &this->aabb; } - __int64* getUniqueId() { + __int64 *getUniqueId() { uintptr_t _this = reinterpret_cast(this); __int64 *result; // rax __int64 v2; // rcx @@ -676,7 +671,6 @@ class C_Entity { } return result; } - }; class C_ServerPlayer; @@ -686,12 +680,11 @@ class C_Player : public C_Entity { C_PlayerInventoryProxy *getSupplies() { static unsigned int offset = 0; if (offset == 0) { - offset = *reinterpret_cast(FindSignature("4C 8B 82 ?? ?? ?? ?? 48 8B B2") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + offset = *reinterpret_cast(FindSignature("4C 8B 8A ? ? ? ? 41 80 B9 ? ? ? ? ? 75 18 49 8B 89 ? ? ? ? 41 8B 51") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies } return *reinterpret_cast(reinterpret_cast<__int64>(this) + offset); }; - C_ItemStack *getSelectedItem() { auto supplies = this->getSupplies(); return supplies->inventory->getItemStack(supplies->selectedHotbarSlot); @@ -858,7 +851,6 @@ class C_ServerPlayer : public C_Player { class C_LocalPlayer : public C_Player { public: - void unlockAchievments() { // MinecraftEventing::fireEventAwardAchievement using fireEventAward = void(__fastcall *)(void *, int); static fireEventAward fireEventAwardFunc = reinterpret_cast(FindSignature("48 85 C9 0F 84 ?? ?? ?? ?? 55 56 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 8B")); diff --git a/SDK/CInventory.h b/SDK/CInventory.h index f65ac37f..5103419a 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -55,13 +55,9 @@ class C_PlayerInventoryProxy { public: int selectedHotbarSlot; //0x0010 private: - char pad_0x0014[0x8C]; //0x0014 + char pad_0x0014[0x9C]; //0x0014 public: - uint8_t holdingItem; //0x00A0 -private: - char pad_0x00A1[0x7]; //0x00A1 -public: - C_Inventory* inventory; //0x00A8 + C_Inventory* inventory; //0x00B0 }; class C_ContainerScreenController { diff --git a/SDK/Tag.h b/SDK/Tag.h index 2a5d5288..0a584fd8 100644 --- a/SDK/Tag.h +++ b/SDK/Tag.h @@ -454,7 +454,7 @@ class ListTag : public Tag { void add(std::unique_ptr tag) { using ListTag__add_t = void(__fastcall*)(ListTag*, std::unique_ptr); - ListTag__add_t func = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 48 8B 0A 48 8B 01 FF 50")); + static ListTag__add_t func = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 48 8B 0A 48 8B 01 FF 50")); func(this, std::move(tag)); } @@ -537,13 +537,13 @@ class CompoundTag : public Tag { CompoundTag() { memset(this, 0, sizeof(CompoundTag)); using constructor_t = void(__fastcall*)(CompoundTag*); - constructor_t func = reinterpret_cast(FindSignature("48 89 4C 24 ?? 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B F9 48 8D 05 ?? ?? ?? ?? 48 89 01 48 8D 59")); + static constructor_t func = reinterpret_cast(FindSignature("48 89 4C 24 ?? 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B F9 48 8D 05 ?? ?? ?? ?? 48 89 01 48 8D 59")); func(this); } void put(TextHolder& tag, std::unique_ptr value) { - using put_t = void(__fastcall*)(CompoundTag*, TextHolder&, std::unique_ptr); - static put_t func = reinterpret_cast(FindSignature("4C 8B DC 53 56 57 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 49 8B F8 48 8B DA 49 89 53 ?? 4D 89 43 ?? 49 8B 30 48 85 F6")); + using CompoundTag__putF = void(__fastcall*)(CompoundTag*, TextHolder&, std::unique_ptr); + static CompoundTag__putF func = reinterpret_cast(FindSignature("4C 8B DC 53 56 57 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 49 8B F8 48 8B DA 49 89 53 ?? 4D 89 43 ?? 49 8B 30 48 85 F6")); func(this, tag, std::move(value)); } From 21df31105ca3eaca8b1cd73bf0e2926dc88ad0ad Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 21 Jun 2020 21:22:02 -0400 Subject: [PATCH 003/419] fix painting not rendering --- Horion.vcxproj | 2 ++ Horion.vcxproj.filters | 10 ++-------- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/NoPaintingCrash.cpp | 11 +++++++++++ Horion/Module/Modules/NoPaintingCrash.h | 10 ++++++++++ Memory/Hooks.cpp | 11 +++++++++-- Memory/Hooks.h | 2 +- 8 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 Horion/Module/Modules/NoPaintingCrash.cpp create mode 100644 Horion/Module/Modules/NoPaintingCrash.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 1d8f9dbd..c51e4a63 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -330,6 +330,7 @@ + @@ -510,6 +511,7 @@ + diff --git a/Horion.vcxproj.filters b/Horion.vcxproj.filters index 59595ecc..9b5afa18 100644 --- a/Horion.vcxproj.filters +++ b/Horion.vcxproj.filters @@ -467,16 +467,13 @@ - - - @@ -510,7 +507,6 @@ - @@ -6550,6 +6546,7 @@ + @@ -7062,16 +7059,13 @@ - - - @@ -7104,7 +7098,6 @@ - @@ -12809,6 +12802,7 @@ + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 8df7978f..af4fb8fe 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -94,6 +94,7 @@ void ModuleManager::initModules() { //this->moduleList.push_back(std::shared_ptr(new AutoSneak())); broken this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); + this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); #if defined(_BETA) or defined(_DEBUG) this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 315d6849..26fc127b 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -88,6 +88,7 @@ #include "Modules/NoHurtcam.h" #include "Modules/AntiImmobile.h" #include "Modules/FollowPathModule.h" +#include "Modules/NoPaintingCrash.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/NoPaintingCrash.cpp b/Horion/Module/Modules/NoPaintingCrash.cpp new file mode 100644 index 00000000..aa45a132 --- /dev/null +++ b/Horion/Module/Modules/NoPaintingCrash.cpp @@ -0,0 +1,11 @@ +#include "NoPaintingCrash.h" + +NoPaintingCrash::NoPaintingCrash() : IModule(0x0, Category::MISC, "Fix Painting crash when using mob spawner !") { +} + +NoPaintingCrash::~NoPaintingCrash() { +} + +const char* NoPaintingCrash::getModuleName() { + return ("NoPaintingCrash"); +} diff --git a/Horion/Module/Modules/NoPaintingCrash.h b/Horion/Module/Modules/NoPaintingCrash.h new file mode 100644 index 00000000..2283df94 --- /dev/null +++ b/Horion/Module/Modules/NoPaintingCrash.h @@ -0,0 +1,10 @@ +#pragma once +#include "Module.h" +class NoPaintingCrash : public IModule { +public: + NoPaintingCrash(); + ~NoPaintingCrash(); + + // Inherited via IModule + virtual const char* getModuleName() override; +}; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 19027c2e..fbeceb77 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1513,8 +1513,15 @@ void Hooks::InventoryTransactionManager_addAction(C_InventoryTransactionManager* Func(a1, a2); } -void Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { - return; +__int64 Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { + static auto Func = g_Hooks.PaintingRenderer__renderHook->GetFastcall<__int64, __int64, __int64, __int64>(); + + static auto NoPaintingCrashMod = moduleMgr->getModule(); + if (NoPaintingCrashMod->isEnabled()) { + return 0; + } + + return Func(_this,a2,a3); } bool Hooks::DirectoryPackAccessStrategy__isTrusted(__int64 _this) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 5b2e2bbb..68ea1790 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -111,7 +111,7 @@ class Hooks { static __int64 GameMode_attack(C_GameMode* _this, C_Entity*); static __int64 ConnectionRequest_create(__int64 _this, __int64 privateKeyManager, void* a3, TextHolder* selfSignedId, TextHolder* serverAddress, __int64 clientRandomId, TextHolder* skinId, SkinData* skinData, __int64 capeData, CoolSkinData* coolSkinStuff, TextHolder* deviceId, int inputMode, int uiProfile, int guiScale, TextHolder* languageCode, bool sendEduModeParams, TextHolder* tenantId, __int64 unused, TextHolder* platformUserId, TextHolder* thirdPartyName, bool thirdPartyNameOnly, TextHolder* platformOnlineId, TextHolder* platformOfflineId, TextHolder* capeId); static void InventoryTransactionManager_addAction(C_InventoryTransactionManager* a1, C_InventoryAction* a2); - static void PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3); + static __int64 PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3); static bool DirectoryPackAccessStrategy__isTrusted(__int64 _this); static bool ReturnTrue(__int64 _this); static __int64 SkinRepository___loadSkinPack(__int64 _this, __int64 pack, __int64 a3); From cca86b00c3598d4c9f8237cfd7c6157393eab323 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 21 Jun 2020 21:23:46 -0400 Subject: [PATCH 004/419] yes --- Memory/Hooks.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index fbeceb77..67c88826 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1517,9 +1517,8 @@ __int64 Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { static auto Func = g_Hooks.PaintingRenderer__renderHook->GetFastcall<__int64, __int64, __int64, __int64>(); static auto NoPaintingCrashMod = moduleMgr->getModule(); - if (NoPaintingCrashMod->isEnabled()) { + if (NoPaintingCrashMod->isEnabled()) return 0; - } return Func(_this,a2,a3); } From 0a1efae1de9ba3863e934d3ec16c2b517382b284 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Mon, 22 Jun 2020 15:11:24 +0200 Subject: [PATCH 005/419] Fix sigs --- Horion.vcxproj | 62 +- Horion.vcxproj.filters | 4338 +--------------------------------------- Memory/GameData.cpp | 8 +- Memory/Hooks.cpp | 10 +- SDK/CClientInstance.h | 21 +- 5 files changed, 140 insertions(+), 4299 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 26b13f79..f712eae0 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -201,7 +201,36 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -298,7 +327,36 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Horion.vcxproj.filters b/Horion.vcxproj.filters index 60b3213b..f914c079 100644 --- a/Horion.vcxproj.filters +++ b/Horion.vcxproj.filters @@ -16,33 +16,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,779 +941,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1803,1082 +1005,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2954,78 +1087,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3070,33 +1162,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3631,1331 +1697,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5023,932 +1767,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6024,78 +1851,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index f475d1e5..83fb453f 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -5,21 +5,19 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; if (clientInstanceOffset == 0x0) { - uintptr_t sigOffset = FindSignature("4C 89 35 ?? ?? ?? ?? 48 8B 5C 24 ?? 48 8B 6C 24 ?? 48 83 C4 ??"); + uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } } - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x30})); + + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x78, 0x160})); #ifdef _DEBUG if (g_Data.clientInstance == 0) throw std::exception("Client Instance is 0"); #endif - - // 4C 8B F8 48 8B 0D ?? ?? ?? ?? 48 8B 11 - // 1.11.1 : 0x0250A2D0 } TextHolder* GameData::getGameVersion() { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 88430a5e..863b6db3 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -112,8 +112,9 @@ void Hooks::Init() { //void* sunLightIntensity = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B B9 ?? ?? ?? ?? 49 8B D8 0F")); - void* ChestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0 75 10 48 8D 51 ?? 48 8B CF E8 ?? ?? ?? ?? 48 89 43 ?? FF 43 ?? 48 85 C0")); - g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); + logF("ChestBlockActor_tickHook dead"); + //void* ChestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0 75 10 48 8D 51 ?? 48 8B CF E8 ?? ?? ?? ?? 48 89 43 ?? FF 43 ?? 48 85 C0")); + //g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -163,8 +164,8 @@ void Hooks::Init() { //void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 48 8B F1 80 B9 ?? ?? ?? ?? ?? 74 51 C6 81 ?? ?? ?? ?? ?? 66 ?? ?? ?? ?? ?? ?? ?? 74 40 48 8D 45")); //g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); - void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D ?? ?? ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 ?? ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B D9 4C")); - g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); + //void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D ?? ?? ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 ?? ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B D9 4C")); + //g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); @@ -277,6 +278,7 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { static auto oText = g_Hooks.RenderTextHook->GetFastcall<__int64, __int64, C_MinecraftUIRenderContext*>(); C_GuiData* dat = g_Data.getClientInstance()->getGuiData(); + DrawUtils::setCtx(renderCtx, dat); { diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 385e154d..0fa8ea1d 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -36,24 +36,21 @@ struct C_FontRepository_FontList { struct C_FontRepository { private: - uintptr_t* shared_ptr_vtable; // 0x0000 - int idk1; // 0x0008 - int idk2; // 0x000C - uintptr_t* font_repository_vtable; // 0x0010 - void* appPlatform; // 0x0018 - void* ptrToSelf; // 0x0020 - void* ptrToSelfSharedPtr; // 0x0028 - __int64 unknown; // 0x0030 -public: - C_FontRepository_FontList* fontList; //0x0038 + uintptr_t* font_repository_vtable; // 0x0000 + __int64 pad; // 0x0008 + void* ptrToSelf; // 0x0010 + void* ptrToSelfSharedPtr; // 0x0018 + __int64 pad2; // 0x0020 +public: + C_FontRepository_FontList* fontList; //0x0028 //C_FontRepository_FontList* fontList1; //0x0040 }; class MinecraftGame { private: - char filler[0x130]; //0x0000 + char filler[0x140]; //0x0000 public: - C_FontRepository* fontRepository; //0x130 + C_FontRepository* fontRepository; //0x140 private: char pad_0x128[0xF0]; //0x138 public: From febec7df6fe5cee73aa8020a910da5ccb41cf676 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Mon, 22 Jun 2020 15:37:19 +0200 Subject: [PATCH 006/419] Crashless main menu --- Horion.vcxproj | 2 + Horion.vcxproj.filters | 12828 -------------------- Horion/DrawUtils.cpp | 10 - Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/AirSwim.cpp | 31 + Horion/Module/Modules/AirSwim.h | 14 + Horion/Module/Modules/NoPaintingCrash.cpp | 11 + Horion/Module/Modules/NoPaintingCrash.h | 10 + Memory/GameData.h | 3 +- Memory/Hooks.cpp | 18 +- Memory/Hooks.h | 2 + SDK/CClientInstance.cpp | 2 +- SDK/CEntity.h | 6 +- 13 files changed, 90 insertions(+), 12848 deletions(-) delete mode 100644 Horion.vcxproj.filters create mode 100644 Horion/Module/Modules/AirSwim.cpp create mode 100644 Horion/Module/Modules/AirSwim.h create mode 100644 Horion/Module/Modules/NoPaintingCrash.cpp create mode 100644 Horion/Module/Modules/NoPaintingCrash.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 1d8f9dbd..c51e4a63 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -330,6 +330,7 @@ + @@ -510,6 +511,7 @@ + diff --git a/Horion.vcxproj.filters b/Horion.vcxproj.filters deleted file mode 100644 index 59595ecc..00000000 --- a/Horion.vcxproj.filters +++ /dev/null @@ -1,12828 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 3dcd82ec..8e87ff2f 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -23,11 +23,6 @@ vec2_t screenSize; vec3_t origin; float lerpT; C_TexturePtr* texturePtr = nullptr; -struct BaseActorRenderContext { - char pad[0x280]{}; -} ourActorContext; - -using baseActorRenderContext_constructor = BaseActorRenderContext*(__fastcall*)(BaseActorRenderContext* _this, __int64 screenContext, C_ClientInstance*, MinecraftGame*); static MaterialPtr* uiMaterial = nullptr; static MaterialPtr* entityFlatStaticMaterial = nullptr; @@ -76,11 +71,6 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { if(entityFlatStaticMaterial == nullptr && g_Data.isInGame()){ entityFlatStaticMaterial = reinterpret_cast(g_Data.getClientInstance()->itemInHandRenderer->entityLineMaterial.materialPtr); } - static auto actorCtxConstructor = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 49 8B D8 48 89 01 48 8B F9 8B")); - - memset(&ourActorContext, 0, sizeof(BaseActorRenderContext)); - actorCtxConstructor(&ourActorContext, reinterpret_cast<__int64>(renderCtx), g_Data.getClientInstance(), g_Data.getClientInstance()->minecraftGame); - } void DrawUtils::setColor(float r, float g, float b, float a) { diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 5fa9a698..315d6849 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -11,6 +11,7 @@ #include "Modules/Aimbot.h" #include "Modules/AirJump.h" +#include "Modules/AirSwim.h" #include "Modules/AntiBot.h" #include "Modules/AutoArmor.h" #include "Modules/AutoClicker.h" diff --git a/Horion/Module/Modules/AirSwim.cpp b/Horion/Module/Modules/AirSwim.cpp new file mode 100644 index 00000000..584d14b7 --- /dev/null +++ b/Horion/Module/Modules/AirSwim.cpp @@ -0,0 +1,31 @@ +#include "AirSwim.h" + +AirSwim::AirSwim() : IModule(0x0, Category::MOVEMENT, "Swim even though your in air") { +} + +AirSwim::~AirSwim() { +} + +const char* AirSwim::getModuleName() { + return ("AirSwim"); +} + +void AirSwim::onEnable() { + if (g_Data.getLocalPlayer() == nullptr) + return; + g_Data.getLocalPlayer()->didEnterWaterBool = true; + g_Data.getLocalPlayer()->startSwimming(); +} + +void AirSwim::onTick(C_GameMode* gm) { + g_Data.getLocalPlayer()->didEnterWaterBool = true; + g_Data.getLocalPlayer()->doWaterSplashEffect(); + g_Data.getLocalPlayer()->startSwimming(); +} + +void AirSwim::onDisable() { + if (g_Data.getLocalPlayer() == nullptr) + return; + g_Data.getLocalPlayer()->didEnterWaterBool = false; + g_Data.getLocalPlayer()->stopSwimming(); +} \ No newline at end of file diff --git a/Horion/Module/Modules/AirSwim.h b/Horion/Module/Modules/AirSwim.h new file mode 100644 index 00000000..8cd45306 --- /dev/null +++ b/Horion/Module/Modules/AirSwim.h @@ -0,0 +1,14 @@ +#pragma once +#include "Module.h" + +class AirSwim : public IModule { +public: + AirSwim(); + ~AirSwim(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onEnable() override; + virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; +}; \ No newline at end of file diff --git a/Horion/Module/Modules/NoPaintingCrash.cpp b/Horion/Module/Modules/NoPaintingCrash.cpp new file mode 100644 index 00000000..4f36765f --- /dev/null +++ b/Horion/Module/Modules/NoPaintingCrash.cpp @@ -0,0 +1,11 @@ +#include "NoPaintingCrash.h" + +NoPaintingCrash::NoPaintingCrash() : IModule(0x0, Category::MISC, "Fix Painting crash when using mob spawner !") { +} + +NoPaintingCrash::~NoPaintingCrash() { +} + +const char* NoPaintingCrash::getModuleName() { + return ("NoPaintingCrash"); +} \ No newline at end of file diff --git a/Horion/Module/Modules/NoPaintingCrash.h b/Horion/Module/Modules/NoPaintingCrash.h new file mode 100644 index 00000000..69ad7dd1 --- /dev/null +++ b/Horion/Module/Modules/NoPaintingCrash.h @@ -0,0 +1,10 @@ +#pragma once +#include "Module.h" +class NoPaintingCrash : public IModule { +public: + NoPaintingCrash(); + ~NoPaintingCrash(); + + // Inherited via IModule + virtual const char* getModuleName() override; +}; \ No newline at end of file diff --git a/Memory/GameData.h b/Memory/GameData.h index 1f056c96..c8d96d4d 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -221,8 +221,7 @@ class GameData { localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); #else - localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + 0xF0); - //localPlayer = clientInstance->getLocalPlayer(); + localPlayer = clientInstance->localPlayer; #endif diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3a3de5eb..1f221faf 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -282,8 +282,8 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 48 8B 89")); - g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); + //void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 48 8B 89")); + //g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags,Hooks::LevelRendererPlayer__renderNameTags); @@ -482,6 +482,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { #if defined(_BETA) or defined(_DEBUG) // Draw Custom Geo Button if (g_Data.allowWIPFeatures()) { + logF("%llX", g_Data.getClientInstance()->getGuiData()); if (HImGui.Button("Load Script Folder", vec2_t(wid.x * (0.765f - 0.5f), wid.y * 0.92f), true)) { HorionDataPacket packet; packet.cmd = CMD_FOLDERCHOOSER; @@ -1344,6 +1345,19 @@ __int64 Hooks::GetGamma(__int64 a1) { return oFunc(a1); } +bool Hooks::Actor_isInWater(C_Entity* _this) { + static auto oFunc = g_Hooks.Actor_isInWaterHook->GetFastcall(); + + if (g_Data.getLocalPlayer() != _this) + return oFunc(_this); + + static auto airSwimModule = moduleMgr->getModule(); + if (airSwimModule->isEnabled()) + return true; + + return oFunc(_this); +} + void Hooks::JumpPower(C_Entity* a1, float a2) { static auto oFunc = g_Hooks.JumpPowerHook->GetFastcall(); static auto highJumpMod = moduleMgr->getModule(); diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 95ac3b41..5b2e2bbb 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -101,6 +101,7 @@ class Hooks { static __int64 MoveInputHandler_tick(C_MoveInputHandler* _this, C_Entity* a2); static __int64 ChestScreenController_tick(C_ChestScreenController* _this); static __int64 GetGamma(__int64 a1); + static bool Actor_isInWater(C_Entity* _this); static void JumpPower(C_Entity* _this, float a2); static __int64 MinecraftGame_onAppSuspended(__int64 _this); static void Actor_ascendLadder(C_Entity* _this); @@ -151,6 +152,7 @@ class Hooks { std::unique_ptr MoveInputHandler_tickHook; std::unique_ptr ChestScreenController_tickHook; std::unique_ptr GetGammaHook; + std::unique_ptr Actor_isInWaterHook; std::unique_ptr JumpPowerHook; std::unique_ptr MinecraftGame_onAppSuspendedHook; std::unique_ptr Actor_ascendLadderHook; diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index c301e1d4..90d511dd 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -8,7 +8,7 @@ __int64 MinecraftGame::getServerEntries() { } void C_GuiData::displayClientMessage(std::string *a2) { using displayClientMessage = void(__thiscall*)(void*, TextHolder); // This signature actually exists 2 times but we got luck that our function is the first in memory - static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("4C 8B DC 53 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 48 8B D9 49 ?? ?? ?? ?? ?? ?? ?? 33 C0 49 89 43 D8 41 88 43 C8 49")); + static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("4C 8B DC 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 33 C0 49 89 43 D8 41 88 43 C8 49")); TextHolder text = TextHolder(*a2); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index cf9b321d..99120e4e 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -75,7 +75,7 @@ class C_Entity { public: C_BlockSource *region; //0x338 private: - char pad_0x350[0xE0]; //0x340 + char pad_0x340[0xE0]; //0x340 public: AABB aabb; //0x0458 float width; //0x0474 @@ -83,10 +83,6 @@ class C_Entity { vec3_t currentPos; //0x047C vec3_t oldPos; //0x0488 vec3_t velocity; //0x0494 -private: - char pad_0x350[0xE0]; //0x350 -public: - AABB aabb; //0x0430 private: char pad_0x0478[0x58]; //0x468 public: From 4a0017d3d1e15d53daa3d6e1bc962d10872f0e12 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 18:39:44 +0200 Subject: [PATCH 007/419] Fix that --- Memory/Hooks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1f221faf..28ce8065 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -259,8 +259,9 @@ void Hooks::Init() { void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 C7 85 ?? ?? ?? ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F2")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); - void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); - g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); + // relies on connectionrequest__create + //void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); + //g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49")); g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); From fa05bb0acf5fa6a2a87032236bfa80bb913c2340 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 18:42:15 +0200 Subject: [PATCH 008/419] Get ingame --- Memory/GameData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index a1472635..38e0a95f 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -109,8 +109,8 @@ void GameData::updateGameData(C_GameMode* gameMode) { if (g_Data.localPlayer != nullptr) { C_GuiData* guiData = g_Data.clientInstance->getGuiData(); - - if (guiData != nullptr) { + logF("%llX", guiData); + if (guiData != nullptr && false) { { auto vecLock = Logger::GetTextToPrintLock(); auto* stringPrintVector = Logger::GetTextToPrint(); From a8b8d816891829b0067045367e6258c355406481 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 19:02:48 +0200 Subject: [PATCH 009/419] Chat messages --- Memory/GameData.cpp | 4 ++-- SDK/CClientInstance.h | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 38e0a95f..6134af0b 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -109,8 +109,8 @@ void GameData::updateGameData(C_GameMode* gameMode) { if (g_Data.localPlayer != nullptr) { C_GuiData* guiData = g_Data.clientInstance->getGuiData(); - logF("%llX", guiData); - if (guiData != nullptr && false) { + + if (guiData != nullptr) { { auto vecLock = Logger::GetTextToPrintLock(); auto* stringPrintVector = Logger::GetTextToPrint(); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 0361fdc3..f3e12776 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -409,7 +409,6 @@ class C_ClientInstance { virtual bool isInMultiplayerGame(void) const; virtual bool isMultiC_PlayerClient(void) const; -private: virtual __int64 getOptions(void); virtual __int64 getOptions(void) const; virtual __int64 getOptionsPtr(void); @@ -453,11 +452,10 @@ class C_ClientInstance { public: virtual void setUICursorTexture(__int64); -private: virtual __int64 getUICursorTexture(void) const; virtual __int64 getCamera(void); virtual __int64 getShaderColor(void); - virtual __int64 getDarkShaderColor(void); + //virtual __int64 getDarkShaderColor(void); virtual __int64 clearGraphicsCache(void); virtual __int64 getNormalizedUICursorTransform(__int64&, float); virtual __int64 shouldRenderUICursor(void) const; From db5c3de2ee43334d582d60e3bf4dd951b25fb428 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 19:27:13 +0200 Subject: [PATCH 010/419] Update some entity stuff --- Memory/Hooks.cpp | 2 +- SDK/CEntity.h | 41 ++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 28ce8065..dd8c4506 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -963,7 +963,7 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) static __int64* winrt_ptr; if (syncShit == nullptr) { //uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 49 8B D6 FF 90 ?? 04"); // The 04 at the end might get invalid in the future - uintptr_t sigOffset = FindSignature("48 89 0D ? ? ? ? E8 ? ? ? ? B0 ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 83 C4"); + uintptr_t sigOffset = FindSignature("48 89 0D ?? ?? ?? ?? E8 ? ? ? ? B0 ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 83 C4"); int offset = *reinterpret_cast(sigOffset + 3); winrt_ptr = *reinterpret_cast<__int64**>(sigOffset + offset + 7); int vtOffset = *reinterpret_cast(sigOffset + 15); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 99120e4e..c11fa468 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -27,53 +27,52 @@ class C_Entity { public: uintptr_t *ptrToPtrToEntList; //0x0008 private: - char pad_0010[0xE0]; //0x0010 + char pad_0010[0xF0]; //0x0010 public: union { struct { - float pitch; //0x00F0 - float yaw; //0x00F4 + float pitch; //0x0100 + float yaw; //0x0104 }; vec2_t viewAngles; }; union { struct { - float pitch2; //0x00F0 - float yaw2; //0x00F4 + float pitch2; + float yaw2; }; vec2_t viewAngles2; }; private: - char pad_0100[0x10]; //0x0100 + char pad_0100[0x10]; //0x0110 public: - vec3_t eyePos0; //0x0110 + vec3_t eyePos0; //0x0120 private: - char pad_0x11C[0x70]; //0x11C + char pad_0x11C[0x70]; //0x12C public: - float fallDistance; //0x18C - bool onGround; //0x0190 + float fallDistance; //0x19C + bool onGround; //0x01A0 private: - char pad_0x179[0x83]; //0x191 + char pad_0x179[0x5F]; //0x1A1 public: - float spectatorMode; //0x0214 - float stepHeight; //0x218 + float stepHeight; //0x200 private: - char pad_0x228[0x10]; //0x21C + char pad_0x228[0x10]; //0x204 public: - float web; //0x022C + float web; //0x0214 private: - char pad_0x23C[0x5]; //0x0230 + char pad_0x23C[0x5]; //0x0218 public: - bool didEnterWaterBool; //0x0235 + bool didEnterWaterBool; //0x021D private: - char pad_023E[0x4E]; //0x0236 + char pad_023E[0x4E]; //0x021E public: - int ticksAlive; //0x0284 + int ticksAlive; //0x026C private: - char pad_0290[0xB0]; //0x0288 + char pad_0290[0xB0]; //0x0270 public: - C_BlockSource *region; //0x338 + C_BlockSource *region; //0x320 private: char pad_0x340[0xE0]; //0x340 public: From ad2b1df0b7f1c6e5fda48c42cb84dd011978600a Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 23 Jun 2020 14:06:10 -0400 Subject: [PATCH 011/419] fix guidata --- SDK/CClientInstance.h | 1 - 1 file changed, 1 deletion(-) diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index f3e12776..026e2ee1 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -461,7 +461,6 @@ class C_ClientInstance { virtual __int64 shouldRenderUICursor(void) const; virtual bool sub_1400CD3B0(void); virtual bool sub_1400CD3B1(void); - virtual __int64 onLatencyUpdated(__int64 const&); virtual __int64 getGuiScale(void) const; virtual __int64 getGuiScaleOption(void) const; virtual __int64 getGuiScaleOffset(void) const; From ace0228ddb12812f2bc3fb9853bec362feca5842 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 20:24:37 +0200 Subject: [PATCH 012/419] Fix Entity Class --- SDK/CClientInstance.h | 4 +-- SDK/CEntity.h | 63 ++++++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index f3e12776..54538abf 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -56,9 +56,9 @@ class MinecraftGame { public: C_FontRepository* fontRepository; //0x140 private: - char pad_0x128[0xF0]; //0x138 + char pad_0x128[0x108]; //0x148 public: - bool canUseKeys; //0x228 + bool canUseKeys; //0x250 C_Font* getTheGoodFontThankYou() { return fontRepository->fontList->fontEntries[7].font; diff --git a/SDK/CEntity.h b/SDK/CEntity.h index c11fa468..33b13aed 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -74,7 +74,7 @@ class C_Entity { public: C_BlockSource *region; //0x320 private: - char pad_0x340[0xE0]; //0x340 + char pad_0x340[0x130]; //0x328 public: AABB aabb; //0x0458 float width; //0x0474 @@ -83,19 +83,19 @@ class C_Entity { vec3_t oldPos; //0x0488 vec3_t velocity; //0x0494 private: - char pad_0x0478[0x58]; //0x468 + char pad_0x0478[0x50]; //0x4A0 public: - __int64 entityRuntimeId; //0x4C0 //4B8 + __int64 entityRuntimeId; //0x4F0 private: - char pad_0478[0x120]; //0x04C8 + char pad_0478[0x128]; //0x04F8 public: - float bodyYaw; //0x05E8 - float oldBodyYaw; //0x05EC - float yawUnused1; //0x05F0 - float yawUnused2; //0x05F4 - int damageTime; //0x05F8 + float bodyYaw; //0x0620 + float oldBodyYaw; //0x0624 + float yawUnused1; //0x0628 + float yawUnused2; //0x062C + int damageTime; //0x0630 private: - char pad_0824[0x88]; //0x05FC + char pad_0824[0x88]; //0x0634 public: int timeSinceDeath; //0x0684 private: @@ -128,6 +128,8 @@ class C_Entity { virtual __int64 reloadHardcodedClient(__int64, __int64 const &); virtual __int64 initializeComponents(__int64, __int64 const &); virtual __int64 reloadComponents(__int64, __int64 const &); + virtual __int64 _serverInitItemStackIds(); + virtual __int64 _doInitialMove(); private: virtual void destructor(); @@ -156,9 +158,10 @@ class C_Entity { virtual __int64 getInterpolatedBodyYaw(float) const; virtual __int64 getYawSpeedInDegreesPerSecond(void) const; virtual __int64 getInterpolatedWalkAnimSpeed(float) const; - virtual __int64 getInterpolatedRidingOffset(float) const; + virtual __int64 getWorldPosition(); virtual void checkBlockCollisions(AABB const &); virtual void checkBlockCollisions(void); + virtual bool isFireImmune(); virtual bool breaksFallingBlocks(void) const; virtual bool blockedByShield(__int64 const &, C_Entity &); virtual void moveRelative(float, float, float, float); @@ -228,8 +231,8 @@ class C_Entity { public: virtual bool canSeeInvisible(void) const; - virtual bool canSee(C_Entity const &) const; virtual bool canSee(vec3_t const &) const; + virtual bool canSee(C_Entity const &) const; virtual bool isSkyLit(float); private: @@ -244,8 +247,8 @@ class C_Entity { virtual bool isSilent(void); virtual bool isPickable(void); virtual bool isFishable(void) const; + virtual bool isSleeping(); virtual bool isPushable(void) const; - virtual bool isPushableByPiston(void) const; virtual bool isSneaking(void) const; virtual void setSneaking(bool); virtual bool isBlocking(void) const; @@ -298,6 +301,7 @@ class C_Entity { virtual bool isInvulnerableTo(__int64 const &) const; private: + virtual __int64 getBlockDamageCause(); virtual void actuallyHurt(int, __int64 const *, bool); virtual __int64 animateHurt(void); virtual __int64 doFireHurt(int); @@ -481,9 +485,11 @@ class C_Entity { virtual __int64 updateEntitySpecificMolangVariables(__int64 &); public: - virtual bool canMakeStepSound(void) const; - + virtual bool shouldTryMakeStepSound(void) const; + private: + virtual __int64 getNextStep(float) const; + virtual __int64 idk(); virtual __int64 outOfWorld(void); virtual __int64 _hurt(__int64 const &, int, bool, bool); virtual __int64 markHurt(void); @@ -520,6 +526,7 @@ class C_Entity { virtual __int64 playAmbientSound(void); virtual __int64 getAmbientSound(void); virtual __int64 getAmbientSoundPostponeTicks(void); + virtual __int64 getAmbientSoundPostponeTicksRange(void); virtual __int64 getItemInHandIcon(__int64 const &, int); public: @@ -544,7 +551,6 @@ class C_Entity { private: virtual __int64 checkSpawnRules(bool); virtual __int64 checkSpawnObstruction(void) const; - virtual __int64 shouldDespawn(void) const; virtual __int64 getAttackAnim(float); virtual __int64 getItemUseDuration(void); virtual __int64 getItemUseStartupProgress(void); @@ -589,6 +595,9 @@ class C_Entity { virtual __int64 getArmorValue(void); virtual __int64 getArmorCoverPercentage(void) const; virtual __int64 hurtArmor(int); + virtual __int64 setDamagedArmor(); + virtual __int64 idk3(); + virtual __int64 sendArmor(void); virtual __int64 containerChanged(int); virtual __int64 updateEquipment(void); virtual __int64 clearEquipment(void); @@ -597,13 +606,14 @@ class C_Entity { virtual __int64 getAllHand(void) const; virtual __int64 getAllEquipment(void) const; virtual __int64 getArmorTypeHash(void); + virtual __int64 dropEquipment(void); + virtual __int64 dropEquipment(__int64 const &, int); + virtual __int64 clearVanishEnchantedItems(void); virtual __int64 sendInventory(bool); - virtual __int64 sendArmor(void); virtual __int64 getDamageAfterMagicAbsorb(__int64 const &, int); virtual __int64 createAIGoals(void); virtual __int64 onBorn(C_Entity &, C_Entity &); virtual void setItemSlot(__int64, __int64 const &); - virtual __int64 goDownInWater(void); public: virtual void setTransitioningSitting(bool); @@ -632,21 +642,12 @@ class C_Entity { virtual __int64 _serverAiMobStep(void); virtual __int64 getDamageAfterEnchantReduction(__int64 const &, int); virtual __int64 getDamageAfterArmorAbsorb(__int64 const &, int); - virtual __int64 dropEquipment(__int64 const &, int); - virtual __int64 dropEquipment(void); virtual __int64 dropBags(void); virtual __int64 dropContainer(void); virtual __int64 tickDeath(void); virtual __int64 _endJump(void); virtual __int64 updateGliding(void); virtual __int64 _allowAscendingScaffolding(void) const; - virtual __int64 prepareRegion(__int64 &); - virtual __int64 destroyRegion(void); - virtual __int64 suspendRegion(void); - virtual __int64 _fireWillChangeDimension(void); - virtual __int64 _fireDimensionChanged(void); - virtual __int64 changeDimensionWithCredits(__int64); - virtual __int64 tickWorld(__int64 const &); public: C_InventoryTransactionManager *getTransactionManager(); @@ -660,16 +661,16 @@ class C_Entity { __int64 *result; // rax __int64 v2; // rcx - result = (__int64 *)(_this + 0xD8); + result = (__int64 *)(_this + 0xE8); if (*result == -1i64) { - v2 = *(__int64 *)(_this + 0x358); - *result = ++*(__int64 *)(v2 + 0x198); + v2 = *(__int64 *)(_this + 0x330); + *result = ++*(__int64 *)(v2 + 0x1A0); } return result; } int getTicksUsingItem(){ - return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0x1188); + return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0xF60); } }; From 85a8ebe6567021f3e68a553025e677d97a2c5a90 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 20:41:49 +0200 Subject: [PATCH 013/419] Full Entity class fixed --- SDK/CEntity.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 33b13aed..26b91158 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -97,28 +97,28 @@ class C_Entity { private: char pad_0824[0x88]; //0x0634 public: - int timeSinceDeath; //0x0684 + int timeSinceDeath; //0x06BC private: - char pad_08B0[0x1E0]; //0x0688 + char pad_08B0[0x204]; //0x06C0 public: - bool canFly; //0x0868 + bool canFly; //0x08C4 private: - char pad_0x0A95[0x61F]; //0x0869 + char pad_0x0A95[0x6B3]; //0x08C5 public: - int16_t itemData; //0x0E88 - int16_t itemId; //0x0E8A + int16_t itemData; //0x0F78 + int16_t itemId; //0x0F7A private: - char pad_10CC[0x1FC]; //0x0E8C + char pad_10CC[0x1FC]; //0x0F7C public: - C_InventoryTransactionManager transac; //0x1088 + C_InventoryTransactionManager transac; //0x1178 private: - char pad_0x1324[0xA80]; //0x10EC + char pad_0x1324[0xAA4]; //0x11E0 public: - int gamemode; //0x1B6C + int gamemode; //0x1C84 private: - char pad_1DA4[0x198]; //0x1B70 + char pad_1DA4[0x238]; //0x1C88 public: - TextHolder uuid; //0x1D08 + TextHolder uuid; //0x1EC0 public: virtual bool hasComponent(__int64 const &) const; From 190d8f2b34e0940e70ae96ead62043be54edfe46 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 21:31:31 +0200 Subject: [PATCH 014/419] Fix sigs --- Memory/GameData.cpp | 2 +- Memory/Hooks.cpp | 34 ++++++++++++---------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 6134af0b..6e414e00 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -169,7 +169,7 @@ void GameData::forEachEntity(std::function callback) { { // MultiplayerLevel::directTickEntities __int64 region = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->region); - __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x150i64); + __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x120i64); for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; // !isRemoved() && !isGlobal() diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index dd8c4506..10754725 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -38,9 +38,9 @@ void Hooks::Init() { if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { - g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[118], Hooks::BlockLegacy_getRenderLayer); + g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[125], Hooks::BlockLegacy_getRenderLayer); - g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[15], Hooks::BlockLegacy_getLightEmission); + g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[16], Hooks::BlockLegacy_getLightEmission); } } @@ -198,9 +198,9 @@ void Hooks::Init() { //void* sunLightIntensity = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B B9 ?? ?? ?? ?? 49 8B D8 0F")); - logF("ChestBlockActor_tickHook dead"); - //void* ChestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0 75 10 48 8D 51 ?? 48 8B CF E8 ?? ?? ?? ?? 48 89 43 ?? FF 43 ?? 48 85 C0")); - //g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); + + void* ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); + g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -211,13 +211,9 @@ void Hooks::Init() { void* autoComplete = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 41 8B F9")); g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); - //void* sendtoServer = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 ?? ?? ?? ?? ?? ?? 0F B6 41 ?? 48 8B FA 88 42 ?? 48 8D 54 24 ?? 48 8B 59 ?? 48 8B CB E8 ?? ?? ?? ?? 45 33 C9")); - //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(sendtoServer, Hooks::LoopbackPacketSender_sendToServer); uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); - //void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 0F 29 74 24 ?? 0F 29 7C 24 ?? 44 0F 29 44 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ??")); - //g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* getFov = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ?? 0F 29 74 24 ? 0F 29 7C 24 ? 44 0F 29 44 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F 28 C1")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); @@ -227,9 +223,7 @@ void Hooks::Init() { void* keyMouseFunc = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0F 29 74 24 70 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 E0 49 8B F8 48 8B F1 45 33 ED 41 8B DD 89 5D DC 49 8B C8 E8")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); - //void* renderLevel = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B D8 48 8B FA 48 8B F1 33 D2")); - //g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); - void* renderLevel = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 56 41 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ? ? ? ?")); + void* renderLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 20 FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 57 41 54 41 55 41 56 41 57 48 83 EC 60 44 ?? ?? ?? ?? ?? ?? ?? ?? 33 F6")); @@ -250,8 +244,8 @@ void Hooks::Init() { //void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 48 8B F1 80 B9 ?? ?? ?? ?? ?? 74 51 C6 81 ?? ?? ?? ?? ?? 66 ?? ?? ?? ?? ?? ?? ?? 74 40 48 8D 45")); //g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); - //void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D ?? ?? ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 ?? ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B D9 4C")); - //g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); + void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D9 4D 8B F8")); + g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); @@ -259,9 +253,8 @@ void Hooks::Init() { void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 C7 85 ?? ?? ?? ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F2")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); - // relies on connectionrequest__create - //void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); - //g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); + void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); + g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49")); g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); @@ -276,9 +269,6 @@ void Hooks::Init() { void* prepFeaturedServersFirstTime = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA")); g_Hooks.prepFeaturedServersFirstTimeHook = std::make_unique(prepFeaturedServersFirstTime, Hooks::prepFeaturedServersFirstTime); - - //void* cube__compile = reinterpret_cast(FindSignature("48 8B C4 53 41 56 41 57 48 81 EC ?? ?? ?? ?? 4C 8B 79 ??")); - //g_Hooks.cube__compileHook = std::make_unique(cube__compile, Hooks::Cube__compile); void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); @@ -483,7 +473,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { #if defined(_BETA) or defined(_DEBUG) // Draw Custom Geo Button if (g_Data.allowWIPFeatures()) { - logF("%llX", g_Data.getClientInstance()->getGuiData()); + if (HImGui.Button("Load Script Folder", vec2_t(wid.x * (0.765f - 0.5f), wid.y * 0.92f), true)) { HorionDataPacket packet; packet.cmd = CMD_FOLDERCHOOSER; @@ -1228,6 +1218,7 @@ int Hooks::BlockLegacy_getRenderLayer(C_BlockLegacy* a1) { static auto xrayMod = moduleMgr->getModule(); if (xrayMod->isEnabled()) { + char* text = a1->name.getText(); if (strstr(text, "ore") == NULL) if (strcmp(text, "lava") != NULL) @@ -1253,7 +1244,6 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) static auto oFunc = g_Hooks.LevelRenderer_renderLevelHook->GetFastcall<__int64, __int64, __int64, __int64>(); using reloadShit_t = void(__fastcall*)(__int64); - //static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B F9 4C")); static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 ?? EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ?? 48 89 68 ?? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9")); static auto xrayMod = moduleMgr->getModule(); From d57d8ccc6bf4aa413ee088c80e6c482d9297c62e Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 21:46:17 +0200 Subject: [PATCH 015/419] Fix 2d drawing --- Horion/DrawUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 8e87ff2f..962ba966 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -50,7 +50,8 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { guiData = gui; renderCtx = ctx; screenContext2d = reinterpret_cast<__int64*>(renderCtx)[2]; - tesselator = *reinterpret_cast<__int64*>(screenContext2d + 0xA8); + + tesselator = *reinterpret_cast<__int64*>(screenContext2d + 0xB0); colorHolder = *reinterpret_cast(screenContext2d + 0x30); glmatrixf* badrefdef = g_Data.getClientInstance()->getRefDef(); From 9ebe92b1417ff50378e3c96fa141c10c4a96f302 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 22:07:00 +0200 Subject: [PATCH 016/419] fix commands --- Memory/Hooks.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 10754725..e9ff1155 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -326,7 +326,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - __int64 a1 = (*(__int64 (__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x970i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + __int64 a1 = (*(__int64 (__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; @@ -334,9 +334,9 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { __int64 v16 = *v15; if (*(BYTE*)(_this + 0xA9A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x978))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x968))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x970))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x960))(v15); *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); *reinterpret_cast<__int64*>(_this + 0xA80) = 0i64; From 7b493a8f04e0fd8fb6cfdbda29429eeacad11bf1 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 23 Jun 2020 22:24:04 +0200 Subject: [PATCH 017/419] Fix cool sigs --- Horion/path/JoePathFinder.cpp | 2 +- SDK/CBlockLegacy.cpp | 2 +- SDK/CBlockLegacy.h | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index d68e7d53..1e7bda99 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -85,7 +85,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo } static uintptr_t** witherRoseVtable = nullptr; if (witherRoseVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 48 B9"); int offset = *reinterpret_cast(sigOffset + 3); witherRoseVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); } diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 7d38e142..ba14f602 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -12,7 +12,7 @@ C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { return getBlockEntity(this, block); } bool C_BlockLegacy::getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor) { - return Utils::CallVFunc<4, bool, AABB*, C_Block*, C_BlockSource*, const vec3_ti*, C_Entity*>(this, collShapeOut, block, blockSource, pos, actor); + return Utils::CallVFunc<5, bool, AABB*, C_Block*, C_BlockSource*, const vec3_ti*, C_Entity*>(this, collShapeOut, block, blockSource, pos, actor); } int C_BlockLegacy::liquidGetDepth(C_BlockSource* reg, const vec3_ti* pos) { using liquid_getDepth_t = int(__fastcall*)(C_BlockLegacy*, C_BlockSource*, const vec3_ti*); diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 7893e344..26dc7ba7 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -33,18 +33,17 @@ class C_BlockLegacy { TextHolder tileName; // 0x0008 TextHolder name; //0x0028 private: - char pad_0x0048[0x70]; //0x0048 + char pad_0x0048[0x78]; //0x0048 public: - C_Material* material; //0x00B8 + C_Material* material; //0x00C0 private: - char pad_0x00C0[0x44]; //0x00C0 + char pad_0x00C0[0x44]; //0x00C8 public: - short blockId; // 0x00C4 + short blockId; // 0x010C private: - char pad_0x0106[0xA]; //0x0106 + char pad_0x0106[0xA]; //0x010E public: - AABB aabb; //0x00C8 - // 0x00E4 + AABB aabb; //0x0110 int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); From 7d1a7c6e2c93bfc067e2d80e28d6b6d8f20dc240 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 23 Jun 2020 16:43:33 -0400 Subject: [PATCH 018/419] fix client instance vTable --- SDK/CClientInstance.h | 3 +- .../v1/query/client-MicrosoftVS/query.json" | 1 + .../reply/cache-v2-59a851a63745b66dac1c.json" | 1059 ++++++ .../cmakeFiles-v1-54d750433216a60118a8.json" | 683 ++++ .../codemodel-v2-0964f0e9c718a0f18c42.json" | 59 + .../index-2020-06-23T20-24-34-0413.json" | 110 + ...et-Horion-Debug-6dc38c8b11e76065de59.json" | 2856 +++++++++++++++++ .../CMakeCache.txt" | 332 ++ .../CMakeCCompiler.cmake" | 76 + .../CMakeCXXCompiler.cmake" | 88 + .../CMakeDetermineCompilerABI_C.bin" | Bin 0 -> 49152 bytes .../CMakeDetermineCompilerABI_CXX.bin" | Bin 0 -> 49152 bytes .../CMakeRCCompiler.cmake" | 6 + .../3.17.20032601-MSVC_2/CMakeSystem.cmake" | 15 + .../CompilerIdC/CMakeCCompilerId.c" | 671 ++++ .../CompilerIdC/CMakeCCompilerId.exe" | Bin 0 -> 95232 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp" | 660 ++++ .../CompilerIdCXX/CMakeCXXCompilerId.exe" | Bin 0 -> 95232 bytes .../CMakeFiles/ShowIncludes/foo.h" | 1 + .../CMakeFiles/ShowIncludes/main.c" | 2 + .../CMakeFiles/TargetDirectories.txt" | 3 + .../CMakeFiles/cmake.check_cache" | 1 + .../VSInheritEnvironments.txt" | 1 + .../build.ninja" | 1741 ++++++++++ .../cmake_install.cmake" | 44 + .../rules.ninja" | 71 + 26 files changed, 8482 insertions(+), 1 deletion(-) create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.cpp" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/ShowIncludes/foo.h" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/ShowIncludes/main.c" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/TargetDirectories.txt" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/cmake.check_cache" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/VSInheritEnvironments.txt" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/build.ninja" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/cmake_install.cmake" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/rules.ninja" diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index a8301fb2..57512ea5 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -455,7 +455,7 @@ class C_ClientInstance { virtual __int64 getUICursorTexture(void) const; virtual __int64 getCamera(void); virtual __int64 getShaderColor(void); - //virtual __int64 getDarkShaderColor(void); + virtual __int64 getDarkShaderColor(void); virtual __int64 clearGraphicsCache(void); virtual __int64 getNormalizedUICursorTransform(__int64&, float); virtual __int64 shouldRenderUICursor(void) const; @@ -494,6 +494,7 @@ class C_ClientInstance { virtual __int64 getCurrentSceneStack(void); virtual __int64 getCurrentUIRouter(void); virtual __int64 getCurrentUIRouter(void) const; + virtual __int64 sub_14012BAB0(void) const; virtual __int64 prepareSceneFor(__int64); virtual __int64 getCachedScenes(void); diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" new file mode 100644 index 00000000..308f68dd --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" @@ -0,0 +1 @@ +{"requests":[{"kind":"cache","version":2},{"kind":"cmakeFiles","version":1},{"kind":"codemodel","version":2}]} \ No newline at end of file diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" new file mode 100644 index 00000000..86b06ea8 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" @@ -0,0 +1,1059 @@ +{ + "entries" : + [ + { + "name" : "CMAKE_BUILD_TYPE", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ..." + } + ], + "type" : "STRING", + "value" : "Debug" + }, + { + "name" : "CMAKE_CACHEFILE_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "This is the directory where this CMakeCache.txt was created" + } + ], + "type" : "INTERNAL", + "value" : "c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)" + }, + { + "name" : "CMAKE_CACHE_MAJOR_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Major version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "3" + }, + { + "name" : "CMAKE_CACHE_MINOR_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Minor version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "17" + }, + { + "name" : "CMAKE_CACHE_PATCH_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Patch version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "20032601" + }, + { + "name" : "CMAKE_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to CMake executable." + } + ], + "type" : "INTERNAL", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" + }, + { + "name" : "CMAKE_CPACK_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to cpack program executable." + } + ], + "type" : "INTERNAL", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe" + }, + { + "name" : "CMAKE_CTEST_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to ctest program executable." + } + ], + "type" : "INTERNAL", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe" + }, + { + "name" : "CMAKE_CXX_COMPILER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "No help, variable specified on the command line." + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" + }, + { + "name" : "CMAKE_CXX_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during all build types." + } + ], + "type" : "STRING", + "value" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc" + }, + { + "name" : "CMAKE_CXX_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "/MDd /Zi /Ob0 /Od /RTC1" + }, + { + "name" : "CMAKE_CXX_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "/MD /O1 /Ob1 /DNDEBUG" + }, + { + "name" : "CMAKE_CXX_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "/MD /O2 /Ob2 /DNDEBUG" + }, + { + "name" : "CMAKE_CXX_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "/MD /Zi /O2 /Ob1 /DNDEBUG" + }, + { + "name" : "CMAKE_CXX_STANDARD_LIBRARIES", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Libraries linked by default with all C++ applications." + } + ], + "type" : "STRING", + "value" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" + }, + { + "name" : "CMAKE_C_COMPILER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "No help, variable specified on the command line." + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" + }, + { + "name" : "CMAKE_C_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the C compiler during all build types." + } + ], + "type" : "STRING", + "value" : "/DWIN32 /D_WINDOWS /W3" + }, + { + "name" : "CMAKE_C_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the C compiler during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "/MDd /Zi /Ob0 /Od /RTC1" + }, + { + "name" : "CMAKE_C_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the C compiler during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "/MD /O1 /Ob1 /DNDEBUG" + }, + { + "name" : "CMAKE_C_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the C compiler during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "/MD /O2 /Ob2 /DNDEBUG" + }, + { + "name" : "CMAKE_C_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the C compiler during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "/MD /Zi /O2 /Ob1 /DNDEBUG" + }, + { + "name" : "CMAKE_C_STANDARD_LIBRARIES", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Libraries linked by default with all C applications." + } + ], + "type" : "STRING", + "value" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" + }, + { + "name" : "CMAKE_EXECUTABLE_FORMAT", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Executable file format" + } + ], + "type" : "INTERNAL", + "value" : "Unknown" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during all build types." + } + ], + "type" : "STRING", + "value" : "/machine:x64" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_EXPORT_COMPILE_COMMANDS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Enable/Disable output of compile commands during generation." + } + ], + "type" : "BOOL", + "value" : "" + }, + { + "name" : "CMAKE_EXTRA_GENERATOR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of external makefile project generator." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator." + } + ], + "type" : "INTERNAL", + "value" : "Ninja" + }, + { + "name" : "CMAKE_GENERATOR_INSTANCE", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Generator instance identifier." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR_PLATFORM", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator platform." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR_TOOLSET", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator toolset." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_HOME_DIRECTORY", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Source directory with the top level CMakeLists.txt file for this project" + } + ], + "type" : "INTERNAL", + "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + }, + { + "name" : "CMAKE_INSTALL_PREFIX", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "No help, variable specified on the command line." + } + ], + "type" : "PATH", + "value" : "C:/Users/Celanie Erwan/Source/Repos/richardletshacks/Horion/out/install/x64-Debug (par défaut)" + }, + { + "name" : "CMAKE_LINKER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe" + }, + { + "name" : "CMAKE_MAKE_PROGRAM", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "make program" + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during all build types." + } + ], + "type" : "STRING", + "value" : "/machine:x64" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_MT", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe" + }, + { + "name" : "CMAKE_NUMBER_OF_MAKEFILES", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "number of local generators" + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_PLATFORM_INFO_INITIALIZED", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Platform information initialized" + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_PROJECT_DESCRIPTION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "" + }, + { + "name" : "CMAKE_PROJECT_HOMEPAGE_URL", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "" + }, + { + "name" : "CMAKE_PROJECT_NAME", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "Horion" + }, + { + "name" : "CMAKE_RC_COMPILER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "RC compiler" + } + ], + "type" : "FILEPATH", + "value" : "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe" + }, + { + "name" : "CMAKE_RC_COMPILER_WORKS", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "" + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_RC_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags for Windows Resource Compiler during all build types." + } + ], + "type" : "STRING", + "value" : "-DWIN32" + }, + { + "name" : "CMAKE_RC_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags for Windows Resource Compiler during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "-D_DEBUG" + }, + { + "name" : "CMAKE_RC_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags for Windows Resource Compiler during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_RC_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags for Windows Resource Compiler during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_RC_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags for Windows Resource Compiler during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_ROOT", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to CMake installation." + } + ], + "type" : "INTERNAL", + "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during all build types." + } + ], + "type" : "STRING", + "value" : "/machine:x64" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "/INCREMENTAL:NO" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "/debug /INCREMENTAL" + }, + { + "name" : "CMAKE_SKIP_INSTALL_RPATH", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If set, runtime paths are not added when installing shared libraries, but are added when building." + } + ], + "type" : "BOOL", + "value" : "NO" + }, + { + "name" : "CMAKE_SKIP_RPATH", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If set, runtime paths are not added when using shared libraries." + } + ], + "type" : "BOOL", + "value" : "NO" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during all build types." + } + ], + "type" : "STRING", + "value" : "/machine:x64" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_VERBOSE_MAKEFILE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo." + } + ], + "type" : "BOOL", + "value" : "FALSE" + }, + { + "name" : "Horion_BINARY_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)" + }, + { + "name" : "Horion_SOURCE_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + } + ], + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" new file mode 100644 index 00000000..caba3ba2 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" @@ -0,0 +1,683 @@ +{ + "inputs" : + [ + { + "path" : "CMakeLists.txt" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineSystem.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystem.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCompilerIdDetection.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ADSP-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Borland-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Cray-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GHS-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GNU-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/HP-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IAR-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Intel-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PGI-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PathScale-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SCO-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TI-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Watcom-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XL-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeFindBinUtils.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompiler.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCXXCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-Determine-CXX.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCompilerIdDetection.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ADSP-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Borland-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Cray-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GHS-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IAR-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Intel-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PGI-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PathScale-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SCO-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TI-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Watcom-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeFindBinUtils.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompiler.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-C.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-C.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineRCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCCompiler.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestRCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerABI.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitIncludeInfo.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitLinkInfo.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompilerABI.c" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompileFeatures.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Internal/FeatureTesting.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompiler.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-CXX.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-CXX.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerABI.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitIncludeInfo.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitLinkInfo.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompileFeatures.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Internal/FeatureTesting.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompiler.cmake.in" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" + } + ], + "kind" : "cmakeFiles", + "paths" : + { + "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", + "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + }, + "version" : + { + "major" : 1, + "minor" : 0 + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" new file mode 100644 index 00000000..7164311d --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" @@ -0,0 +1,59 @@ +{ + "configurations" : + [ + { + "directories" : + [ + { + "build" : ".", + "minimumCMakeVersion" : + { + "string" : "3.12" + }, + "projectIndex" : 0, + "source" : ".", + "targetIndexes" : + [ + 0 + ] + } + ], + "name" : "Debug", + "projects" : + [ + { + "directoryIndexes" : + [ + 0 + ], + "name" : "Horion", + "targetIndexes" : + [ + 0 + ] + } + ], + "targets" : + [ + { + "directoryIndex" : 0, + "id" : "Horion::@6890427a1f51a3e7e1df", + "jsonFile" : "target-Horion-Debug-6dc38c8b11e76065de59.json", + "name" : "Horion", + "projectIndex" : 0 + } + ] + } + ], + "kind" : "codemodel", + "paths" : + { + "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", + "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + }, + "version" : + { + "major" : 2, + "minor" : 0 + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" new file mode 100644 index 00000000..8f1006c8 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" @@ -0,0 +1,110 @@ +{ + "cmake" : + { + "generator" : + { + "multiConfig" : false, + "name" : "Ninja" + }, + "paths" : + { + "cmake" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", + "cpack" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe", + "ctest" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe", + "root" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" + }, + "version" : + { + "isDirty" : false, + "major" : 3, + "minor" : 17, + "patch" : 20032601, + "string" : "3.17.20032601-MSVC_2", + "suffix" : "" + } + }, + "objects" : + [ + { + "jsonFile" : "codemodel-v2-0964f0e9c718a0f18c42.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cmakeFiles-v1-54d750433216a60118a8.json", + "kind" : "cmakeFiles", + "version" : + { + "major" : 1, + "minor" : 0 + } + } + ], + "reply" : + { + "client-MicrosoftVS" : + { + "query.json" : + { + "requests" : + [ + { + "kind" : "cache", + "version" : 2 + }, + { + "kind" : "cmakeFiles", + "version" : 1 + }, + { + "kind" : "codemodel", + "version" : 2 + } + ], + "responses" : + [ + { + "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cmakeFiles-v1-54d750433216a60118a8.json", + "kind" : "cmakeFiles", + "version" : + { + "major" : 1, + "minor" : 0 + } + }, + { + "jsonFile" : "codemodel-v2-0964f0e9c718a0f18c42.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + } + ] + } + } + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" new file mode 100644 index 00000000..a576e4f5 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" @@ -0,0 +1,2856 @@ +{ + "artifacts" : + [ + { + "path" : "Horion.dll" + }, + { + "path" : "Horion.lib" + }, + { + "path" : "Horion.pdb" + } + ], + "backtrace" : 1, + "backtraceGraph" : + { + "commands" : + [ + "add_library", + "link_directories", + "add_compile_options", + "add_compile_definitions", + "include_directories" + ], + "files" : + [ + "CMakeLists.txt" + ], + "nodes" : + [ + { + "file" : 0 + }, + { + "command" : 0, + "file" : 0, + "line" : 24, + "parent" : 0 + }, + { + "command" : 1, + "file" : 0, + "line" : 22, + "parent" : 0 + }, + { + "command" : 2, + "file" : 0, + "line" : 9, + "parent" : 0 + }, + { + "command" : 3, + "file" : 0, + "line" : 12, + "parent" : 0 + }, + { + "command" : 4, + "file" : 0, + "line" : 19, + "parent" : 0 + }, + { + "command" : 4, + "file" : 0, + "line" : 20, + "parent" : 0 + } + ] + }, + "compileGroups" : + [ + { + "compileCommandFragments" : + [ + { + "fragment" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 " + }, + { + "backtrace" : 3, + "fragment" : "/MP" + }, + { + "backtrace" : 3, + "fragment" : "/Ob1" + }, + { + "fragment" : "-std:c++17" + } + ], + "defines" : + [ + { + "define" : "Horion_EXPORTS" + }, + { + "backtrace" : 4, + "define" : "WIN32_LEAN_AND_MEAN" + } + ], + "includes" : + [ + { + "backtrace" : 5, + "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/." + }, + { + "backtrace" : 6, + "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/include" + } + ], + "language" : "CXX", + "sourceIndexes" : + [ + 0, + 2, + 4, + 6, + 8, + 10, + 12, + 14, + 16, + 18, + 20, + 22, + 24, + 26, + 28, + 30, + 32, + 34, + 36, + 38, + 40, + 42, + 44, + 46, + 48, + 50, + 52, + 54, + 56, + 58, + 60, + 62, + 64, + 66, + 68, + 70, + 72, + 74, + 76, + 78, + 80, + 82, + 84, + 86, + 88, + 90, + 92, + 94, + 96, + 98, + 100, + 102, + 104, + 106, + 108, + 110, + 112, + 114, + 116, + 118, + 120, + 122, + 124, + 126, + 128, + 130, + 132, + 134, + 136, + 138, + 140, + 142, + 144, + 146, + 148, + 150, + 152, + 154, + 156, + 158, + 160, + 162, + 164, + 166, + 168, + 170, + 172, + 174, + 176, + 178, + 180, + 182, + 184, + 186, + 188, + 190, + 192, + 194, + 196, + 198, + 200, + 202, + 204, + 206, + 208, + 210, + 212, + 214, + 216, + 218, + 220, + 222, + 224, + 226, + 228, + 230, + 232, + 234, + 236, + 238, + 240, + 242, + 244, + 246, + 248, + 250, + 252, + 254, + 256, + 258, + 260, + 262, + 269, + 271, + 273, + 275, + 278, + 280, + 281, + 283, + 295, + 297, + 300, + 328, + 330, + 332, + 334, + 336, + 340, + 341, + 342, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 355, + 358, + 359, + 361, + 363, + 365, + 367, + 369, + 371, + 373, + 375, + 378, + 380, + 382, + 384, + 386, + 387 + ] + } + ], + "id" : "Horion::@6890427a1f51a3e7e1df", + "link" : + { + "commandFragments" : + [ + { + "fragment" : "/machine:x64 /debug /INCREMENTAL", + "role" : "flags" + }, + { + "backtrace" : 2, + "fragment" : "-LIBPATH:C:\\Users\\CELANI~1\\source\\repos\\RICHAR~1\\Horion\\minhook", + "role" : "libraryPath" + }, + { + "fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib", + "role" : "libraries" + } + ], + "language" : "CXX" + }, + "name" : "Horion", + "nameOnDisk" : "Horion.dll", + "paths" : + { + "build" : ".", + "source" : "." + }, + "sourceGroups" : + [ + { + "name" : "Source Files", + "sourceIndexes" : + [ + 0, + 2, + 4, + 6, + 8, + 10, + 12, + 14, + 16, + 18, + 20, + 22, + 24, + 26, + 28, + 30, + 32, + 34, + 36, + 38, + 40, + 42, + 44, + 46, + 48, + 50, + 52, + 54, + 56, + 58, + 60, + 62, + 64, + 66, + 68, + 70, + 72, + 74, + 76, + 78, + 80, + 82, + 84, + 86, + 88, + 90, + 92, + 94, + 96, + 98, + 100, + 102, + 104, + 106, + 108, + 110, + 112, + 114, + 116, + 118, + 120, + 122, + 124, + 126, + 128, + 130, + 132, + 134, + 136, + 138, + 140, + 142, + 144, + 146, + 148, + 150, + 152, + 154, + 156, + 158, + 160, + 162, + 164, + 166, + 168, + 170, + 172, + 174, + 176, + 178, + 180, + 182, + 184, + 186, + 188, + 190, + 192, + 194, + 196, + 198, + 200, + 202, + 204, + 206, + 208, + 210, + 212, + 214, + 216, + 218, + 220, + 222, + 224, + 226, + 228, + 230, + 232, + 234, + 236, + 238, + 240, + 242, + 244, + 246, + 248, + 250, + 252, + 254, + 256, + 258, + 260, + 262, + 269, + 271, + 273, + 275, + 278, + 280, + 281, + 283, + 295, + 297, + 300, + 328, + 330, + 332, + 334, + 336, + 340, + 341, + 342, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 355, + 358, + 359, + 361, + 363, + 365, + 367, + 369, + 371, + 373, + 375, + 378, + 380, + 382, + 384, + 386, + 387 + ] + }, + { + "name" : "Header Files", + "sourceIndexes" : + [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31, + 33, + 35, + 37, + 39, + 41, + 43, + 45, + 47, + 49, + 51, + 53, + 55, + 57, + 59, + 61, + 63, + 65, + 67, + 69, + 71, + 73, + 75, + 77, + 79, + 81, + 83, + 85, + 87, + 89, + 91, + 93, + 95, + 97, + 99, + 101, + 103, + 105, + 107, + 109, + 111, + 113, + 115, + 117, + 119, + 121, + 123, + 125, + 127, + 129, + 131, + 133, + 135, + 137, + 139, + 141, + 143, + 145, + 147, + 149, + 151, + 153, + 155, + 157, + 159, + 161, + 163, + 165, + 167, + 169, + 171, + 173, + 175, + 177, + 179, + 181, + 183, + 185, + 187, + 189, + 191, + 193, + 195, + 197, + 199, + 201, + 203, + 205, + 207, + 209, + 211, + 213, + 215, + 217, + 219, + 221, + 223, + 225, + 227, + 229, + 231, + 233, + 235, + 237, + 239, + 241, + 243, + 245, + 247, + 249, + 251, + 253, + 255, + 257, + 259, + 261, + 263, + 264, + 265, + 266, + 267, + 268, + 270, + 272, + 274, + 276, + 277, + 279, + 282, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 296, + 298, + 299, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 329, + 331, + 333, + 335, + 337, + 338, + 339, + 343, + 354, + 356, + 357, + 360, + 362, + 364, + 366, + 368, + 370, + 372, + 374, + 376, + 377, + 379, + 381, + 383, + 385, + 388 + ] + } + ], + "sources" : + [ + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/BindCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/BindCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/BruhCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/BruhCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/CommandBlockExploitCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/CommandBlockExploitCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ConfigCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ConfigCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/CoordsCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/CoordsCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/DamageCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/DamageCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/DupeCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/DupeCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/EjectCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/EjectCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/EnchantCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/EnchantCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ExecuteCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ExecuteCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/FriendListCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/FriendListCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/GameModeCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/GameModeCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/GiveCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/GiveCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/HelpCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/HelpCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/HideCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/HideCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ICommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ICommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ModulesCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ModulesCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/NameSpoofCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/NameSpoofCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/NbtCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/NbtCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PanicCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PanicCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PlayerTeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PlayerTeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/RelativeTeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/RelativeTeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SayCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SayCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ScriptCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ScriptCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ServerCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ServerCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/setoffhandCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/setoffhandCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SetprefixCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SetprefixCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SpammerCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SpammerCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/TeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/TeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/TestCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/TestCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ToggleCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ToggleCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/UnbindCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/UnbindCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/CommandMgr.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/CommandMgr.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Config/AccountInformation.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Config/AccountInformation.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Config/ConfigManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Config/ConfigManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/FriendList/FriendList.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/FriendList/FriendList.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Menu/ClickGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Menu/ClickGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Menu/TabGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Menu/TabGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Aimbot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Aimbot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirJump.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirJump.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirStuck.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirStuck.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirSwim.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirSwim.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiBot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiBot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiVoid.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiVoid.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoArmor.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoArmor.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoClicker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoClicker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoGapple.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoGapple.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoSneak.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoSneak.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoSprint.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoSprint.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoTotem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoTotem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Bhop.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Bhop.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Blink.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Blink.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/BowAimbot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/BowAimbot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestAura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestAura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestESP.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestESP.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestStealer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestStealer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ClickGuiMod.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ClickGuiMod.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Crasher.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Crasher.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Criticals.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Criticals.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/CrystalAura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/CrystalAura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/CubeGlide.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/CubeGlide.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Derp.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Derp.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/EditionFaker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/EditionFaker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ESP.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ESP.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FastEast.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FastEat.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FastLadder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FastLadder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Fly.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Fly.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ForceOpenCommandBlock.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ForceOpenCommandBlock.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Freecam.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Freecam.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Fucker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Fucker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FullBright.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FullBright.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Glide.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Glide.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Godmode.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Godmode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/HighJump.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/HighJump.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Hitbox.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Hitbox.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/HudModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/HudModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InfiniteBlockReach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InfiniteBlockReach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InfiniteReach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InfiniteReach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InstaBreak.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InstaBreak.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InventoryCleaner.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InventoryCleaner.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InventoryMove.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InventoryMove.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/JavascriptModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/JavascriptModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Jesus.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Jesus.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Jetpack.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Jetpack.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Killaura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Killaura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/MidClick.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/MidClick.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Module.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Module.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NameTags.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NameTags.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Nbt.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Nbt.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NightMode.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NightMode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoFall.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoFall.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoFriends.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoFriends.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoPacket.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoPacket.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoSlowDown.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoSlowDown.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoSwing.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoSwing.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoWeb.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoWeb.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Nuker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Nuker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/PacketLogger.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/PacketLogger.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Phase.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Phase.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/RainbowSky.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/RainbowSky.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Reach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Reach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Scaffold.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Scaffold.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Spammer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Spammer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Speed.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Speed.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/StackableItem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/StackableItem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Step.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Step.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Teams.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Teams.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Teleport.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Teleport.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/TestModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/TestModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Timer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Timer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Tower.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Tower.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Tracer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Tracer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/TriggerBot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/TriggerBot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Velocity.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Velocity.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Xray.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Xray.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Zoom.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Zoom.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/ModuleManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/ModuleManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/CommandManagerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/CommandManagerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/EntityFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/EntityFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/GameFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/GameFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/GlobalFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/GlobalFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/HorionFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/HorionFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/Vector3Functions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/Vector3Functions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/JsScriptModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/JsScriptModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/ScriptInstance.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/ScriptInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/ScriptManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/ScriptManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/DrawUtils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/DrawUtils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/GuiUtils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/GuiUtils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/ImmediateGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/ImmediateGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Loader.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Loader.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCommon.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCommonWindows.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCore.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCoreWindows.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraDebug.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/examples/imgui_impl_dx11.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/examples/imgui_impl_dx11.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/examples/imgui_impl_win32.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/examples/imgui_impl_win32.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/misc/cpp/imgui_stdlib.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/misc/cpp/imgui_stdlib.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/misc/fonts/binary_to_compressed_c.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/misc/single_file/imgui_single_file.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imconfig.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imgui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_demo.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_draw.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imgui_internal.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_widgets.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_rectpack.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_textedit.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_truetype.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/atlrx.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11async.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11core.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11effect.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/RegExp.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/StringProcess.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/WinHttpClient.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/GameData.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/GameData.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/Hooks.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/Hooks.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Memory/MinHook.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/SlimMem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/SlimMem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CBlockLegacy.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CChestBlockActor.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CClientInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CClientInstanceScreenModel.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CComplexInventoryTransaction.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CEntity.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CEntityList.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CGameMode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CGameSettingsInput.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CHIDController.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CInventory.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CInventoryTransaction.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CItem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CLoopbackPacketSender.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CMinecraftUIRenderContext.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CMoveInputHandler.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CPacket.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CRakNetInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CUIScene.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/MojangsonToken.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/Tag.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/TextHolder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/ChakraHelper.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/DllHelper.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/HMath.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/Json.hpp", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Logger.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Logger.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/SkinUtil.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/SkinUtil.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Target.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Target.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/TextFormat.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/TextFormat.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Utils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Utils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/xorstr.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "resource.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/TextHolder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CChestBlockActor.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/Tag.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/keys.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CBlockLegacy.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CItem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CInventory.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CInventoryTransaction.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CEntity.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CComplexInventoryTransaction.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CPacket.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CMinecraftUIRenderContext.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CClientInstance.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CMoveInputHandler.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "SDK/CImageBuffer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Freelook.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Freelook.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CCamera.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CCamera.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoHurtcam.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoHurtcam.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiImmobile.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiImmobile.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoePathFinder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoePathFinder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoePath.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoePath.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeSegment.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeSegment.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeMovementController.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeMovementController.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoal.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoal.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalXYZ.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalXYZ.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalXZ.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalXZ.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeConstants.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalY.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalY.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FollowPathModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FollowPathModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PathCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PathCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeIncompletePath.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeIncompletePath.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeConstants.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/LevelFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/LevelFunctions.h", + "sourceGroupIndex" : 1 + } + ], + "type" : "SHARED_LIBRARY" +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" "b/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" new file mode 100644 index 00000000..2b19a9b2 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" @@ -0,0 +1,332 @@ +# This is the CMakeCache file. +# For build in directory: c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) +# It was generated by CMake: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING=Debug + +//No help, variable specified on the command line. +CMAKE_CXX_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1 + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG + +//Libraries linked by default with all C++ applications. +CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib + +//No help, variable specified on the command line. +CMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1 + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG + +//Libraries linked by default with all C applications. +CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//No help, variable specified on the command line. +CMAKE_INSTALL_PREFIX:PATH=C:/Users/Celanie Erwan/Source/Repos/richardletshacks/Horion/out/install/x64-Debug (par défaut) + +//Path to a program. +CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe + +//make program +CMAKE_MAKE_PROGRAM:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64 + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//Path to a program. +CMAKE_MT:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Horion + +//RC compiler +CMAKE_RC_COMPILER:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe + +//Flags for Windows Resource Compiler during all build types. +CMAKE_RC_FLAGS:STRING=-DWIN32 + +//Flags for Windows Resource Compiler during DEBUG builds. +CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG + +//Flags for Windows Resource Compiler during MINSIZEREL builds. +CMAKE_RC_FLAGS_MINSIZEREL:STRING= + +//Flags for Windows Resource Compiler during RELEASE builds. +CMAKE_RC_FLAGS_RELEASE:STRING= + +//Flags for Windows Resource Compiler during RELWITHDEBINFO builds. +CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING= + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64 + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64 + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +Horion_BINARY_DIR:STATIC=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) + +//Value Computed by CMake +Horion_SOURCE_DIR:STATIC=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion + + +######################## +# INTERNAL cache entries +######################## + +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=17 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=20032601 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES +CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES +CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Ninja +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MT +CMAKE_MT-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_COMPILER +CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_RC_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS +CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS_DEBUG +CMAKE_RC_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS_MINSIZEREL +CMAKE_RC_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS_RELEASE +CMAKE_RC_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS_RELWITHDEBINFO +CMAKE_RC_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" new file mode 100644 index 00000000..8c3ee39c --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" @@ -0,0 +1,76 @@ +set(CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "MSVC") +set(CMAKE_C_COMPILER_VERSION "19.26.28806.0") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "90") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_std_99;c_std_11;c_function_prototypes;c_variadic_macros") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11") + +set(CMAKE_C_PLATFORM_ID "Windows") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_C_SIMULATE_VERSION "") +set(CMAKE_C_COMPILER_ARCHITECTURE_ID x64) +set(MSVC_C_ARCHITECTURE_ID x64) + +set(CMAKE_AR "") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe") +set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "Remarque : inclusion du fichier : ") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" new file mode 100644 index 00000000..44a3413d --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" @@ -0,0 +1,88 @@ +set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "MSVC") +set(CMAKE_CXX_COMPILER_VERSION "19.26.28806.0") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Windows") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") +set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID x64) +set(MSVC_CXX_ARCHITECTURE_ID x64) + +set(CMAKE_AR "") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe") +set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "Remarque : inclusion du fichier : ") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" new file mode 100644 index 0000000000000000000000000000000000000000..90bae4ebc43215cd8b92f19e363f2b0d21e6412b GIT binary patch literal 49152 zcmeHQ3w%_?)t^mvlMoU%0@2{}5*Ll~S_#+)1b0b7Z*+s(5FXaZX4&14Et}nS9}q09 z2_Z^)T}xZrpIX~e>l>=52mxE0040E^5w&V-YqZ+l7^4NO9>w8Aj(0qG!NZKxU+{scOEsD!ET4@`8Fe}f0aK}9jX8i6pb{O$lultRjnepNkO?RyCE}CH zYMQi4YF%IzCK@0*6+=n3{?Clrc}mBwBtBh?eM|$ReR6cH3h6WNW~@lV4FhXXZsvlj zh27wt$Y)TUDG^UY1h@m&AR>XN?`l7g;va#rnkgZ-GvZ`y*ZDwgKqx?1iIDKIKu1#) zGWJde3fd8%EA~@_gpUO!Q-TWNdIJj3SFXs7fC(Q9@$)KlYe%7=8-Zj*9}_m^ox==Xe0*>pLfjA8r&FEEHh0fy(fUt@9LHC^B<0?Tv-Q0ng z|9`oI^yyhNma(4kGZ6VkAliN!qC3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zqQQCUjq5UhB($2bSE*!?Hx$9W-G%;DUO!q~n_3>`_d=F?LUy_l3Dfn zj_H8FW7Z*f{4r`KqAaM>u^$mp@^f4by#3g3W?$M+kFUPrGAS;H7Uy3y#hfpA{P>Oz zzO+-Ezp!fFBHWuIDfS#oPX(@?9AEDaM)A73}4a$1An+UKN|AS47=() z_=?fwdM|y$D^MGmj1ARHXSjaK%8T;xg(bhY76*$(iLHT^Ak2=0qTvW_4^EIi znqlkm`&R~5 zctZI?)N6Io-mEyk*69m-^5@K++Q)lf?g!hLvr*V+-e>`B^7H>k1OEe583}^` literal 0 HcmV?d00001 diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" new file mode 100644 index 0000000000000000000000000000000000000000..83a03a5779fefc4ecc541088cd1029a157da4a19 GIT binary patch literal 49152 zcmeHQ3w%_?)t^mvlMoU%0@2{}5*LjkuoBP+M0X*fH@eYn2oGyyv+UlGEt}nS9}q14 zObAiZ>ss2{{?yu*THjE`7X)lI0ZKqo5w&7pMyu_Op^Dm1(OUQWpSkxYn+FJ1`+Z;C zg_$#R=FFKhXU?3Nxp#I``HgifoiS!aNF*3*2c(aU$48G86puP%+bH(vh-b#P8ywG! zudeq+gituRH0*8=Jnlds7!{UCLO2!>d;y{Cig`jq&?`;O&CRxGtZjFfbsM|ReMAq> z-8=E&Oyr-tcgn+~Ih_3PC=Sozc-MmyA7-3>;v+V|)mx@KY~t{xM^sqE^Hn}iJ@M3g z;4Ej%dwmv5lipjb;|{SxHZpD0$t(;^m5Mdz0aAbp3=~s3jj;?$|^W`8VLQ9XJFMxpL#cAB|2^xSc`Hi7gQ_k z2Jd7(gX&Cl|cnyiws zce7B?fdE~xpCTlEY$%x=QVG|ZP=LO2MXm=-`q+q{Po-Nu3I*K=BqREm{IL<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0n8ankJND{`87IbDQVDSc(`%_JXl0>Yw8dMPZ+Fw7K{@!a0J$ zWwFp)?Z$O^AR1oD*lSd>z!#3<-tPRs3SR&%u1>Fr@OvRkrLdE3M8b4`WttyQ-G#SY zcK{HCI>WwYnkPk%So|`VKk7ykp$fQ`g{%$ywO$9qb0s%Ps<-oBM6J35eaf>sW0l(% z!M!=%@v!&OD{(2@H+yANstzvnc_my_4zt`0Jy{*>D`!iIqXXBl`Sn{ob4Z7pLi}PT ztK#XoVF~v4IMHch5d~v^G--R?D$gA~@E*kA{C}{jz5-ptyG-;Fp=n@e z4a@)p9l4rRQ=gOu zzLFYPhj(1)c;3%#cRKIdx8cBs?hVR@LmLik?B1wsJhbufM)pg#o-w>WWm$LU-Q9lo pzPk_H-FQ#aJ!|hdyrJkpc1Zp12V0-FURZBkZv$=W^Z!Q!{{uOh2^s(Z literal 0 HcmV?d00001 diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" new file mode 100644 index 00000000..97eaaf6d --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" @@ -0,0 +1,6 @@ +set(CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe") +set(CMAKE_RC_COMPILER_ARG1 "") +set(CMAKE_RC_COMPILER_LOADED 1) +set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) +set(CMAKE_RC_OUTPUT_EXTENSION .res) +set(CMAKE_RC_COMPILER_ENV_VAR "RC") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" new file mode 100644 index 00000000..1bcc6955 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") +set(CMAKE_HOST_SYSTEM_NAME "Windows") +set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") +set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") + + + +set(CMAKE_SYSTEM "Windows-10.0.19041") +set(CMAKE_SYSTEM_NAME "Windows") +set(CMAKE_SYSTEM_VERSION "10.0.19041") +set(CMAKE_SYSTEM_PROCESSOR "AMD64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" new file mode 100644 index 00000000..d884b509 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" @@ -0,0 +1,671 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if !defined(__STDC__) +# if (defined(_MSC_VER) && !defined(__clang__)) \ + || (defined(__ibmxl__) || defined(__IBMC__)) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" new file mode 100644 index 0000000000000000000000000000000000000000..24ba18f33cbdb6bee01f041bdf079f5165fc76de GIT binary patch literal 95232 zcmeFadwf*I`S`z^WRoRiIg7FwKxDsfK@bc z6V2whEp2V9{n(aIuiBg1Rs^(~5FkPB-~~kmytHRsFA)?HQ1<(N=IkZ`wXg5%_xk?% z+bZ7j&#(Ue_di{H9yDsrAlp9&Y&m_E zJ-p@gs~3E`&bx5Y9k(pH>AT*!H{E{w9TD%h=6M%IZ})!tc5iU{Ro?I3ar3;fE>~em z2K4#bhyS?s_SnAcQ=b38{+o!G=hyGQUA^z$|ABhnw|{}kci+BAyjR%o-+#G!Kd}EU z^{(IlE#4oV_Q3w{sCR>UU-|913j}tyC$-f!+s*gq+idd=+?Y-4vW>P4%o#M?_B<); zGN~u?cB`=8E-wk^*ld(k|FUn}lYABA@h{glry*M?Qfx_J8q58YF$s z^n;N4=e619j9ql|O_7^ywtF5V37EDY@T}$O_s>r^##-5Ix-@bQ4JqPX+rL3%ve{b4 zF0?YLKGIj)Ao5-RrF{O`R|W%D2W+;7_-tFwcj?P_zMOCDqItL7G1sPWWCK?=C;4vs zQoc(C%>V!I%NWq(SC_cs;S#4F`=GcZuS9a_bAu&b-Ei%jZntUA=h=;-lH5+CEuL4B z{qpax{qn)rd`Y;z#jN>iXxqP3#-OU$y5jcDoBdbOFz;#^Q1hR|`E!fIW-~g??lFX? zOL({W)-W+E-JR%^Xj*&6_vV z>QXaBrixa+mbR;SJNeCDD43F%+yq?78^0d>$0H@~nPe-sI{Od0+}Nr$Ud-En;URx> zq{M4}i%83E!?j_S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k#)9-D|w#-?J^G25tPv~ILL2YH?He5!jgF3wPK-{DPK{2F+TxCQUA!^g z6!*sc@t$~Jd>|f;kH;tClkutebljG3BRGTDdkQ1Q$4A^)Ichl8c$86 zCR069()NY|ws(@kk_+Mn)8_oWBY(e!wFB0ZU&N>B65A>TZ|#J{$nBUl$~3^oP5 zL4U9(*cTiKMuX$QiQr^#ipa4IItJ?o8wZ;Py@US2p25Dsfx+nD_~69g)HLKJ_IixCixP7aLz6n<97J1VxGC%n z`@=oqzVJXe8XgZ%geSvO;pwm~;)v8m8Y4{+Z^R$ziS$JVh|BTFL}W5D6`79Mh|N0U zvWb}V6OVnvRLahG6U4w6J)fo5^Ypl#-Zn>p@2_^$yGGrko>AXuV6=C%e>6BcHkujD zj^;-5qbhEXJL9gnJMM}5;(>T?ygwd{kHs_bY&;jw$5q0fa3)*{cfynKB?5`wM1LZf z7)xXl*+edpPpG6l=}fwk?xZK_O9qm?$^K+8IhM>Mv&mdCpHwM(%9(Pd+$m4WmkOkM zQ~jx6YAlsWWmCCSKBdz3v@`8WyVIVuFC9qtru);u^jJER&Zcweyu_oEzr%nE+JnxZ zE9ee-g1%rN*c>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" new file mode 100644 index 0000000000000000000000000000000000000000..f9879eb014e510f1d2d9703e4a8105b1266780f3 GIT binary patch literal 95232 zcmeFadwf*I`S`z^WRoRiIg7FwKxDz7(I`e&Bypkc%0|w@M&bp*EBHYWFI5V=fK@bc z6U}nmmbUixscmg*TYJ^E76Gj$L`k^ctb(Y3mwMJ!iJ*{xvfuYJXEzC`eSKfQ*Z0pK zFHX+Po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&V(!BPIwaDgg?=r7)%5c^Ho%AHVNq@3GIhYJ4$CKG) zE}2gjk}73SIa98bJLO4vQ~p$cYA_W{ji<7yTq>U`q*U6TcBWlvciNNorv2&u^k6!e z9#3b}xpY2VNUMxJ Date: Tue, 23 Jun 2020 22:47:08 +0200 Subject: [PATCH 019/419] Epic emote logging --- Memory/Hooks.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e9ff1155..5631f635 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1124,6 +1124,14 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe } } moduleMgr->onSendPacket(packet); + + if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { + auto varInt = reinterpret_cast<__int64*>(reinterpret_cast<__int64>(packet) + 0x28); + auto text = reinterpret_cast(reinterpret_cast<__int64>(packet) + 0x30); + auto bet = reinterpret_cast(reinterpret_cast<__int64>(packet) + 0x50); + logF("emote %llX %s %i", *varInt, text->getText(), *bet); + } + oFunc(a, packet); } From 2b58bbcbb3e4a0d15eb25c8b449a8da5f5e9e0b7 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 23 Jun 2020 19:38:41 -0400 Subject: [PATCH 020/419] fix sigs --- SDK/CEntity.cpp | 8 +++++--- SDK/CInventory.h | 1 + SDK/CPacket.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index fc86c8f5..9142cbe7 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -4,14 +4,16 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { static unsigned int offset = 0; if (offset == 0) { // EnchantCommand::execute - offset = *reinterpret_cast(FindSignature("48 8D 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 90 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B ?? ?? ?? 8B") + 3); + //offset = *reinterpret_cast(FindSignature("48 8D 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 90 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B ?? ?? ?? 8B") + 3); + offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ?") + 3); } return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { static unsigned int offset = 0; if (offset == 0) { - offset = *reinterpret_cast(FindSignature("4C 8B 82 ?? ?? ?? ?? 48 8B B2") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + //offset = *reinterpret_cast(FindSignature("4C 8B 82 ?? ?? ?? ?? 48 8B B2") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + offset = *reinterpret_cast(FindSignature("48 8B 53 ? 48 8B F0 4C 8B 8A ? ? ? ? 41 80 B9 ? ? ? ? ? 75 18 49 8B 89 ? ? ? ? 41 8B 51 ? 4C 8B 01 41 FF 50") + 10); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies } return *reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } @@ -29,6 +31,6 @@ void C_LocalPlayer::applyTurnDelta(vec2_t *viewAngleDelta) { void C_LocalPlayer::setGameModeType(int gma) { // Player::setPlayerGameType using setGameMode = void(__thiscall *)(void *, int); - static setGameMode Game_Mode = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 5C 24 ?? 48 89 ?? 24 ?? 48 89 ?? 24 ?? 8B FA 48 8B D9 8B B1")); + static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); Game_Mode(this, gma); } diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 316b388a..2999b36a 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -16,6 +16,7 @@ class C_Inventory { void dropAll(int slot); virtual __int64 init(); + virtual bool serverInitItemStackIds(signed int a2, int a3, __int64 a4); virtual __int64 addContentChangeListener(__int64 a2); virtual __int64 removeContentChangeListener(__int64 a2); virtual C_ItemStack* getItemStack(int slot); diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 949d52f7..7efe36c0 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -90,7 +90,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& C_InventoryTransactionPacket::C_InventoryTransactionPacket() { static uintptr_t** InventoryTransactionPacketVtable = 0x0; if (InventoryTransactionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 49 89 53 C0 49 89 43"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 44 89 44 24 ? 0F 57 C0 66 0F 7F 44 24 ? 4C 89 84 24"); int offset = *reinterpret_cast(sigOffset + 3); InventoryTransactionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG From d7a8897315c6cc1146dfd9c55d67493f6df426ac Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 24 Jun 2020 14:42:37 -0400 Subject: [PATCH 021/419] fix .give --- Horion/Command/Commands/EnchantCommand.cpp | 3 +-- Horion/Command/Commands/GiveCommand.cpp | 10 ++-------- Horion/Command/Commands/setoffhandCommand.cpp | 12 +++--------- Memory/Hooks.cpp | 6 +++--- SDK/CInventoryTransaction.cpp | 10 +++++----- SDK/CInventoryTransaction.h | 2 +- SDK/CItem.cpp | 13 ++++++++++++- SDK/CItem.h | 9 ++++++++- SDK/CRakNetInstance.h | 4 ++-- 9 files changed, 37 insertions(+), 32 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index 6c676082..202e68bb 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -85,9 +85,8 @@ bool EnchantCommand::execute(std::vector* args) { firstAction = new C_InventoryAction(supplies->selectedHotbarSlot, item, nullptr); if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0) secondAction = new C_InventoryAction(0, nullptr, item, 32766, 100); - else { + else secondAction = new C_InventoryAction(0, nullptr, item, 507, 99999); - } manager->addInventoryAction(*firstAction); manager->addInventoryAction(*secondAction); delete firstAction; diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index 685d94ac..da4d3384 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -26,16 +26,10 @@ bool GiveCommand::execute(std::vector* args) { C_ItemStack* yot = nullptr; auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - using getItemFromId_t = C_Item***(__fastcall*)(void*, int itemID); - static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 66 85 D2 0F 84 ?? ?? ?? ?? 44 0F BF C2 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 44 89 44 24 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 41 0F B6 D0 48 33 D0 0F B6 44 24 ??")); - - using ItemRegistry__lookupByName_t = C_Item***(__fastcall*)(void*, void*, TextHolder); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 48 48 8B F1 48 89 4D 80 45 33 FF 44 89 7C 24 ? 4D 39 78 10 75 23 ")); - if (itemId == 0) { void* ItemPtr = malloc(0x8); void* idk = malloc(0x0); - C_Item*** cStack = ItemRegistry__lookupByNameF(ItemPtr, idk, TextHolder(args->at(1))); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, TextHolder(args->at(1))); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; @@ -45,7 +39,7 @@ bool GiveCommand::execute(std::vector* args) { free(idk); } else { void* ItemPtr = malloc(0x8); - C_Item*** cStack = getItemFromId(ItemPtr, itemId); + C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, itemId); if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) { clientMessageF("%sInvalid item ID!", RED); return true; diff --git a/Horion/Command/Commands/setoffhandCommand.cpp b/Horion/Command/Commands/setoffhandCommand.cpp index fa76fb09..f6f0bce3 100644 --- a/Horion/Command/Commands/setoffhandCommand.cpp +++ b/Horion/Command/Commands/setoffhandCommand.cpp @@ -27,17 +27,11 @@ bool setoffhandCommand::execute(std::vector* args) { C_Inventory* inv = g_Data.getLocalPlayer()->getSupplies()->inventory; C_ItemStack* yot = nullptr; auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - - using getItemFromId_t = C_Item***(__fastcall*)(void*, int itemID); - static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 66 85 D2 0F 84 ?? ?? ?? ?? 44 0F BF C2 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 44 89 44 24 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 41 0F B6 D0 48 33 D0 0F B6 44 24 ??")); - - using ItemRegistry__lookupByName_t = C_Item***(__fastcall*)(void*, void*, TextHolder); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 48 48 8B F1 48 89 4D 80 45 33 FF 44 89 7C 24 ? 4D 39 78 10 75 23 ")); - + if (itemId == 0) { void* ItemPtr = malloc(0x8); void* idk = malloc(0x0); - C_Item*** cStack = ItemRegistry__lookupByNameF(ItemPtr, idk, TextHolder(args->at(1))); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, TextHolder(args->at(1))); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; @@ -47,7 +41,7 @@ bool setoffhandCommand::execute(std::vector* args) { free(idk); } else { void* ItemPtr = malloc(0x8); - C_Item*** cStack = getItemFromId(ItemPtr, itemId); + C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, itemId); if (**cStack == NULL) { clientMessageF("%sInvalid item ID!", RED); return true; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 5631f635..2d49721b 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -241,8 +241,8 @@ void Hooks::Init() { //void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 ?? ?? ?? ?? ?? E8")); //g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); - //void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 48 8B F1 80 B9 ?? ?? ?? ?? ?? 74 51 C6 81 ?? ?? ?? ?? ?? 66 ?? ?? ?? ?? ?? ?? ?? 74 40 48 8D 45")); - //g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); + void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F1 48 C7 85 ? ? ? ? ? ? ? ? 48 8D 95 ? ? ? ? 48 8B 89 ? ? ? ?")); + g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D9 4D 8B F8")); g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); @@ -260,7 +260,7 @@ void Hooks::Init() { g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); #ifdef TEST_DEBUG - void* addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); + void* addAction = reinterpret_cast(FindSignature("40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 45 0F B6 F8 4C 8B F2 48 8B F9 48 8B 01 48 8B 88 ? ? ? ?")); g_Hooks.InventoryTransactionManager__addActionHook = std::make_unique(addAction, Hooks::InventoryTransactionManager__addAction); #endif diff --git a/SDK/CInventoryTransaction.cpp b/SDK/CInventoryTransaction.cpp index 8f8dc4f5..9050470a 100644 --- a/SDK/CInventoryTransaction.cpp +++ b/SDK/CInventoryTransaction.cpp @@ -1,9 +1,9 @@ #include "CInventoryTransaction.h" #include "../Utils/Utils.h" -void C_InventoryTransactionManager::addInventoryAction(const C_InventoryAction& action) { - using InventoryTransactionManager__addAction_t = void(__fastcall*)(C_InventoryTransactionManager*, C_InventoryAction const&); - static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); - //static auto InventoryTransactionManager__addAction = reinterpret_cast(0x7FF6617E6660); +void C_InventoryTransactionManager::addInventoryAction(const C_InventoryAction& action,bool idk) { + using InventoryTransactionManager__addAction_t = void(__fastcall*)(C_InventoryTransactionManager*, C_InventoryAction const&,bool); + //static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); + static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 45 0F B6 F8 4C 8B F2 48 8B F9 48 8B 01 48 8B 88 ? ? ? ?")); if (InventoryTransactionManager__addAction != 0) - InventoryTransactionManager__addAction(this, action); + InventoryTransactionManager__addAction(this, action,idk); } diff --git a/SDK/CInventoryTransaction.h b/SDK/CInventoryTransaction.h index b566b89c..9cf770d1 100644 --- a/SDK/CInventoryTransaction.h +++ b/SDK/CInventoryTransaction.h @@ -45,5 +45,5 @@ class C_InventoryTransactionManager { int unknown; //0x60 // Total size: 0x68 public: - void addInventoryAction(C_InventoryAction const& action); + void addInventoryAction(C_InventoryAction const& action , bool idk = false); }; diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 5cebca9e..080efe51 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -56,7 +56,18 @@ int C_ItemStack::getEnchantValue(int enchantId) { return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { - static uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? 83 7C 24 ?? 00 75 31"); + static uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? 48 8D 0D ? ? ? ? 48 89 05 ? ? ? ? C6 05 ? ? ? ? ? 48 83 C4"); int offset = *reinterpret_cast(sigOffset + 3); this->vTable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); } +C_Item*** ItemRegistry::getItemFromId(void* ptr, int itemId) { + using getItemFromId_t = C_Item ***(__fastcall *)(void *, int); + static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 66 85 D2 0F 84 ? ? ? ? 44 0F BF C2 48 B9 ? ? ? ? ? ? ? ? 44")); + return getItemFromId(ptr, itemId); +} + +C_Item ***ItemRegistry::lookUpByName(void * a1 , void *a2, TextHolder& text) { + using ItemRegistry__lookupByName_t = C_Item ***(__fastcall *)(void *, void *, TextHolder&); + static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 4C 8B F9 48 89 4D ?? 45 33 ED 44 89 6C 24 ?? 4D 39 68")); + return ItemRegistry__lookupByNameF(a1, a2, text); +} diff --git a/SDK/CItem.h b/SDK/CItem.h index 99fedf85..1709e080 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -256,7 +256,7 @@ class C_ItemStack { public: char count; //0x22 private: - char pad_0x1B[0x65]; //0x23 + char pad_0x1B[0x6D]; //0x23 public: C_ItemStack() { memset(this, 0x0, sizeof(C_ItemStack)); @@ -349,3 +349,10 @@ class C_ArmorItem : public C_Item { return ArmorSlot == 3; } }; + + +class ItemRegistry { +public: + static C_Item*** getItemFromId(void* ptr, int itemId); + static C_Item*** lookUpByName(void*, void*, TextHolder&); +}; \ No newline at end of file diff --git a/SDK/CRakNetInstance.h b/SDK/CRakNetInstance.h index 5997f68e..b65989d1 100644 --- a/SDK/CRakNetInstance.h +++ b/SDK/CRakNetInstance.h @@ -2,9 +2,9 @@ class C_RakNetInstance { private: - char pad_0x0008[0x358]; //0x0008 + char pad_0x0008[0x368]; //0x0000 public: - TextHolder serverIp; + TextHolder serverIp; //0x370 private: virtual ~C_RakNetInstance(); From f089fc7082c08ba70f7fa602f4b04a10b47b825d Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 24 Jun 2020 15:12:40 -0400 Subject: [PATCH 022/419] fix .enchant --- Horion/Command/Commands/EnchantCommand.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index 202e68bb..448875b6 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -115,9 +115,9 @@ bool EnchantCommand::execute(std::vector* args) { if (addEnchant(EnchantData, enchantPair)) { // Upper 4 bytes = level, lower 4 bytes = enchant type saveEnchantsToUserData(item, EnchantData); __int64 proxy = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->getSupplies()); - if (!*(uint8_t*)(proxy + 160)) - (*(void(__fastcall**)(unsigned long long, unsigned long long, C_ItemStack*))(**(unsigned long long**)(proxy + 168) + 64i64))( - *(unsigned long long*)(proxy + 168), + if (!*(uint8_t*)(proxy + 168)) + (*(void(__fastcall**)(unsigned long long, unsigned long long, C_ItemStack*))(**(unsigned long long**)(proxy + 176) + 72i64))( + *(unsigned long long*)(proxy + 176), *(unsigned int*)(proxy + 16), item); // Player::selectItem @@ -138,9 +138,9 @@ bool EnchantCommand::execute(std::vector* args) { if (addEnchant(EnchantData, enchantPair)) { // Upper 4 bytes = level, lower 4 bytes = enchant type saveEnchantsToUserData(item, EnchantData); __int64 proxy = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->getSupplies()); - if (!*(uint8_t*)(proxy + 160)) - (*(void(__fastcall**)(unsigned long long, unsigned long long, C_ItemStack*))(**(unsigned long long**)(proxy + 168) + 64i64))( - *(unsigned long long*)(proxy + 168), + if (!*(uint8_t*)(proxy + 168)) + (*(void(__fastcall**)(unsigned long long, unsigned long long, C_ItemStack*))(**(unsigned long long**)(proxy + 176) + 72i64))( + *(unsigned long long*)(proxy + 176), *(unsigned int*)(proxy + 16), item); // Player::selectItem From 768fbf7c62a56dd650e8ababbdc0078a1f1bc10a Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 24 Jun 2020 17:27:50 -0400 Subject: [PATCH 023/419] fix amor hud --- Horion/Module/Modules/AutoArmor.cpp | 2 +- Horion/Module/Modules/HudModule.cpp | 4 ++-- SDK/CItem.cpp | 13 +++++++------ SDK/CItem.h | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Horion/Module/Modules/AutoArmor.cpp b/Horion/Module/Modules/AutoArmor.cpp index 39817b28..49d4f044 100644 --- a/Horion/Module/Modules/AutoArmor.cpp +++ b/Horion/Module/Modules/AutoArmor.cpp @@ -43,7 +43,7 @@ void AutoArmor::onTick(C_GameMode* gm) { static C_ItemStack* emptyItemStack = nullptr; if (emptyItemStack == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 40 38 ?? ?? 0F 84 ?? ?? ?? ?? 48 8B 4A"); + uintptr_t sigOffset = FindSignature("48 8D 3D ? ? ? ? 80 B8 ? ? ? ? ? 75 19 48 8B 88 ? ? ? ? 48 8B 11 4C 8B 42 28 8B 50 10"); int offset = *reinterpret_cast(sigOffset + 3); emptyItemStack = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 1e7395b7..63c2740f 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -68,7 +68,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { DrawUtils::drawText(textPos, &coordsZ, MC_Color(200, 200, 200), 1.f); } } - /*{ // ArmorHUD + { // ArmorHUD if (!(g_Data.getLocalPlayer() == nullptr || !this->displayArmor || !GameData::canUseMoveKeys())) { static float constexpr scale = 1.f; static float constexpr opacity = 0.25f; @@ -99,5 +99,5 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { DrawUtils::drawKeystroke(*input->rightKey, vec2_t(54, windowSize.y - 52)); DrawUtils::drawKeystroke(*input->spaceBarKey, vec2_t(10, windowSize.y - 30)); } - }*/ + } } \ No newline at end of file diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 080efe51..216cc5fe 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -5,7 +5,7 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C_ClientInstance *client, MinecraftGame *game) { memset(this, 0, sizeof(C_BaseActorRenderContext)); using BaseActorRenderContext_t = __int64(__fastcall*)(C_BaseActorRenderContext*, C_ScreenContext*, C_ClientInstance*, MinecraftGame*); - static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8D 05 ?? ?? ?? ?? 49 8B D8 48 89 01 48 8B F9 8B 42 ?? 89 41 ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 59 ?? 4C 89 49 ?? 48 89 51 ?? 49 8B C8")); + static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8D 05 ? ? ? ? 33 F6 48 89 01 49 8B D8 48 89 71 ? 48 8B F9 8B 42")); BaseActorRenderContext_constructor(this, ScreenCtx, client, game); } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { @@ -23,13 +23,14 @@ C_ItemStack::C_ItemStack(const C_ItemStack &src) { C_ItemStack::C_ItemStack(const Tag &tag) { memset(this, 0x0, sizeof(C_ItemStack)); this->setVtable(); - using ItemStackBase__loadItemF = void(__fastcall*)(C_ItemStack*,Tag const&); - static ItemStackBase__loadItemF ItemStackBase__loadItem = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 18 0F 29 70 B8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA 4C 8B E9")); - ItemStackBase__loadItem(this, tag); + fromTag(tag); + /*using ItemStackBase__loadItemF = void(__fastcall*)(C_ItemStack*,Tag const&); + static ItemStackBase__loadItemF ItemStackBase__loadItem = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); + ItemStackBase__loadItem(this, tag);*/ } void C_ItemStack::fromTag(const Tag &tag) { using ItemStackBase__loadItemF = void(__fastcall*)(C_ItemStack*,Tag const&); - static ItemStackBase__loadItemF fromTag = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 18 0F 29 70 B8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA 4C 8B E9")); + static ItemStackBase__loadItemF fromTag = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); fromTag(this, tag); } void C_ItemStack::save(CompoundTag **tag) { @@ -52,7 +53,7 @@ void C_ItemStack::reinit(C_Item &item, int count, int itemData) { } int C_ItemStack::getEnchantValue(int enchantId) { using getEnchantsLevel_t = int(__fastcall*)(int, C_ItemStack*); - static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B F2 8B ?? 33 ?? 48 8B")); + static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8 ? ? ? ?")); return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { diff --git a/SDK/CItem.h b/SDK/CItem.h index 1709e080..4e1d51fb 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -18,11 +18,11 @@ class MinecraftGame; class C_BaseActorRenderContext { private: - char pad_0x0[0x50]; //0x0000 + char pad_0x0[0x58]; //0x0000 public: - C_ItemRenderer* renderer; //0x0050 + C_ItemRenderer* renderer; //0x0058 private: - char pad_0x50[0x280 - 0x58]; //0x58 + char pad_0x50[0x228]; //0x60 public: C_BaseActorRenderContext(C_ScreenContext* ScreenCtx, C_ClientInstance* client, MinecraftGame* game); }; From 9dd0cfeac531ca4db01465ff2d932e75684d7163 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 24 Jun 2020 17:34:02 -0400 Subject: [PATCH 024/419] fix vtable --- SDK/CPacket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 7efe36c0..485ba014 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -120,7 +120,7 @@ C_TextPacket::C_TextPacket() { C_MovePlayerPacket::C_MovePlayerPacket() { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 48 8B 82 ?? ?? ?? ?? 48 89 41 ?? 48 8B 02 48 8B CA FF 50"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -134,7 +134,7 @@ C_MovePlayerPacket::C_MovePlayerPacket() { C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 48 8B 82 ?? ?? ?? ?? 48 89 41 ?? 48 8B 02 48 8B CA FF 50"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG From 5cdae71d5275292e85e0c78de2bfefea2b707170 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 25 Jun 2020 14:09:54 -0400 Subject: [PATCH 025/419] fix epic nbt --- SDK/CEntity.h | 12 ++++++------ SDK/Tag.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 26b91158..fc4616fe 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -11,13 +11,13 @@ class C_GameMode; class PointingStruct { private: - char pad_0x0000[0x850]; //0x0000 + char pad_0x0000[0x8E0]; //0x0000 public: - int rayHitType; //0x0850 - int blockSide; //0x0854 - vec3_ti block; //0x0858 - vec3_t rayHitVec; //0x0864 - C_Entity *entityPtr; //0x0870 + int rayHitType; //0x08E0 + int blockSide; //0x08E4 + vec3_ti block; //0x08E8 + vec3_t rayHitVec; //0x08F4 + C_Entity *entityPtr; //0x0900 }; class C_Player; diff --git a/SDK/Tag.cpp b/SDK/Tag.cpp index 835a9650..3aee427f 100644 --- a/SDK/Tag.cpp +++ b/SDK/Tag.cpp @@ -268,7 +268,7 @@ CompoundTag::CompoundTag() { } void CompoundTag::put(TextHolder& tag, std::unique_ptr value) { using CompoundTag__putF = void(__fastcall*)(CompoundTag*, TextHolder&, std::unique_ptr); - static CompoundTag__putF func = reinterpret_cast(FindSignature("4C 8B DC 53 56 57 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 49 8B F8 48 8B DA 49 89 53 ?? 4D 89 43 ?? 49 8B 30 48 85 F6")); + static CompoundTag__putF func = reinterpret_cast(FindSignature("4C 8B DC 55 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 49 89 5B ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B D8 48 8B FA 48 8B E9")); func(this, tag, std::move(value)); } void Handler::handleWrite(Tag* value, std::stringstream& builder) { From b69859657b6eddffd73d414f6357c139fc4a4bf3 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 25 Jun 2020 20:07:51 -0400 Subject: [PATCH 026/419] fix sigs & player vtable + entity vtable --- .../Commands/CommandBlockExploitCommand.cpp | 2 +- Horion/Command/Commands/DupeCommand.cpp | 9 +--- Horion/Command/Commands/GiveCommand.cpp | 9 +--- .../Module/Modules/ForceOpenCommandBlock.cpp | 4 +- SDK/CEntity.h | 47 +++++++++++++------ SDK/CPacket.cpp | 14 +++--- 6 files changed, 47 insertions(+), 38 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 78e47cbd..fcace7b0 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -54,7 +54,7 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { forceOpenCmdBlockModule->distance = g_Data.getLocalPlayer()->getPos()->dist(pos); forceOpenCmdBlockModule->isInCommandBlock = true; - g_Data.getLocalPlayer()->openCommandBlock(pos); + //g_Data.getLocalPlayer()->openCommandBlock(pos); return true; } else if (args->at(1) == "beehive") { assertTrue(args->size() > 3); diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index 1552d050..8f373ed8 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -28,13 +28,8 @@ bool DupeCommand::execute(std::vector* args) { C_InventoryAction* firstAction = nullptr; C_InventoryAction* secondAction = nullptr; - if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0) { - firstAction = new C_InventoryAction(slot, nullptr, item, 32512); - secondAction = new C_InventoryAction(0, item, nullptr, 156, 100); - } else { - firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, item); - } + firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); + secondAction = new C_InventoryAction(slot, nullptr, item); transactionManager->addInventoryAction(*firstAction); transactionManager->addInventoryAction(*secondAction); diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index da4d3384..1d6cfb22 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -62,13 +62,8 @@ bool GiveCommand::execute(std::vector* args) { C_InventoryAction* firstAction = nullptr; C_InventoryAction* secondAction = nullptr; - if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0) { - firstAction = new C_InventoryAction(slot, nullptr, yot, 32512); - secondAction = new C_InventoryAction(0, yot, nullptr, 156, 100); - } else { - firstAction = new C_InventoryAction(0, yot, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, yot); - } + firstAction = new C_InventoryAction(0, yot, nullptr, 507, 99999); + secondAction = new C_InventoryAction(slot, nullptr, yot); transactionManager->addInventoryAction(*firstAction); transactionManager->addInventoryAction(*secondAction); diff --git a/Horion/Module/Modules/ForceOpenCommandBlock.cpp b/Horion/Module/Modules/ForceOpenCommandBlock.cpp index 55e14ebd..b4fde526 100644 --- a/Horion/Module/Modules/ForceOpenCommandBlock.cpp +++ b/Horion/Module/Modules/ForceOpenCommandBlock.cpp @@ -25,11 +25,11 @@ void ForceOpenCommandBlock::onTick(C_GameMode* gm) { distance = g_Data.getLocalPlayer()->getPos()->dist(*pointingStruct->entityPtr->getPos()); isInCommandBlock = true; __int64* id = pointingStruct->entityPtr->getUniqueId(); - g_Data.getLocalPlayer()->openCommandBlockMinecart(*id); + //g_Data.getLocalPlayer()->openCommandBlockMinecart(*id); } else if (block != nullptr && (blockId == 137 || blockId == 188 || blockId == 189)) { distance = g_Data.getLocalPlayer()->getPos()->dist(pointingStruct->block.toFloatVector()); isInCommandBlock = true; - g_Data.getLocalPlayer()->openCommandBlock(pointingStruct->block); + //g_Data.getLocalPlayer()->openCommandBlock(pointingStruct->block); } } else if (!GameData::isRightClickDown()) { clicked = false; diff --git a/SDK/CEntity.h b/SDK/CEntity.h index fc4616fe..02801585 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -390,6 +390,7 @@ class C_Entity { virtual bool canBePulledIntoVehicle(void) const; private: + virtual bool returnTrue(void) const; virtual __int64 inCaravan(void) const; public: @@ -648,6 +649,13 @@ class C_Entity { virtual __int64 _endJump(void); virtual __int64 updateGliding(void); virtual __int64 _allowAscendingScaffolding(void) const; + virtual __int64 prepareRegion(__int64 &); + virtual __int64 destroyRegion(void); + virtual __int64 suspendRegion(void); + virtual __int64 _fireWillChangeDimension(void); + virtual __int64 _fireDimensionChanged(void); + virtual __int64 changeDimensionWithCredits(__int64); + virtual __int64 tickWorld(__int64 const &); public: C_InventoryTransactionManager *getTransactionManager(); @@ -701,7 +709,7 @@ class C_Player : public C_Entity { virtual __int64 frameUpdate(__int64 &); virtual __int64 getTickingOffsets(void) const; virtual __int64 moveView(void); - virtual __int64 moveSpawnView(vec3_t const &); + //virtual __int64 moveSpawnView(vec3_t const &); public: virtual void setName(std::string const &); @@ -725,13 +733,13 @@ class C_Player : public C_Entity { virtual void setPermissions(int); private: - virtual __int64 startCrafting(vec3_ti const &, bool); - virtual __int64 startStonecutting(vec3_ti const &); + //virtual __int64 startCrafting(vec3_ti const &, bool); + //virtual __int64 startStonecutting(vec3_ti const &); virtual __int64 startDestroying(void); virtual __int64 stopDestroying(void); public: - virtual __int64 openContainer(vec3_ti const &); + /*virtual __int64 openContainer(vec3_ti const &); virtual __int64 openContainer(__int64 const &); virtual __int64 openFurnace(vec3_ti const &); virtual __int64 openBlastFurnace(vec3_ti const &); @@ -748,32 +756,36 @@ class C_Player : public C_Entity { virtual __int64 openBook(int, bool, int, __int64 *); virtual __int64 openCommandBlock(vec3_ti const &); virtual __int64 openCommandBlockMinecart(__int64 const &); - virtual __int64 openHorseInventory(__int64 const &); + virtual __int64 openHorseInventory(__int64 const &);*/ + virtual bool returnFalse0() const; + virtual bool returnFalse1() const; + virtual __int64 openTrading(__int64 const &, bool); public: virtual bool canOpenContainerScreen(void); private: - virtual __int64 openChalkboard(__int64 &, bool); - virtual __int64 openNpcInteractScreen(C_Entity &); + virtual bool returnFalse_0() const; + virtual bool returnFalse_1() const; public: virtual __int64 openInventory(void); - virtual __int64 openStructureEditor(vec3_ti const &); + //virtual __int64 openStructureEditor(vec3_ti const &); private: - virtual __int64 openLabTable(vec3_ti const &); + /*virtual __int64 openLabTable(vec3_ti const &); virtual __int64 openElementConstructor(vec3_ti const &); virtual __int64 openCompoundCreator(vec3_ti const &); virtual __int64 openMaterialReducer(vec3_ti const &); virtual __int64 openLoom(vec3_ti const &); virtual __int64 openStonecutter(vec3_ti const &); virtual __int64 openCartographyTable(vec3_ti const &); - virtual __int64 displayChatMessage(std::string const &, std::string const &); - virtual __int64 displayClientMessage(std::string const &); - virtual __int64 displayLocalizableMessage(std::string const &, __int64 const &); + virtual __int64 displayChatMessage(std::string const &, std::string const &);*/ + virtual bool returnFalse_2() const; + virtual bool returnFalse_3() const; virtual __int64 displayTextObjectMessage(__int64 const &, std::string const &, std::string const &); + virtual __int64 displayTextObjectMessageWhisperMessage(__int64 const &, std::string const &, std::string const &); virtual __int64 displayWhisperMessage(std::string const &, std::string const &, std::string const &, std::string const &); virtual __int64 startSleepInBed(vec3_ti const &); virtual __int64 stopSleepInBed(bool, bool); @@ -784,16 +796,17 @@ class C_Player : public C_Entity { private: virtual __int64 getSleepTimer(void) const; virtual __int64 getPreviousTickSleepTimer(void) const; - virtual __int64 openSign(vec3_ti const &); + virtual bool returnFalse_4() const; + virtual bool returnFalse_5() const; public: - virtual bool isLocalC_Player(void) const; + virtual bool returnFalse_6() const; virtual bool isHostingC_Player(void) const; virtual bool isLoading(void) const; virtual bool isC_PlayerInitialized(void) const; private: - virtual __int64 stopLoading(void); + virtual bool returnFalse_7() const; virtual __int64 registerTrackedBoss(__int64); virtual __int64 unRegisterTrackedBoss(__int64); @@ -841,6 +854,10 @@ class C_Player : public C_Entity { private: virtual __int64 sendNetworkPacket(__int64 &) const; virtual __int64 getC_PlayerEventCoordinator(void); + virtual __int64 getMoveInputHandler(void); + virtual __int64 getInputMode(void); + virtual __int64 getPlayMode(void); + virtual void **reportMovementTelemetry(__int64 *); virtual __int64 onMoveC_PlayerPacketNormal(vec3_t const &, vec2_t const &, float); }; diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 485ba014..891d3e62 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -7,7 +7,7 @@ TextHolder* C_Packet::getName() { LevelSoundEventPacket::LevelSoundEventPacket() { static uintptr_t** LevelSoundEventPacketVtable = 0x0; if (LevelSoundEventPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 44 24 ?? 44 89 74 24 ?? F2 0F 10 06 F2 0F 11 44 24 ??"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4D ? C7 45 ? ? ? ? ? F2 0F 10 00 F2 0F 11 45 ? 8B 40"); int offset = *reinterpret_cast(sigOffset + 3); LevelSoundEventPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -22,7 +22,7 @@ LevelSoundEventPacket::LevelSoundEventPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket() { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 48 89 11 48 89 79 ?? 48 89 79 ?? 89 79 ?? 48 89 79 ?? 48 89 79 ??"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -36,7 +36,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused) { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 48 89 11 48 89 79 ?? 48 89 79 ?? 89 79 ?? 48 89 79 ?? 48 89 79 ??"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -55,7 +55,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos C_ActorFallPacket::C_ActorFallPacket() { static uintptr_t** ActorFallPacketVtable = 0x0; if (ActorFallPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 48 89 4D ?? 48 89 45 EF F3 44 0F 11 45 F7 88 5D FB"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4D ? 48 89 45 ? F3 44 0F 11 45 ? 88 5D F3"); int offset = *reinterpret_cast(sigOffset + 3); ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -69,7 +69,7 @@ C_ActorFallPacket::C_ActorFallPacket() { C_MobEquipmentPacket::C_MobEquipmentPacket() { static uintptr_t** MobEquipmentPacketVtable = 0x0; if (MobEquipmentPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 48 89 51 ?? 48 83 C1 28 49 8B D0"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 89 51 ? 48 8D 59 ? 48 89 5C 24 ? 49 8B D0"); int offset = *reinterpret_cast(sigOffset + 3); MobEquipmentPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -83,7 +83,9 @@ C_MobEquipmentPacket::C_MobEquipmentPacket() { C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& item, int hotbarSlot, int inventorySlot) { memset(this, 0x0, sizeof(C_MobEquipmentPacket)); using MobEquimentPacketConstructor_t = void(__fastcall*)(C_MobEquipmentPacket*, __int64, C_ItemStack&, int, int, char); - static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 08 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 48 48 89 74 24 50 41 8B F9 48 8B F1")); + //static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 08 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 48 48 89 74 24 50 41 8B F9 48 8B F1")); + static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = nullptr; + if (MobEquimentPacketConstructor != 0) MobEquimentPacketConstructor(this, entityRuntimeId, item, hotbarSlot, inventorySlot, 0); } From 4c763f4b10e2e6fdcda43fd3ef70e26e4bab05b6 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 25 Jun 2020 20:09:02 -0400 Subject: [PATCH 027/419] yeet --- SDK/CEntity.h | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 02801585..66314ac0 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -709,7 +709,6 @@ class C_Player : public C_Entity { virtual __int64 frameUpdate(__int64 &); virtual __int64 getTickingOffsets(void) const; virtual __int64 moveView(void); - //virtual __int64 moveSpawnView(vec3_t const &); public: virtual void setName(std::string const &); @@ -733,30 +732,10 @@ class C_Player : public C_Entity { virtual void setPermissions(int); private: - //virtual __int64 startCrafting(vec3_ti const &, bool); - //virtual __int64 startStonecutting(vec3_ti const &); virtual __int64 startDestroying(void); virtual __int64 stopDestroying(void); public: - /*virtual __int64 openContainer(vec3_ti const &); - virtual __int64 openContainer(__int64 const &); - virtual __int64 openFurnace(vec3_ti const &); - virtual __int64 openBlastFurnace(vec3_ti const &); - virtual __int64 openSmoker(vec3_ti const &); - virtual __int64 openEnchanter(vec3_ti const &); - virtual __int64 openAnvil(vec3_ti const &); - virtual __int64 openGrindstone(vec3_ti const &); - virtual __int64 openBrewingStand(vec3_ti const &); - virtual __int64 openHopper(vec3_ti const &); - virtual __int64 openHopper(__int64 const &); - virtual __int64 openDispenser(vec3_ti const &, bool); - virtual __int64 openBeacon(vec3_ti const &); - virtual __int64 openPortfolio(void); - virtual __int64 openBook(int, bool, int, __int64 *); - virtual __int64 openCommandBlock(vec3_ti const &); - virtual __int64 openCommandBlockMinecart(__int64 const &); - virtual __int64 openHorseInventory(__int64 const &);*/ virtual bool returnFalse0() const; virtual bool returnFalse1() const; @@ -771,17 +750,8 @@ class C_Player : public C_Entity { public: virtual __int64 openInventory(void); - //virtual __int64 openStructureEditor(vec3_ti const &); private: - /*virtual __int64 openLabTable(vec3_ti const &); - virtual __int64 openElementConstructor(vec3_ti const &); - virtual __int64 openCompoundCreator(vec3_ti const &); - virtual __int64 openMaterialReducer(vec3_ti const &); - virtual __int64 openLoom(vec3_ti const &); - virtual __int64 openStonecutter(vec3_ti const &); - virtual __int64 openCartographyTable(vec3_ti const &); - virtual __int64 displayChatMessage(std::string const &, std::string const &);*/ virtual bool returnFalse_2() const; virtual bool returnFalse_3() const; virtual __int64 displayTextObjectMessage(__int64 const &, std::string const &, std::string const &); From 6b16d67ef16c714c094b5ab9ca0809ce9bd563d4 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 25 Jun 2020 23:03:54 -0400 Subject: [PATCH 028/419] fix --- Horion/Module/Modules/NoSlowDown.cpp | 63 ++++++++++++++++++++---- Horion/Module/Modules/NoSlowDown.h | 1 + Horion/Module/Modules/Reach.cpp | 6 +-- Memory/Hooks.cpp | 71 ++++++++-------------------- SDK/CInventory.cpp | 2 +- 5 files changed, 79 insertions(+), 64 deletions(-) diff --git a/Horion/Module/Modules/NoSlowDown.cpp b/Horion/Module/Modules/NoSlowDown.cpp index e1567b95..3b500f4a 100644 --- a/Horion/Module/Modules/NoSlowDown.cpp +++ b/Horion/Module/Modules/NoSlowDown.cpp @@ -1,6 +1,7 @@ #include "NoSlowDown.h" #include + #include "../../../Utils/Logger.h" #include "../../../Utils/Utils.h" @@ -15,33 +16,75 @@ const char* NoSlowDown::getModuleName() { } void NoSlowDown::onEnable() { - if (opcode == 0) - opcode = reinterpret_cast(FindSignature("75 2F 4D 85 FF 75 2A")); + if (opcode == 0 || opcode1 == 0) { + opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 7E")); + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + } DWORD oldProtect = 0; - if (!VirtualProtect(opcode, 1, PAGE_EXECUTE_READWRITE, &oldProtect)) { + if (!VirtualProtect(opcode, 5, PAGE_EXECUTE_READWRITE, &oldProtect)) { +#ifdef _DEBUG + logF("couldnt unprotect memory send help"); + __debugbreak(); +#endif + } else { + opcode[0] = 0x90; + opcode[1] = 0x90; + opcode[2] = 0x90; + opcode[3] = 0x90; + opcode[4] = 0x90; + VirtualProtect(opcode, 5, oldProtect, &oldProtect); + } + + if (!VirtualProtect(opcode1, 5, PAGE_EXECUTE_READWRITE, &oldProtect)) { #ifdef _DEBUG logF("couldnt unprotect memory send help"); __debugbreak(); #endif } else { - *opcode = 0xEB; - VirtualProtect(opcode, 1, oldProtect, &oldProtect); + opcode1[0] = 0x90; + opcode1[1] = 0x90; + opcode1[2] = 0x90; + opcode1[3] = 0x90; + opcode1[4] = 0x90; + VirtualProtect(opcode1, 5, oldProtect, &oldProtect); } } void NoSlowDown::onDisable() { - if (opcode == 0) - opcode = reinterpret_cast(FindSignature("75 2F 4D 85 FF 75 2A")); + if (opcode == 0 || opcode1 == 0) { + opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 7E")); + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + } DWORD oldProtect = 0; - if (!VirtualProtect(opcode, 1, PAGE_EXECUTE_READWRITE, &oldProtect)) { + if (!VirtualProtect(opcode, 5, PAGE_EXECUTE_READWRITE, &oldProtect)) { +#ifdef _DEBUG + logF("couldnt unprotect memory send help"); + __debugbreak(); +#endif + } else { + opcode[0] = 0xF3; + opcode[1] = 0x0F; + opcode[2] = 0x11; + opcode[3] = 0x46; + opcode[4] = 0x0C; + //opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C}; + VirtualProtect(opcode, 5, oldProtect, &oldProtect); + }; + + if (!VirtualProtect(opcode1, 5, PAGE_EXECUTE_READWRITE, &oldProtect)) { #ifdef _DEBUG logF("couldnt unprotect memory send help"); __debugbreak(); #endif } else { - *opcode = 0x75; - VirtualProtect(opcode, 1, oldProtect, &oldProtect); + opcode1[0] = 0xF3; + opcode1[1] = 0x0F; + opcode1[2] = 0x11; + opcode1[3] = 0x47; + opcode1[4] = 0x0C; + //opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C}; + VirtualProtect(opcode1, 5, oldProtect, &oldProtect); }; } diff --git a/Horion/Module/Modules/NoSlowDown.h b/Horion/Module/Modules/NoSlowDown.h index 90f2f725..8805c50f 100644 --- a/Horion/Module/Modules/NoSlowDown.h +++ b/Horion/Module/Modules/NoSlowDown.h @@ -3,6 +3,7 @@ class NoSlowDown : public IModule { private: uint8_t* opcode = 0; + uint8_t* opcode1 = 0; public: NoSlowDown(); diff --git a/Horion/Module/Modules/Reach.cpp b/Horion/Module/Modules/Reach.cpp index f84f84bf..ace372b9 100644 --- a/Horion/Module/Modules/Reach.cpp +++ b/Horion/Module/Modules/Reach.cpp @@ -24,10 +24,10 @@ void Reach::onTick(C_GameMode* gm) { void Reach::onEnable() { static uintptr_t sigOffset = 0x0; if (sigOffset == 0x0) { - sigOffset = FindSignature("EB 18 F3 0F 10 05 ?? ?? ?? ?? 44 0F"); + sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 0F 2F F8 76"); if (sigOffset != 0x0) { - int offset = *reinterpret_cast((sigOffset + 6)); // Get Offset from code - reachPtr = reinterpret_cast(sigOffset + offset + 10); + int offset = *reinterpret_cast((sigOffset + 4)); // Get Offset from code + reachPtr = reinterpret_cast(sigOffset + offset + 8); originalReach = *reachPtr; } } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2d49721b..c4fed93f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1,4 +1,5 @@ #include "Hooks.h" + #include "../SDK/Tag.h" Hooks g_Hooks; @@ -326,7 +327,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - __int64 a1 = (*(__int64 (__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + __int64 a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; @@ -380,9 +381,8 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { static auto oText = g_Hooks.RenderTextHook->GetFastcall<__int64, __int64, C_MinecraftUIRenderContext*>(); C_GuiData* dat = g_Data.getClientInstance()->getGuiData(); - - DrawUtils::setCtx(renderCtx, dat); + DrawUtils::setCtx(renderCtx, dat); { static bool wasConnectedBefore = false; @@ -473,7 +473,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { #if defined(_BETA) or defined(_DEBUG) // Draw Custom Geo Button if (g_Data.allowWIPFeatures()) { - if (HImGui.Button("Load Script Folder", vec2_t(wid.x * (0.765f - 0.5f), wid.y * 0.92f), true)) { HorionDataPacket packet; packet.cmd = CMD_FOLDERCHOOSER; @@ -792,7 +791,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { // Zoom calc { static auto zoomModule = moduleMgr->getModule(); - if(zoomModule->isEnabled()) zoomModule->target = zoomModule->strength; + if (zoomModule->isEnabled()) zoomModule->target = zoomModule->strength; zoomModule->modifier = zoomModule->target - ((zoomModule->target - zoomModule->modifier) * 0.8f); if (abs(zoomModule->modifier - zoomModule->target) < 0.1f && !zoomModule->isEnabled()) zoomModule->zooming = false; @@ -924,12 +923,12 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { return oLerp(_this, motVec); static auto noKnockbackmod = moduleMgr->getModule(); - if (noKnockbackmod->isEnabled()) { + /*if (noKnockbackmod->isEnabled()) { static void* networkSender = reinterpret_cast(FindSignature("41 80 BF ?? ?? ?? ?? 00 0F 85 ?? ?? ?? ?? FF")); if (networkSender == _ReturnAddress()) { motVec = _this->velocity.lerp(motVec, noKnockbackmod->xModifier, noKnockbackmod->yModifier, noKnockbackmod->xModifier); } - } + }*/ oLerp(_this, motVec); } @@ -1034,34 +1033,11 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) LilPlump plump = *it; g_Data.getGuiData()->displayClientMessageF("%s%s - %s%s", plump.cmdAlias.c_str(), GRAY, ITALIC, plump.command->getDescription()); } - } else { - g_Data.getGuiData()->displayClientMessageF("=========="); - if (strcmp(text->getText(), ".give ") == 0) { - std::string tag = Utils::getClipboardText(); - if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { - std::string nbt = ".give beehive 64 0 "; - nbt += "COMPOUND_TAG"; - text->setText(nbt); - syncShit(winrt_ptr, text); - g_Data.getGuiData()->displayClientMessage(&tag); - return; - } - } else if (strcmp(text->getText(), ".nbt load") == 0) { - std::string tag = Utils::getClipboardText(); - if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { - std::string nbt = ".nbt load "; - nbt += "COMPOUND_TAG"; - text->setText(nbt); - syncShit(winrt_ptr, text); - g_Data.getGuiData()->displayClientMessage(&tag); - return; - } - } - if (firstResult.command->getUsage(firstResult.cmdAlias.c_str() + 1)[0] == 0) - g_Data.getGuiData()->displayClientMessageF("%s%s %s- %s", WHITE, firstResult.cmdAlias.c_str(), GRAY, firstResult.command->getDescription()); - else - g_Data.getGuiData()->displayClientMessageF("%s%s %s %s- %s", WHITE, firstResult.cmdAlias.c_str(), firstResult.command->getUsage(firstResult.cmdAlias.c_str() + 1 /*exclude prefix*/), GRAY, firstResult.command->getDescription()); } + if (firstResult.command->getUsage(firstResult.cmdAlias.c_str() + 1)[0] == 0) + g_Data.getGuiData()->displayClientMessageF("%s%s %s- %s", WHITE, firstResult.cmdAlias.c_str(), GRAY, firstResult.command->getDescription()); + else + g_Data.getGuiData()->displayClientMessageF("%s%s %s %s- %s", WHITE, firstResult.cmdAlias.c_str(), firstResult.command->getUsage(firstResult.cmdAlias.c_str() + 1 /*exclude prefix*/), GRAY, firstResult.command->getDescription()); if (firstResult.shouldReplace) { if (search.size() == firstResult.cmdAlias.size() - 1 && searchResults.size() == 1) { @@ -1226,7 +1202,6 @@ int Hooks::BlockLegacy_getRenderLayer(C_BlockLegacy* a1) { static auto xrayMod = moduleMgr->getModule(); if (xrayMod->isEnabled()) { - char* text = a1->name.getText(); if (strstr(text, "ore") == NULL) if (strcmp(text, "lava") != NULL) @@ -1450,7 +1425,7 @@ __int64 Hooks::ConnectionRequest_create(__int64 _this, __int64 privateKeyManager auto overrideGeo = std::get<1>(geoOverride); newGeometryData = new TextHolder(*overrideGeo.get()); } else { // Default Skin - /*char* str; // Obj text + /*char* str; // Obj text { auto hResourceObj = FindResourceA(g_Data.getDllModule(), MAKEINTRESOURCEA(IDR_OBJ), "TEXT"); auto hMemoryObj = LoadResource(g_Data.getDllModule(), hResourceObj); @@ -1962,22 +1937,22 @@ void Hooks::LocalPlayer__updateFromCamera(__int64 a1, C_Camera* camera) { auto freelookMod = moduleMgr->getModule(); auto noHurtcamMod = moduleMgr->getModule(); - if(freelookMod->redirectMouse){ + if (freelookMod->redirectMouse) { freelookMod->cameraFacesFront = camera->facesPlayerFront; freelookMod->isThirdPerson = camera->renderPlayerModel; - if(freelookMod->resetViewTick >= 0){ + if (freelookMod->resetViewTick >= 0) { camera->setOrientationDeg(freelookMod->lastCameraAngle.x, freelookMod->lastCameraAngle.y, 0); - }else{ + } else { camera->getPlayerRotation(&freelookMod->lastCameraAngle); } return; } - if(noHurtcamMod->isEnabled() && g_Data.isInGame() && g_Data.getLocalPlayer()->isAlive()){ + if (noHurtcamMod->isEnabled() && g_Data.isInGame() && g_Data.getLocalPlayer()->isAlive()) { vec2_t rot; camera->getPlayerRotation(&rot); - if(camera->facesPlayerFront){ - rot.x *= -1; // rotate back + if (camera->facesPlayerFront) { + rot.x *= -1; // rotate back rot.y += 180; rot = rot.normAngles(); } @@ -1991,7 +1966,7 @@ bool Hooks::Mob__isImmobile(C_Entity* ent) { auto func = g_Hooks.Mob__isImmobileHook->GetFastcall(); static auto antiImmobileMod = moduleMgr->getModule(); - if(antiImmobileMod->isEnabled() && ent == g_Data.getLocalPlayer()) + if (antiImmobileMod->isEnabled() && ent == g_Data.getLocalPlayer()) return false; return func(ent); @@ -2001,15 +1976,13 @@ void Hooks::InventoryTransactionManager__addAction(C_InventoryTransactionManager #ifdef TEST_DEBUG char* srcName = "none"; - if(action.sourceItem.item && *action.sourceItem.item) + if (action.sourceItem.item && *action.sourceItem.item) srcName = (*action.sourceItem.item)->name.getText(); char* targetName = "none"; - if(action.targetItem.item && *action.targetItem.item) + if (action.targetItem.item && *action.targetItem.item) targetName = (*action.targetItem.item)->name.getText(); logF("%i %i %i %s %s", action.type, action.slot, action.sourceType, srcName, targetName, action.sourceType); - - /*if(/*action.slot == 14 && action.sourceType == 124 && strcmp(targetName, "none") == 0 && *strcmp(srcName, "stone_shovel") == 0){ std::string tag = "{ench:[{id:9s,lvl:1s}]}"; action.sourceItem.setUserData(std::move(Mojangson::parseTag(tag))); @@ -2028,17 +2001,15 @@ void Hooks::LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2, TextHold static auto nameTagsMod = moduleMgr->getModule(); if (nameTagsMod->isEnabled() && nameTagsMod->nameTags.size() > 0) { - std::string text = Utils::sanitize(a3->getText()); std::size_t found = text.find('\n'); if (found != std::string::npos) text = text.substr(0, found); - + if (nameTagsMod->nameTags.find(text) != nameTagsMod->nameTags.end()) return; } - return func(a1, a2, a3, a4); } diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index 890d2b47..3ca745c6 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -32,7 +32,7 @@ int C_Inventory::getFirstEmptySlot() { } void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); - static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 45 8B E1")); + static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8 44 8B EA 89 54 24 ? 48 8B F1 49 BF ? ? ? ? ? ? ? ?")); TextHolder txt = TextHolder(name); From 2b224719bd7ec9fc3467b4e232fa713e590db0c7 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 14:54:39 +0200 Subject: [PATCH 029/419] Fix drawLine3d --- Horion/DrawUtils.cpp | 2 +- Horion/Module/Modules/Tracer.cpp | 1 + SDK/CClientInstance.h | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 962ba966..4e0d8253 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -422,7 +422,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { if(game3dContext == 0 || entityFlatStaticMaterial == 0) return; - auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xA8); + auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); DrawUtils::tess__begin(myTess, 4); diff --git a/Horion/Module/Modules/Tracer.cpp b/Horion/Module/Modules/Tracer.cpp index e0d55102..74591697 100644 --- a/Horion/Module/Modules/Tracer.cpp +++ b/Horion/Module/Modules/Tracer.cpp @@ -13,6 +13,7 @@ const char* Tracer::getModuleName() { return "Tracer"; } void Tracer::onLevelRender() { + auto cameraMgr = g_Data.getClientInstance()->getCameraManager(); if(cameraMgr == nullptr) return; diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 57512ea5..2e04270f 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -160,17 +160,17 @@ class C_ClientInstance { private: char pad_0x00B8[0x30]; //0x0110 public: - C_LocalPlayer* localPlayer; //0x00F0 + C_LocalPlayer* localPlayer; //0x0140 private: - char pad[0x380]; // 0x00F8 + char pad[0x380]; // 0x0148 public: struct { - char pad[0x228]; + char pad[0x238]; struct { __int64 materialPtr; size_t refCount; } entityLineMaterial; - } *itemInHandRenderer; // 0x0478 + } *itemInHandRenderer; // 0x04C8 private: virtual __int64 destructorClientInstance(); From 3db207982f5755f442881b5bf580065bee55a19d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 15:32:27 +0200 Subject: [PATCH 030/419] Fix autocomplete --- Memory/Hooks.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index c4fed93f..fd90e777 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -949,14 +949,9 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) using syncShit_t = void(__fastcall*)(__int64*, TextHolder*); static syncShit_t syncShit = nullptr; - static __int64* winrt_ptr; if (syncShit == nullptr) { - //uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 49 8B D6 FF 90 ?? 04"); // The 04 at the end might get invalid in the future - uintptr_t sigOffset = FindSignature("48 89 0D ?? ?? ?? ?? E8 ? ? ? ? B0 ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 83 C4"); - int offset = *reinterpret_cast(sigOffset + 3); - winrt_ptr = *reinterpret_cast<__int64**>(sigOffset + offset + 7); - int vtOffset = *reinterpret_cast(sigOffset + 15); - syncShit = reinterpret_cast(*reinterpret_cast<__int64*>(*winrt_ptr + vtOffset)); + uintptr_t sigOffset = FindSignature("40 53 48 83 EC ?? 48 C7 44 24 20 FE FF FF FF 48 8B DA 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 90 48 8B C8 E8 ?? ?? ?? ?? 48 8B 08 4C 8B 81 ?? 04"); + syncShit = reinterpret_cast(sigOffset); } if (tx != nullptr && text->getTextLength() >= 1 && tx[0] == '.') { @@ -1027,8 +1022,8 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) } else maxReplaceLength = firstResult.cmdAlias.size(); + g_Data.getGuiData()->displayClientMessageF("=========="); if (searchResults.size() > 1) { - g_Data.getGuiData()->displayClientMessageF("=========="); for (auto it = searchResults.begin(); it != searchResults.end(); ++it) { LilPlump plump = *it; g_Data.getGuiData()->displayClientMessageF("%s%s - %s%s", plump.cmdAlias.c_str(), GRAY, ITALIC, plump.command->getDescription()); @@ -1047,7 +1042,7 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) text->setText(firstResult.cmdAlias.substr(0, maxReplaceLength)); // Set text // now sync with the UI thread - syncShit(winrt_ptr, text); + syncShit(0, text); } } From f88b038a75d09dac132bd2a81e5555fdfbf74982 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 15:38:59 +0200 Subject: [PATCH 031/419] Fix velocity --- Memory/Hooks.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index fd90e777..8836ea55 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -923,12 +923,13 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { return oLerp(_this, motVec); static auto noKnockbackmod = moduleMgr->getModule(); - /*if (noKnockbackmod->isEnabled()) { - static void* networkSender = reinterpret_cast(FindSignature("41 80 BF ?? ?? ?? ?? 00 0F 85 ?? ?? ?? ?? FF")); + if (noKnockbackmod->isEnabled()) { + static void* networkSender = reinterpret_cast(6 + FindSignature("FF 90 ?? ?? ?? ?? 4C 8D 9C 24 ?? ?? ?? ?? 49 8B 5B 18 49 8B 73 28 49 8B E3 5F C3")); if (networkSender == _ReturnAddress()) { motVec = _this->velocity.lerp(motVec, noKnockbackmod->xModifier, noKnockbackmod->yModifier, noKnockbackmod->xModifier); } - }*/ + } + oLerp(_this, motVec); } From ebe844f61d58929309dbbf80d4739c36091f89b7 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 16:29:12 +0200 Subject: [PATCH 032/419] Fix fullbright --- Memory/Hooks.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 8836ea55..8be0e381 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -233,14 +233,14 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - //void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC 40 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ??")); - //g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); + void* fullbright = reinterpret_cast(FindSignature("4C 8B DC 57 48 83 EC ?? 49 C7 43 ?? FE FF FF FF 49 89 5B ?? 49 89 73 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 49 89 43 ?? 49 89 43 ?? 48 8B 01 49")); + g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); - //void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 ?? ?? ?? ?? ?? E8")); - //g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); + void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 E8 ?? ?? ?? ?? 48")); + g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F1 48 C7 85 ? ? ? ? ? ? ? ? 48 8D 95 ? ? ? ? 48 8B 89 ? ? ? ?")); g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); @@ -274,8 +274,8 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - //void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 48 8B 89")); - //g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); + void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 33")); + g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags,Hooks::LevelRendererPlayer__renderNameTags); @@ -1284,10 +1284,17 @@ __int64 Hooks::GetGamma(__int64 a1) { char filler[0x20]; // 0x008 TextHolder internalName; // 0x0028 TextHolder friendlyName; // 0x0048 // only exists when the value is present in the options - - char filler2[0x88]; // 0x068 + int optionId; // 0x68 + char filler2[0xC]; // 0x6C + TextHolder nameInConfigFile; // 0x78 + char filler3[0x50]; // 0x098 union { - float _float; + struct { + float min; + float max; + float value; + float defaultValue; + } _float; bool _bool; } value; }; @@ -1296,21 +1303,23 @@ __int64 Hooks::GetGamma(__int64 a1) { if (gfx_gamma == 0) { __int64 v6 = oFunc(a1); // Calls to ClientInstance, returns options ptr - static int numOptions = *reinterpret_cast(FindSignature("48 81 FB ?? ?? ?? ?? 72 ?? 4C 8B 7D") + 3); + static int numOptions = (*reinterpret_cast(FindSignature("49 8D B6 ?? ?? ?? ?? 48 3B FE") + 3) - 16) / 8; //logF("%llX", v6); //logF("Num Options: %i", numOptions); for (int i = 0; i < numOptions; i++) { Option* ptr = *reinterpret_cast(v6 + 0x10 + i * 8); + //if (ptr) + // logF("%llX %s %s", v6 + 0x10 + i * 8, ptr->internalName.getText(), ptr->friendlyName.getText()); if (ptr && strcmp(ptr->internalName.getText(), "gfx_gamma") == 0) { - //logF("%llX %s %s", v6 + 0x10 + i * 8, ptr->internalName.getText(), ptr->friendlyName.getText()); gfx_gamma = ptr; + //logF("%llX %s %s %llX", v6 + 0x10 + i * 8, ptr->internalName.getText(), ptr->friendlyName.getText(), &ptr->value); } } } if (gfx_gamma) - fullBrightModule->gammaPtr = &gfx_gamma->value._float; + fullBrightModule->gammaPtr = &gfx_gamma->value._float.value; return oFunc(a1); } From 078f3d7f50d5b6c860cdf1630c4fc1bd83dd43a9 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 16:35:27 +0200 Subject: [PATCH 033/419] Fix rainbow sky --- Memory/Hooks.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 8be0e381..51cf5d77 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -191,15 +191,12 @@ void Hooks::Init() { void* render = reinterpret_cast(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 48 8B DA 48 8B F9 B9 ? ? ? ? 65 48 8B 04 25 ? ? ? ? 48 8B 10 8B 04 11 39 05 ? ? ? ?")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); - void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 00 48 8B C2 0F 11 02")); + void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - //void* sunLightIntensity = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B B9 ?? ?? ?? ?? 49 8B D8 0F")); - - void* ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); From 3912a04aaa4fb5cc92fade28a46c7aaed67c613b Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 16:57:30 +0200 Subject: [PATCH 034/419] fix scaffold --- Horion/Module/Modules/Scaffold.cpp | 4 ++-- SDK/CItem.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index fb9f22d4..3eb86f4f 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -19,7 +19,6 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) { C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); C_BlockLegacy* blockLegacy = *(block->blockLegacy); if (blockLegacy->material->isReplaceable) { - vec3_ti blok(blockBelow); // Find neighbour @@ -79,6 +78,7 @@ void Scaffold::onTick(C_GameMode* gm) { return; if (!g_Data.canUseMoveKeys()) return; + auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock()) && !spoof) // Block in hand? return; @@ -90,7 +90,7 @@ void Scaffold::onTick(C_GameMode* gm) { // Adjustment by velocity float speed = g_Data.getLocalPlayer()->velocity.magnitudexz(); vec3_t vel = g_Data.getLocalPlayer()->velocity; - vel.normalize(); // Only use values from 0 - 1 + vel = vel.normalize(); // Only use values from 0 - 1 if (!tryScaffold(blockBelow)) { if (speed > 0.05f) { // Are we actually walking? diff --git a/SDK/CItem.h b/SDK/CItem.h index 4e1d51fb..9643794a 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -240,8 +240,8 @@ class C_Item { return false; } bool isBlock(void) { - if (itemId != 0 && itemId < 255) return true; - return false; + auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x170); + return val != nullptr && *val != nullptr; } }; From 327eceea7e3337e5b0b1d9c15c138d328418fa10 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 17:13:01 +0200 Subject: [PATCH 035/419] Fix auto armor --- Horion/Module/Modules/AutoArmor.cpp | 6 +----- SDK/CItem.h | 16 ++++------------ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Horion/Module/Modules/AutoArmor.cpp b/Horion/Module/Modules/AutoArmor.cpp index 49d4f044..b6e26d1e 100644 --- a/Horion/Module/Modules/AutoArmor.cpp +++ b/Horion/Module/Modules/AutoArmor.cpp @@ -1,5 +1,6 @@ #include "AutoArmor.h" #include "../../../Utils/Utils.h" +#include "../../../Utils/Logger.h" class ArmorStruct { public: @@ -46,10 +47,6 @@ void AutoArmor::onTick(C_GameMode* gm) { uintptr_t sigOffset = FindSignature("48 8D 3D ? ? ? ? 80 B8 ? ? ? ? ? 75 19 48 8B 88 ? ? ? ? 48 8B 11 4C 8B 42 28 8B 50 10"); int offset = *reinterpret_cast(sigOffset + 3); emptyItemStack = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); -#ifdef _DEBUG - if (emptyItemStack == 0x0 || sigOffset == 0x0) - __debugbreak(); -#endif } std::vector armorList; @@ -63,7 +60,6 @@ void AutoArmor::onTick(C_GameMode* gm) { for (int i = 0; i < 4; i++) { for (int n = 0; n < 36; n++) { C_ItemStack* stack = inv->getItemStack(n); - if (stack->item != NULL && (*stack->item)->isArmor() && reinterpret_cast(*stack->item)->ArmorSlot == i) { armorList.push_back(ArmorStruct(stack, reinterpret_cast(*stack->item), n)); } diff --git a/SDK/CItem.h b/SDK/CItem.h index 9643794a..a38d55ab 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -54,6 +54,7 @@ class C_Item { public: virtual bool isExperimental(__int64 const*) const; + virtual bool returnFalse(); virtual void setMaxStackSize(unsigned char); virtual void setCategory(int); virtual void setStackedByData(bool); @@ -63,6 +64,7 @@ class C_Item { virtual void setMaxUseDuration(int); virtual void setRequiresWorldBuilder(bool); virtual void setExplodable(bool); + virtual void setFireResistant(bool); virtual void setIsGlint(bool); virtual void setShouldDespawn(bool); @@ -125,37 +127,28 @@ class C_Item { virtual bool isMultiColorTinted(C_ItemStack const&) const; private: - //virtual __int64 getColor(__int64 const&) const; virtual __int64 getColor(C_ItemStack const&) const; virtual __int64 getBaseColor(C_ItemStack const&) const; virtual __int64 getSecondaryColor(C_ItemStack const&) const; virtual __int64 saveAdditionalData(C_ItemStack const&, __int64&) const; virtual __int64 readAdditionalData(C_ItemStack&, __int64 const&)const; - /* virtual __int64 readAdditionalData(__int64&, __int64 const&)const; - public: - private:*/ virtual bool isTintable(void)const; + virtual __int64 buildIdAux(short, const CompoundTag*); + virtual __int64 buildDescriptor(short, const CompoundTag*); virtual __int64 use(C_ItemStack&, C_Entity&) const; virtual __int64 dispense(C_BlockSource&, __int64&, int, vec3_t const&, unsigned char) const; - virtual __int64 useTimeDepleted(__int64&, __int64*, C_Entity*) const; virtual __int64 useTimeDepleted(C_ItemStack&, __int64*, C_Entity*) const; - virtual __int64 releaseUsing(__int64&, C_Entity*, int) const; virtual __int64 releaseUsing(C_ItemStack&, C_Entity*, int) const; virtual __int64 getDestroySpeed(C_ItemStack const&, C_Block const&) const; virtual __int64 hurtEnemy(__int64&, __int64*, __int64*) const; virtual __int64 hurtEnemy(C_ItemStack&, __int64*, __int64*) const; virtual __int64 mineC_Block(__int64&, C_Block const&, int, int, int, C_Entity*) const; virtual __int64 mineC_Block(C_ItemStack&, C_Block const&, int, int, int, C_Entity*) const; - //virtual __int64 buildDescriptionId(__int64 const&)const; virtual __int64 buildDescriptionId(C_ItemStack const&) const; - //virtual __int64 buildEffectDescriptionName(__int64 const&)const; virtual __int64 buildEffectDescriptionName(C_ItemStack const&) const; - //virtual __int64 buildCategoryDescriptionName(__int64 const&)const; virtual __int64 buildCategoryDescriptionName(C_ItemStack const&) const; - //virtual __int64 readUserData(__int64&, __int64&, __int64&) const; virtual __int64 readUserData(C_ItemStack&, __int64&, __int64&) const; - //virtual __int64 writeUserData(__int64 const&, __int64&)const; virtual __int64 writeUserData(C_ItemStack const&, __int64&) const; public: @@ -204,7 +197,6 @@ class C_Item { private: virtual __int64 playSoundIncrementally(__int64 const&, __int64&) const; virtual __int64 playSoundIncrementally(C_ItemStack const&, __int64&) const; - virtual bool isCustomArmor(); virtual __int64 getAuxValuesDescription(void) const; virtual __int64 _checkUseOnPermissions(C_Entity&, __int64&, unsigned char const&, vec3_ti const&) const; virtual __int64 _checkUseOnPermissions(C_Entity&, C_ItemStack&, unsigned char const&, vec3_ti const&) const; From 6368df5b2ff8f57fb780c1f5b25593352041024b Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 17:26:35 +0200 Subject: [PATCH 036/419] Fix auto armor --- SDK/CItem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/CItem.h b/SDK/CItem.h index a38d55ab..e5930c5c 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -324,9 +324,9 @@ class C_ItemStack { class C_ArmorItem : public C_Item { private: - char pad_0x108[0x48 + 0x70]; //0x108 + char pad_0x108[0xB0]; //0x108 public: - int ArmorSlot; //0x150 + int ArmorSlot; //0x1B8 bool isHelmet() { return ArmorSlot == 0; From b9c7faeaa8d45ccd1500cb7e3aa3da0861279f2d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 17:36:47 +0200 Subject: [PATCH 037/419] Fix Dimension_getFogColor crash --- Memory/Hooks.cpp | 6 +++--- Memory/Hooks.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b7d80fae..553f6eca 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -848,8 +848,8 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { return retval; } -float* Hooks::Dimension_getFogColor(__int64 _this, float* color, float brightness) { - static auto oGetFogColor = g_Hooks.Dimension_getFogColorHook->GetFastcall(); +float* Hooks::Dimension_getFogColor(__int64 _this, float* color, float brightness, float a4) { + static auto oGetFogColor = g_Hooks.Dimension_getFogColorHook->GetFastcall(); static float rcolors[4]; @@ -881,7 +881,7 @@ float* Hooks::Dimension_getFogColor(__int64 _this, float* color, float brightnes return rcolors; } - return oGetFogColor(_this, color, brightness); + return oGetFogColor(_this, color, brightness, a4); } float Hooks::Dimension_getTimeOfDay(__int64 _this, int a2, float a3) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 68ea1790..eb3eee03 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -82,7 +82,7 @@ class Hooks { static __int64 UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext); static __int64 UIScene_render(C_UIScene* uiscene, __int64 screencontext); static __int64 RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx); - static float* Dimension_getFogColor(__int64, float* color, float brightness); + static float* Dimension_getFogColor(__int64, float* color, float brightness, float a4); static float Dimension_getTimeOfDay(__int64, int a2, float a3); static float Dimension_getSunIntensity(__int64, float a2, vec3_t* a3, float a4); static void ChestBlockActor_tick(C_ChestBlockActor*, void* a); From 3da5a6debd6fa96b006a6737384f76e1d9370233 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 26 Jun 2020 11:46:17 -0400 Subject: [PATCH 038/419] fix joe --- SDK/CBlockLegacy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index ba14f602..60f79cdd 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -21,6 +21,6 @@ int C_BlockLegacy::liquidGetDepth(C_BlockSource* reg, const vec3_ti* pos) { } void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec3_ti* pos) { using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*); - static liquid_getFlow_t liquid_getDepth = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C")); + static liquid_getFlow_t liquid_getDepth = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 4C 24 ?")); liquid_getDepth(this, flowOut, reg, pos); } From 1cc906395ff0a91bf328fa6e5e7c5de71bd5a3e9 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 17:54:35 +0200 Subject: [PATCH 039/419] Fix protection --- Memory/GameData.h | 2 +- Memory/Hooks.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/GameData.h b/Memory/GameData.h index c8d96d4d..a05c3b5d 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -215,7 +215,7 @@ class GameData { inline C_LocalPlayer* getLocalPlayer() { #ifdef _BETA unsigned int converted = networkedData.localPlayerOffset ^ networkedData.xorKey; - if (networkedData.localPlayerOffset < 0xA0 || converted < 0xA0 || converted > 0x132 || networkedData.dataSet == false) + if (networkedData.localPlayerOffset < 0x110 || converted < 0x125 || converted > 0x191 || networkedData.dataSet == false) localPlayer = nullptr; else localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 553f6eca..abb8f02c 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -361,7 +361,7 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { bool alwaysRender = moduleMgr->isInitialized() && moduleMgr->getModule()->alwaysShow; - TextHolder alloc; + TextHolder alloc = {}; uiscene->getScreenName(&alloc); if (alloc.getTextLength() < 100) From 5442dfcc3ce82e85ae6ec4a69c21649c6c05dfc8 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 18:10:37 +0200 Subject: [PATCH 040/419] Fix unepic crash --- Memory/Hooks.cpp | 6 +++--- Memory/Hooks.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index abb8f02c..0aa738be 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -848,8 +848,8 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { return retval; } -float* Hooks::Dimension_getFogColor(__int64 _this, float* color, float brightness, float a4) { - static auto oGetFogColor = g_Hooks.Dimension_getFogColorHook->GetFastcall(); +float* Hooks::Dimension_getFogColor(__int64 _this, float* color, __int64 a3, float a4) { + static auto oGetFogColor = g_Hooks.Dimension_getFogColorHook->GetFastcall(); static float rcolors[4]; @@ -881,7 +881,7 @@ float* Hooks::Dimension_getFogColor(__int64 _this, float* color, float brightnes return rcolors; } - return oGetFogColor(_this, color, brightness, a4); + return oGetFogColor(_this, color, a3, a4); } float Hooks::Dimension_getTimeOfDay(__int64 _this, int a2, float a3) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index eb3eee03..5075eeca 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -82,7 +82,7 @@ class Hooks { static __int64 UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext); static __int64 UIScene_render(C_UIScene* uiscene, __int64 screencontext); static __int64 RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx); - static float* Dimension_getFogColor(__int64, float* color, float brightness, float a4); + static float* Dimension_getFogColor(__int64, float* color, __int64 brightness, float a4); static float Dimension_getTimeOfDay(__int64, int a2, float a3); static float Dimension_getSunIntensity(__int64, float a2, vec3_t* a3, float a4); static void ChestBlockActor_tick(C_ChestBlockActor*, void* a); From db9fe54669cee30c8a7a63ba14cc9b3158e4aa54 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 26 Jun 2020 18:16:53 +0200 Subject: [PATCH 041/419] cbe --- .../Commands/CommandBlockExploitCommand.cpp | 88 ++++--------------- 1 file changed, 19 insertions(+), 69 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index fcace7b0..6be6e200 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -11,75 +11,25 @@ CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandbl CommandBlockExploitCommand::~CommandBlockExploitCommand() { } -void search(float range) { - vec3_t* pos = g_Data.getLocalPlayer()->getPos(); - auto region = g_Data.getLocalPlayer()->region; - for (float x = pos->x - range; x < pos->x + range; x++) { - for (float z = pos->z - range; z < pos->z + range; z++) { - for (float y = 0; y < 256; y++) { - vec3_t pos(x, y, z); - C_Block* block = region->getBlock(pos); - if (block != nullptr) { - int blockId = block->toLegacy()->blockId; - if (blockId == 137 || blockId == 188 || blockId == 189) { - g_Data.getGuiData()->displayClientMessageF("[%sHorion%s] %sCommand block found at %s%d, %d, %d%s!", GOLD, WHITE, GREEN, GRAY, (int)x, (int)y, (int)z, GREEN); - return; - } - } - } - } - } - g_Data.getGuiData()->displayClientMessageF("[%sHorion%s] %sNo command blocks found!", GOLD, WHITE, GREEN); -} - bool CommandBlockExploitCommand::execute(std::vector* args) { - if (args->at(1) == "search") { - float range = assertFloat(args->at(2)); - clientMessageF("[%sHorion%s] %sSearching for command blocks...", GOLD, WHITE, GREEN); - std::thread searchThread(search, range); - searchThread.detach(); - return true; - } else if (args->at(1) == "open") { - float x = assertFloat(args->at(2)); - float y = assertFloat(args->at(3)); - float z = assertFloat(args->at(4)); - - auto forceOpenCmdBlockModule = moduleMgr->getModule(); - if (!forceOpenCmdBlockModule->isEnabled()) { - clientMessageF("[%sHorion%s] %sEnable ForceCommandBlockOpen first!", GOLD, WHITE, GREEN); - return true; - } - - vec3_t pos(x, y, z); - forceOpenCmdBlockModule->distance = g_Data.getLocalPlayer()->getPos()->dist(pos); - forceOpenCmdBlockModule->isInCommandBlock = true; - - //g_Data.getLocalPlayer()->openCommandBlock(pos); - return true; - } else if (args->at(1) == "beehive") { - assertTrue(args->size() > 3); - std::ostringstream os; - for (int i = 2; i < args->size(); i++) { - if (i > 2) - os << " "; - os << args->at(i); - } - using ItemRegistry__lookupByName_t = C_Item***(__fastcall*)(void*, void*, TextHolder); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 48 48 8B F1 48 89 4D 80 45 33 FF 44 89 7C 24 ? 4D 39 78 10 75 23 ")); - void* ItemPtr = malloc(0x8); - void* idk = malloc(0x0); - C_ItemStack* yot = new C_ItemStack(***ItemRegistry__lookupByNameF(ItemPtr, idk, std::string("beehive")), 1, 0); - free(ItemPtr); - free(idk); - int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); - std::string cmd = os.str(); - std::string tag = "{Occupants:[{TicksLeftToStay:1, ActorIdentifier :\"minecraft:command_block_minecart<>\",SaveData:{UniqueID:0l,Saddled:0b,Invulnerable:0b,LastDimensionId:0,SuccessCount:0,IsStunned:0b,FallDistance:0.0f,ExecuteOnFirstTick:1b,Version:10,IsEating:0b,TickDelay:3,definitions:[\"+minecraft:command_block_minecart\",\"+minecraft:command_block_inactive\"],CurrentTickCount:0,ShowBottom:0b,identifier:\"minecraft:command_block_minecart\",IsTamed:0b,LastExecution:0l,Color:0b,ChestItems:[{Slot:0b,Count:0b,Damage:0s,Name:\"\"}],IsOrphaned:0b,IsRoaring:0b,LootDropped:0b,IsScared:0b,IsIllagerCaptain:0b,Variant:0,CustomName:\"\",Pos:[640.519f,66.35f,32.207695f],Chested:0b,IsTrusting:0b,IsGliding:0b,StrengthMax:0,IsBaby:0b,Sitting:0b,PortalCooldown:0,SkinID:0,IsSwimming:0b,MarkVariant:0,InventoryVersion:\"1.14.20\",Ticking:0b,IsAngry:0b,Motion:[0.0f,0.0f,0.0f],IsAutonomous:0b,OnGround:1b,Color2:0b,Rotation:[-1.5359192f,0.0f],Command:\"" + cmd + "\",OwnerNew:-1l,Fire:0s,Sheared:0b,LastOutput:\"commands.generic.syntax\",IsGlobal:0b,Strength:0,TrackOutput:1b}}]}"; - yot->setUserData(std::move(Mojangson::parseTag(tag))); - g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); - g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); - g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); - clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); - return true; + assertTrue(args->size() > 2); + std::ostringstream os; + for (int i = 1; i < args->size(); i++) { + if (i > 1) + os << " "; + os << args->at(i); } - return false; + void* ItemPtr = malloc(0x8); + C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, 325); + C_ItemStack* yot = new C_ItemStack(***cStack, 1, 5); + free(ItemPtr); + int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); + std::string cmd = os.str(); + std::string tag = "{ChestItems:[{Count:0b,Damage:0s,Name:\"\",Slot:0b}],Chested:0b,Color:0b,Color2:0b,Command:\"" + cmd + "\",CurrentTickCount:0,ExecuteOnFirstTick:1b,FallDistance:0f,Fire:0s,InventoryVersion:\"1.14.20\",Invulnerable:1b,IsAngry:0b,IsAutonomous:0b,IsBaby:0b,IsEating:0b,IsGliding:0b,IsGlobal:0b,IsIllagerCaptain:0b,IsOrphaned:0b,IsRoaring:0b,IsScared:0b,IsStunned:0b,IsSwimming:0b,IsTamed:0b,IsTrusting:0b,LastDimensionId:0,LastExecution:0l,LootDropped:0b,MarkVariant:0,Motion:[0f,0.1f,0f],OnGround:1b,OwnerNew:-1l,PortalCooldown:0,Pos:[0f,0f,0f],Rotation:[0f,0f],Saddled:0b,Sheared:0b,ShowBottom:0b,Sitting:0b,SkinID:0,Strength:0,StrengthMax:0,SuccessCount:1000,TickDelay:1,Ticking:1b,TrackOutput:1b,UniqueID:0l,Variant:0,Version:10,definitions:[\"+minecraft:command_block_minecart\",\"+minecraft:command_block_inactive\"],identifier:\"minecraft:command_block_minecart\",EntityType:100}"; + yot->setUserData(std::move(Mojangson::parseTag(tag))); + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); + g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); + clientMessageF("[%sHorion%s] %sPlace the bucket to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); + return true; } From 4119ed4afe54a9cedc0c5c32c7b0392cc102cb39 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 26 Jun 2020 18:28:47 +0200 Subject: [PATCH 042/419] ancient debris xray --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 2 +- Memory/Hooks.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 6be6e200..338480f5 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -4,7 +4,7 @@ #include "../../Module/ModuleManager.h" #include -CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Search and open commands from far range!", " / /") { +CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", "") { registerAlias("cbe"); } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 0aa738be..e9fa0f20 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1200,7 +1200,8 @@ int Hooks::BlockLegacy_getRenderLayer(C_BlockLegacy* a1) { if (strcmp(text, "lava") != NULL) if (strcmp(text, "water") != NULL) if (strcmp(text, "portal") != NULL) - return 10; + if (strcmp(text, "ancient_debris") != NULL) + return 10; } return oFunc(a1); } From 9063c25bbecfe382485f4e4fb756d520b1b98b12 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 18:32:48 +0200 Subject: [PATCH 043/419] Fix joe not saying anything when he's done --- Horion/Module/Modules/FollowPathModule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Module/Modules/FollowPathModule.cpp b/Horion/Module/Modules/FollowPathModule.cpp index ffa05084..63d7f809 100644 --- a/Horion/Module/Modules/FollowPathModule.cpp +++ b/Horion/Module/Modules/FollowPathModule.cpp @@ -104,6 +104,7 @@ void FollowPathModule::onMove(C_MoveInputHandler *handler) { this->setEnabled(false); } }else{ + this->clientMessageF("%sDone!", GREEN); this->setEnabled(false); return; } From 6056dd3f3b976b3f04670c9ce8660d6aea87e6d9 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 26 Jun 2020 18:53:37 +0200 Subject: [PATCH 044/419] Fix dupe --- Horion/Command/Commands/TestCommand.cpp | 2 +- SDK/CPacket.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index 17e96c6a..d4ca2a66 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -74,7 +74,7 @@ bool TestCommand::execute(std::vector* args) { coolBean.next = reinterpret_cast<__int64>(&ptrBean); pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); - + pk.numTransactions = 2; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); clientMessageF("%sSuccessfully given item! %i", GREEN, numActions); return true; diff --git a/SDK/CPacket.h b/SDK/CPacket.h index f25950f3..a7eaac62 100644 --- a/SDK/CPacket.h +++ b/SDK/CPacket.h @@ -102,7 +102,12 @@ class C_InventoryTransactionPacket : public C_Packet { private: char pad_0x8[0x20]; //0x8 public: - C_ComplexInventoryTransaction* complexTransaction; //0x28 + int unknown = 0;//0x28 + __int64* unknownStart = 0; //0x30 + __int64* unknownEnd = 0; //0x38 + __int64 filler = 0; // 0x40 + C_ComplexInventoryTransaction* complexTransaction; // 0x48 + unsigned char numTransactions; // 0x50 }; class C_TextPacket : public C_Packet { From be19d656c1d23a55f743b3ee1edf1a68dad3ffd5 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 26 Jun 2020 16:09:23 -0400 Subject: [PATCH 045/419] fix custom skin pack --- Memory/Hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e9fa0f20..29e03cfe 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -90,7 +90,7 @@ void Hooks::Init() { { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } - //g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("4C 8B DC 53 48 81 EC ?? ?? ?? ?? 49 C7 43 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B D9 33 C0"), Hooks::ReturnTrue); + g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); } } @@ -248,7 +248,7 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 48 C7 85 ?? ?? ?? ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F2")); + void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); From 1b85ee64a9f81ec963683deeafcbaf41600ba050 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 27 Jun 2020 01:22:07 +0200 Subject: [PATCH 046/419] autosneak, command blocks in xray & cbe fix --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 2 +- Horion/Module/ModuleManager.cpp | 4 ++-- Horion/Module/Modules/AutoSneak.cpp | 6 ++---- Horion/Module/Modules/AutoSneak.h | 1 + Memory/Hooks.cpp | 3 ++- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 338480f5..0155a7ed 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -25,7 +25,7 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { free(ItemPtr); int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); std::string cmd = os.str(); - std::string tag = "{ChestItems:[{Count:0b,Damage:0s,Name:\"\",Slot:0b}],Chested:0b,Color:0b,Color2:0b,Command:\"" + cmd + "\",CurrentTickCount:0,ExecuteOnFirstTick:1b,FallDistance:0f,Fire:0s,InventoryVersion:\"1.14.20\",Invulnerable:1b,IsAngry:0b,IsAutonomous:0b,IsBaby:0b,IsEating:0b,IsGliding:0b,IsGlobal:0b,IsIllagerCaptain:0b,IsOrphaned:0b,IsRoaring:0b,IsScared:0b,IsStunned:0b,IsSwimming:0b,IsTamed:0b,IsTrusting:0b,LastDimensionId:0,LastExecution:0l,LootDropped:0b,MarkVariant:0,Motion:[0f,0.1f,0f],OnGround:1b,OwnerNew:-1l,PortalCooldown:0,Pos:[0f,0f,0f],Rotation:[0f,0f],Saddled:0b,Sheared:0b,ShowBottom:0b,Sitting:0b,SkinID:0,Strength:0,StrengthMax:0,SuccessCount:1000,TickDelay:1,Ticking:1b,TrackOutput:1b,UniqueID:0l,Variant:0,Version:10,definitions:[\"+minecraft:command_block_minecart\",\"+minecraft:command_block_inactive\"],identifier:\"minecraft:command_block_minecart\",EntityType:100}"; + std::string tag = "{ChestItems:[{Count:0b,Damage:0s,Name:\"\",Slot:0b}],Chested:0b,Color:0b,Color2:0b,Command:\"" + cmd + "\",CurrentTickCount:0,ExecuteOnFirstTick:1b,FallDistance:0f,Fire:0s,InventoryVersion:\"1.14.20\",Invulnerable:0b,IsAngry:0b,IsAutonomous:0b,IsBaby:0b,IsEating:0b,IsGliding:0b,IsGlobal:0b,IsIllagerCaptain:0b,IsOrphaned:0b,IsRoaring:0b,IsScared:0b,IsStunned:0b,IsSwimming:0b,IsTamed:0b,IsTrusting:0b,LastDimensionId:0,LastExecution:0l,LootDropped:0b,MarkVariant:0,Motion:[0f,0.1f,0f],OnGround:1b,OwnerNew:-1l,PortalCooldown:0,Pos:[0f,0f,0f],Rotation:[0f,0f],Saddled:0b,Sheared:0b,ShowBottom:0b,Sitting:0b,SkinID:0,Strength:0,StrengthMax:0,SuccessCount:1000,TickDelay:1,Ticking:1b,TrackOutput:1b,UniqueID:0l,Variant:0,Version:10,definitions:[\"+minecraft:command_block_minecart\",\"+minecraft:command_block_inactive\"],identifier:\"minecraft:command_block_minecart\",EntityType:100}"; yot->setUserData(std::move(Mojangson::parseTag(tag))); g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index af4fb8fe..63612e59 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -91,13 +91,13 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Nbt())); this->moduleList.push_back(std::shared_ptr(new Godmode())); this->moduleList.push_back(std::shared_ptr(new Freelook())); - //this->moduleList.push_back(std::shared_ptr(new AutoSneak())); broken + this->moduleList.push_back(std::shared_ptr(new AutoSneak())); this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); #if defined(_BETA) or defined(_DEBUG) - this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); + //this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); #endif diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index 17f7971b..1282b606 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -10,8 +10,6 @@ const char* AutoSneak::getModuleName() { return ("AutoSneak"); } -void AutoSneak::onTick(C_GameMode* gm) { - auto loc = g_Data.getLocalPlayer(); // this is hella broke - loc->setSneaking(true); - +void AutoSneak::onMove(C_MoveInputHandler* handler) { + handler->isSneakDown = true; } diff --git a/Horion/Module/Modules/AutoSneak.h b/Horion/Module/Modules/AutoSneak.h index 0c65af41..c0fc3250 100644 --- a/Horion/Module/Modules/AutoSneak.h +++ b/Horion/Module/Modules/AutoSneak.h @@ -7,4 +7,5 @@ class AutoSneak : public IModule { virtual void onTick(C_GameMode* gm) override; virtual const char* getModuleName() override; + virtual void onMove(C_MoveInputHandler* handler) override; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e9fa0f20..3b09b496 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1201,7 +1201,8 @@ int Hooks::BlockLegacy_getRenderLayer(C_BlockLegacy* a1) { if (strcmp(text, "water") != NULL) if (strcmp(text, "portal") != NULL) if (strcmp(text, "ancient_debris") != NULL) - return 10; + if (strcmp(text, "command_block") != NULL) + return 10; } return oFunc(a1); } From d314e15738da63b064af532d96c4227af5139e8f Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 27 Jun 2020 01:31:06 +0200 Subject: [PATCH 047/419] fix --- Horion/Module/Modules/AutoSneak.cpp | 9 +++++++-- Horion/Module/Modules/AutoSneak.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index 1282b606..e4a158bc 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -10,6 +10,11 @@ const char* AutoSneak::getModuleName() { return ("AutoSneak"); } -void AutoSneak::onMove(C_MoveInputHandler* handler) { - handler->isSneakDown = true; +void AutoSneak::onTick(C_GameMode* gm) { + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = true; +} + +void AutoSneak::onDisable() { + if (g_Data.getLocalPlayer() != nullptr) + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = false; } diff --git a/Horion/Module/Modules/AutoSneak.h b/Horion/Module/Modules/AutoSneak.h index c0fc3250..8f14620a 100644 --- a/Horion/Module/Modules/AutoSneak.h +++ b/Horion/Module/Modules/AutoSneak.h @@ -5,7 +5,7 @@ class AutoSneak : public IModule { AutoSneak(); ~AutoSneak(); - virtual void onTick(C_GameMode* gm) override; virtual const char* getModuleName() override; - virtual void onMove(C_MoveInputHandler* handler) override; + virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; }; From 305e5fd9e9682e437f2c3abc6ff511963791fea5 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 26 Jun 2020 21:37:02 -0400 Subject: [PATCH 048/419] test --- Memory/GameData.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Memory/GameData.h b/Memory/GameData.h index a05c3b5d..92522007 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -213,17 +213,17 @@ class GameData { inline C_ClientInstance* getClientInstance() { return clientInstance; }; inline C_GuiData* getGuiData() { return clientInstance->getGuiData(); }; inline C_LocalPlayer* getLocalPlayer() { - #ifdef _BETA + /*#ifdef _BETA unsigned int converted = networkedData.localPlayerOffset ^ networkedData.xorKey; if (networkedData.localPlayerOffset < 0x110 || converted < 0x125 || converted > 0x191 || networkedData.dataSet == false) localPlayer = nullptr; else - localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); + localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted);*/ - #else + //#else localPlayer = clientInstance->localPlayer; - #endif + //#endif if (localPlayer == nullptr) gameMode = nullptr; From 6e39b8ea8ae09f87e3ae440e9134e0ebd6a69584 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 26 Jun 2020 21:43:04 -0400 Subject: [PATCH 049/419] bruh --- Memory/GameData.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Memory/GameData.h b/Memory/GameData.h index 92522007..a05c3b5d 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -213,17 +213,17 @@ class GameData { inline C_ClientInstance* getClientInstance() { return clientInstance; }; inline C_GuiData* getGuiData() { return clientInstance->getGuiData(); }; inline C_LocalPlayer* getLocalPlayer() { - /*#ifdef _BETA + #ifdef _BETA unsigned int converted = networkedData.localPlayerOffset ^ networkedData.xorKey; if (networkedData.localPlayerOffset < 0x110 || converted < 0x125 || converted > 0x191 || networkedData.dataSet == false) localPlayer = nullptr; else - localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted);*/ + localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); - //#else + #else localPlayer = clientInstance->localPlayer; - //#endif + #endif if (localPlayer == nullptr) gameMode = nullptr; From c1391242f9553bc44430f185d900e536bc43c07f Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 26 Jun 2020 21:44:46 -0400 Subject: [PATCH 050/419] fix ? --- Horion/Module/ModuleManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 63612e59..9d59b9e3 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -97,7 +97,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); #if defined(_BETA) or defined(_DEBUG) - //this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); + this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); #endif From facc03df5d1ca98da41ce0056fe8325c5048f3bd Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 27 Jun 2020 10:56:40 +0200 Subject: [PATCH 051/419] some crashes --- Horion.vcxproj | 2 - Horion/Module/ModuleManager.cpp | 1 - Horion/Module/ModuleManager.h | 1 - Horion/Module/Modules/ChestStealer.cpp | 2 +- .../Module/Modules/ForceOpenCommandBlock.cpp | 37 ------------------- Horion/Module/Modules/ForceOpenCommandBlock.h | 17 --------- Horion/Module/Modules/Scaffold.cpp | 2 +- Memory/Hooks.cpp | 6 --- 8 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 Horion/Module/Modules/ForceOpenCommandBlock.cpp delete mode 100644 Horion/Module/Modules/ForceOpenCommandBlock.h diff --git a/Horion.vcxproj b/Horion.vcxproj index c51e4a63..f10185fd 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -302,7 +302,6 @@ - @@ -483,7 +482,6 @@ - diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 63612e59..d5d46954 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -97,7 +97,6 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); #if defined(_BETA) or defined(_DEBUG) - //this->moduleList.push_back(std::shared_ptr(new ForceOpenCommandBlock())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); #endif diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 26fc127b..69c92445 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -76,7 +76,6 @@ #include "Modules/TriggerBot.h" #include "Modules/Xray.h" #include "Modules/NightMode.h" -#include "Modules/ForceOpenCommandBlock.h" #include "Modules/NoSwing.h" #include "Modules/CubeGlide.h" #include "Modules/AirStuck.h" diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 0d2740e4..bfd39c9c 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -19,7 +19,7 @@ void ChestStealer::onTick(C_GameMode* gm) { delay++; } if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr && delay > setDelay) { - chestScreenController->leaveScreen(); + //chestScreenController->leaveScreen(); delay = 0; } diff --git a/Horion/Module/Modules/ForceOpenCommandBlock.cpp b/Horion/Module/Modules/ForceOpenCommandBlock.cpp deleted file mode 100644 index b4fde526..00000000 --- a/Horion/Module/Modules/ForceOpenCommandBlock.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "ForceOpenCommandBlock.h" - -ForceOpenCommandBlock::ForceOpenCommandBlock() : IModule(0x0, Category::MISC, "Open command blocks even if you are not operator") { -} - -ForceOpenCommandBlock::~ForceOpenCommandBlock() { -} - -const char* ForceOpenCommandBlock::getModuleName() { - return ("ForceOpenCommandBlock"); -} - -void ForceOpenCommandBlock::onTick(C_GameMode* gm) { - if (GameData::canUseMoveKeys()) { - isInCommandBlock = false; - } else { - return; - } - PointingStruct* pointingStruct = g_Data.getClientInstance()->getPointerStruct(); - C_Block* block = gm->player->region->getBlock(pointingStruct->block); - int blockId = block->toLegacy()->blockId; - if (GameData::isRightClickDown() && !clicked) { - clicked = true; - if (pointingStruct->entityPtr != nullptr && pointingStruct->entityPtr->getEntityTypeId() == 100) { - distance = g_Data.getLocalPlayer()->getPos()->dist(*pointingStruct->entityPtr->getPos()); - isInCommandBlock = true; - __int64* id = pointingStruct->entityPtr->getUniqueId(); - //g_Data.getLocalPlayer()->openCommandBlockMinecart(*id); - } else if (block != nullptr && (blockId == 137 || blockId == 188 || blockId == 189)) { - distance = g_Data.getLocalPlayer()->getPos()->dist(pointingStruct->block.toFloatVector()); - isInCommandBlock = true; - //g_Data.getLocalPlayer()->openCommandBlock(pointingStruct->block); - } - } else if (!GameData::isRightClickDown()) { - clicked = false; - } -} diff --git a/Horion/Module/Modules/ForceOpenCommandBlock.h b/Horion/Module/Modules/ForceOpenCommandBlock.h deleted file mode 100644 index 59a067f2..00000000 --- a/Horion/Module/Modules/ForceOpenCommandBlock.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "Module.h" - -class ForceOpenCommandBlock : public IModule { -private: - bool clicked = false; - -public: - ForceOpenCommandBlock(); - ~ForceOpenCommandBlock(); - - bool isInCommandBlock = false; - float distance = 7; - - virtual const char* getModuleName() override; - virtual void onTick(C_GameMode* gm) override; -}; diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index 3eb86f4f..b76e14bb 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -3,7 +3,7 @@ #include "../../../Utils/Logger.h" Scaffold::Scaffold() : IModule(VK_NUMPAD1, Category::WORLD, "Automatically build blocks beneath you") { - registerBoolSetting("Spoof", &this->spoof, this->spoof); + //registerBoolSetting("Spoof", &this->spoof, this->spoof); } Scaffold::~Scaffold() { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 98867717..1418611c 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1383,12 +1383,6 @@ float Hooks::GameMode_getPickRange(C_GameMode* _this, __int64 a2, char a3) { static auto oFunc = g_Hooks.GameMode_getPickRangeHook->GetFastcall(); if (g_Data.getLocalPlayer() != nullptr) { -#ifdef _BETA - static auto forceOpenCmdBlock = moduleMgr->getModule(); - if (forceOpenCmdBlock->isEnabled() && forceOpenCmdBlock->isInCommandBlock) - return forceOpenCmdBlock->distance; -#endif - static auto infiniteBlockReachModule = moduleMgr->getModule(); if (infiniteBlockReachModule->isEnabled()) return infiniteBlockReachModule->getBlockReach(); From 95329b6e146027585f822beb14b891c2bde7ee96 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 27 Jun 2020 19:59:10 +0200 Subject: [PATCH 052/419] fix autototem, inventorycleaner autosort --- Horion/Module/Modules/AutoTotem.cpp | 35 +++++++++------------- Horion/Module/Modules/AutoTotem.h | 4 --- Horion/Module/Modules/InventoryCleaner.cpp | 26 +++------------- SDK/CInventory.cpp | 33 ++++++++++++++++++++ SDK/CInventory.h | 2 ++ 5 files changed, 53 insertions(+), 47 deletions(-) diff --git a/Horion/Module/Modules/AutoTotem.cpp b/Horion/Module/Modules/AutoTotem.cpp index 77069418..639d9823 100644 --- a/Horion/Module/Modules/AutoTotem.cpp +++ b/Horion/Module/Modules/AutoTotem.cpp @@ -1,6 +1,6 @@ #include "AutoTotem.h" -AutoTotem::AutoTotem() : IModule(0x0, Category::PLAYER, "Automatically puts Totems into your offhand") { +AutoTotem::AutoTotem() : IModule(0x0, Category::PLAYER, "Automatically puts totems into your offhand") { } AutoTotem::~AutoTotem() { @@ -11,27 +11,20 @@ const char* AutoTotem::getModuleName() { } void AutoTotem::onTick(C_GameMode* gm) { - C_ItemStack* i = g_Data.getLocalPlayer()->getEquippedTotem(); - - if (i->item == NULL && delay > 3) { - C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); - C_Inventory* a = supplies->inventory; + C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); + C_Inventory* inv = supplies->inventory; + C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); + C_ItemStack* current = g_Data.getLocalPlayer()->getEquippedTotem(); + if (current->item == NULL) { for (int i = 0; i < 36; i++) { - C_ItemStack* test = a->getItemStack(i); - if (test->item != NULL) { - C_Item* yikes = *test->item; - if (yikes->itemId == 450) { - g_Data.getLocalPlayer()->consumeTotem(); - g_Data.getLocalPlayer()->setOffhandSlot(test); - } + C_ItemStack* totem = inv->getItemStack(i); + if (totem->item != NULL && (*totem->item)->itemId == 450) { + C_InventoryAction first(i, totem, nullptr); + C_InventoryAction second(37, nullptr, totem); + g_Data.getLocalPlayer()->setOffhandSlot(totem); + manager->addInventoryAction(first); + manager->addInventoryAction(second); } } - delay = 0; - } - - delay++; - -} - -void AutoTotem::onEnable() { + } } diff --git a/Horion/Module/Modules/AutoTotem.h b/Horion/Module/Modules/AutoTotem.h index bbe494f7..042d8266 100644 --- a/Horion/Module/Modules/AutoTotem.h +++ b/Horion/Module/Modules/AutoTotem.h @@ -2,14 +2,10 @@ #include "Module.h" class AutoTotem : public IModule { -private: - int delay = 0; - public: AutoTotem(); ~AutoTotem(); virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; - virtual void onEnable() override; }; diff --git a/Horion/Module/Modules/InventoryCleaner.cpp b/Horion/Module/Modules/InventoryCleaner.cpp index a1a2a4b5..1261498a 100644 --- a/Horion/Module/Modules/InventoryCleaner.cpp +++ b/Horion/Module/Modules/InventoryCleaner.cpp @@ -8,7 +8,7 @@ InventoryCleaner::InventoryCleaner() : IModule(0x0, Category::PLAYER, "Automatic registerBoolSetting("Food", &this->keepFood, this->keepFood); registerBoolSetting("Blocks", &this->keepBlocks, this->keepBlocks); registerBoolSetting("OpenInv", &this->openInv, this->openInv); - //registerBoolSetting("AutoSort", &this->autoSort, this->autoSort); + registerBoolSetting("AutoSort", &this->autoSort, this->autoSort); } InventoryCleaner::~InventoryCleaner() { @@ -19,7 +19,7 @@ const char* InventoryCleaner::getModuleName() { } void InventoryCleaner::onTick(C_GameMode* gm) { - if ((g_Data.getLocalPlayer()->canOpenContainerScreen() || moduleMgr->getModule()->chestScreenController != nullptr) && openInv) + if (g_Data.getLocalPlayer()->canOpenContainerScreen() && openInv) return; // Drop useless items @@ -31,20 +31,7 @@ void InventoryCleaner::onTick(C_GameMode* gm) { } if (autoSort) { - // Stack all items - { - std::vector stackableSlots = findStackableItems(); - if (!stackableSlots.empty()) { - C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); - int slot = stackableSlots.at(0); - C_ItemStack* item = g_Data.getLocalPlayer()->getSupplies()->inventory->getItemStack(stackableSlots.at(1)); - C_InventoryAction* firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - C_InventoryAction* secondAction = new C_InventoryAction(slot, nullptr, item); - manager->addInventoryAction(*firstAction); - manager->addInventoryAction(*secondAction); - } - } - // Put sword in first empty slot + // Put sword in first slot { C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); C_Inventory* inv = supplies->inventory; @@ -60,12 +47,7 @@ void InventoryCleaner::onTick(C_GameMode* gm) { } } } - C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); - int slot = inv->getFirstEmptySlot(); - C_InventoryAction* firstAction = new C_InventoryAction(0, inv->getItemStack(item), nullptr, 507, 99999); - C_InventoryAction* secondAction = new C_InventoryAction(slot, nullptr, inv->getItemStack(item)); - manager->addInventoryAction(*firstAction); - manager->addInventoryAction(*secondAction); + if (item != supplies->selectedHotbarSlot && item != 0) inv->moveItem(item, 0); } } } diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index 3ca745c6..59ee08f5 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -1,5 +1,6 @@ #include "CInventory.h" #include "../Utils/Utils.h" +#include "../Memory/GameData.h" void C_Inventory::dropSlot(int slot) { // FillingContainer::dropSlot using drop_t = void(__fastcall*)(C_Inventory*, int, char); @@ -39,3 +40,35 @@ void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name if (autoPlaceFunc != 0x0) autoPlaceFunc(this, a1, txt, slot); } + +void C_Inventory::moveItem(int from, int to = -1) { + C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); + + uintptr_t sigOffset = FindSignature("48 8D 3D ? ? ? ? 80 B8 ? ? ? ? ? 75 19 48 8B 88 ? ? ? ? 48 8B 11 4C 8B 42 28 8B 50 10"); + int offset = *reinterpret_cast(sigOffset + 3); + C_ItemStack* emptyItemStack = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + + if (to < 0) to = getFirstEmptySlot(); + C_ItemStack* item1 = getItemStack(from); + C_ItemStack* item2 = getItemStack(to); + + if (item1->item == NULL) return; + if (item2->item == NULL) { + C_InventoryAction first(from, item1, nullptr); + C_InventoryAction second(to, nullptr, item1); + manager->addInventoryAction(first); + manager->addInventoryAction(second); + *item2 = *item1; + *item1 = *emptyItemStack; + } else { + C_InventoryAction first(from, item1, nullptr); + C_InventoryAction second(to, item2, item1); + C_InventoryAction third(from, nullptr, item2); + manager->addInventoryAction(first); + manager->addInventoryAction(second); + manager->addInventoryAction(third); + C_ItemStack a = *item2; + *item2 = *item1; + *item1 = a; + } +} diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 2999b36a..9f830d5f 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -23,6 +23,8 @@ class C_Inventory { virtual bool hasRoomForItem(C_ItemStack*); virtual __int64 addItem(C_ItemStack*); virtual __int64 addItemToFirstEmptySlot(C_ItemStack*); + + void moveItem(int from, int to); }; class C_PlayerInventoryProxy { From afc51566f0706c67b0e9f62c968761898cd4baf0 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 27 Jun 2020 14:22:11 -0400 Subject: [PATCH 053/419] fix cheststealer --- Horion/Module/Modules/ChestStealer.cpp | 2 +- SDK/CInventory.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index bfd39c9c..0d2740e4 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -19,7 +19,7 @@ void ChestStealer::onTick(C_GameMode* gm) { delay++; } if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr && delay > setDelay) { - //chestScreenController->leaveScreen(); + chestScreenController->leaveScreen(); delay = 0; } diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 9f830d5f..5307f0f4 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -46,6 +46,7 @@ class C_ContainerScreenController { virtual __int64 destructor(); virtual __int64 tick(void); virtual __int64 handleEvent(__int64&); + virtual __int64 sub_140321330(void) const; virtual __int64 onOpen(void); virtual __int64 onTerminate(void); virtual __int64 onInit(void); @@ -125,4 +126,4 @@ class C_CraftingScreenController : public C_ContainerScreenController { }; class C_ChestScreenController : public C_ContainerScreenController { -}; +}; \ No newline at end of file From 3f7a4452bc0e133ca81dd48f2e934a330c25f2af Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 28 Jun 2020 12:45:36 +0200 Subject: [PATCH 054/419] display nametags correctly above the entity --- Horion/DrawUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 4e0d8253..04fcde6f 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -299,7 +299,7 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo float textWidth = getTextWidth(&text, textSize); float textHeight = DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() * textSize; - if (refdef->OWorldToScreen(origin, ent->eyePos0, textPos, fov, screenSize)) { + if (refdef->OWorldToScreen(origin, ent->eyePos0.add(0, 0.5f, 0), textPos, fov, screenSize)) { textPos.y -= textHeight; textPos.x -= textWidth / 2.f; rectPos.x = textPos.x - 1.f; From c9f21b141c097856ec7dfde60b6ae2c8378ad506 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 28 Jun 2020 13:06:42 +0200 Subject: [PATCH 055/419] improve cheststealer --- Horion/Module/Modules/ChestStealer.cpp | 27 ++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 0d2740e4..93e3576a 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -1,7 +1,7 @@ #include "ChestStealer.h" ChestStealer::ChestStealer() : IModule(0x0, Category::PLAYER, "Automatically takes all items out of a chest") { - registerIntSetting("Close Delay", &this->setDelay, this->setDelay, 3, 20); + registerIntSetting("Close Delay", &this->setDelay, this->setDelay, 0, 20); } ChestStealer::~ChestStealer() { @@ -11,17 +11,28 @@ const char* ChestStealer::getModuleName() { return ("ChestStealer"); } +std::vector items; + void ChestStealer::onTick(C_GameMode* gm) { if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr) { + for (int i = 0; i < 54; i++) { - chestScreenController->handleAutoPlace(0x7FFFFFFF, "container_items", i); + if (chestScreenController->_getItemStack(TextHolder("container_items"), i)->item != NULL) + items.push_back(i); } - delay++; - } - if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr && delay > setDelay) { - chestScreenController->leaveScreen(); - delay = 0; - } + if (!items.empty()) { + for (int i : items) { + chestScreenController->handleAutoPlace(0x7FFFFFFF, "container_items", i); + } + items.clear(); + } else { + delay++; + if (delay > setDelay) { + chestScreenController->leaveScreen(); + delay = 0; + } + } + } chestScreenController = nullptr; } From 666a69eeae74a4a5ae5715b04217a7654d963929 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 28 Jun 2020 13:19:59 +0200 Subject: [PATCH 056/419] make esp & nametags not draw over hud --- Horion/Module/Modules/ChestESP.cpp | 2 +- Horion/Module/Modules/ChestESP.h | 2 +- Horion/Module/Modules/ESP.cpp | 2 +- Horion/Module/Modules/ESP.h | 2 +- Horion/Module/Modules/InventoryCleaner.cpp | 2 +- Horion/Module/Modules/NameTags.cpp | 2 +- Horion/Module/Modules/NameTags.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/ChestESP.cpp index 3289373f..4ecf77bd 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/ChestESP.cpp @@ -11,7 +11,7 @@ const char* ChestESP::getModuleName() { return ("ChestESP"); } -void ChestESP::onPostRender(C_MinecraftUIRenderContext* renderCtx) { +void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (!g_Data.isInGame() || !GameData::canUseMoveKeys() || g_Data.getLocalPlayer() == nullptr) return; //if (listSize < 1000 && listSize > 1) { diff --git a/Horion/Module/Modules/ChestESP.h b/Horion/Module/Modules/ChestESP.h index 475648ca..ce1d7e95 100644 --- a/Horion/Module/Modules/ChestESP.h +++ b/Horion/Module/Modules/ChestESP.h @@ -14,6 +14,6 @@ class ChestESP : public IModule { // Inherited via IModule virtual const char* getModuleName() override; - virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; virtual void onTick(C_GameMode* gm) override; }; diff --git a/Horion/Module/Modules/ESP.cpp b/Horion/Module/Modules/ESP.cpp index 5d53abd5..a621a7f9 100644 --- a/Horion/Module/Modules/ESP.cpp +++ b/Horion/Module/Modules/ESP.cpp @@ -51,7 +51,7 @@ void doRenderStuff(C_Entity* ent, bool isRegularEntitie) { } -void ESP::onPostRender(C_MinecraftUIRenderContext* renderCtx) { +void ESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); if (localPlayer != nullptr && GameData::canUseMoveKeys()) { diff --git a/Horion/Module/Modules/ESP.h b/Horion/Module/Modules/ESP.h index d28cddd7..7aede33d 100644 --- a/Horion/Module/Modules/ESP.h +++ b/Horion/Module/Modules/ESP.h @@ -13,5 +13,5 @@ class ESP : public IModule { // Inherited via IModule virtual const char* getModuleName() override; - virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; }; diff --git a/Horion/Module/Modules/InventoryCleaner.cpp b/Horion/Module/Modules/InventoryCleaner.cpp index 1261498a..f7f8bd40 100644 --- a/Horion/Module/Modules/InventoryCleaner.cpp +++ b/Horion/Module/Modules/InventoryCleaner.cpp @@ -47,7 +47,7 @@ void InventoryCleaner::onTick(C_GameMode* gm) { } } } - if (item != supplies->selectedHotbarSlot && item != 0) inv->moveItem(item, 0); + if (item != 0) inv->moveItem(item, 0); } } } diff --git a/Horion/Module/Modules/NameTags.cpp b/Horion/Module/Modules/NameTags.cpp index 2e538c7f..6578d063 100644 --- a/Horion/Module/Modules/NameTags.cpp +++ b/Horion/Module/Modules/NameTags.cpp @@ -32,7 +32,7 @@ void drawNameTags(C_Entity* ent, bool isRegularEntitie) { } } -void NameTags::onPostRender(C_MinecraftUIRenderContext* renderCtx) { +void NameTags::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); if (nameTags.size() > 100) diff --git a/Horion/Module/Modules/NameTags.h b/Horion/Module/Modules/NameTags.h index f32e75c5..f06a9dd2 100644 --- a/Horion/Module/Modules/NameTags.h +++ b/Horion/Module/Modules/NameTags.h @@ -11,5 +11,5 @@ class NameTags : public IModule { // Inherited via IModule virtual const char* getModuleName() override; - virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; }; From 2fa5259f303333022bba52c50ad3690fe60ce2de Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 28 Jun 2020 13:52:52 +0200 Subject: [PATCH 057/419] make nametags draw over each other + render them in right order (dist) --- Horion/DrawUtils.cpp | 14 +++++++------- Horion/Module/Modules/NameTags.cpp | 12 ++++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 04fcde6f..9c7c484b 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -302,14 +302,14 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo if (refdef->OWorldToScreen(origin, ent->eyePos0.add(0, 0.5f, 0), textPos, fov, screenSize)) { textPos.y -= textHeight; textPos.x -= textWidth / 2.f; - rectPos.x = textPos.x - 1.f; - rectPos.y = textPos.y - 1.f; - rectPos.z = textPos.x + textWidth + 1.f; - rectPos.w = textPos.y + textHeight + 2.f; + rectPos.x = textPos.x - 1.f * textSize; + rectPos.y = textPos.y - 1.f * textSize; + rectPos.z = textPos.x + textWidth + 1.f * textSize; + rectPos.w = textPos.y + textHeight + 2.f * textSize; vec4_t subRectPos = rectPos; - subRectPos.y = subRectPos.w - 1.f; + subRectPos.y = subRectPos.w - 1.f * textSize; fillRectangle(rectPos, MC_Color(13, 29, 48), 0.8f); - fillRectangle(subRectPos, MC_Color(28, 107, 201), 0.8f); + fillRectangle(subRectPos, MC_Color(28, 107, 201), 0.9f); drawText(textPos, &text, MC_Color(255, 255, 255), textSize); static auto nameTagsMod = moduleMgr->getModule(); @@ -318,7 +318,7 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo auto* player = reinterpret_cast(ent); float scale = textSize * 0.6f; float spacing = scale + 15.f; - float x = rectPos.x + 1.f; + float x = rectPos.x + 1.f * textSize; float y = rectPos.y - 20.f * scale; // armor for (int i = 0; i < 4; i++) { diff --git a/Horion/Module/Modules/NameTags.cpp b/Horion/Module/Modules/NameTags.cpp index 6578d063..3fe11821 100644 --- a/Horion/Module/Modules/NameTags.cpp +++ b/Horion/Module/Modules/NameTags.cpp @@ -26,7 +26,8 @@ void drawNameTags(C_Entity* ent, bool isRegularEntitie) { if (Target::isValidTarget(ent) && nameTagsMod != nullptr) { nameTagsMod->nameTags.insert(Utils::sanitize(ent->getNameTag()->getText())); float dist = ent->getPos()->dist(*g_Data.getLocalPlayer()->getPos()); - DrawUtils::drawNameTags(ent, fmax(0.6f, 1.5f / dist)); + DrawUtils::drawNameTags(ent, fmax(0.6f, 3.f / dist)); + DrawUtils::flush(); } } @@ -39,7 +40,14 @@ void NameTags::onPreRender(C_MinecraftUIRenderContext* renderCtx) { nameTags.clear(); if (localPlayer != nullptr && GameData::canUseMoveKeys()) { - g_Data.forEachEntity(drawNameTags); + std::vector temp; + for (int i = 0; i < g_Data.getEntityList()->getListSize(); i++) + temp.push_back(g_Data.getEntityList()->get(i)); + std::sort(temp.begin(), temp.end(), [localPlayer](const C_Entity* lhs, const C_Entity* rhs) { + return localPlayer->getPos()->dist(*lhs->getPos()) > localPlayer->getPos()->dist(*rhs->getPos()); + }); + for (C_Entity* ent : temp) + drawNameTags(ent, true); } else { nameTags.clear(); } From 94354ddc8c4bf6ed34e9f16ea985476f214b7bd4 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 00:51:08 -0400 Subject: [PATCH 058/419] support 1.16.1 --- Horion/Loader.cpp | 1 + Horion/Module/Modules/NoSlowDown.cpp | 19 +++++-- Horion/Module/Modules/Reach.cpp | 7 ++- Memory/GameData.cpp | 6 ++- Memory/GameData.h | 9 +++- Memory/Hooks.cpp | 77 +++++++++++++++++++++++----- SDK/CEntity.cpp | 13 +++-- SDK/CInventory.cpp | 2 +- SDK/CPacket.cpp | 2 +- 9 files changed, 109 insertions(+), 27 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 4daf0f18..71b015fa 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -341,6 +341,7 @@ DWORD WINAPI start(LPVOID lpParam) { MH_Initialize(); GameData::initGameData(gameModule, &mem, (HMODULE)lpParam); + g_Data.checkGameVersion(); Target::init(g_Data.getPtrLocalPlayer()); Hooks::Init(); diff --git a/Horion/Module/Modules/NoSlowDown.cpp b/Horion/Module/Modules/NoSlowDown.cpp index 3b500f4a..f0c7aef1 100644 --- a/Horion/Module/Modules/NoSlowDown.cpp +++ b/Horion/Module/Modules/NoSlowDown.cpp @@ -17,8 +17,12 @@ const char* NoSlowDown::getModuleName() { void NoSlowDown::onEnable() { if (opcode == 0 || opcode1 == 0) { - opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 7E")); - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?")); + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + else + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); } DWORD oldProtect = 0; @@ -53,8 +57,12 @@ void NoSlowDown::onEnable() { void NoSlowDown::onDisable() { if (opcode == 0 || opcode1 == 0) { - opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 7E")); - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?")); + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); + else + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); } DWORD oldProtect = 0; @@ -82,7 +90,8 @@ void NoSlowDown::onDisable() { opcode1[0] = 0xF3; opcode1[1] = 0x0F; opcode1[2] = 0x11; - opcode1[3] = 0x47; + //opcode1[3] = 0x47; + opcode1[3] = 0x46; opcode1[4] = 0x0C; //opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C}; VirtualProtect(opcode1, 5, oldProtect, &oldProtect); diff --git a/Horion/Module/Modules/Reach.cpp b/Horion/Module/Modules/Reach.cpp index ace372b9..c563af83 100644 --- a/Horion/Module/Modules/Reach.cpp +++ b/Horion/Module/Modules/Reach.cpp @@ -24,7 +24,12 @@ void Reach::onTick(C_GameMode* gm) { void Reach::onEnable() { static uintptr_t sigOffset = 0x0; if (sigOffset == 0x0) { - sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 0F 2F F8 76"); + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 0F 2F F8 76"); + else + sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 44 0F 2F E8 76 0B"); + if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 4)); // Get Offset from code reachPtr = reinterpret_cast(sigOffset + offset + 8); diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 6e414e00..cdc32cd7 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -24,12 +24,14 @@ void GameData::retrieveClientInstance() { #endif } -TextHolder* GameData::getGameVersion() { +void GameData::checkGameVersion() { static uintptr_t sigOffset = 0x0; if (sigOffset == 0x0) sigOffset = FindSignature("48 8D 1D ?? ?? ?? ?? 8B 04 0A 39 05 ?? ?? ?? ?? 0F 8F ?? ?? ?? ?? 4C 8B CB 48 83 3D ?? ?? ?? ?? 10 4C 0F 43 0D ?? ?? ?? ??"); int offset = *reinterpret_cast((sigOffset + 3)); - return reinterpret_cast(sigOffset + offset + 7); + std::string ver = reinterpret_cast(sigOffset + offset + 7)->getText(); + int num = ver.back() - '0'; + this->version = static_cast(num); } bool GameData::canUseMoveKeys() { diff --git a/Memory/GameData.h b/Memory/GameData.h index a05c3b5d..9cf4b857 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -28,6 +28,11 @@ enum DATAPACKET_CMD : int { CMD_LOG }; +enum GAMEVERSION : int { + g_1_16_0 = 0, + g_1_16_1 +}; + struct HorionDataPacket { DATAPACKET_CMD cmd; int params[5] = {0}; @@ -95,6 +100,7 @@ class GameData { AccountInformation accountInformation = AccountInformation::asGuest(); static void retrieveClientInstance(); TextHolder* fakeName; + GAMEVERSION version; public: NetworkedData networkedData; @@ -115,8 +121,8 @@ class GameData { static void EntityList_tick(C_EntityList* list); static void setHIDController(C_HIDController* Hid); static void setRakNetInstance(C_RakNetInstance* raknet); - static TextHolder* getGameVersion(); static void log(const char* fmt, ...); + void checkGameVersion(); float fov = 0.f; int fps = 0; int frameCount = 0; @@ -254,6 +260,7 @@ class GameData { int getFPS() { return fps; }; int getLeftCPS() { return cpsLeft; }; int getRightCPS() { return cpsRight; }; + GAMEVERSION getVersion() { return version; }; }; extern GameData g_Data; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1418611c..d703b1ed 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -33,7 +33,8 @@ void Hooks::Init() { // BlockLegacy::vtable { - uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 48 89 ?? 4C 39"); // BlockLegacy constructor + //uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 48 89 ?? 4C 39"); // BlockLegacy constructor + intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 39 7A ? 75 1A 48 C7 45"); // BlockLegacy constructor int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (blockLegacyVtable == 0x0 || sigOffset == 0x0) @@ -212,7 +213,12 @@ void Hooks::Init() { uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); - void* getFov = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ?? 0F 29 74 24 ? 0F 29 7C 24 ? 44 0F 29 44 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F 28 C1")); + void* getFov = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + getFov = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ?? 0F 29 74 24 ? 0F 29 7C 24 ? 44 0F 29 44 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F 28 C1")); + else + getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); + g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); @@ -230,13 +236,21 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = reinterpret_cast(FindSignature("4C 8B DC 57 48 83 EC ?? 49 C7 43 ?? FE FF FF FF 49 89 5B ?? 49 89 73 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 49 89 43 ?? 49 89 43 ?? 48 8B 01 49")); + void* fullbright = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + fullbright = reinterpret_cast(FindSignature("4C 8B DC 57 48 83 EC ?? 49 C7 43 ?? FE FF FF FF 49 89 5B ?? 49 89 73 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 49 89 43 ?? 49 89 43 ?? 48 8B 01 49")); + else + fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ? 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 33 C0 48 89 44 24 ? 48 89 44 24 ? 48 8B 01 48 8D 54 24 ? FF 90 ? ? ? ?")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); - void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 E8 ?? ?? ?? ?? 48")); + void* onAppSuspended = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 E8 ?? ?? ?? ?? 48")); + else + onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F1 48 C7 85 ? ? ? ? ? ? ? ? 48 8D 95 ? ? ? ? 48 8B 89 ? ? ? ?")); @@ -248,7 +262,11 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); + void* _getSkinPack = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); + else + _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 85 ? ? ? ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); @@ -262,7 +280,10 @@ void Hooks::Init() { g_Hooks.InventoryTransactionManager__addActionHook = std::make_unique(addAction, Hooks::InventoryTransactionManager__addAction); #endif - void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 0F 29 70 ?? 48 8B 05")); + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 0F 29 70 ?? 48 8B 05")); + else + void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 98 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 10 48 89 78 18 0F 29 70 E8 48 8B 05 ? ? ? ? 48 33 C4")); g_Hooks.prepFeaturedServersHook = std::make_unique(prepFeaturedServers, Hooks::prepFeaturedServers); void* prepFeaturedServersFirstTime = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA")); @@ -271,7 +292,11 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 33")); + void* MobIsImmobile = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 33")); + else + MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 80 B9 ? ? ? ? ? 48 8B D9 75 5E")); g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); @@ -921,7 +946,15 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { static auto noKnockbackmod = moduleMgr->getModule(); if (noKnockbackmod->isEnabled()) { - static void* networkSender = reinterpret_cast(6 + FindSignature("FF 90 ?? ?? ?? ?? 4C 8D 9C 24 ?? ?? ?? ?? 49 8B 5B 18 49 8B 73 28 49 8B E3 5F C3")); + static void* networkSender = nullptr; + + if (!networkSender) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + networkSender = reinterpret_cast(6 + FindSignature("FF 90 ?? ?? ?? ?? 4C 8D 9C 24 ?? ?? ?? ?? 49 8B 5B 18 49 8B 73 28 49 8B E3 5F C3")); + else + networkSender = reinterpret_cast(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76")); + } + if (networkSender == _ReturnAddress()) { motVec = _this->velocity.lerp(motVec, noKnockbackmod->xModifier, noKnockbackmod->yModifier, noKnockbackmod->xModifier); } @@ -948,7 +981,13 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) using syncShit_t = void(__fastcall*)(__int64*, TextHolder*); static syncShit_t syncShit = nullptr; if (syncShit == nullptr) { - uintptr_t sigOffset = FindSignature("40 53 48 83 EC ?? 48 C7 44 24 20 FE FF FF FF 48 8B DA 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 90 48 8B C8 E8 ?? ?? ?? ?? 48 8B 08 4C 8B 81 ?? 04"); + uintptr_t sigOffset = 0; + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + sigOffset = FindSignature("40 53 48 83 EC ?? 48 C7 44 24 20 FE FF FF FF 48 8B DA 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 90 48 8B C8 E8 ?? ?? ?? ?? 48 8B 08 4C 8B 81 ?? 04"); + else + sigOffset = FindSignature("40 57 48 83 EC 40 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B F2 48 8D 3D ? ? ? ? 48 8B CF"); + syncShit = reinterpret_cast(sigOffset); } @@ -1108,8 +1147,15 @@ float Hooks::LevelRendererPlayer_getFov(__int64 _this, float a2, bool a3) { static auto oGetFov = g_Hooks.LevelRendererPlayer_getFovHook->GetFastcall(); static void* renderItemInHand = reinterpret_cast(FindSignature("0F 28 F0 F3 44 0F 10 3D ?? ?? ?? ?? F3 41 0F 59 F7")); - //static void* setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ?? ?? ?? ?? 41 0F B6 4E ??")); - static void* setupCamera = reinterpret_cast(FindSignature("0F 28 F8 F3 0F 59 3D ? ? ? ? 41 0F B6 4E ? 88 4C 24 ?? 44 0F B6 E1")); + static void* setupCamera = nullptr; + + if (!setupCamera) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + setupCamera = reinterpret_cast(FindSignature("0F 28 F8 F3 0F 59 3D ? ? ? ? 41 0F B6 4E ? 88 4C 24 ?? 44 0F B6 E1")); + else + setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ? ? ? ? 41 0F B6 4E ? 88 4C 24")); + } + static auto zoomModule = moduleMgr->getModule(); @@ -1222,7 +1268,14 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) static auto oFunc = g_Hooks.LevelRenderer_renderLevelHook->GetFastcall<__int64, __int64, __int64, __int64>(); using reloadShit_t = void(__fastcall*)(__int64); - static reloadShit_t reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 ?? EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ?? 48 89 68 ?? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9")); + static reloadShit_t reloadChunk = nullptr; + + if (!reloadChunk) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 ?? EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ?? 48 89 68 ?? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9")); + else + reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9 4C 8D B9 ? ? ? ? 49 8B CF")); + } static auto xrayMod = moduleMgr->getModule(); diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index 9142cbe7..d11547ae 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -1,5 +1,6 @@ #include "CEntity.h" #include "../Utils/Utils.h" +#include "../Memory/GameData.h" C_InventoryTransactionManager *C_Entity::getTransactionManager() { static unsigned int offset = 0; if (offset == 0) { @@ -13,7 +14,10 @@ C_PlayerInventoryProxy *C_Player::getSupplies() { static unsigned int offset = 0; if (offset == 0) { //offset = *reinterpret_cast(FindSignature("4C 8B 82 ?? ?? ?? ?? 48 8B B2") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies - offset = *reinterpret_cast(FindSignature("48 8B 53 ? 48 8B F0 4C 8B 8A ? ? ? ? 41 80 B9 ? ? ? ? ? 75 18 49 8B 89 ? ? ? ? 41 8B 51 ? 4C 8B 01 41 FF 50") + 10); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + offset = *reinterpret_cast(FindSignature("48 8B 53 ? 48 8B F0 4C 8B 8A ? ? ? ? 41 80 B9 ? ? ? ? ? 75 18 49 8B 89 ? ? ? ? 41 8B 51 ? 4C 8B 01 41 FF 50") + 10); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + else + offset = *reinterpret_cast(FindSignature("48 8B 51 ? 4C 8B 82 ? ? ? ? 48 8B B2 ? ? ? ? 41 80 B8 ? ? ? ? ? ") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies } return *reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } @@ -30,7 +34,8 @@ void C_LocalPlayer::applyTurnDelta(vec2_t *viewAngleDelta) { } void C_LocalPlayer::setGameModeType(int gma) { // Player::setPlayerGameType - using setGameMode = void(__thiscall *)(void *, int); - static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); - Game_Mode(this, gma); + //using setGameMode = void(__thiscall *)(void *, int); + //static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); + this->setC_PlayerGameType(gma); + //Game_Mode(this, gma); } diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index 59ee08f5..37aeee8e 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -33,7 +33,7 @@ int C_Inventory::getFirstEmptySlot() { } void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); - static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8 44 8B EA 89 54 24 ? 48 8B F1 49 BF ? ? ? ? ? ? ? ?")); + static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8")); TextHolder txt = TextHolder(name); diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 891d3e62..672c4530 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -55,7 +55,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos C_ActorFallPacket::C_ActorFallPacket() { static uintptr_t** ActorFallPacketVtable = 0x0; if (ActorFallPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4D ? 48 89 45 ? F3 44 0F 11 45 ? 88 5D F3"); + uintptr_t sigOffset = FindSignature("48 8D ? ? ? ? ? 48 89 ? E7 48 89 45 0F F3 0F 11 75 ?"); int offset = *reinterpret_cast(sigOffset + 3); ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG From ce2bde03588f97e27cc89eb4a1449e7891606029 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 00:58:00 -0400 Subject: [PATCH 059/419] fix --- Horion/Module/Modules/NoSlowDown.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/NoSlowDown.cpp b/Horion/Module/Modules/NoSlowDown.cpp index f0c7aef1..19a32f01 100644 --- a/Horion/Module/Modules/NoSlowDown.cpp +++ b/Horion/Module/Modules/NoSlowDown.cpp @@ -90,8 +90,12 @@ void NoSlowDown::onDisable() { opcode1[0] = 0xF3; opcode1[1] = 0x0F; opcode1[2] = 0x11; - //opcode1[3] = 0x47; - opcode1[3] = 0x46; + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + opcode1[3] = 0x47; + else + opcode1[3] = 0x46; + opcode1[4] = 0x0C; //opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C}; VirtualProtect(opcode1, 5, oldProtect, &oldProtect); From ea6f18bea9b28129d7cd5ee28f82efb32736d0ab Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 01:20:21 -0400 Subject: [PATCH 060/419] fix cbe --- SDK/Tag.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SDK/Tag.cpp b/SDK/Tag.cpp index 3aee427f..cee58a6f 100644 --- a/SDK/Tag.cpp +++ b/SDK/Tag.cpp @@ -2,6 +2,7 @@ #include "../Utils/Utils.h" #include "../Utils/Logger.h" +#include "../Memory/GameData.h" #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -268,7 +269,15 @@ CompoundTag::CompoundTag() { } void CompoundTag::put(TextHolder& tag, std::unique_ptr value) { using CompoundTag__putF = void(__fastcall*)(CompoundTag*, TextHolder&, std::unique_ptr); - static CompoundTag__putF func = reinterpret_cast(FindSignature("4C 8B DC 55 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 49 89 5B ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B D8 48 8B FA 48 8B E9")); + static CompoundTag__putF func = nullptr; + + if (!func) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + func = reinterpret_cast(FindSignature("4C 8B DC 55 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 49 89 5B ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B D8 48 8B FA 48 8B E9")); + else + func = reinterpret_cast(FindSignature("4C 8B DC 53 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 49 8B F8 48 8B DA")); + } + func(this, tag, std::move(value)); } void Handler::handleWrite(Tag* value, std::stringstream& builder) { From beb67073c965a3b414234169346fb1170636aaed Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 30 Jun 2020 12:13:45 +0200 Subject: [PATCH 061/419] add killaura hurttime --- Horion/Module/Modules/ChestStealer.cpp | 9 +++------ Horion/Module/Modules/Killaura.cpp | 4 ++++ Horion/Module/Modules/Killaura.h | 1 + Horion/Module/Modules/TestModule.cpp | 16 ---------------- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 93e3576a..c78e5b9a 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -11,21 +11,18 @@ const char* ChestStealer::getModuleName() { return ("ChestStealer"); } -std::vector items; - void ChestStealer::onTick(C_GameMode* gm) { if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr) { - + std::vector items = {}; for (int i = 0; i < 54; i++) { - if (chestScreenController->_getItemStack(TextHolder("container_items"), i)->item != NULL) + C_ItemStack* stack = chestScreenController->_getItemStack(TextHolder("container_items"), i); + if (stack != nullptr && stack->item != NULL) items.push_back(i); } - if (!items.empty()) { for (int i : items) { chestScreenController->handleAutoPlace(0x7FFFFFFF, "container_items", i); } - items.clear(); } else { delay++; if (delay > setDelay) { diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index 839087d4..07a37a6a 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -5,6 +5,7 @@ Killaura::Killaura() : IModule('P', Category::COMBAT, "Attacks entities around y this->registerBoolSetting("MobAura", &this->isMobAura, this->isMobAura); this->registerFloatSetting("range", &this->range, this->range, 2.f, 20.f); this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); + this->registerBoolSetting("hurttime", &this->hurttime, this->hurttime); this->registerBoolSetting("AutoWeapon", &this->autoweapon, this->autoweapon); this->registerBoolSetting("Silent Rotations", &this->silent, this->silent); } @@ -36,6 +37,9 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { if(!currentEntity->isAlive()) return; + if (currentEntity->damageTime > 0 && killauraMod->hurttime) + return; + if (killauraMod->isMobAura) { if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 63) return; diff --git a/Horion/Module/Modules/Killaura.h b/Horion/Module/Modules/Killaura.h index 43452945..2cf203ea 100644 --- a/Horion/Module/Modules/Killaura.h +++ b/Horion/Module/Modules/Killaura.h @@ -15,6 +15,7 @@ class Killaura : public IModule public: bool isMobAura = false; + bool hurttime = true; float range = 6; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index ababf1ee..99c33403 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,7 +1,6 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" - TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { } @@ -16,25 +15,10 @@ bool TestModule::isFlashMode() { return false; } -int delay = 0; void TestModule::onEnable() { } - - -vec3_t lastPos{}; void TestModule::onTick(C_GameMode* gm) { - - auto diff = gm->player->eyePos0.sub(lastPos); - diff.y = 0; - auto player = g_Data.getLocalPlayer(); - auto pPos = player->eyePos0; - vec3_ti startNode((int)floorf(pPos.x), (int)roundf(pPos.y - 1.62f), (int)floorf(pPos.z)); - auto block = player->region->getBlock(startNode); - - vec3_t flow{}; - block->toLegacy()->liquidGetFlow(&flow, player->region, &startNode); - lastPos = gm->player->eyePos0; } void TestModule::onMove(C_MoveInputHandler* hand){ From 1fe2dda66ea8d16d178cb67e6c6b28ab83986a7d Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 30 Jun 2020 16:28:29 +0200 Subject: [PATCH 062/419] tick to chestscreencontroller_tick --- Horion/Module/Modules/ChestStealer.cpp | 11 +++++------ Horion/Module/Modules/ChestStealer.h | 3 +-- Memory/Hooks.cpp | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index c78e5b9a..9139d522 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -11,25 +11,24 @@ const char* ChestStealer::getModuleName() { return ("ChestStealer"); } -void ChestStealer::onTick(C_GameMode* gm) { - if (g_Data.getLocalPlayer()->canOpenContainerScreen() == 0 && chestScreenController != nullptr) { +void ChestStealer::chestScreenController_tick(C_ChestScreenController* c) { + if (c != nullptr && !g_Data.getLocalPlayer()->canOpenContainerScreen()) { std::vector items = {}; for (int i = 0; i < 54; i++) { - C_ItemStack* stack = chestScreenController->_getItemStack(TextHolder("container_items"), i); + C_ItemStack* stack = c->_getItemStack(TextHolder("container_items"), i); if (stack != nullptr && stack->item != NULL) items.push_back(i); } if (!items.empty()) { for (int i : items) { - chestScreenController->handleAutoPlace(0x7FFFFFFF, "container_items", i); + c->handleAutoPlace(0x7FFFFFFF, "container_items", i); } } else { delay++; if (delay > setDelay) { - chestScreenController->leaveScreen(); + c->leaveScreen(); delay = 0; } } } - chestScreenController = nullptr; } diff --git a/Horion/Module/Modules/ChestStealer.h b/Horion/Module/Modules/ChestStealer.h index 721b62d1..d15adfd6 100644 --- a/Horion/Module/Modules/ChestStealer.h +++ b/Horion/Module/Modules/ChestStealer.h @@ -6,11 +6,10 @@ class ChestStealer : public IModule { int setDelay = 7; public: - C_ChestScreenController* chestScreenController = nullptr; ChestStealer(); ~ChestStealer(); // Inherited via IModule - virtual void onTick(C_GameMode* gm) override; + virtual void chestScreenController_tick(C_ChestScreenController* c); virtual const char* getModuleName() override; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index d703b1ed..2820ce80 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1321,7 +1321,7 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { static auto oFunc = g_Hooks.ChestScreenController_tickHook->GetFastcall<__int64, C_ChestScreenController*>(); static auto chestStealerMod = moduleMgr->getModule(); - chestStealerMod->chestScreenController = a1; + chestStealerMod->chestScreenController_tick(a1); return oFunc(a1); } @@ -1987,6 +1987,7 @@ __int64 Hooks::InGamePlayScreen___renderLevel(__int64 playScreen, __int64 a2, __ } __int64 Hooks::GameMode_attack(C_GameMode* _this, C_Entity* ent) { auto func = g_Hooks.GameMode_attackHook->GetFastcall<__int64, C_GameMode*, C_Entity*>(); + moduleMgr->onAttack(ent); return func(_this, ent); } void Hooks::LocalPlayer__updateFromCamera(__int64 a1, C_Camera* camera) { From 30355baca2dfceee11d0be61f36def1660127cec Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 30 Jun 2020 17:15:22 +0200 Subject: [PATCH 063/419] make scripts render in clickgui --- Horion/Menu/ClickGui.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 73d639e5..82fd5d46 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -1,5 +1,6 @@ #include "ClickGui.h" +#include "../Scripting/ScriptManager.h" #include "../../Utils/Logger.h" #include @@ -119,28 +120,29 @@ void ClickGui::renderCategory(Category category) { // Reset Windows to pre-set positions to avoid confusion if (resetStartPos && ourWindow->pos.x <= 0) { + float yot = g_Data.getGuiData()->windowSize.x; ourWindow->pos.y = 4; switch (category) { case Category::COMBAT: - ourWindow->pos.x = 75; + ourWindow->pos.x = 10.f; break; case Category::VISUAL: - ourWindow->pos.x = 150; + ourWindow->pos.x = yot / 7.f; break; case Category::MOVEMENT: - ourWindow->pos.x = 225; + ourWindow->pos.x = yot / 7.f * 2.f; break; case Category::PLAYER: - ourWindow->pos.x = 315; + ourWindow->pos.x = yot / 7.f * 3.f; break; case Category::WORLD: - ourWindow->pos.x = 415; + ourWindow->pos.x = yot / 7.f * 4.f; break; case Category::MISC: - ourWindow->pos.x = 490; + ourWindow->pos.x = yot / 7.f * 5.f; break; case Category::CUSTOM: - ourWindow->pos.x = 100; + ourWindow->pos.x = yot / 7.f * 6.f; break; } } @@ -633,6 +635,9 @@ void ClickGui::render() { renderCategory(Category::WORLD); renderCategory(Category::MISC); + if (scriptMgr.getNumEnabledScripts() > 0) + renderCategory(Category::CUSTOM); + shouldToggleLeftClick = false; shouldToggleRightClick = false; resetStartPos = false; From a73d42ad20512629ccf1ba001a08f075070dade2 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 30 Jun 2020 17:16:41 +0200 Subject: [PATCH 064/419] fix cheststealer always being enabled --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2820ce80..debf3309 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1321,7 +1321,7 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { static auto oFunc = g_Hooks.ChestScreenController_tickHook->GetFastcall<__int64, C_ChestScreenController*>(); static auto chestStealerMod = moduleMgr->getModule(); - chestStealerMod->chestScreenController_tick(a1); + if(chestStealerMod->isEnabled()) chestStealerMod->chestScreenController_tick(a1); return oFunc(a1); } From 644cc02b5e680ddb93495db6fe13f711bd763967 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 16:43:20 -0400 Subject: [PATCH 065/419] FIX item struct & mob equipment packet --- Horion/Command/Commands/TestCommand.cpp | 6 ++++-- SDK/CItem.h | 14 +++++++------- SDK/CPacket.cpp | 3 +-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index d4ca2a66..441a47f1 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -37,9 +37,11 @@ bool TestCommand::execute(std::vector* args) { auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); + + logF(" item : %d", selectedItem->getItem()->itemId); auto slot = supplies->selectedHotbarSlot; - C_InventoryAction actions[36 * 2]; + /*C_InventoryAction actions[36 * 2]; int numActions = 0; for(int i = slot + 1; i < 9; i++){ auto itemInSlot = supplies->inventory->getItemStack(slot); @@ -76,6 +78,6 @@ bool TestCommand::execute(std::vector* args) { pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); pk.numTransactions = 2; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully given item! %i", GREEN, numActions); + clientMessageF("%sSuccessfully given item! %i", GREEN, numActions);*/ return true; } diff --git a/SDK/CItem.h b/SDK/CItem.h index e5930c5c..c4e18805 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -34,18 +34,18 @@ class C_ItemRenderer { class C_Item { private: - char pad_0x0008[0x68]; //0x8 + char pad_0x0008[0x62]; //0x8 public: - uint16_t itemId; //0x70 + uint16_t itemId; //0x6A private: - char pad_0x00072[0x6]; //0x72 + char pad_0x00072[0x4]; //0x6C public: - TextHolder tileName; //0x78 - TextHolder name; //0x98 + TextHolder tileName; //0x70 + TextHolder name; //0x90 private: - char pad_0x0B8[0x4C]; //0xB8 + char pad_0x0B8[0x4C]; //0xB0 public: - int duration; //0x104 + int duration; //0xFC private: virtual __int64 destructor(); virtual __int64 tearDown(void); diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 672c4530..69d337d2 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -83,8 +83,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket() { C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& item, int hotbarSlot, int inventorySlot) { memset(this, 0x0, sizeof(C_MobEquipmentPacket)); using MobEquimentPacketConstructor_t = void(__fastcall*)(C_MobEquipmentPacket*, __int64, C_ItemStack&, int, int, char); - //static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 08 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 48 48 89 74 24 50 41 8B F9 48 8B F1")); - static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = nullptr; + static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 ? 56 57 41 56 48 83 EC ? 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 41 8B F1 49 8B F8 4C 8B F1")); if (MobEquimentPacketConstructor != 0) MobEquimentPacketConstructor(this, entityRuntimeId, item, hotbarSlot, inventorySlot, 0); From 7d4e146c6c0028ff5af67b8ee72ddc10280f6b10 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 16:44:29 -0400 Subject: [PATCH 066/419] test --- Horion/Command/Commands/TestCommand.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index 441a47f1..cb676286 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -38,10 +38,9 @@ bool TestCommand::execute(std::vector* args) { C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - logF(" item : %d", selectedItem->getItem()->itemId); auto slot = supplies->selectedHotbarSlot; - /*C_InventoryAction actions[36 * 2]; + C_InventoryAction actions[36 * 2]; int numActions = 0; for(int i = slot + 1; i < 9; i++){ auto itemInSlot = supplies->inventory->getItemStack(slot); @@ -78,6 +77,6 @@ bool TestCommand::execute(std::vector* args) { pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); pk.numTransactions = 2; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully given item! %i", GREEN, numActions);*/ + clientMessageF("%sSuccessfully given item! %i", GREEN, numActions); return true; } From b622096d73fa96cc4fb52cc4b09382905d8ef456 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2020 00:03:16 +0200 Subject: [PATCH 067/419] enhanced cheststealer --- Horion/Module/Modules/AutoArmor.cpp | 32 +++++------------------- Horion/Module/Modules/ChestStealer.cpp | 6 ++++- Horion/Module/Modules/ChestStealer.h | 1 + Horion/Module/Modules/InventoryCleaner.h | 3 +-- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/Horion/Module/Modules/AutoArmor.cpp b/Horion/Module/Modules/AutoArmor.cpp index b6e26d1e..843204e7 100644 --- a/Horion/Module/Modules/AutoArmor.cpp +++ b/Horion/Module/Modules/AutoArmor.cpp @@ -39,8 +39,6 @@ void AutoArmor::onTick(C_GameMode* gm) { C_Inventory* inv = supplies->inventory; C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); - C_InventoryAction* first = nullptr; - C_InventoryAction* second = nullptr; static C_ItemStack* emptyItemStack = nullptr; if (emptyItemStack == 0x0) { @@ -75,43 +73,25 @@ void AutoArmor::onTick(C_GameMode* gm) { if (armorItem->item != nullptr && (ArmorStruct(armorItem, reinterpret_cast(*armorItem->item), 0).isEqual(armorList[0])) == false) { int slot = inv->getFirstEmptySlot(); - first = new C_InventoryAction(i, armorItem, nullptr, 632); - second = new C_InventoryAction(slot, nullptr, armorItem); - *g_Data.getLocalPlayer()->getArmor(i) = *emptyItemStack; *inv->getItemStack(slot) = *armorItem; - manager->addInventoryAction(*first); - manager->addInventoryAction(*second); - - delete first; - delete second; - - first = new C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr); - second = new C_InventoryAction(i, nullptr, armorList[0].m_item, 632); + manager->addInventoryAction(C_InventoryAction(i, armorItem, nullptr, 632)); + manager->addInventoryAction(C_InventoryAction(slot, nullptr, armorItem)); *g_Data.getLocalPlayer()->getArmor(i) = *inv->getItemStack(armorList[0].m_slot); *inv->getItemStack(armorList[0].m_slot) = *emptyItemStack; - manager->addInventoryAction(*first); - manager->addInventoryAction(*second); - - delete first; - delete second; + manager->addInventoryAction(C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr)); + manager->addInventoryAction(C_InventoryAction(i, nullptr, armorList[0].m_item, 632)); } if (armorItem->item == nullptr) { - first = new C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr); - second = new C_InventoryAction(i, nullptr, armorList[0].m_item, 632); - *g_Data.getLocalPlayer()->getArmor(i) = *inv->getItemStack(armorList[0].m_slot); *inv->getItemStack(armorList[0].m_slot) = *emptyItemStack; - manager->addInventoryAction(*first); - manager->addInventoryAction(*second); - - delete first; - delete second; + manager->addInventoryAction(C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr)); + manager->addInventoryAction(C_InventoryAction(i, nullptr, armorList[0].m_item, 632)); } } armorList.clear(); diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 9139d522..3810ce4b 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -1,7 +1,9 @@ #include "ChestStealer.h" +#include "../ModuleManager.h" ChestStealer::ChestStealer() : IModule(0x0, Category::PLAYER, "Automatically takes all items out of a chest") { registerIntSetting("Close Delay", &this->setDelay, this->setDelay, 0, 20); + registerBoolSetting("enhanced", &this->enhanced, this->enhanced); } ChestStealer::~ChestStealer() { @@ -14,10 +16,12 @@ const char* ChestStealer::getModuleName() { void ChestStealer::chestScreenController_tick(C_ChestScreenController* c) { if (c != nullptr && !g_Data.getLocalPlayer()->canOpenContainerScreen()) { std::vector items = {}; + auto invcleanerMod = moduleMgr->getModule(); for (int i = 0; i < 54; i++) { C_ItemStack* stack = c->_getItemStack(TextHolder("container_items"), i); if (stack != nullptr && stack->item != NULL) - items.push_back(i); + if (this->enhanced && invcleanerMod->stackIsUseful(stack)) + items.push_back(i); } if (!items.empty()) { for (int i : items) { diff --git a/Horion/Module/Modules/ChestStealer.h b/Horion/Module/Modules/ChestStealer.h index d15adfd6..0793493e 100644 --- a/Horion/Module/Modules/ChestStealer.h +++ b/Horion/Module/Modules/ChestStealer.h @@ -4,6 +4,7 @@ class ChestStealer : public IModule { private: int delay = 0; int setDelay = 7; + bool enhanced = true; public: ChestStealer(); diff --git a/Horion/Module/Modules/InventoryCleaner.h b/Horion/Module/Modules/InventoryCleaner.h index 3c00f4ac..a79362c4 100644 --- a/Horion/Module/Modules/InventoryCleaner.h +++ b/Horion/Module/Modules/InventoryCleaner.h @@ -6,7 +6,6 @@ class InventoryCleaner : public IModule { std::vector findStackableItems(); std::vector findUselessItems(); - bool stackIsUseful(C_ItemStack* itemStack); bool isLastItem(C_Item* item); bool keepTools = true; @@ -18,7 +17,7 @@ class InventoryCleaner : public IModule { bool autoSort = false; public: - C_MoveInputHandler* inputHandler = nullptr; + bool stackIsUseful(C_ItemStack* itemStack); InventoryCleaner(); ~InventoryCleaner(); From bf8691c3111f4d2a9acfc8340fb0ddb88bb99ece Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 19:06:12 -0400 Subject: [PATCH 068/419] fix .nbt load --- SDK/CItem.cpp | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 216cc5fe..ab8cbd17 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -1,21 +1,23 @@ #include "CItem.h" + #include "../Utils/Utils.h" #include "Tag.h" +#include "../Memory/GameData.h" C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C_ClientInstance *client, MinecraftGame *game) { memset(this, 0, sizeof(C_BaseActorRenderContext)); - using BaseActorRenderContext_t = __int64(__fastcall*)(C_BaseActorRenderContext*, C_ScreenContext*, C_ClientInstance*, MinecraftGame*); + using BaseActorRenderContext_t = __int64(__fastcall *)(C_BaseActorRenderContext *, C_ScreenContext *, C_ClientInstance *, MinecraftGame *); static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8D 05 ? ? ? ? 33 F6 48 89 01 49 8B D8 48 89 71 ? 48 8B F9 8B 42")); BaseActorRenderContext_constructor(this, ScreenCtx, client, game); } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { - using renderGuiItemNew_t = void(__fastcall*)(C_ItemRenderer*, C_BaseActorRenderContext*, C_ItemStack*, MinecraftGame*, float, float, float, float, float, bool); + using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 20 0F 29 70 B8 48 8B 05 ?? ?? ?? ??")); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } C_ItemStack::C_ItemStack(const C_ItemStack &src) { memset(this, 0x0, sizeof(C_ItemStack)); - using ItemStackCopyConstructor_t = void(__fastcall*)(C_ItemStack&, C_ItemStack const&); + using ItemStackCopyConstructor_t = void(__fastcall *)(C_ItemStack &, C_ItemStack const &); static ItemStackCopyConstructor_t ItemStackCopyConstructor = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 8B FA 48 8B D9 48 89 48 ??")); ItemStackCopyConstructor(*this, src); this->setVtable(); @@ -29,17 +31,25 @@ C_ItemStack::C_ItemStack(const Tag &tag) { ItemStackBase__loadItem(this, tag);*/ } void C_ItemStack::fromTag(const Tag &tag) { - using ItemStackBase__loadItemF = void(__fastcall*)(C_ItemStack*,Tag const&); - static ItemStackBase__loadItemF fromTag = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); + using ItemStackBase__loadItemF = void(__fastcall *)(C_ItemStack *, Tag const &); + static ItemStackBase__loadItemF fromTag = nullptr; + + if (!fromTag) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) + fromTag = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); + else + fromTag = reinterpret_cast(FindSignature("40 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ?")); + } + fromTag(this, tag); } void C_ItemStack::save(CompoundTag **tag) { - using ItemStackBase__saveF = void(__fastcall*)(C_ItemStack*,CompoundTag**); + using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **); ItemStackBase__saveF save = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B F2 4C 8B F1 48 89 55")); - return save(this,tag); + return save(this, tag); } void C_ItemStack::setUserData(std::unique_ptr tag) { - using setUserData_t = void(__fastcall*)(C_ItemStack*, std::unique_ptr); + using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8D 51 10 48 3B D3 74 20 48 8B 03 48 ?? ?? ?? ?? ?? ?? 48 8B 0A 48 89 02 48 85 C9 74 0B 48 8B 01 BA ?? ?? ?? ?? FF 10")); setUserData(this, std::move(tag)); } @@ -52,23 +62,23 @@ void C_ItemStack::reinit(C_Item &item, int count, int itemData) { Utils::CallVFunc<2, void>(this, &item, count, itemData); } int C_ItemStack::getEnchantValue(int enchantId) { - using getEnchantsLevel_t = int(__fastcall*)(int, C_ItemStack*); + using getEnchantsLevel_t = int(__fastcall *)(int, C_ItemStack *); static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8 ? ? ? ?")); return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { static uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? 48 8D 0D ? ? ? ? 48 89 05 ? ? ? ? C6 05 ? ? ? ? ? 48 83 C4"); - int offset = *reinterpret_cast(sigOffset + 3); - this->vTable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + int offset = *reinterpret_cast(sigOffset + 3); + this->vTable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); } -C_Item*** ItemRegistry::getItemFromId(void* ptr, int itemId) { +C_Item ***ItemRegistry::getItemFromId(void *ptr, int itemId) { using getItemFromId_t = C_Item ***(__fastcall *)(void *, int); static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 66 85 D2 0F 84 ? ? ? ? 44 0F BF C2 48 B9 ? ? ? ? ? ? ? ? 44")); return getItemFromId(ptr, itemId); } -C_Item ***ItemRegistry::lookUpByName(void * a1 , void *a2, TextHolder& text) { - using ItemRegistry__lookupByName_t = C_Item ***(__fastcall *)(void *, void *, TextHolder&); +C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder &text) { + using ItemRegistry__lookupByName_t = C_Item ***(__fastcall *)(void *, void *, TextHolder &); static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 4C 8B F9 48 89 4D ?? 45 33 ED 44 89 6C 24 ?? 4D 39 68")); return ItemRegistry__lookupByNameF(a1, a2, text); } From d90dc556d279fbb35f209a6c21493b053b6517d3 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Tue, 30 Jun 2020 19:08:40 -0400 Subject: [PATCH 069/419] fix auto armor --- SDK/CItem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CItem.h b/SDK/CItem.h index c4e18805..11736e3d 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -324,7 +324,7 @@ class C_ItemStack { class C_ArmorItem : public C_Item { private: - char pad_0x108[0xB0]; //0x108 + char pad_0x108[0xB8]; //0x100 public: int ArmorSlot; //0x1B8 From ad4906bafd0e045bbdb6cfeeb4473ce25396c86e Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2020 02:21:27 +0200 Subject: [PATCH 070/419] for some reason it doesnt work without these pointers --- Horion/Module/Modules/AutoArmor.cpp | 32 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/Horion/Module/Modules/AutoArmor.cpp b/Horion/Module/Modules/AutoArmor.cpp index 843204e7..d2c2ef2f 100644 --- a/Horion/Module/Modules/AutoArmor.cpp +++ b/Horion/Module/Modules/AutoArmor.cpp @@ -39,6 +39,8 @@ void AutoArmor::onTick(C_GameMode* gm) { C_Inventory* inv = supplies->inventory; C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); + C_InventoryAction* first = nullptr; + C_InventoryAction* second = nullptr; static C_ItemStack* emptyItemStack = nullptr; if (emptyItemStack == 0x0) { @@ -73,25 +75,43 @@ void AutoArmor::onTick(C_GameMode* gm) { if (armorItem->item != nullptr && (ArmorStruct(armorItem, reinterpret_cast(*armorItem->item), 0).isEqual(armorList[0])) == false) { int slot = inv->getFirstEmptySlot(); + first = new C_InventoryAction(i, armorItem, nullptr, 632); + second = new C_InventoryAction(slot, nullptr, armorItem); + *g_Data.getLocalPlayer()->getArmor(i) = *emptyItemStack; *inv->getItemStack(slot) = *armorItem; - manager->addInventoryAction(C_InventoryAction(i, armorItem, nullptr, 632)); - manager->addInventoryAction(C_InventoryAction(slot, nullptr, armorItem)); + manager->addInventoryAction(*first); + manager->addInventoryAction(*second); + + delete first; + delete second; + + first = new C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr); + second = new C_InventoryAction(i, nullptr, armorList[0].m_item, 632); *g_Data.getLocalPlayer()->getArmor(i) = *inv->getItemStack(armorList[0].m_slot); *inv->getItemStack(armorList[0].m_slot) = *emptyItemStack; - manager->addInventoryAction(C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr)); - manager->addInventoryAction(C_InventoryAction(i, nullptr, armorList[0].m_item, 632)); + manager->addInventoryAction(*first); + manager->addInventoryAction(*second); + + delete first; + delete second; } if (armorItem->item == nullptr) { *g_Data.getLocalPlayer()->getArmor(i) = *inv->getItemStack(armorList[0].m_slot); + first = new C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr); + second = new C_InventoryAction(i, nullptr, armorList[0].m_item, 632); + *inv->getItemStack(armorList[0].m_slot) = *emptyItemStack; - manager->addInventoryAction(C_InventoryAction(armorList[0].m_slot, armorList[0].m_item, nullptr)); - manager->addInventoryAction(C_InventoryAction(i, nullptr, armorList[0].m_item, 632)); + manager->addInventoryAction(*first); + manager->addInventoryAction(*second); + + delete first; + delete second; } } armorList.clear(); From c1fd6164c41eb4af98d9ae4f457134751ff11d48 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2020 11:41:59 +0200 Subject: [PATCH 071/419] hud sale option --- Horion/Menu/TabGui.cpp | 10 ++++++---- Horion/Module/Modules/HudModule.cpp | 31 ++++++++++++++++------------- Horion/Module/Modules/HudModule.h | 2 ++ Horion/Module/Modules/Killaura.cpp | 2 +- Memory/Hooks.cpp | 15 +++++++------- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Horion/Menu/TabGui.cpp b/Horion/Menu/TabGui.cpp index dbd825b7..a9cb6e3a 100644 --- a/Horion/Menu/TabGui.cpp +++ b/Horion/Menu/TabGui.cpp @@ -58,13 +58,15 @@ void TabGui::renderLabel(const char* text, std::shared_ptr mod) { } void TabGui::renderLevel() { + auto hudModule = moduleMgr->getModule(); + // Parameters - static constexpr float textSize = 1.f; - static const float textHeight = 10.f * textSize; - static constexpr float alphaVal = 1.0f; + float textSize = hudModule->scale; + float textHeight = 10.f * textSize; + float alphaVal = 1.0f; // First loop: Get the maximum text length - float maxLength = 43.f; + float maxLength = 0.f; int labelListLength = 0; for (auto it = labelList.begin(); it != labelList.end(); ++it) { labelListLength++; diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 63c2740f..18d8d2dd 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -14,6 +14,7 @@ HudModule::HudModule() : IModule(0x0, Category::VISUAL, "Displays ArrayList/TabG registerBoolSetting("Show FPS", &this->fps, this->fps); registerBoolSetting("Show CPS", &this->cps, this->cps); registerBoolSetting("Always show", &this->alwaysShow, this->alwaysShow); + registerFloatSetting("Scale", &this->scale, this->scale, 0.5f, 1.5f); } HudModule::~HudModule() { @@ -26,29 +27,31 @@ const char* HudModule::getModuleName() { void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t windowSize = g_Data.getClientInstance()->getGuiData()->windowSize; - float startY = tabgui ? 60.f : 0.f; + float f = 10.f * this->scale; + float len = DrawUtils::getTextWidth(&std::string("Movement"), scale) + 7.f; + float startY = tabgui ? 6 * f : 0.f; if(tabgui && scriptMgr.getNumEnabledScripts() > 0) - startY += 10; + startY += f; { // FPS if (!(g_Data.getLocalPlayer() == nullptr || !this->fps)) { std::string fpsText = "FPS: " + std::to_string(g_Data.getFPS()); - vec4_t rectPos = vec4_t(2.5f, startY + 5.f, 50.5f, startY + 15.f); + vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 15.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); - DrawUtils::drawText(textPos, &fpsText, MC_Color(200, 200, 200), 1.f); + DrawUtils::drawText(textPos, &fpsText, MC_Color(200, 200, 200), scale); - startY += 10; + startY += f; } } { // CPS if (!(g_Data.getLocalPlayer() == nullptr || !this->cps)) { std::string cpsText = "CPS: " + std::to_string(g_Data.getLeftCPS()) + " - " + std::to_string(g_Data.getRightCPS()); - vec4_t rectPos = vec4_t(2.5f, startY + 5.f, 50.5f, startY + 15.f); + vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 15.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); - DrawUtils::drawText(textPos, &cpsText, MC_Color(200, 200, 200), 1.f); + DrawUtils::drawText(textPos, &cpsText, MC_Color(200, 200, 200), scale); - startY += 10; + startY += f; } } { // Coordinates @@ -58,14 +61,14 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { std::string coordsX = "X: " + std::to_string((int)floorf(pos->x)); std::string coordsY = "Y: " + std::to_string((int)floorf(pos->y)); std::string coordsZ = "Z: " + std::to_string((int)floorf(pos->z)); - vec4_t rectPos = vec4_t(2.5f, startY + 5.f, 50.5f, startY + 35.f); + vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 35.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); - DrawUtils::drawText(textPos, &coordsX, MC_Color(200, 200, 200), 1.f); - textPos.y += 10.f; - DrawUtils::drawText(textPos, &coordsY, MC_Color(200, 200, 200), 1.f); - textPos.y += 10.f; - DrawUtils::drawText(textPos, &coordsZ, MC_Color(200, 200, 200), 1.f); + DrawUtils::drawText(textPos, &coordsX, MC_Color(200, 200, 200), scale); + textPos.y += 10.f * f; + DrawUtils::drawText(textPos, &coordsY, MC_Color(200, 200, 200), scale); + textPos.y += 10.f * f; + DrawUtils::drawText(textPos, &coordsZ, MC_Color(200, 200, 200), scale); } } { // ArmorHUD diff --git a/Horion/Module/Modules/HudModule.h b/Horion/Module/Modules/HudModule.h index 20b09b68..e3016989 100644 --- a/Horion/Module/Modules/HudModule.h +++ b/Horion/Module/Modules/HudModule.h @@ -18,6 +18,8 @@ class HudModule : public IModule { bool cps = true; bool alwaysShow = false; + float scale = 1.f; + // Inherited via IModule virtual const char* getModuleName() override; virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index 07a37a6a..5369b845 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -37,7 +37,7 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { if(!currentEntity->isAlive()) return; - if (currentEntity->damageTime > 0 && killauraMod->hurttime) + if (currentEntity->damageTime > 1 && killauraMod->hurttime) return; if (killauraMod->isMobAura) { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index debf3309..1a6b56a1 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -666,6 +666,13 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { // Draw ArrayList if (moduleMgr->isInitialized() && shouldRenderArrayList) { + + // Parameters + float textSize = hudModule->scale; + float textPadding = 1.0f * textSize; + float textHeight = 10.0f * textSize; + float smoothness = 2; + struct IModuleContainer { // Struct used to Sort IModules in a std::set std::shared_ptr backingModule; @@ -693,7 +700,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { if (!this->enabled && *this->pos == vec2_t(0.f, 0.f)) this->shouldRender = false; - this->textWidth = DrawUtils::getTextWidth(&moduleName); + this->textWidth = DrawUtils::getTextWidth(&moduleName, hudModule->scale); } bool operator<(const IModuleContainer& other) const { @@ -709,12 +716,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { } }; - // Parameters - static constexpr float textPadding = 1.0f; - static constexpr float textSize = 1.0f; - static constexpr float textHeight = textSize * 10.0f; - static constexpr float smoothness = 2; - // Mouse click detector static bool wasLeftMouseDown = GameData::isLeftClickDown(); // Last isDown value bool leftMouseDown = GameData::isLeftClickDown(); // current isDown value From 1ea10132de4cbe704abf664c126f197f41366e74 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2020 12:03:06 +0200 Subject: [PATCH 072/419] refactor this check --- Horion/Module/Modules/Killaura.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index 5369b845..8434ccfe 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -37,9 +37,6 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { if(!currentEntity->isAlive()) return; - if (currentEntity->damageTime > 1 && killauraMod->hurttime) - return; - if (killauraMod->isMobAura) { if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 63) return; @@ -86,18 +83,22 @@ void Killaura::onTick(C_GameMode* gm) { Odelay++; if (!targetList.empty() && Odelay >= delay) { - if (autoweapon) findWeapon(); - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swing(); + if (autoweapon) findWeapon(); // Attack all entitys in targetList if (isMulti) { - for (auto & i : targetList) { - g_Data.getCGameMode()->attack(i); + for (auto& i : targetList) { + if (!(i->damageTime > 1 && hurttime)) { + g_Data.getLocalPlayer()->swing(); + g_Data.getCGameMode()->attack(i); + } } } else { - g_Data.getCGameMode()->attack(targetList[0]); + if (!(targetList[0]->damageTime > 1 && hurttime)) { + g_Data.getLocalPlayer()->swing(); + g_Data.getCGameMode()->attack(targetList[0]); + } } Odelay = 0; } From 5c4f68c089a2c21d1eef02752dd589187deaeb55 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2020 12:44:32 +0200 Subject: [PATCH 073/419] fix coordinates text offset --- Horion/Module/Modules/HudModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 18d8d2dd..0a49156b 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -65,9 +65,9 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); DrawUtils::drawText(textPos, &coordsX, MC_Color(200, 200, 200), scale); - textPos.y += 10.f * f; + textPos.y += f; DrawUtils::drawText(textPos, &coordsY, MC_Color(200, 200, 200), scale); - textPos.y += 10.f * f; + textPos.y += f; DrawUtils::drawText(textPos, &coordsZ, MC_Color(200, 200, 200), scale); } } From 33dad0f672dfa4b52623a0ea1c455a63239ab87f Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 3 Jul 2020 13:33:53 +0200 Subject: [PATCH 074/419] fix spammer and add back silent scaffold --- Horion/Module/Modules/Killaura.cpp | 3 +++ Horion/Module/Modules/Scaffold.cpp | 15 +++++++++++++-- Horion/Module/Modules/Scaffold.h | 1 + Horion/Module/Modules/Spammer.cpp | 6 +++--- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index 8434ccfe..e7ccd3c3 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -86,6 +86,9 @@ void Killaura::onTick(C_GameMode* gm) { if (autoweapon) findWeapon(); + C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); // make sure to update rotation + // Attack all entitys in targetList if (isMulti) { for (auto& i : targetList) { diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index b76e14bb..44eec4af 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -3,7 +3,7 @@ #include "../../../Utils/Logger.h" Scaffold::Scaffold() : IModule(VK_NUMPAD1, Category::WORLD, "Automatically build blocks beneath you") { - //registerBoolSetting("Spoof", &this->spoof, this->spoof); + registerBoolSetting("Spoof", &this->spoof, this->spoof); } Scaffold::~Scaffold() { @@ -64,12 +64,14 @@ bool Scaffold::findBlock() { C_ItemStack* stack = inv->getItemStack(n); if (stack->item != nullptr) { if ((*stack->item)->isBlock() && (*stack->item)->itemId != 0) { - auto a = C_MobEquipmentPacket(id, *stack, n, n); + C_MobEquipmentPacket a(id, *stack, n, n); g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); return true; } } } + C_MobEquipmentPacket a(id, *g_Data.getLocalPlayer()->getSelectedItem(), supplies->selectedHotbarSlot, supplies->selectedHotbarSlot); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); return false; } @@ -106,3 +108,12 @@ void Scaffold::onTick(C_GameMode* gm) { } } } + +void Scaffold::onDisable() { + if (g_Data.getLocalPlayer() == nullptr) + return; + __int64 id = *g_Data.getLocalPlayer()->getUniqueId(); + C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); + C_MobEquipmentPacket a(id, *g_Data.getLocalPlayer()->getSelectedItem(), supplies->selectedHotbarSlot, supplies->selectedHotbarSlot); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); +} diff --git a/Horion/Module/Modules/Scaffold.h b/Horion/Module/Modules/Scaffold.h index 9795b746..1b18c1e5 100644 --- a/Horion/Module/Modules/Scaffold.h +++ b/Horion/Module/Modules/Scaffold.h @@ -13,4 +13,5 @@ class Scaffold : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; }; diff --git a/Horion/Module/Modules/Spammer.cpp b/Horion/Module/Modules/Spammer.cpp index 9aca69cc..58518007 100644 --- a/Horion/Module/Modules/Spammer.cpp +++ b/Horion/Module/Modules/Spammer.cpp @@ -16,10 +16,10 @@ const char* Spammer::getModuleName() { void Spammer::onTick(C_GameMode* gm) { Odelay++; if (Odelay > delay * 20) { - C_TextPacket textPacket = C_TextPacket(); + C_TextPacket textPacket; textPacket.message.setText(bypass ? (message + " | " + Utils::randomString(8)) : message); - textPacket.sourceName = *g_Data.getLocalPlayer()->getNameTag(); - textPacket.xboxUserId = TextHolder(std::to_string(g_Data.getLocalPlayer()->getUserId())); + textPacket.sourceName.setText(g_Data.getLocalPlayer()->getNameTag()->getText()); + textPacket.xboxUserId = std::to_string(g_Data.getLocalPlayer()->getUserId()); g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&textPacket); Odelay = 0; } From 10aa5d0d5bbde1aec675b5fa6b5cfe421a68d30d Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 4 Jul 2020 13:06:08 +0200 Subject: [PATCH 075/419] minor improvements --- Horion/Module/Modules/InventoryCleaner.cpp | 2 +- Horion/Module/Modules/Killaura.cpp | 6 ++++-- Horion/Module/Modules/Teleport.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/InventoryCleaner.cpp b/Horion/Module/Modules/InventoryCleaner.cpp index f7f8bd40..b4609bfc 100644 --- a/Horion/Module/Modules/InventoryCleaner.cpp +++ b/Horion/Module/Modules/InventoryCleaner.cpp @@ -36,7 +36,7 @@ void InventoryCleaner::onTick(C_GameMode* gm) { C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); C_Inventory* inv = supplies->inventory; float damage = 0; - int item = supplies->selectedHotbarSlot; + int item = 0; for (int n = 0; n < 36; n++) { C_ItemStack* stack = inv->getItemStack(n); if (stack->item != NULL) { diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index e7ccd3c3..f3e459a7 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -86,8 +86,10 @@ void Killaura::onTick(C_GameMode* gm) { if (autoweapon) findWeapon(); - C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); // make sure to update rotation + if (g_Data.getLocalPlayer()->velocity.squaredxzlen() < 0.01) { + C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); // make sure to update rotation if player is standing still + } // Attack all entitys in targetList if (isMulti) { diff --git a/Horion/Module/Modules/Teleport.cpp b/Horion/Module/Modules/Teleport.cpp index 307407a5..1fb60ac4 100644 --- a/Horion/Module/Modules/Teleport.cpp +++ b/Horion/Module/Modules/Teleport.cpp @@ -39,6 +39,14 @@ void Teleport::onTick(C_GameMode* gm) { if (shouldTP && gm->player->isSneaking()) { tpPos.y += (gm->player->getPos()->y - gm->player->getAABB()->lower.y) + 1; // eye height + 1 if (bypass) { + /*int dist = (int)gm->player->getPos()->dist(tpPos); + int i = (int)dist / 5; + for (int n = 0; n < i; n++) { + vec3_t offs = tpPos.sub(*gm->player->getPos()).div(i).mul(n); + C_MovePlayerPacket p = C_MovePlayerPacket(g_Data.getLocalPlayer(), gm->player->getPos()->add(offs)); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); + } + gm->player->setPos(tpPos);*/ float dist = gm->player->getPos()->dist(tpPos); g_Data.getLocalPlayer()->lerpTo(tpPos, vec2_t(1, 1), (int)fmax((int)dist * 0.1, 1)); } From cc88d2a34e13ac6b35be581b3c5529292e012683 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 4 Jul 2020 15:09:44 +0200 Subject: [PATCH 076/419] Fix cmake build --- CMakeLists.txt | 4 ++-- Horion/Command/Commands/GiveCommand.cpp | 3 ++- Horion/Command/Commands/TestCommand.cpp | 4 +--- Horion/Command/Commands/setoffhandCommand.cpp | 3 ++- Horion/Module/Modules/Fly.cpp | 1 + Horion/Module/Modules/HudModule.cpp | 3 ++- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cee70c38..29391f06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,8 +156,6 @@ add_library(Horion SHARED Horion/Module/Modules/FastLadder.h Horion/Module/Modules/Fly.cpp Horion/Module/Modules/Fly.h - Horion/Module/Modules/ForceOpenCommandBlock.cpp - Horion/Module/Modules/ForceOpenCommandBlock.h Horion/Module/Modules/Freecam.cpp Horion/Module/Modules/Freecam.h Horion/Module/Modules/Fucker.cpp @@ -208,6 +206,8 @@ add_library(Horion SHARED Horion/Module/Modules/NoFriends.h Horion/Module/Modules/NoPacket.cpp Horion/Module/Modules/NoPacket.h + Horion/Module/Modules/NoPaintingCrash.cpp + Horion/Module/Modules/NoPaintingCrash.h Horion/Module/Modules/NoSlowDown.cpp Horion/Module/Modules/NoSlowDown.h Horion/Module/Modules/NoSwing.cpp diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index 1d6cfb22..34a7e1ad 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -29,7 +29,8 @@ bool GiveCommand::execute(std::vector* args) { if (itemId == 0) { void* ItemPtr = malloc(0x8); void* idk = malloc(0x0); - C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, TextHolder(args->at(1))); + TextHolder tempText(args->at(1)); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, tempText); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index cb676286..cdd4e696 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -53,8 +53,6 @@ bool TestCommand::execute(std::vector* args) { } } - //transactionManager->addInventoryAction(firstAction); - C_InventoryTransactionPacket pk; pk.complexTransaction = new C_ComplexInventoryTransaction(); pk.complexTransaction->actionType = 0; @@ -75,7 +73,7 @@ bool TestCommand::execute(std::vector* args) { coolBean.next = reinterpret_cast<__int64>(&ptrBean); pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); - pk.numTransactions = 2; + pk.numTransactions = 1; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); clientMessageF("%sSuccessfully given item! %i", GREEN, numActions); return true; diff --git a/Horion/Command/Commands/setoffhandCommand.cpp b/Horion/Command/Commands/setoffhandCommand.cpp index f6f0bce3..a5eba5e6 100644 --- a/Horion/Command/Commands/setoffhandCommand.cpp +++ b/Horion/Command/Commands/setoffhandCommand.cpp @@ -31,7 +31,8 @@ bool setoffhandCommand::execute(std::vector* args) { if (itemId == 0) { void* ItemPtr = malloc(0x8); void* idk = malloc(0x0); - C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, TextHolder(args->at(1))); + TextHolder tempText(args->at(1)); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, tempText); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; diff --git a/Horion/Module/Modules/Fly.cpp b/Horion/Module/Modules/Fly.cpp index 2727c259..07b745bb 100644 --- a/Horion/Module/Modules/Fly.cpp +++ b/Horion/Module/Modules/Fly.cpp @@ -12,6 +12,7 @@ const char* Fly::getModuleName() { void Fly::onTick(C_GameMode* gm) { gm->player->canFly = true; + } void Fly::onDisable() { diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 0a49156b..cc80c1a8 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -28,7 +28,8 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t windowSize = g_Data.getClientInstance()->getGuiData()->windowSize; float f = 10.f * this->scale; - float len = DrawUtils::getTextWidth(&std::string("Movement"), scale) + 7.f; + std::string tempStr("Movement"); + float len = DrawUtils::getTextWidth(&tempStr, scale) + 7.f; float startY = tabgui ? 6 * f : 0.f; if(tabgui && scriptMgr.getNumEnabledScripts() > 0) startY += f; From a20cd89ac165123b755ef8a077d62c61041d53de Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 4 Jul 2020 17:20:37 +0200 Subject: [PATCH 077/419] Fix joe --- Horion/path/JoePathFinder.cpp | 7 ++++++- Memory/Hooks.cpp | 6 +++--- SDK/CBlockLegacy.cpp | 9 ++++++++- SDK/CItem.cpp | 2 +- Utils/Utils.cpp | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 1e7bda99..704d5789 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -7,6 +7,7 @@ #include #include #include +#include "../../Memory/GameData.h" JoePathFinder::JoePathFinder(vec3_ti start, C_BlockSource* reg, std::shared_ptr goal) : startPos(start), region(reg), goal(goal) { } @@ -85,7 +86,11 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo } static uintptr_t** witherRoseVtable = nullptr; if (witherRoseVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 48 B9"); + uintptr_t sigOffset = 0; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 48 B9"); + else + sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9"); int offset = *reinterpret_cast(sigOffset + 3); witherRoseVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1a6b56a1..e5acef55 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -189,7 +189,7 @@ void Hooks::Init() { void* setupRender = reinterpret_cast(FindSignature("40 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8B F9 33 D2 ?? ?? ?? ?? ?? ?? 48 8D 4C 24 30 E8 ?? ?? ?? ?? 4C 8B CF 4C 8B C3 48 8B 57 ?? 48 8D 4C 24")); g_Hooks.UIScene_setupAndRenderHook = std::make_unique(setupRender, Hooks::UIScene_setupAndRender); - void* render = reinterpret_cast(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 48 8B DA 48 8B F9 B9 ? ? ? ? 65 48 8B 04 25 ? ? ? ? 48 8B 10 8B 04 11 39 05 ? ? ? ?")); + void* render = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B DA 48 8B F9 B9 ?? ?? ?? ?? 65 48 8B 04 25 ?? ?? ?? ?? 48 8B 10 8B 04 11 39 05")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); @@ -240,7 +240,7 @@ void Hooks::Init() { if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) fullbright = reinterpret_cast(FindSignature("4C 8B DC 57 48 83 EC ?? 49 C7 43 ?? FE FF FF FF 49 89 5B ?? 49 89 73 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 49 89 43 ?? 49 89 43 ?? 48 8B 01 49")); else - fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ? 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 33 C0 48 89 44 24 ? 48 89 44 24 ? 48 8B 01 48 8D 54 24 ? FF 90 ? ? ? ?")); + fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); @@ -253,7 +253,7 @@ void Hooks::Init() { onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); - void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F1 48 C7 85 ? ? ? ? ? ? ? ? 48 8D 95 ? ? ? ? 48 8B 89 ? ? ? ?")); + void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F1 48 C7 85 ?? ?? ?? ?? ?? ?? ?? ?? 48 8D 95 ?? ?? ?? ?? 48 8B 89")); g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D9 4D 8B F8")); diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 60f79cdd..67c4f0ed 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -1,5 +1,6 @@ #include "CBlockLegacy.h" +#include "../Memory/GameData.h" #include "../Utils/Utils.h" C_Block* C_BlockSource::getBlock(const vec3_ti& block) { using getBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); @@ -21,6 +22,12 @@ int C_BlockLegacy::liquidGetDepth(C_BlockSource* reg, const vec3_ti* pos) { } void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec3_ti* pos) { using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*); - static liquid_getFlow_t liquid_getDepth = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 4C 24 ?")); + static liquid_getFlow_t liquid_getDepth = nullptr; + if(liquid_getDepth == nullptr){ + if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) + liquid_getDepth = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 4C 24")); + else + liquid_getDepth = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C")); + } liquid_getDepth(this, flowOut, reg, pos); } diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index ab8cbd17..e1d06ce8 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -63,7 +63,7 @@ void C_ItemStack::reinit(C_Item &item, int count, int itemData) { } int C_ItemStack::getEnchantValue(int enchantId) { using getEnchantsLevel_t = int(__fastcall *)(int, C_ItemStack *); - static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8 ? ? ? ?")); + static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8")); return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { diff --git a/Utils/Utils.cpp b/Utils/Utils.cpp index ffc17164..4f10bb6a 100644 --- a/Utils/Utils.cpp +++ b/Utils/Utils.cpp @@ -167,7 +167,7 @@ uintptr_t Utils::FindSignatureModule(const char* szModule, const char* szSignatu if (!firstMatch) firstMatch = pCur; - if (!pattern[2]) + if (!pattern[2] || !pattern[1]) return firstMatch; //if (*(PWORD)pattern == '\?\?' || *(PBYTE)pattern != '\?') From b07b52e16e67bd48784cdcc2379a213f13b89c47 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 6 Jul 2020 21:51:31 +0200 Subject: [PATCH 078/419] fix this --- Horion/Module/Modules/ChestStealer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 3810ce4b..1adeb8da 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -20,7 +20,7 @@ void ChestStealer::chestScreenController_tick(C_ChestScreenController* c) { for (int i = 0; i < 54; i++) { C_ItemStack* stack = c->_getItemStack(TextHolder("container_items"), i); if (stack != nullptr && stack->item != NULL) - if (this->enhanced && invcleanerMod->stackIsUseful(stack)) + if (!this->enhanced || invcleanerMod->stackIsUseful(stack)) items.push_back(i); } if (!items.empty()) { From 748b1203cd77d2d2f3cb686c4a38ec53bb06e087 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 7 Jul 2020 16:42:13 +0200 Subject: [PATCH 079/419] Joe sprints, fix seagrass and kelp --- CMakeLists.txt | 2 +- Horion/path/JoeIncompletePath.cpp | 1 - Horion/path/JoeIncompletePath.h | 4 ---- Horion/path/JoeMovementController.cpp | 8 ++++++-- Horion/path/JoePath.cpp | 29 ++++++++++++++++++++++++++- Horion/path/JoePath.h | 3 +++ Horion/path/JoePathFinder.cpp | 22 ++++++++++++-------- Horion/path/JoeSegment.cpp | 8 +++++++- Horion/path/JoeSegment.h | 5 ++++- SDK/CBlockLegacy.cpp | 13 ++++++++++++ SDK/CBlockLegacy.h | 3 +++ 11 files changed, 79 insertions(+), 19 deletions(-) delete mode 100644 Horion/path/JoeIncompletePath.cpp delete mode 100644 Horion/path/JoeIncompletePath.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 29391f06..0420dae3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,4 +361,4 @@ add_library(Horion SHARED Utils/Utils.cpp Utils/Utils.h Utils/xorstr.h - resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeIncompletePath.cpp Horion/path/JoeIncompletePath.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h) + resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h) diff --git a/Horion/path/JoeIncompletePath.cpp b/Horion/path/JoeIncompletePath.cpp deleted file mode 100644 index fdab1634..00000000 --- a/Horion/path/JoeIncompletePath.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "JoeIncompletePath.h" diff --git a/Horion/path/JoeIncompletePath.h b/Horion/path/JoeIncompletePath.h deleted file mode 100644 index d62180f7..00000000 --- a/Horion/path/JoeIncompletePath.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -class JoeIncompletePath { -}; diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 5efa19ae..4b933680 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -12,6 +12,10 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move return; } + if(!this->currentPath->isInitialized1()){ + this->currentPath->initPathSegments(); + } + auto pPos = player->eyePos0; pPos.y -= 1.62f; vec3_ti playerNode((int)floorf(pPos.x), (int)roundf(pPos.y), (int)floorf(pPos.z)); @@ -34,7 +38,6 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move float dComp = 4; vec3_t addedDiff{0, 0, 0}; - // we should probably make seperate classes for each segment type at some point, but im just doing it here for now for faster prototyping switch(curSeg.getSegmentType()){ case JUMP: { @@ -159,6 +162,8 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move } break; WALK:; case WALK: { + player->setSprinting(curSeg.isAllowingSprint()); + auto pPosD = pPos; // p if(!player->onGround && dComp < 8){ @@ -172,7 +177,6 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move walkTarget = start; } - vec3_t diff3d = walkTarget.sub(pPosD); vec2_t diff2d = {diff3d.x, diff3d.z}; float diffMag = diff2d.magnitude(); diff --git a/Horion/path/JoePath.cpp b/Horion/path/JoePath.cpp index 2fa0032c..a4569298 100644 --- a/Horion/path/JoePath.cpp +++ b/Horion/path/JoePath.cpp @@ -1,6 +1,9 @@ #include "JoePath.h" #include "../DrawUtils.h" -JoePath::JoePath(const std::vector& segments, bool isIncomplete) : segments(segments), isIncomplete(isIncomplete) {} +#include "../../Utils/Logger.h" +JoePath::JoePath(const std::vector& segments, bool isIncomplete) : segments(segments), isIncomplete(isIncomplete) { + +} JoePath::JoePath() : segments() { } void JoePath::draw(int highlight) const { @@ -26,3 +29,27 @@ void JoePath::cutoff(float percentageKeep) { int numKeep = (int)ceilf(this->getNumSegments() * percentageKeep); this->segments.erase(this->segments.begin() + numKeep, this->segments.end()); } +void JoePath::initPathSegments() { + // Check whether we can sprint or not + if(segments.size() > 1){ + for(int i = 0; i < segments.size() - 2; i++){ + auto& curSeg = segments.at(i); + auto& nextSeg = segments.at(i + 1); + if(curSeg.getSegmentType() != JoeSegmentType::WALK || nextSeg.getSegmentType() != JoeSegmentType::WALK){ + curSeg.setAllowSprint(false); + continue; + } + + auto currentTangent = curSeg.getEnd().sub(curSeg.getStart()).toFloatVector().normalize(); + auto nextTangent = nextSeg.getEnd().sub(nextSeg.getStart()).toFloatVector().normalize(); + if(currentTangent.dot(nextTangent) > 0.3f){ // make sure we're running in a similar direction + curSeg.setAllowSprint(true); + } + } + } + + this->isInitialized = true; +} +bool JoePath::isInitialized1() const { + return isInitialized; +} diff --git a/Horion/path/JoePath.h b/Horion/path/JoePath.h index 60f83428..de7d5d86 100644 --- a/Horion/path/JoePath.h +++ b/Horion/path/JoePath.h @@ -7,6 +7,7 @@ class JoePath { private: std::vector segments; bool isIncomplete; + bool isInitialized = 0; public: JoePath(const std::vector& segments, bool isIncomplete); JoePath(); @@ -23,6 +24,8 @@ class JoePath { return this->segments[seg]; } + bool isInitialized1() const; + void initPathSegments(); bool isIncomplete1() const; void draw(int) const; }; diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 704d5789..22a0c2a6 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -66,7 +66,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo auto obs1 = reg->getBlock(pos)->toLegacy(); if(obs1->material->isSuperHot) return true; - if(obs1->material->isLiquid && !allowWater) + if((obs1->material->isLiquid || obs1->hasWater(reg, pos)) && !allowWater) return true; // contact damage based @@ -122,11 +122,12 @@ __forceinline bool isDangerousPlayer(vec3_ti pos, C_BlockSource* reg, bool allow __forceinline bool canStandOn(const vec3_ti& pos, C_BlockSource* reg, bool inWater = false){ auto block = reg->getBlock(pos); auto standOn = block->toLegacy(); - bool validWater = inWater && standOn->material->isLiquid && !standOn->material->isSuperHot; + bool validWater = inWater && standOn->hasWater(reg, pos); if(validWater){ // block above has to be water as well - auto swimIn = reg->getBlock(pos.add(0, 1, 0))->toLegacy(); - validWater = swimIn->material->isLiquid && !swimIn->material->isSuperHot; + auto swimPos = pos.add(0, 1, 0); + auto swimIn = reg->getBlock(swimPos)->toLegacy(); + validWater = swimIn->hasWater(reg, swimPos); } if(!standOn->material->isSolid && !validWater) return false; @@ -185,7 +186,8 @@ __forceinline bool isObstructedPlayer(vec3_ti pos, C_BlockSource* reg, bool allo std::vector findEdges(std::unordered_map& allNodes, Node startNode, C_BlockSource* reg, NodeRef startNodeRef){ std::vector edges; auto startBlock = reg->getBlock(startNode.pos)->toLegacy(); - bool isInWater = startBlock->material->isLiquid && !startBlock->material->isSuperHot; + bool isInWater = startBlock->hasWater(reg, startNode.pos); + float maxWalkSpeed = isInWater ? WATER_SPEED : SPRINT_SPEED; static const float SQRT2 = sqrtf(2); @@ -262,7 +264,7 @@ std::vector findEdges(std::unordered_map& allNodes break; auto block = reg->getBlock(dropPos)->toLegacy(); - auto isWaterBlock = block->material->isLiquid && !block->material->isSuperHot; + auto isWaterBlock = block->hasWater(reg, dropPos); if(isWaterBlock) numWaterBlocks++; else{ @@ -276,8 +278,9 @@ std::vector findEdges(std::unordered_map& allNodes // find out how deep the water is int waterDepth = 1; while(waterDepth < 19){ // make sure we don't drop too deep - auto blockTest = reg->getBlock(dropPos.add(0, waterDepth, 0))->toLegacy(); - if(!blockTest->material->isLiquid || blockTest->material->isSuperHot) + auto testPos = dropPos.add(0, waterDepth, 0); + auto blockTest = reg->getBlock(testPos)->toLegacy(); + if(!blockTest->hasWater(reg, testPos)) break; waterDepth++; @@ -435,13 +438,16 @@ JoePath JoePathFinder::findPath() { if(this->goal->isInGoal(cur.pos) || numNodes % 1200 == 0){ std::vector segments; auto node = cur; + while(node.pos != startPos){ auto prev = node.cameFrom; auto prevNode = allNodes.at(prev.nodeBefore.hash); + segments.emplace_back(prev.edgeType, prevNode.pos, node.pos, node.gScore - prevNode.gScore); node = prevNode; } std::reverse(segments.begin(), segments.end()); + if(this->goal->isInGoal(cur.pos)){ auto now = std::chrono::high_resolution_clock::now(); std::chrono::duration diff = now - pathSearchStart; diff --git a/Horion/path/JoeSegment.cpp b/Horion/path/JoeSegment.cpp index d208af8e..05f56ea1 100644 --- a/Horion/path/JoeSegment.cpp +++ b/Horion/path/JoeSegment.cpp @@ -2,7 +2,7 @@ #include "../DrawUtils.h" -JoeSegment::JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost) : segmentType(type), start(start), end(stop), cost(cost) { +JoeSegment::JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost, bool allowSprint) : segmentType(type), start(start), end(stop), cost(cost), allowSprint(allowSprint) { } void JoeSegment::draw() { switch (segmentType) { @@ -40,3 +40,9 @@ const vec3_ti& JoeSegment::getEnd() const { float JoeSegment::getCost() const { return cost; } +bool JoeSegment::isAllowingSprint() const { + return allowSprint; +} +void JoeSegment::setAllowSprint(bool allowSprint) { + JoeSegment::allowSprint = allowSprint; +} diff --git a/Horion/path/JoeSegment.h b/Horion/path/JoeSegment.h index 60bc82ee..ef1905c8 100644 --- a/Horion/path/JoeSegment.h +++ b/Horion/path/JoeSegment.h @@ -16,9 +16,12 @@ class JoeSegment { JoeSegmentType segmentType; vec3_ti start, end; float cost; + bool allowSprint; public: - JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost); + JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost, bool allowSprint = false); void draw(); + bool isAllowingSprint() const; + void setAllowSprint(bool allowSprint); JoeSegmentType getSegmentType() const; const vec3_ti& getStart() const; const vec3_ti& getEnd() const; diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 67c4f0ed..3b52f4fb 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -12,6 +12,11 @@ C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 8B 02 48 8B DA C1 F8 ?? 89 44 24 ?? 8B 42 ?? 48 8D 54 24 ? C1 F8 04 89 44 24 ?? E8 ? ? ? ? 48 85 C0 74 31")); return getBlockEntity(this, block); } +C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { + using getLiquidBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); + static getLiquidBlock_t getLiquidBlock = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC ?? 83 7A ?? 00 48 8B DA 48 8B F9 7C")); + return getLiquidBlock(this, block); +} bool C_BlockLegacy::getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor) { return Utils::CallVFunc<5, bool, AABB*, C_Block*, C_BlockSource*, const vec3_ti*, C_Entity*>(this, collShapeOut, block, blockSource, pos, actor); } @@ -31,3 +36,11 @@ void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec } liquid_getDepth(this, flowOut, reg, pos); } +bool C_BlockLegacy::hasWater(C_BlockSource* reg, const vec3_ti& pos) { + if(this->material->isLiquid){ + return !this->material->isSuperHot; + } + + auto liquidBlock = reg->getLiquidBlock(pos)->toLegacy(); + return this != liquidBlock && liquidBlock->material->isLiquid && !liquidBlock->material->isSuperHot; +} diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 26dc7ba7..691a62c9 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -48,6 +48,7 @@ class C_BlockLegacy { int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); bool getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor); + bool hasWater(C_BlockSource*, const vec3_ti& pos); }; class C_Block { @@ -82,4 +83,6 @@ class C_BlockSource { C_Block* getBlock(const vec3_ti& block);; C_BlockActor* getBlockEntity(const vec3_ti& block); + + C_Block* getLiquidBlock(const vec3_ti& block); }; From cbb270b16964043036b7486e4304cee83a57772d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 7 Jul 2020 17:18:20 +0200 Subject: [PATCH 080/419] Fix vs project --- Horion.vcxproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index f10185fd..198f3b6c 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -358,7 +358,6 @@ - @@ -537,8 +536,6 @@ - - From 5474a45e8187bb37b4dcb4a27de740cbeb61c82e Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 9 Jul 2020 14:38:08 +0200 Subject: [PATCH 081/419] use moveinputhandler for bhop and fix joe getting stuck in water when in creative --- Horion/Module/Modules/Bhop.cpp | 69 +++++++++++---------------- Horion/Module/Modules/Bhop.h | 3 +- Horion/path/JoeMovementController.cpp | 2 +- 3 files changed, 30 insertions(+), 44 deletions(-) diff --git a/Horion/Module/Modules/Bhop.cpp b/Horion/Module/Modules/Bhop.cpp index ac7bd7d8..df03bf64 100644 --- a/Horion/Module/Modules/Bhop.cpp +++ b/Horion/Module/Modules/Bhop.cpp @@ -11,61 +11,48 @@ const char* Bhop::getModuleName() { return ("Bhop"); } -void Bhop::onTick(C_GameMode* gm) { - C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); - if (input == nullptr) - return; - - if (gm->player->isInLava() == 1 || gm->player->isInWater() == 1) - return; +void Bhop::onMove(C_MoveInputHandler* input) { + auto player = g_Data.getLocalPlayer(); + if (player == nullptr) return; - if (gm->player->isSneaking()) + if (player->isInLava() == 1 || player->isInWater() == 1) return; - if (!GameData::canUseMoveKeys() && g_Data.getLocalPlayer()->canOpenContainerScreen()) + if (player->isSneaking()) return; - float yaw = gm->player->yaw; + float yaw = player->yaw; - if (gm->player->onGround && (GameData::isKeyDown(*input->forwardKey) || GameData::isKeyDown(*input->backKey) || GameData::isKeyDown(*input->rightKey) || GameData::isKeyDown(*input->leftKey))) - gm->player->jumpFromGround(); + bool pressed = input->forward || input->backward || input->right || input->left; - if (GameData::isKeyDown(*input->forwardKey) && GameData::isKeyDown(*input->backKey)) { + if (input->forward && input->backward) return; - } else if (GameData::isKeyDown(*input->forwardKey) && GameData::isKeyDown(*input->rightKey) && !GameData::isKeyDown(*input->leftKey)) { - yaw += 45.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->forwardKey) && GameData::isKeyDown(*input->leftKey) && !GameData::isKeyDown(*input->rightKey)) { - yaw -= 45.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->backKey) && GameData::isKeyDown(*input->rightKey) && !GameData::isKeyDown(*input->leftKey)) { - yaw += 135.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->backKey) && GameData::isKeyDown(*input->leftKey) && !GameData::isKeyDown(*input->rightKey)) { - yaw -= 135.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->forwardKey)) { - keyPressed = true; - } else if (GameData::isKeyDown(*input->backKey)) { - yaw += 180.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->rightKey) && !GameData::isKeyDown(*input->leftKey)) { + + if (player->onGround && pressed) + player->jumpFromGround(); + + if (input->right) { yaw += 90.f; - keyPressed = true; - } else if (GameData::isKeyDown(*input->leftKey) && !GameData::isKeyDown(*input->rightKey)) { + if (input->forward) + yaw -= 45.f; + else if (input->backward) + yaw += 45.f; + } + if (input->left) { yaw -= 90.f; - keyPressed = true; + if (input->forward) + yaw += 45.f; + else if (input->backward) + yaw -= 45.f; } - if (yaw >= 180) - yaw -= 360.f; + + if (input->backward && !input->left && !input->right) + yaw += 180.f; float calcYaw = (yaw + 90) * (PI / 180); vec3_t moveVec; moveVec.x = cos(calcYaw) * speed; - moveVec.y = gm->player->velocity.y; + moveVec.y = player->velocity.y; moveVec.z = sin(calcYaw) * speed; - if (keyPressed) { - gm->player->lerpMotion(moveVec); - keyPressed = false; - } + if(pressed) player->lerpMotion(moveVec); } diff --git a/Horion/Module/Modules/Bhop.h b/Horion/Module/Modules/Bhop.h index cef9338a..811dd27c 100644 --- a/Horion/Module/Modules/Bhop.h +++ b/Horion/Module/Modules/Bhop.h @@ -4,7 +4,6 @@ class Bhop : public IModule { private: - bool keyPressed = false; float speed = 0.325f; public: @@ -13,5 +12,5 @@ class Bhop : public IModule { // Inherited via IModule virtual const char* getModuleName() override; - virtual void onTick(C_GameMode* gm) override; + virtual void onMove(C_MoveInputHandler* input) override; }; diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 4b933680..43d95b61 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -79,7 +79,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move this->stateInfo.nextSegment(); break; }else if(inWater && (pPos.y < end.y || player->velocity.y < 0.12f)) - movementHandler->isJumping = 1; + movementHandler->autoJumpInWater = 1; }else{ dComp = 10; enableNextSegmentSmoothing = false; From 8a996e4f418441e0069ccb3f1b4bea40af94a2e1 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 10 Jul 2020 19:49:51 +0200 Subject: [PATCH 082/419] Joe Water fixes --- Horion/Module/Modules/FollowPathModule.cpp | 6 +- Horion/Module/Modules/TestModule.cpp | 14 ++- Horion/path/JoeConstants.h | 2 + Horion/path/JoeMovementController.cpp | 79 +++++++++++----- Horion/path/JoePath.cpp | 12 ++- Horion/path/JoePathFinder.cpp | 61 +++++++----- Horion/path/JoeSegment.cpp | 102 +++++++++++++++++++++ Horion/path/JoeSegment.h | 5 + Memory/Hooks.cpp | 4 +- Utils/HMath.h | 4 + 10 files changed, 236 insertions(+), 53 deletions(-) diff --git a/Horion/Module/Modules/FollowPathModule.cpp b/Horion/Module/Modules/FollowPathModule.cpp index 63d7f809..26e2be40 100644 --- a/Horion/Module/Modules/FollowPathModule.cpp +++ b/Horion/Module/Modules/FollowPathModule.cpp @@ -5,11 +5,7 @@ FollowPathModule::FollowPathModule() : IModule(0, Category::MOVEMENT, "Follows joe paths") {} const char *FollowPathModule::getModuleName() { -#ifdef _DEBUG return "FollowPath"; -#else - return "Joe"; -#endif } void FollowPathModule::startSearch(vec3_ti startNode, C_BlockSource* region, float searchTimeout, std::function callback){ @@ -102,6 +98,8 @@ void FollowPathModule::onMove(C_MoveInputHandler *handler) { this->movementController = std::make_unique(path); }else if(!pathFinder){ this->setEnabled(false); + }else if(g_Data.getLocalPlayer()->isInWater()){ + handler->autoJumpInWater = true; } }else{ this->clientMessageF("%sDone!", GREEN); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 99c33403..fd39364f 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,5 +1,6 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" +#include "../../DrawUtils.h" TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { } @@ -15,10 +16,19 @@ bool TestModule::isFlashMode() { return false; } +std::vector lastPos; void TestModule::onEnable() { + lastPos.clear(); } void TestModule::onTick(C_GameMode* gm) { + /*auto pPos = gm->player->eyePos0; + vec3_ti startNode((int)floorf(pPos.x), (int)roundf(pPos.y - 1.62f), (int)floorf(pPos.z)); + + if(std::find(lastPos.begin(), lastPos.end(), startNode) == lastPos.end()){ + lastPos.push_back(startNode); + }*/ + logF("%.2f", gm->player->velocity.z); } void TestModule::onMove(C_MoveInputHandler* hand){ @@ -26,7 +36,9 @@ void TestModule::onMove(C_MoveInputHandler* hand){ } void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { - + for(auto pos : lastPos){ + DrawUtils::drawBox(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector(), 1, false); + } } void TestModule::onSendPacket(C_Packet* p) { diff --git a/Horion/path/JoeConstants.h b/Horion/path/JoeConstants.h index 9d97d6d8..a963ce93 100644 --- a/Horion/path/JoeConstants.h +++ b/Horion/path/JoeConstants.h @@ -5,6 +5,8 @@ constexpr float SPRINT_SPEED = 5.61f; constexpr float WATER_SPEED = 1.8f; constexpr float JUMP_TIME = 0.6f; constexpr float PARKOUR_JUMP1_TIME = 0.5f; +constexpr float WATER_UP_SPEED = 2.5f; +constexpr float WATER_SINK_SPEED = 3.5f; float minecraftFallVel(int ticks); diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 43d95b61..a8acb959 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -22,6 +22,13 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move auto curSeg = this->currentPath->getSegment(this->stateInfo.currentPathSegment); + if(!curSeg.isInValidPosition(playerNode)){ + logF("invalid position %i %i %i, %i %i %i", curSeg.getSegmentType(), this->stateInfo.currentPathSegment, this->stateInfo.currentPathSegment > 0 ? this->currentPath->getSegment(this->stateInfo.currentPathSegment - 1).getSegmentType() : 0, playerNode.x, playerNode.y, playerNode.z); + this->stateInfo.currentPathSegment = this->currentPath->getNumSegments(); + this->stateInfo.recoverToStartPos = false; + return; + } + auto startBpos = curSeg.getStart(); auto start = startBpos.toVec3t().add(0.5f, 0, 0.5f); auto endBpos = curSeg.getEnd(); @@ -42,20 +49,22 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move switch(curSeg.getSegmentType()){ case JUMP: { if(player->onGround){ - if(fabsf(pPos.y - end.y) < 0.1f && pPos.dist(end) < 0.5f){// Check for end condition + if(fabsf(pPos.y - end.y) < 0.1f && pPos.dist(end) < 0.5f) { // Check for end condition this->stateInfo.nextSegment(); break; } - if(player->getTicksUsingItem() > 0 && fabsf(pPos.y - end.y) > 0.1f){ + auto tangent = end.sub(start); + tangent.y = 0; + tangent = tangent.normalize(); + auto crossTangent = tangent.cross({0, 1, 0}); + + if((player->getTicksUsingItem() > 0 || fabsf(player->velocity.dot(crossTangent)) > 0.1f) && fabsf(pPos.y - end.y) > 0.1f){ walkTarget = start; goto WALK; } if(pPos.y - end.y > -0.01f) goto WALK; - auto tangent = end.sub(start); - tangent.y = 0; - tangent = tangent.normalize(); auto lastPossibleJumpTarget = start.add(tangent.mul(0.25f)); walkTarget = start.add(tangent); // This is not actually on a block anymore, but if we make this smaller the movement controller will stop moving at the jump target @@ -78,8 +87,10 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move if(fabsf(pPos.y - end.y) < (inWater ? 0.2f : 0.1f) && pPos.sub(end).magnitudexz() < 0.5f && player->velocity.y > -0.1f){// Check for end condition this->stateInfo.nextSegment(); break; - }else if(inWater && (pPos.y < end.y || player->velocity.y < 0.12f)) - movementHandler->autoJumpInWater = 1; + }else if(inWater){ + if(pPos.y < end.y || player->velocity.y < 0.12f) + movementHandler->autoJumpInWater = 1; + } }else{ dComp = 10; enableNextSegmentSmoothing = false; @@ -135,26 +146,50 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move } break; case WATER_WALK: { { - if(player->isInWater()) - movementHandler->isJumping = 1; - auto tangent = end.sub(start); - tangent.y = 0; - tangent = tangent.normalize(); - auto crossTangent = tangent.cross({0, 1, 0}); - float sideError = fabsf(pPos.sub(end).dot(crossTangent)); - if(sideError < 0.2f /*make sure we're not drifting to the side to much*/ && fabsf(pPos.sub(end).dot(tangent)) < 0.4f){ - this->stateInfo.nextSegment(); - break; + bool isVertical = tangent.magnitudexz() < 0.1f && fabsf(tangent.y) > 0.5f; + + if(isVertical){ + if(pPos.sub(end).magnitudexz() < 0.3f && fabsf(pPos.y - end.y) < 0.35f){ + this->stateInfo.nextSegment(); + break; + } + + if(pPos.y + 0.1f < end.y) + movementHandler->autoJumpInWater = 1; + else if(pPos.y > end.y) + movementHandler->isSneakDown = 1; + + }else{ + + if(player->isInWater()) + movementHandler->autoJumpInWater = 1; + + tangent.y = 0; + tangent = tangent.normalize(); + auto crossTangent = tangent.cross({0, 1, 0}); + float sideError = fabsf(pPos.sub(end).dot(crossTangent)); + if(sideError < 0.2f /*make sure we're not drifting to the side to much*/ && fabsf(pPos.sub(end).dot(tangent)) < 0.4f){ + this->stateInfo.nextSegment(); + break; + } + if(end.y > start.y && sideError > 0.15f && pPos.y - end.y < -0.1f) + walkTarget = start.add(tangent.mul(0.2f)); // center if we need to get up a block } - if(end.y > start.y && sideError > 0.15f && pPos.y - end.y < -0.1f) - walkTarget = start.add(tangent.mul(0.2f)); // center if we need to get up a block + vec3_t flow{}; auto block = player->region->getBlock(playerNode); - if(!block->toLegacy()->material->isLiquid) - block = player->region->getBlock(playerNode.add(0, -1, 0)); - block->toLegacy()->liquidGetFlow(&flow, player->region, &playerNode); + if(!block->toLegacy()->material->isLiquid){ + auto mod = playerNode.add(0, -1, 0); + block = player->region->getBlock(mod); + + if(block->toLegacy()->material->isLiquid) + block->toLegacy()->liquidGetFlow(&flow, player->region, &mod); + }else{ + block->toLegacy()->liquidGetFlow(&flow, player->region, &playerNode); + } + flow = flow.mul(-1 * 0.07f * 10); addedDiff = flow; } diff --git a/Horion/path/JoePath.cpp b/Horion/path/JoePath.cpp index a4569298..ca1b687c 100644 --- a/Horion/path/JoePath.cpp +++ b/Horion/path/JoePath.cpp @@ -4,7 +4,7 @@ JoePath::JoePath(const std::vector& segments, bool isIncomplete) : segments(segments), isIncomplete(isIncomplete) { } -JoePath::JoePath() : segments() { +JoePath::JoePath() : segments(), isIncomplete(false) { } void JoePath::draw(int highlight) const { DrawUtils::setColor(13 / 255.f, 29 / 255.f, 48 / 255.f, 1); @@ -30,8 +30,14 @@ void JoePath::cutoff(float percentageKeep) { this->segments.erase(this->segments.begin() + numKeep, this->segments.end()); } void JoePath::initPathSegments() { + // Init segments + for(auto& seg : segments){ + seg.init(); + } + // Check whether we can sprint or not if(segments.size() > 1){ + for(int i = 0; i < segments.size() - 2; i++){ auto& curSeg = segments.at(i); auto& nextSeg = segments.at(i + 1); @@ -39,6 +45,10 @@ void JoePath::initPathSegments() { curSeg.setAllowSprint(false); continue; } + if(curSeg.getStart().y != curSeg.getEnd().y){ + curSeg.setAllowSprint(false); + continue; + } auto currentTangent = curSeg.getEnd().sub(curSeg.getStart()).toFloatVector().normalize(); auto nextTangent = nextSeg.getEnd().sub(nextSeg.getStart()).toFloatVector().normalize(); diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 22a0c2a6..399cce09 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -66,7 +66,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo auto obs1 = reg->getBlock(pos)->toLegacy(); if(obs1->material->isSuperHot) return true; - if((obs1->material->isLiquid || obs1->hasWater(reg, pos)) && !allowWater) + if(!allowWater && (obs1->material->isLiquid || obs1->hasWater(reg, pos))) return true; // contact damage based @@ -115,7 +115,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo } return false; } -__forceinline bool isDangerousPlayer(vec3_ti pos, C_BlockSource* reg, bool allowWater = false){ +__forceinline bool isDangerousPlayer(const vec3_ti& pos, C_BlockSource* reg, bool allowWater = false){ return isDangerous(pos, reg, allowWater) || isDangerous(pos.add(0, 1, 0), reg, allowWater); } @@ -160,30 +160,17 @@ __forceinline bool isObstructed(const vec3_ti& pos, C_BlockSource* reg, bool all AABB aabb{}; bool hasBox = obs1->getCollisionShape(&aabb, block, reg, &pos, nullptr); - /* - // Snow blocks - { - static uintptr_t** snowBlockVtable = nullptr; // TopSnowBlock - if (snowBlockVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 C6 83 ?? ?? ?? ?? 01 F3"); - int offset = *reinterpret_cast(sigOffset + 3); - snowBlockVtable = reinterpret_cast(sigOffset + offset + *length of instruction* 7); - } - - if(obs1->Vtable == snowBlockVtable hasBox - return true; - }*/ if(hasBox) return true; return isDangerous(pos, reg, allowWater); } -__forceinline bool isObstructedPlayer(vec3_ti pos, C_BlockSource* reg, bool allowWater = false){ +__forceinline bool isObstructedPlayer(const vec3_ti& pos, C_BlockSource* reg, bool allowWater = false){ return isObstructed(pos, reg, allowWater) || isObstructed(pos.add(0, 1, 0), reg); } -std::vector findEdges(std::unordered_map& allNodes, Node startNode, C_BlockSource* reg, NodeRef startNodeRef){ +std::vector findEdges(std::unordered_map& allNodes, const Node& startNode, C_BlockSource* reg, NodeRef startNodeRef){ std::vector edges; auto startBlock = reg->getBlock(startNode.pos)->toLegacy(); bool isInWater = startBlock->hasWater(reg, startNode.pos); @@ -197,6 +184,21 @@ std::vector findEdges(std::unordered_map& allNodes const float diagonalSlowSpeed = SQRT2 / fminf(maxWalkSpeed, WALKING_SPEED); const float walkOffBlockTime = 0.8f / maxWalkSpeed; + if(isInWater){ + { + auto mod = startNode.pos.add(0, 1, 0); + auto block = reg->getBlock(mod); + if (block->toLegacy()->material->isLiquid && !block->toLegacy()->material->isSuperHot) { + if (!isObstructed(startNode.pos.add(0, 1, 0), reg, true) && !isObstructed(startNode.pos.add(0, 2, 0), reg, true)) + edges.emplace_back(startNodeRef, findNode(allNodes, mod), 1 / WATER_UP_SPEED, JoeSegmentType::WATER_WALK); + } + } + if(!isObstructed(startNode.pos.add(0, -1, 0), reg, true) && canStandOn(startNode.pos.add(0, -2, 0), reg, true)){ + auto mod = startNode.pos.add(0, -1, 0); + edges.emplace_back(startNodeRef, findNode(allNodes, mod), 1 / WATER_SINK_SPEED, JoeSegmentType::WATER_WALK); + } + } + for(int x = -1; x <= 1; x++){ for(int z = -1; z <= 1; z++){ if(x == 0 && z == 0) @@ -235,6 +237,7 @@ std::vector findEdges(std::unordered_map& allNodes // Drop down { + int numWaterBlocks = 0; int dropLength = 0; while(dropLength < 3){ dropLength++; @@ -245,9 +248,22 @@ std::vector findEdges(std::unordered_map& allNodes break; } - if(!canStandOn(dropPos.add(0, -1, 0), reg, isInWater)) // block to stand on after drop + if(!canStandOn(dropPos.add(0, -1, 0), reg, false)) // block to stand on after drop continue; + int waterDepth = 0; + while(waterDepth < dropLength){ + auto testPos = dropPos.add(0, waterDepth, 0); + auto blockTest = reg->getBlock(testPos)->toLegacy(); + if(!blockTest->hasWater(reg, testPos)) + break; + + waterDepth++; + } + if(waterDepth > 0){ + dropPos = dropPos.add(0, waterDepth - 1, 0); + } + const float dropTime = FALL_N_BLOCKS_COST[dropLength] + walkOffBlockTime; edges.emplace_back(startNodeRef, findNode(allNodes, dropPos), dropTime, JoeSegmentType::DROP); dropLength = -1; @@ -255,7 +271,7 @@ std::vector findEdges(std::unordered_map& allNodes } if(dropLength == 3){ // no drop found, lets try water drops auto dropPos = newPos.add(0, -1 * dropLength, 0); - int numWaterBlocks = 0; + while(dropPos.y > 1){ dropPos.y--; dropLength++; @@ -418,7 +434,7 @@ JoePath JoePathFinder::findPath() { int numNodes = 0; int numEdges = 0; - if(this->pathSearchTimeout < 0 || this->pathSearchTimeout > 1000) + if(this->pathSearchTimeout < 0 || this->pathSearchTimeout > 50) this->pathSearchTimeout = 10; auto pathSearchStart = std::chrono::high_resolution_clock::now(); @@ -471,6 +487,7 @@ JoePath JoePathFinder::findPath() { numEdges += (int)edges.size(); for(auto edge : edges){ auto& edgeEndNode = allNodes.at(edge.endNode.hash); + //logF("(%i %i %i) %i -> (%i %i %i)", cur.pos.x, cur.pos.y, cur.pos.z, edge.type, edgeEndNode.pos.x, edgeEndNode.pos.y, edgeEndNode.pos.z); if(edgeEndNode.isClosed) continue; float tentativeScore = cur.gScore + edge.cost; @@ -488,16 +505,12 @@ JoePath JoePathFinder::findPath() { openSet.push(edge.endNode); }else{ // remove from openset - openSet.push(edge.endNode); } } - //Sleep(100); } auto now = std::chrono::high_resolution_clock::now(); std::chrono::duration diff = now - pathSearchStart; - //logF("Could not find path! Time: %.2fs Total Nodes: %i NodesVisited: %i Edges: %i term: %i", diff.count(), allNodes.size(), numNodes, numEdges, terminateSearch); - // Did not find path, return incomplete one if(this->terminateSearch) return JoePath(); diff --git a/Horion/path/JoeSegment.cpp b/Horion/path/JoeSegment.cpp index 05f56ea1..e0a76993 100644 --- a/Horion/path/JoeSegment.cpp +++ b/Horion/path/JoeSegment.cpp @@ -3,8 +3,13 @@ #include "../DrawUtils.h" JoeSegment::JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost, bool allowSprint) : segmentType(type), start(start), end(stop), cost(cost), allowSprint(allowSprint) { + } void JoeSegment::draw() { + //for(auto p : this->validPositions){ + // DrawUtils::drawLine3d(p.toFloatVector(), p.add(1, 1, 1).toFloatVector()); + //} + switch (segmentType) { case DROP: { auto dropPoint = start.toVec3t().add(0.5f, 0.05f, 0.5f); @@ -46,3 +51,100 @@ bool JoeSegment::isAllowingSprint() const { void JoeSegment::setAllowSprint(bool allowSprint) { JoeSegment::allowSprint = allowSprint; } +bool JoeSegment::isInValidPosition(const vec3_ti& pos) const { + for(const auto& validPos : this->validPositions){ + if(pos == validPos) + return true; + } + return false; +} +void JoeSegment::setValidPositions(const std::vector& validPositions) { + JoeSegment::validPositions = validPositions; +} +void JoeSegment::init() { + std::vector positions = {start, end}; + + auto player = g_Data.getLocalPlayer(); + auto reg = player->region; + + switch(this->segmentType){ + case JoeSegmentType::WALK: { + if(start.y == end.y){ + int isDiagonal = 0; + isDiagonal += start.x != end.x; + isDiagonal += start.z != end.z; + if(!isDiagonal){ + break; + } + + auto mod = start; + mod.x = end.x; + positions.push_back(mod); + mod.x = start.x; + mod.z = end.z; + positions.push_back(mod); + break; + } + + vec3_t tangentF = end.sub(start).toFloatVector(); + tangentF.y = 0; + tangentF = tangentF.normalize(); + vec3_ti tangent((int)roundf(tangentF.x), 0, (int)roundf(tangentF.z)); + + positions.push_back(start.add(tangent)); + positions.push_back(start.add(tangent).add(0, -1, 0)); + + for(int yLevel = start.y; yLevel > end.y; yLevel--){ + auto mod = end; + mod.y = yLevel; + positions.push_back(mod); + } + } break; + case JoeSegmentType::DROP: { + for(int yLevel = start.y; yLevel > end.y; yLevel--){ + auto mod = end; + mod.y = yLevel; + positions.push_back(mod); + } + auto pos = end; + auto block = reg->getBlock(pos); + while(block->toLegacy()->hasWater(reg, pos) && pos.y > 1 && end.y - pos.y < 19){ + positions.push_back(pos); + pos.y--; + } + } break; + case JoeSegmentType::JUMP: { + auto mod = start; + mod.y = end.y; + positions.push_back(mod); + } break; + case JoeSegmentType::PARKOUR_JUMP_SINGLE: { + vec3_t tangentF = end.sub(start).toFloatVector(); + tangentF.y = 0; + tangentF = tangentF.normalize(); + vec3_ti tangent((int)roundf(tangentF.x), 0, (int)roundf(tangentF.z)); + + positions.push_back(start.add(0, 1, 0)); + + auto mod = start.add(tangent); + positions.push_back(mod); + positions.push_back(mod.add(0, 1, 0)); + + mod = end; + for(int yLevel = end.y; yLevel <= start.y + 1; yLevel++){ + mod.y = yLevel; + positions.push_back(mod); + } + } break; + case JoeSegmentType::WATER_WALK: { + positions.push_back(start.add(0, 1, 0)); + if(end.y > start.y) + positions.push_back(start.add(0, 2, 0)); + positions.push_back(end.add(0, 1, 0)); + } break; + default: { + + } break; + } + this->setValidPositions(positions); +} diff --git a/Horion/path/JoeSegment.h b/Horion/path/JoeSegment.h index ef1905c8..46a31dc6 100644 --- a/Horion/path/JoeSegment.h +++ b/Horion/path/JoeSegment.h @@ -1,6 +1,7 @@ #pragma once #include "../../Utils/HMath.h" +#include enum JoeSegmentType{ INVALID = -1, @@ -17,6 +18,7 @@ class JoeSegment { vec3_ti start, end; float cost; bool allowSprint; + std::vector validPositions; public: JoeSegment(JoeSegmentType type, vec3_ti& start, vec3_ti& stop, float cost, bool allowSprint = false); void draw(); @@ -25,5 +27,8 @@ class JoeSegment { JoeSegmentType getSegmentType() const; const vec3_ti& getStart() const; const vec3_ti& getEnd() const; + bool isInValidPosition(const vec3_ti& pos) const; + void setValidPositions(const std::vector& validPositions); float getCost() const; + void init(); }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e5acef55..7535834e 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1313,9 +1313,11 @@ void Hooks::ClickFunc(__int64 a1, char mouseButton, char isDown, __int16 mouseX, __int64 Hooks::MoveInputHandler_tick(C_MoveInputHandler* a1, C_Entity* a2) { static auto oTick = g_Hooks.MoveInputHandler_tickHook->GetFastcall<__int64, C_MoveInputHandler*, C_Entity*>(); + auto ret = oTick(a1, a2); moduleMgr->onMove(a1); - return ret; + + return 0; } __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { diff --git a/Utils/HMath.h b/Utils/HMath.h index 19680e63..53aa7f53 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -262,6 +262,10 @@ struct vec3_ti { bool operator==(const vec3_ti &o) const { return x == o.x && y == o.y && z == o.z; } bool operator!=(const vec3_ti &o) const { return x != o.x || y != o.y || z != o.z; } + vec3_ti add(vec3_ti o) const { + return vec3_ti(x + o.x, y + o.y, z + o.z); + } + vec3_ti add(int f) const { return vec3_ti(x + f, y + f, z + f); } From 91a2bc7e2a4c29482fcd57d2e7777832ee9f2642 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 12 Jul 2020 11:43:10 -0400 Subject: [PATCH 083/419] fix fastladder --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 7535834e..60fdc9c7 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -58,7 +58,7 @@ void Hooks::Init() { g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); - g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[322], Hooks::Actor_ascendLadder); + g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder); } } From 41a03e42287730d5af8d3b237c81cae684ce40b3 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 12 Jul 2020 18:15:48 +0200 Subject: [PATCH 084/419] remove this --- Horion/Module/ModuleManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index d5d46954..ebef6de8 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -89,7 +89,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Zoom())); this->moduleList.push_back(std::shared_ptr(new Teams())); this->moduleList.push_back(std::shared_ptr(new Nbt())); - this->moduleList.push_back(std::shared_ptr(new Godmode())); + //this->moduleList.push_back(std::shared_ptr(new Godmode())); this->moduleList.push_back(std::shared_ptr(new Freelook())); this->moduleList.push_back(std::shared_ptr(new AutoSneak())); this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); @@ -105,7 +105,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new TestModule())); #endif - // Sort module alphabetically + // Sort modules alphabetically std::sort(moduleList.begin(), moduleList.end(), [](auto lhs, auto rhs) { auto current = lhs; auto other = rhs; From 5ba94846fc9aa08136da86fb9c863f12b0d6b16d Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 12 Jul 2020 18:45:16 +0200 Subject: [PATCH 085/419] add to public --- Horion/Command/CommandMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index f4e93834..00febb7f 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -39,11 +39,11 @@ void CommandMgr::initCommands() { commandList.push_back(new DamageCommand()); commandList.push_back(new ConfigCommand()); commandList.push_back(new SetprefixCommand()); + commandList.push_back(new NbtCommand()); #if defined(_BETA) or defined(_DEBUG) commandList.push_back(new CommandBlockExploitCommand()); commandList.push_back(new NameSpoofCommand()); - commandList.push_back(new NbtCommand()); commandList.push_back(new ExecuteCommand()); commandList.push_back(new ScriptCommand()); commandList.push_back(new PathCommand()); From 7b94fd0566bdcfef8015576b10d4bbcc02ecb134 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 19 Jul 2020 23:25:56 +0200 Subject: [PATCH 086/419] Epic drawLine3d --- CMakeLists.txt | 2 +- Horion/DrawUtils.cpp | 54 +++++++++++++++++- Horion/DrawUtils.h | 2 + Horion/Module/Modules/JavascriptModule.cpp | 12 ++++ Horion/Module/Modules/JavascriptModule.h | 1 + Horion/Module/Modules/TestModule.cpp | 32 ++++++++++- Horion/Module/Modules/TestModule.h | 2 +- Horion/Scripting/Functions/DrawFunctions.cpp | 55 +++++++++++++++++++ Horion/Scripting/Functions/DrawFunctions.h | 9 +++ .../Scripting/Functions/EntityFunctions.cpp | 16 ++++++ Horion/Scripting/Functions/EntityFunctions.h | 1 + .../Scripting/Functions/HorionFunctions.cpp | 4 ++ Horion/Scripting/Functions/HorionFunctions.h | 1 + .../Functions/LocalPlayerFunctions.cpp | 2 + .../Scripting/Functions/Vector3Functions.cpp | 10 +++- Horion/Scripting/Functions/Vector3Functions.h | 2 +- Horion/Scripting/JsScriptModule.cpp | 2 +- Horion/Scripting/ScriptInstance.cpp | 30 +++++----- Horion/Scripting/ScriptInstance.h | 18 ++++++ Horion/Scripting/ScriptManager.cpp | 11 ++++ Horion/Scripting/ScriptManager.h | 3 + Memory/GameData.cpp | 3 +- 22 files changed, 249 insertions(+), 23 deletions(-) create mode 100644 Horion/Scripting/Functions/DrawFunctions.cpp create mode 100644 Horion/Scripting/Functions/DrawFunctions.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0420dae3..063a5386 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,4 +361,4 @@ add_library(Horion SHARED Utils/Utils.cpp Utils/Utils.h Utils/xorstr.h - resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h) + resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 9c7c484b..ba12f14b 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -40,7 +40,12 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - g_Data.getLastUpdateTime(); ElapsedMicroseconds.QuadPart *= 1000000; - ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / 20; + int ticksPerSecond = 20; + if(g_Data.getClientInstance()->minecraft) + ticksPerSecond = *g_Data.getClientInstance()->minecraft->timer; + if(ticksPerSecond < 1) + ticksPerSecond = 1; + ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / ticksPerSecond; lerpT = (ElapsedMicroseconds.QuadPart / 1000000.f); if (lerpT > 1) lerpT = 1; @@ -451,4 +456,51 @@ void DrawUtils::setGameRenderContext(__int64 ctx) { game3dContext = ctx; if (g_Data.getClientInstance()->levelRenderer != nullptr) origin = g_Data.getClientInstance()->levelRenderer->origin; + + if(ctx){ + LARGE_INTEGER EndingTime, ElapsedMicroseconds; + LARGE_INTEGER Frequency; + QueryPerformanceFrequency(&Frequency); + QueryPerformanceCounter(&EndingTime); + ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - g_Data.getLastUpdateTime(); + + ElapsedMicroseconds.QuadPart *= 1000000; + int ticksPerSecond = 20; + if(g_Data.getClientInstance()->minecraft) + ticksPerSecond = *g_Data.getClientInstance()->minecraft->timer; + if(ticksPerSecond < 1) + ticksPerSecond = 1; + ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / ticksPerSecond; + lerpT = (ElapsedMicroseconds.QuadPart / 1000000.f); + if (lerpT > 1) + lerpT = 1; + else if (lerpT < 0) + lerpT = 0; + } +} +float DrawUtils::getLerpTime() { + return lerpT; +} +void DrawUtils::drawLinestrip3d(const std::vector& points) { + if(game3dContext == 0 || entityFlatStaticMaterial == 0) + return; + + auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); + + DrawUtils::tess__begin(myTess, 5); + + /* + * 1: quads + * 2: triangle list + * 3: trianglestrip (6) + * 4: line list + * 5: line strip (7) + */ + + for(const auto& p : points){ + auto pD = p.sub(origin); + tess_vertex(myTess, pD.x, pD.y, pD.z); + } + + tess_end(game3dContext, myTess, entityFlatStaticMaterial); } diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 810b386c..457f20ae 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -88,6 +88,7 @@ class DrawUtils { static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); static void drawLine(vec2_t start, vec2_t end, float lineWidth); // rgba + static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); static inline void fillRectangle(vec4_t pos, const MC_Color col, float alpha) { float posF[4]; // vec4_t(startX, startY, endX, endY); @@ -113,6 +114,7 @@ class DrawUtils { static void drawNameTags(C_Entity* ent, float textSize, bool drawHealth = false, bool useUnicodeFont = false); static void drawItem(C_ItemStack* item, vec2_t ItemPos, float opacity, float scale, bool isEnchanted); static void drawKeystroke(char key, vec2_t pos); + static float getLerpTime(); static vec2_t worldToScreen(const vec3_t& world); }; diff --git a/Horion/Module/Modules/JavascriptModule.cpp b/Horion/Module/Modules/JavascriptModule.cpp index eaf30c1a..b80bb4f2 100644 --- a/Horion/Module/Modules/JavascriptModule.cpp +++ b/Horion/Module/Modules/JavascriptModule.cpp @@ -59,3 +59,15 @@ void JavascriptModule::onDisable() { p->getScriptInstance()->callCallback(callback); } +void JavascriptModule::onLevelRender() { + auto p = this->backingScriptModule.lock(); + if (!p) + return; + + auto lock = p->lockCallbacks(); + auto callback = p->getCallback(L"onRender"); + if (callback == JS_INVALID_REFERENCE) + return; + + p->getScriptInstance()->callCallbackImmediate(callback); +} diff --git a/Horion/Module/Modules/JavascriptModule.h b/Horion/Module/Modules/JavascriptModule.h index 9fbe6d44..7e345a55 100644 --- a/Horion/Module/Modules/JavascriptModule.h +++ b/Horion/Module/Modules/JavascriptModule.h @@ -21,4 +21,5 @@ class JavascriptModule : public IModule { virtual void onTick(C_GameMode* gm) override; void onEnable() override; void onDisable() override; + void onLevelRender() override; }; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index fd39364f..fc781049 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -28,7 +28,7 @@ void TestModule::onTick(C_GameMode* gm) { if(std::find(lastPos.begin(), lastPos.end(), startNode) == lastPos.end()){ lastPos.push_back(startNode); }*/ - logF("%.2f", gm->player->velocity.z); + //logF("%.2f", gm->player->velocity.z); } void TestModule::onMove(C_MoveInputHandler* hand){ @@ -47,3 +47,33 @@ void TestModule::onSendPacket(C_Packet* p) { void TestModule::onDisable() { } +float t = 0; +void TestModule::onLevelRender() { + t++; + DrawUtils::setColor(1, 0.2f, 0.2f, 1); + g_Data.forEachEntity([](auto c, auto _){ + vec3_t* start = c->getPosOld(); + vec3_t* end = c->getPos(); + + auto te = DrawUtils::getLerpTime(); + vec3_t pos = start->lerp(end, te); + + auto yPos = pos.y; + yPos -= 1.62; + yPos += 0.9 + 0.9 * sin(((t + pos.x * 6 + pos.z * 5) / 60) * PI * 2); + + std::vector posList; + vec3_t lastPos(pos.x + sinf(0), yPos, pos.z + cosf(0)); + posList.push_back(lastPos); + for(auto angle = 0; angle <= 360; angle += 10){ + if(angle == 0) + continue; + vec3_t curPos(pos.x + sinf(angle / (180 / PI)), yPos, pos.z + cosf(angle / (180 / PI))); + posList.push_back(curPos); + //DrawUtils::drawLine3d(lastPos, curPos); + //lastPos = curPos; + } + + DrawUtils::drawLinestrip3d(posList); + }); +} diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 78112722..5a833477 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -17,5 +17,5 @@ class TestModule : public IModule { virtual void onSendPacket(C_Packet* p) override; virtual void onMove(C_MoveInputHandler* hand) override; virtual void onDisable() override; - + void onLevelRender() override; }; diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp new file mode 100644 index 00000000..1d3c5147 --- /dev/null +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -0,0 +1,55 @@ +#include "DrawFunctions.h" +#include "../../DrawUtils.h" + +JsValueRef CALLBACK DrawFunctions::drawLine3d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + auto startOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!startOpt.has_value()) { + THROW(L"Invalid start vector!"); + } + // Note that &arguments[argIndex] might point to invalid memory here, but the function should abort because argumentCount - argIndex equals 0 + auto endOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!endOpt.has_value()) { + THROW(L"Invalid end vector!"); + } + DrawUtils::drawLine3d(*startOpt, *endOpt); + + return chakra.trueValue(); +} + +JsValueRef CALLBACK DrawFunctions::setColor(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + if (argumentCount < 4){ + THROW(L"Invalid arguments (3 floats needed, 4th optional)!"); + } + + bool hasAlpha = argumentCount >= 5; + + bool isValid = true; + JsValueType type; + for (int i = 0; i < (hasAlpha ? 4 : 3); i++) { + auto err = chakra.JsGetValueType_(arguments[i + 1], &type); + if (err != JsNoError || type != JsNumber) { + isValid = false; + break; + } + } + + if (!isValid){ + THROW(L"Invalid arguments (3 doubles needed, 4th optional)!"); + } + + double r, g, b, a = 1; + int err = 0; + err |= (int)chakra.JsNumberToDouble_(arguments[1], &r); + err |= (int)chakra.JsNumberToDouble_(arguments[2], &g); + err |= (int)chakra.JsNumberToDouble_(arguments[3], &b); + if(hasAlpha) + err |= (int)chakra.JsNumberToDouble_(arguments[4], &a); + if ((JsErrorCode)err != JsNoError){ + THROW(L"Invalid arguments (can't convert to double)"); + } + + DrawUtils::setColor(r, g, b, a); + + return chakra.trueValue(); +} \ No newline at end of file diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h new file mode 100644 index 00000000..51bc55dd --- /dev/null +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -0,0 +1,9 @@ +#pragma once + +#include "../ScriptManager.h" + +class DrawFunctions { +public: + DECL_FUN(drawLine3d); + DECL_FUN(setColor); +}; diff --git a/Horion/Scripting/Functions/EntityFunctions.cpp b/Horion/Scripting/Functions/EntityFunctions.cpp index 4dd333ea..492893a5 100644 --- a/Horion/Scripting/Functions/EntityFunctions.cpp +++ b/Horion/Scripting/Functions/EntityFunctions.cpp @@ -1,4 +1,5 @@ #include "EntityFunctions.h" +#include "../../DrawUtils.h" // this fixes intellisense somehow #ifndef ENTITY_INVALID @@ -23,6 +24,21 @@ JsValueRef CALLBACK EntityFunctions::getPosition(JsValueRef callee, bool isConst return scriptMgr.prepareVector3(*ent->getPos(), reinterpret_cast(callbackState)); } +JsValueRef CALLBACK EntityFunctions::getInterpolatedPosition(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + vec3_t* start = ent->getPosOld(); + vec3_t* end = ent->getPos(); + + auto t = DrawUtils::getLerpTime(); + vec3_t lerped = start->lerp(end, t); + + return scriptMgr.prepareVector3(lerped, reinterpret_cast(callbackState)); +} + JsValueRef CALLBACK EntityFunctions::getVelocity(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto ent = EntityFunctions::getEntityFromValue(arguments[0]); if (ent == nullptr) { diff --git a/Horion/Scripting/Functions/EntityFunctions.h b/Horion/Scripting/Functions/EntityFunctions.h index 57a08402..9d7a23c6 100644 --- a/Horion/Scripting/Functions/EntityFunctions.h +++ b/Horion/Scripting/Functions/EntityFunctions.h @@ -38,6 +38,7 @@ class EntityFunctions { DECL_FUN(isValid); DECL_FUN(getPosition); + DECL_FUN(getInterpolatedPosition); DECL_FUN(getVelocity); DECL_FUN(isOnGround); DECL_FUN(getSize); diff --git a/Horion/Scripting/Functions/HorionFunctions.cpp b/Horion/Scripting/Functions/HorionFunctions.cpp index 178084aa..735593bf 100644 --- a/Horion/Scripting/Functions/HorionFunctions.cpp +++ b/Horion/Scripting/Functions/HorionFunctions.cpp @@ -6,4 +6,8 @@ JsValueRef CALLBACK HorionFunctions::getCommandManager(JsValueRef callee, bool i JsValueRef CALLBACK HorionFunctions::getModuleManager(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { return reinterpret_cast(callbackState)->moduleManager; +} + +JsValueRef CALLBACK HorionFunctions::getDrawUtils(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + return reinterpret_cast(callbackState)->drawUtils; } \ No newline at end of file diff --git a/Horion/Scripting/Functions/HorionFunctions.h b/Horion/Scripting/Functions/HorionFunctions.h index 681f232e..0d36ea1a 100644 --- a/Horion/Scripting/Functions/HorionFunctions.h +++ b/Horion/Scripting/Functions/HorionFunctions.h @@ -6,4 +6,5 @@ class HorionFunctions { public: DECL_FUN(getCommandManager); DECL_FUN(getModuleManager); + DECL_FUN(getDrawUtils); }; diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 6b0bd136..18be704d 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -25,6 +25,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setVelocity(JsValueRef callee, bool is if (ent == nullptr) { ENTITY_INVALID; } + auto vecOpt = Vector3Functions::getVecFromArguments(&arguments[1], argumentCount - 1); if (!vecOpt.has_value()) { THROW(L"Invalid vector!"); @@ -54,6 +55,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setViewAngles(JsValueRef callee, bool if (ent == nullptr) { ENTITY_INVALID; } + auto vecOpt = Vector3Functions::getVecFromArguments(&arguments[1], argumentCount - 1); if (!vecOpt.has_value()) { THROW(L"Invalid vector!"); diff --git a/Horion/Scripting/Functions/Vector3Functions.cpp b/Horion/Scripting/Functions/Vector3Functions.cpp index d205590c..ff0e99a2 100644 --- a/Horion/Scripting/Functions/Vector3Functions.cpp +++ b/Horion/Scripting/Functions/Vector3Functions.cpp @@ -18,14 +18,17 @@ std::optional Vector3Functions::getVecFromValue(JsValueRef ref) { return std::optional(vecInfo->vec); } -std::optional Vector3Functions::getVecFromArguments(JsValueRef* args, int argCount) { +std::optional Vector3Functions::getVecFromArguments(JsValueRef* args, int argCount, int* nextArg) { if (argCount <= 0) return std::optional(); auto vec = Vector3Functions::getVecFromValue(args[0]); - if (vec.has_value()) + if (vec.has_value()){ + if(nextArg) + *nextArg += 1; return vec.value(); + } if (argCount < 3) return std::optional(); @@ -51,6 +54,9 @@ std::optional Vector3Functions::getVecFromArguments(JsValueRef* args, in if ((JsErrorCode)err != JsNoError) return std::optional(); + if(nextArg) + *nextArg += 3; + return std::optional(vec3_t(x, y, z)); } diff --git a/Horion/Scripting/Functions/Vector3Functions.h b/Horion/Scripting/Functions/Vector3Functions.h index fd7ce813..fb9b4636 100644 --- a/Horion/Scripting/Functions/Vector3Functions.h +++ b/Horion/Scripting/Functions/Vector3Functions.h @@ -9,7 +9,7 @@ class Vector3Functions { static std::optional getVecFromValue(JsValueRef); public: - static std::optional getVecFromArguments(JsValueRef*, int argCount); + static std::optional getVecFromArguments(JsValueRef*, int argCount, int* nextArg = nullptr); DECL_FUN(isValid); DECL_FUN(getX); diff --git a/Horion/Scripting/JsScriptModule.cpp b/Horion/Scripting/JsScriptModule.cpp index 4997c70c..ddaac328 100644 --- a/Horion/Scripting/JsScriptModule.cpp +++ b/Horion/Scripting/JsScriptModule.cpp @@ -12,7 +12,7 @@ JsValueRef JsScriptModule::getCallback(std::wstring callbackName) { } bool JsScriptModule::registerCallback(std::wstring callbackName, JsValueRef jsFunc) { - if (callbackName != L"onTick" && callbackName != L"onEnable" && callbackName != L"onDisable" && callbackName != L"onAttack") + if (callbackName != L"onTick" && callbackName != L"onEnable" && callbackName != L"onDisable" && callbackName != L"onAttack" && callbackName != L"onRender") return false; chakra.JsAddRef_(jsFunc, 0); diff --git a/Horion/Scripting/ScriptInstance.cpp b/Horion/Scripting/ScriptInstance.cpp index 663811ab..b625df54 100644 --- a/Horion/Scripting/ScriptInstance.cpp +++ b/Horion/Scripting/ScriptInstance.cpp @@ -9,16 +9,14 @@ ScriptInstance::~ScriptInstance() { if (this->runtimeHandle != JS_INVALID_RUNTIME_HANDLE) chakra.JsDisableRuntimeExecution_(this->runtimeHandle); this->isRunning = false; - if (this->scriptThread.joinable()) - this->scriptThread.join(); - } + if (this->scriptThread.joinable()) + this->scriptThread.join(); { auto lock = moduleMgr->lockModuleListExclusive(); auto list = moduleMgr->getModuleList(); - for (auto it = this->registeredModules.begin(); it != this->registeredModules.end(); it++) { - auto p = *it; + for (const auto& p : this->registeredModules) { auto pos = std::find(list->begin(), list->end(), p->getModule()); if (pos == list->end()) { logF("couldn't find module???"); @@ -52,13 +50,13 @@ void ScriptInstance::runPromises() { void ScriptInstance::runSync() { std::wstring contents = Utils::wreadFileContents(this->startScriptPath); - if (contents.size() == 0) { + if (contents.empty()) { isRunning = false; return; } JsContextRef context; - JsValueRef result = 0; + JsValueRef result = nullptr; chakra.JsCreateRuntime_((_JsRuntimeAttributes)((int)JsRuntimeAttributeDisableFatalOnOOM | (int)JsRuntimeAttributeAllowScriptInterrupt | (int)JsRuntimeAttributeDisableBackgroundWork), nullptr, &this->runtimeHandle); if (!isRunning) { @@ -98,20 +96,26 @@ void ScriptInstance::runSync() { logF("Initial Script return: %S", returnString.c_str()); this->runPromises(); - while (this->isRunning && !g_Data.shouldTerminate()) { - Sleep(1); + while (this->isRunning && !GameData::shouldTerminate()) { + { + std::unique_lock lk(callbackMutex); + this->callbackWaiter.wait_for(lk, std::chrono::milliseconds(1)); - while (!this->callbackQueue.empty()) { - auto callb = this->callbackQueue.front(); - this->callbackQueue.pop(); - chakra.JsCallFunction_(callb, &global, 1, &result); + while (!this->callbackQueue.empty()) { + auto callb = this->callbackQueue.front(); + this->callbackQueue.pop(); + chakra.JsCallFunction_(callb, &global, 1, &result); + } } + this->callbacksExecuted.notify_all(); + this->runPromises(); } chakra.JsSetCurrentContext_(JS_INVALID_REFERENCE); chakra.JsDisposeRuntime_(this->runtimeHandle); this->runtimeHandle = JS_INVALID_RUNTIME_HANDLE; + this->isRunning = false; } void ScriptInstance::run() { diff --git a/Horion/Scripting/ScriptInstance.h b/Horion/Scripting/ScriptInstance.h index 0561ebe8..5400e13d 100644 --- a/Horion/Scripting/ScriptInstance.h +++ b/Horion/Scripting/ScriptInstance.h @@ -6,6 +6,7 @@ #include "../../Utils/Logger.h" #include "ScriptManager.h" #include +#include #include "JsScriptModule.h" class JsScriptModule; @@ -18,6 +19,9 @@ class ScriptInstance { std::thread scriptThread; std::queue taskQueue; std::queue callbackQueue; + std::mutex callbackMutex; + std::condition_variable callbacksExecuted; + std::condition_variable callbackWaiter; JsRuntimeHandle runtimeHandle = JS_INVALID_RUNTIME_HANDLE; void runPromises(); @@ -30,9 +34,23 @@ class ScriptInstance { } void callCallback(JsValueRef ref) { + if(!isRunning) + return; + std::lock_guard lock(callbackMutex); this->callbackQueue.push(ref); } + void callCallbackImmediate(JsValueRef ref) { + if(!isRunning) + return; + std::unique_lock lock(callbackMutex); + this->callbackQueue.push(ref); + this->callbackWaiter.notify_all(); + if(this->callbacksExecuted.wait_for(lock, std::chrono::milliseconds(20)) == std::cv_status::timeout){ + logF("Callback timeout!"); + } + } + void registerModule(std::shared_ptr jsMod) { this->registeredModules.push_back(jsMod); } diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 021411fb..5fb2c55b 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -57,6 +57,7 @@ void ScriptManager::prepareVector3Prototype(JsValueRef global, ContextObjects* o void ScriptManager::prepareEntityPrototype(JsValueRef proto, ContextObjects* objs) { chakra.defineFunction(proto, L"isValid", EntityFunctions::isValid, objs); chakra.defineFunction(proto, L"getPosition", EntityFunctions::getPosition, objs); + chakra.defineFunction(proto, L"getInterpolatedPosition", EntityFunctions::getInterpolatedPosition, objs); chakra.defineFunction(proto, L"getVelocity", EntityFunctions::getVelocity, objs); chakra.defineFunction(proto, L"isOnGround", EntityFunctions::isOnGround, objs); chakra.defineFunction(proto, L"getSize", EntityFunctions::getSize, objs); @@ -88,6 +89,7 @@ void ScriptManager::prepareGameFunctions(JsValueRef global, ContextObjects* objs } void ScriptManager::prepareHorionFunctions(JsValueRef global, ContextObjects* obj) { + this->prepareDrawFunctions(global, obj); this->prepareCommandManagerFunctions(global, obj); this->prepareModuleManagerFunctions(global, obj); @@ -98,6 +100,15 @@ void ScriptManager::prepareHorionFunctions(JsValueRef global, ContextObjects* ob chakra.defineFunction(horionObject, L"getCommandManager", HorionFunctions::getCommandManager, obj); chakra.defineFunction(horionObject, L"getModuleManager", HorionFunctions::getModuleManager, obj); + chakra.defineFunction(horionObject, L"getDrawUtils", HorionFunctions::getDrawUtils, obj); +} + +void ScriptManager::prepareDrawFunctions(JsValueRef global, ContextObjects* objs) { + chakra.JsCreateObject_(&objs->drawUtils); + chakra.JsAddRef_(objs->drawUtils, 0); + + chakra.defineFunction(objs->drawUtils, L"drawLine3d", DrawFunctions::drawLine3d, objs); + chakra.defineFunction(objs->drawUtils, L"setColor", DrawFunctions::setColor, objs); } void ScriptManager::prepareCommandManagerFunctions(JsValueRef global, ContextObjects* objs) { diff --git a/Horion/Scripting/ScriptManager.h b/Horion/Scripting/ScriptManager.h index 4b043976..31329908 100644 --- a/Horion/Scripting/ScriptManager.h +++ b/Horion/Scripting/ScriptManager.h @@ -72,6 +72,7 @@ extern ScriptManager scriptMgr; #include "Functions/CommandManagerFunctions.h" #include "Functions/ModuleManagerFunctions.h" #include "Functions/LevelFunctions.h" +#include "Functions/DrawFunctions.h" #include "ScriptInstance.h" @@ -85,6 +86,7 @@ struct ContextObjects { JsValueRef localPlayerPrototype = JS_INVALID_REFERENCE; JsValueRef moduleManager = JS_INVALID_REFERENCE; JsValueRef commandManager = JS_INVALID_REFERENCE; + JsValueRef drawUtils = JS_INVALID_REFERENCE; JsValueRef levelObject = JS_INVALID_REFERENCE; JsValueRef modulePrototype = JS_INVALID_REFERENCE; JsValueRef jsModulePrototype = JS_INVALID_REFERENCE; @@ -104,6 +106,7 @@ class ScriptManager { void prepareGameFunctions(JsValueRef global, ContextObjects* objs); void prepareHorionFunctions(JsValueRef global, ContextObjects* obj); + void prepareDrawFunctions(JsValueRef global, ContextObjects* obj); void prepareCommandManagerFunctions(JsValueRef global, ContextObjects* obj); void prepareModuleManagerFunctions(JsValueRef global, ContextObjects* obj); void prepareModuleFunctions(JsValueRef proto, ContextObjects* obj); diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index cdc32cd7..078c4abd 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -194,8 +194,7 @@ void GameData::forEachEntity(std::function callback) { #endif } else { size_t listSize = entList->getListSize(); - //logF("listSize: %li", listSize); - if (listSize < 5000 && listSize > 1) { + if (listSize < 5000 && listSize > 0) { for (size_t i = 0; i < listSize; i++) { C_Entity* current = entList->get(i); if (std::find(tickedEntities.begin(), tickedEntities.end(), current) == tickedEntities.end()) { From aaa2f910110d59b310dcd06b7577039ed2df9b10 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Mon, 20 Jul 2020 23:20:39 +0200 Subject: [PATCH 087/419] Linestrip3d --- Horion/Scripting/Functions/DrawFunctions.cpp | 41 +++++++ Horion/Scripting/Functions/DrawFunctions.h | 1 + .../Scripting/Functions/Vector3Functions.cpp | 112 ++++++++++++++++++ Horion/Scripting/Functions/Vector3Functions.h | 7 +- Horion/Scripting/ScriptInstance.cpp | 28 +++-- Horion/Scripting/ScriptInstance.h | 1 + Horion/Scripting/ScriptManager.cpp | 4 + Memory/Hooks.cpp | 3 +- Utils/ChakraHelper.h | 9 ++ 9 files changed, 192 insertions(+), 14 deletions(-) diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 1d3c5147..63625c79 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -17,6 +17,47 @@ JsValueRef CALLBACK DrawFunctions::drawLine3d(JsValueRef callee, bool isConstruc return chakra.trueValue(); } +JsValueRef CALLBACK DrawFunctions::drawLinestrip3d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + if (argumentCount < 2){ + THROW(L"Not enough arguments supplied"); + } + + auto arr = arguments[1]; + JsValueType type = JsUndefined; + chakra.JsGetValueType_(arr, &type); + if(type != JsArray){ + THROW(L"Array required as first argument"); + } + + JsValueRef lengthProp; + chakra.getProperty(arr, L"length", &lengthProp); + int arrayLength = -1; + chakra.JsNumberToInt_(lengthProp, &arrayLength); + + if(arrayLength < 2){ + THROW(L"Array needs at least 2 points"); + } + if(arrayLength > 100000){ + THROW(L"Array too big"); + } + + std::vector pointList; + pointList.reserve(arrayLength); + for(int i = 0; i < arrayLength; i++){ + auto val = chakra.arrayGet(arr, i); + auto valueOpt = Vector3Functions::getVecFromValue(val); + if(!valueOpt.has_value()){ + THROW(L"Points in array need to be of type \"Vec3\""); + } + + pointList.push_back(*valueOpt); + } + + DrawUtils::drawLinestrip3d(pointList); + + return chakra.trueValue(); +} + JsValueRef CALLBACK DrawFunctions::setColor(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { if (argumentCount < 4){ THROW(L"Invalid arguments (3 floats needed, 4th optional)!"); diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h index 51bc55dd..a5e131f9 100644 --- a/Horion/Scripting/Functions/DrawFunctions.h +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -6,4 +6,5 @@ class DrawFunctions { public: DECL_FUN(drawLine3d); DECL_FUN(setColor); + DECL_FUN(drawLinestrip3d); }; diff --git a/Horion/Scripting/Functions/Vector3Functions.cpp b/Horion/Scripting/Functions/Vector3Functions.cpp index ff0e99a2..7237878a 100644 --- a/Horion/Scripting/Functions/Vector3Functions.cpp +++ b/Horion/Scripting/Functions/Vector3Functions.cpp @@ -125,4 +125,116 @@ JsValueRef CALLBACK Vector3Functions::constructor(JsValueRef callee, bool isCons chakra.JsNumberToDouble_(arguments[3], &z); return scriptMgr.prepareVector3(vec3_t((float)x, (float)y, (float)z), reinterpret_cast(callbackState)); +} + +JsValueRef CALLBACK Vector3Functions::add(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch(argumentCount - 1){ + case 1: { + // either adding a Vec3 or a float to all 3 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if(type == JsNumber){ + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError){ + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector3(vecOpt->add((float)val), reinterpret_cast(callbackState)); + }else if(type == JsObject){ + auto oVec = Vector3Functions::getVecFromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector3(vecOpt->add(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 3: { + // adding with 3 individual floats + vec3_t oVec; + for(int i = 0; i < 3; i++){ + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if(type != JsNumber){ + THROW(L"Invalid argument supplied"); + } + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError){ + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector3(vecOpt->add(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} + +JsValueRef CALLBACK Vector3Functions::sub(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch(argumentCount - 1){ + case 1: { + // either subtracting a Vec3 or a float to all 3 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if(type == JsNumber){ + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError){ + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector3(vecOpt->sub((float)val), reinterpret_cast(callbackState)); + }else if(type == JsObject){ + auto oVec = Vector3Functions::getVecFromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector3(vecOpt->sub(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 3: { + // adding with 3 individual floats + vec3_t oVec; + for(int i = 0; i < 3; i++){ + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if(type != JsNumber){ + THROW(L"Invalid argument supplied"); + } + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError){ + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector3(vecOpt->sub(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/Vector3Functions.h b/Horion/Scripting/Functions/Vector3Functions.h index fb9b4636..6071d2ac 100644 --- a/Horion/Scripting/Functions/Vector3Functions.h +++ b/Horion/Scripting/Functions/Vector3Functions.h @@ -5,10 +5,8 @@ #include class Vector3Functions { -private: - static std::optional getVecFromValue(JsValueRef); - public: + static std::optional getVecFromValue(JsValueRef); static std::optional getVecFromArguments(JsValueRef*, int argCount, int* nextArg = nullptr); DECL_FUN(isValid); @@ -17,4 +15,7 @@ class Vector3Functions { DECL_FUN(getZ); DECL_FUN(toString); DECL_FUN(constructor); + + DECL_FUN(add); + DECL_FUN(sub); }; diff --git a/Horion/Scripting/ScriptInstance.cpp b/Horion/Scripting/ScriptInstance.cpp index b625df54..feda5693 100644 --- a/Horion/Scripting/ScriptInstance.cpp +++ b/Horion/Scripting/ScriptInstance.cpp @@ -45,6 +45,7 @@ void ScriptInstance::runPromises() { taskQueue.pop(); chakra.JsCallFunction_(task, &global, 1, &result); chakra.JsRelease_(task, nullptr); + this->checkPrintError(); } } @@ -77,19 +78,11 @@ void ScriptInstance::runSync() { auto err = chakra.JsRunScript_(contents.c_str(), JS_SOURCE_CONTEXT_NONE, L"", &result); std::wstring returnString = L"No result"; - bool hasException; - chakra.JsHasException_(&hasException); - if (err != JsNoError || hasException) { + if (err != JsNoError || this->checkPrintError()) { logF("Script run failed: %X", err); returnString = L"Error! " + std::to_wstring(err) + L", you can find a stack trace in the console"; - - if (hasException) { - JsValueRef exception; - chakra.JsGetAndClearException_(&exception); - logF("Exception: %S", chakra.exceptionToString(exception).c_str()); - } } returnString = chakra.valueToString(result); @@ -105,6 +98,7 @@ void ScriptInstance::runSync() { auto callb = this->callbackQueue.front(); this->callbackQueue.pop(); chakra.JsCallFunction_(callb, &global, 1, &result); + this->checkPrintError(); } } this->callbacksExecuted.notify_all(); @@ -130,3 +124,19 @@ void ScriptInstance::run() { logF("Script Execution finished"); }); } +bool ScriptInstance::checkPrintError() { + bool hasException; + chakra.JsHasException_(&hasException); + + if (hasException) { + JsValueRef exception; + chakra.JsGetAndClearException_(&exception); + auto exceptionStr = chakra.exceptionToString(exception); + logF("Exception: %S", exceptionStr.c_str()); + if(exceptionStr.size() > 70){ + logF("check the logfile for exceptions"); + } + } + + return hasException; +} diff --git a/Horion/Scripting/ScriptInstance.h b/Horion/Scripting/ScriptInstance.h index 5400e13d..749babfb 100644 --- a/Horion/Scripting/ScriptInstance.h +++ b/Horion/Scripting/ScriptInstance.h @@ -24,6 +24,7 @@ class ScriptInstance { std::condition_variable callbackWaiter; JsRuntimeHandle runtimeHandle = JS_INVALID_RUNTIME_HANDLE; void runPromises(); + bool checkPrintError(); public: ScriptInstance(std::wstring startScript); diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 5fb2c55b..7765011c 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -50,6 +50,9 @@ void ScriptManager::prepareVector3Prototype(JsValueRef global, ContextObjects* o chakra.defineFunction(obj->vec3Prototype, L"toString", Vector3Functions::toString, obj); + chakra.defineFunction(obj->vec3Prototype, L"add", Vector3Functions::add, obj); + chakra.defineFunction(obj->vec3Prototype, L"sub", Vector3Functions::sub, obj); + auto con = chakra.defineFunction(global, L"Vec3", Vector3Functions::constructor, obj); chakra.addPropertyToObj(con, L"prototype", obj->vec3Prototype); } @@ -108,6 +111,7 @@ void ScriptManager::prepareDrawFunctions(JsValueRef global, ContextObjects* objs chakra.JsAddRef_(objs->drawUtils, 0); chakra.defineFunction(objs->drawUtils, L"drawLine3d", DrawFunctions::drawLine3d, objs); + chakra.defineFunction(objs->drawUtils, L"drawLinestrip3d", DrawFunctions::drawLinestrip3d, objs); chakra.defineFunction(objs->drawUtils, L"setColor", DrawFunctions::setColor, objs); } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 60fdc9c7..fccc4632 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -166,12 +166,11 @@ void Hooks::Init() { auto swapChain = g_Data.getSlimMem()->ReadPtr<__int64>(startOffset, {0, secondOffset, 0x170}); auto vtable = *reinterpret_cast(swapChain); - logF(" %llX",vtable[8]); + //logF(" %llX",vtable[8]); g_Hooks.swapchain__presentHook = std::make_unique(vtable[8], Hooks::swapChain__present); g_Hooks.swapchain__resizeBuffersHook = std::make_unique(vtable[13], Hooks::swapChain__ResizeBuffers); } - } // Signatures diff --git a/Utils/ChakraHelper.h b/Utils/ChakraHelper.h index a828b126..1b253710 100644 --- a/Utils/ChakraHelper.h +++ b/Utils/ChakraHelper.h @@ -58,6 +58,8 @@ class ChakraApi { DECL_API(JsCreateArray); DECL_API(JsIntToNumber); DECL_API(JsSetIndexedProperty); + DECL_API(JsNumberToInt); + DECL_API(JsGetIndexedProperty); std::wstring exceptionToString(JsValueRef ref) { JsValueRef stack; @@ -250,6 +252,13 @@ class ChakraApi { return std::wstring(L"error2#") + std::to_wstring(err); } + JsValueRef arrayGet(JsValueRef arr, int index) { + JsValueRef indexNum, result; + this->JsIntToNumber_(index, &indexNum); + this->JsGetIndexedProperty_(arr, indexNum, &result); + return result; + } + void arraySet(JsValueRef arr, int index, JsValueRef value) { JsValueRef indexNum; this->JsIntToNumber_(index, &indexNum); From fcde620534f766d2374c5dc1a963b3d670a51f82 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 21 Jul 2020 22:36:26 +0200 Subject: [PATCH 088/419] Fix vs --- Horion.vcxproj | 3 +++ Horion/Scripting/Functions/DrawFunctions.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 198f3b6c..4209c7fb 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -363,6 +363,7 @@ + @@ -536,11 +537,13 @@ + + diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 63625c79..777a3e34 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -90,7 +90,7 @@ JsValueRef CALLBACK DrawFunctions::setColor(JsValueRef callee, bool isConstructC THROW(L"Invalid arguments (can't convert to double)"); } - DrawUtils::setColor(r, g, b, a); + DrawUtils::setColor((float)r, (float)g, (float)b, (float)a); return chakra.trueValue(); } \ No newline at end of file From f8296513ca06f40975a1157463ee1ea3eb4b2e6c Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 21 Jul 2020 23:00:10 +0200 Subject: [PATCH 089/419] Update to 1.16.10 --- Horion/DrawUtils.cpp | 4 ++-- Horion/Module/Modules/TestModule.cpp | 4 ++-- Horion/path/JoeMovementController.cpp | 2 +- Memory/GameData.cpp | 12 +++++++++--- Memory/GameData.h | 3 ++- Utils/Utils.cpp | 10 ++++------ 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index ba12f14b..d8002207 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -42,7 +42,7 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { ElapsedMicroseconds.QuadPart *= 1000000; int ticksPerSecond = 20; if(g_Data.getClientInstance()->minecraft) - ticksPerSecond = *g_Data.getClientInstance()->minecraft->timer; + ticksPerSecond = (int)*g_Data.getClientInstance()->minecraft->timer; if(ticksPerSecond < 1) ticksPerSecond = 1; ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / ticksPerSecond; @@ -467,7 +467,7 @@ void DrawUtils::setGameRenderContext(__int64 ctx) { ElapsedMicroseconds.QuadPart *= 1000000; int ticksPerSecond = 20; if(g_Data.getClientInstance()->minecraft) - ticksPerSecond = *g_Data.getClientInstance()->minecraft->timer; + ticksPerSecond = (int)*g_Data.getClientInstance()->minecraft->timer; if(ticksPerSecond < 1) ticksPerSecond = 1; ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / ticksPerSecond; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index fc781049..f845f2cb 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -59,8 +59,8 @@ void TestModule::onLevelRender() { vec3_t pos = start->lerp(end, te); auto yPos = pos.y; - yPos -= 1.62; - yPos += 0.9 + 0.9 * sin(((t + pos.x * 6 + pos.z * 5) / 60) * PI * 2); + yPos -= 1.62f; + yPos += 0.9f + 0.9f * sin(((t + pos.x * 6 + pos.z * 5) / 60) * PI * 2); std::vector posList; vec3_t lastPos(pos.x + sinf(0), yPos, pos.z + cosf(0)); diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index a8acb959..71716287 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -24,7 +24,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move if(!curSeg.isInValidPosition(playerNode)){ logF("invalid position %i %i %i, %i %i %i", curSeg.getSegmentType(), this->stateInfo.currentPathSegment, this->stateInfo.currentPathSegment > 0 ? this->currentPath->getSegment(this->stateInfo.currentPathSegment - 1).getSegmentType() : 0, playerNode.x, playerNode.y, playerNode.z); - this->stateInfo.currentPathSegment = this->currentPath->getNumSegments(); + this->stateInfo.currentPathSegment = (int)this->currentPath->getNumSegments(); this->stateInfo.recoverToStartPos = false; return; } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 078c4abd..eea94ee7 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -25,12 +25,18 @@ void GameData::retrieveClientInstance() { } void GameData::checkGameVersion() { - static uintptr_t sigOffset = 0x0; - if (sigOffset == 0x0) + static uintptr_t sigOffset = 0; + if (sigOffset == 0) sigOffset = FindSignature("48 8D 1D ?? ?? ?? ?? 8B 04 0A 39 05 ?? ?? ?? ?? 0F 8F ?? ?? ?? ?? 4C 8B CB 48 83 3D ?? ?? ?? ?? 10 4C 0F 43 0D ?? ?? ?? ??"); int offset = *reinterpret_cast((sigOffset + 3)); std::string ver = reinterpret_cast(sigOffset + offset + 7)->getText(); - int num = ver.back() - '0'; + auto lastDot = ver.find_last_of("."); + if (lastDot == std::string::npos || lastDot >= ver.size() - 1) { + this->version = static_cast(0); + return; + } + + int num = std::stoi(ver.substr(lastDot + 1)); this->version = static_cast(num); } diff --git a/Memory/GameData.h b/Memory/GameData.h index 9cf4b857..90e351d6 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -30,7 +30,8 @@ enum DATAPACKET_CMD : int { enum GAMEVERSION : int { g_1_16_0 = 0, - g_1_16_1 + g_1_16_1 = 1, + g_1_16_10 = 10 }; struct HorionDataPacket { diff --git a/Utils/Utils.cpp b/Utils/Utils.cpp index 4f10bb6a..4d5bb8b1 100644 --- a/Utils/Utils.cpp +++ b/Utils/Utils.cpp @@ -189,16 +189,14 @@ uintptr_t Utils::FindSignatureModule(const char* szModule, const char* szSignatu // This will not get optimized away because we are in debug // Leave this in here to quickly find bad signatures in case of updates logF("Signature dead: %s", szSignature); -#ifndef SIG_DEBUG - - const char* msgToTheOverwhelmedDebugger = "SIGNATURE NOT FOUND"; - __debugbreak(); + if (true) { + const char* msgToTheOverwhelmedDebugger = "SIGNATURE NOT FOUND"; + __debugbreak(); + } - //throw std::exception("Signature not found"); #ifdef __clang__ #pragma clang diagnostic pop #endif -#endif #endif return 0u; } From 77d4be2b0814af22410528786f7ef53e512ca954 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 23 Jul 2020 13:16:33 +0200 Subject: [PATCH 090/419] Very important changes to horion --- Horion/Loader.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 71b015fa..c4d6ecef 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -14,14 +14,14 @@ DWORD WINAPI keyThread(LPVOID lpParam) { logF("Key thread started"); bool* keyMap = static_cast(malloc(0xFF * 4 + 0x4)); - if (keyMap == 0) + if (keyMap == nullptr) throw std::exception("Keymap not allocated"); - uintptr_t clickMap = reinterpret_cast(malloc(5)); + auto clickMap = reinterpret_cast(malloc(5)); if (clickMap == 0) throw std::exception("Clickmap not allocated"); - bool* keyMapAddr = 0x0; + bool* keyMapAddr = nullptr; uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 89 1C 81 48"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code @@ -52,14 +52,14 @@ DWORD WINAPI keyThread(LPVOID lpParam) { } } - if (*hidController != 0) { + if (*hidController != nullptr) { for (uintptr_t key = 0; key < 5; key++) { bool newKey = (*hidController)->clickMap[key]; bool* oldKey = reinterpret_cast(clickMap + key); if (newKey != *oldKey) { ClickGui::onMouseClickUpdate((int)key, newKey); HImGui.onMouseClickUpdate((int)key, newKey); - if (newKey == true) { + if (newKey) { if ((int)key == 0) g_Data.leftclickCount++; else if ((int)key == 1) @@ -76,7 +76,7 @@ DWORD WINAPI keyThread(LPVOID lpParam) { Sleep(2); } logF("Stopping Threads..."); - g_Data.terminate(); + GameData::terminate(); Sleep(200); // Give the threads a bit of time to exit FreeLibraryAndExitThread(static_cast(lpParam), 1); // Uninject @@ -103,8 +103,8 @@ DWORD WINAPI injectorConnectionThread(LPVOID lpParam) { logF("Magic array at %llX", magicArray); - MemoryBoi** horionToInjectorPtr = reinterpret_cast(magicArray + sizeof(magicValues)); - MemoryBoi** injectorToHorionPtr = reinterpret_cast(magicArray + sizeof(magicValues) + sizeof(uintptr_t)); + auto** horionToInjectorPtr = reinterpret_cast(magicArray + sizeof(magicValues)); + auto** injectorToHorionPtr = reinterpret_cast(magicArray + sizeof(magicValues) + sizeof(uintptr_t)); *horionToInjectorPtr = new MemoryBoi(); MemoryBoi* horionToInjector = *horionToInjectorPtr; From 53f876962de107560f45beb463688238f10ac721 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 13 Aug 2020 16:34:32 -0400 Subject: [PATCH 091/419] fix client instance struct --- Memory/GameData.cpp | 5 +- Memory/Hooks.cpp | 8 +- SDK/CClientInstance.h | 3 +- .../cmakeFiles-v1-56979dbdf47060668f93.json" | 135 + .../codemodel-v2-71e38a9fd3c9e5e2a63f.json" | 59 + .../index-2020-08-12T21-43-03-0141.json" | 110 + ...et-Horion-Debug-25e771fe711f1c7111bc.json" | 2856 +++++++++++++++++ 7 files changed, 3169 insertions(+), 7 deletions(-) create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" create mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index eea94ee7..1da7fc84 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -9,7 +9,8 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; if (clientInstanceOffset == 0x0) { - uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); + //uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); + uintptr_t sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative @@ -17,7 +18,7 @@ void GameData::retrieveClientInstance() { } } - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x78, 0x160})); + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0,0x0, 0x380, 0x10})); #ifdef _DEBUG if (g_Data.clientInstance == 0) throw std::exception("Client Instance is 0"); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index fccc4632..33672869 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -197,8 +197,8 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - void* ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); - g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); + //void* ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); + //g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -283,10 +283,10 @@ void Hooks::Init() { void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 0F 29 70 ?? 48 8B 05")); else void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 98 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 10 48 89 78 18 0F 29 70 E8 48 8B 05 ? ? ? ? 48 33 C4")); - g_Hooks.prepFeaturedServersHook = std::make_unique(prepFeaturedServers, Hooks::prepFeaturedServers); + //g_Hooks.prepFeaturedServersHook = std::make_unique(prepFeaturedServers, Hooks::prepFeaturedServers); void* prepFeaturedServersFirstTime = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA")); - g_Hooks.prepFeaturedServersFirstTimeHook = std::make_unique(prepFeaturedServersFirstTime, Hooks::prepFeaturedServersFirstTime); + //g_Hooks.prepFeaturedServersFirstTimeHook = std::make_unique(prepFeaturedServersFirstTime, Hooks::prepFeaturedServersFirstTime); void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 2e04270f..84670390 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -52,7 +52,8 @@ struct C_FontRepository { class MinecraftGame { private: - char filler[0x140]; //0x0000 + //char filler[0x140]; //0x0000 + char filler[0x150]; //0x0000 public: C_FontRepository* fontRepository; //0x140 private: diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" new file mode 100644 index 00000000..5937ea54 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" @@ -0,0 +1,135 @@ +{ + "inputs" : + [ + { + "path" : "CMakeLists.txt" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-C.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-C.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" + }, + { + "isGenerated" : true, + "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-CXX.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-CXX.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" + }, + { + "isCMake" : true, + "isExternal" : true, + "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" + } + ], + "kind" : "cmakeFiles", + "paths" : + { + "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", + "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + }, + "version" : + { + "major" : 1, + "minor" : 0 + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" new file mode 100644 index 00000000..f5481f44 --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" @@ -0,0 +1,59 @@ +{ + "configurations" : + [ + { + "directories" : + [ + { + "build" : ".", + "minimumCMakeVersion" : + { + "string" : "3.12" + }, + "projectIndex" : 0, + "source" : ".", + "targetIndexes" : + [ + 0 + ] + } + ], + "name" : "Debug", + "projects" : + [ + { + "directoryIndexes" : + [ + 0 + ], + "name" : "Horion", + "targetIndexes" : + [ + 0 + ] + } + ], + "targets" : + [ + { + "directoryIndex" : 0, + "id" : "Horion::@6890427a1f51a3e7e1df", + "jsonFile" : "target-Horion-Debug-25e771fe711f1c7111bc.json", + "name" : "Horion", + "projectIndex" : 0 + } + ] + } + ], + "kind" : "codemodel", + "paths" : + { + "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", + "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" + }, + "version" : + { + "major" : 2, + "minor" : 0 + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" new file mode 100644 index 00000000..8de9537e --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" @@ -0,0 +1,110 @@ +{ + "cmake" : + { + "generator" : + { + "multiConfig" : false, + "name" : "Ninja" + }, + "paths" : + { + "cmake" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", + "cpack" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe", + "ctest" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe", + "root" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" + }, + "version" : + { + "isDirty" : false, + "major" : 3, + "minor" : 17, + "patch" : 20032601, + "string" : "3.17.20032601-MSVC_2", + "suffix" : "" + } + }, + "objects" : + [ + { + "jsonFile" : "codemodel-v2-71e38a9fd3c9e5e2a63f.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cmakeFiles-v1-56979dbdf47060668f93.json", + "kind" : "cmakeFiles", + "version" : + { + "major" : 1, + "minor" : 0 + } + } + ], + "reply" : + { + "client-MicrosoftVS" : + { + "query.json" : + { + "requests" : + [ + { + "kind" : "cache", + "version" : 2 + }, + { + "kind" : "cmakeFiles", + "version" : 1 + }, + { + "kind" : "codemodel", + "version" : 2 + } + ], + "responses" : + [ + { + "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cmakeFiles-v1-56979dbdf47060668f93.json", + "kind" : "cmakeFiles", + "version" : + { + "major" : 1, + "minor" : 0 + } + }, + { + "jsonFile" : "codemodel-v2-71e38a9fd3c9e5e2a63f.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + } + ] + } + } + } +} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" new file mode 100644 index 00000000..261866ee --- /dev/null +++ "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" @@ -0,0 +1,2856 @@ +{ + "artifacts" : + [ + { + "path" : "Horion.dll" + }, + { + "path" : "Horion.lib" + }, + { + "path" : "Horion.pdb" + } + ], + "backtrace" : 1, + "backtraceGraph" : + { + "commands" : + [ + "add_library", + "link_directories", + "add_compile_options", + "add_compile_definitions", + "include_directories" + ], + "files" : + [ + "CMakeLists.txt" + ], + "nodes" : + [ + { + "file" : 0 + }, + { + "command" : 0, + "file" : 0, + "line" : 24, + "parent" : 0 + }, + { + "command" : 1, + "file" : 0, + "line" : 22, + "parent" : 0 + }, + { + "command" : 2, + "file" : 0, + "line" : 9, + "parent" : 0 + }, + { + "command" : 3, + "file" : 0, + "line" : 12, + "parent" : 0 + }, + { + "command" : 4, + "file" : 0, + "line" : 19, + "parent" : 0 + }, + { + "command" : 4, + "file" : 0, + "line" : 20, + "parent" : 0 + } + ] + }, + "compileGroups" : + [ + { + "compileCommandFragments" : + [ + { + "fragment" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 " + }, + { + "backtrace" : 3, + "fragment" : "/MP" + }, + { + "backtrace" : 3, + "fragment" : "/Ob1" + }, + { + "fragment" : "-std:c++17" + } + ], + "defines" : + [ + { + "define" : "Horion_EXPORTS" + }, + { + "backtrace" : 4, + "define" : "WIN32_LEAN_AND_MEAN" + } + ], + "includes" : + [ + { + "backtrace" : 5, + "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/." + }, + { + "backtrace" : 6, + "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/include" + } + ], + "language" : "CXX", + "sourceIndexes" : + [ + 0, + 2, + 4, + 6, + 8, + 10, + 12, + 14, + 16, + 18, + 20, + 22, + 24, + 26, + 28, + 30, + 32, + 34, + 36, + 38, + 40, + 42, + 44, + 46, + 48, + 50, + 52, + 54, + 56, + 58, + 60, + 62, + 64, + 66, + 68, + 70, + 72, + 74, + 76, + 78, + 80, + 82, + 84, + 86, + 88, + 90, + 92, + 94, + 96, + 98, + 100, + 102, + 104, + 106, + 108, + 110, + 112, + 114, + 116, + 118, + 120, + 122, + 124, + 126, + 128, + 130, + 132, + 134, + 136, + 138, + 140, + 142, + 144, + 146, + 148, + 150, + 152, + 154, + 156, + 158, + 160, + 162, + 164, + 166, + 168, + 170, + 172, + 174, + 176, + 178, + 180, + 182, + 184, + 186, + 188, + 190, + 192, + 194, + 196, + 198, + 200, + 202, + 204, + 206, + 208, + 210, + 212, + 214, + 216, + 218, + 220, + 222, + 224, + 226, + 228, + 230, + 232, + 234, + 236, + 238, + 240, + 242, + 244, + 246, + 248, + 250, + 252, + 254, + 256, + 258, + 260, + 262, + 269, + 271, + 273, + 275, + 278, + 280, + 281, + 283, + 295, + 297, + 300, + 328, + 330, + 332, + 334, + 336, + 340, + 341, + 342, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 355, + 358, + 359, + 361, + 363, + 365, + 367, + 369, + 371, + 373, + 375, + 378, + 380, + 382, + 384, + 385, + 387 + ] + } + ], + "id" : "Horion::@6890427a1f51a3e7e1df", + "link" : + { + "commandFragments" : + [ + { + "fragment" : "/machine:x64 /debug /INCREMENTAL", + "role" : "flags" + }, + { + "backtrace" : 2, + "fragment" : "-LIBPATH:C:\\Users\\CELANI~1\\source\\repos\\RICHAR~1\\Horion\\minhook", + "role" : "libraryPath" + }, + { + "fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib", + "role" : "libraries" + } + ], + "language" : "CXX" + }, + "name" : "Horion", + "nameOnDisk" : "Horion.dll", + "paths" : + { + "build" : ".", + "source" : "." + }, + "sourceGroups" : + [ + { + "name" : "Source Files", + "sourceIndexes" : + [ + 0, + 2, + 4, + 6, + 8, + 10, + 12, + 14, + 16, + 18, + 20, + 22, + 24, + 26, + 28, + 30, + 32, + 34, + 36, + 38, + 40, + 42, + 44, + 46, + 48, + 50, + 52, + 54, + 56, + 58, + 60, + 62, + 64, + 66, + 68, + 70, + 72, + 74, + 76, + 78, + 80, + 82, + 84, + 86, + 88, + 90, + 92, + 94, + 96, + 98, + 100, + 102, + 104, + 106, + 108, + 110, + 112, + 114, + 116, + 118, + 120, + 122, + 124, + 126, + 128, + 130, + 132, + 134, + 136, + 138, + 140, + 142, + 144, + 146, + 148, + 150, + 152, + 154, + 156, + 158, + 160, + 162, + 164, + 166, + 168, + 170, + 172, + 174, + 176, + 178, + 180, + 182, + 184, + 186, + 188, + 190, + 192, + 194, + 196, + 198, + 200, + 202, + 204, + 206, + 208, + 210, + 212, + 214, + 216, + 218, + 220, + 222, + 224, + 226, + 228, + 230, + 232, + 234, + 236, + 238, + 240, + 242, + 244, + 246, + 248, + 250, + 252, + 254, + 256, + 258, + 260, + 262, + 269, + 271, + 273, + 275, + 278, + 280, + 281, + 283, + 295, + 297, + 300, + 328, + 330, + 332, + 334, + 336, + 340, + 341, + 342, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 355, + 358, + 359, + 361, + 363, + 365, + 367, + 369, + 371, + 373, + 375, + 378, + 380, + 382, + 384, + 385, + 387 + ] + }, + { + "name" : "Header Files", + "sourceIndexes" : + [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31, + 33, + 35, + 37, + 39, + 41, + 43, + 45, + 47, + 49, + 51, + 53, + 55, + 57, + 59, + 61, + 63, + 65, + 67, + 69, + 71, + 73, + 75, + 77, + 79, + 81, + 83, + 85, + 87, + 89, + 91, + 93, + 95, + 97, + 99, + 101, + 103, + 105, + 107, + 109, + 111, + 113, + 115, + 117, + 119, + 121, + 123, + 125, + 127, + 129, + 131, + 133, + 135, + 137, + 139, + 141, + 143, + 145, + 147, + 149, + 151, + 153, + 155, + 157, + 159, + 161, + 163, + 165, + 167, + 169, + 171, + 173, + 175, + 177, + 179, + 181, + 183, + 185, + 187, + 189, + 191, + 193, + 195, + 197, + 199, + 201, + 203, + 205, + 207, + 209, + 211, + 213, + 215, + 217, + 219, + 221, + 223, + 225, + 227, + 229, + 231, + 233, + 235, + 237, + 239, + 241, + 243, + 245, + 247, + 249, + 251, + 253, + 255, + 257, + 259, + 261, + 263, + 264, + 265, + 266, + 267, + 268, + 270, + 272, + 274, + 276, + 277, + 279, + 282, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 296, + 298, + 299, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 329, + 331, + 333, + 335, + 337, + 338, + 339, + 343, + 354, + 356, + 357, + 360, + 362, + 364, + 366, + 368, + 370, + 372, + 374, + 376, + 377, + 379, + 381, + 383, + 386, + 388 + ] + } + ], + "sources" : + [ + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/BindCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/BindCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/BruhCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/BruhCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/CommandBlockExploitCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/CommandBlockExploitCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ConfigCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ConfigCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/CoordsCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/CoordsCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/DamageCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/DamageCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/DupeCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/DupeCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/EjectCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/EjectCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/EnchantCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/EnchantCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ExecuteCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ExecuteCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/FriendListCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/FriendListCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/GameModeCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/GameModeCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/GiveCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/GiveCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/HelpCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/HelpCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/HideCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/HideCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ICommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ICommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ModulesCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ModulesCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/NameSpoofCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/NameSpoofCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/NbtCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/NbtCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PanicCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PanicCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PlayerTeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PlayerTeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/RelativeTeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/RelativeTeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SayCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SayCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ScriptCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ScriptCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ServerCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ServerCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/setoffhandCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/setoffhandCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SetprefixCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SetprefixCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/SpammerCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/SpammerCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/TeleportCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/TeleportCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/TestCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/TestCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/ToggleCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/ToggleCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/UnbindCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/UnbindCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/CommandMgr.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/CommandMgr.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Config/AccountInformation.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Config/AccountInformation.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Config/ConfigManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Config/ConfigManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/FriendList/FriendList.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/FriendList/FriendList.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Menu/ClickGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Menu/ClickGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Menu/TabGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Menu/TabGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Aimbot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Aimbot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirJump.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirJump.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirStuck.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirStuck.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AirSwim.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AirSwim.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiBot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiBot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiVoid.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiVoid.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoArmor.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoArmor.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoClicker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoClicker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoGapple.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoGapple.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoSneak.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoSneak.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoSprint.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoSprint.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AutoTotem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AutoTotem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Bhop.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Bhop.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Blink.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Blink.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/BowAimbot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/BowAimbot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestAura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestAura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestESP.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestESP.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ChestStealer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ChestStealer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ClickGuiMod.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ClickGuiMod.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Crasher.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Crasher.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Criticals.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Criticals.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/CrystalAura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/CrystalAura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/CubeGlide.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/CubeGlide.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Derp.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Derp.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/EditionFaker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/EditionFaker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/ESP.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/ESP.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FastEast.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FastEat.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FastLadder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FastLadder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Fly.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Fly.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Freecam.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Freecam.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Fucker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Fucker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FullBright.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FullBright.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Glide.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Glide.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Godmode.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Godmode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/HighJump.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/HighJump.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Hitbox.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Hitbox.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/HudModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/HudModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InfiniteBlockReach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InfiniteBlockReach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InfiniteReach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InfiniteReach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InstaBreak.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InstaBreak.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InventoryCleaner.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InventoryCleaner.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/InventoryMove.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/InventoryMove.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/JavascriptModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/JavascriptModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Jesus.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Jesus.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Jetpack.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Jetpack.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Killaura.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Killaura.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/MidClick.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/MidClick.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Module.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Module.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NameTags.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NameTags.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Nbt.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Nbt.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NightMode.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NightMode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoFall.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoFall.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoFriends.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoFriends.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoPacket.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoPacket.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoPaintingCrash.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoPaintingCrash.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoSlowDown.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoSlowDown.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoSwing.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoSwing.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoWeb.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoWeb.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Nuker.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Nuker.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/PacketLogger.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/PacketLogger.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Phase.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Phase.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/RainbowSky.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/RainbowSky.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Reach.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Reach.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Scaffold.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Scaffold.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Spammer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Spammer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Speed.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Speed.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/StackableItem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/StackableItem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Step.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Step.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Teams.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Teams.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Teleport.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Teleport.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/TestModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/TestModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Timer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Timer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Tower.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Tower.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Tracer.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Tracer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/TriggerBot.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/TriggerBot.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Velocity.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Velocity.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Xray.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Xray.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Zoom.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Zoom.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/ModuleManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/ModuleManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/CommandManagerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/CommandManagerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/EntityFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/EntityFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/GameFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/GameFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/GlobalFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/GlobalFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/HorionFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/HorionFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/Vector3Functions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/Vector3Functions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/JsScriptModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/JsScriptModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/ScriptInstance.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/ScriptInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/ScriptManager.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/ScriptManager.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/DrawUtils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/DrawUtils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/GuiUtils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/GuiUtils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/ImmediateGui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/ImmediateGui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Loader.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Loader.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCommon.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCommonWindows.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCore.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraCoreWindows.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/chakra/ChakraDebug.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/examples/imgui_impl_dx11.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/examples/imgui_impl_dx11.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/examples/imgui_impl_win32.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/examples/imgui_impl_win32.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/misc/cpp/imgui_stdlib.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/misc/cpp/imgui_stdlib.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/misc/fonts/binary_to_compressed_c.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/misc/single_file/imgui_single_file.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imconfig.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imgui.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_demo.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_draw.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imgui_internal.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "include/imgui/imgui_widgets.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_rectpack.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_textedit.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/imgui/imstb_truetype.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/atlrx.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11async.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11core.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/d3dx11effect.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/RegExp.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/StringProcess.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "include/WinHttpClient.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/GameData.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/GameData.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/Hooks.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/Hooks.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Memory/MinHook.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Memory/SlimMem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Memory/SlimMem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CBlockLegacy.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CChestBlockActor.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CClientInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CClientInstanceScreenModel.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CComplexInventoryTransaction.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CEntity.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CEntityList.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CGameMode.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CGameSettingsInput.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CHIDController.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CInventory.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CInventoryTransaction.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CItem.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CLoopbackPacketSender.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CMinecraftUIRenderContext.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CMoveInputHandler.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CPacket.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CRakNetInstance.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CUIScene.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/MojangsonToken.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/Tag.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/TextHolder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/ChakraHelper.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/DllHelper.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/HMath.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/Json.hpp", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Logger.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Logger.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/SkinUtil.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/SkinUtil.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Target.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Target.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/TextFormat.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/TextFormat.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Utils/Utils.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/Utils.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Utils/xorstr.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "resource.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/TextHolder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CChestBlockActor.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/Tag.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Utils/keys.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CBlockLegacy.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CItem.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CInventory.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CInventoryTransaction.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CEntity.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CComplexInventoryTransaction.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CPacket.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CMinecraftUIRenderContext.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CClientInstance.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CMoveInputHandler.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "SDK/CImageBuffer.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/Freelook.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/Freelook.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "SDK/CCamera.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "SDK/CCamera.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/NoHurtcam.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/NoHurtcam.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/AntiImmobile.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/AntiImmobile.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoePathFinder.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoePathFinder.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoePath.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoePath.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeSegment.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeSegment.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeMovementController.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeMovementController.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoal.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoal.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalXYZ.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalXYZ.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalXZ.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalXZ.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "Horion/path/JoeConstants.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/goals/JoeGoalY.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/path/goals/JoeGoalY.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Module/Modules/FollowPathModule.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Module/Modules/FollowPathModule.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Command/Commands/PathCommand.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Command/Commands/PathCommand.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/path/JoeConstants.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/LevelFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/LevelFunctions.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "Horion/Scripting/Functions/DrawFunctions.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "Horion/Scripting/Functions/DrawFunctions.h", + "sourceGroupIndex" : 1 + } + ], + "type" : "SHARED_LIBRARY" +} From 7868d134aad627f8f41a179db33026f0d361e15b Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Fri, 14 Aug 2020 16:42:15 -0400 Subject: [PATCH 092/419] yeet --- Horion/DrawUtils.cpp | 3 +++ Horion/Loader.cpp | 2 +- Memory/GameData.cpp | 13 ++++++++++--- Memory/GameData.h | 3 ++- Memory/Hooks.cpp | 16 +++++++++++++--- SDK/CClientInstance.h | 13 ++++++++++--- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index d8002207..d7c8bc4f 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -88,6 +88,9 @@ void DrawUtils::setColor(float r, float g, float b, float a) { } C_Font* DrawUtils::getFont(Fonts font) { + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + return g_Data.getClientInstance()->N0000080D->getOldFont(); switch (font) { case Fonts::SMOOTH: return g_Data.getClientInstance()->N0000080D->getTheGoodFontThankYou(); diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index c4d6ecef..6b479d61 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -340,8 +340,8 @@ DWORD WINAPI start(LPVOID lpParam) { gameModule = mem.GetModule(L"Minecraft.Windows.exe"); // Get Module for Base Address MH_Initialize(); - GameData::initGameData(gameModule, &mem, (HMODULE)lpParam); g_Data.checkGameVersion(); + GameData::initGameData(gameModule, &mem, (HMODULE)lpParam); Target::init(g_Data.getPtrLocalPlayer()); Hooks::Init(); diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 1da7fc84..cd932eb3 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -8,17 +8,24 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; + uintptr_t sigOffset = 0x0; if (clientInstanceOffset == 0x0) { - //uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); - uintptr_t sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); + + if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); + else + sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } } + if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x380, 0x10})); + else + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x78, 0x160})); - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0,0x0, 0x380, 0x10})); #ifdef _DEBUG if (g_Data.clientInstance == 0) throw std::exception("Client Instance is 0"); diff --git a/Memory/GameData.h b/Memory/GameData.h index 90e351d6..5fb45618 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -31,7 +31,8 @@ enum DATAPACKET_CMD : int { enum GAMEVERSION : int { g_1_16_0 = 0, g_1_16_1 = 1, - g_1_16_10 = 10 + g_1_16_10 = 10, + g_1_16_20 = 20 }; struct HorionDataPacket { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 33672869..cf0d55e5 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -197,8 +197,13 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - //void* ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); - //g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); + void* ChestTick = nullptr; + if(g_Data.getVersion() == GAMEVERSION::g_1_16_20) + ChestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0")); + else + ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); + + g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -348,7 +353,12 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - __int64 a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + __int64 a1 = 0; + if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + else + a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 84670390..79286ac1 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -52,10 +52,13 @@ struct C_FontRepository { class MinecraftGame { private: - //char filler[0x140]; //0x0000 - char filler[0x150]; //0x0000 + char filler[0x140]; //0x0000 public: - C_FontRepository* fontRepository; //0x140 + C_FontRepository* fontRepository; //0x140 +private: + char pad_0x148[0x8]; //0x148 +public: + C_FontRepository* fontRepository1; //0x150 private: char pad_0x128[0x108]; //0x148 public: @@ -65,6 +68,10 @@ class MinecraftGame { return fontRepository->fontList->fontEntries[7].font; }; + C_Font* getOldFont() { + return fontRepository1->fontList->fontEntries[7].font; + }; + C_Font* getTheBetterFontYes() { return fontRepository->fontList->fontEntries[0].font; } From 5fe55939689252590388c085ad389e4529240eeb Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 15 Aug 2020 13:04:33 -0400 Subject: [PATCH 093/419] fix tracer , enchant , autosneak & clickgui --- Horion/Command/Commands/EnchantCommand.cpp | 9 ++++++++- Horion/Command/Commands/TestCommand.cpp | 5 +++-- SDK/CClientInstance.h | 5 +++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index 448875b6..f97cd672 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -100,7 +100,14 @@ bool EnchantCommand::execute(std::vector* args) { static getEnchantsFromUserData_t getEnchantsFromUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 54 41 56 41 57 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 0F 29 70 C8 4C 8B E2 4C 8B F9 48 89 54 24 ?? 33 F6")); static addEnchant_t addEnchant = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 54 24 ?? 57 48 83 EC ?? 45 0F")); - static saveEnchantsToUserData_t saveEnchantsToUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 25")); + + static saveEnchantsToUserData_t saveEnchantsToUserData = 0x0; + if (!saveEnchantsToUserData) { + if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); + else + saveEnchantsToUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 25")); + } if (strcmp(args->at(1).c_str(), "all") == 0) { for (int i = 0; i < 38; i++) { diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index cdd4e696..ea435331 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -33,7 +33,8 @@ void showAimedBlockInfo() { bool TestCommand::execute(std::vector* args) { C_LocalPlayer* player = g_Data.getLocalPlayer(); - auto supplies = g_Data.getLocalPlayer()->getSupplies(); + g_Data.getClientInstance()->getLevel(); + /*auto supplies = g_Data.getLocalPlayer()->getSupplies(); auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); @@ -75,6 +76,6 @@ bool TestCommand::execute(std::vector* args) { pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); pk.numTransactions = 1; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully given item! %i", GREEN, numActions); + clientMessageF("%sSuccessfully given item! %i", GREEN, numActions);*/ return true; } diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 79286ac1..467c9557 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -416,10 +416,11 @@ class C_ClientInstance { virtual bool isPreGame(void) const; virtual bool isInMultiplayerGame(void) const; virtual bool isMultiC_PlayerClient(void) const; - + virtual __int64 sub_14012F590() const; + virtual __int64 sub_14012F4D0() const; virtual __int64 getOptions(void); virtual __int64 getOptions(void) const; - virtual __int64 getOptionsPtr(void); + //virtual __int64 getOptionsPtr(void); virtual __int64 getUser(void); virtual __int64 getUser(void) const; virtual __int64 getGameRenderer(void) const; From 17c3eadcb3de03d6fa0ec3a5fb467e76c10e816c Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 18 Aug 2020 11:05:03 +0200 Subject: [PATCH 094/419] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c949848c..29264590 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **Horion** is a minecraft bedrock edition utility mod designed to enhance a users gameplay. If you want to contribute to this project, feel free to fork this repository and submit a pull request. -[![Discord](https://img.shields.io/discord/669714521375375385?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/horion) +[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/gameing) [![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horionbeta.club/injector "Download the injector") ![](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) From f6fcf6b5655ed592693cd1fdc2bbd926d4058a14 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 18 Aug 2020 11:05:58 +0200 Subject: [PATCH 095/419] Delete FUNDING.yml --- .github/FUNDING.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1bd9ba6c..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: horion -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From bbdb7ab28c2b143bee95aeae312d57570ca1656a Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 26 Aug 2020 14:31:02 +0200 Subject: [PATCH 096/419] Add files via upload --- .github/horion-banner.png | Bin 0 -> 60253 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/horion-banner.png diff --git a/.github/horion-banner.png b/.github/horion-banner.png new file mode 100644 index 0000000000000000000000000000000000000000..4665b54a24be098093146847e75692b640bc8da7 GIT binary patch literal 60253 zcmX_nbyQUE_w^v%4I|yHlyoWG9fL^B&>$t^ZmVR zvG{|<-1|Hy_SyTKGvVs0a@ZJT7$6V`TR~o069htpfj|hZXehv6BG&ZNKp+~Bg7h10 zkF33HR1bsctA{SV$$xOY_m+p!0<=MKAan*i-MIpFwh$ewc>SUmMMV!yKP3&eE|Voc zCeRfnNm{>`{q(a=fC0+z8YMjG^*MtROe81cVUtBq8*M1%^M≫^C&}fvMx(MUIG% zOXsHHM7%>|Ak-xa`89R`EocXXg`$pmH{2}J(1Ha(H=;j8+=yXz5eJ!cuf0Jf6 z)18*asfAz?^I;TO9mzy2plF!)Chd^)=`(LXhJX_>ik6jtlic}DBHzghF zbP2t+W{gwvLpH$=W9NA^hm?YU$XwAdjw|{&L^v6Fclm1DCSo2m_RNt#fHlOAm*>Xo~7`G;It>9jnGZi!@}9T74x?vuHMOE{@&O^NY~n=H*f(+wV3u}KT6>^4}J#Ovrk2;CE_dk8M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F5b6vec2@5Z}ejGY=7#HLi6+Dc6Ht|n~#qs<{T`;<+k!Byj z!sHt`KM>TjL!iLz)${L#+yC$;H|lUyNTECDed#u%X&x=f#xbF^`9Fy1%!3f5pfPjE zY<+=}J|rW`eaHnL=)HRXweLa+Aq&E>H*3g`1zL*keFju&(f_5czvI82!%;300F(Mq y0Q?xi_P Date: Wed, 26 Aug 2020 14:34:18 +0200 Subject: [PATCH 097/419] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29264590..4f1b1df8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# Horion +

+ +

+
**Horion** is a minecraft bedrock edition utility mod designed to enhance a users gameplay. If you want to contribute to this project, feel free to fork this repository and submit a pull request. From daba1aa1c980b8dcb168dbc2ea0c28a805d2b819 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 30 Aug 2020 14:58:54 +0200 Subject: [PATCH 098/419] CC-BY-NC-ND 4.0 to CC-BY-NC 4.0 --- LICENSE | 63 ++++++++++++++++++++++++++++++------------------------- README.md | 22 +++++++------------ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/LICENSE b/LICENSE index 79a169d2..7a6572ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Attribution-NonCommercial-NoDerivatives 4.0 International +Attribution-NonCommercial 4.0 International ======================================================================= @@ -54,18 +54,18 @@ exhaustive, and do not form part of our licenses. ======================================================================= -Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 -International Public License +Creative Commons Attribution-NonCommercial 4.0 International Public +License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons -Attribution-NonCommercial-NoDerivatives 4.0 International Public -License ("Public License"). To the extent this Public License may be -interpreted as a contract, You are granted the Licensed Rights in -consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the -Licensor receives from making the Licensed Material available under -these terms and conditions. +Attribution-NonCommercial 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. Section 1 -- Definitions. @@ -80,37 +80,40 @@ Section 1 -- Definitions. Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. - b. Copyright and Similar Rights means copyright and/or similar rights + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - - c. Effective Technological Measures means those measures that, in the + d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. - d. Exceptions and Limitations means fair use, fair dealing, and/or + e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. - e. Licensed Material means the artistic or literary work, database, + f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. - f. Licensed Rights means the rights granted to You subject to the + g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. - g. Licensor means the individual(s) or entity(ies) granting rights + h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. - h. NonCommercial means not primarily intended for or directed towards + i. NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital @@ -118,7 +121,7 @@ Section 1 -- Definitions. no payment of monetary compensation in connection with the exchange. - i. Share means to provide material to the public by any means or + j. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material @@ -126,13 +129,13 @@ Section 1 -- Definitions. public may access the material from a place and at a time individually chosen by them. - j. Sui Generis Database Rights means rights other than copyright + k. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. - k. You means the individual or entity exercising the Licensed Rights + l. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. @@ -148,8 +151,8 @@ Section 2 -- Scope. a. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and - b. produce and reproduce, but not Share, Adapted Material - for NonCommercial purposes only. + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public @@ -223,7 +226,8 @@ following conditions. a. Attribution. - 1. If You Share the Licensed Material, You must: + 1. If You Share the Licensed Material (including in modified + form), You must: a. retain the following if it is supplied by the Licensor with the Licensed Material: @@ -251,9 +255,6 @@ following conditions. Public License, and include the text of, or the URI or hyperlink to, this Public License. - For the avoidance of doubt, You do not have permission under - this Public License to Share Adapted Material. - 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be @@ -265,6 +266,10 @@ following conditions. information required by Section 3(a)(1)(A) to the extent reasonably practicable. + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + Section 4 -- Sui Generis Database Rights. @@ -274,7 +279,7 @@ apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes - only and provided You do not Share Adapted Material; + only; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database @@ -399,4 +404,4 @@ understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. -Creative Commons may be contacted at creativecommons.org. +Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/README.md b/README.md index 4f1b1df8..4d9f99c0 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,15 @@


-**Horion** is a minecraft bedrock edition utility mod designed to enhance a users gameplay. +**Horion** is a minecraft bedrock edition utility mod designed to enhance a users gameplay. We do not take responsibility. If you want to contribute to this project, feel free to fork this repository and submit a pull request. +**As of 09/01/20, this project is under no active development by the horion team anymore. We will still review PRs.** -[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/gameing) +[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/pS3pKkQ) [![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horionbeta.club/injector "Download the injector") -![](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) +![Total Injections](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) -[![Codacy Badge](https://img.shields.io/codacy/grade/a8c1e0a4242d4da39762bc231c2c8c48?style=for-the-badge)](https://www.codacy.com/manual/horionclient/Horion) -[![License](https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/4.0/) - -## Installation -1. **Download the Injector** or directly download the `.dll` via the label: -[![Latest release](https://img.shields.io/github/v/release/Horionclient/Horion-Releases?include_prereleases&label=Download%20latest%20stable%20release&sort=semver&style=for-the-badge)](https://github.com/Horionclient/Horion-Releases/releases/latest/) - -2. **Launch the injector and press "Inject"** (If you chose to download the dll, put the dev mode switch on and locate the dll manually. Any other Injector may be used for this, too). - -3. In-Game, use the Tab-GUI or Click-GUI (opened by pressing *INSERT*) to navigate through all features. +[![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) ## Contributing To contribute, simply **fork the repository**, edit the things you want to and **submit a pull request**. @@ -29,4 +21,6 @@ More Information on setting everything up can be found in the **[wiki](https://g If you need any help with understanding our code, join the official discord server ## Licensing -This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +You are allowed to fork the project and distribute it, if you give credit. You may not sell any code protected by the license. +Not all source files are protected by this license - Some third party libraries (Chakra, DX11) may be under different copyright. From 5b1ce6ed183def6d38a233d09a9a2f7714758207 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 30 Aug 2020 15:09:18 +0200 Subject: [PATCH 099/419] remove out --- .gitignore | 1 + Horion.rc | 11 +- .../v1/query/client-MicrosoftVS/query.json" | 1 - .../reply/cache-v2-59a851a63745b66dac1c.json" | 1059 ------ .../cmakeFiles-v1-54d750433216a60118a8.json" | 683 ---- .../cmakeFiles-v1-56979dbdf47060668f93.json" | 135 - .../codemodel-v2-0964f0e9c718a0f18c42.json" | 59 - .../codemodel-v2-71e38a9fd3c9e5e2a63f.json" | 59 - .../index-2020-06-23T20-24-34-0413.json" | 110 - .../index-2020-08-12T21-43-03-0141.json" | 110 - ...et-Horion-Debug-25e771fe711f1c7111bc.json" | 2856 ----------------- ...et-Horion-Debug-6dc38c8b11e76065de59.json" | 2856 ----------------- .../CMakeCache.txt" | 332 -- .../CMakeCCompiler.cmake" | 76 - .../CMakeCXXCompiler.cmake" | 88 - .../CMakeDetermineCompilerABI_C.bin" | Bin 49152 -> 0 bytes .../CMakeDetermineCompilerABI_CXX.bin" | Bin 49152 -> 0 bytes .../CMakeRCCompiler.cmake" | 6 - .../3.17.20032601-MSVC_2/CMakeSystem.cmake" | 15 - .../CompilerIdC/CMakeCCompilerId.c" | 671 ---- .../CompilerIdC/CMakeCCompilerId.exe" | Bin 95232 -> 0 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp" | 660 ---- .../CompilerIdCXX/CMakeCXXCompilerId.exe" | Bin 95232 -> 0 bytes .../CMakeFiles/ShowIncludes/foo.h" | 1 - .../CMakeFiles/ShowIncludes/main.c" | 2 - .../CMakeFiles/TargetDirectories.txt" | 3 - .../CMakeFiles/cmake.check_cache" | 1 - .../VSInheritEnvironments.txt" | 1 - .../build.ninja" | 1741 ---------- .../cmake_install.cmake" | 44 - .../rules.ninja" | 71 - resources/cat.png | Bin 15241 -> 0 bytes 32 files changed, 2 insertions(+), 11650 deletions(-) delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.cpp" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/ShowIncludes/foo.h" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/ShowIncludes/main.c" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/TargetDirectories.txt" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/CMakeFiles/cmake.check_cache" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/VSInheritEnvironments.txt" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/build.ninja" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/cmake_install.cmake" delete mode 100644 "out/build/x64-Debug (par d\303\251faut)/rules.ninja" delete mode 100644 resources/cat.png diff --git a/.gitignore b/.gitignore index 8c222c7c..a0236611 100644 --- a/.gitignore +++ b/.gitignore @@ -332,3 +332,4 @@ ASALocalRun/ # CMake /out/build/x64-Debug +/out/build/x64-Debug (default) diff --git a/Horion.rc b/Horion.rc index bc7aebf4..b38bc5a5 100644 --- a/Horion.rc +++ b/Horion.rc @@ -61,16 +61,7 @@ IDR_TEXT1 TEXT "resources\\coolroblox.json" IDR_STEVE RCDATA "resources\\Steve.dat" -///////////////////////////////////////////////////////////////////////////// -// -// PNG -// - -IDB_CAT1 PNG "resources\\cat.png" - -#endif // Fran�ais (France) resources -///////////////////////////////////////////////////////////////////////////// - +#endif #ifndef APSTUDIO_INVOKED diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" deleted file mode 100644 index 308f68dd..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/query/client-MicrosoftVS/query.json" +++ /dev/null @@ -1 +0,0 @@ -{"requests":[{"kind":"cache","version":2},{"kind":"cmakeFiles","version":1},{"kind":"codemodel","version":2}]} \ No newline at end of file diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" deleted file mode 100644 index 86b06ea8..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cache-v2-59a851a63745b66dac1c.json" +++ /dev/null @@ -1,1059 +0,0 @@ -{ - "entries" : - [ - { - "name" : "CMAKE_BUILD_TYPE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ..." - } - ], - "type" : "STRING", - "value" : "Debug" - }, - { - "name" : "CMAKE_CACHEFILE_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "This is the directory where this CMakeCache.txt was created" - } - ], - "type" : "INTERNAL", - "value" : "c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)" - }, - { - "name" : "CMAKE_CACHE_MAJOR_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Major version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "3" - }, - { - "name" : "CMAKE_CACHE_MINOR_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Minor version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "17" - }, - { - "name" : "CMAKE_CACHE_PATCH_VERSION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Patch version of cmake used to create the current loaded cache" - } - ], - "type" : "INTERNAL", - "value" : "20032601" - }, - { - "name" : "CMAKE_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to CMake executable." - } - ], - "type" : "INTERNAL", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" - }, - { - "name" : "CMAKE_CPACK_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to cpack program executable." - } - ], - "type" : "INTERNAL", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe" - }, - { - "name" : "CMAKE_CTEST_COMMAND", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to ctest program executable." - } - ], - "type" : "INTERNAL", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe" - }, - { - "name" : "CMAKE_CXX_COMPILER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" - }, - { - "name" : "CMAKE_CXX_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during all build types." - } - ], - "type" : "STRING", - "value" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc" - }, - { - "name" : "CMAKE_CXX_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "/MDd /Zi /Ob0 /Od /RTC1" - }, - { - "name" : "CMAKE_CXX_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "/MD /O1 /Ob1 /DNDEBUG" - }, - { - "name" : "CMAKE_CXX_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "/MD /O2 /Ob2 /DNDEBUG" - }, - { - "name" : "CMAKE_CXX_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the CXX compiler during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "/MD /Zi /O2 /Ob1 /DNDEBUG" - }, - { - "name" : "CMAKE_CXX_STANDARD_LIBRARIES", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Libraries linked by default with all C++ applications." - } - ], - "type" : "STRING", - "value" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" - }, - { - "name" : "CMAKE_C_COMPILER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" - }, - { - "name" : "CMAKE_C_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during all build types." - } - ], - "type" : "STRING", - "value" : "/DWIN32 /D_WINDOWS /W3" - }, - { - "name" : "CMAKE_C_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "/MDd /Zi /Ob0 /Od /RTC1" - }, - { - "name" : "CMAKE_C_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "/MD /O1 /Ob1 /DNDEBUG" - }, - { - "name" : "CMAKE_C_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "/MD /O2 /Ob2 /DNDEBUG" - }, - { - "name" : "CMAKE_C_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the C compiler during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "/MD /Zi /O2 /Ob1 /DNDEBUG" - }, - { - "name" : "CMAKE_C_STANDARD_LIBRARIES", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Libraries linked by default with all C applications." - } - ], - "type" : "STRING", - "value" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" - }, - { - "name" : "CMAKE_EXECUTABLE_FORMAT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Executable file format" - } - ], - "type" : "INTERNAL", - "value" : "Unknown" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during all build types." - } - ], - "type" : "STRING", - "value" : "/machine:x64" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_EXPORT_COMPILE_COMMANDS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Enable/Disable output of compile commands during generation." - } - ], - "type" : "BOOL", - "value" : "" - }, - { - "name" : "CMAKE_EXTRA_GENERATOR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of external makefile project generator." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator." - } - ], - "type" : "INTERNAL", - "value" : "Ninja" - }, - { - "name" : "CMAKE_GENERATOR_INSTANCE", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Generator instance identifier." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR_PLATFORM", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator platform." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_GENERATOR_TOOLSET", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Name of generator toolset." - } - ], - "type" : "INTERNAL", - "value" : "" - }, - { - "name" : "CMAKE_HOME_DIRECTORY", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Source directory with the top level CMakeLists.txt file for this project" - } - ], - "type" : "INTERNAL", - "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - }, - { - "name" : "CMAKE_INSTALL_PREFIX", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "No help, variable specified on the command line." - } - ], - "type" : "PATH", - "value" : "C:/Users/Celanie Erwan/Source/Repos/richardletshacks/Horion/out/install/x64-Debug (par défaut)" - }, - { - "name" : "CMAKE_LINKER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe" - }, - { - "name" : "CMAKE_MAKE_PROGRAM", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "make program" - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during all build types." - } - ], - "type" : "STRING", - "value" : "/machine:x64" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of modules during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_MT", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Path to a program." - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe" - }, - { - "name" : "CMAKE_NUMBER_OF_MAKEFILES", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "number of local generators" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_PLATFORM_INFO_INITIALIZED", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Platform information initialized" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_PROJECT_DESCRIPTION", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "" - }, - { - "name" : "CMAKE_PROJECT_HOMEPAGE_URL", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "" - }, - { - "name" : "CMAKE_PROJECT_NAME", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "Horion" - }, - { - "name" : "CMAKE_RC_COMPILER", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "RC compiler" - } - ], - "type" : "FILEPATH", - "value" : "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe" - }, - { - "name" : "CMAKE_RC_COMPILER_WORKS", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "" - } - ], - "type" : "INTERNAL", - "value" : "1" - }, - { - "name" : "CMAKE_RC_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags for Windows Resource Compiler during all build types." - } - ], - "type" : "STRING", - "value" : "-DWIN32" - }, - { - "name" : "CMAKE_RC_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags for Windows Resource Compiler during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "-D_DEBUG" - }, - { - "name" : "CMAKE_RC_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags for Windows Resource Compiler during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_RC_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags for Windows Resource Compiler during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_RC_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags for Windows Resource Compiler during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_ROOT", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Path to CMake installation." - } - ], - "type" : "INTERNAL", - "value" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during all build types." - } - ], - "type" : "STRING", - "value" : "/machine:x64" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "/INCREMENTAL:NO" - }, - { - "name" : "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of shared libraries during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "/debug /INCREMENTAL" - }, - { - "name" : "CMAKE_SKIP_INSTALL_RPATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If set, runtime paths are not added when installing shared libraries, but are added when building." - } - ], - "type" : "BOOL", - "value" : "NO" - }, - { - "name" : "CMAKE_SKIP_RPATH", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If set, runtime paths are not added when using shared libraries." - } - ], - "type" : "BOOL", - "value" : "NO" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during all build types." - } - ], - "type" : "STRING", - "value" : "/machine:x64" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_DEBUG", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during DEBUG builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during MINSIZEREL builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_RELEASE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during RELEASE builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "Flags used by the linker during the creation of static libraries during RELWITHDEBINFO builds." - } - ], - "type" : "STRING", - "value" : "" - }, - { - "name" : "CMAKE_VERBOSE_MAKEFILE", - "properties" : - [ - { - "name" : "ADVANCED", - "value" : "1" - }, - { - "name" : "HELPSTRING", - "value" : "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo." - } - ], - "type" : "BOOL", - "value" : "FALSE" - }, - { - "name" : "Horion_BINARY_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)" - }, - { - "name" : "Horion_SOURCE_DIR", - "properties" : - [ - { - "name" : "HELPSTRING", - "value" : "Value Computed by CMake" - } - ], - "type" : "STATIC", - "value" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - } - ], - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" deleted file mode 100644 index caba3ba2..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-54d750433216a60118a8.json" +++ /dev/null @@ -1,683 +0,0 @@ -{ - "inputs" : - [ - { - "path" : "CMakeLists.txt" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineSystem.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystem.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCompilerIdDetection.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ADSP-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMCC-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMClang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/AppleClang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Borland-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Cray-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GHS-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GNU-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/HP-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IAR-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Intel-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PGI-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PathScale-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SCO-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TI-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Watcom-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XL-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/zOS-C-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeFindBinUtils.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompiler.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCXXCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-Determine-CXX.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCompilerIdDetection.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ADSP-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMCC-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/ARMClang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/AppleClang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Borland-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Cray-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GHS-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IAR-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Intel-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PGI-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/PathScale-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SCO-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/TI-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/Watcom-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeFindBinUtils.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompiler.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-C.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-C.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineRCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCCompiler.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestRCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerABI.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitIncludeInfo.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitLinkInfo.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompilerABI.c" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompileFeatures.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Internal/FeatureTesting.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCCompiler.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-CXX.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-CXX.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerABI.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitIncludeInfo.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeParseImplicitLinkInfo.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeDetermineCompileFeatures.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Internal/FeatureTesting.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXCompiler.cmake.in" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" - } - ], - "kind" : "cmakeFiles", - "paths" : - { - "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", - "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - }, - "version" : - { - "major" : 1, - "minor" : 0 - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" deleted file mode 100644 index 5937ea54..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/cmakeFiles-v1-56979dbdf47060668f93.json" +++ /dev/null @@ -1,135 +0,0 @@ -{ - "inputs" : - [ - { - "path" : "CMakeLists.txt" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-C.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-C.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" - }, - { - "isGenerated" : true, - "path" : "out/build/x64-Debug (par défaut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeRCInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/MSVC-CXX.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC-CXX.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/Platform/Windows-MSVC.cmake" - }, - { - "isCMake" : true, - "isExternal" : true, - "path" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" - } - ], - "kind" : "cmakeFiles", - "paths" : - { - "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", - "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - }, - "version" : - { - "major" : 1, - "minor" : 0 - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" deleted file mode 100644 index 7164311d..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-0964f0e9c718a0f18c42.json" +++ /dev/null @@ -1,59 +0,0 @@ -{ - "configurations" : - [ - { - "directories" : - [ - { - "build" : ".", - "minimumCMakeVersion" : - { - "string" : "3.12" - }, - "projectIndex" : 0, - "source" : ".", - "targetIndexes" : - [ - 0 - ] - } - ], - "name" : "Debug", - "projects" : - [ - { - "directoryIndexes" : - [ - 0 - ], - "name" : "Horion", - "targetIndexes" : - [ - 0 - ] - } - ], - "targets" : - [ - { - "directoryIndex" : 0, - "id" : "Horion::@6890427a1f51a3e7e1df", - "jsonFile" : "target-Horion-Debug-6dc38c8b11e76065de59.json", - "name" : "Horion", - "projectIndex" : 0 - } - ] - } - ], - "kind" : "codemodel", - "paths" : - { - "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", - "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - }, - "version" : - { - "major" : 2, - "minor" : 0 - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" deleted file mode 100644 index f5481f44..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/codemodel-v2-71e38a9fd3c9e5e2a63f.json" +++ /dev/null @@ -1,59 +0,0 @@ -{ - "configurations" : - [ - { - "directories" : - [ - { - "build" : ".", - "minimumCMakeVersion" : - { - "string" : "3.12" - }, - "projectIndex" : 0, - "source" : ".", - "targetIndexes" : - [ - 0 - ] - } - ], - "name" : "Debug", - "projects" : - [ - { - "directoryIndexes" : - [ - 0 - ], - "name" : "Horion", - "targetIndexes" : - [ - 0 - ] - } - ], - "targets" : - [ - { - "directoryIndex" : 0, - "id" : "Horion::@6890427a1f51a3e7e1df", - "jsonFile" : "target-Horion-Debug-25e771fe711f1c7111bc.json", - "name" : "Horion", - "projectIndex" : 0 - } - ] - } - ], - "kind" : "codemodel", - "paths" : - { - "build" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut)", - "source" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion" - }, - "version" : - { - "major" : 2, - "minor" : 0 - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" deleted file mode 100644 index 8f1006c8..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-06-23T20-24-34-0413.json" +++ /dev/null @@ -1,110 +0,0 @@ -{ - "cmake" : - { - "generator" : - { - "multiConfig" : false, - "name" : "Ninja" - }, - "paths" : - { - "cmake" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", - "cpack" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe", - "ctest" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe", - "root" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" - }, - "version" : - { - "isDirty" : false, - "major" : 3, - "minor" : 17, - "patch" : 20032601, - "string" : "3.17.20032601-MSVC_2", - "suffix" : "" - } - }, - "objects" : - [ - { - "jsonFile" : "codemodel-v2-0964f0e9c718a0f18c42.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cmakeFiles-v1-54d750433216a60118a8.json", - "kind" : "cmakeFiles", - "version" : - { - "major" : 1, - "minor" : 0 - } - } - ], - "reply" : - { - "client-MicrosoftVS" : - { - "query.json" : - { - "requests" : - [ - { - "kind" : "cache", - "version" : 2 - }, - { - "kind" : "cmakeFiles", - "version" : 1 - }, - { - "kind" : "codemodel", - "version" : 2 - } - ], - "responses" : - [ - { - "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cmakeFiles-v1-54d750433216a60118a8.json", - "kind" : "cmakeFiles", - "version" : - { - "major" : 1, - "minor" : 0 - } - }, - { - "jsonFile" : "codemodel-v2-0964f0e9c718a0f18c42.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - } - ] - } - } - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" deleted file mode 100644 index 8de9537e..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/index-2020-08-12T21-43-03-0141.json" +++ /dev/null @@ -1,110 +0,0 @@ -{ - "cmake" : - { - "generator" : - { - "multiConfig" : false, - "name" : "Ninja" - }, - "paths" : - { - "cmake" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", - "cpack" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe", - "ctest" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe", - "root" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17" - }, - "version" : - { - "isDirty" : false, - "major" : 3, - "minor" : 17, - "patch" : 20032601, - "string" : "3.17.20032601-MSVC_2", - "suffix" : "" - } - }, - "objects" : - [ - { - "jsonFile" : "codemodel-v2-71e38a9fd3c9e5e2a63f.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cmakeFiles-v1-56979dbdf47060668f93.json", - "kind" : "cmakeFiles", - "version" : - { - "major" : 1, - "minor" : 0 - } - } - ], - "reply" : - { - "client-MicrosoftVS" : - { - "query.json" : - { - "requests" : - [ - { - "kind" : "cache", - "version" : 2 - }, - { - "kind" : "cmakeFiles", - "version" : 1 - }, - { - "kind" : "codemodel", - "version" : 2 - } - ], - "responses" : - [ - { - "jsonFile" : "cache-v2-59a851a63745b66dac1c.json", - "kind" : "cache", - "version" : - { - "major" : 2, - "minor" : 0 - } - }, - { - "jsonFile" : "cmakeFiles-v1-56979dbdf47060668f93.json", - "kind" : "cmakeFiles", - "version" : - { - "major" : 1, - "minor" : 0 - } - }, - { - "jsonFile" : "codemodel-v2-71e38a9fd3c9e5e2a63f.json", - "kind" : "codemodel", - "version" : - { - "major" : 2, - "minor" : 0 - } - } - ] - } - } - } -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" deleted file mode 100644 index 261866ee..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-25e771fe711f1c7111bc.json" +++ /dev/null @@ -1,2856 +0,0 @@ -{ - "artifacts" : - [ - { - "path" : "Horion.dll" - }, - { - "path" : "Horion.lib" - }, - { - "path" : "Horion.pdb" - } - ], - "backtrace" : 1, - "backtraceGraph" : - { - "commands" : - [ - "add_library", - "link_directories", - "add_compile_options", - "add_compile_definitions", - "include_directories" - ], - "files" : - [ - "CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 0 - }, - { - "command" : 0, - "file" : 0, - "line" : 24, - "parent" : 0 - }, - { - "command" : 1, - "file" : 0, - "line" : 22, - "parent" : 0 - }, - { - "command" : 2, - "file" : 0, - "line" : 9, - "parent" : 0 - }, - { - "command" : 3, - "file" : 0, - "line" : 12, - "parent" : 0 - }, - { - "command" : 4, - "file" : 0, - "line" : 19, - "parent" : 0 - }, - { - "command" : 4, - "file" : 0, - "line" : 20, - "parent" : 0 - } - ] - }, - "compileGroups" : - [ - { - "compileCommandFragments" : - [ - { - "fragment" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 " - }, - { - "backtrace" : 3, - "fragment" : "/MP" - }, - { - "backtrace" : 3, - "fragment" : "/Ob1" - }, - { - "fragment" : "-std:c++17" - } - ], - "defines" : - [ - { - "define" : "Horion_EXPORTS" - }, - { - "backtrace" : 4, - "define" : "WIN32_LEAN_AND_MEAN" - } - ], - "includes" : - [ - { - "backtrace" : 5, - "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/." - }, - { - "backtrace" : 6, - "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/include" - } - ], - "language" : "CXX", - "sourceIndexes" : - [ - 0, - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36, - 38, - 40, - 42, - 44, - 46, - 48, - 50, - 52, - 54, - 56, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 72, - 74, - 76, - 78, - 80, - 82, - 84, - 86, - 88, - 90, - 92, - 94, - 96, - 98, - 100, - 102, - 104, - 106, - 108, - 110, - 112, - 114, - 116, - 118, - 120, - 122, - 124, - 126, - 128, - 130, - 132, - 134, - 136, - 138, - 140, - 142, - 144, - 146, - 148, - 150, - 152, - 154, - 156, - 158, - 160, - 162, - 164, - 166, - 168, - 170, - 172, - 174, - 176, - 178, - 180, - 182, - 184, - 186, - 188, - 190, - 192, - 194, - 196, - 198, - 200, - 202, - 204, - 206, - 208, - 210, - 212, - 214, - 216, - 218, - 220, - 222, - 224, - 226, - 228, - 230, - 232, - 234, - 236, - 238, - 240, - 242, - 244, - 246, - 248, - 250, - 252, - 254, - 256, - 258, - 260, - 262, - 269, - 271, - 273, - 275, - 278, - 280, - 281, - 283, - 295, - 297, - 300, - 328, - 330, - 332, - 334, - 336, - 340, - 341, - 342, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 355, - 358, - 359, - 361, - 363, - 365, - 367, - 369, - 371, - 373, - 375, - 378, - 380, - 382, - 384, - 385, - 387 - ] - } - ], - "id" : "Horion::@6890427a1f51a3e7e1df", - "link" : - { - "commandFragments" : - [ - { - "fragment" : "/machine:x64 /debug /INCREMENTAL", - "role" : "flags" - }, - { - "backtrace" : 2, - "fragment" : "-LIBPATH:C:\\Users\\CELANI~1\\source\\repos\\RICHAR~1\\Horion\\minhook", - "role" : "libraryPath" - }, - { - "fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib", - "role" : "libraries" - } - ], - "language" : "CXX" - }, - "name" : "Horion", - "nameOnDisk" : "Horion.dll", - "paths" : - { - "build" : ".", - "source" : "." - }, - "sourceGroups" : - [ - { - "name" : "Source Files", - "sourceIndexes" : - [ - 0, - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36, - 38, - 40, - 42, - 44, - 46, - 48, - 50, - 52, - 54, - 56, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 72, - 74, - 76, - 78, - 80, - 82, - 84, - 86, - 88, - 90, - 92, - 94, - 96, - 98, - 100, - 102, - 104, - 106, - 108, - 110, - 112, - 114, - 116, - 118, - 120, - 122, - 124, - 126, - 128, - 130, - 132, - 134, - 136, - 138, - 140, - 142, - 144, - 146, - 148, - 150, - 152, - 154, - 156, - 158, - 160, - 162, - 164, - 166, - 168, - 170, - 172, - 174, - 176, - 178, - 180, - 182, - 184, - 186, - 188, - 190, - 192, - 194, - 196, - 198, - 200, - 202, - 204, - 206, - 208, - 210, - 212, - 214, - 216, - 218, - 220, - 222, - 224, - 226, - 228, - 230, - 232, - 234, - 236, - 238, - 240, - 242, - 244, - 246, - 248, - 250, - 252, - 254, - 256, - 258, - 260, - 262, - 269, - 271, - 273, - 275, - 278, - 280, - 281, - 283, - 295, - 297, - 300, - 328, - 330, - 332, - 334, - 336, - 340, - 341, - 342, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 355, - 358, - 359, - 361, - 363, - 365, - 367, - 369, - 371, - 373, - 375, - 378, - 380, - 382, - 384, - 385, - 387 - ] - }, - { - "name" : "Header Files", - "sourceIndexes" : - [ - 1, - 3, - 5, - 7, - 9, - 11, - 13, - 15, - 17, - 19, - 21, - 23, - 25, - 27, - 29, - 31, - 33, - 35, - 37, - 39, - 41, - 43, - 45, - 47, - 49, - 51, - 53, - 55, - 57, - 59, - 61, - 63, - 65, - 67, - 69, - 71, - 73, - 75, - 77, - 79, - 81, - 83, - 85, - 87, - 89, - 91, - 93, - 95, - 97, - 99, - 101, - 103, - 105, - 107, - 109, - 111, - 113, - 115, - 117, - 119, - 121, - 123, - 125, - 127, - 129, - 131, - 133, - 135, - 137, - 139, - 141, - 143, - 145, - 147, - 149, - 151, - 153, - 155, - 157, - 159, - 161, - 163, - 165, - 167, - 169, - 171, - 173, - 175, - 177, - 179, - 181, - 183, - 185, - 187, - 189, - 191, - 193, - 195, - 197, - 199, - 201, - 203, - 205, - 207, - 209, - 211, - 213, - 215, - 217, - 219, - 221, - 223, - 225, - 227, - 229, - 231, - 233, - 235, - 237, - 239, - 241, - 243, - 245, - 247, - 249, - 251, - 253, - 255, - 257, - 259, - 261, - 263, - 264, - 265, - 266, - 267, - 268, - 270, - 272, - 274, - 276, - 277, - 279, - 282, - 284, - 285, - 286, - 287, - 288, - 289, - 290, - 291, - 292, - 293, - 294, - 296, - 298, - 299, - 301, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 329, - 331, - 333, - 335, - 337, - 338, - 339, - 343, - 354, - 356, - 357, - 360, - 362, - 364, - 366, - 368, - 370, - 372, - 374, - 376, - 377, - 379, - 381, - 383, - 386, - 388 - ] - } - ], - "sources" : - [ - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/BindCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/BindCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/BruhCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/BruhCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/CommandBlockExploitCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/CommandBlockExploitCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ConfigCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ConfigCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/CoordsCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/CoordsCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/DamageCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/DamageCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/DupeCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/DupeCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/EjectCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/EjectCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/EnchantCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/EnchantCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ExecuteCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ExecuteCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/FriendListCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/FriendListCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/GameModeCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/GameModeCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/GiveCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/GiveCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/HelpCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/HelpCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/HideCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/HideCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ICommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ICommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ModulesCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ModulesCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/NameSpoofCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/NameSpoofCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/NbtCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/NbtCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PanicCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PanicCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PlayerTeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PlayerTeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/RelativeTeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/RelativeTeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SayCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SayCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ScriptCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ScriptCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ServerCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ServerCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/setoffhandCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/setoffhandCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SetprefixCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SetprefixCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SpammerCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SpammerCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/TeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/TeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/TestCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/TestCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ToggleCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ToggleCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/UnbindCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/UnbindCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/CommandMgr.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/CommandMgr.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Config/AccountInformation.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Config/AccountInformation.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Config/ConfigManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Config/ConfigManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/FriendList/FriendList.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/FriendList/FriendList.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Menu/ClickGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Menu/ClickGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Menu/TabGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Menu/TabGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Aimbot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Aimbot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirJump.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirJump.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirStuck.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirStuck.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirSwim.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirSwim.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiBot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiBot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiVoid.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiVoid.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoArmor.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoArmor.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoClicker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoClicker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoGapple.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoGapple.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoSneak.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoSneak.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoSprint.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoSprint.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoTotem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoTotem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Bhop.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Bhop.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Blink.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Blink.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/BowAimbot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/BowAimbot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestAura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestAura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestESP.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestESP.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestStealer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestStealer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ClickGuiMod.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ClickGuiMod.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Crasher.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Crasher.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Criticals.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Criticals.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/CrystalAura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/CrystalAura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/CubeGlide.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/CubeGlide.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Derp.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Derp.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/EditionFaker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/EditionFaker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ESP.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ESP.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FastEast.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FastEat.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FastLadder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FastLadder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Fly.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Fly.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Freecam.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Freecam.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Fucker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Fucker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FullBright.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FullBright.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Glide.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Glide.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Godmode.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Godmode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/HighJump.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/HighJump.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Hitbox.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Hitbox.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/HudModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/HudModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InfiniteBlockReach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InfiniteBlockReach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InfiniteReach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InfiniteReach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InstaBreak.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InstaBreak.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InventoryCleaner.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InventoryCleaner.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InventoryMove.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InventoryMove.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/JavascriptModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/JavascriptModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Jesus.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Jesus.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Jetpack.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Jetpack.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Killaura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Killaura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/MidClick.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/MidClick.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Module.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Module.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NameTags.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NameTags.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Nbt.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Nbt.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NightMode.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NightMode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoFall.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoFall.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoFriends.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoFriends.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoPacket.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoPacket.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoPaintingCrash.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoPaintingCrash.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoSlowDown.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoSlowDown.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoSwing.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoSwing.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoWeb.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoWeb.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Nuker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Nuker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/PacketLogger.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/PacketLogger.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Phase.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Phase.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/RainbowSky.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/RainbowSky.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Reach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Reach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Scaffold.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Scaffold.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Spammer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Spammer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Speed.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Speed.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/StackableItem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/StackableItem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Step.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Step.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Teams.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Teams.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Teleport.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Teleport.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/TestModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/TestModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Timer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Timer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Tower.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Tower.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Tracer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Tracer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/TriggerBot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/TriggerBot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Velocity.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Velocity.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Xray.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Xray.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Zoom.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Zoom.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/ModuleManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/ModuleManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/CommandManagerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/CommandManagerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/EntityFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/EntityFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/GameFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/GameFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/GlobalFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/GlobalFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/HorionFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/HorionFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/Vector3Functions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/Vector3Functions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/JsScriptModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/JsScriptModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/ScriptInstance.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/ScriptInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/ScriptManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/ScriptManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/DrawUtils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/DrawUtils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/GuiUtils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/GuiUtils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/ImmediateGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/ImmediateGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Loader.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Loader.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCommon.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCommonWindows.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCore.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCoreWindows.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraDebug.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/examples/imgui_impl_dx11.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/examples/imgui_impl_dx11.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/examples/imgui_impl_win32.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/examples/imgui_impl_win32.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/misc/cpp/imgui_stdlib.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/misc/cpp/imgui_stdlib.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/misc/fonts/binary_to_compressed_c.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/misc/single_file/imgui_single_file.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imconfig.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imgui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_demo.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_draw.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imgui_internal.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_widgets.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_rectpack.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_textedit.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_truetype.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/atlrx.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11async.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11core.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11effect.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/RegExp.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/StringProcess.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/WinHttpClient.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/GameData.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/GameData.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/Hooks.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/Hooks.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Memory/MinHook.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/SlimMem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/SlimMem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CBlockLegacy.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CChestBlockActor.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CClientInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CClientInstanceScreenModel.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CComplexInventoryTransaction.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CEntity.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CEntityList.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CGameMode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CGameSettingsInput.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CHIDController.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CInventory.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CInventoryTransaction.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CItem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CLoopbackPacketSender.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CMinecraftUIRenderContext.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CMoveInputHandler.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CPacket.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CRakNetInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CUIScene.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/MojangsonToken.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/Tag.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/TextHolder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/ChakraHelper.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/DllHelper.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/HMath.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/Json.hpp", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Logger.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Logger.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/SkinUtil.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/SkinUtil.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Target.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Target.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/TextFormat.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/TextFormat.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Utils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Utils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/xorstr.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "resource.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/TextHolder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CChestBlockActor.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/Tag.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/keys.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CBlockLegacy.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CItem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CInventory.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CInventoryTransaction.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CEntity.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CComplexInventoryTransaction.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CPacket.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CMinecraftUIRenderContext.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CClientInstance.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CMoveInputHandler.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "SDK/CImageBuffer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Freelook.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Freelook.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CCamera.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CCamera.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoHurtcam.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoHurtcam.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiImmobile.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiImmobile.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoePathFinder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoePathFinder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoePath.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoePath.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeSegment.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeSegment.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeMovementController.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeMovementController.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoal.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoal.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalXYZ.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalXYZ.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalXZ.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalXZ.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeConstants.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalY.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalY.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FollowPathModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FollowPathModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PathCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PathCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeConstants.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/LevelFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/LevelFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/DrawFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/DrawFunctions.h", - "sourceGroupIndex" : 1 - } - ], - "type" : "SHARED_LIBRARY" -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" "b/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" deleted file mode 100644 index a576e4f5..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/.cmake/api/v1/reply/target-Horion-Debug-6dc38c8b11e76065de59.json" +++ /dev/null @@ -1,2856 +0,0 @@ -{ - "artifacts" : - [ - { - "path" : "Horion.dll" - }, - { - "path" : "Horion.lib" - }, - { - "path" : "Horion.pdb" - } - ], - "backtrace" : 1, - "backtraceGraph" : - { - "commands" : - [ - "add_library", - "link_directories", - "add_compile_options", - "add_compile_definitions", - "include_directories" - ], - "files" : - [ - "CMakeLists.txt" - ], - "nodes" : - [ - { - "file" : 0 - }, - { - "command" : 0, - "file" : 0, - "line" : 24, - "parent" : 0 - }, - { - "command" : 1, - "file" : 0, - "line" : 22, - "parent" : 0 - }, - { - "command" : 2, - "file" : 0, - "line" : 9, - "parent" : 0 - }, - { - "command" : 3, - "file" : 0, - "line" : 12, - "parent" : 0 - }, - { - "command" : 4, - "file" : 0, - "line" : 19, - "parent" : 0 - }, - { - "command" : 4, - "file" : 0, - "line" : 20, - "parent" : 0 - } - ] - }, - "compileGroups" : - [ - { - "compileCommandFragments" : - [ - { - "fragment" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 " - }, - { - "backtrace" : 3, - "fragment" : "/MP" - }, - { - "backtrace" : 3, - "fragment" : "/Ob1" - }, - { - "fragment" : "-std:c++17" - } - ], - "defines" : - [ - { - "define" : "Horion_EXPORTS" - }, - { - "backtrace" : 4, - "define" : "WIN32_LEAN_AND_MEAN" - } - ], - "includes" : - [ - { - "backtrace" : 5, - "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/." - }, - { - "backtrace" : 6, - "path" : "C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/include" - } - ], - "language" : "CXX", - "sourceIndexes" : - [ - 0, - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36, - 38, - 40, - 42, - 44, - 46, - 48, - 50, - 52, - 54, - 56, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 72, - 74, - 76, - 78, - 80, - 82, - 84, - 86, - 88, - 90, - 92, - 94, - 96, - 98, - 100, - 102, - 104, - 106, - 108, - 110, - 112, - 114, - 116, - 118, - 120, - 122, - 124, - 126, - 128, - 130, - 132, - 134, - 136, - 138, - 140, - 142, - 144, - 146, - 148, - 150, - 152, - 154, - 156, - 158, - 160, - 162, - 164, - 166, - 168, - 170, - 172, - 174, - 176, - 178, - 180, - 182, - 184, - 186, - 188, - 190, - 192, - 194, - 196, - 198, - 200, - 202, - 204, - 206, - 208, - 210, - 212, - 214, - 216, - 218, - 220, - 222, - 224, - 226, - 228, - 230, - 232, - 234, - 236, - 238, - 240, - 242, - 244, - 246, - 248, - 250, - 252, - 254, - 256, - 258, - 260, - 262, - 269, - 271, - 273, - 275, - 278, - 280, - 281, - 283, - 295, - 297, - 300, - 328, - 330, - 332, - 334, - 336, - 340, - 341, - 342, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 355, - 358, - 359, - 361, - 363, - 365, - 367, - 369, - 371, - 373, - 375, - 378, - 380, - 382, - 384, - 386, - 387 - ] - } - ], - "id" : "Horion::@6890427a1f51a3e7e1df", - "link" : - { - "commandFragments" : - [ - { - "fragment" : "/machine:x64 /debug /INCREMENTAL", - "role" : "flags" - }, - { - "backtrace" : 2, - "fragment" : "-LIBPATH:C:\\Users\\CELANI~1\\source\\repos\\RICHAR~1\\Horion\\minhook", - "role" : "libraryPath" - }, - { - "fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib", - "role" : "libraries" - } - ], - "language" : "CXX" - }, - "name" : "Horion", - "nameOnDisk" : "Horion.dll", - "paths" : - { - "build" : ".", - "source" : "." - }, - "sourceGroups" : - [ - { - "name" : "Source Files", - "sourceIndexes" : - [ - 0, - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36, - 38, - 40, - 42, - 44, - 46, - 48, - 50, - 52, - 54, - 56, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 72, - 74, - 76, - 78, - 80, - 82, - 84, - 86, - 88, - 90, - 92, - 94, - 96, - 98, - 100, - 102, - 104, - 106, - 108, - 110, - 112, - 114, - 116, - 118, - 120, - 122, - 124, - 126, - 128, - 130, - 132, - 134, - 136, - 138, - 140, - 142, - 144, - 146, - 148, - 150, - 152, - 154, - 156, - 158, - 160, - 162, - 164, - 166, - 168, - 170, - 172, - 174, - 176, - 178, - 180, - 182, - 184, - 186, - 188, - 190, - 192, - 194, - 196, - 198, - 200, - 202, - 204, - 206, - 208, - 210, - 212, - 214, - 216, - 218, - 220, - 222, - 224, - 226, - 228, - 230, - 232, - 234, - 236, - 238, - 240, - 242, - 244, - 246, - 248, - 250, - 252, - 254, - 256, - 258, - 260, - 262, - 269, - 271, - 273, - 275, - 278, - 280, - 281, - 283, - 295, - 297, - 300, - 328, - 330, - 332, - 334, - 336, - 340, - 341, - 342, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 355, - 358, - 359, - 361, - 363, - 365, - 367, - 369, - 371, - 373, - 375, - 378, - 380, - 382, - 384, - 386, - 387 - ] - }, - { - "name" : "Header Files", - "sourceIndexes" : - [ - 1, - 3, - 5, - 7, - 9, - 11, - 13, - 15, - 17, - 19, - 21, - 23, - 25, - 27, - 29, - 31, - 33, - 35, - 37, - 39, - 41, - 43, - 45, - 47, - 49, - 51, - 53, - 55, - 57, - 59, - 61, - 63, - 65, - 67, - 69, - 71, - 73, - 75, - 77, - 79, - 81, - 83, - 85, - 87, - 89, - 91, - 93, - 95, - 97, - 99, - 101, - 103, - 105, - 107, - 109, - 111, - 113, - 115, - 117, - 119, - 121, - 123, - 125, - 127, - 129, - 131, - 133, - 135, - 137, - 139, - 141, - 143, - 145, - 147, - 149, - 151, - 153, - 155, - 157, - 159, - 161, - 163, - 165, - 167, - 169, - 171, - 173, - 175, - 177, - 179, - 181, - 183, - 185, - 187, - 189, - 191, - 193, - 195, - 197, - 199, - 201, - 203, - 205, - 207, - 209, - 211, - 213, - 215, - 217, - 219, - 221, - 223, - 225, - 227, - 229, - 231, - 233, - 235, - 237, - 239, - 241, - 243, - 245, - 247, - 249, - 251, - 253, - 255, - 257, - 259, - 261, - 263, - 264, - 265, - 266, - 267, - 268, - 270, - 272, - 274, - 276, - 277, - 279, - 282, - 284, - 285, - 286, - 287, - 288, - 289, - 290, - 291, - 292, - 293, - 294, - 296, - 298, - 299, - 301, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 329, - 331, - 333, - 335, - 337, - 338, - 339, - 343, - 354, - 356, - 357, - 360, - 362, - 364, - 366, - 368, - 370, - 372, - 374, - 376, - 377, - 379, - 381, - 383, - 385, - 388 - ] - } - ], - "sources" : - [ - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/BindCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/BindCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/BruhCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/BruhCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/CommandBlockExploitCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/CommandBlockExploitCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ConfigCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ConfigCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/CoordsCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/CoordsCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/DamageCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/DamageCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/DupeCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/DupeCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/EjectCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/EjectCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/EnchantCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/EnchantCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ExecuteCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ExecuteCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/FriendListCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/FriendListCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/GameModeCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/GameModeCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/GiveCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/GiveCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/HelpCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/HelpCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/HideCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/HideCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ICommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ICommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ModulesCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ModulesCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/NameSpoofCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/NameSpoofCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/NbtCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/NbtCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PanicCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PanicCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PlayerTeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PlayerTeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/RelativeTeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/RelativeTeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SayCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SayCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ScriptCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ScriptCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ServerCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ServerCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/setoffhandCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/setoffhandCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SetprefixCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SetprefixCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/SpammerCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/SpammerCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/TeleportCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/TeleportCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/TestCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/TestCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/ToggleCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/ToggleCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/UnbindCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/UnbindCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/CommandMgr.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/CommandMgr.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Config/AccountInformation.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Config/AccountInformation.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Config/ConfigManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Config/ConfigManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/FriendList/FriendList.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/FriendList/FriendList.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Menu/ClickGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Menu/ClickGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Menu/TabGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Menu/TabGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Aimbot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Aimbot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirJump.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirJump.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirStuck.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirStuck.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AirSwim.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AirSwim.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiBot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiBot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiVoid.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiVoid.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoArmor.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoArmor.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoClicker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoClicker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoGapple.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoGapple.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoSneak.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoSneak.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoSprint.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoSprint.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AutoTotem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AutoTotem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Bhop.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Bhop.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Blink.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Blink.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/BowAimbot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/BowAimbot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestAura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestAura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestESP.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestESP.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ChestStealer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ChestStealer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ClickGuiMod.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ClickGuiMod.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Crasher.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Crasher.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Criticals.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Criticals.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/CrystalAura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/CrystalAura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/CubeGlide.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/CubeGlide.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Derp.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Derp.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/EditionFaker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/EditionFaker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ESP.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ESP.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FastEast.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FastEat.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FastLadder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FastLadder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Fly.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Fly.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/ForceOpenCommandBlock.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/ForceOpenCommandBlock.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Freecam.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Freecam.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Fucker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Fucker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FullBright.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FullBright.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Glide.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Glide.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Godmode.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Godmode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/HighJump.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/HighJump.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Hitbox.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Hitbox.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/HudModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/HudModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InfiniteBlockReach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InfiniteBlockReach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InfiniteReach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InfiniteReach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InstaBreak.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InstaBreak.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InventoryCleaner.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InventoryCleaner.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/InventoryMove.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/InventoryMove.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/JavascriptModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/JavascriptModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Jesus.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Jesus.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Jetpack.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Jetpack.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Killaura.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Killaura.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/MidClick.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/MidClick.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Module.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Module.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NameTags.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NameTags.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Nbt.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Nbt.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NightMode.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NightMode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoFall.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoFall.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoFriends.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoFriends.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoPacket.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoPacket.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoSlowDown.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoSlowDown.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoSwing.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoSwing.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoWeb.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoWeb.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Nuker.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Nuker.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/PacketLogger.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/PacketLogger.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Phase.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Phase.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/RainbowSky.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/RainbowSky.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Reach.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Reach.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Scaffold.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Scaffold.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Spammer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Spammer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Speed.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Speed.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/StackableItem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/StackableItem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Step.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Step.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Teams.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Teams.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Teleport.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Teleport.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/TestModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/TestModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Timer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Timer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Tower.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Tower.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Tracer.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Tracer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/TriggerBot.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/TriggerBot.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Velocity.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Velocity.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Xray.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Xray.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Zoom.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Zoom.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/ModuleManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/ModuleManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/CommandManagerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/CommandManagerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/EntityFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/EntityFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/GameFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/GameFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/GlobalFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/GlobalFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/HorionFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/HorionFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/LocalPlayerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/ModuleManagerFunctions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/Vector3Functions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/Vector3Functions.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/JsScriptModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/JsScriptModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/ScriptInstance.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/ScriptInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/ScriptManager.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/ScriptManager.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/DrawUtils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/DrawUtils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/GuiUtils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/GuiUtils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/ImmediateGui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/ImmediateGui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Loader.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Loader.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCommon.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCommonWindows.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCore.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraCoreWindows.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/chakra/ChakraDebug.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/examples/imgui_impl_dx11.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/examples/imgui_impl_dx11.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/examples/imgui_impl_win32.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/examples/imgui_impl_win32.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/misc/cpp/imgui_stdlib.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/misc/cpp/imgui_stdlib.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/misc/fonts/binary_to_compressed_c.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/misc/single_file/imgui_single_file.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imconfig.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imgui.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_demo.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_draw.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imgui_internal.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "include/imgui/imgui_widgets.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_rectpack.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_textedit.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/imgui/imstb_truetype.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/atlrx.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11async.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11core.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/d3dx11effect.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/RegExp.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/StringProcess.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "include/WinHttpClient.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/GameData.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/GameData.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/Hooks.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/Hooks.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Memory/MinHook.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Memory/SlimMem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Memory/SlimMem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CBlockLegacy.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CChestBlockActor.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CClientInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CClientInstanceScreenModel.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CComplexInventoryTransaction.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CEntity.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CEntityList.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CGameMode.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CGameSettingsInput.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CHIDController.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CInventory.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CInventoryTransaction.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CItem.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CLoopbackPacketSender.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CMinecraftUIRenderContext.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CMoveInputHandler.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CPacket.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CRakNetInstance.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CUIScene.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/MojangsonToken.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/Tag.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/TextHolder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/ChakraHelper.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/DllHelper.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/HMath.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/Json.hpp", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Logger.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Logger.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/SkinUtil.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/SkinUtil.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Target.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Target.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/TextFormat.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/TextFormat.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Utils/Utils.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/Utils.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Utils/xorstr.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "resource.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/TextHolder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CChestBlockActor.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/Tag.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Utils/keys.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CBlockLegacy.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CItem.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CInventory.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CInventoryTransaction.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CEntity.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CComplexInventoryTransaction.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CPacket.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CMinecraftUIRenderContext.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CClientInstance.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CMoveInputHandler.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "SDK/CImageBuffer.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/Freelook.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/Freelook.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "SDK/CCamera.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "SDK/CCamera.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/NoHurtcam.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/NoHurtcam.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/AntiImmobile.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/AntiImmobile.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoePathFinder.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoePathFinder.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoePath.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoePath.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeSegment.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeSegment.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeMovementController.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeMovementController.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoal.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoal.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalXYZ.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalXYZ.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalXZ.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalXZ.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeConstants.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/goals/JoeGoalY.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/goals/JoeGoalY.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Module/Modules/FollowPathModule.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Module/Modules/FollowPathModule.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Command/Commands/PathCommand.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Command/Commands/PathCommand.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeIncompletePath.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/path/JoeIncompletePath.h", - "sourceGroupIndex" : 1 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/path/JoeConstants.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "compileGroupIndex" : 0, - "path" : "Horion/Scripting/Functions/LevelFunctions.cpp", - "sourceGroupIndex" : 0 - }, - { - "backtrace" : 1, - "path" : "Horion/Scripting/Functions/LevelFunctions.h", - "sourceGroupIndex" : 1 - } - ], - "type" : "SHARED_LIBRARY" -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" "b/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" deleted file mode 100644 index 2b19a9b2..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeCache.txt" +++ /dev/null @@ -1,332 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) -# It was generated by CMake: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING=Debug - -//No help, variable specified on the command line. -CMAKE_CXX_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1 - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG - -//Libraries linked by default with all C++ applications. -CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib - -//No help, variable specified on the command line. -CMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1 - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG - -//Libraries linked by default with all C applications. -CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= - -//No help, variable specified on the command line. -CMAKE_INSTALL_PREFIX:PATH=C:/Users/Celanie Erwan/Source/Repos/richardletshacks/Horion/out/install/x64-Debug (par défaut) - -//Path to a program. -CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe - -//make program -CMAKE_MAKE_PROGRAM:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64 - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL - -//Path to a program. -CMAKE_MT:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=Horion - -//RC compiler -CMAKE_RC_COMPILER:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe - -//Flags for Windows Resource Compiler during all build types. -CMAKE_RC_FLAGS:STRING=-DWIN32 - -//Flags for Windows Resource Compiler during DEBUG builds. -CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG - -//Flags for Windows Resource Compiler during MINSIZEREL builds. -CMAKE_RC_FLAGS_MINSIZEREL:STRING= - -//Flags for Windows Resource Compiler during RELEASE builds. -CMAKE_RC_FLAGS_RELEASE:STRING= - -//Flags for Windows Resource Compiler during RELWITHDEBINFO builds. -CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING= - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64 - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64 - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -Horion_BINARY_DIR:STATIC=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) - -//Value Computed by CMake -Horion_SOURCE_DIR:STATIC=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion - - -######################## -# INTERNAL cache entries -######################## - -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Celanie Erwan/source/repos/richardletshacks/Horion/out/build/x64-Debug (par défaut) -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=17 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=20032601 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES -CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES -CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Ninja -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Celanie Erwan/source/repos/richardletshacks/Horion -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MT -CMAKE_MT-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_COMPILER -CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 -CMAKE_RC_COMPILER_WORKS:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_FLAGS -CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_FLAGS_DEBUG -CMAKE_RC_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_FLAGS_MINSIZEREL -CMAKE_RC_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_FLAGS_RELEASE -CMAKE_RC_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RC_FLAGS_RELWITHDEBINFO -CMAKE_RC_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" deleted file mode 100644 index 8c3ee39c..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCCompiler.cmake" +++ /dev/null @@ -1,76 +0,0 @@ -set(CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "MSVC") -set(CMAKE_C_COMPILER_VERSION "19.26.28806.0") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "90") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_std_99;c_std_11;c_function_prototypes;c_variadic_macros") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11") - -set(CMAKE_C_PLATFORM_ID "Windows") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_C_SIMULATE_VERSION "") -set(CMAKE_C_COMPILER_ARCHITECTURE_ID x64) -set(MSVC_C_ARCHITECTURE_ID x64) - -set(CMAKE_AR "") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe") -set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "Remarque : inclusion du fichier : ") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" deleted file mode 100644 index 44a3413d..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeCXXCompiler.cmake" +++ /dev/null @@ -1,88 +0,0 @@ -set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "MSVC") -set(CMAKE_CXX_COMPILER_VERSION "19.26.28806.0") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") - -set(CMAKE_CXX_PLATFORM_ID "Windows") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_CXX_SIMULATE_VERSION "") -set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID x64) -set(MSVC_CXX_ARCHITECTURE_ID x64) - -set(CMAKE_AR "") -set(CMAKE_CXX_COMPILER_AR "") -set(CMAKE_RANLIB "") -set(CMAKE_CXX_COMPILER_RANLIB "") -set(CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/link.exe") -set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/mt.exe") -set(CMAKE_COMPILER_IS_GNUCXX ) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "Remarque : inclusion du fichier : ") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_C.bin" deleted file mode 100644 index 90bae4ebc43215cd8b92f19e363f2b0d21e6412b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49152 zcmeHQ3w%_?)t^mvlMoU%0@2{}5*Ll~S_#+)1b0b7Z*+s(5FXaZX4&14Et}nS9}q09 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i6}fEP(6$GryU+<*Lxbg;PEDds7O4a$XZ*E z>y-F&-jFotaF8S}oP+ywkn2uJtknG(QcCS@DUOh5IR+O!kJN=cPPc?uV8zh{+$3sIr8>I&2=GVL0mUmBCp01e^3E;SROJJ)C< zK_az8yC28ipgwzC(TK+}pwceL1q)K-WgS}1aZS|gTA_55U2Y&{di@|`lMJwGS8%l> zjPn^!J0p~?qj8S7y#Wj@g!emEhH+)qAE`y*?WvAc^|%EQgaHt38}i{GF1e}*w_%kl ztn!RPnq^L0=;an@*YitXc25X5$?Khdm!||5#UTwlI|W8xqD&}zDB!}?zH&FqPrz33 zF#(btA?$+H7^!-?8fgvFG@%sprIz=Z+X5TLQp7N_XZ4j4Ux_mqfqj;!bMg0tvjqYx zqQQCUjq5UhB($2bSE*!?Hx$9W-G%;DUO!q~n_3>`_d=F?LUy_l3Dfn zj_H8FW7Z*f{4r`KqAaM>u^$mp@^f4by#3g3W?$M+kFUPrGAS;H7Uy3y#hfpA{P>Oz zzO+-Ezp!fFBHWuIDfS#oPX(@?9AEDaM)A73}4a$1An+UKN|AS47=() z_=?fwdM|y$D^MGmj1ARHXSjaK%8T;xg(bhY76*$(iLHT^Ak2=0qTvW_4^EIi znqlkm`&R~5 zctZI?)N6Io-mEyk*69m-^5@K++Q)lf?g!hLvr*V+-e>`B^7H>k1OEe583}^` diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeDetermineCompilerABI_CXX.bin" deleted file mode 100644 index 83a03a5779fefc4ecc541088cd1029a157da4a19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49152 zcmeHQ3w%_?)t^mvlMoU%0@2{}5*LjkuoBP+M0X*fH@eYn2oGyyv+UlGEt}nS9}q14 zObAiZ>ss2{{?yu*THjE`7X)lI0ZKqo5w&7pMyu_Op^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Y_JbZGEmtsh^uzK@lE(VP90Ga#e$HLT@HxDLpB z2)F}(?x*_;&5iE#^nu4)45A|Ov?^;| z1Floz&v`@Akjq7qcyJEx&q1y`A+cKbXGp2FH>bJ6(ozgAdLFG0OKz`=UzH>^xNsE* zEx70|?Gjuaz*$J|vr5V-CHAZ;K|osJ;zCrat$KnDs!ZDl=$FPMJU~OZuS?BD>CQFU zNRmh^(eKBxH>uB(Cl-}l11fEYT(BTjUe>AST-U^Wo@HuB*<~hDrY`^@cAg1V?Fp@P zMQ}djX?K*;^)${=uP=z9h42B_@(8ZX2BLK+ygl8uq5-!cLNEZLZAU&5!X;M?;We%B zL^Pf;NVCL^3%%R|oko7?%PEC%lf1zl@JMrTQ5@2+)6-z|bJPjt3S0n8ankJND{`87IbDQVDSc(`%_JXl0>Yw8dMPZ+Fw7K{@!a0J$ zWwFp)?Z$O^AR1oD*lSd>z!#3<-tPRs3SR&%u1>Fr@OvRkrLdE3M8b4`WttyQ-G#SY zcK{HCI>WwYnkPk%So|`VKk7ykp$fQ`g{%$ywO$9qb0s%Ps<-oBM6J35eaf>sW0l(% z!M!=%@v!&OD{(2@H+yANstzvnc_my_4zt`0Jy{*>D`!iIqXXBl`Sn{ob4Z7pLi}PT ztK#XoVF~v4IMHch5d~v^G--R?D$gA~@E*kA{C}{jz5-ptyG-;Fp=n@e z4a@)p9l4rRQ=gOu zzLFYPhj(1)c;3%#cRKIdx8cBs?hVR@LmLik?B1wsJhbufM)pg#o-w>WWm$LU-Q9lo pzPk_H-FQ#aJ!|hdyrJkpc1Zp12V0-FURZBkZv$=W^Z!Q!{{uOh2^s(Z diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" deleted file mode 100644 index 97eaaf6d..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeRCCompiler.cmake" +++ /dev/null @@ -1,6 +0,0 @@ -set(CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/rc.exe") -set(CMAKE_RC_COMPILER_ARG1 "") -set(CMAKE_RC_COMPILER_LOADED 1) -set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) -set(CMAKE_RC_OUTPUT_EXTENSION .res) -set(CMAKE_RC_COMPILER_ENV_VAR "RC") diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" deleted file mode 100644 index 1bcc6955..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CMakeSystem.cmake" +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") -set(CMAKE_HOST_SYSTEM_NAME "Windows") -set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") -set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") - - - -set(CMAKE_SYSTEM "Windows-10.0.19041") -set(CMAKE_SYSTEM_NAME "Windows") -set(CMAKE_SYSTEM_VERSION "10.0.19041") -set(CMAKE_SYSTEM_PROCESSOR "AMD64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" deleted file mode 100644 index d884b509..00000000 --- "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.c" +++ /dev/null @@ -1,671 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if (defined(_MSC_VER) && !defined(__clang__)) \ - || (defined(__ibmxl__) || defined(__IBMC__)) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" deleted file mode 100644 index 24ba18f33cbdb6bee01f041bdf079f5165fc76de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95232 zcmeFadwf*I`S`z^WRoRiIg7FwKxDsfK@bc z6V2whEp2V9{n(aIuiBg1Rs^(~5FkPB-~~kmytHRsFA)?HQ1<(N=IkZ`wXg5%_xk?% z+bZ7j&#(Ue_di{H9yDsrAlp9&Y&m_E zJ-p@gs~3E`&bx5Y9k(pH>AT*!H{E{w9TD%h=6M%IZ})!tc5iU{Ro?I3ar3;fE>~em z2K4#bhyS?s_SnAcQ=b38{+o!G=hyGQUA^z$|ABhnw|{}kci+BAyjR%o-+#G!Kd}EU z^{(IlE#4oV_Q3w{sCR>UU-|913j}tyC$-f!+s*gq+idd=+?Y-4vW>P4%o#M?_B<); zGN~u?cB`=8E-wk^*ld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EX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L -# if defined(__INTEL_CXX11_MODE__) -# if defined(__cpp_aggregate_nsdmi) -# define CXX_STD 201402L -# else -# define CXX_STD 201103L -# endif -# else -# define CXX_STD 199711L -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# define CXX_STD _MSVC_LANG -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git "a/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" "b/out/build/x64-Debug (par d\303\251faut)/CMakeFiles/3.17.20032601-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" deleted file mode 100644 index f9879eb014e510f1d2d9703e4a8105b1266780f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95232 zcmeFadwf*I`S`z^WRoRiIg7FwKxDz7(I`e&Bypkc%0|w@M&bp*EBHYWFI5V=fK@bc z6U}nmmbUixscmg*TYJ^E76Gj$L`k^ctb(Y3mwMJ!iJ*{xvfuYJXEzC`eSKfQ*Z0pK zFHX+PoSA24o|$>(xy@|tb<1t}Hk+-0CzG++R`QmA0rmI4|LNlMfDx+)*q-UPY2-?K zWYfs2=iRo@JAc95w=TH(o8H+s-*wmBQSblE@h*tn<-P4LZ)oaO-f!N0%bYPTS8-Vu z^m$tPA9vifT6Y*NLgd0 zzIzgHw+aXB@{(|#%|=P}FZZ@R%~wGp|MG3K8ghlQWl6Pw-m=B2$~_is#e&XOn}pZ*trq(Rd6 zY(EI8e_oqy)|dsi+#J2xW_#-ql7MOZ4o?GJpJ183TavmrC0LS5dill?;~o^iclX>af|24)fE|gr`b)r}^hI zZ8nu7QEGND2O3+V3(dA7n@vx;x_FthnY88^R>4z-+iXoOu`5;FoI_$$OSFWXc?8YB zNEKcQ4U<0~Q;^F3bOzx<5`gS5-y2En6#@BU79Fq(X{q=6wpCPRGslr_Xa7N$8(Xx-i+BevI234(mU+$p zA+l_z;d*d}-4^e*YmKLq(6lZ#x!rLGNkr(g=am-K^`G-HpBSk+SiBPYZAc&nzUS*4(rh|+F)B+w(s`0f1lXZE% zb-IzC@z?}bMW4KbB=1@)uTwYrn@3J3$F*L8)@A;-Ox~sD4|zw7cHP)vIL$}C$YdDK zu!ZPpfyP5Ihxv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Zr6RY@MW=R}7mL7{d%0Btkm((c!TmSjp;@AK1+kfte{^_^9L4;{efgaOm9y%@m z!H0iL)aw=M4Tqu>l;ubN@n_|K`HnY=a@n98jvo;p{` Date: Tue, 1 Sep 2020 13:42:21 +0200 Subject: [PATCH 100/419] No idea what i did tbh --- Horion/DrawUtils.cpp | 5 ++- Horion/Loader.cpp | 8 +++-- Horion/Module/Modules/JavascriptModule.cpp | 14 +++++++- Horion/Module/Modules/JavascriptModule.h | 1 + Horion/Module/Modules/TestModule.cpp | 25 +++++++------ Horion/Scripting/Functions/DrawFunctions.cpp | 19 ++++++++++ Horion/Scripting/Functions/DrawFunctions.h | 2 ++ .../Scripting/Functions/EntityFunctions.cpp | 36 +++++++++++++++++++ Horion/Scripting/Functions/EntityFunctions.h | 4 +++ Horion/Scripting/JsScriptModule.cpp | 2 +- Horion/Scripting/ScriptManager.cpp | 4 +++ 11 files changed, 102 insertions(+), 18 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index d8002207..c2ef970b 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -235,15 +235,14 @@ void DrawUtils::drawBox(vec3_t lower, vec3_t upper, float lineWidth, bool outlin float smallestAngle = PI * 2; vec2_t smallestDir; std::tuple smallestE; + auto lastDirAtan2 = atan2(lastDir.y, lastDir.x); for (auto cur : screenCords) { if (std::get<0>(current) == std::get<0>(cur)) continue; - //if (std::find(indices.begin(), indices.end(), std::get<0>(cur)) != indices.end()) - // continue; // angle between vecs vec2_t dir = vec2_t(std::get<1>(cur)).sub(std::get<1>(current)); - float angle = atan2(dir.y, dir.x) - atan2(lastDir.y, lastDir.x); + float angle = atan2(dir.y, dir.x) - lastDirAtan2; if (angle > PI) { angle -= 2 * PI; } else if (angle <= -PI) { diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index c4d6ecef..8ab4afeb 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -329,7 +329,9 @@ DWORD WINAPI start(LPVOID lpParam) { logF("Starting up..."); logF("MSC v%i at %s", _MSC_VER, __TIMESTAMP__); - CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)injectorConnectionThread, lpParam, NULL, NULL); + DWORD conThread; + CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)injectorConnectionThread, lpParam, NULL, &conThread); + logF("InjCon: %i", conThread); init(); DWORD procId = GetCurrentProcessId(); @@ -346,7 +348,9 @@ DWORD WINAPI start(LPVOID lpParam) { Hooks::Init(); - CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)keyThread, lpParam, NULL, NULL); // Checking Keypresses + DWORD keyThreadId; + CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)keyThread, lpParam, NULL, &keyThreadId); // Checking Keypresses + logF("KeyT: %i", keyThreadId); logF("Waiting for injector"); while (!g_Data.isInjectorConnectionActive()) { diff --git a/Horion/Module/Modules/JavascriptModule.cpp b/Horion/Module/Modules/JavascriptModule.cpp index b80bb4f2..8e90d849 100644 --- a/Horion/Module/Modules/JavascriptModule.cpp +++ b/Horion/Module/Modules/JavascriptModule.cpp @@ -33,7 +33,7 @@ void JavascriptModule::onTick(C_GameMode* gm) { if (callback == JS_INVALID_REFERENCE) return; - p->getScriptInstance()->callCallback(callback); + p->getScriptInstance()->callCallbackImmediate(callback); } void JavascriptModule::onEnable() { auto p = this->backingScriptModule.lock(); @@ -71,3 +71,15 @@ void JavascriptModule::onLevelRender() { p->getScriptInstance()->callCallbackImmediate(callback); } +void JavascriptModule::onPreRender(C_MinecraftUIRenderContext* renderCtx) { + auto p = this->backingScriptModule.lock(); + if (!p) + return; + + auto lock = p->lockCallbacks(); + auto callback = p->getCallback(L"onRender2d"); + if (callback == JS_INVALID_REFERENCE) + return; + + p->getScriptInstance()->callCallbackImmediate(callback); +} diff --git a/Horion/Module/Modules/JavascriptModule.h b/Horion/Module/Modules/JavascriptModule.h index 7e345a55..b84b3eb5 100644 --- a/Horion/Module/Modules/JavascriptModule.h +++ b/Horion/Module/Modules/JavascriptModule.h @@ -22,4 +22,5 @@ class JavascriptModule : public IModule { void onEnable() override; void onDisable() override; void onLevelRender() override; + void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; }; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index f845f2cb..9dc9e77a 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -51,7 +51,15 @@ float t = 0; void TestModule::onLevelRender() { t++; DrawUtils::setColor(1, 0.2f, 0.2f, 1); - g_Data.forEachEntity([](auto c, auto _){ + + vec3_t permutations[36]; + for(int i = 0; i < 36; i++){ + permutations[i] = {sinf((i * 10.f) / (180 / PI)), 0.f, cosf((i * 10.f) / (180 / PI))}; + } + + const float coolAnim = 0.9f + 0.9f * sin((t / 60) * PI * 2); + + g_Data.forEachEntity([&](auto c, auto _){ vec3_t* start = c->getPosOld(); vec3_t* end = c->getPos(); @@ -60,18 +68,13 @@ void TestModule::onLevelRender() { auto yPos = pos.y; yPos -= 1.62f; - yPos += 0.9f + 0.9f * sin(((t + pos.x * 6 + pos.z * 5) / 60) * PI * 2); + yPos += coolAnim; std::vector posList; - vec3_t lastPos(pos.x + sinf(0), yPos, pos.z + cosf(0)); - posList.push_back(lastPos); - for(auto angle = 0; angle <= 360; angle += 10){ - if(angle == 0) - continue; - vec3_t curPos(pos.x + sinf(angle / (180 / PI)), yPos, pos.z + cosf(angle / (180 / PI))); - posList.push_back(curPos); - //DrawUtils::drawLine3d(lastPos, curPos); - //lastPos = curPos; + posList.reserve(36); + for(auto& perm : permutations){ + vec3_t curPos(pos.x, yPos, pos.z); + posList.push_back(curPos.add(perm)); } DrawUtils::drawLinestrip3d(posList); diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 777a3e34..739aea8b 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -92,5 +92,24 @@ JsValueRef CALLBACK DrawFunctions::setColor(JsValueRef callee, bool isConstructC DrawUtils::setColor((float)r, (float)g, (float)b, (float)a); + return chakra.trueValue(); +} + +JsValueRef CALLBACK DrawFunctions::drawLine2d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + auto startOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!startOpt.has_value()) { + THROW(L"Invalid start vector!"); + } + if(startOpt->z != 0){ + THROW(L"Z component must be 0"); + } + // Note that &arguments[argIndex] might point to invalid memory here, but the function should abort because argumentCount - argIndex equals 0 + auto endOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!endOpt.has_value()) { + THROW(L"Invalid end vector!"); + } + DrawUtils::drawLine3d(*startOpt, *endOpt); + return chakra.trueValue(); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h index a5e131f9..ac39b483 100644 --- a/Horion/Scripting/Functions/DrawFunctions.h +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -7,4 +7,6 @@ class DrawFunctions { DECL_FUN(drawLine3d); DECL_FUN(setColor); DECL_FUN(drawLinestrip3d); + DECL_FUN(drawLine2d); + DECL_FUN(getOrigin); }; diff --git a/Horion/Scripting/Functions/EntityFunctions.cpp b/Horion/Scripting/Functions/EntityFunctions.cpp index 492893a5..a9fefa85 100644 --- a/Horion/Scripting/Functions/EntityFunctions.cpp +++ b/Horion/Scripting/Functions/EntityFunctions.cpp @@ -57,6 +57,42 @@ JsValueRef CALLBACK EntityFunctions::isOnGround(JsValueRef callee, bool isConstr return chakra.toBoolean(ent->onGround); } +JsValueRef CALLBACK EntityFunctions::isInvisible(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + return chakra.toBoolean(ent->isInvisible()); +} + +JsValueRef CALLBACK EntityFunctions::isInWater(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + return chakra.toBoolean(ent->isInWater()); +} + +JsValueRef CALLBACK EntityFunctions::isInLava(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + return chakra.toBoolean(ent->isInLava()); +} + +JsValueRef CALLBACK EntityFunctions::isSneaking(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + return chakra.toBoolean(ent->isSneaking()); +} + JsValueRef CALLBACK EntityFunctions::getSize(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto ent = EntityFunctions::getEntityFromValue(arguments[0]); if (ent == nullptr) { diff --git a/Horion/Scripting/Functions/EntityFunctions.h b/Horion/Scripting/Functions/EntityFunctions.h index 9d7a23c6..62f1c79b 100644 --- a/Horion/Scripting/Functions/EntityFunctions.h +++ b/Horion/Scripting/Functions/EntityFunctions.h @@ -41,6 +41,10 @@ class EntityFunctions { DECL_FUN(getInterpolatedPosition); DECL_FUN(getVelocity); DECL_FUN(isOnGround); + DECL_FUN(isInvisible); + DECL_FUN(isInWater); + DECL_FUN(isInLava); + DECL_FUN(isSneaking); DECL_FUN(getSize); DECL_FUN(toString); DECL_FUN(getViewAngles); diff --git a/Horion/Scripting/JsScriptModule.cpp b/Horion/Scripting/JsScriptModule.cpp index ddaac328..8dd2417a 100644 --- a/Horion/Scripting/JsScriptModule.cpp +++ b/Horion/Scripting/JsScriptModule.cpp @@ -12,7 +12,7 @@ JsValueRef JsScriptModule::getCallback(std::wstring callbackName) { } bool JsScriptModule::registerCallback(std::wstring callbackName, JsValueRef jsFunc) { - if (callbackName != L"onTick" && callbackName != L"onEnable" && callbackName != L"onDisable" && callbackName != L"onAttack" && callbackName != L"onRender") + if (callbackName != L"onTick" && callbackName != L"onEnable" && callbackName != L"onDisable" && callbackName != L"onAttack" && callbackName != L"onRender" && callbackName != L"onRender2d") return false; chakra.JsAddRef_(jsFunc, 0); diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 7765011c..a7cb024d 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -63,6 +63,10 @@ void ScriptManager::prepareEntityPrototype(JsValueRef proto, ContextObjects* obj chakra.defineFunction(proto, L"getInterpolatedPosition", EntityFunctions::getInterpolatedPosition, objs); chakra.defineFunction(proto, L"getVelocity", EntityFunctions::getVelocity, objs); chakra.defineFunction(proto, L"isOnGround", EntityFunctions::isOnGround, objs); + chakra.defineFunction(proto, L"isInvisible", EntityFunctions::isInvisible, objs); + chakra.defineFunction(proto, L"isInWater", EntityFunctions::isInWater, objs); + chakra.defineFunction(proto, L"isInLava", EntityFunctions::isInLava, objs); + chakra.defineFunction(proto, L"isSneaking", EntityFunctions::isSneaking, objs); chakra.defineFunction(proto, L"getSize", EntityFunctions::getSize, objs); chakra.defineFunction(proto, L"toString", EntityFunctions::toString, objs); chakra.defineFunction(proto, L"getViewAngles", EntityFunctions::getViewAngles, objs); From 9ce0f72a58fc715f73be02309b268eb8663445cc Mon Sep 17 00:00:00 2001 From: baseds Date: Tue, 1 Sep 2020 13:11:21 +0100 Subject: [PATCH 101/419] better gitignore --- .gitignore | 207 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 185 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index a0236611..b1b3f143 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,166 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/cmake,clion+all,visualstudio,c++ +# Edit at https://www.toptal.com/developers/gitignore?templates=cmake,clion+all,visualstudio,c++ + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +### CLion+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### CLion+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### CMake ### +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +### CMake Patch ### +# External projects +*-prefix/ + +### VisualStudio ### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files +*.rsuser *.suo *.user *.userosscache *.sln.docstates -Horion.vcxproj.filters # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -20,10 +168,13 @@ Horion.vcxproj.filters [Rr]eleases/ x64/ x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +[Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -37,9 +188,10 @@ Generated\ Files/ [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ @@ -53,7 +205,6 @@ BenchmarkDotNet.Artifacts/ project.lock.json project.fragment.lock.json artifacts/ -**/Properties/launchSettings.json # StyleCop StyleCopReport.xml @@ -61,12 +212,10 @@ StyleCopReport.xml # Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta -*.obj *.iobj -*.pch *.pdb *.ipdb *.pgc @@ -78,6 +227,7 @@ StyleCopReport.xml *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log *.vspscc *.vssscc @@ -120,9 +270,6 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* @@ -133,6 +280,9 @@ _TeamCity* .axoCover/* !.axoCover/settings.json +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + # Visual Studio code coverage results *.coverage *.coveragexml @@ -180,6 +330,8 @@ PublishScripts/ # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. @@ -204,12 +356,14 @@ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ @@ -222,7 +376,7 @@ ClientBin/ *.publishsettings orleans.codegen.cs -# Including strong name files can present a security risk +# Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk @@ -253,6 +407,9 @@ ServiceFabricBackup/ *.bim.layout *.bim_*.settings *.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ @@ -288,12 +445,8 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ +# CodeRush personal settings +.cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ @@ -318,7 +471,7 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ -# Azure Stream Analytics local run output +# Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log @@ -327,9 +480,19 @@ ASALocalRun/ # NVidia Nsight GPU debugger configuration file *.nvuser -# MFractors (Xamarin productivity tool) working folder +# MFractors (Xamarin productivity tool) working folder .mfractor/ -# CMake -/out/build/x64-Debug -/out/build/x64-Debug (default) +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# End of https://www.toptal.com/developers/gitignore/api/cmake,clion+all,visualstudio,c++ From ba00d13f9723a9fccd8e6979f622d222d782894d Mon Sep 17 00:00:00 2001 From: segment <70320706+baseds@users.noreply.github.com> Date: Tue, 1 Sep 2020 13:39:34 +0100 Subject: [PATCH 102/419] remove .lib (minhook binary is in repository) --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index b1b3f143..9c5c736e 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ *.lai *.la *.a -*.lib # Executables *.exe From 6604353fa240101f5313dc7abc11a331550aa324 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 1 Sep 2020 14:42:17 +0200 Subject: [PATCH 103/419] Add Nukkit Dupe --- Horion/Command/Commands/DupeCommand.cpp | 63 +++++++++++++++---------- Horion/Command/Commands/TestCommand.cpp | 44 ----------------- 2 files changed, 38 insertions(+), 69 deletions(-) diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index 8f373ed8..0d74d37a 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -1,46 +1,59 @@ #include "DupeCommand.h" -DupeCommand::DupeCommand() : IMCCommand("dupe", "Duplicates the item in hand", " ") { +DupeCommand::DupeCommand() : IMCCommand("dupe", "Duplicates the item in hand", "") { } DupeCommand::~DupeCommand() { } bool DupeCommand::execute(std::vector* args) { - C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); - C_Inventory* inv = supplies->inventory; + C_LocalPlayer* player = g_Data.getLocalPlayer(); + + auto supplies = g_Data.getLocalPlayer()->getSupplies(); auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - int selectedSlot = supplies->selectedHotbarSlot; - C_ItemStack* item = inv->getItemStack(selectedSlot); + C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); + + auto slot = supplies->selectedHotbarSlot; - int count = item->count; - bool isGive = true; + C_InventoryAction actions[36 * 2]; + int numActions = 0; + for(int i = 0; i < 36; i++){ + if(i == slot) + continue; + auto itemInSlot = supplies->inventory->getItemStack(i); - if (args->size() > 1) - item->count = assertInt(args->at(1)); - if (args->size() > 2) - isGive = static_cast(assertInt(args->at(2))); + if(itemInSlot == nullptr || !itemInSlot->isValid() || itemInSlot->getItem()->itemId == 0) + { + actions[numActions] = C_InventoryAction(slot, selectedItem, nullptr, 0, 0); + actions[numActions + 1] = C_InventoryAction(i, nullptr, selectedItem, 0, 0); - if (isGive) { - int slot = inv->getFirstEmptySlot(); + numActions += 2; + } + } - C_InventoryAction* firstAction = nullptr; - C_InventoryAction* secondAction = nullptr; + C_InventoryTransactionPacket pk; + pk.complexTransaction = new C_ComplexInventoryTransaction(); + pk.complexTransaction->actionType = 0; - firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, item); + struct temp { + __int64 next; + char pad[0x18]; + C_InventoryAction* start; + C_InventoryAction* end; + }; - transactionManager->addInventoryAction(*firstAction); - transactionManager->addInventoryAction(*secondAction); + temp coolBean{}; + coolBean.start = &actions[0]; + coolBean.end = &actions[numActions]; - inv->addItemToFirstEmptySlot(item); - } else - g_Data.getLocalPlayer()->setOffhandSlot(item); + auto ptrBean = &coolBean; - if (args->size() > 1) - item->count = count; + coolBean.next = reinterpret_cast<__int64>(&ptrBean); - clientMessageF("%sSuccessfully duplicated the item!", GREEN); + pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); + pk.numTransactions = 1; + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); + clientMessageF("%sSuccessfully duplicated item! (%i times)", GREEN, numActions / 2); return true; } diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index ea435331..3bfc34e8 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -33,49 +33,5 @@ void showAimedBlockInfo() { bool TestCommand::execute(std::vector* args) { C_LocalPlayer* player = g_Data.getLocalPlayer(); - g_Data.getClientInstance()->getLevel(); - /*auto supplies = g_Data.getLocalPlayer()->getSupplies(); - auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - - C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - - auto slot = supplies->selectedHotbarSlot; - - C_InventoryAction actions[36 * 2]; - int numActions = 0; - for(int i = slot + 1; i < 9; i++){ - auto itemInSlot = supplies->inventory->getItemStack(slot); - //if(itemInSlot == nullptr || itemInSlot->item == nullptr || *itemInSlot->item == nullptr) - { - actions[numActions] = C_InventoryAction(slot, selectedItem, nullptr, 0, 0); - actions[numActions + 1] = C_InventoryAction(i, nullptr, selectedItem, 0, 0); - - numActions += 2; - } - } - - C_InventoryTransactionPacket pk; - pk.complexTransaction = new C_ComplexInventoryTransaction(); - pk.complexTransaction->actionType = 0; - - struct temp { - __int64 next; - char pad[0x18]; - C_InventoryAction* start; - C_InventoryAction* end; - }; - - temp coolBean{}; - coolBean.start = &actions[0]; - coolBean.end = &actions[numActions]; - - auto ptrBean = &coolBean; - - coolBean.next = reinterpret_cast<__int64>(&ptrBean); - - pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); - pk.numTransactions = 1; - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully given item! %i", GREEN, numActions);*/ return true; } From 246ffc81fdaf90b43750b5e894114c89e362fdb1 Mon Sep 17 00:00:00 2001 From: baseds Date: Tue, 1 Sep 2020 13:49:37 +0100 Subject: [PATCH 104/419] remove imgui useless --- CMakeLists.txt | 18 - Memory/Hooks.h | 4 - include/imgui/LICENSE.txt | 21 - include/imgui/examples/README.txt | 287 - include/imgui/examples/imgui_examples.sln | 68 - include/imgui/examples/imgui_impl_dx11.cpp | 549 - include/imgui/examples/imgui_impl_dx11.h | 25 - include/imgui/examples/imgui_impl_win32.cpp | 445 - include/imgui/examples/imgui_impl_win32.h | 37 - include/imgui/imconfig.h | 108 - include/imgui/imgui.cpp | 10419 ---------------- include/imgui/imgui.h | 2337 ---- include/imgui/imgui_demo.cpp | 4917 -------- include/imgui/imgui_draw.cpp | 3594 ------ include/imgui/imgui_internal.h | 1955 --- include/imgui/imgui_widgets.cpp | 7736 ------------ include/imgui/imstb_rectpack.h | 639 - include/imgui/imstb_textedit.h | 1417 --- include/imgui/imstb_truetype.h | 4903 -------- include/imgui/misc/README.txt | 24 - include/imgui/misc/cpp/README.txt | 10 - include/imgui/misc/cpp/imgui_stdlib.cpp | 76 - include/imgui/misc/cpp/imgui_stdlib.h | 22 - include/imgui/misc/fonts/Cousine-Regular.ttf | Bin 43912 -> 0 bytes include/imgui/misc/fonts/DroidSans.ttf | Bin 190044 -> 0 bytes include/imgui/misc/fonts/Karla-Regular.ttf | Bin 16848 -> 0 bytes include/imgui/misc/fonts/ProggyClean.ttf | Bin 41208 -> 0 bytes include/imgui/misc/fonts/ProggyTiny.ttf | Bin 35656 -> 0 bytes include/imgui/misc/fonts/Roboto-Medium.ttf | Bin 162588 -> 0 bytes .../misc/fonts/binary_to_compressed_c.cpp | 389 - include/imgui/misc/natvis/README.txt | 4 - include/imgui/misc/natvis/imgui.natvis | 39 - .../misc/single_file/imgui_single_file.h | 17 - 33 files changed, 40060 deletions(-) delete mode 100644 include/imgui/LICENSE.txt delete mode 100644 include/imgui/examples/README.txt delete mode 100644 include/imgui/examples/imgui_examples.sln delete mode 100644 include/imgui/examples/imgui_impl_dx11.cpp delete mode 100644 include/imgui/examples/imgui_impl_dx11.h delete mode 100644 include/imgui/examples/imgui_impl_win32.cpp delete mode 100644 include/imgui/examples/imgui_impl_win32.h delete mode 100644 include/imgui/imconfig.h delete mode 100644 include/imgui/imgui.cpp delete mode 100644 include/imgui/imgui.h delete mode 100644 include/imgui/imgui_demo.cpp delete mode 100644 include/imgui/imgui_draw.cpp delete mode 100644 include/imgui/imgui_internal.h delete mode 100644 include/imgui/imgui_widgets.cpp delete mode 100644 include/imgui/imstb_rectpack.h delete mode 100644 include/imgui/imstb_textedit.h delete mode 100644 include/imgui/imstb_truetype.h delete mode 100644 include/imgui/misc/README.txt delete mode 100644 include/imgui/misc/cpp/README.txt delete mode 100644 include/imgui/misc/cpp/imgui_stdlib.cpp delete mode 100644 include/imgui/misc/cpp/imgui_stdlib.h delete mode 100644 include/imgui/misc/fonts/Cousine-Regular.ttf delete mode 100644 include/imgui/misc/fonts/DroidSans.ttf delete mode 100644 include/imgui/misc/fonts/Karla-Regular.ttf delete mode 100644 include/imgui/misc/fonts/ProggyClean.ttf delete mode 100644 include/imgui/misc/fonts/ProggyTiny.ttf delete mode 100644 include/imgui/misc/fonts/Roboto-Medium.ttf delete mode 100644 include/imgui/misc/fonts/binary_to_compressed_c.cpp delete mode 100644 include/imgui/misc/natvis/README.txt delete mode 100644 include/imgui/misc/natvis/imgui.natvis delete mode 100644 include/imgui/misc/single_file/imgui_single_file.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 063a5386..c6bc6fe9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,24 +291,6 @@ add_library(Horion SHARED include/chakra/ChakraCore.h include/chakra/ChakraCoreWindows.h include/chakra/ChakraDebug.h - include/imgui/examples/imgui_impl_dx11.cpp - include/imgui/examples/imgui_impl_dx11.h - include/imgui/examples/imgui_impl_win32.cpp - include/imgui/examples/imgui_impl_win32.h - include/imgui/misc/cpp/imgui_stdlib.cpp - include/imgui/misc/cpp/imgui_stdlib.h - include/imgui/misc/fonts/binary_to_compressed_c.cpp - include/imgui/misc/single_file/imgui_single_file.h - include/imgui/imconfig.h - include/imgui/imgui.cpp - include/imgui/imgui.h - include/imgui/imgui_demo.cpp - include/imgui/imgui_draw.cpp - include/imgui/imgui_internal.h - include/imgui/imgui_widgets.cpp - include/imgui/imstb_rectpack.h - include/imgui/imstb_textedit.h - include/imgui/imstb_truetype.h include/atlrx.h include/d3dx11.h include/d3dx11async.h diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 5075eeca..d3ebeacb 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -35,10 +35,6 @@ #include "../include/d3dx11async.h" -#include "../include/imgui/imgui.h" -#include "../include/imgui/examples/imgui_impl_dx11.h" -#include "../include/imgui/examples/imgui_impl_win32.h" - class VMTHook; class FuncHook; diff --git a/include/imgui/LICENSE.txt b/include/imgui/LICENSE.txt deleted file mode 100644 index d8763995..00000000 --- a/include/imgui/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Omar Cornut - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/include/imgui/examples/README.txt b/include/imgui/examples/README.txt deleted file mode 100644 index 1408585b..00000000 --- a/include/imgui/examples/README.txt +++ /dev/null @@ -1,287 +0,0 @@ ------------------------------------------------------------------------ - dear imgui, v1.76 ------------------------------------------------------------------------ - examples/README.txt - (This is the README file for the examples/ folder. See docs/ for more documentation) ------------------------------------------------------------------------ - -Dear ImGui is highly portable and only requires a few things to run and render: - - - Providing mouse/keyboard inputs - - Uploading the font atlas texture into graphics memory - - Providing a render function to render indexed textured triangles - - Optional: clipboard support, mouse cursor supports, Windows IME support, etc. - -This is essentially what the example bindings in this folder are providing + obligatory portability cruft. - -It is important to understand the difference between the core Dear ImGui library (files in the root folder) -and examples bindings which we are describing here (examples/ folder). -You should be able to write bindings for pretty much any platform and any 3D graphics API. With some extra -effort you can even perform the rendering remotely, on a different machine than the one running the logic. - -This folder contains two things: - - - Example bindings for popular platforms/graphics API, which you can use as is or adapt for your own use. - They are the imgui_impl_XXXX files found in the examples/ folder. - - - Example applications (standalone, ready-to-build) using the aforementioned bindings. - They are the in the XXXX_example/ sub-folders. - -You can find binaries of some of those example applications at: - http://www.dearimgui.org/binaries - - ---------------------------------------- - MISC COMMENTS AND SUGGESTIONS ---------------------------------------- - - - Read FAQ at http://dearimgui.org/faq - - - Please read 'PROGRAMMER GUIDE' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. - Please read the comments and instruction at the top of each file. - - - If you are using of the backend provided here, so you can copy the imgui_impl_xxx.cpp/h files - to your project and use them unmodified. Each imgui_impl_xxxx.cpp comes with its own individual - ChangeLog at the top of the .cpp files, so if you want to update them later it will be easier to - catch up with what changed. - - - Dear ImGui has 0 to 1 frame of lag for most behaviors, at 60 FPS your experience should be pleasant. - However, consider that OS mouse cursors are typically drawn through a specific hardware accelerated path - and will feel smoother than common GPU rendered contents (including Dear ImGui windows). - You may experiment with the io.MouseDrawCursor flag to request Dear ImGui to draw a mouse cursor itself, - to visualize the lag between a hardware cursor and a software cursor. However, rendering a mouse cursor - at 60 FPS will feel slow. It might be beneficial to the user experience to switch to a software rendered - cursor only when an interactive drag is in progress. - Note that some setup or GPU drivers are likely to be causing extra lag depending on their settings. - If you feel that dragging windows feels laggy and you are not sure who to blame: try to build an - application drawing a shape directly under the mouse cursor. - - ---------------------------------------- - EXAMPLE BINDINGS ---------------------------------------- - -Most the example bindings are split in 2 parts: - - - The "Platform" bindings, in charge of: mouse/keyboard/gamepad inputs, cursor shape, timing, windowing. - Examples: Windows (imgui_impl_win32.cpp), GLFW (imgui_impl_glfw.cpp), SDL2 (imgui_impl_sdl.cpp), etc. - - - The "Renderer" bindings, in charge of: creating the main font texture, rendering imgui draw data. - Examples: DirectX11 (imgui_impl_dx11.cpp), GL3 (imgui_impl_opengl3.cpp), Vulkan (imgui_impl_vulkan.cpp), etc. - - - The example _applications_ usually combine 1 platform + 1 renderer binding to create a working program. - Examples: the example_win32_directx11/ application combines imgui_impl_win32.cpp + imgui_impl_dx11.cpp. - - - Some bindings for higher level frameworks carry both "Platform" and "Renderer" parts in one file. - This is the case for Allegro 5 (imgui_impl_allegro5.cpp), Marmalade (imgui_impl_marmalade5.cpp). - - - If you use your own engine, you may decide to use some of existing bindings and/or rewrite some using - your own API. As a recommendation, if you are new to Dear ImGui, try using the existing binding as-is - first, before moving on to rewrite some of the code. Although it is tempting to rewrite both of the - imgui_impl_xxxx files to fit under your coding style, consider that it is not necessary! - In fact, if you are new to Dear ImGui, rewriting them will almost always be harder. - - Example: your engine is built over Windows + DirectX11 but you have your own high-level rendering - system layered over DirectX11. - Suggestion: step 1: try using imgui_impl_win32.cpp + imgui_impl_dx11.cpp first. - Once this work, _if_ you want you can replace the imgui_impl_dx11.cpp code with a custom renderer - using your own functions, etc. - Please consider using the bindings to the lower-level platform/graphics API as-is. - - Example: your engine is multi-platform (consoles, phones, etc.), you have high-level systems everywhere. - Suggestion: step 1: try using a non-portable binding first (e.g. win32 + underlying graphics API)! - This is counter-intuitive, but this will get you running faster! Once you better understand how imgui - works and is bound, you can rewrite the code using your own systems. - - - Road-map: Dear ImGui 1.80 (WIP currently in the "docking" branch) will allows imgui windows to be - seamlessly detached from the main application window. This is achieved using an extra layer to the - platform and renderer bindings, which allows Dear ImGui to communicate platform-specific requests. - If you decide to use unmodified imgui_impl_xxxx.cpp files, you will automatically benefit from - improvements and fixes related to viewports and platform windows without extra work on your side. - - -List of Platforms Bindings in this repository: - - imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/ - imgui_impl_osx.mm ; macOS native API (not as feature complete as glfw/sdl back-ends) - imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org - imgui_impl_win32.cpp ; Win32 native API (Windows) - imgui_impl_glut.cpp ; GLUT/FreeGLUT (absolutely not recommended in 2020!) - -List of Renderer Bindings in this repository: - - imgui_impl_dx9.cpp ; DirectX9 - imgui_impl_dx10.cpp ; DirectX10 - imgui_impl_dx11.cpp ; DirectX11 - imgui_impl_dx12.cpp ; DirectX12 - imgui_impl_metal.mm ; Metal (with ObjC) - imgui_impl_opengl2.cpp ; OpenGL 2 (legacy, fixed pipeline <- don't use with modern OpenGL context) - imgui_impl_opengl3.cpp ; OpenGL 3/4, OpenGL ES 2, OpenGL ES 3 (modern programmable pipeline) - imgui_impl_vulkan.cpp ; Vulkan - -List of high-level Frameworks Bindings in this repository: (combine Platform + Renderer) - - imgui_impl_allegro5.cpp - imgui_impl_marmalade.cpp - -Note that Dear ImGui works with Emscripten. The examples_emscripten/ app uses imgui_impl_sdl.cpp and -imgui_impl_opengl3.cpp, but other combinations are possible. - -Third-party framework, graphics API and languages bindings are listed at: - - https://github.com/ocornut/imgui/wiki/Bindings - -Including backends for: - - AGS/Adventure Game Studio, Amethyst, bsf, Cinder, Cocos2d-x, Diligent Engine, Flexium, - GML/Game Maker Studio2, GTK3+OpenGL3, Irrlicht Engine, LÖVE+LUA, Magnum, NanoRT, Nim Game Lib, - Ogre, openFrameworks, OSG/OpenSceneGraph, Orx, px_render, Qt/QtDirect3D, SFML, Sokol, - Unreal Engine 4, vtk, Win32 GDI, etc. - -Not sure which to use? -Recommended platform/frameworks: - - GLFW https://github.com/glfw/glfw Use imgui_impl_glfw.cpp - SDL2 https://www.libsdl.org Use imgui_impl_sdl.cpp - Sokol https://github.com/floooh/sokol Use util/sokol_imgui.h in Sokol repository. - -Those will allow you to create portable applications and will solve and abstract away many issues. - - ---------------------------------------- - EXAMPLE APPLICATIONS ---------------------------------------- - -Building: - Unfortunately in 2020 it is still tedious to create and maintain portable build files using external - libraries (the kind we're using here to create a window and render 3D triangles) without relying on - third party software. For most examples here I choose to provide: - - Makefiles for Linux/OSX - - Batch files for Visual Studio 2008+ - - A .sln project file for Visual Studio 2010+ - - Xcode project files for the Apple examples - Please let me know if they don't work with your setup! - You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those - directly with a command-line compiler. - - If you are interested in using Cmake to build and links examples, see: - https://github.com/ocornut/imgui/pull/1713 and https://github.com/ocornut/imgui/pull/3027 - - -example_allegro5/ - Allegro 5 example. - = main.cpp + imgui_impl_allegro5.cpp - -example_apple_metal/ - OSX & iOS + Metal. - = main.m + imgui_impl_osx.mm + imgui_impl_metal.mm - It is based on the "cross-platform" game template provided with Xcode as of Xcode 9. - (NB: imgui_impl_osx.mm is currently not as feature complete as other platforms back-ends. - You may prefer to use the GLFW Or SDL back-ends, which will also support Windows and Linux.) - -example_apple_opengl2/ - OSX + OpenGL2. - = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp - (NB: imgui_impl_osx.mm is currently not as feature complete as other platforms back-ends. - You may prefer to use the GLFW Or SDL back-ends, which will also support Windows and Linux.) - -example_empscripten: - Emcripten + SDL2 + OpenGL3+/ES2/ES3 example. - = main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp - Note that other examples based on SDL or GLFW + OpenGL could easily be modified to work with Emscripten. - We provide this to make the Emscripten differences obvious, and have them not pollute all other examples. - -example_glfw_metal/ - GLFW (Mac) + Metal example. - = main.mm + imgui_impl_glfw.cpp + imgui_impl_metal.mm - -example_glfw_opengl2/ - GLFW + OpenGL2 example (legacy, fixed pipeline). - = main.cpp + imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp - **DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** - **Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)** - This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter. - If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to - make things more complicated, will require your code to reset many OpenGL attributes to their initial - state, and might confuse your GPU driver. One star, not recommended. - -example_glfw_opengl3/ - GLFW (Win32, Mac, Linux) + OpenGL3+/ES2/ES3 example (programmable pipeline). - = main.cpp + imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp - This uses more modern OpenGL calls and custom shaders. - Prefer using that if you are using modern OpenGL in your application (anything with shaders). - (Please be mindful that accessing OpenGL3+ functions requires a function loader, which are a frequent - source for confusion for new users. We use a loader in imgui_impl_opengl3.cpp which may be different - from the one your app normally use. Read imgui_impl_opengl3.h for details and how to change it.) - -example_glfw_vulkan/ - GLFW (Win32, Mac, Linux) + Vulkan example. - = main.cpp + imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp - This is quite long and tedious, because: Vulkan. - For this example, the main.cpp file exceptionally use helpers function from imgui_impl_vulkan.h/cpp. - -example_glut_opengl2/ - GLUT (e.g., FreeGLUT on Linux/Windows, GLUT framework on OSX) + OpenGL2. - = main.cpp + imgui_impl_glut.cpp + imgui_impl_opengl2.cpp - Note that GLUT/FreeGLUT is largely obsolete software, prefer using GLFW or SDL. - -example_marmalade/ - Marmalade example using IwGx. - = main.cpp + imgui_impl_marmalade.cpp - -example_null - Null example, compile and link imgui, create context, run headless with no inputs and no graphics output. - = main.cpp - This is used to quickly test compilation of core imgui files in as many setups as possible. - Because this application doesn't create a window nor a graphic context, there's no graphics output. - -example_sdl_directx11/ - SDL2 + DirectX11 example, Windows only. - = main.cpp + imgui_impl_sdl.cpp + imgui_impl_dx11.cpp - This to demonstrate usage of DirectX with SDL. - -example_sdl_metal/ - SDL2 (Mac) + Metal example. - = main.mm + imgui_impl_sdl.cpp + imgui_impl_metal.mm - -example_sdl_opengl2/ - SDL2 (Win32, Mac, Linux etc.) + OpenGL example (legacy, fixed pipeline). - = main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl2.cpp - **DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** - **Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)** - This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter. - If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to - make things more complicated, will require your code to reset many OpenGL attributes to their initial - state, and might confuse your GPU driver. One star, not recommended. - -example_sdl_opengl3/ - SDL2 (Win32, Mac, Linux, etc.) + OpenGL3+/ES2/ES3 example. - = main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp - This uses more modern OpenGL calls and custom shaders. - Prefer using that if you are using modern OpenGL in your application (anything with shaders). - (Please be mindful that accessing OpenGL3+ functions requires a function loader, which are a frequent - source for confusion for new users. We use a loader in imgui_impl_opengl3.cpp which may be different - from the one your app normally use. Read imgui_impl_opengl3.h for details and how to change it.) - -example_sdl_vulkan/ - SDL2 (Win32, Mac, Linux, etc.) + Vulkan example. - = main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp - This is quite long and tedious, because: Vulkan. - For this example, the main.cpp file exceptionally use helpers function from imgui_impl_vulkan.h/cpp. - -example_win32_directx9/ - DirectX9 example, Windows only. - = main.cpp + imgui_impl_win32.cpp + imgui_impl_dx9.cpp - -example_win32_directx10/ - DirectX10 example, Windows only. - = main.cpp + imgui_impl_win32.cpp + imgui_impl_dx10.cpp - -example_win32_directx11/ - DirectX11 example, Windows only. - = main.cpp + imgui_impl_win32.cpp + imgui_impl_dx11.cpp - -example_win32_directx12/ - DirectX12 example, Windows only. - = main.cpp + imgui_impl_win32.cpp + imgui_impl_dx12.cpp - This is quite long and tedious, because: DirectX12. diff --git a/include/imgui/examples/imgui_examples.sln b/include/imgui/examples/imgui_examples.sln deleted file mode 100644 index 49b2ff89..00000000 --- a/include/imgui/examples/imgui_examples.sln +++ /dev/null @@ -1,68 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx9", "example_win32_directx9\example_win32_directx9.vcxproj", "{4165A294-21F2-44CA-9B38-E3F935ABADF5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx10", "example_win32_directx10\example_win32_directx10.vcxproj", "{345A953E-A004-4648-B442-DC5F9F11068C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx11", "example_win32_directx11\example_win32_directx11.vcxproj", "{9F316E83-5AE5-4939-A723-305A94F48005}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_glfw_opengl2", "example_glfw_opengl2\example_glfw_opengl2.vcxproj", "{9CDA7840-B7A5-496D-A527-E95571496D18}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_glfw_opengl3", "example_glfw_opengl3\example_glfw_opengl3.vcxproj", "{4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|Win32.ActiveCfg = Debug|Win32 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|Win32.Build.0 = Debug|Win32 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|x64.ActiveCfg = Debug|x64 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|x64.Build.0 = Debug|x64 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|Win32.ActiveCfg = Release|Win32 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|Win32.Build.0 = Release|Win32 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|x64.ActiveCfg = Release|x64 - {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|x64.Build.0 = Release|x64 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|Win32.ActiveCfg = Debug|Win32 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|Win32.Build.0 = Debug|Win32 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|x64.ActiveCfg = Debug|x64 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|x64.Build.0 = Debug|x64 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|Win32.ActiveCfg = Release|Win32 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|Win32.Build.0 = Release|Win32 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|x64.ActiveCfg = Release|x64 - {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|x64.Build.0 = Release|x64 - {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|Win32.ActiveCfg = Debug|Win32 - {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|Win32.Build.0 = Debug|Win32 - {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|x64.ActiveCfg = Debug|x64 - {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|x64.Build.0 = Debug|x64 - {9F316E83-5AE5-4939-A723-305A94F48005}.Release|Win32.ActiveCfg = Release|Win32 - {9F316E83-5AE5-4939-A723-305A94F48005}.Release|Win32.Build.0 = Release|Win32 - {9F316E83-5AE5-4939-A723-305A94F48005}.Release|x64.ActiveCfg = Release|x64 - {9F316E83-5AE5-4939-A723-305A94F48005}.Release|x64.Build.0 = Release|x64 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|Win32.ActiveCfg = Debug|Win32 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|Win32.Build.0 = Debug|Win32 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|x64.ActiveCfg = Debug|x64 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|x64.Build.0 = Debug|x64 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|Win32.ActiveCfg = Release|Win32 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|Win32.Build.0 = Release|Win32 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|x64.ActiveCfg = Release|x64 - {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|x64.Build.0 = Release|x64 - {345A953E-A004-4648-B442-DC5F9F11068C}.Debug|Win32.ActiveCfg = Debug|Win32 - {345A953E-A004-4648-B442-DC5F9F11068C}.Debug|Win32.Build.0 = Debug|Win32 - {345A953E-A004-4648-B442-DC5F9F11068C}.Debug|x64.ActiveCfg = Debug|x64 - {345A953E-A004-4648-B442-DC5F9F11068C}.Debug|x64.Build.0 = Debug|x64 - {345A953E-A004-4648-B442-DC5F9F11068C}.Release|Win32.ActiveCfg = Release|Win32 - {345A953E-A004-4648-B442-DC5F9F11068C}.Release|Win32.Build.0 = Release|Win32 - {345A953E-A004-4648-B442-DC5F9F11068C}.Release|x64.ActiveCfg = Release|x64 - {345A953E-A004-4648-B442-DC5F9F11068C}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/include/imgui/examples/imgui_impl_dx11.cpp b/include/imgui/examples/imgui_impl_dx11.cpp deleted file mode 100644 index aadadddf..00000000 --- a/include/imgui/examples/imgui_impl_dx11.cpp +++ /dev/null @@ -1,549 +0,0 @@ -// dear imgui: Renderer for DirectX11 -// This needs to be used along with a Platform Binding (e.g. Win32) - -// Implemented features: -// [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! -// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. - -// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. -// If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp -// https://github.com/ocornut/imgui - -// CHANGELOG -// (minor and older changes stripped away, please see git history for details) -// 2019-08-01: DirectX11: Fixed code querying the Geometry Shader state (would generally error with Debug layer enabled). -// 2019-07-21: DirectX11: Backup, clear and restore Geometry Shader is any is bound when calling ImGui_ImplDX10_RenderDrawData. Clearing Hull/Domain/Compute shaders without backup/restore. -// 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. -// 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. -// 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). -// 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. -// 2018-08-01: DirectX11: Querying for IDXGIFactory instead of IDXGIFactory1 to increase compatibility. -// 2018-07-13: DirectX11: Fixed unreleased resources in Init and Shutdown functions. -// 2018-06-08: Misc: Extracted imgui_impl_dx11.cpp/.h away from the old combined DX11+Win32 example. -// 2018-06-08: DirectX11: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle. -// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX11_RenderDrawData() in the .h file so you can call it yourself. -// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves. -// 2016-05-07: DirectX11: Disabling depth-write. - -#include "../../../Utils/Logger.h" -#include "../imgui.h" -#include "imgui_impl_dx11.h" - -// DirectX -#include -#include -#include -#ifdef _MSC_VER -#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below. -#endif - -// DirectX data -static ID3D11Device* g_pd3dDevice = NULL; -static ID3D11DeviceContext* g_pd3dDeviceContext = NULL; -static IDXGIFactory* g_pFactory = NULL; -static ID3D11Buffer* g_pVB = NULL; -static ID3D11Buffer* g_pIB = NULL; -static ID3D10Blob* g_pVertexShaderBlob = NULL; -static ID3D11VertexShader* g_pVertexShader = NULL; -static ID3D11InputLayout* g_pInputLayout = NULL; -static ID3D11Buffer* g_pVertexConstantBuffer = NULL; -static ID3D10Blob* g_pPixelShaderBlob = NULL; -static ID3D11PixelShader* g_pPixelShader = NULL; -static ID3D11SamplerState* g_pFontSampler = NULL; -static ID3D11ShaderResourceView*g_pFontTextureView = NULL; -static ID3D11RasterizerState* g_pRasterizerState = NULL; -static ID3D11BlendState* g_pBlendState = NULL; -static ID3D11DepthStencilState* g_pDepthStencilState = NULL; -static int g_VertexBufferSize = 5000, g_IndexBufferSize = 10000; - -struct VERTEX_CONSTANT_BUFFER -{ - float mvp[4][4]; -}; - -static void ImGui_ImplDX11_SetupRenderState(ImDrawData* draw_data, ID3D11DeviceContext* ctx) -{ - // Setup viewport - D3D11_VIEWPORT vp; - memset(&vp, 0, sizeof(D3D11_VIEWPORT)); - vp.Width = draw_data->DisplaySize.x; - vp.Height = draw_data->DisplaySize.y; - vp.MinDepth = 0.0f; - vp.MaxDepth = 1.0f; - vp.TopLeftX = vp.TopLeftY = 0; - ctx->RSSetViewports(1, &vp); - - // Setup shader and vertex buffers - unsigned int stride = sizeof(ImDrawVert); - unsigned int offset = 0; - ctx->IASetInputLayout(g_pInputLayout); - ctx->IASetVertexBuffers(0, 1, &g_pVB, &stride, &offset); - ctx->IASetIndexBuffer(g_pIB, sizeof(ImDrawIdx) == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, 0); - ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - ctx->VSSetShader(g_pVertexShader, NULL, 0); - ctx->VSSetConstantBuffers(0, 1, &g_pVertexConstantBuffer); - ctx->PSSetShader(g_pPixelShader, NULL, 0); - ctx->PSSetSamplers(0, 1, &g_pFontSampler); - ctx->GSSetShader(NULL, NULL, 0); - ctx->HSSetShader(NULL, NULL, 0); // In theory we should backup and restore this as well.. very infrequently used.. - ctx->DSSetShader(NULL, NULL, 0); // In theory we should backup and restore this as well.. very infrequently used.. - ctx->CSSetShader(NULL, NULL, 0); // In theory we should backup and restore this as well.. very infrequently used.. - - // Setup blend state - const float blend_factor[4] = { 0.f, 0.f, 0.f, 0.f }; - ctx->OMSetBlendState(g_pBlendState, blend_factor, 0xffffffff); - ctx->OMSetDepthStencilState(g_pDepthStencilState, 0); - ctx->RSSetState(g_pRasterizerState); -} - -// Render function -// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop) -void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data) -{ - // Avoid rendering when minimized - if (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f) - return; - - ID3D11DeviceContext* ctx = g_pd3dDeviceContext; - - // Create and grow vertex/index buffers if needed - if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount) - { - if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } - g_VertexBufferSize = draw_data->TotalVtxCount + 5000; - D3D11_BUFFER_DESC desc; - memset(&desc, 0, sizeof(D3D11_BUFFER_DESC)); - desc.Usage = D3D11_USAGE_DYNAMIC; - desc.ByteWidth = g_VertexBufferSize * sizeof(ImDrawVert); - desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - desc.MiscFlags = 0; - if (g_pd3dDevice->CreateBuffer(&desc, NULL, &g_pVB) < 0) - return; - } - if (!g_pIB || g_IndexBufferSize < draw_data->TotalIdxCount) - { - if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } - g_IndexBufferSize = draw_data->TotalIdxCount + 10000; - D3D11_BUFFER_DESC desc; - memset(&desc, 0, sizeof(D3D11_BUFFER_DESC)); - desc.Usage = D3D11_USAGE_DYNAMIC; - desc.ByteWidth = g_IndexBufferSize * sizeof(ImDrawIdx); - desc.BindFlags = D3D11_BIND_INDEX_BUFFER; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - if (g_pd3dDevice->CreateBuffer(&desc, NULL, &g_pIB) < 0) - return; - } - - // Upload vertex/index data into a single contiguous GPU buffer - D3D11_MAPPED_SUBRESOURCE vtx_resource, idx_resource; - if (ctx->Map(g_pVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &vtx_resource) != S_OK) - return; - if (ctx->Map(g_pIB, 0, D3D11_MAP_WRITE_DISCARD, 0, &idx_resource) != S_OK) - return; - - - ImDrawVert* vtx_dst = (ImDrawVert*)vtx_resource.pData; - ImDrawIdx* idx_dst = (ImDrawIdx*)idx_resource.pData; - for (int n = 0; n < draw_data->CmdListsCount; n++) - { - const ImDrawList* cmd_list = draw_data->CmdLists[n]; - memcpy(vtx_dst, cmd_list->VtxBuffer.Data, cmd_list->VtxBuffer.Size * sizeof(ImDrawVert)); - memcpy(idx_dst, cmd_list->IdxBuffer.Data, cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx)); - vtx_dst += cmd_list->VtxBuffer.Size; - idx_dst += cmd_list->IdxBuffer.Size; - } - ctx->Unmap(g_pVB, 0); - ctx->Unmap(g_pIB, 0); - - // Setup orthographic projection matrix into our constant buffer - // Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps. - { - D3D11_MAPPED_SUBRESOURCE mapped_resource; - if (ctx->Map(g_pVertexConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped_resource) != S_OK) - return; - VERTEX_CONSTANT_BUFFER* constant_buffer = (VERTEX_CONSTANT_BUFFER*)mapped_resource.pData; - float L = draw_data->DisplayPos.x; - float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x; - float T = draw_data->DisplayPos.y; - float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y; - float mvp[4][4] = - { - { 2.0f/(R-L), 0.0f, 0.0f, 0.0f }, - { 0.0f, 2.0f/(T-B), 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.5f, 0.0f }, - { (R+L)/(L-R), (T+B)/(B-T), 0.5f, 1.0f }, - }; - memcpy(&constant_buffer->mvp, mvp, sizeof(mvp)); - ctx->Unmap(g_pVertexConstantBuffer, 0); - } - - // Backup DX state that will be modified to restore it afterwards (unfortunately this is very ugly looking and verbose. Close your eyes!) - struct BACKUP_DX11_STATE - { - UINT ScissorRectsCount, ViewportsCount; - D3D11_RECT ScissorRects[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; - D3D11_VIEWPORT Viewports[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; - ID3D11RasterizerState* RS; - ID3D11BlendState* BlendState; - FLOAT BlendFactor[4]; - UINT SampleMask; - UINT StencilRef; - ID3D11DepthStencilState* DepthStencilState; - ID3D11ShaderResourceView* PSShaderResource; - ID3D11SamplerState* PSSampler; - ID3D11PixelShader* PS; - ID3D11VertexShader* VS; - ID3D11GeometryShader* GS; - UINT PSInstancesCount, VSInstancesCount, GSInstancesCount; - ID3D11ClassInstance *PSInstances[256], *VSInstances[256], *GSInstances[256]; // 256 is max according to PSSetShader documentation - D3D11_PRIMITIVE_TOPOLOGY PrimitiveTopology; - ID3D11Buffer* IndexBuffer, *VertexBuffer, *VSConstantBuffer; - UINT IndexBufferOffset, VertexBufferStride, VertexBufferOffset; - DXGI_FORMAT IndexBufferFormat; - ID3D11InputLayout* InputLayout; - }; - BACKUP_DX11_STATE old; - old.ScissorRectsCount = old.ViewportsCount = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; - ctx->RSGetScissorRects(&old.ScissorRectsCount, old.ScissorRects); - ctx->RSGetViewports(&old.ViewportsCount, old.Viewports); - ctx->RSGetState(&old.RS); - ctx->OMGetBlendState(&old.BlendState, old.BlendFactor, &old.SampleMask); - ctx->OMGetDepthStencilState(&old.DepthStencilState, &old.StencilRef); - ctx->PSGetShaderResources(0, 1, &old.PSShaderResource); - ctx->PSGetSamplers(0, 1, &old.PSSampler); - old.PSInstancesCount = old.VSInstancesCount = old.GSInstancesCount = 256; - ctx->PSGetShader(&old.PS, old.PSInstances, &old.PSInstancesCount); - ctx->VSGetShader(&old.VS, old.VSInstances, &old.VSInstancesCount); - ctx->VSGetConstantBuffers(0, 1, &old.VSConstantBuffer); - ctx->GSGetShader(&old.GS, old.GSInstances, &old.GSInstancesCount); - - ctx->IAGetPrimitiveTopology(&old.PrimitiveTopology); - ctx->IAGetIndexBuffer(&old.IndexBuffer, &old.IndexBufferFormat, &old.IndexBufferOffset); - ctx->IAGetVertexBuffers(0, 1, &old.VertexBuffer, &old.VertexBufferStride, &old.VertexBufferOffset); - ctx->IAGetInputLayout(&old.InputLayout); - - // Setup desired DX state - ImGui_ImplDX11_SetupRenderState(draw_data, ctx); - - // Render command lists - // (Because we merged all buffers into a single one, we maintain our own offset into them) - int global_idx_offset = 0; - int global_vtx_offset = 0; - ImVec2 clip_off = draw_data->DisplayPos; - for (int n = 0; n < draw_data->CmdListsCount; n++) - { - const ImDrawList* cmd_list = draw_data->CmdLists[n]; - for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) - { - const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; - if (pcmd->UserCallback != NULL) - { - // User callback, registered via ImDrawList::AddCallback() - // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.) - if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) - ImGui_ImplDX11_SetupRenderState(draw_data, ctx); - else - pcmd->UserCallback(cmd_list, pcmd); - } - else - { - // Apply scissor/clipping rectangle - const D3D11_RECT r = { (LONG)(pcmd->ClipRect.x - clip_off.x), (LONG)(pcmd->ClipRect.y - clip_off.y), (LONG)(pcmd->ClipRect.z - clip_off.x), (LONG)(pcmd->ClipRect.w - clip_off.y) }; - ctx->RSSetScissorRects(1, &r); - - // Bind texture, Draw - ID3D11ShaderResourceView* texture_srv = (ID3D11ShaderResourceView*)pcmd->TextureId; - ctx->PSSetShaderResources(0, 1, &texture_srv); - ctx->DrawIndexed(pcmd->ElemCount, pcmd->IdxOffset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset); - } - } - global_idx_offset += cmd_list->IdxBuffer.Size; - global_vtx_offset += cmd_list->VtxBuffer.Size; - } - - // Restore modified DX state - ctx->RSSetScissorRects(old.ScissorRectsCount, old.ScissorRects); - ctx->RSSetViewports(old.ViewportsCount, old.Viewports); - ctx->RSSetState(old.RS); if (old.RS) old.RS->Release(); - ctx->OMSetBlendState(old.BlendState, old.BlendFactor, old.SampleMask); if (old.BlendState) old.BlendState->Release(); - ctx->OMSetDepthStencilState(old.DepthStencilState, old.StencilRef); if (old.DepthStencilState) old.DepthStencilState->Release(); - ctx->PSSetShaderResources(0, 1, &old.PSShaderResource); if (old.PSShaderResource) old.PSShaderResource->Release(); - ctx->PSSetSamplers(0, 1, &old.PSSampler); if (old.PSSampler) old.PSSampler->Release(); - ctx->PSSetShader(old.PS, old.PSInstances, old.PSInstancesCount); if (old.PS) old.PS->Release(); - for (UINT i = 0; i < old.PSInstancesCount; i++) if (old.PSInstances[i]) old.PSInstances[i]->Release(); - ctx->VSSetShader(old.VS, old.VSInstances, old.VSInstancesCount); if (old.VS) old.VS->Release(); - ctx->VSSetConstantBuffers(0, 1, &old.VSConstantBuffer); if (old.VSConstantBuffer) old.VSConstantBuffer->Release(); - ctx->GSSetShader(old.GS, old.GSInstances, old.GSInstancesCount); if (old.GS) old.GS->Release(); - for (UINT i = 0; i < old.VSInstancesCount; i++) if (old.VSInstances[i]) old.VSInstances[i]->Release(); - ctx->IASetPrimitiveTopology(old.PrimitiveTopology); - ctx->IASetIndexBuffer(old.IndexBuffer, old.IndexBufferFormat, old.IndexBufferOffset); if (old.IndexBuffer) old.IndexBuffer->Release(); - ctx->IASetVertexBuffers(0, 1, &old.VertexBuffer, &old.VertexBufferStride, &old.VertexBufferOffset); if (old.VertexBuffer) old.VertexBuffer->Release(); - ctx->IASetInputLayout(old.InputLayout); if (old.InputLayout) old.InputLayout->Release(); -} - -static void ImGui_ImplDX11_CreateFontsTexture() -{ - // Build texture atlas - ImGuiIO& io = ImGui::GetIO(); - unsigned char* pixels; - int width, height; - io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); - - // Upload texture to graphics system - { - D3D11_TEXTURE2D_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.Width = width; - desc.Height = height; - desc.MipLevels = 1; - desc.ArraySize = 1; - desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - desc.SampleDesc.Count = 1; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = 0; - - ID3D11Texture2D *pTexture = NULL; - D3D11_SUBRESOURCE_DATA subResource; - subResource.pSysMem = pixels; - subResource.SysMemPitch = desc.Width * 4; - subResource.SysMemSlicePitch = 0; - g_pd3dDevice->CreateTexture2D(&desc, &subResource, &pTexture); - - // Create texture view - D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc; - ZeroMemory(&srvDesc, sizeof(srvDesc)); - srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; - srvDesc.Texture2D.MipLevels = desc.MipLevels; - srvDesc.Texture2D.MostDetailedMip = 0; - g_pd3dDevice->CreateShaderResourceView(pTexture, &srvDesc, &g_pFontTextureView); - pTexture->Release(); - } - - // Store our identifier - io.Fonts->TexID = (ImTextureID)g_pFontTextureView; - - // Create texture sampler - { - D3D11_SAMPLER_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; - desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; - desc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; - desc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; - desc.MipLODBias = 0.f; - desc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; - desc.MinLOD = 0.f; - desc.MaxLOD = 0.f; - g_pd3dDevice->CreateSamplerState(&desc, &g_pFontSampler); - } -} - -bool ImGui_ImplDX11_CreateDeviceObjects() -{ - if (!g_pd3dDevice) - return false; - if (g_pFontSampler) - ImGui_ImplDX11_InvalidateDeviceObjects(); - logF("ImGui_ImplDX11_CreateDeviceObjects"); - // By using D3DCompile() from / d3dcompiler.lib, we introduce a dependency to a given version of d3dcompiler_XX.dll (see D3DCOMPILER_DLL_A) - // If you would like to use this DX11 sample code but remove this dependency you can: - // 1) compile once, save the compiled shader blobs into a file or source code and pass them to CreateVertexShader()/CreatePixelShader() [preferred solution] - // 2) use code to detect any version of the DLL and grab a pointer to D3DCompile from the DLL. - // See https://github.com/ocornut/imgui/pull/638 for sources and details. - - // Create the vertex shader - { - static const char* vertexShader = - "cbuffer vertexBuffer : register(b0) \ - {\ - float4x4 ProjectionMatrix; \ - };\ - struct VS_INPUT\ - {\ - float2 pos : POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ - };\ - \ - struct PS_INPUT\ - {\ - float4 pos : SV_POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ - };\ - \ - PS_INPUT main(VS_INPUT input)\ - {\ - PS_INPUT output;\ - output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\ - output.col = input.col;\ - output.uv = input.uv;\ - return output;\ - }"; - - D3DCompile(vertexShader, strlen(vertexShader), NULL, NULL, NULL, "main", "vs_4_0", 0, 0, &g_pVertexShaderBlob, NULL); - if (g_pVertexShaderBlob == NULL) // NB: Pass ID3D10Blob* pErrorBlob to D3DCompile() to get error showing in (const char*)pErrorBlob->GetBufferPointer(). Make sure to Release() the blob! - return false; - if (g_pd3dDevice->CreateVertexShader((DWORD*)g_pVertexShaderBlob->GetBufferPointer(), g_pVertexShaderBlob->GetBufferSize(), NULL, &g_pVertexShader) != S_OK) - return false; - - #pragma warning(disable : 4311 4302) - // Create the input layout - D3D11_INPUT_ELEMENT_DESC local_layout[] = - { - { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, reinterpret_cast(&((ImDrawVert*)0)->pos), D3D11_INPUT_PER_VERTEX_DATA, 0 }, - {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, reinterpret_cast(&((ImDrawVert*)0)->uv), D3D11_INPUT_PER_VERTEX_DATA, 0}, - {"COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, reinterpret_cast(&((ImDrawVert*)0)->col), D3D11_INPUT_PER_VERTEX_DATA, 0}, - }; - #pragma warning(default : 4311 4302) - if (g_pd3dDevice->CreateInputLayout(local_layout, 3, g_pVertexShaderBlob->GetBufferPointer(), g_pVertexShaderBlob->GetBufferSize(), &g_pInputLayout) != S_OK) - return false; - - // Create the constant buffer - { - D3D11_BUFFER_DESC desc; - desc.ByteWidth = sizeof(VERTEX_CONSTANT_BUFFER); - desc.Usage = D3D11_USAGE_DYNAMIC; - desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - desc.MiscFlags = 0; - g_pd3dDevice->CreateBuffer(&desc, NULL, &g_pVertexConstantBuffer); - } - } - - // Create the pixel shader - { - static const char* pixelShader = - "struct PS_INPUT\ - {\ - float4 pos : SV_POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ - };\ - sampler sampler0;\ - Texture2D texture0;\ - \ - float4 main(PS_INPUT input) : SV_Target\ - {\ - float4 out_col = input.col * texture0.Sample(sampler0, input.uv); \ - return out_col; \ - }"; - - D3DCompile(pixelShader, strlen(pixelShader), NULL, NULL, NULL, "main", "ps_4_0", 0, 0, &g_pPixelShaderBlob, NULL); - if (g_pPixelShaderBlob == NULL) // NB: Pass ID3D10Blob* pErrorBlob to D3DCompile() to get error showing in (const char*)pErrorBlob->GetBufferPointer(). Make sure to Release() the blob! - return false; - if (g_pd3dDevice->CreatePixelShader((DWORD*)g_pPixelShaderBlob->GetBufferPointer(), g_pPixelShaderBlob->GetBufferSize(), NULL, &g_pPixelShader) != S_OK) - return false; - } - - // Create the blending setup - { - D3D11_BLEND_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.AlphaToCoverageEnable = false; - desc.RenderTarget[0].BlendEnable = true; - desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; - desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; - desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; - desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA; - desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; - desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; - desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; - g_pd3dDevice->CreateBlendState(&desc, &g_pBlendState); - } - - // Create the rasterizer state - { - D3D11_RASTERIZER_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.FillMode = D3D11_FILL_SOLID; - desc.CullMode = D3D11_CULL_NONE; - desc.ScissorEnable = true; - desc.DepthClipEnable = true; - g_pd3dDevice->CreateRasterizerState(&desc, &g_pRasterizerState); - } - - // Create depth-stencil State - { - D3D11_DEPTH_STENCIL_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.DepthEnable = false; - desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; - desc.DepthFunc = D3D11_COMPARISON_ALWAYS; - desc.StencilEnable = false; - desc.FrontFace.StencilFailOp = desc.FrontFace.StencilDepthFailOp = desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; - desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; - desc.BackFace = desc.FrontFace; - g_pd3dDevice->CreateDepthStencilState(&desc, &g_pDepthStencilState); - } - - ImGui_ImplDX11_CreateFontsTexture(); - - return true; -} - -void ImGui_ImplDX11_InvalidateDeviceObjects() -{ - if (!g_pd3dDevice) - return; - - if (g_pFontSampler) { g_pFontSampler->Release(); g_pFontSampler = NULL; } - if (g_pFontTextureView) { g_pFontTextureView->Release(); g_pFontTextureView = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well. - if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } - if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } - - if (g_pBlendState) { g_pBlendState->Release(); g_pBlendState = NULL; } - if (g_pDepthStencilState) { g_pDepthStencilState->Release(); g_pDepthStencilState = NULL; } - if (g_pRasterizerState) { g_pRasterizerState->Release(); g_pRasterizerState = NULL; } - if (g_pPixelShader) { g_pPixelShader->Release(); g_pPixelShader = NULL; } - if (g_pPixelShaderBlob) { g_pPixelShaderBlob->Release(); g_pPixelShaderBlob = NULL; } - if (g_pVertexConstantBuffer) { g_pVertexConstantBuffer->Release(); g_pVertexConstantBuffer = NULL; } - if (g_pInputLayout) { g_pInputLayout->Release(); g_pInputLayout = NULL; } - if (g_pVertexShader) { g_pVertexShader->Release(); g_pVertexShader = NULL; } - if (g_pVertexShaderBlob) { g_pVertexShaderBlob->Release(); g_pVertexShaderBlob = NULL; } -} - -bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context) -{ - // Setup back-end capabilities flags - ImGuiIO& io = ImGui::GetIO(); - io.BackendRendererName = "imgui_impl_dx11"; - io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes. - - // Get factory from device - IDXGIDevice* pDXGIDevice = NULL; - IDXGIAdapter* pDXGIAdapter = NULL; - IDXGIFactory* pFactory = NULL; - - if (device->QueryInterface(IID_PPV_ARGS(&pDXGIDevice)) == S_OK) - if (pDXGIDevice->GetParent(IID_PPV_ARGS(&pDXGIAdapter)) == S_OK) - if (pDXGIAdapter->GetParent(IID_PPV_ARGS(&pFactory)) == S_OK) - { - g_pd3dDevice = device; - g_pd3dDeviceContext = device_context; - g_pFactory = pFactory; - } - if (pDXGIDevice) pDXGIDevice->Release(); - if (pDXGIAdapter) pDXGIAdapter->Release(); - g_pd3dDevice->AddRef(); - g_pd3dDeviceContext->AddRef(); - - return true; -} - -void ImGui_ImplDX11_Shutdown() -{ - ImGui_ImplDX11_InvalidateDeviceObjects(); - if (g_pFactory) { g_pFactory->Release(); g_pFactory = NULL; } - if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; } - if (g_pd3dDeviceContext) { g_pd3dDeviceContext->Release(); g_pd3dDeviceContext = NULL; } -} - -void ImGui_ImplDX11_NewFrame() -{ - if (!g_pFontSampler) - ImGui_ImplDX11_CreateDeviceObjects(); -} diff --git a/include/imgui/examples/imgui_impl_dx11.h b/include/imgui/examples/imgui_impl_dx11.h deleted file mode 100644 index 05ade438..00000000 --- a/include/imgui/examples/imgui_impl_dx11.h +++ /dev/null @@ -1,25 +0,0 @@ -// dear imgui: Renderer for DirectX11 -// This needs to be used along with a Platform Binding (e.g. Win32) - -// Implemented features: -// [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! -// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. - -// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. -// If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. -// https://github.com/ocornut/imgui - -#pragma once -#include "../imgui.h" // IMGUI_IMPL_API - -struct ID3D11Device; -struct ID3D11DeviceContext; - -IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); -IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); -IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); -IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); - -// Use if you want to reset your rendering device without losing Dear ImGui state. -IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); -IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); diff --git a/include/imgui/examples/imgui_impl_win32.cpp b/include/imgui/examples/imgui_impl_win32.cpp deleted file mode 100644 index cd8adb41..00000000 --- a/include/imgui/examples/imgui_impl_win32.cpp +++ /dev/null @@ -1,445 +0,0 @@ -// dear imgui: Platform Binding for Windows (standard windows API for 32 and 64 bits applications) -// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) - -// Implemented features: -// [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) -// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. -// [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). -// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. - -#include "../imgui.h" -#include "imgui_impl_win32.h" -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - -// Using XInput library for gamepad (with recent Windows SDK this may leads to executables which won't run on Windows 7) -#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD -#include -#else -#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT -#endif -#if defined(_MSC_VER) && !defined(IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT) -#pragma comment(lib, "xinput") -//#pragma comment(lib, "Xinput9_1_0") -#endif - -// CHANGELOG -// (minor and older changes stripped away, please see git history for details) -// 2020-03-03: Inputs: Calling AddInputCharacterUTF16() to support surrogate pairs leading to codepoint >= 0x10000 (for more complete CJK inputs) -// 2020-02-17: Added ImGui_ImplWin32_EnableDpiAwareness(), ImGui_ImplWin32_GetDpiScaleForHwnd(), ImGui_ImplWin32_GetDpiScaleForMonitor() helper functions. -// 2020-01-14: Inputs: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD/IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT. -// 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor. -// 2019-05-11: Inputs: Don't filter value from WM_CHAR before calling AddInputCharacter(). -// 2019-01-17: Misc: Using GetForegroundWindow()+IsChild() instead of GetActiveWindow() to be compatible with windows created in a different thread or parent. -// 2019-01-17: Inputs: Added support for mouse buttons 4 and 5 via WM_XBUTTON* messages. -// 2019-01-15: Inputs: Added support for XInput gamepads (if ImGuiConfigFlags_NavEnableGamepad is set by user application). -// 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window. -// 2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor. -// 2018-06-10: Inputs: Fixed handling of mouse wheel messages to support fine position messages (typically sent by track-pads). -// 2018-06-08: Misc: Extracted imgui_impl_win32.cpp/.h away from the old combined DX9/DX10/DX11/DX12 examples. -// 2018-03-20: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors and ImGuiBackendFlags_HasSetMousePos flags + honor ImGuiConfigFlags_NoMouseCursorChange flag. -// 2018-02-20: Inputs: Added support for mouse cursors (ImGui::GetMouseCursor() value and WM_SETCURSOR message handling). -// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space. -// 2018-02-06: Inputs: Honoring the io.WantSetMousePos by repositioning the mouse (when using navigation and ImGuiConfigFlags_NavMoveMouse is set). -// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves. -// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support. -// 2018-01-08: Inputs: Added mapping for ImGuiKey_Insert. -// 2018-01-05: Inputs: Added WM_LBUTTONDBLCLK double-click handlers for window classes with the CS_DBLCLKS flag. -// 2017-10-23: Inputs: Added WM_SYSKEYDOWN / WM_SYSKEYUP handlers so e.g. the VK_MENU key can be read. -// 2017-10-23: Inputs: Using Win32 ::SetCapture/::GetCapture() to retrieve mouse positions outside the client area when dragging. -// 2016-11-12: Inputs: Only call Win32 ::SetCursor(NULL) when io.MouseDrawCursor is set. - - -#include "../../../Utils/Logger.h" - -// Win32 Data -static HWND g_hWnd = NULL; -static INT64 g_Time = 0; -static INT64 g_TicksPerSecond = 0; -static ImGuiMouseCursor g_LastMouseCursor = ImGuiMouseCursor_COUNT; -static bool g_HasGamepad = false; -static bool g_WantUpdateHasGamepad = true; - -// Functions -bool ImGui_ImplWin32_Init(void* hwnd) -{ - if (!::QueryPerformanceFrequency((LARGE_INTEGER *)&g_TicksPerSecond)) - return false; - if (!::QueryPerformanceCounter((LARGE_INTEGER *)&g_Time)) - return false; - - // Setup back-end capabilities flags - g_hWnd = (HWND)hwnd; - ImGuiIO& io = ImGui::GetIO(); - io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional) - io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used) - io.BackendPlatformName = "imgui_impl_win32"; - io.ImeWindowHandle = hwnd; - - // Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array that we will update during the application lifetime. - io.KeyMap[ImGuiKey_Tab] = VK_TAB; - io.KeyMap[ImGuiKey_LeftArrow] = VK_LEFT; - io.KeyMap[ImGuiKey_RightArrow] = VK_RIGHT; - io.KeyMap[ImGuiKey_UpArrow] = VK_UP; - io.KeyMap[ImGuiKey_DownArrow] = VK_DOWN; - io.KeyMap[ImGuiKey_PageUp] = VK_PRIOR; - io.KeyMap[ImGuiKey_PageDown] = VK_NEXT; - io.KeyMap[ImGuiKey_Home] = VK_HOME; - io.KeyMap[ImGuiKey_End] = VK_END; - io.KeyMap[ImGuiKey_Insert] = VK_INSERT; - io.KeyMap[ImGuiKey_Delete] = VK_DELETE; - io.KeyMap[ImGuiKey_Backspace] = VK_BACK; - io.KeyMap[ImGuiKey_Space] = VK_SPACE; - io.KeyMap[ImGuiKey_Enter] = VK_RETURN; - io.KeyMap[ImGuiKey_Escape] = VK_ESCAPE; - io.KeyMap[ImGuiKey_KeyPadEnter] = VK_RETURN; - io.KeyMap[ImGuiKey_A] = 'A'; - io.KeyMap[ImGuiKey_C] = 'C'; - io.KeyMap[ImGuiKey_V] = 'V'; - io.KeyMap[ImGuiKey_X] = 'X'; - io.KeyMap[ImGuiKey_Y] = 'Y'; - io.KeyMap[ImGuiKey_Z] = 'Z'; - - return true; -} - -void ImGui_ImplWin32_Shutdown() -{ - g_hWnd = (HWND)0; -} - -static bool ImGui_ImplWin32_UpdateMouseCursor() -{ - ImGuiIO& io = ImGui::GetIO(); - if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) - return false; - - ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor(); - if (imgui_cursor == ImGuiMouseCursor_None || io.MouseDrawCursor) - { - // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor - ::SetCursor(NULL); - } - else - { - // Show OS mouse cursor - LPTSTR win32_cursor = IDC_ARROW; - switch (imgui_cursor) - { - case ImGuiMouseCursor_Arrow: win32_cursor = IDC_ARROW; break; - case ImGuiMouseCursor_TextInput: win32_cursor = IDC_IBEAM; break; - case ImGuiMouseCursor_ResizeAll: win32_cursor = IDC_SIZEALL; break; - case ImGuiMouseCursor_ResizeEW: win32_cursor = IDC_SIZEWE; break; - case ImGuiMouseCursor_ResizeNS: win32_cursor = IDC_SIZENS; break; - case ImGuiMouseCursor_ResizeNESW: win32_cursor = IDC_SIZENESW; break; - case ImGuiMouseCursor_ResizeNWSE: win32_cursor = IDC_SIZENWSE; break; - case ImGuiMouseCursor_Hand: win32_cursor = IDC_HAND; break; - case ImGuiMouseCursor_NotAllowed: win32_cursor = IDC_NO; break; - } - ::SetCursor(::LoadCursor(NULL, win32_cursor)); - } - return true; -} - -static void ImGui_ImplWin32_UpdateMousePos() -{ - ImGuiIO& io = ImGui::GetIO(); - - // Set OS mouse position if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user) - if (io.WantSetMousePos) - { - POINT pos = { (int)io.MousePos.x, (int)io.MousePos.y }; - ::ClientToScreen(g_hWnd, &pos); - ::SetCursorPos(pos.x, pos.y); - } - - // Set mouse position - io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX); - POINT pos; - if (HWND active_window = ::GetForegroundWindow()) - if (active_window == g_hWnd || ::IsChild(active_window, g_hWnd)) - if (::GetCursorPos(&pos) && ::ScreenToClient(g_hWnd, &pos)) - io.MousePos = ImVec2((float)pos.x, (float)pos.y); -} - -// Gamepad navigation mapping -static void ImGui_ImplWin32_UpdateGamepads() -{ -#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD - ImGuiIO& io = ImGui::GetIO(); - memset(io.NavInputs, 0, sizeof(io.NavInputs)); - if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) - return; - - // Calling XInputGetState() every frame on disconnected gamepads is unfortunately too slow. - // Instead we refresh gamepad availability by calling XInputGetCapabilities() _only_ after receiving WM_DEVICECHANGE. - if (g_WantUpdateHasGamepad) - { - XINPUT_CAPABILITIES caps; - g_HasGamepad = (XInputGetCapabilities(0, XINPUT_FLAG_GAMEPAD, &caps) == ERROR_SUCCESS); - g_WantUpdateHasGamepad = false; - } - - XINPUT_STATE xinput_state; - io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad; - if (g_HasGamepad && XInputGetState(0, &xinput_state) == ERROR_SUCCESS) - { - const XINPUT_GAMEPAD& gamepad = xinput_state.Gamepad; - io.BackendFlags |= ImGuiBackendFlags_HasGamepad; - - #define MAP_BUTTON(NAV_NO, BUTTON_ENUM) { io.NavInputs[NAV_NO] = (gamepad.wButtons & BUTTON_ENUM) ? 1.0f : 0.0f; } - #define MAP_ANALOG(NAV_NO, VALUE, V0, V1) { float vn = (float)(VALUE - V0) / (float)(V1 - V0); if (vn > 1.0f) vn = 1.0f; if (vn > 0.0f && io.NavInputs[NAV_NO] < vn) io.NavInputs[NAV_NO] = vn; } - MAP_BUTTON(ImGuiNavInput_Activate, XINPUT_GAMEPAD_A); // Cross / A - MAP_BUTTON(ImGuiNavInput_Cancel, XINPUT_GAMEPAD_B); // Circle / B - MAP_BUTTON(ImGuiNavInput_Menu, XINPUT_GAMEPAD_X); // Square / X - MAP_BUTTON(ImGuiNavInput_Input, XINPUT_GAMEPAD_Y); // Triangle / Y - MAP_BUTTON(ImGuiNavInput_DpadLeft, XINPUT_GAMEPAD_DPAD_LEFT); // D-Pad Left - MAP_BUTTON(ImGuiNavInput_DpadRight, XINPUT_GAMEPAD_DPAD_RIGHT); // D-Pad Right - MAP_BUTTON(ImGuiNavInput_DpadUp, XINPUT_GAMEPAD_DPAD_UP); // D-Pad Up - MAP_BUTTON(ImGuiNavInput_DpadDown, XINPUT_GAMEPAD_DPAD_DOWN); // D-Pad Down - MAP_BUTTON(ImGuiNavInput_FocusPrev, XINPUT_GAMEPAD_LEFT_SHOULDER); // L1 / LB - MAP_BUTTON(ImGuiNavInput_FocusNext, XINPUT_GAMEPAD_RIGHT_SHOULDER); // R1 / RB - MAP_BUTTON(ImGuiNavInput_TweakSlow, XINPUT_GAMEPAD_LEFT_SHOULDER); // L1 / LB - MAP_BUTTON(ImGuiNavInput_TweakFast, XINPUT_GAMEPAD_RIGHT_SHOULDER); // R1 / RB - MAP_ANALOG(ImGuiNavInput_LStickLeft, gamepad.sThumbLX, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32768); - MAP_ANALOG(ImGuiNavInput_LStickRight, gamepad.sThumbLX, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767); - MAP_ANALOG(ImGuiNavInput_LStickUp, gamepad.sThumbLY, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767); - MAP_ANALOG(ImGuiNavInput_LStickDown, gamepad.sThumbLY, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32767); - #undef MAP_BUTTON - #undef MAP_ANALOG - } -#endif // #ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD -} - -void ImGui_ImplWin32_NewFrame() -{ - ImGuiIO& io = ImGui::GetIO(); - IM_ASSERT(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame()."); - - // Setup display size (every frame to accommodate for window resizing) - /*RECT rect; - ::GetClientRect(g_hWnd, &rect); - io.DisplaySize = ImVec2((float)(rect.right - rect.left), (float)(rect.bottom - rect.top)); - logF("Display: %f, %f", io.DisplaySize.x, io.DisplaySize.y); - */ - // Setup time step - INT64 current_time; - ::QueryPerformanceCounter((LARGE_INTEGER *)¤t_time); - io.DeltaTime = (float)(current_time - g_Time) / g_TicksPerSecond; - g_Time = current_time; - - // Read keyboard modifiers inputs - io.KeyCtrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0; - io.KeyShift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0; - io.KeyAlt = (::GetKeyState(VK_MENU) & 0x8000) != 0; - io.KeySuper = false; - // io.KeysDown[], io.MousePos, io.MouseDown[], io.MouseWheel: filled by the WndProc handler below. - - // Update OS mouse position - ImGui_ImplWin32_UpdateMousePos(); - - // Update OS mouse cursor with the cursor requested by imgui - ImGuiMouseCursor mouse_cursor = io.MouseDrawCursor ? ImGuiMouseCursor_None : ImGui::GetMouseCursor(); - if (g_LastMouseCursor != mouse_cursor) - { - g_LastMouseCursor = mouse_cursor; - ImGui_ImplWin32_UpdateMouseCursor(); - } - - // Update game controllers (if enabled and available) - ImGui_ImplWin32_UpdateGamepads(); -} - -// Allow compilation with old Windows SDK. MinGW doesn't have default _WIN32_WINNT/WINVER versions. -#ifndef WM_MOUSEHWHEEL -#define WM_MOUSEHWHEEL 0x020E -#endif -#ifndef DBT_DEVNODES_CHANGED -#define DBT_DEVNODES_CHANGED 0x0007 -#endif - -// Win32 message handler (process Win32 mouse/keyboard inputs, etc.) -// Call from your application's message handler. -// When implementing your own back-end, you can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if Dear ImGui wants to use your inputs. -// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application. -// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application. -// Generally you may always pass all inputs to Dear ImGui, and hide them from your application based on those two flags. -// PS: In this Win32 handler, we use the capture API (GetCapture/SetCapture/ReleaseCapture) to be able to read mouse coordinates when dragging mouse outside of our window bounds. -// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag. -#if 0 -// Copy this line into your .cpp file to forward declare the function. -extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -#endif -IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - if (ImGui::GetCurrentContext() == NULL) - return 0; - - ImGuiIO& io = ImGui::GetIO(); - switch (msg) - { - case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: - case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK: - case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK: - case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK: - { - int button = 0; - if (msg == WM_LBUTTONDOWN || msg == WM_LBUTTONDBLCLK) { button = 0; } - if (msg == WM_RBUTTONDOWN || msg == WM_RBUTTONDBLCLK) { button = 1; } - if (msg == WM_MBUTTONDOWN || msg == WM_MBUTTONDBLCLK) { button = 2; } - if (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONDBLCLK) { button = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 3 : 4; } - if (!ImGui::IsAnyMouseDown() && ::GetCapture() == NULL) - ::SetCapture(hwnd); - io.MouseDown[button] = true; - return 0; - } - case WM_LBUTTONUP: - case WM_RBUTTONUP: - case WM_MBUTTONUP: - case WM_XBUTTONUP: - { - int button = 0; - if (msg == WM_LBUTTONUP) { button = 0; } - if (msg == WM_RBUTTONUP) { button = 1; } - if (msg == WM_MBUTTONUP) { button = 2; } - if (msg == WM_XBUTTONUP) { button = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 3 : 4; } - io.MouseDown[button] = false; - if (!ImGui::IsAnyMouseDown() && ::GetCapture() == hwnd) - ::ReleaseCapture(); - return 0; - } - case WM_MOUSEWHEEL: - io.MouseWheel += (float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA; - return 0; - case WM_MOUSEHWHEEL: - io.MouseWheelH += (float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA; - return 0; - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - if (wParam < 256) - io.KeysDown[wParam] = 1; - return 0; - case WM_KEYUP: - case WM_SYSKEYUP: - if (wParam < 256) - io.KeysDown[wParam] = 0; - return 0; - case WM_CHAR: - // You can also use ToAscii()+GetKeyboardState() to retrieve characters. - if (wParam > 0 && wParam < 0x10000) - io.AddInputCharacterUTF16((unsigned short)wParam); - return 0; - case WM_SETCURSOR: - if (LOWORD(lParam) == HTCLIENT && ImGui_ImplWin32_UpdateMouseCursor()) - return 1; - return 0; - case WM_DEVICECHANGE: - if ((UINT)wParam == DBT_DEVNODES_CHANGED) - g_WantUpdateHasGamepad = true; - return 0; - } - return 0; -} - - -//-------------------------------------------------------------------------------------------------------- -// DPI-related helpers (optional) -//-------------------------------------------------------------------------------------------------------- -// - Use to enable DPI awareness without having to create an application manifest. -// - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. -// - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. -// but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, -// neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. -//--------------------------------------------------------------------------------------------------------- -// This is the scheme successfully used by GLFW (from which we borrowed some of the code) and other apps aiming to be highly portable. -// ImGui_ImplWin32_EnableDpiAwareness() is just a helper called by main.cpp, we don't call it automatically. -// If you are trying to implement your own back-end for your own engine, you may ignore that noise. -//--------------------------------------------------------------------------------------------------------- - -// Implement some of the functions and types normally declared in recent Windows SDK. -#if !defined(_versionhelpers_H_INCLUDED_) && !defined(_INC_VERSIONHELPERS) -static BOOL IsWindowsVersionOrGreater(WORD major, WORD minor, WORD sp) -{ - OSVERSIONINFOEXW osvi = { sizeof(osvi), major, minor, 0, 0, { 0 }, sp }; - DWORD mask = VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR; - ULONGLONG cond = ::VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL); - cond = ::VerSetConditionMask(cond, VER_MINORVERSION, VER_GREATER_EQUAL); - cond = ::VerSetConditionMask(cond, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - return ::VerifyVersionInfoW(&osvi, mask, cond); -} -#define IsWindows8Point1OrGreater() IsWindowsVersionOrGreater(HIBYTE(0x0602), LOBYTE(0x0602), 0) // _WIN32_WINNT_WINBLUE -#endif - -#ifndef DPI_ENUMS_DECLARED -typedef enum { PROCESS_DPI_UNAWARE = 0, PROCESS_SYSTEM_DPI_AWARE = 1, PROCESS_PER_MONITOR_DPI_AWARE = 2 } PROCESS_DPI_AWARENESS; -typedef enum { MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2, MDT_DEFAULT = MDT_EFFECTIVE_DPI } MONITOR_DPI_TYPE; -#endif -#ifndef _DPI_AWARENESS_CONTEXTS_ -DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); -#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE (DPI_AWARENESS_CONTEXT)-3 -#endif -#ifndef DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 -#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 (DPI_AWARENESS_CONTEXT)-4 -#endif -typedef HRESULT(WINAPI* PFN_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS); // Shcore.lib + dll, Windows 8.1+ -typedef HRESULT(WINAPI* PFN_GetDpiForMonitor)(HMONITOR, MONITOR_DPI_TYPE, UINT*, UINT*); // Shcore.lib + dll, Windows 8.1+ -typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_SetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); // User32.lib + dll, Windows 10 v1607+ (Creators Update) - -// Helper function to enable DPI awareness without setting up a manifest -void ImGui_ImplWin32_EnableDpiAwareness() -{ - // if (IsWindows10OrGreater()) // This needs a manifest to succeed. Instead we try to grab the function pointer! - { - static HINSTANCE user32_dll = ::LoadLibraryA("user32.dll"); // Reference counted per-process - if (PFN_SetThreadDpiAwarenessContext SetThreadDpiAwarenessContextFn = (PFN_SetThreadDpiAwarenessContext)::GetProcAddress(user32_dll, "SetThreadDpiAwarenessContext")) - { - SetThreadDpiAwarenessContextFn(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); - return; - } - } - if (IsWindows8Point1OrGreater()) - { - static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process - if (PFN_SetProcessDpiAwareness SetProcessDpiAwarenessFn = (PFN_SetProcessDpiAwareness)::GetProcAddress(shcore_dll, "SetProcessDpiAwareness")) - { - SetProcessDpiAwarenessFn(PROCESS_PER_MONITOR_DPI_AWARE); - return; - } - } - SetProcessDPIAware(); -} - -#ifdef _MSC_VER -#pragma comment(lib, "gdi32") // Link with gdi32.lib for GetDeviceCaps() -#endif - -float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor) -{ - UINT xdpi = 96, ydpi = 96; - if (IsWindows8Point1OrGreater()) - { - static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process - if (PFN_GetDpiForMonitor GetDpiForMonitorFn = (PFN_GetDpiForMonitor)::GetProcAddress(shcore_dll, "GetDpiForMonitor")) - GetDpiForMonitorFn((HMONITOR)monitor, MDT_EFFECTIVE_DPI, &xdpi, &ydpi); - } - else - { - const HDC dc = ::GetDC(NULL); - xdpi = ::GetDeviceCaps(dc, LOGPIXELSX); - ydpi = ::GetDeviceCaps(dc, LOGPIXELSY); - ::ReleaseDC(NULL, dc); - } - IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert! - return xdpi / 96.0f; -} - -float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd) -{ - HMONITOR monitor = ::MonitorFromWindow((HWND)hwnd, MONITOR_DEFAULTTONEAREST); - return ImGui_ImplWin32_GetDpiScaleForMonitor(monitor); -} - -//--------------------------------------------------------------------------------------------------------- diff --git a/include/imgui/examples/imgui_impl_win32.h b/include/imgui/examples/imgui_impl_win32.h deleted file mode 100644 index 57311da4..00000000 --- a/include/imgui/examples/imgui_impl_win32.h +++ /dev/null @@ -1,37 +0,0 @@ -// dear imgui: Platform Binding for Windows (standard windows API for 32 and 64 bits applications) -// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) - -// Implemented features: -// [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) -// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. -// [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). -// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. - -#pragma once -#include "../imgui.h" // IMGUI_IMPL_API - -IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); -IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); -IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); - -// Configuration -// - Disable gamepad support or linking with xinput.lib -//#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD -//#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT - -// Win32 message handler your application need to call. -// - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. -// - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. -#if 0 -extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -#endif - -// DPI-related helpers (optional) -// - Use to enable DPI awareness without having to create an application manifest. -// - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. -// - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. -// but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, -// neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. -IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); -IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd -IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor diff --git a/include/imgui/imconfig.h b/include/imgui/imconfig.h deleted file mode 100644 index c6817de7..00000000 --- a/include/imgui/imconfig.h +++ /dev/null @@ -1,108 +0,0 @@ -//----------------------------------------------------------------------------- -// COMPILE-TIME OPTIONS FOR DEAR IMGUI -// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. -// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. -//----------------------------------------------------------------------------- -// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/branch with your modifications to imconfig.h) -// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h" -// If you do so you need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include -// the imgui*.cpp files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures. -// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. -// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using. -//----------------------------------------------------------------------------- - -#pragma once - -//---- Define assertion handler. Defaults to calling assert(). -// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. -//#define IM_ASSERT(_EXPR) MyAssert(_EXPR) -//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts - -//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows -// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. -//#define IMGUI_API __declspec( dllexport ) -//#define IMGUI_API __declspec( dllimport ) - -//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. -//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS - -//---- Disable all of Dear ImGui or don't implement standard windows. -// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp. -//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty. -//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended. -//#define IMGUI_DISABLE_METRICS_WINDOW // Disable debug/metrics window: ShowMetricsWindow() will be empty. - -//---- Don't implement some functions to reduce linkage requirements. -//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. -//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow. -//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime). -//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default). -//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf) -//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself. -//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function. -//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions(). - -//---- Include imgui_user.h at the end of imgui.h as a convenience -//#define IMGUI_INCLUDE_IMGUI_USER_H - -//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) -//#define IMGUI_USE_BGRA_PACKED_COLOR - -//---- Use 32-bit for ImWchar (default is 16-bit) to support full unicode code points. -//#define IMGUI_USE_WCHAR32 - -//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version -// By default the embedded implementations are declared static and not available outside of imgui cpp files. -//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" -//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" -//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION -//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION - -//---- Unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined, use the much faster STB sprintf library implementation of vsnprintf instead of the one from the default C library. -// Note that stb_sprintf.h is meant to be provided by the user and available in the include path at compile time. Also, the compatibility checks of the arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf. -// #define IMGUI_USE_STB_SPRINTF - -//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. -// This will be inlined as part of ImVec2 and ImVec4 class declarations. -/* -#define IM_VEC2_CLASS_EXTRA \ - ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ - operator MyVec2() const { return MyVec2(x,y); } - -#define IM_VEC4_CLASS_EXTRA \ - ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ - operator MyVec4() const { return MyVec4(x,y,z,w); } -*/ - -//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices. -// Your renderer back-end will need to support it (most example renderer back-ends support both 16/32-bit indices). -// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. -// Read about ImGuiBackendFlags_RendererHasVtxOffset for details. -//#define ImDrawIdx unsigned int - -//---- Override ImDrawCallback signature (will need to modify renderer back-ends accordingly) -//struct ImDrawList; -//struct ImDrawCmd; -//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); -//#define ImDrawCallback MyImDrawCallback - -//---- Debug Tools: Macro to break in Debugger -// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) -//#define IM_DEBUG_BREAK IM_ASSERT(0) -//#define IM_DEBUG_BREAK __debugbreak() - -//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(), -// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.) -// This adds a small runtime cost which is why it is not enabled by default. -//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX - -//---- Debug Tools: Enable slower asserts -//#define IMGUI_DEBUG_PARANOID - -//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. -/* -namespace ImGui -{ - void MyFunction(const char* name, const MyMatrix44& v); -} -*/ diff --git a/include/imgui/imgui.cpp b/include/imgui/imgui.cpp deleted file mode 100644 index b57bb195..00000000 --- a/include/imgui/imgui.cpp +++ /dev/null @@ -1,10419 +0,0 @@ -// dear imgui, v1.76 -// (main code and documentation) - -// Help: -// - Read FAQ at http://dearimgui.org/faq -// - Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase. -// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. All applications in examples/ are doing that. -// Read imgui.cpp for details, links and comments. - -// Resources: -// - FAQ http://dearimgui.org/faq -// - Homepage & latest https://github.com/ocornut/imgui -// - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/3075 (please post your screenshots/video there!) -// - Glossary https://github.com/ocornut/imgui/wiki/Glossary -// - Wiki https://github.com/ocornut/imgui/wiki -// - Issues & support https://github.com/ocornut/imgui/issues - -// Developed by Omar Cornut and every direct or indirect contributors to the GitHub. -// See LICENSE.txt for copyright and licensing details (standard MIT License). -// This library is free but I need your support to sustain development and maintenance. -// Businesses: you can support continued development via invoiced technical support, maintenance and sponsoring contracts. Please reach out to "contact AT dearimgui.org". -// Individuals: you can support continued development via donations. See docs/README or web page. - -// It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library. -// Note that 'ImGui::' being a namespace, you can add functions into the namespace from your own source files, without -// modifying imgui.h or imgui.cpp. You may include imgui_internal.h to access internal data structures, but it doesn't -// come with any guarantee of forward compatibility. Discussing your changes on the GitHub Issue Tracker may lead you -// to a better solution or official support for them. - -/* - -Index of this file: - -DOCUMENTATION - -- MISSION STATEMENT -- END-USER GUIDE -- PROGRAMMER GUIDE - - READ FIRST - - HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI - - GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE - - HOW A SIMPLE APPLICATION MAY LOOK LIKE - - HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE - - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS -- API BREAKING CHANGES (read me when you update!) -- FREQUENTLY ASKED QUESTIONS (FAQ) - - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer) - -CODE -(search for "[SECTION]" in the code to find them) - -// [SECTION] INCLUDES -// [SECTION] FORWARD DECLARATIONS -// [SECTION] CONTEXT AND MEMORY ALLOCATORS -// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO) -// [SECTION] MISC HELPERS/UTILITIES (Geometry functions) -// [SECTION] MISC HELPERS/UTILITIES (String, Format, Hash functions) -// [SECTION] MISC HELPERS/UTILITIES (File functions) -// [SECTION] MISC HELPERS/UTILITIES (ImText* functions) -// [SECTION] MISC HELPERS/UTILITIES (Color functions) -// [SECTION] ImGuiStorage -// [SECTION] ImGuiTextFilter -// [SECTION] ImGuiTextBuffer -// [SECTION] ImGuiListClipper -// [SECTION] STYLING -// [SECTION] RENDER HELPERS -// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) -// [SECTION] ERROR CHECKING -// [SECTION] LAYOUT -// [SECTION] SCROLLING -// [SECTION] TOOLTIPS -// [SECTION] POPUPS -// [SECTION] KEYBOARD/GAMEPAD NAVIGATION -// [SECTION] DRAG AND DROP -// [SECTION] LOGGING/CAPTURING -// [SECTION] SETTINGS -// [SECTION] PLATFORM DEPENDENT HELPERS -// [SECTION] METRICS/DEBUG WINDOW - -*/ - -//----------------------------------------------------------------------------- -// DOCUMENTATION -//----------------------------------------------------------------------------- - -/* - - MISSION STATEMENT - ================= - - - Easy to use to create code-driven and data-driven tools. - - Easy to use to create ad hoc short-lived tools and long-lived, more elaborate tools. - - Easy to hack and improve. - - Minimize screen real-estate usage. - - Minimize setup and maintenance. - - Minimize state storage on user side. - - Portable, minimize dependencies, run on target (consoles, phones, etc.). - - Efficient runtime and memory consumption (NB- we do allocate when "growing" content e.g. creating a window,. - opening a tree node for the first time, etc. but a typical frame should not allocate anything). - - Designed for developers and content-creators, not the typical end-user! Some of the weaknesses includes: - - Doesn't look fancy, doesn't animate. - - Limited layout features, intricate layouts are typically crafted in code. - - - END-USER GUIDE - ============== - - - Double-click on title bar to collapse window. - - Click upper right corner to close a window, available when 'bool* p_open' is passed to ImGui::Begin(). - - Click and drag on lower right corner to resize window (double-click to auto fit window to its contents). - - Click and drag on any empty space to move window. - - TAB/SHIFT+TAB to cycle through keyboard editable fields. - - CTRL+Click on a slider or drag box to input value as text. - - Use mouse wheel to scroll. - - Text editor: - - Hold SHIFT or use mouse to select text. - - CTRL+Left/Right to word jump. - - CTRL+Shift+Left/Right to select words. - - CTRL+A our Double-Click to select all. - - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/ - - CTRL+Z,CTRL+Y to undo/redo. - - ESCAPE to revert text to its original value. - - You can apply arithmetic operators +,*,/ on numerical values. Use +- to subtract (because - would set a negative value!) - - Controls are automatically adjusted for OSX to match standard OSX text editing operations. - - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard. - - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. See suggested mappings in imgui.h ImGuiNavInput_ + download PNG/PSD at http://goo.gl/9LgVZW - - - PROGRAMMER GUIDE - ================ - - READ FIRST - ---------- - - Remember to read the FAQ (https://www.dearimgui.org/faq) - - Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic, there are no construction - or destruction steps, less superfluous data retention on your side, less state duplication, less state synchronization, less bugs. - - Call and read ImGui::ShowDemoWindow() for demo code demonstrating most features. - - The library is designed to be built from sources. Avoid pre-compiled binaries and packaged versions. See imconfig.h to configure your build. - - Dear ImGui is an implementation of the IMGUI paradigm (immediate-mode graphical user interface, a term coined by Casey Muratori). - You can learn about IMGUI principles at http://www.johno.se/book/imgui.html, http://mollyrocket.com/861 & more links in the FAQ. - - Dear ImGui is a "single pass" rasterizing implementation of the IMGUI paradigm, aimed at ease of use and high-performances. - For every application frame your UI code will be called only once. This is in contrast to e.g. Unity's own implementation of an IMGUI, - where the UI code is called multiple times ("multiple passes") from a single entry point. There are pros and cons to both approaches. - - Our origin are on the top-left. In axis aligned bounding boxes, Min = top-left, Max = bottom-right. - - This codebase is also optimized to yield decent performances with typical "Debug" builds settings. - - Please make sure you have asserts enabled (IM_ASSERT redirects to assert() by default, but can be redirected). - If you get an assert, read the messages and comments around the assert. - - C++: this is a very C-ish codebase: we don't rely on C++11, we don't include any C++ headers, and ImGui:: is a namespace. - - C++: ImVec2/ImVec4 do not expose math operators by default, because it is expected that you use your own math types. - See FAQ "How can I use my own math types instead of ImVec2/ImVec4?" for details about setting up imconfig.h for that. - However, imgui_internal.h can optionally export math operators for ImVec2/ImVec4, which we use in this codebase. - - C++: pay attention that ImVector<> manipulates plain-old-data and does not honor construction/destruction (avoid using it in your code!). - - - HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI - ---------------------------------------------- - - Overwrite all the sources files except for imconfig.h (if you have made modification to your copy of imconfig.h) - - Or maintain your own branch where you have imconfig.h modified. - - Read the "API BREAKING CHANGES" section (below). This is where we list occasional API breaking changes. - If a function/type has been renamed / or marked obsolete, try to fix the name in your code before it is permanently removed - from the public API. If you have a problem with a missing function/symbols, search for its name in the code, there will - likely be a comment about it. Please report any issue to the GitHub page! - - Try to keep your copy of dear imgui reasonably up to date. - - - GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE - --------------------------------------------------------------- - - Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library. - - In the majority of cases you should be able to use unmodified back-ends files available in the examples/ folder. - - Add the Dear ImGui source files to your projects or using your preferred build system. - It is recommended you build and statically link the .cpp files as part of your project and NOT as shared library (DLL). - - You can later customize the imconfig.h file to tweak some compile-time behavior, such as integrating Dear ImGui types with your own maths types. - - When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them. - - Dear ImGui never touches or knows about your GPU state. The only function that knows about GPU is the draw function that you provide. - Effectively it means you can create widgets at any time in your code, regardless of considerations of being in "update" vs "render" - phases of your own application. All rendering information are stored into command-lists that you will retrieve after calling ImGui::Render(). - - Refer to the bindings and demo applications in the examples/ folder for instruction on how to setup your code. - - If you are running over a standard OS with a common graphics API, you should be able to use unmodified imgui_impl_*** files from the examples/ folder. - - - HOW A SIMPLE APPLICATION MAY LOOK LIKE - -------------------------------------- - EXHIBIT 1: USING THE EXAMPLE BINDINGS (= imgui_impl_XXX.cpp files from the examples/ folder). - The sub-folders in examples/ contains examples applications following this structure. - - // Application init: create a dear imgui context, setup some options, load fonts - ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); - // TODO: Set optional io.ConfigFlags values, e.g. 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard' to enable keyboard controls. - // TODO: Fill optional fields of the io structure later. - // TODO: Load TTF/OTF fonts if you don't want to use the default font. - - // Initialize helper Platform and Renderer bindings (here we are using imgui_impl_win32.cpp and imgui_impl_dx11.cpp) - ImGui_ImplWin32_Init(hwnd); - ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext); - - // Application main loop - while (true) - { - // Feed inputs to dear imgui, start new frame - ImGui_ImplDX11_NewFrame(); - ImGui_ImplWin32_NewFrame(); - ImGui::NewFrame(); - - // Any application code here - ImGui::Text("Hello, world!"); - - // Render dear imgui into screen - ImGui::Render(); - ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); - g_pSwapChain->Present(1, 0); - } - - // Shutdown - ImGui_ImplDX11_Shutdown(); - ImGui_ImplWin32_Shutdown(); - ImGui::DestroyContext(); - - EXHIBIT 2: IMPLEMENTING CUSTOM BINDING / CUSTOM ENGINE - - // Application init: create a dear imgui context, setup some options, load fonts - ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); - // TODO: Set optional io.ConfigFlags values, e.g. 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard' to enable keyboard controls. - // TODO: Fill optional fields of the io structure later. - // TODO: Load TTF/OTF fonts if you don't want to use the default font. - - // Build and load the texture atlas into a texture - // (In the examples/ app this is usually done within the ImGui_ImplXXX_Init() function from one of the demo Renderer) - int width, height; - unsigned char* pixels = NULL; - io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); - - // At this point you've got the texture data and you need to upload that your your graphic system: - // After we have created the texture, store its pointer/identifier (_in whichever format your engine uses_) in 'io.Fonts->TexID'. - // This will be passed back to your via the renderer. Basically ImTextureID == void*. Read FAQ for details about ImTextureID. - MyTexture* texture = MyEngine::CreateTextureFromMemoryPixels(pixels, width, height, TEXTURE_TYPE_RGBA32) - io.Fonts->TexID = (void*)texture; - - // Application main loop - while (true) - { - // Setup low-level inputs, e.g. on Win32: calling GetKeyboardState(), or write to those fields from your Windows message handlers, etc. - // (In the examples/ app this is usually done within the ImGui_ImplXXX_NewFrame() function from one of the demo Platform bindings) - io.DeltaTime = 1.0f/60.0f; // set the time elapsed since the previous frame (in seconds) - io.DisplaySize.x = 1920.0f; // set the current display width - io.DisplaySize.y = 1280.0f; // set the current display height here - io.MousePos = my_mouse_pos; // set the mouse position - io.MouseDown[0] = my_mouse_buttons[0]; // set the mouse button states - io.MouseDown[1] = my_mouse_buttons[1]; - - // Call NewFrame(), after this point you can use ImGui::* functions anytime - // (So you want to try calling NewFrame() as early as you can in your mainloop to be able to use Dear ImGui everywhere) - ImGui::NewFrame(); - - // Most of your application code here - ImGui::Text("Hello, world!"); - MyGameUpdate(); // may use any Dear ImGui functions, e.g. ImGui::Begin("My window"); ImGui::Text("Hello, world!"); ImGui::End(); - MyGameRender(); // may use any Dear ImGui functions as well! - - // Render dear imgui, swap buffers - // (You want to try calling EndFrame/Render as late as you can, to be able to use Dear ImGui in your own game rendering code) - ImGui::EndFrame(); - ImGui::Render(); - ImDrawData* draw_data = ImGui::GetDrawData(); - MyImGuiRenderFunction(draw_data); - SwapBuffers(); - } - - // Shutdown - ImGui::DestroyContext(); - - To decide whether to dispatch mouse/keyboard inputs to Dear ImGui to the rest your application, - you should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags! - Please read the FAQ and example applications for details about this! - - - HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE - --------------------------------------------- - The bindings in impl_impl_XXX.cpp files contains many working implementations of a rendering function. - - void void MyImGuiRenderFunction(ImDrawData* draw_data) - { - // TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled - // TODO: Setup viewport covering draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize - // TODO: Setup orthographic projection matrix cover draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize - // TODO: Setup shader: vertex { float2 pos, float2 uv, u32 color }, fragment shader sample color from 1 texture, multiply by vertex color. - for (int n = 0; n < draw_data->CmdListsCount; n++) - { - const ImDrawList* cmd_list = draw_data->CmdLists[n]; - const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; // vertex buffer generated by Dear ImGui - const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; // index buffer generated by Dear ImGui - for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) - { - const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; - if (pcmd->UserCallback) - { - pcmd->UserCallback(cmd_list, pcmd); - } - else - { - // The texture for the draw call is specified by pcmd->TextureId. - // The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization. - MyEngineBindTexture((MyTexture*)pcmd->TextureId); - - // We are using scissoring to clip some objects. All low-level graphics API should supports it. - // - If your engine doesn't support scissoring yet, you may ignore this at first. You will get some small glitches - // (some elements visible outside their bounds) but you can fix that once everything else works! - // - Clipping coordinates are provided in imgui coordinates space (from draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize) - // In a single viewport application, draw_data->DisplayPos will always be (0,0) and draw_data->DisplaySize will always be == io.DisplaySize. - // However, in the interest of supporting multi-viewport applications in the future (see 'viewport' branch on github), - // always subtract draw_data->DisplayPos from clipping bounds to convert them to your viewport space. - // - Note that pcmd->ClipRect contains Min+Max bounds. Some graphics API may use Min+Max, other may use Min+Size (size being Max-Min) - ImVec2 pos = draw_data->DisplayPos; - MyEngineScissor((int)(pcmd->ClipRect.x - pos.x), (int)(pcmd->ClipRect.y - pos.y), (int)(pcmd->ClipRect.z - pos.x), (int)(pcmd->ClipRect.w - pos.y)); - - // Render 'pcmd->ElemCount/3' indexed triangles. - // By default the indices ImDrawIdx are 16-bit, you can change them to 32-bit in imconfig.h if your engine doesn't support 16-bit indices. - MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer, vtx_buffer); - } - idx_buffer += pcmd->ElemCount; - } - } - } - - - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS - ------------------------------------------ - - The gamepad/keyboard navigation is fairly functional and keeps being improved. - - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PS4, Switch, XB1) without a mouse! - - You can ask questions and report issues at https://github.com/ocornut/imgui/issues/787 - - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. - - Keyboard: - - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. - NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. - - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag - will be set. For more advanced uses, you may want to read from: - - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set. - - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used). - - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions. - Please reach out if you think the game vs navigation input sharing could be improved. - - Gamepad: - - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. - - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame(). - Note that io.NavInputs[] is cleared by EndFrame(). - - See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. For each entry of io.NavInputs[], set the following values: - 0.0f= not held. 1.0f= fully held. Pass intermediate 0.0f..1.0f values for analog triggers/sticks. - - We uses a simple >0.0f test for activation testing, and won't attempt to test for a dead-zone. - Your code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). - - You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://goo.gl/9LgVZW. - - If you need to share inputs between your game and the imgui parts, the easiest approach is to go all-or-nothing, with a buttons combo - to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. - - Mouse: - - PS4 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback. - - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard. - - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. - Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements. - When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved. - When that happens your back-end NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the binding in examples/ do that. - (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse as moving back and forth!) - (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want - to set a boolean to ignore your other external mouse positions until the external source is moved again.) - - - API BREAKING CHANGES - ==================== - - Occasionally introducing changes that are breaking the API. We try to make the breakage minor and easy to fix. - Below is a change-log of API breaking changes only. If you are using one of the functions listed, expect to have to fix some code. - When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. - You can read releases logs https://github.com/ocornut/imgui/releases for more details. - - - 2020/01/22 (1.75) - ImDrawList::AddCircle()/AddCircleFilled() functions don't accept negative radius any more. - - 2019/12/17 (1.75) - [undid this change in 1.76] made Columns() limited to 64 columns by asserting above that limit. While the current code technically supports it, future code may not so we're putting the restriction ahead. - - 2019/12/13 (1.75) - [imgui_internal.h] changed ImRect() default constructor initializes all fields to 0.0f instead of (FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX). If you used ImRect::Add() to create bounding boxes by adding multiple points into it, you may need to fix your initial value. - - 2019/12/08 (1.75) - removed redirecting functions/enums that were marked obsolete in 1.53 (December 2017): - - ShowTestWindow() -> use ShowDemoWindow() - - IsRootWindowFocused() -> use IsWindowFocused(ImGuiFocusedFlags_RootWindow) - - IsRootWindowOrAnyChildFocused() -> use IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) - - SetNextWindowContentWidth(w) -> use SetNextWindowContentSize(ImVec2(w, 0.0f) - - GetItemsLineHeightWithSpacing() -> use GetFrameHeightWithSpacing() - - ImGuiCol_ChildWindowBg -> use ImGuiCol_ChildBg - - ImGuiStyleVar_ChildWindowRounding -> use ImGuiStyleVar_ChildRounding - - ImGuiTreeNodeFlags_AllowOverlapMode -> use ImGuiTreeNodeFlags_AllowItemOverlap - - IMGUI_DISABLE_TEST_WINDOWS -> use IMGUI_DISABLE_DEMO_WINDOWS - - 2019/12/08 (1.75) - obsoleted calling ImDrawList::PrimReserve() with a negative count (which was the vaguely documented and rarely if ever used). Instead we added an explicit PrimUnreserve() API. - - 2019/12/06 (1.75) - removed implicit default parameter to IsMouseDragging(int button = 0) to be consistent with other mouse functions (none of the other functions have it). - - 2019/11/21 (1.74) - ImFontAtlas::AddCustomRectRegular() now requires an ID larger than 0x110000 (instead of 0x10000) to conform with supporting Unicode planes 1-16 in a future update. ID below 0x110000 will now assert. - - 2019/11/19 (1.74) - renamed IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS to IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS for consistency. - - 2019/11/19 (1.74) - renamed IMGUI_DISABLE_MATH_FUNCTIONS to IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS for consistency. - - 2019/10/22 (1.74) - removed redirecting functions/enums that were marked obsolete in 1.52 (October 2017): - - Begin() [old 5 args version] -> use Begin() [3 args], use SetNextWindowSize() SetNextWindowBgAlpha() if needed - - IsRootWindowOrAnyChildHovered() -> use IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows) - - AlignFirstTextHeightToWidgets() -> use AlignTextToFramePadding() - - SetNextWindowPosCenter() -> use SetNextWindowPos() with a pivot of (0.5f, 0.5f) - - ImFont::Glyph -> use ImFontGlyph - - 2019/10/14 (1.74) - inputs: Fixed a miscalculation in the keyboard/mouse "typematic" repeat delay/rate calculation, used by keys and e.g. repeating mouse buttons as well as the GetKeyPressedAmount() function. - if you were using a non-default value for io.KeyRepeatRate (previous default was 0.250), you can add +io.KeyRepeatDelay to it to compensate for the fix. - The function was triggering on: 0.0 and (delay+rate*N) where (N>=1). Fixed formula responds to (N>=0). Effectively it made io.KeyRepeatRate behave like it was set to (io.KeyRepeatRate + io.KeyRepeatDelay). - If you never altered io.KeyRepeatRate nor used GetKeyPressedAmount() this won't affect you. - - 2019/07/15 (1.72) - removed TreeAdvanceToLabelPos() which is rarely used and only does SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()). Kept redirection function (will obsolete). - - 2019/07/12 (1.72) - renamed ImFontAtlas::CustomRect to ImFontAtlasCustomRect. Kept redirection typedef (will obsolete). - - 2019/06/14 (1.72) - removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017): ImGuiCol_Column*, ImGuiSetCond_*, IsItemHoveredRect(), IsPosHoveringAnyWindow(), IsMouseHoveringAnyWindow(), IsMouseHoveringWindow(), IMGUI_ONCE_UPON_A_FRAME. Grep this log for details and new names, or see how they were implemented until 1.71. - - 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have - overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering. - This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows. - Please reach out if you are affected. - - 2019/05/13 (1.71) - renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete). - - 2019/05/11 (1.71) - changed io.AddInputCharacter(unsigned short c) signature to io.AddInputCharacter(unsigned int c). - - 2019/04/29 (1.70) - improved ImDrawList thick strokes (>1.0f) preserving correct thickness up to 90 degrees angles (e.g. rectangles). If you have custom rendering using thick lines, they will appear thicker now. - - 2019/04/29 (1.70) - removed GetContentRegionAvailWidth(), use GetContentRegionAvail().x instead. Kept inline redirection function (will obsolete). - - 2019/03/04 (1.69) - renamed GetOverlayDrawList() to GetForegroundDrawList(). Kept redirection function (will obsolete). - - 2019/02/26 (1.69) - renamed ImGuiColorEditFlags_RGB/ImGuiColorEditFlags_HSV/ImGuiColorEditFlags_HEX to ImGuiColorEditFlags_DisplayRGB/ImGuiColorEditFlags_DisplayHSV/ImGuiColorEditFlags_DisplayHex. Kept redirection enums (will obsolete). - - 2019/02/14 (1.68) - made it illegal/assert when io.DisplayTime == 0.0f (with an exception for the first frame). If for some reason your time step calculation gives you a zero value, replace it with a dummy small value! - - 2019/02/01 (1.68) - removed io.DisplayVisibleMin/DisplayVisibleMax (which were marked obsolete and removed from viewport/docking branch already). - - 2019/01/06 (1.67) - renamed io.InputCharacters[], marked internal as was always intended. Please don't access directly, and use AddInputCharacter() instead! - - 2019/01/06 (1.67) - renamed ImFontAtlas::GlyphRangesBuilder to ImFontGlyphRangesBuilder. Kept redirection typedef (will obsolete). - - 2018/12/20 (1.67) - made it illegal to call Begin("") with an empty string. This somehow half-worked before but had various undesirable side-effects. - - 2018/12/10 (1.67) - renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges as we are doing a large pass on configuration flags. - - 2018/10/12 (1.66) - renamed misc/stl/imgui_stl.* to misc/cpp/imgui_stdlib.* in prevision for other C++ helper files. - - 2018/09/28 (1.66) - renamed SetScrollHere() to SetScrollHereY(). Kept redirection function (will obsolete). - - 2018/09/06 (1.65) - renamed stb_truetype.h to imstb_truetype.h, stb_textedit.h to imstb_textedit.h, and stb_rect_pack.h to imstb_rectpack.h. - If you were conveniently using the imgui copy of those STB headers in your project you will have to update your include paths. - - 2018/09/05 (1.65) - renamed io.OptCursorBlink/io.ConfigCursorBlink to io.ConfigInputTextCursorBlink. (#1427) - - 2018/08/31 (1.64) - added imgui_widgets.cpp file, extracted and moved widgets code out of imgui.cpp into imgui_widgets.cpp. Re-ordered some of the code remaining in imgui.cpp. - NONE OF THE FUNCTIONS HAVE CHANGED. THE CODE IS SEMANTICALLY 100% IDENTICAL, BUT _EVERY_ FUNCTION HAS BEEN MOVED. - Because of this, any local modifications to imgui.cpp will likely conflict when you update. Read docs/CHANGELOG.txt for suggestions. - - 2018/08/22 (1.63) - renamed IsItemDeactivatedAfterChange() to IsItemDeactivatedAfterEdit() for consistency with new IsItemEdited() API. Kept redirection function (will obsolete soonish as IsItemDeactivatedAfterChange() is very recent). - - 2018/08/21 (1.63) - renamed ImGuiTextEditCallback to ImGuiInputTextCallback, ImGuiTextEditCallbackData to ImGuiInputTextCallbackData for consistency. Kept redirection types (will obsolete). - - 2018/08/21 (1.63) - removed ImGuiInputTextCallbackData::ReadOnly since it is a duplication of (ImGuiInputTextCallbackData::Flags & ImGuiInputTextFlags_ReadOnly). - - 2018/08/01 (1.63) - removed per-window ImGuiWindowFlags_ResizeFromAnySide beta flag in favor of a global io.ConfigResizeWindowsFromEdges [update 1.67 renamed to ConfigWindowsResizeFromEdges] to enable the feature. - - 2018/08/01 (1.63) - renamed io.OptCursorBlink to io.ConfigCursorBlink [-> io.ConfigInputTextCursorBlink in 1.65], io.OptMacOSXBehaviors to ConfigMacOSXBehaviors for consistency. - - 2018/07/22 (1.63) - changed ImGui::GetTime() return value from float to double to avoid accumulating floating point imprecisions over time. - - 2018/07/08 (1.63) - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg for consistency with other features. Kept redirection enum (will obsolete). - - 2018/06/08 (1.62) - examples: the imgui_impl_xxx files have been split to separate platform (Win32, Glfw, SDL2, etc.) from renderer (DX11, OpenGL, Vulkan, etc.). - old bindings will still work as is, however prefer using the separated bindings as they will be updated to support multi-viewports. - when adopting new bindings follow the main.cpp code of your preferred examples/ folder to know which functions to call. - in particular, note that old bindings called ImGui::NewFrame() at the end of their ImGui_ImplXXXX_NewFrame() function. - - 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set. - - 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details. - - 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more. - If you used DragInt() with custom format strings, make sure you change them to use %d or an integer-compatible format. - To honor backward-compatibility, the DragInt() code will currently parse and modify format strings to replace %*f with %d, giving time to users to upgrade their code. - If you have IMGUI_DISABLE_OBSOLETE_FUNCTIONS enabled, the code will instead assert! You may run a reg-exp search on your codebase for e.g. "DragInt.*%f" to help you find them. - - 2018/04/28 (1.61) - obsoleted InputFloat() functions taking an optional "int decimal_precision" in favor of an equivalent and more flexible "const char* format", - consistent with other functions. Kept redirection functions (will obsolete). - - 2018/04/09 (1.61) - IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ reference, more consistent with expectation and allows passing r-value. - - 2018/03/20 (1.60) - renamed io.WantMoveMouse to io.WantSetMousePos for consistency and ease of understanding (was added in 1.52, _not_ used by core and only honored by some binding ahead of merging the Nav branch). - - 2018/03/12 (1.60) - removed ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered as the closing cross uses regular button colors now. - - 2018/03/08 (1.60) - changed ImFont::DisplayOffset.y to default to 0 instead of +1. Fixed rounding of Ascent/Descent to match TrueType renderer. If you were adding or subtracting to ImFont::DisplayOffset check if your fonts are correctly aligned vertically. - - 2018/03/03 (1.60) - renamed ImGuiStyleVar_Count_ to ImGuiStyleVar_COUNT and ImGuiMouseCursor_Count_ to ImGuiMouseCursor_COUNT for consistency with other public enums. - - 2018/02/18 (1.60) - BeginDragDropSource(): temporarily removed the optional mouse_button=0 parameter because it is not really usable in many situations at the moment. - - 2018/02/16 (1.60) - obsoleted the io.RenderDrawListsFn callback, you can call your graphics engine render function after ImGui::Render(). Use ImGui::GetDrawData() to retrieve the ImDrawData* to display. - - 2018/02/07 (1.60) - reorganized context handling to be more explicit, - - YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::DestroyContext() AT THE END. - - removed Shutdown() function, as DestroyContext() serve this purpose. - - you may pass a ImFontAtlas* pointer to CreateContext() to share a font atlas between contexts. Otherwise CreateContext() will create its own font atlas instance. - - removed allocator parameters from CreateContext(), they are now setup with SetAllocatorFunctions(), and shared by all contexts. - - removed the default global context and font atlas instance, which were confusing for users of DLL reloading and users of multiple contexts. - - 2018/01/31 (1.60) - moved sample TTF files from extra_fonts/ to misc/fonts/. If you loaded files directly from the imgui repo you may need to update your paths. - - 2018/01/11 (1.60) - obsoleted IsAnyWindowHovered() in favor of IsWindowHovered(ImGuiHoveredFlags_AnyWindow). Kept redirection function (will obsolete). - - 2018/01/11 (1.60) - obsoleted IsAnyWindowFocused() in favor of IsWindowFocused(ImGuiFocusedFlags_AnyWindow). Kept redirection function (will obsolete). - - 2018/01/03 (1.60) - renamed ImGuiSizeConstraintCallback to ImGuiSizeCallback, ImGuiSizeConstraintCallbackData to ImGuiSizeCallbackData. - - 2017/12/29 (1.60) - removed CalcItemRectClosestPoint() which was weird and not really used by anyone except demo code. If you need it it's easy to replicate on your side. - - 2017/12/24 (1.53) - renamed the emblematic ShowTestWindow() function to ShowDemoWindow(). Kept redirection function (will obsolete). - - 2017/12/21 (1.53) - ImDrawList: renamed style.AntiAliasedShapes to style.AntiAliasedFill for consistency and as a way to explicitly break code that manipulate those flag at runtime. You can now manipulate ImDrawList::Flags - - 2017/12/21 (1.53) - ImDrawList: removed 'bool anti_aliased = true' final parameter of ImDrawList::AddPolyline() and ImDrawList::AddConvexPolyFilled(). Prefer manipulating ImDrawList::Flags if you need to toggle them during the frame. - - 2017/12/14 (1.53) - using the ImGuiWindowFlags_NoScrollWithMouse flag on a child window forwards the mouse wheel event to the parent window, unless either ImGuiWindowFlags_NoInputs or ImGuiWindowFlags_NoScrollbar are also set. - - 2017/12/13 (1.53) - renamed GetItemsLineHeightWithSpacing() to GetFrameHeightWithSpacing(). Kept redirection function (will obsolete). - - 2017/12/13 (1.53) - obsoleted IsRootWindowFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootWindow). Kept redirection function (will obsolete). - - obsoleted IsRootWindowOrAnyChildFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows). Kept redirection function (will obsolete). - - 2017/12/12 (1.53) - renamed ImGuiTreeNodeFlags_AllowOverlapMode to ImGuiTreeNodeFlags_AllowItemOverlap. Kept redirection enum (will obsolete). - - 2017/12/10 (1.53) - removed SetNextWindowContentWidth(), prefer using SetNextWindowContentSize(). Kept redirection function (will obsolete). - - 2017/11/27 (1.53) - renamed ImGuiTextBuffer::append() helper to appendf(), appendv() to appendfv(). If you copied the 'Log' demo in your code, it uses appendv() so that needs to be renamed. - - 2017/11/18 (1.53) - Style, Begin: removed ImGuiWindowFlags_ShowBorders window flag. Borders are now fully set up in the ImGuiStyle structure (see e.g. style.FrameBorderSize, style.WindowBorderSize). Use ImGui::ShowStyleEditor() to look them up. - Please note that the style system will keep evolving (hopefully stabilizing in Q1 2018), and so custom styles will probably subtly break over time. It is recommended you use the StyleColorsClassic(), StyleColorsDark(), StyleColorsLight() functions. - - 2017/11/18 (1.53) - Style: removed ImGuiCol_ComboBg in favor of combo boxes using ImGuiCol_PopupBg for consistency. - - 2017/11/18 (1.53) - Style: renamed ImGuiCol_ChildWindowBg to ImGuiCol_ChildBg. - - 2017/11/18 (1.53) - Style: renamed style.ChildWindowRounding to style.ChildRounding, ImGuiStyleVar_ChildWindowRounding to ImGuiStyleVar_ChildRounding. - - 2017/11/02 (1.53) - obsoleted IsRootWindowOrAnyChildHovered() in favor of using IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); - - 2017/10/24 (1.52) - renamed IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS/IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS to IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS/IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS for consistency. - - 2017/10/20 (1.52) - changed IsWindowHovered() default parameters behavior to return false if an item is active in another window (e.g. click-dragging item from another window to this window). You can use the newly introduced IsWindowHovered() flags to requests this specific behavior if you need it. - - 2017/10/20 (1.52) - marked IsItemHoveredRect()/IsMouseHoveringWindow() as obsolete, in favor of using the newly introduced flags for IsItemHovered() and IsWindowHovered(). See https://github.com/ocornut/imgui/issues/1382 for details. - removed the IsItemRectHovered()/IsWindowRectHovered() names introduced in 1.51 since they were merely more consistent names for the two functions we are now obsoleting. - IsItemHoveredRect() --> IsItemHovered(ImGuiHoveredFlags_RectOnly) - IsMouseHoveringAnyWindow() --> IsWindowHovered(ImGuiHoveredFlags_AnyWindow) - IsMouseHoveringWindow() --> IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) [weird, old behavior] - - 2017/10/17 (1.52) - marked the old 5-parameters version of Begin() as obsolete (still available). Use SetNextWindowSize()+Begin() instead! - - 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept inline redirection function (will obsolete). - - 2017/09/26 (1.52) - renamed ImFont::Glyph to ImFontGlyph. Kept redirection typedef (will obsolete). - - 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the optional pivot information to do the same and more. Kept redirection function (will obsolete). - - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we now accept negative mouse coordinates. In your binding if you need to support unavailable mouse, make sure to replace "io.MousePos = ImVec2(-1,-1)" with "io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX)". - - 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete). -> (1.52) use IsItemHovered(ImGuiHoveredFlags_RectOnly)! - - renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirection function (will obsolete). - - renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirection function (will obsolete). - - 2017/08/20 (1.51) - renamed GetStyleColName() to GetStyleColorName() for consistency. - - 2017/08/20 (1.51) - added PushStyleColor(ImGuiCol idx, ImU32 col) overload, which _might_ cause an "ambiguous call" compilation error if you are using ImColor() with implicit cast. Cast to ImU32 or ImVec4 explicily to fix. - - 2017/08/15 (1.51) - marked the weird IMGUI_ONCE_UPON_A_FRAME helper macro as obsolete. prefer using the more explicit ImGuiOnceUponAFrame type. - - 2017/08/15 (1.51) - changed parameter order for BeginPopupContextWindow() from (const char*,int buttons,bool also_over_items) to (const char*,int buttons,bool also_over_items). Note that most calls relied on default parameters completely. - - 2017/08/13 (1.51) - renamed ImGuiCol_Column to ImGuiCol_Separator, ImGuiCol_ColumnHovered to ImGuiCol_SeparatorHovered, ImGuiCol_ColumnActive to ImGuiCol_SeparatorActive. Kept redirection enums (will obsolete). - - 2017/08/11 (1.51) - renamed ImGuiSetCond_Always to ImGuiCond_Always, ImGuiSetCond_Once to ImGuiCond_Once, ImGuiSetCond_FirstUseEver to ImGuiCond_FirstUseEver, ImGuiSetCond_Appearing to ImGuiCond_Appearing. Kept redirection enums (will obsolete). - - 2017/08/09 (1.51) - removed ValueColor() helpers, they are equivalent to calling Text(label) + SameLine() + ColorButton(). - - 2017/08/08 (1.51) - removed ColorEditMode() and ImGuiColorEditMode in favor of ImGuiColorEditFlags and parameters to the various Color*() functions. The SetColorEditOptions() allows to initialize default but the user can still change them with right-click context menu. - - changed prototype of 'ColorEdit4(const char* label, float col[4], bool show_alpha = true)' to 'ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0)', where passing flags = 0x01 is a safe no-op (hello dodgy backward compatibility!). - check and run the demo window, under "Color/Picker Widgets", to understand the various new options. - - changed prototype of rarely used 'ColorButton(ImVec4 col, bool small_height = false, bool outline_border = true)' to 'ColorButton(const char* desc_id, ImVec4 col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0,0))' - - 2017/07/20 (1.51) - removed IsPosHoveringAnyWindow(ImVec2), which was partly broken and misleading. ASSERT + redirect user to io.WantCaptureMouse - - 2017/05/26 (1.50) - removed ImFontConfig::MergeGlyphCenterV in favor of a more multipurpose ImFontConfig::GlyphOffset. - - 2017/05/01 (1.50) - renamed ImDrawList::PathFill() (rarely used directly) to ImDrawList::PathFillConvex() for clarity. - - 2016/11/06 (1.50) - BeginChild(const char*) now applies the stack id to the provided label, consistently with other functions as it should always have been. It shouldn't affect you unless (extremely unlikely) you were appending multiple times to a same child from different locations of the stack id. If that's the case, generate an id with GetId() and use it instead of passing string to BeginChild(). - - 2016/10/15 (1.50) - avoid 'void* user_data' parameter to io.SetClipboardTextFn/io.GetClipboardTextFn pointers. We pass io.ClipboardUserData to it. - - 2016/09/25 (1.50) - style.WindowTitleAlign is now a ImVec2 (ImGuiAlign enum was removed). set to (0.5f,0.5f) for horizontal+vertical centering, (0.0f,0.0f) for upper-left, etc. - - 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal. - - 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore. - If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you, otherwise if <1.0f you need tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar. - This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color: - ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); } - If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color. - - 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext(). - - 2016/05/02 (1.49) - renamed SetNextTreeNodeOpened() to SetNextTreeNodeOpen(), no redirection. - - 2016/05/01 (1.49) - obsoleted old signature of CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false) as extra parameters were badly designed and rarely used. You can replace the "default_open = true" flag in new API with CollapsingHeader(label, ImGuiTreeNodeFlags_DefaultOpen). - - 2016/04/26 (1.49) - changed ImDrawList::PushClipRect(ImVec4 rect) to ImDrawList::PushClipRect(Imvec2 min,ImVec2 max,bool intersect_with_current_clip_rect=false). Note that higher-level ImGui::PushClipRect() is preferable because it will clip at logic/widget level, whereas ImDrawList::PushClipRect() only affect your renderer. - - 2016/04/03 (1.48) - removed style.WindowFillAlphaDefault setting which was redundant. Bake default BG alpha inside style.Colors[ImGuiCol_WindowBg] and all other Bg color values. (ref github issue #337). - - 2016/04/03 (1.48) - renamed ImGuiCol_TooltipBg to ImGuiCol_PopupBg, used by popups/menus and tooltips. popups/menus were previously using ImGuiCol_WindowBg. (ref github issue #337) - - 2016/03/21 (1.48) - renamed GetWindowFont() to GetFont(), GetWindowFontSize() to GetFontSize(). Kept inline redirection function (will obsolete). - - 2016/03/02 (1.48) - InputText() completion/history/always callbacks: if you modify the text buffer manually (without using DeleteChars()/InsertChars() helper) you need to maintain the BufTextLen field. added an assert. - - 2016/01/23 (1.48) - fixed not honoring exact width passed to PushItemWidth(), previously it would add extra FramePadding.x*2 over that width. if you had manual pixel-perfect alignment in place it might affect you. - - 2015/12/27 (1.48) - fixed ImDrawList::AddRect() which used to render a rectangle 1 px too large on each axis. - - 2015/12/04 (1.47) - renamed Color() helpers to ValueColor() - dangerously named, rarely used and probably to be made obsolete. - - 2015/08/29 (1.45) - with the addition of horizontal scrollbar we made various fixes to inconsistencies with dealing with cursor position. - GetCursorPos()/SetCursorPos() functions now include the scrolled amount. It shouldn't affect the majority of users, but take note that SetCursorPosX(100.0f) puts you at +100 from the starting x position which may include scrolling, not at +100 from the window left side. - GetContentRegionMax()/GetWindowContentRegionMin()/GetWindowContentRegionMax() functions allow include the scrolled amount. Typically those were used in cases where no scrolling would happen so it may not be a problem, but watch out! - - 2015/08/29 (1.45) - renamed style.ScrollbarWidth to style.ScrollbarSize - - 2015/08/05 (1.44) - split imgui.cpp into extra files: imgui_demo.cpp imgui_draw.cpp imgui_internal.h that you need to add to your project. - - 2015/07/18 (1.44) - fixed angles in ImDrawList::PathArcTo(), PathArcToFast() (introduced in 1.43) being off by an extra PI for no justifiable reason - - 2015/07/14 (1.43) - add new ImFontAtlas::AddFont() API. For the old AddFont***, moved the 'font_no' parameter of ImFontAtlas::AddFont** functions to the ImFontConfig structure. - you need to render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of text. - - 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amount of CPU/GPU and enables us to get anti-aliasing for a marginal cost. - this necessary change will break your rendering function! the fix should be very easy. sorry for that :( - - if you are using a vanilla copy of one of the imgui_impl_XXXX.cpp provided in the example, you just need to update your copy and you can ignore the rest. - - the signature of the io.RenderDrawListsFn handler has changed! - old: ImGui_XXXX_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count) - new: ImGui_XXXX_RenderDrawLists(ImDrawData* draw_data). - parameters: 'cmd_lists' becomes 'draw_data->CmdLists', 'cmd_lists_count' becomes 'draw_data->CmdListsCount' - ImDrawList: 'commands' becomes 'CmdBuffer', 'vtx_buffer' becomes 'VtxBuffer', 'IdxBuffer' is new. - ImDrawCmd: 'vtx_count' becomes 'ElemCount', 'clip_rect' becomes 'ClipRect', 'user_callback' becomes 'UserCallback', 'texture_id' becomes 'TextureId'. - - each ImDrawList now contains both a vertex buffer and an index buffer. For each command, render ElemCount/3 triangles using indices from the index buffer. - - if you REALLY cannot render indexed primitives, you can call the draw_data->DeIndexAllBuffers() method to de-index the buffers. This is slow and a waste of CPU/GPU. Prefer using indexed rendering! - - refer to code in the examples/ folder or ask on the GitHub if you are unsure of how to upgrade. please upgrade! - - 2015/07/10 (1.43) - changed SameLine() parameters from int to float. - - 2015/07/02 (1.42) - renamed SetScrollPosHere() to SetScrollFromCursorPos(). Kept inline redirection function (will obsolete). - - 2015/07/02 (1.42) - renamed GetScrollPosY() to GetScrollY(). Necessary to reduce confusion along with other scrolling functions, because positions (e.g. cursor position) are not equivalent to scrolling amount. - - 2015/06/14 (1.41) - changed ImageButton() default bg_col parameter from (0,0,0,1) (black) to (0,0,0,0) (transparent) - makes a difference when texture have transparence - - 2015/06/14 (1.41) - changed Selectable() API from (label, selected, size) to (label, selected, flags, size). Size override should have been rarely be used. Sorry! - - 2015/05/31 (1.40) - renamed GetWindowCollapsed() to IsWindowCollapsed() for consistency. Kept inline redirection function (will obsolete). - - 2015/05/31 (1.40) - renamed IsRectClipped() to IsRectVisible() for consistency. Note that return value is opposite! Kept inline redirection function (will obsolete). - - 2015/05/27 (1.40) - removed the third 'repeat_if_held' parameter from Button() - sorry! it was rarely used and inconsistent. Use PushButtonRepeat(true) / PopButtonRepeat() to enable repeat on desired buttons. - - 2015/05/11 (1.40) - changed BeginPopup() API, takes a string identifier instead of a bool. ImGui needs to manage the open/closed state of popups. Call OpenPopup() to actually set the "open" state of a popup. BeginPopup() returns true if the popup is opened. - - 2015/05/03 (1.40) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same). - - 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function until 1.50. - - 2015/04/09 (1.38) - renamed ImDrawList::AddArc() to ImDrawList::AddArcFast() for compatibility with future API - - 2015/04/03 (1.38) - removed ImGuiCol_CheckHovered, ImGuiCol_CheckActive, replaced with the more general ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive. - - 2014/04/03 (1.38) - removed support for passing -FLT_MAX..+FLT_MAX as the range for a SliderFloat(). Use DragFloat() or Inputfloat() instead. - - 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function until 1.50. - - 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing - - 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function until 1.50. - - 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing) - - 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function until 1.50. - - 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once. - - 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now. - - 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior - - 2015/02/08 (1.31) - renamed GetTextLineSpacing() to GetTextLineHeightWithSpacing() - - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused) - - 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions. - - 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader. - - 2015/01/11 (1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels. - - old: const void* png_data; unsigned int png_size; ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size); [..Upload texture to GPU..]; - - new: unsigned char* pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); [..Upload texture to GPU..]; io.Fonts->TexId = YourTexIdentifier; - you now have more flexibility to load multiple TTF fonts and manage the texture buffer for internal needs. It is now recommended that you sample the font texture with bilinear interpolation. - - 2015/01/11 (1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render images). make sure to set io.Fonts->TexID. - - 2015/01/11 (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix) - - 2015/01/11 (1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets - - 2014/12/10 (1.18) - removed SetNewWindowDefaultPos() in favor of new generic API SetNextWindowPos(pos, ImGuiSetCondition_FirstUseEver) - - 2014/11/28 (1.17) - moved IO.Font*** options to inside the IO.Font-> structure (FontYOffset, FontTexUvForWhite, FontBaseScale, FontFallbackGlyph) - - 2014/11/26 (1.17) - reworked syntax of IMGUI_ONCE_UPON_A_FRAME helper macro to increase compiler compatibility - - 2014/11/07 (1.15) - renamed IsHovered() to IsItemHovered() - - 2014/10/02 (1.14) - renamed IMGUI_INCLUDE_IMGUI_USER_CPP to IMGUI_INCLUDE_IMGUI_USER_INL and imgui_user.cpp to imgui_user.inl (more IDE friendly) - - 2014/09/25 (1.13) - removed 'text_end' parameter from IO.SetClipboardTextFn (the string is now always zero-terminated for simplicity) - - 2014/09/24 (1.12) - renamed SetFontScale() to SetWindowFontScale() - - 2014/09/24 (1.12) - moved IM_MALLOC/IM_REALLOC/IM_FREE preprocessor defines to IO.MemAllocFn/IO.MemReallocFn/IO.MemFreeFn - - 2014/08/30 (1.09) - removed IO.FontHeight (now computed automatically) - - 2014/08/30 (1.09) - moved IMGUI_FONT_TEX_UV_FOR_WHITE preprocessor define to IO.FontTexUvForWhite - - 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fixes - - - FREQUENTLY ASKED QUESTIONS (FAQ) - ================================ - - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer) - Some answers are copied down here to facilitate searching in code. - - Q&A: Basics - =========== - - Q: Where is the documentation? - A: This library is poorly documented at the moment and expects of the user to be acquainted with C/C++. - - Run the examples/ and explore them. - - See demo code in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function. - - The demo covers most features of Dear ImGui, so you can read the code and see its output. - - See documentation and comments at the top of imgui.cpp + effectively imgui.h. - - Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the - examples/ folder to explain how to integrate Dear ImGui with your own engine/application. - - The Wiki (https://github.com/ocornut/imgui/wiki) has many resources and links. - - The Glossary (https://github.com/ocornut/imgui/wiki/Glossary) page also may be useful. - - Your programming IDE is your friend, find the type or function declaration to find comments - associated to it. - - Q: What is this library called? - Q: Which version should I get? - >> This library is called "Dear ImGui", please don't call it "ImGui" :) - >> See https://www.dearimgui.org/faq - - Q&A: Integration - ================ - - Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or to my application? - A: You should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags! - >> See https://www.dearimgui.org/faq for fully detailed answer. You really want to read this. - - Q. How can I enable keyboard controls? - Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display) - Q: I integrated Dear ImGui in my engine and the text or lines are blurry.. - Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around.. - >> See https://www.dearimgui.org/faq - - Q&A: Usage - ---------- - - Q: Why are multiple widgets reacting when I interact with a single one? - Q: How can I have multiple widgets with the same label or with an empty label? - A: A primer on labels and the ID Stack... - - Dear ImGui internally need to uniquely identify UI elements. - Elements that are typically not clickable (such as calls to the Text functions) don't need an ID. - Interactive widgets (such as calls to Button buttons) need a unique ID. - Unique ID are used internally to track active widgets and occasionally associate state to widgets. - Unique ID are implicitly built from the hash of multiple elements that identify the "path" to the UI element. - - - Unique ID are often derived from a string label: - - Button("OK"); // Label = "OK", ID = hash of (..., "OK") - Button("Cancel"); // Label = "Cancel", ID = hash of (..., "Cancel") - - - ID are uniquely scoped within windows, tree nodes, etc. which all pushes to the ID stack. Having - two buttons labeled "OK" in different windows or different tree locations is fine. - We used "..." above to signify whatever was already pushed to the ID stack previously: - - Begin("MyWindow"); - Button("OK"); // Label = "OK", ID = hash of ("MyWindow", "OK") - End(); - Begin("MyOtherWindow"); - Button("OK"); // Label = "OK", ID = hash of ("MyOtherWindow", "OK") - End(); - - - If you have a same ID twice in the same location, you'll have a conflict: - - Button("OK"); - Button("OK"); // ID collision! Interacting with either button will trigger the first one. - - Fear not! this is easy to solve and there are many ways to solve it! - - - Solving ID conflict in a simple/local context: - When passing a label you can optionally specify extra ID information within string itself. - Use "##" to pass a complement to the ID that won't be visible to the end-user. - This helps solving the simple collision cases when you know e.g. at compilation time which items - are going to be created: - - Begin("MyWindow"); - Button("Play"); // Label = "Play", ID = hash of ("MyWindow", "Play") - Button("Play##foo1"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo1") // Different from above - Button("Play##foo2"); // Label = "Play", ID = hash of ("MyWindow", "Play##foo2") // Different from above - End(); - - - If you want to completely hide the label, but still need an ID: - - Checkbox("##On", &b); // Label = "", ID = hash of (..., "##On") // No visible label, just a checkbox! - - - Occasionally/rarely you might want change a label while preserving a constant ID. This allows - you to animate labels. For example you may want to include varying information in a window title bar, - but windows are uniquely identified by their ID. Use "###" to pass a label that isn't part of ID: - - Button("Hello###ID"); // Label = "Hello", ID = hash of (..., "###ID") - Button("World###ID"); // Label = "World", ID = hash of (..., "###ID") // Same as above, even though the label looks different - - sprintf(buf, "My game (%f FPS)###MyGame", fps); - Begin(buf); // Variable title, ID = hash of "MyGame" - - - Solving ID conflict in a more general manner: - Use PushID() / PopID() to create scopes and manipulate the ID stack, as to avoid ID conflicts - within the same window. This is the most convenient way of distinguishing ID when iterating and - creating many UI elements programmatically. - You can push a pointer, a string or an integer value into the ID stack. - Remember that ID are formed from the concatenation of _everything_ pushed into the ID stack. - At each level of the stack we store the seed used for items at this level of the ID stack. - - Begin("Window"); - for (int i = 0; i < 100; i++) - { - PushID(i); // Push i to the id tack - Button("Click"); // Label = "Click", ID = hash of ("Window", i, "Click") - PopID(); - } - for (int i = 0; i < 100; i++) - { - MyObject* obj = Objects[i]; - PushID(obj); - Button("Click"); // Label = "Click", ID = hash of ("Window", obj pointer, "Click") - PopID(); - } - for (int i = 0; i < 100; i++) - { - MyObject* obj = Objects[i]; - PushID(obj->Name); - Button("Click"); // Label = "Click", ID = hash of ("Window", obj->Name, "Click") - PopID(); - } - End(); - - - You can stack multiple prefixes into the ID stack: - - Button("Click"); // Label = "Click", ID = hash of (..., "Click") - PushID("node"); - Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click") - PushID(my_ptr); - Button("Click"); // Label = "Click", ID = hash of (..., "node", my_ptr, "Click") - PopID(); - PopID(); - - - Tree nodes implicitly creates a scope for you by calling PushID(). - - Button("Click"); // Label = "Click", ID = hash of (..., "Click") - if (TreeNode("node")) // <-- this function call will do a PushID() for you (unless instructed not to, with a special flag) - { - Button("Click"); // Label = "Click", ID = hash of (..., "node", "Click") - TreePop(); - } - - - When working with trees, ID are used to preserve the open/close state of each tree node. - Depending on your use cases you may want to use strings, indices or pointers as ID. - e.g. when following a single pointer that may change over time, using a static string as ID - will preserve your node open/closed state when the targeted object change. - e.g. when displaying a list of objects, using indices or pointers as ID will preserve the - node open/closed state differently. See what makes more sense in your situation! - - Q: How can I display an image? What is ImTextureID, how does it works? - >> See https://www.dearimgui.org/faq and https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples - - Q: How can I use my own math types instead of ImVec2/ImVec4? - Q: How can I interact with standard C++ types (such as std::string and std::vector)? - Q: How can I display custom shapes? (using low-level ImDrawList API) - >> See https://www.dearimgui.org/faq - - Q&A: Fonts, Text - ================ - - Q: How can I load a different font than the default? - Q: How can I easily use icons in my application? - Q: How can I load multiple fonts? - Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic? - >> See https://www.dearimgui.org/faq and docs/FONTS.txt - - Q&A: Concerns - ============= - - Q: Who uses Dear ImGui? - Q: Can you create elaborate/serious tools with Dear ImGui? - Q: Can you reskin the look of Dear ImGui? - Q: Why using C++ (as opposed to C)? - >> See https://www.dearimgui.org/faq - - Q&A: Community - ============== - - Q: How can I help? - A: - Businesses: please reach out to "contact AT dearimgui.org" if you work in a place using Dear ImGui! - We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts. - This is among the most useful thing you can do for Dear ImGui. With increased funding we can hire more people working on this project. - - Individuals: you can support continued development via PayPal donations. See README. - - If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt - and see how you want to help and can help! - - Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc. - You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/3075). Visuals are ideal as they inspire other programmers. - But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions. - - If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues (on github or privately). - -*/ - -//------------------------------------------------------------------------- -// [SECTION] INCLUDES -//------------------------------------------------------------------------- - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include "imgui.h" -#ifndef IMGUI_DISABLE - -#ifndef IMGUI_DEFINE_MATH_OPERATORS -#define IMGUI_DEFINE_MATH_OPERATORS -#endif -#include "imgui_internal.h" - -// System includes -#include // toupper -#include // vsnprintf, sscanf, printf -#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier -#include // intptr_t -#else -#include // intptr_t -#endif - -// [Windows] OS specific includes (optional) -#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) -#define IMGUI_DISABLE_WIN32_FUNCTIONS -#endif -#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef NOMINMAX -#define NOMINMAX -#endif -#ifndef __MINGW32__ -#include // _wfopen, OpenClipboard -#else -#include -#endif -#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have all Win32 functions -#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS -#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS -#endif -#endif - -// [Apple] OS specific includes -#if defined(__APPLE__) -#include -#endif - -// Visual Studio warnings -#ifdef _MSC_VER -#pragma warning (disable: 4127) // condition expression is constant -#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen -#if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later -#pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types -#endif -#endif - -// Clang/GCC warnings with -Weverything -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wformat-pedantic *' // not all warnings are known by all clang versions.. so ignoring warnings triggers new warnings on some configuration. great! -#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. -#pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok. -#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code. -#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. -#pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference is. -#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // -#pragma clang diagnostic ignored "-Wformat-pedantic" // warning : format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic. -#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 -#endif -#if __has_warning("-Wdouble-promotion") -#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. -#endif -#elif defined(__GNUC__) -// We disable -Wpragmas because GCC doesn't provide an has_warning equivalent and some forks/patches may not following the warning/version association. -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used -#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size -#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*' -#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function -#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value -#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked -#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false -#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead -#endif - -// Debug options -#define IMGUI_DEBUG_NAV_SCORING 0 // Display navigation scoring preview when hovering items. Display last moving direction matches when holding CTRL -#define IMGUI_DEBUG_NAV_RECTS 0 // Display the reference navigation rectangle for each window -#define IMGUI_DEBUG_INI_SETTINGS 0 // Save additional comments in .ini file (particularly helps for Docking, but makes saving slower) - -// When using CTRL+TAB (or Gamepad Square+L/R) we delay the visual a little in order to reduce visual noise doing a fast switch. -static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f; // Time before the highlight and screen dimming starts fading in -static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time before the window list starts to appear - -// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by back-end) -static const float WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS = 4.0f; // Extend outside and inside windows. Affect FindHoveredWindow(). -static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time. -static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 2.00f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certaint time, unless mouse moved. - -//------------------------------------------------------------------------- -// [SECTION] FORWARD DECLARATIONS -//------------------------------------------------------------------------- - -static void SetCurrentWindow(ImGuiWindow* window); -static void FindHoveredWindow(); -static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags); -static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window, bool snap_on_edges); - -static void AddDrawListToDrawData(ImVector* out_list, ImDrawList* draw_list); -static void AddWindowToSortBuffer(ImVector* out_sorted_windows, ImGuiWindow* window); - -static ImRect GetViewportRect(); - -// Settings -static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name); -static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line); -static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer* buf); - -// Platform Dependents default implementation for IO functions -static const char* GetClipboardTextFn_DefaultImpl(void* user_data); -static void SetClipboardTextFn_DefaultImpl(void* user_data, const char* text); -static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y); - -namespace ImGui -{ -// Navigation -static void NavUpdate(); -static void NavUpdateWindowing(); -static void NavUpdateWindowingOverlay(); -static void NavUpdateMoveResult(); -static float NavUpdatePageUpPageDown(); -static inline void NavUpdateAnyRequestFlag(); -static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand); -static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, ImGuiID id); -static ImVec2 NavCalcPreferredRefPos(); -static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window); -static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window); -static int FindWindowFocusIndex(ImGuiWindow* window); - -// Error Checking -static void ErrorCheckNewFrameSanityChecks(); -static void ErrorCheckEndFrameSanityChecks(); -static void ErrorCheckBeginEndCompareStacksSize(ImGuiWindow* window, bool write); - -// Misc -static void UpdateSettings(); -static void UpdateMouseInputs(); -static void UpdateMouseWheel(); -static void UpdateTabFocus(); -static void UpdateDebugToolItemPicker(); -static bool UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]); -static void RenderWindowOuterBorders(ImGuiWindow* window); -static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size); -static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open); - -} - -//----------------------------------------------------------------------------- -// [SECTION] CONTEXT AND MEMORY ALLOCATORS -//----------------------------------------------------------------------------- - -// Current context pointer. Implicitly used by all Dear ImGui functions. Always assumed to be != NULL. -// ImGui::CreateContext() will automatically set this pointer if it is NULL. Change to a different context by calling ImGui::SetCurrentContext(). -// 1) Important: globals are not shared across DLL boundaries! If you use DLLs or any form of hot-reloading: you will need to call -// SetCurrentContext() (with the pointer you got from CreateContext) from each unique static/DLL boundary, and after each hot-reloading. -// In your debugger, add GImGui to your watch window and notice how its value changes depending on which location you are currently stepping into. -// 2) Important: Dear ImGui functions are not thread-safe because of this pointer. -// If you want thread-safety to allow N threads to access N different contexts, you can: -// - Change this variable to use thread local storage so each thread can refer to a different context, in imconfig.h: -// struct ImGuiContext; -// extern thread_local ImGuiContext* MyImGuiTLS; -// #define GImGui MyImGuiTLS -// And then define MyImGuiTLS in one of your cpp file. Note that thread_local is a C++11 keyword, earlier C++ uses compiler-specific keyword. -// - Future development aim to make this context pointer explicit to all calls. Also read https://github.com/ocornut/imgui/issues/586 -// - If you need a finite number of contexts, you may compile and use multiple instances of the ImGui code from different namespace. -#ifndef GImGui -ImGuiContext* GImGui = NULL; -#endif - -// Memory Allocator functions. Use SetAllocatorFunctions() to change them. -// If you use DLL hotreloading you might need to call SetAllocatorFunctions() after reloading code from this file. -// Otherwise, you probably don't want to modify them mid-program, and if you use global/static e.g. ImVector<> instances you may need to keep them accessible during program destruction. -#ifndef IMGUI_DISABLE_DEFAULT_ALLOCATORS -static void* MallocWrapper(size_t size, void* user_data) { IM_UNUSED(user_data); return malloc(size); } -static void FreeWrapper(void* ptr, void* user_data) { IM_UNUSED(user_data); free(ptr); } -#else -static void* MallocWrapper(size_t size, void* user_data) { IM_UNUSED(user_data); IM_UNUSED(size); IM_ASSERT(0); return NULL; } -static void FreeWrapper(void* ptr, void* user_data) { IM_UNUSED(user_data); IM_UNUSED(ptr); IM_ASSERT(0); } -#endif - -static void* (*GImAllocatorAllocFunc)(size_t size, void* user_data) = MallocWrapper; -static void (*GImAllocatorFreeFunc)(void* ptr, void* user_data) = FreeWrapper; -static void* GImAllocatorUserData = NULL; - -//----------------------------------------------------------------------------- -// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO) -//----------------------------------------------------------------------------- - -ImGuiStyle::ImGuiStyle() -{ - Alpha = 1.0f; // Global alpha applies to everything in ImGui - WindowPadding = ImVec2(8,8); // Padding within a window - WindowRounding = 7.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows - WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested. - WindowMinSize = ImVec2(32,32); // Minimum window size - WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text - WindowMenuButtonPosition= ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left. - ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows - ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested. - PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows - PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested. - FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets) - FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets). - FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested. - ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines - ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) - TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! - IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). - ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). - ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar - ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar - GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar - GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. - TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. - TabBorderSize = 0.0f; // Thickness of border around tabs. - ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. - ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text. - SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. - DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. - DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. - MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. - AntiAliasedLines = true; // Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU. - AntiAliasedFill = true; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.) - CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. - CircleSegmentMaxError = 1.60f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. - - // Default theme - ImGui::StyleColorsDark(this); -} - -// To scale your entire UI (e.g. if you want your app to use High DPI or generally be DPI aware) you may use this helper function. Scaling the fonts is done separately and is up to you. -// Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times. -void ImGuiStyle::ScaleAllSizes(float scale_factor) -{ - WindowPadding = ImFloor(WindowPadding * scale_factor); - WindowRounding = ImFloor(WindowRounding * scale_factor); - WindowMinSize = ImFloor(WindowMinSize * scale_factor); - ChildRounding = ImFloor(ChildRounding * scale_factor); - PopupRounding = ImFloor(PopupRounding * scale_factor); - FramePadding = ImFloor(FramePadding * scale_factor); - FrameRounding = ImFloor(FrameRounding * scale_factor); - ItemSpacing = ImFloor(ItemSpacing * scale_factor); - ItemInnerSpacing = ImFloor(ItemInnerSpacing * scale_factor); - TouchExtraPadding = ImFloor(TouchExtraPadding * scale_factor); - IndentSpacing = ImFloor(IndentSpacing * scale_factor); - ColumnsMinSpacing = ImFloor(ColumnsMinSpacing * scale_factor); - ScrollbarSize = ImFloor(ScrollbarSize * scale_factor); - ScrollbarRounding = ImFloor(ScrollbarRounding * scale_factor); - GrabMinSize = ImFloor(GrabMinSize * scale_factor); - GrabRounding = ImFloor(GrabRounding * scale_factor); - TabRounding = ImFloor(TabRounding * scale_factor); - DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor); - DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor); - MouseCursorScale = ImFloor(MouseCursorScale * scale_factor); -} - -ImGuiIO::ImGuiIO() -{ - // Most fields are initialized with zero - memset(this, 0, sizeof(*this)); - IM_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT); // Our pre-C++11 IM_STATIC_ASSERT() macros triggers warning on modern compilers so we don't use it here. - - // Settings - ConfigFlags = ImGuiConfigFlags_None; - BackendFlags = ImGuiBackendFlags_None; - DisplaySize = ImVec2(-1.0f, -1.0f); - DeltaTime = 1.0f/60.0f; - IniSavingRate = 5.0f; - IniFilename = "imgui.ini"; - LogFilename = "imgui_log.txt"; - MouseDoubleClickTime = 0.30f; - MouseDoubleClickMaxDist = 6.0f; - for (int i = 0; i < ImGuiKey_COUNT; i++) - KeyMap[i] = -1; - KeyRepeatDelay = 0.275f; - KeyRepeatRate = 0.050f; - UserData = NULL; - - Fonts = NULL; - FontGlobalScale = 1.0f; - FontDefault = NULL; - FontAllowUserScaling = false; - DisplayFramebufferScale = ImVec2(1.0f, 1.0f); - - // Miscellaneous options - MouseDrawCursor = false; -#ifdef __APPLE__ - ConfigMacOSXBehaviors = true; // Set Mac OS X style defaults based on __APPLE__ compile time flag -#else - ConfigMacOSXBehaviors = false; -#endif - ConfigInputTextCursorBlink = true; - ConfigWindowsResizeFromEdges = true; - ConfigWindowsMoveFromTitleBarOnly = false; - ConfigWindowsMemoryCompactTimer = 60.0f; - - // Platform Functions - BackendPlatformName = BackendRendererName = NULL; - BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL; - GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations - SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; - ClipboardUserData = NULL; - ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl; - ImeWindowHandle = NULL; - -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - RenderDrawListsFn = NULL; -#endif - - // Input (NB: we already have memset zero the entire structure!) - MousePos = ImVec2(-FLT_MAX, -FLT_MAX); - MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX); - MouseDragThreshold = 6.0f; - for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f; - for (int i = 0; i < IM_ARRAYSIZE(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f; - for (int i = 0; i < IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0f; -} - -// Pass in translated ASCII characters for text input. -// - with glfw you can get those from the callback set in glfwSetCharCallback() -// - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message -void ImGuiIO::AddInputCharacter(unsigned int c) -{ - InputQueueCharacters.push_back(c > 0 && c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID); -} - -// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so -// we should save the high surrogate. -void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) -{ - if ((c & 0xFC00) == 0xD800) // High surrogate, must save - { - if (InputQueueSurrogate != 0) - InputQueueCharacters.push_back(0xFFFD); - InputQueueSurrogate = c; - return; - } - - ImWchar cp = c; - if (InputQueueSurrogate != 0) - { - if ((c & 0xFC00) != 0xDC00) // Invalid low surrogate - InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID); - else if (IM_UNICODE_CODEPOINT_MAX == (0xFFFF)) // Codepoint will not fit in ImWchar (extra parenthesis around 0xFFFF somehow fixes -Wunreachable-code with Clang) - cp = IM_UNICODE_CODEPOINT_INVALID; - else - cp = (ImWchar)(((InputQueueSurrogate - 0xD800) << 10) + (c - 0xDC00) + 0x10000); - InputQueueSurrogate = 0; - } - InputQueueCharacters.push_back(cp); -} - -void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) -{ - while (*utf8_chars != 0) - { - unsigned int c = 0; - utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL); - if (c > 0) - InputQueueCharacters.push_back((ImWchar)c); - } -} - -void ImGuiIO::ClearInputCharacters() -{ - InputQueueCharacters.resize(0); -} - -//----------------------------------------------------------------------------- -// [SECTION] MISC HELPERS/UTILITIES (Geometry functions) -//----------------------------------------------------------------------------- - -ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments) -{ - IM_ASSERT(num_segments > 0); // Use ImBezierClosestPointCasteljau() - ImVec2 p_last = p1; - ImVec2 p_closest; - float p_closest_dist2 = FLT_MAX; - float t_step = 1.0f / (float)num_segments; - for (int i_step = 1; i_step <= num_segments; i_step++) - { - ImVec2 p_current = ImBezierCalc(p1, p2, p3, p4, t_step * i_step); - ImVec2 p_line = ImLineClosestPoint(p_last, p_current, p); - float dist2 = ImLengthSqr(p - p_line); - if (dist2 < p_closest_dist2) - { - p_closest = p_line; - p_closest_dist2 = dist2; - } - p_last = p_current; - } - return p_closest; -} - -// Closely mimics PathBezierToCasteljau() in imgui_draw.cpp -static void BezierClosestPointCasteljauStep(const ImVec2& p, ImVec2& p_closest, ImVec2& p_last, float& p_closest_dist2, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level) -{ - float dx = x4 - x1; - float dy = y4 - y1; - float d2 = ((x2 - x4) * dy - (y2 - y4) * dx); - float d3 = ((x3 - x4) * dy - (y3 - y4) * dx); - d2 = (d2 >= 0) ? d2 : -d2; - d3 = (d3 >= 0) ? d3 : -d3; - if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy)) - { - ImVec2 p_current(x4, y4); - ImVec2 p_line = ImLineClosestPoint(p_last, p_current, p); - float dist2 = ImLengthSqr(p - p_line); - if (dist2 < p_closest_dist2) - { - p_closest = p_line; - p_closest_dist2 = dist2; - } - p_last = p_current; - } - else if (level < 10) - { - float x12 = (x1+x2)*0.5f, y12 = (y1+y2)*0.5f; - float x23 = (x2+x3)*0.5f, y23 = (y2+y3)*0.5f; - float x34 = (x3+x4)*0.5f, y34 = (y3+y4)*0.5f; - float x123 = (x12+x23)*0.5f, y123 = (y12+y23)*0.5f; - float x234 = (x23+x34)*0.5f, y234 = (y23+y34)*0.5f; - float x1234 = (x123+x234)*0.5f, y1234 = (y123+y234)*0.5f; - BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1); - BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1); - } -} - -// tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol -// Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically. -ImVec2 ImBezierClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol) -{ - IM_ASSERT(tess_tol > 0.0f); - ImVec2 p_last = p1; - ImVec2 p_closest; - float p_closest_dist2 = FLT_MAX; - BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, tess_tol, 0); - return p_closest; -} - -ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p) -{ - ImVec2 ap = p - a; - ImVec2 ab_dir = b - a; - float dot = ap.x * ab_dir.x + ap.y * ab_dir.y; - if (dot < 0.0f) - return a; - float ab_len_sqr = ab_dir.x * ab_dir.x + ab_dir.y * ab_dir.y; - if (dot > ab_len_sqr) - return b; - return a + ab_dir * dot / ab_len_sqr; -} - -bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p) -{ - bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f; - bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f; - bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f; - return ((b1 == b2) && (b2 == b3)); -} - -void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w) -{ - ImVec2 v0 = b - a; - ImVec2 v1 = c - a; - ImVec2 v2 = p - a; - const float denom = v0.x * v1.y - v1.x * v0.y; - out_v = (v2.x * v1.y - v1.x * v2.y) / denom; - out_w = (v0.x * v2.y - v2.x * v0.y) / denom; - out_u = 1.0f - out_v - out_w; -} - -ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p) -{ - ImVec2 proj_ab = ImLineClosestPoint(a, b, p); - ImVec2 proj_bc = ImLineClosestPoint(b, c, p); - ImVec2 proj_ca = ImLineClosestPoint(c, a, p); - float dist2_ab = ImLengthSqr(p - proj_ab); - float dist2_bc = ImLengthSqr(p - proj_bc); - float dist2_ca = ImLengthSqr(p - proj_ca); - float m = ImMin(dist2_ab, ImMin(dist2_bc, dist2_ca)); - if (m == dist2_ab) - return proj_ab; - if (m == dist2_bc) - return proj_bc; - return proj_ca; -} - -//----------------------------------------------------------------------------- -// [SECTION] MISC HELPERS/UTILITIES (String, Format, Hash functions) -//----------------------------------------------------------------------------- - -// Consider using _stricmp/_strnicmp under Windows or strcasecmp/strncasecmp. We don't actually use either ImStricmp/ImStrnicmp in the codebase any more. -int ImStricmp(const char* str1, const char* str2) -{ - int d; - while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } - return d; -} - -int ImStrnicmp(const char* str1, const char* str2, size_t count) -{ - int d = 0; - while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } - return d; -} - -void ImStrncpy(char* dst, const char* src, size_t count) -{ - if (count < 1) - return; - if (count > 1) - strncpy(dst, src, count - 1); - dst[count - 1] = 0; -} - -char* ImStrdup(const char* str) -{ - size_t len = strlen(str); - void* buf = IM_ALLOC(len + 1); - return (char*)memcpy(buf, (const void*)str, len + 1); -} - -char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src) -{ - size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1; - size_t src_size = strlen(src) + 1; - if (dst_buf_size < src_size) - { - IM_FREE(dst); - dst = (char*)IM_ALLOC(src_size); - if (p_dst_size) - *p_dst_size = src_size; - } - return (char*)memcpy(dst, (const void*)src, src_size); -} - -const char* ImStrchrRange(const char* str, const char* str_end, char c) -{ - const char* p = (const char*)memchr(str, (int)c, str_end - str); - return p; -} - -int ImStrlenW(const ImWchar* str) -{ - //return (int)wcslen((const wchar_t*)str); // FIXME-OPT: Could use this when wchar_t are 16-bit - int n = 0; - while (*str++) n++; - return n; -} - -// Find end-of-line. Return pointer will point to either first \n, either str_end. -const char* ImStreolRange(const char* str, const char* str_end) -{ - const char* p = (const char*)memchr(str, '\n', str_end - str); - return p ? p : str_end; -} - -const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line -{ - while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n') - buf_mid_line--; - return buf_mid_line; -} - -const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end) -{ - if (!needle_end) - needle_end = needle + strlen(needle); - - const char un0 = (char)toupper(*needle); - while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end)) - { - if (toupper(*haystack) == un0) - { - const char* b = needle + 1; - for (const char* a = haystack + 1; b < needle_end; a++, b++) - if (toupper(*a) != toupper(*b)) - break; - if (b == needle_end) - return haystack; - } - haystack++; - } - return NULL; -} - -// Trim str by offsetting contents when there's leading data + writing a \0 at the trailing position. We use this in situation where the cost is negligible. -void ImStrTrimBlanks(char* buf) -{ - char* p = buf; - while (p[0] == ' ' || p[0] == '\t') // Leading blanks - p++; - char* p_start = p; - while (*p != 0) // Find end of string - p++; - while (p > p_start && (p[-1] == ' ' || p[-1] == '\t')) // Trailing blanks - p--; - if (p_start != buf) // Copy memory if we had leading blanks - memmove(buf, p_start, p - p_start); - buf[p - p_start] = 0; // Zero terminate -} - -const char* ImStrSkipBlank(const char* str) -{ - while (str[0] == ' ' || str[0] == '\t') - str++; - return str; -} - -// A) MSVC version appears to return -1 on overflow, whereas glibc appears to return total count (which may be >= buf_size). -// Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm. -// B) When buf==NULL vsnprintf() will return the output size. -#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS - -// We support stb_sprintf which is much faster (see: https://github.com/nothings/stb/blob/master/stb_sprintf.h) -// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS -// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are -// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.) -#ifdef IMGUI_USE_STB_SPRINTF -#define STB_SPRINTF_IMPLEMENTATION -#include "stb_sprintf.h" -#endif - -#if defined(_MSC_VER) && !defined(vsnprintf) -#define vsnprintf _vsnprintf -#endif - -int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); -#ifdef IMGUI_USE_STB_SPRINTF - int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); -#else - int w = vsnprintf(buf, buf_size, fmt, args); -#endif - va_end(args); - if (buf == NULL) - return w; - if (w == -1 || w >= (int)buf_size) - w = (int)buf_size - 1; - buf[w] = 0; - return w; -} - -int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) -{ -#ifdef IMGUI_USE_STB_SPRINTF - int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); -#else - int w = vsnprintf(buf, buf_size, fmt, args); -#endif - if (buf == NULL) - return w; - if (w == -1 || w >= (int)buf_size) - w = (int)buf_size - 1; - buf[w] = 0; - return w; -} -#endif // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS - -// CRC32 needs a 1KB lookup table (not cache friendly) -// Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily: -// - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constructors, - make it thread-safe. -static const ImU32 GCrc32LookupTable[256] = -{ - 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, - 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, - 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, - 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, - 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, - 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, - 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, - 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, - 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, - 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, - 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, - 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F,0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, - 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, - 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, - 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9, - 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D, -}; - -// Known size hash -// It is ok to call ImHashData on a string with known length but the ### operator won't be supported. -// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. -ImU32 ImHashData(const void* data_p, size_t data_size, ImU32 seed) -{ - ImU32 crc = ~seed; - const unsigned char* data = (const unsigned char*)data_p; - const ImU32* crc32_lut = GCrc32LookupTable; - while (data_size-- != 0) - crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *data++]; - return ~crc; -} - -// Zero-terminated string hash, with support for ### to reset back to seed value -// We support a syntax of "label###id" where only "###id" is included in the hash, and only "label" gets displayed. -// Because this syntax is rarely used we are optimizing for the common case. -// - If we reach ### in the string we discard the hash so far and reset to the seed. -// - We don't do 'current += 2; continue;' after handling ### to keep the code smaller/faster (measured ~10% diff in Debug build) -// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. -ImU32 ImHashStr(const char* data_p, size_t data_size, ImU32 seed) -{ - seed = ~seed; - ImU32 crc = seed; - const unsigned char* data = (const unsigned char*)data_p; - const ImU32* crc32_lut = GCrc32LookupTable; - if (data_size != 0) - { - while (data_size-- != 0) - { - unsigned char c = *data++; - if (c == '#' && data_size >= 2 && data[0] == '#' && data[1] == '#') - crc = seed; - crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c]; - } - } - else - { - while (unsigned char c = *data++) - { - if (c == '#' && data[0] == '#' && data[1] == '#') - crc = seed; - crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c]; - } - } - return ~crc; -} - -//----------------------------------------------------------------------------- -// [SECTION] MISC HELPERS/UTILITIES (File functions) -//----------------------------------------------------------------------------- - -// Default file functions -#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS - -ImFileHandle ImFileOpen(const char* filename, const char* mode) -{ -#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__) - // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. - // Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32! - const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0); - const int mode_wsize = ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0); - ImVector buf; - buf.resize(filename_wsize + mode_wsize); - ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, (wchar_t*)&buf[0], filename_wsize); - ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, (wchar_t*)&buf[filename_wsize], mode_wsize); - return ::_wfopen((const wchar_t*)&buf[0], (const wchar_t*)&buf[filename_wsize]); -#else - return fopen(filename, mode); -#endif -} - -// We should in theory be using fseeko()/ftello() with off_t and _fseeki64()/_ftelli64() with __int64, waiting for the PR that does that in a very portable pre-C++11 zero-warnings way. -bool ImFileClose(ImFileHandle f) { return fclose(f) == 0; } -ImU64 ImFileGetSize(ImFileHandle f) { long off = 0, sz = 0; return ((off = ftell(f)) != -1 && !fseek(f, 0, SEEK_END) && (sz = ftell(f)) != -1 && !fseek(f, off, SEEK_SET)) ? (ImU64)sz : (ImU64)-1; } -ImU64 ImFileRead(void* data, ImU64 sz, ImU64 count, ImFileHandle f) { return fread(data, (size_t)sz, (size_t)count, f); } -ImU64 ImFileWrite(const void* data, ImU64 sz, ImU64 count, ImFileHandle f) { return fwrite(data, (size_t)sz, (size_t)count, f); } -#endif // #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS - -// Helper: Load file content into memory -// Memory allocated with IM_ALLOC(), must be freed by user using IM_FREE() == ImGui::MemFree() -// This can't really be used with "rt" because fseek size won't match read size. -void* ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_file_size, int padding_bytes) -{ - IM_ASSERT(filename && mode); - if (out_file_size) - *out_file_size = 0; - - ImFileHandle f; - if ((f = ImFileOpen(filename, mode)) == NULL) - return NULL; - - size_t file_size = (size_t)ImFileGetSize(f); - if (file_size == (size_t)-1) - { - ImFileClose(f); - return NULL; - } - - void* file_data = IM_ALLOC(file_size + padding_bytes); - if (file_data == NULL) - { - ImFileClose(f); - return NULL; - } - if (ImFileRead(file_data, 1, file_size, f) != file_size) - { - ImFileClose(f); - IM_FREE(file_data); - return NULL; - } - if (padding_bytes > 0) - memset((void*)(((char*)file_data) + file_size), 0, (size_t)padding_bytes); - - ImFileClose(f); - if (out_file_size) - *out_file_size = file_size; - - return file_data; -} - -//----------------------------------------------------------------------------- -// [SECTION] MISC HELPERS/UTILITIES (ImText* functions) -//----------------------------------------------------------------------------- - -// Convert UTF-8 to 32-bit character, process single character input. -// Based on stb_from_utf8() from github.com/nothings/stb/ -// We handle UTF-8 decoding error by skipping forward. -int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end) -{ - unsigned int c = (unsigned int)-1; - const unsigned char* str = (const unsigned char*)in_text; - if (!(*str & 0x80)) - { - c = (unsigned int)(*str++); - *out_char = c; - return 1; - } - if ((*str & 0xe0) == 0xc0) - { - *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string - if (in_text_end && in_text_end - (const char*)str < 2) return 1; - if (*str < 0xc2) return 2; - c = (unsigned int)((*str++ & 0x1f) << 6); - if ((*str & 0xc0) != 0x80) return 2; - c += (*str++ & 0x3f); - *out_char = c; - return 2; - } - if ((*str & 0xf0) == 0xe0) - { - *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string - if (in_text_end && in_text_end - (const char*)str < 3) return 1; - if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3; - if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below - c = (unsigned int)((*str++ & 0x0f) << 12); - if ((*str & 0xc0) != 0x80) return 3; - c += (unsigned int)((*str++ & 0x3f) << 6); - if ((*str & 0xc0) != 0x80) return 3; - c += (*str++ & 0x3f); - *out_char = c; - return 3; - } - if ((*str & 0xf8) == 0xf0) - { - *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string - if (in_text_end && in_text_end - (const char*)str < 4) return 1; - if (*str > 0xf4) return 4; - if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 4; - if (*str == 0xf4 && str[1] > 0x8f) return 4; // str[1] < 0x80 is checked below - c = (unsigned int)((*str++ & 0x07) << 18); - if ((*str & 0xc0) != 0x80) return 4; - c += (unsigned int)((*str++ & 0x3f) << 12); - if ((*str & 0xc0) != 0x80) return 4; - c += (unsigned int)((*str++ & 0x3f) << 6); - if ((*str & 0xc0) != 0x80) return 4; - c += (*str++ & 0x3f); - // utf-8 encodings of values used in surrogate pairs are invalid - if ((c & 0xFFFFF800) == 0xD800) return 4; - // If codepoint does not fit in ImWchar, use replacement character U+FFFD instead - if (c > IM_UNICODE_CODEPOINT_MAX) c = IM_UNICODE_CODEPOINT_INVALID; - *out_char = c; - return 4; - } - *out_char = 0; - return 0; -} - -int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) -{ - ImWchar* buf_out = buf; - ImWchar* buf_end = buf + buf_size; - while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) - { - unsigned int c; - in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); - if (c == 0) - break; - *buf_out++ = (ImWchar)c; - } - *buf_out = 0; - if (in_text_remaining) - *in_text_remaining = in_text; - return (int)(buf_out - buf); -} - -int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) -{ - int char_count = 0; - while ((!in_text_end || in_text < in_text_end) && *in_text) - { - unsigned int c; - in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); - if (c == 0) - break; - char_count++; - } - return char_count; -} - -// Based on stb_to_utf8() from github.com/nothings/stb/ -static inline int ImTextCharToUtf8(char* buf, int buf_size, unsigned int c) -{ - if (c < 0x80) - { - buf[0] = (char)c; - return 1; - } - if (c < 0x800) - { - if (buf_size < 2) return 0; - buf[0] = (char)(0xc0 + (c >> 6)); - buf[1] = (char)(0x80 + (c & 0x3f)); - return 2; - } - if (c < 0x10000) - { - if (buf_size < 3) return 0; - buf[0] = (char)(0xe0 + (c >> 12)); - buf[1] = (char)(0x80 + ((c>> 6) & 0x3f)); - buf[2] = (char)(0x80 + ((c ) & 0x3f)); - return 3; - } - if (c <= 0x10FFFF) - { - if (buf_size < 4) return 0; - buf[0] = (char)(0xf0 + (c >> 18)); - buf[1] = (char)(0x80 + ((c >> 12) & 0x3f)); - buf[2] = (char)(0x80 + ((c >> 6) & 0x3f)); - buf[3] = (char)(0x80 + ((c ) & 0x3f)); - return 4; - } - // Invalid code point, the max unicode is 0x10FFFF - return 0; -} - -// Not optimal but we very rarely use this function. -int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end) -{ - unsigned int dummy = 0; - return ImTextCharFromUtf8(&dummy, in_text, in_text_end); -} - -static inline int ImTextCountUtf8BytesFromChar(unsigned int c) -{ - if (c < 0x80) return 1; - if (c < 0x800) return 2; - if (c < 0x10000) return 3; - if (c <= 0x10FFFF) return 4; - return 3; -} - -int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end) -{ - char* buf_out = buf; - const char* buf_end = buf + buf_size; - while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) - { - unsigned int c = (unsigned int)(*in_text++); - if (c < 0x80) - *buf_out++ = (char)c; - else - buf_out += ImTextCharToUtf8(buf_out, (int)(buf_end-buf_out-1), c); - } - *buf_out = 0; - return (int)(buf_out - buf); -} - -int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) -{ - int bytes_count = 0; - while ((!in_text_end || in_text < in_text_end) && *in_text) - { - unsigned int c = (unsigned int)(*in_text++); - if (c < 0x80) - bytes_count++; - else - bytes_count += ImTextCountUtf8BytesFromChar(c); - } - return bytes_count; -} - -//----------------------------------------------------------------------------- -// [SECTION] MISC HELPERS/UTILITIES (Color functions) -// Note: The Convert functions are early design which are not consistent with other API. -//----------------------------------------------------------------------------- - -IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b) -{ - float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.f; - int r = ImLerp((int)(col_a >> IM_COL32_R_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_R_SHIFT) & 0xFF, t); - int g = ImLerp((int)(col_a >> IM_COL32_G_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_G_SHIFT) & 0xFF, t); - int b = ImLerp((int)(col_a >> IM_COL32_B_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_B_SHIFT) & 0xFF, t); - return IM_COL32(r, g, b, 0xFF); -} - -ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in) -{ - float s = 1.0f/255.0f; - return ImVec4( - ((in >> IM_COL32_R_SHIFT) & 0xFF) * s, - ((in >> IM_COL32_G_SHIFT) & 0xFF) * s, - ((in >> IM_COL32_B_SHIFT) & 0xFF) * s, - ((in >> IM_COL32_A_SHIFT) & 0xFF) * s); -} - -ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in) -{ - ImU32 out; - out = ((ImU32)IM_F32_TO_INT8_SAT(in.x)) << IM_COL32_R_SHIFT; - out |= ((ImU32)IM_F32_TO_INT8_SAT(in.y)) << IM_COL32_G_SHIFT; - out |= ((ImU32)IM_F32_TO_INT8_SAT(in.z)) << IM_COL32_B_SHIFT; - out |= ((ImU32)IM_F32_TO_INT8_SAT(in.w)) << IM_COL32_A_SHIFT; - return out; -} - -// Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p592 -// Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv -void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v) -{ - float K = 0.f; - if (g < b) - { - ImSwap(g, b); - K = -1.f; - } - if (r < g) - { - ImSwap(r, g); - K = -2.f / 6.f - K; - } - - const float chroma = r - (g < b ? g : b); - out_h = ImFabs(K + (g - b) / (6.f * chroma + 1e-20f)); - out_s = chroma / (r + 1e-20f); - out_v = r; -} - -// Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593 -// also http://en.wikipedia.org/wiki/HSL_and_HSV -void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b) -{ - if (s == 0.0f) - { - // gray - out_r = out_g = out_b = v; - return; - } - - h = ImFmod(h, 1.0f) / (60.0f/360.0f); - int i = (int)h; - float f = h - (float)i; - float p = v * (1.0f - s); - float q = v * (1.0f - s * f); - float t = v * (1.0f - s * (1.0f - f)); - - switch (i) - { - case 0: out_r = v; out_g = t; out_b = p; break; - case 1: out_r = q; out_g = v; out_b = p; break; - case 2: out_r = p; out_g = v; out_b = t; break; - case 3: out_r = p; out_g = q; out_b = v; break; - case 4: out_r = t; out_g = p; out_b = v; break; - case 5: default: out_r = v; out_g = p; out_b = q; break; - } -} - -//----------------------------------------------------------------------------- -// [SECTION] ImGuiStorage -// Helper: Key->value storage -//----------------------------------------------------------------------------- - -// std::lower_bound but without the bullshit -static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector& data, ImGuiID key) -{ - ImGuiStorage::ImGuiStoragePair* first = data.Data; - ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size; - size_t count = (size_t)(last - first); - while (count > 0) - { - size_t count2 = count >> 1; - ImGuiStorage::ImGuiStoragePair* mid = first + count2; - if (mid->key < key) - { - first = ++mid; - count -= count2 + 1; - } - else - { - count = count2; - } - } - return first; -} - -// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. -void ImGuiStorage::BuildSortByKey() -{ - struct StaticFunc - { - static int IMGUI_CDECL PairCompareByID(const void* lhs, const void* rhs) - { - // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that. - if (((const ImGuiStoragePair*)lhs)->key > ((const ImGuiStoragePair*)rhs)->key) return +1; - if (((const ImGuiStoragePair*)lhs)->key < ((const ImGuiStoragePair*)rhs)->key) return -1; - return 0; - } - }; - if (Data.Size > 1) - ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairCompareByID); -} - -int ImGuiStorage::GetInt(ImGuiID key, int default_val) const -{ - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) - return default_val; - return it->val_i; -} - -bool ImGuiStorage::GetBool(ImGuiID key, bool default_val) const -{ - return GetInt(key, default_val ? 1 : 0) != 0; -} - -float ImGuiStorage::GetFloat(ImGuiID key, float default_val) const -{ - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) - return default_val; - return it->val_f; -} - -void* ImGuiStorage::GetVoidPtr(ImGuiID key) const -{ - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) - return NULL; - return it->val_p; -} - -// References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. -int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - it = Data.insert(it, ImGuiStoragePair(key, default_val)); - return &it->val_i; -} - -bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) -{ - return (bool*)GetIntRef(key, default_val ? 1 : 0); -} - -float* ImGuiStorage::GetFloatRef(ImGuiID key, float default_val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - it = Data.insert(it, ImGuiStoragePair(key, default_val)); - return &it->val_f; -} - -void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - it = Data.insert(it, ImGuiStoragePair(key, default_val)); - return &it->val_p; -} - -// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame) -void ImGuiStorage::SetInt(ImGuiID key, int val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { - Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_i = val; -} - -void ImGuiStorage::SetBool(ImGuiID key, bool val) -{ - SetInt(key, val ? 1 : 0); -} - -void ImGuiStorage::SetFloat(ImGuiID key, float val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { - Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_f = val; -} - -void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val) -{ - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { - Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_p = val; -} - -void ImGuiStorage::SetAllInt(int v) -{ - for (int i = 0; i < Data.Size; i++) - Data[i].val_i = v; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImGuiTextFilter -//----------------------------------------------------------------------------- - -// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" -ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) -{ - if (default_filter) - { - ImStrncpy(InputBuf, default_filter, IM_ARRAYSIZE(InputBuf)); - Build(); - } - else - { - InputBuf[0] = 0; - CountGrep = 0; - } -} - -bool ImGuiTextFilter::Draw(const char* label, float width) -{ - if (width != 0.0f) - ImGui::SetNextItemWidth(width); - bool value_changed = ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf)); - if (value_changed) - Build(); - return value_changed; -} - -void ImGuiTextFilter::ImGuiTextRange::split(char separator, ImVector* out) const -{ - out->resize(0); - const char* wb = b; - const char* we = wb; - while (we < e) - { - if (*we == separator) - { - out->push_back(ImGuiTextRange(wb, we)); - wb = we + 1; - } - we++; - } - if (wb != we) - out->push_back(ImGuiTextRange(wb, we)); -} - -void ImGuiTextFilter::Build() -{ - Filters.resize(0); - ImGuiTextRange input_range(InputBuf, InputBuf+strlen(InputBuf)); - input_range.split(',', &Filters); - - CountGrep = 0; - for (int i = 0; i != Filters.Size; i++) - { - ImGuiTextRange& f = Filters[i]; - while (f.b < f.e && ImCharIsBlankA(f.b[0])) - f.b++; - while (f.e > f.b && ImCharIsBlankA(f.e[-1])) - f.e--; - if (f.empty()) - continue; - if (Filters[i].b[0] != '-') - CountGrep += 1; - } -} - -bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const -{ - if (Filters.empty()) - return true; - - if (text == NULL) - text = ""; - - for (int i = 0; i != Filters.Size; i++) - { - const ImGuiTextRange& f = Filters[i]; - if (f.empty()) - continue; - if (f.b[0] == '-') - { - // Subtract - if (ImStristr(text, text_end, f.b + 1, f.e) != NULL) - return false; - } - else - { - // Grep - if (ImStristr(text, text_end, f.b, f.e) != NULL) - return true; - } - } - - // Implicit * grep - if (CountGrep == 0) - return true; - - return false; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImGuiTextBuffer -//----------------------------------------------------------------------------- - -// On some platform vsnprintf() takes va_list by reference and modifies it. -// va_copy is the 'correct' way to copy a va_list but Visual Studio prior to 2013 doesn't have it. -#ifndef va_copy -#if defined(__GNUC__) || defined(__clang__) -#define va_copy(dest, src) __builtin_va_copy(dest, src) -#else -#define va_copy(dest, src) (dest = src) -#endif -#endif - -char ImGuiTextBuffer::EmptyString[1] = { 0 }; - -void ImGuiTextBuffer::append(const char* str, const char* str_end) -{ - int len = str_end ? (int)(str_end - str) : (int)strlen(str); - - // Add zero-terminator the first time - const int write_off = (Buf.Size != 0) ? Buf.Size : 1; - const int needed_sz = write_off + len; - if (write_off + len >= Buf.Capacity) - { - int new_capacity = Buf.Capacity * 2; - Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity); - } - - Buf.resize(needed_sz); - memcpy(&Buf[write_off - 1], str, (size_t)len); - Buf[write_off - 1 + len] = 0; -} - -void ImGuiTextBuffer::appendf(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - appendfv(fmt, args); - va_end(args); -} - -// Helper: Text buffer for logging/accumulating text -void ImGuiTextBuffer::appendfv(const char* fmt, va_list args) -{ - va_list args_copy; - va_copy(args_copy, args); - - int len = ImFormatStringV(NULL, 0, fmt, args); // FIXME-OPT: could do a first pass write attempt, likely successful on first pass. - if (len <= 0) - { - va_end(args_copy); - return; - } - - // Add zero-terminator the first time - const int write_off = (Buf.Size != 0) ? Buf.Size : 1; - const int needed_sz = write_off + len; - if (write_off + len >= Buf.Capacity) - { - int new_capacity = Buf.Capacity * 2; - Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity); - } - - Buf.resize(needed_sz); - ImFormatStringV(&Buf[write_off - 1], (size_t)len + 1, fmt, args_copy); - va_end(args_copy); -} - -//----------------------------------------------------------------------------- -// [SECTION] ImGuiListClipper -// This is currently not as flexible/powerful as it should be and really confusing/spaghetti, mostly because we changed -// the API mid-way through development and support two ways to using the clipper, needs some rework (see TODO) -//----------------------------------------------------------------------------- - -// Helper to calculate coarse clipping of large list of evenly sized items. -// NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern. -// NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX -void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (g.LogEnabled) - { - // If logging is active, do not perform any clipping - *out_items_display_start = 0; - *out_items_display_end = items_count; - return; - } - if (window->SkipItems) - { - *out_items_display_start = *out_items_display_end = 0; - return; - } - - // We create the union of the ClipRect and the NavScoringRect which at worst should be 1 page away from ClipRect - ImRect unclipped_rect = window->ClipRect; - if (g.NavMoveRequest) - unclipped_rect.Add(g.NavScoringRect); - if (g.NavJustMovedToId && window->NavLastIds[0] == g.NavJustMovedToId) - unclipped_rect.Add(ImRect(window->Pos + window->NavRectRel[0].Min, window->Pos + window->NavRectRel[0].Max)); - - const ImVec2 pos = window->DC.CursorPos; - int start = (int)((unclipped_rect.Min.y - pos.y) / items_height); - int end = (int)((unclipped_rect.Max.y - pos.y) / items_height); - - // When performing a navigation request, ensure we have one item extra in the direction we are moving to - if (g.NavMoveRequest && g.NavMoveClipDir == ImGuiDir_Up) - start--; - if (g.NavMoveRequest && g.NavMoveClipDir == ImGuiDir_Down) - end++; - - start = ImClamp(start, 0, items_count); - end = ImClamp(end + 1, start, items_count); - *out_items_display_start = start; - *out_items_display_end = end; -} - -static void SetCursorPosYAndSetupDummyPrevLine(float pos_y, float line_height) -{ - // Set cursor position and a few other things so that SetScrollHereY() and Columns() can work when seeking cursor. - // FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code would stumble on the same issue. - // The clipper should probably have a 4th step to display the last item in a regular manner. - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - window->DC.CursorPos.y = pos_y; - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y); - window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage. - window->DC.PrevLineSize.y = (line_height - g.Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list. - if (ImGuiColumns* columns = window->DC.CurrentColumns) - columns->LineMinY = window->DC.CursorPos.y; // Setting this so that cell Y position are set properly -} - -// Use case A: Begin() called from constructor with items_height<0, then called again from Sync() in StepNo 1 -// Use case B: Begin() called from constructor with items_height>0 -// FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style. -void ImGuiListClipper::Begin(int count, float items_height) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - StartPosY = window->DC.CursorPos.y; - ItemsHeight = items_height; - ItemsCount = count; - StepNo = 0; - DisplayEnd = DisplayStart = -1; - if (ItemsHeight > 0.0f) - { - ImGui::CalcListClipping(ItemsCount, ItemsHeight, &DisplayStart, &DisplayEnd); // calculate how many to clip/display - if (DisplayStart > 0) - SetCursorPosYAndSetupDummyPrevLine(StartPosY + DisplayStart * ItemsHeight, ItemsHeight); // advance cursor - StepNo = 2; - } -} - -void ImGuiListClipper::End() -{ - if (ItemsCount < 0) - return; - // In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user. - if (ItemsCount < INT_MAX) - SetCursorPosYAndSetupDummyPrevLine(StartPosY + ItemsCount * ItemsHeight, ItemsHeight); // advance cursor - ItemsCount = -1; - StepNo = 3; -} - -bool ImGuiListClipper::Step() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - if (ItemsCount == 0 || window->SkipItems) - { - ItemsCount = -1; - return false; - } - if (StepNo == 0) // Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height. - { - DisplayStart = 0; - DisplayEnd = 1; - StartPosY = window->DC.CursorPos.y; - StepNo = 1; - return true; - } - if (StepNo == 1) // Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element. - { - if (ItemsCount == 1) { ItemsCount = -1; return false; } - float items_height = window->DC.CursorPos.y - StartPosY; - IM_ASSERT(items_height > 0.0f); // If this triggers, it means Item 0 hasn't moved the cursor vertically - Begin(ItemsCount - 1, items_height); - DisplayStart++; - DisplayEnd++; - StepNo = 3; - return true; - } - if (StepNo == 2) // Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user still call Step(). Does nothing and switch to Step 3. - { - IM_ASSERT(DisplayStart >= 0 && DisplayEnd >= 0); - StepNo = 3; - return true; - } - if (StepNo == 3) // Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop. - End(); - return false; -} - -//----------------------------------------------------------------------------- -// [SECTION] STYLING -//----------------------------------------------------------------------------- - -ImGuiStyle& ImGui::GetStyle() -{ - IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); - return GImGui->Style; -} - -ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul) -{ - ImGuiStyle& style = GImGui->Style; - ImVec4 c = style.Colors[idx]; - c.w *= style.Alpha * alpha_mul; - return ColorConvertFloat4ToU32(c); -} - -ImU32 ImGui::GetColorU32(const ImVec4& col) -{ - ImGuiStyle& style = GImGui->Style; - ImVec4 c = col; - c.w *= style.Alpha; - return ColorConvertFloat4ToU32(c); -} - -const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx) -{ - ImGuiStyle& style = GImGui->Style; - return style.Colors[idx]; -} - -ImU32 ImGui::GetColorU32(ImU32 col) -{ - ImGuiStyle& style = GImGui->Style; - if (style.Alpha >= 1.0f) - return col; - ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT; - a = (ImU32)(a * style.Alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range. - return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT); -} - -// FIXME: This may incur a round-trip (if the end user got their data from a float4) but eventually we aim to store the in-flight colors as ImU32 -void ImGui::PushStyleColor(ImGuiCol idx, ImU32 col) -{ - ImGuiContext& g = *GImGui; - ImGuiColorMod backup; - backup.Col = idx; - backup.BackupValue = g.Style.Colors[idx]; - g.ColorModifiers.push_back(backup); - g.Style.Colors[idx] = ColorConvertU32ToFloat4(col); -} - -void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col) -{ - ImGuiContext& g = *GImGui; - ImGuiColorMod backup; - backup.Col = idx; - backup.BackupValue = g.Style.Colors[idx]; - g.ColorModifiers.push_back(backup); - g.Style.Colors[idx] = col; -} - -void ImGui::PopStyleColor(int count) -{ - ImGuiContext& g = *GImGui; - while (count > 0) - { - ImGuiColorMod& backup = g.ColorModifiers.back(); - g.Style.Colors[backup.Col] = backup.BackupValue; - g.ColorModifiers.pop_back(); - count--; - } -} - -struct ImGuiStyleVarInfo -{ - ImGuiDataType Type; - ImU32 Count; - ImU32 Offset; - void* GetVarPtr(ImGuiStyle* style) const { return (void*)((unsigned char*)style + Offset); } -}; - -static const ImGuiStyleVarInfo GStyleVarInfo[] = -{ - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign -}; - -static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx) -{ - IM_ASSERT(idx >= 0 && idx < ImGuiStyleVar_COUNT); - IM_ASSERT(IM_ARRAYSIZE(GStyleVarInfo) == ImGuiStyleVar_COUNT); - return &GStyleVarInfo[idx]; -} - -void ImGui::PushStyleVar(ImGuiStyleVar idx, float val) -{ - const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); - if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1) - { - ImGuiContext& g = *GImGui; - float* pvar = (float*)var_info->GetVarPtr(&g.Style); - g.StyleModifiers.push_back(ImGuiStyleMod(idx, *pvar)); - *pvar = val; - return; - } - IM_ASSERT(0 && "Called PushStyleVar() float variant but variable is not a float!"); -} - -void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) -{ - const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); - if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2) - { - ImGuiContext& g = *GImGui; - ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); - g.StyleModifiers.push_back(ImGuiStyleMod(idx, *pvar)); - *pvar = val; - return; - } - IM_ASSERT(0 && "Called PushStyleVar() ImVec2 variant but variable is not a ImVec2!"); -} - -void ImGui::PopStyleVar(int count) -{ - ImGuiContext& g = *GImGui; - while (count > 0) - { - // We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it. - ImGuiStyleMod& backup = g.StyleModifiers.back(); - const ImGuiStyleVarInfo* info = GetStyleVarInfo(backup.VarIdx); - void* data = info->GetVarPtr(&g.Style); - if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; } - else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; } - g.StyleModifiers.pop_back(); - count--; - } -} - -const char* ImGui::GetStyleColorName(ImGuiCol idx) -{ - // Create switch-case from enum with regexp: ImGuiCol_{.*}, --> case ImGuiCol_\1: return "\1"; - switch (idx) - { - case ImGuiCol_Text: return "Text"; - case ImGuiCol_TextDisabled: return "TextDisabled"; - case ImGuiCol_WindowBg: return "WindowBg"; - case ImGuiCol_ChildBg: return "ChildBg"; - case ImGuiCol_PopupBg: return "PopupBg"; - case ImGuiCol_Border: return "Border"; - case ImGuiCol_BorderShadow: return "BorderShadow"; - case ImGuiCol_FrameBg: return "FrameBg"; - case ImGuiCol_FrameBgHovered: return "FrameBgHovered"; - case ImGuiCol_FrameBgActive: return "FrameBgActive"; - case ImGuiCol_TitleBg: return "TitleBg"; - case ImGuiCol_TitleBgActive: return "TitleBgActive"; - case ImGuiCol_TitleBgCollapsed: return "TitleBgCollapsed"; - case ImGuiCol_MenuBarBg: return "MenuBarBg"; - case ImGuiCol_ScrollbarBg: return "ScrollbarBg"; - case ImGuiCol_ScrollbarGrab: return "ScrollbarGrab"; - case ImGuiCol_ScrollbarGrabHovered: return "ScrollbarGrabHovered"; - case ImGuiCol_ScrollbarGrabActive: return "ScrollbarGrabActive"; - case ImGuiCol_CheckMark: return "CheckMark"; - case ImGuiCol_SliderGrab: return "SliderGrab"; - case ImGuiCol_SliderGrabActive: return "SliderGrabActive"; - case ImGuiCol_Button: return "Button"; - case ImGuiCol_ButtonHovered: return "ButtonHovered"; - case ImGuiCol_ButtonActive: return "ButtonActive"; - case ImGuiCol_Header: return "Header"; - case ImGuiCol_HeaderHovered: return "HeaderHovered"; - case ImGuiCol_HeaderActive: return "HeaderActive"; - case ImGuiCol_Separator: return "Separator"; - case ImGuiCol_SeparatorHovered: return "SeparatorHovered"; - case ImGuiCol_SeparatorActive: return "SeparatorActive"; - case ImGuiCol_ResizeGrip: return "ResizeGrip"; - case ImGuiCol_ResizeGripHovered: return "ResizeGripHovered"; - case ImGuiCol_ResizeGripActive: return "ResizeGripActive"; - case ImGuiCol_Tab: return "Tab"; - case ImGuiCol_TabHovered: return "TabHovered"; - case ImGuiCol_TabActive: return "TabActive"; - case ImGuiCol_TabUnfocused: return "TabUnfocused"; - case ImGuiCol_TabUnfocusedActive: return "TabUnfocusedActive"; - case ImGuiCol_PlotLines: return "PlotLines"; - case ImGuiCol_PlotLinesHovered: return "PlotLinesHovered"; - case ImGuiCol_PlotHistogram: return "PlotHistogram"; - case ImGuiCol_PlotHistogramHovered: return "PlotHistogramHovered"; - case ImGuiCol_TextSelectedBg: return "TextSelectedBg"; - case ImGuiCol_DragDropTarget: return "DragDropTarget"; - case ImGuiCol_NavHighlight: return "NavHighlight"; - case ImGuiCol_NavWindowingHighlight: return "NavWindowingHighlight"; - case ImGuiCol_NavWindowingDimBg: return "NavWindowingDimBg"; - case ImGuiCol_ModalWindowDimBg: return "ModalWindowDimBg"; - } - IM_ASSERT(0); - return "Unknown"; -} - -//----------------------------------------------------------------------------- -// [SECTION] RENDER HELPERS -// Some of those (internal) functions are currently quite a legacy mess - their signature and behavior will change, -// we need a nicer separation between low-level functions and high-level functions relying on the ImGui context. -// Also see imgui_draw.cpp for some more which have been reworked to not rely on ImGui:: context. -//----------------------------------------------------------------------------- - -const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end) -{ - const char* text_display_end = text; - if (!text_end) - text_end = (const char*)-1; - - while (text_display_end < text_end && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#')) - text_display_end++; - return text_display_end; -} - -// Internal ImGui functions to render text -// RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() -void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - // Hide anything after a '##' string - const char* text_display_end; - if (hide_text_after_hash) - { - text_display_end = FindRenderedTextEnd(text, text_end); - } - else - { - if (!text_end) - text_end = text + strlen(text); // FIXME-OPT - text_display_end = text_end; - } - - if (text != text_display_end) - { - window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end); - if (g.LogEnabled) - LogRenderedText(&pos, text, text_display_end); - } -} - -void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - if (!text_end) - text_end = text + strlen(text); // FIXME-OPT - - if (text != text_end) - { - window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_end, wrap_width); - if (g.LogEnabled) - LogRenderedText(&pos, text, text_end); - } -} - -// Default clip_rect uses (pos_min,pos_max) -// Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges) -void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect) -{ - // Perform CPU side clipping for single clipped element to avoid using scissor state - ImVec2 pos = pos_min; - const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_display_end, false, 0.0f); - - const ImVec2* clip_min = clip_rect ? &clip_rect->Min : &pos_min; - const ImVec2* clip_max = clip_rect ? &clip_rect->Max : &pos_max; - bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y); - if (clip_rect) // If we had no explicit clipping rectangle then pos==clip_min - need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y); - - // Align whole block. We should defer that to the better rendering function when we'll have support for individual line alignment. - if (align.x > 0.0f) pos.x = ImMax(pos.x, pos.x + (pos_max.x - pos.x - text_size.x) * align.x); - if (align.y > 0.0f) pos.y = ImMax(pos.y, pos.y + (pos_max.y - pos.y - text_size.y) * align.y); - - // Render - if (need_clipping) - { - ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y); - draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect); - } - else - { - draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, NULL); - } -} - -void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect) -{ - // Hide anything after a '##' string - const char* text_display_end = FindRenderedTextEnd(text, text_end); - const int text_len = (int)(text_display_end - text); - if (text_len == 0) - return; - - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - RenderTextClippedEx(window->DrawList, pos_min, pos_max, text, text_display_end, text_size_if_known, align, clip_rect); - if (g.LogEnabled) - LogRenderedText(&pos_min, text, text_display_end); -} - - -// Another overly complex function until we reorganize everything into a nice all-in-one helper. -// This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display. -// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move. -void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end_full, const ImVec2* text_size_if_known) -{ - ImGuiContext& g = *GImGui; - if (text_end_full == NULL) - text_end_full = FindRenderedTextEnd(text); - const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_end_full, false, 0.0f); - - //draw_list->AddLine(ImVec2(pos_max.x, pos_min.y - 4), ImVec2(pos_max.x, pos_max.y + 4), IM_COL32(0, 0, 255, 255)); - //draw_list->AddLine(ImVec2(ellipsis_max_x, pos_min.y-2), ImVec2(ellipsis_max_x, pos_max.y+2), IM_COL32(0, 255, 0, 255)); - //draw_list->AddLine(ImVec2(clip_max_x, pos_min.y), ImVec2(clip_max_x, pos_max.y), IM_COL32(255, 0, 0, 255)); - // FIXME: We could technically remove (last_glyph->AdvanceX - last_glyph->X1) from text_size.x here and save a few pixels. - if (text_size.x > pos_max.x - pos_min.x) - { - // Hello wo... - // | | | - // min max ellipsis_max - // <-> this is generally some padding value - - const ImFont* font = draw_list->_Data->Font; - const float font_size = draw_list->_Data->FontSize; - const char* text_end_ellipsis = NULL; - - ImWchar ellipsis_char = font->EllipsisChar; - int ellipsis_char_count = 1; - if (ellipsis_char == (ImWchar)-1) - { - ellipsis_char = (ImWchar)'.'; - ellipsis_char_count = 3; - } - const ImFontGlyph* glyph = font->FindGlyph(ellipsis_char); - - float ellipsis_glyph_width = glyph->X1; // Width of the glyph with no padding on either side - float ellipsis_total_width = ellipsis_glyph_width; // Full width of entire ellipsis - - if (ellipsis_char_count > 1) - { - // Full ellipsis size without free spacing after it. - const float spacing_between_dots = 1.0f * (draw_list->_Data->FontSize / font->FontSize); - ellipsis_glyph_width = glyph->X1 - glyph->X0 + spacing_between_dots; - ellipsis_total_width = ellipsis_glyph_width * (float)ellipsis_char_count - spacing_between_dots; - } - - // We can now claim the space between pos_max.x and ellipsis_max.x - const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_total_width) - pos_min.x, 1.0f); - float text_size_clipped_x = font->CalcTextSizeA(font_size, text_avail_width, 0.0f, text, text_end_full, &text_end_ellipsis).x; - if (text == text_end_ellipsis && text_end_ellipsis < text_end_full) - { - // Always display at least 1 character if there's no room for character + ellipsis - text_end_ellipsis = text + ImTextCountUtf8BytesFromChar(text, text_end_full); - text_size_clipped_x = font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, text, text_end_ellipsis).x; - } - while (text_end_ellipsis > text && ImCharIsBlankA(text_end_ellipsis[-1])) - { - // Trim trailing space before ellipsis (FIXME: Supporting non-ascii blanks would be nice, for this we need a function to backtrack in UTF-8 text) - text_end_ellipsis--; - text_size_clipped_x -= font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, text_end_ellipsis, text_end_ellipsis + 1).x; // Ascii blanks are always 1 byte - } - - // Render text, render ellipsis - RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f)); - float ellipsis_x = pos_min.x + text_size_clipped_x; - if (ellipsis_x + ellipsis_total_width <= ellipsis_max_x) - for (int i = 0; i < ellipsis_char_count; i++) - { - font->RenderChar(draw_list, font_size, ImVec2(ellipsis_x, pos_min.y), GetColorU32(ImGuiCol_Text), ellipsis_char); - ellipsis_x += ellipsis_glyph_width; - } - } - else - { - RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_full, &text_size, ImVec2(0.0f, 0.0f)); - } - - if (g.LogEnabled) - LogRenderedText(&pos_min, text, text_end_full); -} - -// Render a rectangle shaped with optional rounding and borders -void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding); - const float border_size = g.Style.FrameBorderSize; - if (border && border_size > 0.0f) - { - window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow), rounding, ImDrawCornerFlags_All, border_size); - window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); - } -} - -void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - const float border_size = g.Style.FrameBorderSize; - if (border_size > 0.0f) - { - window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow), rounding, ImDrawCornerFlags_All, border_size); - window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); - } -} - -void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags) -{ - ImGuiContext& g = *GImGui; - if (id != g.NavId) - return; - if (g.NavDisableHighlight && !(flags & ImGuiNavHighlightFlags_AlwaysDraw)) - return; - ImGuiWindow* window = g.CurrentWindow; - if (window->DC.NavHideHighlightOneFrame) - return; - - float rounding = (flags & ImGuiNavHighlightFlags_NoRounding) ? 0.0f : g.Style.FrameRounding; - ImRect display_rect = bb; - display_rect.ClipWith(window->ClipRect); - if (flags & ImGuiNavHighlightFlags_TypeDefault) - { - const float THICKNESS = 2.0f; - const float DISTANCE = 3.0f + THICKNESS * 0.5f; - display_rect.Expand(ImVec2(DISTANCE,DISTANCE)); - bool fully_visible = window->ClipRect.Contains(display_rect); - if (!fully_visible) - window->DrawList->PushClipRect(display_rect.Min, display_rect.Max); - window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS*0.5f,THICKNESS*0.5f), display_rect.Max - ImVec2(THICKNESS*0.5f,THICKNESS*0.5f), GetColorU32(ImGuiCol_NavHighlight), rounding, ImDrawCornerFlags_All, THICKNESS); - if (!fully_visible) - window->DrawList->PopClipRect(); - } - if (flags & ImGuiNavHighlightFlags_TypeThin) - { - window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), rounding, ~0, 1.0f); - } -} - -//----------------------------------------------------------------------------- -// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) -//----------------------------------------------------------------------------- - -// ImGuiWindow is mostly a dumb struct. It merely has a constructor and a few helper methods -ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) - : DrawListInst(&context->DrawListSharedData) -{ - Name = ImStrdup(name); - ID = ImHashStr(name); - IDStack.push_back(ID); - Flags = ImGuiWindowFlags_None; - Pos = ImVec2(0.0f, 0.0f); - Size = SizeFull = ImVec2(0.0f, 0.0f); - ContentSize = ContentSizeExplicit = ImVec2(0.0f, 0.0f); - WindowPadding = ImVec2(0.0f, 0.0f); - WindowRounding = 0.0f; - WindowBorderSize = 0.0f; - NameBufLen = (int)strlen(name) + 1; - MoveId = GetID("#MOVE"); - ChildId = 0; - Scroll = ImVec2(0.0f, 0.0f); - ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); - ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f); - ScrollbarSizes = ImVec2(0.0f, 0.0f); - ScrollbarX = ScrollbarY = false; - Active = WasActive = false; - WriteAccessed = false; - Collapsed = false; - WantCollapseToggle = false; - SkipItems = false; - Appearing = false; - Hidden = false; - IsFallbackWindow = false; - HasCloseButton = false; - ResizeBorderHeld = -1; - BeginCount = 0; - BeginOrderWithinParent = -1; - BeginOrderWithinContext = -1; - PopupId = 0; - AutoFitFramesX = AutoFitFramesY = -1; - AutoFitChildAxises = 0x00; - AutoFitOnlyGrows = false; - AutoPosLastDirection = ImGuiDir_None; - HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0; - SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing; - SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX); - - InnerRect = ImRect(0.0f, 0.0f, 0.0f, 0.0f); // Clear so the InnerRect.GetSize() code in Begin() doesn't lead to overflow even if the result isn't used. - - LastFrameActive = -1; - LastTimeActive = -1.0f; - ItemWidthDefault = 0.0f; - FontWindowScale = 1.0f; - SettingsOffset = -1; - - DrawList = &DrawListInst; - DrawList->_OwnerName = Name; - ParentWindow = NULL; - RootWindow = NULL; - RootWindowForTitleBarHighlight = NULL; - RootWindowForNav = NULL; - - NavLastIds[0] = NavLastIds[1] = 0; - NavRectRel[0] = NavRectRel[1] = ImRect(); - NavLastChildNavWindow = NULL; - - MemoryCompacted = false; - MemoryDrawListIdxCapacity = MemoryDrawListVtxCapacity = 0; -} - -ImGuiWindow::~ImGuiWindow() -{ - IM_ASSERT(DrawList == &DrawListInst); - IM_DELETE(Name); - for (int i = 0; i != ColumnsStorage.Size; i++) - ColumnsStorage[i].~ImGuiColumns(); -} - -ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); - ImGui::KeepAliveID(id); - return id; -} - -ImGuiID ImGuiWindow::GetID(const void* ptr) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); - ImGui::KeepAliveID(id); - return id; -} - -ImGuiID ImGuiWindow::GetID(int n) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&n, sizeof(n), seed); - ImGui::KeepAliveID(id); - return id; -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end) -{ - ImGuiID seed = IDStack.back(); - return ImHashStr(str, str_end ? (str_end - str) : 0, seed); -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(const void* ptr) -{ - ImGuiID seed = IDStack.back(); - return ImHashData(&ptr, sizeof(void*), seed); -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n) -{ - ImGuiID seed = IDStack.back(); - return ImHashData(&n, sizeof(n), seed); -} - -// This is only used in rare/specific situations to manufacture an ID out of nowhere. -ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) -{ - ImGuiID seed = IDStack.back(); - const int r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x), (int)(r_abs.Max.y - Pos.y) }; - ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed); - ImGui::KeepAliveID(id); - return id; -} - -static void SetCurrentWindow(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - g.CurrentWindow = window; - if (window) - g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); -} - -// Free up/compact internal window buffers, we can use this when a window becomes unused. -// This is currently unused by the library, but you may call this yourself for easy GC. -// Not freed: -// - ImGuiWindow, ImGuiWindowSettings, Name -// - StateStorage, ColumnsStorage (may hold useful data) -// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost. -void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window) -{ - window->MemoryCompacted = true; - window->MemoryDrawListIdxCapacity = window->DrawList->IdxBuffer.Capacity; - window->MemoryDrawListVtxCapacity = window->DrawList->VtxBuffer.Capacity; - window->IDStack.clear(); - window->DrawList->ClearFreeMemory(); - window->DC.ChildWindows.clear(); - window->DC.ItemFlagsStack.clear(); - window->DC.ItemWidthStack.clear(); - window->DC.TextWrapPosStack.clear(); - window->DC.GroupStack.clear(); -} - -void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window) -{ - // We stored capacity of the ImDrawList buffer to reduce growth-caused allocation/copy when awakening. - // The other buffers tends to amortize much faster. - window->MemoryCompacted = false; - window->DrawList->IdxBuffer.reserve(window->MemoryDrawListIdxCapacity); - window->DrawList->VtxBuffer.reserve(window->MemoryDrawListVtxCapacity); - window->MemoryDrawListIdxCapacity = window->MemoryDrawListVtxCapacity = 0; -} - -void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - g.ActiveIdIsJustActivated = (g.ActiveId != id); - if (g.ActiveIdIsJustActivated) - { - g.ActiveIdTimer = 0.0f; - g.ActiveIdHasBeenPressedBefore = false; - g.ActiveIdHasBeenEditedBefore = false; - if (id != 0) - { - g.LastActiveId = id; - g.LastActiveIdTimer = 0.0f; - } - } - g.ActiveId = id; - g.ActiveIdAllowOverlap = false; - g.ActiveIdWindow = window; - g.ActiveIdHasBeenEditedThisFrame = false; - if (id) - { - g.ActiveIdIsAlive = id; - g.ActiveIdSource = (g.NavActivateId == id || g.NavInputId == id || g.NavJustTabbedId == id || g.NavJustMovedToId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse; - } - - // Clear declaration of inputs claimed by the widget - // (Please note that this is WIP and not all keys/inputs are thoroughly declared by all widgets yet) - g.ActiveIdUsingNavDirMask = 0x00; - g.ActiveIdUsingNavInputMask = 0x00; - g.ActiveIdUsingKeyInputMask = 0x00; -} - -void ImGui::ClearActiveID() -{ - SetActiveID(0, NULL); -} - -void ImGui::SetHoveredID(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - g.HoveredId = id; - g.HoveredIdAllowOverlap = false; - if (id != 0 && g.HoveredIdPreviousFrame != id) - g.HoveredIdTimer = g.HoveredIdNotActiveTimer = 0.0f; -} - -ImGuiID ImGui::GetHoveredID() -{ - ImGuiContext& g = *GImGui; - return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame; -} - -void ImGui::KeepAliveID(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId == id) - g.ActiveIdIsAlive = id; - if (g.ActiveIdPreviousFrame == id) - g.ActiveIdPreviousFrameIsAlive = true; -} - -void ImGui::MarkItemEdited(ImGuiID id) -{ - // This marking is solely to be able to provide info for IsItemDeactivatedAfterEdit(). - // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need need to fill the data. - ImGuiContext& g = *GImGui; - IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive); - IM_UNUSED(id); // Avoid unused variable warnings when asserts are compiled out. - //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id); - g.ActiveIdHasBeenEditedThisFrame = true; - g.ActiveIdHasBeenEditedBefore = true; - g.CurrentWindow->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Edited; -} - -static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags) -{ - // An active popup disable hovering on other windows (apart from its own children) - // FIXME-OPT: This could be cached/stored within the window. - ImGuiContext& g = *GImGui; - if (g.NavWindow) - if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindow) - if (focused_root_window->WasActive && focused_root_window != window->RootWindow) - { - // For the purpose of those flags we differentiate "standard popup" from "modal popup" - // NB: The order of those two tests is important because Modal windows are also Popups. - if (focused_root_window->Flags & ImGuiWindowFlags_Modal) - return false; - if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup)) - return false; - } - return true; -} - -// This is roughly matching the behavior of internal-facing ItemHoverable() -// - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered() -// - this should work even for non-interactive items that have no ID, so we cannot use LastItemId -bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (g.NavDisableMouseHover && !g.NavDisableHighlight) - return IsItemFocused(); - - // Test for bounding box overlap, as updated as ItemAdd() - if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) - return false; - IM_ASSERT((flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) == 0); // Flags not supported by this function - - // Test if we are hovering the right window (our window could be behind another window) - // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable to use IsItemHovered() after EndChild() itself. - // Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was the test that has been running for a long while. - //if (g.HoveredWindow != window) - // return false; - if (g.HoveredRootWindow != window->RootWindow && !(flags & ImGuiHoveredFlags_AllowWhenOverlapped)) - return false; - - // Test if another item is active (e.g. being dragged) - if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) - if (g.ActiveId != 0 && g.ActiveId != window->DC.LastItemId && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId) - return false; - - // Test if interactions on this window are blocked by an active popup or modal. - // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here. - if (!IsWindowContentHoverable(window, flags)) - return false; - - // Test if the item is disabled - if ((window->DC.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) - return false; - - // Special handling for the dummy item after Begin() which represent the title bar or tab. - // When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. - if (window->DC.LastItemId == window->MoveId && window->WriteAccessed) - return false; - return true; -} - -// Internal facing ItemHoverable() used when submitting widgets. Differs slightly from IsItemHovered(). -bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id) -{ - ImGuiContext& g = *GImGui; - if (g.HoveredId != 0 && g.HoveredId != id && !g.HoveredIdAllowOverlap) - return false; - - ImGuiWindow* window = g.CurrentWindow; - if (g.HoveredWindow != window) - return false; - if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap) - return false; - if (!IsMouseHoveringRect(bb.Min, bb.Max)) - return false; - if (g.NavDisableMouseHover || !IsWindowContentHoverable(window, ImGuiHoveredFlags_None)) - return false; - if (window->DC.ItemFlags & ImGuiItemFlags_Disabled) - return false; - - SetHoveredID(id); - - // [DEBUG] Item Picker tool! - // We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making - // the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered - // items if we perform the test in ItemAdd(), but that would incur a small runtime cost. - // #define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX in imconfig.h if you want this check to also be performed in ItemAdd(). - if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id) - GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255)); - if (g.DebugItemPickerBreakId == id) - IM_DEBUG_BREAK(); - - return true; -} - -bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (!bb.Overlaps(window->ClipRect)) - if (id == 0 || (id != g.ActiveId && id != g.NavId)) - if (clip_even_when_logged || !g.LogEnabled) - return true; - return false; -} - -// Process TAB/Shift+TAB. Be mindful that this function may _clear_ the ActiveID when tabbing out. -bool ImGui::FocusableItemRegister(ImGuiWindow* window, ImGuiID id) -{ - ImGuiContext& g = *GImGui; - - // Increment counters - const bool is_tab_stop = (window->DC.ItemFlags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0; - window->DC.FocusCounterRegular++; - if (is_tab_stop) - window->DC.FocusCounterTabStop++; - - // Process TAB/Shift-TAB to tab *OUT* of the currently focused item. - // (Note that we can always TAB out of a widget that doesn't allow tabbing in) - if (g.ActiveId == id && g.FocusTabPressed && !IsActiveIdUsingKey(ImGuiKey_Tab) && g.FocusRequestNextWindow == NULL) - { - g.FocusRequestNextWindow = window; - g.FocusRequestNextCounterTabStop = window->DC.FocusCounterTabStop + (g.IO.KeyShift ? (is_tab_stop ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items. - } - - // Handle focus requests - if (g.FocusRequestCurrWindow == window) - { - if (window->DC.FocusCounterRegular == g.FocusRequestCurrCounterRegular) - return true; - if (is_tab_stop && window->DC.FocusCounterTabStop == g.FocusRequestCurrCounterTabStop) - { - g.NavJustTabbedId = id; - return true; - } - - // If another item is about to be focused, we clear our own active id - if (g.ActiveId == id) - ClearActiveID(); - } - - return false; -} - -void ImGui::FocusableItemUnregister(ImGuiWindow* window) -{ - window->DC.FocusCounterRegular--; - window->DC.FocusCounterTabStop--; -} - -float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) -{ - if (wrap_pos_x < 0.0f) - return 0.0f; - - ImGuiWindow* window = GImGui->CurrentWindow; - if (wrap_pos_x == 0.0f) - wrap_pos_x = window->WorkRect.Max.x; - else if (wrap_pos_x > 0.0f) - wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space - - return ImMax(wrap_pos_x - pos.x, 1.0f); -} - -// IM_ALLOC() == ImGui::MemAlloc() -void* ImGui::MemAlloc(size_t size) -{ - if (ImGuiContext* ctx = GImGui) - ctx->IO.MetricsActiveAllocations++; - return GImAllocatorAllocFunc(size, GImAllocatorUserData); -} - -// IM_FREE() == ImGui::MemFree() -void ImGui::MemFree(void* ptr) -{ - if (ptr) - if (ImGuiContext* ctx = GImGui) - ctx->IO.MetricsActiveAllocations--; - return GImAllocatorFreeFunc(ptr, GImAllocatorUserData); -} - -const char* ImGui::GetClipboardText() -{ - ImGuiContext& g = *GImGui; - return g.IO.GetClipboardTextFn ? g.IO.GetClipboardTextFn(g.IO.ClipboardUserData) : ""; -} - -void ImGui::SetClipboardText(const char* text) -{ - ImGuiContext& g = *GImGui; - if (g.IO.SetClipboardTextFn) - g.IO.SetClipboardTextFn(g.IO.ClipboardUserData, text); -} - -const char* ImGui::GetVersion() -{ - return IMGUI_VERSION; -} - -// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself -// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module -ImGuiContext* ImGui::GetCurrentContext() -{ - return GImGui; -} - -void ImGui::SetCurrentContext(ImGuiContext* ctx) -{ -#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC - IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this. -#else - GImGui = ctx; -#endif -} - -void ImGui::SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data) -{ - GImAllocatorAllocFunc = alloc_func; - GImAllocatorFreeFunc = free_func; - GImAllocatorUserData = user_data; -} - -ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas) -{ - ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas); - if (GImGui == NULL) - SetCurrentContext(ctx); - Initialize(ctx); - return ctx; -} - -void ImGui::DestroyContext(ImGuiContext* ctx) -{ - if (ctx == NULL) - ctx = GImGui; - Shutdown(ctx); - if (GImGui == ctx) - SetCurrentContext(NULL); - IM_DELETE(ctx); -} - -ImGuiIO& ImGui::GetIO() -{ - IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); - return GImGui->IO; -} - -// Same value as passed to the old io.RenderDrawListsFn function. Valid after Render() and until the next call to NewFrame() -ImDrawData* ImGui::GetDrawData() -{ - ImGuiContext& g = *GImGui; - return g.DrawData.Valid ? &g.DrawData : NULL; -} - -double ImGui::GetTime() -{ - return GImGui->Time; -} - -int ImGui::GetFrameCount() -{ - return GImGui->FrameCount; -} - -ImDrawList* ImGui::GetBackgroundDrawList() -{ - return &GImGui->BackgroundDrawList; -} - -ImDrawList* ImGui::GetForegroundDrawList() -{ - return &GImGui->ForegroundDrawList; -} - -ImDrawListSharedData* ImGui::GetDrawListSharedData() -{ - return &GImGui->DrawListSharedData; -} - -void ImGui::StartMouseMovingWindow(ImGuiWindow* window) -{ - // Set ActiveId even if the _NoMove flag is set. Without it, dragging away from a window with _NoMove would activate hover on other windows. - // We _also_ call this when clicking in a window empty space when io.ConfigWindowsMoveFromTitleBarOnly is set, but clear g.MovingWindow afterward. - // This is because we want ActiveId to be set even when the window is not permitted to move. - ImGuiContext& g = *GImGui; - FocusWindow(window); - SetActiveID(window->MoveId, window); - g.NavDisableHighlight = true; - g.ActiveIdClickOffset = g.IO.MousePos - window->RootWindow->Pos; - - bool can_move_window = true; - if ((window->Flags & ImGuiWindowFlags_NoMove) || (window->RootWindow->Flags & ImGuiWindowFlags_NoMove)) - can_move_window = false; - if (can_move_window) - g.MovingWindow = window; -} - -// Handle mouse moving window -// Note: moving window with the navigation keys (Square + d-pad / CTRL+TAB + Arrows) are processed in NavUpdateWindowing() -// FIXME: We don't have strong guarantee that g.MovingWindow stay synched with g.ActiveId == g.MovingWindow->MoveId. -// This is currently enforced by the fact that BeginDragDropSource() is setting all g.ActiveIdUsingXXXX flags to inhibit navigation inputs, -// but if we should more thoroughly test cases where g.ActiveId or g.MovingWindow gets changed and not the other. -void ImGui::UpdateMouseMovingWindowNewFrame() -{ - ImGuiContext& g = *GImGui; - if (g.MovingWindow != NULL) - { - // We actually want to move the root window. g.MovingWindow == window we clicked on (could be a child window). - // We track it to preserve Focus and so that generally ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency. - KeepAliveID(g.ActiveId); - IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow); - ImGuiWindow* moving_window = g.MovingWindow->RootWindow; - if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos)) - { - ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset; - if (moving_window->Pos.x != pos.x || moving_window->Pos.y != pos.y) - { - MarkIniSettingsDirty(moving_window); - SetWindowPos(moving_window, pos, ImGuiCond_Always); - } - FocusWindow(g.MovingWindow); - } - else - { - ClearActiveID(); - g.MovingWindow = NULL; - } - } - else - { - // When clicking/dragging from a window that has the _NoMove flag, we still set the ActiveId in order to prevent hovering others. - if (g.ActiveIdWindow && g.ActiveIdWindow->MoveId == g.ActiveId) - { - KeepAliveID(g.ActiveId); - if (!g.IO.MouseDown[0]) - ClearActiveID(); - } - } -} - -// Initiate moving window when clicking on empty space or title bar. -// Handle left-click and right-click focus. -void ImGui::UpdateMouseMovingWindowEndFrame() -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId != 0 || g.HoveredId != 0) - return; - - // Unless we just made a window/popup appear - if (g.NavWindow && g.NavWindow->Appearing) - return; - - // Click to focus window and start moving (after we're done with all our widgets) - if (g.IO.MouseClicked[0]) - { - if (g.HoveredRootWindow != NULL) - { - StartMouseMovingWindow(g.HoveredWindow); - if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(g.HoveredRootWindow->Flags & ImGuiWindowFlags_NoTitleBar)) - if (!g.HoveredRootWindow->TitleBarRect().Contains(g.IO.MouseClickedPos[0])) - g.MovingWindow = NULL; - } - else if (g.NavWindow != NULL && GetTopMostPopupModal() == NULL) - { - // Clicking on void disable focus - FocusWindow(NULL); - } - } - - // With right mouse button we close popups without changing focus based on where the mouse is aimed - // Instead, focus will be restored to the window under the bottom-most closed popup. - // (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger) - if (g.IO.MouseClicked[1]) - { - // Find the top-most window between HoveredWindow and the top-most Modal Window. - // This is where we can trim the popup stack. - ImGuiWindow* modal = GetTopMostPopupModal(); - bool hovered_window_above_modal = false; - if (modal == NULL) - hovered_window_above_modal = true; - for (int i = g.Windows.Size - 1; i >= 0 && hovered_window_above_modal == false; i--) - { - ImGuiWindow* window = g.Windows[i]; - if (window == modal) - break; - if (window == g.HoveredWindow) - hovered_window_above_modal = true; - } - ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true); - } -} - -static bool IsWindowActiveAndVisible(ImGuiWindow* window) -{ - return (window->Active) && (!window->Hidden); -} - -static void ImGui::UpdateMouseInputs() -{ - ImGuiContext& g = *GImGui; - - // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) - if (IsMousePosValid(&g.IO.MousePos)) - g.IO.MousePos = g.LastValidMousePos = ImFloor(g.IO.MousePos); - - // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta - if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MousePosPrev)) - g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev; - else - g.IO.MouseDelta = ImVec2(0.0f, 0.0f); - if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f) - g.NavDisableMouseHover = false; - - g.IO.MousePosPrev = g.IO.MousePos; - for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++) - { - g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f; - g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f; - g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i]; - g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f; - g.IO.MouseDoubleClicked[i] = false; - if (g.IO.MouseClicked[i]) - { - if ((float)(g.Time - g.IO.MouseClickedTime[i]) < g.IO.MouseDoubleClickTime) - { - ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); - if (ImLengthSqr(delta_from_click_pos) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist) - g.IO.MouseDoubleClicked[i] = true; - g.IO.MouseClickedTime[i] = -DBL_MAX; // so the third click isn't turned into a double-click - } - else - { - g.IO.MouseClickedTime[i] = g.Time; - } - g.IO.MouseClickedPos[i] = g.IO.MousePos; - g.IO.MouseDownWasDoubleClick[i] = g.IO.MouseDoubleClicked[i]; - g.IO.MouseDragMaxDistanceAbs[i] = ImVec2(0.0f, 0.0f); - g.IO.MouseDragMaxDistanceSqr[i] = 0.0f; - } - else if (g.IO.MouseDown[i]) - { - // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold - ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); - g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(delta_from_click_pos)); - g.IO.MouseDragMaxDistanceAbs[i].x = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, delta_from_click_pos.x < 0.0f ? -delta_from_click_pos.x : delta_from_click_pos.x); - g.IO.MouseDragMaxDistanceAbs[i].y = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, delta_from_click_pos.y < 0.0f ? -delta_from_click_pos.y : delta_from_click_pos.y); - } - if (!g.IO.MouseDown[i] && !g.IO.MouseReleased[i]) - g.IO.MouseDownWasDoubleClick[i] = false; - if (g.IO.MouseClicked[i]) // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation - g.NavDisableMouseHover = false; - } -} - -static void StartLockWheelingWindow(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - if (g.WheelingWindow == window) - return; - g.WheelingWindow = window; - g.WheelingWindowRefMousePos = g.IO.MousePos; - g.WheelingWindowTimer = WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER; -} - -void ImGui::UpdateMouseWheel() -{ - ImGuiContext& g = *GImGui; - - // Reset the locked window if we move the mouse or after the timer elapses - if (g.WheelingWindow != NULL) - { - g.WheelingWindowTimer -= g.IO.DeltaTime; - if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold) - g.WheelingWindowTimer = 0.0f; - if (g.WheelingWindowTimer <= 0.0f) - { - g.WheelingWindow = NULL; - g.WheelingWindowTimer = 0.0f; - } - } - - if (g.IO.MouseWheel == 0.0f && g.IO.MouseWheelH == 0.0f) - return; - - ImGuiWindow* window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow; - if (!window || window->Collapsed) - return; - - // Zoom / Scale window - // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned. - if (g.IO.MouseWheel != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) - { - StartLockWheelingWindow(window); - const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f); - const float scale = new_font_scale / window->FontWindowScale; - window->FontWindowScale = new_font_scale; - if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) - { - const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; - SetWindowPos(window, window->Pos + offset, 0); - window->Size = ImFloor(window->Size * scale); - window->SizeFull = ImFloor(window->SizeFull * scale); - } - return; - } - - // Mouse wheel scrolling - // If a child window has the ImGuiWindowFlags_NoScrollWithMouse flag, we give a chance to scroll its parent - - // Vertical Mouse Wheel scrolling - const float wheel_y = (g.IO.MouseWheel != 0.0f && !g.IO.KeyShift) ? g.IO.MouseWheel : 0.0f; - if (wheel_y != 0.0f && !g.IO.KeyCtrl) - { - StartLockWheelingWindow(window); - while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.y == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) - window = window->ParentWindow; - if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) - { - float max_step = window->InnerRect.GetHeight() * 0.67f; - float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step)); - SetScrollY(window, window->Scroll.y - wheel_y * scroll_step); - } - } - - // Horizontal Mouse Wheel scrolling, or Vertical Mouse Wheel w/ Shift held - const float wheel_x = (g.IO.MouseWheelH != 0.0f && !g.IO.KeyShift) ? g.IO.MouseWheelH : (g.IO.MouseWheel != 0.0f && g.IO.KeyShift) ? g.IO.MouseWheel : 0.0f; - if (wheel_x != 0.0f && !g.IO.KeyCtrl) - { - StartLockWheelingWindow(window); - while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.x == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) - window = window->ParentWindow; - if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) - { - float max_step = window->InnerRect.GetWidth() * 0.67f; - float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step)); - SetScrollX(window, window->Scroll.x - wheel_x * scroll_step); - } - } -} - -void ImGui::UpdateTabFocus() -{ - ImGuiContext& g = *GImGui; - - // Pressing TAB activate widget focus - g.FocusTabPressed = (g.NavWindow && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab)); - if (g.ActiveId == 0 && g.FocusTabPressed) - { - // Note that SetKeyboardFocusHere() sets the Next fields mid-frame. To be consistent we also - // manipulate the Next fields even, even though they will be turned into Curr fields by the code below. - g.FocusRequestNextWindow = g.NavWindow; - g.FocusRequestNextCounterRegular = INT_MAX; - if (g.NavId != 0 && g.NavIdTabCounter != INT_MAX) - g.FocusRequestNextCounterTabStop = g.NavIdTabCounter + 1 + (g.IO.KeyShift ? -1 : 1); - else - g.FocusRequestNextCounterTabStop = g.IO.KeyShift ? -1 : 0; - } - - // Turn queued focus request into current one - g.FocusRequestCurrWindow = NULL; - g.FocusRequestCurrCounterRegular = g.FocusRequestCurrCounterTabStop = INT_MAX; - if (g.FocusRequestNextWindow != NULL) - { - ImGuiWindow* window = g.FocusRequestNextWindow; - g.FocusRequestCurrWindow = window; - if (g.FocusRequestNextCounterRegular != INT_MAX && window->DC.FocusCounterRegular != -1) - g.FocusRequestCurrCounterRegular = ImModPositive(g.FocusRequestNextCounterRegular, window->DC.FocusCounterRegular + 1); - if (g.FocusRequestNextCounterTabStop != INT_MAX && window->DC.FocusCounterTabStop != -1) - g.FocusRequestCurrCounterTabStop = ImModPositive(g.FocusRequestNextCounterTabStop, window->DC.FocusCounterTabStop + 1); - g.FocusRequestNextWindow = NULL; - g.FocusRequestNextCounterRegular = g.FocusRequestNextCounterTabStop = INT_MAX; - } - - g.NavIdTabCounter = INT_MAX; -} - -// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app) -void ImGui::UpdateHoveredWindowAndCaptureFlags() -{ - ImGuiContext& g = *GImGui; - - // Find the window hovered by mouse: - // - Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow. - // - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame. - // - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms. - FindHoveredWindow(); - - // Modal windows prevents cursor from hovering behind them. - ImGuiWindow* modal_window = GetTopMostPopupModal(); - if (modal_window) - if (g.HoveredRootWindow && !IsWindowChildOf(g.HoveredRootWindow, modal_window)) - g.HoveredRootWindow = g.HoveredWindow = NULL; - - // Disabled mouse? - if (g.IO.ConfigFlags & ImGuiConfigFlags_NoMouse) - g.HoveredWindow = g.HoveredRootWindow = NULL; - - // We track click ownership. When clicked outside of a window the click is owned by the application and won't report hovering nor request capture even while dragging over our windows afterward. - int mouse_earliest_button_down = -1; - bool mouse_any_down = false; - for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++) - { - if (g.IO.MouseClicked[i]) - g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL) || (!g.OpenPopupStack.empty()); - mouse_any_down |= g.IO.MouseDown[i]; - if (g.IO.MouseDown[i]) - if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[i] < g.IO.MouseClickedTime[mouse_earliest_button_down]) - mouse_earliest_button_down = i; - } - const bool mouse_avail_to_imgui = (mouse_earliest_button_down == -1) || g.IO.MouseDownOwned[mouse_earliest_button_down]; - - // If mouse was first clicked outside of ImGui bounds we also cancel out hovering. - // FIXME: For patterns of drag and drop across OS windows, we may need to rework/remove this test (first committed 311c0ca9 on 2015/02) - const bool mouse_dragging_extern_payload = g.DragDropActive && (g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) != 0; - if (!mouse_avail_to_imgui && !mouse_dragging_extern_payload) - g.HoveredWindow = g.HoveredRootWindow = NULL; - - // Update io.WantCaptureMouse for the user application (true = dispatch mouse info to imgui, false = dispatch mouse info to Dear ImGui + app) - if (g.WantCaptureMouseNextFrame != -1) - g.IO.WantCaptureMouse = (g.WantCaptureMouseNextFrame != 0); - else - g.IO.WantCaptureMouse = (mouse_avail_to_imgui && (g.HoveredWindow != NULL || mouse_any_down)) || (!g.OpenPopupStack.empty()); - - // Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to imgui, false = dispatch keyboard info to Dear ImGui + app) - if (g.WantCaptureKeyboardNextFrame != -1) - g.IO.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0); - else - g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL); - if (g.IO.NavActive && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard)) - g.IO.WantCaptureKeyboard = true; - - // Update io.WantTextInput flag, this is to allow systems without a keyboard (e.g. mobile, hand-held) to show a software keyboard if possible - g.IO.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false; -} - -ImGuiKeyModFlags ImGui::GetMergedKeyModFlags() -{ - ImGuiContext& g = *GImGui; - ImGuiKeyModFlags key_mod_flags = ImGuiKeyModFlags_None; - if (g.IO.KeyCtrl) { key_mod_flags |= ImGuiKeyModFlags_Ctrl; } - if (g.IO.KeyShift) { key_mod_flags |= ImGuiKeyModFlags_Shift; } - if (g.IO.KeyAlt) { key_mod_flags |= ImGuiKeyModFlags_Alt; } - if (g.IO.KeySuper) { key_mod_flags |= ImGuiKeyModFlags_Super; } - return key_mod_flags; -} - -void ImGui::NewFrame() -{ - IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); - ImGuiContext& g = *GImGui; - -#ifdef IMGUI_ENABLE_TEST_ENGINE - ImGuiTestEngineHook_PreNewFrame(&g); -#endif - - // Check and assert for various common IO and Configuration mistakes - ErrorCheckNewFrameSanityChecks(); - - // Load settings on first frame, save settings when modified (after a delay) - UpdateSettings(); - - g.Time += g.IO.DeltaTime; - g.WithinFrameScope = true; - g.FrameCount += 1; - g.TooltipOverrideCount = 0; - g.WindowsActiveCount = 0; - g.MenusIdSubmittedThisFrame.resize(0); - - // Calculate frame-rate for the user, as a purely luxurious feature - g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx]; - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx] = g.IO.DeltaTime; - g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) % IM_ARRAYSIZE(g.FramerateSecPerFrame); - g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame))) : FLT_MAX; - - // Setup current font and draw list shared data - g.IO.Fonts->Locked = true; - SetCurrentFont(GetDefaultFont()); - IM_ASSERT(g.Font->IsLoaded()); - g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y); - g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol; - g.DrawListSharedData.SetCircleSegmentMaxError(g.Style.CircleSegmentMaxError); - g.DrawListSharedData.InitialFlags = ImDrawListFlags_None; - if (g.Style.AntiAliasedLines) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines; - if (g.Style.AntiAliasedFill) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill; - if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset; - - g.BackgroundDrawList.Clear(); - g.BackgroundDrawList.PushTextureID(g.IO.Fonts->TexID); - g.BackgroundDrawList.PushClipRectFullScreen(); - - g.ForegroundDrawList.Clear(); - g.ForegroundDrawList.PushTextureID(g.IO.Fonts->TexID); - g.ForegroundDrawList.PushClipRectFullScreen(); - - // Mark rendering data as invalid to prevent user who may have a handle on it to use it. - g.DrawData.Clear(); - - // Drag and drop keep the source ID alive so even if the source disappear our state is consistent - if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId) - KeepAliveID(g.DragDropPayload.SourceId); - - // Update HoveredId data - if (!g.HoveredIdPreviousFrame) - g.HoveredIdTimer = 0.0f; - if (!g.HoveredIdPreviousFrame || (g.HoveredId && g.ActiveId == g.HoveredId)) - g.HoveredIdNotActiveTimer = 0.0f; - if (g.HoveredId) - g.HoveredIdTimer += g.IO.DeltaTime; - if (g.HoveredId && g.ActiveId != g.HoveredId) - g.HoveredIdNotActiveTimer += g.IO.DeltaTime; - g.HoveredIdPreviousFrame = g.HoveredId; - g.HoveredId = 0; - g.HoveredIdAllowOverlap = false; - - // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore) - if (g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0) - ClearActiveID(); - if (g.ActiveId) - g.ActiveIdTimer += g.IO.DeltaTime; - g.LastActiveIdTimer += g.IO.DeltaTime; - g.ActiveIdPreviousFrame = g.ActiveId; - g.ActiveIdPreviousFrameWindow = g.ActiveIdWindow; - g.ActiveIdPreviousFrameHasBeenEditedBefore = g.ActiveIdHasBeenEditedBefore; - g.ActiveIdIsAlive = 0; - g.ActiveIdHasBeenEditedThisFrame = false; - g.ActiveIdPreviousFrameIsAlive = false; - g.ActiveIdIsJustActivated = false; - if (g.TempInputId != 0 && g.ActiveId != g.TempInputId) - g.TempInputId = 0; - if (g.ActiveId == 0) - { - g.ActiveIdUsingNavDirMask = 0x00; - g.ActiveIdUsingNavInputMask = 0x00; - g.ActiveIdUsingKeyInputMask = 0x00; - } - - // Drag and drop - g.DragDropAcceptIdPrev = g.DragDropAcceptIdCurr; - g.DragDropAcceptIdCurr = 0; - g.DragDropAcceptIdCurrRectSurface = FLT_MAX; - g.DragDropWithinSource = false; - g.DragDropWithinTarget = false; - - // Update keyboard input state - // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools - g.IO.KeyMods = GetMergedKeyModFlags(); - memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration)); - for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++) - g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f; - - // Update gamepad/keyboard navigation - NavUpdate(); - - // Update mouse input state - UpdateMouseInputs(); - - // Find hovered window - // (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame) - UpdateHoveredWindowAndCaptureFlags(); - - // Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering) - UpdateMouseMovingWindowNewFrame(); - - // Background darkening/whitening - if (GetTopMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f)) - g.DimBgRatio = ImMin(g.DimBgRatio + g.IO.DeltaTime * 6.0f, 1.0f); - else - g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f); - - g.MouseCursor = ImGuiMouseCursor_Arrow; - g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1; - g.PlatformImePos = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window by default - - // Mouse wheel scrolling, scale - UpdateMouseWheel(); - - // Update legacy TAB focus - UpdateTabFocus(); - - // Mark all windows as not visible and compact unused memory. - IM_ASSERT(g.WindowsFocusOrder.Size == g.Windows.Size); - const float memory_compact_start_time = (g.IO.ConfigWindowsMemoryCompactTimer >= 0.0f) ? (float)g.Time - g.IO.ConfigWindowsMemoryCompactTimer : FLT_MAX; - for (int i = 0; i != g.Windows.Size; i++) - { - ImGuiWindow* window = g.Windows[i]; - window->WasActive = window->Active; - window->BeginCount = 0; - window->Active = false; - window->WriteAccessed = false; - - // Garbage collect transient buffers of recently unused windows - if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time) - GcCompactTransientWindowBuffers(window); - } - - // Closing the focused window restore focus to the first active root window in descending z-order - if (g.NavWindow && !g.NavWindow->WasActive) - FocusTopMostWindowUnderOne(NULL, NULL); - - // No window should be open at the beginning of the frame. - // But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear. - g.CurrentWindowStack.resize(0); - g.BeginPopupStack.resize(0); - ClosePopupsOverWindow(g.NavWindow, false); - - // [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. - UpdateDebugToolItemPicker(); - - // Create implicit/fallback window - which we will only render it if the user has added something to it. - // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. - // This fallback is particularly important as it avoid ImGui:: calls from crashing. - g.WithinFrameScopeWithImplicitWindow = true; - SetNextWindowSize(ImVec2(400,400), ImGuiCond_FirstUseEver); - Begin("Debug##Default"); - IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true); - -#ifdef IMGUI_ENABLE_TEST_ENGINE - ImGuiTestEngineHook_PostNewFrame(&g); -#endif -} - -// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. -void ImGui::UpdateDebugToolItemPicker() -{ - ImGuiContext& g = *GImGui; - g.DebugItemPickerBreakId = 0; - if (g.DebugItemPickerActive) - { - const ImGuiID hovered_id = g.HoveredIdPreviousFrame; - ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); - if (ImGui::IsKeyPressedMap(ImGuiKey_Escape)) - g.DebugItemPickerActive = false; - if (ImGui::IsMouseClicked(0) && hovered_id) - { - g.DebugItemPickerBreakId = hovered_id; - g.DebugItemPickerActive = false; - } - ImGui::SetNextWindowBgAlpha(0.60f); - ImGui::BeginTooltip(); - ImGui::Text("HoveredId: 0x%08X", hovered_id); - ImGui::Text("Press ESC to abort picking."); - ImGui::TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click to break in debugger!"); - ImGui::EndTooltip(); - } -} - -void ImGui::Initialize(ImGuiContext* context) -{ - ImGuiContext& g = *context; - IM_ASSERT(!g.Initialized && !g.SettingsLoaded); - - // Add .ini handle for ImGuiWindow type - { - ImGuiSettingsHandler ini_handler; - ini_handler.TypeName = "Window"; - ini_handler.TypeHash = ImHashStr("Window"); - ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen; - ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine; - ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll; - g.SettingsHandlers.push_back(ini_handler); - } - -#ifdef IMGUI_HAS_TABLE - // Add .ini handle for ImGuiTable type - { - ImGuiSettingsHandler ini_handler; - ini_handler.TypeName = "Table"; - ini_handler.TypeHash = ImHashStr("Table"); - ini_handler.ReadOpenFn = TableSettingsHandler_ReadOpen; - ini_handler.ReadLineFn = TableSettingsHandler_ReadLine; - ini_handler.WriteAllFn = TableSettingsHandler_WriteAll; - g.SettingsHandlers.push_back(ini_handler); - } -#endif // #ifdef IMGUI_HAS_TABLE - -#ifdef IMGUI_HAS_DOCK -#endif // #ifdef IMGUI_HAS_DOCK - - g.Initialized = true; -} - -// This function is merely here to free heap allocations. -void ImGui::Shutdown(ImGuiContext* context) -{ - // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) - ImGuiContext& g = *context; - if (g.IO.Fonts && g.FontAtlasOwnedByContext) - { - g.IO.Fonts->Locked = false; - IM_DELETE(g.IO.Fonts); - } - g.IO.Fonts = NULL; - - // Cleanup of other data are conditional on actually having initialized Dear ImGui. - if (!g.Initialized) - return; - - // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file) - if (g.SettingsLoaded && g.IO.IniFilename != NULL) - { - ImGuiContext* backup_context = GImGui; - SetCurrentContext(context); - SaveIniSettingsToDisk(g.IO.IniFilename); - SetCurrentContext(backup_context); - } - - // Clear everything else - for (int i = 0; i < g.Windows.Size; i++) - IM_DELETE(g.Windows[i]); - g.Windows.clear(); - g.WindowsFocusOrder.clear(); - g.WindowsTempSortBuffer.clear(); - g.CurrentWindow = NULL; - g.CurrentWindowStack.clear(); - g.WindowsById.Clear(); - g.NavWindow = NULL; - g.HoveredWindow = g.HoveredRootWindow = NULL; - g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL; - g.MovingWindow = NULL; - g.ColorModifiers.clear(); - g.StyleModifiers.clear(); - g.FontStack.clear(); - g.OpenPopupStack.clear(); - g.BeginPopupStack.clear(); - g.DrawDataBuilder.ClearFreeMemory(); - g.BackgroundDrawList.ClearFreeMemory(); - g.ForegroundDrawList.ClearFreeMemory(); - - g.TabBars.Clear(); - g.CurrentTabBarStack.clear(); - g.ShrinkWidthBuffer.clear(); - - g.ClipboardHandlerData.clear(); - g.MenusIdSubmittedThisFrame.clear(); - g.InputTextState.ClearFreeMemory(); - - g.SettingsWindows.clear(); - g.SettingsHandlers.clear(); - - if (g.LogFile) - { -#ifndef IMGUI_DISABLE_TTY_FUNCTIONS - if (g.LogFile != stdout) -#endif - ImFileClose(g.LogFile); - g.LogFile = NULL; - } - g.LogBuffer.clear(); - - g.Initialized = false; -} - -// FIXME: Add a more explicit sort order in the window structure. -static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs) -{ - const ImGuiWindow* const a = *(const ImGuiWindow* const *)lhs; - const ImGuiWindow* const b = *(const ImGuiWindow* const *)rhs; - if (int d = (a->Flags & ImGuiWindowFlags_Popup) - (b->Flags & ImGuiWindowFlags_Popup)) - return d; - if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip)) - return d; - return (a->BeginOrderWithinParent - b->BeginOrderWithinParent); -} - -static void AddWindowToSortBuffer(ImVector* out_sorted_windows, ImGuiWindow* window) -{ - out_sorted_windows->push_back(window); - if (window->Active) - { - int count = window->DC.ChildWindows.Size; - if (count > 1) - ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer); - for (int i = 0; i < count; i++) - { - ImGuiWindow* child = window->DC.ChildWindows[i]; - if (child->Active) - AddWindowToSortBuffer(out_sorted_windows, child); - } - } -} - -static void AddDrawListToDrawData(ImVector* out_list, ImDrawList* draw_list) -{ - if (draw_list->CmdBuffer.empty()) - return; - - // Remove trailing command if unused - ImDrawCmd& last_cmd = draw_list->CmdBuffer.back(); - if (last_cmd.ElemCount == 0 && last_cmd.UserCallback == NULL) - { - draw_list->CmdBuffer.pop_back(); - if (draw_list->CmdBuffer.empty()) - return; - } - - // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc. - // May trigger for you if you are using PrimXXX functions incorrectly. - IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size); - IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size); - if (!(draw_list->Flags & ImDrawListFlags_AllowVtxOffset)) - IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); - - // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window) - // If this assert triggers because you are drawing lots of stuff manually: - // - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds. - // Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics window to inspect draw list contents. - // - If you want large meshes with more than 64K vertices, you can either: - // (A) Handle the ImDrawCmd::VtxOffset value in your renderer back-end, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'. - // Most example back-ends already support this from 1.71. Pre-1.71 back-ends won't. - // Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them. - // (B) Or handle 32-bit indices in your renderer back-end, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h. - // Most example back-ends already support this. For example, the OpenGL example code detect index size at compile-time: - // glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset); - // Your own engine or render API may use different parameters or function calls to specify index sizes. - // 2 and 4 bytes indices are generally supported by most graphics API. - // - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching - // the 64K limit to split your draw commands in multiple draw lists. - if (sizeof(ImDrawIdx) == 2) - IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above"); - - out_list->push_back(draw_list); -} - -static void AddWindowToDrawData(ImVector* out_render_list, ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - g.IO.MetricsRenderWindows++; - AddDrawListToDrawData(out_render_list, window->DrawList); - for (int i = 0; i < window->DC.ChildWindows.Size; i++) - { - ImGuiWindow* child = window->DC.ChildWindows[i]; - if (IsWindowActiveAndVisible(child)) // clipped children may have been marked not active - AddWindowToDrawData(out_render_list, child); - } -} - -// Layer is locked for the root window, however child windows may use a different viewport (e.g. extruding menu) -static void AddRootWindowToDrawData(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - int layer = (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0; - AddWindowToDrawData(&g.DrawDataBuilder.Layers[layer], window); -} - -void ImDrawDataBuilder::FlattenIntoSingleLayer() -{ - int n = Layers[0].Size; - int size = n; - for (int i = 1; i < IM_ARRAYSIZE(Layers); i++) - size += Layers[i].Size; - Layers[0].resize(size); - for (int layer_n = 1; layer_n < IM_ARRAYSIZE(Layers); layer_n++) - { - ImVector& layer = Layers[layer_n]; - if (layer.empty()) - continue; - memcpy(&Layers[0][n], &layer[0], layer.Size * sizeof(ImDrawList*)); - n += layer.Size; - layer.resize(0); - } -} - -static void SetupDrawData(ImVector* draw_lists, ImDrawData* draw_data) -{ - ImGuiIO& io = ImGui::GetIO(); - draw_data->Valid = true; - draw_data->CmdLists = (draw_lists->Size > 0) ? draw_lists->Data : NULL; - draw_data->CmdListsCount = draw_lists->Size; - draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0; - draw_data->DisplayPos = ImVec2(0.0f, 0.0f); - draw_data->DisplaySize = io.DisplaySize; - draw_data->FramebufferScale = io.DisplayFramebufferScale; - for (int n = 0; n < draw_lists->Size; n++) - { - draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size; - draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size; - } -} - -// When using this function it is sane to ensure that float are perfectly rounded to integer values, to that e.g. (int)(max.x-min.x) in user's render produce correct result. -void ImGui::PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DrawList->PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect); - window->ClipRect = window->DrawList->_ClipRectStack.back(); -} - -void ImGui::PopClipRect() -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DrawList->PopClipRect(); - window->ClipRect = window->DrawList->_ClipRectStack.back(); -} - -// This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal. -void ImGui::EndFrame() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.Initialized); - - // Don't process EndFrame() multiple times. - if (g.FrameCountEnded == g.FrameCount) - return; - IM_ASSERT(g.WithinFrameScope && "Forgot to call ImGui::NewFrame()?"); - - ErrorCheckEndFrameSanityChecks(); - - // Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) - if (g.IO.ImeSetInputScreenPosFn && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f)) - { - g.IO.ImeSetInputScreenPosFn((int)g.PlatformImePos.x, (int)g.PlatformImePos.y); - g.PlatformImeLastPos = g.PlatformImePos; - } - - // Hide implicit/fallback "Debug" window if it hasn't been used - g.WithinFrameScopeWithImplicitWindow = false; - if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed) - g.CurrentWindow->Active = false; - End(); - - // Show CTRL+TAB list window - if (g.NavWindowingTarget != NULL) - NavUpdateWindowingOverlay(); - - // Drag and Drop: Elapse payload (if delivered, or if source stops being submitted) - if (g.DragDropActive) - { - bool is_delivered = g.DragDropPayload.Delivery; - bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); - if (is_delivered || is_elapsed) - ClearDragDrop(); - } - - // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing. - if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount) - { - g.DragDropWithinSource = true; - SetTooltip("..."); - g.DragDropWithinSource = false; - } - - // End frame - g.WithinFrameScope = false; - g.FrameCountEnded = g.FrameCount; - - // Initiate moving window + handle left-click and right-click focus - UpdateMouseMovingWindowEndFrame(); - - // Sort the window list so that all child windows are after their parent - // We cannot do that on FocusWindow() because childs may not exist yet - g.WindowsTempSortBuffer.resize(0); - g.WindowsTempSortBuffer.reserve(g.Windows.Size); - for (int i = 0; i != g.Windows.Size; i++) - { - ImGuiWindow* window = g.Windows[i]; - if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it - continue; - AddWindowToSortBuffer(&g.WindowsTempSortBuffer, window); - } - - // This usually assert if there is a mismatch between the ImGuiWindowFlags_ChildWindow / ParentWindow values and DC.ChildWindows[] in parents, aka we've done something wrong. - IM_ASSERT(g.Windows.Size == g.WindowsTempSortBuffer.Size); - g.Windows.swap(g.WindowsTempSortBuffer); - g.IO.MetricsActiveWindows = g.WindowsActiveCount; - - // Unlock font atlas - g.IO.Fonts->Locked = false; - - // Clear Input data for next frame - g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f; - g.IO.InputQueueCharacters.resize(0); - memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs)); -} - -void ImGui::Render() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.Initialized); - - if (g.FrameCountEnded != g.FrameCount) - EndFrame(); - g.FrameCountRendered = g.FrameCount; - g.IO.MetricsRenderWindows = 0; - g.DrawDataBuilder.Clear(); - - // Add background ImDrawList - if (!g.BackgroundDrawList.VtxBuffer.empty()) - AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList); - - // Add ImDrawList to render - ImGuiWindow* windows_to_render_top_most[2]; - windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL; - windows_to_render_top_most[1] = (g.NavWindowingTarget ? g.NavWindowingList : NULL); - for (int n = 0; n != g.Windows.Size; n++) - { - ImGuiWindow* window = g.Windows[n]; - if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_top_most[0] && window != windows_to_render_top_most[1]) - AddRootWindowToDrawData(window); - } - for (int n = 0; n < IM_ARRAYSIZE(windows_to_render_top_most); n++) - if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window - AddRootWindowToDrawData(windows_to_render_top_most[n]); - g.DrawDataBuilder.FlattenIntoSingleLayer(); - - // Draw software mouse cursor if requested - if (g.IO.MouseDrawCursor) - RenderMouseCursor(&g.ForegroundDrawList, g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48)); - - // Add foreground ImDrawList - if (!g.ForegroundDrawList.VtxBuffer.empty()) - AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.ForegroundDrawList); - - // Setup ImDrawData structure for end-user - SetupDrawData(&g.DrawDataBuilder.Layers[0], &g.DrawData); - g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount; - g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount; - - // (Legacy) Call the Render callback function. The current prefer way is to let the user retrieve GetDrawData() and call the render function themselves. -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL) - g.IO.RenderDrawListsFn(&g.DrawData); -#endif -} - -// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker. -// CalcTextSize("") should return ImVec2(0.0f, g.FontSize) -ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width) -{ - ImGuiContext& g = *GImGui; - - const char* text_display_end; - if (hide_text_after_double_hash) - text_display_end = FindRenderedTextEnd(text, text_end); // Hide anything after a '##' string - else - text_display_end = text_end; - - ImFont* font = g.Font; - const float font_size = g.FontSize; - if (text == text_display_end) - return ImVec2(0.0f, font_size); - ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL); - - // Round - text_size.x = IM_FLOOR(text_size.x + 0.95f); - - return text_size; -} - -// Find window given position, search front-to-back -// FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programatically -// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is -// called, aka before the next Begin(). Moving window isn't affected. -static void FindHoveredWindow() -{ - ImGuiContext& g = *GImGui; - - ImGuiWindow* hovered_window = NULL; - if (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs)) - hovered_window = g.MovingWindow; - - ImVec2 padding_regular = g.Style.TouchExtraPadding; - ImVec2 padding_for_resize_from_edges = g.IO.ConfigWindowsResizeFromEdges ? ImMax(g.Style.TouchExtraPadding, ImVec2(WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS)) : padding_regular; - for (int i = g.Windows.Size - 1; i >= 0; i--) - { - ImGuiWindow* window = g.Windows[i]; - if (!window->Active || window->Hidden) - continue; - if (window->Flags & ImGuiWindowFlags_NoMouseInputs) - continue; - - // Using the clipped AABB, a child window will typically be clipped by its parent (not always) - ImRect bb(window->OuterRectClipped); - if (window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize)) - bb.Expand(padding_regular); - else - bb.Expand(padding_for_resize_from_edges); - if (!bb.Contains(g.IO.MousePos)) - continue; - - // Those seemingly unnecessary extra tests are because the code here is a little different in viewport/docking branches. - if (hovered_window == NULL) - hovered_window = window; - if (hovered_window) - break; - } - - g.HoveredWindow = hovered_window; - g.HoveredRootWindow = g.HoveredWindow ? g.HoveredWindow->RootWindow : NULL; - -} - -// Test if mouse cursor is hovering given rectangle -// NB- Rectangle is clipped by our current clip setting -// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding) -bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) -{ - ImGuiContext& g = *GImGui; - - // Clip - ImRect rect_clipped(r_min, r_max); - if (clip) - rect_clipped.ClipWith(g.CurrentWindow->ClipRect); - - // Expand for touch input - const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); - if (!rect_for_touch.Contains(g.IO.MousePos)) - return false; - return true; -} - -int ImGui::GetKeyIndex(ImGuiKey imgui_key) -{ - IM_ASSERT(imgui_key >= 0 && imgui_key < ImGuiKey_COUNT); - ImGuiContext& g = *GImGui; - return g.IO.KeyMap[imgui_key]; -} - -// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]! -// Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]! -bool ImGui::IsKeyDown(int user_key_index) -{ - if (user_key_index < 0) - return false; - ImGuiContext& g = *GImGui; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - return g.IO.KeysDown[user_key_index]; -} - -// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime) -// t1 = current time (e.g.: g.Time) -// An event is triggered at: -// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N -int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate) -{ - if (t1 == 0.0f) - return 1; - if (t0 >= t1) - return 0; - if (repeat_rate <= 0.0f) - return (t0 < repeat_delay) && (t1 >= repeat_delay); - const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate); - const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate); - const int count = count_t1 - count_t0; - return count; -} - -int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_rate) -{ - ImGuiContext& g = *GImGui; - if (key_index < 0) - return 0; - IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - const float t = g.IO.KeysDownDuration[key_index]; - return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate); -} - -bool ImGui::IsKeyPressed(int user_key_index, bool repeat) -{ - ImGuiContext& g = *GImGui; - if (user_key_index < 0) - return false; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - const float t = g.IO.KeysDownDuration[user_key_index]; - if (t == 0.0f) - return true; - if (repeat && t > g.IO.KeyRepeatDelay) - return GetKeyPressedAmount(user_key_index, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0; - return false; -} - -bool ImGui::IsKeyReleased(int user_key_index) -{ - ImGuiContext& g = *GImGui; - if (user_key_index < 0) return false; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index]; -} - -bool ImGui::IsMouseDown(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseDown[button]; -} - -bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - const float t = g.IO.MouseDownDuration[button]; - if (t == 0.0f) - return true; - - if (repeat && t > g.IO.KeyRepeatDelay) - { - // FIXME: 2019/05/03: Our old repeat code was wrong here and led to doubling the repeat rate, which made it an ok rate for repeat on mouse hold. - int amount = CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate * 0.50f); - if (amount > 0) - return true; - } - return false; -} - -bool ImGui::IsMouseReleased(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseReleased[button]; -} - -bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseDoubleClicked[button]; -} - -// [Internal] This doesn't test if the button is pressed -bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (lock_threshold < 0.0f) - lock_threshold = g.IO.MouseDragThreshold; - return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold; -} - -bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (!g.IO.MouseDown[button]) - return false; - return IsMouseDragPastThreshold(button, lock_threshold); -} - -ImVec2 ImGui::GetMousePos() -{ - ImGuiContext& g = *GImGui; - return g.IO.MousePos; -} - -// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed! -ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup() -{ - ImGuiContext& g = *GImGui; - if (g.BeginPopupStack.Size > 0) - return g.OpenPopupStack[g.BeginPopupStack.Size-1].OpenMousePos; - return g.IO.MousePos; -} - -// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position. -bool ImGui::IsMousePosValid(const ImVec2* mouse_pos) -{ - // The assert is only to silence a false-positive in XCode Static Analysis. - // Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions). - IM_ASSERT(GImGui != NULL); - const float MOUSE_INVALID = -256000.0f; - ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos; - return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID; -} - -bool ImGui::IsAnyMouseDown() -{ - ImGuiContext& g = *GImGui; - for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++) - if (g.IO.MouseDown[n]) - return true; - return false; -} - -// Return the delta from the initial clicking position while the mouse button is clicked or was just released. -// This is locked and return 0.0f until the mouse moves past a distance threshold at least once. -// NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse position valid when dragging even outside the client window. -ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (lock_threshold < 0.0f) - lock_threshold = g.IO.MouseDragThreshold; - if (g.IO.MouseDown[button] || g.IO.MouseReleased[button]) - if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold) - if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MouseClickedPos[button])) - return g.IO.MousePos - g.IO.MouseClickedPos[button]; - return ImVec2(0.0f, 0.0f); -} - -void ImGui::ResetMouseDragDelta(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr - g.IO.MouseClickedPos[button] = g.IO.MousePos; -} - -ImGuiMouseCursor ImGui::GetMouseCursor() -{ - return GImGui->MouseCursor; -} - -void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) -{ - GImGui->MouseCursor = cursor_type; -} - -void ImGui::CaptureKeyboardFromApp(bool capture) -{ - GImGui->WantCaptureKeyboardNextFrame = capture ? 1 : 0; -} - -void ImGui::CaptureMouseFromApp(bool capture) -{ - GImGui->WantCaptureMouseNextFrame = capture ? 1 : 0; -} - -bool ImGui::IsItemActive() -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId) - { - ImGuiWindow* window = g.CurrentWindow; - return g.ActiveId == window->DC.LastItemId; - } - return false; -} - -bool ImGui::IsItemActivated() -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId) - { - ImGuiWindow* window = g.CurrentWindow; - if (g.ActiveId == window->DC.LastItemId && g.ActiveIdPreviousFrame != window->DC.LastItemId) - return true; - } - return false; -} - -bool ImGui::IsItemDeactivated() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HasDeactivated) - return (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_Deactivated) != 0; - return (g.ActiveIdPreviousFrame == window->DC.LastItemId && g.ActiveIdPreviousFrame != 0 && g.ActiveId != window->DC.LastItemId); -} - -bool ImGui::IsItemDeactivatedAfterEdit() -{ - ImGuiContext& g = *GImGui; - return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore)); -} - -bool ImGui::IsItemFocused() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - if (g.NavId == 0 || g.NavDisableHighlight || g.NavId != window->DC.LastItemId) - return false; - return true; -} - -bool ImGui::IsItemClicked(ImGuiMouseButton mouse_button) -{ - return IsMouseClicked(mouse_button) && IsItemHovered(ImGuiHoveredFlags_None); -} - -bool ImGui::IsItemToggledOpen() -{ - ImGuiContext& g = *GImGui; - return (g.CurrentWindow->DC.LastItemStatusFlags & ImGuiItemStatusFlags_ToggledOpen) ? true : false; -} - -bool ImGui::IsItemToggledSelection() -{ - ImGuiContext& g = *GImGui; - return (g.CurrentWindow->DC.LastItemStatusFlags & ImGuiItemStatusFlags_ToggledSelection) ? true : false; -} - -bool ImGui::IsAnyItemHovered() -{ - ImGuiContext& g = *GImGui; - return g.HoveredId != 0 || g.HoveredIdPreviousFrame != 0; -} - -bool ImGui::IsAnyItemActive() -{ - ImGuiContext& g = *GImGui; - return g.ActiveId != 0; -} - -bool ImGui::IsAnyItemFocused() -{ - ImGuiContext& g = *GImGui; - return g.NavId != 0 && !g.NavDisableHighlight; -} - -bool ImGui::IsItemVisible() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->ClipRect.Overlaps(window->DC.LastItemRect); -} - -bool ImGui::IsItemEdited() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_Edited) != 0; -} - -// Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority. -void ImGui::SetItemAllowOverlap() -{ - ImGuiContext& g = *GImGui; - if (g.HoveredId == g.CurrentWindow->DC.LastItemId) - g.HoveredIdAllowOverlap = true; - if (g.ActiveId == g.CurrentWindow->DC.LastItemId) - g.ActiveIdAllowOverlap = true; -} - -ImVec2 ImGui::GetItemRectMin() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.LastItemRect.Min; -} - -ImVec2 ImGui::GetItemRectMax() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.LastItemRect.Max; -} - -ImVec2 ImGui::GetItemRectSize() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.LastItemRect.GetSize(); -} - -static ImRect GetViewportRect() -{ - ImGuiContext& g = *GImGui; - return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y); -} - -bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* parent_window = g.CurrentWindow; - - flags |= ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow; - flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag - - // Size - const ImVec2 content_avail = GetContentRegionAvail(); - ImVec2 size = ImFloor(size_arg); - const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00); - if (size.x <= 0.0f) - size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues) - if (size.y <= 0.0f) - size.y = ImMax(content_avail.y + size.y, 4.0f); - SetNextWindowSize(size); - - // Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value. - char title[256]; - if (name) - ImFormatString(title, IM_ARRAYSIZE(title), "%s/%s_%08X", parent_window->Name, name, id); - else - ImFormatString(title, IM_ARRAYSIZE(title), "%s/%08X", parent_window->Name, id); - - const float backup_border_size = g.Style.ChildBorderSize; - if (!border) - g.Style.ChildBorderSize = 0.0f; - bool ret = Begin(title, NULL, flags); - g.Style.ChildBorderSize = backup_border_size; - - ImGuiWindow* child_window = g.CurrentWindow; - child_window->ChildId = id; - child_window->AutoFitChildAxises = (ImS8)auto_fit_axises; - - // Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually. - // While this is not really documented/defined, it seems that the expected thing to do. - if (child_window->BeginCount == 1) - parent_window->DC.CursorPos = child_window->Pos; - - // Process navigation-in immediately so NavInit can run on first frame - if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll)) - { - FocusWindow(child_window); - NavInitWindow(child_window, false); - SetActiveID(id+1, child_window); // Steal ActiveId with a dummy id so that key-press won't activate child item - g.ActiveIdSource = ImGuiInputSource_Nav; - } - return ret; -} - -bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags); -} - -bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) -{ - IM_ASSERT(id != 0); - return BeginChildEx(NULL, id, size_arg, border, extra_flags); -} - -void ImGui::EndChild() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - IM_ASSERT(g.WithinEndChild == false); - IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls - - g.WithinEndChild = true; - if (window->BeginCount > 1) - { - End(); - } - else - { - ImVec2 sz = window->Size; - if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f - sz.x = ImMax(4.0f, sz.x); - if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y)) - sz.y = ImMax(4.0f, sz.y); - End(); - - ImGuiWindow* parent_window = g.CurrentWindow; - ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); - ItemSize(sz); - if ((window->DC.NavLayerActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWindowFlags_NavFlattened)) - { - ItemAdd(bb, window->ChildId); - RenderNavHighlight(bb, window->ChildId); - - // When browsing a window that has no activable items (scroll only) we keep a highlight on the child - if (window->DC.NavLayerActiveMask == 0 && window == g.NavWindow) - RenderNavHighlight(ImRect(bb.Min - ImVec2(2,2), bb.Max + ImVec2(2,2)), g.NavId, ImGuiNavHighlightFlags_TypeThin); - } - else - { - // Not navigable into - ItemAdd(bb, 0); - } - } - g.WithinEndChild = false; -} - -// Helper to create a child window / scrolling region that looks like a normal widget frame. -bool ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags) -{ - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]); - PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding); - PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize); - PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding); - bool ret = BeginChild(id, size, true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysUseWindowPadding | extra_flags); - PopStyleVar(3); - PopStyleColor(); - return ret; -} - -void ImGui::EndChildFrame() -{ - EndChild(); -} - -static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond flags, bool enabled) -{ - window->SetWindowPosAllowFlags = enabled ? (window->SetWindowPosAllowFlags | flags) : (window->SetWindowPosAllowFlags & ~flags); - window->SetWindowSizeAllowFlags = enabled ? (window->SetWindowSizeAllowFlags | flags) : (window->SetWindowSizeAllowFlags & ~flags); - window->SetWindowCollapsedAllowFlags = enabled ? (window->SetWindowCollapsedAllowFlags | flags) : (window->SetWindowCollapsedAllowFlags & ~flags); -} - -ImGuiWindow* ImGui::FindWindowByID(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - return (ImGuiWindow*)g.WindowsById.GetVoidPtr(id); -} - -ImGuiWindow* ImGui::FindWindowByName(const char* name) -{ - ImGuiID id = ImHashStr(name); - return FindWindowByID(id); -} - -static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags); - - // Create window the first time - ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); - window->Flags = flags; - g.WindowsById.SetVoidPtr(window->ID, window); - - // Default/arbitrary window position. Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window. - window->Pos = ImVec2(60, 60); - - // User can disable loading and saving of settings. Tooltip and child windows also don't store settings. - if (!(flags & ImGuiWindowFlags_NoSavedSettings)) - if (ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID)) - { - // Retrieve settings from .ini file - window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); - SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false); - window->Pos = ImVec2(settings->Pos.x, settings->Pos.y); - window->Collapsed = settings->Collapsed; - if (settings->Size.x > 0 && settings->Size.y > 0) - size = ImVec2(settings->Size.x, settings->Size.y); - } - window->Size = window->SizeFull = ImFloor(size); - window->DC.CursorStartPos = window->DC.CursorMaxPos = window->Pos; // So first call to CalcContentSize() doesn't return crazy values - - if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) - { - window->AutoFitFramesX = window->AutoFitFramesY = 2; - window->AutoFitOnlyGrows = false; - } - else - { - if (window->Size.x <= 0.0f) - window->AutoFitFramesX = 2; - if (window->Size.y <= 0.0f) - window->AutoFitFramesY = 2; - window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); - } - - g.WindowsFocusOrder.push_back(window); - if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) - g.Windows.push_front(window); // Quite slow but rare and only once - else - g.Windows.push_back(window); - return window; -} - -static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size) -{ - ImGuiContext& g = *GImGui; - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint) - { - // Using -1,-1 on either X/Y axis to preserve the current size. - ImRect cr = g.NextWindowData.SizeConstraintRect; - new_size.x = (cr.Min.x >= 0 && cr.Max.x >= 0) ? ImClamp(new_size.x, cr.Min.x, cr.Max.x) : window->SizeFull.x; - new_size.y = (cr.Min.y >= 0 && cr.Max.y >= 0) ? ImClamp(new_size.y, cr.Min.y, cr.Max.y) : window->SizeFull.y; - if (g.NextWindowData.SizeCallback) - { - ImGuiSizeCallbackData data; - data.UserData = g.NextWindowData.SizeCallbackUserData; - data.Pos = window->Pos; - data.CurrentSize = window->SizeFull; - data.DesiredSize = new_size; - g.NextWindowData.SizeCallback(&data); - new_size = data.DesiredSize; - } - new_size.x = IM_FLOOR(new_size.x); - new_size.y = IM_FLOOR(new_size.y); - } - - // Minimum size - if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) - { - ImGuiWindow* window_for_height = window; - new_size = ImMax(new_size, g.Style.WindowMinSize); - new_size.y = ImMax(new_size.y, window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); // Reduce artifacts with very small windows - } - return new_size; -} - -static ImVec2 CalcWindowContentSize(ImGuiWindow* window) -{ - if (window->Collapsed) - if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) - return window->ContentSize; - if (window->Hidden && window->HiddenFramesCannotSkipItems == 0 && window->HiddenFramesCanSkipItems > 0) - return window->ContentSize; - - ImVec2 sz; - sz.x = IM_FLOOR((window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); - sz.y = IM_FLOOR((window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); - return sz; -} - -static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents) -{ - ImGuiContext& g = *GImGui; - ImGuiStyle& style = g.Style; - ImVec2 size_decorations = ImVec2(0.0f, window->TitleBarHeight() + window->MenuBarHeight()); - ImVec2 size_pad = window->WindowPadding * 2.0f; - ImVec2 size_desired = size_contents + size_pad + size_decorations; - if (window->Flags & ImGuiWindowFlags_Tooltip) - { - // Tooltip always resize - return size_desired; - } - else - { - // Maximum window size is determined by the viewport size or monitor size - const bool is_popup = (window->Flags & ImGuiWindowFlags_Popup) != 0; - const bool is_menu = (window->Flags & ImGuiWindowFlags_ChildMenu) != 0; - ImVec2 size_min = style.WindowMinSize; - if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups) - size_min = ImMin(size_min, ImVec2(4.0f, 4.0f)); - ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, g.IO.DisplaySize - style.DisplaySafeAreaPadding * 2.0f)); - - // When the window cannot fit all contents (either because of constraints, either because screen is too small), - // we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding. - ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit); - bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - size_decorations.x < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar); - bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - size_decorations.y < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar); - if (will_have_scrollbar_x) - size_auto_fit.y += style.ScrollbarSize; - if (will_have_scrollbar_y) - size_auto_fit.x += style.ScrollbarSize; - return size_auto_fit; - } -} - -ImVec2 ImGui::CalcWindowExpectedSize(ImGuiWindow* window) -{ - ImVec2 size_contents = CalcWindowContentSize(window); - ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, size_contents); - ImVec2 size_final = CalcWindowSizeAfterConstraint(window, size_auto_fit); - return size_final; -} - -static ImGuiCol GetWindowBgColorIdxFromFlags(ImGuiWindowFlags flags) -{ - if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup)) - return ImGuiCol_PopupBg; - if (flags & ImGuiWindowFlags_ChildWindow) - return ImGuiCol_ChildBg; - return ImGuiCol_WindowBg; -} - -static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const ImVec2& corner_target, const ImVec2& corner_norm, ImVec2* out_pos, ImVec2* out_size) -{ - ImVec2 pos_min = ImLerp(corner_target, window->Pos, corner_norm); // Expected window upper-left - ImVec2 pos_max = ImLerp(window->Pos + window->Size, corner_target, corner_norm); // Expected window lower-right - ImVec2 size_expected = pos_max - pos_min; - ImVec2 size_constrained = CalcWindowSizeAfterConstraint(window, size_expected); - *out_pos = pos_min; - if (corner_norm.x == 0.0f) - out_pos->x -= (size_constrained.x - size_expected.x); - if (corner_norm.y == 0.0f) - out_pos->y -= (size_constrained.y - size_expected.y); - *out_size = size_constrained; -} - -struct ImGuiResizeGripDef -{ - ImVec2 CornerPosN; - ImVec2 InnerDir; - int AngleMin12, AngleMax12; -}; - -static const ImGuiResizeGripDef resize_grip_def[4] = -{ - { ImVec2(1,1), ImVec2(-1,-1), 0, 3 }, // Lower-right - { ImVec2(0,1), ImVec2(+1,-1), 3, 6 }, // Lower-left - { ImVec2(0,0), ImVec2(+1,+1), 6, 9 }, // Upper-left (Unused) - { ImVec2(1,0), ImVec2(-1,+1), 9,12 }, // Upper-right (Unused) -}; - -static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness) -{ - ImRect rect = window->Rect(); - if (thickness == 0.0f) rect.Max -= ImVec2(1,1); - if (border_n == 0) return ImRect(rect.Min.x + perp_padding, rect.Min.y - thickness, rect.Max.x - perp_padding, rect.Min.y + thickness); // Top - if (border_n == 1) return ImRect(rect.Max.x - thickness, rect.Min.y + perp_padding, rect.Max.x + thickness, rect.Max.y - perp_padding); // Right - if (border_n == 2) return ImRect(rect.Min.x + perp_padding, rect.Max.y - thickness, rect.Max.x - perp_padding, rect.Max.y + thickness); // Bottom - if (border_n == 3) return ImRect(rect.Min.x - thickness, rect.Min.y + perp_padding, rect.Min.x + thickness, rect.Max.y - perp_padding); // Left - IM_ASSERT(0); - return ImRect(); -} - -// 0..3: corners (Lower-right, Lower-left, Unused, Unused) -// 4..7: borders (Top, Right, Bottom, Left) -ImGuiID ImGui::GetWindowResizeID(ImGuiWindow* window, int n) -{ - IM_ASSERT(n >= 0 && n <= 7); - ImGuiID id = window->ID; - id = ImHashStr("#RESIZE", 0, id); - id = ImHashData(&n, sizeof(int), id); - return id; -} - -// Handle resize for: Resize Grips, Borders, Gamepad -// Return true when using auto-fit (double click on resize grip) -static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]) -{ - ImGuiContext& g = *GImGui; - ImGuiWindowFlags flags = window->Flags; - - if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) - return false; - if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implicit/fallback Debug window. - return false; - - bool ret_auto_fit = false; - const int resize_border_count = g.IO.ConfigWindowsResizeFromEdges ? 4 : 0; - const float grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); - const float grip_hover_inner_size = IM_FLOOR(grip_draw_size * 0.75f); - const float grip_hover_outer_size = g.IO.ConfigWindowsResizeFromEdges ? WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS : 0.0f; - - ImVec2 pos_target(FLT_MAX, FLT_MAX); - ImVec2 size_target(FLT_MAX, FLT_MAX); - - // Resize grips and borders are on layer 1 - window->DC.NavLayerCurrent = ImGuiNavLayer_Menu; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Menu); - - // Manual resize grips - PushID("#RESIZE"); - for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) - { - const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n]; - const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN); - - // Using the FlattenChilds button flag we make the resize button accessible even if we are hovering over a child window - ImRect resize_rect(corner - grip.InnerDir * grip_hover_outer_size, corner + grip.InnerDir * grip_hover_inner_size); - if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x); - if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y); - bool hovered, held; - ButtonBehavior(resize_rect, window->GetID(resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); - //GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255)); - if (hovered || held) - g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE; - - if (held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0) - { - // Manual auto-fit when double-clicking - size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit); - ret_auto_fit = true; - ClearActiveID(); - } - else if (held) - { - // Resize from any of the four corners - // We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position - ImVec2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + ImLerp(grip.InnerDir * grip_hover_outer_size, grip.InnerDir * -grip_hover_inner_size, grip.CornerPosN); // Corner of the window corresponding to our corner grip - CalcResizePosSizeFromAnyCorner(window, corner_target, grip.CornerPosN, &pos_target, &size_target); - } - if (resize_grip_n == 0 || held || hovered) - resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip); - } - for (int border_n = 0; border_n < resize_border_count; border_n++) - { - bool hovered, held; - ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); - ButtonBehavior(border_rect, window->GetID(border_n + 4), &hovered, &held, ImGuiButtonFlags_FlattenChildren); - //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255)); - if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held) - { - g.MouseCursor = (border_n & 1) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS; - if (held) - *border_held = border_n; - } - if (held) - { - ImVec2 border_target = window->Pos; - ImVec2 border_posn; - if (border_n == 0) { border_posn = ImVec2(0, 0); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Top - if (border_n == 1) { border_posn = ImVec2(1, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Right - if (border_n == 2) { border_posn = ImVec2(0, 1); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Bottom - if (border_n == 3) { border_posn = ImVec2(0, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Left - CalcResizePosSizeFromAnyCorner(window, border_target, border_posn, &pos_target, &size_target); - } - } - PopID(); - - // Restore nav layer - window->DC.NavLayerCurrent = ImGuiNavLayer_Main; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); - - // Navigation resize (keyboard/gamepad) - if (g.NavWindowingTarget && g.NavWindowingTarget->RootWindow == window) - { - ImVec2 nav_resize_delta; - if (g.NavInputSource == ImGuiInputSource_NavKeyboard && g.IO.KeyShift) - nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); - if (g.NavInputSource == ImGuiInputSource_NavGamepad) - nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_Down); - if (nav_resize_delta.x != 0.0f || nav_resize_delta.y != 0.0f) - { - const float NAV_RESIZE_SPEED = 600.0f; - nav_resize_delta *= ImFloor(NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); - g.NavWindowingToggleLayer = false; - g.NavDisableMouseHover = true; - resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive); - // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck. - size_target = CalcWindowSizeAfterConstraint(window, window->SizeFull + nav_resize_delta); - } - } - - // Apply back modified position/size to window - if (size_target.x != FLT_MAX) - { - window->SizeFull = size_target; - MarkIniSettingsDirty(window); - } - if (pos_target.x != FLT_MAX) - { - window->Pos = ImFloor(pos_target); - MarkIniSettingsDirty(window); - } - - window->Size = window->SizeFull; - return ret_auto_fit; -} - -static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& rect, const ImVec2& padding) -{ - ImGuiContext& g = *GImGui; - ImVec2 size_for_clamping = (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) ? ImVec2(window->Size.x, window->TitleBarHeight()) : window->Size; - window->Pos = ImMin(rect.Max - padding, ImMax(window->Pos + size_for_clamping, rect.Min + padding) - size_for_clamping); -} - -static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - float rounding = window->WindowRounding; - float border_size = window->WindowBorderSize; - if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground)) - window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); - - int border_held = window->ResizeBorderHeld; - if (border_held != -1) - { - struct ImGuiResizeBorderDef - { - ImVec2 InnerDir; - ImVec2 CornerPosN1, CornerPosN2; - float OuterAngle; - }; - static const ImGuiResizeBorderDef resize_border_def[4] = - { - { ImVec2(0,+1), ImVec2(0,0), ImVec2(1,0), IM_PI*1.50f }, // Top - { ImVec2(-1,0), ImVec2(1,0), ImVec2(1,1), IM_PI*0.00f }, // Right - { ImVec2(0,-1), ImVec2(1,1), ImVec2(0,1), IM_PI*0.50f }, // Bottom - { ImVec2(+1,0), ImVec2(0,1), ImVec2(0,0), IM_PI*1.00f } // Left - }; - const ImGuiResizeBorderDef& def = resize_border_def[border_held]; - ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f); - window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI*0.25f, def.OuterAngle); - window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI*0.25f); - window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), false, ImMax(2.0f, border_size)); // Thicker than usual - } - if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) - { - float y = window->Pos.y + window->TitleBarHeight() - 1; - window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->Size.x - border_size, y), GetColorU32(ImGuiCol_Border), g.Style.FrameBorderSize); - } -} - -// Draw background and borders -// Draw and handle scrollbars -void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size) -{ - ImGuiContext& g = *GImGui; - ImGuiStyle& style = g.Style; - ImGuiWindowFlags flags = window->Flags; - - // Ensure that ScrollBar doesn't read last frame's SkipItems - window->SkipItems = false; - - // Draw window + handle manual resize - // As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame. - const float window_rounding = window->WindowRounding; - const float window_border_size = window->WindowBorderSize; - if (window->Collapsed) - { - // Title bar only - float backup_border_size = style.FrameBorderSize; - g.Style.FrameBorderSize = window->WindowBorderSize; - ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && !g.NavDisableHighlight) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed); - RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding); - g.Style.FrameBorderSize = backup_border_size; - } - else - { - // Window background - if (!(flags & ImGuiWindowFlags_NoBackground)) - { - ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags)); - bool override_alpha = false; - float alpha = 1.0f; - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha) - { - alpha = g.NextWindowData.BgAlphaVal; - override_alpha = true; - } - if (override_alpha) - bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT); - window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot); - } - - // Title bar - if (!(flags & ImGuiWindowFlags_NoTitleBar)) - { - ImU32 title_bar_col = GetColorU32(title_bar_is_highlight ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg); - window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, window_rounding, ImDrawCornerFlags_Top); - } - - // Menu bar - if (flags & ImGuiWindowFlags_MenuBar) - { - ImRect menu_bar_rect = window->MenuBarRect(); - menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have minimum size covering the menu bar so this is useful for them. - window->DrawList->AddRectFilled(menu_bar_rect.Min + ImVec2(window_border_size, 0), menu_bar_rect.Max - ImVec2(window_border_size, 0), GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawCornerFlags_Top); - if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y) - window->DrawList->AddLine(menu_bar_rect.GetBL(), menu_bar_rect.GetBR(), GetColorU32(ImGuiCol_Border), style.FrameBorderSize); - } - - // Scrollbars - if (window->ScrollbarX) - Scrollbar(ImGuiAxis_X); - if (window->ScrollbarY) - Scrollbar(ImGuiAxis_Y); - - // Render resize grips (after their input handling so we don't have a frame of latency) - if (!(flags & ImGuiWindowFlags_NoResize)) - { - for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) - { - const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n]; - const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN); - window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(window_border_size, resize_grip_draw_size) : ImVec2(resize_grip_draw_size, window_border_size))); - window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(resize_grip_draw_size, window_border_size) : ImVec2(window_border_size, resize_grip_draw_size))); - window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + window_border_size), corner.y + grip.InnerDir.y * (window_rounding + window_border_size)), window_rounding, grip.AngleMin12, grip.AngleMax12); - window->DrawList->PathFillConvex(resize_grip_col[resize_grip_n]); - } - } - - // Borders - RenderWindowOuterBorders(window); - } -} - -// Render title text, collapse button, close button -void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open) -{ - ImGuiContext& g = *GImGui; - ImGuiStyle& style = g.Style; - ImGuiWindowFlags flags = window->Flags; - - const bool has_close_button = (p_open != NULL); - const bool has_collapse_button = !(flags & ImGuiWindowFlags_NoCollapse) && (style.WindowMenuButtonPosition != ImGuiDir_None); - - // Close & Collapse button are on the Menu NavLayer and don't default focus (unless there's nothing else on that layer) - const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags; - window->DC.ItemFlags |= ImGuiItemFlags_NoNavDefaultFocus; - window->DC.NavLayerCurrent = ImGuiNavLayer_Menu; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Menu); - - // Layout buttons - // FIXME: Would be nice to generalize the subtleties expressed here into reusable code. - float pad_l = style.FramePadding.x; - float pad_r = style.FramePadding.x; - float button_sz = g.FontSize; - ImVec2 close_button_pos; - ImVec2 collapse_button_pos; - if (has_close_button) - { - pad_r += button_sz; - close_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y); - } - if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Right) - { - pad_r += button_sz; - collapse_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y); - } - if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Left) - { - collapse_button_pos = ImVec2(title_bar_rect.Min.x + pad_l - style.FramePadding.x, title_bar_rect.Min.y); - pad_l += button_sz; - } - - // Collapse button (submitting first so it gets priority when choosing a navigation init fallback) - if (has_collapse_button) - if (CollapseButton(window->GetID("#COLLAPSE"), collapse_button_pos)) - window->WantCollapseToggle = true; // Defer actual collapsing to next frame as we are too far in the Begin() function - - // Close button - if (has_close_button) - if (CloseButton(window->GetID("#CLOSE"), close_button_pos)) - *p_open = false; - - window->DC.NavLayerCurrent = ImGuiNavLayer_Main; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); - window->DC.ItemFlags = item_flags_backup; - - // Title bar text (with: horizontal alignment, avoiding collapse/close button, optional "unsaved document" marker) - // FIXME: Refactor text alignment facilities along with RenderText helpers, this is WAY too much messy code.. - const char* UNSAVED_DOCUMENT_MARKER = "*"; - const float marker_size_x = (flags & ImGuiWindowFlags_UnsavedDocument) ? CalcTextSize(UNSAVED_DOCUMENT_MARKER, NULL, false).x : 0.0f; - const ImVec2 text_size = CalcTextSize(name, NULL, true) + ImVec2(marker_size_x, 0.0f); - - // As a nice touch we try to ensure that centered title text doesn't get affected by visibility of Close/Collapse button, - // while uncentered title text will still reach edges correct. - if (pad_l > style.FramePadding.x) - pad_l += g.Style.ItemInnerSpacing.x; - if (pad_r > style.FramePadding.x) - pad_r += g.Style.ItemInnerSpacing.x; - if (style.WindowTitleAlign.x > 0.0f && style.WindowTitleAlign.x < 1.0f) - { - float centerness = ImSaturate(1.0f - ImFabs(style.WindowTitleAlign.x - 0.5f) * 2.0f); // 0.0f on either edges, 1.0f on center - float pad_extend = ImMin(ImMax(pad_l, pad_r), title_bar_rect.GetWidth() - pad_l - pad_r - text_size.x); - pad_l = ImMax(pad_l, pad_extend * centerness); - pad_r = ImMax(pad_r, pad_extend * centerness); - } - - ImRect layout_r(title_bar_rect.Min.x + pad_l, title_bar_rect.Min.y, title_bar_rect.Max.x - pad_r, title_bar_rect.Max.y); - ImRect clip_r(layout_r.Min.x, layout_r.Min.y, layout_r.Max.x + g.Style.ItemInnerSpacing.x, layout_r.Max.y); - //if (g.IO.KeyCtrl) window->DrawList->AddRect(layout_r.Min, layout_r.Max, IM_COL32(255, 128, 0, 255)); // [DEBUG] - RenderTextClipped(layout_r.Min, layout_r.Max, name, NULL, &text_size, style.WindowTitleAlign, &clip_r); - if (flags & ImGuiWindowFlags_UnsavedDocument) - { - ImVec2 marker_pos = ImVec2(ImMax(layout_r.Min.x, layout_r.Min.x + (layout_r.GetWidth() - text_size.x) * style.WindowTitleAlign.x) + text_size.x, layout_r.Min.y) + ImVec2(2 - marker_size_x, 0.0f); - ImVec2 off = ImVec2(0.0f, IM_FLOOR(-g.FontSize * 0.25f)); - RenderTextClipped(marker_pos + off, layout_r.Max + off, UNSAVED_DOCUMENT_MARKER, NULL, NULL, ImVec2(0, style.WindowTitleAlign.y), &clip_r); - } -} - -void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window) -{ - window->ParentWindow = parent_window; - window->RootWindow = window->RootWindowForTitleBarHighlight = window->RootWindowForNav = window; - if (parent_window && (flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Tooltip)) - window->RootWindow = parent_window->RootWindow; - if (parent_window && !(flags & ImGuiWindowFlags_Modal) && (flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup))) - window->RootWindowForTitleBarHighlight = parent_window->RootWindowForTitleBarHighlight; - while (window->RootWindowForNav->Flags & ImGuiWindowFlags_NavFlattened) - { - IM_ASSERT(window->RootWindowForNav->ParentWindow != NULL); - window->RootWindowForNav = window->RootWindowForNav->ParentWindow; - } -} - -// Push a new Dear ImGui window to add widgets to. -// - A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair. -// - Begin/End can be called multiple times during the frame with the same window name to append content. -// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). -// You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file. -// - Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned. -// - Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed. -bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - IM_ASSERT(name != NULL && name[0] != '\0'); // Window name required - IM_ASSERT(g.WithinFrameScope); // Forgot to call ImGui::NewFrame() - IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet - - // Find or create - ImGuiWindow* window = FindWindowByName(name); - const bool window_just_created = (window == NULL); - if (window_just_created) - { - ImVec2 size_on_first_use = (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) ? g.NextWindowData.SizeVal : ImVec2(0.0f, 0.0f); // Any condition flag will do since we are creating a new window here. - window = CreateNewWindow(name, size_on_first_use, flags); - } - - // Automatically disable manual moving/resizing when NoInputs is set - if ((flags & ImGuiWindowFlags_NoInputs) == ImGuiWindowFlags_NoInputs) - flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize; - - if (flags & ImGuiWindowFlags_NavFlattened) - IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow); - - const int current_frame = g.FrameCount; - const bool first_begin_of_the_frame = (window->LastFrameActive != current_frame); - window->IsFallbackWindow = (g.CurrentWindowStack.Size == 0 && g.WithinFrameScopeWithImplicitWindow); - - // Update the Appearing flag - bool window_just_activated_by_user = (window->LastFrameActive < current_frame - 1); // Not using !WasActive because the implicit "Debug" window would always toggle off->on - const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0); - if (flags & ImGuiWindowFlags_Popup) - { - ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size]; - window_just_activated_by_user |= (window->PopupId != popup_ref.PopupId); // We recycle popups so treat window as activated if popup id changed - window_just_activated_by_user |= (window != popup_ref.Window); - } - window->Appearing = (window_just_activated_by_user || window_just_appearing_after_hidden_for_resize); - if (window->Appearing) - SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true); - - // Update Flags, LastFrameActive, BeginOrderXXX fields - if (first_begin_of_the_frame) - { - window->Flags = (ImGuiWindowFlags)flags; - window->LastFrameActive = current_frame; - window->LastTimeActive = (float)g.Time; - window->BeginOrderWithinParent = 0; - window->BeginOrderWithinContext = (short)(g.WindowsActiveCount++); - } - else - { - flags = window->Flags; - } - - // Parent window is latched only on the first call to Begin() of the frame, so further append-calls can be done from a different window stack - ImGuiWindow* parent_window_in_stack = g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back(); - ImGuiWindow* parent_window = first_begin_of_the_frame ? ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup)) ? parent_window_in_stack : NULL) : window->ParentWindow; - IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow)); - - // We allow window memory to be compacted so recreate the base stack when needed. - if (window->IDStack.Size == 0) - window->IDStack.push_back(window->ID); - - // Add to stack - // We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow() - g.CurrentWindowStack.push_back(window); - g.CurrentWindow = NULL; - ErrorCheckBeginEndCompareStacksSize(window, true); - if (flags & ImGuiWindowFlags_Popup) - { - ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size]; - popup_ref.Window = window; - g.BeginPopupStack.push_back(popup_ref); - window->PopupId = popup_ref.PopupId; - } - - if (window_just_appearing_after_hidden_for_resize && !(flags & ImGuiWindowFlags_ChildWindow)) - window->NavLastIds[0] = 0; - - // Update ->RootWindow and others pointers (before any possible call to FocusWindow) - if (first_begin_of_the_frame) - UpdateWindowParentAndRootLinks(window, flags, parent_window); - - // Process SetNextWindow***() calls - bool window_pos_set_by_api = false; - bool window_size_x_set_by_api = false, window_size_y_set_by_api = false; - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) - { - window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.NextWindowData.PosCond) != 0; - if (window_pos_set_by_api && ImLengthSqr(g.NextWindowData.PosPivotVal) > 0.00001f) - { - // May be processed on the next frame if this is our first frame and we are measuring size - // FIXME: Look into removing the branch so everything can go through this same code path for consistency. - window->SetWindowPosVal = g.NextWindowData.PosVal; - window->SetWindowPosPivot = g.NextWindowData.PosPivotVal; - window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); - } - else - { - SetWindowPos(window, g.NextWindowData.PosVal, g.NextWindowData.PosCond); - } - } - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) - { - window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.x > 0.0f); - window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.y > 0.0f); - SetWindowSize(window, g.NextWindowData.SizeVal, g.NextWindowData.SizeCond); - } - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasContentSize) - window->ContentSizeExplicit = g.NextWindowData.ContentSizeVal; - else if (first_begin_of_the_frame) - window->ContentSizeExplicit = ImVec2(0.0f, 0.0f); - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasCollapsed) - SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond); - if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasFocus) - FocusWindow(window); - if (window->Appearing) - SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, false); - - // When reusing window again multiple times a frame, just append content (don't need to setup again) - if (first_begin_of_the_frame) - { - // Initialize - const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345) - window->Active = true; - window->HasCloseButton = (p_open != NULL); - window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX); - window->IDStack.resize(1); - - // Restore buffer capacity when woken from a compacted state, to avoid - if (window->MemoryCompacted) - GcAwakeTransientWindowBuffers(window); - - // Update stored window name when it changes (which can _only_ happen with the "###" operator, so the ID would stay unchanged). - // The title bar always display the 'name' parameter, so we only update the string storage if it needs to be visible to the end-user elsewhere. - bool window_title_visible_elsewhere = false; - if (g.NavWindowingList != NULL && (window->Flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window titles visible when using CTRL+TAB - window_title_visible_elsewhere = true; - if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->Name) != 0) - { - size_t buf_len = (size_t)window->NameBufLen; - window->Name = ImStrdupcpy(window->Name, &buf_len, name); - window->NameBufLen = (int)buf_len; - } - - // UPDATE CONTENTS SIZE, UPDATE HIDDEN STATUS - - // Update contents size from last frame for auto-fitting (or use explicit size) - window->ContentSize = CalcWindowContentSize(window); - if (window->HiddenFramesCanSkipItems > 0) - window->HiddenFramesCanSkipItems--; - if (window->HiddenFramesCannotSkipItems > 0) - window->HiddenFramesCannotSkipItems--; - - // Hide new windows for one frame until they calculate their size - if (window_just_created && (!window_size_x_set_by_api || !window_size_y_set_by_api)) - window->HiddenFramesCannotSkipItems = 1; - - // Hide popup/tooltip window when re-opening while we measure size (because we recycle the windows) - // We reset Size/ContentSize for reappearing popups/tooltips early in this function, so further code won't be tempted to use the old size. - if (window_just_activated_by_user && (flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0) - { - window->HiddenFramesCannotSkipItems = 1; - if (flags & ImGuiWindowFlags_AlwaysAutoResize) - { - if (!window_size_x_set_by_api) - window->Size.x = window->SizeFull.x = 0.f; - if (!window_size_y_set_by_api) - window->Size.y = window->SizeFull.y = 0.f; - window->ContentSize = ImVec2(0.f, 0.f); - } - } - - // SELECT VIEWPORT - // FIXME-VIEWPORT: In the docking/viewport branch, this is the point where we select the current viewport (which may affect the style) - SetCurrentWindow(window); - - // LOCK BORDER SIZE AND PADDING FOR THE FRAME (so that altering them doesn't cause inconsistencies) - - if (flags & ImGuiWindowFlags_ChildWindow) - window->WindowBorderSize = style.ChildBorderSize; - else - window->WindowBorderSize = ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupBorderSize : style.WindowBorderSize; - window->WindowPadding = style.WindowPadding; - if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == 0.0f) - window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f); - - // Collapse window by double-clicking on title bar - // At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing - if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse)) - { - // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar. - ImRect title_bar_rect = window->TitleBarRect(); - if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0]) - window->WantCollapseToggle = true; - if (window->WantCollapseToggle) - { - window->Collapsed = !window->Collapsed; - MarkIniSettingsDirty(window); - FocusWindow(window); - } - } - else - { - window->Collapsed = false; - } - window->WantCollapseToggle = false; - - // SIZE - - // Calculate auto-fit size, handle automatic resize - const ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, window->ContentSize); - bool use_current_size_for_scrollbar_x = window_just_created; - bool use_current_size_for_scrollbar_y = window_just_created; - if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed) - { - // Using SetNextWindowSize() overrides ImGuiWindowFlags_AlwaysAutoResize, so it can be used on tooltips/popups, etc. - if (!window_size_x_set_by_api) - { - window->SizeFull.x = size_auto_fit.x; - use_current_size_for_scrollbar_x = true; - } - if (!window_size_y_set_by_api) - { - window->SizeFull.y = size_auto_fit.y; - use_current_size_for_scrollbar_y = true; - } - } - else if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) - { - // Auto-fit may only grow window during the first few frames - // We still process initial auto-fit on collapsed windows to get a window width, but otherwise don't honor ImGuiWindowFlags_AlwaysAutoResize when collapsed. - if (!window_size_x_set_by_api && window->AutoFitFramesX > 0) - { - window->SizeFull.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x; - use_current_size_for_scrollbar_x = true; - } - if (!window_size_y_set_by_api && window->AutoFitFramesY > 0) - { - window->SizeFull.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y; - use_current_size_for_scrollbar_y = true; - } - if (!window->Collapsed) - MarkIniSettingsDirty(window); - } - - // Apply minimum/maximum window size constraints and final size - window->SizeFull = CalcWindowSizeAfterConstraint(window, window->SizeFull); - window->Size = window->Collapsed && !(flags & ImGuiWindowFlags_ChildWindow) ? window->TitleBarRect().GetSize() : window->SizeFull; - - // Decoration size - const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); - - // POSITION - - // Popup latch its initial position, will position itself when it appears next frame - if (window_just_activated_by_user) - { - window->AutoPosLastDirection = ImGuiDir_None; - if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api) - window->Pos = g.BeginPopupStack.back().OpenPopupPos; - } - - // Position child window - if (flags & ImGuiWindowFlags_ChildWindow) - { - IM_ASSERT(parent_window && parent_window->Active); - window->BeginOrderWithinParent = (short)parent_window->DC.ChildWindows.Size; - parent_window->DC.ChildWindows.push_back(window); - if (!(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api && !window_is_child_tooltip) - window->Pos = parent_window->DC.CursorPos; - } - - const bool window_pos_with_pivot = (window->SetWindowPosVal.x != FLT_MAX && window->HiddenFramesCannotSkipItems == 0); - if (window_pos_with_pivot) - SetWindowPos(window, window->SetWindowPosVal - window->SizeFull * window->SetWindowPosPivot, 0); // Position given a pivot (e.g. for centering) - else if ((flags & ImGuiWindowFlags_ChildMenu) != 0) - window->Pos = FindBestWindowPosForPopup(window); - else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_just_appearing_after_hidden_for_resize) - window->Pos = FindBestWindowPosForPopup(window); - else if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api && !window_is_child_tooltip) - window->Pos = FindBestWindowPosForPopup(window); - - // Clamp position/size so window stays visible within its viewport or monitor - // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing. - ImRect viewport_rect(GetViewportRect()); - if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) - { - ImVec2 clamp_padding = ImMax(style.DisplayWindowPadding, style.DisplaySafeAreaPadding); - if (viewport_rect.GetWidth() > 0 && viewport_rect.GetHeight() > 0.0f) - { - ClampWindowRect(window, viewport_rect, clamp_padding); - } - } - window->Pos = ImFloor(window->Pos); - - // Lock window rounding for the frame (so that altering them doesn't cause inconsistencies) - window->WindowRounding = (flags & ImGuiWindowFlags_ChildWindow) ? style.ChildRounding : ((flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupRounding : style.WindowRounding; - - // Apply window focus (new and reactivated windows are moved to front) - bool want_focus = false; - if (window_just_activated_by_user && !(flags & ImGuiWindowFlags_NoFocusOnAppearing)) - { - if (flags & ImGuiWindowFlags_Popup) - want_focus = true; - else if ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) == 0) - want_focus = true; - } - - // Handle manual resize: Resize Grips, Borders, Gamepad - int border_held = -1; - ImU32 resize_grip_col[4] = {}; - const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it. - const float resize_grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); - if (!window->Collapsed) - if (UpdateWindowManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0])) - use_current_size_for_scrollbar_x = use_current_size_for_scrollbar_y = true; - window->ResizeBorderHeld = (signed char)border_held; - - // SCROLLBAR VISIBILITY - - // Update scrollbar visibility (based on the Size that was effective during last frame or the auto-resized Size). - if (!window->Collapsed) - { - // When reading the current size we need to read it after size constraints have been applied. - // When we use InnerRect here we are intentionally reading last frame size, same for ScrollbarSizes values before we set them again. - ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - decoration_up_height); - ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + window->ScrollbarSizes; - ImVec2 needed_size_from_last_frame = window_just_created ? ImVec2(0, 0) : window->ContentSize + window->WindowPadding * 2.0f; - float size_x_for_scrollbars = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.x : avail_size_from_last_frame.x; - float size_y_for_scrollbars = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.y : avail_size_from_last_frame.y; - //bool scrollbar_y_from_last_frame = window->ScrollbarY; // FIXME: May want to use that in the ScrollbarX expression? How many pros vs cons? - window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar)); - window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((needed_size_from_last_frame.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)); - if (window->ScrollbarX && !window->ScrollbarY) - window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar); - window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f); - } - - // UPDATE RECTANGLES (1- THOSE NOT AFFECTED BY SCROLLING) - // Update various regions. Variables they depends on should be set above in this function. - // We set this up after processing the resize grip so that our rectangles doesn't lag by a frame. - - // Outer rectangle - // Not affected by window border size. Used by: - // - FindHoveredWindow() (w/ extra padding when border resize is enabled) - // - Begin() initial clipping rect for drawing window background and borders. - // - Begin() clipping whole child - const ImRect host_rect = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip) ? parent_window->ClipRect : viewport_rect; - const ImRect outer_rect = window->Rect(); - const ImRect title_bar_rect = window->TitleBarRect(); - window->OuterRectClipped = outer_rect; - window->OuterRectClipped.ClipWith(host_rect); - - // Inner rectangle - // Not affected by window border size. Used by: - // - InnerClipRect - // - ScrollToBringRectIntoView() - // - NavUpdatePageUpPageDown() - // - Scrollbar() - window->InnerRect.Min.x = window->Pos.x; - window->InnerRect.Min.y = window->Pos.y + decoration_up_height; - window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x; - window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->ScrollbarSizes.y; - - // Inner clipping rectangle. - // Will extend a little bit outside the normal work region. - // This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space. - // Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result. - // Note that if our window is collapsed we will end up with an inverted (~null) clipping rectangle which is the correct behavior. - // Affected by window/frame border size. Used by: - // - Begin() initial clip rect - float top_border_size = (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize); - window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize)); - window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size); - window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize)); - window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y - window->WindowBorderSize); - window->InnerClipRect.ClipWithFull(host_rect); - - // Default item width. Make it proportional to window size if window manually resizes - if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize)) - window->ItemWidthDefault = ImFloor(window->Size.x * 0.65f); - else - window->ItemWidthDefault = ImFloor(g.FontSize * 16.0f); - - // SCROLLING - - // Lock down maximum scrolling - // The value of ScrollMax are ahead from ScrollbarX/ScrollbarY which is intentionally using InnerRect from previous rect in order to accommodate - // for right/bottom aligned items without creating a scrollbar. - window->ScrollMax.x = ImMax(0.0f, window->ContentSize.x + window->WindowPadding.x * 2.0f - window->InnerRect.GetWidth()); - window->ScrollMax.y = ImMax(0.0f, window->ContentSize.y + window->WindowPadding.y * 2.0f - window->InnerRect.GetHeight()); - - // Apply scrolling - window->Scroll = CalcNextScrollFromScrollTargetAndClamp(window, true); - window->ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); - - // DRAWING - - // Setup draw list and outer clipping rectangle - window->DrawList->Clear(); - window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID); - PushClipRect(host_rect.Min, host_rect.Max, false); - - // Draw modal window background (darkens what is behind them, all viewports) - const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0; - const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && (window == g.NavWindowingTargetAnim->RootWindow); - if (dim_bg_for_modal || dim_bg_for_window_list) - { - const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio); - window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, dim_bg_col); - } - - // Draw navigation selection/windowing rectangle background - if (dim_bg_for_window_list && window == g.NavWindowingTargetAnim) - { - ImRect bb = window->Rect(); - bb.Expand(g.FontSize); - if (!bb.Contains(viewport_rect)) // Avoid drawing if the window covers all the viewport anyway - window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding); - } - - // Since 1.71, child window can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call. - // When using overlapping child windows, this will break the assumption that child z-order is mapped to submission order. - // We disable this when the parent window has zero vertices, which is a common pattern leading to laying out multiple overlapping child. - // We also disabled this when we have dimming overlay behind this specific one child. - // FIXME: More code may rely on explicit sorting of overlapping child window and would need to disable this somehow. Please get in contact if you are affected. - { - bool render_decorations_in_parent = false; - if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip) - if (window->DrawList->CmdBuffer.back().ElemCount == 0 && parent_window->DrawList->VtxBuffer.Size > 0) - render_decorations_in_parent = true; - if (render_decorations_in_parent) - window->DrawList = parent_window->DrawList; - - // Handle title bar, scrollbar, resize grips and resize borders - const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow; - const bool title_bar_is_highlight = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight); - RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, resize_grip_count, resize_grip_col, resize_grip_draw_size); - - if (render_decorations_in_parent) - window->DrawList = &window->DrawListInst; - } - - // Draw navigation selection/windowing rectangle border - if (g.NavWindowingTargetAnim == window) - { - float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding); - ImRect bb = window->Rect(); - bb.Expand(g.FontSize); - if (bb.Contains(viewport_rect)) // If a window fits the entire viewport, adjust its highlight inward - { - bb.Expand(-g.FontSize - 1.0f); - rounding = window->WindowRounding; - } - window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), rounding, ~0, 3.0f); - } - - // UPDATE RECTANGLES (2- THOSE AFFECTED BY SCROLLING) - - // Work rectangle. - // Affected by window padding and border size. Used by: - // - Columns() for right-most edge - // - TreeNode(), CollapsingHeader() for right-most edge - // - BeginTabBar() for right-most edge - const bool allow_scrollbar_x = !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar); - const bool allow_scrollbar_y = !(flags & ImGuiWindowFlags_NoScrollbar); - const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x)); - const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y)); - window->WorkRect.Min.x = ImFloor(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize)); - window->WorkRect.Min.y = ImFloor(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize)); - window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x; - window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y; - - // [LEGACY] Content Region - // FIXME-OBSOLETE: window->ContentRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it. - // Used by: - // - Mouse wheel scrolling + many other things - window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x; - window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height; - window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x)); - window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y)); - - // Setup drawing context - // (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.) - window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x; - window->DC.GroupOffset.x = 0.0f; - window->DC.ColumnsOffset.x = 0.0f; - window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.Indent.x + window->DC.ColumnsOffset.x, decoration_up_height + window->WindowPadding.y - window->Scroll.y); - window->DC.CursorPos = window->DC.CursorStartPos; - window->DC.CursorPosPrevLine = window->DC.CursorPos; - window->DC.CursorMaxPos = window->DC.CursorStartPos; - window->DC.CurrLineSize = window->DC.PrevLineSize = ImVec2(0.0f, 0.0f); - window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f; - - window->DC.NavLayerCurrent = ImGuiNavLayer_Main; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); - window->DC.NavLayerActiveMask = window->DC.NavLayerActiveMaskNext; - window->DC.NavLayerActiveMaskNext = 0x00; - window->DC.NavFocusScopeIdCurrent = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window->DC.NavFocusScopeIdCurrent : 0; // -V595 - window->DC.NavHideHighlightOneFrame = false; - window->DC.NavHasScroll = (window->ScrollMax.y > 0.0f); - - window->DC.MenuBarAppending = false; - window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x); - window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y; - window->DC.MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user); - window->DC.TreeDepth = 0; - window->DC.TreeJumpToParentOnPopMask = 0x00; - window->DC.ChildWindows.resize(0); - window->DC.StateStorage = &window->StateStorage; - window->DC.CurrentColumns = NULL; - window->DC.LayoutType = ImGuiLayoutType_Vertical; - window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical; - window->DC.FocusCounterRegular = window->DC.FocusCounterTabStop = -1; - - window->DC.ItemWidth = window->ItemWidthDefault; - window->DC.TextWrapPos = -1.0f; // disabled - window->DC.ItemFlagsStack.resize(0); - window->DC.ItemWidthStack.resize(0); - window->DC.TextWrapPosStack.resize(0); - window->DC.GroupStack.resize(0); - window->DC.ItemFlags = parent_window ? parent_window->DC.ItemFlags : ImGuiItemFlags_Default_; - if (parent_window) - window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); - - if (window->AutoFitFramesX > 0) - window->AutoFitFramesX--; - if (window->AutoFitFramesY > 0) - window->AutoFitFramesY--; - - // Apply focus (we need to call FocusWindow() AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there) - if (want_focus) - { - FocusWindow(window); - NavInitWindow(window, false); - } - - // Title bar - if (!(flags & ImGuiWindowFlags_NoTitleBar)) - RenderWindowTitleBarContents(window, title_bar_rect, name, p_open); - - // Pressing CTRL+C while holding on a window copy its content to the clipboard - // This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope. - // Maybe we can support CTRL+C on every element? - /* - if (g.ActiveId == move_id) - if (g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_C)) - LogToClipboard(); - */ - - // We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin(). - // This is useful to allow creating context menus on title bar only, etc. - window->DC.LastItemId = window->MoveId; - window->DC.LastItemStatusFlags = IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0; - window->DC.LastItemRect = title_bar_rect; -#ifdef IMGUI_ENABLE_TEST_ENGINE - if (!(window->Flags & ImGuiWindowFlags_NoTitleBar)) - IMGUI_TEST_ENGINE_ITEM_ADD(window->DC.LastItemRect, window->DC.LastItemId); -#endif - } - else - { - // Append - SetCurrentWindow(window); - } - - PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); - - // Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused) - if (first_begin_of_the_frame) - window->WriteAccessed = false; - - window->BeginCount++; - g.NextWindowData.ClearFlags(); - - if (flags & ImGuiWindowFlags_ChildWindow) - { - // Child window can be out of sight and have "negative" clip windows. - // Mark them as collapsed so commands are skipped earlier (we can't manually collapse them because they have no title bar). - IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0); - if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) - if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y) - window->HiddenFramesCanSkipItems = 1; - - // Hide along with parent or if parent is collapsed - if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCanSkipItems > 0)) - window->HiddenFramesCanSkipItems = 1; - if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCannotSkipItems > 0)) - window->HiddenFramesCannotSkipItems = 1; - } - - // Don't render if style alpha is 0.0 at the time of Begin(). This is arbitrary and inconsistent but has been there for a long while (may remove at some point) - if (style.Alpha <= 0.0f) - window->HiddenFramesCanSkipItems = 1; - - // Update the Hidden flag - window->Hidden = (window->HiddenFramesCanSkipItems > 0) || (window->HiddenFramesCannotSkipItems > 0); - - // Update the SkipItems flag, used to early out of all items functions (no layout required) - bool skip_items = false; - if (window->Collapsed || !window->Active || window->Hidden) - if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && window->HiddenFramesCannotSkipItems <= 0) - skip_items = true; - window->SkipItems = skip_items; - - return !skip_items; -} - -void ImGui::End() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - // Error checking: verify that user hasn't called End() too many times! - if (g.CurrentWindowStack.Size <= 1 && g.WithinFrameScopeWithImplicitWindow) - { - IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size > 1, "Calling End() too many times!"); - return; - } - IM_ASSERT(g.CurrentWindowStack.Size > 0); - - // Error checking: verify that user doesn't directly call End() on a child window. - if (window->Flags & ImGuiWindowFlags_ChildWindow) - IM_ASSERT_USER_ERROR(g.WithinEndChild, "Must call EndChild() and not End()!"); - - // Close anything that is open - if (window->DC.CurrentColumns) - EndColumns(); - PopClipRect(); // Inner window clip rectangle - - // Stop logging - if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging - LogFinish(); - - // Pop from window stack - g.CurrentWindowStack.pop_back(); - if (window->Flags & ImGuiWindowFlags_Popup) - g.BeginPopupStack.pop_back(); - ErrorCheckBeginEndCompareStacksSize(window, false); - SetCurrentWindow(g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back()); -} - -void ImGui::BringWindowToFocusFront(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - if (g.WindowsFocusOrder.back() == window) - return; - for (int i = g.WindowsFocusOrder.Size - 2; i >= 0; i--) // We can ignore the top-most window - if (g.WindowsFocusOrder[i] == window) - { - memmove(&g.WindowsFocusOrder[i], &g.WindowsFocusOrder[i + 1], (size_t)(g.WindowsFocusOrder.Size - i - 1) * sizeof(ImGuiWindow*)); - g.WindowsFocusOrder[g.WindowsFocusOrder.Size - 1] = window; - break; - } -} - -void ImGui::BringWindowToDisplayFront(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* current_front_window = g.Windows.back(); - if (current_front_window == window || current_front_window->RootWindow == window) - return; - for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the top-most window - if (g.Windows[i] == window) - { - memmove(&g.Windows[i], &g.Windows[i + 1], (size_t)(g.Windows.Size - i - 1) * sizeof(ImGuiWindow*)); - g.Windows[g.Windows.Size - 1] = window; - break; - } -} - -void ImGui::BringWindowToDisplayBack(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - if (g.Windows[0] == window) - return; - for (int i = 0; i < g.Windows.Size; i++) - if (g.Windows[i] == window) - { - memmove(&g.Windows[1], &g.Windows[0], (size_t)i * sizeof(ImGuiWindow*)); - g.Windows[0] = window; - break; - } -} - -// Moving window to front of display and set focus (which happens to be back of our sorted list) -void ImGui::FocusWindow(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - - if (g.NavWindow != window) - { - g.NavWindow = window; - if (window && g.NavDisableMouseHover) - g.NavMousePosDirty = true; - g.NavInitRequest = false; - g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId - g.NavFocusScopeId = 0; - g.NavIdIsAlive = false; - g.NavLayer = ImGuiNavLayer_Main; - //IMGUI_DEBUG_LOG("FocusWindow(\"%s\")\n", window ? window->Name : NULL); - } - - // Close popups if any - ClosePopupsOverWindow(window, false); - - // Passing NULL allow to disable keyboard focus - if (!window) - return; - - // Move the root window to the top of the pile - IM_ASSERT(window->RootWindow != NULL); - ImGuiWindow* focus_front_window = window->RootWindow; // NB: In docking branch this is window->RootWindowDockStop - ImGuiWindow* display_front_window = window->RootWindow; - - // Steal focus on active widgets - if (focus_front_window->Flags & ImGuiWindowFlags_Popup) // FIXME: This statement may be unnecessary? Need further testing before removing it.. - if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != focus_front_window) - ClearActiveID(); - - // Bring to front - BringWindowToFocusFront(focus_front_window); - if (((window->Flags | display_front_window->Flags) & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0) - BringWindowToDisplayFront(display_front_window); -} - -void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window) -{ - ImGuiContext& g = *GImGui; - - int start_idx = g.WindowsFocusOrder.Size - 1; - if (under_this_window != NULL) - { - int under_this_window_idx = FindWindowFocusIndex(under_this_window); - if (under_this_window_idx != -1) - start_idx = under_this_window_idx - 1; - } - for (int i = start_idx; i >= 0; i--) - { - // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user. - ImGuiWindow* window = g.WindowsFocusOrder[i]; - if (window != ignore_window && window->WasActive && !(window->Flags & ImGuiWindowFlags_ChildWindow)) - if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) - { - ImGuiWindow* focus_window = NavRestoreLastChildNavWindow(window); - FocusWindow(focus_window); - return; - } - } - FocusWindow(NULL); -} - -void ImGui::SetCurrentFont(ImFont* font) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ? - IM_ASSERT(font->Scale > 0.0f); - g.Font = font; - g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale); - g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f; - - ImFontAtlas* atlas = g.Font->ContainerAtlas; - g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel; - g.DrawListSharedData.Font = g.Font; - g.DrawListSharedData.FontSize = g.FontSize; -} - -void ImGui::PushFont(ImFont* font) -{ - ImGuiContext& g = *GImGui; - if (!font) - font = GetDefaultFont(); - SetCurrentFont(font); - g.FontStack.push_back(font); - g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID); -} - -void ImGui::PopFont() -{ - ImGuiContext& g = *GImGui; - g.CurrentWindow->DrawList->PopTextureID(); - g.FontStack.pop_back(); - SetCurrentFont(g.FontStack.empty() ? GetDefaultFont() : g.FontStack.back()); -} - -void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (enabled) - window->DC.ItemFlags |= option; - else - window->DC.ItemFlags &= ~option; - window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); -} - -void ImGui::PopItemFlag() -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.ItemFlagsStack.pop_back(); - window->DC.ItemFlags = window->DC.ItemFlagsStack.empty() ? ImGuiItemFlags_Default_ : window->DC.ItemFlagsStack.back(); -} - -// FIXME: Look into renaming this once we have settled the new Focus/Activation/TabStop system. -void ImGui::PushAllowKeyboardFocus(bool allow_keyboard_focus) -{ - PushItemFlag(ImGuiItemFlags_NoTabStop, !allow_keyboard_focus); -} - -void ImGui::PopAllowKeyboardFocus() -{ - PopItemFlag(); -} - -void ImGui::PushButtonRepeat(bool repeat) -{ - PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); -} - -void ImGui::PopButtonRepeat() -{ - PopItemFlag(); -} - -void ImGui::PushTextWrapPos(float wrap_pos_x) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.TextWrapPos = wrap_pos_x; - window->DC.TextWrapPosStack.push_back(wrap_pos_x); -} - -void ImGui::PopTextWrapPos() -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.TextWrapPosStack.pop_back(); - window->DC.TextWrapPos = window->DC.TextWrapPosStack.empty() ? -1.0f : window->DC.TextWrapPosStack.back(); -} - -bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent) -{ - if (window->RootWindow == potential_parent) - return true; - while (window != NULL) - { - if (window == potential_parent) - return true; - window = window->ParentWindow; - } - return false; -} - -bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) -{ - IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function - ImGuiContext& g = *GImGui; - - if (flags & ImGuiHoveredFlags_AnyWindow) - { - if (g.HoveredWindow == NULL) - return false; - } - else - { - switch (flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) - { - case ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows: - if (g.HoveredRootWindow != g.CurrentWindow->RootWindow) - return false; - break; - case ImGuiHoveredFlags_RootWindow: - if (g.HoveredWindow != g.CurrentWindow->RootWindow) - return false; - break; - case ImGuiHoveredFlags_ChildWindows: - if (g.HoveredWindow == NULL || !IsWindowChildOf(g.HoveredWindow, g.CurrentWindow)) - return false; - break; - default: - if (g.HoveredWindow != g.CurrentWindow) - return false; - break; - } - } - - if (!IsWindowContentHoverable(g.HoveredWindow, flags)) - return false; - if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) - if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != g.HoveredWindow->MoveId) - return false; - return true; -} - -bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) -{ - ImGuiContext& g = *GImGui; - - if (flags & ImGuiFocusedFlags_AnyWindow) - return g.NavWindow != NULL; - - IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End() - switch (flags & (ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows)) - { - case ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows: - return g.NavWindow && g.NavWindow->RootWindow == g.CurrentWindow->RootWindow; - case ImGuiFocusedFlags_RootWindow: - return g.NavWindow == g.CurrentWindow->RootWindow; - case ImGuiFocusedFlags_ChildWindows: - return g.NavWindow && IsWindowChildOf(g.NavWindow, g.CurrentWindow); - default: - return g.NavWindow == g.CurrentWindow; - } -} - -// Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext) -// Note that NoNavFocus makes the window not reachable with CTRL+TAB but it can still be focused with mouse or programmaticaly. -// If you want a window to never be focused, you may use the e.g. NoInputs flag. -bool ImGui::IsWindowNavFocusable(ImGuiWindow* window) -{ - return window->Active && window == window->RootWindow && !(window->Flags & ImGuiWindowFlags_NoNavFocus); -} - -float ImGui::GetWindowWidth() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->Size.x; -} - -float ImGui::GetWindowHeight() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->Size.y; -} - -ImVec2 ImGui::GetWindowPos() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - return window->Pos; -} - -void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond) -{ - // Test condition (NB: bit 0 is always true) and clear flags for next time - if (cond && (window->SetWindowPosAllowFlags & cond) == 0) - return; - - IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. - window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); - window->SetWindowPosVal = ImVec2(FLT_MAX, FLT_MAX); - - // Set - const ImVec2 old_pos = window->Pos; - window->Pos = ImFloor(pos); - ImVec2 offset = window->Pos - old_pos; - window->DC.CursorPos += offset; // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor - window->DC.CursorMaxPos += offset; // And more importantly we need to offset CursorMaxPos/CursorStartPos this so ContentSize calculation doesn't get affected. - window->DC.CursorStartPos += offset; -} - -void ImGui::SetWindowPos(const ImVec2& pos, ImGuiCond cond) -{ - ImGuiWindow* window = GetCurrentWindowRead(); - SetWindowPos(window, pos, cond); -} - -void ImGui::SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond) -{ - if (ImGuiWindow* window = FindWindowByName(name)) - SetWindowPos(window, pos, cond); -} - -ImVec2 ImGui::GetWindowSize() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->Size; -} - -void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond) -{ - // Test condition (NB: bit 0 is always true) and clear flags for next time - if (cond && (window->SetWindowSizeAllowFlags & cond) == 0) - return; - - IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. - window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); - - // Set - if (size.x > 0.0f) - { - window->AutoFitFramesX = 0; - window->SizeFull.x = IM_FLOOR(size.x); - } - else - { - window->AutoFitFramesX = 2; - window->AutoFitOnlyGrows = false; - } - if (size.y > 0.0f) - { - window->AutoFitFramesY = 0; - window->SizeFull.y = IM_FLOOR(size.y); - } - else - { - window->AutoFitFramesY = 2; - window->AutoFitOnlyGrows = false; - } -} - -void ImGui::SetWindowSize(const ImVec2& size, ImGuiCond cond) -{ - SetWindowSize(GImGui->CurrentWindow, size, cond); -} - -void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond) -{ - if (ImGuiWindow* window = FindWindowByName(name)) - SetWindowSize(window, size, cond); -} - -void ImGui::SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond) -{ - // Test condition (NB: bit 0 is always true) and clear flags for next time - if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0) - return; - window->SetWindowCollapsedAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); - - // Set - window->Collapsed = collapsed; -} - -void ImGui::SetWindowCollapsed(bool collapsed, ImGuiCond cond) -{ - SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond); -} - -bool ImGui::IsWindowCollapsed() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->Collapsed; -} - -bool ImGui::IsWindowAppearing() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->Appearing; -} - -void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond) -{ - if (ImGuiWindow* window = FindWindowByName(name)) - SetWindowCollapsed(window, collapsed, cond); -} - -void ImGui::SetWindowFocus() -{ - FocusWindow(GImGui->CurrentWindow); -} - -void ImGui::SetWindowFocus(const char* name) -{ - if (name) - { - if (ImGuiWindow* window = FindWindowByName(name)) - FocusWindow(window); - } - else - { - FocusWindow(NULL); - } -} - -void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiCond cond, const ImVec2& pivot) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasPos; - g.NextWindowData.PosVal = pos; - g.NextWindowData.PosPivotVal = pivot; - g.NextWindowData.PosCond = cond ? cond : ImGuiCond_Always; -} - -void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSize; - g.NextWindowData.SizeVal = size; - g.NextWindowData.SizeCond = cond ? cond : ImGuiCond_Always; -} - -void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback, void* custom_callback_user_data) -{ - ImGuiContext& g = *GImGui; - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSizeConstraint; - g.NextWindowData.SizeConstraintRect = ImRect(size_min, size_max); - g.NextWindowData.SizeCallback = custom_callback; - g.NextWindowData.SizeCallbackUserData = custom_callback_user_data; -} - -// Content size = inner scrollable rectangle, padded with WindowPadding. -// SetNextWindowContentSize(ImVec2(100,100) + ImGuiWindowFlags_AlwaysAutoResize will always allow submitting a 100x100 item. -void ImGui::SetNextWindowContentSize(const ImVec2& size) -{ - ImGuiContext& g = *GImGui; - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasContentSize; - g.NextWindowData.ContentSizeVal = size; -} - -void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiCond cond) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasCollapsed; - g.NextWindowData.CollapsedVal = collapsed; - g.NextWindowData.CollapsedCond = cond ? cond : ImGuiCond_Always; -} - -void ImGui::SetNextWindowFocus() -{ - ImGuiContext& g = *GImGui; - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasFocus; -} - -void ImGui::SetNextWindowBgAlpha(float alpha) -{ - ImGuiContext& g = *GImGui; - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasBgAlpha; - g.NextWindowData.BgAlphaVal = alpha; -} - -ImDrawList* ImGui::GetWindowDrawList() -{ - ImGuiWindow* window = GetCurrentWindow(); - return window->DrawList; -} - -ImFont* ImGui::GetFont() -{ - return GImGui->Font; -} - -float ImGui::GetFontSize() -{ - return GImGui->FontSize; -} - -ImVec2 ImGui::GetFontTexUvWhitePixel() -{ - return GImGui->DrawListSharedData.TexUvWhitePixel; -} - -void ImGui::SetWindowFontScale(float scale) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - window->FontWindowScale = scale; - g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); -} - -void ImGui::ActivateItem(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - g.NavNextActivateId = id; -} - -void ImGui::PushFocusScope(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - window->IDStack.push_back(window->DC.NavFocusScopeIdCurrent); - window->DC.NavFocusScopeIdCurrent = id; -} - -void ImGui::PopFocusScope() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - window->DC.NavFocusScopeIdCurrent = window->IDStack.back(); - window->IDStack.pop_back(); -} - -void ImGui::SetKeyboardFocusHere(int offset) -{ - IM_ASSERT(offset >= -1); // -1 is allowed but not below - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - g.FocusRequestNextWindow = window; - g.FocusRequestNextCounterRegular = window->DC.FocusCounterRegular + 1 + offset; - g.FocusRequestNextCounterTabStop = INT_MAX; -} - -void ImGui::SetItemDefaultFocus() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (!window->Appearing) - return; - if (g.NavWindow == window->RootWindowForNav && (g.NavInitRequest || g.NavInitResultId != 0) && g.NavLayer == g.NavWindow->DC.NavLayerCurrent) - { - g.NavInitRequest = false; - g.NavInitResultId = g.NavWindow->DC.LastItemId; - g.NavInitResultRectRel = ImRect(g.NavWindow->DC.LastItemRect.Min - g.NavWindow->Pos, g.NavWindow->DC.LastItemRect.Max - g.NavWindow->Pos); - NavUpdateAnyRequestFlag(); - if (!IsItemVisible()) - SetScrollHereY(); - } -} - -void ImGui::SetStateStorage(ImGuiStorage* tree) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->DC.StateStorage = tree ? tree : &window->StateStorage; -} - -ImGuiStorage* ImGui::GetStateStorage() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->DC.StateStorage; -} - -void ImGui::PushID(const char* str_id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.push_back(window->GetIDNoKeepAlive(str_id)); -} - -void ImGui::PushID(const char* str_id_begin, const char* str_id_end) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.push_back(window->GetIDNoKeepAlive(str_id_begin, str_id_end)); -} - -void ImGui::PushID(const void* ptr_id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.push_back(window->GetIDNoKeepAlive(ptr_id)); -} - -void ImGui::PushID(int int_id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.push_back(window->GetIDNoKeepAlive(int_id)); -} - -// Push a given id value ignoring the ID stack as a seed. -void ImGui::PushOverrideID(ImGuiID id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.push_back(id); -} - -void ImGui::PopID() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - window->IDStack.pop_back(); -} - -ImGuiID ImGui::GetID(const char* str_id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->GetID(str_id); -} - -ImGuiID ImGui::GetID(const char* str_id_begin, const char* str_id_end) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->GetID(str_id_begin, str_id_end); -} - -ImGuiID ImGui::GetID(const void* ptr_id) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->GetID(ptr_id); -} - -bool ImGui::IsRectVisible(const ImVec2& size) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); -} - -bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); -} - - -//----------------------------------------------------------------------------- -// [SECTION] ERROR CHECKING -//----------------------------------------------------------------------------- - -// Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui. -// Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit -// If the user has inconsistent compilation settings, imgui configuration #define, packing pragma, etc. your user code -// may see different structures than what imgui.cpp sees, which is problematic. -// We usually require settings to be in imconfig.h to make sure that they are accessible to all compilation units involved with Dear ImGui. -bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx) -{ - bool error = false; - if (strcmp(version, IMGUI_VERSION) != 0) { error = true; IM_ASSERT(strcmp(version, IMGUI_VERSION) == 0 && "Mismatched version string!"); } - if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); } - if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); } - if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); } - if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); } - if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); } - if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); } - return !error; -} - -static void ImGui::ErrorCheckNewFrameSanityChecks() -{ - ImGuiContext& g = *GImGui; - - // Check user IM_ASSERT macro - // (IF YOU GET A WARNING OR COMPILE ERROR HERE: it means you assert macro is incorrectly defined! - // If your macro uses multiple statements, it NEEDS to be surrounded by a 'do { ... } while (0)' block. - // This is a common C/C++ idiom to allow multiple statements macros to be used in control flow blocks.) - // #define IM_ASSERT(EXPR) SomeCode(EXPR); SomeMoreCode(); // Wrong! - // #define IM_ASSERT(EXPR) do { SomeCode(EXPR); SomeMoreCode(); } while (0) // Correct! - if (true) IM_ASSERT(1); else IM_ASSERT(0); - - // Check user data - // (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument) - IM_ASSERT(g.Initialized); - IM_ASSERT((g.IO.DeltaTime > 0.0f || g.FrameCount == 0) && "Need a positive DeltaTime!"); - IM_ASSERT((g.FrameCount == 0 || g.FrameCountEnded == g.FrameCount) && "Forgot to call Render() or EndFrame() at the end of the previous frame?"); - IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f && "Invalid DisplaySize value!"); - IM_ASSERT(g.IO.Fonts->Fonts.Size > 0 && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?"); - IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?"); - IM_ASSERT(g.Style.CurveTessellationTol > 0.0f && "Invalid style setting!"); - IM_ASSERT(g.Style.CircleSegmentMaxError > 0.0f && "Invalid style setting!"); - IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f && "Invalid style setting. Alpha cannot be negative (allows us to avoid a few clamps in color computations)!"); - IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting."); - IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right); - for (int n = 0; n < ImGuiKey_COUNT; n++) - IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)"); - - // Perform simple check: required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only recently added in 1.60 WIP) - if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) - IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation."); - - // Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires back-end to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly. - if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors)) - g.IO.ConfigWindowsResizeFromEdges = false; -} - -static void ImGui::ErrorCheckEndFrameSanityChecks() -{ - ImGuiContext& g = *GImGui; - - // Verify that io.KeyXXX fields haven't been tampered with. Key mods shoudl not be modified between NewFrame() and EndFrame() - const ImGuiKeyModFlags expected_key_mod_flags = GetMergedKeyModFlags(); - IM_ASSERT(g.IO.KeyMods == expected_key_mod_flags && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); - IM_UNUSED(expected_key_mod_flags); - - // Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you - // to always call End/EndChild even if Begin/BeginChild returns false! (this is unfortunately inconsistent with most other Begin* API). - if (g.CurrentWindowStack.Size != 1) - { - if (g.CurrentWindowStack.Size > 1) - { - IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"); - while (g.CurrentWindowStack.Size > 1) - End(); - } - else - { - IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?"); - } - } -} - -// Save and compare stack sizes on Begin()/End() to detect usage errors -// Begin() calls this with write=true -// End() calls this with write=false -static void ImGui::ErrorCheckBeginEndCompareStacksSize(ImGuiWindow* window, bool write) -{ - ImGuiContext& g = *GImGui; - short* p = &window->DC.StackSizesBackup[0]; - - // Window stacks - // NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin) - { int n = window->IDStack.Size; if (write) *p = (short)n; else IM_ASSERT(*p == n && "PushID/PopID or TreeNode/TreePop Mismatch!"); p++; } // Too few or too many PopID()/TreePop() - { int n = window->DC.GroupStack.Size; if (write) *p = (short)n; else IM_ASSERT(*p == n && "BeginGroup/EndGroup Mismatch!"); p++; } // Too few or too many EndGroup() - - // Global stacks - // For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them. - { int n = g.BeginPopupStack.Size; if (write) *p = (short)n; else IM_ASSERT(*p == n && "BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch!"); p++; }// Too few or too many EndMenu()/EndPopup() - { int n = g.ColorModifiers.Size; if (write) *p = (short)n; else IM_ASSERT(*p >= n && "PushStyleColor/PopStyleColor Mismatch!"); p++; } // Too few or too many PopStyleColor() - { int n = g.StyleModifiers.Size; if (write) *p = (short)n; else IM_ASSERT(*p >= n && "PushStyleVar/PopStyleVar Mismatch!"); p++; } // Too few or too many PopStyleVar() - { int n = g.FontStack.Size; if (write) *p = (short)n; else IM_ASSERT(*p >= n && "PushFont/PopFont Mismatch!"); p++; } // Too few or too many PopFont() - IM_ASSERT(p == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup)); -} - - -//----------------------------------------------------------------------------- -// [SECTION] LAYOUT -//----------------------------------------------------------------------------- -// - ItemSize() -// - ItemAdd() -// - SameLine() -// - GetCursorScreenPos() -// - SetCursorScreenPos() -// - GetCursorPos(), GetCursorPosX(), GetCursorPosY() -// - SetCursorPos(), SetCursorPosX(), SetCursorPosY() -// - GetCursorStartPos() -// - Indent() -// - Unindent() -// - SetNextItemWidth() -// - PushItemWidth() -// - PushMultiItemsWidths() -// - PopItemWidth() -// - CalcItemWidth() -// - CalcItemSize() -// - GetTextLineHeight() -// - GetTextLineHeightWithSpacing() -// - GetFrameHeight() -// - GetFrameHeightWithSpacing() -// - GetContentRegionMax() -// - GetContentRegionMaxAbs() [Internal] -// - GetContentRegionAvail(), -// - GetWindowContentRegionMin(), GetWindowContentRegionMax() -// - GetWindowContentRegionWidth() -// - BeginGroup() -// - EndGroup() -// Also see in imgui_widgets: tab bars, columns. -//----------------------------------------------------------------------------- - -// Advance cursor given item size for layout. -// Register minimum needed size so it can extend the bounding box used for auto-fit calculation. -// See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different. -void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return; - - // We increase the height in this function to accommodate for baseline offset. - // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor, - // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect. - const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f; - const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y); - - // Always align ourselves on pixel boundaries - //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] - window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; - window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y; - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line - window->DC.CursorPos.y = IM_FLOOR(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y); // Next line - window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); - //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] - - window->DC.PrevLineSize.y = line_height; - window->DC.CurrLineSize.y = 0.0f; - window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y); - window->DC.CurrLineTextBaseOffset = 0.0f; - - // Horizontal layout mode - if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) - SameLine(); -} - -void ImGui::ItemSize(const ImRect& bb, float text_baseline_y) -{ - ItemSize(bb.GetSize(), text_baseline_y); -} - -// Declare item bounding box for clipping and interaction. -// Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface -// declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction. -bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - if (id != 0) - { - // Navigation processing runs prior to clipping early-out - // (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget - // (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests - // unfortunately, but it is still limited to one window. It may not scale very well for windows with ten of - // thousands of item, but at least NavMoveRequest is only set on user interaction, aka maximum once a frame. - // We could early out with "if (is_clipped && !g.NavInitRequest) return false;" but when we wouldn't be able - // to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick). - // We intentionally don't check if g.NavWindow != NULL because g.NavAnyRequest should only be set when it is non null. - // If we crash on a NULL g.NavWindow we need to fix the bug elsewhere. - window->DC.NavLayerActiveMaskNext |= window->DC.NavLayerCurrentMask; - if (g.NavId == id || g.NavAnyRequest) - if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) - if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened)) - NavProcessItem(window, nav_bb_arg ? *nav_bb_arg : bb, id); - - // [DEBUG] Item Picker tool, when enabling the "extended" version we perform the check in ItemAdd() -#ifdef IMGUI_DEBUG_TOOL_ITEM_PICKER_EX - if (id == g.DebugItemPickerBreakId) - { - IM_DEBUG_BREAK(); - g.DebugItemPickerBreakId = 0; - } -#endif - } - - window->DC.LastItemId = id; - window->DC.LastItemRect = bb; - window->DC.LastItemStatusFlags = ImGuiItemStatusFlags_None; - g.NextItemData.Flags = ImGuiNextItemDataFlags_None; - -#ifdef IMGUI_ENABLE_TEST_ENGINE - if (id != 0) - IMGUI_TEST_ENGINE_ITEM_ADD(nav_bb_arg ? *nav_bb_arg : bb, id); -#endif - - // Clipping test - const bool is_clipped = IsClippedEx(bb, id, false); - if (is_clipped) - return false; - //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] - - // We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them) - if (IsMouseHoveringRect(bb.Min, bb.Max)) - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HoveredRect; - return true; -} - -// Gets back to previous line and continue with horizontal layout -// offset_from_start_x == 0 : follow right after previous item -// offset_from_start_x != 0 : align to specified x position (relative to window/group left) -// spacing_w < 0 : use default spacing if pos_x == 0, no spacing if pos_x != 0 -// spacing_w >= 0 : enforce spacing amount -void ImGui::SameLine(float offset_from_start_x, float spacing_w) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - if (offset_from_start_x != 0.0f) - { - if (spacing_w < 0.0f) spacing_w = 0.0f; - window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + offset_from_start_x + spacing_w + window->DC.GroupOffset.x + window->DC.ColumnsOffset.x; - window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; - } - else - { - if (spacing_w < 0.0f) spacing_w = g.Style.ItemSpacing.x; - window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w; - window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; - } - window->DC.CurrLineSize = window->DC.PrevLineSize; - window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset; -} - -ImVec2 ImGui::GetCursorScreenPos() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CursorPos; -} - -void ImGui::SetCursorScreenPos(const ImVec2& pos) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.CursorPos = pos; - window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); -} - -// User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient. -// Conversion happens as we pass the value to user, but it makes our naming convention confusing because GetCursorPos() == (DC.CursorPos - window.Pos). May want to rename 'DC.CursorPos'. -ImVec2 ImGui::GetCursorPos() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CursorPos - window->Pos + window->Scroll; -} - -float ImGui::GetCursorPosX() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CursorPos.x - window->Pos.x + window->Scroll.x; -} - -float ImGui::GetCursorPosY() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CursorPos.y - window->Pos.y + window->Scroll.y; -} - -void ImGui::SetCursorPos(const ImVec2& local_pos) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.CursorPos = window->Pos - window->Scroll + local_pos; - window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); -} - -void ImGui::SetCursorPosX(float x) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x; - window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x); -} - -void ImGui::SetCursorPosY(float y) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y; - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y); -} - -ImVec2 ImGui::GetCursorStartPos() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CursorStartPos - window->Pos; -} - -void ImGui::Indent(float indent_w) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - window->DC.Indent.x += (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; - window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x; -} - -void ImGui::Unindent(float indent_w) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - window->DC.Indent.x -= (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; - window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x; -} - -// Affect large frame+labels widgets only. -void ImGui::SetNextItemWidth(float item_width) -{ - ImGuiContext& g = *GImGui; - g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasWidth; - g.NextItemData.Width = item_width; -} - -void ImGui::PushItemWidth(float item_width) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width); - window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); - g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth; -} - -void ImGui::PushMultiItemsWidths(int components, float w_full) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - const ImGuiStyle& style = g.Style; - const float w_item_one = ImMax(1.0f, IM_FLOOR((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components)); - const float w_item_last = ImMax(1.0f, IM_FLOOR(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1))); - window->DC.ItemWidthStack.push_back(w_item_last); - for (int i = 0; i < components-1; i++) - window->DC.ItemWidthStack.push_back(w_item_one); - window->DC.ItemWidth = window->DC.ItemWidthStack.back(); - g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth; -} - -void ImGui::PopItemWidth() -{ - ImGuiWindow* window = GetCurrentWindow(); - window->DC.ItemWidthStack.pop_back(); - window->DC.ItemWidth = window->DC.ItemWidthStack.empty() ? window->ItemWidthDefault : window->DC.ItemWidthStack.back(); -} - -// Calculate default item width given value passed to PushItemWidth() or SetNextItemWidth(). -// The SetNextItemWidth() data is generally cleared/consumed by ItemAdd() or NextItemData.ClearFlags() -float ImGui::CalcItemWidth() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - float w; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth) - w = g.NextItemData.Width; - else - w = window->DC.ItemWidth; - if (w < 0.0f) - { - float region_max_x = GetContentRegionMaxAbs().x; - w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w); - } - w = IM_FLOOR(w); - return w; -} - -// [Internal] Calculate full item size given user provided 'size' parameter and default width/height. Default width is often == CalcItemWidth(). -// Those two functions CalcItemWidth vs CalcItemSize are awkwardly named because they are not fully symmetrical. -// Note that only CalcItemWidth() is publicly exposed. -// The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable) -ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - - ImVec2 region_max; - if (size.x < 0.0f || size.y < 0.0f) - region_max = GetContentRegionMaxAbs(); - - if (size.x == 0.0f) - size.x = default_w; - else if (size.x < 0.0f) - size.x = ImMax(4.0f, region_max.x - window->DC.CursorPos.x + size.x); - - if (size.y == 0.0f) - size.y = default_h; - else if (size.y < 0.0f) - size.y = ImMax(4.0f, region_max.y - window->DC.CursorPos.y + size.y); - - return size; -} - -float ImGui::GetTextLineHeight() -{ - ImGuiContext& g = *GImGui; - return g.FontSize; -} - -float ImGui::GetTextLineHeightWithSpacing() -{ - ImGuiContext& g = *GImGui; - return g.FontSize + g.Style.ItemSpacing.y; -} - -float ImGui::GetFrameHeight() -{ - ImGuiContext& g = *GImGui; - return g.FontSize + g.Style.FramePadding.y * 2.0f; -} - -float ImGui::GetFrameHeightWithSpacing() -{ - ImGuiContext& g = *GImGui; - return g.FontSize + g.Style.FramePadding.y * 2.0f + g.Style.ItemSpacing.y; -} - -// FIXME: All the Contents Region function are messy or misleading. WE WILL AIM TO OBSOLETE ALL OF THEM WITH A NEW "WORK RECT" API. Thanks for your patience! - -// FIXME: This is in window space (not screen space!). -ImVec2 ImGui::GetContentRegionMax() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImVec2 mx = window->ContentRegionRect.Max - window->Pos; - if (window->DC.CurrentColumns) - mx.x = window->WorkRect.Max.x - window->Pos.x; - return mx; -} - -// [Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features. -ImVec2 ImGui::GetContentRegionMaxAbs() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImVec2 mx = window->ContentRegionRect.Max; - if (window->DC.CurrentColumns) - mx.x = window->WorkRect.Max.x; - return mx; -} - -ImVec2 ImGui::GetContentRegionAvail() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return GetContentRegionMaxAbs() - window->DC.CursorPos; -} - -// In window space (not screen space!) -ImVec2 ImGui::GetWindowContentRegionMin() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ContentRegionRect.Min - window->Pos; -} - -ImVec2 ImGui::GetWindowContentRegionMax() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ContentRegionRect.Max - window->Pos; -} - -float ImGui::GetWindowContentRegionWidth() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ContentRegionRect.GetWidth(); -} - -// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) -void ImGui::BeginGroup() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - - window->DC.GroupStack.resize(window->DC.GroupStack.Size + 1); - ImGuiGroupData& group_data = window->DC.GroupStack.back(); - group_data.BackupCursorPos = window->DC.CursorPos; - group_data.BackupCursorMaxPos = window->DC.CursorMaxPos; - group_data.BackupIndent = window->DC.Indent; - group_data.BackupGroupOffset = window->DC.GroupOffset; - group_data.BackupCurrLineSize = window->DC.CurrLineSize; - group_data.BackupCurrLineTextBaseOffset = window->DC.CurrLineTextBaseOffset; - group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive; - group_data.BackupActiveIdPreviousFrameIsAlive = g.ActiveIdPreviousFrameIsAlive; - group_data.EmitItem = true; - - window->DC.GroupOffset.x = window->DC.CursorPos.x - window->Pos.x - window->DC.ColumnsOffset.x; - window->DC.Indent = window->DC.GroupOffset; - window->DC.CursorMaxPos = window->DC.CursorPos; - window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); - if (g.LogEnabled) - g.LogLinePosY = -FLT_MAX; // To enforce Log carriage return -} - -void ImGui::EndGroup() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - IM_ASSERT(!window->DC.GroupStack.empty()); // Mismatched BeginGroup()/EndGroup() calls - - ImGuiGroupData& group_data = window->DC.GroupStack.back(); - - ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos)); - - window->DC.CursorPos = group_data.BackupCursorPos; - window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos); - window->DC.Indent = group_data.BackupIndent; - window->DC.GroupOffset = group_data.BackupGroupOffset; - window->DC.CurrLineSize = group_data.BackupCurrLineSize; - window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset; - if (g.LogEnabled) - g.LogLinePosY = -FLT_MAX; // To enforce Log carriage return - - if (!group_data.EmitItem) - { - window->DC.GroupStack.pop_back(); - return; - } - - window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. - ItemSize(group_bb.GetSize()); - ItemAdd(group_bb, 0); - - // If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group. - // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets. - // Also if you grep for LastItemId you'll notice it is only used in that context. - // (The tests not symmetrical because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.) - const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId; - const bool group_contains_prev_active_id = !group_data.BackupActiveIdPreviousFrameIsAlive && g.ActiveIdPreviousFrameIsAlive; - if (group_contains_curr_active_id) - window->DC.LastItemId = g.ActiveId; - else if (group_contains_prev_active_id) - window->DC.LastItemId = g.ActiveIdPreviousFrame; - window->DC.LastItemRect = group_bb; - - // Forward Edited flag - if (group_contains_curr_active_id && g.ActiveIdHasBeenEditedThisFrame) - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Edited; - - // Forward Deactivated flag - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDeactivated; - if (group_contains_prev_active_id && g.ActiveId != g.ActiveIdPreviousFrame) - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Deactivated; - - window->DC.GroupStack.pop_back(); - //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug] -} - - -//----------------------------------------------------------------------------- -// [SECTION] SCROLLING -//----------------------------------------------------------------------------- - -static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window, bool snap_on_edges) -{ - ImGuiContext& g = *GImGui; - ImVec2 scroll = window->Scroll; - if (window->ScrollTarget.x < FLT_MAX) - { - float cr_x = window->ScrollTargetCenterRatio.x; - float target_x = window->ScrollTarget.x; - if (snap_on_edges && cr_x <= 0.0f && target_x <= window->WindowPadding.x) - target_x = 0.0f; - else if (snap_on_edges && cr_x >= 1.0f && target_x >= window->ContentSize.x + window->WindowPadding.x + g.Style.ItemSpacing.x) - target_x = window->ContentSize.x + window->WindowPadding.x * 2.0f; - scroll.x = target_x - cr_x * (window->SizeFull.x - window->ScrollbarSizes.x); - } - if (window->ScrollTarget.y < FLT_MAX) - { - // 'snap_on_edges' allows for a discontinuity at the edge of scrolling limits to take account of WindowPadding so that scrolling to make the last item visible scroll far enough to see the padding. - float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); - float cr_y = window->ScrollTargetCenterRatio.y; - float target_y = window->ScrollTarget.y; - if (snap_on_edges && cr_y <= 0.0f && target_y <= window->WindowPadding.y) - target_y = 0.0f; - if (snap_on_edges && cr_y >= 1.0f && target_y >= window->ContentSize.y + window->WindowPadding.y + g.Style.ItemSpacing.y) - target_y = window->ContentSize.y + window->WindowPadding.y * 2.0f; - scroll.y = target_y - cr_y * (window->SizeFull.y - window->ScrollbarSizes.y - decoration_up_height); - } - scroll.x = IM_FLOOR(ImMax(scroll.x, 0.0f)); - scroll.y = IM_FLOOR(ImMax(scroll.y, 0.0f)); - if (!window->Collapsed && !window->SkipItems) - { - scroll.x = ImMin(scroll.x, window->ScrollMax.x); - scroll.y = ImMin(scroll.y, window->ScrollMax.y); - } - return scroll; -} - -// Scroll to keep newly navigated item fully into view -ImVec2 ImGui::ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& item_rect) -{ - ImGuiContext& g = *GImGui; - ImRect window_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1)); - //GetForegroundDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG] - - ImVec2 delta_scroll; - if (!window_rect.Contains(item_rect)) - { - if (window->ScrollbarX && item_rect.Min.x < window_rect.Min.x) - SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x + g.Style.ItemSpacing.x, 0.0f); - else if (window->ScrollbarX && item_rect.Max.x >= window_rect.Max.x) - SetScrollFromPosX(window, item_rect.Max.x - window->Pos.x + g.Style.ItemSpacing.x, 1.0f); - if (item_rect.Min.y < window_rect.Min.y) - SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y - g.Style.ItemSpacing.y, 0.0f); - else if (item_rect.Max.y >= window_rect.Max.y) - SetScrollFromPosY(window, item_rect.Max.y - window->Pos.y + g.Style.ItemSpacing.y, 1.0f); - - ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window, false); - delta_scroll = next_scroll - window->Scroll; - } - - // Also scroll parent window to keep us into view if necessary - if (window->Flags & ImGuiWindowFlags_ChildWindow) - delta_scroll += ScrollToBringRectIntoView(window->ParentWindow, ImRect(item_rect.Min - delta_scroll, item_rect.Max - delta_scroll)); - - return delta_scroll; -} - -float ImGui::GetScrollX() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->Scroll.x; -} - -float ImGui::GetScrollY() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->Scroll.y; -} - -float ImGui::GetScrollMaxX() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ScrollMax.x; -} - -float ImGui::GetScrollMaxY() -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ScrollMax.y; -} - -void ImGui::SetScrollX(float scroll_x) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->ScrollTarget.x = scroll_x; - window->ScrollTargetCenterRatio.x = 0.0f; -} - -void ImGui::SetScrollY(float scroll_y) -{ - ImGuiWindow* window = GetCurrentWindow(); - window->ScrollTarget.y = scroll_y; - window->ScrollTargetCenterRatio.y = 0.0f; -} - -void ImGui::SetScrollX(ImGuiWindow* window, float new_scroll_x) -{ - window->ScrollTarget.x = new_scroll_x; - window->ScrollTargetCenterRatio.x = 0.0f; -} - -void ImGui::SetScrollY(ImGuiWindow* window, float new_scroll_y) -{ - window->ScrollTarget.y = new_scroll_y; - window->ScrollTargetCenterRatio.y = 0.0f; -} - - -void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio) -{ - // We store a target position so centering can occur on the next frame when we are guaranteed to have a known window size - IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f); - window->ScrollTarget.x = IM_FLOOR(local_x + window->Scroll.x); - window->ScrollTargetCenterRatio.x = center_x_ratio; -} - -void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio) -{ - // We store a target position so centering can occur on the next frame when we are guaranteed to have a known window size - IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f); - const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); - local_y -= decoration_up_height; - window->ScrollTarget.y = IM_FLOOR(local_y + window->Scroll.y); - window->ScrollTargetCenterRatio.y = center_y_ratio; -} - -void ImGui::SetScrollFromPosX(float local_x, float center_x_ratio) -{ - ImGuiContext& g = *GImGui; - SetScrollFromPosX(g.CurrentWindow, local_x, center_x_ratio); -} - -void ImGui::SetScrollFromPosY(float local_y, float center_y_ratio) -{ - ImGuiContext& g = *GImGui; - SetScrollFromPosY(g.CurrentWindow, local_y, center_y_ratio); -} - -// center_x_ratio: 0.0f left of last item, 0.5f horizontal center of last item, 1.0f right of last item. -void ImGui::SetScrollHereX(float center_x_ratio) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - float target_x = window->DC.LastItemRect.Min.x - window->Pos.x; // Left of last item, in window space - float last_item_width = window->DC.LastItemRect.GetWidth(); - target_x += (last_item_width * center_x_ratio) + (g.Style.ItemSpacing.x * (center_x_ratio - 0.5f) * 2.0f); // Precisely aim before, in the middle or after the last item. - SetScrollFromPosX(target_x, center_x_ratio); -} - -// center_y_ratio: 0.0f top of last item, 0.5f vertical center of last item, 1.0f bottom of last item. -void ImGui::SetScrollHereY(float center_y_ratio) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - float target_y = window->DC.CursorPosPrevLine.y - window->Pos.y; // Top of last item, in window space - target_y += (window->DC.PrevLineSize.y * center_y_ratio) + (g.Style.ItemSpacing.y * (center_y_ratio - 0.5f) * 2.0f); // Precisely aim above, in the middle or below the last line. - SetScrollFromPosY(target_y, center_y_ratio); -} - -//----------------------------------------------------------------------------- -// [SECTION] TOOLTIPS -//----------------------------------------------------------------------------- - -void ImGui::BeginTooltip() -{ - BeginTooltipEx(ImGuiWindowFlags_None, ImGuiTooltipFlags_None); -} - -void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags) -{ - ImGuiContext& g = *GImGui; - - if (g.DragDropWithinSource || g.DragDropWithinTarget) - { - // The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor) - // In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor. - // Whatever we do we want to call SetNextWindowPos() to enforce a tooltip position and disable clipping the tooltip without our display area, like regular tooltip do. - //ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding; - ImVec2 tooltip_pos = g.IO.MousePos + ImVec2(16 * g.Style.MouseCursorScale, 8 * g.Style.MouseCursorScale); - SetNextWindowPos(tooltip_pos); - SetNextWindowBgAlpha(g.Style.Colors[ImGuiCol_PopupBg].w * 0.60f); - //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :( - tooltip_flags |= ImGuiTooltipFlags_OverridePreviousTooltip; - } - - char window_name[16]; - ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", g.TooltipOverrideCount); - if (tooltip_flags & ImGuiTooltipFlags_OverridePreviousTooltip) - if (ImGuiWindow* window = FindWindowByName(window_name)) - if (window->Active) - { - // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one. - window->Hidden = true; - window->HiddenFramesCanSkipItems = 1; - ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); - } - ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoInputs|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize; - Begin(window_name, NULL, flags | extra_flags); -} - -void ImGui::EndTooltip() -{ - IM_ASSERT(GetCurrentWindowRead()->Flags & ImGuiWindowFlags_Tooltip); // Mismatched BeginTooltip()/EndTooltip() calls - End(); -} - -void ImGui::SetTooltipV(const char* fmt, va_list args) -{ - BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip); - TextV(fmt, args); - EndTooltip(); -} - -void ImGui::SetTooltip(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - SetTooltipV(fmt, args); - va_end(args); -} - -//----------------------------------------------------------------------------- -// [SECTION] POPUPS -//----------------------------------------------------------------------------- - -bool ImGui::IsPopupOpen(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - return g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].PopupId == id; -} - -bool ImGui::IsPopupOpen(const char* str_id) -{ - ImGuiContext& g = *GImGui; - return g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].PopupId == g.CurrentWindow->GetID(str_id); -} - -ImGuiWindow* ImGui::GetTopMostPopupModal() -{ - ImGuiContext& g = *GImGui; - for (int n = g.OpenPopupStack.Size-1; n >= 0; n--) - if (ImGuiWindow* popup = g.OpenPopupStack.Data[n].Window) - if (popup->Flags & ImGuiWindowFlags_Modal) - return popup; - return NULL; -} - -void ImGui::OpenPopup(const char* str_id) -{ - ImGuiContext& g = *GImGui; - OpenPopupEx(g.CurrentWindow->GetID(str_id)); -} - -// Mark popup as open (toggle toward open state). -// Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. -// Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). -// One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL) -void ImGui::OpenPopupEx(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* parent_window = g.CurrentWindow; - int current_stack_size = g.BeginPopupStack.Size; - ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack. - popup_ref.PopupId = id; - popup_ref.Window = NULL; - popup_ref.SourceWindow = g.NavWindow; - popup_ref.OpenFrameCount = g.FrameCount; - popup_ref.OpenParentId = parent_window->IDStack.back(); - popup_ref.OpenPopupPos = NavCalcPreferredRefPos(); - popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos; - - //IMGUI_DEBUG_LOG("OpenPopupEx(0x%08X)\n", g.FrameCount, id); - if (g.OpenPopupStack.Size < current_stack_size + 1) - { - g.OpenPopupStack.push_back(popup_ref); - } - else - { - // Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui - // would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing - // situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand. - if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) - { - g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount; - } - else - { - // Close child popups if any, then flag popup for open/reopen - g.OpenPopupStack.resize(current_stack_size + 1); - g.OpenPopupStack[current_stack_size] = popup_ref; - } - - // When reopening a popup we first refocus its parent, otherwise if its parent is itself a popup it would get closed by ClosePopupsOverWindow(). - // This is equivalent to what ClosePopupToLevel() does. - //if (g.OpenPopupStack[current_stack_size].PopupId == id) - // FocusWindow(parent_window); - } -} - -void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup) -{ - ImGuiContext& g = *GImGui; - if (g.OpenPopupStack.empty()) - return; - - // When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it. - // Don't close our own child popup windows. - int popup_count_to_keep = 0; - if (ref_window) - { - // Find the highest popup which is a descendant of the reference window (generally reference window = NavWindow) - for (; popup_count_to_keep < g.OpenPopupStack.Size; popup_count_to_keep++) - { - ImGuiPopupData& popup = g.OpenPopupStack[popup_count_to_keep]; - if (!popup.Window) - continue; - IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); - if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) - continue; - - // Trim the stack when popups are not direct descendant of the reference window (the reference window is often the NavWindow) - bool popup_or_descendent_is_ref_window = false; - for (int m = popup_count_to_keep; m < g.OpenPopupStack.Size && !popup_or_descendent_is_ref_window; m++) - if (ImGuiWindow* popup_window = g.OpenPopupStack[m].Window) - if (popup_window->RootWindow == ref_window->RootWindow) - popup_or_descendent_is_ref_window = true; - if (!popup_or_descendent_is_ref_window) - break; - } - } - if (popup_count_to_keep < g.OpenPopupStack.Size) // This test is not required but it allows to set a convenient breakpoint on the statement below - { - //IMGUI_DEBUG_LOG("ClosePopupsOverWindow(%s) -> ClosePopupToLevel(%d)\n", ref_window->Name, popup_count_to_keep); - ClosePopupToLevel(popup_count_to_keep, restore_focus_to_window_under_popup); - } -} - -void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size); - ImGuiWindow* focus_window = g.OpenPopupStack[remaining].SourceWindow; - ImGuiWindow* popup_window = g.OpenPopupStack[remaining].Window; - g.OpenPopupStack.resize(remaining); - - if (restore_focus_to_window_under_popup) - { - if (focus_window && !focus_window->WasActive && popup_window) - { - // Fallback - FocusTopMostWindowUnderOne(popup_window, NULL); - } - else - { - if (g.NavLayer == ImGuiNavLayer_Main && focus_window) - focus_window = NavRestoreLastChildNavWindow(focus_window); - FocusWindow(focus_window); - } - } -} - -// Close the popup we have begin-ed into. -void ImGui::CloseCurrentPopup() -{ - ImGuiContext& g = *GImGui; - int popup_idx = g.BeginPopupStack.Size - 1; - if (popup_idx < 0 || popup_idx >= g.OpenPopupStack.Size || g.BeginPopupStack[popup_idx].PopupId != g.OpenPopupStack[popup_idx].PopupId) - return; - - // Closing a menu closes its top-most parent popup (unless a modal) - while (popup_idx > 0) - { - ImGuiWindow* popup_window = g.OpenPopupStack[popup_idx].Window; - ImGuiWindow* parent_popup_window = g.OpenPopupStack[popup_idx - 1].Window; - bool close_parent = false; - if (popup_window && (popup_window->Flags & ImGuiWindowFlags_ChildMenu)) - if (parent_popup_window == NULL || !(parent_popup_window->Flags & ImGuiWindowFlags_Modal)) - close_parent = true; - if (!close_parent) - break; - popup_idx--; - } - //IMGUI_DEBUG_LOG("CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx); - ClosePopupToLevel(popup_idx, true); - - // A common pattern is to close a popup when selecting a menu item/selectable that will open another window. - // To improve this usage pattern, we avoid nav highlight for a single frame in the parent window. - // Similarly, we could avoid mouse hover highlight in this window but it is less visually problematic. - if (ImGuiWindow* window = g.NavWindow) - window->DC.NavHideHighlightOneFrame = true; -} - -bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - if (!IsPopupOpen(id)) - { - g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values - return false; - } - - char name[20]; - if (flags & ImGuiWindowFlags_ChildMenu) - ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth - else - ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame - - flags |= ImGuiWindowFlags_Popup; - bool is_open = Begin(name, NULL, flags); - if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display) - EndPopup(); - - return is_open; -} - -bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - if (g.OpenPopupStack.Size <= g.BeginPopupStack.Size) // Early out for performance - { - g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values - return false; - } - flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings; - return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags); -} - -// If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup. -// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here. -bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - const ImGuiID id = window->GetID(name); - if (!IsPopupOpen(id)) - { - g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values - return false; - } - - // Center modal windows by default - // FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window. - if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0) - SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f)); - - flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings; - const bool is_open = Begin(name, p_open, flags); - if (!is_open || (p_open && !*p_open)) // NB: is_open can be 'false' when the popup is completely clipped (e.g. zero size display) - { - EndPopup(); - if (is_open) - ClosePopupToLevel(g.BeginPopupStack.Size, true); - return false; - } - return is_open; -} - -void ImGui::EndPopup() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - IM_ASSERT(window->Flags & ImGuiWindowFlags_Popup); // Mismatched BeginPopup()/EndPopup() calls - IM_ASSERT(g.BeginPopupStack.Size > 0); - - // Make all menus and popups wrap around for now, may need to expose that policy. - NavMoveRequestTryWrapping(window, ImGuiNavMoveFlags_LoopY); - - // Child-popups don't need to be layed out - IM_ASSERT(g.WithinEndChild == false); - if (window->Flags & ImGuiWindowFlags_ChildWindow) - g.WithinEndChild = true; - End(); - g.WithinEndChild = false; -} - -bool ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiMouseButton mouse_button) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) - { - ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict! - IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item) - OpenPopupEx(id); - return true; - } - return false; -} - -// This is a helper to handle the simplest case of associating one named popup to one given widget. -// You may want to handle this on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters). -// You can pass a NULL str_id to use the identifier of the last item. -bool ImGui::BeginPopupContextItem(const char* str_id, ImGuiMouseButton mouse_button) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - if (window->SkipItems) - return false; - ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict! - IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item) - if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) - OpenPopupEx(id); - return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); -} - -bool ImGui::BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mouse_button, bool also_over_items) -{ - if (!str_id) - str_id = "window_context"; - ImGuiID id = GImGui->CurrentWindow->GetID(str_id); - if (IsMouseReleased(mouse_button) && IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) - if (also_over_items || !IsAnyItemHovered()) - OpenPopupEx(id); - return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); -} - -bool ImGui::BeginPopupContextVoid(const char* str_id, ImGuiMouseButton mouse_button) -{ - if (!str_id) - str_id = "void_context"; - ImGuiID id = GImGui->CurrentWindow->GetID(str_id); - if (IsMouseReleased(mouse_button) && !IsWindowHovered(ImGuiHoveredFlags_AnyWindow)) - OpenPopupEx(id); - return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); -} - -// r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.) -// r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it. -ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy) -{ - ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size); - //GetForegroundDrawList()->AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255)); - //GetForegroundDrawList()->AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255)); - - // Combo Box policy (we want a connecting edge) - if (policy == ImGuiPopupPositionPolicy_ComboBox) - { - const ImGuiDir dir_prefered_order[ImGuiDir_COUNT] = { ImGuiDir_Down, ImGuiDir_Right, ImGuiDir_Left, ImGuiDir_Up }; - for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) - { - const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; - if (n != -1 && dir == *last_dir) // Already tried this direction? - continue; - ImVec2 pos; - if (dir == ImGuiDir_Down) pos = ImVec2(r_avoid.Min.x, r_avoid.Max.y); // Below, Toward Right (default) - if (dir == ImGuiDir_Right) pos = ImVec2(r_avoid.Min.x, r_avoid.Min.y - size.y); // Above, Toward Right - if (dir == ImGuiDir_Left) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Max.y); // Below, Toward Left - if (dir == ImGuiDir_Up) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Min.y - size.y); // Above, Toward Left - if (!r_outer.Contains(ImRect(pos, pos + size))) - continue; - *last_dir = dir; - return pos; - } - } - - // Default popup policy - const ImGuiDir dir_prefered_order[ImGuiDir_COUNT] = { ImGuiDir_Right, ImGuiDir_Down, ImGuiDir_Up, ImGuiDir_Left }; - for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) - { - const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; - if (n != -1 && dir == *last_dir) // Already tried this direction? - continue; - float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? r_avoid.Max.x : r_outer.Min.x); - float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y); - if (avail_w < size.x || avail_h < size.y) - continue; - ImVec2 pos; - pos.x = (dir == ImGuiDir_Left) ? r_avoid.Min.x - size.x : (dir == ImGuiDir_Right) ? r_avoid.Max.x : base_pos_clamped.x; - pos.y = (dir == ImGuiDir_Up) ? r_avoid.Min.y - size.y : (dir == ImGuiDir_Down) ? r_avoid.Max.y : base_pos_clamped.y; - *last_dir = dir; - return pos; - } - - // Fallback, try to keep within display - *last_dir = ImGuiDir_None; - ImVec2 pos = ref_pos; - pos.x = ImMax(ImMin(pos.x + size.x, r_outer.Max.x) - size.x, r_outer.Min.x); - pos.y = ImMax(ImMin(pos.y + size.y, r_outer.Max.y) - size.y, r_outer.Min.y); - return pos; -} - -ImRect ImGui::GetWindowAllowedExtentRect(ImGuiWindow* window) -{ - IM_UNUSED(window); - ImVec2 padding = GImGui->Style.DisplaySafeAreaPadding; - ImRect r_screen = GetViewportRect(); - r_screen.Expand(ImVec2((r_screen.GetWidth() > padding.x * 2) ? -padding.x : 0.0f, (r_screen.GetHeight() > padding.y * 2) ? -padding.y : 0.0f)); - return r_screen; -} - -ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - - ImRect r_outer = GetWindowAllowedExtentRect(window); - if (window->Flags & ImGuiWindowFlags_ChildMenu) - { - // Child menus typically request _any_ position within the parent menu item, and then we move the new menu outside the parent bounds. - // This is how we end up with child menus appearing (most-commonly) on the right of the parent menu. - IM_ASSERT(g.CurrentWindow == window); - ImGuiWindow* parent_window = g.CurrentWindowStack[g.CurrentWindowStack.Size - 2]; - float horizontal_overlap = g.Style.ItemInnerSpacing.x; // We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x). - ImRect r_avoid; - if (parent_window->DC.MenuBarAppending) - r_avoid = ImRect(-FLT_MAX, parent_window->ClipRect.Min.y, FLT_MAX, parent_window->ClipRect.Max.y); // Avoid parent menu-bar. If we wanted multi-line menu-bar, we may instead want to have the calling window setup e.g. a NextWindowData.PosConstraintAvoidRect field - else - r_avoid = ImRect(parent_window->Pos.x + horizontal_overlap, -FLT_MAX, parent_window->Pos.x + parent_window->Size.x - horizontal_overlap - parent_window->ScrollbarSizes.x, FLT_MAX); - return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid); - } - if (window->Flags & ImGuiWindowFlags_Popup) - { - ImRect r_avoid = ImRect(window->Pos.x - 1, window->Pos.y - 1, window->Pos.x + 1, window->Pos.y + 1); - return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid); - } - if (window->Flags & ImGuiWindowFlags_Tooltip) - { - // Position tooltip (always follows mouse) - float sc = g.Style.MouseCursorScale; - ImVec2 ref_pos = NavCalcPreferredRefPos(); - ImRect r_avoid; - if (!g.NavDisableHighlight && g.NavDisableMouseHover && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos)) - r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 16, ref_pos.y + 8); - else - r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * sc, ref_pos.y + 24 * sc); // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important. - ImVec2 pos = FindBestWindowPosForPopupEx(ref_pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid); - if (window->AutoPosLastDirection == ImGuiDir_None) - pos = ref_pos + ImVec2(2, 2); // If there's not enough room, for tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible. - return pos; - } - IM_ASSERT(0); - return window->Pos; -} - -//----------------------------------------------------------------------------- -// [SECTION] KEYBOARD/GAMEPAD NAVIGATION -//----------------------------------------------------------------------------- - -// FIXME-NAV: The existence of SetNavID vs SetNavIDWithRectRel vs SetFocusID is incredibly messy and confusing, -// and needs some explanation or serious refactoring. -void ImGui::SetNavID(ImGuiID id, int nav_layer, ImGuiID focus_scope_id) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.NavWindow); - IM_ASSERT(nav_layer == 0 || nav_layer == 1); - g.NavId = id; - g.NavFocusScopeId = focus_scope_id; - g.NavWindow->NavLastIds[nav_layer] = id; -} - -void ImGui::SetNavIDWithRectRel(ImGuiID id, int nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel) -{ - ImGuiContext& g = *GImGui; - SetNavID(id, nav_layer, focus_scope_id); - g.NavWindow->NavRectRel[nav_layer] = rect_rel; - g.NavMousePosDirty = true; - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; -} - -void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(id != 0); - - // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and window->DC.NavFocusScopeIdCurrent are valid. - // Note that window may be != g.CurrentWindow (e.g. SetFocusID call in InputTextEx for multi-line text) - const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent; - if (g.NavWindow != window) - g.NavInitRequest = false; - g.NavWindow = window; - g.NavId = id; - g.NavLayer = nav_layer; - g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent; - window->NavLastIds[nav_layer] = id; - if (window->DC.LastItemId == id) - window->NavRectRel[nav_layer] = ImRect(window->DC.LastItemRect.Min - window->Pos, window->DC.LastItemRect.Max - window->Pos); - - if (g.ActiveIdSource == ImGuiInputSource_Nav) - g.NavDisableMouseHover = true; - else - g.NavDisableHighlight = true; -} - -ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy) -{ - if (ImFabs(dx) > ImFabs(dy)) - return (dx > 0.0f) ? ImGuiDir_Right : ImGuiDir_Left; - return (dy > 0.0f) ? ImGuiDir_Down : ImGuiDir_Up; -} - -static float inline NavScoreItemDistInterval(float a0, float a1, float b0, float b1) -{ - if (a1 < b0) - return a1 - b0; - if (b1 < a0) - return a0 - b1; - return 0.0f; -} - -static void inline NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir, ImRect& r, const ImRect& clip_rect) -{ - if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right) - { - r.Min.y = ImClamp(r.Min.y, clip_rect.Min.y, clip_rect.Max.y); - r.Max.y = ImClamp(r.Max.y, clip_rect.Min.y, clip_rect.Max.y); - } - else - { - r.Min.x = ImClamp(r.Min.x, clip_rect.Min.x, clip_rect.Max.x); - r.Max.x = ImClamp(r.Max.x, clip_rect.Min.x, clip_rect.Max.x); - } -} - -// Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057 -static bool ImGui::NavScoreItem(ImGuiNavMoveResult* result, ImRect cand) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (g.NavLayer != window->DC.NavLayerCurrent) - return false; - - const ImRect& curr = g.NavScoringRect; // Current modified source rect (NB: we've applied Max.x = Min.x in NavUpdate() to inhibit the effect of having varied item width) - g.NavScoringCount++; - - // When entering through a NavFlattened border, we consider child window items as fully clipped for scoring - if (window->ParentWindow == g.NavWindow) - { - IM_ASSERT((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened); - if (!window->ClipRect.Overlaps(cand)) - return false; - cand.ClipWithFull(window->ClipRect); // This allows the scored item to not overlap other candidates in the parent window - } - - // We perform scoring on items bounding box clipped by the current clipping rectangle on the other axis (clipping on our movement axis would give us equal scores for all clipped items) - // For example, this ensure that items in one column are not reached when moving vertically from items in another column. - NavClampRectToVisibleAreaForMoveDir(g.NavMoveClipDir, cand, window->ClipRect); - - // Compute distance between boxes - // FIXME-NAV: Introducing biases for vertical navigation, needs to be removed. - float dbx = NavScoreItemDistInterval(cand.Min.x, cand.Max.x, curr.Min.x, curr.Max.x); - float dby = NavScoreItemDistInterval(ImLerp(cand.Min.y, cand.Max.y, 0.2f), ImLerp(cand.Min.y, cand.Max.y, 0.8f), ImLerp(curr.Min.y, curr.Max.y, 0.2f), ImLerp(curr.Min.y, curr.Max.y, 0.8f)); // Scale down on Y to keep using box-distance for vertically touching items - if (dby != 0.0f && dbx != 0.0f) - dbx = (dbx/1000.0f) + ((dbx > 0.0f) ? +1.0f : -1.0f); - float dist_box = ImFabs(dbx) + ImFabs(dby); - - // Compute distance between centers (this is off by a factor of 2, but we only compare center distances with each other so it doesn't matter) - float dcx = (cand.Min.x + cand.Max.x) - (curr.Min.x + curr.Max.x); - float dcy = (cand.Min.y + cand.Max.y) - (curr.Min.y + curr.Max.y); - float dist_center = ImFabs(dcx) + ImFabs(dcy); // L1 metric (need this for our connectedness guarantee) - - // Determine which quadrant of 'curr' our candidate item 'cand' lies in based on distance - ImGuiDir quadrant; - float dax = 0.0f, day = 0.0f, dist_axial = 0.0f; - if (dbx != 0.0f || dby != 0.0f) - { - // For non-overlapping boxes, use distance between boxes - dax = dbx; - day = dby; - dist_axial = dist_box; - quadrant = ImGetDirQuadrantFromDelta(dbx, dby); - } - else if (dcx != 0.0f || dcy != 0.0f) - { - // For overlapping boxes with different centers, use distance between centers - dax = dcx; - day = dcy; - dist_axial = dist_center; - quadrant = ImGetDirQuadrantFromDelta(dcx, dcy); - } - else - { - // Degenerate case: two overlapping buttons with same center, break ties arbitrarily (note that LastItemId here is really the _previous_ item order, but it doesn't matter) - quadrant = (window->DC.LastItemId < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right; - } - -#if IMGUI_DEBUG_NAV_SCORING - char buf[128]; - if (IsMouseHoveringRect(cand.Min, cand.Max)) - { - ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]); - ImDrawList* draw_list = GetForegroundDrawList(window); - draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100)); - draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200)); - draw_list->AddRectFilled(cand.Max - ImVec2(4,4), cand.Max + CalcTextSize(buf) + ImVec2(4,4), IM_COL32(40,0,0,150)); - draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Max, ~0U, buf); - } - else if (g.IO.KeyCtrl) // Hold to preview score in matching quadrant. Press C to rotate. - { - if (IsKeyPressedMap(ImGuiKey_C)) { g.NavMoveDirLast = (ImGuiDir)((g.NavMoveDirLast + 1) & 3); g.IO.KeysDownDuration[g.IO.KeyMap[ImGuiKey_C]] = 0.01f; } - if (quadrant == g.NavMoveDir) - { - ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center); - ImDrawList* draw_list = GetForegroundDrawList(window); - draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200)); - draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf); - } - } - #endif - - // Is it in the quadrant we're interesting in moving to? - bool new_best = false; - if (quadrant == g.NavMoveDir) - { - // Does it beat the current best candidate? - if (dist_box < result->DistBox) - { - result->DistBox = dist_box; - result->DistCenter = dist_center; - return true; - } - if (dist_box == result->DistBox) - { - // Try using distance between center points to break ties - if (dist_center < result->DistCenter) - { - result->DistCenter = dist_center; - new_best = true; - } - else if (dist_center == result->DistCenter) - { - // Still tied! we need to be extra-careful to make sure everything gets linked properly. We consistently break ties by symbolically moving "later" items - // (with higher index) to the right/downwards by an infinitesimal amount since we the current "best" button already (so it must have a lower index), - // this is fairly easy. This rule ensures that all buttons with dx==dy==0 will end up being linked in order of appearance along the x axis. - if (((g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) ? dby : dbx) < 0.0f) // moving bj to the right/down decreases distance - new_best = true; - } - } - } - - // Axial check: if 'curr' has no link at all in some direction and 'cand' lies roughly in that direction, add a tentative link. This will only be kept if no "real" matches - // are found, so it only augments the graph produced by the above method using extra links. (important, since it doesn't guarantee strong connectedness) - // This is just to avoid buttons having no links in a particular direction when there's a suitable neighbor. you get good graphs without this too. - // 2017/09/29: FIXME: This now currently only enabled inside menu bars, ideally we'd disable it everywhere. Menus in particular need to catch failure. For general navigation it feels awkward. - // Disabling it may lead to disconnected graphs when nodes are very spaced out on different axis. Perhaps consider offering this as an option? - if (result->DistBox == FLT_MAX && dist_axial < result->DistAxial) // Check axial match - if (g.NavLayer == ImGuiNavLayer_Menu && !(g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu)) - if ((g.NavMoveDir == ImGuiDir_Left && dax < 0.0f) || (g.NavMoveDir == ImGuiDir_Right && dax > 0.0f) || (g.NavMoveDir == ImGuiDir_Up && day < 0.0f) || (g.NavMoveDir == ImGuiDir_Down && day > 0.0f)) - { - result->DistAxial = dist_axial; - new_best = true; - } - - return new_best; -} - -// We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) -static void ImGui::NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGuiID id) -{ - ImGuiContext& g = *GImGui; - //if (!g.IO.NavActive) // [2017/10/06] Removed this possibly redundant test but I am not sure of all the side-effects yet. Some of the feature here will need to work regardless of using a _NoNavInputs flag. - // return; - - const ImGuiItemFlags item_flags = window->DC.ItemFlags; - const ImRect nav_bb_rel(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); - - // Process Init Request - if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent) - { - // Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback - if (!(item_flags & ImGuiItemFlags_NoNavDefaultFocus) || g.NavInitResultId == 0) - { - g.NavInitResultId = id; - g.NavInitResultRectRel = nav_bb_rel; - } - if (!(item_flags & ImGuiItemFlags_NoNavDefaultFocus)) - { - g.NavInitRequest = false; // Found a match, clear request - NavUpdateAnyRequestFlag(); - } - } - - // Process Move Request (scoring for navigation) - // FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRectScreen + scoring from a rect wrapped according to current wrapping policy) - if ((g.NavId != id || (g.NavMoveRequestFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & (ImGuiItemFlags_Disabled|ImGuiItemFlags_NoNav))) - { - ImGuiNavMoveResult* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; -#if IMGUI_DEBUG_NAV_SCORING - // [DEBUG] Score all items in NavWindow at all times - if (!g.NavMoveRequest) - g.NavMoveDir = g.NavMoveDirLast; - bool new_best = NavScoreItem(result, nav_bb) && g.NavMoveRequest; -#else - bool new_best = g.NavMoveRequest && NavScoreItem(result, nav_bb); -#endif - if (new_best) - { - result->Window = window; - result->ID = id; - result->FocusScopeId = window->DC.NavFocusScopeIdCurrent; - result->RectRel = nav_bb_rel; - } - - // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. - const float VISIBLE_RATIO = 0.70f; - if ((g.NavMoveRequestFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) - if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) - if (NavScoreItem(&g.NavMoveResultLocalVisibleSet, nav_bb)) - { - result = &g.NavMoveResultLocalVisibleSet; - result->Window = window; - result->ID = id; - result->FocusScopeId = window->DC.NavFocusScopeIdCurrent; - result->RectRel = nav_bb_rel; - } - } - - // Update window-relative bounding box of navigated item - if (g.NavId == id) - { - g.NavWindow = window; // Always refresh g.NavWindow, because some operations such as FocusItem() don't have a window. - g.NavLayer = window->DC.NavLayerCurrent; - g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent; - g.NavIdIsAlive = true; - g.NavIdTabCounter = window->DC.FocusCounterTabStop; - window->NavRectRel[window->DC.NavLayerCurrent] = nav_bb_rel; // Store item bounding box (relative to window position) - } -} - -bool ImGui::NavMoveRequestButNoResultYet() -{ - ImGuiContext& g = *GImGui; - return g.NavMoveRequest && g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0; -} - -void ImGui::NavMoveRequestCancel() -{ - ImGuiContext& g = *GImGui; - g.NavMoveRequest = false; - NavUpdateAnyRequestFlag(); -} - -void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect& bb_rel, ImGuiNavMoveFlags move_flags) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.NavMoveRequestForward == ImGuiNavForward_None); - NavMoveRequestCancel(); - g.NavMoveDir = move_dir; - g.NavMoveClipDir = clip_dir; - g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued; - g.NavMoveRequestFlags = move_flags; - g.NavWindow->NavRectRel[g.NavLayer] = bb_rel; -} - -void ImGui::NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags) -{ - ImGuiContext& g = *GImGui; - if (g.NavWindow != window || !NavMoveRequestButNoResultYet() || g.NavMoveRequestForward != ImGuiNavForward_None || g.NavLayer != ImGuiNavLayer_Main) - return; - IM_ASSERT(move_flags != 0); // No points calling this with no wrapping - ImRect bb_rel = window->NavRectRel[0]; - - ImGuiDir clip_dir = g.NavMoveDir; - if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) - { - bb_rel.Min.x = bb_rel.Max.x = ImMax(window->SizeFull.x, window->ContentSize.x + window->WindowPadding.x * 2.0f) - window->Scroll.x; - if (move_flags & ImGuiNavMoveFlags_WrapX) { bb_rel.TranslateY(-bb_rel.GetHeight()); clip_dir = ImGuiDir_Up; } - NavMoveRequestForward(g.NavMoveDir, clip_dir, bb_rel, move_flags); - } - if (g.NavMoveDir == ImGuiDir_Right && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) - { - bb_rel.Min.x = bb_rel.Max.x = -window->Scroll.x; - if (move_flags & ImGuiNavMoveFlags_WrapX) { bb_rel.TranslateY(+bb_rel.GetHeight()); clip_dir = ImGuiDir_Down; } - NavMoveRequestForward(g.NavMoveDir, clip_dir, bb_rel, move_flags); - } - if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) - { - bb_rel.Min.y = bb_rel.Max.y = ImMax(window->SizeFull.y, window->ContentSize.y + window->WindowPadding.y * 2.0f) - window->Scroll.y; - if (move_flags & ImGuiNavMoveFlags_WrapY) { bb_rel.TranslateX(-bb_rel.GetWidth()); clip_dir = ImGuiDir_Left; } - NavMoveRequestForward(g.NavMoveDir, clip_dir, bb_rel, move_flags); - } - if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) - { - bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y; - if (move_flags & ImGuiNavMoveFlags_WrapY) { bb_rel.TranslateX(+bb_rel.GetWidth()); clip_dir = ImGuiDir_Right; } - NavMoveRequestForward(g.NavMoveDir, clip_dir, bb_rel, move_flags); - } -} - -// FIXME: This could be replaced by updating a frame number in each window when (window == NavWindow) and (NavLayer == 0). -// This way we could find the last focused window among our children. It would be much less confusing this way? -static void ImGui::NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window) -{ - ImGuiWindow* parent_window = nav_window; - while (parent_window && (parent_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 && (parent_window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) == 0) - parent_window = parent_window->ParentWindow; - if (parent_window && parent_window != nav_window) - parent_window->NavLastChildNavWindow = nav_window; -} - -// Restore the last focused child. -// Call when we are expected to land on the Main Layer (0) after FocusWindow() -static ImGuiWindow* ImGui::NavRestoreLastChildNavWindow(ImGuiWindow* window) -{ - return window->NavLastChildNavWindow ? window->NavLastChildNavWindow : window; -} - -static void NavRestoreLayer(ImGuiNavLayer layer) -{ - ImGuiContext& g = *GImGui; - g.NavLayer = layer; - if (layer == 0) - g.NavWindow = ImGui::NavRestoreLastChildNavWindow(g.NavWindow); - ImGuiWindow* window = g.NavWindow; - if (layer == 0 && window->NavLastIds[0] != 0) - ImGui::SetNavIDWithRectRel(window->NavLastIds[0], layer, 0, window->NavRectRel[0]); - else - ImGui::NavInitWindow(window, true); -} - -static inline void ImGui::NavUpdateAnyRequestFlag() -{ - ImGuiContext& g = *GImGui; - g.NavAnyRequest = g.NavMoveRequest || g.NavInitRequest || (IMGUI_DEBUG_NAV_SCORING && g.NavWindow != NULL); - if (g.NavAnyRequest) - IM_ASSERT(g.NavWindow != NULL); -} - -// This needs to be called before we submit any widget (aka in or before Begin) -void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(window == g.NavWindow); - bool init_for_nav = false; - if (!(window->Flags & ImGuiWindowFlags_NoNavInputs)) - if (!(window->Flags & ImGuiWindowFlags_ChildWindow) || (window->Flags & ImGuiWindowFlags_Popup) || (window->NavLastIds[0] == 0) || force_reinit) - init_for_nav = true; - //IMGUI_DEBUG_LOG("[Nav] NavInitWindow() init_for_nav=%d, window=\"%s\", layer=%d\n", init_for_nav, window->Name, g.NavLayer); - if (init_for_nav) - { - SetNavID(0, g.NavLayer, 0); - g.NavInitRequest = true; - g.NavInitRequestFromMove = false; - g.NavInitResultId = 0; - g.NavInitResultRectRel = ImRect(); - NavUpdateAnyRequestFlag(); - } - else - { - g.NavId = window->NavLastIds[0]; - g.NavFocusScopeId = 0; - } -} - -static ImVec2 ImGui::NavCalcPreferredRefPos() -{ - ImGuiContext& g = *GImGui; - if (g.NavDisableHighlight || !g.NavDisableMouseHover || !g.NavWindow) - { - // Mouse (we need a fallback in case the mouse becomes invalid after being used) - if (IsMousePosValid(&g.IO.MousePos)) - return g.IO.MousePos; - return g.LastValidMousePos; - } - else - { - // When navigation is active and mouse is disabled, decide on an arbitrary position around the bottom left of the currently navigated item. - const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer]; - ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight())); - ImRect visible_rect = GetViewportRect(); - return ImFloor(ImClamp(pos, visible_rect.Min, visible_rect.Max)); // ImFloor() is important because non-integer mouse position application in back-end might be lossy and result in undesirable non-zero delta. - } -} - -float ImGui::GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode) -{ - ImGuiContext& g = *GImGui; - if (mode == ImGuiInputReadMode_Down) - return g.IO.NavInputs[n]; // Instant, read analog input (0.0f..1.0f, as provided by user) - - const float t = g.IO.NavInputsDownDuration[n]; - if (t < 0.0f && mode == ImGuiInputReadMode_Released) // Return 1.0f when just released, no repeat, ignore analog input. - return (g.IO.NavInputsDownDurationPrev[n] >= 0.0f ? 1.0f : 0.0f); - if (t < 0.0f) - return 0.0f; - if (mode == ImGuiInputReadMode_Pressed) // Return 1.0f when just pressed, no repeat, ignore analog input. - return (t == 0.0f) ? 1.0f : 0.0f; - if (mode == ImGuiInputReadMode_Repeat) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.80f); - if (mode == ImGuiInputReadMode_RepeatSlow) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 1.25f, g.IO.KeyRepeatRate * 2.00f); - if (mode == ImGuiInputReadMode_RepeatFast) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.30f); - return 0.0f; -} - -ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor, float fast_factor) -{ - ImVec2 delta(0.0f, 0.0f); - if (dir_sources & ImGuiNavDirSourceFlags_Keyboard) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight_, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft_, mode), GetNavInputAmount(ImGuiNavInput_KeyDown_, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp_, mode)); - if (dir_sources & ImGuiNavDirSourceFlags_PadDPad) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_DpadRight, mode) - GetNavInputAmount(ImGuiNavInput_DpadLeft, mode), GetNavInputAmount(ImGuiNavInput_DpadDown, mode) - GetNavInputAmount(ImGuiNavInput_DpadUp, mode)); - if (dir_sources & ImGuiNavDirSourceFlags_PadLStick) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_LStickRight, mode) - GetNavInputAmount(ImGuiNavInput_LStickLeft, mode), GetNavInputAmount(ImGuiNavInput_LStickDown, mode) - GetNavInputAmount(ImGuiNavInput_LStickUp, mode)); - if (slow_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakSlow)) - delta *= slow_factor; - if (fast_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakFast)) - delta *= fast_factor; - return delta; -} - -static void ImGui::NavUpdate() -{ - ImGuiContext& g = *GImGui; - g.IO.WantSetMousePos = false; -#if 0 - if (g.NavScoringCount > 0) IMGUI_DEBUG_LOG("NavScoringCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.FrameCount, g.NavScoringCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); -#endif - - // Set input source as Gamepad when buttons are pressed (as some features differs when used with Gamepad vs Keyboard) - // (do it before we map Keyboard input!) - bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; - bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; - if (nav_gamepad_active) - if (g.IO.NavInputs[ImGuiNavInput_Activate] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Input] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Cancel] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Menu] > 0.0f) - g.NavInputSource = ImGuiInputSource_NavGamepad; - - // Update Keyboard->Nav inputs mapping - if (nav_keyboard_active) - { - #define NAV_MAP_KEY(_KEY, _NAV_INPUT) do { if (IsKeyDown(g.IO.KeyMap[_KEY])) { g.IO.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_NavKeyboard; } } while (0) - NAV_MAP_KEY(ImGuiKey_Space, ImGuiNavInput_Activate ); - NAV_MAP_KEY(ImGuiKey_Enter, ImGuiNavInput_Input ); - NAV_MAP_KEY(ImGuiKey_Escape, ImGuiNavInput_Cancel ); - NAV_MAP_KEY(ImGuiKey_LeftArrow, ImGuiNavInput_KeyLeft_ ); - NAV_MAP_KEY(ImGuiKey_RightArrow,ImGuiNavInput_KeyRight_); - NAV_MAP_KEY(ImGuiKey_UpArrow, ImGuiNavInput_KeyUp_ ); - NAV_MAP_KEY(ImGuiKey_DownArrow, ImGuiNavInput_KeyDown_ ); - if (g.IO.KeyCtrl) - g.IO.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f; - if (g.IO.KeyShift) - g.IO.NavInputs[ImGuiNavInput_TweakFast] = 1.0f; - if (g.IO.KeyAlt && !g.IO.KeyCtrl) // AltGR is Alt+Ctrl, also even on keyboards without AltGR we don't want Alt+Ctrl to open menu. - g.IO.NavInputs[ImGuiNavInput_KeyMenu_] = 1.0f; - #undef NAV_MAP_KEY - } - memcpy(g.IO.NavInputsDownDurationPrev, g.IO.NavInputsDownDuration, sizeof(g.IO.NavInputsDownDuration)); - for (int i = 0; i < IM_ARRAYSIZE(g.IO.NavInputs); i++) - g.IO.NavInputsDownDuration[i] = (g.IO.NavInputs[i] > 0.0f) ? (g.IO.NavInputsDownDuration[i] < 0.0f ? 0.0f : g.IO.NavInputsDownDuration[i] + g.IO.DeltaTime) : -1.0f; - - // Process navigation init request (select first/default focus) - // In very rare cases g.NavWindow may be null (e.g. clearing focus after requesting an init request, which does happen when releasing Alt while clicking on void) - if (g.NavInitResultId != 0 && (!g.NavDisableHighlight || g.NavInitRequestFromMove) && g.NavWindow) - { - // Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called) - //IMGUI_DEBUG_LOG("[Nav] Apply NavInitRequest result: 0x%08X Layer %d in \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name); - if (g.NavInitRequestFromMove) - SetNavIDWithRectRel(g.NavInitResultId, g.NavLayer, 0, g.NavInitResultRectRel); - else - SetNavID(g.NavInitResultId, g.NavLayer, 0); - g.NavWindow->NavRectRel[g.NavLayer] = g.NavInitResultRectRel; - } - g.NavInitRequest = false; - g.NavInitRequestFromMove = false; - g.NavInitResultId = 0; - g.NavJustMovedToId = 0; - - // Process navigation move request - if (g.NavMoveRequest) - NavUpdateMoveResult(); - - // When a forwarded move request failed, we restore the highlight that we disabled during the forward frame - if (g.NavMoveRequestForward == ImGuiNavForward_ForwardActive) - { - IM_ASSERT(g.NavMoveRequest); - if (g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0) - g.NavDisableHighlight = false; - g.NavMoveRequestForward = ImGuiNavForward_None; - } - - // Apply application mouse position movement, after we had a chance to process move request result. - if (g.NavMousePosDirty && g.NavIdIsAlive) - { - // Set mouse position given our knowledge of the navigated item position from last frame - if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (g.IO.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) - { - if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow) - { - g.IO.MousePos = g.IO.MousePosPrev = NavCalcPreferredRefPos(); - g.IO.WantSetMousePos = true; - } - } - g.NavMousePosDirty = false; - } - g.NavIdIsAlive = false; - g.NavJustTabbedId = 0; - IM_ASSERT(g.NavLayer == 0 || g.NavLayer == 1); - - // Store our return window (for returning from Layer 1 to Layer 0) and clear it as soon as we step back in our own Layer 0 - if (g.NavWindow) - NavSaveLastChildNavWindowIntoParent(g.NavWindow); - if (g.NavWindow && g.NavWindow->NavLastChildNavWindow != NULL && g.NavLayer == ImGuiNavLayer_Main) - g.NavWindow->NavLastChildNavWindow = NULL; - - // Update CTRL+TAB and Windowing features (hold Square to move/resize/etc.) - NavUpdateWindowing(); - - // Set output flags for user application - g.IO.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs); - g.IO.NavVisible = (g.IO.NavActive && g.NavId != 0 && !g.NavDisableHighlight) || (g.NavWindowingTarget != NULL); - - // Process NavCancel input (to close a popup, get back to parent, clear focus) - if (IsNavInputTest(ImGuiNavInput_Cancel, ImGuiInputReadMode_Pressed)) - { - if (g.ActiveId != 0) - { - if (!IsActiveIdUsingNavInput(ImGuiNavInput_Cancel)) - ClearActiveID(); - } - else if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow) && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow) - { - // Exit child window - ImGuiWindow* child_window = g.NavWindow; - ImGuiWindow* parent_window = g.NavWindow->ParentWindow; - IM_ASSERT(child_window->ChildId != 0); - FocusWindow(parent_window); - SetNavID(child_window->ChildId, 0, 0); - // Reassigning with same value, we're being explicit here. - g.NavIdIsAlive = false; // -V1048 - if (g.NavDisableMouseHover) - g.NavMousePosDirty = true; - } - else if (g.OpenPopupStack.Size > 0) - { - // Close open popup/menu - if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) - ClosePopupToLevel(g.OpenPopupStack.Size - 1, true); - } - else if (g.NavLayer != ImGuiNavLayer_Main) - { - // Leave the "menu" layer - NavRestoreLayer(ImGuiNavLayer_Main); - } - else - { - // Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were - if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow))) - g.NavWindow->NavLastIds[0] = 0; - g.NavId = g.NavFocusScopeId = 0; - } - } - - // Process manual activation request - g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavInputId = 0; - if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) - { - bool activate_down = IsNavInputDown(ImGuiNavInput_Activate); - bool activate_pressed = activate_down && IsNavInputTest(ImGuiNavInput_Activate, ImGuiInputReadMode_Pressed); - if (g.ActiveId == 0 && activate_pressed) - g.NavActivateId = g.NavId; - if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_down) - g.NavActivateDownId = g.NavId; - if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_pressed) - g.NavActivatePressedId = g.NavId; - if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && IsNavInputTest(ImGuiNavInput_Input, ImGuiInputReadMode_Pressed)) - g.NavInputId = g.NavId; - } - if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) - g.NavDisableHighlight = true; - if (g.NavActivateId != 0) - IM_ASSERT(g.NavActivateDownId == g.NavActivateId); - g.NavMoveRequest = false; - - // Process programmatic activation request - if (g.NavNextActivateId != 0) - g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavInputId = g.NavNextActivateId; - g.NavNextActivateId = 0; - - // Initiate directional inputs request - if (g.NavMoveRequestForward == ImGuiNavForward_None) - { - g.NavMoveDir = ImGuiDir_None; - g.NavMoveRequestFlags = ImGuiNavMoveFlags_None; - if (g.NavWindow && !g.NavWindowingTarget && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) - { - const ImGuiInputReadMode read_mode = ImGuiInputReadMode_Repeat; - if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && (IsNavInputTest(ImGuiNavInput_DpadLeft, read_mode) || IsNavInputTest(ImGuiNavInput_KeyLeft_, read_mode))) { g.NavMoveDir = ImGuiDir_Left; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && (IsNavInputTest(ImGuiNavInput_DpadRight, read_mode) || IsNavInputTest(ImGuiNavInput_KeyRight_, read_mode))) { g.NavMoveDir = ImGuiDir_Right; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && (IsNavInputTest(ImGuiNavInput_DpadUp, read_mode) || IsNavInputTest(ImGuiNavInput_KeyUp_, read_mode))) { g.NavMoveDir = ImGuiDir_Up; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && (IsNavInputTest(ImGuiNavInput_DpadDown, read_mode) || IsNavInputTest(ImGuiNavInput_KeyDown_, read_mode))) { g.NavMoveDir = ImGuiDir_Down; } - } - g.NavMoveClipDir = g.NavMoveDir; - } - else - { - // Forwarding previous request (which has been modified, e.g. wrap around menus rewrite the requests with a starting rectangle at the other side of the window) - // (Preserve g.NavMoveRequestFlags, g.NavMoveClipDir which were set by the NavMoveRequestForward() function) - IM_ASSERT(g.NavMoveDir != ImGuiDir_None && g.NavMoveClipDir != ImGuiDir_None); - IM_ASSERT(g.NavMoveRequestForward == ImGuiNavForward_ForwardQueued); - g.NavMoveRequestForward = ImGuiNavForward_ForwardActive; - } - - // Update PageUp/PageDown/Home/End scroll - // FIXME-NAV: Consider enabling those keys even without the master ImGuiConfigFlags_NavEnableKeyboard flag? - float nav_scoring_rect_offset_y = 0.0f; - if (nav_keyboard_active) - nav_scoring_rect_offset_y = NavUpdatePageUpPageDown(); - - // If we initiate a movement request and have no current NavId, we initiate a InitDefautRequest that will be used as a fallback if the direction fails to find a match - if (g.NavMoveDir != ImGuiDir_None) - { - g.NavMoveRequest = true; - g.NavMoveRequestKeyMods = g.IO.KeyMods; - g.NavMoveDirLast = g.NavMoveDir; - } - if (g.NavMoveRequest && g.NavId == 0) - { - //IMGUI_DEBUG_LOG("[Nav] NavInitRequest from move, window \"%s\", layer=%d\n", g.NavWindow->Name, g.NavLayer); - g.NavInitRequest = g.NavInitRequestFromMove = true; - // Reassigning with same value, we're being explicit here. - g.NavInitResultId = 0; // -V1048 - g.NavDisableHighlight = false; - } - NavUpdateAnyRequestFlag(); - - // Scrolling - if (g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.NavWindowingTarget) - { - // *Fallback* manual-scroll with Nav directional keys when window has no navigable item - ImGuiWindow* window = g.NavWindow; - const float scroll_speed = IM_ROUND(window->CalcFontSize() * 100 * g.IO.DeltaTime); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported. - if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll && g.NavMoveRequest) - { - if (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) - SetScrollX(window, ImFloor(window->Scroll.x + ((g.NavMoveDir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed)); - if (g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) - SetScrollY(window, ImFloor(window->Scroll.y + ((g.NavMoveDir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed)); - } - - // *Normal* Manual scroll with NavScrollXXX keys - // Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds. - ImVec2 scroll_dir = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down, 1.0f/10.0f, 10.0f); - if (scroll_dir.x != 0.0f && window->ScrollbarX) - { - SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed)); - g.NavMoveFromClampedRefRect = true; - } - if (scroll_dir.y != 0.0f) - { - SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed)); - g.NavMoveFromClampedRefRect = true; - } - } - - // Reset search results - g.NavMoveResultLocal.Clear(); - g.NavMoveResultLocalVisibleSet.Clear(); - g.NavMoveResultOther.Clear(); - - // When we have manually scrolled (without using navigation) and NavId becomes out of bounds, we project its bounding box to the visible area to restart navigation within visible items - if (g.NavMoveRequest && g.NavMoveFromClampedRefRect && g.NavLayer == ImGuiNavLayer_Main) - { - ImGuiWindow* window = g.NavWindow; - ImRect window_rect_rel(window->InnerRect.Min - window->Pos - ImVec2(1,1), window->InnerRect.Max - window->Pos + ImVec2(1,1)); - if (!window_rect_rel.Contains(window->NavRectRel[g.NavLayer])) - { - float pad = window->CalcFontSize() * 0.5f; - window_rect_rel.Expand(ImVec2(-ImMin(window_rect_rel.GetWidth(), pad), -ImMin(window_rect_rel.GetHeight(), pad))); // Terrible approximation for the intent of starting navigation from first fully visible item - window->NavRectRel[g.NavLayer].ClipWith(window_rect_rel); - g.NavId = g.NavFocusScopeId = 0; - } - g.NavMoveFromClampedRefRect = false; - } - - // For scoring we use a single segment on the left side our current item bounding box (not touching the edge to avoid box overlap with zero-spaced items) - ImRect nav_rect_rel = (g.NavWindow && !g.NavWindow->NavRectRel[g.NavLayer].IsInverted()) ? g.NavWindow->NavRectRel[g.NavLayer] : ImRect(0,0,0,0); - g.NavScoringRect = g.NavWindow ? ImRect(g.NavWindow->Pos + nav_rect_rel.Min, g.NavWindow->Pos + nav_rect_rel.Max) : GetViewportRect(); - g.NavScoringRect.TranslateY(nav_scoring_rect_offset_y); - g.NavScoringRect.Min.x = ImMin(g.NavScoringRect.Min.x + 1.0f, g.NavScoringRect.Max.x); - g.NavScoringRect.Max.x = g.NavScoringRect.Min.x; - IM_ASSERT(!g.NavScoringRect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem(). - //GetForegroundDrawList()->AddRect(g.NavScoringRectScreen.Min, g.NavScoringRectScreen.Max, IM_COL32(255,200,0,255)); // [DEBUG] - g.NavScoringCount = 0; -#if IMGUI_DEBUG_NAV_RECTS - if (g.NavWindow) - { - ImDrawList* draw_list = GetForegroundDrawList(g.NavWindow); - if (1) { for (int layer = 0; layer < 2; layer++) draw_list->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG] - if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); } - } -#endif -} - -// Apply result from previous frame navigation directional move request -static void ImGui::NavUpdateMoveResult() -{ - ImGuiContext& g = *GImGui; - if (g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0) - { - // In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result) - if (g.NavId != 0) - { - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; - } - return; - } - - // Select which result to use - ImGuiNavMoveResult* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; - - // PageUp/PageDown behavior first jumps to the bottom/top mostly visible item, _otherwise_ use the result from the previous/next page. - if (g.NavMoveRequestFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) - if (g.NavMoveResultLocalVisibleSet.ID != 0 && g.NavMoveResultLocalVisibleSet.ID != g.NavId) - result = &g.NavMoveResultLocalVisibleSet; - - // Maybe entering a flattened child from the outside? In this case solve the tie using the regular scoring rules. - if (result != &g.NavMoveResultOther && g.NavMoveResultOther.ID != 0 && g.NavMoveResultOther.Window->ParentWindow == g.NavWindow) - if ((g.NavMoveResultOther.DistBox < result->DistBox) || (g.NavMoveResultOther.DistBox == result->DistBox && g.NavMoveResultOther.DistCenter < result->DistCenter)) - result = &g.NavMoveResultOther; - IM_ASSERT(g.NavWindow && result->Window); - - // Scroll to keep newly navigated item fully into view. - if (g.NavLayer == ImGuiNavLayer_Main) - { - ImVec2 delta_scroll; - if (g.NavMoveRequestFlags & ImGuiNavMoveFlags_ScrollToEdge) - { - float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f; - delta_scroll.y = result->Window->Scroll.y - scroll_target; - SetScrollY(result->Window, scroll_target); - } - else - { - ImRect rect_abs = ImRect(result->RectRel.Min + result->Window->Pos, result->RectRel.Max + result->Window->Pos); - delta_scroll = ScrollToBringRectIntoView(result->Window, rect_abs); - } - - // Offset our result position so mouse position can be applied immediately after in NavUpdate() - result->RectRel.TranslateX(-delta_scroll.x); - result->RectRel.TranslateY(-delta_scroll.y); - } - - ClearActiveID(); - g.NavWindow = result->Window; - if (g.NavId != result->ID) - { - // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId) - g.NavJustMovedToId = result->ID; - g.NavJustMovedToFocusScopeId = result->FocusScopeId; - g.NavJustMovedToKeyMods = g.NavMoveRequestKeyMods; - } - SetNavIDWithRectRel(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel); - g.NavMoveFromClampedRefRect = false; -} - -// Handle PageUp/PageDown/Home/End keys -static float ImGui::NavUpdatePageUpPageDown() -{ - ImGuiContext& g = *GImGui; - if (g.NavMoveDir != ImGuiDir_None || g.NavWindow == NULL) - return 0.0f; - if ((g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL || g.NavLayer != ImGuiNavLayer_Main) - return 0.0f; - - ImGuiWindow* window = g.NavWindow; - const bool page_up_held = IsKeyDown(g.IO.KeyMap[ImGuiKey_PageUp]) && !IsActiveIdUsingKey(ImGuiKey_PageUp); - const bool page_down_held = IsKeyDown(g.IO.KeyMap[ImGuiKey_PageDown]) && !IsActiveIdUsingKey(ImGuiKey_PageDown); - const bool home_pressed = IsKeyPressed(g.IO.KeyMap[ImGuiKey_Home]) && !IsActiveIdUsingKey(ImGuiKey_Home); - const bool end_pressed = IsKeyPressed(g.IO.KeyMap[ImGuiKey_End]) && !IsActiveIdUsingKey(ImGuiKey_End); - if (page_up_held != page_down_held || home_pressed != end_pressed) // If either (not both) are pressed - { - if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll) - { - // Fallback manual-scroll when window has no navigable item - if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageUp], true)) - SetScrollY(window, window->Scroll.y - window->InnerRect.GetHeight()); - else if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageDown], true)) - SetScrollY(window, window->Scroll.y + window->InnerRect.GetHeight()); - else if (home_pressed) - SetScrollY(window, 0.0f); - else if (end_pressed) - SetScrollY(window, window->ScrollMax.y); - } - else - { - ImRect& nav_rect_rel = window->NavRectRel[g.NavLayer]; - const float page_offset_y = ImMax(0.0f, window->InnerRect.GetHeight() - window->CalcFontSize() * 1.0f + nav_rect_rel.GetHeight()); - float nav_scoring_rect_offset_y = 0.0f; - if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageUp], true)) - { - nav_scoring_rect_offset_y = -page_offset_y; - g.NavMoveDir = ImGuiDir_Down; // Because our scoring rect is offset up, we request the down direction (so we can always land on the last item) - g.NavMoveClipDir = ImGuiDir_Up; - g.NavMoveRequestFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet; - } - else if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageDown], true)) - { - nav_scoring_rect_offset_y = +page_offset_y; - g.NavMoveDir = ImGuiDir_Up; // Because our scoring rect is offset down, we request the up direction (so we can always land on the last item) - g.NavMoveClipDir = ImGuiDir_Down; - g.NavMoveRequestFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet; - } - else if (home_pressed) - { - // FIXME-NAV: handling of Home/End is assuming that the top/bottom most item will be visible with Scroll.y == 0/ScrollMax.y - // Scrolling will be handled via the ImGuiNavMoveFlags_ScrollToEdge flag, we don't scroll immediately to avoid scrolling happening before nav result. - // Preserve current horizontal position if we have any. - nav_rect_rel.Min.y = nav_rect_rel.Max.y = -window->Scroll.y; - if (nav_rect_rel.IsInverted()) - nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f; - g.NavMoveDir = ImGuiDir_Down; - g.NavMoveRequestFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge; - } - else if (end_pressed) - { - nav_rect_rel.Min.y = nav_rect_rel.Max.y = window->ScrollMax.y + window->SizeFull.y - window->Scroll.y; - if (nav_rect_rel.IsInverted()) - nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f; - g.NavMoveDir = ImGuiDir_Up; - g.NavMoveRequestFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge; - } - return nav_scoring_rect_offset_y; - } - } - return 0.0f; -} - -static int ImGui::FindWindowFocusIndex(ImGuiWindow* window) // FIXME-OPT O(N) -{ - ImGuiContext& g = *GImGui; - for (int i = g.WindowsFocusOrder.Size-1; i >= 0; i--) - if (g.WindowsFocusOrder[i] == window) - return i; - return -1; -} - -static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) // FIXME-OPT O(N) -{ - ImGuiContext& g = *GImGui; - for (int i = i_start; i >= 0 && i < g.WindowsFocusOrder.Size && i != i_stop; i += dir) - if (ImGui::IsWindowNavFocusable(g.WindowsFocusOrder[i])) - return g.WindowsFocusOrder[i]; - return NULL; -} - -static void NavUpdateWindowingHighlightWindow(int focus_change_dir) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.NavWindowingTarget); - if (g.NavWindowingTarget->Flags & ImGuiWindowFlags_Modal) - return; - - const int i_current = ImGui::FindWindowFocusIndex(g.NavWindowingTarget); - ImGuiWindow* window_target = FindWindowNavFocusable(i_current + focus_change_dir, -INT_MAX, focus_change_dir); - if (!window_target) - window_target = FindWindowNavFocusable((focus_change_dir < 0) ? (g.WindowsFocusOrder.Size - 1) : 0, i_current, focus_change_dir); - if (window_target) // Don't reset windowing target if there's a single window in the list - g.NavWindowingTarget = g.NavWindowingTargetAnim = window_target; - g.NavWindowingToggleLayer = false; -} - -// Windowing management mode -// Keyboard: CTRL+Tab (change focus/move/resize), Alt (toggle menu layer) -// Gamepad: Hold Menu/Square (change focus/move/resize), Tap Menu/Square (toggle menu layer) -static void ImGui::NavUpdateWindowing() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* apply_focus_window = NULL; - bool apply_toggle_layer = false; - - ImGuiWindow* modal_window = GetTopMostPopupModal(); - if (modal_window != NULL) - { - g.NavWindowingTarget = NULL; - return; - } - - // Fade out - if (g.NavWindowingTargetAnim && g.NavWindowingTarget == NULL) - { - g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha - g.IO.DeltaTime * 10.0f, 0.0f); - if (g.DimBgRatio <= 0.0f && g.NavWindowingHighlightAlpha <= 0.0f) - g.NavWindowingTargetAnim = NULL; - } - - // Start CTRL-TAB or Square+L/R window selection - bool start_windowing_with_gamepad = !g.NavWindowingTarget && IsNavInputTest(ImGuiNavInput_Menu, ImGuiInputReadMode_Pressed); - bool start_windowing_with_keyboard = !g.NavWindowingTarget && g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab) && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard); - if (start_windowing_with_gamepad || start_windowing_with_keyboard) - if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) - { - g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; // FIXME-DOCK: Will need to use RootWindowDockStop - g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f; - g.NavWindowingToggleLayer = start_windowing_with_keyboard ? false : true; - g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_NavKeyboard : ImGuiInputSource_NavGamepad; - } - - // Gamepad update - g.NavWindowingTimer += g.IO.DeltaTime; - if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_NavGamepad) - { - // Highlight only appears after a brief time holding the button, so that a fast tap on PadMenu (to toggle NavLayer) doesn't add visual noise - g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); - - // Select window to focus - const int focus_change_dir = (int)IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiInputReadMode_RepeatSlow) - (int)IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiInputReadMode_RepeatSlow); - if (focus_change_dir != 0) - { - NavUpdateWindowingHighlightWindow(focus_change_dir); - g.NavWindowingHighlightAlpha = 1.0f; - } - - // Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered top-most) - if (!IsNavInputDown(ImGuiNavInput_Menu)) - { - g.NavWindowingToggleLayer &= (g.NavWindowingHighlightAlpha < 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore. - if (g.NavWindowingToggleLayer && g.NavWindow) - apply_toggle_layer = true; - else if (!g.NavWindowingToggleLayer) - apply_focus_window = g.NavWindowingTarget; - g.NavWindowingTarget = NULL; - } - } - - // Keyboard: Focus - if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_NavKeyboard) - { - // Visuals only appears after a brief time after pressing TAB the first time, so that a fast CTRL+TAB doesn't add visual noise - g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // 1.0f - if (IsKeyPressedMap(ImGuiKey_Tab, true)) - NavUpdateWindowingHighlightWindow(g.IO.KeyShift ? +1 : -1); - if (!g.IO.KeyCtrl) - apply_focus_window = g.NavWindowingTarget; - } - - // Keyboard: Press and Release ALT to toggle menu layer - // FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB - if (IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Pressed)) - g.NavWindowingToggleLayer = true; - if ((g.ActiveId == 0 || g.ActiveIdAllowOverlap) && g.NavWindowingToggleLayer && IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Released)) - if (IsMousePosValid(&g.IO.MousePos) == IsMousePosValid(&g.IO.MousePosPrev)) - apply_toggle_layer = true; - - // Move window - if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove)) - { - ImVec2 move_delta; - if (g.NavInputSource == ImGuiInputSource_NavKeyboard && !g.IO.KeyShift) - move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); - if (g.NavInputSource == ImGuiInputSource_NavGamepad) - move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down); - if (move_delta.x != 0.0f || move_delta.y != 0.0f) - { - const float NAV_MOVE_SPEED = 800.0f; - const float move_speed = ImFloor(NAV_MOVE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); // FIXME: Doesn't code variable framerate very well - SetWindowPos(g.NavWindowingTarget->RootWindow, g.NavWindowingTarget->RootWindow->Pos + move_delta * move_speed, ImGuiCond_Always); - g.NavDisableMouseHover = true; - MarkIniSettingsDirty(g.NavWindowingTarget); - } - } - - // Apply final focus - if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow)) - { - ClearActiveID(); - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; - apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window); - ClosePopupsOverWindow(apply_focus_window, false); - FocusWindow(apply_focus_window); - if (apply_focus_window->NavLastIds[0] == 0) - NavInitWindow(apply_focus_window, false); - - // If the window only has a menu layer, select it directly - if (apply_focus_window->DC.NavLayerActiveMask == (1 << ImGuiNavLayer_Menu)) - g.NavLayer = ImGuiNavLayer_Menu; - } - if (apply_focus_window) - g.NavWindowingTarget = NULL; - - // Apply menu/layer toggle - if (apply_toggle_layer && g.NavWindow) - { - // Move to parent menu if necessary - ImGuiWindow* new_nav_window = g.NavWindow; - while (new_nav_window->ParentWindow - && (new_nav_window->DC.NavLayerActiveMask & (1 << ImGuiNavLayer_Menu)) == 0 - && (new_nav_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 - && (new_nav_window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) == 0) - new_nav_window = new_nav_window->ParentWindow; - if (new_nav_window != g.NavWindow) - { - ImGuiWindow* old_nav_window = g.NavWindow; - FocusWindow(new_nav_window); - new_nav_window->NavLastChildNavWindow = old_nav_window; - } - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; - - // When entering a regular menu bar with the Alt key, we always reinitialize the navigation ID. - const ImGuiNavLayer new_nav_layer = (g.NavWindow->DC.NavLayerActiveMask & (1 << ImGuiNavLayer_Menu)) ? (ImGuiNavLayer)((int)g.NavLayer ^ 1) : ImGuiNavLayer_Main; - NavRestoreLayer(new_nav_layer); - } -} - -// Window has already passed the IsWindowNavFocusable() -static const char* GetFallbackWindowNameForWindowingList(ImGuiWindow* window) -{ - if (window->Flags & ImGuiWindowFlags_Popup) - return "(Popup)"; - if ((window->Flags & ImGuiWindowFlags_MenuBar) && strcmp(window->Name, "##MainMenuBar") == 0) - return "(Main menu bar)"; - return "(Untitled)"; -} - -// Overlay displayed when using CTRL+TAB. Called by EndFrame(). -void ImGui::NavUpdateWindowingOverlay() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.NavWindowingTarget != NULL); - - if (g.NavWindowingTimer < NAV_WINDOWING_LIST_APPEAR_DELAY) - return; - - if (g.NavWindowingList == NULL) - g.NavWindowingList = FindWindowByName("###NavWindowingList"); - SetNextWindowSizeConstraints(ImVec2(g.IO.DisplaySize.x * 0.20f, g.IO.DisplaySize.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX)); - SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f)); - PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f); - Begin("###NavWindowingList", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings); - for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--) - { - ImGuiWindow* window = g.WindowsFocusOrder[n]; - if (!IsWindowNavFocusable(window)) - continue; - const char* label = window->Name; - if (label == FindRenderedTextEnd(label)) - label = GetFallbackWindowNameForWindowingList(window); - Selectable(label, g.NavWindowingTarget == window); - } - End(); - PopStyleVar(); -} - -//----------------------------------------------------------------------------- -// [SECTION] DRAG AND DROP -//----------------------------------------------------------------------------- - -void ImGui::ClearDragDrop() -{ - ImGuiContext& g = *GImGui; - g.DragDropActive = false; - g.DragDropPayload.Clear(); - g.DragDropAcceptFlags = ImGuiDragDropFlags_None; - g.DragDropAcceptIdCurr = g.DragDropAcceptIdPrev = 0; - g.DragDropAcceptIdCurrRectSurface = FLT_MAX; - g.DragDropAcceptFrameCount = -1; - - g.DragDropPayloadBufHeap.clear(); - memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal)); -} - -// Call when current ID is active. -// When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource() -bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - bool source_drag_active = false; - ImGuiID source_id = 0; - ImGuiID source_parent_id = 0; - ImGuiMouseButton mouse_button = ImGuiMouseButton_Left; - if (!(flags & ImGuiDragDropFlags_SourceExtern)) - { - source_id = window->DC.LastItemId; - if (source_id != 0 && g.ActiveId != source_id) // Early out for most common case - return false; - if (g.IO.MouseDown[mouse_button] == false) - return false; - - if (source_id == 0) - { - // If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to: - // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag, C) Swallow your programmer pride. - if (!(flags & ImGuiDragDropFlags_SourceAllowNullID)) - { - IM_ASSERT(0); - return false; - } - - // Early out - if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) == 0 && (g.ActiveId == 0 || g.ActiveIdWindow != window)) - return false; - - // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image() - // We build a throwaway ID based on current ID stack + relative AABB of items in window. - // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled. - // We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive. - source_id = window->DC.LastItemId = window->GetIDFromRectangle(window->DC.LastItemRect); - bool is_hovered = ItemHoverable(window->DC.LastItemRect, source_id); - if (is_hovered && g.IO.MouseClicked[mouse_button]) - { - SetActiveID(source_id, window); - FocusWindow(window); - } - if (g.ActiveId == source_id) // Allow the underlying widget to display/return hovered during the mouse release frame, else we would get a flicker. - g.ActiveIdAllowOverlap = is_hovered; - } - else - { - g.ActiveIdAllowOverlap = false; - } - if (g.ActiveId != source_id) - return false; - source_parent_id = window->IDStack.back(); - source_drag_active = IsMouseDragging(mouse_button); - - // Disable navigation and key inputs while dragging - g.ActiveIdUsingNavDirMask = ~(ImU32)0; - g.ActiveIdUsingNavInputMask = ~(ImU32)0; - g.ActiveIdUsingKeyInputMask = ~(ImU64)0; - } - else - { - window = NULL; - source_id = ImHashStr("#SourceExtern"); - source_drag_active = true; - } - - if (source_drag_active) - { - if (!g.DragDropActive) - { - IM_ASSERT(source_id != 0); - ClearDragDrop(); - ImGuiPayload& payload = g.DragDropPayload; - payload.SourceId = source_id; - payload.SourceParentId = source_parent_id; - g.DragDropActive = true; - g.DragDropSourceFlags = flags; - g.DragDropMouseButton = mouse_button; - } - g.DragDropSourceFrameCount = g.FrameCount; - g.DragDropWithinSource = true; - - if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) - { - // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit) - // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents. - BeginTooltip(); - if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip)) - { - ImGuiWindow* tooltip_window = g.CurrentWindow; - tooltip_window->SkipItems = true; - tooltip_window->HiddenFramesCanSkipItems = 1; - } - } - - if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern)) - window->DC.LastItemStatusFlags &= ~ImGuiItemStatusFlags_HoveredRect; - - return true; - } - return false; -} - -void ImGui::EndDragDropSource() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.DragDropActive); - IM_ASSERT(g.DragDropWithinSource && "Not after a BeginDragDropSource()?"); - - if (!(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) - EndTooltip(); - - // Discard the drag if have not called SetDragDropPayload() - if (g.DragDropPayload.DataFrameCount == -1) - ClearDragDrop(); - g.DragDropWithinSource = false; -} - -// Use 'cond' to choose to submit payload on drag start or every frame -bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_size, ImGuiCond cond) -{ - ImGuiContext& g = *GImGui; - ImGuiPayload& payload = g.DragDropPayload; - if (cond == 0) - cond = ImGuiCond_Always; - - IM_ASSERT(type != NULL); - IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long"); - IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0)); - IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once); - IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() - - if (cond == ImGuiCond_Always || payload.DataFrameCount == -1) - { - // Copy payload - ImStrncpy(payload.DataType, type, IM_ARRAYSIZE(payload.DataType)); - g.DragDropPayloadBufHeap.resize(0); - if (data_size > sizeof(g.DragDropPayloadBufLocal)) - { - // Store in heap - g.DragDropPayloadBufHeap.resize((int)data_size); - payload.Data = g.DragDropPayloadBufHeap.Data; - memcpy(payload.Data, data, data_size); - } - else if (data_size > 0) - { - // Store locally - memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal)); - payload.Data = g.DragDropPayloadBufLocal; - memcpy(payload.Data, data, data_size); - } - else - { - payload.Data = NULL; - } - payload.DataSize = (int)data_size; - } - payload.DataFrameCount = g.FrameCount; - - return (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1); -} - -bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id) -{ - ImGuiContext& g = *GImGui; - if (!g.DragDropActive) - return false; - - ImGuiWindow* window = g.CurrentWindow; - if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) - return false; - IM_ASSERT(id != 0); - if (!IsMouseHoveringRect(bb.Min, bb.Max) || (id == g.DragDropPayload.SourceId)) - return false; - if (window->SkipItems) - return false; - - IM_ASSERT(g.DragDropWithinTarget == false); - g.DragDropTargetRect = bb; - g.DragDropTargetId = id; - g.DragDropWithinTarget = true; - return true; -} - -// We don't use BeginDragDropTargetCustom() and duplicate its code because: -// 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. -// 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. -// Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case) -bool ImGui::BeginDragDropTarget() -{ - ImGuiContext& g = *GImGui; - if (!g.DragDropActive) - return false; - - ImGuiWindow* window = g.CurrentWindow; - if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) - return false; - if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) - return false; - - const ImRect& display_rect = (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? window->DC.LastItemDisplayRect : window->DC.LastItemRect; - ImGuiID id = window->DC.LastItemId; - if (id == 0) - id = window->GetIDFromRectangle(display_rect); - if (g.DragDropPayload.SourceId == id) - return false; - - IM_ASSERT(g.DragDropWithinTarget == false); - g.DragDropTargetRect = display_rect; - g.DragDropTargetId = id; - g.DragDropWithinTarget = true; - return true; -} - -bool ImGui::IsDragDropPayloadBeingAccepted() -{ - ImGuiContext& g = *GImGui; - return g.DragDropActive && g.DragDropAcceptIdPrev != 0; -} - -const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImGuiPayload& payload = g.DragDropPayload; - IM_ASSERT(g.DragDropActive); // Not called between BeginDragDropTarget() and EndDragDropTarget() ? - IM_ASSERT(payload.DataFrameCount != -1); // Forgot to call EndDragDropTarget() ? - if (type != NULL && !payload.IsDataType(type)) - return NULL; - - // Accept smallest drag target bounding box, this allows us to nest drag targets conveniently without ordering constraints. - // NB: We currently accept NULL id as target. However, overlapping targets requires a unique ID to function! - const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId); - ImRect r = g.DragDropTargetRect; - float r_surface = r.GetWidth() * r.GetHeight(); - if (r_surface < g.DragDropAcceptIdCurrRectSurface) - { - g.DragDropAcceptFlags = flags; - g.DragDropAcceptIdCurr = g.DragDropTargetId; - g.DragDropAcceptIdCurrRectSurface = r_surface; - } - - // Render default drop visuals - payload.Preview = was_accepted_previously; - flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that lives for 1 frame) - if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview) - { - // FIXME-DRAG: Settle on a proper default visuals for drop target. - r.Expand(3.5f); - bool push_clip_rect = !window->ClipRect.Contains(r); - if (push_clip_rect) window->DrawList->PushClipRect(r.Min-ImVec2(1,1), r.Max+ImVec2(1,1)); - window->DrawList->AddRect(r.Min, r.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, ~0, 2.0f); - if (push_clip_rect) window->DrawList->PopClipRect(); - } - - g.DragDropAcceptFrameCount = g.FrameCount; - payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() - if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) - return NULL; - - return &payload; -} - -const ImGuiPayload* ImGui::GetDragDropPayload() -{ - ImGuiContext& g = *GImGui; - return g.DragDropActive ? &g.DragDropPayload : NULL; -} - -// We don't really use/need this now, but added it for the sake of consistency and because we might need it later. -void ImGui::EndDragDropTarget() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.DragDropActive); - IM_ASSERT(g.DragDropWithinTarget); - g.DragDropWithinTarget = false; -} - -//----------------------------------------------------------------------------- -// [SECTION] LOGGING/CAPTURING -//----------------------------------------------------------------------------- -// All text output from the interface can be captured into tty/file/clipboard. -// By default, tree nodes are automatically opened during logging. -//----------------------------------------------------------------------------- - -// Pass text data straight to log (without being displayed) -void ImGui::LogText(const char* fmt, ...) -{ - ImGuiContext& g = *GImGui; - if (!g.LogEnabled) - return; - - va_list args; - va_start(args, fmt); - if (g.LogFile) - { - g.LogBuffer.Buf.resize(0); - g.LogBuffer.appendfv(fmt, args); - ImFileWrite(g.LogBuffer.c_str(), sizeof(char), (ImU64)g.LogBuffer.size(), g.LogFile); - } - else - { - g.LogBuffer.appendfv(fmt, args); - } - va_end(args); -} - -// Internal version that takes a position to decide on newline placement and pad items according to their depth. -// We split text into individual lines to add current tree level padding -void ImGui::LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - if (!text_end) - text_end = FindRenderedTextEnd(text, text_end); - - const bool log_new_line = ref_pos && (ref_pos->y > g.LogLinePosY + 1); - if (ref_pos) - g.LogLinePosY = ref_pos->y; - if (log_new_line) - g.LogLineFirstItem = true; - - const char* text_remaining = text; - if (g.LogDepthRef > window->DC.TreeDepth) // Re-adjust padding if we have popped out of our starting depth - g.LogDepthRef = window->DC.TreeDepth; - const int tree_depth = (window->DC.TreeDepth - g.LogDepthRef); - for (;;) - { - // Split the string. Each new line (after a '\n') is followed by spacing corresponding to the current depth of our log entry. - // We don't add a trailing \n to allow a subsequent item on the same line to be captured. - const char* line_start = text_remaining; - const char* line_end = ImStreolRange(line_start, text_end); - const bool is_first_line = (line_start == text); - const bool is_last_line = (line_end == text_end); - if (!is_last_line || (line_start != line_end)) - { - const int char_count = (int)(line_end - line_start); - if (log_new_line || !is_first_line) - LogText(IM_NEWLINE "%*s%.*s", tree_depth * 4, "", char_count, line_start); - else if (g.LogLineFirstItem) - LogText("%*s%.*s", tree_depth * 4, "", char_count, line_start); - else - LogText(" %.*s", char_count, line_start); - g.LogLineFirstItem = false; - } - else if (log_new_line) - { - // An empty "" string at a different Y position should output a carriage return. - LogText(IM_NEWLINE); - break; - } - - if (is_last_line) - break; - text_remaining = line_end + 1; - } -} - -// Start logging/capturing text output -void ImGui::LogBegin(ImGuiLogType type, int auto_open_depth) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - IM_ASSERT(g.LogEnabled == false); - IM_ASSERT(g.LogFile == NULL); - IM_ASSERT(g.LogBuffer.empty()); - g.LogEnabled = true; - g.LogType = type; - g.LogDepthRef = window->DC.TreeDepth; - g.LogDepthToExpand = ((auto_open_depth >= 0) ? auto_open_depth : g.LogDepthToExpandDefault); - g.LogLinePosY = FLT_MAX; - g.LogLineFirstItem = true; -} - -void ImGui::LogToTTY(int auto_open_depth) -{ - ImGuiContext& g = *GImGui; - if (g.LogEnabled) - return; - IM_UNUSED(auto_open_depth); -#ifndef IMGUI_DISABLE_TTY_FUNCTIONS - LogBegin(ImGuiLogType_TTY, auto_open_depth); - g.LogFile = stdout; -#endif -} - -// Start logging/capturing text output to given file -void ImGui::LogToFile(int auto_open_depth, const char* filename) -{ - ImGuiContext& g = *GImGui; - if (g.LogEnabled) - return; - - // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still - // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. - // By opening the file in binary mode "ab" we have consistent output everywhere. - if (!filename) - filename = g.IO.LogFilename; - if (!filename || !filename[0]) - return; - ImFileHandle f = ImFileOpen(filename, "ab"); - if (!f) - { - IM_ASSERT(0); - return; - } - - LogBegin(ImGuiLogType_File, auto_open_depth); - g.LogFile = f; -} - -// Start logging/capturing text output to clipboard -void ImGui::LogToClipboard(int auto_open_depth) -{ - ImGuiContext& g = *GImGui; - if (g.LogEnabled) - return; - LogBegin(ImGuiLogType_Clipboard, auto_open_depth); -} - -void ImGui::LogToBuffer(int auto_open_depth) -{ - ImGuiContext& g = *GImGui; - if (g.LogEnabled) - return; - LogBegin(ImGuiLogType_Buffer, auto_open_depth); -} - -void ImGui::LogFinish() -{ - ImGuiContext& g = *GImGui; - if (!g.LogEnabled) - return; - - LogText(IM_NEWLINE); - switch (g.LogType) - { - case ImGuiLogType_TTY: -#ifndef IMGUI_DISABLE_TTY_FUNCTIONS - fflush(g.LogFile); -#endif - break; - case ImGuiLogType_File: - ImFileClose(g.LogFile); - break; - case ImGuiLogType_Buffer: - break; - case ImGuiLogType_Clipboard: - if (!g.LogBuffer.empty()) - SetClipboardText(g.LogBuffer.begin()); - break; - case ImGuiLogType_None: - IM_ASSERT(0); - break; - } - - g.LogEnabled = false; - g.LogType = ImGuiLogType_None; - g.LogFile = NULL; - g.LogBuffer.clear(); -} - -// Helper to display logging buttons -// FIXME-OBSOLETE: We should probably obsolete this and let the user have their own helper (this is one of the oldest function alive!) -void ImGui::LogButtons() -{ - ImGuiContext& g = *GImGui; - - PushID("LogButtons"); -#ifndef IMGUI_DISABLE_TTY_FUNCTIONS - const bool log_to_tty = Button("Log To TTY"); SameLine(); -#else - const bool log_to_tty = false; -#endif - const bool log_to_file = Button("Log To File"); SameLine(); - const bool log_to_clipboard = Button("Log To Clipboard"); SameLine(); - PushAllowKeyboardFocus(false); - SetNextItemWidth(80.0f); - SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL); - PopAllowKeyboardFocus(); - PopID(); - - // Start logging at the end of the function so that the buttons don't appear in the log - if (log_to_tty) - LogToTTY(); - if (log_to_file) - LogToFile(); - if (log_to_clipboard) - LogToClipboard(); -} - -//----------------------------------------------------------------------------- -// [SECTION] SETTINGS -//----------------------------------------------------------------------------- - -// Called by NewFrame() -void ImGui::UpdateSettings() -{ - // Load settings on first frame (if not explicitly loaded manually before) - ImGuiContext& g = *GImGui; - if (!g.SettingsLoaded) - { - IM_ASSERT(g.SettingsWindows.empty()); - if (g.IO.IniFilename) - LoadIniSettingsFromDisk(g.IO.IniFilename); - g.SettingsLoaded = true; - } - - // Save settings (with a delay after the last modification, so we don't spam disk too much) - if (g.SettingsDirtyTimer > 0.0f) - { - g.SettingsDirtyTimer -= g.IO.DeltaTime; - if (g.SettingsDirtyTimer <= 0.0f) - { - if (g.IO.IniFilename != NULL) - SaveIniSettingsToDisk(g.IO.IniFilename); - else - g.IO.WantSaveIniSettings = true; // Let user know they can call SaveIniSettingsToMemory(). user will need to clear io.WantSaveIniSettings themselves. - g.SettingsDirtyTimer = 0.0f; - } - } -} - -void ImGui::MarkIniSettingsDirty() -{ - ImGuiContext& g = *GImGui; - if (g.SettingsDirtyTimer <= 0.0f) - g.SettingsDirtyTimer = g.IO.IniSavingRate; -} - -void ImGui::MarkIniSettingsDirty(ImGuiWindow* window) -{ - ImGuiContext& g = *GImGui; - if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings)) - if (g.SettingsDirtyTimer <= 0.0f) - g.SettingsDirtyTimer = g.IO.IniSavingRate; -} - -ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) -{ - ImGuiContext& g = *GImGui; - -#if !IMGUI_DEBUG_INI_SETTINGS - // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() - // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier. - if (const char* p = strstr(name, "###")) - name = p; -#endif - const size_t name_len = strlen(name); - - // Allocate chunk - const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; - ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); - IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); - settings->ID = ImHashStr(name, name_len); - memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator - - return settings; -} - -ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) - if (settings->ID == id) - return settings; - return NULL; -} - -ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name) -{ - if (ImGuiWindowSettings* settings = FindWindowSettings(ImHashStr(name))) - return settings; - return CreateNewWindowSettings(name); -} - -void ImGui::LoadIniSettingsFromDisk(const char* ini_filename) -{ - size_t file_data_size = 0; - char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_data_size); - if (!file_data) - return; - LoadIniSettingsFromMemory(file_data, (size_t)file_data_size); - IM_FREE(file_data); -} - -ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name) -{ - ImGuiContext& g = *GImGui; - const ImGuiID type_hash = ImHashStr(type_name); - for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++) - if (g.SettingsHandlers[handler_n].TypeHash == type_hash) - return &g.SettingsHandlers[handler_n]; - return NULL; -} - -// Zero-tolerance, no error reporting, cheap .ini parsing -void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(g.Initialized); - IM_ASSERT(g.SettingsLoaded == false && g.FrameCount == 0); - - // For user convenience, we allow passing a non zero-terminated string (hence the ini_size parameter). - // For our convenience and to make the code simpler, we'll also write zero-terminators within the buffer. So let's create a writable copy.. - if (ini_size == 0) - ini_size = strlen(ini_data); - char* buf = (char*)IM_ALLOC(ini_size + 1); - char* buf_end = buf + ini_size; - memcpy(buf, ini_data, ini_size); - buf[ini_size] = 0; - - void* entry_data = NULL; - ImGuiSettingsHandler* entry_handler = NULL; - - char* line_end = NULL; - for (char* line = buf; line < buf_end; line = line_end + 1) - { - // Skip new lines markers, then find end of the line - while (*line == '\n' || *line == '\r') - line++; - line_end = line; - while (line_end < buf_end && *line_end != '\n' && *line_end != '\r') - line_end++; - line_end[0] = 0; - if (line[0] == ';') - continue; - if (line[0] == '[' && line_end > line && line_end[-1] == ']') - { - // Parse "[Type][Name]". Note that 'Name' can itself contains [] characters, which is acceptable with the current format and parsing code. - line_end[-1] = 0; - const char* name_end = line_end - 1; - const char* type_start = line + 1; - char* type_end = (char*)(void*)ImStrchrRange(type_start, name_end, ']'); - const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL; - if (!type_end || !name_start) - continue; - *type_end = 0; // Overwrite first ']' - name_start++; // Skip second '[' - entry_handler = FindSettingsHandler(type_start); - entry_data = entry_handler ? entry_handler->ReadOpenFn(&g, entry_handler, name_start) : NULL; - } - else if (entry_handler != NULL && entry_data != NULL) - { - // Let type handler parse the line - entry_handler->ReadLineFn(&g, entry_handler, entry_data, line); - } - } - IM_FREE(buf); - g.SettingsLoaded = true; -} - -void ImGui::SaveIniSettingsToDisk(const char* ini_filename) -{ - ImGuiContext& g = *GImGui; - g.SettingsDirtyTimer = 0.0f; - if (!ini_filename) - return; - - size_t ini_data_size = 0; - const char* ini_data = SaveIniSettingsToMemory(&ini_data_size); - ImFileHandle f = ImFileOpen(ini_filename, "wt"); - if (!f) - return; - ImFileWrite(ini_data, sizeof(char), ini_data_size, f); - ImFileClose(f); -} - -// Call registered handlers (e.g. SettingsHandlerWindow_WriteAll() + custom handlers) to write their stuff into a text buffer -const char* ImGui::SaveIniSettingsToMemory(size_t* out_size) -{ - ImGuiContext& g = *GImGui; - g.SettingsDirtyTimer = 0.0f; - g.SettingsIniData.Buf.resize(0); - g.SettingsIniData.Buf.push_back(0); - for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++) - { - ImGuiSettingsHandler* handler = &g.SettingsHandlers[handler_n]; - handler->WriteAllFn(&g, handler, &g.SettingsIniData); - } - if (out_size) - *out_size = (size_t)g.SettingsIniData.size(); - return g.SettingsIniData.c_str(); -} - -static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name) -{ - ImGuiWindowSettings* settings = ImGui::FindWindowSettings(ImHashStr(name)); - if (!settings) - settings = ImGui::CreateNewWindowSettings(name); - return (void*)settings; -} - -static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line) -{ - ImGuiWindowSettings* settings = (ImGuiWindowSettings*)entry; - int x, y; - int i; - if (sscanf(line, "Pos=%i,%i", &x, &y) == 2) settings->Pos = ImVec2ih((short)x, (short)y); - else if (sscanf(line, "Size=%i,%i", &x, &y) == 2) settings->Size = ImVec2ih((short)x, (short)y); - else if (sscanf(line, "Collapsed=%d", &i) == 1) settings->Collapsed = (i != 0); -} - -static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf) -{ - // Gather data from windows that were active during this session - // (if a window wasn't opened in this session we preserve its settings) - ImGuiContext& g = *ctx; - for (int i = 0; i != g.Windows.Size; i++) - { - ImGuiWindow* window = g.Windows[i]; - if (window->Flags & ImGuiWindowFlags_NoSavedSettings) - continue; - - ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID); - if (!settings) - { - settings = ImGui::CreateNewWindowSettings(window->Name); - window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); - } - IM_ASSERT(settings->ID == window->ID); - settings->Pos = ImVec2ih((short)window->Pos.x, (short)window->Pos.y); - settings->Size = ImVec2ih((short)window->SizeFull.x, (short)window->SizeFull.y); - settings->Collapsed = window->Collapsed; - } - - // Write to text buffer - buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve - for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) - { - const char* settings_name = settings->GetName(); - buf->appendf("[%s][%s]\n", handler->TypeName, settings_name); - buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y); - buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y); - buf->appendf("Collapsed=%d\n", settings->Collapsed); - buf->append("\n"); - } -} - - -//----------------------------------------------------------------------------- -// [SECTION] VIEWPORTS, PLATFORM WINDOWS -//----------------------------------------------------------------------------- - -// (this section is filled in the 'docking' branch) - - -//----------------------------------------------------------------------------- -// [SECTION] DOCKING -//----------------------------------------------------------------------------- - -// (this section is filled in the 'docking' branch) - - -//----------------------------------------------------------------------------- -// [SECTION] PLATFORM DEPENDENT HELPERS -//----------------------------------------------------------------------------- - -#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) - -#ifdef _MSC_VER -#pragma comment(lib, "user32") -#pragma comment(lib, "kernel32") -#endif - -// Win32 clipboard implementation -// We use g.ClipboardHandlerData for temporary storage to ensure it is freed on Shutdown() -static const char* GetClipboardTextFn_DefaultImpl(void*) -{ - ImGuiContext& g = *GImGui; - g.ClipboardHandlerData.clear(); - if (!::OpenClipboard(NULL)) - return NULL; - HANDLE wbuf_handle = ::GetClipboardData(CF_UNICODETEXT); - if (wbuf_handle == NULL) - { - ::CloseClipboard(); - return NULL; - } - if (const WCHAR* wbuf_global = (const WCHAR*)::GlobalLock(wbuf_handle)) - { - int buf_len = ::WideCharToMultiByte(CP_UTF8, 0, wbuf_global, -1, NULL, 0, NULL, NULL); - g.ClipboardHandlerData.resize(buf_len); - ::WideCharToMultiByte(CP_UTF8, 0, wbuf_global, -1, g.ClipboardHandlerData.Data, buf_len, NULL, NULL); - } - ::GlobalUnlock(wbuf_handle); - ::CloseClipboard(); - return g.ClipboardHandlerData.Data; -} - -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) -{ - if (!::OpenClipboard(NULL)) - return; - const int wbuf_length = ::MultiByteToWideChar(CP_UTF8, 0, text, -1, NULL, 0); - HGLOBAL wbuf_handle = ::GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length * sizeof(WCHAR)); - if (wbuf_handle == NULL) - { - ::CloseClipboard(); - return; - } - WCHAR* wbuf_global = (WCHAR*)::GlobalLock(wbuf_handle); - ::MultiByteToWideChar(CP_UTF8, 0, text, -1, wbuf_global, wbuf_length); - ::GlobalUnlock(wbuf_handle); - ::EmptyClipboard(); - if (::SetClipboardData(CF_UNICODETEXT, wbuf_handle) == NULL) - ::GlobalFree(wbuf_handle); - ::CloseClipboard(); -} - -#elif defined(__APPLE__) && TARGET_OS_OSX && defined(IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS) - -#include // Use old API to avoid need for separate .mm file -static PasteboardRef main_clipboard = 0; - -// OSX clipboard implementation -// If you enable this you will need to add '-framework ApplicationServices' to your linker command-line! -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) -{ - if (!main_clipboard) - PasteboardCreate(kPasteboardClipboard, &main_clipboard); - PasteboardClear(main_clipboard); - CFDataRef cf_data = CFDataCreate(kCFAllocatorDefault, (const UInt8*)text, strlen(text)); - if (cf_data) - { - PasteboardPutItemFlavor(main_clipboard, (PasteboardItemID)1, CFSTR("public.utf8-plain-text"), cf_data, 0); - CFRelease(cf_data); - } -} - -static const char* GetClipboardTextFn_DefaultImpl(void*) -{ - if (!main_clipboard) - PasteboardCreate(kPasteboardClipboard, &main_clipboard); - PasteboardSynchronize(main_clipboard); - - ItemCount item_count = 0; - PasteboardGetItemCount(main_clipboard, &item_count); - for (ItemCount i = 0; i < item_count; i++) - { - PasteboardItemID item_id = 0; - PasteboardGetItemIdentifier(main_clipboard, i + 1, &item_id); - CFArrayRef flavor_type_array = 0; - PasteboardCopyItemFlavors(main_clipboard, item_id, &flavor_type_array); - for (CFIndex j = 0, nj = CFArrayGetCount(flavor_type_array); j < nj; j++) - { - CFDataRef cf_data; - if (PasteboardCopyItemFlavorData(main_clipboard, item_id, CFSTR("public.utf8-plain-text"), &cf_data) == noErr) - { - ImGuiContext& g = *GImGui; - g.ClipboardHandlerData.clear(); - int length = (int)CFDataGetLength(cf_data); - g.ClipboardHandlerData.resize(length + 1); - CFDataGetBytes(cf_data, CFRangeMake(0, length), (UInt8*)g.ClipboardHandlerData.Data); - g.ClipboardHandlerData[length] = 0; - CFRelease(cf_data); - return g.ClipboardHandlerData.Data; - } - } - } - return NULL; -} - -#else - -// Local Dear ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers. -static const char* GetClipboardTextFn_DefaultImpl(void*) -{ - ImGuiContext& g = *GImGui; - return g.ClipboardHandlerData.empty() ? NULL : g.ClipboardHandlerData.begin(); -} - -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) -{ - ImGuiContext& g = *GImGui; - g.ClipboardHandlerData.clear(); - const char* text_end = text + strlen(text); - g.ClipboardHandlerData.resize((int)(text_end - text) + 1); - memcpy(&g.ClipboardHandlerData[0], text, (size_t)(text_end - text)); - g.ClipboardHandlerData[(int)(text_end - text)] = 0; -} - -#endif - -// Win32 API IME support (for Asian languages, etc.) -#if defined(_WIN32) && !defined(__GNUC__) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) - -#include -#ifdef _MSC_VER -#pragma comment(lib, "imm32") -#endif - -static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y) -{ - // Notify OS Input Method Editor of text input position - ImGuiIO& io = ImGui::GetIO(); - if (HWND hwnd = (HWND)io.ImeWindowHandle) - if (HIMC himc = ::ImmGetContext(hwnd)) - { - COMPOSITIONFORM cf; - cf.ptCurrentPos.x = x; - cf.ptCurrentPos.y = y; - cf.dwStyle = CFS_FORCE_POSITION; - ::ImmSetCompositionWindow(himc, &cf); - ::ImmReleaseContext(hwnd, himc); - } -} - -#else - -static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {} - -#endif - -//----------------------------------------------------------------------------- -// [SECTION] METRICS/DEBUG WINDOW -//----------------------------------------------------------------------------- - -#ifndef IMGUI_DISABLE_METRICS_WINDOW -// Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds. -static void MetricsHelpMarker(const char* desc) -{ - ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); - ImGui::TextUnformatted(desc); - ImGui::PopTextWrapPos(); - ImGui::EndTooltip(); - } -} - -void ImGui::ShowMetricsWindow(bool* p_open) -{ - if (!ImGui::Begin("Dear ImGui Metrics", p_open)) - { - ImGui::End(); - return; - } - - // Debugging enums - enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type - const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Content", "ContentRegionRect" }; - enum { TRT_OuterRect, TRT_WorkRect, TRT_HostClipRect, TRT_InnerClipRect, TRT_BackgroundClipRect, TRT_ColumnsRect, TRT_ColumnsClipRect, TRT_ColumnsContentHeadersUsed, TRT_ColumnsContentHeadersDesired, TRT_ColumnsContentRowsFrozen, TRT_ColumnsContentRowsUnfrozen, TRT_Count }; // Tables Rect Type - const char* trt_rects_names[TRT_Count] = { "OuterRect", "WorkRect", "HostClipRect", "InnerClipRect", "BackgroundClipRect", "ColumnsRect", "ColumnsClipRect", "ColumnsContentHeadersUsed", "ColumnsContentHeadersDesired", "ColumnsContentRowsFrozen", "ColumnsContentRowsUnfrozen" }; - - // State - static bool show_windows_rects = false; - static int show_windows_rect_type = WRT_WorkRect; - static bool show_windows_begin_order = false; - static bool show_tables_rects = false; - static int show_tables_rect_type = TRT_WorkRect; - static bool show_drawcmd_mesh = true; - static bool show_drawcmd_aabb = true; - - // Basic info - ImGuiContext& g = *GImGui; - ImGuiIO& io = ImGui::GetIO(); - ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); - ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); - ImGui::Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3); - ImGui::Text("%d active windows (%d visible)", io.MetricsActiveWindows, io.MetricsRenderWindows); - ImGui::Text("%d active allocations", io.MetricsActiveAllocations); - ImGui::Separator(); - - // Helper functions to display common structures: - // - NodeDrawList() - // - NodeColumns() - // - NodeWindow() - // - NodeWindows() - // - NodeTabBar() - // - NodeStorage() - struct Funcs - { - static ImRect GetWindowRect(ImGuiWindow* window, int rect_type) - { - if (rect_type == WRT_OuterRect) { return window->Rect(); } - else if (rect_type == WRT_OuterRectClipped) { return window->OuterRectClipped; } - else if (rect_type == WRT_InnerRect) { return window->InnerRect; } - else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; } - else if (rect_type == WRT_WorkRect) { return window->WorkRect; } - else if (rect_type == WRT_Content) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); } - else if (rect_type == WRT_ContentRegionRect) { return window->ContentRegionRect; } - IM_ASSERT(0); - return ImRect(); - } - - static void NodeDrawCmdShowMeshAndBoundingBox(ImGuiWindow* window, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, int elem_offset, bool show_mesh, bool show_aabb) - { - IM_ASSERT(show_mesh || show_aabb); - ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list - ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL; - - // Draw wire-frame version of all triangles - ImRect clip_rect = draw_cmd->ClipRect; - ImRect vtxs_rect(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); - ImDrawListFlags backup_flags = fg_draw_list->Flags; - fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles. - for (unsigned int base_idx = elem_offset; base_idx < (elem_offset + draw_cmd->ElemCount); base_idx += 3) - { - ImVec2 triangle[3]; - for (int n = 0; n < 3; n++) - { - ImVec2 p = draw_list->VtxBuffer[idx_buffer ? idx_buffer[base_idx + n] : (base_idx + n)].pos; - triangle[n] = p; - vtxs_rect.Add(p); - } - if (show_mesh) - fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), true, 1.0f); // In yellow: mesh triangles - } - // Draw bounding boxes - if (show_aabb) - { - fg_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU - fg_draw_list->AddRect(ImFloor(vtxs_rect.Min), ImFloor(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles - } - fg_draw_list->Flags = backup_flags; - } - - static void NodeDrawList(ImGuiWindow* window, ImDrawList* draw_list, const char* label) - { - bool node_open = ImGui::TreeNode(draw_list, "%s: '%s' %d vtx, %d indices, %d cmds", label, draw_list->_OwnerName ? draw_list->_OwnerName : "", draw_list->VtxBuffer.Size, draw_list->IdxBuffer.Size, draw_list->CmdBuffer.Size); - if (draw_list == ImGui::GetWindowDrawList()) - { - ImGui::SameLine(); - ImGui::TextColored(ImVec4(1.0f,0.4f,0.4f,1.0f), "CURRENTLY APPENDING"); // Can't display stats for active draw list! (we don't have the data double-buffered) - if (node_open) ImGui::TreePop(); - return; - } - - ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list - if (window && IsItemHovered()) - fg_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); - if (!node_open) - return; - - if (window && !window->WasActive) - ImGui::TextDisabled("Warning: owning Window is inactive. This DrawList is not being rendered!"); - - unsigned int elem_offset = 0; - for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem_offset += pcmd->ElemCount, pcmd++) - { - if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0) - continue; - if (pcmd->UserCallback) - { - ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData); - continue; - } - - ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL; - char buf[300]; - ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd: %4d triangles, Tex 0x%p, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)", - pcmd->ElemCount/3, (void*)(intptr_t)pcmd->TextureId, - pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w); - bool pcmd_node_open = ImGui::TreeNode((void*)(pcmd - draw_list->CmdBuffer.begin()), "%s", buf); - if (ImGui::IsItemHovered() && (show_drawcmd_mesh || show_drawcmd_aabb) && fg_draw_list) - NodeDrawCmdShowMeshAndBoundingBox(window, draw_list, pcmd, elem_offset, show_drawcmd_mesh, show_drawcmd_aabb); - if (!pcmd_node_open) - continue; - - // Calculate approximate coverage area (touched pixel count) - // This will be in pixels squared as long there's no post-scaling happening to the renderer output. - float total_area = 0.0f; - for (unsigned int base_idx = elem_offset; base_idx < (elem_offset + pcmd->ElemCount); base_idx += 3) - { - ImVec2 triangle[3]; - for (int n = 0; n < 3; n++) - triangle[n] = draw_list->VtxBuffer[idx_buffer ? idx_buffer[base_idx + n] : (base_idx + n)].pos; - total_area += ImTriangleArea(triangle[0], triangle[1], triangle[2]); - } - - // Display vertex information summary. Hover to get all triangles drawn in wire-frame - ImFormatString(buf, IM_ARRAYSIZE(buf), "Mesh: ElemCount: %d, VtxOffset: +%d, IdxOffset: +%d, Area: ~%0.f px", pcmd->ElemCount, pcmd->VtxOffset, pcmd->IdxOffset, total_area); - ImGui::Selectable(buf); - if (ImGui::IsItemHovered() && fg_draw_list) - NodeDrawCmdShowMeshAndBoundingBox(window, draw_list, pcmd, elem_offset, true, false); - - // Display individual triangles/vertices. Hover on to get the corresponding triangle highlighted. - ImGuiListClipper clipper(pcmd->ElemCount/3); // Manually coarse clip our print out of individual vertices to save CPU, only items that may be visible. - while (clipper.Step()) - for (int prim = clipper.DisplayStart, idx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++) - { - char *buf_p = buf, *buf_end = buf + IM_ARRAYSIZE(buf); - ImVec2 triangle[3]; - for (int n = 0; n < 3; n++, idx_i++) - { - ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[idx_i] : idx_i]; - triangle[n] = v.pos; - buf_p += ImFormatString(buf_p, buf_end - buf_p, "%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n", - (n == 0) ? "Vert:" : " ", idx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col); - } - - ImGui::Selectable(buf, false); - if (fg_draw_list && ImGui::IsItemHovered()) - { - ImDrawListFlags backup_flags = fg_draw_list->Flags; - fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles. - fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255,255,0,255), true, 1.0f); - fg_draw_list->Flags = backup_flags; - } - } - ImGui::TreePop(); - } - ImGui::TreePop(); - } - - static void NodeColumns(const ImGuiColumns* columns) - { - if (!ImGui::TreeNode((void*)(uintptr_t)columns->ID, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->ID, columns->Count, columns->Flags)) - return; - ImGui::BulletText("Width: %.1f (MinX: %.1f, MaxX: %.1f)", columns->OffMaxX - columns->OffMinX, columns->OffMinX, columns->OffMaxX); - for (int column_n = 0; column_n < columns->Columns.Size; column_n++) - ImGui::BulletText("Column %02d: OffsetNorm %.3f (= %.1f px)", column_n, columns->Columns[column_n].OffsetNorm, GetColumnOffsetFromNorm(columns, columns->Columns[column_n].OffsetNorm)); - ImGui::TreePop(); - } - - static void NodeWindows(ImVector& windows, const char* label) - { - if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size)) - return; - for (int i = 0; i < windows.Size; i++) - { - ImGui::PushID(windows[i]); - Funcs::NodeWindow(windows[i], "Window"); - ImGui::PopID(); - } - ImGui::TreePop(); - } - - static void NodeWindow(ImGuiWindow* window, const char* label) - { - if (window == NULL) - { - ImGui::BulletText("%s: NULL", label); - return; - } - bool open = ImGui::TreeNode(label, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window); - if (ImGui::IsItemHovered() && window->WasActive) - ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); - if (!open) - return; - - if (!window->WasActive) - ImGui::TextDisabled("Note: window is not currently visible."); - if (window->MemoryCompacted) - ImGui::TextDisabled("Note: some memory buffers have been compacted/freed."); - - ImGuiWindowFlags flags = window->Flags; - NodeDrawList(window, window->DrawList, "DrawList"); - ImGui::BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), ContentSize (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->ContentSize.x, window->ContentSize.y); - ImGui::BulletText("Flags: 0x%08X (%s%s%s%s%s%s%s%s%s..)", flags, - (flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "", - (flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "", - (flags & ImGuiWindowFlags_NoMouseInputs)? "NoMouseInputs":"", (flags & ImGuiWindowFlags_NoNavInputs) ? "NoNavInputs" : "", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : ""); - ImGui::BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f) Scrollbar:%s%s", window->Scroll.x, window->ScrollMax.x, window->Scroll.y, window->ScrollMax.y, window->ScrollbarX ? "X" : "", window->ScrollbarY ? "Y" : ""); - ImGui::BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1); - ImGui::BulletText("Appearing: %d, Hidden: %d (CanSkip %d Cannot %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesCanSkipItems, window->HiddenFramesCannotSkipItems, window->SkipItems); - ImGui::BulletText("NavLastIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], window->DC.NavLayerActiveMask); - ImGui::BulletText("NavLastChildNavWindow: %s", window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL"); - if (!window->NavRectRel[0].IsInverted()) - ImGui::BulletText("NavRectRel[0]: (%.1f,%.1f)(%.1f,%.1f)", window->NavRectRel[0].Min.x, window->NavRectRel[0].Min.y, window->NavRectRel[0].Max.x, window->NavRectRel[0].Max.y); - else - ImGui::BulletText("NavRectRel[0]: "); - if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow"); - if (window->ParentWindow != NULL) NodeWindow(window->ParentWindow, "ParentWindow"); - if (window->DC.ChildWindows.Size > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows"); - if (window->ColumnsStorage.Size > 0 && ImGui::TreeNode("Columns", "Columns sets (%d)", window->ColumnsStorage.Size)) - { - for (int n = 0; n < window->ColumnsStorage.Size; n++) - NodeColumns(&window->ColumnsStorage[n]); - ImGui::TreePop(); - } - NodeStorage(&window->StateStorage, "Storage"); - ImGui::TreePop(); - } - - static void NodeTabBar(ImGuiTabBar* tab_bar) - { - // Standalone tab bars (not associated to docking/windows functionality) currently hold no discernible strings. - char buf[256]; - char* p = buf; - const char* buf_end = buf + IM_ARRAYSIZE(buf); - p += ImFormatString(p, buf_end - p, "TabBar (%d tabs)%s", tab_bar->Tabs.Size, (tab_bar->PrevFrameVisible < ImGui::GetFrameCount() - 2) ? " *Inactive*" : ""); - if (ImGui::TreeNode(tab_bar, "%s", buf)) - { - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - { - const ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; - ImGui::PushID(tab); - if (ImGui::SmallButton("<")) { TabBarQueueChangeTabOrder(tab_bar, tab, -1); } ImGui::SameLine(0, 2); - if (ImGui::SmallButton(">")) { TabBarQueueChangeTabOrder(tab_bar, tab, +1); } ImGui::SameLine(); - ImGui::Text("%02d%c Tab 0x%08X '%s'", tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : ""); - ImGui::PopID(); - } - ImGui::TreePop(); - } - } - - static void NodeStorage(ImGuiStorage* storage, const char* label) - { - if (!ImGui::TreeNode(label, "%s: %d entries, %d bytes", label, storage->Data.Size, storage->Data.size_in_bytes())) - return; - for (int n = 0; n < storage->Data.Size; n++) - { - const ImGuiStorage::ImGuiStoragePair& p = storage->Data[n]; - ImGui::BulletText("Key 0x%08X Value { i: %d }", p.key, p.val_i); // Important: we currently don't store a type, real value may not be integer. - } - ImGui::TreePop(); - } - }; - - - // Tools - if (ImGui::TreeNode("Tools")) - { - // The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted. - if (ImGui::Button("Item Picker..")) - ImGui::DebugStartItemPicker(); - ImGui::SameLine(); - MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash."); - - ImGui::Checkbox("Show windows begin order", &show_windows_begin_order); - ImGui::Checkbox("Show windows rectangles", &show_windows_rects); - ImGui::SameLine(); - ImGui::SetNextItemWidth(ImGui::GetFontSize() * 12); - show_windows_rects |= ImGui::Combo("##show_windows_rect_type", &show_windows_rect_type, wrt_rects_names, WRT_Count, WRT_Count); - if (show_windows_rects && g.NavWindow) - { - ImGui::BulletText("'%s':", g.NavWindow->Name); - ImGui::Indent(); - for (int rect_n = 0; rect_n < WRT_Count; rect_n++) - { - ImRect r = Funcs::GetWindowRect(g.NavWindow, rect_n); - ImGui::Text("(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) %s", r.Min.x, r.Min.y, r.Max.x, r.Max.y, r.GetWidth(), r.GetHeight(), wrt_rects_names[rect_n]); - } - ImGui::Unindent(); - } - ImGui::Checkbox("Show mesh when hovering ImDrawCmd", &show_drawcmd_mesh); - ImGui::Checkbox("Show bounding boxes when hovering ImDrawCmd", &show_drawcmd_aabb); - ImGui::TreePop(); - } - - // Contents - Funcs::NodeWindows(g.Windows, "Windows"); - //Funcs::NodeWindows(g.WindowsFocusOrder, "WindowsFocusOrder"); - if (ImGui::TreeNode("DrawLists", "Active DrawLists (%d)", g.DrawDataBuilder.Layers[0].Size)) - { - for (int i = 0; i < g.DrawDataBuilder.Layers[0].Size; i++) - Funcs::NodeDrawList(NULL, g.DrawDataBuilder.Layers[0][i], "DrawList"); - ImGui::TreePop(); - } - - // Details for Popups - if (ImGui::TreeNode("Popups", "Popups (%d)", g.OpenPopupStack.Size)) - { - for (int i = 0; i < g.OpenPopupStack.Size; i++) - { - ImGuiWindow* window = g.OpenPopupStack[i].Window; - ImGui::BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : ""); - } - ImGui::TreePop(); - } - - // Details for TabBars - if (ImGui::TreeNode("TabBars", "Tab Bars (%d)", g.TabBars.GetSize())) - { - for (int n = 0; n < g.TabBars.GetSize(); n++) - Funcs::NodeTabBar(g.TabBars.GetByIndex(n)); - ImGui::TreePop(); - } - - // Details for Tables - IM_UNUSED(trt_rects_names); - IM_UNUSED(show_tables_rects); - IM_UNUSED(show_tables_rect_type); -#ifdef IMGUI_HAS_TABLE - if (ImGui::TreeNode("Tables", "Tables (%d)", g.Tables.GetSize())) - { - for (int n = 0; n < g.Tables.GetSize(); n++) - Funcs::NodeTable(g.Tables.GetByIndex(n)); - ImGui::TreePop(); - } -#endif // #define IMGUI_HAS_TABLE - - // Details for Docking -#ifdef IMGUI_HAS_DOCK - if (ImGui::TreeNode("Docking")) - { - ImGui::TreePop(); - } -#endif // #define IMGUI_HAS_DOCK - - // Misc Details - if (ImGui::TreeNode("Internal state")) - { - const char* input_source_names[] = { "None", "Mouse", "Nav", "NavKeyboard", "NavGamepad" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT); - ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL"); - ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL"); - ImGui::Text("HoveredId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d", g.HoveredId, g.HoveredIdPreviousFrame, g.HoveredIdTimer, g.HoveredIdAllowOverlap); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not - ImGui::Text("ActiveId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d, Source: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, g.ActiveIdAllowOverlap, input_source_names[g.ActiveIdSource]); - ImGui::Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL"); - ImGui::Text("MovingWindow: '%s'", g.MovingWindow ? g.MovingWindow->Name : "NULL"); - ImGui::Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL"); - ImGui::Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer); - ImGui::Text("NavInputSource: %s", input_source_names[g.NavInputSource]); - ImGui::Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible); - ImGui::Text("NavActivateId: 0x%08X, NavInputId: 0x%08X", g.NavActivateId, g.NavInputId); - ImGui::Text("NavDisableHighlight: %d, NavDisableMouseHover: %d", g.NavDisableHighlight, g.NavDisableMouseHover); - ImGui::Text("NavWindowingTarget: '%s'", g.NavWindowingTarget ? g.NavWindowingTarget->Name : "NULL"); - ImGui::Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize); - ImGui::TreePop(); - } - - // Overlay: Display windows Rectangles and Begin Order - if (show_windows_rects || show_windows_begin_order) - { - for (int n = 0; n < g.Windows.Size; n++) - { - ImGuiWindow* window = g.Windows[n]; - if (!window->WasActive) - continue; - ImDrawList* draw_list = GetForegroundDrawList(window); - if (show_windows_rects) - { - ImRect r = Funcs::GetWindowRect(window, show_windows_rect_type); - draw_list->AddRect(r.Min, r.Max, IM_COL32(255, 0, 128, 255)); - } - if (show_windows_begin_order && !(window->Flags & ImGuiWindowFlags_ChildWindow)) - { - char buf[32]; - ImFormatString(buf, IM_ARRAYSIZE(buf), "%d", window->BeginOrderWithinContext); - float font_size = ImGui::GetFontSize(); - draw_list->AddRectFilled(window->Pos, window->Pos + ImVec2(font_size, font_size), IM_COL32(200, 100, 100, 255)); - draw_list->AddText(window->Pos, IM_COL32(255, 255, 255, 255), buf); - } - } - } - -#ifdef IMGUI_HAS_TABLE - // Overlay: Display Tables Rectangles - if (show_tables_rects) - { - for (int table_n = 0; table_n < g.Tables.GetSize(); table_n++) - { - ImGuiTable* table = g.Tables.GetByIndex(table_n); - } - } -#endif // #define IMGUI_HAS_TABLE - -#ifdef IMGUI_HAS_DOCK - // Overlay: Display Docking info - if (show_docking_nodes && g.IO.KeyCtrl) - { - } -#endif // #define IMGUI_HAS_DOCK - - ImGui::End(); -} - -#else - -void ImGui::ShowMetricsWindow(bool*) { } - -#endif - -//----------------------------------------------------------------------------- - -// Include imgui_user.inl at the end of imgui.cpp to access private data/functions that aren't exposed. -// Prefer just including imgui_internal.h from your code rather than using this define. If a declaration is missing from imgui_internal.h add it or request it on the github. -#ifdef IMGUI_INCLUDE_IMGUI_USER_INL -#include "imgui_user.inl" -#endif - -//----------------------------------------------------------------------------- - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imgui.h b/include/imgui/imgui.h deleted file mode 100644 index 92c56740..00000000 --- a/include/imgui/imgui.h +++ /dev/null @@ -1,2337 +0,0 @@ -// dear imgui, v1.76 -// (headers) - -// Help: -// - Read FAQ at http://dearimgui.org/faq -// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. -// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. All applications in examples/ are doing that. -// Read imgui.cpp for details, links and comments. - -// Resources: -// - FAQ http://dearimgui.org/faq -// - Homepage & latest https://github.com/ocornut/imgui -// - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/3075 (please post your screenshots/video there!) -// - Glossary https://github.com/ocornut/imgui/wiki/Glossary -// - Wiki https://github.com/ocornut/imgui/wiki -// - Issues & support https://github.com/ocornut/imgui/issues - -/* - -Index of this file: -// Header mess -// Forward declarations and basic types -// ImGui API (Dear ImGui end-user API) -// Flags & Enumerations -// Memory allocations macros -// ImVector<> -// ImGuiStyle -// ImGuiIO -// Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload) -// Obsolete functions -// Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor) -// Draw List API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData) -// Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont) - -*/ - -#pragma once - -// Configuration file with compile-time options (edit imconfig.h or #define IMGUI_USER_CONFIG to your own filename) -#ifdef IMGUI_USER_CONFIG -#include IMGUI_USER_CONFIG -#endif -#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) -#include "imconfig.h" -#endif - -#ifndef IMGUI_DISABLE - -//----------------------------------------------------------------------------- -// Header mess -//----------------------------------------------------------------------------- - -// Includes -#include // FLT_MIN, FLT_MAX -#include // va_list, va_start, va_end -#include // ptrdiff_t, NULL -#include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp - -// Version -// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) -#define IMGUI_VERSION "1.76" -#define IMGUI_VERSION_NUM 17600 -#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) - -// Define attributes of all API symbols declarations (e.g. for DLL under Windows) -// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default bindings files (imgui_impl_xxx.h) -// Using dear imgui via a shared library is not recommended, because we don't guarantee backward nor forward ABI compatibility (also function call overhead, as dear imgui is a call-heavy API) -#ifndef IMGUI_API -#define IMGUI_API -#endif -#ifndef IMGUI_IMPL_API -#define IMGUI_IMPL_API IMGUI_API -#endif - -// Helper Macros -#ifndef IM_ASSERT -#include -#define IM_ASSERT(_EXPR) assert(_EXPR) // You can override the default assert handler by editing imconfig.h -#endif -#if !defined(IMGUI_USE_STB_SPRINTF) && (defined(__clang__) || defined(__GNUC__)) -#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // To apply printf-style warnings to our functions. -#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0))) -#else -#define IM_FMTARGS(FMT) -#define IM_FMTLIST(FMT) -#endif -#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*_ARR))) // Size of a static C-style array. Don't use on pointers! -#define IM_UNUSED(_VAR) ((void)_VAR) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds. -#if (__cplusplus >= 201100) -#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11 -#else -#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Old style macro. -#endif - -// Warnings -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wold-style-cast" -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" -#endif -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead -#endif - -//----------------------------------------------------------------------------- -// Forward declarations and basic types -//----------------------------------------------------------------------------- - -// Forward declarations -struct ImDrawChannel; // Temporary storage to output draw commands out of order, used by ImDrawListSplitter and ImDrawList::ChannelsSplit() -struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call, unless it is a callback) -struct ImDrawData; // All draw command lists required to render the frame + pos/size coordinates to use for the projection matrix. -struct ImDrawList; // A single draw command list (generally one per window, conceptually you may see this as a dynamic "mesh" builder) -struct ImDrawListSharedData; // Data shared among multiple draw lists (typically owned by parent ImGui context, but you may create one yourself) -struct ImDrawListSplitter; // Helper to split a draw list into different layers which can be drawn into out of order, then flattened back. -struct ImDrawVert; // A single vertex (pos + uv + col = 20 bytes by default. Override layout with IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT) -struct ImFont; // Runtime data for a single font within a parent ImFontAtlas -struct ImFontAtlas; // Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader -struct ImFontConfig; // Configuration data when adding a font or merging fonts -struct ImFontGlyph; // A single font glyph (code point + coordinates within in ImFontAtlas + offset) -struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data -struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using) -struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h) -struct ImGuiIO; // Main configuration and I/O between your application and ImGui -struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use) -struct ImGuiListClipper; // Helper to manually clip large list of items -struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro -struct ImGuiPayload; // User data payload for drag and drop operations -struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use) -struct ImGuiStorage; // Helper for key->value storage -struct ImGuiStyle; // Runtime data for styling/colors -struct ImGuiTextBuffer; // Helper to hold and append into a text buffer (~string builder) -struct ImGuiTextFilter; // Helper to parse and apply text filters (e.g. "aaaaa[,bbbbb][,ccccc]") - -// Enums/Flags (declared as int for compatibility with old C++, to allow using as flags and to not pollute the top of this file) -// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! -// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. -typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling -typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions -typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type -typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction -typedef int ImGuiKey; // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum) -typedef int ImGuiNavInput; // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation -typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle) -typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier -typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling -typedef int ImDrawCornerFlags; // -> enum ImDrawCornerFlags_ // Flags: for ImDrawList::AddRect(), AddRectFilled() etc. -typedef int ImDrawListFlags; // -> enum ImDrawListFlags_ // Flags: for ImDrawList -typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas -typedef int ImGuiBackendFlags; // -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags -typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc. -typedef int ImGuiConfigFlags; // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags -typedef int ImGuiComboFlags; // -> enum ImGuiComboFlags_ // Flags: for BeginCombo() -typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload() -typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused() -typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc. -typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline() -typedef int ImGuiKeyModFlags; // -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super) -typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable() -typedef int ImGuiTabBarFlags; // -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar() -typedef int ImGuiTabItemFlags; // -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem() -typedef int ImGuiTreeNodeFlags; // -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode(), TreeNodeEx(), CollapsingHeader() -typedef int ImGuiWindowFlags; // -> enum ImGuiWindowFlags_ // Flags: for Begin(), BeginChild() - -// Other types -#ifndef ImTextureID // ImTextureID [configurable type: override in imconfig.h with '#define ImTextureID xxx'] -typedef void* ImTextureID; // User data for rendering back-end to identify a texture. This is whatever to you want it to be! read the FAQ about ImTextureID for details. -#endif -typedef unsigned int ImGuiID; // A unique ID used by widgets, typically hashed from a stack of string. -typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData *data); -typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); - -// Decoded character types -// (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display) -typedef unsigned short ImWchar16; // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings. -typedef unsigned int ImWchar32; // A single decoded U32 character/code point. We encode them as multi bytes UTF-8 when used in strings. -#ifdef IMGUI_USE_WCHAR32 // ImWchar [configurable type: override in imconfig.h with '#define IMGUI_USE_WCHAR32' to support Unicode planes 1-16] -typedef ImWchar32 ImWchar; -#else -typedef ImWchar16 ImWchar; -#endif - -// Basic scalar data types -typedef signed char ImS8; // 8-bit signed integer -typedef unsigned char ImU8; // 8-bit unsigned integer -typedef signed short ImS16; // 16-bit signed integer -typedef unsigned short ImU16; // 16-bit unsigned integer -typedef signed int ImS32; // 32-bit signed integer == int -typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors) -#if defined(_MSC_VER) && !defined(__clang__) -typedef signed __int64 ImS64; // 64-bit signed integer (pre and post C++11 with Visual Studio) -typedef unsigned __int64 ImU64; // 64-bit unsigned integer (pre and post C++11 with Visual Studio) -#elif (defined(__clang__) || defined(__GNUC__)) && (__cplusplus < 201100) -#include -typedef int64_t ImS64; // 64-bit signed integer (pre C++11) -typedef uint64_t ImU64; // 64-bit unsigned integer (pre C++11) -#else -typedef signed long long ImS64; // 64-bit signed integer (post C++11) -typedef unsigned long long ImU64; // 64-bit unsigned integer (post C++11) -#endif - -// 2D vector (often used to store positions or sizes) -struct ImVec2 -{ - float x, y; - ImVec2() { x = y = 0.0f; } - ImVec2(float _x, float _y) { x = _x; y = _y; } - float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. - float& operator[] (size_t idx) { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. -#ifdef IM_VEC2_CLASS_EXTRA - IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2. -#endif -}; - -// 4D vector (often used to store floating-point colors) -struct ImVec4 -{ - float x, y, z, w; - ImVec4() { x = y = z = w = 0.0f; } - ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; } -#ifdef IM_VEC4_CLASS_EXTRA - IM_VEC4_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec4. -#endif -}; - -//----------------------------------------------------------------------------- -// ImGui: Dear ImGui end-user API -// (This is a namespace. You can add extra ImGui:: functions in your own separate file. Please don't modify imgui source files!) -//----------------------------------------------------------------------------- - -namespace ImGui -{ - // Context creation and access - // Each context create its own ImFontAtlas by default. You may instance one yourself and pass it to CreateContext() to share a font atlas between imgui contexts. - // None of those functions is reliant on the current context. - IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL); - IMGUI_API void DestroyContext(ImGuiContext* ctx = NULL); // NULL = destroy current context - IMGUI_API ImGuiContext* GetCurrentContext(); - IMGUI_API void SetCurrentContext(ImGuiContext* ctx); - - // Main - IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags) - IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame! - IMGUI_API void NewFrame(); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame(). - IMGUI_API void EndFrame(); // ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all! - IMGUI_API void Render(); // ends the Dear ImGui frame, finalize the draw data. You can get call GetDrawData() to obtain it and run your rendering function (up to v1.60, this used to call io.RenderDrawListsFn(). Nowadays, we allow and prefer calling your render function yourself.) - IMGUI_API ImDrawData* GetDrawData(); // valid after Render() and until the next call to NewFrame(). this is what you have to render. - - // Demo, Debug, Information - IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! - IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information. - IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Debug/Metrics window. display Dear ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc. - IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) - IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles. - IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts. - IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls). - IMGUI_API const char* GetVersion(); // get the compiled version string e.g. "1.23" (essentially the compiled value for IMGUI_VERSION) - - // Styles - IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL); // new, recommended style (default) - IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL); // classic imgui style - IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL); // best used with borders and a custom, thicker font - - // Windows - // - Begin() = push window to the stack and start appending to it. End() = pop window from the stack. - // - You may append multiple times to the same window during the same frame. - // - Passing 'bool* p_open != NULL' shows a window-closing widget in the upper-right corner of the window, - // which clicking will set the boolean to false when clicked. - // - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting - // anything to the window. Always call a matching End() for each Begin() call, regardless of its return value! - // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu, - // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function - // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] - // - Note that the bottom of window stack always contains a window called "Debug". - IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); - IMGUI_API void End(); - - // Child Windows - // - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child. - // - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400). - // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. - // Always call a matching EndChild() for each BeginChild() call, regardless of its return value [as with Begin: this is due to legacy reason and inconsistent with most BeginXXX functions apart from the regular Begin() which behaves like BeginChild().] - IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); - IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); - IMGUI_API void EndChild(); - - // Windows Utilities - // - 'current window' = the window we are appending into while inside a Begin()/End() block. 'next window' = next window we will Begin() into. - IMGUI_API bool IsWindowAppearing(); - IMGUI_API bool IsWindowCollapsed(); - IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options. - IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ! - IMGUI_API ImDrawList* GetWindowDrawList(); // get draw list associated to the current window, to append your own drawing primitives - IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList API) - IMGUI_API ImVec2 GetWindowSize(); // get current window size - IMGUI_API float GetWindowWidth(); // get current window width (shortcut for GetWindowSize().x) - IMGUI_API float GetWindowHeight(); // get current window height (shortcut for GetWindowSize().y) - - // Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin). - IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0,0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc. - IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin() - IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints. - IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin() - IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin() - IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin() - IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground. - IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects. - IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects. - IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed(). - IMGUI_API void SetWindowFocus(); // (not recommended) set current window to be focused / top-most. prefer using SetNextWindowFocus(). - IMGUI_API void SetWindowFontScale(float scale); // set font scale. Adjust IO.FontGlobalScale if you want to scale all windows. This is an old API! For correct scaling, prefer to reload font + rebuild ImFontAtlas + call style.ScaleAllSizes(). - IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0); // set named window position. - IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. - IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state - IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / top-most. use NULL to remove focus. - - // Content region - // - Those functions are bound to be redesigned soon (they are confusing, incomplete and return values in local window coordinates which increases confusion) - IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates - IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos() - IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min (roughly (0,0)-Scroll), in window coordinates - IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates - IMGUI_API float GetWindowContentRegionWidth(); // - - // Windows Scrolling - IMGUI_API float GetScrollX(); // get scrolling amount [0..GetScrollMaxX()] - IMGUI_API float GetScrollY(); // get scrolling amount [0..GetScrollMaxY()] - IMGUI_API float GetScrollMaxX(); // get maximum scrolling amount ~~ ContentSize.X - WindowSize.X - IMGUI_API float GetScrollMaxY(); // get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y - IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()] - IMGUI_API void SetScrollY(float scroll_y); // set scrolling amount [0..GetScrollMaxY()] - IMGUI_API void SetScrollHereX(float center_x_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. - IMGUI_API void SetScrollHereY(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. - IMGUI_API void SetScrollFromPosX(float local_x, float center_x_ratio = 0.5f); // adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position. - IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position. - - // Parameters stacks (shared) - IMGUI_API void PushFont(ImFont* font); // use NULL as a shortcut to push default font - IMGUI_API void PopFont(); - IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); - IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col); - IMGUI_API void PopStyleColor(int count = 1); - IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); - IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); - IMGUI_API void PopStyleVar(int count = 1); - IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in. - IMGUI_API ImFont* GetFont(); // get current font - IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied - IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API - IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier - IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied - IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied - - // Parameters stacks (current window) - IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width, - IMGUI_API void PopItemWidth(); - IMGUI_API void SetNextItemWidth(float item_width); // set width of the _next_ common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side) - IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions. - IMGUI_API void PushTextWrapPos(float wrap_local_pos_x = 0.0f); // push word-wrapping position for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space - IMGUI_API void PopTextWrapPos(); - IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets - IMGUI_API void PopAllowKeyboardFocus(); - IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame. - IMGUI_API void PopButtonRepeat(); - - // Cursor / Layout - // - By "cursor" we mean the current output position. - // - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down. - // - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceeding widget. - // - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API: - // Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos() - // Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. - IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator. - IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates. - IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in an horizontal-layout context. - IMGUI_API void Spacing(); // add vertical spacing. - IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into. - IMGUI_API void Indent(float indent_w = 0.0f); // move content position toward the right, by style.IndentSpacing or indent_w if != 0 - IMGUI_API void Unindent(float indent_w = 0.0f); // move content position back to the left, by style.IndentSpacing or indent_w if != 0 - IMGUI_API void BeginGroup(); // lock horizontal starting position - IMGUI_API void EndGroup(); // unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) - IMGUI_API ImVec2 GetCursorPos(); // cursor position in window coordinates (relative to window position) - IMGUI_API float GetCursorPosX(); // (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc. - IMGUI_API float GetCursorPosY(); // other functions such as GetCursorScreenPos or everything in ImDrawList:: - IMGUI_API void SetCursorPos(const ImVec2& local_pos); // are using the main, absolute coordinate system. - IMGUI_API void SetCursorPosX(float local_x); // GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.) - IMGUI_API void SetCursorPosY(float local_y); // - IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position in window coordinates - IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) - IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute screen coordinates [0..io.DisplaySize] - IMGUI_API void AlignTextToFramePadding(); // vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item) - IMGUI_API float GetTextLineHeight(); // ~ FontSize - IMGUI_API float GetTextLineHeightWithSpacing(); // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) - IMGUI_API float GetFrameHeight(); // ~ FontSize + style.FramePadding.y * 2 - IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) - - // ID stack/scopes - // - Read the FAQ for more details about how ID are handled in dear imgui. If you are creating widgets in a loop you most - // likely want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them. - // - The resulting ID are hashes of the entire stack. - // - You can also use the "Label##foobar" syntax within widget label to distinguish them from each others. - // - In this header file we use the "label"/"name" terminology to denote a string that will be displayed and used as an ID, - // whereas "str_id" denote a string that is only used as an ID and not normally displayed. - IMGUI_API void PushID(const char* str_id); // push string into the ID stack (will hash string). - IMGUI_API void PushID(const char* str_id_begin, const char* str_id_end); // push string into the ID stack (will hash string). - IMGUI_API void PushID(const void* ptr_id); // push pointer into the ID stack (will hash pointer). - IMGUI_API void PushID(int int_id); // push integer into the ID stack (will hash integer). - IMGUI_API void PopID(); // pop from the ID stack. - IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself - IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end); - IMGUI_API ImGuiID GetID(const void* ptr_id); - - // Widgets: Text - IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. - IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // formatted text - IMGUI_API void TextV(const char* fmt, va_list args) IM_FMTLIST(1); - IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor(); - IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(2); - IMGUI_API void TextDisabled(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor(); - IMGUI_API void TextDisabledV(const char* fmt, va_list args) IM_FMTLIST(1); - IMGUI_API void TextWrapped(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize(). - IMGUI_API void TextWrappedV(const char* fmt, va_list args) IM_FMTLIST(1); - IMGUI_API void LabelText(const char* label, const char* fmt, ...) IM_FMTARGS(2); // display text+label aligned the same way as value+label widgets - IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2); - IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text() - IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1); - - // Widgets: Main - // - Most widgets return true when the value has been changed or when pressed/selected - // - You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state. - IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0,0)); // button - IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text - IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size); // button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) - IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape - IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0)); - IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding - IMGUI_API bool Checkbox(const char* label, bool* v); - IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value); - IMGUI_API bool RadioButton(const char* label, bool active); // use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; } - IMGUI_API bool RadioButton(const char* label, int* v, int v_button); // shortcut to handle the above pattern when value is an integer - IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-1,0), const char* overlay = NULL); - IMGUI_API void Bullet(); // draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses - - // Widgets: Combo Box - // - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items. - // - The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose. - IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0); - IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true! - IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1); - IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0" - IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1); - - // Widgets: Drags - // - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped and can go off-bounds. - // - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x - // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. - // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). - // - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits. - // - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum. - // - Use v_min > v_max to lock edits. - IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound - IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", const char* format_max = NULL, float power = 1.0f); - IMGUI_API bool DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d"); // If v_min >= v_max we have no bound - IMGUI_API bool DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d"); - IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d"); - IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d"); - IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", const char* format_max = NULL); - IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, float power = 1.0f); - IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, float power = 1.0f); - - // Widgets: Sliders - // - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds. - // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. - IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f); // adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for power curve sliders - IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f, const char* format = "%.0f deg"); - IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* format = "%d"); - IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* format = "%d"); - IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* format = "%d"); - IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* format = "%d"); - IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f); - IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f); - IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f); - IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format = "%d"); - IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f); - - // Widgets: Input with Keyboard - // - If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp. - // - Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc. - IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool InputTextWithHint(const char* label, const char* hint, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, const char* format = "%.3f", ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputFloat2(const char* label, float v[2], const char* format = "%.3f", ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputFloat3(const char* label, float v[3], const char* format = "%.3f", ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputFloat4(const char* label, float v[4], const char* format = "%.3f", ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputInt2(const char* label, int v[2], ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputDouble(const char* label, double* v, double step = 0.0, double step_fast = 0.0, const char* format = "%.6f", ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0); - - // Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.) - // - Note that in C++ a 'float v[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. - // - You can pass the address of a first float element out of a contiguous structure, e.g. &myvector.x - IMGUI_API bool ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); - IMGUI_API bool ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0); - IMGUI_API bool ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); - IMGUI_API bool ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL); - IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0,0)); // display a colored square/button, hover for details, return true when pressed. - IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls. - - // Widgets: Trees - // - TreeNode functions return true when the node is open, in which case you need to also call TreePop() when you are finished displaying the tree node contents. - IMGUI_API bool TreeNode(const char* label); - IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...) IM_FMTARGS(2); // helper variation to easily decorelate the id from the displayed string. Read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet(). - IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...) IM_FMTARGS(2); // " - IMGUI_API bool TreeNodeV(const char* str_id, const char* fmt, va_list args) IM_FMTLIST(2); - IMGUI_API bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args) IM_FMTLIST(2); - IMGUI_API bool TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags = 0); - IMGUI_API bool TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); - IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); - IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); - IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); - IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired. - IMGUI_API void TreePush(const void* ptr_id = NULL); // " - IMGUI_API void TreePop(); // ~ Unindent()+PopId() - IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode - IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop(). - IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header - IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state. - - // Widgets: Selectables - // - A selectable highlights when hovered, and can display another color when selected. - // - Neighbors selectable extend their highlight bounds in order to leave no gap between them. This is so a series of selected Selectable appear contiguous. - IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height - IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper. - - // Widgets: List Boxes - // - FIXME: To be consistent with all the newer API, ListBoxHeader/ListBoxFooter should in reality be called BeginListBox/EndListBox. Will rename them. - IMGUI_API bool ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1); - IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1); - IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. if the function return true, you can output elements then call ListBoxFooter() afterwards. - IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // " - IMGUI_API void ListBoxFooter(); // terminate the scrolling region. only call ListBoxFooter() if ListBoxHeader() returned true! - - // Widgets: Data Plotting - IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float)); - IMGUI_API void PlotLines(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0)); - IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float)); - IMGUI_API void PlotHistogram(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0)); - - // Widgets: Value() Helpers. - // - Those are merely shortcut to calling Text() with a format string. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace) - IMGUI_API void Value(const char* prefix, bool b); - IMGUI_API void Value(const char* prefix, int v); - IMGUI_API void Value(const char* prefix, unsigned int v); - IMGUI_API void Value(const char* prefix, float v, const char* float_format = NULL); - - // Widgets: Menus - // - Use BeginMenuBar() on a window ImGuiWindowFlags_MenuBar to append to its menu bar. - // - Use BeginMainMenuBar() to create a menu bar at the top of the screen and append to it. - // - Use BeginMenu() to create a menu. You can call BeginMenu() multiple time with the same identifier to append more items to it. - IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). - IMGUI_API void EndMenuBar(); // only call EndMenuBar() if BeginMenuBar() returns true! - IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar. - IMGUI_API void EndMainMenuBar(); // only call EndMainMenuBar() if BeginMainMenuBar() returns true! - IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true! - IMGUI_API void EndMenu(); // only call EndMenu() if BeginMenu() returns true! - IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment - IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL - - // Tooltips - // - Tooltip are windows following the mouse which do not take focus away. - IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items). - IMGUI_API void EndTooltip(); - IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip(). - IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); - - // Popups, Modals - // The properties of popups windows are: - // - They block normal mouse hovering detection outside them. (*) - // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE. - // - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls. - // User can manipulate the visibility state by calling OpenPopup(). - // - We default to use the right mouse (ImGuiMouseButton_Right=1) for the Popup Context functions. - // (*) You can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup. - // Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time. - IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). - IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returns true! - IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1); // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp! - IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window. - IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows). - IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // modal dialog (regular window with title bar, block interactions behind the modal window, can't close the modal window by clicking outside) - IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true! - IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1); // helper to open popup when clicked on last item (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors). return true when just opened. - IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open at the current begin-ed level of the popup stack. - IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup. - - // Columns - // - You can also use SameLine(pos_x) to mimic simplified columns. - // - The columns API is work-in-progress and rather lacking (columns are arguably the worst part of dear imgui at the moment!) - // - There is a maximum of 64 columns. - // - Currently working on new 'Tables' api which will replace columns around Q2 2020 (see GitHub #2957). - IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true); - IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished - IMGUI_API int GetColumnIndex(); // get current column index - IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column - IMGUI_API void SetColumnWidth(int column_index, float width); // set column width (in pixels). pass -1 to use current column - IMGUI_API float GetColumnOffset(int column_index = -1); // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f - IMGUI_API void SetColumnOffset(int column_index, float offset_x); // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column - IMGUI_API int GetColumnsCount(); - - // Tab Bars, Tabs - IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0); // create and append into a TabBar - IMGUI_API void EndTabBar(); // only call EndTabBar() if BeginTabBar() returns true! - IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0);// create a Tab. Returns true if the Tab is selected. - IMGUI_API void EndTabItem(); // only call EndTabItem() if BeginTabItem() returns true! - IMGUI_API void SetTabItemClosed(const char* tab_or_docked_window_label); // notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name. - - // Logging/Capture - // - All text output from the interface can be captured into tty/file/clipboard. By default, tree nodes are automatically opened during logging. - IMGUI_API void LogToTTY(int auto_open_depth = -1); // start logging to tty (stdout) - IMGUI_API void LogToFile(int auto_open_depth = -1, const char* filename = NULL); // start logging to file - IMGUI_API void LogToClipboard(int auto_open_depth = -1); // start logging to OS clipboard - IMGUI_API void LogFinish(); // stop logging (close file, etc.) - IMGUI_API void LogButtons(); // helper to display buttons for logging to tty/file/clipboard - IMGUI_API void LogText(const char* fmt, ...) IM_FMTARGS(1); // pass text data straight to log (without being displayed) - - // Drag and Drop - // - [BETA API] API may evolve! - IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0); // call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource() - IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t sz, ImGuiCond cond = 0); // type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. - IMGUI_API void EndDragDropSource(); // only call EndDragDropSource() if BeginDragDropSource() returns true! - IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() - IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. - IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true! - IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type. - - // Clipping - IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect); - IMGUI_API void PopClipRect(); - - // Focus, Activation - // - Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHereY()" when applicable to signify "this is the default item" - IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. - IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget. - - // Item/Widgets Utilities - // - Most of the functions are referring to the last/previous item we submitted. - // - See Demo Window under "Widgets->Querying Status" for an interactive visualization of most of those functions. - IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options. - IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false) - IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation? - IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered() - IMGUI_API bool IsItemVisible(); // is the last item visible? (items may be out of sight because of clipping/scrolling) - IMGUI_API bool IsItemEdited(); // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets. - IMGUI_API bool IsItemActivated(); // was the last item just made active (item was previously inactive). - IMGUI_API bool IsItemDeactivated(); // was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing. - IMGUI_API bool IsItemDeactivatedAfterEdit(); // was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item). - IMGUI_API bool IsItemToggledOpen(); // was the last item open state toggled? set by TreeNode(). - IMGUI_API bool IsAnyItemHovered(); // is any item hovered? - IMGUI_API bool IsAnyItemActive(); // is any item active? - IMGUI_API bool IsAnyItemFocused(); // is any item focused? - IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space) - IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space) - IMGUI_API ImVec2 GetItemRectSize(); // get size of last item - IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area. - - // Miscellaneous Utilities - IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped. - IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side. - IMGUI_API double GetTime(); // get global imgui time. incremented by io.DeltaTime every frame. - IMGUI_API int GetFrameCount(); // get global imgui frame count. incremented by 1 every frame. - IMGUI_API ImDrawList* GetBackgroundDrawList(); // this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents. - IMGUI_API ImDrawList* GetForegroundDrawList(); // this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents. - IMGUI_API ImDrawListSharedData* GetDrawListSharedData(); // you may use this when creating your own ImDrawList instances. - IMGUI_API const char* GetStyleColorName(ImGuiCol idx); // get a string corresponding to the enum value (for display, saving, etc.). - IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it) - IMGUI_API ImGuiStorage* GetStateStorage(); - IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. - IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame - IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window) - - // Text Utilities - IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); - - // Color Utilities - IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in); - IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in); - IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v); - IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b); - - // Inputs Utilities: Keyboard - // - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[]. - // - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index. - IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key] - IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index]. - IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate - IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)? - IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate - IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value = true); // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call. - - // Inputs Utilities: Mouse - // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right. - // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle. - // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold') - IMGUI_API bool IsMouseDown(ImGuiMouseButton button); // is mouse button held? - IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down) - IMGUI_API bool IsMouseReleased(ImGuiMouseButton button); // did mouse button released? (went from Down to !Down) - IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime. - IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block. - IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available - IMGUI_API bool IsAnyMouseDown(); // is any mouse button held? - IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls - IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves) - IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) - IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) - IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); // - IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you - IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired cursor type - IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value = true); // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call. - - // Clipboard Utilities - // - Also see the LogToClipboard() function to capture GUI into clipboard, or easily output text data to the clipboard. - IMGUI_API const char* GetClipboardText(); - IMGUI_API void SetClipboardText(const char* text); - - // Settings/.Ini Utilities - // - The disk functions are automatically called if io.IniFilename != NULL (default is "imgui.ini"). - // - Set io.IniFilename to NULL to load/save manually. Read io.WantSaveIniSettings description about handling .ini saving manually. - IMGUI_API void LoadIniSettingsFromDisk(const char* ini_filename); // call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename). - IMGUI_API void LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size=0); // call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source. - IMGUI_API void SaveIniSettingsToDisk(const char* ini_filename); // this is automatically called (if io.IniFilename is not empty) a few seconds after any modification that should be reflected in the .ini file (and also by DestroyContext). - IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL); // return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings. - - // Debug Utilities - IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro. - - // Memory Allocators - // - All those functions are not reliant on the current context. - // - If you reload the contents of imgui.cpp at runtime, you may need to call SetCurrentContext() + SetAllocatorFunctions() again because we use global storage for those. - IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = NULL); - IMGUI_API void* MemAlloc(size_t size); - IMGUI_API void MemFree(void* ptr); - -} // namespace ImGui - -//----------------------------------------------------------------------------- -// Flags & Enumerations -//----------------------------------------------------------------------------- - -// Flags for ImGui::Begin() -enum ImGuiWindowFlags_ -{ - ImGuiWindowFlags_None = 0, - ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar - ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip - ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window - ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbars (window can still scroll with mouse or programmatically) - ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. - ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it - ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame - ImGuiWindowFlags_NoBackground = 1 << 7, // Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f). - ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file - ImGuiWindowFlags_NoMouseInputs = 1 << 9, // Disable catching mouse, hovering test with pass through. - ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar - ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section. - ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state - ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) - ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, // Always show vertical scrollbar (even if ContentSize.y < Size.y) - ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x) - ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) - ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window - ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB) - ImGuiWindowFlags_UnsavedDocument = 1 << 20, // Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker. - ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, - ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse, - ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, - - // [Internal] - ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!) - ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild() - ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip() - ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup() - ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal() - ImGuiWindowFlags_ChildMenu = 1 << 28 // Don't use! For internal use by BeginMenu() - - // [Obsolete] - //ImGuiWindowFlags_ShowBorders = 1 << 7, // --> Set style.FrameBorderSize=1.0f or style.WindowBorderSize=1.0f to enable borders around items or windows. - //ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by back-end (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) -}; - -// Flags for ImGui::InputText() -enum ImGuiInputTextFlags_ -{ - ImGuiInputTextFlags_None = 0, - ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/ - ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef - ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z - ImGuiInputTextFlags_CharsNoBlank = 1 << 3, // Filter out spaces, tabs - ImGuiInputTextFlags_AutoSelectAll = 1 << 4, // Select entire text when first taking mouse focus - ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider looking at the IsItemDeactivatedAfterEdit() function. - ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Callback on pressing TAB (for completion handling) - ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Callback on pressing Up/Down arrows (for history handling) - ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Callback on each iteration. User code may query cursor position, modify text buffer. - ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. - ImGuiInputTextFlags_AllowTabInput = 1 << 10, // Pressing TAB input a '\t' character into the text field - ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter). - ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, // Disable following the cursor horizontally - ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13, // Insert mode - ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode - ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*' - ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). - ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) - ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) - // [Internal] - ImGuiInputTextFlags_Multiline = 1 << 20, // For internal use by InputTextMultiline() - ImGuiInputTextFlags_NoMarkEdited = 1 << 21 // For internal use by functions using InputText() before reformatting data -}; - -// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*() -enum ImGuiTreeNodeFlags_ -{ - ImGuiTreeNodeFlags_None = 0, - ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected - ImGuiTreeNodeFlags_Framed = 1 << 1, // Full colored frame (e.g. for CollapsingHeader) - ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one - ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack - ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) - ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, // Default node to be open - ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Need double-click to open node - ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open. - ImGuiTreeNodeFlags_Leaf = 1 << 8, // No collapsing, no arrow (use as a convenience for leaf nodes). - ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow - ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). - ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default. - ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (bypass the indented area). - ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) - //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible - ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog -}; - -// Flags for ImGui::Selectable() -enum ImGuiSelectableFlags_ -{ - ImGuiSelectableFlags_None = 0, - ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window - ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column) - ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too - ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text - ImGuiSelectableFlags_AllowItemOverlap = 1 << 4 // (WIP) Hit testing to allow subsequent widgets to overlap this one -}; - -// Flags for ImGui::BeginCombo() -enum ImGuiComboFlags_ -{ - ImGuiComboFlags_None = 0, - ImGuiComboFlags_PopupAlignLeft = 1 << 0, // Align the popup toward the left by default - ImGuiComboFlags_HeightSmall = 1 << 1, // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo() - ImGuiComboFlags_HeightRegular = 1 << 2, // Max ~8 items visible (default) - ImGuiComboFlags_HeightLarge = 1 << 3, // Max ~20 items visible - ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible - ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button - ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button - ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest -}; - -// Flags for ImGui::BeginTabBar() -enum ImGuiTabBarFlags_ -{ - ImGuiTabBarFlags_None = 0, - ImGuiTabBarFlags_Reorderable = 1 << 0, // Allow manually dragging tabs to re-order them + New tabs are appended at the end of list - ImGuiTabBarFlags_AutoSelectNewTabs = 1 << 1, // Automatically select new tabs when they appear - ImGuiTabBarFlags_TabListPopupButton = 1 << 2, // Disable buttons to open the tab list popup - ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. - ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4, // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll) - ImGuiTabBarFlags_NoTooltip = 1 << 5, // Disable tooltips when hovering a tab - ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit - ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit - ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll, - ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown -}; - -// Flags for ImGui::BeginTabItem() -enum ImGuiTabItemFlags_ -{ - ImGuiTabItemFlags_None = 0, - ImGuiTabItemFlags_UnsavedDocument = 1 << 0, // Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. Also: tab is selected on closure and closure is deferred by one frame to allow code to undo it without flicker. - ImGuiTabItemFlags_SetSelected = 1 << 1, // Trigger flag to programmatically make the tab selected when calling BeginTabItem() - ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. - ImGuiTabItemFlags_NoPushId = 1 << 3 // Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem() -}; - -// Flags for ImGui::IsWindowFocused() -enum ImGuiFocusedFlags_ -{ - ImGuiFocusedFlags_None = 0, - ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused - ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy) - ImGuiFocusedFlags_AnyWindow = 1 << 2, // IsWindowFocused(): Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! - ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows -}; - -// Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered() -// Note: if you are trying to check whether your mouse should be dispatched to Dear ImGui or to your app, you should use 'io.WantCaptureMouse' instead! Please read the FAQ! -// Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls. -enum ImGuiHoveredFlags_ -{ - ImGuiHoveredFlags_None = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. - ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered - ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy) - ImGuiHoveredFlags_AnyWindow = 1 << 2, // IsWindowHovered() only: Return true if any window is hovered - ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 3, // Return true even if a popup window is normally blocking access to this item/window - //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 4, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet. - ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 5, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. - ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 6, // Return true even if the position is obstructed or overlapped by another window - ImGuiHoveredFlags_AllowWhenDisabled = 1 << 7, // Return true even if the item is disabled - ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, - ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows -}; - -// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload() -enum ImGuiDragDropFlags_ -{ - ImGuiDragDropFlags_None = 0, - // BeginDragDropSource() flags - ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior. - ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item. - ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. - ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. - ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. - ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) - // AcceptDragDropPayload() flags - ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. - ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. - ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. - ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery. -}; - -// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui. -#define IMGUI_PAYLOAD_TYPE_COLOR_3F "_COL3F" // float[3]: Standard type for colors, without alpha. User code may use this type. -#define IMGUI_PAYLOAD_TYPE_COLOR_4F "_COL4F" // float[4]: Standard type for colors. User code may use this type. - -// A primary data type -enum ImGuiDataType_ -{ - ImGuiDataType_S8, // signed char / char (with sensible compilers) - ImGuiDataType_U8, // unsigned char - ImGuiDataType_S16, // short - ImGuiDataType_U16, // unsigned short - ImGuiDataType_S32, // int - ImGuiDataType_U32, // unsigned int - ImGuiDataType_S64, // long long / __int64 - ImGuiDataType_U64, // unsigned long long / unsigned __int64 - ImGuiDataType_Float, // float - ImGuiDataType_Double, // double - ImGuiDataType_COUNT -}; - -// A cardinal direction -enum ImGuiDir_ -{ - ImGuiDir_None = -1, - ImGuiDir_Left = 0, - ImGuiDir_Right = 1, - ImGuiDir_Up = 2, - ImGuiDir_Down = 3, - ImGuiDir_COUNT -}; - -// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array -enum ImGuiKey_ -{ - ImGuiKey_Tab, - ImGuiKey_LeftArrow, - ImGuiKey_RightArrow, - ImGuiKey_UpArrow, - ImGuiKey_DownArrow, - ImGuiKey_PageUp, - ImGuiKey_PageDown, - ImGuiKey_Home, - ImGuiKey_End, - ImGuiKey_Insert, - ImGuiKey_Delete, - ImGuiKey_Backspace, - ImGuiKey_Space, - ImGuiKey_Enter, - ImGuiKey_Escape, - ImGuiKey_KeyPadEnter, - ImGuiKey_A, // for text edit CTRL+A: select all - ImGuiKey_C, // for text edit CTRL+C: copy - ImGuiKey_V, // for text edit CTRL+V: paste - ImGuiKey_X, // for text edit CTRL+X: cut - ImGuiKey_Y, // for text edit CTRL+Y: redo - ImGuiKey_Z, // for text edit CTRL+Z: undo - ImGuiKey_COUNT -}; - -// To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/back-end) -enum ImGuiKeyModFlags_ -{ - ImGuiKeyModFlags_None = 0, - ImGuiKeyModFlags_Ctrl = 1 << 0, - ImGuiKeyModFlags_Shift = 1 << 1, - ImGuiKeyModFlags_Alt = 1 << 2, - ImGuiKeyModFlags_Super = 1 << 3 -}; - -// Gamepad/Keyboard navigation -// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. -// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Back-end: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). -// Read instructions in imgui.cpp for more details. Download PNG/PSD at http://goo.gl/9LgVZW. -enum ImGuiNavInput_ -{ - // Gamepad Mapping - ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), A (Switch), Space (Keyboard) - ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard) - ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) - ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard) - ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard) - ImGuiNavInput_DpadRight, // - ImGuiNavInput_DpadUp, // - ImGuiNavInput_DpadDown, // - ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down - ImGuiNavInput_LStickRight, // - ImGuiNavInput_LStickUp, // - ImGuiNavInput_LStickDown, // - ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - - // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them. - // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[]. - ImGuiNavInput_KeyMenu_, // toggle menu // = io.KeyAlt - ImGuiNavInput_KeyLeft_, // move left // = Arrow keys - ImGuiNavInput_KeyRight_, // move right - ImGuiNavInput_KeyUp_, // move up - ImGuiNavInput_KeyDown_, // move down - ImGuiNavInput_COUNT, - ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyMenu_ -}; - -// Configuration flags stored in io.ConfigFlags. Set by user/application. -enum ImGuiConfigFlags_ -{ - ImGuiConfigFlags_None = 0, - ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[]. - ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set ImGuiBackendFlags_HasGamepad. - ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth. - ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set. - ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the back-end. - ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct back-end to not alter mouse cursor shape and visibility. Use if the back-end cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead. - - // User storage (to allow your back-end/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core Dear ImGui) - ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware. - ImGuiConfigFlags_IsTouchScreen = 1 << 21 // Application is using a touch screen instead of a mouse. -}; - -// Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end. -enum ImGuiBackendFlags_ -{ - ImGuiBackendFlags_None = 0, - ImGuiBackendFlags_HasGamepad = 1 << 0, // Back-end Platform supports gamepad and currently has one connected. - ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Back-end Platform supports honoring GetMouseCursor() value to change the OS cursor shape. - ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Back-end Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set). - ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3 // Back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. -}; - -// Enumeration for PushStyleColor() / PopStyleColor() -enum ImGuiCol_ -{ - ImGuiCol_Text, - ImGuiCol_TextDisabled, - ImGuiCol_WindowBg, // Background of normal windows - ImGuiCol_ChildBg, // Background of child windows - ImGuiCol_PopupBg, // Background of popups, menus, tooltips windows - ImGuiCol_Border, - ImGuiCol_BorderShadow, - ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input - ImGuiCol_FrameBgHovered, - ImGuiCol_FrameBgActive, - ImGuiCol_TitleBg, - ImGuiCol_TitleBgActive, - ImGuiCol_TitleBgCollapsed, - ImGuiCol_MenuBarBg, - ImGuiCol_ScrollbarBg, - ImGuiCol_ScrollbarGrab, - ImGuiCol_ScrollbarGrabHovered, - ImGuiCol_ScrollbarGrabActive, - ImGuiCol_CheckMark, - ImGuiCol_SliderGrab, - ImGuiCol_SliderGrabActive, - ImGuiCol_Button, - ImGuiCol_ButtonHovered, - ImGuiCol_ButtonActive, - ImGuiCol_Header, // Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem - ImGuiCol_HeaderHovered, - ImGuiCol_HeaderActive, - ImGuiCol_Separator, - ImGuiCol_SeparatorHovered, - ImGuiCol_SeparatorActive, - ImGuiCol_ResizeGrip, - ImGuiCol_ResizeGripHovered, - ImGuiCol_ResizeGripActive, - ImGuiCol_Tab, - ImGuiCol_TabHovered, - ImGuiCol_TabActive, - ImGuiCol_TabUnfocused, - ImGuiCol_TabUnfocusedActive, - ImGuiCol_PlotLines, - ImGuiCol_PlotLinesHovered, - ImGuiCol_PlotHistogram, - ImGuiCol_PlotHistogramHovered, - ImGuiCol_TextSelectedBg, - ImGuiCol_DragDropTarget, - ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item - ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB - ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active - ImGuiCol_ModalWindowDimBg, // Darken/colorize entire screen behind a modal window, when one is active - ImGuiCol_COUNT - - // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiCol_ModalWindowDarkening = ImGuiCol_ModalWindowDimBg // [renamed in 1.63] - //, ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered// [unused since 1.60+] the close button now uses regular button colors. -#endif -}; - -// Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure. -// - The enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code. -// During initialization or between frames, feel free to just poke into ImGuiStyle directly. -// - Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description. -// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. -// - When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type. -enum ImGuiStyleVar_ -{ - // Enum name --------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions) - ImGuiStyleVar_Alpha, // float Alpha - ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding - ImGuiStyleVar_WindowRounding, // float WindowRounding - ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize - ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize - ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign - ImGuiStyleVar_ChildRounding, // float ChildRounding - ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize - ImGuiStyleVar_PopupRounding, // float PopupRounding - ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize - ImGuiStyleVar_FramePadding, // ImVec2 FramePadding - ImGuiStyleVar_FrameRounding, // float FrameRounding - ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize - ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing - ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing - ImGuiStyleVar_IndentSpacing, // float IndentSpacing - ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize - ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding - ImGuiStyleVar_GrabMinSize, // float GrabMinSize - ImGuiStyleVar_GrabRounding, // float GrabRounding - ImGuiStyleVar_TabRounding, // float TabRounding - ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign - ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign - ImGuiStyleVar_COUNT - - // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT // [renamed in 1.60] -#endif -}; - -// Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton() -enum ImGuiColorEditFlags_ -{ - ImGuiColorEditFlags_None = 0, - ImGuiColorEditFlags_NoAlpha = 1 << 1, // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (will only read 3 components from the input pointer). - ImGuiColorEditFlags_NoPicker = 1 << 2, // // ColorEdit: disable picker when clicking on colored square. - ImGuiColorEditFlags_NoOptions = 1 << 3, // // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview. - ImGuiColorEditFlags_NoSmallPreview = 1 << 4, // // ColorEdit, ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs) - ImGuiColorEditFlags_NoInputs = 1 << 5, // // ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square). - ImGuiColorEditFlags_NoTooltip = 1 << 6, // // ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview. - ImGuiColorEditFlags_NoLabel = 1 << 7, // // ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker). - ImGuiColorEditFlags_NoSidePreview = 1 << 8, // // ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead. - ImGuiColorEditFlags_NoDragDrop = 1 << 9, // // ColorEdit: disable drag and drop target. ColorButton: disable drag and drop source. - ImGuiColorEditFlags_NoBorder = 1 << 10, // // ColorButton: disable border (which is enforced by default) - - // User Options (right-click on widget to change some of them). - ImGuiColorEditFlags_AlphaBar = 1 << 16, // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker. - ImGuiColorEditFlags_AlphaPreview = 1 << 17, // // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque. - ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 18, // // ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque. - ImGuiColorEditFlags_HDR = 1 << 19, // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well). - ImGuiColorEditFlags_DisplayRGB = 1 << 20, // [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex. - ImGuiColorEditFlags_DisplayHSV = 1 << 21, // [Display] // " - ImGuiColorEditFlags_DisplayHex = 1 << 22, // [Display] // " - ImGuiColorEditFlags_Uint8 = 1 << 23, // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255. - ImGuiColorEditFlags_Float = 1 << 24, // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. - ImGuiColorEditFlags_PickerHueBar = 1 << 25, // [Picker] // ColorPicker: bar for Hue, rectangle for Sat/Value. - ImGuiColorEditFlags_PickerHueWheel = 1 << 26, // [Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value. - ImGuiColorEditFlags_InputRGB = 1 << 27, // [Input] // ColorEdit, ColorPicker: input and output data in RGB format. - ImGuiColorEditFlags_InputHSV = 1 << 28, // [Input] // ColorEdit, ColorPicker: input and output data in HSV format. - - // Defaults Options. You can set application defaults using SetColorEditOptions(). The intent is that you probably don't want to - // override them in most of your calls. Let the user choose via the option menu and/or call SetColorEditOptions() once during startup. - ImGuiColorEditFlags__OptionsDefault = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_DisplayRGB|ImGuiColorEditFlags_InputRGB|ImGuiColorEditFlags_PickerHueBar, - - // [Internal] Masks - ImGuiColorEditFlags__DisplayMask = ImGuiColorEditFlags_DisplayRGB|ImGuiColorEditFlags_DisplayHSV|ImGuiColorEditFlags_DisplayHex, - ImGuiColorEditFlags__DataTypeMask = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_Float, - ImGuiColorEditFlags__PickerMask = ImGuiColorEditFlags_PickerHueWheel|ImGuiColorEditFlags_PickerHueBar, - ImGuiColorEditFlags__InputMask = ImGuiColorEditFlags_InputRGB|ImGuiColorEditFlags_InputHSV - - // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69] -#endif -}; - -// Identify a mouse button. -// Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience. -enum ImGuiMouseButton_ -{ - ImGuiMouseButton_Left = 0, - ImGuiMouseButton_Right = 1, - ImGuiMouseButton_Middle = 2, - ImGuiMouseButton_COUNT = 5 -}; - -// Enumeration for GetMouseCursor() -// User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here -enum ImGuiMouseCursor_ -{ - ImGuiMouseCursor_None = -1, - ImGuiMouseCursor_Arrow = 0, - ImGuiMouseCursor_TextInput, // When hovering over InputText, etc. - ImGuiMouseCursor_ResizeAll, // (Unused by Dear ImGui functions) - ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border - ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column - ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window - ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window - ImGuiMouseCursor_Hand, // (Unused by Dear ImGui functions. Use for e.g. hyperlinks) - ImGuiMouseCursor_NotAllowed, // When hovering something with disallowed interaction. Usually a crossed circle. - ImGuiMouseCursor_COUNT - - // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiMouseCursor_Count_ = ImGuiMouseCursor_COUNT // [renamed in 1.60] -#endif -}; - -// Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions -// Represent a condition. -// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always. -enum ImGuiCond_ -{ - ImGuiCond_Always = 1 << 0, // Set the variable - ImGuiCond_Once = 1 << 1, // Set the variable once per runtime session (only the first call with succeed) - ImGuiCond_FirstUseEver = 1 << 2, // Set the variable if the object/window has no persistently saved data (no entry in .ini file) - ImGuiCond_Appearing = 1 << 3 // Set the variable if the object/window is appearing after being hidden/inactive (or the first time) -}; - -//----------------------------------------------------------------------------- -// Helpers: Memory allocations macros -// IM_MALLOC(), IM_FREE(), IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE() -// We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax. -// Defining a custom placement new() with a dummy parameter allows us to bypass including which on some platforms complains when user has disabled exceptions. -//----------------------------------------------------------------------------- - -struct ImNewDummy {}; -inline void* operator new(size_t, ImNewDummy, void* ptr) { return ptr; } -inline void operator delete(void*, ImNewDummy, void*) {} // This is only required so we can use the symmetrical new() -#define IM_ALLOC(_SIZE) ImGui::MemAlloc(_SIZE) -#define IM_FREE(_PTR) ImGui::MemFree(_PTR) -#define IM_PLACEMENT_NEW(_PTR) new(ImNewDummy(), _PTR) -#define IM_NEW(_TYPE) new(ImNewDummy(), ImGui::MemAlloc(sizeof(_TYPE))) _TYPE -template void IM_DELETE(T* p) { if (p) { p->~T(); ImGui::MemFree(p); } } - -//----------------------------------------------------------------------------- -// Helper: ImVector<> -// Lightweight std::vector<>-like class to avoid dragging dependencies (also, some implementations of STL with debug enabled are absurdly slow, we bypass it so our code runs fast in debug). -//----------------------------------------------------------------------------- -// - You generally do NOT need to care or use this ever. But we need to make it available in imgui.h because some of our public structures are relying on it. -// - We use std-like naming convention here, which is a little unusual for this codebase. -// - Important: clear() frees memory, resize(0) keep the allocated buffer. We use resize(0) a lot to intentionally recycle allocated buffers across frames and amortize our costs. -// - Important: our implementation does NOT call C++ constructors/destructors, we treat everything as raw data! This is intentional but be extra mindful of that, -// Do NOT use this class as a std::vector replacement in your own code! Many of the structures used by dear imgui can be safely initialized by a zero-memset. -//----------------------------------------------------------------------------- - -template -struct ImVector -{ - int Size; - int Capacity; - T* Data; - - // Provide standard typedefs but we don't use them ourselves. - typedef T value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; - - // Constructors, destructor - inline ImVector() { Size = Capacity = 0; Data = NULL; } - inline ImVector(const ImVector& src) { Size = Capacity = 0; Data = NULL; operator=(src); } - inline ImVector& operator=(const ImVector& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; } - inline ~ImVector() { if (Data) IM_FREE(Data); } - - inline bool empty() const { return Size == 0; } - inline int size() const { return Size; } - inline int size_in_bytes() const { return Size * (int)sizeof(T); } - inline int capacity() const { return Capacity; } - inline T& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; } - inline const T& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; } - - inline void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } } - inline T* begin() { return Data; } - inline const T* begin() const { return Data; } - inline T* end() { return Data + Size; } - inline const T* end() const { return Data + Size; } - inline T& front() { IM_ASSERT(Size > 0); return Data[0]; } - inline const T& front() const { IM_ASSERT(Size > 0); return Data[0]; } - inline T& back() { IM_ASSERT(Size > 0); return Data[Size - 1]; } - inline const T& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; } - inline void swap(ImVector& rhs) { int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; T* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; } - - inline int _grow_capacity(int sz) const { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; } - inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; } - inline void resize(int new_size, const T& v) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; } - inline void shrink(int new_size) { IM_ASSERT(new_size <= Size); Size = new_size; } // Resize a vector to a smaller size, guaranteed not to cause a reallocation - inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; } - - // NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden. - inline void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; } - inline void pop_back() { IM_ASSERT(Size > 0); Size--; } - inline void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); } - inline T* erase(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; } - inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data+Size && it_last > it && it_last <= Data+Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - count) * sizeof(T)); Size -= (int)count; return Data + off; } - inline T* erase_unsorted(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; if (it < Data+Size-1) memcpy(Data + off, Data + Size - 1, sizeof(T)); Size--; return Data + off; } - inline T* insert(const T* it, const T& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(T)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; } - inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; } - inline T* find(const T& v) { T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; } - inline const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; } - inline bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; } - inline bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; } - inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; return (int)off; } -}; - -//----------------------------------------------------------------------------- -// ImGuiStyle -// You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame(). -// During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, -// and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors. -//----------------------------------------------------------------------------- - -struct ImGuiStyle -{ - float Alpha; // Global alpha applies to everything in Dear ImGui. - ImVec2 WindowPadding; // Padding within a window. - float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. - float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). - ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). - ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. - ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left. - float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows. - float ChildBorderSize; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). - float PopupRounding; // Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding) - float PopupBorderSize; // Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). - ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets). - float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets). - float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). - ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines. - ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). - ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! - float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). - float ColumnsMinSpacing; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). - float ScrollbarSize; // Width of the vertical scrollbar, Height of the horizontal scrollbar. - float ScrollbarRounding; // Radius of grab corners for scrollbar. - float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar. - float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. - float TabRounding; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. - float TabBorderSize; // Thickness of border around tabs. - ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. - ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). - ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. - ImVec2 DisplayWindowPadding; // Window position are clamped to be visible within the display area by at least this amount. Only applies to regular windows. - ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! - float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. - bool AntiAliasedLines; // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU. - bool AntiAliasedFill; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.) - float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. - float CircleSegmentMaxError; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. - ImVec4 Colors[ImGuiCol_COUNT]; - - IMGUI_API ImGuiStyle(); - IMGUI_API void ScaleAllSizes(float scale_factor); -}; - -//----------------------------------------------------------------------------- -// ImGuiIO -// Communicate most settings and inputs/outputs to Dear ImGui using this structure. -// Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage. -//----------------------------------------------------------------------------- - -struct ImGuiIO -{ - //------------------------------------------------------------------ - // Configuration (fill once) // Default value - //------------------------------------------------------------------ - - ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc. - ImGuiBackendFlags BackendFlags; // = 0 // See ImGuiBackendFlags_ enum. Set by back-end (imgui_impl_xxx files or custom back-end) to communicate features supported by the back-end. - ImVec2 DisplaySize; // // Main display size, in pixels. - float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. - float IniSavingRate; // = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds. - const char* IniFilename; // = "imgui.ini" // Path to .ini file. Set NULL to disable automatic .ini loading/saving, if e.g. you want to manually load/save from memory. - const char* LogFilename; // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified). - float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds. - float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels. - float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging. - int KeyMap[ImGuiKey_COUNT]; // // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. - float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). - float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. - void* UserData; // = NULL // Store your own data for retrieval by callbacks. - - ImFontAtlas*Fonts; // // Font atlas: load, rasterize and pack one or more fonts into a single texture. - float FontGlobalScale; // = 1.0f // Global scale all fonts - bool FontAllowUserScaling; // = false // Allow user scaling text of individual window with CTRL+Wheel. - ImFont* FontDefault; // = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0]. - ImVec2 DisplayFramebufferScale; // = (1, 1) // For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale. - - // Miscellaneous options - bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by back-end implementations. - bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63) - bool ConfigInputTextCursorBlink; // = true // Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63) - bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag) - bool ConfigWindowsMoveFromTitleBarOnly; // = false // [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected. - float ConfigWindowsMemoryCompactTimer;// = 60.0f // [BETA] Compact window memory usage when unused. Set to -1.0f to disable. - - //------------------------------------------------------------------ - // Platform Functions - // (the imgui_impl_xxxx back-end files are setting those up for you) - //------------------------------------------------------------------ - - // Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff. - const char* BackendPlatformName; // = NULL - const char* BackendRendererName; // = NULL - void* BackendPlatformUserData; // = NULL // User data for platform back-end - void* BackendRendererUserData; // = NULL // User data for renderer back-end - void* BackendLanguageUserData; // = NULL // User data for non C++ programming language back-end - - // Optional: Access OS clipboard - // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) - const char* (*GetClipboardTextFn)(void* user_data); - void (*SetClipboardTextFn)(void* user_data, const char* text); - void* ClipboardUserData; - - // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows) - // (default to use native imm32 api on Windows) - void (*ImeSetInputScreenPosFn)(int x, int y); - void* ImeWindowHandle; // = NULL // (Windows) Set this to your HWND to get automatic IME cursor positioning. - -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - // [OBSOLETE since 1.60+] Rendering function, will be automatically called in Render(). Please call your rendering function yourself now! - // You can obtain the ImDrawData* by calling ImGui::GetDrawData() after Render(). See example applications if you are unsure of how to implement this. - void (*RenderDrawListsFn)(ImDrawData* data); -#else - // This is only here to keep ImGuiIO the same size/layout, so that IMGUI_DISABLE_OBSOLETE_FUNCTIONS can exceptionally be used outside of imconfig.h. - void* RenderDrawListsFnUnused; -#endif - - //------------------------------------------------------------------ - // Input - Fill before calling NewFrame() - //------------------------------------------------------------------ - - ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.) - bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. - float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. - float MouseWheelH; // Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends. - bool KeyCtrl; // Keyboard modifier pressed: Control - bool KeyShift; // Keyboard modifier pressed: Shift - bool KeyAlt; // Keyboard modifier pressed: Alt - bool KeySuper; // Keyboard modifier pressed: Cmd/Super/Windows - bool KeysDown[512]; // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). - float NavInputs[ImGuiNavInput_COUNT]; // Gamepad inputs. Cleared back to zero by EndFrame(). Keyboard keys will be auto-mapped and be written here by NewFrame(). - - // Functions - IMGUI_API void AddInputCharacter(unsigned int c); // Queue new character input - IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue new character input from an UTF-16 character, it can be a surrogate - IMGUI_API void AddInputCharactersUTF8(const char* str); // Queue new characters input from an UTF-8 string - IMGUI_API void ClearInputCharacters(); // Clear the text input buffer manually - - //------------------------------------------------------------------ - // Output - Updated by NewFrame() or EndFrame()/Render() - // (when reading from the io.WantCaptureMouse, io.WantCaptureKeyboard flags to dispatch your inputs, it is - // generally easier and more correct to use their state BEFORE calling NewFrame(). See FAQ for details!) - //------------------------------------------------------------------ - - bool WantCaptureMouse; // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.). - bool WantCaptureKeyboard; // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.). - bool WantTextInput; // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active). - bool WantSetMousePos; // MousePos has been altered, back-end should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled. - bool WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving! - bool NavActive; // Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag. - bool NavVisible; // Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events). - float Framerate; // Application framerate estimate, in frame per second. Solely for convenience. Rolling average estimation based on io.DeltaTime over 120 frames. - int MetricsRenderVertices; // Vertices output during last call to Render() - int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3 - int MetricsRenderWindows; // Number of visible windows - int MetricsActiveWindows; // Number of active windows - int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts. - ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. - - //------------------------------------------------------------------ - // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed! - //------------------------------------------------------------------ - - ImGuiKeyModFlags KeyMods; // Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame() - ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid) - ImVec2 MouseClickedPos[5]; // Position at time of clicking - double MouseClickedTime[5]; // Time of last click (used to figure out double-click) - bool MouseClicked[5]; // Mouse button went from !Down to Down - bool MouseDoubleClicked[5]; // Has mouse button been double-clicked? - bool MouseReleased[5]; // Mouse button went from Down to !Down - bool MouseDownOwned[5]; // Track if button was clicked inside a dear imgui window. We don't request mouse capture from the application if click started outside ImGui bounds. - bool MouseDownWasDoubleClick[5]; // Track if button down was a double-click - float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked) - float MouseDownDurationPrev[5]; // Previous time the mouse button has been down - ImVec2 MouseDragMaxDistanceAbs[5]; // Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point - float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point - float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed) - float KeysDownDurationPrev[512]; // Previous duration the key has been down - float NavInputsDownDuration[ImGuiNavInput_COUNT]; - float NavInputsDownDurationPrev[ImGuiNavInput_COUNT]; - ImWchar16 InputQueueSurrogate; // For AddInputCharacterUTF16 - ImVector InputQueueCharacters; // Queue of _characters_ input (obtained by platform back-end). Fill using AddInputCharacter() helper. - - IMGUI_API ImGuiIO(); -}; - -//----------------------------------------------------------------------------- -// Misc data structures -//----------------------------------------------------------------------------- - -// Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used. -// The callback function should return 0 by default. -// Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details) -// - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB -// - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows -// - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration -// - ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. -// - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. -struct ImGuiInputTextCallbackData -{ - ImGuiInputTextFlags EventFlag; // One ImGuiInputTextFlags_Callback* // Read-only - ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only - void* UserData; // What user passed to InputText() // Read-only - - // Arguments for the different callback events - // - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary. - // - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state. - ImWchar EventChar; // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0; - ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only // [Completion,History] - char* Buf; // Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer! - int BufTextLen; // Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length() - int BufSize; // Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1 - bool BufDirty; // Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always] - int CursorPos; // // Read-write // [Completion,History,Always] - int SelectionStart; // // Read-write // [Completion,History,Always] == to SelectionEnd when no selection) - int SelectionEnd; // // Read-write // [Completion,History,Always] - - // Helper functions for text manipulation. - // Use those function to benefit from the CallbackResize behaviors. Calling those function reset the selection. - IMGUI_API ImGuiInputTextCallbackData(); - IMGUI_API void DeleteChars(int pos, int bytes_count); - IMGUI_API void InsertChars(int pos, const char* text, const char* text_end = NULL); - bool HasSelection() const { return SelectionStart != SelectionEnd; } -}; - -// Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin(). -// NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough. -struct ImGuiSizeCallbackData -{ - void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints() - ImVec2 Pos; // Read-only. Window position, for reference. - ImVec2 CurrentSize; // Read-only. Current window size. - ImVec2 DesiredSize; // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing. -}; - -// Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload() -struct ImGuiPayload -{ - // Members - void* Data; // Data (copied and owned by dear imgui) - int DataSize; // Data size - - // [Internal] - ImGuiID SourceId; // Source item id - ImGuiID SourceParentId; // Source parent id (if available) - int DataFrameCount; // Data timestamp - char DataType[32+1]; // Data type tag (short user-supplied string, 32 characters max) - bool Preview; // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets) - bool Delivery; // Set when AcceptDragDropPayload() was called and mouse button is released over the target item. - - ImGuiPayload() { Clear(); } - void Clear() { SourceId = SourceParentId = 0; Data = NULL; DataSize = 0; memset(DataType, 0, sizeof(DataType)); DataFrameCount = -1; Preview = Delivery = false; } - bool IsDataType(const char* type) const { return DataFrameCount != -1 && strcmp(type, DataType) == 0; } - bool IsPreview() const { return Preview; } - bool IsDelivery() const { return Delivery; } -}; - -//----------------------------------------------------------------------------- -// Obsolete functions (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details) -// Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead. -//----------------------------------------------------------------------------- - -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS -namespace ImGui -{ - // OBSOLETED in 1.72 (from July 2019) - static inline void TreeAdvanceToLabelPos() { SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()); } - // OBSOLETED in 1.71 (from June 2019) - static inline void SetNextTreeNodeOpen(bool open, ImGuiCond cond = 0) { SetNextItemOpen(open, cond); } - // OBSOLETED in 1.70 (from May 2019) - static inline float GetContentRegionAvailWidth() { return GetContentRegionAvail().x; } - // OBSOLETED in 1.69 (from Mar 2019) - static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); } - // OBSOLETED in 1.66 (from Sep 2018) - static inline void SetScrollHere(float center_ratio=0.5f){ SetScrollHereY(center_ratio); } - // OBSOLETED in 1.63 (between Aug 2018 and Sept 2018) - static inline bool IsItemDeactivatedAfterChange() { return IsItemDeactivatedAfterEdit(); } - // OBSOLETED in 1.61 (between Apr 2018 and Aug 2018) - IMGUI_API bool InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags flags = 0); // Use the 'const char* format' version instead of 'decimal_precision'! - IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision, ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision, ImGuiInputTextFlags flags = 0); - IMGUI_API bool InputFloat4(const char* label, float v[4], int decimal_precision, ImGuiInputTextFlags flags = 0); - // OBSOLETED in 1.60 (between Dec 2017 and Apr 2018) - static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); } - static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } - static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { IM_UNUSED(on_edge); IM_UNUSED(outward); IM_ASSERT(0); return pos; } -} -typedef ImGuiInputTextCallback ImGuiTextEditCallback; // OBSOLETED in 1.63 (from Aug 2018): made the names consistent -typedef ImGuiInputTextCallbackData ImGuiTextEditCallbackData; -#endif - -//----------------------------------------------------------------------------- -// Helpers -//----------------------------------------------------------------------------- - -// Helper: Unicode defines -#define IM_UNICODE_CODEPOINT_INVALID 0xFFFD // Invalid Unicode code point (standard value). -#ifdef IMGUI_USE_WCHAR32 -#define IM_UNICODE_CODEPOINT_MAX 0x10FFFF // Maximum Unicode code point supported by this build. -#else -#define IM_UNICODE_CODEPOINT_MAX 0xFFFF // Maximum Unicode code point supported by this build. -#endif - -// Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame. -// Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame"); -struct ImGuiOnceUponAFrame -{ - ImGuiOnceUponAFrame() { RefFrame = -1; } - mutable int RefFrame; - operator bool() const { int current_frame = ImGui::GetFrameCount(); if (RefFrame == current_frame) return false; RefFrame = current_frame; return true; } -}; - -// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" -struct ImGuiTextFilter -{ - IMGUI_API ImGuiTextFilter(const char* default_filter = ""); - IMGUI_API bool Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f); // Helper calling InputText+Build - IMGUI_API bool PassFilter(const char* text, const char* text_end = NULL) const; - IMGUI_API void Build(); - void Clear() { InputBuf[0] = 0; Build(); } - bool IsActive() const { return !Filters.empty(); } - - // [Internal] - struct ImGuiTextRange - { - const char* b; - const char* e; - - ImGuiTextRange() { b = e = NULL; } - ImGuiTextRange(const char* _b, const char* _e) { b = _b; e = _e; } - bool empty() const { return b == e; } - IMGUI_API void split(char separator, ImVector* out) const; - }; - char InputBuf[256]; - ImVectorFilters; - int CountGrep; -}; - -// Helper: Growable text buffer for logging/accumulating text -// (this could be called 'ImGuiTextBuilder' / 'ImGuiStringBuilder') -struct ImGuiTextBuffer -{ - ImVector Buf; - IMGUI_API static char EmptyString[1]; - - ImGuiTextBuffer() { } - inline char operator[](int i) const { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; } - const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; } - const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator - int size() const { return Buf.Size ? Buf.Size - 1 : 0; } - bool empty() const { return Buf.Size <= 1; } - void clear() { Buf.clear(); } - void reserve(int capacity) { Buf.reserve(capacity); } - const char* c_str() const { return Buf.Data ? Buf.Data : EmptyString; } - IMGUI_API void append(const char* str, const char* str_end = NULL); - IMGUI_API void appendf(const char* fmt, ...) IM_FMTARGS(2); - IMGUI_API void appendfv(const char* fmt, va_list args) IM_FMTLIST(2); -}; - -// Helper: Key->Value storage -// Typically you don't have to worry about this since a storage is held within each Window. -// We use it to e.g. store collapse state for a tree (Int 0/1) -// This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame) -// You can use it as custom user storage for temporary values. Declare your own storage if, for example: -// - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state). -// - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient) -// Types are NOT stored, so it is up to you to make sure your Key don't collide with different types. -struct ImGuiStorage -{ - // [Internal] - struct ImGuiStoragePair - { - ImGuiID key; - union { int val_i; float val_f; void* val_p; }; - ImGuiStoragePair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; } - ImGuiStoragePair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; } - ImGuiStoragePair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; } - }; - - ImVector Data; - - // - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N) - // - Set***() functions find pair, insertion on demand if missing. - // - Sorted insertion is costly, paid once. A typical frame shouldn't need to insert any new pair. - void Clear() { Data.clear(); } - IMGUI_API int GetInt(ImGuiID key, int default_val = 0) const; - IMGUI_API void SetInt(ImGuiID key, int val); - IMGUI_API bool GetBool(ImGuiID key, bool default_val = false) const; - IMGUI_API void SetBool(ImGuiID key, bool val); - IMGUI_API float GetFloat(ImGuiID key, float default_val = 0.0f) const; - IMGUI_API void SetFloat(ImGuiID key, float val); - IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL - IMGUI_API void SetVoidPtr(ImGuiID key, void* val); - - // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. - // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. - // - A typical use case where this is convenient for quick hacking (e.g. add storage during a live Edit&Continue session if you can't modify existing struct) - // float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar; - IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0); - IMGUI_API bool* GetBoolRef(ImGuiID key, bool default_val = false); - IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0.0f); - IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL); - - // Use on your own storage if you know only integer are being stored (open/close all tree nodes) - IMGUI_API void SetAllInt(int val); - - // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. - IMGUI_API void BuildSortByKey(); -}; - -// Helper: Manually clip large list of items. -// If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all. -// The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped. -// ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null. -// Usage: -// ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced. -// while (clipper.Step()) -// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) -// ImGui::Text("line number %d", i); -// - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor). -// - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element. -// - (Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.) -// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop. -struct ImGuiListClipper -{ - int DisplayStart, DisplayEnd; - int ItemsCount; - - // [Internal] - int StepNo; - float ItemsHeight; - float StartPosY; - - // items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step). - // items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing(). - // If you don't specify an items_height, you NEED to call Step(). If you specify items_height you may call the old Begin()/End() api directly, but prefer calling Step(). - ImGuiListClipper(int items_count = -1, float items_height = -1.0f) { Begin(items_count, items_height); } // NB: Begin() initialize every fields (as we allow user to call Begin/End multiple times on a same instance if they want). - ~ImGuiListClipper() { IM_ASSERT(ItemsCount == -1); } // Assert if user forgot to call End() or Step() until false. - - IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items. - IMGUI_API void Begin(int items_count, float items_height = -1.0f); // Automatically called by constructor if you passed 'items_count' or by Step() in Step 1. - IMGUI_API void End(); // Automatically called on the last call of Step() that returns false. -}; - -// Helpers macros to generate 32-bit encoded colors -#ifdef IMGUI_USE_BGRA_PACKED_COLOR -#define IM_COL32_R_SHIFT 16 -#define IM_COL32_G_SHIFT 8 -#define IM_COL32_B_SHIFT 0 -#define IM_COL32_A_SHIFT 24 -#define IM_COL32_A_MASK 0xFF000000 -#else -#define IM_COL32_R_SHIFT 0 -#define IM_COL32_G_SHIFT 8 -#define IM_COL32_B_SHIFT 16 -#define IM_COL32_A_SHIFT 24 -#define IM_COL32_A_MASK 0xFF000000 -#endif -#define IM_COL32(R,G,B,A) (((ImU32)(A)<>IM_COL32_R_SHIFT)&0xFF) * sc; Value.y = (float)((rgba>>IM_COL32_G_SHIFT)&0xFF) * sc; Value.z = (float)((rgba>>IM_COL32_B_SHIFT)&0xFF) * sc; Value.w = (float)((rgba>>IM_COL32_A_SHIFT)&0xFF) * sc; } - ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; } - ImColor(const ImVec4& col) { Value = col; } - inline operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); } - inline operator ImVec4() const { return Value; } - - // FIXME-OBSOLETE: May need to obsolete/cleanup those helpers. - inline void SetHSV(float h, float s, float v, float a = 1.0f){ ImGui::ColorConvertHSVtoRGB(h, s, v, Value.x, Value.y, Value.z); Value.w = a; } - static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r,g,b,a); } -}; - -//----------------------------------------------------------------------------- -// Draw List API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData) -// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList. -//----------------------------------------------------------------------------- - -// ImDrawCallback: Draw callbacks for advanced uses [configurable type: override in imconfig.h] -// NB: You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering, -// you can poke into the draw list for that! Draw callback may be useful for example to: -// A) Change your GPU render state, -// B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc. -// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd.UserCallback(parent_list, cmd); } else { RenderTriangles() }' -// If you want to override the signature of ImDrawCallback, you can simply use e.g. '#define ImDrawCallback MyDrawCallback' (in imconfig.h) + update rendering back-end accordingly. -#ifndef ImDrawCallback -typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd); -#endif - -// Special Draw callback value to request renderer back-end to reset the graphics/render state. -// The renderer back-end needs to handle this special value, otherwise it will crash trying to call a function at this address. -// This is useful for example if you submitted callbacks which you know have altered the render state and you want it to be restored. -// It is not done by default because they are many perfectly useful way of altering render state for imgui contents (e.g. changing shader/blending settings before an Image call). -#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-1) - -// Typically, 1 command = 1 GPU draw call (unless command is a callback) -// Pre 1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' -// is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices. -struct ImDrawCmd -{ - unsigned int ElemCount; // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[]. - ImVec4 ClipRect; // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates - ImTextureID TextureId; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas. - unsigned int VtxOffset; // Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be >0 to support meshes larger than 64K vertices with 16-bit indices. - unsigned int IdxOffset; // Start offset in index buffer. Always equal to sum of ElemCount drawn so far. - ImDrawCallback UserCallback; // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally. - void* UserCallbackData; // The draw callback code can access this. - - ImDrawCmd() { ElemCount = 0; TextureId = (ImTextureID)NULL; VtxOffset = IdxOffset = 0; UserCallback = NULL; UserCallbackData = NULL; } -}; - -// Vertex index, default to 16-bit -// To allow large meshes with 16-bit indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end (recommended). -// To use 32-bit indices: override with '#define ImDrawIdx unsigned int' in imconfig.h. -#ifndef ImDrawIdx -typedef unsigned short ImDrawIdx; -#endif - -// Vertex layout -#ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT -struct ImDrawVert -{ - ImVec2 pos; - ImVec2 uv; - ImU32 col; -}; -#else -// You can override the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h -// The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine. -// The type has to be described within the macro (you can either declare the struct or use a typedef). This is because ImVec2/ImU32 are likely not declared a the time you'd want to set your type up. -// NOTE: IMGUI DOESN'T CLEAR THE STRUCTURE AND DOESN'T CALL A CONSTRUCTOR SO ANY CUSTOM FIELD WILL BE UNINITIALIZED. IF YOU ADD EXTRA FIELDS (SUCH AS A 'Z' COORDINATES) YOU WILL NEED TO CLEAR THEM DURING RENDER OR TO IGNORE THEM. -IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT; -#endif - -// For use by ImDrawListSplitter. -struct ImDrawChannel -{ - ImVector _CmdBuffer; - ImVector _IdxBuffer; -}; - -// Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order. -// This is used by the Columns api, so items of each column can be batched together in a same draw call. -struct ImDrawListSplitter -{ - int _Current; // Current channel number (0) - int _Count; // Number of active channels (1+) - ImVector _Channels; // Draw channels (not resized down so _Count might be < Channels.Size) - - inline ImDrawListSplitter() { Clear(); } - inline ~ImDrawListSplitter() { ClearFreeMemory(); } - inline void Clear() { _Current = 0; _Count = 1; } // Do not clear Channels[] so our allocations are reused next frame - IMGUI_API void ClearFreeMemory(); - IMGUI_API void Split(ImDrawList* draw_list, int count); - IMGUI_API void Merge(ImDrawList* draw_list); - IMGUI_API void SetCurrentChannel(ImDrawList* draw_list, int channel_idx); -}; - -enum ImDrawCornerFlags_ -{ - ImDrawCornerFlags_None = 0, - ImDrawCornerFlags_TopLeft = 1 << 0, // 0x1 - ImDrawCornerFlags_TopRight = 1 << 1, // 0x2 - ImDrawCornerFlags_BotLeft = 1 << 2, // 0x4 - ImDrawCornerFlags_BotRight = 1 << 3, // 0x8 - ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, // 0x3 - ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, // 0xC - ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, // 0x5 - ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, // 0xA - ImDrawCornerFlags_All = 0xF // In your function calls you may use ~0 (= all bits sets) instead of ImDrawCornerFlags_All, as a convenience -}; - -enum ImDrawListFlags_ -{ - ImDrawListFlags_None = 0, - ImDrawListFlags_AntiAliasedLines = 1 << 0, // Lines are anti-aliased (*2 the number of triangles for 1.0f wide line, otherwise *3 the number of triangles) - ImDrawListFlags_AntiAliasedFill = 1 << 1, // Filled shapes have anti-aliased edges (*2 the number of vertices) - ImDrawListFlags_AllowVtxOffset = 1 << 2 // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled. -}; - -// Draw command list -// This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame, -// all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering. -// Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to -// access the current window draw list and draw custom primitives. -// You can interleave normal ImGui:: calls and adding primitives to the current draw list. -// All positions are generally in pixel coordinates (top-left at (0,0), bottom-right at io.DisplaySize), but you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well) -// Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects. -struct ImDrawList -{ - // This is what you have to render - ImVector CmdBuffer; // Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback. - ImVector IdxBuffer; // Index buffer. Each command consume ImDrawCmd::ElemCount of those - ImVector VtxBuffer; // Vertex buffer. - ImDrawListFlags Flags; // Flags, you may poke into these to adjust anti-aliasing settings per-primitive. - - // [Internal, used while building lists] - const ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context) - const char* _OwnerName; // Pointer to owner window's name for debugging - unsigned int _VtxCurrentOffset; // [Internal] Always 0 unless 'Flags & ImDrawListFlags_AllowVtxOffset'. - unsigned int _VtxCurrentIdx; // [Internal] Generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0. - ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) - ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) - ImVector _ClipRectStack; // [Internal] - ImVector _TextureIdStack; // [Internal] - ImVector _Path; // [Internal] current path building - ImDrawListSplitter _Splitter; // [Internal] for channels api - - // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui) - ImDrawList(const ImDrawListSharedData* shared_data) { _Data = shared_data; _OwnerName = NULL; Clear(); } - ~ImDrawList() { ClearFreeMemory(); } - IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling) - IMGUI_API void PushClipRectFullScreen(); - IMGUI_API void PopClipRect(); - IMGUI_API void PushTextureID(ImTextureID texture_id); - IMGUI_API void PopTextureID(); - inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); } - inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); } - - // Primitives - // - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners. - // - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred). - // In future versions we will use textures to provide cheaper and higher-quality circles. - // Use AddNgon() and AddNgonFilled() functions if you need to guaranteed a specific number of sides. - IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f); - IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1.0f); // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4 bits corresponding to which corner to round - IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); // a: upper-left, b: lower-right (== upper-left + size) - IMGUI_API void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left); - IMGUI_API void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f); - IMGUI_API void AddQuadFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col); - IMGUI_API void AddTriangle(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness = 1.0f); - IMGUI_API void AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col); - IMGUI_API void AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f); - IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 12); - IMGUI_API void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f); - IMGUI_API void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments); - IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL); - IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL); - IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness); - IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order. - IMGUI_API void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); - - // Image primitives - // - Read FAQ to understand what ImTextureID is. - // - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle. - // - "uv_min" and "uv_max" represent the normalized texture coordinates to use for those corners. Using (0,0)->(1,1) texture coordinates will generally display the entire texture. - IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min = ImVec2(0, 0), const ImVec2& uv_max = ImVec2(1, 1), ImU32 col = IM_COL32_WHITE); - IMGUI_API void AddImageQuad(ImTextureID user_texture_id, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& uv1 = ImVec2(0, 0), const ImVec2& uv2 = ImVec2(1, 0), const ImVec2& uv3 = ImVec2(1, 1), const ImVec2& uv4 = ImVec2(0, 1), ImU32 col = IM_COL32_WHITE); - IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); - - // Stateful path API, add points then finish with PathFillConvex() or PathStroke() - inline void PathClear() { _Path.Size = 0; } - inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); } - inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size-1], &pos, 8) != 0) _Path.push_back(pos); } - inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } // Note: Anti-aliased filling requires points to be in clockwise order. - inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; } - IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10); - IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle - IMGUI_API void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0); - IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); - - // Advanced - IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. - IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible - IMGUI_API ImDrawList* CloneOutput() const; // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer. - - // Advanced: Channels - // - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives) - // - Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end) - // - FIXME-OBSOLETE: This API shouldn't have been in ImDrawList in the first place! - // Prefer using your own persistent copy of ImDrawListSplitter as you can stack them. - // Using the ImDrawList::ChannelsXXXX you cannot stack a split over another. - inline void ChannelsSplit(int count) { _Splitter.Split(this, count); } - inline void ChannelsMerge() { _Splitter.Merge(this); } - inline void ChannelsSetCurrent(int n) { _Splitter.SetCurrentChannel(this, n); } - - // Internal helpers - // NB: all primitives needs to be reserved via PrimReserve() beforehand! - IMGUI_API void Clear(); - IMGUI_API void ClearFreeMemory(); - IMGUI_API void PrimReserve(int idx_count, int vtx_count); - IMGUI_API void PrimUnreserve(int idx_count, int vtx_count); - IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles) - IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col); - IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col); - inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; } - inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; } - inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } - IMGUI_API void UpdateClipRect(); - IMGUI_API void UpdateTextureID(); -}; - -// All draw data to render a Dear ImGui frame -// (NB: the style and the naming convention here is a little inconsistent, we currently preserve them for backward compatibility purpose, -// as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList) -struct ImDrawData -{ - bool Valid; // Only valid after Render() is called and before the next NewFrame() is called. - ImDrawList** CmdLists; // Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here. - int CmdListsCount; // Number of ImDrawList* to render - int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size - int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size - ImVec2 DisplayPos; // Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) - ImVec2 DisplaySize; // Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) - ImVec2 FramebufferScale; // Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. - - // Functions - ImDrawData() { Valid = false; Clear(); } - ~ImDrawData() { Clear(); } - void Clear() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.f, 0.f); } // The ImDrawList are owned by ImGuiContext! - IMGUI_API void DeIndexAllBuffers(); // Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering! - IMGUI_API void ScaleClipRects(const ImVec2& fb_scale); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects, or if there is a difference between your window resolution and framebuffer resolution. -}; - -//----------------------------------------------------------------------------- -// Font API (ImFontConfig, ImFontGlyph, ImFontAtlasFlags, ImFontAtlas, ImFontGlyphRangesBuilder, ImFont) -//----------------------------------------------------------------------------- - -struct ImFontConfig -{ - void* FontData; // // TTF/OTF data - int FontDataSize; // // TTF/OTF data size - bool FontDataOwnedByAtlas; // true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself). - int FontNo; // 0 // Index of font within TTF/OTF file - float SizePixels; // // Size in pixels for rasterizer (more or less maps to the resulting font height). - int OversampleH; // 3 // Rasterize at higher quality for sub-pixel positioning. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details. - int OversampleV; // 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis. - bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. - ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now. - ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input. - const ImWchar* GlyphRanges; // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. - float GlyphMinAdvanceX; // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font - float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs - bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. - unsigned int RasterizerFlags; // 0x00 // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one. - float RasterizerMultiply; // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. - ImWchar EllipsisChar; // -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used. - - // [Internal] - char Name[40]; // Name (strictly to ease debugging) - ImFont* DstFont; - - IMGUI_API ImFontConfig(); -}; - -// Hold rendering data for one glyph. -// (Note: some language parsers may fail to convert the 31+1 bitfield members, in this case maybe drop store a single u32 or we can rework this) -struct ImFontGlyph -{ - unsigned int Codepoint : 31; // 0x0000..0xFFFF - unsigned int Visible : 1; // Flag to allow early out when rendering - float AdvanceX; // Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in) - float X0, Y0, X1, Y1; // Glyph corners - float U0, V0, U1, V1; // Texture coordinates -}; - -// Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges(). -// This is essentially a tightly packed of vector of 64k booleans = 8KB storage. -struct ImFontGlyphRangesBuilder -{ - ImVector UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used) - - ImFontGlyphRangesBuilder() { Clear(); } - inline void Clear() { int size_in_bytes = (IM_UNICODE_CODEPOINT_MAX + 1) / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); } - inline bool GetBit(size_t n) const { int off = (int)(n >> 5); ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; } // Get bit n in the array - inline void SetBit(size_t n) { int off = (int)(n >> 5); ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; } // Set bit n in the array - inline void AddChar(ImWchar c) { SetBit(c); } // Add character - IMGUI_API void AddText(const char* text, const char* text_end = NULL); // Add string (each character of the UTF-8 string are added) - IMGUI_API void AddRanges(const ImWchar* ranges); // Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault()) to force add all of ASCII/Latin+Ext - IMGUI_API void BuildRanges(ImVector* out_ranges); // Output new ranges -}; - -// See ImFontAtlas::AddCustomRectXXX functions. -struct ImFontAtlasCustomRect -{ - unsigned int ID; // Input // User ID. Use < 0x110000 to map into a font glyph, >= 0x110000 for other/internal/custom texture data. - unsigned short Width, Height; // Input // Desired rectangle dimension - unsigned short X, Y; // Output // Packed position in Atlas - float GlyphAdvanceX; // Input // For custom font glyphs only (ID < 0x110000): glyph xadvance - ImVec2 GlyphOffset; // Input // For custom font glyphs only (ID < 0x110000): glyph display offset - ImFont* Font; // Input // For custom font glyphs only (ID < 0x110000): target font - ImFontAtlasCustomRect() { ID = 0xFFFFFFFF; Width = Height = 0; X = Y = 0xFFFF; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0,0); Font = NULL; } - bool IsPacked() const { return X != 0xFFFF; } -}; - -enum ImFontAtlasFlags_ -{ - ImFontAtlasFlags_None = 0, - ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, // Don't round the height to next power of two - ImFontAtlasFlags_NoMouseCursors = 1 << 1 // Don't build software mouse cursors into the atlas -}; - -// Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding: -// - One or more fonts. -// - Custom graphics data needed to render the shapes needed by Dear ImGui. -// - Mouse cursor shapes for software cursor rendering (unless setting 'Flags |= ImFontAtlasFlags_NoMouseCursors' in the font atlas). -// It is the user-code responsibility to setup/build the atlas, then upload the pixel data into a texture accessible by your graphics api. -// - Optionally, call any of the AddFont*** functions. If you don't call any, the default font embedded in the code will be loaded for you. -// - Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data. -// - Upload the pixels data into a texture within your graphics system (see imgui_impl_xxxx.cpp examples) -// - Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture in a format natural to your graphics API. -// This value will be passed back to you during rendering to identify the texture. Read FAQ entry about ImTextureID for more details. -// Common pitfalls: -// - If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the -// atlas is build (when calling GetTexData*** or Build()). We only copy the pointer, not the data. -// - Important: By default, AddFontFromMemoryTTF() takes ownership of the data. Even though we are not writing to it, we will free the pointer on destruction. -// You can set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed, -// - Even though many functions are suffixed with "TTF", OTF data is supported just as well. -// - This is an old API and it is currently awkward for those and and various other reasons! We will address them in the future! -struct ImFontAtlas -{ - IMGUI_API ImFontAtlas(); - IMGUI_API ~ImFontAtlas(); - IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg); - IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL); - IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); - IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed. - IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp. - IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter. - IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts. - IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory. - IMGUI_API void ClearFonts(); // Clear output font data (glyphs storage, UV coordinates). - IMGUI_API void Clear(); // Clear all input and output. - - // Build atlas, retrieve pixel data. - // User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID(). - // The pitch is always = Width * BytesPerPixels (1 or 4) - // Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into - // the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste. - IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions. - IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel - IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel - bool IsBuilt() const { return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); } - void SetTexID(ImTextureID id) { TexID = id; } - - //------------------------------------------- - // Glyph Ranges - //------------------------------------------- - - // Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list) - // NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details. - // NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data. - IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin - IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters - IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs - IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs - IMGUI_API const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese - IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters - IMGUI_API const ImWchar* GetGlyphRangesThai(); // Default + Thai characters - IMGUI_API const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters - - //------------------------------------------- - // [BETA] Custom Rectangles/Glyphs API - //------------------------------------------- - - // You can request arbitrary rectangles to be packed into the atlas, for your own purposes. - // After calling Build(), you can query the rectangle position and render your pixels. - // You can also request your rectangles to be mapped as font glyph (given a font + Unicode point), - // so you can render e.g. custom colorful icons and use them as regular glyphs. - // Read docs/FONTS.txt for more details about using colorful icons. - IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x110000. Id >= 0x80000000 are reserved for ImGui and ImDrawList - IMGUI_API int AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0)); // Id needs to be < 0x110000 to register a rectangle to map into a specific font. - const ImFontAtlasCustomRect*GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; } - - // [Internal] - IMGUI_API void CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const; - IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]); - - //------------------------------------------- - // Members - //------------------------------------------- - - bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert. - ImFontAtlasFlags Flags; // Build flags (see ImFontAtlasFlags_) - ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure. - int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. - int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0. - - // [Internal] - // NB: Access texture data via GetTexData*() calls! Which will setup a default font for you. - unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight - unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4 - int TexWidth; // Texture width calculated during Build(). - int TexHeight; // Texture height calculated during Build(). - ImVec2 TexUvScale; // = (1.0f/TexWidth, 1.0f/TexHeight) - ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel - ImVector Fonts; // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font. - ImVector CustomRects; // Rectangles for packing custom texture data into the atlas. - ImVector ConfigData; // Internal data - int CustomRectIds[1]; // Identifiers of custom texture rectangle used by ImFontAtlas/ImDrawList - -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+ - typedef ImFontGlyphRangesBuilder GlyphRangesBuilder; // OBSOLETED in 1.67+ -#endif -}; - -// Font runtime data and rendering -// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32(). -struct ImFont -{ - // Members: Hot ~20/24 bytes (for CalcTextSize) - ImVector IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI). - float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX - float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading) - - // Members: Hot ~36/48 bytes (for CalcTextSize + render loop) - ImVector IndexLookup; // 12-16 // out // // Sparse. Index glyphs by Unicode code-point. - ImVector Glyphs; // 12-16 // out // // All glyphs. - const ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar) - ImVec2 DisplayOffset; // 8 // in // = (0,0) // Offset font rendering by xx pixels - - // Members: Cold ~32/40 bytes - ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into - const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData - short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont. - ImWchar FallbackChar; // 2 // in // = '?' // Replacement character if a glyph isn't found. Only set via SetFallbackChar() - ImWchar EllipsisChar; // 2 // out // = -1 // Character used for ellipsis rendering. - bool DirtyLookupTables; // 1 // out // - float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale() - float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] - int MetricsTotalSurface;// 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs) - ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX+1)/4096/8]; // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations accross all used codepoints. - - // Methods - IMGUI_API ImFont(); - IMGUI_API ~ImFont(); - IMGUI_API const ImFontGlyph*FindGlyph(ImWchar c) const; - IMGUI_API const ImFontGlyph*FindGlyphNoFallback(ImWchar c) const; - float GetCharAdvance(ImWchar c) const { return ((int)c < IndexAdvanceX.Size) ? IndexAdvanceX[(int)c] : FallbackAdvanceX; } - bool IsLoaded() const { return ContainerAtlas != NULL; } - const char* GetDebugName() const { return ConfigData ? ConfigData->Name : ""; } - - // 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. - // 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. - IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8 - IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const; - IMGUI_API void RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const; - IMGUI_API void RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const; - - // [Internal] Don't use! - IMGUI_API void BuildLookupTable(); - IMGUI_API void ClearOutputData(); - IMGUI_API void GrowIndex(int new_size); - IMGUI_API void AddGlyph(ImWchar c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x); - IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. - IMGUI_API void SetGlyphVisible(ImWchar c, bool visible); - IMGUI_API void SetFallbackChar(ImWchar c); - IMGUI_API bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last); -}; - -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - -// Include imgui_user.h at the end of imgui.h (convenient for user to only explicitly include vanilla imgui.h) -#ifdef IMGUI_INCLUDE_IMGUI_USER_H -#include "imgui_user.h" -#endif - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imgui_demo.cpp b/include/imgui/imgui_demo.cpp deleted file mode 100644 index 1e110ded..00000000 --- a/include/imgui/imgui_demo.cpp +++ /dev/null @@ -1,4917 +0,0 @@ -// dear imgui, v1.76 -// (demo code) - -// Help: -// - Read FAQ at http://dearimgui.org/faq -// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. -// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. All applications in examples/ are doing that. -// Read imgui.cpp for more details, documentation and comments. -// Get latest version at https://github.com/ocornut/imgui - -// Message to the person tempted to delete this file when integrating Dear ImGui into their code base: -// Do NOT remove this file from your project! Think again! It is the most useful reference code that you and other coders -// will want to refer to and call. Have the ImGui::ShowDemoWindow() function wired in an always-available debug menu of -// your game/app! Removing this file from your project is hindering access to documentation for everyone in your team, -// likely leading you to poorer usage of the library. -// Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow(). -// If you want to link core Dear ImGui in your shipped builds but want a thorough guarantee that the demo will not be linked, -// you can setup your imconfig.h with #define IMGUI_DISABLE_DEMO_WINDOWS and those functions will be empty. -// In other situation, whenever you have Dear ImGui available you probably want this to be available for reference. -// Thank you, -// -Your beloved friend, imgui_demo.cpp (which you won't delete) - -// Message to beginner C/C++ programmers about the meaning of the 'static' keyword: -// In this demo code, we frequently we use 'static' variables inside functions. A static variable persist across calls, so it is -// essentially like a global variable but declared inside the scope of the function. We do this as a way to gather code and data -// in the same place, to make the demo source code faster to read, faster to write, and smaller in size. -// It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be -// reentrant or used in multiple threads. This might be a pattern you will want to use in your code, but most of the real data -// you would be editing is likely going to be stored outside your functions. - -// The Demo code in this file is designed to be easy to copy-and-paste in into your application! -// Because of this: -// - We never omit the ImGui:: namespace when calling functions, even though most of our code is already in the same namespace. -// - We try to declare static variables in the local scope, as close as possible to the code using them. -// - We never use any of the helpers/facilities used internally by Dear ImGui, unless it has been exposed in the public API (imgui.h). -// - We never use maths operators on ImVec2/ImVec4. For other of our sources files, they are provided by imgui_internal.h w/ IMGUI_DEFINE_MATH_OPERATORS. -// For your own sources file they are optional and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h. -// Because we don't want to assume anything about your support of maths operators, we don't use them in imgui_demo.cpp. - -/* - -Index of this file: - -// [SECTION] Forward Declarations, Helpers -// [SECTION] Demo Window / ShowDemoWindow() -// [SECTION] About Window / ShowAboutWindow() -// [SECTION] Style Editor / ShowStyleEditor() -// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() -// [SECTION] Example App: Debug Console / ShowExampleAppConsole() -// [SECTION] Example App: Debug Log / ShowExampleAppLog() -// [SECTION] Example App: Simple Layout / ShowExampleAppLayout() -// [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() -// [SECTION] Example App: Long Text / ShowExampleAppLongText() -// [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() -// [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() -// [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() -// [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() -// [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() -// [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() - -*/ - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include "imgui.h" -#ifndef IMGUI_DISABLE - -#include // toupper -#include // INT_MIN, INT_MAX -#include // sqrtf, powf, cosf, sinf, floorf, ceilf -#include // vsnprintf, sscanf, printf -#include // NULL, malloc, free, atoi -#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier -#include // intptr_t -#else -#include // intptr_t -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen -#endif -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code) -#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' -#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal -#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. -#pragma clang diagnostic ignored "-Wunused-macros" // warning : warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used. -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 -#endif -#if __has_warning("-Wdouble-promotion") -#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. -#endif -#if __has_warning("-Wreserved-id-macro") -#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // -#endif -#elif defined(__GNUC__) -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size -#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure) -#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function -#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value -#pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub. -#endif - -// Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!) -#ifdef _WIN32 -#define IM_NEWLINE "\r\n" -#else -#define IM_NEWLINE "\n" -#endif - -#if defined(_MSC_VER) && !defined(snprintf) -#define snprintf _snprintf -#endif -#if defined(_MSC_VER) && !defined(vsnprintf) -#define vsnprintf _vsnprintf -#endif - -//----------------------------------------------------------------------------- -// [SECTION] Forward Declarations, Helpers -//----------------------------------------------------------------------------- - -#if !defined(IMGUI_DISABLE_DEMO_WINDOWS) - -// Forward Declarations -static void ShowExampleAppDocuments(bool* p_open); -static void ShowExampleAppMainMenuBar(); -static void ShowExampleAppConsole(bool* p_open); -static void ShowExampleAppLog(bool* p_open); -static void ShowExampleAppLayout(bool* p_open); -static void ShowExampleAppPropertyEditor(bool* p_open); -static void ShowExampleAppLongText(bool* p_open); -static void ShowExampleAppAutoResize(bool* p_open); -static void ShowExampleAppConstrainedResize(bool* p_open); -static void ShowExampleAppSimpleOverlay(bool* p_open); -static void ShowExampleAppWindowTitles(bool* p_open); -static void ShowExampleAppCustomRendering(bool* p_open); -static void ShowExampleMenuFile(); - -// Helper to display a little (?) mark which shows a tooltip when hovered. -// In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.txt) -static void HelpMarker(const char* desc) -{ - ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); - ImGui::TextUnformatted(desc); - ImGui::PopTextWrapPos(); - ImGui::EndTooltip(); - } -} - -// Helper to display basic user controls. -void ImGui::ShowUserGuide() -{ - ImGuiIO& io = ImGui::GetIO(); - ImGui::BulletText("Double-click on title bar to collapse window."); - ImGui::BulletText("Click and drag on lower corner to resize window\n(double-click to auto fit window to its contents)."); - ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text."); - ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields."); - if (io.FontAllowUserScaling) - ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents."); - ImGui::BulletText("While inputing text:\n"); - ImGui::Indent(); - ImGui::BulletText("CTRL+Left/Right to word jump."); - ImGui::BulletText("CTRL+A or double-click to select all."); - ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste."); - ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo."); - ImGui::BulletText("ESCAPE to revert."); - ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract."); - ImGui::Unindent(); - ImGui::BulletText("With keyboard navigation enabled:"); - ImGui::Indent(); - ImGui::BulletText("Arrow keys to navigate."); - ImGui::BulletText("Space to activate a widget."); - ImGui::BulletText("Return to input text into a widget."); - ImGui::BulletText("Escape to deactivate a widget, close popup, exit child window."); - ImGui::BulletText("Alt to jump to the menu layer of a window."); - ImGui::BulletText("CTRL+Tab to select a window."); - ImGui::Unindent(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Demo Window / ShowDemoWindow() -//----------------------------------------------------------------------------- -// - ShowDemoWindowWidgets() -// - ShowDemoWindowLayout() -// - ShowDemoWindowPopups() -// - ShowDemoWindowColumns() -// - ShowDemoWindowMisc() -//----------------------------------------------------------------------------- - -// We split the contents of the big ShowDemoWindow() function into smaller functions (because the link time of very large functions grow non-linearly) -static void ShowDemoWindowWidgets(); -static void ShowDemoWindowLayout(); -static void ShowDemoWindowPopups(); -static void ShowDemoWindowColumns(); -static void ShowDemoWindowMisc(); - -// Demonstrate most Dear ImGui features (this is big function!) -// You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature. -void ImGui::ShowDemoWindow(bool* p_open) -{ - IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!"); // Exceptionally add an extra assert here for people confused with initial dear imgui setup - - // Examples Apps (accessible from the "Examples" menu) - static bool show_app_documents = false; - static bool show_app_main_menu_bar = false; - static bool show_app_console = false; - static bool show_app_log = false; - static bool show_app_layout = false; - static bool show_app_property_editor = false; - static bool show_app_long_text = false; - static bool show_app_auto_resize = false; - static bool show_app_constrained_resize = false; - static bool show_app_simple_overlay = false; - static bool show_app_window_titles = false; - static bool show_app_custom_rendering = false; - - if (show_app_documents) ShowExampleAppDocuments(&show_app_documents); - if (show_app_main_menu_bar) ShowExampleAppMainMenuBar(); - if (show_app_console) ShowExampleAppConsole(&show_app_console); - if (show_app_log) ShowExampleAppLog(&show_app_log); - if (show_app_layout) ShowExampleAppLayout(&show_app_layout); - if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor); - if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text); - if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize); - if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize); - if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay); - if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles); - if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering); - - // Dear ImGui Apps (accessible from the "Tools" menu) - static bool show_app_metrics = false; - static bool show_app_style_editor = false; - static bool show_app_about = false; - - if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); } - if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); } - if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); } - - // Demonstrate the various window flags. Typically you would just use the default! - static bool no_titlebar = false; - static bool no_scrollbar = false; - static bool no_menu = false; - static bool no_move = false; - static bool no_resize = false; - static bool no_collapse = false; - static bool no_close = false; - static bool no_nav = false; - static bool no_background = false; - static bool no_bring_to_front = false; - - ImGuiWindowFlags window_flags = 0; - if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar; - if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar; - if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar; - if (no_move) window_flags |= ImGuiWindowFlags_NoMove; - if (no_resize) window_flags |= ImGuiWindowFlags_NoResize; - if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse; - if (no_nav) window_flags |= ImGuiWindowFlags_NoNav; - if (no_background) window_flags |= ImGuiWindowFlags_NoBackground; - if (no_bring_to_front) window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus; - if (no_close) p_open = NULL; // Don't pass our bool* to Begin - - // We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming. - ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver); - ImGui::SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver); - - // Main body of the Demo window starts here. - if (!ImGui::Begin("Dear ImGui Demo", p_open, window_flags)) - { - // Early out if the window is collapsed, as an optimization. - ImGui::End(); - return; - } - - // Most "big" widgets share a common width settings by default. - //ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // Use 2/3 of the space for widgets and 1/3 for labels (default) - ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size. - - // Menu Bar - if (ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("Menu")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Examples")) - { - ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar); - ImGui::MenuItem("Console", NULL, &show_app_console); - ImGui::MenuItem("Log", NULL, &show_app_log); - ImGui::MenuItem("Simple layout", NULL, &show_app_layout); - ImGui::MenuItem("Property editor", NULL, &show_app_property_editor); - ImGui::MenuItem("Long text display", NULL, &show_app_long_text); - ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize); - ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize); - ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay); - ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles); - ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering); - ImGui::MenuItem("Documents", NULL, &show_app_documents); - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Tools")) - { - ImGui::MenuItem("Metrics", NULL, &show_app_metrics); - ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor); - ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about); - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - - ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION); - ImGui::Spacing(); - - if (ImGui::CollapsingHeader("Help")) - { - ImGui::Text("ABOUT THIS DEMO:"); - ImGui::BulletText("Sections below are demonstrating many aspects of the library."); - ImGui::BulletText("The \"Examples\" menu above leads to more demo contents."); - ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n" - "and Metrics (general purpose Dear ImGui debugging tool)."); - ImGui::Separator(); - - ImGui::Text("PROGRAMMER GUIDE:"); - ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!"); - ImGui::BulletText("See comments in imgui.cpp."); - ImGui::BulletText("See example applications in the examples/ folder."); - ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/"); - ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls."); - ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls."); - ImGui::Separator(); - - ImGui::Text("USER GUIDE:"); - ImGui::ShowUserGuide(); - } - - if (ImGui::CollapsingHeader("Configuration")) - { - ImGuiIO& io = ImGui::GetIO(); - - if (ImGui::TreeNode("Configuration##2")) - { - ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard); - ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad); - ImGui::SameLine(); HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details."); - ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos); - ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos."); - ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouse); - if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) // Create a way to restore this flag otherwise we could be stuck completely! - { - if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f) - { - ImGui::SameLine(); - ImGui::Text("<>"); - } - if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) - io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse; - } - ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange); - ImGui::SameLine(); HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility."); - ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink); - ImGui::SameLine(); HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting"); - ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges); - ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); - ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); - ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); - ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); - ImGui::TreePop(); - ImGui::Separator(); - } - - if (ImGui::TreeNode("Backend Flags")) - { - HelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.\nHere we expose then as read-only fields to avoid breaking interactions with your back-end."); - ImGuiBackendFlags backend_flags = io.BackendFlags; // Make a local copy to avoid modifying actual back-end flags. - ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad); - ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors); - ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasSetMousePos); - ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", (unsigned int *)&backend_flags, ImGuiBackendFlags_RendererHasVtxOffset); - ImGui::TreePop(); - ImGui::Separator(); - } - - if (ImGui::TreeNode("Style")) - { - HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function."); - ImGui::ShowStyleEditor(); - ImGui::TreePop(); - ImGui::Separator(); - } - - if (ImGui::TreeNode("Capture/Logging")) - { - ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded."); - HelpMarker("Try opening any of the contents below in this window and then click one of the \"Log To\" button."); - ImGui::LogButtons(); - ImGui::TextWrapped("You can also call ImGui::LogText() to output directly to the log without a visual output."); - if (ImGui::Button("Copy \"Hello, world!\" to clipboard")) - { - ImGui::LogToClipboard(); - ImGui::LogText("Hello, world!"); - ImGui::LogFinish(); - } - ImGui::TreePop(); - } - } - - if (ImGui::CollapsingHeader("Window options")) - { - ImGui::Checkbox("No titlebar", &no_titlebar); ImGui::SameLine(150); - ImGui::Checkbox("No scrollbar", &no_scrollbar); ImGui::SameLine(300); - ImGui::Checkbox("No menu", &no_menu); - ImGui::Checkbox("No move", &no_move); ImGui::SameLine(150); - ImGui::Checkbox("No resize", &no_resize); ImGui::SameLine(300); - ImGui::Checkbox("No collapse", &no_collapse); - ImGui::Checkbox("No close", &no_close); ImGui::SameLine(150); - ImGui::Checkbox("No nav", &no_nav); ImGui::SameLine(300); - ImGui::Checkbox("No background", &no_background); - ImGui::Checkbox("No bring to front", &no_bring_to_front); - } - - // All demo contents - ShowDemoWindowWidgets(); - ShowDemoWindowLayout(); - ShowDemoWindowPopups(); - ShowDemoWindowColumns(); - ShowDemoWindowMisc(); - - // End of ShowDemoWindow() - ImGui::End(); -} - -static void ShowDemoWindowWidgets() -{ - if (!ImGui::CollapsingHeader("Widgets")) - return; - - if (ImGui::TreeNode("Basic")) - { - static int clicked = 0; - if (ImGui::Button("Button")) - clicked++; - if (clicked & 1) - { - ImGui::SameLine(); - ImGui::Text("Thanks for clicking me!"); - } - - static bool check = true; - ImGui::Checkbox("checkbox", &check); - - static int e = 0; - ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine(); - ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine(); - ImGui::RadioButton("radio c", &e, 2); - - // Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style. - for (int i = 0; i < 7; i++) - { - if (i > 0) - ImGui::SameLine(); - ImGui::PushID(i); - ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.7f)); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i/7.0f, 0.8f, 0.8f)); - ImGui::Button("Click"); - ImGui::PopStyleColor(3); - ImGui::PopID(); - } - - // Use AlignTextToFramePadding() to align text baseline to the baseline of framed elements (otherwise a Text+SameLine+Button sequence will have the text a little too high by default) - ImGui::AlignTextToFramePadding(); - ImGui::Text("Hold to repeat:"); - ImGui::SameLine(); - - // Arrow buttons with Repeater - static int counter = 0; - float spacing = ImGui::GetStyle().ItemInnerSpacing.x; - ImGui::PushButtonRepeat(true); - if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; } - ImGui::SameLine(0.0f, spacing); - if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; } - ImGui::PopButtonRepeat(); - ImGui::SameLine(); - ImGui::Text("%d", counter); - - ImGui::Text("Hover over me"); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip("I am a tooltip"); - - ImGui::SameLine(); - ImGui::Text("- or me"); - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - ImGui::Text("I am a fancy tooltip"); - static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; - ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); - ImGui::EndTooltip(); - } - - ImGui::Separator(); - - ImGui::LabelText("label", "Value"); - - { - // Using the _simplified_ one-liner Combo() api here - // See "Combo" section for examples of how to use the more complete BeginCombo()/EndCombo() api. - const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; - static int item_current = 0; - ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); - ImGui::SameLine(); HelpMarker("Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n"); - } - - { - // To wire InputText() with std::string or any other custom string type, - // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file. - static char str0[128] = "Hello, world!"; - ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0)); - ImGui::SameLine(); HelpMarker("USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp)."); - - static char str1[128] = ""; - ImGui::InputTextWithHint("input text (w/ hint)", "enter text here", str1, IM_ARRAYSIZE(str1)); - - static int i0 = 123; - ImGui::InputInt("input int", &i0); - ImGui::SameLine(); HelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n"); - - static float f0 = 0.001f; - ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f"); - - static double d0 = 999999.00000001; - ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f"); - - static float f1 = 1.e10f; - ImGui::InputFloat("input scientific", &f1, 0.0f, 0.0f, "%e"); - ImGui::SameLine(); HelpMarker("You can input value using the scientific notation,\n e.g. \"1e+8\" becomes \"100000000\".\n"); - - static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; - ImGui::InputFloat3("input float3", vec4a); - } - - { - static int i1 = 50, i2 = 42; - ImGui::DragInt("drag int", &i1, 1); - ImGui::SameLine(); HelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value."); - - ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%"); - - static float f1=1.00f, f2=0.0067f; - ImGui::DragFloat("drag float", &f1, 0.005f); - ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns"); - } - - { - static int i1=0; - ImGui::SliderInt("slider int", &i1, -1, 3); - ImGui::SameLine(); HelpMarker("CTRL+click to input value."); - - static float f1=0.123f, f2=0.0f; - ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f"); - ImGui::SliderFloat("slider float (curve)", &f2, -10.0f, 10.0f, "%.4f", 2.0f); - - static float angle = 0.0f; - ImGui::SliderAngle("slider angle", &angle); - - // Using the format string to display a name instead of an integer. - // Here we completely omit '%d' from the format string, so it'll only display a name. - // This technique can also be used with DragInt(). - enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT }; - const char* element_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" }; - static int current_element = Element_Fire; - const char* current_element_name = (current_element >= 0 && current_element < Element_COUNT) ? element_names[current_element] : "Unknown"; - ImGui::SliderInt("slider enum", ¤t_element, 0, Element_COUNT - 1, current_element_name); - ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer."); - } - - { - static float col1[3] = { 1.0f,0.0f,0.2f }; - static float col2[4] = { 0.4f,0.7f,0.0f,0.5f }; - ImGui::ColorEdit3("color 1", col1); - ImGui::SameLine(); HelpMarker("Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n"); - - ImGui::ColorEdit4("color 2", col2); - } - - { - // List box - const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" }; - static int listbox_item_current = 1; - ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4); - - //static int listbox_item_current2 = 2; - //ImGui::SetNextItemWidth(-1); - //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4); - } - - ImGui::TreePop(); - } - - // Testing ImGuiOnceUponAFrame helper. - //static ImGuiOnceUponAFrame once; - //for (int i = 0; i < 5; i++) - // if (once) - // ImGui::Text("This will be displayed only once."); - - if (ImGui::TreeNode("Trees")) - { - if (ImGui::TreeNode("Basic trees")) - { - for (int i = 0; i < 5; i++) - { - // Use SetNextItemOpen() so set the default state of a node to be open. - // We could also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing! - if (i == 0) - ImGui::SetNextItemOpen(true, ImGuiCond_Once); - - if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i)) - { - ImGui::Text("blah blah"); - ImGui::SameLine(); - if (ImGui::SmallButton("button")) {} - ImGui::TreePop(); - } - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Advanced, with Selectable nodes")) - { - HelpMarker("This is a more typical looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open."); - static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth; - static bool align_label_with_current_x_position = false; - ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnArrow", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_OpenOnArrow); - ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick); - ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::SameLine(); HelpMarker("Extend hit area to all available width instead of allowing more items to be layed out after the node."); - ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_SpanFullWidth); - ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position); - ImGui::Text("Hello!"); - if (align_label_with_current_x_position) - ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing()); - - static int selection_mask = (1 << 2); // Dumb representation of what may be user-side selection state. You may carry selection state inside or outside your objects in whatever format you see fit. - int node_clicked = -1; // Temporary storage of what node we have clicked to process selection at the end of the loop. May be a pointer to your own node type, etc. - for (int i = 0; i < 6; i++) - { - // Disable the default open on single-click behavior and pass in Selected flag according to our selection state. - ImGuiTreeNodeFlags node_flags = base_flags; - const bool is_selected = (selection_mask & (1 << i)) != 0; - if (is_selected) - node_flags |= ImGuiTreeNodeFlags_Selected; - if (i < 3) - { - // Items 0..2 are Tree Node - bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i); - if (ImGui::IsItemClicked()) - node_clicked = i; - if (node_open) - { - ImGui::BulletText("Blah blah\nBlah Blah"); - ImGui::TreePop(); - } - } - else - { - // Items 3..5 are Tree Leaves - // The only reason we use TreeNode at all is to allow selection of the leaf. - // Otherwise we can use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text(). - node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet - ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i); - if (ImGui::IsItemClicked()) - node_clicked = i; - } - } - if (node_clicked != -1) - { - // Update selection state. Process outside of tree loop to avoid visual inconsistencies during the clicking-frame. - if (ImGui::GetIO().KeyCtrl) - selection_mask ^= (1 << node_clicked); // CTRL+click to toggle - else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, this commented bit preserve selection when clicking on item that is part of the selection - selection_mask = (1 << node_clicked); // Click to single-select - } - if (align_label_with_current_x_position) - ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing()); - ImGui::TreePop(); - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Collapsing Headers")) - { - static bool closable_group = true; - ImGui::Checkbox("Show 2nd header", &closable_group); - if (ImGui::CollapsingHeader("Header", ImGuiTreeNodeFlags_None)) - { - ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); - for (int i = 0; i < 5; i++) - ImGui::Text("Some content %d", i); - } - if (ImGui::CollapsingHeader("Header with a close button", &closable_group)) - { - ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); - for (int i = 0; i < 5; i++) - ImGui::Text("More content %d", i); - } - /* - if (ImGui::CollapsingHeader("Header with a bullet", ImGuiTreeNodeFlags_Bullet)) - ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); - */ - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Bullets")) - { - ImGui::BulletText("Bullet point 1"); - ImGui::BulletText("Bullet point 2\nOn multiple lines"); - if (ImGui::TreeNode("Tree node")) - { - ImGui::BulletText("Another bullet point"); - ImGui::TreePop(); - } - ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)"); - ImGui::Bullet(); ImGui::SmallButton("Button"); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Text")) - { - if (ImGui::TreeNode("Colored Text")) - { - // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility. - ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink"); - ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow"); - ImGui::TextDisabled("Disabled"); - ImGui::SameLine(); HelpMarker("The TextDisabled color is stored in ImGuiStyle."); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Word Wrapping")) - { - // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility. - ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages."); - ImGui::Spacing(); - - static float wrap_width = 200.0f; - ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f"); - - ImGui::Text("Test paragraph 1:"); - ImVec2 pos = ImGui::GetCursorScreenPos(); - ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); - ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); - ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width); - ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); - ImGui::PopTextWrapPos(); - - ImGui::Text("Test paragraph 2:"); - pos = ImGui::GetCursorScreenPos(); - ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); - ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); - ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh"); - ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); - ImGui::PopTextWrapPos(); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("UTF-8 Text")) - { - // UTF-8 test with Japanese characters - // (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read docs/FONTS.txt for details.) - // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8 - // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature') - // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE. - // Instead we are encoding a few strings with hexadecimal constants. Don't do this in your application! - // Please use u8"text in any language" in your application! - // Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application. - ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read docs/FONTS.txt for details."); - ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string. - ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)"); - static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e"; - //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis - ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf)); - ImGui::TreePop(); - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Images")) - { - ImGuiIO& io = ImGui::GetIO(); - ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!"); - - // Here we are grabbing the font texture because that's the only one we have access to inside the demo code. - // Remember that ImTextureID is just storage for whatever you want it to be, it is essentially a value that will be passed to the render function inside the ImDrawCmd structure. - // If you use one of the default imgui_impl_XXXX.cpp renderer, they all have comments at the top of their file to specify what they expect to be stored in ImTextureID. - // (for example, the imgui_impl_dx11.cpp renderer expect a 'ID3D11ShaderResourceView*' pointer. The imgui_impl_opengl3.cpp renderer expect a GLuint OpenGL texture identifier etc.) - // If you decided that ImTextureID = MyEngineTexture*, then you can pass your MyEngineTexture* pointers to ImGui::Image(), and gather width/height through your own functions, etc. - // Using ShowMetricsWindow() as a "debugger" to inspect the draw data that are being passed to your render will help you debug issues if you are confused about this. - // Consider using the lower-level ImDrawList::AddImage() API, via ImGui::GetWindowDrawList()->AddImage(). - ImTextureID my_tex_id = io.Fonts->TexID; - float my_tex_w = (float)io.Fonts->TexWidth; - float my_tex_h = (float)io.Fonts->TexHeight; - - ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h); - ImVec2 pos = ImGui::GetCursorScreenPos(); - ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), ImVec2(0,0), ImVec2(1,1), ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4(1.0f,1.0f,1.0f,0.5f)); - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - float region_sz = 32.0f; - float region_x = io.MousePos.x - pos.x - region_sz * 0.5f; if (region_x < 0.0f) region_x = 0.0f; else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz; - float region_y = io.MousePos.y - pos.y - region_sz * 0.5f; if (region_y < 0.0f) region_y = 0.0f; else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz; - float zoom = 4.0f; - ImGui::Text("Min: (%.2f, %.2f)", region_x, region_y); - ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz); - ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h); - ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h); - ImGui::Image(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ImVec4(1.0f, 1.0f, 1.0f, 0.5f)); - ImGui::EndTooltip(); - } - ImGui::TextWrapped("And now some textured buttons.."); - static int pressed_count = 0; - for (int i = 0; i < 8; i++) - { - ImGui::PushID(i); - int frame_padding = -1 + i; // -1 = uses default padding - if (ImGui::ImageButton(my_tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/my_tex_w,32/my_tex_h), frame_padding, ImVec4(0.0f,0.0f,0.0f,1.0f))) - pressed_count += 1; - ImGui::PopID(); - ImGui::SameLine(); - } - ImGui::NewLine(); - ImGui::Text("Pressed %d times.", pressed_count); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Combo")) - { - // Expose flags as checkbox for the demo - static ImGuiComboFlags flags = 0; - ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", (unsigned int*)&flags, ImGuiComboFlags_PopupAlignLeft); - ImGui::SameLine(); HelpMarker("Only makes a difference if the popup is larger than the combo"); - if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", (unsigned int*)&flags, ImGuiComboFlags_NoArrowButton)) - flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both - if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", (unsigned int*)&flags, ImGuiComboFlags_NoPreview)) - flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both - - // General BeginCombo() API, you have full control over your selection data and display type. - // (your selection data could be an index, a pointer to the object, an id for the object, a flag stored in the object itself, etc.) - const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; - static const char* item_current = items[0]; // Here our selection is a single pointer stored outside the object. - if (ImGui::BeginCombo("combo 1", item_current, flags)) // The second parameter is the label previewed before opening the combo. - { - for (int n = 0; n < IM_ARRAYSIZE(items); n++) - { - bool is_selected = (item_current == items[n]); - if (ImGui::Selectable(items[n], is_selected)) - item_current = items[n]; - if (is_selected) - ImGui::SetItemDefaultFocus(); // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch) - } - ImGui::EndCombo(); - } - - // Simplified one-liner Combo() API, using values packed in a single constant string - static int item_current_2 = 0; - ImGui::Combo("combo 2 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); - - // Simplified one-liner Combo() using an array of const char* - static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview - ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items)); - - // Simplified one-liner Combo() using an accessor function - struct FuncHolder { static bool ItemGetter(void* data, int idx, const char** out_str) { *out_str = ((const char**)data)[idx]; return true; } }; - static int item_current_4 = 0; - ImGui::Combo("combo 4 (function)", &item_current_4, &FuncHolder::ItemGetter, items, IM_ARRAYSIZE(items)); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Selectables")) - { - // Selectable() has 2 overloads: - // - The one taking "bool selected" as a read-only selection information. When Selectable() has been clicked is returns true and you can alter selection state accordingly. - // - The one taking "bool* p_selected" as a read-write selection information (convenient in some cases) - // The earlier is more flexible, as in real application your selection may be stored in a different manner (in flags within objects, as an external list, etc). - if (ImGui::TreeNode("Basic")) - { - static bool selection[5] = { false, true, false, false, false }; - ImGui::Selectable("1. I am selectable", &selection[0]); - ImGui::Selectable("2. I am selectable", &selection[1]); - ImGui::Text("3. I am not selectable"); - ImGui::Selectable("4. I am selectable", &selection[3]); - if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick)) - if (ImGui::IsMouseDoubleClicked(0)) - selection[4] = !selection[4]; - ImGui::TreePop(); - } - if (ImGui::TreeNode("Selection State: Single Selection")) - { - static int selected = -1; - for (int n = 0; n < 5; n++) - { - char buf[32]; - sprintf(buf, "Object %d", n); - if (ImGui::Selectable(buf, selected == n)) - selected = n; - } - ImGui::TreePop(); - } - if (ImGui::TreeNode("Selection State: Multiple Selection")) - { - HelpMarker("Hold CTRL and click to select multiple items."); - static bool selection[5] = { false, false, false, false, false }; - for (int n = 0; n < 5; n++) - { - char buf[32]; - sprintf(buf, "Object %d", n); - if (ImGui::Selectable(buf, selection[n])) - { - if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held - memset(selection, 0, sizeof(selection)); - selection[n] ^= 1; - } - } - ImGui::TreePop(); - } - if (ImGui::TreeNode("Rendering more text into the same line")) - { - // Using the Selectable() override that takes "bool* p_selected" parameter and toggle your booleans automatically. - static bool selected[3] = { false, false, false }; - ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); - ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes"); - ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); - ImGui::TreePop(); - } - if (ImGui::TreeNode("In columns")) - { - ImGui::Columns(3, NULL, false); - static bool selected[16] = {}; - for (int i = 0; i < 16; i++) - { - char label[32]; sprintf(label, "Item %d", i); - if (ImGui::Selectable(label, &selected[i])) {} - ImGui::NextColumn(); - } - ImGui::Columns(1); - ImGui::TreePop(); - } - if (ImGui::TreeNode("Grid")) - { - static bool selected[4*4] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true }; - for (int i = 0; i < 4*4; i++) - { - ImGui::PushID(i); - if (ImGui::Selectable("Sailor", &selected[i], 0, ImVec2(50,50))) - { - // Note: We _unnecessarily_ test for both x/y and i here only to silence some static analyzer. The second part of each test is unnecessary. - int x = i % 4; - int y = i / 4; - if (x > 0) { selected[i - 1] ^= 1; } - if (x < 3 && i < 15) { selected[i + 1] ^= 1; } - if (y > 0 && i > 3) { selected[i - 4] ^= 1; } - if (y < 3 && i < 12) { selected[i + 4] ^= 1; } - } - if ((i % 4) < 3) ImGui::SameLine(); - ImGui::PopID(); - } - ImGui::TreePop(); - } - if (ImGui::TreeNode("Alignment")) - { - HelpMarker("By default, Selectables uses style.SelectableTextAlign but it can be overriden on a per-item basis using PushStyleVar(). You'll probably want to always keep your default situation to left-align otherwise it becomes difficult to layout multiple items on a same line"); - static bool selected[3*3] = { true, false, true, false, true, false, true, false, true }; - for (int y = 0; y < 3; y++) - { - for (int x = 0; x < 3; x++) - { - ImVec2 alignment = ImVec2((float)x / 2.0f, (float)y / 2.0f); - char name[32]; - sprintf(name, "(%.1f,%.1f)", alignment.x, alignment.y); - if (x > 0) ImGui::SameLine(); - ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, alignment); - ImGui::Selectable(name, &selected[3*y+x], ImGuiSelectableFlags_None, ImVec2(80,80)); - ImGui::PopStyleVar(); - } - } - ImGui::TreePop(); - } - ImGui::TreePop(); - } - - // To wire InputText() with std::string or any other custom string type, - // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file. - if (ImGui::TreeNode("Text Input")) - { - if (ImGui::TreeNode("Multi-line Text Input")) - { - // Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize - // and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings. - static char text[1024 * 16] = - "/*\n" - " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n" - " the hexadecimal encoding of one offending instruction,\n" - " more formally, the invalid operand with locked CMPXCHG8B\n" - " instruction bug, is a design flaw in the majority of\n" - " Intel Pentium, Pentium MMX, and Pentium OverDrive\n" - " processors (all in the P5 microarchitecture).\n" - "*/\n\n" - "label:\n" - "\tlock cmpxchg8b eax\n"; - - static ImGuiInputTextFlags flags = ImGuiInputTextFlags_AllowTabInput; - HelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp because we don't want to include in here)"); - ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", (unsigned int*)&flags, ImGuiInputTextFlags_ReadOnly); - ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", (unsigned int*)&flags, ImGuiInputTextFlags_AllowTabInput); - ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", (unsigned int*)&flags, ImGuiInputTextFlags_CtrlEnterForNewLine); - ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Filtered Text Input")) - { - static char buf1[64] = ""; ImGui::InputText("default", buf1, 64); - static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal); - static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase); - static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase); - static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank); - struct TextFilters { static int FilterImGuiLetters(ImGuiInputTextCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } }; - static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters); - - ImGui::Text("Password input"); - static char password[64] = "password123"; - ImGui::InputText("password", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password); - ImGui::SameLine(); HelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n"); - ImGui::InputTextWithHint("password (w/ hint)", "", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password); - ImGui::InputText("password (clear)", password, IM_ARRAYSIZE(password)); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Resize Callback")) - { - // To wire InputText() with std::string or any other custom string type, - // you can use the ImGuiInputTextFlags_CallbackResize flag + create a custom ImGui::InputText() wrapper using your prefered type. - // See misc/cpp/imgui_stdlib.h for an implementation of this using std::string. - HelpMarker("Demonstrate using ImGuiInputTextFlags_CallbackResize to wire your resizable string type to InputText().\n\nSee misc/cpp/imgui_stdlib.h for an implementation of this for std::string."); - struct Funcs - { - static int MyResizeCallback(ImGuiInputTextCallbackData* data) - { - if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) - { - ImVector* my_str = (ImVector*)data->UserData; - IM_ASSERT(my_str->begin() == data->Buf); - my_str->resize(data->BufSize); // NB: On resizing calls, generally data->BufSize == data->BufTextLen + 1 - data->Buf = my_str->begin(); - } - return 0; - } - - // Tip: Because ImGui:: is a namespace you would typicall add your own function into the namespace in your own source files. - // For example, you may add a function called ImGui::InputText(const char* label, MyString* my_str). - static bool MyInputTextMultiline(const char* label, ImVector* my_str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0) - { - IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); - return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, Funcs::MyResizeCallback, (void*)my_str); - } - }; - - // For this demo we are using ImVector as a string container. - // Note that because we need to store a terminating zero character, our size/capacity are 1 more than usually reported by a typical string class. - static ImVector my_str; - if (my_str.empty()) - my_str.push_back(0); - Funcs::MyInputTextMultiline("##MyStr", &my_str, ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16)); - ImGui::Text("Data: %p\nSize: %d\nCapacity: %d", (void*)my_str.begin(), my_str.size(), my_str.capacity()); - ImGui::TreePop(); - } - - ImGui::TreePop(); - } - - // Plot/Graph widgets are currently fairly limited. - // Consider writing your own plotting widget, or using a third-party one (see "Wiki->Useful Widgets", or github.com/ocornut/imgui/issues/2747) - if (ImGui::TreeNode("Plots Widgets")) - { - static bool animate = true; - ImGui::Checkbox("Animate", &animate); - - static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; - ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr)); - - // Create a dummy array of contiguous float values to plot - // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter. - static float values[90] = {}; - static int values_offset = 0; - static double refresh_time = 0.0; - if (!animate || refresh_time == 0.0) - refresh_time = ImGui::GetTime(); - while (refresh_time < ImGui::GetTime()) // Create dummy data at fixed 60 hz rate for the demo - { - static float phase = 0.0f; - values[values_offset] = cosf(phase); - values_offset = (values_offset+1) % IM_ARRAYSIZE(values); - phase += 0.10f*values_offset; - refresh_time += 1.0f/60.0f; - } - - // Plots can display overlay texts - // (in this example, we will display an average value) - { - float average = 0.0f; - for (int n = 0; n < IM_ARRAYSIZE(values); n++) - average += values[n]; - average /= (float)IM_ARRAYSIZE(values); - char overlay[32]; - sprintf(overlay, "avg %f", average); - ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, overlay, -1.0f, 1.0f, ImVec2(0,80)); - } - ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80)); - - // Use functions to generate output - // FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count. - struct Funcs - { - static float Sin(void*, int i) { return sinf(i * 0.1f); } - static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; } - }; - static int func_type = 0, display_count = 70; - ImGui::Separator(); - ImGui::SetNextItemWidth(100); - ImGui::Combo("func", &func_type, "Sin\0Saw\0"); - ImGui::SameLine(); - ImGui::SliderInt("Sample count", &display_count, 1, 400); - float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw; - ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); - ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); - ImGui::Separator(); - - // Animate a simple progress bar - static float progress = 0.0f, progress_dir = 1.0f; - if (animate) - { - progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime; - if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; } - if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; } - } - - // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width, - // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth. - ImGui::ProgressBar(progress, ImVec2(0.0f,0.0f)); - ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); - ImGui::Text("Progress Bar"); - - float progress_saturated = (progress < 0.0f) ? 0.0f : (progress > 1.0f) ? 1.0f : progress; - char buf[32]; - sprintf(buf, "%d/%d", (int)(progress_saturated*1753), 1753); - ImGui::ProgressBar(progress, ImVec2(0.f,0.f), buf); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Color/Picker Widgets")) - { - static ImVec4 color = ImVec4(114.0f/255.0f, 144.0f/255.0f, 154.0f/255.0f, 200.0f/255.0f); - - static bool alpha_preview = true; - static bool alpha_half_preview = false; - static bool drag_and_drop = true; - static bool options_menu = true; - static bool hdr = false; - ImGui::Checkbox("With Alpha Preview", &alpha_preview); - ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview); - ImGui::Checkbox("With Drag and Drop", &drag_and_drop); - ImGui::Checkbox("With Options Menu", &options_menu); ImGui::SameLine(); HelpMarker("Right-click on the individual color widget to show options."); - ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); HelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets."); - ImGuiColorEditFlags misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions); - - ImGui::Text("Color widget:"); - ImGui::SameLine(); HelpMarker("Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n"); - ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags); - - ImGui::Text("Color widget HSV with Alpha:"); - ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | misc_flags); - - ImGui::Text("Color widget with Float Display:"); - ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags); - - ImGui::Text("Color button with Picker:"); - ImGui::SameLine(); HelpMarker("With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup."); - ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags); - - ImGui::Text("Color button with Custom Picker Popup:"); - - // Generate a dummy default palette. The palette will persist and can be edited. - static bool saved_palette_init = true; - static ImVec4 saved_palette[32] = {}; - if (saved_palette_init) - { - for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) - { - ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f, saved_palette[n].x, saved_palette[n].y, saved_palette[n].z); - saved_palette[n].w = 1.0f; // Alpha - } - saved_palette_init = false; - } - - static ImVec4 backup_color; - bool open_popup = ImGui::ColorButton("MyColor##3b", color, misc_flags); - ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x); - open_popup |= ImGui::Button("Palette"); - if (open_popup) - { - ImGui::OpenPopup("mypicker"); - backup_color = color; - } - if (ImGui::BeginPopup("mypicker")) - { - ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!"); - ImGui::Separator(); - ImGui::ColorPicker4("##picker", (float*)&color, misc_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview); - ImGui::SameLine(); - - ImGui::BeginGroup(); // Lock X position - ImGui::Text("Current"); - ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40)); - ImGui::Text("Previous"); - if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40))) - color = backup_color; - ImGui::Separator(); - ImGui::Text("Palette"); - for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) - { - ImGui::PushID(n); - if ((n % 8) != 0) - ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y); - if (ImGui::ColorButton("##palette", saved_palette[n], ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip, ImVec2(20,20))) - color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha! - - // Allow user to drop colors into each palette entry - // (Note that ColorButton is already a drag source by default, unless using ImGuiColorEditFlags_NoDragDrop) - if (ImGui::BeginDragDropTarget()) - { - if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) - memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3); - if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F)) - memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4); - ImGui::EndDragDropTarget(); - } - - ImGui::PopID(); - } - ImGui::EndGroup(); - ImGui::EndPopup(); - } - - ImGui::Text("Color button only:"); - static bool no_border = false; - ImGui::Checkbox("ImGuiColorEditFlags_NoBorder", &no_border); - ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags | (no_border ? ImGuiColorEditFlags_NoBorder : 0), ImVec2(80,80)); - - ImGui::Text("Color picker:"); - static bool alpha = true; - static bool alpha_bar = true; - static bool side_preview = true; - static bool ref_color = false; - static ImVec4 ref_color_v(1.0f,0.0f,1.0f,0.5f); - static int display_mode = 0; - static int picker_mode = 0; - ImGui::Checkbox("With Alpha", &alpha); - ImGui::Checkbox("With Alpha Bar", &alpha_bar); - ImGui::Checkbox("With Side Preview", &side_preview); - if (side_preview) - { - ImGui::SameLine(); - ImGui::Checkbox("With Ref Color", &ref_color); - if (ref_color) - { - ImGui::SameLine(); - ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | misc_flags); - } - } - ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0"); - ImGui::SameLine(); HelpMarker("ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions()."); - ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0"); - ImGui::SameLine(); HelpMarker("User can right-click the picker to change mode."); - ImGuiColorEditFlags flags = misc_flags; - if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4() - if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar; - if (!side_preview) flags |= ImGuiColorEditFlags_NoSidePreview; - if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar; - if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel; - if (display_mode == 1) flags |= ImGuiColorEditFlags_NoInputs; // Disable all RGB/HSV/Hex displays - if (display_mode == 2) flags |= ImGuiColorEditFlags_DisplayRGB; // Override display mode - if (display_mode == 3) flags |= ImGuiColorEditFlags_DisplayHSV; - if (display_mode == 4) flags |= ImGuiColorEditFlags_DisplayHex; - ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL); - - ImGui::Text("Programmatically set defaults:"); - ImGui::SameLine(); HelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible."); - if (ImGui::Button("Default: Uint8 + HSV + Hue Bar")) - ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar); - if (ImGui::Button("Default: Float + HDR + Hue Wheel")) - ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel); - - // HSV encoded support (to avoid RGB<>HSV round trips and singularities when S==0 or V==0) - static ImVec4 color_stored_as_hsv(0.23f, 1.0f, 1.0f, 1.0f); - ImGui::Spacing(); - ImGui::Text("HSV encoded colors"); - ImGui::SameLine(); HelpMarker("By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the added benefit that you can manipulate hue values with the picker even when saturation or value are zero."); - ImGui::Text("Color widget with InputHSV:"); - ImGui::ColorEdit4("HSV shown as RGB##1", (float*)&color_stored_as_hsv, ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float); - ImGui::ColorEdit4("HSV shown as HSV##1", (float*)&color_stored_as_hsv, ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float); - ImGui::DragFloat4("Raw HSV values", (float*)&color_stored_as_hsv, 0.01f, 0.0f, 1.0f); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Range Widgets")) - { - static float begin = 10, end = 90; - static int begin_i = 100, end_i = 1000; - ImGui::DragFloatRange2("range", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%"); - ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units"); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Data Types")) - { - // The DragScalar/InputScalar/SliderScalar functions allow various data types: signed/unsigned int/long long and float/double - // To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum to pass the type, - // and passing all arguments by address. - // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types. - // In practice, if you frequently use a given type that is not covered by the normal API entry points, you can wrap it - // yourself inside a 1 line function which can take typed argument as value instead of void*, and then pass their address - // to the generic function. For example: - // bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld") - // { - // return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format); - // } - - // Limits (as helper variables that we can take the address of) - // Note that the SliderScalar function has a maximum usable range of half the natural type maximum, hence the /2 below. - #ifndef LLONG_MIN - ImS64 LLONG_MIN = -9223372036854775807LL - 1; - ImS64 LLONG_MAX = 9223372036854775807LL; - ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1); - #endif - const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127; - const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255; - const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767; - const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535; - const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2; - const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2; - const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2; - const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2; - const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f; - const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0; - - // State - static char s8_v = 127; - static ImU8 u8_v = 255; - static short s16_v = 32767; - static ImU16 u16_v = 65535; - static ImS32 s32_v = -1; - static ImU32 u32_v = (ImU32)-1; - static ImS64 s64_v = -1; - static ImU64 u64_v = (ImU64)-1; - static float f32_v = 0.123f; - static double f64_v = 90000.01234567890123456789; - - const float drag_speed = 0.2f; - static bool drag_clamp = false; - ImGui::Text("Drags:"); - ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp); ImGui::SameLine(); HelpMarker("As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value."); - ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL); - ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms"); - ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL); - ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms"); - ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL); - ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms"); - ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL); - ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL); - ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 1.0f); - ImGui::DragScalar("drag float ^2", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 2.0f); ImGui::SameLine(); HelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range."); - ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams", 1.0f); - ImGui::DragScalar("drag double ^2", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", 2.0f); - - ImGui::Text("Sliders"); - ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d"); - ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u"); - ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d"); - ImGui::SliderScalar("slider u16 full", ImGuiDataType_U16, &u16_v, &u16_min, &u16_max, "%u"); - ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d"); - ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d"); - ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d"); - ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u"); - ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u"); - ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u"); - ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%I64d"); - ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%I64d"); - ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%I64d"); - ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%I64u ms"); - ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%I64u ms"); - ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%I64u ms"); - ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one); - ImGui::SliderScalar("slider float low^2", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", 2.0f); - ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e"); - ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams", 1.0f); - ImGui::SliderScalar("slider double low^2",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", 2.0f); - ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams", 1.0f); - - static bool inputs_step = true; - ImGui::Text("Inputs"); - ImGui::Checkbox("Show step buttons", &inputs_step); - ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d"); - ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u"); - ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d"); - ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u"); - ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d"); - ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); - ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u"); - ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); - ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL); - ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL); - ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL); - ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Multi-component Widgets")) - { - static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; - static int vec4i[4] = { 1, 5, 100, 255 }; - - ImGui::InputFloat2("input float2", vec4f); - ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f); - ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f); - ImGui::InputInt2("input int2", vec4i); - ImGui::DragInt2("drag int2", vec4i, 1, 0, 255); - ImGui::SliderInt2("slider int2", vec4i, 0, 255); - ImGui::Spacing(); - - ImGui::InputFloat3("input float3", vec4f); - ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f); - ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f); - ImGui::InputInt3("input int3", vec4i); - ImGui::DragInt3("drag int3", vec4i, 1, 0, 255); - ImGui::SliderInt3("slider int3", vec4i, 0, 255); - ImGui::Spacing(); - - ImGui::InputFloat4("input float4", vec4f); - ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f); - ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f); - ImGui::InputInt4("input int4", vec4i); - ImGui::DragInt4("drag int4", vec4i, 1, 0, 255); - ImGui::SliderInt4("slider int4", vec4i, 0, 255); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Vertical Sliders")) - { - const float spacing = 4; - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing)); - - static int int_value = 0; - ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5); - ImGui::SameLine(); - - static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f }; - ImGui::PushID("set1"); - for (int i = 0; i < 7; i++) - { - if (i > 0) ImGui::SameLine(); - ImGui::PushID(i); - ImGui::PushStyleColor(ImGuiCol_FrameBg, (ImVec4)ImColor::HSV(i/7.0f, 0.5f, 0.5f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.5f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.5f)); - ImGui::PushStyleColor(ImGuiCol_SliderGrab, (ImVec4)ImColor::HSV(i/7.0f, 0.9f, 0.9f)); - ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, ""); - if (ImGui::IsItemActive() || ImGui::IsItemHovered()) - ImGui::SetTooltip("%.3f", values[i]); - ImGui::PopStyleColor(4); - ImGui::PopID(); - } - ImGui::PopID(); - - ImGui::SameLine(); - ImGui::PushID("set2"); - static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f }; - const int rows = 3; - const ImVec2 small_slider_size(18, (float)(int)((160.0f - (rows - 1) * spacing) / rows)); - for (int nx = 0; nx < 4; nx++) - { - if (nx > 0) ImGui::SameLine(); - ImGui::BeginGroup(); - for (int ny = 0; ny < rows; ny++) - { - ImGui::PushID(nx*rows+ny); - ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, ""); - if (ImGui::IsItemActive() || ImGui::IsItemHovered()) - ImGui::SetTooltip("%.3f", values2[nx]); - ImGui::PopID(); - } - ImGui::EndGroup(); - } - ImGui::PopID(); - - ImGui::SameLine(); - ImGui::PushID("set3"); - for (int i = 0; i < 4; i++) - { - if (i > 0) ImGui::SameLine(); - ImGui::PushID(i); - ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40); - ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f\nsec"); - ImGui::PopStyleVar(); - ImGui::PopID(); - } - ImGui::PopID(); - ImGui::PopStyleVar(); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Drag and Drop")) - { - if (ImGui::TreeNode("Drag and drop in standard widgets")) - { - // ColorEdit widgets automatically act as drag source and drag target. - // They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets - // to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo. - HelpMarker("You can drag from the colored squares."); - static float col1[3] = { 1.0f, 0.0f, 0.2f }; - static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f }; - ImGui::ColorEdit3("color 1", col1); - ImGui::ColorEdit4("color 2", col2); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Drag and drop to copy/swap items")) - { - enum Mode - { - Mode_Copy, - Mode_Move, - Mode_Swap - }; - static int mode = 0; - if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine(); - if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine(); - if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; } - static const char* names[9] = { "Bobby", "Beatrice", "Betty", "Brianna", "Barry", "Bernard", "Bibi", "Blaine", "Bryn" }; - for (int n = 0; n < IM_ARRAYSIZE(names); n++) - { - ImGui::PushID(n); - if ((n % 3) != 0) - ImGui::SameLine(); - ImGui::Button(names[n], ImVec2(60,60)); - - // Our buttons are both drag sources and drag targets here! - if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) - { - ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything) - if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.) - if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); } - if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); } - ImGui::EndDragDropSource(); - } - if (ImGui::BeginDragDropTarget()) - { - if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL")) - { - IM_ASSERT(payload->DataSize == sizeof(int)); - int payload_n = *(const int*)payload->Data; - if (mode == Mode_Copy) - { - names[n] = names[payload_n]; - } - if (mode == Mode_Move) - { - names[n] = names[payload_n]; - names[payload_n] = ""; - } - if (mode == Mode_Swap) - { - const char* tmp = names[n]; - names[n] = names[payload_n]; - names[payload_n] = tmp; - } - } - ImGui::EndDragDropTarget(); - } - ImGui::PopID(); - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Drag to reorder items (simple)")) - { - // Simple reordering - HelpMarker("We don't use the drag and drop api at all here! Instead we query when the item is held but not hovered, and order items accordingly."); - static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" }; - for (int n = 0; n < IM_ARRAYSIZE(item_names); n++) - { - const char* item = item_names[n]; - ImGui::Selectable(item); - - if (ImGui::IsItemActive() && !ImGui::IsItemHovered()) - { - int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1); - if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names)) - { - item_names[n] = item_names[n_next]; - item_names[n_next] = item; - ImGui::ResetMouseDragDelta(); - } - } - } - ImGui::TreePop(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)")) - { - // Submit an item (various types available) so we can query their status in the following block. - static int item_type = 1; - ImGui::Combo("Item Type", &item_type, "Text\0Button\0Button (w/ repeat)\0Checkbox\0SliderFloat\0InputText\0InputFloat\0InputFloat3\0ColorEdit4\0MenuItem\0TreeNode\0TreeNode (w/ double-click)\0ListBox\0", 20); - ImGui::SameLine(); - HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions."); - bool ret = false; - static bool b = false; - static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f }; - static char str[16] = {}; - if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction - if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button - if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater) - if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox - if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item - if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing) - if (item_type == 6) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input - if (item_type == 7) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged) - if (item_type == 8) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged) - if (item_type == 9) { ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy) - if (item_type == 10){ ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node - if (item_type == 11){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy. - if (item_type == 12){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", ¤t, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); } - - // Display the value of IsItemHovered() and other common item state functions. - // Note that the ImGuiHoveredFlags_XXX flags can be combined. - // Because BulletText is an item itself and that would affect the output of IsItemXXX functions, - // we query every state in a single call to avoid storing them and to simplify the code - ImGui::BulletText( - "Return value = %d\n" - "IsItemFocused() = %d\n" - "IsItemHovered() = %d\n" - "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n" - "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n" - "IsItemHovered(_AllowWhenOverlapped) = %d\n" - "IsItemHovered(_RectOnly) = %d\n" - "IsItemActive() = %d\n" - "IsItemEdited() = %d\n" - "IsItemActivated() = %d\n" - "IsItemDeactivated() = %d\n" - "IsItemDeactivatedAfterEdit() = %d\n" - "IsItemVisible() = %d\n" - "IsItemClicked() = %d\n" - "IsItemToggledOpen() = %d\n" - "GetItemRectMin() = (%.1f, %.1f)\n" - "GetItemRectMax() = (%.1f, %.1f)\n" - "GetItemRectSize() = (%.1f, %.1f)", - ret, - ImGui::IsItemFocused(), - ImGui::IsItemHovered(), - ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), - ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), - ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped), - ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly), - ImGui::IsItemActive(), - ImGui::IsItemEdited(), - ImGui::IsItemActivated(), - ImGui::IsItemDeactivated(), - ImGui::IsItemDeactivatedAfterEdit(), - ImGui::IsItemVisible(), - ImGui::IsItemClicked(), - ImGui::IsItemToggledOpen(), - ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y, - ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y, - ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y - ); - - static bool embed_all_inside_a_child_window = false; - ImGui::Checkbox("Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window); - if (embed_all_inside_a_child_window) - ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true); - - // Testing IsWindowFocused() function with its various flags. - // Note that the ImGuiFocusedFlags_XXX flags can be combined. - ImGui::BulletText( - "IsWindowFocused() = %d\n" - "IsWindowFocused(_ChildWindows) = %d\n" - "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n" - "IsWindowFocused(_RootWindow) = %d\n" - "IsWindowFocused(_AnyWindow) = %d\n", - ImGui::IsWindowFocused(), - ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows), - ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow), - ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow), - ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)); - - // Testing IsWindowHovered() function with its various flags. - // Note that the ImGuiHoveredFlags_XXX flags can be combined. - ImGui::BulletText( - "IsWindowHovered() = %d\n" - "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n" - "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n" - "IsWindowHovered(_ChildWindows) = %d\n" - "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n" - "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n" - "IsWindowHovered(_RootWindow) = %d\n" - "IsWindowHovered(_AnyWindow) = %d\n", - ImGui::IsWindowHovered(), - ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), - ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), - ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows), - ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow), - ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_AllowWhenBlockedByPopup), - ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow), - ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)); - - ImGui::BeginChild("child", ImVec2(0, 50), true); - ImGui::Text("This is another child window for testing the _ChildWindows flag."); - ImGui::EndChild(); - if (embed_all_inside_a_child_window) - ImGui::EndChild(); - - static char dummy_str[] = "This is a dummy field to be able to tab-out of the widgets above."; - ImGui::InputText("dummy", dummy_str, IM_ARRAYSIZE(dummy_str), ImGuiInputTextFlags_ReadOnly); - - // Calling IsItemHovered() after begin returns the hovered status of the title bar. - // This is useful in particular if you want to create a context menu (with BeginPopupContextItem) associated to the title bar of a window. - static bool test_window = false; - ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window); - if (test_window) - { - ImGui::Begin("Title bar Hovered/Active tests", &test_window); - if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered() - { - if (ImGui::MenuItem("Close")) { test_window = false; } - ImGui::EndPopup(); - } - ImGui::Text( - "IsItemHovered() after begin = %d (== is title bar hovered)\n" - "IsItemActive() after begin = %d (== is window being clicked/moved)\n", - ImGui::IsItemHovered(), ImGui::IsItemActive()); - ImGui::End(); - } - - ImGui::TreePop(); - } -} - -static void ShowDemoWindowLayout() -{ - if (!ImGui::CollapsingHeader("Layout")) - return; - - if (ImGui::TreeNode("Child windows")) - { - HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); - static bool disable_mouse_wheel = false; - static bool disable_menu = false; - ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel); - ImGui::Checkbox("Disable Menu", &disable_menu); - - static int line = 50; - bool goto_line = ImGui::Button("Goto"); - ImGui::SameLine(); - ImGui::SetNextItemWidth(100); - goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue); - - // Child 1: no border, enable horizontal scrollbar - { - ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0); - ImGui::BeginChild("ChildL", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 260), false, window_flags); - for (int i = 0; i < 100; i++) - { - ImGui::Text("%04d: scrollable region", i); - if (goto_line && line == i) - ImGui::SetScrollHereY(); - } - if (goto_line && line >= 100) - ImGui::SetScrollHereY(); - ImGui::EndChild(); - } - - ImGui::SameLine(); - - // Child 2: rounded border - { - ImGuiWindowFlags window_flags = (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0) | (disable_menu ? 0 : ImGuiWindowFlags_MenuBar); - ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); - ImGui::BeginChild("ChildR", ImVec2(0, 260), true, window_flags); - if (!disable_menu && ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("Menu")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - ImGui::Columns(2); - for (int i = 0; i < 100; i++) - { - char buf[32]; - sprintf(buf, "%03d", i); - ImGui::Button(buf, ImVec2(-FLT_MIN, 0.0f)); - ImGui::NextColumn(); - } - ImGui::EndChild(); - ImGui::PopStyleVar(); - } - - ImGui::Separator(); - - // Demonstrate a few extra things - // - Changing ImGuiCol_ChildBg (which is transparent black in default styles) - // - Using SetCursorPos() to position the child window (because the child window is an item from the POV of the parent window) - // You can also call SetNextWindowPos() to position the child window. The parent window will effectively layout from this position. - // - Using ImGui::GetItemRectMin/Max() to query the "item" state (because the child window is an item from the POV of the parent window) - // See "Widgets" -> "Querying Status (Active/Focused/Hovered etc.)" section for more details about this. - { - ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10); - ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100)); - ImGui::BeginChild("Red", ImVec2(200, 100), true, ImGuiWindowFlags_None); - for (int n = 0; n < 50; n++) - ImGui::Text("Some test %d", n); - ImGui::EndChild(); - ImVec2 child_rect_min = ImGui::GetItemRectMin(); - ImVec2 child_rect_max = ImGui::GetItemRectMax(); - ImGui::PopStyleColor(); - ImGui::Text("Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.x, child_rect_min.y, child_rect_max.x, child_rect_max.y); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Widgets Width")) - { - // Use SetNextItemWidth() to set the width of a single upcoming item. - // Use PushItemWidth()/PopItemWidth() to set the width of a group of items. - static float f = 0.0f; - ImGui::Text("SetNextItemWidth/PushItemWidth(100)"); - ImGui::SameLine(); HelpMarker("Fixed width."); - ImGui::SetNextItemWidth(100); - ImGui::DragFloat("float##1", &f); - - ImGui::Text("SetNextItemWidth/PushItemWidth(GetWindowWidth() * 0.5f)"); - ImGui::SameLine(); HelpMarker("Half of window width."); - ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.5f); - ImGui::DragFloat("float##2", &f); - - ImGui::Text("SetNextItemWidth/PushItemWidth(GetContentRegionAvail().x * 0.5f)"); - ImGui::SameLine(); HelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)"); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5f); - ImGui::DragFloat("float##3", &f); - - ImGui::Text("SetNextItemWidth/PushItemWidth(-100)"); - ImGui::SameLine(); HelpMarker("Align to right edge minus 100"); - ImGui::SetNextItemWidth(-100); - ImGui::DragFloat("float##4", &f); - - // Demonstrate using PushItemWidth to surround three items. Calling SetNextItemWidth() before each of them would have the same effect. - ImGui::Text("SetNextItemWidth/PushItemWidth(-1)"); - ImGui::SameLine(); HelpMarker("Align to right edge"); - ImGui::PushItemWidth(-1); - ImGui::DragFloat("##float5a", &f); - ImGui::DragFloat("##float5b", &f); - ImGui::DragFloat("##float5c", &f); - ImGui::PopItemWidth(); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Basic Horizontal Layout")) - { - ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceding item)"); - - // Text - ImGui::Text("Two items: Hello"); ImGui::SameLine(); - ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); - - // Adjust spacing - ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20); - ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); - - // Button - ImGui::AlignTextToFramePadding(); - ImGui::Text("Normal buttons"); ImGui::SameLine(); - ImGui::Button("Banana"); ImGui::SameLine(); - ImGui::Button("Apple"); ImGui::SameLine(); - ImGui::Button("Corniflower"); - - // Button - ImGui::Text("Small buttons"); ImGui::SameLine(); - ImGui::SmallButton("Like this one"); ImGui::SameLine(); - ImGui::Text("can fit within a text block."); - - // Aligned to arbitrary position. Easy/cheap column. - ImGui::Text("Aligned"); - ImGui::SameLine(150); ImGui::Text("x=150"); - ImGui::SameLine(300); ImGui::Text("x=300"); - ImGui::Text("Aligned"); - ImGui::SameLine(150); ImGui::SmallButton("x=150"); - ImGui::SameLine(300); ImGui::SmallButton("x=300"); - - // Checkbox - static bool c1 = false, c2 = false, c3 = false, c4 = false; - ImGui::Checkbox("My", &c1); ImGui::SameLine(); - ImGui::Checkbox("Tailor", &c2); ImGui::SameLine(); - ImGui::Checkbox("Is", &c3); ImGui::SameLine(); - ImGui::Checkbox("Rich", &c4); - - // Various - static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f; - ImGui::PushItemWidth(80); - const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" }; - static int item = -1; - ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); - ImGui::SliderFloat("X", &f0, 0.0f, 5.0f); ImGui::SameLine(); - ImGui::SliderFloat("Y", &f1, 0.0f, 5.0f); ImGui::SameLine(); - ImGui::SliderFloat("Z", &f2, 0.0f, 5.0f); - ImGui::PopItemWidth(); - - ImGui::PushItemWidth(80); - ImGui::Text("Lists:"); - static int selection[4] = { 0, 1, 2, 3 }; - for (int i = 0; i < 4; i++) - { - if (i > 0) ImGui::SameLine(); - ImGui::PushID(i); - ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items)); - ImGui::PopID(); - //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i); - } - ImGui::PopItemWidth(); - - // Dummy - ImVec2 button_sz(40, 40); - ImGui::Button("A", button_sz); ImGui::SameLine(); - ImGui::Dummy(button_sz); ImGui::SameLine(); - ImGui::Button("B", button_sz); - - // Manually wrapping (we should eventually provide this as an automatic layout feature, but for now you can do it manually) - ImGui::Text("Manually wrapping:"); - ImGuiStyle& style = ImGui::GetStyle(); - int buttons_count = 20; - float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x; - for (int n = 0; n < buttons_count; n++) - { - ImGui::PushID(n); - ImGui::Button("Box", button_sz); - float last_button_x2 = ImGui::GetItemRectMax().x; - float next_button_x2 = last_button_x2 + style.ItemSpacing.x + button_sz.x; // Expected position if next button was on same line - if (n + 1 < buttons_count && next_button_x2 < window_visible_x2) - ImGui::SameLine(); - ImGui::PopID(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Tabs")) - { - if (ImGui::TreeNode("Basic")) - { - ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None; - if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) - { - if (ImGui::BeginTabItem("Avocado")) - { - ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah"); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Broccoli")) - { - ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah"); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Cucumber")) - { - ImGui::Text("This is the Cucumber tab!\nblah blah blah blah blah"); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::Separator(); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Advanced & Close Button")) - { - // Expose a couple of the available flags. In most cases you may just call BeginTabBar() with no flags (0). - static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable; - ImGui::CheckboxFlags("ImGuiTabBarFlags_Reorderable", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_Reorderable); - ImGui::CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_AutoSelectNewTabs); - ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton); - ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton); - if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0) - tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_; - if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown)) - tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyResizeDown); - if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyScroll)) - tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll); - - // Tab Bar - const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" }; - static bool opened[4] = { true, true, true, true }; // Persistent user state - for (int n = 0; n < IM_ARRAYSIZE(opened); n++) - { - if (n > 0) { ImGui::SameLine(); } - ImGui::Checkbox(names[n], &opened[n]); - } - - // Passing a bool* to BeginTabItem() is similar to passing one to Begin(): the underlying bool will be set to false when the tab is closed. - if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) - { - for (int n = 0; n < IM_ARRAYSIZE(opened); n++) - if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None)) - { - ImGui::Text("This is the %s tab!", names[n]); - if (n & 1) - ImGui::Text("I am an odd tab."); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::Separator(); - ImGui::TreePop(); - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Groups")) - { - HelpMarker("BeginGroup() basically locks the horizontal position for new line. EndGroup() bundles the whole group so that you can use \"item\" functions such as IsItemHovered()/IsItemActive() or SameLine() etc. on the whole group."); - ImGui::BeginGroup(); - { - ImGui::BeginGroup(); - ImGui::Button("AAA"); - ImGui::SameLine(); - ImGui::Button("BBB"); - ImGui::SameLine(); - ImGui::BeginGroup(); - ImGui::Button("CCC"); - ImGui::Button("DDD"); - ImGui::EndGroup(); - ImGui::SameLine(); - ImGui::Button("EEE"); - ImGui::EndGroup(); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip("First group hovered"); - } - // Capture the group size and create widgets using the same size - ImVec2 size = ImGui::GetItemRectSize(); - const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f }; - ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size); - - ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); - ImGui::SameLine(); - ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); - ImGui::EndGroup(); - ImGui::SameLine(); - - ImGui::Button("LEVERAGE\nBUZZWORD", size); - ImGui::SameLine(); - - if (ImGui::ListBoxHeader("List", size)) - { - ImGui::Selectable("Selected", true); - ImGui::Selectable("Not Selected", false); - ImGui::ListBoxFooter(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Text Baseline Alignment")) - { - { - ImGui::BulletText("Text baseline:"); - ImGui::SameLine(); - HelpMarker("This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets."); - ImGui::Indent(); - - ImGui::Text("KO Blahblah"); ImGui::SameLine(); - ImGui::Button("Some framed item"); ImGui::SameLine(); - HelpMarker("Baseline of button will look misaligned with text.."); - - // If your line starts with text, call AlignTextToFramePadding() to align text to upcoming widgets. - // Because we don't know what's coming after the Text() statement, we need to move the text baseline down by FramePadding.y - ImGui::AlignTextToFramePadding(); - ImGui::Text("OK Blahblah"); ImGui::SameLine(); - ImGui::Button("Some framed item"); ImGui::SameLine(); - HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y"); - - // SmallButton() uses the same vertical padding as Text - ImGui::Button("TEST##1"); ImGui::SameLine(); - ImGui::Text("TEST"); ImGui::SameLine(); - ImGui::SmallButton("TEST##2"); - - // If your line starts with text, call AlignTextToFramePadding() to align text to upcoming widgets. - ImGui::AlignTextToFramePadding(); - ImGui::Text("Text aligned to framed item"); ImGui::SameLine(); - ImGui::Button("Item##1"); ImGui::SameLine(); - ImGui::Text("Item"); ImGui::SameLine(); - ImGui::SmallButton("Item##2"); ImGui::SameLine(); - ImGui::Button("Item##3"); - - ImGui::Unindent(); - } - - ImGui::Spacing(); - - { - ImGui::BulletText("Multi-line text:"); - ImGui::Indent(); - ImGui::Text("One\nTwo\nThree"); ImGui::SameLine(); - ImGui::Text("Hello\nWorld"); ImGui::SameLine(); - ImGui::Text("Banana"); - - ImGui::Text("Banana"); ImGui::SameLine(); - ImGui::Text("Hello\nWorld"); ImGui::SameLine(); - ImGui::Text("One\nTwo\nThree"); - - ImGui::Button("HOP##1"); ImGui::SameLine(); - ImGui::Text("Banana"); ImGui::SameLine(); - ImGui::Text("Hello\nWorld"); ImGui::SameLine(); - ImGui::Text("Banana"); - - ImGui::Button("HOP##2"); ImGui::SameLine(); - ImGui::Text("Hello\nWorld"); ImGui::SameLine(); - ImGui::Text("Banana"); - ImGui::Unindent(); - } - - ImGui::Spacing(); - - { - ImGui::BulletText("Misc items:"); - ImGui::Indent(); - - // SmallButton() sets FramePadding to zero. Text baseline is aligned to match baseline of previous Button - ImGui::Button("80x80", ImVec2(80, 80)); - ImGui::SameLine(); - ImGui::Button("50x50", ImVec2(50, 50)); - ImGui::SameLine(); - ImGui::Button("Button()"); - ImGui::SameLine(); - ImGui::SmallButton("SmallButton()"); - - // Tree - const float spacing = ImGui::GetStyle().ItemInnerSpacing.x; - ImGui::Button("Button##1"); - ImGui::SameLine(0.0f, spacing); - if (ImGui::TreeNode("Node##1")) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data - - ImGui::AlignTextToFramePadding(); // Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit). - bool node_open = ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content. - ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##2"); - if (node_open) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data - - // Bullet - ImGui::Button("Button##3"); - ImGui::SameLine(0.0f, spacing); - ImGui::BulletText("Bullet text"); - - ImGui::AlignTextToFramePadding(); - ImGui::BulletText("Node"); - ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##4"); - ImGui::Unindent(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Scrolling")) - { - // Vertical scroll functions - HelpMarker("Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given vertical position."); - - static int track_item = 50; - static bool enable_track = true; - static bool enable_extra_decorations = false; - static float scroll_to_off_px = 0.0f; - static float scroll_to_pos_px = 200.0f; - - ImGui::Checkbox("Decoration", &enable_extra_decorations); - ImGui::SameLine(); - HelpMarker("We expose this for testing because scrolling sometimes had issues with window decoration such as menu-bars."); - - ImGui::Checkbox("Track", &enable_track); - ImGui::PushItemWidth(100); - ImGui::SameLine(140); enable_track |= ImGui::DragInt("##item", &track_item, 0.25f, 0, 99, "Item = %d"); - - bool scroll_to_off = ImGui::Button("Scroll Offset"); - ImGui::SameLine(140); scroll_to_off |= ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, FLT_MAX, "+%.0f px"); - - bool scroll_to_pos = ImGui::Button("Scroll To Pos"); - ImGui::SameLine(140); scroll_to_pos |= ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, FLT_MAX, "X/Y = %.0f px"); - ImGui::PopItemWidth(); - - if (scroll_to_off || scroll_to_pos) - enable_track = false; - - ImGuiStyle& style = ImGui::GetStyle(); - float child_w = (ImGui::GetContentRegionAvail().x - 4 * style.ItemSpacing.x) / 5; - if (child_w < 1.0f) - child_w = 1.0f; - ImGui::PushID("##VerticalScrolling"); - for (int i = 0; i < 5; i++) - { - if (i > 0) ImGui::SameLine(); - ImGui::BeginGroup(); - const char* names[] = { "Top", "25%", "Center", "75%", "Bottom" }; - ImGui::TextUnformatted(names[i]); - - ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0; - bool window_visible = ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(child_w, 200.0f), true, child_flags); - if (ImGui::BeginMenuBar()) - { - ImGui::TextUnformatted("abc"); - ImGui::EndMenuBar(); - } - if (scroll_to_off) - ImGui::SetScrollY(scroll_to_off_px); - if (scroll_to_pos) - ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_pos_px, i * 0.25f); - if (window_visible) // Avoid calling SetScrollHereY when running with culled items - { - for (int item = 0; item < 100; item++) - { - if (enable_track && item == track_item) - { - ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item); - ImGui::SetScrollHereY(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom - } - else - { - ImGui::Text("Item %d", item); - } - } - } - float scroll_y = ImGui::GetScrollY(); - float scroll_max_y = ImGui::GetScrollMaxY(); - ImGui::EndChild(); - ImGui::Text("%.0f/%.0f", scroll_y, scroll_max_y); - ImGui::EndGroup(); - } - ImGui::PopID(); - - // Horizontal scroll functions - ImGui::Spacing(); - HelpMarker("Use SetScrollHereX() or SetScrollFromPosX() to scroll to a given horizontal position.\n\nUsing the \"Scroll To Pos\" button above will make the discontinuity at edges visible: scrolling to the top/bottom/left/right-most item will add an additional WindowPadding to reflect on reaching the edge of the list.\n\nBecause the clipping rectangle of most window hides half worth of WindowPadding on the left/right, using SetScrollFromPosX(+1) will usually result in clipped text whereas the equivalent SetScrollFromPosY(+1) wouldn't."); - ImGui::PushID("##HorizontalScrolling"); - for (int i = 0; i < 5; i++) - { - float child_height = ImGui::GetTextLineHeight() + style.ScrollbarSize + style.WindowPadding.y * 2.0f; - ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0); - bool window_visible = ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(-100, child_height), true, child_flags); - if (scroll_to_off) - ImGui::SetScrollX(scroll_to_off_px); - if (scroll_to_pos) - ImGui::SetScrollFromPosX(ImGui::GetCursorStartPos().x + scroll_to_pos_px, i * 0.25f); - if (window_visible) // Avoid calling SetScrollHereY when running with culled items - { - for (int item = 0; item < 100; item++) - { - if (enable_track && item == track_item) - { - ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item); - ImGui::SetScrollHereX(i * 0.25f); // 0.0f:left, 0.5f:center, 1.0f:right - } - else - { - ImGui::Text("Item %d", item); - } - ImGui::SameLine(); - } - } - float scroll_x = ImGui::GetScrollX(); - float scroll_max_x = ImGui::GetScrollMaxX(); - ImGui::EndChild(); - ImGui::SameLine(); - const char* names[] = { "Left", "25%", "Center", "75%", "Right" }; - ImGui::Text("%s\n%.0f/%.0f", names[i], scroll_x, scroll_max_x); - ImGui::Spacing(); - } - ImGui::PopID(); - - // Miscellaneous Horizontal Scrolling Demo - HelpMarker("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\nYou may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin()."); - static int lines = 7; - ImGui::SliderInt("Lines", &lines, 1, 15); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f)); - ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar); - for (int line = 0; line < lines; line++) - { - // Display random stuff (for the sake of this trivial demo we are using basic Button+SameLine. If you want to create your own time line for a real application you may be better off - // manipulating the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets yourself. You may also want to use the lower-level ImDrawList API) - int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3); - for (int n = 0; n < num_buttons; n++) - { - if (n > 0) ImGui::SameLine(); - ImGui::PushID(n + line * 1000); - char num_buf[16]; - sprintf(num_buf, "%d", n); - const char* label = (!(n%15)) ? "FizzBuzz" : (!(n%3)) ? "Fizz" : (!(n%5)) ? "Buzz" : num_buf; - float hue = n*0.05f; - ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f)); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f)); - ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f)); - ImGui::PopStyleColor(3); - ImGui::PopID(); - } - } - float scroll_x = ImGui::GetScrollX(); - float scroll_max_x = ImGui::GetScrollMaxX(); - ImGui::EndChild(); - ImGui::PopStyleVar(2); - float scroll_x_delta = 0.0f; - ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) { scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); - ImGui::Text("Scroll from code"); ImGui::SameLine(); - ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) { scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); - ImGui::Text("%.0f/%.0f", scroll_x, scroll_max_x); - if (scroll_x_delta != 0.0f) - { - ImGui::BeginChild("scrolling"); // Demonstrate a trick: you can use Begin to set yourself in the context of another window (here we are already out of your child window) - ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta); - ImGui::EndChild(); - } - ImGui::Spacing(); - - static bool show_horizontal_contents_size_demo_window = false; - ImGui::Checkbox("Show Horizontal contents size demo window", &show_horizontal_contents_size_demo_window); - - if (show_horizontal_contents_size_demo_window) - { - static bool show_h_scrollbar = true; - static bool show_button = true; - static bool show_tree_nodes = true; - static bool show_text_wrapped = false; - static bool show_columns = true; - static bool show_tab_bar = true; - static bool show_child = false; - static bool explicit_content_size = false; - static float contents_size_x = 300.0f; - if (explicit_content_size) - ImGui::SetNextWindowContentSize(ImVec2(contents_size_x, 0.0f)); - ImGui::Begin("Horizontal contents size demo window", &show_horizontal_contents_size_demo_window, show_h_scrollbar ? ImGuiWindowFlags_HorizontalScrollbar : 0); - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0)); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 0)); - HelpMarker("Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles."); - ImGui::Checkbox("H-scrollbar", &show_h_scrollbar); - ImGui::Checkbox("Button", &show_button); // Will grow contents size (unless explicitly overwritten) - ImGui::Checkbox("Tree nodes", &show_tree_nodes); // Will grow contents size and display highlight over full width - ImGui::Checkbox("Text wrapped", &show_text_wrapped);// Will grow and use contents size - ImGui::Checkbox("Columns", &show_columns); // Will use contents size - ImGui::Checkbox("Tab bar", &show_tab_bar); // Will use contents size - ImGui::Checkbox("Child", &show_child); // Will grow and use contents size - ImGui::Checkbox("Explicit content size", &explicit_content_size); - ImGui::Text("Scroll %.1f/%.1f %.1f/%.1f", ImGui::GetScrollX(), ImGui::GetScrollMaxX(), ImGui::GetScrollY(), ImGui::GetScrollMaxY()); - if (explicit_content_size) - { - ImGui::SameLine(); - ImGui::SetNextItemWidth(100); - ImGui::DragFloat("##csx", &contents_size_x); - ImVec2 p = ImGui::GetCursorScreenPos(); - ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + 10, p.y + 10), IM_COL32_WHITE); - ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(p.x + contents_size_x - 10, p.y), ImVec2(p.x + contents_size_x, p.y + 10), IM_COL32_WHITE); - ImGui::Dummy(ImVec2(0, 10)); - } - ImGui::PopStyleVar(2); - ImGui::Separator(); - if (show_button) - { - ImGui::Button("this is a 300-wide button", ImVec2(300, 0)); - } - if (show_tree_nodes) - { - bool open = true; - if (ImGui::TreeNode("this is a tree node")) - { - if (ImGui::TreeNode("another one of those tree node...")) - { - ImGui::Text("Some tree contents"); - ImGui::TreePop(); - } - ImGui::TreePop(); - } - ImGui::CollapsingHeader("CollapsingHeader", &open); - } - if (show_text_wrapped) - { - ImGui::TextWrapped("This text should automatically wrap on the edge of the work rectangle."); - } - if (show_columns) - { - ImGui::Columns(4); - for (int n = 0; n < 4; n++) - { - ImGui::Text("Width %.2f", ImGui::GetColumnWidth()); - ImGui::NextColumn(); - } - ImGui::Columns(1); - } - if (show_tab_bar && ImGui::BeginTabBar("Hello")) - { - if (ImGui::BeginTabItem("OneOneOne")) { ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("TwoTwoTwo")) { ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("ThreeThreeThree")) { ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("FourFourFour")) { ImGui::EndTabItem(); } - ImGui::EndTabBar(); - } - if (show_child) - { - ImGui::BeginChild("child", ImVec2(0,0), true); - ImGui::EndChild(); - } - ImGui::End(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Clipping")) - { - static ImVec2 size(100, 100), offset(50, 20); - ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost."); - ImGui::DragFloat2("size", (float*)&size, 0.5f, 1.0f, 200.0f, "%.0f"); - ImGui::TextWrapped("(Click and drag)"); - ImVec2 pos = ImGui::GetCursorScreenPos(); - ImVec4 clip_rect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); - ImGui::InvisibleButton("##dummy", size); - if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0)) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; } - ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x + size.x, pos.y + size.y), IM_COL32(90, 90, 120, 255)); - ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect); - ImGui::TreePop(); - } -} - -static void ShowDemoWindowPopups() -{ - if (!ImGui::CollapsingHeader("Popups & Modal windows")) - return; - - // The properties of popups windows are: - // - They block normal mouse hovering detection outside them. (*) - // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE. - // - Their visibility state (~bool) is held internally by Dear ImGui instead of being held by the programmer as we are used to with regular Begin() calls. - // User can manipulate the visibility state by calling OpenPopup(). - // (*) One can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup. - // Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time. - - // Typical use for regular windows: - // bool my_tool_is_active = false; if (ImGui::Button("Open")) my_tool_is_active = true; [...] if (my_tool_is_active) Begin("My Tool", &my_tool_is_active) { [...] } End(); - // Typical use for popups: - // if (ImGui::Button("Open")) ImGui::OpenPopup("MyPopup"); if (ImGui::BeginPopup("MyPopup") { [...] EndPopup(); } - - // With popups we have to go through a library call (here OpenPopup) to manipulate the visibility state. - // This may be a bit confusing at first but it should quickly make sense. Follow on the examples below. - - if (ImGui::TreeNode("Popups")) - { - ImGui::TextWrapped("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it."); - - static int selected_fish = -1; - const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" }; - static bool toggles[] = { true, false, false, false, false }; - - // Simple selection popup - // (If you want to show the current selection inside the Button itself, you may want to build a string using the "###" operator to preserve a constant ID with a variable label) - if (ImGui::Button("Select..")) - ImGui::OpenPopup("my_select_popup"); - ImGui::SameLine(); - ImGui::TextUnformatted(selected_fish == -1 ? "" : names[selected_fish]); - if (ImGui::BeginPopup("my_select_popup")) - { - ImGui::Text("Aquarium"); - ImGui::Separator(); - for (int i = 0; i < IM_ARRAYSIZE(names); i++) - if (ImGui::Selectable(names[i])) - selected_fish = i; - ImGui::EndPopup(); - } - - // Showing a menu with toggles - if (ImGui::Button("Toggle..")) - ImGui::OpenPopup("my_toggle_popup"); - if (ImGui::BeginPopup("my_toggle_popup")) - { - for (int i = 0; i < IM_ARRAYSIZE(names); i++) - ImGui::MenuItem(names[i], "", &toggles[i]); - if (ImGui::BeginMenu("Sub-menu")) - { - ImGui::MenuItem("Click me"); - ImGui::EndMenu(); - } - - ImGui::Separator(); - ImGui::Text("Tooltip here"); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip("I am a tooltip over a popup"); - - if (ImGui::Button("Stacked Popup")) - ImGui::OpenPopup("another popup"); - if (ImGui::BeginPopup("another popup")) - { - for (int i = 0; i < IM_ARRAYSIZE(names); i++) - ImGui::MenuItem(names[i], "", &toggles[i]); - if (ImGui::BeginMenu("Sub-menu")) - { - ImGui::MenuItem("Click me"); - if (ImGui::Button("Stacked Popup")) - ImGui::OpenPopup("another popup"); - if (ImGui::BeginPopup("another popup")) - { - ImGui::Text("I am the last one here."); - ImGui::EndPopup(); - } - ImGui::EndMenu(); - } - ImGui::EndPopup(); - } - ImGui::EndPopup(); - } - - // Call the more complete ShowExampleMenuFile which we use in various places of this demo - if (ImGui::Button("File Menu..")) - ImGui::OpenPopup("my_file_popup"); - if (ImGui::BeginPopup("my_file_popup")) - { - ShowExampleMenuFile(); - ImGui::EndPopup(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Context menus")) - { - // BeginPopupContextItem() is a helper to provide common/simple popup behavior of essentially doing: - // if (IsItemHovered() && IsMouseReleased(0)) - // OpenPopup(id); - // return BeginPopup(id); - // For more advanced uses you may want to replicate and cuztomize this code. This the comments inside BeginPopupContextItem() implementation. - static float value = 0.5f; - ImGui::Text("Value = %.3f (<-- right-click here)", value); - if (ImGui::BeginPopupContextItem("item context menu")) - { - if (ImGui::Selectable("Set to zero")) value = 0.0f; - if (ImGui::Selectable("Set to PI")) value = 3.1415f; - ImGui::SetNextItemWidth(-1); - ImGui::DragFloat("##Value", &value, 0.1f, 0.0f, 0.0f); - ImGui::EndPopup(); - } - - // We can also use OpenPopupOnItemClick() which is the same as BeginPopupContextItem() but without the Begin call. - // So here we will make it that clicking on the text field with the right mouse button (1) will toggle the visibility of the popup above. - ImGui::Text("(You can also right-click me to open the same popup as above.)"); - ImGui::OpenPopupOnItemClick("item context menu", 1); - - // When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem(). - // BeginPopupContextItem() will use the last item ID as the popup ID. - // In addition here, we want to include your editable label inside the button label. We use the ### operator to override the ID (read FAQ about ID for details) - static char name[32] = "Label1"; - char buf[64]; sprintf(buf, "Button: %s###Button", name); // ### operator override ID ignoring the preceding label - ImGui::Button(buf); - if (ImGui::BeginPopupContextItem()) - { - ImGui::Text("Edit name:"); - ImGui::InputText("##edit", name, IM_ARRAYSIZE(name)); - if (ImGui::Button("Close")) - ImGui::CloseCurrentPopup(); - ImGui::EndPopup(); - } - ImGui::SameLine(); ImGui::Text("(<-- right-click here)"); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Modals")) - { - ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window."); - - if (ImGui::Button("Delete..")) - ImGui::OpenPopup("Delete?"); - - if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize)) - { - ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n"); - ImGui::Separator(); - - //static int dummy_i = 0; - //ImGui::Combo("Combo", &dummy_i, "Delete\0Delete harder\0"); - - static bool dont_ask_me_next_time = false; - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); - ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time); - ImGui::PopStyleVar(); - - if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } - ImGui::SetItemDefaultFocus(); - ImGui::SameLine(); - if (ImGui::Button("Cancel", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } - ImGui::EndPopup(); - } - - if (ImGui::Button("Stacked modals..")) - ImGui::OpenPopup("Stacked 1"); - if (ImGui::BeginPopupModal("Stacked 1", NULL, ImGuiWindowFlags_MenuBar)) - { - if (ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("File")) - { - if (ImGui::MenuItem("Dummy menu item")) {} - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it."); - - // Testing behavior of widgets stacking their own regular popups over the modal. - static int item = 1; - static float color[4] = { 0.4f,0.7f,0.0f,0.5f }; - ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); - ImGui::ColorEdit4("color", color); - - if (ImGui::Button("Add another modal..")) - ImGui::OpenPopup("Stacked 2"); - - // Also demonstrate passing a bool* to BeginPopupModal(), this will create a regular close button which will close the popup. - // Note that the visibility state of popups is owned by imgui, so the input value of the bool actually doesn't matter here. - bool dummy_open = true; - if (ImGui::BeginPopupModal("Stacked 2", &dummy_open)) - { - ImGui::Text("Hello from Stacked The Second!"); - if (ImGui::Button("Close")) - ImGui::CloseCurrentPopup(); - ImGui::EndPopup(); - } - - if (ImGui::Button("Close")) - ImGui::CloseCurrentPopup(); - ImGui::EndPopup(); - } - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Menus inside a regular window")) - { - ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!"); - ImGui::Separator(); - // NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above. - // To do so we are encloding the items in a PushID()/PopID() block to make them two different menusets. If we don't, opening any popup above and hovering our menu here - // would open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it, which is the desired behavior for regular menus. - ImGui::PushID("foo"); - ImGui::MenuItem("Menu item", "CTRL+M"); - if (ImGui::BeginMenu("Menu inside a regular window")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - ImGui::PopID(); - ImGui::Separator(); - ImGui::TreePop(); - } -} - -static void ShowDemoWindowColumns() -{ - if (!ImGui::CollapsingHeader("Columns")) - return; - - ImGui::PushID("Columns"); - - static bool disable_indent = false; - ImGui::Checkbox("Disable tree indentation", &disable_indent); - ImGui::SameLine(); - HelpMarker("Disable the indenting of tree nodes so demo columns can use the full window width."); - if (disable_indent) - ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, 0.0f); - - // Basic columns - if (ImGui::TreeNode("Basic")) - { - ImGui::Text("Without border:"); - ImGui::Columns(3, "mycolumns3", false); // 3-ways, no border - ImGui::Separator(); - for (int n = 0; n < 14; n++) - { - char label[32]; - sprintf(label, "Item %d", n); - if (ImGui::Selectable(label)) {} - //if (ImGui::Button(label, ImVec2(-FLT_MIN,0.0f))) {} - ImGui::NextColumn(); - } - ImGui::Columns(1); - ImGui::Separator(); - - ImGui::Text("With border:"); - ImGui::Columns(4, "mycolumns"); // 4-ways, with border - ImGui::Separator(); - ImGui::Text("ID"); ImGui::NextColumn(); - ImGui::Text("Name"); ImGui::NextColumn(); - ImGui::Text("Path"); ImGui::NextColumn(); - ImGui::Text("Hovered"); ImGui::NextColumn(); - ImGui::Separator(); - const char* names[3] = { "One", "Two", "Three" }; - const char* paths[3] = { "/path/one", "/path/two", "/path/three" }; - static int selected = -1; - for (int i = 0; i < 3; i++) - { - char label[32]; - sprintf(label, "%04d", i); - if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SpanAllColumns)) - selected = i; - bool hovered = ImGui::IsItemHovered(); - ImGui::NextColumn(); - ImGui::Text(names[i]); ImGui::NextColumn(); - ImGui::Text(paths[i]); ImGui::NextColumn(); - ImGui::Text("%d", hovered); ImGui::NextColumn(); - } - ImGui::Columns(1); - ImGui::Separator(); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Borders")) - { - // NB: Future columns API should allow automatic horizontal borders. - static bool h_borders = true; - static bool v_borders = true; - static int columns_count = 4; - const int lines_count = 3; - ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); - ImGui::DragInt("##columns_count", &columns_count, 0.1f, 2, 10, "%d columns"); - if (columns_count < 2) - columns_count = 2; - ImGui::SameLine(); - ImGui::Checkbox("horizontal", &h_borders); - ImGui::SameLine(); - ImGui::Checkbox("vertical", &v_borders); - ImGui::Columns(columns_count, NULL, v_borders); - for (int i = 0; i < columns_count * lines_count; i++) - { - if (h_borders && ImGui::GetColumnIndex() == 0) - ImGui::Separator(); - ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i); - ImGui::Text("Width %.2f", ImGui::GetColumnWidth()); - ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x); - ImGui::Text("Offset %.2f", ImGui::GetColumnOffset()); - ImGui::Text("Long text that is likely to clip"); - ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f)); - ImGui::NextColumn(); - } - ImGui::Columns(1); - if (h_borders) - ImGui::Separator(); - ImGui::TreePop(); - } - - // Create multiple items in a same cell before switching to next column - if (ImGui::TreeNode("Mixed items")) - { - ImGui::Columns(3, "mixed"); - ImGui::Separator(); - - ImGui::Text("Hello"); - ImGui::Button("Banana"); - ImGui::NextColumn(); - - ImGui::Text("ImGui"); - ImGui::Button("Apple"); - static float foo = 1.0f; - ImGui::InputFloat("red", &foo, 0.05f, 0, "%.3f"); - ImGui::Text("An extra line here."); - ImGui::NextColumn(); - - ImGui::Text("Sailor"); - ImGui::Button("Corniflower"); - static float bar = 1.0f; - ImGui::InputFloat("blue", &bar, 0.05f, 0, "%.3f"); - ImGui::NextColumn(); - - if (ImGui::CollapsingHeader("Category A")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); - if (ImGui::CollapsingHeader("Category B")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); - if (ImGui::CollapsingHeader("Category C")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); - ImGui::Columns(1); - ImGui::Separator(); - ImGui::TreePop(); - } - - // Word wrapping - if (ImGui::TreeNode("Word-wrapping")) - { - ImGui::Columns(2, "word-wrapping"); - ImGui::Separator(); - ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); - ImGui::TextWrapped("Hello Left"); - ImGui::NextColumn(); - ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); - ImGui::TextWrapped("Hello Right"); - ImGui::Columns(1); - ImGui::Separator(); - ImGui::TreePop(); - } - - // Scrolling columns - /* - if (ImGui::TreeNode("Vertical Scrolling")) - { - ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y)); - ImGui::Columns(3); - ImGui::Text("ID"); ImGui::NextColumn(); - ImGui::Text("Name"); ImGui::NextColumn(); - ImGui::Text("Path"); ImGui::NextColumn(); - ImGui::Columns(1); - ImGui::Separator(); - ImGui::EndChild(); - ImGui::BeginChild("##scrollingregion", ImVec2(0, 60)); - ImGui::Columns(3); - for (int i = 0; i < 10; i++) - { - ImGui::Text("%04d", i); ImGui::NextColumn(); - ImGui::Text("Foobar"); ImGui::NextColumn(); - ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn(); - } - ImGui::Columns(1); - ImGui::EndChild(); - ImGui::TreePop(); - } - */ - - if (ImGui::TreeNode("Horizontal Scrolling")) - { - ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f)); - ImGui::BeginChild("##ScrollingRegion", ImVec2(0, ImGui::GetFontSize() * 20), false, ImGuiWindowFlags_HorizontalScrollbar); - ImGui::Columns(10); - int ITEMS_COUNT = 2000; - ImGuiListClipper clipper(ITEMS_COUNT); // Also demonstrate using the clipper for large list - while (clipper.Step()) - { - for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) - for (int j = 0; j < 10; j++) - { - ImGui::Text("Line %d Column %d...", i, j); - ImGui::NextColumn(); - } - } - ImGui::Columns(1); - ImGui::EndChild(); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Tree")) - { - ImGui::Columns(2, "tree", true); - for (int x = 0; x < 3; x++) - { - bool open1 = ImGui::TreeNode((void*)(intptr_t)x, "Node%d", x); - ImGui::NextColumn(); - ImGui::Text("Node contents"); - ImGui::NextColumn(); - if (open1) - { - for (int y = 0; y < 3; y++) - { - bool open2 = ImGui::TreeNode((void*)(intptr_t)y, "Node%d.%d", x, y); - ImGui::NextColumn(); - ImGui::Text("Node contents"); - if (open2) - { - ImGui::Text("Even more contents"); - if (ImGui::TreeNode("Tree in column")) - { - ImGui::Text("The quick brown fox jumps over the lazy dog"); - ImGui::TreePop(); - } - } - ImGui::NextColumn(); - if (open2) - ImGui::TreePop(); - } - ImGui::TreePop(); - } - } - ImGui::Columns(1); - ImGui::TreePop(); - } - - if (disable_indent) - ImGui::PopStyleVar(); - ImGui::PopID(); -} - -static void ShowDemoWindowMisc() -{ - if (ImGui::CollapsingHeader("Filtering")) - { - // Helper class to easy setup a text filter. - // You may want to implement a more feature-full filtering scheme in your own application. - static ImGuiTextFilter filter; - ImGui::Text("Filter usage:\n" - " \"\" display all lines\n" - " \"xxx\" display lines containing \"xxx\"\n" - " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n" - " \"-xxx\" hide lines containing \"xxx\""); - filter.Draw(); - const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" }; - for (int i = 0; i < IM_ARRAYSIZE(lines); i++) - if (filter.PassFilter(lines[i])) - ImGui::BulletText("%s", lines[i]); - } - - if (ImGui::CollapsingHeader("Inputs, Navigation & Focus")) - { - ImGuiIO& io = ImGui::GetIO(); - - // Display ImGuiIO output flags - ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse); - ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard); - ImGui::Text("WantTextInput: %d", io.WantTextInput); - ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos); - ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible); - - // Display Keyboard/Mouse state - if (ImGui::TreeNode("Keyboard, Mouse & Navigation State")) - { - if (ImGui::IsMousePosValid()) - ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); - else - ImGui::Text("Mouse pos: "); - ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); - ImGui::Text("Mouse down:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } - ImGui::Text("Mouse clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } - ImGui::Text("Mouse dbl-clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } - ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } - ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); - - ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (io.KeysDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("%d (0x%X) (%.02f secs)", i, i, io.KeysDownDuration[i]); } - ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); } - ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); } - ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); - ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. - - ImGui::Text("NavInputs down:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputs[i] > 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputs[i]); } - ImGui::Text("NavInputs pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] == 0.0f) { ImGui::SameLine(); ImGui::Text("[%d]", i); } - ImGui::Text("NavInputs duration:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputsDownDuration[i]); } - - ImGui::Button("Hovering me sets the\nkeyboard capture flag"); - if (ImGui::IsItemHovered()) - ImGui::CaptureKeyboardFromApp(true); - ImGui::SameLine(); - ImGui::Button("Holding me clears the\nthe keyboard capture flag"); - if (ImGui::IsItemActive()) - ImGui::CaptureKeyboardFromApp(false); - - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Tabbing")) - { - ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields."); - static char buf[32] = "dummy"; - ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); - ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); - ImGui::InputText("3", buf, IM_ARRAYSIZE(buf)); - ImGui::PushAllowKeyboardFocus(false); - ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf)); - //ImGui::SameLine(); HelpMarker("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets."); - ImGui::PopAllowKeyboardFocus(); - ImGui::InputText("5", buf, IM_ARRAYSIZE(buf)); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Focus from code")) - { - bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine(); - bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine(); - bool focus_3 = ImGui::Button("Focus on 3"); - int has_focus = 0; - static char buf[128] = "click on a button to set focus"; - - if (focus_1) ImGui::SetKeyboardFocusHere(); - ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); - if (ImGui::IsItemActive()) has_focus = 1; - - if (focus_2) ImGui::SetKeyboardFocusHere(); - ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); - if (ImGui::IsItemActive()) has_focus = 2; - - ImGui::PushAllowKeyboardFocus(false); - if (focus_3) ImGui::SetKeyboardFocusHere(); - ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf)); - if (ImGui::IsItemActive()) has_focus = 3; - ImGui::PopAllowKeyboardFocus(); - - if (has_focus) - ImGui::Text("Item with focus: %d", has_focus); - else - ImGui::Text("Item with focus: "); - - // Use >= 0 parameter to SetKeyboardFocusHere() to focus an upcoming item - static float f3[3] = { 0.0f, 0.0f, 0.0f }; - int focus_ahead = -1; - if (ImGui::Button("Focus on X")) { focus_ahead = 0; } ImGui::SameLine(); - if (ImGui::Button("Focus on Y")) { focus_ahead = 1; } ImGui::SameLine(); - if (ImGui::Button("Focus on Z")) { focus_ahead = 2; } - if (focus_ahead != -1) ImGui::SetKeyboardFocusHere(focus_ahead); - ImGui::SliderFloat3("Float3", &f3[0], 0.0f, 1.0f); - - ImGui::TextWrapped("NB: Cursor & selection are preserved when refocusing last used item in code."); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Dragging")) - { - ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget."); - for (int button = 0; button < 3; button++) - ImGui::Text("IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d", - button, ImGui::IsMouseDragging(button), ImGui::IsMouseDragging(button, 0.0f), ImGui::IsMouseDragging(button, 20.0f)); - - ImGui::Button("Drag Me"); - if (ImGui::IsItemActive()) - ImGui::GetForegroundDrawList()->AddLine(io.MouseClickedPos[0], io.MousePos, ImGui::GetColorU32(ImGuiCol_Button), 4.0f); // Draw a line between the button and the mouse cursor - - // Drag operations gets "unlocked" when the mouse has moved past a certain threshold (the default threshold is stored in io.MouseDragThreshold) - // You can request a lower or higher threshold using the second parameter of IsMouseDragging() and GetMouseDragDelta() - ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f); - ImVec2 value_with_lock_threshold = ImGui::GetMouseDragDelta(0); - ImVec2 mouse_delta = io.MouseDelta; - ImGui::Text("GetMouseDragDelta(0):\n w/ default threshold: (%.1f, %.1f),\n w/ zero threshold: (%.1f, %.1f)\nMouseDelta: (%.1f, %.1f)", value_with_lock_threshold.x, value_with_lock_threshold.y, value_raw.x, value_raw.y, mouse_delta.x, mouse_delta.y); - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Mouse cursors")) - { - const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" }; - IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT); - - ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]); - ImGui::Text("Hover to see mouse cursors:"); - ImGui::SameLine(); HelpMarker("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it."); - for (int i = 0; i < ImGuiMouseCursor_COUNT; i++) - { - char label[32]; - sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]); - ImGui::Bullet(); ImGui::Selectable(label, false); - if (ImGui::IsItemHovered() || ImGui::IsItemFocused()) - ImGui::SetMouseCursor(i); - } - ImGui::TreePop(); - } - } -} - -//----------------------------------------------------------------------------- -// [SECTION] About Window / ShowAboutWindow() -// Access from Dear ImGui Demo -> Tools -> About -//----------------------------------------------------------------------------- - -void ImGui::ShowAboutWindow(bool* p_open) -{ - if (!ImGui::Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize)) - { - ImGui::End(); - return; - } - ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); - ImGui::Separator(); - ImGui::Text("By Omar Cornut and all Dear ImGui contributors."); - ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information."); - - static bool show_config_info = false; - ImGui::Checkbox("Config/Build Information", &show_config_info); - if (show_config_info) - { - ImGuiIO& io = ImGui::GetIO(); - ImGuiStyle& style = ImGui::GetStyle(); - - bool copy_to_clipboard = ImGui::Button("Copy to clipboard"); - ImGui::BeginChildFrame(ImGui::GetID("cfginfos"), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove); - if (copy_to_clipboard) - { - ImGui::LogToClipboard(); - ImGui::LogText("```\n"); // Back quotes will make the text appears without formatting when pasting to GitHub - } - - ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); - ImGui::Separator(); - ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert)); - ImGui::Text("define: __cplusplus=%d", (int)__cplusplus); -#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_WIN32_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_FILE_FUNCTIONS - ImGui::Text("define: IMGUI_DISABLE_FILE_FUNCTIONS"); -#endif -#ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS - ImGui::Text("define: IMGUI_DISABLE_DEFAULT_ALLOCATORS"); -#endif -#ifdef IMGUI_USE_BGRA_PACKED_COLOR - ImGui::Text("define: IMGUI_USE_BGRA_PACKED_COLOR"); -#endif -#ifdef _WIN32 - ImGui::Text("define: _WIN32"); -#endif -#ifdef _WIN64 - ImGui::Text("define: _WIN64"); -#endif -#ifdef __linux__ - ImGui::Text("define: __linux__"); -#endif -#ifdef __APPLE__ - ImGui::Text("define: __APPLE__"); -#endif -#ifdef _MSC_VER - ImGui::Text("define: _MSC_VER=%d", _MSC_VER); -#endif -#ifdef __MINGW32__ - ImGui::Text("define: __MINGW32__"); -#endif -#ifdef __MINGW64__ - ImGui::Text("define: __MINGW64__"); -#endif -#ifdef __GNUC__ - ImGui::Text("define: __GNUC__=%d", (int)__GNUC__); -#endif -#ifdef __clang_version__ - ImGui::Text("define: __clang_version__=%s", __clang_version__); -#endif - ImGui::Separator(); - ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL"); - ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL"); - ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags); - if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard"); - if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad"); - if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos"); - if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard"); - if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse"); - if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange"); - if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor"); - if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors"); - if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink"); - if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges"); - if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly"); - if (io.ConfigWindowsMemoryCompactTimer >= 0.0f) ImGui::Text("io.ConfigWindowsMemoryCompactTimer = %.1ff", io.ConfigWindowsMemoryCompactTimer); - ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags); - if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad"); - if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors"); - if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) ImGui::Text(" HasSetMousePos"); - if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) ImGui::Text(" RendererHasVtxOffset"); - ImGui::Separator(); - ImGui::Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight); - ImGui::Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y); - ImGui::Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); - ImGui::Separator(); - ImGui::Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y); - ImGui::Text("style.WindowBorderSize: %.2f", style.WindowBorderSize); - ImGui::Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y); - ImGui::Text("style.FrameRounding: %.2f", style.FrameRounding); - ImGui::Text("style.FrameBorderSize: %.2f", style.FrameBorderSize); - ImGui::Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y); - ImGui::Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y); - - if (copy_to_clipboard) - { - ImGui::LogText("\n```\n"); - ImGui::LogFinish(); - } - ImGui::EndChildFrame(); - } - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Style Editor / ShowStyleEditor() -//----------------------------------------------------------------------------- -// - ShowStyleSelector() -// - ShowFontSelector() -// - ShowStyleEditor() -//----------------------------------------------------------------------------- - -// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options. -// Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally. -bool ImGui::ShowStyleSelector(const char* label) -{ - static int style_idx = -1; - if (ImGui::Combo(label, &style_idx, "Classic\0Dark\0Light\0")) - { - switch (style_idx) - { - case 0: ImGui::StyleColorsClassic(); break; - case 1: ImGui::StyleColorsDark(); break; - case 2: ImGui::StyleColorsLight(); break; - } - return true; - } - return false; -} - -// Demo helper function to select among loaded fonts. -// Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one. -void ImGui::ShowFontSelector(const char* label) -{ - ImGuiIO& io = ImGui::GetIO(); - ImFont* font_current = ImGui::GetFont(); - if (ImGui::BeginCombo(label, font_current->GetDebugName())) - { - for (int n = 0; n < io.Fonts->Fonts.Size; n++) - { - ImFont* font = io.Fonts->Fonts[n]; - ImGui::PushID((void*)font); - if (ImGui::Selectable(font->GetDebugName(), font == font_current)) - io.FontDefault = font; - ImGui::PopID(); - } - ImGui::EndCombo(); - } - ImGui::SameLine(); - HelpMarker( - "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n" - "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n" - "- Read FAQ and docs/FONTS.txt for more details.\n" - "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame()."); -} - -void ImGui::ShowStyleEditor(ImGuiStyle* ref) -{ - // You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to an internally stored reference) - ImGuiStyle& style = ImGui::GetStyle(); - static ImGuiStyle ref_saved_style; - - // Default to using internal storage as reference - static bool init = true; - if (init && ref == NULL) - ref_saved_style = style; - init = false; - if (ref == NULL) - ref = &ref_saved_style; - - ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f); - - if (ImGui::ShowStyleSelector("Colors##Selector")) - ref_saved_style = style; - ImGui::ShowFontSelector("Fonts##Selector"); - - // Simplified Settings - if (ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f")) - style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding - { bool window_border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; } - ImGui::SameLine(); - { bool frame_border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; } - ImGui::SameLine(); - { bool popup_border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; } - - // Save/Revert button - if (ImGui::Button("Save Ref")) - *ref = ref_saved_style = style; - ImGui::SameLine(); - if (ImGui::Button("Revert Ref")) - style = *ref; - ImGui::SameLine(); - HelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export\" below to save them somewhere."); - - ImGui::Separator(); - - if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) - { - if (ImGui::BeginTabItem("Sizes")) - { - ImGui::Text("Main"); - ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); - ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); - ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); - ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); - ImGui::Text("Borders"); - ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::Text("Rounding"); - ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); - ImGui::Text("Alignment"); - ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); - int window_menu_button_position = style.WindowMenuButtonPosition + 1; - if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0")) - style.WindowMenuButtonPosition = window_menu_button_position - 1; - ImGui::Combo("ColorButtonPosition", (int*)&style.ColorButtonPosition, "Left\0Right\0"); - ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content."); - ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content."); - ImGui::Text("Safe Area Padding"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); - ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("Colors")) - { - static int output_dest = 0; - static bool output_only_modified = true; - if (ImGui::Button("Export")) - { - if (output_dest == 0) - ImGui::LogToClipboard(); - else - ImGui::LogToTTY(); - ImGui::LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE); - for (int i = 0; i < ImGuiCol_COUNT; i++) - { - const ImVec4& col = style.Colors[i]; - const char* name = ImGui::GetStyleColorName(i); - if (!output_only_modified || memcmp(&col, &ref->Colors[i], sizeof(ImVec4)) != 0) - ImGui::LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (int)strlen(name), "", col.x, col.y, col.z, col.w); - } - ImGui::LogFinish(); - } - ImGui::SameLine(); ImGui::SetNextItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0"); - ImGui::SameLine(); ImGui::Checkbox("Only Modified Colors", &output_only_modified); - - static ImGuiTextFilter filter; - filter.Draw("Filter colors", ImGui::GetFontSize() * 16); - - static ImGuiColorEditFlags alpha_flags = 0; - if (ImGui::RadioButton("Opaque", alpha_flags == 0)) { alpha_flags = 0; } ImGui::SameLine(); - if (ImGui::RadioButton("Alpha", alpha_flags == ImGuiColorEditFlags_AlphaPreview)) { alpha_flags = ImGuiColorEditFlags_AlphaPreview; } ImGui::SameLine(); - if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine(); - HelpMarker("In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu."); - - ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); - ImGui::PushItemWidth(-160); - for (int i = 0; i < ImGuiCol_COUNT; i++) - { - const char* name = ImGui::GetStyleColorName(i); - if (!filter.PassFilter(name)) - continue; - ImGui::PushID(i); - ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags); - if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0) - { - // Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons. - // Read the FAQ and docs/FONTS.txt about using icon fonts. It's really easy and super convenient! - ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i]; - ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i]; - } - ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); - ImGui::TextUnformatted(name); - ImGui::PopID(); - } - ImGui::PopItemWidth(); - ImGui::EndChild(); - - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("Fonts")) - { - ImGuiIO& io = ImGui::GetIO(); - ImFontAtlas* atlas = io.Fonts; - HelpMarker("Read FAQ and docs/FONTS.txt for details on font loading."); - ImGui::PushItemWidth(120); - for (int i = 0; i < atlas->Fonts.Size; i++) - { - ImFont* font = atlas->Fonts[i]; - ImGui::PushID(font); - bool font_details_opened = ImGui::TreeNode(font, "Font %d: \"%s\"\n%.2f px, %d glyphs, %d file(s)", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount); - ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { io.FontDefault = font; } - if (font_details_opened) - { - ImGui::PushFont(font); - ImGui::Text("The quick brown fox jumps over the lazy dog"); - ImGui::PopFont(); - ImGui::DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font - ImGui::SameLine(); HelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)"); - ImGui::InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f"); - ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent); - ImGui::Text("Fallback character: '%c' (U+%04X)", font->FallbackChar, font->FallbackChar); - ImGui::Text("Ellipsis character: '%c' (U+%04X)", font->EllipsisChar, font->EllipsisChar); - const float surface_sqrt = sqrtf((float)font->MetricsTotalSurface); - ImGui::Text("Texture Area: about %d px ~%dx%d px", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt); - for (int config_i = 0; config_i < font->ConfigDataCount; config_i++) - if (font->ConfigData) - if (const ImFontConfig* cfg = &font->ConfigData[config_i]) - ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH); - if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size)) - { - // Display all glyphs of the fonts in separate pages of 256 characters - for (unsigned int base = 0; base <= IM_UNICODE_CODEPOINT_MAX; base += 256) - { - // Skip ahead if a large bunch of glyphs are not present in the font (test in chunks of 4k) - // This is only a small optimization to reduce the number of iterations when IM_UNICODE_MAX_CODEPOINT is large. - // (if ImWchar==ImWchar32 we will do at least about 272 queries here) - if (!(base & 4095) && font->IsGlyphRangeUnused(base, base + 4095)) - { - base += 4096 - 256; - continue; - } - - int count = 0; - for (unsigned int n = 0; n < 256; n++) - count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0; - if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph")) - { - float cell_size = font->FontSize * 1; - float cell_spacing = style.ItemSpacing.y; - ImVec2 base_pos = ImGui::GetCursorScreenPos(); - ImDrawList* draw_list = ImGui::GetWindowDrawList(); - for (unsigned int n = 0; n < 256; n++) - { - ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing)); - ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size); - const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n)); - draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50)); - if (glyph) - font->RenderChar(draw_list, cell_size, cell_p1, ImGui::GetColorU32(ImGuiCol_Text), (ImWchar)(base + n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string. - if (glyph && ImGui::IsMouseHoveringRect(cell_p1, cell_p2)) - { - ImGui::BeginTooltip(); - ImGui::Text("Codepoint: U+%04X", base + n); - ImGui::Separator(); - ImGui::Text("Visible: %d", glyph->Visible); - ImGui::Text("AdvanceX: %.1f", glyph->AdvanceX); - ImGui::Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1); - ImGui::Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1); - ImGui::EndTooltip(); - } - } - ImGui::Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16)); - ImGui::TreePop(); - } - } - ImGui::TreePop(); - } - ImGui::TreePop(); - } - ImGui::PopID(); - } - if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) - { - ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); - ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); - ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), tint_col, border_col); - ImGui::TreePop(); - } - - HelpMarker("Those are old settings provided for convenience.\nHowever, the _correct_ way of scaling your UI is currently to reload your font at the designed size, rebuild the font atlas, and call style.ScaleAllSizes() on a reference ImGuiStyle structure."); - static float window_scale = 1.0f; - if (ImGui::DragFloat("window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.2f")) // scale only this window - ImGui::SetWindowFontScale(window_scale); - ImGui::DragFloat("global scale", &io.FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.2f"); // scale everything - ImGui::PopItemWidth(); - - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("Rendering")) - { - ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); HelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well."); - ImGui::Checkbox("Anti-aliased fill", &style.AntiAliasedFill); - ImGui::PushItemWidth(100); - ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, 10.0f, "%.2f"); - if (style.CurveTessellationTol < 0.10f) style.CurveTessellationTol = 0.10f; - ImGui::DragFloat("Circle segment Max Error", &style.CircleSegmentMaxError, 0.01f, 0.10f, 10.0f, "%.2f"); - ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero. - ImGui::PopItemWidth(); - - ImGui::EndTabItem(); - } - - ImGui::EndTabBar(); - } - - ImGui::PopItemWidth(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() -//----------------------------------------------------------------------------- -// - ShowExampleAppMainMenuBar() -// - ShowExampleMenuFile() -//----------------------------------------------------------------------------- - -// Demonstrate creating a "main" fullscreen menu bar and populating it. -// Note the difference between BeginMainMenuBar() and BeginMenuBar(): -// - BeginMenuBar() = menu-bar inside current window we Begin()-ed into (the window needs the ImGuiWindowFlags_MenuBar flag) -// - BeginMainMenuBar() = helper to create menu-bar-sized window at the top of the main viewport + call BeginMenuBar() into it. -static void ShowExampleAppMainMenuBar() -{ - if (ImGui::BeginMainMenuBar()) - { - if (ImGui::BeginMenu("File")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Edit")) - { - if (ImGui::MenuItem("Undo", "CTRL+Z")) {} - if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item - ImGui::Separator(); - if (ImGui::MenuItem("Cut", "CTRL+X")) {} - if (ImGui::MenuItem("Copy", "CTRL+C")) {} - if (ImGui::MenuItem("Paste", "CTRL+V")) {} - ImGui::EndMenu(); - } - ImGui::EndMainMenuBar(); - } -} - -// Note that shortcuts are currently provided for display only (future version will add flags to BeginMenu to process shortcuts) -static void ShowExampleMenuFile() -{ - ImGui::MenuItem("(dummy menu)", NULL, false, false); - if (ImGui::MenuItem("New")) {} - if (ImGui::MenuItem("Open", "Ctrl+O")) {} - if (ImGui::BeginMenu("Open Recent")) - { - ImGui::MenuItem("fish_hat.c"); - ImGui::MenuItem("fish_hat.inl"); - ImGui::MenuItem("fish_hat.h"); - if (ImGui::BeginMenu("More..")) - { - ImGui::MenuItem("Hello"); - ImGui::MenuItem("Sailor"); - if (ImGui::BeginMenu("Recurse..")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - ImGui::EndMenu(); - } - ImGui::EndMenu(); - } - if (ImGui::MenuItem("Save", "Ctrl+S")) {} - if (ImGui::MenuItem("Save As..")) {} - - ImGui::Separator(); - if (ImGui::BeginMenu("Options")) - { - static bool enabled = true; - ImGui::MenuItem("Enabled", "", &enabled); - ImGui::BeginChild("child", ImVec2(0, 60), true); - for (int i = 0; i < 10; i++) - ImGui::Text("Scrolling Text %d", i); - ImGui::EndChild(); - static float f = 0.5f; - static int n = 0; - ImGui::SliderFloat("Value", &f, 0.0f, 1.0f); - ImGui::InputFloat("Input", &f, 0.1f); - ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0"); - ImGui::EndMenu(); - } - - if (ImGui::BeginMenu("Colors")) - { - float sz = ImGui::GetTextLineHeight(); - for (int i = 0; i < ImGuiCol_COUNT; i++) - { - const char* name = ImGui::GetStyleColorName((ImGuiCol)i); - ImVec2 p = ImGui::GetCursorScreenPos(); - ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x+sz, p.y+sz), ImGui::GetColorU32((ImGuiCol)i)); - ImGui::Dummy(ImVec2(sz, sz)); - ImGui::SameLine(); - ImGui::MenuItem(name); - } - ImGui::EndMenu(); - } - - // Here we demonstrate appending again to the "Options" menu (which we already created above) - // Of course in this demo it is a little bit silly that this function calls BeginMenu("Options") twice. - // In a real code-base using it would make senses to use this feature from very different code locations. - if (ImGui::BeginMenu("Options")) // <-- Append! - { - static bool b = true; - ImGui::Checkbox("SomeOption", &b); - ImGui::EndMenu(); - } - - if (ImGui::BeginMenu("Disabled", false)) // Disabled - { - IM_ASSERT(0); - } - if (ImGui::MenuItem("Checked", NULL, true)) {} - if (ImGui::MenuItem("Quit", "Alt+F4")) {} -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Debug Console / ShowExampleAppConsole() -//----------------------------------------------------------------------------- - -// Demonstrate creating a simple console window, with scrolling, filtering, completion and history. -// For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions. -struct ExampleAppConsole -{ - char InputBuf[256]; - ImVector Items; - ImVector Commands; - ImVector History; - int HistoryPos; // -1: new line, 0..History.Size-1 browsing history. - ImGuiTextFilter Filter; - bool AutoScroll; - bool ScrollToBottom; - - ExampleAppConsole() - { - ClearLog(); - memset(InputBuf, 0, sizeof(InputBuf)); - HistoryPos = -1; - Commands.push_back("HELP"); - Commands.push_back("HISTORY"); - Commands.push_back("CLEAR"); - Commands.push_back("CLASSIFY"); // "classify" is only here to provide an example of "C"+[tab] completing to "CL" and displaying matches. - AutoScroll = true; - ScrollToBottom = false; - AddLog("Welcome to Dear ImGui!"); - } - ~ExampleAppConsole() - { - ClearLog(); - for (int i = 0; i < History.Size; i++) - free(History[i]); - } - - // Portable helpers - static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } - static int Strnicmp(const char* str1, const char* str2, int n) { int d = 0; while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; } return d; } - static char* Strdup(const char *str) { size_t len = strlen(str) + 1; void* buf = malloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)str, len); } - static void Strtrim(char* str) { char* str_end = str + strlen(str); while (str_end > str && str_end[-1] == ' ') str_end--; *str_end = 0; } - - void ClearLog() - { - for (int i = 0; i < Items.Size; i++) - free(Items[i]); - Items.clear(); - } - - void AddLog(const char* fmt, ...) IM_FMTARGS(2) - { - // FIXME-OPT - char buf[1024]; - va_list args; - va_start(args, fmt); - vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); - buf[IM_ARRAYSIZE(buf)-1] = 0; - va_end(args); - Items.push_back(Strdup(buf)); - } - - void Draw(const char* title, bool* p_open) - { - ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); - if (!ImGui::Begin(title, p_open)) - { - ImGui::End(); - return; - } - - // As a specific feature guaranteed by the library, after calling Begin() the last Item represent the title bar. So e.g. IsItemHovered() will return true when hovering the title bar. - // Here we create a context menu only available from the title bar. - if (ImGui::BeginPopupContextItem()) - { - if (ImGui::MenuItem("Close Console")) - *p_open = false; - ImGui::EndPopup(); - } - - ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc."); - ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion."); - - // TODO: display items starting from the bottom - - if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine(); - if (ImGui::SmallButton("Add Dummy Error")) { AddLog("[error] something went wrong"); } ImGui::SameLine(); - if (ImGui::SmallButton("Clear")) { ClearLog(); } ImGui::SameLine(); - bool copy_to_clipboard = ImGui::SmallButton("Copy"); - //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); } - - ImGui::Separator(); - - // Options menu - if (ImGui::BeginPopup("Options")) - { - ImGui::Checkbox("Auto-scroll", &AutoScroll); - ImGui::EndPopup(); - } - - // Options, Filter - if (ImGui::Button("Options")) - ImGui::OpenPopup("Options"); - ImGui::SameLine(); - Filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180); - ImGui::Separator(); - - const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing(); // 1 separator, 1 input text - ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar); // Leave room for 1 separator + 1 InputText - if (ImGui::BeginPopupContextWindow()) - { - if (ImGui::Selectable("Clear")) ClearLog(); - ImGui::EndPopup(); - } - - // Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end()); - // NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping to only process visible items. - // You can seek and display only the lines that are visible using the ImGuiListClipper helper, if your elements are evenly spaced and you have cheap random access to the elements. - // To use the clipper we could replace the 'for (int i = 0; i < Items.Size; i++)' loop with: - // ImGuiListClipper clipper(Items.Size); - // while (clipper.Step()) - // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) - // However, note that you can not use this code as is if a filter is active because it breaks the 'cheap random-access' property. We would need random-access on the post-filtered list. - // A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices that passed the filtering test, recomputing this array when user changes the filter, - // and appending newly elements as they are inserted. This is left as a task to the user until we can manage to improve this example code! - // If your items are of variable size you may want to implement code similar to what ImGuiListClipper does. Or split your data into fixed height items to allow random-seeking into your list. - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing - if (copy_to_clipboard) - ImGui::LogToClipboard(); - for (int i = 0; i < Items.Size; i++) - { - const char* item = Items[i]; - if (!Filter.PassFilter(item)) - continue; - - // Normally you would store more information in your item (e.g. make Items[] an array of structure, store color/type etc.) - bool pop_color = false; - if (strstr(item, "[error]")) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f)); pop_color = true; } - else if (strncmp(item, "# ", 2) == 0) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.8f, 0.6f, 1.0f)); pop_color = true; } - ImGui::TextUnformatted(item); - if (pop_color) - ImGui::PopStyleColor(); - } - if (copy_to_clipboard) - ImGui::LogFinish(); - - if (ScrollToBottom || (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY())) - ImGui::SetScrollHereY(1.0f); - ScrollToBottom = false; - - ImGui::PopStyleVar(); - ImGui::EndChild(); - ImGui::Separator(); - - // Command-line - bool reclaim_focus = false; - if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this)) - { - char* s = InputBuf; - Strtrim(s); - if (s[0]) - ExecCommand(s); - strcpy(s, ""); - reclaim_focus = true; - } - - // Auto-focus on window apparition - ImGui::SetItemDefaultFocus(); - if (reclaim_focus) - ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget - - ImGui::End(); - } - - void ExecCommand(const char* command_line) - { - AddLog("# %s\n", command_line); - - // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal. - HistoryPos = -1; - for (int i = History.Size-1; i >= 0; i--) - if (Stricmp(History[i], command_line) == 0) - { - free(History[i]); - History.erase(History.begin() + i); - break; - } - History.push_back(Strdup(command_line)); - - // Process command - if (Stricmp(command_line, "CLEAR") == 0) - { - ClearLog(); - } - else if (Stricmp(command_line, "HELP") == 0) - { - AddLog("Commands:"); - for (int i = 0; i < Commands.Size; i++) - AddLog("- %s", Commands[i]); - } - else if (Stricmp(command_line, "HISTORY") == 0) - { - int first = History.Size - 10; - for (int i = first > 0 ? first : 0; i < History.Size; i++) - AddLog("%3d: %s\n", i, History[i]); - } - else - { - AddLog("Unknown command: '%s'\n", command_line); - } - - // On commad input, we scroll to bottom even if AutoScroll==false - ScrollToBottom = true; - } - - static int TextEditCallbackStub(ImGuiInputTextCallbackData* data) // In C++11 you are better off using lambdas for this sort of forwarding callbacks - { - ExampleAppConsole* console = (ExampleAppConsole*)data->UserData; - return console->TextEditCallback(data); - } - - int TextEditCallback(ImGuiInputTextCallbackData* data) - { - //AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd); - switch (data->EventFlag) - { - case ImGuiInputTextFlags_CallbackCompletion: - { - // Example of TEXT COMPLETION - - // Locate beginning of current word - const char* word_end = data->Buf + data->CursorPos; - const char* word_start = word_end; - while (word_start > data->Buf) - { - const char c = word_start[-1]; - if (c == ' ' || c == '\t' || c == ',' || c == ';') - break; - word_start--; - } - - // Build a list of candidates - ImVector candidates; - for (int i = 0; i < Commands.Size; i++) - if (Strnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0) - candidates.push_back(Commands[i]); - - if (candidates.Size == 0) - { - // No match - AddLog("No match for \"%.*s\"!\n", (int)(word_end-word_start), word_start); - } - else if (candidates.Size == 1) - { - // Single match. Delete the beginning of the word and replace it entirely so we've got nice casing - data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start)); - data->InsertChars(data->CursorPos, candidates[0]); - data->InsertChars(data->CursorPos, " "); - } - else - { - // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY" - int match_len = (int)(word_end - word_start); - for (;;) - { - int c = 0; - bool all_candidates_matches = true; - for (int i = 0; i < candidates.Size && all_candidates_matches; i++) - if (i == 0) - c = toupper(candidates[i][match_len]); - else if (c == 0 || c != toupper(candidates[i][match_len])) - all_candidates_matches = false; - if (!all_candidates_matches) - break; - match_len++; - } - - if (match_len > 0) - { - data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start)); - data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len); - } - - // List matches - AddLog("Possible matches:\n"); - for (int i = 0; i < candidates.Size; i++) - AddLog("- %s\n", candidates[i]); - } - - break; - } - case ImGuiInputTextFlags_CallbackHistory: - { - // Example of HISTORY - const int prev_history_pos = HistoryPos; - if (data->EventKey == ImGuiKey_UpArrow) - { - if (HistoryPos == -1) - HistoryPos = History.Size - 1; - else if (HistoryPos > 0) - HistoryPos--; - } - else if (data->EventKey == ImGuiKey_DownArrow) - { - if (HistoryPos != -1) - if (++HistoryPos >= History.Size) - HistoryPos = -1; - } - - // A better implementation would preserve the data on the current input line along with cursor position. - if (prev_history_pos != HistoryPos) - { - const char* history_str = (HistoryPos >= 0) ? History[HistoryPos] : ""; - data->DeleteChars(0, data->BufTextLen); - data->InsertChars(0, history_str); - } - } - } - return 0; - } -}; - -static void ShowExampleAppConsole(bool* p_open) -{ - static ExampleAppConsole console; - console.Draw("Example: Console", p_open); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Debug Log / ShowExampleAppLog() -//----------------------------------------------------------------------------- - -// Usage: -// static ExampleAppLog my_log; -// my_log.AddLog("Hello %d world\n", 123); -// my_log.Draw("title"); -struct ExampleAppLog -{ - ImGuiTextBuffer Buf; - ImGuiTextFilter Filter; - ImVector LineOffsets; // Index to lines offset. We maintain this with AddLog() calls, allowing us to have a random access on lines - bool AutoScroll; // Keep scrolling if already at the bottom - - ExampleAppLog() - { - AutoScroll = true; - Clear(); - } - - void Clear() - { - Buf.clear(); - LineOffsets.clear(); - LineOffsets.push_back(0); - } - - void AddLog(const char* fmt, ...) IM_FMTARGS(2) - { - int old_size = Buf.size(); - va_list args; - va_start(args, fmt); - Buf.appendfv(fmt, args); - va_end(args); - for (int new_size = Buf.size(); old_size < new_size; old_size++) - if (Buf[old_size] == '\n') - LineOffsets.push_back(old_size + 1); - } - - void Draw(const char* title, bool* p_open = NULL) - { - if (!ImGui::Begin(title, p_open)) - { - ImGui::End(); - return; - } - - // Options menu - if (ImGui::BeginPopup("Options")) - { - ImGui::Checkbox("Auto-scroll", &AutoScroll); - ImGui::EndPopup(); - } - - // Main window - if (ImGui::Button("Options")) - ImGui::OpenPopup("Options"); - ImGui::SameLine(); - bool clear = ImGui::Button("Clear"); - ImGui::SameLine(); - bool copy = ImGui::Button("Copy"); - ImGui::SameLine(); - Filter.Draw("Filter", -100.0f); - - ImGui::Separator(); - ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar); - - if (clear) - Clear(); - if (copy) - ImGui::LogToClipboard(); - - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); - const char* buf = Buf.begin(); - const char* buf_end = Buf.end(); - if (Filter.IsActive()) - { - // In this example we don't use the clipper when Filter is enabled. - // This is because we don't have a random access on the result on our filter. - // A real application processing logs with ten of thousands of entries may want to store the result of search/filter. - // especially if the filtering function is not trivial (e.g. reg-exp). - for (int line_no = 0; line_no < LineOffsets.Size; line_no++) - { - const char* line_start = buf + LineOffsets[line_no]; - const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; - if (Filter.PassFilter(line_start, line_end)) - ImGui::TextUnformatted(line_start, line_end); - } - } - else - { - // The simplest and easy way to display the entire buffer: - // ImGui::TextUnformatted(buf_begin, buf_end); - // And it'll just work. TextUnformatted() has specialization for large blob of text and will fast-forward to skip non-visible lines. - // Here we instead demonstrate using the clipper to only process lines that are within the visible area. - // If you have tens of thousands of items and their processing cost is non-negligible, coarse clipping them on your side is recommended. - // Using ImGuiListClipper requires A) random access into your data, and B) items all being the same height, - // both of which we can handle since we an array pointing to the beginning of each line of text. - // When using the filter (in the block of code above) we don't have random access into the data to display anymore, which is why we don't use the clipper. - // Storing or skimming through the search result would make it possible (and would be recommended if you want to search through tens of thousands of entries) - ImGuiListClipper clipper; - clipper.Begin(LineOffsets.Size); - while (clipper.Step()) - { - for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++) - { - const char* line_start = buf + LineOffsets[line_no]; - const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; - ImGui::TextUnformatted(line_start, line_end); - } - } - clipper.End(); - } - ImGui::PopStyleVar(); - - if (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) - ImGui::SetScrollHereY(1.0f); - - ImGui::EndChild(); - ImGui::End(); - } -}; - -// Demonstrate creating a simple log window with basic filtering. -static void ShowExampleAppLog(bool* p_open) -{ - static ExampleAppLog log; - - // For the demo: add a debug button _BEFORE_ the normal log window contents - // We take advantage of a rarely used feature: multiple calls to Begin()/End() are appending to the _same_ window. - // Most of the contents of the window will be added by the log.Draw() call. - ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver); - ImGui::Begin("Example: Log", p_open); - if (ImGui::SmallButton("[Debug] Add 5 entries")) - { - static int counter = 0; - for (int n = 0; n < 5; n++) - { - const char* categories[3] = { "info", "warn", "error" }; - const char* words[] = { "Bumfuzzled", "Cattywampus", "Snickersnee", "Abibliophobia", "Absquatulate", "Nincompoop", "Pauciloquent" }; - log.AddLog("[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n", - ImGui::GetFrameCount(), categories[counter % IM_ARRAYSIZE(categories)], ImGui::GetTime(), words[counter % IM_ARRAYSIZE(words)]); - counter++; - } - } - ImGui::End(); - - // Actually call in the regular Log helper (which will Begin() into the same window as we just did) - log.Draw("Example: Log", p_open); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Simple Layout / ShowExampleAppLayout() -//----------------------------------------------------------------------------- - -// Demonstrate create a window with multiple child windows. -static void ShowExampleAppLayout(bool* p_open) -{ - ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiCond_FirstUseEver); - if (ImGui::Begin("Example: Simple layout", p_open, ImGuiWindowFlags_MenuBar)) - { - if (ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("File")) - { - if (ImGui::MenuItem("Close")) *p_open = false; - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - - // left - static int selected = 0; - ImGui::BeginChild("left pane", ImVec2(150, 0), true); - for (int i = 0; i < 100; i++) - { - char label[128]; - sprintf(label, "MyObject %d", i); - if (ImGui::Selectable(label, selected == i)) - selected = i; - } - ImGui::EndChild(); - ImGui::SameLine(); - - // right - ImGui::BeginGroup(); - ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us - ImGui::Text("MyObject: %d", selected); - ImGui::Separator(); - if (ImGui::BeginTabBar("##Tabs", ImGuiTabBarFlags_None)) - { - if (ImGui::BeginTabItem("Description")) - { - ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Details")) - { - ImGui::Text("ID: 0123456789"); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::EndChild(); - if (ImGui::Button("Revert")) {} - ImGui::SameLine(); - if (ImGui::Button("Save")) {} - ImGui::EndGroup(); - } - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() -//----------------------------------------------------------------------------- - -// Demonstrate create a simple property editor. -static void ShowExampleAppPropertyEditor(bool* p_open) -{ - ImGui::SetNextWindowSize(ImVec2(430,450), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("Example: Property editor", p_open)) - { - ImGui::End(); - return; - } - - HelpMarker("This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API."); - - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2,2)); - ImGui::Columns(2); - ImGui::Separator(); - - struct funcs - { - static void ShowDummyObject(const char* prefix, int uid) - { - ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID. - ImGui::AlignTextToFramePadding(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high. - bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid); - ImGui::NextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("my sailor is rich"); - ImGui::NextColumn(); - if (node_open) - { - static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f }; - for (int i = 0; i < 8; i++) - { - ImGui::PushID(i); // Use field index as identifier. - if (i < 2) - { - ShowDummyObject("Child", 424242); - } - else - { - // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well) - ImGui::AlignTextToFramePadding(); - ImGui::TreeNodeEx("Field", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet, "Field_%d", i); - ImGui::NextColumn(); - ImGui::SetNextItemWidth(-1); - if (i >= 5) - ImGui::InputFloat("##value", &dummy_members[i], 1.0f); - else - ImGui::DragFloat("##value", &dummy_members[i], 0.01f); - ImGui::NextColumn(); - } - ImGui::PopID(); - } - ImGui::TreePop(); - } - ImGui::PopID(); - } - }; - - // Iterate dummy objects with dummy members (all the same data) - for (int obj_i = 0; obj_i < 3; obj_i++) - funcs::ShowDummyObject("Object", obj_i); - - ImGui::Columns(1); - ImGui::Separator(); - ImGui::PopStyleVar(); - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Long Text / ShowExampleAppLongText() -//----------------------------------------------------------------------------- - -// Demonstrate/test rendering huge amount of text, and the incidence of clipping. -static void ShowExampleAppLongText(bool* p_open) -{ - ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("Example: Long text display", p_open)) - { - ImGui::End(); - return; - } - - static int test_type = 0; - static ImGuiTextBuffer log; - static int lines = 0; - ImGui::Text("Printing unusually long amount of text."); - ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped\0Multiple calls to Text(), not clipped (slow)\0"); - ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size()); - if (ImGui::Button("Clear")) { log.clear(); lines = 0; } - ImGui::SameLine(); - if (ImGui::Button("Add 1000 lines")) - { - for (int i = 0; i < 1000; i++) - log.appendf("%i The quick brown fox jumps over the lazy dog\n", lines+i); - lines += 1000; - } - ImGui::BeginChild("Log"); - switch (test_type) - { - case 0: - // Single call to TextUnformatted() with a big buffer - ImGui::TextUnformatted(log.begin(), log.end()); - break; - case 1: - { - // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper. - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); - ImGuiListClipper clipper(lines); - while (clipper.Step()) - for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) - ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); - ImGui::PopStyleVar(); - break; - } - case 2: - // Multiple calls to Text(), not clipped (slow) - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); - for (int i = 0; i < lines; i++) - ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); - ImGui::PopStyleVar(); - break; - } - ImGui::EndChild(); - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() -//----------------------------------------------------------------------------- - -// Demonstrate creating a window which gets auto-resized according to its content. -static void ShowExampleAppAutoResize(bool* p_open) -{ - if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize)) - { - ImGui::End(); - return; - } - - static int lines = 10; - ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop."); - ImGui::SliderInt("Number of lines", &lines, 1, 20); - for (int i = 0; i < lines; i++) - ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() -//----------------------------------------------------------------------------- - -// Demonstrate creating a window with custom resize constraints. -static void ShowExampleAppConstrainedResize(bool* p_open) -{ - struct CustomConstraints // Helper functions to demonstrate programmatic constraints - { - static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = (data->DesiredSize.x > data->DesiredSize.y ? data->DesiredSize.x : data->DesiredSize.y); } - static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); } - }; - - static bool auto_resize = false; - static int type = 0; - static int display_lines = 10; - if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only - if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only - if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100 - if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width 400-500 - if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, 500)); // Height 400-500 - if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square - if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)(intptr_t)100); // Fixed Step - - ImGuiWindowFlags flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0; - if (ImGui::Begin("Example: Constrained Resize", p_open, flags)) - { - const char* desc[] = - { - "Resize vertical only", - "Resize horizontal only", - "Width > 100, Height > 100", - "Width 400-500", - "Height 400-500", - "Custom: Always Square", - "Custom: Fixed Steps (100)", - }; - if (ImGui::Button("200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine(); - if (ImGui::Button("500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine(); - if (ImGui::Button("800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); } - ImGui::SetNextItemWidth(200); - ImGui::Combo("Constraint", &type, desc, IM_ARRAYSIZE(desc)); - ImGui::SetNextItemWidth(200); - ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100); - ImGui::Checkbox("Auto-resize", &auto_resize); - for (int i = 0; i < display_lines; i++) - ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, ""); - } - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() -//----------------------------------------------------------------------------- - -// Demonstrate creating a simple static window with no decoration + a context-menu to choose which corner of the screen to use. -static void ShowExampleAppSimpleOverlay(bool* p_open) -{ - const float DISTANCE = 10.0f; - static int corner = 0; - ImGuiIO& io = ImGui::GetIO(); - if (corner != -1) - { - ImVec2 window_pos = ImVec2((corner & 1) ? io.DisplaySize.x - DISTANCE : DISTANCE, (corner & 2) ? io.DisplaySize.y - DISTANCE : DISTANCE); - ImVec2 window_pos_pivot = ImVec2((corner & 1) ? 1.0f : 0.0f, (corner & 2) ? 1.0f : 0.0f); - ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot); - } - ImGui::SetNextWindowBgAlpha(0.35f); // Transparent background - if (ImGui::Begin("Example: Simple overlay", p_open, (corner != -1 ? ImGuiWindowFlags_NoMove : 0) | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav)) - { - ImGui::Text("Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)"); - ImGui::Separator(); - if (ImGui::IsMousePosValid()) - ImGui::Text("Mouse Position: (%.1f,%.1f)", io.MousePos.x, io.MousePos.y); - else - ImGui::Text("Mouse Position: "); - if (ImGui::BeginPopupContextWindow()) - { - if (ImGui::MenuItem("Custom", NULL, corner == -1)) corner = -1; - if (ImGui::MenuItem("Top-left", NULL, corner == 0)) corner = 0; - if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1; - if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2; - if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3; - if (p_open && ImGui::MenuItem("Close")) *p_open = false; - ImGui::EndPopup(); - } - } - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() -//----------------------------------------------------------------------------- - -// Demonstrate using "##" and "###" in identifiers to manipulate ID generation. -// This apply to all regular items as well. Read FAQ section "How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on the purpose of labels/IDs." for details. -static void ShowExampleAppWindowTitles(bool*) -{ - // By default, Windows are uniquely identified by their title. - // You can use the "##" and "###" markers to manipulate the display/ID. - - // Using "##" to display same title but have unique identifier. - ImGui::SetNextWindowPos(ImVec2(100, 100), ImGuiCond_FirstUseEver); - ImGui::Begin("Same title as another window##1"); - ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique."); - ImGui::End(); - - ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_FirstUseEver); - ImGui::Begin("Same title as another window##2"); - ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique."); - ImGui::End(); - - // Using "###" to display a changing title but keep a static identifier "AnimatedTitle" - char buf[128]; - sprintf(buf, "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime() / 0.25f) & 3], ImGui::GetFrameCount()); - ImGui::SetNextWindowPos(ImVec2(100, 300), ImGuiCond_FirstUseEver); - ImGui::Begin(buf); - ImGui::Text("This window has a changing title."); - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() -//----------------------------------------------------------------------------- - -// Demonstrate using the low-level ImDrawList to draw custom shapes. -static void ShowExampleAppCustomRendering(bool* p_open) -{ - if (!ImGui::Begin("Example: Custom rendering", p_open)) - { - ImGui::End(); - return; - } - - // Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc. - // Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4. - // ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types) - // In this example we are not using the maths operators! - ImDrawList* draw_list = ImGui::GetWindowDrawList(); - - if (ImGui::BeginTabBar("##TabBar")) - { - if (ImGui::BeginTabItem("Primitives")) - { - ImGui::PushItemWidth(-ImGui::GetFontSize() * 10); - - // Draw gradients - // (note that those are currently exacerbating our sRGB/Linear issues) - ImGui::Text("Gradients"); - ImVec2 gradient_size = ImVec2(ImGui::CalcItemWidth(), ImGui::GetFrameHeight()); - { - ImVec2 p = ImGui::GetCursorScreenPos(); - ImU32 col_a = ImGui::GetColorU32(ImVec4(0.0f, 0.0f, 0.0f, 1.0f)); - ImU32 col_b = ImGui::GetColorU32(ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); - draw_list->AddRectFilledMultiColor(p, ImVec2(p.x + gradient_size.x, p.y + gradient_size.y), col_a, col_b, col_b, col_a); - ImGui::InvisibleButton("##gradient1", gradient_size); - } - { - ImVec2 p = ImGui::GetCursorScreenPos(); - ImU32 col_a = ImGui::GetColorU32(ImVec4(0.0f, 1.0f, 0.0f, 1.0f)); - ImU32 col_b = ImGui::GetColorU32(ImVec4(1.0f, 0.0f, 0.0f, 1.0f)); - draw_list->AddRectFilledMultiColor(p, ImVec2(p.x + gradient_size.x, p.y + gradient_size.y), col_a, col_b, col_b, col_a); - ImGui::InvisibleButton("##gradient2", gradient_size); - } - - // Draw a bunch of primitives - ImGui::Text("All primitives"); - static float sz = 36.0f; - static float thickness = 3.0f; - static int ngon_sides = 6; - static bool circle_segments_override = false; - static int circle_segments_override_v = 12; - static ImVec4 colf = ImVec4(1.0f, 1.0f, 0.4f, 1.0f); - ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f"); - ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f"); - ImGui::SliderInt("N-gon sides", &ngon_sides, 3, 12); - ImGui::Checkbox("##circlesegmentoverride", &circle_segments_override); - ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); - if (ImGui::SliderInt("Circle segments", &circle_segments_override_v, 3, 40)) - circle_segments_override = true; - ImGui::ColorEdit4("Color", &colf.x); - const ImVec2 p = ImGui::GetCursorScreenPos(); - const ImU32 col = ImColor(colf); - const float spacing = 10.0f; - const ImDrawCornerFlags corners_none = 0; - const ImDrawCornerFlags corners_all = ImDrawCornerFlags_All; - const ImDrawCornerFlags corners_tl_br = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotRight; - const int circle_segments = circle_segments_override ? circle_segments_override_v : 0; - float x = p.x + 4.0f, y = p.y + 4.0f; - for (int n = 0; n < 2; n++) - { - // First line uses a thickness of 1.0f, second line uses the configurable thickness - float th = (n == 0) ? 1.0f : thickness; - draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // N-gon - draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments, th); x += sz + spacing; // Circle - draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, corners_none, th); x += sz + spacing; // Square - draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_all, th); x += sz + spacing; // Square with all rounded corners - draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners - draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th); x += sz + spacing; // Triangle - draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th); x += sz*0.4f + spacing; // Thin triangle - draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!) - draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!) - draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th); x += sz + spacing; // Diagonal line - draw_list->AddBezierCurve(ImVec2(x, y), ImVec2(x + sz*1.3f, y + sz*0.3f), ImVec2(x + sz - sz*1.3f, y + sz - sz*0.3f), ImVec2(x + sz, y + sz), col, th); - x = p.x + 4; - y += sz + spacing; - } - draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz*0.5f, col, ngon_sides); x += sz + spacing; // N-gon - draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments);x += sz + spacing; // Circle - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col); x += sz + spacing; // Square - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f); x += sz + spacing; // Square with all rounded corners - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br); x += sz + spacing; // Square with two rounded corners - draw_list->AddTriangleFilled(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col); x += sz + spacing; // Triangle - draw_list->AddTriangleFilled(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col); x += sz*0.4f + spacing; // Thin triangle - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + thickness), col); x += sz + spacing; // Horizontal line (faster than AddLine, but only handle integer thickness) - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + thickness, y + sz), col); x += spacing*2.0f; // Vertical line (faster than AddLine, but only handle integer thickness) - draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + 1, y + 1), col); x += sz; // Pixel (faster than AddLine) - draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x + sz, y + sz), IM_COL32(0, 0, 0, 255), IM_COL32(255, 0, 0, 255), IM_COL32(255, 255, 0, 255), IM_COL32(0, 255, 0, 255)); - ImGui::Dummy(ImVec2((sz + spacing) * 9.8f, (sz + spacing) * 3)); - - ImGui::PopItemWidth(); - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("Canvas")) - { - static ImVector points; - static bool adding_line = false; - if (ImGui::Button("Clear")) points.clear(); - if (points.Size >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } } - ImGui::Text("Left-click and drag to add lines,\nRight-click to undo"); - - // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered() - // But you can also draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos(). - // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max). - ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates! - ImVec2 canvas_size = ImGui::GetContentRegionAvail(); // Resize canvas to what's available - if (canvas_size.x < 50.0f) canvas_size.x = 50.0f; - if (canvas_size.y < 50.0f) canvas_size.y = 50.0f; - draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(50, 50, 50, 255), IM_COL32(50, 50, 60, 255), IM_COL32(60, 60, 70, 255), IM_COL32(50, 50, 60, 255)); - draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(255, 255, 255, 255)); - - bool adding_preview = false; - ImGui::InvisibleButton("canvas", canvas_size); - ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y); - if (adding_line) - { - adding_preview = true; - points.push_back(mouse_pos_in_canvas); - if (!ImGui::IsMouseDown(0)) - adding_line = adding_preview = false; - } - if (ImGui::IsItemHovered()) - { - if (!adding_line && ImGui::IsMouseClicked(0)) - { - points.push_back(mouse_pos_in_canvas); - adding_line = true; - } - if (ImGui::IsMouseClicked(1) && !points.empty()) - { - adding_line = adding_preview = false; - points.pop_back(); - points.pop_back(); - } - } - draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), true); // clip lines within the canvas (if we resize it, etc.) - for (int i = 0; i < points.Size - 1; i += 2) - draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i + 1].x, canvas_pos.y + points[i + 1].y), IM_COL32(255, 255, 0, 255), 2.0f); - draw_list->PopClipRect(); - if (adding_preview) - points.pop_back(); - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("BG/FG draw lists")) - { - static bool draw_bg = true; - static bool draw_fg = true; - ImGui::Checkbox("Draw in Background draw list", &draw_bg); - ImGui::SameLine(); HelpMarker("The Background draw list will be rendered below every Dear ImGui windows."); - ImGui::Checkbox("Draw in Foreground draw list", &draw_fg); - ImGui::SameLine(); HelpMarker("The Foreground draw list will be rendered over every Dear ImGui windows."); - ImVec2 window_pos = ImGui::GetWindowPos(); - ImVec2 window_size = ImGui::GetWindowSize(); - ImVec2 window_center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f); - if (draw_bg) - ImGui::GetBackgroundDrawList()->AddCircle(window_center, window_size.x * 0.6f, IM_COL32(255, 0, 0, 200), 0, 10+4); - if (draw_fg) - ImGui::GetForegroundDrawList()->AddCircle(window_center, window_size.y * 0.6f, IM_COL32(0, 255, 0, 200), 0, 10); - ImGui::EndTabItem(); - } - - ImGui::EndTabBar(); - } - - ImGui::End(); -} - -//----------------------------------------------------------------------------- -// [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() -//----------------------------------------------------------------------------- - -// Simplified structure to mimic a Document model -struct MyDocument -{ - const char* Name; // Document title - bool Open; // Set when the document is open (in this demo, we keep an array of all available documents to simplify the demo) - bool OpenPrev; // Copy of Open from last update. - bool Dirty; // Set when the document has been modified - bool WantClose; // Set when the document - ImVec4 Color; // An arbitrary variable associated to the document - - MyDocument(const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f,1.0f,1.0f,1.0f)) - { - Name = name; - Open = OpenPrev = open; - Dirty = false; - WantClose = false; - Color = color; - } - void DoOpen() { Open = true; } - void DoQueueClose() { WantClose = true; } - void DoForceClose() { Open = false; Dirty = false; } - void DoSave() { Dirty = false; } - - // Display dummy contents for the Document - static void DisplayContents(MyDocument* doc) - { - ImGui::PushID(doc); - ImGui::Text("Document \"%s\"", doc->Name); - ImGui::PushStyleColor(ImGuiCol_Text, doc->Color); - ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); - ImGui::PopStyleColor(); - if (ImGui::Button("Modify", ImVec2(100, 0))) - doc->Dirty = true; - ImGui::SameLine(); - if (ImGui::Button("Save", ImVec2(100, 0))) - doc->DoSave(); - ImGui::ColorEdit3("color", &doc->Color.x); // Useful to test drag and drop and hold-dragged-to-open-tab behavior. - ImGui::PopID(); - } - - // Display context menu for the Document - static void DisplayContextMenu(MyDocument* doc) - { - if (!ImGui::BeginPopupContextItem()) - return; - - char buf[256]; - sprintf(buf, "Save %s", doc->Name); - if (ImGui::MenuItem(buf, "CTRL+S", false, doc->Open)) - doc->DoSave(); - if (ImGui::MenuItem("Close", "CTRL+W", false, doc->Open)) - doc->DoQueueClose(); - ImGui::EndPopup(); - } -}; - -struct ExampleAppDocuments -{ - ImVector Documents; - - ExampleAppDocuments() - { - Documents.push_back(MyDocument("Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f))); - Documents.push_back(MyDocument("Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f))); - Documents.push_back(MyDocument("Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f))); - Documents.push_back(MyDocument("Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f))); - Documents.push_back(MyDocument("A Rather Long Title", false)); - Documents.push_back(MyDocument("Some Document", false)); - } -}; - -// [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. -// If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, as opposed -// to clicking on the regular tab closing button) and stops being submitted, it will take a frame for the tab bar to notice its absence. -// During this frame there will be a gap in the tab bar, and if the tab that has disappeared was the selected one, the tab bar -// will report no selected tab during the frame. This will effectively give the impression of a flicker for one frame. -// We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch. -// Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag. -static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app) -{ - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - { - MyDocument* doc = &app.Documents[doc_n]; - if (!doc->Open && doc->OpenPrev) - ImGui::SetTabItemClosed(doc->Name); - doc->OpenPrev = doc->Open; - } -} - -void ShowExampleAppDocuments(bool* p_open) -{ - static ExampleAppDocuments app; - - // Options - static bool opt_reorderable = true; - static ImGuiTabBarFlags opt_fitting_flags = ImGuiTabBarFlags_FittingPolicyDefault_; - - bool window_contents_visible = ImGui::Begin("Example: Documents", p_open, ImGuiWindowFlags_MenuBar); - if (!window_contents_visible) - { - ImGui::End(); - return; - } - - // Menu - if (ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("File")) - { - int open_count = 0; - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - open_count += app.Documents[doc_n].Open ? 1 : 0; - - if (ImGui::BeginMenu("Open", open_count < app.Documents.Size)) - { - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - { - MyDocument* doc = &app.Documents[doc_n]; - if (!doc->Open) - if (ImGui::MenuItem(doc->Name)) - doc->DoOpen(); - } - ImGui::EndMenu(); - } - if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0)) - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - app.Documents[doc_n].DoQueueClose(); - if (ImGui::MenuItem("Exit", "Alt+F4")) {} - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - - // [Debug] List documents with one checkbox for each - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - { - MyDocument* doc = &app.Documents[doc_n]; - if (doc_n > 0) - ImGui::SameLine(); - ImGui::PushID(doc); - if (ImGui::Checkbox(doc->Name, &doc->Open)) - if (!doc->Open) - doc->DoForceClose(); - ImGui::PopID(); - } - - ImGui::Separator(); - - // Submit Tab Bar and Tabs - { - ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0); - if (ImGui::BeginTabBar("##tabs", tab_bar_flags)) - { - if (opt_reorderable) - NotifyOfDocumentsClosedElsewhere(app); - - // [DEBUG] Stress tests - //if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on. - //if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway.. - - // Submit Tabs - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - { - MyDocument* doc = &app.Documents[doc_n]; - if (!doc->Open) - continue; - - ImGuiTabItemFlags tab_flags = (doc->Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0); - bool visible = ImGui::BeginTabItem(doc->Name, &doc->Open, tab_flags); - - // Cancel attempt to close when unsaved add to save queue so we can display a popup. - if (!doc->Open && doc->Dirty) - { - doc->Open = true; - doc->DoQueueClose(); - } - - MyDocument::DisplayContextMenu(doc); - if (visible) - { - MyDocument::DisplayContents(doc); - ImGui::EndTabItem(); - } - } - - ImGui::EndTabBar(); - } - } - - // Update closing queue - static ImVector close_queue; - if (close_queue.empty()) - { - // Close queue is locked once we started a popup - for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) - { - MyDocument* doc = &app.Documents[doc_n]; - if (doc->WantClose) - { - doc->WantClose = false; - close_queue.push_back(doc); - } - } - } - - // Display closing confirmation UI - if (!close_queue.empty()) - { - int close_queue_unsaved_documents = 0; - for (int n = 0; n < close_queue.Size; n++) - if (close_queue[n]->Dirty) - close_queue_unsaved_documents++; - - if (close_queue_unsaved_documents == 0) - { - // Close documents when all are unsaved - for (int n = 0; n < close_queue.Size; n++) - close_queue[n]->DoForceClose(); - close_queue.clear(); - } - else - { - if (!ImGui::IsPopupOpen("Save?")) - ImGui::OpenPopup("Save?"); - if (ImGui::BeginPopupModal("Save?")) - { - ImGui::Text("Save change to the following items?"); - ImGui::SetNextItemWidth(-1.0f); - if (ImGui::ListBoxHeader("##", close_queue_unsaved_documents, 6)) - { - for (int n = 0; n < close_queue.Size; n++) - if (close_queue[n]->Dirty) - ImGui::Text("%s", close_queue[n]->Name); - ImGui::ListBoxFooter(); - } - - if (ImGui::Button("Yes", ImVec2(80, 0))) - { - for (int n = 0; n < close_queue.Size; n++) - { - if (close_queue[n]->Dirty) - close_queue[n]->DoSave(); - close_queue[n]->DoForceClose(); - } - close_queue.clear(); - ImGui::CloseCurrentPopup(); - } - ImGui::SameLine(); - if (ImGui::Button("No", ImVec2(80, 0))) - { - for (int n = 0; n < close_queue.Size; n++) - close_queue[n]->DoForceClose(); - close_queue.clear(); - ImGui::CloseCurrentPopup(); - } - ImGui::SameLine(); - if (ImGui::Button("Cancel", ImVec2(80, 0))) - { - close_queue.clear(); - ImGui::CloseCurrentPopup(); - } - ImGui::EndPopup(); - } - } - } - - ImGui::End(); -} - -// End of Demo code -#else - -void ImGui::ShowAboutWindow(bool*) {} -void ImGui::ShowDemoWindow(bool*) {} -void ImGui::ShowUserGuide() {} -void ImGui::ShowStyleEditor(ImGuiStyle*) {} - -#endif - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imgui_draw.cpp b/include/imgui/imgui_draw.cpp deleted file mode 100644 index 1e08bfd0..00000000 --- a/include/imgui/imgui_draw.cpp +++ /dev/null @@ -1,3594 +0,0 @@ -// dear imgui, v1.76 -// (drawing and font code) - -/* - -Index of this file: - -// [SECTION] STB libraries implementation -// [SECTION] Style functions -// [SECTION] ImDrawList -// [SECTION] ImDrawListSplitter -// [SECTION] ImDrawData -// [SECTION] Helpers ShadeVertsXXX functions -// [SECTION] ImFontConfig -// [SECTION] ImFontAtlas -// [SECTION] ImFontAtlas glyph ranges helpers -// [SECTION] ImFontGlyphRangesBuilder -// [SECTION] ImFont -// [SECTION] ImGui Internal Render Helpers -// [SECTION] Decompression code -// [SECTION] Default font data (ProggyClean.ttf) - -*/ - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include "imgui.h" -#ifndef IMGUI_DISABLE - -#ifndef IMGUI_DEFINE_MATH_OPERATORS -#define IMGUI_DEFINE_MATH_OPERATORS -#endif -#include "imgui_internal.h" - -#include // vsnprintf, sscanf, printf -#if !defined(alloca) -#if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__SWITCH__) -#include // alloca (glibc uses . Note that Cygwin may have _WIN32 defined, so the order matters here) -#elif defined(_WIN32) -#include // alloca -#if !defined(alloca) -#define alloca _alloca // for clang with MS Codegen -#endif -#else -#include // alloca -#endif -#endif - -// Visual Studio warnings -#ifdef _MSC_VER -#pragma warning (disable: 4127) // condition expression is constant -#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff) -#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen -#endif - -// Clang/GCC warnings with -Weverything -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. -#pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants ok. -#pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference is. -#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 -#endif -#if __has_warning("-Wcomma") -#pragma clang diagnostic ignored "-Wcomma" // warning : possible misuse of comma operator here // -#endif -#if __has_warning("-Wreserved-id-macro") -#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // -#endif -#if __has_warning("-Wdouble-promotion") -#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. -#endif -#elif defined(__GNUC__) -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used -#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function -#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value -#pragma GCC diagnostic ignored "-Wstack-protector" // warning: stack protector not protecting local variables: variable length buffer -#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead -#endif - -//------------------------------------------------------------------------- -// [SECTION] STB libraries implementation -//------------------------------------------------------------------------- - -// Compile time options: -//#define IMGUI_STB_NAMESPACE ImStb -//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" -//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" -//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION -//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION - -#ifdef IMGUI_STB_NAMESPACE -namespace IMGUI_STB_NAMESPACE -{ -#endif - -#ifdef _MSC_VER -#pragma warning (push) -#pragma warning (disable: 4456) // declaration of 'xx' hides previous local declaration -#endif - -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wmissing-prototypes" -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#pragma clang diagnostic ignored "-Wcast-qual" // warning : cast from 'const xxxx *' to 'xxx *' drops const qualifier // -#endif - -#if defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wtype-limits" // warning: comparison is always true due to limited range of data type [-Wtype-limits] -#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers -#endif - -#ifndef STB_RECT_PACK_IMPLEMENTATION // in case the user already have an implementation in the _same_ compilation unit (e.g. unity builds) -#ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION -#define STBRP_STATIC -#define STBRP_ASSERT(x) do { IM_ASSERT(x); } while (0) -#define STBRP_SORT ImQsort -#define STB_RECT_PACK_IMPLEMENTATION -#endif -#ifdef IMGUI_STB_RECT_PACK_FILENAME -#include IMGUI_STB_RECT_PACK_FILENAME -#else -#include "imstb_rectpack.h" -#endif -#endif - -#ifndef STB_TRUETYPE_IMPLEMENTATION // in case the user already have an implementation in the _same_ compilation unit (e.g. unity builds) -#ifndef IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION -#define STBTT_malloc(x,u) ((void)(u), IM_ALLOC(x)) -#define STBTT_free(x,u) ((void)(u), IM_FREE(x)) -#define STBTT_assert(x) do { IM_ASSERT(x); } while(0) -#define STBTT_fmod(x,y) ImFmod(x,y) -#define STBTT_sqrt(x) ImSqrt(x) -#define STBTT_pow(x,y) ImPow(x,y) -#define STBTT_fabs(x) ImFabs(x) -#define STBTT_ifloor(x) ((int)ImFloorStd(x)) -#define STBTT_iceil(x) ((int)ImCeil(x)) -#define STBTT_STATIC -#define STB_TRUETYPE_IMPLEMENTATION -#else -#define STBTT_DEF extern -#endif -#ifdef IMGUI_STB_TRUETYPE_FILENAME -#include IMGUI_STB_TRUETYPE_FILENAME -#else -#include "imstb_truetype.h" -#endif -#endif - -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - -#if defined(_MSC_VER) -#pragma warning (pop) -#endif - -#ifdef IMGUI_STB_NAMESPACE -} // namespace ImStb -using namespace IMGUI_STB_NAMESPACE; -#endif - -//----------------------------------------------------------------------------- -// [SECTION] Style functions -//----------------------------------------------------------------------------- - -void ImGui::StyleColorsDark(ImGuiStyle* dst) -{ - ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); - ImVec4* colors = style->Colors; - - colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); - colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); - colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.94f); - colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f); - colors[ImGuiCol_Border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f); - colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_FrameBg] = ImVec4(0.16f, 0.29f, 0.48f, 0.54f); - colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); - colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); - colors[ImGuiCol_TitleBg] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f); - colors[ImGuiCol_TitleBgActive] = ImVec4(0.16f, 0.29f, 0.48f, 1.00f); - colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f); - colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f); - colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f); - colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f); - colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f); - colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f); - colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f); - colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); - colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f); - colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f); - colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); - colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_Separator] = colors[ImGuiCol_Border]; - colors[ImGuiCol_SeparatorHovered] = ImVec4(0.10f, 0.40f, 0.75f, 0.78f); - colors[ImGuiCol_SeparatorActive] = ImVec4(0.10f, 0.40f, 0.75f, 1.00f); - colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.25f); - colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); - colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); - colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); - colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f); - colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); - colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); - colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); - colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); - colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); - colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); -} - -void ImGui::StyleColorsClassic(ImGuiStyle* dst) -{ - ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); - ImVec4* colors = style->Colors; - - colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); - colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); - colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f); - colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f); - colors[ImGuiCol_Border] = ImVec4(0.50f, 0.50f, 0.50f, 0.50f); - colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_FrameBg] = ImVec4(0.43f, 0.43f, 0.43f, 0.39f); - colors[ImGuiCol_FrameBgHovered] = ImVec4(0.47f, 0.47f, 0.69f, 0.40f); - colors[ImGuiCol_FrameBgActive] = ImVec4(0.42f, 0.41f, 0.64f, 0.69f); - colors[ImGuiCol_TitleBg] = ImVec4(0.27f, 0.27f, 0.54f, 0.83f); - colors[ImGuiCol_TitleBgActive] = ImVec4(0.32f, 0.32f, 0.63f, 0.87f); - colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.40f, 0.40f, 0.80f, 0.20f); - colors[ImGuiCol_MenuBarBg] = ImVec4(0.40f, 0.40f, 0.55f, 0.80f); - colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f); - colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.80f, 0.30f); - colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.80f, 0.40f); - colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f); - colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f); - colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f); - colors[ImGuiCol_SliderGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f); - colors[ImGuiCol_Button] = ImVec4(0.35f, 0.40f, 0.61f, 0.62f); - colors[ImGuiCol_ButtonHovered] = ImVec4(0.40f, 0.48f, 0.71f, 0.79f); - colors[ImGuiCol_ButtonActive] = ImVec4(0.46f, 0.54f, 0.80f, 1.00f); - colors[ImGuiCol_Header] = ImVec4(0.40f, 0.40f, 0.90f, 0.45f); - colors[ImGuiCol_HeaderHovered] = ImVec4(0.45f, 0.45f, 0.90f, 0.80f); - colors[ImGuiCol_HeaderActive] = ImVec4(0.53f, 0.53f, 0.87f, 0.80f); - colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 0.60f); - colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f); - colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f); - colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.16f); - colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f); - colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); - colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); - colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); - colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); - colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f); - colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); - colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); - colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); -} - -// Those light colors are better suited with a thicker font than the default one + FrameBorder -void ImGui::StyleColorsLight(ImGuiStyle* dst) -{ - ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); - ImVec4* colors = style->Colors; - - colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f); - colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); - colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 1.00f); - colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.98f); - colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.30f); - colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); - colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); - colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); - colors[ImGuiCol_TitleBg] = ImVec4(0.96f, 0.96f, 0.96f, 1.00f); - colors[ImGuiCol_TitleBgActive] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f); - colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 1.00f, 1.00f, 0.51f); - colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f); - colors[ImGuiCol_ScrollbarBg] = ImVec4(0.98f, 0.98f, 0.98f, 0.53f); - colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.69f, 0.69f, 0.69f, 0.80f); - colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f); - colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f); - colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_SliderGrab] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f); - colors[ImGuiCol_SliderGrabActive] = ImVec4(0.46f, 0.54f, 0.80f, 0.60f); - colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); - colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f); - colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f); - colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); - colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); - colors[ImGuiCol_Separator] = ImVec4(0.39f, 0.39f, 0.39f, 0.62f); - colors[ImGuiCol_SeparatorHovered] = ImVec4(0.14f, 0.44f, 0.80f, 0.78f); - colors[ImGuiCol_SeparatorActive] = ImVec4(0.14f, 0.44f, 0.80f, 1.00f); - colors[ImGuiCol_ResizeGrip] = ImVec4(0.80f, 0.80f, 0.80f, 0.56f); - colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); - colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.90f); - colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); - colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); - colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); - colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.45f, 0.00f, 1.00f); - colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); - colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f); - colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.20f); - colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); -} - -//----------------------------------------------------------------------------- -// ImDrawList -//----------------------------------------------------------------------------- - -ImDrawListSharedData::ImDrawListSharedData() -{ - Font = NULL; - FontSize = 0.0f; - CurveTessellationTol = 0.0f; - CircleSegmentMaxError = 0.0f; - ClipRectFullscreen = ImVec4(-8192.0f, -8192.0f, +8192.0f, +8192.0f); - InitialFlags = ImDrawListFlags_None; - - // Lookup tables - for (int i = 0; i < IM_ARRAYSIZE(ArcFastVtx); i++) - { - const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(ArcFastVtx); - ArcFastVtx[i] = ImVec2(ImCos(a), ImSin(a)); - } - memset(CircleSegmentCounts, 0, sizeof(CircleSegmentCounts)); // This will be set by SetCircleSegmentMaxError() -} - -void ImDrawListSharedData::SetCircleSegmentMaxError(float max_error) -{ - if (CircleSegmentMaxError == max_error) - return; - CircleSegmentMaxError = max_error; - for (int i = 0; i < IM_ARRAYSIZE(CircleSegmentCounts); i++) - { - const float radius = i + 1.0f; - const int segment_count = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError); - CircleSegmentCounts[i] = (ImU8)ImMin(segment_count, 255); - } -} - -void ImDrawList::Clear() -{ - CmdBuffer.resize(0); - IdxBuffer.resize(0); - VtxBuffer.resize(0); - Flags = _Data ? _Data->InitialFlags : ImDrawListFlags_None; - _VtxCurrentOffset = 0; - _VtxCurrentIdx = 0; - _VtxWritePtr = NULL; - _IdxWritePtr = NULL; - _ClipRectStack.resize(0); - _TextureIdStack.resize(0); - _Path.resize(0); - _Splitter.Clear(); -} - -void ImDrawList::ClearFreeMemory() -{ - CmdBuffer.clear(); - IdxBuffer.clear(); - VtxBuffer.clear(); - _VtxCurrentIdx = 0; - _VtxWritePtr = NULL; - _IdxWritePtr = NULL; - _ClipRectStack.clear(); - _TextureIdStack.clear(); - _Path.clear(); - _Splitter.ClearFreeMemory(); -} - -ImDrawList* ImDrawList::CloneOutput() const -{ - ImDrawList* dst = IM_NEW(ImDrawList(_Data)); - dst->CmdBuffer = CmdBuffer; - dst->IdxBuffer = IdxBuffer; - dst->VtxBuffer = VtxBuffer; - dst->Flags = Flags; - return dst; -} - -// Using macros because C++ is a terrible language, we want guaranteed inline, no code in header, and no overhead in Debug builds -#define GetCurrentClipRect() (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen) -#define GetCurrentTextureId() (_TextureIdStack.Size ? _TextureIdStack.Data[_TextureIdStack.Size-1] : (ImTextureID)NULL) - -void ImDrawList::AddDrawCmd() -{ - ImDrawCmd draw_cmd; - draw_cmd.ClipRect = GetCurrentClipRect(); - draw_cmd.TextureId = GetCurrentTextureId(); - draw_cmd.VtxOffset = _VtxCurrentOffset; - draw_cmd.IdxOffset = IdxBuffer.Size; - - IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w); - CmdBuffer.push_back(draw_cmd); -} - -void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data) -{ - ImDrawCmd* current_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL; - if (!current_cmd || current_cmd->ElemCount != 0 || current_cmd->UserCallback != NULL) - { - AddDrawCmd(); - current_cmd = &CmdBuffer.back(); - } - current_cmd->UserCallback = callback; - current_cmd->UserCallbackData = callback_data; - - AddDrawCmd(); // Force a new command after us (see comment below) -} - -// Our scheme may appears a bit unusual, basically we want the most-common calls AddLine AddRect etc. to not have to perform any check so we always have a command ready in the stack. -// The cost of figuring out if a new command has to be added or if we can merge is paid in those Update** functions only. -void ImDrawList::UpdateClipRect() -{ - // If current command is used with different settings we need to add a new command - const ImVec4 curr_clip_rect = GetCurrentClipRect(); - ImDrawCmd* curr_cmd = CmdBuffer.Size > 0 ? &CmdBuffer.Data[CmdBuffer.Size-1] : NULL; - if (!curr_cmd || (curr_cmd->ElemCount != 0 && memcmp(&curr_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) != 0) || curr_cmd->UserCallback != NULL) - { - AddDrawCmd(); - return; - } - - // Try to merge with previous command if it matches, else use current command - ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; - if (curr_cmd->ElemCount == 0 && prev_cmd && memcmp(&prev_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) == 0 && prev_cmd->TextureId == GetCurrentTextureId() && prev_cmd->UserCallback == NULL) - CmdBuffer.pop_back(); - else - curr_cmd->ClipRect = curr_clip_rect; -} - -void ImDrawList::UpdateTextureID() -{ - // If current command is used with different settings we need to add a new command - const ImTextureID curr_texture_id = GetCurrentTextureId(); - ImDrawCmd* curr_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL; - if (!curr_cmd || (curr_cmd->ElemCount != 0 && curr_cmd->TextureId != curr_texture_id) || curr_cmd->UserCallback != NULL) - { - AddDrawCmd(); - return; - } - - // Try to merge with previous command if it matches, else use current command - ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; - if (curr_cmd->ElemCount == 0 && prev_cmd && prev_cmd->TextureId == curr_texture_id && memcmp(&prev_cmd->ClipRect, &GetCurrentClipRect(), sizeof(ImVec4)) == 0 && prev_cmd->UserCallback == NULL) - CmdBuffer.pop_back(); - else - curr_cmd->TextureId = curr_texture_id; -} - -#undef GetCurrentClipRect -#undef GetCurrentTextureId - -// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling) -void ImDrawList::PushClipRect(ImVec2 cr_min, ImVec2 cr_max, bool intersect_with_current_clip_rect) -{ - ImVec4 cr(cr_min.x, cr_min.y, cr_max.x, cr_max.y); - if (intersect_with_current_clip_rect && _ClipRectStack.Size) - { - ImVec4 current = _ClipRectStack.Data[_ClipRectStack.Size-1]; - if (cr.x < current.x) cr.x = current.x; - if (cr.y < current.y) cr.y = current.y; - if (cr.z > current.z) cr.z = current.z; - if (cr.w > current.w) cr.w = current.w; - } - cr.z = ImMax(cr.x, cr.z); - cr.w = ImMax(cr.y, cr.w); - - _ClipRectStack.push_back(cr); - UpdateClipRect(); -} - -void ImDrawList::PushClipRectFullScreen() -{ - PushClipRect(ImVec2(_Data->ClipRectFullscreen.x, _Data->ClipRectFullscreen.y), ImVec2(_Data->ClipRectFullscreen.z, _Data->ClipRectFullscreen.w)); -} - -void ImDrawList::PopClipRect() -{ - IM_ASSERT(_ClipRectStack.Size > 0); - _ClipRectStack.pop_back(); - UpdateClipRect(); -} - -void ImDrawList::PushTextureID(ImTextureID texture_id) -{ - _TextureIdStack.push_back(texture_id); - UpdateTextureID(); -} - -void ImDrawList::PopTextureID() -{ - IM_ASSERT(_TextureIdStack.Size > 0); - _TextureIdStack.pop_back(); - UpdateTextureID(); -} - -// Reserve space for a number of vertices and indices. -// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or -// submit the intermediate results. PrimUnreserve() can be used to release unused allocations. -void ImDrawList::PrimReserve(int idx_count, int vtx_count) -{ - // Large mesh support (when enabled) - IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0); - if (sizeof(ImDrawIdx) == 2 && (_VtxCurrentIdx + vtx_count >= (1 << 16)) && (Flags & ImDrawListFlags_AllowVtxOffset)) - { - _VtxCurrentOffset = VtxBuffer.Size; - _VtxCurrentIdx = 0; - AddDrawCmd(); - } - - ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size - 1]; - draw_cmd.ElemCount += idx_count; - - int vtx_buffer_old_size = VtxBuffer.Size; - VtxBuffer.resize(vtx_buffer_old_size + vtx_count); - _VtxWritePtr = VtxBuffer.Data + vtx_buffer_old_size; - - int idx_buffer_old_size = IdxBuffer.Size; - IdxBuffer.resize(idx_buffer_old_size + idx_count); - _IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size; -} - -// Release the a number of reserved vertices/indices from the end of the last reservation made with PrimReserve(). -void ImDrawList::PrimUnreserve(int idx_count, int vtx_count) -{ - IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0); - - ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size - 1]; - draw_cmd.ElemCount -= idx_count; - VtxBuffer.shrink(VtxBuffer.Size - vtx_count); - IdxBuffer.shrink(IdxBuffer.Size - idx_count); -} - -// Fully unrolled with inline call to keep our debug builds decently fast. -void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col) -{ - ImVec2 b(c.x, a.y), d(a.x, c.y), uv(_Data->TexUvWhitePixel); - ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; - _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); - _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); - _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; - _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; - _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; - _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col; - _VtxWritePtr += 4; - _VtxCurrentIdx += 4; - _IdxWritePtr += 6; -} - -void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col) -{ - ImVec2 b(c.x, a.y), d(a.x, c.y), uv_b(uv_c.x, uv_a.y), uv_d(uv_a.x, uv_c.y); - ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; - _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); - _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); - _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; - _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; - _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; - _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col; - _VtxWritePtr += 4; - _VtxCurrentIdx += 4; - _IdxWritePtr += 6; -} - -void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col) -{ - ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; - _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); - _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); - _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; - _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; - _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; - _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col; - _VtxWritePtr += 4; - _VtxCurrentIdx += 4; - _IdxWritePtr += 6; -} - -// On AddPolyline() and AddConvexPolyFilled() we intentionally avoid using ImVec2 and superflous function calls to optimize debug/non-inlined builds. -// Those macros expects l-values. -#define IM_NORMALIZE2F_OVER_ZERO(VX,VY) do { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = 1.0f / ImSqrt(d2); VX *= inv_len; VY *= inv_len; } } while (0) -#define IM_FIXNORMAL2F(VX,VY) do { float d2 = VX*VX + VY*VY; if (d2 < 0.5f) d2 = 0.5f; float inv_lensq = 1.0f / d2; VX *= inv_lensq; VY *= inv_lensq; } while (0) - -// TODO: Thickness anti-aliased lines cap are missing their AA fringe. -// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds. -void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, bool closed, float thickness) -{ - if (points_count < 2) - return; - - const ImVec2 uv = _Data->TexUvWhitePixel; - - int count = points_count; - if (!closed) - count = points_count-1; - - const bool thick_line = thickness > 1.0f; - if (Flags & ImDrawListFlags_AntiAliasedLines) - { - // Anti-aliased stroke - const float AA_SIZE = 1.0f; - const ImU32 col_trans = col & ~IM_COL32_A_MASK; - - const int idx_count = thick_line ? count*18 : count*12; - const int vtx_count = thick_line ? points_count*4 : points_count*3; - PrimReserve(idx_count, vtx_count); - - // Temporary buffer - ImVec2* temp_normals = (ImVec2*)alloca(points_count * (thick_line ? 5 : 3) * sizeof(ImVec2)); //-V630 - ImVec2* temp_points = temp_normals + points_count; - - for (int i1 = 0; i1 < count; i1++) - { - const int i2 = (i1+1) == points_count ? 0 : i1+1; - float dx = points[i2].x - points[i1].x; - float dy = points[i2].y - points[i1].y; - IM_NORMALIZE2F_OVER_ZERO(dx, dy); - temp_normals[i1].x = dy; - temp_normals[i1].y = -dx; - } - if (!closed) - temp_normals[points_count-1] = temp_normals[points_count-2]; - - if (!thick_line) - { - if (!closed) - { - temp_points[0] = points[0] + temp_normals[0] * AA_SIZE; - temp_points[1] = points[0] - temp_normals[0] * AA_SIZE; - temp_points[(points_count-1)*2+0] = points[points_count-1] + temp_normals[points_count-1] * AA_SIZE; - temp_points[(points_count-1)*2+1] = points[points_count-1] - temp_normals[points_count-1] * AA_SIZE; - } - - // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer. - unsigned int idx1 = _VtxCurrentIdx; - for (int i1 = 0; i1 < count; i1++) - { - const int i2 = (i1+1) == points_count ? 0 : i1+1; - unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+3; - - // Average normals - float dm_x = (temp_normals[i1].x + temp_normals[i2].x) * 0.5f; - float dm_y = (temp_normals[i1].y + temp_normals[i2].y) * 0.5f; - IM_FIXNORMAL2F(dm_x, dm_y); - dm_x *= AA_SIZE; - dm_y *= AA_SIZE; - - // Add temporary vertexes - ImVec2* out_vtx = &temp_points[i2*2]; - out_vtx[0].x = points[i2].x + dm_x; - out_vtx[0].y = points[i2].y + dm_y; - out_vtx[1].x = points[i2].x - dm_x; - out_vtx[1].y = points[i2].y - dm_y; - - // Add indexes - _IdxWritePtr[0] = (ImDrawIdx)(idx2+0); _IdxWritePtr[1] = (ImDrawIdx)(idx1+0); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2); - _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+0); - _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0); - _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10]= (ImDrawIdx)(idx2+0); _IdxWritePtr[11]= (ImDrawIdx)(idx2+1); - _IdxWritePtr += 12; - - idx1 = idx2; - } - - // Add vertexes - for (int i = 0; i < points_count; i++) - { - _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; - _VtxWritePtr[1].pos = temp_points[i*2+0]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; - _VtxWritePtr[2].pos = temp_points[i*2+1]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col_trans; - _VtxWritePtr += 3; - } - } - else - { - const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f; - if (!closed) - { - temp_points[0] = points[0] + temp_normals[0] * (half_inner_thickness + AA_SIZE); - temp_points[1] = points[0] + temp_normals[0] * (half_inner_thickness); - temp_points[2] = points[0] - temp_normals[0] * (half_inner_thickness); - temp_points[3] = points[0] - temp_normals[0] * (half_inner_thickness + AA_SIZE); - temp_points[(points_count-1)*4+0] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE); - temp_points[(points_count-1)*4+1] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness); - temp_points[(points_count-1)*4+2] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness); - temp_points[(points_count-1)*4+3] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE); - } - - // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer. - unsigned int idx1 = _VtxCurrentIdx; - for (int i1 = 0; i1 < count; i1++) - { - const int i2 = (i1+1) == points_count ? 0 : i1+1; - unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+4; - - // Average normals - float dm_x = (temp_normals[i1].x + temp_normals[i2].x) * 0.5f; - float dm_y = (temp_normals[i1].y + temp_normals[i2].y) * 0.5f; - IM_FIXNORMAL2F(dm_x, dm_y); - float dm_out_x = dm_x * (half_inner_thickness + AA_SIZE); - float dm_out_y = dm_y * (half_inner_thickness + AA_SIZE); - float dm_in_x = dm_x * half_inner_thickness; - float dm_in_y = dm_y * half_inner_thickness; - - // Add temporary vertexes - ImVec2* out_vtx = &temp_points[i2*4]; - out_vtx[0].x = points[i2].x + dm_out_x; - out_vtx[0].y = points[i2].y + dm_out_y; - out_vtx[1].x = points[i2].x + dm_in_x; - out_vtx[1].y = points[i2].y + dm_in_y; - out_vtx[2].x = points[i2].x - dm_in_x; - out_vtx[2].y = points[i2].y - dm_in_y; - out_vtx[3].x = points[i2].x - dm_out_x; - out_vtx[3].y = points[i2].y - dm_out_y; - - // Add indexes - _IdxWritePtr[0] = (ImDrawIdx)(idx2+1); _IdxWritePtr[1] = (ImDrawIdx)(idx1+1); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2); - _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+1); - _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0); - _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10] = (ImDrawIdx)(idx2+0); _IdxWritePtr[11] = (ImDrawIdx)(idx2+1); - _IdxWritePtr[12] = (ImDrawIdx)(idx2+2); _IdxWritePtr[13] = (ImDrawIdx)(idx1+2); _IdxWritePtr[14] = (ImDrawIdx)(idx1+3); - _IdxWritePtr[15] = (ImDrawIdx)(idx1+3); _IdxWritePtr[16] = (ImDrawIdx)(idx2+3); _IdxWritePtr[17] = (ImDrawIdx)(idx2+2); - _IdxWritePtr += 18; - - idx1 = idx2; - } - - // Add vertexes - for (int i = 0; i < points_count; i++) - { - _VtxWritePtr[0].pos = temp_points[i*4+0]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col_trans; - _VtxWritePtr[1].pos = temp_points[i*4+1]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; - _VtxWritePtr[2].pos = temp_points[i*4+2]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; - _VtxWritePtr[3].pos = temp_points[i*4+3]; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col_trans; - _VtxWritePtr += 4; - } - } - _VtxCurrentIdx += (ImDrawIdx)vtx_count; - } - else - { - // Non Anti-aliased Stroke - const int idx_count = count*6; - const int vtx_count = count*4; // FIXME-OPT: Not sharing edges - PrimReserve(idx_count, vtx_count); - - for (int i1 = 0; i1 < count; i1++) - { - const int i2 = (i1+1) == points_count ? 0 : i1+1; - const ImVec2& p1 = points[i1]; - const ImVec2& p2 = points[i2]; - - float dx = p2.x - p1.x; - float dy = p2.y - p1.y; - IM_NORMALIZE2F_OVER_ZERO(dx, dy); - dx *= (thickness * 0.5f); - dy *= (thickness * 0.5f); - - _VtxWritePtr[0].pos.x = p1.x + dy; _VtxWritePtr[0].pos.y = p1.y - dx; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; - _VtxWritePtr[1].pos.x = p2.x + dy; _VtxWritePtr[1].pos.y = p2.y - dx; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; - _VtxWritePtr[2].pos.x = p2.x - dy; _VtxWritePtr[2].pos.y = p2.y + dx; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; - _VtxWritePtr[3].pos.x = p1.x - dy; _VtxWritePtr[3].pos.y = p1.y + dx; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col; - _VtxWritePtr += 4; - - _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2); - _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3); - _IdxWritePtr += 6; - _VtxCurrentIdx += 4; - } - } -} - -// We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds. -void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col) -{ - if (points_count < 3) - return; - - const ImVec2 uv = _Data->TexUvWhitePixel; - - if (Flags & ImDrawListFlags_AntiAliasedFill) - { - // Anti-aliased Fill - const float AA_SIZE = 1.0f; - const ImU32 col_trans = col & ~IM_COL32_A_MASK; - const int idx_count = (points_count-2)*3 + points_count*6; - const int vtx_count = (points_count*2); - PrimReserve(idx_count, vtx_count); - - // Add indexes for fill - unsigned int vtx_inner_idx = _VtxCurrentIdx; - unsigned int vtx_outer_idx = _VtxCurrentIdx+1; - for (int i = 2; i < points_count; i++) - { - _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+((i-1)<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_inner_idx+(i<<1)); - _IdxWritePtr += 3; - } - - // Compute normals - ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); //-V630 - for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) - { - const ImVec2& p0 = points[i0]; - const ImVec2& p1 = points[i1]; - float dx = p1.x - p0.x; - float dy = p1.y - p0.y; - IM_NORMALIZE2F_OVER_ZERO(dx, dy); - temp_normals[i0].x = dy; - temp_normals[i0].y = -dx; - } - - for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) - { - // Average normals - const ImVec2& n0 = temp_normals[i0]; - const ImVec2& n1 = temp_normals[i1]; - float dm_x = (n0.x + n1.x) * 0.5f; - float dm_y = (n0.y + n1.y) * 0.5f; - IM_FIXNORMAL2F(dm_x, dm_y); - dm_x *= AA_SIZE * 0.5f; - dm_y *= AA_SIZE * 0.5f; - - // Add vertices - _VtxWritePtr[0].pos.x = (points[i1].x - dm_x); _VtxWritePtr[0].pos.y = (points[i1].y - dm_y); _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; // Inner - _VtxWritePtr[1].pos.x = (points[i1].x + dm_x); _VtxWritePtr[1].pos.y = (points[i1].y + dm_y); _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; // Outer - _VtxWritePtr += 2; - - // Add indexes for fringes - _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx+(i1<<1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+(i0<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_outer_idx+(i0<<1)); - _IdxWritePtr[3] = (ImDrawIdx)(vtx_outer_idx+(i0<<1)); _IdxWritePtr[4] = (ImDrawIdx)(vtx_outer_idx+(i1<<1)); _IdxWritePtr[5] = (ImDrawIdx)(vtx_inner_idx+(i1<<1)); - _IdxWritePtr += 6; - } - _VtxCurrentIdx += (ImDrawIdx)vtx_count; - } - else - { - // Non Anti-aliased Fill - const int idx_count = (points_count-2)*3; - const int vtx_count = points_count; - PrimReserve(idx_count, vtx_count); - for (int i = 0; i < vtx_count; i++) - { - _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; - _VtxWritePtr++; - } - for (int i = 2; i < points_count; i++) - { - _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+i-1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+i); - _IdxWritePtr += 3; - } - _VtxCurrentIdx += (ImDrawIdx)vtx_count; - } -} - -void ImDrawList::PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12) -{ - if (radius == 0.0f || a_min_of_12 > a_max_of_12) - { - _Path.push_back(center); - return; - } - - // For legacy reason the PathArcToFast() always takes angles where 2*PI is represented by 12, - // but it is possible to set IM_DRAWLIST_ARCFAST_TESSELATION_MULTIPLIER to a higher value. This should compile to a no-op otherwise. -#if IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER != 1 - a_min_of_12 *= IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER; - a_max_of_12 *= IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER; -#endif - - _Path.reserve(_Path.Size + (a_max_of_12 - a_min_of_12 + 1)); - for (int a = a_min_of_12; a <= a_max_of_12; a++) - { - const ImVec2& c = _Data->ArcFastVtx[a % IM_ARRAYSIZE(_Data->ArcFastVtx)]; - _Path.push_back(ImVec2(center.x + c.x * radius, center.y + c.y * radius)); - } -} - -void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments) -{ - if (radius == 0.0f) - { - _Path.push_back(center); - return; - } - - // Note that we are adding a point at both a_min and a_max. - // If you are trying to draw a full closed circle you don't want the overlapping points! - _Path.reserve(_Path.Size + (num_segments + 1)); - for (int i = 0; i <= num_segments; i++) - { - const float a = a_min + ((float)i / (float)num_segments) * (a_max - a_min); - _Path.push_back(ImVec2(center.x + ImCos(a) * radius, center.y + ImSin(a) * radius)); - } -} - -ImVec2 ImBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t) -{ - float u = 1.0f - t; - float w1 = u*u*u; - float w2 = 3*u*u*t; - float w3 = 3*u*t*t; - float w4 = t*t*t; - return ImVec2(w1*p1.x + w2*p2.x + w3*p3.x + w4*p4.x, w1*p1.y + w2*p2.y + w3*p3.y + w4*p4.y); -} - -// Closely mimics BezierClosestPointCasteljauStep() in imgui.cpp -static void PathBezierToCasteljau(ImVector* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level) -{ - float dx = x4 - x1; - float dy = y4 - y1; - float d2 = ((x2 - x4) * dy - (y2 - y4) * dx); - float d3 = ((x3 - x4) * dy - (y3 - y4) * dx); - d2 = (d2 >= 0) ? d2 : -d2; - d3 = (d3 >= 0) ? d3 : -d3; - if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy)) - { - path->push_back(ImVec2(x4, y4)); - } - else if (level < 10) - { - float x12 = (x1+x2)*0.5f, y12 = (y1+y2)*0.5f; - float x23 = (x2+x3)*0.5f, y23 = (y2+y3)*0.5f; - float x34 = (x3+x4)*0.5f, y34 = (y3+y4)*0.5f; - float x123 = (x12+x23)*0.5f, y123 = (y12+y23)*0.5f; - float x234 = (x23+x34)*0.5f, y234 = (y23+y34)*0.5f; - float x1234 = (x123+x234)*0.5f, y1234 = (y123+y234)*0.5f; - PathBezierToCasteljau(path, x1,y1, x12,y12, x123,y123, x1234,y1234, tess_tol, level+1); - PathBezierToCasteljau(path, x1234,y1234, x234,y234, x34,y34, x4,y4, tess_tol, level+1); - } -} - -void ImDrawList::PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments) -{ - ImVec2 p1 = _Path.back(); - if (num_segments == 0) - { - PathBezierToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated - } - else - { - float t_step = 1.0f / (float)num_segments; - for (int i_step = 1; i_step <= num_segments; i_step++) - _Path.push_back(ImBezierCalc(p1, p2, p3, p4, t_step * i_step)); - } -} - -void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDrawCornerFlags rounding_corners) -{ - rounding = ImMin(rounding, ImFabs(b.x - a.x) * ( ((rounding_corners & ImDrawCornerFlags_Top) == ImDrawCornerFlags_Top) || ((rounding_corners & ImDrawCornerFlags_Bot) == ImDrawCornerFlags_Bot) ? 0.5f : 1.0f ) - 1.0f); - rounding = ImMin(rounding, ImFabs(b.y - a.y) * ( ((rounding_corners & ImDrawCornerFlags_Left) == ImDrawCornerFlags_Left) || ((rounding_corners & ImDrawCornerFlags_Right) == ImDrawCornerFlags_Right) ? 0.5f : 1.0f ) - 1.0f); - - if (rounding <= 0.0f || rounding_corners == 0) - { - PathLineTo(a); - PathLineTo(ImVec2(b.x, a.y)); - PathLineTo(b); - PathLineTo(ImVec2(a.x, b.y)); - } - else - { - const float rounding_tl = (rounding_corners & ImDrawCornerFlags_TopLeft) ? rounding : 0.0f; - const float rounding_tr = (rounding_corners & ImDrawCornerFlags_TopRight) ? rounding : 0.0f; - const float rounding_br = (rounding_corners & ImDrawCornerFlags_BotRight) ? rounding : 0.0f; - const float rounding_bl = (rounding_corners & ImDrawCornerFlags_BotLeft) ? rounding : 0.0f; - PathArcToFast(ImVec2(a.x + rounding_tl, a.y + rounding_tl), rounding_tl, 6, 9); - PathArcToFast(ImVec2(b.x - rounding_tr, a.y + rounding_tr), rounding_tr, 9, 12); - PathArcToFast(ImVec2(b.x - rounding_br, b.y - rounding_br), rounding_br, 0, 3); - PathArcToFast(ImVec2(a.x + rounding_bl, b.y - rounding_bl), rounding_bl, 3, 6); - } -} - -void ImDrawList::AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - PathLineTo(p1 + ImVec2(0.5f, 0.5f)); - PathLineTo(p2 + ImVec2(0.5f, 0.5f)); - PathStroke(col, false, thickness); -} - -// p_min = upper-left, p_max = lower-right -// Note we don't render 1 pixels sized rectangles properly. -void ImDrawList::AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - if (Flags & ImDrawListFlags_AntiAliasedLines) - PathRect(p_min + ImVec2(0.50f,0.50f), p_max - ImVec2(0.50f,0.50f), rounding, rounding_corners); - else - PathRect(p_min + ImVec2(0.50f,0.50f), p_max - ImVec2(0.49f,0.49f), rounding, rounding_corners); // Better looking lower-right corner and rounded non-AA shapes. - PathStroke(col, true, thickness); -} - -void ImDrawList::AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - if (rounding > 0.0f) - { - PathRect(p_min, p_max, rounding, rounding_corners); - PathFillConvex(col); - } - else - { - PrimReserve(6, 4); - PrimRect(p_min, p_max, col); - } -} - -// p_min = upper-left, p_max = lower-right -void ImDrawList::AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left) -{ - if (((col_upr_left | col_upr_right | col_bot_right | col_bot_left) & IM_COL32_A_MASK) == 0) - return; - - const ImVec2 uv = _Data->TexUvWhitePixel; - PrimReserve(6, 4); - PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+1)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2)); - PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+3)); - PrimWriteVtx(p_min, uv, col_upr_left); - PrimWriteVtx(ImVec2(p_max.x, p_min.y), uv, col_upr_right); - PrimWriteVtx(p_max, uv, col_bot_right); - PrimWriteVtx(ImVec2(p_min.x, p_max.y), uv, col_bot_left); -} - -void ImDrawList::AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - PathLineTo(p1); - PathLineTo(p2); - PathLineTo(p3); - PathLineTo(p4); - PathStroke(col, true, thickness); -} - -void ImDrawList::AddQuadFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - PathLineTo(p1); - PathLineTo(p2); - PathLineTo(p3); - PathLineTo(p4); - PathFillConvex(col); -} - -void ImDrawList::AddTriangle(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - PathLineTo(p1); - PathLineTo(p2); - PathLineTo(p3); - PathStroke(col, true, thickness); -} - -void ImDrawList::AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - PathLineTo(p1); - PathLineTo(p2); - PathLineTo(p3); - PathFillConvex(col); -} - -void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f) - return; - - // Obtain segment count - if (num_segments <= 0) - { - // Automatic segment count - const int radius_idx = (int)radius - 1; - if (radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts)) - num_segments = _Data->CircleSegmentCounts[radius_idx]; // Use cached value - else - num_segments = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleSegmentMaxError); - } - else - { - // Explicit segment count (still clamp to avoid drawing insanely tessellated shapes) - num_segments = ImClamp(num_segments, 3, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX); - } - - // Because we are filling a closed shape we remove 1 from the count of segments/points - const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments; - if (num_segments == 12) - PathArcToFast(center, radius - 0.5f, 0, 12); - else - PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1); - PathStroke(col, true, thickness); -} - -void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments) -{ - if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f) - return; - - // Obtain segment count - if (num_segments <= 0) - { - // Automatic segment count - const int radius_idx = (int)radius - 1; - if (radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts)) - num_segments = _Data->CircleSegmentCounts[radius_idx]; // Use cached value - else - num_segments = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleSegmentMaxError); - } - else - { - // Explicit segment count (still clamp to avoid drawing insanely tessellated shapes) - num_segments = ImClamp(num_segments, 3, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX); - } - - // Because we are filling a closed shape we remove 1 from the count of segments/points - const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments; - if (num_segments == 12) - PathArcToFast(center, radius, 0, 12); - else - PathArcTo(center, radius, 0.0f, a_max, num_segments - 1); - PathFillConvex(col); -} - -// Guaranteed to honor 'num_segments' -void ImDrawList::AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness) -{ - if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2) - return; - - // Because we are filling a closed shape we remove 1 from the count of segments/points - const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments; - PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1); - PathStroke(col, true, thickness); -} - -// Guaranteed to honor 'num_segments' -void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments) -{ - if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2) - return; - - // Because we are filling a closed shape we remove 1 from the count of segments/points - const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments; - PathArcTo(center, radius, 0.0f, a_max, num_segments - 1); - PathFillConvex(col); -} - -// Cubic Bezier takes 4 controls points -void ImDrawList::AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - PathLineTo(p1); - PathBezierCurveTo(p2, p3, p4, num_segments); - PathStroke(col, false, thickness); -} - -void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - if (text_end == NULL) - text_end = text_begin + strlen(text_begin); - if (text_begin == text_end) - return; - - // Pull default font/size from the shared ImDrawListSharedData instance - if (font == NULL) - font = _Data->Font; - if (font_size == 0.0f) - font_size = _Data->FontSize; - - IM_ASSERT(font->ContainerAtlas->TexID == _TextureIdStack.back()); // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font. - - ImVec4 clip_rect = _ClipRectStack.back(); - if (cpu_fine_clip_rect) - { - clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x); - clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y); - clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z); - clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w); - } - font->RenderText(this, font_size, pos, col, clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip_rect != NULL); -} - -void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end) -{ - AddText(NULL, 0.0f, pos, col, text_begin, text_end); -} - -void ImDrawList::AddImage(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); - if (push_texture_id) - PushTextureID(user_texture_id); - - PrimReserve(6, 4); - PrimRectUV(p_min, p_max, uv_min, uv_max, col); - - if (push_texture_id) - PopTextureID(); -} - -void ImDrawList::AddImageQuad(ImTextureID user_texture_id, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& uv1, const ImVec2& uv2, const ImVec2& uv3, const ImVec2& uv4, ImU32 col) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); - if (push_texture_id) - PushTextureID(user_texture_id); - - PrimReserve(6, 4); - PrimQuadUV(p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); - - if (push_texture_id) - PopTextureID(); -} - -void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners) -{ - if ((col & IM_COL32_A_MASK) == 0) - return; - - if (rounding <= 0.0f || (rounding_corners & ImDrawCornerFlags_All) == 0) - { - AddImage(user_texture_id, p_min, p_max, uv_min, uv_max, col); - return; - } - - const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); - if (push_texture_id) - PushTextureID(user_texture_id); - - int vert_start_idx = VtxBuffer.Size; - PathRect(p_min, p_max, rounding, rounding_corners); - PathFillConvex(col); - int vert_end_idx = VtxBuffer.Size; - ImGui::ShadeVertsLinearUV(this, vert_start_idx, vert_end_idx, p_min, p_max, uv_min, uv_max, true); - - if (push_texture_id) - PopTextureID(); -} - - -//----------------------------------------------------------------------------- -// ImDrawListSplitter -//----------------------------------------------------------------------------- -// FIXME: This may be a little confusing, trying to be a little too low-level/optimal instead of just doing vector swap.. -//----------------------------------------------------------------------------- - -void ImDrawListSplitter::ClearFreeMemory() -{ - for (int i = 0; i < _Channels.Size; i++) - { - if (i == _Current) - memset(&_Channels[i], 0, sizeof(_Channels[i])); // Current channel is a copy of CmdBuffer/IdxBuffer, don't destruct again - _Channels[i]._CmdBuffer.clear(); - _Channels[i]._IdxBuffer.clear(); - } - _Current = 0; - _Count = 1; - _Channels.clear(); -} - -void ImDrawListSplitter::Split(ImDrawList* draw_list, int channels_count) -{ - IM_ASSERT(_Current == 0 && _Count <= 1 && "Nested channel splitting is not supported. Please use separate instances of ImDrawListSplitter."); - int old_channels_count = _Channels.Size; - if (old_channels_count < channels_count) - _Channels.resize(channels_count); - _Count = channels_count; - - // Channels[] (24/32 bytes each) hold storage that we'll swap with draw_list->_CmdBuffer/_IdxBuffer - // The content of Channels[0] at this point doesn't matter. We clear it to make state tidy in a debugger but we don't strictly need to. - // When we switch to the next channel, we'll copy draw_list->_CmdBuffer/_IdxBuffer into Channels[0] and then Channels[1] into draw_list->CmdBuffer/_IdxBuffer - memset(&_Channels[0], 0, sizeof(ImDrawChannel)); - for (int i = 1; i < channels_count; i++) - { - if (i >= old_channels_count) - { - IM_PLACEMENT_NEW(&_Channels[i]) ImDrawChannel(); - } - else - { - _Channels[i]._CmdBuffer.resize(0); - _Channels[i]._IdxBuffer.resize(0); - } - if (_Channels[i]._CmdBuffer.Size == 0) - { - ImDrawCmd draw_cmd; - draw_cmd.ClipRect = draw_list->_ClipRectStack.back(); - draw_cmd.TextureId = draw_list->_TextureIdStack.back(); - _Channels[i]._CmdBuffer.push_back(draw_cmd); - } - } -} - -static inline bool CanMergeDrawCommands(ImDrawCmd* a, ImDrawCmd* b) -{ - return memcmp(&a->ClipRect, &b->ClipRect, sizeof(a->ClipRect)) == 0 && a->TextureId == b->TextureId && a->VtxOffset == b->VtxOffset && !a->UserCallback && !b->UserCallback; -} - -void ImDrawListSplitter::Merge(ImDrawList* draw_list) -{ - // Note that we never use or rely on channels.Size because it is merely a buffer that we never shrink back to 0 to keep all sub-buffers ready for use. - if (_Count <= 1) - return; - - SetCurrentChannel(draw_list, 0); - if (draw_list->CmdBuffer.Size != 0 && draw_list->CmdBuffer.back().ElemCount == 0) - draw_list->CmdBuffer.pop_back(); - - // Calculate our final buffer sizes. Also fix the incorrect IdxOffset values in each command. - int new_cmd_buffer_count = 0; - int new_idx_buffer_count = 0; - ImDrawCmd* last_cmd = (_Count > 0 && draw_list->CmdBuffer.Size > 0) ? &draw_list->CmdBuffer.back() : NULL; - int idx_offset = last_cmd ? last_cmd->IdxOffset + last_cmd->ElemCount : 0; - for (int i = 1; i < _Count; i++) - { - ImDrawChannel& ch = _Channels[i]; - if (ch._CmdBuffer.Size > 0 && ch._CmdBuffer.back().ElemCount == 0) - ch._CmdBuffer.pop_back(); - if (ch._CmdBuffer.Size > 0 && last_cmd != NULL && CanMergeDrawCommands(last_cmd, &ch._CmdBuffer[0])) - { - // Merge previous channel last draw command with current channel first draw command if matching. - last_cmd->ElemCount += ch._CmdBuffer[0].ElemCount; - idx_offset += ch._CmdBuffer[0].ElemCount; - ch._CmdBuffer.erase(ch._CmdBuffer.Data); // FIXME-OPT: Improve for multiple merges. - } - if (ch._CmdBuffer.Size > 0) - last_cmd = &ch._CmdBuffer.back(); - new_cmd_buffer_count += ch._CmdBuffer.Size; - new_idx_buffer_count += ch._IdxBuffer.Size; - for (int cmd_n = 0; cmd_n < ch._CmdBuffer.Size; cmd_n++) - { - ch._CmdBuffer.Data[cmd_n].IdxOffset = idx_offset; - idx_offset += ch._CmdBuffer.Data[cmd_n].ElemCount; - } - } - draw_list->CmdBuffer.resize(draw_list->CmdBuffer.Size + new_cmd_buffer_count); - draw_list->IdxBuffer.resize(draw_list->IdxBuffer.Size + new_idx_buffer_count); - - // Write commands and indices in order (they are fairly small structures, we don't copy vertices only indices) - ImDrawCmd* cmd_write = draw_list->CmdBuffer.Data + draw_list->CmdBuffer.Size - new_cmd_buffer_count; - ImDrawIdx* idx_write = draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size - new_idx_buffer_count; - for (int i = 1; i < _Count; i++) - { - ImDrawChannel& ch = _Channels[i]; - if (int sz = ch._CmdBuffer.Size) { memcpy(cmd_write, ch._CmdBuffer.Data, sz * sizeof(ImDrawCmd)); cmd_write += sz; } - if (int sz = ch._IdxBuffer.Size) { memcpy(idx_write, ch._IdxBuffer.Data, sz * sizeof(ImDrawIdx)); idx_write += sz; } - } - draw_list->_IdxWritePtr = idx_write; - draw_list->UpdateClipRect(); // We call this instead of AddDrawCmd(), so that empty channels won't produce an extra draw call. - draw_list->UpdateTextureID(); - _Count = 1; -} - -void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx) -{ - IM_ASSERT(idx >= 0 && idx < _Count); - if (_Current == idx) - return; - // Overwrite ImVector (12/16 bytes), four times. This is merely a silly optimization instead of doing .swap() - memcpy(&_Channels.Data[_Current]._CmdBuffer, &draw_list->CmdBuffer, sizeof(draw_list->CmdBuffer)); - memcpy(&_Channels.Data[_Current]._IdxBuffer, &draw_list->IdxBuffer, sizeof(draw_list->IdxBuffer)); - _Current = idx; - memcpy(&draw_list->CmdBuffer, &_Channels.Data[idx]._CmdBuffer, sizeof(draw_list->CmdBuffer)); - memcpy(&draw_list->IdxBuffer, &_Channels.Data[idx]._IdxBuffer, sizeof(draw_list->IdxBuffer)); - draw_list->_IdxWritePtr = draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImDrawData -//----------------------------------------------------------------------------- - -// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering! -void ImDrawData::DeIndexAllBuffers() -{ - ImVector new_vtx_buffer; - TotalVtxCount = TotalIdxCount = 0; - for (int i = 0; i < CmdListsCount; i++) - { - ImDrawList* cmd_list = CmdLists[i]; - if (cmd_list->IdxBuffer.empty()) - continue; - new_vtx_buffer.resize(cmd_list->IdxBuffer.Size); - for (int j = 0; j < cmd_list->IdxBuffer.Size; j++) - new_vtx_buffer[j] = cmd_list->VtxBuffer[cmd_list->IdxBuffer[j]]; - cmd_list->VtxBuffer.swap(new_vtx_buffer); - cmd_list->IdxBuffer.resize(0); - TotalVtxCount += cmd_list->VtxBuffer.Size; - } -} - -// Helper to scale the ClipRect field of each ImDrawCmd. -// Use if your final output buffer is at a different scale than draw_data->DisplaySize, -// or if there is a difference between your window resolution and framebuffer resolution. -void ImDrawData::ScaleClipRects(const ImVec2& fb_scale) -{ - for (int i = 0; i < CmdListsCount; i++) - { - ImDrawList* cmd_list = CmdLists[i]; - for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) - { - ImDrawCmd* cmd = &cmd_list->CmdBuffer[cmd_i]; - cmd->ClipRect = ImVec4(cmd->ClipRect.x * fb_scale.x, cmd->ClipRect.y * fb_scale.y, cmd->ClipRect.z * fb_scale.x, cmd->ClipRect.w * fb_scale.y); - } - } -} - -//----------------------------------------------------------------------------- -// [SECTION] Helpers ShadeVertsXXX functions -//----------------------------------------------------------------------------- - -// Generic linear color gradient, write to RGB fields, leave A untouched. -void ImGui::ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1) -{ - ImVec2 gradient_extent = gradient_p1 - gradient_p0; - float gradient_inv_length2 = 1.0f / ImLengthSqr(gradient_extent); - ImDrawVert* vert_start = draw_list->VtxBuffer.Data + vert_start_idx; - ImDrawVert* vert_end = draw_list->VtxBuffer.Data + vert_end_idx; - for (ImDrawVert* vert = vert_start; vert < vert_end; vert++) - { - float d = ImDot(vert->pos - gradient_p0, gradient_extent); - float t = ImClamp(d * gradient_inv_length2, 0.0f, 1.0f); - int r = ImLerp((int)(col0 >> IM_COL32_R_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_R_SHIFT) & 0xFF, t); - int g = ImLerp((int)(col0 >> IM_COL32_G_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_G_SHIFT) & 0xFF, t); - int b = ImLerp((int)(col0 >> IM_COL32_B_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_B_SHIFT) & 0xFF, t); - vert->col = (r << IM_COL32_R_SHIFT) | (g << IM_COL32_G_SHIFT) | (b << IM_COL32_B_SHIFT) | (vert->col & IM_COL32_A_MASK); - } -} - -// Distribute UV over (a, b) rectangle -void ImGui::ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp) -{ - const ImVec2 size = b - a; - const ImVec2 uv_size = uv_b - uv_a; - const ImVec2 scale = ImVec2( - size.x != 0.0f ? (uv_size.x / size.x) : 0.0f, - size.y != 0.0f ? (uv_size.y / size.y) : 0.0f); - - ImDrawVert* vert_start = draw_list->VtxBuffer.Data + vert_start_idx; - ImDrawVert* vert_end = draw_list->VtxBuffer.Data + vert_end_idx; - if (clamp) - { - const ImVec2 min = ImMin(uv_a, uv_b); - const ImVec2 max = ImMax(uv_a, uv_b); - for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex) - vertex->uv = ImClamp(uv_a + ImMul(ImVec2(vertex->pos.x, vertex->pos.y) - a, scale), min, max); - } - else - { - for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex) - vertex->uv = uv_a + ImMul(ImVec2(vertex->pos.x, vertex->pos.y) - a, scale); - } -} - -//----------------------------------------------------------------------------- -// [SECTION] ImFontConfig -//----------------------------------------------------------------------------- - -ImFontConfig::ImFontConfig() -{ - FontData = NULL; - FontDataSize = 0; - FontDataOwnedByAtlas = true; - FontNo = 0; - SizePixels = 0.0f; - OversampleH = 3; // FIXME: 2 may be a better default? - OversampleV = 1; - PixelSnapH = false; - GlyphExtraSpacing = ImVec2(0.0f, 0.0f); - GlyphOffset = ImVec2(0.0f, 0.0f); - GlyphRanges = NULL; - GlyphMinAdvanceX = 0.0f; - GlyphMaxAdvanceX = FLT_MAX; - MergeMode = false; - RasterizerFlags = 0x00; - RasterizerMultiply = 1.0f; - EllipsisChar = (ImWchar)-1; - memset(Name, 0, sizeof(Name)); - DstFont = NULL; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImFontAtlas -//----------------------------------------------------------------------------- - -// A work of art lies ahead! (. = white layer, X = black layer, others are blank) -// The white texels on the top left are the ones we'll use everywhere in Dear ImGui to render filled shapes. -const int FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF = 108; -const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27; -const unsigned int FONT_ATLAS_DEFAULT_TEX_DATA_ID = 0x80000000; -static const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF * FONT_ATLAS_DEFAULT_TEX_DATA_H + 1] = -{ - "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX " - "..- -X.....X- X.X - X.X -X.....X - X.....X- X..X " - "--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X " - "X - X.X - X.....X - X.....X -X...X - X...X- X..X " - "XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X " - "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX " - "X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX " - "X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX " - "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X " - "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X" - "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X" - "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X" - "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X" - "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X" - "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X" - "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X" - "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X " - "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X " - "X.X X..X - -X.......X- X.......X - XX XX - - X..........X " - "XX X..X - - X.....X - X.....X - X.X X.X - - X........X " - " X..X - X...X - X...X - X..X X..X - - X........X " - " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX " - "------------ - X - X -X.....................X- ------------------" - " ----------------------------------- X...XXXXXXXXXXXXX...X - " - " - X..X X..X - " - " - X.X X.X - " - " - XX XX - " -}; - -static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3] = -{ - // Pos ........ Size ......... Offset ...... - { ImVec2( 0,3), ImVec2(12,19), ImVec2( 0, 0) }, // ImGuiMouseCursor_Arrow - { ImVec2(13,0), ImVec2( 7,16), ImVec2( 1, 8) }, // ImGuiMouseCursor_TextInput - { ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) }, // ImGuiMouseCursor_ResizeAll - { ImVec2(21,0), ImVec2( 9,23), ImVec2( 4,11) }, // ImGuiMouseCursor_ResizeNS - { ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 4) }, // ImGuiMouseCursor_ResizeEW - { ImVec2(73,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNESW - { ImVec2(55,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNWSE - { ImVec2(91,0), ImVec2(17,22), ImVec2( 5, 0) }, // ImGuiMouseCursor_Hand -}; - -ImFontAtlas::ImFontAtlas() -{ - Locked = false; - Flags = ImFontAtlasFlags_None; - TexID = (ImTextureID)NULL; - TexDesiredWidth = 0; - TexGlyphPadding = 1; - - TexPixelsAlpha8 = NULL; - TexPixelsRGBA32 = NULL; - TexWidth = TexHeight = 0; - TexUvScale = ImVec2(0.0f, 0.0f); - TexUvWhitePixel = ImVec2(0.0f, 0.0f); - for (int n = 0; n < IM_ARRAYSIZE(CustomRectIds); n++) - CustomRectIds[n] = -1; -} - -ImFontAtlas::~ImFontAtlas() -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - Clear(); -} - -void ImFontAtlas::ClearInputData() -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - for (int i = 0; i < ConfigData.Size; i++) - if (ConfigData[i].FontData && ConfigData[i].FontDataOwnedByAtlas) - { - IM_FREE(ConfigData[i].FontData); - ConfigData[i].FontData = NULL; - } - - // When clearing this we lose access to the font name and other information used to build the font. - for (int i = 0; i < Fonts.Size; i++) - if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size) - { - Fonts[i]->ConfigData = NULL; - Fonts[i]->ConfigDataCount = 0; - } - ConfigData.clear(); - CustomRects.clear(); - for (int n = 0; n < IM_ARRAYSIZE(CustomRectIds); n++) - CustomRectIds[n] = -1; -} - -void ImFontAtlas::ClearTexData() -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - if (TexPixelsAlpha8) - IM_FREE(TexPixelsAlpha8); - if (TexPixelsRGBA32) - IM_FREE(TexPixelsRGBA32); - TexPixelsAlpha8 = NULL; - TexPixelsRGBA32 = NULL; -} - -void ImFontAtlas::ClearFonts() -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - for (int i = 0; i < Fonts.Size; i++) - IM_DELETE(Fonts[i]); - Fonts.clear(); -} - -void ImFontAtlas::Clear() -{ - ClearInputData(); - ClearTexData(); - ClearFonts(); -} - -void ImFontAtlas::GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) -{ - // Build atlas on demand - if (TexPixelsAlpha8 == NULL) - { - if (ConfigData.empty()) - AddFontDefault(); - Build(); - } - - *out_pixels = TexPixelsAlpha8; - if (out_width) *out_width = TexWidth; - if (out_height) *out_height = TexHeight; - if (out_bytes_per_pixel) *out_bytes_per_pixel = 1; -} - -void ImFontAtlas::GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) -{ - // Convert to RGBA32 format on demand - // Although it is likely to be the most commonly used format, our font rendering is 1 channel / 8 bpp - if (!TexPixelsRGBA32) - { - unsigned char* pixels = NULL; - GetTexDataAsAlpha8(&pixels, NULL, NULL); - if (pixels) - { - TexPixelsRGBA32 = (unsigned int*)IM_ALLOC((size_t)TexWidth * (size_t)TexHeight * 4); - const unsigned char* src = pixels; - unsigned int* dst = TexPixelsRGBA32; - for (int n = TexWidth * TexHeight; n > 0; n--) - *dst++ = IM_COL32(255, 255, 255, (unsigned int)(*src++)); - } - } - - *out_pixels = (unsigned char*)TexPixelsRGBA32; - if (out_width) *out_width = TexWidth; - if (out_height) *out_height = TexHeight; - if (out_bytes_per_pixel) *out_bytes_per_pixel = 4; -} - -ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg) -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0); - IM_ASSERT(font_cfg->SizePixels > 0.0f); - - // Create new font - if (!font_cfg->MergeMode) - Fonts.push_back(IM_NEW(ImFont)); - else - IM_ASSERT(!Fonts.empty() && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font. - - ConfigData.push_back(*font_cfg); - ImFontConfig& new_font_cfg = ConfigData.back(); - if (new_font_cfg.DstFont == NULL) - new_font_cfg.DstFont = Fonts.back(); - if (!new_font_cfg.FontDataOwnedByAtlas) - { - new_font_cfg.FontData = IM_ALLOC(new_font_cfg.FontDataSize); - new_font_cfg.FontDataOwnedByAtlas = true; - memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize); - } - - if (new_font_cfg.DstFont->EllipsisChar == (ImWchar)-1) - new_font_cfg.DstFont->EllipsisChar = font_cfg->EllipsisChar; - - // Invalidate texture - ClearTexData(); - return new_font_cfg.DstFont; -} - -// Default font TTF is compressed with stb_compress then base85 encoded (see misc/fonts/binary_to_compressed_c.cpp for encoder) -static unsigned int stb_decompress_length(const unsigned char *input); -static unsigned int stb_decompress(unsigned char *output, const unsigned char *input, unsigned int length); -static const char* GetDefaultCompressedFontDataTTFBase85(); -static unsigned int Decode85Byte(char c) { return c >= '\\' ? c-36 : c-35; } -static void Decode85(const unsigned char* src, unsigned char* dst) -{ - while (*src) - { - unsigned int tmp = Decode85Byte(src[0]) + 85*(Decode85Byte(src[1]) + 85*(Decode85Byte(src[2]) + 85*(Decode85Byte(src[3]) + 85*Decode85Byte(src[4])))); - dst[0] = ((tmp >> 0) & 0xFF); dst[1] = ((tmp >> 8) & 0xFF); dst[2] = ((tmp >> 16) & 0xFF); dst[3] = ((tmp >> 24) & 0xFF); // We can't assume little-endianness. - src += 5; - dst += 4; - } -} - -// Load embedded ProggyClean.ttf at size 13, disable oversampling -ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) -{ - ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); - if (!font_cfg_template) - { - font_cfg.OversampleH = font_cfg.OversampleV = 1; - font_cfg.PixelSnapH = true; - } - if (font_cfg.SizePixels <= 0.0f) - font_cfg.SizePixels = 13.0f * 1.0f; - if (font_cfg.Name[0] == '\0') - ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels); - font_cfg.EllipsisChar = (ImWchar)0x0085; - - const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85(); - const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault(); - ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, glyph_ranges); - font->DisplayOffset.y = 1.0f; - return font; -} - -ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - size_t data_size = 0; - void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0); - if (!data) - { - IM_ASSERT_USER_ERROR(0, "Could not load font file!"); - return NULL; - } - ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); - if (font_cfg.Name[0] == '\0') - { - // Store a short copy of filename into into the font name for convenience - const char* p; - for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {} - ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s, %.0fpx", p, size_pixels); - } - return AddFontFromMemoryTTF(data, (int)data_size, size_pixels, &font_cfg, glyph_ranges); -} - -// NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build(). -ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); - IM_ASSERT(font_cfg.FontData == NULL); - font_cfg.FontData = ttf_data; - font_cfg.FontDataSize = ttf_size; - font_cfg.SizePixels = size_pixels; - if (glyph_ranges) - font_cfg.GlyphRanges = glyph_ranges; - return AddFont(&font_cfg); -} - -ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) -{ - const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_ttf_data); - unsigned char* buf_decompressed_data = (unsigned char *)IM_ALLOC(buf_decompressed_size); - stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size); - - ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); - IM_ASSERT(font_cfg.FontData == NULL); - font_cfg.FontDataOwnedByAtlas = true; - return AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, &font_cfg, glyph_ranges); -} - -ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg, const ImWchar* glyph_ranges) -{ - int compressed_ttf_size = (((int)strlen(compressed_ttf_data_base85) + 4) / 5) * 4; - void* compressed_ttf = IM_ALLOC((size_t)compressed_ttf_size); - Decode85((const unsigned char*)compressed_ttf_data_base85, (unsigned char*)compressed_ttf); - ImFont* font = AddFontFromMemoryCompressedTTF(compressed_ttf, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges); - IM_FREE(compressed_ttf); - return font; -} - -int ImFontAtlas::AddCustomRectRegular(unsigned int id, int width, int height) -{ - // Breaking change on 2019/11/21 (1.74): ImFontAtlas::AddCustomRectRegular() now requires an ID >= 0x110000 (instead of >= 0x10000) - IM_ASSERT(id >= 0x110000); - IM_ASSERT(width > 0 && width <= 0xFFFF); - IM_ASSERT(height > 0 && height <= 0xFFFF); - ImFontAtlasCustomRect r; - r.ID = id; - r.Width = (unsigned short)width; - r.Height = (unsigned short)height; - CustomRects.push_back(r); - return CustomRects.Size - 1; // Return index -} - -int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset) -{ - IM_ASSERT(font != NULL); - IM_ASSERT(width > 0 && width <= 0xFFFF); - IM_ASSERT(height > 0 && height <= 0xFFFF); - ImFontAtlasCustomRect r; - r.ID = id; - r.Width = (unsigned short)width; - r.Height = (unsigned short)height; - r.GlyphAdvanceX = advance_x; - r.GlyphOffset = offset; - r.Font = font; - CustomRects.push_back(r); - return CustomRects.Size - 1; // Return index -} - -void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const -{ - IM_ASSERT(TexWidth > 0 && TexHeight > 0); // Font atlas needs to be built before we can calculate UV coordinates - IM_ASSERT(rect->IsPacked()); // Make sure the rectangle has been packed - *out_uv_min = ImVec2((float)rect->X * TexUvScale.x, (float)rect->Y * TexUvScale.y); - *out_uv_max = ImVec2((float)(rect->X + rect->Width) * TexUvScale.x, (float)(rect->Y + rect->Height) * TexUvScale.y); -} - -bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]) -{ - if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT) - return false; - if (Flags & ImFontAtlasFlags_NoMouseCursors) - return false; - - IM_ASSERT(CustomRectIds[0] != -1); - ImFontAtlasCustomRect& r = CustomRects[CustomRectIds[0]]; - IM_ASSERT(r.ID == FONT_ATLAS_DEFAULT_TEX_DATA_ID); - ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r.X, (float)r.Y); - ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1]; - *out_size = size; - *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2]; - out_uv_border[0] = (pos) * TexUvScale; - out_uv_border[1] = (pos + size) * TexUvScale; - pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF + 1; - out_uv_fill[0] = (pos) * TexUvScale; - out_uv_fill[1] = (pos + size) * TexUvScale; - return true; -} - -bool ImFontAtlas::Build() -{ - IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); - return ImFontAtlasBuildWithStbTruetype(this); -} - -void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_brighten_factor) -{ - for (unsigned int i = 0; i < 256; i++) - { - unsigned int value = (unsigned int)(i * in_brighten_factor); - out_table[i] = value > 255 ? 255 : (value & 0xFF); - } -} - -void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride) -{ - unsigned char* data = pixels + x + y * stride; - for (int j = h; j > 0; j--, data += stride) - for (int i = 0; i < w; i++) - data[i] = table[data[i]]; -} - -// Temporary data for one source font (multiple source fonts can be merged into one destination ImFont) -// (C++03 doesn't allow instancing ImVector<> with function-local types so we declare the type here.) -struct ImFontBuildSrcData -{ - stbtt_fontinfo FontInfo; - stbtt_pack_range PackRange; // Hold the list of codepoints to pack (essentially points to Codepoints.Data) - stbrp_rect* Rects; // Rectangle to pack. We first fill in their size and the packer will give us their position. - stbtt_packedchar* PackedChars; // Output glyphs - const ImWchar* SrcRanges; // Ranges as requested by user (user is allowed to request too much, e.g. 0x0020..0xFFFF) - int DstIndex; // Index into atlas->Fonts[] and dst_tmp_array[] - int GlyphsHighest; // Highest requested codepoint - int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font) - ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB) - ImVector GlyphsList; // Glyph codepoints list (flattened version of GlyphsMap) -}; - -// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont) -struct ImFontBuildDstData -{ - int SrcCount; // Number of source fonts targeting this destination font. - int GlyphsHighest; - int GlyphsCount; - ImBitVector GlyphsSet; // This is used to resolve collision when multiple sources are merged into a same destination font. -}; - -static void UnpackBitVectorToFlatIndexList(const ImBitVector* in, ImVector* out) -{ - IM_ASSERT(sizeof(in->Storage.Data[0]) == sizeof(int)); - const ImU32* it_begin = in->Storage.begin(); - const ImU32* it_end = in->Storage.end(); - for (const ImU32* it = it_begin; it < it_end; it++) - if (ImU32 entries_32 = *it) - for (ImU32 bit_n = 0; bit_n < 32; bit_n++) - if (entries_32 & ((ImU32)1 << bit_n)) - out->push_back((int)(((it - it_begin) << 5) + bit_n)); -} - -bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) -{ - IM_ASSERT(atlas->ConfigData.Size > 0); - - ImFontAtlasBuildInit(atlas); - - // Clear atlas - atlas->TexID = (ImTextureID)NULL; - atlas->TexWidth = atlas->TexHeight = 0; - atlas->TexUvScale = ImVec2(0.0f, 0.0f); - atlas->TexUvWhitePixel = ImVec2(0.0f, 0.0f); - atlas->ClearTexData(); - - // Temporary storage for building - ImVector src_tmp_array; - ImVector dst_tmp_array; - src_tmp_array.resize(atlas->ConfigData.Size); - dst_tmp_array.resize(atlas->Fonts.Size); - memset(src_tmp_array.Data, 0, (size_t)src_tmp_array.size_in_bytes()); - memset(dst_tmp_array.Data, 0, (size_t)dst_tmp_array.size_in_bytes()); - - // 1. Initialize font loading structure, check font data validity - for (int src_i = 0; src_i < atlas->ConfigData.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - ImFontConfig& cfg = atlas->ConfigData[src_i]; - IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == atlas)); - - // Find index from cfg.DstFont (we allow the user to set cfg.DstFont. Also it makes casual debugging nicer than when storing indices) - src_tmp.DstIndex = -1; - for (int output_i = 0; output_i < atlas->Fonts.Size && src_tmp.DstIndex == -1; output_i++) - if (cfg.DstFont == atlas->Fonts[output_i]) - src_tmp.DstIndex = output_i; - IM_ASSERT(src_tmp.DstIndex != -1); // cfg.DstFont not pointing within atlas->Fonts[] array? - if (src_tmp.DstIndex == -1) - return false; - - // Initialize helper structure for font loading and verify that the TTF/OTF data is correct - const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo); - IM_ASSERT(font_offset >= 0 && "FontData is incorrect, or FontNo cannot be found."); - if (!stbtt_InitFont(&src_tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset)) - return false; - - // Measure highest codepoints - ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex]; - src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault(); - for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2) - src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]); - dst_tmp.SrcCount++; - dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest); - } - - // 2. For every requested codepoint, check for their presence in the font data, and handle redundancy or overlaps between source fonts to avoid unused glyphs. - int total_glyphs_count = 0; - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex]; - src_tmp.GlyphsSet.Create(src_tmp.GlyphsHighest + 1); - if (dst_tmp.GlyphsSet.Storage.empty()) - dst_tmp.GlyphsSet.Create(dst_tmp.GlyphsHighest + 1); - - for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2) - for (unsigned int codepoint = src_range[0]; codepoint <= src_range[1]; codepoint++) - { - if (dst_tmp.GlyphsSet.TestBit(codepoint)) // Don't overwrite existing glyphs. We could make this an option for MergeMode (e.g. MergeOverwrite==true) - continue; - if (!stbtt_FindGlyphIndex(&src_tmp.FontInfo, codepoint)) // It is actually in the font? - continue; - - // Add to avail set/counters - src_tmp.GlyphsCount++; - dst_tmp.GlyphsCount++; - src_tmp.GlyphsSet.SetBit(codepoint); - dst_tmp.GlyphsSet.SetBit(codepoint); - total_glyphs_count++; - } - } - - // 3. Unpack our bit map into a flat list (we now have all the Unicode points that we know are requested _and_ available _and_ not overlapping another) - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - src_tmp.GlyphsList.reserve(src_tmp.GlyphsCount); - UnpackBitVectorToFlatIndexList(&src_tmp.GlyphsSet, &src_tmp.GlyphsList); - src_tmp.GlyphsSet.Clear(); - IM_ASSERT(src_tmp.GlyphsList.Size == src_tmp.GlyphsCount); - } - for (int dst_i = 0; dst_i < dst_tmp_array.Size; dst_i++) - dst_tmp_array[dst_i].GlyphsSet.Clear(); - dst_tmp_array.clear(); - - // Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0) - // (We technically don't need to zero-clear buf_rects, but let's do it for the sake of sanity) - ImVector buf_rects; - ImVector buf_packedchars; - buf_rects.resize(total_glyphs_count); - buf_packedchars.resize(total_glyphs_count); - memset(buf_rects.Data, 0, (size_t)buf_rects.size_in_bytes()); - memset(buf_packedchars.Data, 0, (size_t)buf_packedchars.size_in_bytes()); - - // 4. Gather glyphs sizes so we can pack them in our virtual canvas. - int total_surface = 0; - int buf_rects_out_n = 0; - int buf_packedchars_out_n = 0; - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - if (src_tmp.GlyphsCount == 0) - continue; - - src_tmp.Rects = &buf_rects[buf_rects_out_n]; - src_tmp.PackedChars = &buf_packedchars[buf_packedchars_out_n]; - buf_rects_out_n += src_tmp.GlyphsCount; - buf_packedchars_out_n += src_tmp.GlyphsCount; - - // Convert our ranges in the format stb_truetype wants - ImFontConfig& cfg = atlas->ConfigData[src_i]; - src_tmp.PackRange.font_size = cfg.SizePixels; - src_tmp.PackRange.first_unicode_codepoint_in_range = 0; - src_tmp.PackRange.array_of_unicode_codepoints = src_tmp.GlyphsList.Data; - src_tmp.PackRange.num_chars = src_tmp.GlyphsList.Size; - src_tmp.PackRange.chardata_for_range = src_tmp.PackedChars; - src_tmp.PackRange.h_oversample = (unsigned char)cfg.OversampleH; - src_tmp.PackRange.v_oversample = (unsigned char)cfg.OversampleV; - - // Gather the sizes of all rectangles we will need to pack (this loop is based on stbtt_PackFontRangesGatherRects) - const float scale = (cfg.SizePixels > 0) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -cfg.SizePixels); - const int padding = atlas->TexGlyphPadding; - for (int glyph_i = 0; glyph_i < src_tmp.GlyphsList.Size; glyph_i++) - { - int x0, y0, x1, y1; - const int glyph_index_in_font = stbtt_FindGlyphIndex(&src_tmp.FontInfo, src_tmp.GlyphsList[glyph_i]); - IM_ASSERT(glyph_index_in_font != 0); - stbtt_GetGlyphBitmapBoxSubpixel(&src_tmp.FontInfo, glyph_index_in_font, scale * cfg.OversampleH, scale * cfg.OversampleV, 0, 0, &x0, &y0, &x1, &y1); - src_tmp.Rects[glyph_i].w = (stbrp_coord)(x1 - x0 + padding + cfg.OversampleH - 1); - src_tmp.Rects[glyph_i].h = (stbrp_coord)(y1 - y0 + padding + cfg.OversampleV - 1); - total_surface += src_tmp.Rects[glyph_i].w * src_tmp.Rects[glyph_i].h; - } - } - - // We need a width for the skyline algorithm, any width! - // The exact width doesn't really matter much, but some API/GPU have texture size limitations and increasing width can decrease height. - // User can override TexDesiredWidth and TexGlyphPadding if they wish, otherwise we use a simple heuristic to select the width based on expected surface. - const int surface_sqrt = (int)ImSqrt((float)total_surface) + 1; - atlas->TexHeight = 0; - if (atlas->TexDesiredWidth > 0) - atlas->TexWidth = atlas->TexDesiredWidth; - else - atlas->TexWidth = (surface_sqrt >= 4096*0.7f) ? 4096 : (surface_sqrt >= 2048*0.7f) ? 2048 : (surface_sqrt >= 1024*0.7f) ? 1024 : 512; - - // 5. Start packing - // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values). - const int TEX_HEIGHT_MAX = 1024 * 32; - stbtt_pack_context spc = {}; - stbtt_PackBegin(&spc, NULL, atlas->TexWidth, TEX_HEIGHT_MAX, 0, atlas->TexGlyphPadding, NULL); - ImFontAtlasBuildPackCustomRects(atlas, spc.pack_info); - - // 6. Pack each source font. No rendering yet, we are working with rectangles in an infinitely tall texture at this point. - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - if (src_tmp.GlyphsCount == 0) - continue; - - stbrp_pack_rects((stbrp_context*)spc.pack_info, src_tmp.Rects, src_tmp.GlyphsCount); - - // Extend texture height and mark missing glyphs as non-packed so we won't render them. - // FIXME: We are not handling packing failure here (would happen if we got off TEX_HEIGHT_MAX or if a single if larger than TexWidth?) - for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++) - if (src_tmp.Rects[glyph_i].was_packed) - atlas->TexHeight = ImMax(atlas->TexHeight, src_tmp.Rects[glyph_i].y + src_tmp.Rects[glyph_i].h); - } - - // 7. Allocate texture - atlas->TexHeight = (atlas->Flags & ImFontAtlasFlags_NoPowerOfTwoHeight) ? (atlas->TexHeight + 1) : ImUpperPowerOfTwo(atlas->TexHeight); - atlas->TexUvScale = ImVec2(1.0f / atlas->TexWidth, 1.0f / atlas->TexHeight); - atlas->TexPixelsAlpha8 = (unsigned char*)IM_ALLOC(atlas->TexWidth * atlas->TexHeight); - memset(atlas->TexPixelsAlpha8, 0, atlas->TexWidth * atlas->TexHeight); - spc.pixels = atlas->TexPixelsAlpha8; - spc.height = atlas->TexHeight; - - // 8. Render/rasterize font characters into the texture - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontConfig& cfg = atlas->ConfigData[src_i]; - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - if (src_tmp.GlyphsCount == 0) - continue; - - stbtt_PackFontRangesRenderIntoRects(&spc, &src_tmp.FontInfo, &src_tmp.PackRange, 1, src_tmp.Rects); - - // Apply multiply operator - if (cfg.RasterizerMultiply != 1.0f) - { - unsigned char multiply_table[256]; - ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, cfg.RasterizerMultiply); - stbrp_rect* r = &src_tmp.Rects[0]; - for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++, r++) - if (r->was_packed) - ImFontAtlasBuildMultiplyRectAlpha8(multiply_table, atlas->TexPixelsAlpha8, r->x, r->y, r->w, r->h, atlas->TexWidth * 1); - } - src_tmp.Rects = NULL; - } - - // End packing - stbtt_PackEnd(&spc); - buf_rects.clear(); - - // 9. Setup ImFont and glyphs for runtime - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - { - ImFontBuildSrcData& src_tmp = src_tmp_array[src_i]; - if (src_tmp.GlyphsCount == 0) - continue; - - ImFontConfig& cfg = atlas->ConfigData[src_i]; - ImFont* dst_font = cfg.DstFont; // We can have multiple input fonts writing into a same destination font (when using MergeMode=true) - - const float font_scale = stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels); - int unscaled_ascent, unscaled_descent, unscaled_line_gap; - stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap); - - const float ascent = ImFloor(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1)); - const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1)); - ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent); - const float font_off_x = cfg.GlyphOffset.x; - const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent); - - for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++) - { - const int codepoint = src_tmp.GlyphsList[glyph_i]; - const stbtt_packedchar& pc = src_tmp.PackedChars[glyph_i]; - - const float char_advance_x_org = pc.xadvance; - const float char_advance_x_mod = ImClamp(char_advance_x_org, cfg.GlyphMinAdvanceX, cfg.GlyphMaxAdvanceX); - float char_off_x = font_off_x; - if (char_advance_x_org != char_advance_x_mod) - char_off_x += cfg.PixelSnapH ? ImFloor((char_advance_x_mod - char_advance_x_org) * 0.5f) : (char_advance_x_mod - char_advance_x_org) * 0.5f; - - // Register glyph - stbtt_aligned_quad q; - float dummy_x = 0.0f, dummy_y = 0.0f; - stbtt_GetPackedQuad(src_tmp.PackedChars, atlas->TexWidth, atlas->TexHeight, glyph_i, &dummy_x, &dummy_y, &q, 0); - dst_font->AddGlyph((ImWchar)codepoint, q.x0 + char_off_x, q.y0 + font_off_y, q.x1 + char_off_x, q.y1 + font_off_y, q.s0, q.t0, q.s1, q.t1, char_advance_x_mod); - } - } - - // Cleanup temporary (ImVector doesn't honor destructor) - for (int src_i = 0; src_i < src_tmp_array.Size; src_i++) - src_tmp_array[src_i].~ImFontBuildSrcData(); - - ImFontAtlasBuildFinish(atlas); - return true; -} - -// Register default custom rectangles (this is called/shared by both the stb_truetype and the FreeType builder) -void ImFontAtlasBuildInit(ImFontAtlas* atlas) -{ - if (atlas->CustomRectIds[0] >= 0) - return; - if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors)) - atlas->CustomRectIds[0] = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_ID, FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF*2+1, FONT_ATLAS_DEFAULT_TEX_DATA_H); - else - atlas->CustomRectIds[0] = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_ID, 2, 2); -} - -void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent) -{ - if (!font_config->MergeMode) - { - font->ClearOutputData(); - font->FontSize = font_config->SizePixels; - font->ConfigData = font_config; - font->ContainerAtlas = atlas; - font->Ascent = ascent; - font->Descent = descent; - } - font->ConfigDataCount++; -} - -void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque) -{ - stbrp_context* pack_context = (stbrp_context*)stbrp_context_opaque; - IM_ASSERT(pack_context != NULL); - - ImVector& user_rects = atlas->CustomRects; - IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong. - - ImVector pack_rects; - pack_rects.resize(user_rects.Size); - memset(pack_rects.Data, 0, (size_t)pack_rects.size_in_bytes()); - for (int i = 0; i < user_rects.Size; i++) - { - pack_rects[i].w = user_rects[i].Width; - pack_rects[i].h = user_rects[i].Height; - } - stbrp_pack_rects(pack_context, &pack_rects[0], pack_rects.Size); - for (int i = 0; i < pack_rects.Size; i++) - if (pack_rects[i].was_packed) - { - user_rects[i].X = pack_rects[i].x; - user_rects[i].Y = pack_rects[i].y; - IM_ASSERT(pack_rects[i].w == user_rects[i].Width && pack_rects[i].h == user_rects[i].Height); - atlas->TexHeight = ImMax(atlas->TexHeight, pack_rects[i].y + pack_rects[i].h); - } -} - -static void ImFontAtlasBuildRenderDefaultTexData(ImFontAtlas* atlas) -{ - IM_ASSERT(atlas->CustomRectIds[0] >= 0); - IM_ASSERT(atlas->TexPixelsAlpha8 != NULL); - ImFontAtlasCustomRect& r = atlas->CustomRects[atlas->CustomRectIds[0]]; - IM_ASSERT(r.ID == FONT_ATLAS_DEFAULT_TEX_DATA_ID); - IM_ASSERT(r.IsPacked()); - - const int w = atlas->TexWidth; - if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors)) - { - // Render/copy pixels - IM_ASSERT(r.Width == FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF * 2 + 1 && r.Height == FONT_ATLAS_DEFAULT_TEX_DATA_H); - for (int y = 0, n = 0; y < FONT_ATLAS_DEFAULT_TEX_DATA_H; y++) - for (int x = 0; x < FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF; x++, n++) - { - const int offset0 = (int)(r.X + x) + (int)(r.Y + y) * w; - const int offset1 = offset0 + FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF + 1; - atlas->TexPixelsAlpha8[offset0] = FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[n] == '.' ? 0xFF : 0x00; - atlas->TexPixelsAlpha8[offset1] = FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[n] == 'X' ? 0xFF : 0x00; - } - } - else - { - IM_ASSERT(r.Width == 2 && r.Height == 2); - const int offset = (int)(r.X) + (int)(r.Y) * w; - atlas->TexPixelsAlpha8[offset] = atlas->TexPixelsAlpha8[offset + 1] = atlas->TexPixelsAlpha8[offset + w] = atlas->TexPixelsAlpha8[offset + w + 1] = 0xFF; - } - atlas->TexUvWhitePixel = ImVec2((r.X + 0.5f) * atlas->TexUvScale.x, (r.Y + 0.5f) * atlas->TexUvScale.y); -} - -void ImFontAtlasBuildFinish(ImFontAtlas* atlas) -{ - // Render into our custom data block - ImFontAtlasBuildRenderDefaultTexData(atlas); - - // Register custom rectangle glyphs - for (int i = 0; i < atlas->CustomRects.Size; i++) - { - const ImFontAtlasCustomRect& r = atlas->CustomRects[i]; - if (r.Font == NULL || r.ID >= 0x110000) - continue; - - IM_ASSERT(r.Font->ContainerAtlas == atlas); - ImVec2 uv0, uv1; - atlas->CalcCustomRectUV(&r, &uv0, &uv1); - r.Font->AddGlyph((ImWchar)r.ID, r.GlyphOffset.x, r.GlyphOffset.y, r.GlyphOffset.x + r.Width, r.GlyphOffset.y + r.Height, uv0.x, uv0.y, uv1.x, uv1.y, r.GlyphAdvanceX); - } - - // Build all fonts lookup tables - for (int i = 0; i < atlas->Fonts.Size; i++) - if (atlas->Fonts[i]->DirtyLookupTables) - atlas->Fonts[i]->BuildLookupTable(); - - // Ellipsis character is required for rendering elided text. We prefer using U+2026 (horizontal ellipsis). - // However some old fonts may contain ellipsis at U+0085. Here we auto-detect most suitable ellipsis character. - // FIXME: Also note that 0x2026 is currently seldomly included in our font ranges. Because of this we are more likely to use three individual dots. - for (int i = 0; i < atlas->Fonts.size(); i++) - { - ImFont* font = atlas->Fonts[i]; - if (font->EllipsisChar != (ImWchar)-1) - continue; - const ImWchar ellipsis_variants[] = { (ImWchar)0x2026, (ImWchar)0x0085 }; - for (int j = 0; j < IM_ARRAYSIZE(ellipsis_variants); j++) - if (font->FindGlyphNoFallback(ellipsis_variants[j]) != NULL) // Verify glyph exists - { - font->EllipsisChar = ellipsis_variants[j]; - break; - } - } -} - -// Retrieve list of range (2 int per range, values are inclusive) -const ImWchar* ImFontAtlas::GetGlyphRangesDefault() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0, - }; - return &ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesKorean() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x3131, 0x3163, // Korean alphabets - 0xAC00, 0xD79D, // Korean characters - 0, - }; - return &ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesChineseFull() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x2000, 0x206F, // General Punctuation - 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana - 0x31F0, 0x31FF, // Katakana Phonetic Extensions - 0xFF00, 0xFFEF, // Half-width characters - 0x4e00, 0x9FAF, // CJK Ideograms - 0, - }; - return &ranges[0]; -} - -static void UnpackAccumulativeOffsetsIntoRanges(int base_codepoint, const short* accumulative_offsets, int accumulative_offsets_count, ImWchar* out_ranges) -{ - for (int n = 0; n < accumulative_offsets_count; n++, out_ranges += 2) - { - out_ranges[0] = out_ranges[1] = (ImWchar)(base_codepoint + accumulative_offsets[n]); - base_codepoint += accumulative_offsets[n]; - } - out_ranges[0] = 0; -} - -//------------------------------------------------------------------------- -// [SECTION] ImFontAtlas glyph ranges helpers -//------------------------------------------------------------------------- - -const ImWchar* ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon() -{ - // Store 2500 regularly used characters for Simplified Chinese. - // Sourced from https://zh.wiktionary.org/wiki/%E9%99%84%E5%BD%95:%E7%8E%B0%E4%BB%A3%E6%B1%89%E8%AF%AD%E5%B8%B8%E7%94%A8%E5%AD%97%E8%A1%A8 - // This table covers 97.97% of all characters used during the month in July, 1987. - // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters. - // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.) - static const short accumulative_offsets_from_0x4E00[] = - { - 0,1,2,4,1,1,1,1,2,1,3,2,1,2,2,1,1,1,1,1,5,2,1,2,3,3,3,2,2,4,1,1,1,2,1,5,2,3,1,2,1,2,1,1,2,1,1,2,2,1,4,1,1,1,1,5,10,1,2,19,2,1,2,1,2,1,2,1,2, - 1,5,1,6,3,2,1,2,2,1,1,1,4,8,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4,8,9,2,3,1,1,1,1,3,5,5,1,3,8,4,6, - 2,1,4,12,1,5,3,7,13,2,5,8,1,6,1,2,5,14,6,1,5,2,4,8,15,5,1,23,6,62,2,10,1,1,8,1,2,2,10,4,2,2,9,2,1,1,3,2,3,1,5,3,3,2,1,3,8,1,1,1,11,3,1,1,4, - 3,7,1,14,1,2,3,12,5,2,5,1,6,7,5,7,14,11,1,3,1,8,9,12,2,1,11,8,4,4,2,6,10,9,13,1,1,3,1,5,1,3,2,4,4,1,18,2,3,14,11,4,29,4,2,7,1,3,13,9,2,2,5, - 3,5,20,7,16,8,5,72,34,6,4,22,12,12,28,45,36,9,7,39,9,191,1,1,1,4,11,8,4,9,2,3,22,1,1,1,1,4,17,1,7,7,1,11,31,10,2,4,8,2,3,2,1,4,2,16,4,32,2, - 3,19,13,4,9,1,5,2,14,8,1,1,3,6,19,6,5,1,16,6,2,10,8,5,1,2,3,1,5,5,1,11,6,6,1,3,3,2,6,3,8,1,1,4,10,7,5,7,7,5,8,9,2,1,3,4,1,1,3,1,3,3,2,6,16, - 1,4,6,3,1,10,6,1,3,15,2,9,2,10,25,13,9,16,6,2,2,10,11,4,3,9,1,2,6,6,5,4,30,40,1,10,7,12,14,33,6,3,6,7,3,1,3,1,11,14,4,9,5,12,11,49,18,51,31, - 140,31,2,2,1,5,1,8,1,10,1,4,4,3,24,1,10,1,3,6,6,16,3,4,5,2,1,4,2,57,10,6,22,2,22,3,7,22,6,10,11,36,18,16,33,36,2,5,5,1,1,1,4,10,1,4,13,2,7, - 5,2,9,3,4,1,7,43,3,7,3,9,14,7,9,1,11,1,1,3,7,4,18,13,1,14,1,3,6,10,73,2,2,30,6,1,11,18,19,13,22,3,46,42,37,89,7,3,16,34,2,2,3,9,1,7,1,1,1,2, - 2,4,10,7,3,10,3,9,5,28,9,2,6,13,7,3,1,3,10,2,7,2,11,3,6,21,54,85,2,1,4,2,2,1,39,3,21,2,2,5,1,1,1,4,1,1,3,4,15,1,3,2,4,4,2,3,8,2,20,1,8,7,13, - 4,1,26,6,2,9,34,4,21,52,10,4,4,1,5,12,2,11,1,7,2,30,12,44,2,30,1,1,3,6,16,9,17,39,82,2,2,24,7,1,7,3,16,9,14,44,2,1,2,1,2,3,5,2,4,1,6,7,5,3, - 2,6,1,11,5,11,2,1,18,19,8,1,3,24,29,2,1,3,5,2,2,1,13,6,5,1,46,11,3,5,1,1,5,8,2,10,6,12,6,3,7,11,2,4,16,13,2,5,1,1,2,2,5,2,28,5,2,23,10,8,4, - 4,22,39,95,38,8,14,9,5,1,13,5,4,3,13,12,11,1,9,1,27,37,2,5,4,4,63,211,95,2,2,2,1,3,5,2,1,1,2,2,1,1,1,3,2,4,1,2,1,1,5,2,2,1,1,2,3,1,3,1,1,1, - 3,1,4,2,1,3,6,1,1,3,7,15,5,3,2,5,3,9,11,4,2,22,1,6,3,8,7,1,4,28,4,16,3,3,25,4,4,27,27,1,4,1,2,2,7,1,3,5,2,28,8,2,14,1,8,6,16,25,3,3,3,14,3, - 3,1,1,2,1,4,6,3,8,4,1,1,1,2,3,6,10,6,2,3,18,3,2,5,5,4,3,1,5,2,5,4,23,7,6,12,6,4,17,11,9,5,1,1,10,5,12,1,1,11,26,33,7,3,6,1,17,7,1,5,12,1,11, - 2,4,1,8,14,17,23,1,2,1,7,8,16,11,9,6,5,2,6,4,16,2,8,14,1,11,8,9,1,1,1,9,25,4,11,19,7,2,15,2,12,8,52,7,5,19,2,16,4,36,8,1,16,8,24,26,4,6,2,9, - 5,4,36,3,28,12,25,15,37,27,17,12,59,38,5,32,127,1,2,9,17,14,4,1,2,1,1,8,11,50,4,14,2,19,16,4,17,5,4,5,26,12,45,2,23,45,104,30,12,8,3,10,2,2, - 3,3,1,4,20,7,2,9,6,15,2,20,1,3,16,4,11,15,6,134,2,5,59,1,2,2,2,1,9,17,3,26,137,10,211,59,1,2,4,1,4,1,1,1,2,6,2,3,1,1,2,3,2,3,1,3,4,4,2,3,3, - 1,4,3,1,7,2,2,3,1,2,1,3,3,3,2,2,3,2,1,3,14,6,1,3,2,9,6,15,27,9,34,145,1,1,2,1,1,1,1,2,1,1,1,1,2,2,2,3,1,2,1,1,1,2,3,5,8,3,5,2,4,1,3,2,2,2,12, - 4,1,1,1,10,4,5,1,20,4,16,1,15,9,5,12,2,9,2,5,4,2,26,19,7,1,26,4,30,12,15,42,1,6,8,172,1,1,4,2,1,1,11,2,2,4,2,1,2,1,10,8,1,2,1,4,5,1,2,5,1,8, - 4,1,3,4,2,1,6,2,1,3,4,1,2,1,1,1,1,12,5,7,2,4,3,1,1,1,3,3,6,1,2,2,3,3,3,2,1,2,12,14,11,6,6,4,12,2,8,1,7,10,1,35,7,4,13,15,4,3,23,21,28,52,5, - 26,5,6,1,7,10,2,7,53,3,2,1,1,1,2,163,532,1,10,11,1,3,3,4,8,2,8,6,2,2,23,22,4,2,2,4,2,1,3,1,3,3,5,9,8,2,1,2,8,1,10,2,12,21,20,15,105,2,3,1,1, - 3,2,3,1,1,2,5,1,4,15,11,19,1,1,1,1,5,4,5,1,1,2,5,3,5,12,1,2,5,1,11,1,1,15,9,1,4,5,3,26,8,2,1,3,1,1,15,19,2,12,1,2,5,2,7,2,19,2,20,6,26,7,5, - 2,2,7,34,21,13,70,2,128,1,1,2,1,1,2,1,1,3,2,2,2,15,1,4,1,3,4,42,10,6,1,49,85,8,1,2,1,1,4,4,2,3,6,1,5,7,4,3,211,4,1,2,1,2,5,1,2,4,2,2,6,5,6, - 10,3,4,48,100,6,2,16,296,5,27,387,2,2,3,7,16,8,5,38,15,39,21,9,10,3,7,59,13,27,21,47,5,21,6 - }; - static ImWchar base_ranges[] = // not zero-terminated - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x2000, 0x206F, // General Punctuation - 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana - 0x31F0, 0x31FF, // Katakana Phonetic Extensions - 0xFF00, 0xFFEF // Half-width characters - }; - static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00) * 2 + 1] = { 0 }; - if (!full_ranges[0]) - { - memcpy(full_ranges, base_ranges, sizeof(base_ranges)); - UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges)); - } - return &full_ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesJapanese() -{ - // 1946 common ideograms code points for Japanese - // Sourced from http://theinstructionlimit.com/common-kanji-character-ranges-for-xna-spritefont-rendering - // FIXME: Source a list of the revised 2136 Joyo Kanji list from 2010 and rebuild this. - // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters. - // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.) - static const short accumulative_offsets_from_0x4E00[] = - { - 0,1,2,4,1,1,1,1,2,1,6,2,2,1,8,5,7,11,1,2,10,10,8,2,4,20,2,11,8,2,1,2,1,6,2,1,7,5,3,7,1,1,13,7,9,1,4,6,1,2,1,10,1,1,9,2,2,4,5,6,14,1,1,9,3,18, - 5,4,2,2,10,7,1,1,1,3,2,4,3,23,2,10,12,2,14,2,4,13,1,6,10,3,1,7,13,6,4,13,5,2,3,17,2,2,5,7,6,4,1,7,14,16,6,13,9,15,1,1,7,16,4,7,1,19,9,2,7,15, - 2,6,5,13,25,4,14,13,11,25,1,1,1,2,1,2,2,3,10,11,3,3,1,1,4,4,2,1,4,9,1,4,3,5,5,2,7,12,11,15,7,16,4,5,16,2,1,1,6,3,3,1,1,2,7,6,6,7,1,4,7,6,1,1, - 2,1,12,3,3,9,5,8,1,11,1,2,3,18,20,4,1,3,6,1,7,3,5,5,7,2,2,12,3,1,4,2,3,2,3,11,8,7,4,17,1,9,25,1,1,4,2,2,4,1,2,7,1,1,1,3,1,2,6,16,1,2,1,1,3,12, - 20,2,5,20,8,7,6,2,1,1,1,1,6,2,1,2,10,1,1,6,1,3,1,2,1,4,1,12,4,1,3,1,1,1,1,1,10,4,7,5,13,1,15,1,1,30,11,9,1,15,38,14,1,32,17,20,1,9,31,2,21,9, - 4,49,22,2,1,13,1,11,45,35,43,55,12,19,83,1,3,2,3,13,2,1,7,3,18,3,13,8,1,8,18,5,3,7,25,24,9,24,40,3,17,24,2,1,6,2,3,16,15,6,7,3,12,1,9,7,3,3, - 3,15,21,5,16,4,5,12,11,11,3,6,3,2,31,3,2,1,1,23,6,6,1,4,2,6,5,2,1,1,3,3,22,2,6,2,3,17,3,2,4,5,1,9,5,1,1,6,15,12,3,17,2,14,2,8,1,23,16,4,2,23, - 8,15,23,20,12,25,19,47,11,21,65,46,4,3,1,5,6,1,2,5,26,2,1,1,3,11,1,1,1,2,1,2,3,1,1,10,2,3,1,1,1,3,6,3,2,2,6,6,9,2,2,2,6,2,5,10,2,4,1,2,1,2,2, - 3,1,1,3,1,2,9,23,9,2,1,1,1,1,5,3,2,1,10,9,6,1,10,2,31,25,3,7,5,40,1,15,6,17,7,27,180,1,3,2,2,1,1,1,6,3,10,7,1,3,6,17,8,6,2,2,1,3,5,5,8,16,14, - 15,1,1,4,1,2,1,1,1,3,2,7,5,6,2,5,10,1,4,2,9,1,1,11,6,1,44,1,3,7,9,5,1,3,1,1,10,7,1,10,4,2,7,21,15,7,2,5,1,8,3,4,1,3,1,6,1,4,2,1,4,10,8,1,4,5, - 1,5,10,2,7,1,10,1,1,3,4,11,10,29,4,7,3,5,2,3,33,5,2,19,3,1,4,2,6,31,11,1,3,3,3,1,8,10,9,12,11,12,8,3,14,8,6,11,1,4,41,3,1,2,7,13,1,5,6,2,6,12, - 12,22,5,9,4,8,9,9,34,6,24,1,1,20,9,9,3,4,1,7,2,2,2,6,2,28,5,3,6,1,4,6,7,4,2,1,4,2,13,6,4,4,3,1,8,8,3,2,1,5,1,2,2,3,1,11,11,7,3,6,10,8,6,16,16, - 22,7,12,6,21,5,4,6,6,3,6,1,3,2,1,2,8,29,1,10,1,6,13,6,6,19,31,1,13,4,4,22,17,26,33,10,4,15,12,25,6,67,10,2,3,1,6,10,2,6,2,9,1,9,4,4,1,2,16,2, - 5,9,2,3,8,1,8,3,9,4,8,6,4,8,11,3,2,1,1,3,26,1,7,5,1,11,1,5,3,5,2,13,6,39,5,1,5,2,11,6,10,5,1,15,5,3,6,19,21,22,2,4,1,6,1,8,1,4,8,2,4,2,2,9,2, - 1,1,1,4,3,6,3,12,7,1,14,2,4,10,2,13,1,17,7,3,2,1,3,2,13,7,14,12,3,1,29,2,8,9,15,14,9,14,1,3,1,6,5,9,11,3,38,43,20,7,7,8,5,15,12,19,15,81,8,7, - 1,5,73,13,37,28,8,8,1,15,18,20,165,28,1,6,11,8,4,14,7,15,1,3,3,6,4,1,7,14,1,1,11,30,1,5,1,4,14,1,4,2,7,52,2,6,29,3,1,9,1,21,3,5,1,26,3,11,14, - 11,1,17,5,1,2,1,3,2,8,1,2,9,12,1,1,2,3,8,3,24,12,7,7,5,17,3,3,3,1,23,10,4,4,6,3,1,16,17,22,3,10,21,16,16,6,4,10,2,1,1,2,8,8,6,5,3,3,3,39,25, - 15,1,1,16,6,7,25,15,6,6,12,1,22,13,1,4,9,5,12,2,9,1,12,28,8,3,5,10,22,60,1,2,40,4,61,63,4,1,13,12,1,4,31,12,1,14,89,5,16,6,29,14,2,5,49,18,18, - 5,29,33,47,1,17,1,19,12,2,9,7,39,12,3,7,12,39,3,1,46,4,12,3,8,9,5,31,15,18,3,2,2,66,19,13,17,5,3,46,124,13,57,34,2,5,4,5,8,1,1,1,4,3,1,17,5, - 3,5,3,1,8,5,6,3,27,3,26,7,12,7,2,17,3,7,18,78,16,4,36,1,2,1,6,2,1,39,17,7,4,13,4,4,4,1,10,4,2,4,6,3,10,1,19,1,26,2,4,33,2,73,47,7,3,8,2,4,15, - 18,1,29,2,41,14,1,21,16,41,7,39,25,13,44,2,2,10,1,13,7,1,7,3,5,20,4,8,2,49,1,10,6,1,6,7,10,7,11,16,3,12,20,4,10,3,1,2,11,2,28,9,2,4,7,2,15,1, - 27,1,28,17,4,5,10,7,3,24,10,11,6,26,3,2,7,2,2,49,16,10,16,15,4,5,27,61,30,14,38,22,2,7,5,1,3,12,23,24,17,17,3,3,2,4,1,6,2,7,5,1,1,5,1,1,9,4, - 1,3,6,1,8,2,8,4,14,3,5,11,4,1,3,32,1,19,4,1,13,11,5,2,1,8,6,8,1,6,5,13,3,23,11,5,3,16,3,9,10,1,24,3,198,52,4,2,2,5,14,5,4,22,5,20,4,11,6,41, - 1,5,2,2,11,5,2,28,35,8,22,3,18,3,10,7,5,3,4,1,5,3,8,9,3,6,2,16,22,4,5,5,3,3,18,23,2,6,23,5,27,8,1,33,2,12,43,16,5,2,3,6,1,20,4,2,9,7,1,11,2, - 10,3,14,31,9,3,25,18,20,2,5,5,26,14,1,11,17,12,40,19,9,6,31,83,2,7,9,19,78,12,14,21,76,12,113,79,34,4,1,1,61,18,85,10,2,2,13,31,11,50,6,33,159, - 179,6,6,7,4,4,2,4,2,5,8,7,20,32,22,1,3,10,6,7,28,5,10,9,2,77,19,13,2,5,1,4,4,7,4,13,3,9,31,17,3,26,2,6,6,5,4,1,7,11,3,4,2,1,6,2,20,4,1,9,2,6, - 3,7,1,1,1,20,2,3,1,6,2,3,6,2,4,8,1,5,13,8,4,11,23,1,10,6,2,1,3,21,2,2,4,24,31,4,10,10,2,5,192,15,4,16,7,9,51,1,2,1,1,5,1,1,2,1,3,5,3,1,3,4,1, - 3,1,3,3,9,8,1,2,2,2,4,4,18,12,92,2,10,4,3,14,5,25,16,42,4,14,4,2,21,5,126,30,31,2,1,5,13,3,22,5,6,6,20,12,1,14,12,87,3,19,1,8,2,9,9,3,3,23,2, - 3,7,6,3,1,2,3,9,1,3,1,6,3,2,1,3,11,3,1,6,10,3,2,3,1,2,1,5,1,1,11,3,6,4,1,7,2,1,2,5,5,34,4,14,18,4,19,7,5,8,2,6,79,1,5,2,14,8,2,9,2,1,36,28,16, - 4,1,1,1,2,12,6,42,39,16,23,7,15,15,3,2,12,7,21,64,6,9,28,8,12,3,3,41,59,24,51,55,57,294,9,9,2,6,2,15,1,2,13,38,90,9,9,9,3,11,7,1,1,1,5,6,3,2, - 1,2,2,3,8,1,4,4,1,5,7,1,4,3,20,4,9,1,1,1,5,5,17,1,5,2,6,2,4,1,4,5,7,3,18,11,11,32,7,5,4,7,11,127,8,4,3,3,1,10,1,1,6,21,14,1,16,1,7,1,3,6,9,65, - 51,4,3,13,3,10,1,1,12,9,21,110,3,19,24,1,1,10,62,4,1,29,42,78,28,20,18,82,6,3,15,6,84,58,253,15,155,264,15,21,9,14,7,58,40,39, - }; - static ImWchar base_ranges[] = // not zero-terminated - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana - 0x31F0, 0x31FF, // Katakana Phonetic Extensions - 0xFF00, 0xFFEF // Half-width characters - }; - static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00)*2 + 1] = { 0 }; - if (!full_ranges[0]) - { - memcpy(full_ranges, base_ranges, sizeof(base_ranges)); - UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges)); - } - return &full_ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement - 0x2DE0, 0x2DFF, // Cyrillic Extended-A - 0xA640, 0xA69F, // Cyrillic Extended-B - 0, - }; - return &ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesThai() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin - 0x2010, 0x205E, // Punctuations - 0x0E00, 0x0E7F, // Thai - 0, - }; - return &ranges[0]; -} - -const ImWchar* ImFontAtlas::GetGlyphRangesVietnamese() -{ - static const ImWchar ranges[] = - { - 0x0020, 0x00FF, // Basic Latin - 0x0102, 0x0103, - 0x0110, 0x0111, - 0x0128, 0x0129, - 0x0168, 0x0169, - 0x01A0, 0x01A1, - 0x01AF, 0x01B0, - 0x1EA0, 0x1EF9, - 0, - }; - return &ranges[0]; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImFontGlyphRangesBuilder -//----------------------------------------------------------------------------- - -void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end) -{ - while (text_end ? (text < text_end) : *text) - { - unsigned int c = 0; - int c_len = ImTextCharFromUtf8(&c, text, text_end); - text += c_len; - if (c_len == 0) - break; - AddChar((ImWchar)c); - } -} - -void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges) -{ - for (; ranges[0]; ranges += 2) - for (ImWchar c = ranges[0]; c <= ranges[1]; c++) - AddChar(c); -} - -void ImFontGlyphRangesBuilder::BuildRanges(ImVector* out_ranges) -{ - const int max_codepoint = IM_UNICODE_CODEPOINT_MAX; - for (int n = 0; n <= max_codepoint; n++) - if (GetBit(n)) - { - out_ranges->push_back((ImWchar)n); - while (n < max_codepoint && GetBit(n + 1)) - n++; - out_ranges->push_back((ImWchar)n); - } - out_ranges->push_back(0); -} - -//----------------------------------------------------------------------------- -// [SECTION] ImFont -//----------------------------------------------------------------------------- - -ImFont::ImFont() -{ - FontSize = 0.0f; - FallbackAdvanceX = 0.0f; - FallbackChar = (ImWchar)'?'; - EllipsisChar = (ImWchar)-1; - DisplayOffset = ImVec2(0.0f, 0.0f); - FallbackGlyph = NULL; - ContainerAtlas = NULL; - ConfigData = NULL; - ConfigDataCount = 0; - DirtyLookupTables = false; - Scale = 1.0f; - Ascent = Descent = 0.0f; - MetricsTotalSurface = 0; - memset(Used4kPagesMap, 0, sizeof(Used4kPagesMap)); -} - -ImFont::~ImFont() -{ - ClearOutputData(); -} - -void ImFont::ClearOutputData() -{ - FontSize = 0.0f; - FallbackAdvanceX = 0.0f; - Glyphs.clear(); - IndexAdvanceX.clear(); - IndexLookup.clear(); - FallbackGlyph = NULL; - ContainerAtlas = NULL; - DirtyLookupTables = true; - Ascent = Descent = 0.0f; - MetricsTotalSurface = 0; -} - -void ImFont::BuildLookupTable() -{ - int max_codepoint = 0; - for (int i = 0; i != Glyphs.Size; i++) - max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint); - - // Build lookup table - IM_ASSERT(Glyphs.Size < 0xFFFF); // -1 is reserved - IndexAdvanceX.clear(); - IndexLookup.clear(); - DirtyLookupTables = false; - memset(Used4kPagesMap, 0, sizeof(Used4kPagesMap)); - GrowIndex(max_codepoint + 1); - for (int i = 0; i < Glyphs.Size; i++) - { - int codepoint = (int)Glyphs[i].Codepoint; - IndexAdvanceX[codepoint] = Glyphs[i].AdvanceX; - IndexLookup[codepoint] = (ImWchar)i; - - // Mark 4K page as used - const int page_n = codepoint / 4096; - Used4kPagesMap[page_n >> 3] |= 1 << (page_n & 7); - } - - // Create a glyph to handle TAB - // FIXME: Needs proper TAB handling but it needs to be contextualized (or we could arbitrary say that each string starts at "column 0" ?) - if (FindGlyph((ImWchar)' ')) - { - if (Glyphs.back().Codepoint != '\t') // So we can call this function multiple times (FIXME: Flaky) - Glyphs.resize(Glyphs.Size + 1); - ImFontGlyph& tab_glyph = Glyphs.back(); - tab_glyph = *FindGlyph((ImWchar)' '); - tab_glyph.Codepoint = '\t'; - tab_glyph.AdvanceX *= IM_TABSIZE; - IndexAdvanceX[(int)tab_glyph.Codepoint] = (float)tab_glyph.AdvanceX; - IndexLookup[(int)tab_glyph.Codepoint] = (ImWchar)(Glyphs.Size-1); - } - - // Mark special glyphs as not visible (note that AddGlyph already mark as non-visible glyphs with zero-size polygons) - SetGlyphVisible((ImWchar)' ', false); - SetGlyphVisible((ImWchar)'\t', false); - - // Setup fall-backs - FallbackGlyph = FindGlyphNoFallback(FallbackChar); - FallbackAdvanceX = FallbackGlyph ? FallbackGlyph->AdvanceX : 0.0f; - for (int i = 0; i < max_codepoint + 1; i++) - if (IndexAdvanceX[i] < 0.0f) - IndexAdvanceX[i] = FallbackAdvanceX; -} - -// API is designed this way to avoid exposing the 4K page size -// e.g. use with IsGlyphRangeUnused(0, 255) -bool ImFont::IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last) -{ - unsigned int page_begin = (c_begin / 4096); - unsigned int page_last = (c_last / 4096); - for (unsigned int page_n = page_begin; page_n <= page_last; page_n++) - if ((page_n >> 3) < sizeof(Used4kPagesMap)) - if (Used4kPagesMap[page_n >> 3] & (1 << (page_n & 7))) - return false; - return true; -} - -void ImFont::SetGlyphVisible(ImWchar c, bool visible) -{ - if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)c)) - glyph->Visible = visible ? 1 : 0; -} - -void ImFont::SetFallbackChar(ImWchar c) -{ - FallbackChar = c; - BuildLookupTable(); -} - -void ImFont::GrowIndex(int new_size) -{ - IM_ASSERT(IndexAdvanceX.Size == IndexLookup.Size); - if (new_size <= IndexLookup.Size) - return; - IndexAdvanceX.resize(new_size, -1.0f); - IndexLookup.resize(new_size, (ImWchar)-1); -} - -// x0/y0/x1/y1 are offset from the character upper-left layout position, in pixels. Therefore x0/y0 are often fairly close to zero. -// Not to be mistaken with texture coordinates, which are held by u0/v0/u1/v1 in normalized format (0.0..1.0 on each texture axis). -void ImFont::AddGlyph(ImWchar codepoint, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x) -{ - Glyphs.resize(Glyphs.Size + 1); - ImFontGlyph& glyph = Glyphs.back(); - glyph.Codepoint = (unsigned int)codepoint; - glyph.Visible = (x0 != x1) && (y0 != y1); - glyph.X0 = x0; - glyph.Y0 = y0; - glyph.X1 = x1; - glyph.Y1 = y1; - glyph.U0 = u0; - glyph.V0 = v0; - glyph.U1 = u1; - glyph.V1 = v1; - glyph.AdvanceX = advance_x + ConfigData->GlyphExtraSpacing.x; // Bake spacing into AdvanceX - - if (ConfigData->PixelSnapH) - glyph.AdvanceX = IM_ROUND(glyph.AdvanceX); - - // Compute rough surface usage metrics (+1 to account for average padding, +0.99 to round) - DirtyLookupTables = true; - MetricsTotalSurface += (int)((glyph.U1 - glyph.U0) * ContainerAtlas->TexWidth + 1.99f) * (int)((glyph.V1 - glyph.V0) * ContainerAtlas->TexHeight + 1.99f); -} - -void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst) -{ - IM_ASSERT(IndexLookup.Size > 0); // Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function. - unsigned int index_size = (unsigned int)IndexLookup.Size; - - if (dst < index_size && IndexLookup.Data[dst] == (ImWchar)-1 && !overwrite_dst) // 'dst' already exists - return; - if (src >= index_size && dst >= index_size) // both 'dst' and 'src' don't exist -> no-op - return; - - GrowIndex(dst + 1); - IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : (ImWchar)-1; - IndexAdvanceX[dst] = (src < index_size) ? IndexAdvanceX.Data[src] : 1.0f; -} - -const ImFontGlyph* ImFont::FindGlyph(ImWchar c) const -{ - if (c >= (size_t)IndexLookup.Size) - return FallbackGlyph; - const ImWchar i = IndexLookup.Data[c]; - if (i == (ImWchar)-1) - return FallbackGlyph; - return &Glyphs.Data[i]; -} - -const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const -{ - if (c >= (size_t)IndexLookup.Size) - return NULL; - const ImWchar i = IndexLookup.Data[c]; - if (i == (ImWchar)-1) - return NULL; - return &Glyphs.Data[i]; -} - -const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const -{ - // Simple word-wrapping for English, not full-featured. Please submit failing cases! - // FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.) - - // For references, possible wrap point marked with ^ - // "aaa bbb, ccc,ddd. eee fff. ggg!" - // ^ ^ ^ ^ ^__ ^ ^ - - // List of hardcoded separators: .,;!?'" - - // Skip extra blanks after a line returns (that includes not counting them in width computation) - // e.g. "Hello world" --> "Hello" "World" - - // Cut words that cannot possibly fit within one line. - // e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish" - - float line_width = 0.0f; - float word_width = 0.0f; - float blank_width = 0.0f; - wrap_width /= scale; // We work with unscaled widths to avoid scaling every characters - - const char* word_end = text; - const char* prev_word_end = NULL; - bool inside_word = true; - - const char* s = text; - while (s < text_end) - { - unsigned int c = (unsigned int)*s; - const char* next_s; - if (c < 0x80) - next_s = s + 1; - else - next_s = s + ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) - break; - - if (c < 32) - { - if (c == '\n') - { - line_width = word_width = blank_width = 0.0f; - inside_word = true; - s = next_s; - continue; - } - if (c == '\r') - { - s = next_s; - continue; - } - } - - const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX.Data[c] : FallbackAdvanceX); - if (ImCharIsBlankW(c)) - { - if (inside_word) - { - line_width += blank_width; - blank_width = 0.0f; - word_end = s; - } - blank_width += char_width; - inside_word = false; - } - else - { - word_width += char_width; - if (inside_word) - { - word_end = next_s; - } - else - { - prev_word_end = word_end; - line_width += word_width + blank_width; - word_width = blank_width = 0.0f; - } - - // Allow wrapping after punctuation. - inside_word = !(c == '.' || c == ',' || c == ';' || c == '!' || c == '?' || c == '\"'); - } - - // We ignore blank width at the end of the line (they can be skipped) - if (line_width + word_width > wrap_width) - { - // Words that cannot possibly fit within an entire line will be cut anywhere. - if (word_width < wrap_width) - s = prev_word_end ? prev_word_end : word_end; - break; - } - - s = next_s; - } - - return s; -} - -ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining) const -{ - if (!text_end) - text_end = text_begin + strlen(text_begin); // FIXME-OPT: Need to avoid this. - - const float line_height = size; - const float scale = size / FontSize; - - ImVec2 text_size = ImVec2(0,0); - float line_width = 0.0f; - - const bool word_wrap_enabled = (wrap_width > 0.0f); - const char* word_wrap_eol = NULL; - - const char* s = text_begin; - while (s < text_end) - { - if (word_wrap_enabled) - { - // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature. - if (!word_wrap_eol) - { - word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width); - if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity. - word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below - } - - if (s >= word_wrap_eol) - { - if (text_size.x < line_width) - text_size.x = line_width; - text_size.y += line_height; - line_width = 0.0f; - word_wrap_eol = NULL; - - // Wrapping skips upcoming blanks - while (s < text_end) - { - const char c = *s; - if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; } - } - continue; - } - } - - // Decode and advance source - const char* prev_s = s; - unsigned int c = (unsigned int)*s; - if (c < 0x80) - { - s += 1; - } - else - { - s += ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) // Malformed UTF-8? - break; - } - - if (c < 32) - { - if (c == '\n') - { - text_size.x = ImMax(text_size.x, line_width); - text_size.y += line_height; - line_width = 0.0f; - continue; - } - if (c == '\r') - continue; - } - - const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX.Data[c] : FallbackAdvanceX) * scale; - if (line_width + char_width >= max_width) - { - s = prev_s; - break; - } - - line_width += char_width; - } - - if (text_size.x < line_width) - text_size.x = line_width; - - if (line_width > 0 || text_size.y == 0.0f) - text_size.y += line_height; - - if (remaining) - *remaining = s; - - return text_size; -} - -void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const -{ - const ImFontGlyph* glyph = FindGlyph(c); - if (!glyph || !glyph->Visible) - return; - float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f; - pos.x = IM_FLOOR(pos.x + DisplayOffset.x); - pos.y = IM_FLOOR(pos.y + DisplayOffset.y); - draw_list->PrimReserve(6, 4); - draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col); -} - -void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const -{ - if (!text_end) - text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls. - - // Align to be pixel perfect - pos.x = IM_FLOOR(pos.x + DisplayOffset.x); - pos.y = IM_FLOOR(pos.y + DisplayOffset.y); - float x = pos.x; - float y = pos.y; - if (y > clip_rect.w) - return; - - const float scale = size / FontSize; - const float line_height = FontSize * scale; - const bool word_wrap_enabled = (wrap_width > 0.0f); - const char* word_wrap_eol = NULL; - - // Fast-forward to first visible line - const char* s = text_begin; - if (y + line_height < clip_rect.y && !word_wrap_enabled) - while (y + line_height < clip_rect.y && s < text_end) - { - s = (const char*)memchr(s, '\n', text_end - s); - s = s ? s + 1 : text_end; - y += line_height; - } - - // For large text, scan for the last visible line in order to avoid over-reserving in the call to PrimReserve() - // Note that very large horizontal line will still be affected by the issue (e.g. a one megabyte string buffer without a newline will likely crash atm) - if (text_end - s > 10000 && !word_wrap_enabled) - { - const char* s_end = s; - float y_end = y; - while (y_end < clip_rect.w && s_end < text_end) - { - s_end = (const char*)memchr(s_end, '\n', text_end - s_end); - s_end = s_end ? s_end + 1 : text_end; - y_end += line_height; - } - text_end = s_end; - } - if (s == text_end) - return; - - // Reserve vertices for remaining worse case (over-reserving is useful and easily amortized) - const int vtx_count_max = (int)(text_end - s) * 4; - const int idx_count_max = (int)(text_end - s) * 6; - const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max; - draw_list->PrimReserve(idx_count_max, vtx_count_max); - - ImDrawVert* vtx_write = draw_list->_VtxWritePtr; - ImDrawIdx* idx_write = draw_list->_IdxWritePtr; - unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx; - - while (s < text_end) - { - if (word_wrap_enabled) - { - // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature. - if (!word_wrap_eol) - { - word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x)); - if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity. - word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below - } - - if (s >= word_wrap_eol) - { - x = pos.x; - y += line_height; - word_wrap_eol = NULL; - - // Wrapping skips upcoming blanks - while (s < text_end) - { - const char c = *s; - if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; } - } - continue; - } - } - - // Decode and advance source - unsigned int c = (unsigned int)*s; - if (c < 0x80) - { - s += 1; - } - else - { - s += ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) // Malformed UTF-8? - break; - } - - if (c < 32) - { - if (c == '\n') - { - x = pos.x; - y += line_height; - if (y > clip_rect.w) - break; // break out of main loop - continue; - } - if (c == '\r') - continue; - } - - const ImFontGlyph* glyph = FindGlyph((ImWchar)c); - if (glyph == NULL) - continue; - - float char_width = glyph->AdvanceX * scale; - if (glyph->Visible) - { - // We don't do a second finer clipping test on the Y axis as we've already skipped anything before clip_rect.y and exit once we pass clip_rect.w - float x1 = x + glyph->X0 * scale; - float x2 = x + glyph->X1 * scale; - float y1 = y + glyph->Y0 * scale; - float y2 = y + glyph->Y1 * scale; - if (x1 <= clip_rect.z && x2 >= clip_rect.x) - { - // Render a character - float u1 = glyph->U0; - float v1 = glyph->V0; - float u2 = glyph->U1; - float v2 = glyph->V1; - - // CPU side clipping used to fit text in their frame when the frame is too small. Only does clipping for axis aligned quads. - if (cpu_fine_clip) - { - if (x1 < clip_rect.x) - { - u1 = u1 + (1.0f - (x2 - clip_rect.x) / (x2 - x1)) * (u2 - u1); - x1 = clip_rect.x; - } - if (y1 < clip_rect.y) - { - v1 = v1 + (1.0f - (y2 - clip_rect.y) / (y2 - y1)) * (v2 - v1); - y1 = clip_rect.y; - } - if (x2 > clip_rect.z) - { - u2 = u1 + ((clip_rect.z - x1) / (x2 - x1)) * (u2 - u1); - x2 = clip_rect.z; - } - if (y2 > clip_rect.w) - { - v2 = v1 + ((clip_rect.w - y1) / (y2 - y1)) * (v2 - v1); - y2 = clip_rect.w; - } - if (y1 >= y2) - { - x += char_width; - continue; - } - } - - // We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here: - { - idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2); - idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3); - vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1; - vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1; - vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2; - vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2; - vtx_write += 4; - vtx_current_idx += 4; - idx_write += 6; - } - } - } - x += char_width; - } - - // Give back unused vertices (clipped ones, blanks) ~ this is essentially a PrimUnreserve() action. - draw_list->VtxBuffer.Size = (int)(vtx_write - draw_list->VtxBuffer.Data); // Same as calling shrink() - draw_list->IdxBuffer.Size = (int)(idx_write - draw_list->IdxBuffer.Data); - draw_list->CmdBuffer[draw_list->CmdBuffer.Size-1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size); - draw_list->_VtxWritePtr = vtx_write; - draw_list->_IdxWritePtr = idx_write; - draw_list->_VtxCurrentIdx = vtx_current_idx; -} - -//----------------------------------------------------------------------------- -// [SECTION] ImGui Internal Render Helpers -//----------------------------------------------------------------------------- -// Vaguely redesigned to stop accessing ImGui global state: -// - RenderArrow() -// - RenderBullet() -// - RenderCheckMark() -// - RenderMouseCursor() -// - RenderArrowPointingAt() -// - RenderRectFilledRangeH() -//----------------------------------------------------------------------------- -// Function in need of a redesign (legacy mess) -// - RenderColorRectWithAlphaCheckerboard() -//----------------------------------------------------------------------------- - -// Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state -void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale) -{ - const float h = draw_list->_Data->FontSize * 1.00f; - float r = h * 0.40f * scale; - ImVec2 center = pos + ImVec2(h * 0.50f, h * 0.50f * scale); - - ImVec2 a, b, c; - switch (dir) - { - case ImGuiDir_Up: - case ImGuiDir_Down: - if (dir == ImGuiDir_Up) r = -r; - a = ImVec2(+0.000f, +0.750f) * r; - b = ImVec2(-0.866f, -0.750f) * r; - c = ImVec2(+0.866f, -0.750f) * r; - break; - case ImGuiDir_Left: - case ImGuiDir_Right: - if (dir == ImGuiDir_Left) r = -r; - a = ImVec2(+0.750f, +0.000f) * r; - b = ImVec2(-0.750f, +0.866f) * r; - c = ImVec2(-0.750f, -0.866f) * r; - break; - case ImGuiDir_None: - case ImGuiDir_COUNT: - IM_ASSERT(0); - break; - } - draw_list->AddTriangleFilled(center + a, center + b, center + c, col); -} - -void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col) -{ - draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8); -} - -void ImGui::RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz) -{ - float thickness = ImMax(sz / 5.0f, 1.0f); - sz -= thickness * 0.5f; - pos += ImVec2(thickness * 0.25f, thickness * 0.25f); - - float third = sz / 3.0f; - float bx = pos.x + third; - float by = pos.y + sz - third * 0.5f; - draw_list->PathLineTo(ImVec2(bx - third, by - third)); - draw_list->PathLineTo(ImVec2(bx, by)); - draw_list->PathLineTo(ImVec2(bx + third * 2.0f, by - third * 2.0f)); - draw_list->PathStroke(col, false, thickness); -} - -void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow) -{ - if (mouse_cursor == ImGuiMouseCursor_None) - return; - IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT); - - ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas; - ImVec2 offset, size, uv[4]; - if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2])) - { - pos -= offset; - const ImTextureID tex_id = font_atlas->TexID; - draw_list->PushTextureID(tex_id); - draw_list->AddImage(tex_id, pos + ImVec2(1,0)*scale, pos + ImVec2(1,0)*scale + size*scale, uv[2], uv[3], col_shadow); - draw_list->AddImage(tex_id, pos + ImVec2(2,0)*scale, pos + ImVec2(2,0)*scale + size*scale, uv[2], uv[3], col_shadow); - draw_list->AddImage(tex_id, pos, pos + size*scale, uv[2], uv[3], col_border); - draw_list->AddImage(tex_id, pos, pos + size*scale, uv[0], uv[1], col_fill); - draw_list->PopTextureID(); - } -} - -// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side. -void ImGui::RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col) -{ - switch (direction) - { - case ImGuiDir_Left: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), pos, col); return; - case ImGuiDir_Right: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), pos, col); return; - case ImGuiDir_Up: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), pos, col); return; - case ImGuiDir_Down: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), pos, col); return; - case ImGuiDir_None: case ImGuiDir_COUNT: break; // Fix warnings - } -} - -static inline float ImAcos01(float x) -{ - if (x <= 0.0f) return IM_PI * 0.5f; - if (x >= 1.0f) return 0.0f; - return ImAcos(x); - //return (-0.69813170079773212f * x * x - 0.87266462599716477f) * x + 1.5707963267948966f; // Cheap approximation, may be enough for what we do. -} - -// FIXME: Cleanup and move code to ImDrawList. -void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding) -{ - if (x_end_norm == x_start_norm) - return; - if (x_start_norm > x_end_norm) - ImSwap(x_start_norm, x_end_norm); - - ImVec2 p0 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_start_norm), rect.Min.y); - ImVec2 p1 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_end_norm), rect.Max.y); - if (rounding == 0.0f) - { - draw_list->AddRectFilled(p0, p1, col, 0.0f); - return; - } - - rounding = ImClamp(ImMin((rect.Max.x - rect.Min.x) * 0.5f, (rect.Max.y - rect.Min.y) * 0.5f) - 1.0f, 0.0f, rounding); - const float inv_rounding = 1.0f / rounding; - const float arc0_b = ImAcos01(1.0f - (p0.x - rect.Min.x) * inv_rounding); - const float arc0_e = ImAcos01(1.0f - (p1.x - rect.Min.x) * inv_rounding); - const float half_pi = IM_PI * 0.5f; // We will == compare to this because we know this is the exact value ImAcos01 can return. - const float x0 = ImMax(p0.x, rect.Min.x + rounding); - if (arc0_b == arc0_e) - { - draw_list->PathLineTo(ImVec2(x0, p1.y)); - draw_list->PathLineTo(ImVec2(x0, p0.y)); - } - else if (arc0_b == 0.0f && arc0_e == half_pi) - { - draw_list->PathArcToFast(ImVec2(x0, p1.y - rounding), rounding, 3, 6); // BL - draw_list->PathArcToFast(ImVec2(x0, p0.y + rounding), rounding, 6, 9); // TR - } - else - { - draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b, 3); // BL - draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e, 3); // TR - } - if (p1.x > rect.Min.x + rounding) - { - const float arc1_b = ImAcos01(1.0f - (rect.Max.x - p1.x) * inv_rounding); - const float arc1_e = ImAcos01(1.0f - (rect.Max.x - p0.x) * inv_rounding); - const float x1 = ImMin(p1.x, rect.Max.x - rounding); - if (arc1_b == arc1_e) - { - draw_list->PathLineTo(ImVec2(x1, p0.y)); - draw_list->PathLineTo(ImVec2(x1, p1.y)); - } - else if (arc1_b == 0.0f && arc1_e == half_pi) - { - draw_list->PathArcToFast(ImVec2(x1, p0.y + rounding), rounding, 9, 12); // TR - draw_list->PathArcToFast(ImVec2(x1, p1.y - rounding), rounding, 0, 3); // BR - } - else - { - draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b, 3); // TR - draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e, 3); // BR - } - } - draw_list->PathFillConvex(col); -} - -// Helper for ColorPicker4() -// NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that. -// Spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding alltogether. -// FIXME: uses ImGui::GetColorU32 -void ImGui::RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 col, float grid_step, ImVec2 grid_off, float rounding, int rounding_corners_flags) -{ - if (((col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT) < 0xFF) - { - ImU32 col_bg1 = ImGui::GetColorU32(ImAlphaBlendColors(IM_COL32(204, 204, 204, 255), col)); - ImU32 col_bg2 = ImGui::GetColorU32(ImAlphaBlendColors(IM_COL32(128, 128, 128, 255), col)); - draw_list->AddRectFilled(p_min, p_max, col_bg1, rounding, rounding_corners_flags); - - int yi = 0; - for (float y = p_min.y + grid_off.y; y < p_max.y; y += grid_step, yi++) - { - float y1 = ImClamp(y, p_min.y, p_max.y), y2 = ImMin(y + grid_step, p_max.y); - if (y2 <= y1) - continue; - for (float x = p_min.x + grid_off.x + (yi & 1) * grid_step; x < p_max.x; x += grid_step * 2.0f) - { - float x1 = ImClamp(x, p_min.x, p_max.x), x2 = ImMin(x + grid_step, p_max.x); - if (x2 <= x1) - continue; - int rounding_corners_flags_cell = 0; - if (y1 <= p_min.y) { if (x1 <= p_min.x) rounding_corners_flags_cell |= ImDrawCornerFlags_TopLeft; if (x2 >= p_max.x) rounding_corners_flags_cell |= ImDrawCornerFlags_TopRight; } - if (y2 >= p_max.y) { if (x1 <= p_min.x) rounding_corners_flags_cell |= ImDrawCornerFlags_BotLeft; if (x2 >= p_max.x) rounding_corners_flags_cell |= ImDrawCornerFlags_BotRight; } - rounding_corners_flags_cell &= rounding_corners_flags; - draw_list->AddRectFilled(ImVec2(x1, y1), ImVec2(x2, y2), col_bg2, rounding_corners_flags_cell ? rounding : 0.0f, rounding_corners_flags_cell); - } - } - } - else - { - draw_list->AddRectFilled(p_min, p_max, col, rounding, rounding_corners_flags); - } -} - -//----------------------------------------------------------------------------- -// [SECTION] Decompression code -//----------------------------------------------------------------------------- -// Compressed with stb_compress() then converted to a C array and encoded as base85. -// Use the program in misc/fonts/binary_to_compressed_c.cpp to create the array from a TTF file. -// The purpose of encoding as base85 instead of "0x00,0x01,..." style is only save on _source code_ size. -// Decompression from stb.h (public domain) by Sean Barrett https://github.com/nothings/stb/blob/master/stb.h -//----------------------------------------------------------------------------- - -static unsigned int stb_decompress_length(const unsigned char *input) -{ - return (input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]; -} - -static unsigned char *stb__barrier_out_e, *stb__barrier_out_b; -static const unsigned char *stb__barrier_in_b; -static unsigned char *stb__dout; -static void stb__match(const unsigned char *data, unsigned int length) -{ - // INVERSE of memmove... write each byte before copying the next... - IM_ASSERT(stb__dout + length <= stb__barrier_out_e); - if (stb__dout + length > stb__barrier_out_e) { stb__dout += length; return; } - if (data < stb__barrier_out_b) { stb__dout = stb__barrier_out_e+1; return; } - while (length--) *stb__dout++ = *data++; -} - -static void stb__lit(const unsigned char *data, unsigned int length) -{ - IM_ASSERT(stb__dout + length <= stb__barrier_out_e); - if (stb__dout + length > stb__barrier_out_e) { stb__dout += length; return; } - if (data < stb__barrier_in_b) { stb__dout = stb__barrier_out_e+1; return; } - memcpy(stb__dout, data, length); - stb__dout += length; -} - -#define stb__in2(x) ((i[x] << 8) + i[(x)+1]) -#define stb__in3(x) ((i[x] << 16) + stb__in2((x)+1)) -#define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1)) - -static const unsigned char *stb_decompress_token(const unsigned char *i) -{ - if (*i >= 0x20) { // use fewer if's for cases that expand small - if (*i >= 0x80) stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2; - else if (*i >= 0x40) stb__match(stb__dout-(stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3; - else /* *i >= 0x20 */ stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1); - } else { // more ifs for cases that expand large, since overhead is amortized - if (*i >= 0x18) stb__match(stb__dout-(stb__in3(0) - 0x180000 + 1), i[3]+1), i += 4; - else if (*i >= 0x10) stb__match(stb__dout-(stb__in3(0) - 0x100000 + 1), stb__in2(3)+1), i += 5; - else if (*i >= 0x08) stb__lit(i+2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1); - else if (*i == 0x07) stb__lit(i+3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1); - else if (*i == 0x06) stb__match(stb__dout-(stb__in3(1)+1), i[4]+1), i += 5; - else if (*i == 0x04) stb__match(stb__dout-(stb__in3(1)+1), stb__in2(4)+1), i += 6; - } - return i; -} - -static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen) -{ - const unsigned long ADLER_MOD = 65521; - unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16; - unsigned long blocklen = buflen % 5552; - - unsigned long i; - while (buflen) { - for (i=0; i + 7 < blocklen; i += 8) { - s1 += buffer[0], s2 += s1; - s1 += buffer[1], s2 += s1; - s1 += buffer[2], s2 += s1; - s1 += buffer[3], s2 += s1; - s1 += buffer[4], s2 += s1; - s1 += buffer[5], s2 += s1; - s1 += buffer[6], s2 += s1; - s1 += buffer[7], s2 += s1; - - buffer += 8; - } - - for (; i < blocklen; ++i) - s1 += *buffer++, s2 += s1; - - s1 %= ADLER_MOD, s2 %= ADLER_MOD; - buflen -= blocklen; - blocklen = 5552; - } - return (unsigned int)(s2 << 16) + (unsigned int)s1; -} - -static unsigned int stb_decompress(unsigned char *output, const unsigned char *i, unsigned int /*length*/) -{ - if (stb__in4(0) != 0x57bC0000) return 0; - if (stb__in4(4) != 0) return 0; // error! stream is > 4GB - const unsigned int olen = stb_decompress_length(i); - stb__barrier_in_b = i; - stb__barrier_out_e = output + olen; - stb__barrier_out_b = output; - i += 16; - - stb__dout = output; - for (;;) { - const unsigned char *old_i = i; - i = stb_decompress_token(i); - if (i == old_i) { - if (*i == 0x05 && i[1] == 0xfa) { - IM_ASSERT(stb__dout == output + olen); - if (stb__dout != output + olen) return 0; - if (stb_adler32(1, output, olen) != (unsigned int) stb__in4(2)) - return 0; - return olen; - } else { - IM_ASSERT(0); /* NOTREACHED */ - return 0; - } - } - IM_ASSERT(stb__dout <= output + olen); - if (stb__dout > output + olen) - return 0; - } -} - -//----------------------------------------------------------------------------- -// [SECTION] Default font data (ProggyClean.ttf) -//----------------------------------------------------------------------------- -// ProggyClean.ttf -// Copyright (c) 2004, 2005 Tristan Grimmer -// MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip) -// Download and more information at http://upperbounds.net -//----------------------------------------------------------------------------- -// File: 'ProggyClean.ttf' (41208 bytes) -// Exported using misc/fonts/binary_to_compressed_c.cpp (with compression + base85 string encoding). -// The purpose of encoding as base85 instead of "0x00,0x01,..." style is only save on _source code_ size. -//----------------------------------------------------------------------------- -static const char proggy_clean_ttf_compressed_data_base85[11980+1] = - "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/" - "2*>]b(MC;$jPfY.;h^`IWM9Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1=Ke$$'5F%)]0^#0X@U.a$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;--VsM.M0rJfLH2eTM`*oJMHRC`N" - "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`�j@'DbG&#^$PG.Ll+DNa&VZ>1i%h1S9u5o@YaaW$e+bROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc." - "x]Ip.PH^'/aqUO/$1WxLoW0[iLAw=4h(9.`G" - "CR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N?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP" - "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp" - "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#"; - -static const char* GetDefaultCompressedFontDataTTFBase85() -{ - return proggy_clean_ttf_compressed_data_base85; -} - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imgui_internal.h b/include/imgui/imgui_internal.h deleted file mode 100644 index cef0f9a9..00000000 --- a/include/imgui/imgui_internal.h +++ /dev/null @@ -1,1955 +0,0 @@ -// dear imgui, v1.76 -// (internal structures/api) - -// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! -// Set: -// #define IMGUI_DEFINE_MATH_OPERATORS -// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators) - -/* - -Index of this file: -// Header mess -// Forward declarations -// STB libraries includes -// Context pointer -// Generic helpers -// Misc data structures -// Main imgui context -// Tab bar, tab item -// Internal API - -*/ - -#pragma once -#ifndef IMGUI_DISABLE - -//----------------------------------------------------------------------------- -// Header mess -//----------------------------------------------------------------------------- - -#ifndef IMGUI_VERSION -#error Must include imgui.h before imgui_internal.h -#endif - -#include // FILE*, sscanf -#include // NULL, malloc, free, qsort, atoi, atof -#include // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf -#include // INT_MIN, INT_MAX - -// Visual Studio warnings -#ifdef _MSC_VER -#pragma warning (push) -#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) -#endif - -// Clang/GCC warnings with -Weverything -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h -#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h -#pragma clang diagnostic ignored "-Wold-style-cast" -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" -#endif -#if __has_warning("-Wdouble-promotion") -#pragma clang diagnostic ignored "-Wdouble-promotion" -#endif -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead -#endif - -// Legacy defines -#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74 -#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS -#endif -#ifdef IMGUI_DISABLE_MATH_FUNCTIONS // Renamed in 1.74 -#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS -#endif - -//----------------------------------------------------------------------------- -// Forward declarations -//----------------------------------------------------------------------------- - -struct ImBitVector; // Store 1-bit per value -struct ImRect; // An axis-aligned rectangle (2 points) -struct ImDrawDataBuilder; // Helper to build a ImDrawData instance -struct ImDrawListSharedData; // Data shared between all ImDrawList instances -struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it -struct ImGuiColumnData; // Storage data for a single column -struct ImGuiColumns; // Storage data for a columns set -struct ImGuiContext; // Main Dear ImGui context -struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum -struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup() -struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box -struct ImGuiItemHoveredDataBackup; // Backup and restore IsItemHovered() internal data -struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only -struct ImGuiNavMoveResult; // Result of a gamepad/keyboard directional navigation move query result -struct ImGuiNextWindowData; // Storage for SetNextWindow** functions -struct ImGuiNextItemData; // Storage for SetNextItem** functions -struct ImGuiPopupData; // Storage for current popup stack -struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file -struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it -struct ImGuiTabBar; // Storage for a tab bar -struct ImGuiTabItem; // Storage for a tab item (within a tab bar) -struct ImGuiWindow; // Storage for one window -struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame) -struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session) - -// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists. -typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical -typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: for ButtonEx(), ButtonBehavior() -typedef int ImGuiColumnsFlags; // -> enum ImGuiColumnsFlags_ // Flags: BeginColumns() -typedef int ImGuiDragFlags; // -> enum ImGuiDragFlags_ // Flags: for DragBehavior() -typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag() -typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags -typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight() -typedef int ImGuiNavDirSourceFlags; // -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d() -typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests -typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions -typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions -typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx() -typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for SliderBehavior() -typedef int ImGuiTextFlags; // -> enum ImGuiTextFlags_ // Flags: for TextEx() -typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx() - -//------------------------------------------------------------------------- -// STB libraries includes -//------------------------------------------------------------------------- - -namespace ImStb -{ - -#undef STB_TEXTEDIT_STRING -#undef STB_TEXTEDIT_CHARTYPE -#define STB_TEXTEDIT_STRING ImGuiInputTextState -#define STB_TEXTEDIT_CHARTYPE ImWchar -#define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f -#define STB_TEXTEDIT_UNDOSTATECOUNT 99 -#define STB_TEXTEDIT_UNDOCHARCOUNT 999 -#include "imstb_textedit.h" - -} // namespace ImStb - -//----------------------------------------------------------------------------- -// Context pointer -//----------------------------------------------------------------------------- - -#ifndef GImGui -extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer -#endif - -//----------------------------------------------------------------------------- -// Macros -//----------------------------------------------------------------------------- - -// Debug Logging -#ifndef IMGUI_DEBUG_LOG -#define IMGUI_DEBUG_LOG(_FMT,...) printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__) -#endif - -// Static Asserts -#if (__cplusplus >= 201100) -#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "") -#else -#define IM_STATIC_ASSERT(_COND) typedef char static_assertion_##__line__[(_COND)?1:-1] -#endif - -// "Paranoid" Debug Asserts are meant to only be enabled during specific debugging/work, otherwise would slow down the code too much. -// We currently don't have many of those so the effect is currently negligible, but onward intent to add more aggressive ones in the code. -//#define IMGUI_DEBUG_PARANOID -#ifdef IMGUI_DEBUG_PARANOID -#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR) -#else -#define IM_ASSERT_PARANOID(_EXPR) -#endif - -// Error handling -// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults. -#ifndef IM_ASSERT_USER_ERROR -#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error -#endif - -// Misc Macros -#define IM_PI 3.14159265358979323846f -#ifdef _WIN32 -#define IM_NEWLINE "\r\n" // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!) -#else -#define IM_NEWLINE "\n" -#endif -#define IM_TABSIZE (4) -#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose -#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 -#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds -#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // - -// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall -#ifdef _MSC_VER -#define IMGUI_CDECL __cdecl -#else -#define IMGUI_CDECL -#endif - -//----------------------------------------------------------------------------- -// Generic helpers -// Note that the ImXXX helpers functions are lower-level than ImGui functions. -// ImGui functions or the ImGui context are never called/used from other ImXXX functions. -//----------------------------------------------------------------------------- -// - Helpers: Misc -// - Helpers: Bit manipulation -// - Helpers: String, Formatting -// - Helpers: UTF-8 <> wchar conversions -// - Helpers: ImVec2/ImVec4 operators -// - Helpers: Maths -// - Helpers: Geometry -// - Helpers: Bit arrays -// - Helper: ImBitVector -// - Helper: ImPool<> -// - Helper: ImChunkStream<> -//----------------------------------------------------------------------------- - -// Helpers: Misc -#define ImQsort qsort -IMGUI_API ImU32 ImHashData(const void* data, size_t data_size, ImU32 seed = 0); -IMGUI_API ImU32 ImHashStr(const char* data, size_t data_size = 0, ImU32 seed = 0); -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS -static inline ImU32 ImHash(const void* data, int size, ImU32 seed = 0) { return size ? ImHashData(data, (size_t)size, seed) : ImHashStr((const char*)data, 0, seed); } // [moved to ImHashStr/ImHashData in 1.68] -#endif - -// Helpers: Color Blending -IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b); - -// Helpers: Bit manipulation -static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; } -static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; } - -// Helpers: String, Formatting -IMGUI_API int ImStricmp(const char* str1, const char* str2); -IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); -IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); -IMGUI_API char* ImStrdup(const char* str); -IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str); -IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); -IMGUI_API int ImStrlenW(const ImWchar* str); -IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line -IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line -IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); -IMGUI_API void ImStrTrimBlanks(char* str); -IMGUI_API const char* ImStrSkipBlank(const char* str); -IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3); -IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3); -IMGUI_API const char* ImParseFormatFindStart(const char* format); -IMGUI_API const char* ImParseFormatFindEnd(const char* format); -IMGUI_API const char* ImParseFormatTrimDecorations(const char* format, char* buf, size_t buf_size); -IMGUI_API int ImParseFormatPrecision(const char* format, int default_value); -static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; } -static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; } - -// Helpers: UTF-8 <> wchar conversions -IMGUI_API int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count -IMGUI_API int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // read one character. return input UTF-8 bytes count -IMGUI_API int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count -IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count) -IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8 -IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8 - -// Helpers: ImVec2/ImVec4 operators -// We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.) -// We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself. -#ifdef IMGUI_DEFINE_MATH_OPERATORS -static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x*rhs, lhs.y*rhs); } -static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x/rhs, lhs.y/rhs); } -static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); } -static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); } -static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); } -static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); } -static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; } -static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; } -static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; } -static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; } -static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; } -static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; } -static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z, lhs.w+rhs.w); } -static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z, lhs.w-rhs.w); } -static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); } -#endif - -// Helpers: File System -#ifdef IMGUI_DISABLE_FILE_FUNCTIONS -#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS -typedef void* ImFileHandle; -static inline ImFileHandle ImFileOpen(const char*, const char*) { return NULL; } -static inline bool ImFileClose(ImFileHandle) { return false; } -static inline ImU64 ImFileGetSize(ImFileHandle) { return (ImU64)-1; } -static inline ImU64 ImFileRead(void*, ImU64, ImU64, ImFileHandle) { return 0; } -static inline ImU64 ImFileWrite(const void*, ImU64, ImU64, ImFileHandle) { return 0; } -#endif - -#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS -typedef FILE* ImFileHandle; -IMGUI_API ImFileHandle ImFileOpen(const char* filename, const char* mode); -IMGUI_API bool ImFileClose(ImFileHandle file); -IMGUI_API ImU64 ImFileGetSize(ImFileHandle file); -IMGUI_API ImU64 ImFileRead(void* data, ImU64 size, ImU64 count, ImFileHandle file); -IMGUI_API ImU64 ImFileWrite(const void* data, ImU64 size, ImU64 count, ImFileHandle file); -#else -#define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions -#endif -IMGUI_API void* ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_file_size = NULL, int padding_bytes = 0); - -// Helpers: Maths -// - Wrapper for standard libs functions. (Note that imgui_demo.cpp does _not_ use them to keep the code easy to copy) -#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS -#define ImFabs(X) fabsf(X) -#define ImSqrt(X) sqrtf(X) -#define ImFmod(X, Y) fmodf((X), (Y)) -#define ImCos(X) cosf(X) -#define ImSin(X) sinf(X) -#define ImAcos(X) acosf(X) -#define ImAtan2(Y, X) atan2f((Y), (X)) -#define ImAtof(STR) atof(STR) -#define ImFloorStd(X) floorf(X) // We already uses our own ImFloor() { return (float)(int)v } internally so the standard one wrapper is named differently (it's used by e.g. stb_truetype) -#define ImCeil(X) ceilf(X) -static inline float ImPow(float x, float y) { return powf(x, y); } // DragBehaviorT/SliderBehaviorT uses ImPow with either float/double and need the precision -static inline double ImPow(double x, double y) { return pow(x, y); } -#endif -// - ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support variety of types: signed/unsigned int/long long float/double -// (Exceptionally using templates here but we could also redefine them for those types) -template static inline T ImMin(T lhs, T rhs) { return lhs < rhs ? lhs : rhs; } -template static inline T ImMax(T lhs, T rhs) { return lhs >= rhs ? lhs : rhs; } -template static inline T ImClamp(T v, T mn, T mx) { return (v < mn) ? mn : (v > mx) ? mx : v; } -template static inline T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); } -template static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; } -template static inline T ImAddClampOverflow(T a, T b, T mn, T mx) { if (b < 0 && (a < mn - b)) return mn; if (b > 0 && (a > mx - b)) return mx; return a + b; } -template static inline T ImSubClampOverflow(T a, T b, T mn, T mx) { if (b > 0 && (a < mn + b)) return mn; if (b < 0 && (a > mx + b)) return mx; return a - b; } -// - Misc maths helpers -static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); } -static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); } -static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); } -static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); } -static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); } -static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); } -static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; } -static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; } -static inline float ImLengthSqr(const ImVec4& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y + lhs.z*lhs.z + lhs.w*lhs.w; } -static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = lhs.x*lhs.x + lhs.y*lhs.y; if (d > 0.0f) return 1.0f / ImSqrt(d); return fail_value; } -static inline float ImFloor(float f) { return (float)(int)(f); } -static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); } -static inline int ImModPositive(int a, int b) { return (a + b) % b; } -static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; } -static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); } -static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; } -static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } - -// Helpers: Geometry -IMGUI_API ImVec2 ImBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t); // Cubic Bezier -IMGUI_API ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments); // For curves with explicit number of segments -IMGUI_API ImVec2 ImBezierClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol);// For auto-tessellated curves you can use tess_tol = style.CurveTessellationTol -IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p); -IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); -IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); -IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w); -inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; } -IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy); - -// Helpers: Bit arrays -inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; } -inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; } -inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; } -inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) -{ - while (n <= n2) - { - int a_mod = (n & 31); - int b_mod = ((n2 >= n + 31) ? 31 : (n2 & 31)) + 1; - ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1); - arr[n >> 5] |= mask; - n = (n + 32) & ~31; - } -} - -// Helper: ImBitVector -// Store 1-bit per value. -struct IMGUI_API ImBitVector -{ - ImVector Storage; - void Create(int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); } - void Clear() { Storage.clear(); } - bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return ImBitArrayTestBit(Storage.Data, n); } - void SetBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); } - void ClearBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); } -}; - -// Helper: ImPool<> -// Basic keyed storage for contiguous instances, slow/amortized insertion, O(1) indexable, O(Log N) queries by ID over a dense/hot buffer, -// Honor constructor/destructor. Add/remove invalidate all pointers. Indexes have the same lifetime as the associated object. -typedef int ImPoolIdx; -template -struct IMGUI_API ImPool -{ - ImVector Buf; // Contiguous data - ImGuiStorage Map; // ID->Index - ImPoolIdx FreeIdx; // Next free idx to use - - ImPool() { FreeIdx = 0; } - ~ImPool() { Clear(); } - T* GetByKey(ImGuiID key) { int idx = Map.GetInt(key, -1); return (idx != -1) ? &Buf[idx] : NULL; } - T* GetByIndex(ImPoolIdx n) { return &Buf[n]; } - ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size); return (ImPoolIdx)(p - Buf.Data); } - T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Buf[*p_idx]; *p_idx = FreeIdx; return Add(); } - bool Contains(const T* p) const { return (p >= Buf.Data && p < Buf.Data + Buf.Size); } - void Clear() { for (int n = 0; n < Map.Data.Size; n++) { int idx = Map.Data[n].val_i; if (idx != -1) Buf[idx].~T(); } Map.Clear(); Buf.clear(); FreeIdx = 0; } - T* Add() { int idx = FreeIdx; if (idx == Buf.Size) { Buf.resize(Buf.Size + 1); FreeIdx++; } else { FreeIdx = *(int*)&Buf[idx]; } IM_PLACEMENT_NEW(&Buf[idx]) T(); return &Buf[idx]; } - void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); } - void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); } - void Reserve(int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); } - int GetSize() const { return Buf.Size; } -}; - -// Helper: ImChunkStream<> -// Build and iterate a contiguous stream of variable-sized structures. -// This is used by Settings to store persistent data while reducing allocation count. -// We store the chunk size first, and align the final size on 4 bytes boundaries (this what the '(X + 3) & ~3' statement is for) -// The tedious/zealous amount of casting is to avoid -Wcast-align warnings. -template -struct IMGUI_API ImChunkStream -{ - ImVector Buf; - - void clear() { Buf.clear(); } - bool empty() const { return Buf.Size == 0; } - int size() const { return Buf.Size; } - T* alloc_chunk(size_t sz) { size_t HDR_SZ = 4; sz = ((HDR_SZ + sz) + 3u) & ~3u; int off = Buf.Size; Buf.resize(off + (int)sz); ((int*)(void*)(Buf.Data + off))[0] = (int)sz; return (T*)(void*)(Buf.Data + off + (int)HDR_SZ); } - T* begin() { size_t HDR_SZ = 4; if (!Buf.Data) return NULL; return (T*)(void*)(Buf.Data + HDR_SZ); } - T* next_chunk(T* p) { size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(void*)((char*)(void*)p + chunk_size(p)); if (p == (T*)(void*)((char*)end() + HDR_SZ)) return (T*)0; IM_ASSERT(p < end()); return p; } - int chunk_size(const T* p) { return ((const int*)p)[-1]; } - T* end() { return (T*)(void*)(Buf.Data + Buf.Size); } - int offset_from_ptr(const T* p) { IM_ASSERT(p >= begin() && p < end()); const ptrdiff_t off = (const char*)p - Buf.Data; return (int)off; } - T* ptr_from_offset(int off) { IM_ASSERT(off >= 4 && off < Buf.Size); return (T*)(void*)(Buf.Data + off); } -}; - -//----------------------------------------------------------------------------- -// Misc data structures -//----------------------------------------------------------------------------- - -enum ImGuiButtonFlags_ -{ - ImGuiButtonFlags_None = 0, - ImGuiButtonFlags_Repeat = 1 << 0, // hold to repeat - ImGuiButtonFlags_PressedOnClick = 1 << 1, // return true on click (mouse down event) - ImGuiButtonFlags_PressedOnClickRelease = 1 << 2, // [Default] return true on click + release on same item <-- this is what the majority of Button are using - ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 3, // return true on click + release even if the release event is not done while hovering the item - ImGuiButtonFlags_PressedOnRelease = 1 << 4, // return true on release (default requires click+release) - ImGuiButtonFlags_PressedOnDoubleClick = 1 << 5, // return true on double-click (default requires click+release) - ImGuiButtonFlags_PressedOnDragDropHold = 1 << 6, // return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers) - ImGuiButtonFlags_FlattenChildren = 1 << 7, // allow interactions even if a child window is overlapping - ImGuiButtonFlags_AllowItemOverlap = 1 << 8, // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap() - ImGuiButtonFlags_DontClosePopups = 1 << 9, // disable automatically closing parent popup on press // [UNUSED] - ImGuiButtonFlags_Disabled = 1 << 10, // disable interactions - ImGuiButtonFlags_AlignTextBaseLine = 1 << 11, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine - ImGuiButtonFlags_NoKeyModifiers = 1 << 12, // disable mouse interaction if a key modifier is held - ImGuiButtonFlags_NoHoldingActiveId = 1 << 13, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only) - ImGuiButtonFlags_NoNavFocus = 1 << 14, // don't override navigation focus when activated - ImGuiButtonFlags_NoHoveredOnFocus = 1 << 15, // don't report as hovered when nav focus is on this item - ImGuiButtonFlags_MouseButtonLeft = 1 << 16, // [Default] react on left mouse button - ImGuiButtonFlags_MouseButtonRight = 1 << 17, // react on right mouse button - ImGuiButtonFlags_MouseButtonMiddle = 1 << 18, // react on center mouse button - - ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, - ImGuiButtonFlags_MouseButtonShift_ = 16, - ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft, - ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold, - ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease -}; - -enum ImGuiSliderFlags_ -{ - ImGuiSliderFlags_None = 0, - ImGuiSliderFlags_Vertical = 1 << 0 -}; - -enum ImGuiDragFlags_ -{ - ImGuiDragFlags_None = 0, - ImGuiDragFlags_Vertical = 1 << 0 -}; - -enum ImGuiColumnsFlags_ -{ - // Default: 0 - ImGuiColumnsFlags_None = 0, - ImGuiColumnsFlags_NoBorder = 1 << 0, // Disable column dividers - ImGuiColumnsFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers - ImGuiColumnsFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns - ImGuiColumnsFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window - ImGuiColumnsFlags_GrowParentContentsSize= 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove. -}; - -// Extend ImGuiSelectableFlags_ -enum ImGuiSelectableFlagsPrivate_ -{ - // NB: need to be in sync with last value of ImGuiSelectableFlags_ - ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20, - ImGuiSelectableFlags_SelectOnClick = 1 << 21, // Override button behavior to react on Click (default is Click+Release) - ImGuiSelectableFlags_SelectOnRelease = 1 << 22, // Override button behavior to react on Release (default is Click+Release) - ImGuiSelectableFlags_SpanAvailWidth = 1 << 23, // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus) - ImGuiSelectableFlags_DrawHoveredWhenHeld= 1 << 24, // Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow. - ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25 -}; - -// Extend ImGuiTreeNodeFlags_ -enum ImGuiTreeNodeFlagsPrivate_ -{ - ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20 -}; - -enum ImGuiSeparatorFlags_ -{ - ImGuiSeparatorFlags_None = 0, - ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar - ImGuiSeparatorFlags_Vertical = 1 << 1, - ImGuiSeparatorFlags_SpanAllColumns = 1 << 2 -}; - -// Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin(). -// This is going to be exposed in imgui.h when stabilized enough. -enum ImGuiItemFlags_ -{ - ImGuiItemFlags_None = 0, - ImGuiItemFlags_NoTabStop = 1 << 0, // false - ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings. - ImGuiItemFlags_Disabled = 1 << 2, // false // [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211 - ImGuiItemFlags_NoNav = 1 << 3, // false - ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false - ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // MenuItem/Selectable() automatically closes current Popup window - ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets) - ImGuiItemFlags_Default_ = 0 -}; - -// Storage for LastItem data -enum ImGuiItemStatusFlags_ -{ - ImGuiItemStatusFlags_None = 0, - ImGuiItemStatusFlags_HoveredRect = 1 << 0, - ImGuiItemStatusFlags_HasDisplayRect = 1 << 1, - ImGuiItemStatusFlags_Edited = 1 << 2, // Value exposed by item was edited in the current frame (should match the bool return value of most widgets) - ImGuiItemStatusFlags_ToggledSelection = 1 << 3, // Set when Selectable(), TreeNode() reports toggling a selection. We can't report "Selected" because reporting the change allows us to handle clipping with less issues. - ImGuiItemStatusFlags_ToggledOpen = 1 << 4, // Set when TreeNode() reports toggling their open state. - ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag. - ImGuiItemStatusFlags_Deactivated = 1 << 6 // Only valid if ImGuiItemStatusFlags_HasDeactivated is set. - -#ifdef IMGUI_ENABLE_TEST_ENGINE - , // [imgui_tests only] - ImGuiItemStatusFlags_Openable = 1 << 10, // - ImGuiItemStatusFlags_Opened = 1 << 11, // - ImGuiItemStatusFlags_Checkable = 1 << 12, // - ImGuiItemStatusFlags_Checked = 1 << 13 // -#endif -}; - -enum ImGuiTextFlags_ -{ - ImGuiTextFlags_None = 0, - ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0 -}; - -enum ImGuiTooltipFlags_ -{ - ImGuiTooltipFlags_None = 0, - ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0 // Override will clear/ignore previously submitted tooltip (defaults to append) -}; - -// FIXME: this is in development, not exposed/functional as a generic feature yet. -// Horizontal/Vertical enums are fixed to 0/1 so they may be used to index ImVec2 -enum ImGuiLayoutType_ -{ - ImGuiLayoutType_Horizontal = 0, - ImGuiLayoutType_Vertical = 1 -}; - -enum ImGuiLogType -{ - ImGuiLogType_None = 0, - ImGuiLogType_TTY, - ImGuiLogType_File, - ImGuiLogType_Buffer, - ImGuiLogType_Clipboard -}; - -// X/Y enums are fixed to 0/1 so they may be used to index ImVec2 -enum ImGuiAxis -{ - ImGuiAxis_None = -1, - ImGuiAxis_X = 0, - ImGuiAxis_Y = 1 -}; - -enum ImGuiPlotType -{ - ImGuiPlotType_Lines, - ImGuiPlotType_Histogram -}; - -enum ImGuiInputSource -{ - ImGuiInputSource_None = 0, - ImGuiInputSource_Mouse, - ImGuiInputSource_Nav, - ImGuiInputSource_NavKeyboard, // Only used occasionally for storage, not tested/handled by most code - ImGuiInputSource_NavGamepad, // " - ImGuiInputSource_COUNT -}; - -// FIXME-NAV: Clarify/expose various repeat delay/rate -enum ImGuiInputReadMode -{ - ImGuiInputReadMode_Down, - ImGuiInputReadMode_Pressed, - ImGuiInputReadMode_Released, - ImGuiInputReadMode_Repeat, - ImGuiInputReadMode_RepeatSlow, - ImGuiInputReadMode_RepeatFast -}; - -enum ImGuiNavHighlightFlags_ -{ - ImGuiNavHighlightFlags_None = 0, - ImGuiNavHighlightFlags_TypeDefault = 1 << 0, - ImGuiNavHighlightFlags_TypeThin = 1 << 1, - ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse. - ImGuiNavHighlightFlags_NoRounding = 1 << 3 -}; - -enum ImGuiNavDirSourceFlags_ -{ - ImGuiNavDirSourceFlags_None = 0, - ImGuiNavDirSourceFlags_Keyboard = 1 << 0, - ImGuiNavDirSourceFlags_PadDPad = 1 << 1, - ImGuiNavDirSourceFlags_PadLStick = 1 << 2 -}; - -enum ImGuiNavMoveFlags_ -{ - ImGuiNavMoveFlags_None = 0, - ImGuiNavMoveFlags_LoopX = 1 << 0, // On failed request, restart from opposite side - ImGuiNavMoveFlags_LoopY = 1 << 1, - ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left) - ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful for provided for completeness - ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place) - ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisibleSet that only comprise elements that are already fully visible. - ImGuiNavMoveFlags_ScrollToEdge = 1 << 6 -}; - -enum ImGuiNavForward -{ - ImGuiNavForward_None, - ImGuiNavForward_ForwardQueued, - ImGuiNavForward_ForwardActive -}; - -enum ImGuiNavLayer -{ - ImGuiNavLayer_Main = 0, // Main scrolling layer - ImGuiNavLayer_Menu = 1, // Menu layer (access with Alt/ImGuiNavInput_Menu) - ImGuiNavLayer_COUNT -}; - -enum ImGuiPopupPositionPolicy -{ - ImGuiPopupPositionPolicy_Default, - ImGuiPopupPositionPolicy_ComboBox -}; - -// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches) -struct ImVec1 -{ - float x; - ImVec1() { x = 0.0f; } - ImVec1(float _x) { x = _x; } -}; - -// 2D vector (half-size integer) -struct ImVec2ih -{ - short x, y; - ImVec2ih() { x = y = 0; } - ImVec2ih(short _x, short _y) { x = _x; y = _y; } - explicit ImVec2ih(const ImVec2& rhs) { x = (short)rhs.x; y = (short)rhs.y; } -}; - -// 2D axis aligned bounding-box -// NB: we can't rely on ImVec2 math operators being available here -struct IMGUI_API ImRect -{ - ImVec2 Min; // Upper-left - ImVec2 Max; // Lower-right - - ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {} - ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {} - ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {} - ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {} - - ImVec2 GetCenter() const { return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); } - ImVec2 GetSize() const { return ImVec2(Max.x - Min.x, Max.y - Min.y); } - float GetWidth() const { return Max.x - Min.x; } - float GetHeight() const { return Max.y - Min.y; } - ImVec2 GetTL() const { return Min; } // Top-left - ImVec2 GetTR() const { return ImVec2(Max.x, Min.y); } // Top-right - ImVec2 GetBL() const { return ImVec2(Min.x, Max.y); } // Bottom-left - ImVec2 GetBR() const { return Max; } // Bottom-right - bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; } - bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; } - bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; } - void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; } - void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; } - void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; } - void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; } - void Translate(const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; } - void TranslateX(float dx) { Min.x += dx; Max.x += dx; } - void TranslateY(float dy) { Min.y += dy; Max.y += dy; } - void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display. - void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped. - void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); } - bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; } -}; - -// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo(). -struct ImGuiDataTypeInfo -{ - size_t Size; // Size in byte - const char* PrintFmt; // Default printf format for the type - const char* ScanFmt; // Default scanf format for the type -}; - -// Stacked color modifier, backup of modified data so we can restore it -struct ImGuiColorMod -{ - ImGuiCol Col; - ImVec4 BackupValue; -}; - -// Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable. -struct ImGuiStyleMod -{ - ImGuiStyleVar VarIdx; - union { int BackupInt[2]; float BackupFloat[2]; }; - ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; } - ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; } - ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; } -}; - -// Stacked storage data for BeginGroup()/EndGroup() -struct ImGuiGroupData -{ - ImVec2 BackupCursorPos; - ImVec2 BackupCursorMaxPos; - ImVec1 BackupIndent; - ImVec1 BackupGroupOffset; - ImVec2 BackupCurrLineSize; - float BackupCurrLineTextBaseOffset; - ImGuiID BackupActiveIdIsAlive; - bool BackupActiveIdPreviousFrameIsAlive; - bool EmitItem; -}; - -// Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper. -struct IMGUI_API ImGuiMenuColumns -{ - float Spacing; - float Width, NextWidth; - float Pos[3], NextWidths[3]; - - ImGuiMenuColumns(); - void Update(int count, float spacing, bool clear); - float DeclColumns(float w0, float w1, float w2); - float CalcExtraSpace(float avail_w) const; -}; - -// Internal state of the currently focused/edited text input box -// For a given item ID, access with ImGui::GetInputTextState() -struct IMGUI_API ImGuiInputTextState -{ - ImGuiID ID; // widget id owning the text state - int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not. - ImVector TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. - ImVector TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity. - ImVector InitialTextA; // backup of end-user buffer at the time of focus (in UTF-8, unaltered) - bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument) - int BufCapacityA; // end-user buffer capacity - float ScrollX; // horizontal scrolling/offset - ImStb::STB_TexteditState Stb; // state for stb_textedit.h - float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately - bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!) - bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection - ImGuiInputTextFlags UserFlags; // Temporarily set while we call user's callback - ImGuiInputTextCallback UserCallback; // " - void* UserCallbackData; // " - - ImGuiInputTextState() { memset(this, 0, sizeof(*this)); } - void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); } - void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); } - int GetUndoAvailCount() const { return Stb.undostate.undo_point; } - int GetRedoAvailCount() const { return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; } - void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation - - // Cursor & Selection - void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking - void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); } - bool HasSelection() const { return Stb.select_start != Stb.select_end; } - void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; } - void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; } -}; - -// Windows data saved in imgui.ini file -// Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily. -// (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure) -struct ImGuiWindowSettings -{ - ImGuiID ID; - ImVec2ih Pos; - ImVec2ih Size; - bool Collapsed; - - ImGuiWindowSettings() { ID = 0; Pos = Size = ImVec2ih(0, 0); Collapsed = false; } - char* GetName() { return (char*)(this + 1); } -}; - -struct ImGuiSettingsHandler -{ - const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']' - ImGuiID TypeHash; // == ImHashStr(TypeName) - void* (*ReadOpenFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); // Read: Called when entering into a new ini entry e.g. "[Window][Name]" - void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); // Read: Called for every line of text within an ini entry - void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); // Write: Output every entries into 'out_buf' - void* UserData; - - ImGuiSettingsHandler() { memset(this, 0, sizeof(*this)); } -}; - -// Storage for current popup stack -struct ImGuiPopupData -{ - ImGuiID PopupId; // Set on OpenPopup() - ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() - ImGuiWindow* SourceWindow; // Set on OpenPopup() copy of NavWindow at the time of opening the popup - int OpenFrameCount; // Set on OpenPopup() - ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) - ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) - ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup - - ImGuiPopupData() { PopupId = 0; Window = SourceWindow = NULL; OpenFrameCount = -1; OpenParentId = 0; } -}; - -struct ImGuiColumnData -{ - float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right) - float OffsetNormBeforeResize; - ImGuiColumnsFlags Flags; // Not exposed - ImRect ClipRect; - - ImGuiColumnData() { OffsetNorm = OffsetNormBeforeResize = 0.0f; Flags = ImGuiColumnsFlags_None; } -}; - -struct ImGuiColumns -{ - ImGuiID ID; - ImGuiColumnsFlags Flags; - bool IsFirstFrame; - bool IsBeingResized; - int Current; - int Count; - float OffMinX, OffMaxX; // Offsets from HostWorkRect.Min.x - float LineMinY, LineMaxY; - float HostCursorPosY; // Backup of CursorPos at the time of BeginColumns() - float HostCursorMaxPosX; // Backup of CursorMaxPos at the time of BeginColumns() - ImRect HostClipRect; // Backup of ClipRect at the time of BeginColumns() - ImRect HostWorkRect; // Backup of WorkRect at the time of BeginColumns() - ImVector Columns; - ImDrawListSplitter Splitter; - - ImGuiColumns() { Clear(); } - void Clear() - { - ID = 0; - Flags = ImGuiColumnsFlags_None; - IsFirstFrame = false; - IsBeingResized = false; - Current = 0; - Count = 1; - OffMinX = OffMaxX = 0.0f; - LineMinY = LineMaxY = 0.0f; - HostCursorPosY = 0.0f; - HostCursorMaxPosX = 0.0f; - Columns.clear(); - } -}; - -// ImDrawList: Helper function to calculate a circle's segment count given its radius and a "maximum error" value. -#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 12 -#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512 -#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(_RAD,_MAXERROR) ImClamp((int)((IM_PI * 2.0f) / ImAcos(((_RAD) - (_MAXERROR)) / (_RAD))), IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX) - -// ImDrawList: You may set this to higher values (e.g. 2 or 3) to increase tessellation of fast rounded corners path. -#ifndef IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER -#define IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER 1 -#endif - -// Data shared between all ImDrawList instances -// You may want to create your own instance of this if you want to use ImDrawList completely without ImGui. In that case, watch out for future changes to this structure. -struct IMGUI_API ImDrawListSharedData -{ - ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas - ImFont* Font; // Current/default font (optional, for simplified AddText overload) - float FontSize; // Current/default font size (optional, for simplified AddText overload) - float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() - float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc - ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen() - ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards) - - // [Internal] Lookup tables - ImVec2 ArcFastVtx[12 * IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER]; // FIXME: Bake rounded corners fill/borders in atlas - ImU8 CircleSegmentCounts[64]; // Precomputed segment count for given radius (array index + 1) before we calculate it dynamically (to avoid calculation overhead) - - ImDrawListSharedData(); - void SetCircleSegmentMaxError(float max_error); -}; - -struct ImDrawDataBuilder -{ - ImVector Layers[2]; // Global layers for: regular, tooltip - - void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); } - void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); } - IMGUI_API void FlattenIntoSingleLayer(); -}; - -struct ImGuiNavMoveResult -{ - ImGuiWindow* Window; // Best candidate window - ImGuiID ID; // Best candidate ID - ImGuiID FocusScopeId; // Best candidate focus scope ID - float DistBox; // Best candidate box distance to current NavId - float DistCenter; // Best candidate center distance to current NavId - float DistAxial; - ImRect RectRel; // Best candidate bounding box in window relative space - - ImGuiNavMoveResult() { Clear(); } - void Clear() { Window = NULL; ID = FocusScopeId = 0; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel = ImRect(); } -}; - -enum ImGuiNextWindowDataFlags_ -{ - ImGuiNextWindowDataFlags_None = 0, - ImGuiNextWindowDataFlags_HasPos = 1 << 0, - ImGuiNextWindowDataFlags_HasSize = 1 << 1, - ImGuiNextWindowDataFlags_HasContentSize = 1 << 2, - ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3, - ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4, - ImGuiNextWindowDataFlags_HasFocus = 1 << 5, - ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6 -}; - -// Storage for SetNexWindow** functions -struct ImGuiNextWindowData -{ - ImGuiNextWindowDataFlags Flags; - ImGuiCond PosCond; - ImGuiCond SizeCond; - ImGuiCond CollapsedCond; - ImVec2 PosVal; - ImVec2 PosPivotVal; - ImVec2 SizeVal; - ImVec2 ContentSizeVal; - bool CollapsedVal; - ImRect SizeConstraintRect; - ImGuiSizeCallback SizeCallback; - void* SizeCallbackUserData; - float BgAlphaVal; // Override background alpha - ImVec2 MenuBarOffsetMinVal; // *Always on* This is not exposed publicly, so we don't clear it. - - ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); } - inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; } -}; - -enum ImGuiNextItemDataFlags_ -{ - ImGuiNextItemDataFlags_None = 0, - ImGuiNextItemDataFlags_HasWidth = 1 << 0, - ImGuiNextItemDataFlags_HasOpen = 1 << 1 -}; - -struct ImGuiNextItemData -{ - ImGuiNextItemDataFlags Flags; - float Width; // Set by SetNextItemWidth() - ImGuiID FocusScopeId; // Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging) - ImGuiCond OpenCond; - bool OpenVal; // Set by SetNextItemOpen() - - ImGuiNextItemData() { memset(this, 0, sizeof(*this)); } - inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; } // Also cleared manually by ItemAdd()! -}; - -//----------------------------------------------------------------------------- -// Tabs -//----------------------------------------------------------------------------- - -struct ImGuiShrinkWidthItem -{ - int Index; - float Width; -}; - -struct ImGuiPtrOrIndex -{ - void* Ptr; // Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool. - int Index; // Usually index in a main pool. - - ImGuiPtrOrIndex(void* ptr) { Ptr = ptr; Index = -1; } - ImGuiPtrOrIndex(int index) { Ptr = NULL; Index = index; } -}; - -//----------------------------------------------------------------------------- -// Main Dear ImGui context -//----------------------------------------------------------------------------- - -struct ImGuiContext -{ - bool Initialized; - bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it. - ImGuiIO IO; - ImGuiStyle Style; - ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back() - float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window. - float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height. - ImDrawListSharedData DrawListSharedData; - double Time; - int FrameCount; - int FrameCountEnded; - int FrameCountRendered; - bool WithinFrameScope; // Set by NewFrame(), cleared by EndFrame() - bool WithinFrameScopeWithImplicitWindow; // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed - bool WithinEndChild; // Set within EndChild() - - // Windows state - ImVector Windows; // Windows, sorted in display order, back to front - ImVector WindowsFocusOrder; // Windows, sorted in focus order, back to front. (FIXME: We could only store root windows here! Need to sort out the Docking equivalent which is RootWindowDockStop and is unfortunately a little more dynamic) - ImVector WindowsTempSortBuffer; // Temporary buffer used in EndFrame() to reorder windows so parents are kept before their child - ImVector CurrentWindowStack; - ImGuiStorage WindowsById; // Map window's ImGuiID to ImGuiWindow* - int WindowsActiveCount; // Number of unique windows submitted by frame - ImGuiWindow* CurrentWindow; // Window being drawn into - ImGuiWindow* HoveredWindow; // Will catch mouse inputs - ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only) - ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow. - ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window. - ImVec2 WheelingWindowRefMousePos; - float WheelingWindowTimer; - - // Item/widgets state and tracking information - ImGuiID HoveredId; // Hovered widget - bool HoveredIdAllowOverlap; - ImGuiID HoveredIdPreviousFrame; - float HoveredIdTimer; // Measure contiguous hovering time - float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active - ImGuiID ActiveId; // Active widget - ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame) - float ActiveIdTimer; - bool ActiveIdIsJustActivated; // Set at the time of activation for one frame - bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always) - bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch. - bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state. - bool ActiveIdHasBeenEditedThisFrame; - ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it) - ImU32 ActiveIdUsingNavInputMask; // Active widget will want to read those nav inputs. - ImU64 ActiveIdUsingKeyInputMask; // Active widget will want to read those key inputs. When we grow the ImGuiKey enum we'll need to either to order the enum to make useful keys come first, either redesign this into e.g. a small array. - ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) - ImGuiWindow* ActiveIdWindow; - ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard) - int ActiveIdMouseButton; - ImGuiID ActiveIdPreviousFrame; - bool ActiveIdPreviousFrameIsAlive; - bool ActiveIdPreviousFrameHasBeenEditedBefore; - ImGuiWindow* ActiveIdPreviousFrameWindow; - ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation. - float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation. - - // Next window/item data - ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions - ImGuiNextItemData NextItemData; // Storage for SetNextItem** functions - - // Shared stacks - ImVector ColorModifiers; // Stack for PushStyleColor()/PopStyleColor() - ImVector StyleModifiers; // Stack for PushStyleVar()/PopStyleVar() - ImVector FontStack; // Stack for PushFont()/PopFont() - ImVectorOpenPopupStack; // Which popups are open (persistent) - ImVectorBeginPopupStack; // Which level of BeginPopup() we are in (reset every frame) - - // Gamepad/keyboard Navigation - ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusWindow' - ImGuiID NavId; // Focused item for navigation - ImGuiID NavFocusScopeId; - ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem() - ImGuiID NavActivateDownId; // ~~ IsNavInputDown(ImGuiNavInput_Activate) ? NavId : 0 - ImGuiID NavActivatePressedId; // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0 - ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0 - ImGuiID NavJustTabbedId; // Just tabbed to this id. - ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest). - ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest). - ImGuiKeyModFlags NavJustMovedToKeyMods; - ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame. - ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard. - ImRect NavScoringRect; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring. - int NavScoringCount; // Metrics for debugging - ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later. - int NavIdTabCounter; // == NavWindow->DC.FocusIdxTabCounter at time of NavId processing - bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRefRectRel is valid - bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default) - bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover) - bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again. - bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest - bool NavInitRequest; // Init request for appearing window to select first item - bool NavInitRequestFromMove; - ImGuiID NavInitResultId; - ImRect NavInitResultRectRel; - bool NavMoveFromClampedRefRect; // Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items - bool NavMoveRequest; // Move request for this frame - ImGuiNavMoveFlags NavMoveRequestFlags; - ImGuiNavForward NavMoveRequestForward; // None / ForwardQueued / ForwardActive (this is used to navigate sibling parent menus from a child menu) - ImGuiKeyModFlags NavMoveRequestKeyMods; - ImGuiDir NavMoveDir, NavMoveDirLast; // Direction of the move request (left/right/up/down), direction of the previous move request - ImGuiDir NavMoveClipDir; // FIXME-NAV: Describe the purpose of this better. Might want to rename? - ImGuiNavMoveResult NavMoveResultLocal; // Best move request candidate within NavWindow - ImGuiNavMoveResult NavMoveResultLocalVisibleSet; // Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag) - ImGuiNavMoveResult NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag) - - // Navigation: Windowing (CTRL+TAB, holding Menu button + directional pads to move/resize) - ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed top-most. - ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f - ImGuiWindow* NavWindowingList; - float NavWindowingTimer; - float NavWindowingHighlightAlpha; - bool NavWindowingToggleLayer; - - // Legacy Focus/Tabbing system (older than Nav, active even if Nav is disabled, misnamed. FIXME-NAV: This needs a redesign!) - ImGuiWindow* FocusRequestCurrWindow; // - ImGuiWindow* FocusRequestNextWindow; // - int FocusRequestCurrCounterRegular; // Any item being requested for focus, stored as an index (we on layout to be stable between the frame pressing TAB and the next frame, semi-ouch) - int FocusRequestCurrCounterTabStop; // Tab item being requested for focus, stored as an index - int FocusRequestNextCounterRegular; // Stored for next frame - int FocusRequestNextCounterTabStop; // " - bool FocusTabPressed; // - - // Render - ImDrawData DrawData; // Main ImDrawData instance to pass render information to the user - ImDrawDataBuilder DrawDataBuilder; - float DimBgRatio; // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list) - ImDrawList BackgroundDrawList; // First draw list to be rendered. - ImDrawList ForegroundDrawList; // Last draw list to be rendered. This is where we the render software mouse cursor (if io.MouseDrawCursor is set) and most debug overlays. - ImGuiMouseCursor MouseCursor; - - // Drag and Drop - bool DragDropActive; - bool DragDropWithinSource; // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source. - bool DragDropWithinTarget; // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target. - ImGuiDragDropFlags DragDropSourceFlags; - int DragDropSourceFrameCount; - int DragDropMouseButton; - ImGuiPayload DragDropPayload; - ImRect DragDropTargetRect; // Store rectangle of current target candidate (we favor small targets when overlapping) - ImGuiID DragDropTargetId; - ImGuiDragDropFlags DragDropAcceptFlags; - float DragDropAcceptIdCurrRectSurface; // Target item surface (we resolve overlapping targets by prioritizing the smaller surface) - ImGuiID DragDropAcceptIdCurr; // Target item id (set at the time of accepting the payload) - ImGuiID DragDropAcceptIdPrev; // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets) - int DragDropAcceptFrameCount; // Last time a target expressed a desire to accept the source - ImVector DragDropPayloadBufHeap; // We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size - unsigned char DragDropPayloadBufLocal[16]; // Local buffer for small payloads - - // Tab bars - ImGuiTabBar* CurrentTabBar; - ImPool TabBars; - ImVector CurrentTabBarStack; - ImVector ShrinkWidthBuffer; - - // Widget state - ImVec2 LastValidMousePos; - ImGuiInputTextState InputTextState; - ImFont InputTextPasswordFont; - ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc. - ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets - float ColorEditLastHue; // Backup of last Hue associated to LastColor[3], so we can restore Hue in lossy RGB<>HSV round trips - float ColorEditLastSat; // Backup of last Saturation associated to LastColor[3], so we can restore Saturation in lossy RGB<>HSV round trips - float ColorEditLastColor[3]; - ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker. - bool DragCurrentAccumDirty; - float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings - float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio - float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage? - int TooltipOverrideCount; - ImVector ClipboardHandlerData; // If no custom clipboard handler is defined - ImVector MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once - - // Platform support - ImVec2 PlatformImePos; // Cursor position request & last passed to the OS Input Method Editor - ImVec2 PlatformImeLastPos; - - // Settings - bool SettingsLoaded; - float SettingsDirtyTimer; // Save .ini Settings to memory when time reaches zero - ImGuiTextBuffer SettingsIniData; // In memory .ini settings - ImVector SettingsHandlers; // List of .ini settings handlers - ImChunkStream SettingsWindows; // ImGuiWindow .ini settings entries - - // Capture/Logging - bool LogEnabled; - ImGuiLogType LogType; - ImFileHandle LogFile; // If != NULL log to stdout/ file - ImGuiTextBuffer LogBuffer; // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators. - float LogLinePosY; - bool LogLineFirstItem; - int LogDepthRef; - int LogDepthToExpand; - int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call. - - // Debug Tools - bool DebugItemPickerActive; - ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this id - - // Misc - float FramerateSecPerFrame[120]; // Calculate estimate of framerate for user over the last 2 seconds. - int FramerateSecPerFrameIdx; - float FramerateSecPerFrameAccum; - int WantCaptureMouseNextFrame; // Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags - int WantCaptureKeyboardNextFrame; - int WantTextInputNextFrame; - char TempBuffer[1024*3+1]; // Temporary text buffer - - ImGuiContext(ImFontAtlas* shared_font_atlas) : BackgroundDrawList(&DrawListSharedData), ForegroundDrawList(&DrawListSharedData) - { - Initialized = false; - Font = NULL; - FontSize = FontBaseSize = 0.0f; - FontAtlasOwnedByContext = shared_font_atlas ? false : true; - IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)(); - Time = 0.0f; - FrameCount = 0; - FrameCountEnded = FrameCountRendered = -1; - WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false; - - WindowsActiveCount = 0; - CurrentWindow = NULL; - HoveredWindow = NULL; - HoveredRootWindow = NULL; - MovingWindow = NULL; - WheelingWindow = NULL; - WheelingWindowTimer = 0.0f; - - HoveredId = 0; - HoveredIdAllowOverlap = false; - HoveredIdPreviousFrame = 0; - HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f; - ActiveId = 0; - ActiveIdIsAlive = 0; - ActiveIdTimer = 0.0f; - ActiveIdIsJustActivated = false; - ActiveIdAllowOverlap = false; - ActiveIdHasBeenPressedBefore = false; - ActiveIdHasBeenEditedBefore = false; - ActiveIdHasBeenEditedThisFrame = false; - ActiveIdUsingNavDirMask = 0x00; - ActiveIdUsingNavInputMask = 0x00; - ActiveIdUsingKeyInputMask = 0x00; - ActiveIdClickOffset = ImVec2(-1,-1); - ActiveIdWindow = NULL; - ActiveIdSource = ImGuiInputSource_None; - ActiveIdMouseButton = 0; - ActiveIdPreviousFrame = 0; - ActiveIdPreviousFrameIsAlive = false; - ActiveIdPreviousFrameHasBeenEditedBefore = false; - ActiveIdPreviousFrameWindow = NULL; - LastActiveId = 0; - LastActiveIdTimer = 0.0f; - - NavWindow = NULL; - NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavInputId = 0; - NavJustTabbedId = NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0; - NavJustMovedToKeyMods = ImGuiKeyModFlags_None; - NavInputSource = ImGuiInputSource_None; - NavScoringRect = ImRect(); - NavScoringCount = 0; - NavLayer = ImGuiNavLayer_Main; - NavIdTabCounter = INT_MAX; - NavIdIsAlive = false; - NavMousePosDirty = false; - NavDisableHighlight = true; - NavDisableMouseHover = false; - NavAnyRequest = false; - NavInitRequest = false; - NavInitRequestFromMove = false; - NavInitResultId = 0; - NavMoveFromClampedRefRect = false; - NavMoveRequest = false; - NavMoveRequestFlags = ImGuiNavMoveFlags_None; - NavMoveRequestForward = ImGuiNavForward_None; - NavMoveRequestKeyMods = ImGuiKeyModFlags_None; - NavMoveDir = NavMoveDirLast = NavMoveClipDir = ImGuiDir_None; - - NavWindowingTarget = NavWindowingTargetAnim = NavWindowingList = NULL; - NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f; - NavWindowingToggleLayer = false; - - FocusRequestCurrWindow = FocusRequestNextWindow = NULL; - FocusRequestCurrCounterRegular = FocusRequestCurrCounterTabStop = INT_MAX; - FocusRequestNextCounterRegular = FocusRequestNextCounterTabStop = INT_MAX; - FocusTabPressed = false; - - DimBgRatio = 0.0f; - BackgroundDrawList._OwnerName = "##Background"; // Give it a name for debugging - ForegroundDrawList._OwnerName = "##Foreground"; // Give it a name for debugging - MouseCursor = ImGuiMouseCursor_Arrow; - - DragDropActive = DragDropWithinSource = DragDropWithinTarget = false; - DragDropSourceFlags = ImGuiDragDropFlags_None; - DragDropSourceFrameCount = -1; - DragDropMouseButton = -1; - DragDropTargetId = 0; - DragDropAcceptFlags = ImGuiDragDropFlags_None; - DragDropAcceptIdCurrRectSurface = 0.0f; - DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0; - DragDropAcceptFrameCount = -1; - memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal)); - - CurrentTabBar = NULL; - - LastValidMousePos = ImVec2(0.0f, 0.0f); - TempInputId = 0; - ColorEditOptions = ImGuiColorEditFlags__OptionsDefault; - ColorEditLastHue = ColorEditLastSat = 0.0f; - ColorEditLastColor[0] = ColorEditLastColor[1] = ColorEditLastColor[2] = FLT_MAX; - DragCurrentAccumDirty = false; - DragCurrentAccum = 0.0f; - DragSpeedDefaultRatio = 1.0f / 100.0f; - ScrollbarClickDeltaToGrabCenter = 0.0f; - TooltipOverrideCount = 0; - - PlatformImePos = PlatformImeLastPos = ImVec2(FLT_MAX, FLT_MAX); - - SettingsLoaded = false; - SettingsDirtyTimer = 0.0f; - - LogEnabled = false; - LogType = ImGuiLogType_None; - LogFile = NULL; - LogLinePosY = FLT_MAX; - LogLineFirstItem = false; - LogDepthRef = 0; - LogDepthToExpand = LogDepthToExpandDefault = 2; - - DebugItemPickerActive = false; - DebugItemPickerBreakId = 0; - - memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame)); - FramerateSecPerFrameIdx = 0; - FramerateSecPerFrameAccum = 0.0f; - WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1; - memset(TempBuffer, 0, sizeof(TempBuffer)); - } -}; - -//----------------------------------------------------------------------------- -// ImGuiWindow -//----------------------------------------------------------------------------- - -// Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow. -// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered. -struct IMGUI_API ImGuiWindowTempData -{ - // Layout - ImVec2 CursorPos; // Current emitting position, in absolute coordinates. - ImVec2 CursorPosPrevLine; - ImVec2 CursorStartPos; // Initial position after Begin(), generally ~ window position + WindowPadding. - ImVec2 CursorMaxPos; // Used to implicitly calculate the size of our contents, always growing during the frame. Used to calculate window->ContentSize at the beginning of next frame - ImVec2 CurrLineSize; - ImVec2 PrevLineSize; - float CurrLineTextBaseOffset; // Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added). - float PrevLineTextBaseOffset; - ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.) - ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API. - ImVec1 GroupOffset; - - // Last item status - ImGuiID LastItemId; // ID for last item - ImGuiItemStatusFlags LastItemStatusFlags; // Status flags for last item (see ImGuiItemStatusFlags_) - ImRect LastItemRect; // Interaction rect for last item - ImRect LastItemDisplayRect; // End-user display rect for last item (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect) - - // Keyboard/Gamepad navigation - ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1) - int NavLayerCurrentMask; // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping. - int NavLayerActiveMask; // Which layer have been written to (result from previous frame) - int NavLayerActiveMaskNext; // Which layer have been written to (buffer for current frame) - ImGuiID NavFocusScopeIdCurrent; // Current focus scope ID while appending - bool NavHideHighlightOneFrame; - bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f) - - // Miscellaneous - bool MenuBarAppending; // FIXME: Remove this - ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs. - ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items measurement - int TreeDepth; // Current tree depth. - ImU32 TreeJumpToParentOnPopMask; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary. - ImVector ChildWindows; - ImGuiStorage* StateStorage; // Current persistent per-window storage (store e.g. tree node open/close state) - ImGuiColumns* CurrentColumns; // Current columns set - ImGuiLayoutType LayoutType; - ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin() - int FocusCounterRegular; // (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign) - int FocusCounterTabStop; // (Legacy Focus/Tabbing system) Same, but only count widgets which you can Tab through. - - // Local parameters stacks - // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings. - ImGuiItemFlags ItemFlags; // == ItemFlagsStack.back() [empty == ImGuiItemFlags_Default] - float ItemWidth; // == ItemWidthStack.back(). 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window - float TextWrapPos; // == TextWrapPosStack.back() [empty == -1.0f] - ImVectorItemFlagsStack; - ImVector ItemWidthStack; - ImVector TextWrapPosStack; - ImVectorGroupStack; - short StackSizesBackup[6]; // Store size of various stacks for asserting - - ImGuiWindowTempData() - { - CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos = ImVec2(0.0f, 0.0f); - CurrLineSize = PrevLineSize = ImVec2(0.0f, 0.0f); - CurrLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f; - Indent = ImVec1(0.0f); - ColumnsOffset = ImVec1(0.0f); - GroupOffset = ImVec1(0.0f); - - LastItemId = 0; - LastItemStatusFlags = ImGuiItemStatusFlags_None; - LastItemRect = LastItemDisplayRect = ImRect(); - - NavLayerActiveMask = NavLayerActiveMaskNext = 0x00; - NavLayerCurrent = ImGuiNavLayer_Main; - NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); - NavFocusScopeIdCurrent = 0; - NavHideHighlightOneFrame = false; - NavHasScroll = false; - - MenuBarAppending = false; - MenuBarOffset = ImVec2(0.0f, 0.0f); - TreeDepth = 0; - TreeJumpToParentOnPopMask = 0x00; - StateStorage = NULL; - CurrentColumns = NULL; - LayoutType = ParentLayoutType = ImGuiLayoutType_Vertical; - FocusCounterRegular = FocusCounterTabStop = -1; - - ItemFlags = ImGuiItemFlags_Default_; - ItemWidth = 0.0f; - TextWrapPos = -1.0f; - memset(StackSizesBackup, 0, sizeof(StackSizesBackup)); - } -}; - -// Storage for one window -struct IMGUI_API ImGuiWindow -{ - char* Name; // Window name, owned by the window. - ImGuiID ID; // == ImHashStr(Name) - ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_ - ImVec2 Pos; // Position (always rounded-up to nearest pixel) - ImVec2 Size; // Current size (==SizeFull or collapsed title bar size) - ImVec2 SizeFull; // Size when non collapsed - ImVec2 ContentSize; // Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding. - ImVec2 ContentSizeExplicit; // Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize(). - ImVec2 WindowPadding; // Window padding at the time of Begin(). - float WindowRounding; // Window rounding at the time of Begin(). - float WindowBorderSize; // Window border size at the time of Begin(). - int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)! - ImGuiID MoveId; // == window->GetID("#MOVE") - ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window) - ImVec2 Scroll; - ImVec2 ScrollMax; - ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change) - ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered - ImVec2 ScrollbarSizes; // Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar. - bool ScrollbarX, ScrollbarY; // Are scrollbars visible? - bool Active; // Set to true on Begin(), unless Collapsed - bool WasActive; - bool WriteAccessed; // Set to true when any widget access the current window - bool Collapsed; // Set when collapsing window to become only title-bar - bool WantCollapseToggle; - bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed) - bool Appearing; // Set during the frame where the window is appearing (or re-appearing) - bool Hidden; // Do not display (== (HiddenFrames*** > 0)) - bool IsFallbackWindow; // Set on the "Debug##Default" window. - bool HasCloseButton; // Set when the window has a close button (p_open != NULL) - signed char ResizeBorderHeld; // Current border being held for resize (-1: none, otherwise 0-3) - short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) - short BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0. - short BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues. - ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) - ImS8 AutoFitFramesX, AutoFitFramesY; - ImS8 AutoFitChildAxises; - bool AutoFitOnlyGrows; - ImGuiDir AutoPosLastDirection; - int HiddenFramesCanSkipItems; // Hide the window for N frames - int HiddenFramesCannotSkipItems; // Hide the window for N frames while allowing items to be submitted so we can measure their size - ImGuiCond SetWindowPosAllowFlags; // store acceptable condition flags for SetNextWindowPos() use. - ImGuiCond SetWindowSizeAllowFlags; // store acceptable condition flags for SetNextWindowSize() use. - ImGuiCond SetWindowCollapsedAllowFlags; // store acceptable condition flags for SetNextWindowCollapsed() use. - ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size) - ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right. - - ImVector IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure) - ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name. - - // The best way to understand what those rectangles are is to use the 'Metrics -> Tools -> Show windows rectangles' viewer. - // The main 'OuterRect', omitted as a field, is window->Rect(). - ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window. - ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar) - ImRect InnerClipRect; // == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect. - ImRect WorkRect; // Cover the whole scrolling region, shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward). - ImRect ClipRect; // Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back(). - ImRect ContentRegionRect; // FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on. - - int LastFrameActive; // Last frame number the window was Active. - float LastTimeActive; // Last timestamp the window was Active (using float as we don't need high precision there) - float ItemWidthDefault; - ImGuiStorage StateStorage; - ImVector ColumnsStorage; - float FontWindowScale; // User scale multiplier per-window, via SetWindowFontScale() - int SettingsOffset; // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back) - - ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer) - ImDrawList DrawListInst; - ImGuiWindow* ParentWindow; // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL. - ImGuiWindow* RootWindow; // Point to ourself or first ancestor that is not a child window. - ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active. - ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag. - - ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.) - ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1) - ImRect NavRectRel[ImGuiNavLayer_COUNT]; // Reference rectangle, in window relative space - - bool MemoryCompacted; - int MemoryDrawListIdxCapacity; - int MemoryDrawListVtxCapacity; - -public: - ImGuiWindow(ImGuiContext* context, const char* name); - ~ImGuiWindow(); - - ImGuiID GetID(const char* str, const char* str_end = NULL); - ImGuiID GetID(const void* ptr); - ImGuiID GetID(int n); - ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL); - ImGuiID GetIDNoKeepAlive(const void* ptr); - ImGuiID GetIDNoKeepAlive(int n); - ImGuiID GetIDFromRectangle(const ImRect& r_abs); - - // We don't use g.FontSize because the window may be != g.CurrentWidow. - ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x+Size.x, Pos.y+Size.y); } - float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; } - float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; } - ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); } - float MenuBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; } - ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); } -}; - -// Backup and restore just enough data to be able to use IsItemHovered() on item A after another B in the same window has overwritten the data. -struct ImGuiItemHoveredDataBackup -{ - ImGuiID LastItemId; - ImGuiItemStatusFlags LastItemStatusFlags; - ImRect LastItemRect; - ImRect LastItemDisplayRect; - - ImGuiItemHoveredDataBackup() { Backup(); } - void Backup() { ImGuiWindow* window = GImGui->CurrentWindow; LastItemId = window->DC.LastItemId; LastItemStatusFlags = window->DC.LastItemStatusFlags; LastItemRect = window->DC.LastItemRect; LastItemDisplayRect = window->DC.LastItemDisplayRect; } - void Restore() const { ImGuiWindow* window = GImGui->CurrentWindow; window->DC.LastItemId = LastItemId; window->DC.LastItemStatusFlags = LastItemStatusFlags; window->DC.LastItemRect = LastItemRect; window->DC.LastItemDisplayRect = LastItemDisplayRect; } -}; - -//----------------------------------------------------------------------------- -// Tab bar, tab item -//----------------------------------------------------------------------------- - -// Extend ImGuiTabBarFlags_ -enum ImGuiTabBarFlagsPrivate_ -{ - ImGuiTabBarFlags_DockNode = 1 << 20, // Part of a dock node [we don't use this in the master branch but it facilitate branch syncing to keep this around] - ImGuiTabBarFlags_IsFocused = 1 << 21, - ImGuiTabBarFlags_SaveSettings = 1 << 22 // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs -}; - -// Extend ImGuiTabItemFlags_ -enum ImGuiTabItemFlagsPrivate_ -{ - ImGuiTabItemFlags_NoCloseButton = 1 << 20 // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout) -}; - -// Storage for one active tab item (sizeof() 26~32 bytes) -struct ImGuiTabItem -{ - ImGuiID ID; - ImGuiTabItemFlags Flags; - int LastFrameVisible; - int LastFrameSelected; // This allows us to infer an ordered list of the last activated tabs with little maintenance - int NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames - float Offset; // Position relative to beginning of tab - float Width; // Width currently displayed - float ContentWidth; // Width of actual contents, stored during BeginTabItem() call - - ImGuiTabItem() { ID = 0; Flags = ImGuiTabItemFlags_None; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = ContentWidth = 0.0f; } -}; - -// Storage for a tab bar (sizeof() 92~96 bytes) -struct ImGuiTabBar -{ - ImVector Tabs; - ImGuiID ID; // Zero for tab-bars used by docking - ImGuiID SelectedTabId; // Selected tab/window - ImGuiID NextSelectedTabId; - ImGuiID VisibleTabId; // Can occasionally be != SelectedTabId (e.g. when previewing contents for CTRL+TAB preview) - int CurrFrameVisible; - int PrevFrameVisible; - ImRect BarRect; - float LastTabContentHeight; // Record the height of contents submitted below the tab bar - float OffsetMax; // Distance from BarRect.Min.x, locked during layout - float OffsetMaxIdeal; // Ideal offset if all tabs were visible and not clipped - float OffsetNextTab; // Distance from BarRect.Min.x, incremented with each BeginTabItem() call, not used if ImGuiTabBarFlags_Reorderable if set. - float ScrollingAnim; - float ScrollingTarget; - float ScrollingTargetDistToVisibility; - float ScrollingSpeed; - ImGuiTabBarFlags Flags; - ImGuiID ReorderRequestTabId; - ImS8 ReorderRequestDir; - bool WantLayout; - bool VisibleTabWasSubmitted; - short LastTabItemIdx; // For BeginTabItem()/EndTabItem() - ImVec2 FramePadding; // style.FramePadding locked at the time of BeginTabBar() - ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer. - - ImGuiTabBar(); - int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); } - const char* GetTabName(const ImGuiTabItem* tab) const - { - IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size); - return TabsNames.Buf.Data + tab->NameOffset; - } -}; - -//----------------------------------------------------------------------------- -// Internal API -// No guarantee of forward compatibility here. -//----------------------------------------------------------------------------- - -namespace ImGui -{ - // Windows - // We should always have a CurrentWindow in the stack (there is an implicit "Debug" window) - // If this ever crash because g.CurrentWindow is NULL it means that either - // - ImGui::NewFrame() has never been called, which is illegal. - // - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal. - inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; } - inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; } - IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id); - IMGUI_API ImGuiWindow* FindWindowByName(const char* name); - IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window); - IMGUI_API ImVec2 CalcWindowExpectedSize(ImGuiWindow* window); - IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent); - IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window); - IMGUI_API ImRect GetWindowAllowedExtentRect(ImGuiWindow* window); - IMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond = 0); - IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0); - IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0); - - // Windows: Display Order and Focus Order - IMGUI_API void FocusWindow(ImGuiWindow* window); - IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window); - IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window); - IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window); - IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window); - - // Fonts, drawing - IMGUI_API void SetCurrentFont(ImFont* font); - inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; } - inline ImDrawList* GetForegroundDrawList(ImGuiWindow* window) { IM_UNUSED(window); ImGuiContext& g = *GImGui; return &g.ForegroundDrawList; } // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches. - - // Init - IMGUI_API void Initialize(ImGuiContext* context); - IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext(). - - // NewFrame - IMGUI_API void UpdateHoveredWindowAndCaptureFlags(); - IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window); - IMGUI_API void UpdateMouseMovingWindowNewFrame(); - IMGUI_API void UpdateMouseMovingWindowEndFrame(); - - // Settings - IMGUI_API void MarkIniSettingsDirty(); - IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window); - IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name); - IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id); - IMGUI_API ImGuiWindowSettings* FindOrCreateWindowSettings(const char* name); - IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name); - - // Scrolling - IMGUI_API void SetScrollX(ImGuiWindow* window, float new_scroll_x); - IMGUI_API void SetScrollY(ImGuiWindow* window, float new_scroll_y); - IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio = 0.5f); - IMGUI_API void SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio = 0.5f); - IMGUI_API ImVec2 ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& item_rect); - - // Basic Accessors - inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.CurrentWindow->DC.LastItemId; } - inline ImGuiItemStatusFlags GetItemStatusFlags() { ImGuiContext& g = *GImGui; return g.CurrentWindow->DC.LastItemStatusFlags; } - inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; } - inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; } - IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window); - IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window); - IMGUI_API void ClearActiveID(); - IMGUI_API ImGuiID GetHoveredID(); - IMGUI_API void SetHoveredID(ImGuiID id); - IMGUI_API void KeepAliveID(ImGuiID id); - IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function. - IMGUI_API void PushOverrideID(ImGuiID id); // Push given value at the top of the ID stack (whereas PushID combines old and new hashes) - - // Basic Helpers for widget code - IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f); - IMGUI_API void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f); - IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL); - IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id); - IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged); - IMGUI_API bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id); // Return true if focus is requested - IMGUI_API void FocusableItemUnregister(ImGuiWindow* window); - IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h); - IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x); - IMGUI_API void PushMultiItemsWidths(int components, float width_full); - IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); - IMGUI_API void PopItemFlag(); - IMGUI_API bool IsItemToggledSelection(); // Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly) - IMGUI_API ImVec2 GetContentRegionMaxAbs(); - IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess); - - // Logging/Capture - IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name. - IMGUI_API void LogToBuffer(int auto_open_depth = -1); // Start logging/capturing to internal buffer - - // Popups, Modals, Tooltips - IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags); - IMGUI_API void OpenPopupEx(ImGuiID id); - IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup); - IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup); - IMGUI_API bool IsPopupOpen(ImGuiID id); // Test for id within current popup stack level (currently begin-ed into); this doesn't scan the whole popup stack! - IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); - IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags); - IMGUI_API ImGuiWindow* GetTopMostPopupModal(); - IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window); - IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy = ImGuiPopupPositionPolicy_Default); - - // Navigation - IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit); - IMGUI_API bool NavMoveRequestButNoResultYet(); - IMGUI_API void NavMoveRequestCancel(); - IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect& bb_rel, ImGuiNavMoveFlags move_flags); - IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags); - IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode); - IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f); - IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate); - IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again. - IMGUI_API void SetNavID(ImGuiID id, int nav_layer, ImGuiID focus_scope_id); - IMGUI_API void SetNavIDWithRectRel(ImGuiID id, int nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel); - - // Focus scope (WIP) - IMGUI_API void PushFocusScope(ImGuiID id); // Note: this is storing in same stack as IDStack, so Push/Pop mismatch will be reported there. - IMGUI_API void PopFocusScope(); - inline ImGuiID GetFocusScopeID() { ImGuiContext& g = *GImGui; return g.NavFocusScopeId; } - - // Inputs - // FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions. - inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; } - inline bool IsActiveIdUsingNavInput(ImGuiNavInput input) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavInputMask & (1 << input)) != 0; } - inline bool IsActiveIdUsingKey(ImGuiKey key) { ImGuiContext& g = *GImGui; IM_ASSERT(key < 64); return (g.ActiveIdUsingKeyInputMask & ((ImU64)1 << key)) != 0; } - IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f); - inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { ImGuiContext& g = *GImGui; const int key_index = g.IO.KeyMap[key]; return (key_index >= 0) ? IsKeyPressed(key_index, repeat) : false; } - inline bool IsNavInputDown(ImGuiNavInput n) { ImGuiContext& g = *GImGui; return g.IO.NavInputs[n] > 0.0f; } - inline bool IsNavInputTest(ImGuiNavInput n, ImGuiInputReadMode rm) { return (GetNavInputAmount(n, rm) > 0.0f); } - IMGUI_API ImGuiKeyModFlags GetMergedKeyModFlags(); - - // Drag and Drop - IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id); - IMGUI_API void ClearDragDrop(); - IMGUI_API bool IsDragDropPayloadBeingAccepted(); - - // Internal Columns API (this is not exposed because we will encourage transitioning to the Tables api) - IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiColumnsFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns(). - IMGUI_API void EndColumns(); // close columns - IMGUI_API void PushColumnClipRect(int column_index); - IMGUI_API void PushColumnsBackground(); - IMGUI_API void PopColumnsBackground(); - IMGUI_API ImGuiID GetColumnsID(const char* str_id, int count); - IMGUI_API ImGuiColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id); - IMGUI_API float GetColumnOffsetFromNorm(const ImGuiColumns* columns, float offset_norm); - IMGUI_API float GetColumnNormFromOffset(const ImGuiColumns* columns, float offset); - - // Tab Bars - IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags); - IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id); - IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id); - IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); - IMGUI_API void TabBarQueueChangeTabOrder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int dir); - IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags); - IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button); - IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col); - IMGUI_API bool TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id); - - // Render helpers - // AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT. - // NB: All position are in absolute pixels coordinates (we are never using window coordinates internally) - IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true); - IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width); - IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0,0), const ImRect* clip_rect = NULL); - IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL); - IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known); - IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f); - IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f); - IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, int rounding_corners_flags = ~0); - IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight - IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text. - IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL); - - // Render helpers (those functions don't access any ImGui state!) - IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f); - IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col); - IMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz); - IMGUI_API void RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow); - IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col); - IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding); - -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - // [1.71: 2019/06/07: Updating prototypes of some of the internal functions. Leaving those for reference for a short while] - inline void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale=1.0f) { ImGuiWindow* window = GetCurrentWindow(); RenderArrow(window->DrawList, pos, GetColorU32(ImGuiCol_Text), dir, scale); } - inline void RenderBullet(ImVec2 pos) { ImGuiWindow* window = GetCurrentWindow(); RenderBullet(window->DrawList, pos, GetColorU32(ImGuiCol_Text)); } -#endif - - // Widgets - IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0); - IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0,0), ImGuiButtonFlags flags = 0); - IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos); - IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos); - IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); - IMGUI_API void Scrollbar(ImGuiAxis axis); - IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* p_scroll_v, float avail_v, float contents_v, ImDrawCornerFlags rounding_corners); - IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis); - IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis); - IMGUI_API ImGuiID GetWindowResizeID(ImGuiWindow* window, int n); // 0..3: corners, 4..7: borders - IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags); - - // Widgets low-level behaviors - IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0); - IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, float power, ImGuiDragFlags flags); - IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb); - IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f); - IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL); - IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextItemOpen() data, if any. May return true when logging - IMGUI_API void TreePushOverrideID(ImGuiID id); - - // Template functions are instantiated in imgui_widgets.cpp for a finite number of types. - // To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036). - // e.g. " extern template IMGUI_API float RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, float v); " - template IMGUI_API bool DragBehaviorT(ImGuiDataType data_type, T* v, float v_speed, T v_min, T v_max, const char* format, float power, ImGuiDragFlags flags); - template IMGUI_API bool SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, T* v, T v_min, T v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb); - template IMGUI_API float SliderCalcRatioFromValueT(ImGuiDataType data_type, T v, T v_min, T v_max, float power, float linear_zero_pos); - template IMGUI_API T RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, T v); - - // Data type helpers - IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type); - IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format); - IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg_1, const void* arg_2); - IMGUI_API bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format); - - // InputText - IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags); - IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format); - inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); } - inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active - - // Color - IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags); - IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags); - IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags); - - // Plot - IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size); - - // Shade functions (write over already created vertices) - IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1); - IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp); - - // Garbage collection - IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window); - IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window); - - // Debug Tools - inline void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max, col); } - inline void DebugStartItemPicker() { ImGuiContext& g = *GImGui; g.DebugItemPickerActive = true; } - -} // namespace ImGui - -// ImFontAtlas internals -IMGUI_API bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas); -IMGUI_API void ImFontAtlasBuildInit(ImFontAtlas* atlas); -IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent); -IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque); -IMGUI_API void ImFontAtlasBuildFinish(ImFontAtlas* atlas); -IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor); -IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride); - -// Debug Tools -// Use 'Metrics->Tools->Item Picker' to break into the call-stack of a specific item. -#ifndef IM_DEBUG_BREAK -#if defined(__clang__) -#define IM_DEBUG_BREAK() __builtin_debugtrap() -#elif defined (_MSC_VER) -#define IM_DEBUG_BREAK() __debugbreak() -#else -#define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger! -#endif -#endif // #ifndef IM_DEBUG_BREAK - -// Test Engine Hooks (imgui_tests) -//#define IMGUI_ENABLE_TEST_ENGINE -#ifdef IMGUI_ENABLE_TEST_ENGINE -extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx); -extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx); -extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id); -extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags); -extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...); -#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB, _ID) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box -#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) -#define IMGUI_TEST_ENGINE_LOG(_FMT, ...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log -#else -#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB, _ID) do { } while (0) -#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) do { } while (0) -#define IMGUI_TEST_ENGINE_LOG(_FMT, ...) do { } while (0) -#endif - -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - -#ifdef _MSC_VER -#pragma warning (pop) -#endif - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imgui_widgets.cpp b/include/imgui/imgui_widgets.cpp deleted file mode 100644 index 27d9e455..00000000 --- a/include/imgui/imgui_widgets.cpp +++ /dev/null @@ -1,7736 +0,0 @@ -// dear imgui, v1.76 -// (widgets code) - -/* - -Index of this file: - -// [SECTION] Forward Declarations -// [SECTION] Widgets: Text, etc. -// [SECTION] Widgets: Main (Button, Image, Checkbox, RadioButton, ProgressBar, Bullet, etc.) -// [SECTION] Widgets: Low-level Layout helpers (Spacing, Dummy, NewLine, Separator, etc.) -// [SECTION] Widgets: ComboBox -// [SECTION] Data Type and Data Formatting Helpers -// [SECTION] Widgets: DragScalar, DragFloat, DragInt, etc. -// [SECTION] Widgets: SliderScalar, SliderFloat, SliderInt, etc. -// [SECTION] Widgets: InputScalar, InputFloat, InputInt, etc. -// [SECTION] Widgets: InputText, InputTextMultiline -// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc. -// [SECTION] Widgets: TreeNode, CollapsingHeader, etc. -// [SECTION] Widgets: Selectable -// [SECTION] Widgets: ListBox -// [SECTION] Widgets: PlotLines, PlotHistogram -// [SECTION] Widgets: Value helpers -// [SECTION] Widgets: MenuItem, BeginMenu, EndMenu, etc. -// [SECTION] Widgets: BeginTabBar, EndTabBar, etc. -// [SECTION] Widgets: BeginTabItem, EndTabItem, etc. -// [SECTION] Widgets: Columns, BeginColumns, EndColumns, etc. - -*/ - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include "imgui.h" -#ifndef IMGUI_DISABLE - -#ifndef IMGUI_DEFINE_MATH_OPERATORS -#define IMGUI_DEFINE_MATH_OPERATORS -#endif -#include "imgui_internal.h" - -#include // toupper -#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier -#include // intptr_t -#else -#include // intptr_t -#endif - -// Visual Studio warnings -#ifdef _MSC_VER -#pragma warning (disable: 4127) // condition expression is constant -#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen -#if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later -#pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types -#endif -#endif - -// Clang/GCC warnings with -Weverything -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. -#pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok. -#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code. -#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // -#if __has_warning("-Wzero-as-null-pointer-constant") -#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 -#endif -#if __has_warning("-Wdouble-promotion") -#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. -#endif -#if __has_warning("-Wdeprecated-enum-enum-conversion") -#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated -#endif -#elif defined(__GNUC__) -#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind -#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked -#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead -#endif - -//------------------------------------------------------------------------- -// Data -//------------------------------------------------------------------------- - -// Those MIN/MAX values are not define because we need to point to them -static const signed char IM_S8_MIN = -128; -static const signed char IM_S8_MAX = 127; -static const unsigned char IM_U8_MIN = 0; -static const unsigned char IM_U8_MAX = 0xFF; -static const signed short IM_S16_MIN = -32768; -static const signed short IM_S16_MAX = 32767; -static const unsigned short IM_U16_MIN = 0; -static const unsigned short IM_U16_MAX = 0xFFFF; -static const ImS32 IM_S32_MIN = INT_MIN; // (-2147483647 - 1), (0x80000000); -static const ImS32 IM_S32_MAX = INT_MAX; // (2147483647), (0x7FFFFFFF) -static const ImU32 IM_U32_MIN = 0; -static const ImU32 IM_U32_MAX = UINT_MAX; // (0xFFFFFFFF) -#ifdef LLONG_MIN -static const ImS64 IM_S64_MIN = LLONG_MIN; // (-9223372036854775807ll - 1ll); -static const ImS64 IM_S64_MAX = LLONG_MAX; // (9223372036854775807ll); -#else -static const ImS64 IM_S64_MIN = -9223372036854775807LL - 1; -static const ImS64 IM_S64_MAX = 9223372036854775807LL; -#endif -static const ImU64 IM_U64_MIN = 0; -#ifdef ULLONG_MAX -static const ImU64 IM_U64_MAX = ULLONG_MAX; // (0xFFFFFFFFFFFFFFFFull); -#else -static const ImU64 IM_U64_MAX = (2ULL * 9223372036854775807LL + 1); -#endif - -//------------------------------------------------------------------------- -// [SECTION] Forward Declarations -//------------------------------------------------------------------------- - -// For InputTextEx() -static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data); -static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end); -static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Text, etc. -//------------------------------------------------------------------------- -// - TextEx() [Internal] -// - TextUnformatted() -// - Text() -// - TextV() -// - TextColored() -// - TextColoredV() -// - TextDisabled() -// - TextDisabledV() -// - TextWrapped() -// - TextWrappedV() -// - LabelText() -// - LabelTextV() -// - BulletText() -// - BulletTextV() -//------------------------------------------------------------------------- - -void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - IM_ASSERT(text != NULL); - const char* text_begin = text; - if (text_end == NULL) - text_end = text + strlen(text); // FIXME-OPT - - const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); - const float wrap_pos_x = window->DC.TextWrapPos; - const bool wrap_enabled = (wrap_pos_x >= 0.0f); - if (text_end - text > 2000 && !wrap_enabled) - { - // Long text! - // Perform manual coarse clipping to optimize for long multi-line text - // - From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled. - // - We also don't vertically center the text within the line full height, which is unlikely to matter because we are likely the biggest and only item on the line. - // - We use memchr(), pay attention that well optimized versions of those str/mem functions are much faster than a casually written loop. - const char* line = text; - const float line_height = GetTextLineHeight(); - ImVec2 text_size(0,0); - - // Lines to skip (can't skip when logging text) - ImVec2 pos = text_pos; - if (!g.LogEnabled) - { - int lines_skippable = (int)((window->ClipRect.Min.y - text_pos.y) / line_height); - if (lines_skippable > 0) - { - int lines_skipped = 0; - while (line < text_end && lines_skipped < lines_skippable) - { - const char* line_end = (const char*)memchr(line, '\n', text_end - line); - if (!line_end) - line_end = text_end; - if ((flags & ImGuiTextFlags_NoWidthForLargeClippedText) == 0) - text_size.x = ImMax(text_size.x, CalcTextSize(line, line_end).x); - line = line_end + 1; - lines_skipped++; - } - pos.y += lines_skipped * line_height; - } - } - - // Lines to render - if (line < text_end) - { - ImRect line_rect(pos, pos + ImVec2(FLT_MAX, line_height)); - while (line < text_end) - { - if (IsClippedEx(line_rect, 0, false)) - break; - - const char* line_end = (const char*)memchr(line, '\n', text_end - line); - if (!line_end) - line_end = text_end; - text_size.x = ImMax(text_size.x, CalcTextSize(line, line_end).x); - RenderText(pos, line, line_end, false); - line = line_end + 1; - line_rect.Min.y += line_height; - line_rect.Max.y += line_height; - pos.y += line_height; - } - - // Count remaining lines - int lines_skipped = 0; - while (line < text_end) - { - const char* line_end = (const char*)memchr(line, '\n', text_end - line); - if (!line_end) - line_end = text_end; - if ((flags & ImGuiTextFlags_NoWidthForLargeClippedText) == 0) - text_size.x = ImMax(text_size.x, CalcTextSize(line, line_end).x); - line = line_end + 1; - lines_skipped++; - } - pos.y += lines_skipped * line_height; - } - text_size.y = (pos - text_pos).y; - - ImRect bb(text_pos, text_pos + text_size); - ItemSize(text_size, 0.0f); - ItemAdd(bb, 0); - } - else - { - const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f; - const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width); - - ImRect bb(text_pos, text_pos + text_size); - ItemSize(text_size, 0.0f); - if (!ItemAdd(bb, 0)) - return; - - // Render (we don't hide text after ## in this end-user function) - RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width); - } -} - -void ImGui::TextUnformatted(const char* text, const char* text_end) -{ - TextEx(text, text_end, ImGuiTextFlags_NoWidthForLargeClippedText); -} - -void ImGui::Text(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - TextV(fmt, args); - va_end(args); -} - -void ImGui::TextV(const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); - TextEx(g.TempBuffer, text_end, ImGuiTextFlags_NoWidthForLargeClippedText); -} - -void ImGui::TextColored(const ImVec4& col, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - TextColoredV(col, fmt, args); - va_end(args); -} - -void ImGui::TextColoredV(const ImVec4& col, const char* fmt, va_list args) -{ - PushStyleColor(ImGuiCol_Text, col); - TextV(fmt, args); - PopStyleColor(); -} - -void ImGui::TextDisabled(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - TextDisabledV(fmt, args); - va_end(args); -} - -void ImGui::TextDisabledV(const char* fmt, va_list args) -{ - PushStyleColor(ImGuiCol_Text, GImGui->Style.Colors[ImGuiCol_TextDisabled]); - TextV(fmt, args); - PopStyleColor(); -} - -void ImGui::TextWrapped(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - TextWrappedV(fmt, args); - va_end(args); -} - -void ImGui::TextWrappedV(const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - bool need_backup = (window->DC.TextWrapPos < 0.0f); // Keep existing wrap position if one is already set - if (need_backup) - PushTextWrapPos(0.0f); - TextV(fmt, args); - if (need_backup) - PopTextWrapPos(); -} - -void ImGui::LabelText(const char* label, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - LabelTextV(label, fmt, args); - va_end(args); -} - -// Add a label+text combo aligned to other label+value widgets -void ImGui::LabelTextV(const char* label, const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const float w = CalcItemWidth(); - - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2)); - const ImRect total_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + (label_size.x > 0.0f ? style.ItemInnerSpacing.x : 0.0f), style.FramePadding.y*2) + label_size); - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, 0)) - return; - - // Render - const char* value_text_begin = &g.TempBuffer[0]; - const char* value_text_end = value_text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); - RenderTextClipped(value_bb.Min, value_bb.Max, value_text_begin, value_text_end, NULL, ImVec2(0.0f,0.5f)); - if (label_size.x > 0.0f) - RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y + style.FramePadding.y), label); -} - -void ImGui::BulletText(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - BulletTextV(fmt, args); - va_end(args); -} - -// Text with a little bullet aligned to the typical tree node. -void ImGui::BulletTextV(const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - - const char* text_begin = g.TempBuffer; - const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); - const ImVec2 label_size = CalcTextSize(text_begin, text_end, false); - const ImVec2 total_size = ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x * 2) : 0.0f), label_size.y); // Empty text doesn't add padding - ImVec2 pos = window->DC.CursorPos; - pos.y += window->DC.CurrLineTextBaseOffset; - ItemSize(total_size, 0.0f); - const ImRect bb(pos, pos + total_size); - if (!ItemAdd(bb, 0)) - return; - - // Render - ImU32 text_col = GetColorU32(ImGuiCol_Text); - RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, g.FontSize*0.5f), text_col); - RenderText(bb.Min + ImVec2(g.FontSize + style.FramePadding.x * 2, 0.0f), text_begin, text_end, false); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Main -//------------------------------------------------------------------------- -// - ButtonBehavior() [Internal] -// - Button() -// - SmallButton() -// - InvisibleButton() -// - ArrowButton() -// - CloseButton() [Internal] -// - CollapseButton() [Internal] -// - GetWindowScrollbarID() [Internal] -// - GetWindowScrollbarRect() [Internal] -// - Scrollbar() [Internal] -// - ScrollbarEx() [Internal] -// - Image() -// - ImageButton() -// - Checkbox() -// - CheckboxFlags() -// - RadioButton() -// - ProgressBar() -// - Bullet() -//------------------------------------------------------------------------- - -// The ButtonBehavior() function is key to many interactions and used by many/most widgets. -// Because we handle so many cases (keyboard/gamepad navigation, drag and drop) and many specific behavior (via ImGuiButtonFlags_), -// this code is a little complex. -// By far the most common path is interacting with the Mouse using the default ImGuiButtonFlags_PressedOnClickRelease button behavior. -// See the series of events below and the corresponding state reported by dear imgui: -//------------------------------------------------------------------------------------------------------------------------------------------------ -// with PressedOnClickRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked() -// Frame N+0 (mouse is outside bb) - - - - - - -// Frame N+1 (mouse moves inside bb) - true - - - - -// Frame N+2 (mouse button is down) - true true true - true -// Frame N+3 (mouse button is down) - true true - - - -// Frame N+4 (mouse moves outside bb) - - true - - - -// Frame N+5 (mouse moves inside bb) - true true - - - -// Frame N+6 (mouse button is released) true true - - true - -// Frame N+7 (mouse button is released) - true - - - - -// Frame N+8 (mouse moves outside bb) - - - - - - -//------------------------------------------------------------------------------------------------------------------------------------------------ -// with PressedOnClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked() -// Frame N+2 (mouse button is down) true true true true - true -// Frame N+3 (mouse button is down) - true true - - - -// Frame N+6 (mouse button is released) - true - - true - -// Frame N+7 (mouse button is released) - true - - - - -//------------------------------------------------------------------------------------------------------------------------------------------------ -// with PressedOnRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked() -// Frame N+2 (mouse button is down) - true - - - true -// Frame N+3 (mouse button is down) - true - - - - -// Frame N+6 (mouse button is released) true true - - - - -// Frame N+7 (mouse button is released) - true - - - - -//------------------------------------------------------------------------------------------------------------------------------------------------ -// with PressedOnDoubleClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked() -// Frame N+0 (mouse button is down) - true - - - true -// Frame N+1 (mouse button is down) - true - - - - -// Frame N+2 (mouse button is released) - true - - - - -// Frame N+3 (mouse button is released) - true - - - - -// Frame N+4 (mouse button is down) true true true true - true -// Frame N+5 (mouse button is down) - true true - - - -// Frame N+6 (mouse button is released) - true - - true - -// Frame N+7 (mouse button is released) - true - - - - -//------------------------------------------------------------------------------------------------------------------------------------------------ -// Note that some combinations are supported, -// - PressedOnDragDropHold can generally be associated with any flag. -// - PressedOnDoubleClick can be associated by PressedOnClickRelease/PressedOnRelease, in which case the second release event won't be reported. -//------------------------------------------------------------------------------------------------------------------------------------------------ -// The behavior of the return-value changes when ImGuiButtonFlags_Repeat is set: -// Repeat+ Repeat+ Repeat+ Repeat+ -// PressedOnClickRelease PressedOnClick PressedOnRelease PressedOnDoubleClick -//------------------------------------------------------------------------------------------------------------------------------------------------- -// Frame N+0 (mouse button is down) - true - true -// ... - - - - -// Frame N + RepeatDelay true true - true -// ... - - - - -// Frame N + RepeatDelay + RepeatRate*N true true - true -//------------------------------------------------------------------------------------------------------------------------------------------------- - -bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - - if (flags & ImGuiButtonFlags_Disabled) - { - if (out_hovered) *out_hovered = false; - if (out_held) *out_held = false; - if (g.ActiveId == id) ClearActiveID(); - return false; - } - - // Default only reacts to left mouse button - if ((flags & ImGuiButtonFlags_MouseButtonMask_) == 0) - flags |= ImGuiButtonFlags_MouseButtonDefault_; - - // Default behavior requires click + release inside bounding box - if ((flags & ImGuiButtonFlags_PressedOnMask_) == 0) - flags |= ImGuiButtonFlags_PressedOnDefault_; - - ImGuiWindow* backup_hovered_window = g.HoveredWindow; - const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window; - if (flatten_hovered_children) - g.HoveredWindow = window; - -#ifdef IMGUI_ENABLE_TEST_ENGINE - if (id != 0 && window->DC.LastItemId != id) - ImGuiTestEngineHook_ItemAdd(&g, bb, id); -#endif - - bool pressed = false; - bool hovered = ItemHoverable(bb, id); - - // Drag source doesn't report as hovered - if (hovered && g.DragDropActive && g.DragDropPayload.SourceId == id && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoDisableHover)) - hovered = false; - - // Special mode for Drag and Drop where holding button pressed for a long time while dragging another item triggers the button - if (g.DragDropActive && (flags & ImGuiButtonFlags_PressedOnDragDropHold) && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoHoldToOpenOthers)) - if (IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) - { - hovered = true; - SetHoveredID(id); - if (CalcTypematicRepeatAmount(g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, g.HoveredIdTimer + 0.0001f, 0.70f, 0.00f)) - { - pressed = true; - FocusWindow(window); - } - } - - if (flatten_hovered_children) - g.HoveredWindow = backup_hovered_window; - - // AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one. - if (hovered && (flags & ImGuiButtonFlags_AllowItemOverlap) && (g.HoveredIdPreviousFrame != id && g.HoveredIdPreviousFrame != 0)) - hovered = false; - - // Mouse handling - if (hovered) - { - if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt)) - { - // Poll buttons - int mouse_button_clicked = -1; - int mouse_button_released = -1; - if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseClicked[0]) { mouse_button_clicked = 0; } - else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseClicked[1]) { mouse_button_clicked = 1; } - else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && g.IO.MouseClicked[2]) { mouse_button_clicked = 2; } - if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseReleased[0]) { mouse_button_released = 0; } - else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseReleased[1]) { mouse_button_released = 1; } - else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && g.IO.MouseReleased[2]) { mouse_button_released = 2; } - - if (mouse_button_clicked != -1 && g.ActiveId != id) - { - if (flags & (ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere)) - { - SetActiveID(id, window); - g.ActiveIdMouseButton = mouse_button_clicked; - if (!(flags & ImGuiButtonFlags_NoNavFocus)) - SetFocusID(id, window); - FocusWindow(window); - } - if ((flags & ImGuiButtonFlags_PressedOnClick) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDoubleClicked[mouse_button_clicked])) - { - pressed = true; - if (flags & ImGuiButtonFlags_NoHoldingActiveId) - ClearActiveID(); - else - SetActiveID(id, window); // Hold on ID - g.ActiveIdMouseButton = mouse_button_clicked; - FocusWindow(window); - } - } - if ((flags & ImGuiButtonFlags_PressedOnRelease) && mouse_button_released != -1) - { - // Repeat mode trumps on release behavior - if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button_released] >= g.IO.KeyRepeatDelay)) - pressed = true; - ClearActiveID(); - } - - // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above). - // Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings. - if (g.ActiveId == id && (flags & ImGuiButtonFlags_Repeat)) - if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, true)) - pressed = true; - } - - if (pressed) - g.NavDisableHighlight = true; - } - - // Gamepad/Keyboard navigation - // We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse. - if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId)) - if (!(flags & ImGuiButtonFlags_NoHoveredOnFocus)) - hovered = true; - if (g.NavActivateDownId == id) - { - bool nav_activated_by_code = (g.NavActivateId == id); - bool nav_activated_by_inputs = IsNavInputTest(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed); - if (nav_activated_by_code || nav_activated_by_inputs) - pressed = true; - if (nav_activated_by_code || nav_activated_by_inputs || g.ActiveId == id) - { - // Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button. - g.NavActivateId = id; // This is so SetActiveId assign a Nav source - SetActiveID(id, window); - if ((nav_activated_by_code || nav_activated_by_inputs) && !(flags & ImGuiButtonFlags_NoNavFocus)) - SetFocusID(id, window); - } - } - - bool held = false; - if (g.ActiveId == id) - { - if (g.ActiveIdSource == ImGuiInputSource_Mouse) - { - if (g.ActiveIdIsJustActivated) - g.ActiveIdClickOffset = g.IO.MousePos - bb.Min; - - const int mouse_button = g.ActiveIdMouseButton; - IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT); - if (g.IO.MouseDown[mouse_button]) - { - held = true; - } - else - { - bool release_in = hovered && (flags & ImGuiButtonFlags_PressedOnClickRelease) != 0; - bool release_anywhere = (flags & ImGuiButtonFlags_PressedOnClickReleaseAnywhere) != 0; - if ((release_in || release_anywhere) && !g.DragDropActive) - { - bool is_double_click_release = (flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDownWasDoubleClick[mouse_button]; - bool is_repeating_already = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button] >= g.IO.KeyRepeatDelay; // Repeat mode trumps - if (!is_double_click_release && !is_repeating_already) - pressed = true; - } - ClearActiveID(); - } - if (!(flags & ImGuiButtonFlags_NoNavFocus)) - g.NavDisableHighlight = true; - } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) - { - if (g.NavActivateDownId != id) - ClearActiveID(); - } - if (pressed) - g.ActiveIdHasBeenPressedBefore = true; - } - - if (out_hovered) *out_hovered = hovered; - if (out_held) *out_held = held; - - return pressed; -} - -bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - - ImVec2 pos = window->DC.CursorPos; - if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag) - pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y; - ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f); - - const ImRect bb(pos, pos + size); - ItemSize(size, style.FramePadding.y); - if (!ItemAdd(bb, id)) - return false; - - if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) - flags |= ImGuiButtonFlags_Repeat; - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); - - // Render - const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - RenderNavHighlight(bb, id); - RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding); - RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb); - - // Automatically close popups - //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup)) - // CloseCurrentPopup(); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); - return pressed; -} - -bool ImGui::Button(const char* label, const ImVec2& size_arg) -{ - return ButtonEx(label, size_arg, 0); -} - -// Small buttons fits within text without additional vertical spacing. -bool ImGui::SmallButton(const char* label) -{ - ImGuiContext& g = *GImGui; - float backup_padding_y = g.Style.FramePadding.y; - g.Style.FramePadding.y = 0.0f; - bool pressed = ButtonEx(label, ImVec2(0, 0), ImGuiButtonFlags_AlignTextBaseLine); - g.Style.FramePadding.y = backup_padding_y; - return pressed; -} - -// Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack. -// Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id) -bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - // Cannot use zero-size for InvisibleButton(). Unlike Button() there is not way to fallback using the label size. - IM_ASSERT(size_arg.x != 0.0f && size_arg.y != 0.0f); - - const ImGuiID id = window->GetID(str_id); - ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f); - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - ItemSize(size); - if (!ItemAdd(bb, id)) - return false; - - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held); - - return pressed; -} - -bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiButtonFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiID id = window->GetID(str_id); - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - const float default_size = GetFrameHeight(); - ItemSize(size, (size.y >= default_size) ? g.Style.FramePadding.y : -1.0f); - if (!ItemAdd(bb, id)) - return false; - - if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) - flags |= ImGuiButtonFlags_Repeat; - - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); - - // Render - const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - const ImU32 text_col = GetColorU32(ImGuiCol_Text); - RenderNavHighlight(bb, id); - RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding); - RenderArrow(window->DrawList, bb.Min + ImVec2(ImMax(0.0f, (size.x - g.FontSize) * 0.5f), ImMax(0.0f, (size.y - g.FontSize) * 0.5f)), text_col, dir); - - return pressed; -} - -bool ImGui::ArrowButton(const char* str_id, ImGuiDir dir) -{ - float sz = GetFrameHeight(); - return ArrowButtonEx(str_id, dir, ImVec2(sz, sz), ImGuiButtonFlags_None); -} - -// Button to close a window -bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)//, float size) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - // We intentionally allow interaction when clipped so that a mechanical Alt,Right,Validate sequence close a window. - // (this isn't the regular behavior of buttons, but it doesn't affect the user much because navigation tends to keep items visible). - const ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f); - bool is_clipped = !ItemAdd(bb, id); - - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held); - if (is_clipped) - return pressed; - - // Render - ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered); - ImVec2 center = bb.GetCenter(); - if (hovered) - window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col, 12); - - float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f; - ImU32 cross_col = GetColorU32(ImGuiCol_Text); - center -= ImVec2(0.5f, 0.5f); - window->DrawList->AddLine(center + ImVec2(+cross_extent,+cross_extent), center + ImVec2(-cross_extent,-cross_extent), cross_col, 1.0f); - window->DrawList->AddLine(center + ImVec2(+cross_extent,-cross_extent), center + ImVec2(-cross_extent,+cross_extent), cross_col, 1.0f); - - return pressed; -} - -bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f); - ItemAdd(bb, id); - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_None); - - // Render - ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - ImU32 text_col = GetColorU32(ImGuiCol_Text); - ImVec2 center = bb.GetCenter(); - if (hovered || held) - window->DrawList->AddCircleFilled(center/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col, 12); - RenderArrow(window->DrawList, bb.Min + g.Style.FramePadding, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f); - - // Switch to moving the window after mouse is moved beyond the initial drag threshold - if (IsItemActive() && IsMouseDragging(0)) - StartMouseMovingWindow(window); - - return pressed; -} - -ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis) -{ - return window->GetIDNoKeepAlive(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY"); -} - -// Return scrollbar rectangle, must only be called for corresponding axis if window->ScrollbarX/Y is set. -ImRect ImGui::GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis) -{ - const ImRect outer_rect = window->Rect(); - const ImRect inner_rect = window->InnerRect; - const float border_size = window->WindowBorderSize; - const float scrollbar_size = window->ScrollbarSizes[axis ^ 1]; // (ScrollbarSizes.x = width of Y scrollbar; ScrollbarSizes.y = height of X scrollbar) - IM_ASSERT(scrollbar_size > 0.0f); - if (axis == ImGuiAxis_X) - return ImRect(inner_rect.Min.x, ImMax(outer_rect.Min.y, outer_rect.Max.y - border_size - scrollbar_size), inner_rect.Max.x, outer_rect.Max.y); - else - return ImRect(ImMax(outer_rect.Min.x, outer_rect.Max.x - border_size - scrollbar_size), inner_rect.Min.y, outer_rect.Max.x, inner_rect.Max.y); -} - -void ImGui::Scrollbar(ImGuiAxis axis) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - const ImGuiID id = GetWindowScrollbarID(window, axis); - KeepAliveID(id); - - // Calculate scrollbar bounding box - ImRect bb = GetWindowScrollbarRect(window, axis); - ImDrawCornerFlags rounding_corners = 0; - if (axis == ImGuiAxis_X) - { - rounding_corners |= ImDrawCornerFlags_BotLeft; - if (!window->ScrollbarY) - rounding_corners |= ImDrawCornerFlags_BotRight; - } - else - { - if ((window->Flags & ImGuiWindowFlags_NoTitleBar) && !(window->Flags & ImGuiWindowFlags_MenuBar)) - rounding_corners |= ImDrawCornerFlags_TopRight; - if (!window->ScrollbarX) - rounding_corners |= ImDrawCornerFlags_BotRight; - } - float size_avail = window->InnerRect.Max[axis] - window->InnerRect.Min[axis]; - float size_contents = window->ContentSize[axis] + window->WindowPadding[axis] * 2.0f; - ScrollbarEx(bb, id, axis, &window->Scroll[axis], size_avail, size_contents, rounding_corners); -} - -// Vertical/Horizontal scrollbar -// The entire piece of code below is rather confusing because: -// - We handle absolute seeking (when first clicking outside the grab) and relative manipulation (afterward or when clicking inside the grab) -// - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar -// - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal. -// Still, the code should probably be made simpler.. -bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, float* p_scroll_v, float size_avail_v, float size_contents_v, ImDrawCornerFlags rounding_corners) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - - const float bb_frame_width = bb_frame.GetWidth(); - const float bb_frame_height = bb_frame.GetHeight(); - if (bb_frame_width <= 0.0f || bb_frame_height <= 0.0f) - return false; - - // When we are too small, start hiding and disabling the grab (this reduce visual noise on very small window and facilitate using the window resize grab) - float alpha = 1.0f; - if ((axis == ImGuiAxis_Y) && bb_frame_height < g.FontSize + g.Style.FramePadding.y * 2.0f) - alpha = ImSaturate((bb_frame_height - g.FontSize) / (g.Style.FramePadding.y * 2.0f)); - if (alpha <= 0.0f) - return false; - - const ImGuiStyle& style = g.Style; - const bool allow_interaction = (alpha >= 1.0f); - - ImRect bb = bb_frame; - bb.Expand(ImVec2(-ImClamp(IM_FLOOR((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_FLOOR((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f))); - - // V denote the main, longer axis of the scrollbar (= height for a vertical scrollbar) - const float scrollbar_size_v = (axis == ImGuiAxis_X) ? bb.GetWidth() : bb.GetHeight(); - - // Calculate the height of our grabbable box. It generally represent the amount visible (vs the total scrollable amount) - // But we maintain a minimum size in pixel to allow for the user to still aim inside. - IM_ASSERT(ImMax(size_contents_v, size_avail_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers. - const float win_size_v = ImMax(ImMax(size_contents_v, size_avail_v), 1.0f); - const float grab_h_pixels = ImClamp(scrollbar_size_v * (size_avail_v / win_size_v), style.GrabMinSize, scrollbar_size_v); - const float grab_h_norm = grab_h_pixels / scrollbar_size_v; - - // Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar(). - bool held = false; - bool hovered = false; - ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_NoNavFocus); - - float scroll_max = ImMax(1.0f, size_contents_v - size_avail_v); - float scroll_ratio = ImSaturate(*p_scroll_v / scroll_max); - float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; // Grab position in normalized space - if (held && allow_interaction && grab_h_norm < 1.0f) - { - float scrollbar_pos_v = bb.Min[axis]; - float mouse_pos_v = g.IO.MousePos[axis]; - - // Click position in scrollbar normalized space (0.0f->1.0f) - const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v); - SetHoveredID(id); - - bool seek_absolute = false; - if (g.ActiveIdIsJustActivated) - { - // On initial click calculate the distance between mouse and the center of the grab - seek_absolute = (clicked_v_norm < grab_v_norm || clicked_v_norm > grab_v_norm + grab_h_norm); - if (seek_absolute) - g.ScrollbarClickDeltaToGrabCenter = 0.0f; - else - g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f; - } - - // Apply scroll (p_scroll_v will generally point on one member of window->Scroll) - // It is ok to modify Scroll here because we are being called in Begin() after the calculation of ContentSize and before setting up our starting position - const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm)); - *p_scroll_v = IM_ROUND(scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v)); - - // Update values for rendering - scroll_ratio = ImSaturate(*p_scroll_v / scroll_max); - grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; - - // Update distance to grab now that we have seeked and saturated - if (seek_absolute) - g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f; - } - - // Render - const ImU32 bg_col = GetColorU32(ImGuiCol_ScrollbarBg); - const ImU32 grab_col = GetColorU32(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab, alpha); - window->DrawList->AddRectFilled(bb_frame.Min, bb_frame.Max, bg_col, window->WindowRounding, rounding_corners); - ImRect grab_rect; - if (axis == ImGuiAxis_X) - grab_rect = ImRect(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm), bb.Min.y, ImLerp(bb.Min.x, bb.Max.x, grab_v_norm) + grab_h_pixels, bb.Max.y); - else - grab_rect = ImRect(bb.Min.x, ImLerp(bb.Min.y, bb.Max.y, grab_v_norm), bb.Max.x, ImLerp(bb.Min.y, bb.Max.y, grab_v_norm) + grab_h_pixels); - window->DrawList->AddRectFilled(grab_rect.Min, grab_rect.Max, grab_col, style.ScrollbarRounding); - - return held; -} - -void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - if (border_col.w > 0.0f) - bb.Max += ImVec2(2, 2); - ItemSize(bb); - if (!ItemAdd(bb, 0)) - return; - - if (border_col.w > 0.0f) - { - window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f); - window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col)); - } - else - { - window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col)); - } -} - -// frame_padding < 0: uses FramePadding from style (default) -// frame_padding = 0: no framing -// frame_padding > 0: set framing size -// The color used are the button colors. -bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - - // Default to using texture ID as ID. User can still push string/integer prefixes. - // We could hash the size/uv to create a unique ID but that would prevent the user from animating UV. - PushID((void*)(intptr_t)user_texture_id); - const ImGuiID id = window->GetID("#image"); - PopID(); - - const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding; - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2); - const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size); - ItemSize(bb); - if (!ItemAdd(bb, id)) - return false; - - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held); - - // Render - const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - RenderNavHighlight(bb, id); - RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, style.FrameRounding)); - if (bg_col.w > 0.0f) - window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, GetColorU32(bg_col)); - window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, GetColorU32(tint_col)); - - return pressed; -} - -bool ImGui::Checkbox(const char* label, bool* v) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - - const float square_sz = GetFrameHeight(); - const ImVec2 pos = window->DC.CursorPos; - const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f)); - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id)) - return false; - - bool hovered, held; - bool pressed = ButtonBehavior(total_bb, id, &hovered, &held); - if (pressed) - { - *v = !(*v); - MarkItemEdited(id); - } - - const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz)); - RenderNavHighlight(total_bb, id); - RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding); - ImU32 check_col = GetColorU32(ImGuiCol_CheckMark); - if (window->DC.ItemFlags & ImGuiItemFlags_MixedValue) - { - // Undocumented tristate/mixed/indeterminate checkbox (#2644) - ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f))); - window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding); - } - else if (*v) - { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad*2.0f); - } - - if (g.LogEnabled) - LogRenderedText(&total_bb.Min, *v ? "[x]" : "[ ]"); - if (label_size.x > 0.0f) - RenderText(ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y), label); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); - return pressed; -} - -bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value) -{ - bool v = ((*flags & flags_value) == flags_value); - bool pressed = Checkbox(label, &v); - if (pressed) - { - if (v) - *flags |= flags_value; - else - *flags &= ~flags_value; - } - - return pressed; -} - -bool ImGui::RadioButton(const char* label, bool active) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - - const float square_sz = GetFrameHeight(); - const ImVec2 pos = window->DC.CursorPos; - const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz)); - const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f)); - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id)) - return false; - - ImVec2 center = check_bb.GetCenter(); - center.x = IM_ROUND(center.x); - center.y = IM_ROUND(center.y); - const float radius = (square_sz - 1.0f) * 0.5f; - - bool hovered, held; - bool pressed = ButtonBehavior(total_bb, id, &hovered, &held); - if (pressed) - MarkItemEdited(id); - - RenderNavHighlight(total_bb, id); - window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16); - if (active) - { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16); - } - - if (style.FrameBorderSize > 0.0f) - { - window->DrawList->AddCircle(center + ImVec2(1,1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize); - window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize); - } - - if (g.LogEnabled) - LogRenderedText(&total_bb.Min, active ? "(x)" : "( )"); - if (label_size.x > 0.0f) - RenderText(ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y), label); - - return pressed; -} - -// FIXME: This would work nicely if it was a public template, e.g. 'template RadioButton(const char* label, T* v, T v_button)', but I'm not sure how we would expose it.. -bool ImGui::RadioButton(const char* label, int* v, int v_button) -{ - const bool pressed = RadioButton(label, *v == v_button); - if (pressed) - *v = v_button; - return pressed; -} - -// size_arg (for each axis) < 0.0f: align to end, 0.0f: auto, > 0.0f: specified size -void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* overlay) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - - ImVec2 pos = window->DC.CursorPos; - ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), g.FontSize + style.FramePadding.y*2.0f); - ImRect bb(pos, pos + size); - ItemSize(size, style.FramePadding.y); - if (!ItemAdd(bb, 0)) - return; - - // Render - fraction = ImSaturate(fraction); - RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); - bb.Expand(ImVec2(-style.FrameBorderSize, -style.FrameBorderSize)); - const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y); - RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding); - - // Default displaying the fraction as percentage string, but user can override it - char overlay_buf[32]; - if (!overlay) - { - ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction*100+0.01f); - overlay = overlay_buf; - } - - ImVec2 overlay_size = CalcTextSize(overlay, NULL); - if (overlay_size.x > 0.0f) - RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f,0.5f), &bb); -} - -void ImGui::Bullet() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const float line_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + g.Style.FramePadding.y*2), g.FontSize); - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize, line_height)); - ItemSize(bb); - if (!ItemAdd(bb, 0)) - { - SameLine(0, style.FramePadding.x*2); - return; - } - - // Render and stay on same line - ImU32 text_col = GetColorU32(ImGuiCol_Text); - RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, line_height*0.5f), text_col); - SameLine(0, style.FramePadding.x * 2.0f); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Low-level Layout helpers -//------------------------------------------------------------------------- -// - Spacing() -// - Dummy() -// - NewLine() -// - AlignTextToFramePadding() -// - SeparatorEx() [Internal] -// - Separator() -// - SplitterBehavior() [Internal] -// - ShrinkWidths() [Internal] -//------------------------------------------------------------------------- - -void ImGui::Spacing() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - ItemSize(ImVec2(0,0)); -} - -void ImGui::Dummy(const ImVec2& size) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - ItemSize(size); - ItemAdd(bb, 0); -} - -void ImGui::NewLine() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - const ImGuiLayoutType backup_layout_type = window->DC.LayoutType; - window->DC.LayoutType = ImGuiLayoutType_Vertical; - if (window->DC.CurrLineSize.y > 0.0f) // In the event that we are on a line with items that is smaller that FontSize high, we will preserve its height. - ItemSize(ImVec2(0,0)); - else - ItemSize(ImVec2(0.0f, g.FontSize)); - window->DC.LayoutType = backup_layout_type; -} - -void ImGui::AlignTextToFramePadding() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - window->DC.CurrLineSize.y = ImMax(window->DC.CurrLineSize.y, g.FontSize + g.Style.FramePadding.y * 2); - window->DC.CurrLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, g.Style.FramePadding.y); -} - -// Horizontal/vertical separating line -void ImGui::SeparatorEx(ImGuiSeparatorFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImGuiContext& g = *GImGui; - IM_ASSERT(ImIsPowerOfTwo(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical))); // Check that only 1 option is selected - - float thickness_draw = 1.0f; - float thickness_layout = 0.0f; - if (flags & ImGuiSeparatorFlags_Vertical) - { - // Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout. - float y1 = window->DC.CursorPos.y; - float y2 = window->DC.CursorPos.y + window->DC.CurrLineSize.y; - const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + thickness_draw, y2)); - ItemSize(ImVec2(thickness_layout, 0.0f)); - if (!ItemAdd(bb, 0)) - return; - - // Draw - window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator)); - if (g.LogEnabled) - LogText(" |"); - } - else if (flags & ImGuiSeparatorFlags_Horizontal) - { - // Horizontal Separator - float x1 = window->Pos.x; - float x2 = window->Pos.x + window->Size.x; - if (!window->DC.GroupStack.empty()) - x1 += window->DC.Indent.x; - - ImGuiColumns* columns = (flags & ImGuiSeparatorFlags_SpanAllColumns) ? window->DC.CurrentColumns : NULL; - if (columns) - PushColumnsBackground(); - - // We don't provide our width to the layout so that it doesn't get feed back into AutoFit - const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness_draw)); - ItemSize(ImVec2(0.0f, thickness_layout)); - const bool item_visible = ItemAdd(bb, 0); - if (item_visible) - { - // Draw - window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x, bb.Min.y), GetColorU32(ImGuiCol_Separator)); - if (g.LogEnabled) - LogRenderedText(&bb.Min, "--------------------------------"); - } - if (columns) - { - PopColumnsBackground(); - columns->LineMinY = window->DC.CursorPos.y; - } - } -} - -void ImGui::Separator() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return; - - // Those flags should eventually be overridable by the user - ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal; - flags |= ImGuiSeparatorFlags_SpanAllColumns; - SeparatorEx(flags); -} - -// Using 'hover_visibility_delay' allows us to hide the highlight and mouse cursor for a short time, which can be convenient to reduce visual noise. -bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags; - window->DC.ItemFlags |= ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus; - bool item_add = ItemAdd(bb, id); - window->DC.ItemFlags = item_flags_backup; - if (!item_add) - return false; - - bool hovered, held; - ImRect bb_interact = bb; - bb_interact.Expand(axis == ImGuiAxis_Y ? ImVec2(0.0f, hover_extend) : ImVec2(hover_extend, 0.0f)); - ButtonBehavior(bb_interact, id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap); - if (g.ActiveId != id) - SetItemAllowOverlap(); - - if (held || (g.HoveredId == id && g.HoveredIdPreviousFrame == id && g.HoveredIdTimer >= hover_visibility_delay)) - SetMouseCursor(axis == ImGuiAxis_Y ? ImGuiMouseCursor_ResizeNS : ImGuiMouseCursor_ResizeEW); - - ImRect bb_render = bb; - if (held) - { - ImVec2 mouse_delta_2d = g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min; - float mouse_delta = (axis == ImGuiAxis_Y) ? mouse_delta_2d.y : mouse_delta_2d.x; - - // Minimum pane size - float size_1_maximum_delta = ImMax(0.0f, *size1 - min_size1); - float size_2_maximum_delta = ImMax(0.0f, *size2 - min_size2); - if (mouse_delta < -size_1_maximum_delta) - mouse_delta = -size_1_maximum_delta; - if (mouse_delta > size_2_maximum_delta) - mouse_delta = size_2_maximum_delta; - - // Apply resize - if (mouse_delta != 0.0f) - { - if (mouse_delta < 0.0f) - IM_ASSERT(*size1 + mouse_delta >= min_size1); - if (mouse_delta > 0.0f) - IM_ASSERT(*size2 - mouse_delta >= min_size2); - *size1 += mouse_delta; - *size2 -= mouse_delta; - bb_render.Translate((axis == ImGuiAxis_X) ? ImVec2(mouse_delta, 0.0f) : ImVec2(0.0f, mouse_delta)); - MarkItemEdited(id); - } - } - - // Render - const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : (hovered && g.HoveredIdTimer >= hover_visibility_delay) ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); - window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, 0.0f); - - return held; -} - -static int IMGUI_CDECL ShrinkWidthItemComparer(const void* lhs, const void* rhs) -{ - const ImGuiShrinkWidthItem* a = (const ImGuiShrinkWidthItem*)lhs; - const ImGuiShrinkWidthItem* b = (const ImGuiShrinkWidthItem*)rhs; - if (int d = (int)(b->Width - a->Width)) - return d; - return (b->Index - a->Index); -} - -// Shrink excess width from a set of item, by removing width from the larger items first. -void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess) -{ - if (count == 1) - { - items[0].Width = ImMax(items[0].Width - width_excess, 1.0f); - return; - } - ImQsort(items, (size_t)count, sizeof(ImGuiShrinkWidthItem), ShrinkWidthItemComparer); - int count_same_width = 1; - while (width_excess > 0.0f && count_same_width < count) - { - while (count_same_width < count && items[0].Width <= items[count_same_width].Width) - count_same_width++; - float max_width_to_remove_per_item = (count_same_width < count) ? (items[0].Width - items[count_same_width].Width) : (items[0].Width - 1.0f); - float width_to_remove_per_item = ImMin(width_excess / count_same_width, max_width_to_remove_per_item); - for (int item_n = 0; item_n < count_same_width; item_n++) - items[item_n].Width -= width_to_remove_per_item; - width_excess -= width_to_remove_per_item * count_same_width; - } - - // Round width and redistribute remainder left-to-right (could make it an option of the function?) - // Ensure that e.g. the right-most tab of a shrunk tab-bar always reaches exactly at the same distance from the right-most edge of the tab bar separator. - width_excess = 0.0f; - for (int n = 0; n < count; n++) - { - float width_rounded = ImFloor(items[n].Width); - width_excess += items[n].Width - width_rounded; - items[n].Width = width_rounded; - } - if (width_excess > 0.0f) - for (int n = 0; n < count; n++) - if (items[n].Index < (int)(width_excess + 0.01f)) - items[n].Width += 1.0f; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: ComboBox -//------------------------------------------------------------------------- -// - BeginCombo() -// - EndCombo() -// - Combo() -//------------------------------------------------------------------------- - -static float CalcMaxPopupHeightFromItemCount(int items_count) -{ - ImGuiContext& g = *GImGui; - if (items_count <= 0) - return FLT_MAX; - return (g.FontSize + g.Style.ItemSpacing.y) * items_count - g.Style.ItemSpacing.y + (g.Style.WindowPadding.y * 2); -} - -bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags) -{ - // Always consume the SetNextWindowSizeConstraint() call in our early return paths - ImGuiContext& g = *GImGui; - bool has_window_size_constraint = (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint) != 0; - g.NextWindowData.Flags &= ~ImGuiNextWindowDataFlags_HasSizeConstraint; - - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - IM_ASSERT((flags & (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)) != (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)); // Can't use both flags together - - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - - const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight(); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const float expected_w = CalcItemWidth(); - const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : expected_w; - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); - const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id, &frame_bb)) - return false; - - bool hovered, held; - bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held); - bool popup_open = IsPopupOpen(id); - - const ImU32 frame_col = GetColorU32(hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - const float value_x2 = ImMax(frame_bb.Min.x, frame_bb.Max.x - arrow_size); - RenderNavHighlight(frame_bb, id); - if (!(flags & ImGuiComboFlags_NoPreview)) - window->DrawList->AddRectFilled(frame_bb.Min, ImVec2(value_x2, frame_bb.Max.y), frame_col, style.FrameRounding, (flags & ImGuiComboFlags_NoArrowButton) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Left); - if (!(flags & ImGuiComboFlags_NoArrowButton)) - { - ImU32 bg_col = GetColorU32((popup_open || hovered) ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - ImU32 text_col = GetColorU32(ImGuiCol_Text); - window->DrawList->AddRectFilled(ImVec2(value_x2, frame_bb.Min.y), frame_bb.Max, bg_col, style.FrameRounding, (w <= arrow_size) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Right); - if (value_x2 + arrow_size - style.FramePadding.x <= frame_bb.Max.x) - RenderArrow(window->DrawList, ImVec2(value_x2 + style.FramePadding.y, frame_bb.Min.y + style.FramePadding.y), text_col, ImGuiDir_Down, 1.0f); - } - RenderFrameBorder(frame_bb.Min, frame_bb.Max, style.FrameRounding); - if (preview_value != NULL && !(flags & ImGuiComboFlags_NoPreview)) - RenderTextClipped(frame_bb.Min + style.FramePadding, ImVec2(value_x2, frame_bb.Max.y), preview_value, NULL, NULL, ImVec2(0.0f,0.0f)); - if (label_size.x > 0) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - if ((pressed || g.NavActivateId == id) && !popup_open) - { - if (window->DC.NavLayerCurrent == 0) - window->NavLastIds[0] = id; - OpenPopupEx(id); - popup_open = true; - } - - if (!popup_open) - return false; - - if (has_window_size_constraint) - { - g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSizeConstraint; - g.NextWindowData.SizeConstraintRect.Min.x = ImMax(g.NextWindowData.SizeConstraintRect.Min.x, w); - } - else - { - if ((flags & ImGuiComboFlags_HeightMask_) == 0) - flags |= ImGuiComboFlags_HeightRegular; - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiComboFlags_HeightMask_)); // Only one - int popup_max_height_in_items = -1; - if (flags & ImGuiComboFlags_HeightRegular) popup_max_height_in_items = 8; - else if (flags & ImGuiComboFlags_HeightSmall) popup_max_height_in_items = 4; - else if (flags & ImGuiComboFlags_HeightLarge) popup_max_height_in_items = 20; - SetNextWindowSizeConstraints(ImVec2(w, 0.0f), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items))); - } - - char name[16]; - ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth - - // Peak into expected window size so we can position it - if (ImGuiWindow* popup_window = FindWindowByName(name)) - if (popup_window->WasActive) - { - ImVec2 size_expected = CalcWindowExpectedSize(popup_window); - if (flags & ImGuiComboFlags_PopupAlignLeft) - popup_window->AutoPosLastDirection = ImGuiDir_Left; - ImRect r_outer = GetWindowAllowedExtentRect(popup_window); - ImVec2 pos = FindBestWindowPosForPopupEx(frame_bb.GetBL(), size_expected, &popup_window->AutoPosLastDirection, r_outer, frame_bb, ImGuiPopupPositionPolicy_ComboBox); - SetNextWindowPos(pos); - } - - // We don't use BeginPopupEx() solely because we have a custom name string, which we could make an argument to BeginPopupEx() - ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove; - - // Horizontally align ourselves with the framed text - PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(style.FramePadding.x, style.WindowPadding.y)); - bool ret = Begin(name, NULL, window_flags); - PopStyleVar(); - if (!ret) - { - EndPopup(); - IM_ASSERT(0); // This should never happen as we tested for IsPopupOpen() above - return false; - } - return true; -} - -void ImGui::EndCombo() -{ - EndPopup(); -} - -// Getter for the old Combo() API: const char*[] -static bool Items_ArrayGetter(void* data, int idx, const char** out_text) -{ - const char* const* items = (const char* const*)data; - if (out_text) - *out_text = items[idx]; - return true; -} - -// Getter for the old Combo() API: "item1\0item2\0item3\0" -static bool Items_SingleStringGetter(void* data, int idx, const char** out_text) -{ - // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited. - const char* items_separated_by_zeros = (const char*)data; - int items_count = 0; - const char* p = items_separated_by_zeros; - while (*p) - { - if (idx == items_count) - break; - p += strlen(p) + 1; - items_count++; - } - if (!*p) - return false; - if (out_text) - *out_text = p; - return true; -} - -// Old API, prefer using BeginCombo() nowadays if you can. -bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_max_height_in_items) -{ - ImGuiContext& g = *GImGui; - - // Call the getter to obtain the preview string which is a parameter to BeginCombo() - const char* preview_value = NULL; - if (*current_item >= 0 && *current_item < items_count) - items_getter(data, *current_item, &preview_value); - - // The old Combo() API exposed "popup_max_height_in_items". The new more general BeginCombo() API doesn't have/need it, but we emulate it here. - if (popup_max_height_in_items != -1 && !(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint)) - SetNextWindowSizeConstraints(ImVec2(0,0), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items))); - - if (!BeginCombo(label, preview_value, ImGuiComboFlags_None)) - return false; - - // Display items - // FIXME-OPT: Use clipper (but we need to disable it on the appearing frame to make sure our call to SetItemDefaultFocus() is processed) - bool value_changed = false; - for (int i = 0; i < items_count; i++) - { - PushID((void*)(intptr_t)i); - const bool item_selected = (i == *current_item); - const char* item_text; - if (!items_getter(data, i, &item_text)) - item_text = "*Unknown item*"; - if (Selectable(item_text, item_selected)) - { - value_changed = true; - *current_item = i; - } - if (item_selected) - SetItemDefaultFocus(); - PopID(); - } - - EndCombo(); - return value_changed; -} - -// Combo box helper allowing to pass an array of strings. -bool ImGui::Combo(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items) -{ - const bool value_changed = Combo(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_in_items); - return value_changed; -} - -// Combo box helper allowing to pass all items in a single string literal holding multiple zero-terminated items "item1\0item2\0" -bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items) -{ - int items_count = 0; - const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this, or at least only when combo is open - while (*p) - { - p += strlen(p) + 1; - items_count++; - } - bool value_changed = Combo(label, current_item, Items_SingleStringGetter, (void*)items_separated_by_zeros, items_count, height_in_items); - return value_changed; -} - -//------------------------------------------------------------------------- -// [SECTION] Data Type and Data Formatting Helpers [Internal] -//------------------------------------------------------------------------- -// - PatchFormatStringFloatToInt() -// - DataTypeGetInfo() -// - DataTypeFormatString() -// - DataTypeApplyOp() -// - DataTypeApplyOpFromText() -// - GetMinimumStepAtDecimalPrecision -// - RoundScalarWithFormat<>() -//------------------------------------------------------------------------- - -static const ImGuiDataTypeInfo GDataTypeInfo[] = -{ - { sizeof(char), "%d", "%d" }, // ImGuiDataType_S8 - { sizeof(unsigned char), "%u", "%u" }, - { sizeof(short), "%d", "%d" }, // ImGuiDataType_S16 - { sizeof(unsigned short), "%u", "%u" }, - { sizeof(int), "%d", "%d" }, // ImGuiDataType_S32 - { sizeof(unsigned int), "%u", "%u" }, -#ifdef _MSC_VER - { sizeof(ImS64), "%I64d","%I64d" }, // ImGuiDataType_S64 - { sizeof(ImU64), "%I64u","%I64u" }, -#else - { sizeof(ImS64), "%lld", "%lld" }, // ImGuiDataType_S64 - { sizeof(ImU64), "%llu", "%llu" }, -#endif - { sizeof(float), "%f", "%f" }, // ImGuiDataType_Float (float are promoted to double in va_arg) - { sizeof(double), "%f", "%lf" }, // ImGuiDataType_Double -}; -IM_STATIC_ASSERT(IM_ARRAYSIZE(GDataTypeInfo) == ImGuiDataType_COUNT); - -// FIXME-LEGACY: Prior to 1.61 our DragInt() function internally used floats and because of this the compile-time default value for format was "%.0f". -// Even though we changed the compile-time default, we expect users to have carried %f around, which would break the display of DragInt() calls. -// To honor backward compatibility we are rewriting the format string, unless IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. What could possibly go wrong?! -static const char* PatchFormatStringFloatToInt(const char* fmt) -{ - if (fmt[0] == '%' && fmt[1] == '.' && fmt[2] == '0' && fmt[3] == 'f' && fmt[4] == 0) // Fast legacy path for "%.0f" which is expected to be the most common case. - return "%d"; - const char* fmt_start = ImParseFormatFindStart(fmt); // Find % (if any, and ignore %%) - const char* fmt_end = ImParseFormatFindEnd(fmt_start); // Find end of format specifier, which itself is an exercise of confidence/recklessness (because snprintf is dependent on libc or user). - if (fmt_end > fmt_start && fmt_end[-1] == 'f') - { -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - if (fmt_start == fmt && fmt_end[0] == 0) - return "%d"; - ImGuiContext& g = *GImGui; - ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%.*s%%d%s", (int)(fmt_start - fmt), fmt, fmt_end); // Honor leading and trailing decorations, but lose alignment/precision. - return g.TempBuffer; -#else - IM_ASSERT(0 && "DragInt(): Invalid format string!"); // Old versions used a default parameter of "%.0f", please replace with e.g. "%d" -#endif - } - return fmt; -} - -const ImGuiDataTypeInfo* ImGui::DataTypeGetInfo(ImGuiDataType data_type) -{ - IM_ASSERT(data_type >= 0 && data_type < ImGuiDataType_COUNT); - return &GDataTypeInfo[data_type]; -} - -int ImGui::DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format) -{ - // Signedness doesn't matter when pushing integer arguments - if (data_type == ImGuiDataType_S32 || data_type == ImGuiDataType_U32) - return ImFormatString(buf, buf_size, format, *(const ImU32*)p_data); - if (data_type == ImGuiDataType_S64 || data_type == ImGuiDataType_U64) - return ImFormatString(buf, buf_size, format, *(const ImU64*)p_data); - if (data_type == ImGuiDataType_Float) - return ImFormatString(buf, buf_size, format, *(const float*)p_data); - if (data_type == ImGuiDataType_Double) - return ImFormatString(buf, buf_size, format, *(const double*)p_data); - if (data_type == ImGuiDataType_S8) - return ImFormatString(buf, buf_size, format, *(const ImS8*)p_data); - if (data_type == ImGuiDataType_U8) - return ImFormatString(buf, buf_size, format, *(const ImU8*)p_data); - if (data_type == ImGuiDataType_S16) - return ImFormatString(buf, buf_size, format, *(const ImS16*)p_data); - if (data_type == ImGuiDataType_U16) - return ImFormatString(buf, buf_size, format, *(const ImU16*)p_data); - IM_ASSERT(0); - return 0; -} - -void ImGui::DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg1, const void* arg2) -{ - IM_ASSERT(op == '+' || op == '-'); - switch (data_type) - { - case ImGuiDataType_S8: - if (op == '+') { *(ImS8*)output = ImAddClampOverflow(*(const ImS8*)arg1, *(const ImS8*)arg2, IM_S8_MIN, IM_S8_MAX); } - if (op == '-') { *(ImS8*)output = ImSubClampOverflow(*(const ImS8*)arg1, *(const ImS8*)arg2, IM_S8_MIN, IM_S8_MAX); } - return; - case ImGuiDataType_U8: - if (op == '+') { *(ImU8*)output = ImAddClampOverflow(*(const ImU8*)arg1, *(const ImU8*)arg2, IM_U8_MIN, IM_U8_MAX); } - if (op == '-') { *(ImU8*)output = ImSubClampOverflow(*(const ImU8*)arg1, *(const ImU8*)arg2, IM_U8_MIN, IM_U8_MAX); } - return; - case ImGuiDataType_S16: - if (op == '+') { *(ImS16*)output = ImAddClampOverflow(*(const ImS16*)arg1, *(const ImS16*)arg2, IM_S16_MIN, IM_S16_MAX); } - if (op == '-') { *(ImS16*)output = ImSubClampOverflow(*(const ImS16*)arg1, *(const ImS16*)arg2, IM_S16_MIN, IM_S16_MAX); } - return; - case ImGuiDataType_U16: - if (op == '+') { *(ImU16*)output = ImAddClampOverflow(*(const ImU16*)arg1, *(const ImU16*)arg2, IM_U16_MIN, IM_U16_MAX); } - if (op == '-') { *(ImU16*)output = ImSubClampOverflow(*(const ImU16*)arg1, *(const ImU16*)arg2, IM_U16_MIN, IM_U16_MAX); } - return; - case ImGuiDataType_S32: - if (op == '+') { *(ImS32*)output = ImAddClampOverflow(*(const ImS32*)arg1, *(const ImS32*)arg2, IM_S32_MIN, IM_S32_MAX); } - if (op == '-') { *(ImS32*)output = ImSubClampOverflow(*(const ImS32*)arg1, *(const ImS32*)arg2, IM_S32_MIN, IM_S32_MAX); } - return; - case ImGuiDataType_U32: - if (op == '+') { *(ImU32*)output = ImAddClampOverflow(*(const ImU32*)arg1, *(const ImU32*)arg2, IM_U32_MIN, IM_U32_MAX); } - if (op == '-') { *(ImU32*)output = ImSubClampOverflow(*(const ImU32*)arg1, *(const ImU32*)arg2, IM_U32_MIN, IM_U32_MAX); } - return; - case ImGuiDataType_S64: - if (op == '+') { *(ImS64*)output = ImAddClampOverflow(*(const ImS64*)arg1, *(const ImS64*)arg2, IM_S64_MIN, IM_S64_MAX); } - if (op == '-') { *(ImS64*)output = ImSubClampOverflow(*(const ImS64*)arg1, *(const ImS64*)arg2, IM_S64_MIN, IM_S64_MAX); } - return; - case ImGuiDataType_U64: - if (op == '+') { *(ImU64*)output = ImAddClampOverflow(*(const ImU64*)arg1, *(const ImU64*)arg2, IM_U64_MIN, IM_U64_MAX); } - if (op == '-') { *(ImU64*)output = ImSubClampOverflow(*(const ImU64*)arg1, *(const ImU64*)arg2, IM_U64_MIN, IM_U64_MAX); } - return; - case ImGuiDataType_Float: - if (op == '+') { *(float*)output = *(const float*)arg1 + *(const float*)arg2; } - if (op == '-') { *(float*)output = *(const float*)arg1 - *(const float*)arg2; } - return; - case ImGuiDataType_Double: - if (op == '+') { *(double*)output = *(const double*)arg1 + *(const double*)arg2; } - if (op == '-') { *(double*)output = *(const double*)arg1 - *(const double*)arg2; } - return; - case ImGuiDataType_COUNT: break; - } - IM_ASSERT(0); -} - -// User can input math operators (e.g. +100) to edit a numerical values. -// NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess.. -bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format) -{ - while (ImCharIsBlankA(*buf)) - buf++; - - // We don't support '-' op because it would conflict with inputing negative value. - // Instead you can use +-100 to subtract from an existing value - char op = buf[0]; - if (op == '+' || op == '*' || op == '/') - { - buf++; - while (ImCharIsBlankA(*buf)) - buf++; - } - else - { - op = 0; - } - if (!buf[0]) - return false; - - // Copy the value in an opaque buffer so we can compare at the end of the function if it changed at all. - IM_ASSERT(data_type < ImGuiDataType_COUNT); - int data_backup[2]; - const ImGuiDataTypeInfo* type_info = ImGui::DataTypeGetInfo(data_type); - IM_ASSERT(type_info->Size <= sizeof(data_backup)); - memcpy(data_backup, p_data, type_info->Size); - - if (format == NULL) - format = type_info->ScanFmt; - - // FIXME-LEGACY: The aim is to remove those operators and write a proper expression evaluator at some point.. - int arg1i = 0; - if (data_type == ImGuiDataType_S32) - { - int* v = (int*)p_data; - int arg0i = *v; - float arg1f = 0.0f; - if (op && sscanf(initial_value_buf, format, &arg0i) < 1) - return false; - // Store operand in a float so we can use fractional value for multipliers (*1.1), but constant always parsed as integer so we can fit big integers (e.g. 2000000003) past float precision - if (op == '+') { if (sscanf(buf, "%d", &arg1i)) *v = (int)(arg0i + arg1i); } // Add (use "+-" to subtract) - else if (op == '*') { if (sscanf(buf, "%f", &arg1f)) *v = (int)(arg0i * arg1f); } // Multiply - else if (op == '/') { if (sscanf(buf, "%f", &arg1f) && arg1f != 0.0f) *v = (int)(arg0i / arg1f); } // Divide - else { if (sscanf(buf, format, &arg1i) == 1) *v = arg1i; } // Assign constant - } - else if (data_type == ImGuiDataType_Float) - { - // For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in - format = "%f"; - float* v = (float*)p_data; - float arg0f = *v, arg1f = 0.0f; - if (op && sscanf(initial_value_buf, format, &arg0f) < 1) - return false; - if (sscanf(buf, format, &arg1f) < 1) - return false; - if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract) - else if (op == '*') { *v = arg0f * arg1f; } // Multiply - else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide - else { *v = arg1f; } // Assign constant - } - else if (data_type == ImGuiDataType_Double) - { - format = "%lf"; // scanf differentiate float/double unlike printf which forces everything to double because of ellipsis - double* v = (double*)p_data; - double arg0f = *v, arg1f = 0.0; - if (op && sscanf(initial_value_buf, format, &arg0f) < 1) - return false; - if (sscanf(buf, format, &arg1f) < 1) - return false; - if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract) - else if (op == '*') { *v = arg0f * arg1f; } // Multiply - else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide - else { *v = arg1f; } // Assign constant - } - else if (data_type == ImGuiDataType_U32 || data_type == ImGuiDataType_S64 || data_type == ImGuiDataType_U64) - { - // All other types assign constant - // We don't bother handling support for legacy operators since they are a little too crappy. Instead we will later implement a proper expression evaluator in the future. - sscanf(buf, format, p_data); - } - else - { - // Small types need a 32-bit buffer to receive the result from scanf() - int v32; - sscanf(buf, format, &v32); - if (data_type == ImGuiDataType_S8) - *(ImS8*)p_data = (ImS8)ImClamp(v32, (int)IM_S8_MIN, (int)IM_S8_MAX); - else if (data_type == ImGuiDataType_U8) - *(ImU8*)p_data = (ImU8)ImClamp(v32, (int)IM_U8_MIN, (int)IM_U8_MAX); - else if (data_type == ImGuiDataType_S16) - *(ImS16*)p_data = (ImS16)ImClamp(v32, (int)IM_S16_MIN, (int)IM_S16_MAX); - else if (data_type == ImGuiDataType_U16) - *(ImU16*)p_data = (ImU16)ImClamp(v32, (int)IM_U16_MIN, (int)IM_U16_MAX); - else - IM_ASSERT(0); - } - - return memcmp(data_backup, p_data, type_info->Size) != 0; -} - -static float GetMinimumStepAtDecimalPrecision(int decimal_precision) -{ - static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f }; - if (decimal_precision < 0) - return FLT_MIN; - return (decimal_precision < IM_ARRAYSIZE(min_steps)) ? min_steps[decimal_precision] : ImPow(10.0f, (float)-decimal_precision); -} - -template -static const char* ImAtoi(const char* src, TYPE* output) -{ - int negative = 0; - if (*src == '-') { negative = 1; src++; } - if (*src == '+') { src++; } - TYPE v = 0; - while (*src >= '0' && *src <= '9') - v = (v * 10) + (*src++ - '0'); - *output = negative ? -v : v; - return src; -} - -template -TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, TYPE v) -{ - const char* fmt_start = ImParseFormatFindStart(format); - if (fmt_start[0] != '%' || fmt_start[1] == '%') // Don't apply if the value is not visible in the format string - return v; - char v_str[64]; - ImFormatString(v_str, IM_ARRAYSIZE(v_str), fmt_start, v); - const char* p = v_str; - while (*p == ' ') - p++; - if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) - v = (TYPE)ImAtof(p); - else - ImAtoi(p, (SIGNEDTYPE*)&v); - return v; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: DragScalar, DragFloat, DragInt, etc. -//------------------------------------------------------------------------- -// - DragBehaviorT<>() [Internal] -// - DragBehavior() [Internal] -// - DragScalar() -// - DragScalarN() -// - DragFloat() -// - DragFloat2() -// - DragFloat3() -// - DragFloat4() -// - DragFloatRange2() -// - DragInt() -// - DragInt2() -// - DragInt3() -// - DragInt4() -// - DragIntRange2() -//------------------------------------------------------------------------- - -// This is called by DragBehavior() when the widget is active (held by mouse or being manipulated with Nav controls) -template -bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const TYPE v_min, const TYPE v_max, const char* format, float power, ImGuiDragFlags flags) -{ - ImGuiContext& g = *GImGui; - const ImGuiAxis axis = (flags & ImGuiDragFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X; - const bool is_decimal = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double); - const bool is_clamped = (v_min < v_max); - const bool is_power = (power != 1.0f && is_decimal && is_clamped && (v_max - v_min < FLT_MAX)); - const bool is_locked = (v_min > v_max); - if (is_locked) - return false; - - // Default tweak speed - if (v_speed == 0.0f && is_clamped && (v_max - v_min < FLT_MAX)) - v_speed = (float)((v_max - v_min) * g.DragSpeedDefaultRatio); - - // Inputs accumulates into g.DragCurrentAccum, which is flushed into the current value as soon as it makes a difference with our precision settings - float adjust_delta = 0.0f; - if (g.ActiveIdSource == ImGuiInputSource_Mouse && IsMousePosValid() && g.IO.MouseDragMaxDistanceSqr[0] > 1.0f*1.0f) - { - adjust_delta = g.IO.MouseDelta[axis]; - if (g.IO.KeyAlt) - adjust_delta *= 1.0f / 100.0f; - if (g.IO.KeyShift) - adjust_delta *= 10.0f; - } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) - { - int decimal_precision = is_decimal ? ImParseFormatPrecision(format, 3) : 0; - adjust_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 1.0f / 10.0f, 10.0f)[axis]; - v_speed = ImMax(v_speed, GetMinimumStepAtDecimalPrecision(decimal_precision)); - } - adjust_delta *= v_speed; - - // For vertical drag we currently assume that Up=higher value (like we do with vertical sliders). This may become a parameter. - if (axis == ImGuiAxis_Y) - adjust_delta = -adjust_delta; - - // Clear current value on activation - // Avoid altering values and clamping when we are _already_ past the limits and heading in the same direction, so e.g. if range is 0..255, current value is 300 and we are pushing to the right side, keep the 300. - bool is_just_activated = g.ActiveIdIsJustActivated; - bool is_already_past_limits_and_pushing_outward = is_clamped && ((*v >= v_max && adjust_delta > 0.0f) || (*v <= v_min && adjust_delta < 0.0f)); - bool is_drag_direction_change_with_power = is_power && ((adjust_delta < 0 && g.DragCurrentAccum > 0) || (adjust_delta > 0 && g.DragCurrentAccum < 0)); - if (is_just_activated || is_already_past_limits_and_pushing_outward || is_drag_direction_change_with_power) - { - g.DragCurrentAccum = 0.0f; - g.DragCurrentAccumDirty = false; - } - else if (adjust_delta != 0.0f) - { - g.DragCurrentAccum += adjust_delta; - g.DragCurrentAccumDirty = true; - } - - if (!g.DragCurrentAccumDirty) - return false; - - TYPE v_cur = *v; - FLOATTYPE v_old_ref_for_accum_remainder = (FLOATTYPE)0.0f; - - if (is_power) - { - // Offset + round to user desired precision, with a curve on the v_min..v_max range to get more precision on one side of the range - FLOATTYPE v_old_norm_curved = ImPow((FLOATTYPE)(v_cur - v_min) / (FLOATTYPE)(v_max - v_min), (FLOATTYPE)1.0f / power); - FLOATTYPE v_new_norm_curved = v_old_norm_curved + (g.DragCurrentAccum / (v_max - v_min)); - v_cur = v_min + (SIGNEDTYPE)ImPow(ImSaturate((float)v_new_norm_curved), power) * (v_max - v_min); - v_old_ref_for_accum_remainder = v_old_norm_curved; - } - else - { - v_cur += (SIGNEDTYPE)g.DragCurrentAccum; - } - - // Round to user desired precision based on format string - v_cur = RoundScalarWithFormatT(format, data_type, v_cur); - - // Preserve remainder after rounding has been applied. This also allow slow tweaking of values. - g.DragCurrentAccumDirty = false; - if (is_power) - { - FLOATTYPE v_cur_norm_curved = ImPow((FLOATTYPE)(v_cur - v_min) / (FLOATTYPE)(v_max - v_min), (FLOATTYPE)1.0f / power); - g.DragCurrentAccum -= (float)(v_cur_norm_curved - v_old_ref_for_accum_remainder); - } - else - { - g.DragCurrentAccum -= (float)((SIGNEDTYPE)v_cur - (SIGNEDTYPE)*v); - } - - // Lose zero sign for float/double - if (v_cur == (TYPE)-0) - v_cur = (TYPE)0; - - // Clamp values (+ handle overflow/wrap-around for integer types) - if (*v != v_cur && is_clamped) - { - if (v_cur < v_min || (v_cur > *v && adjust_delta < 0.0f && !is_decimal)) - v_cur = v_min; - if (v_cur > v_max || (v_cur < *v && adjust_delta > 0.0f && !is_decimal)) - v_cur = v_max; - } - - // Apply result - if (*v == v_cur) - return false; - *v = v_cur; - return true; -} - -bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, float power, ImGuiDragFlags flags) -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId == id) - { - if (g.ActiveIdSource == ImGuiInputSource_Mouse && !g.IO.MouseDown[0]) - ClearActiveID(); - else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) - ClearActiveID(); - } - if (g.ActiveId != id) - return false; - - switch (data_type) - { - case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)p_v; bool r = DragBehaviorT(ImGuiDataType_S32, &v32, v_speed, p_min ? *(const ImS8*) p_min : IM_S8_MIN, p_max ? *(const ImS8*)p_max : IM_S8_MAX, format, power, flags); if (r) *(ImS8*)p_v = (ImS8)v32; return r; } - case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)p_v; bool r = DragBehaviorT(ImGuiDataType_U32, &v32, v_speed, p_min ? *(const ImU8*) p_min : IM_U8_MIN, p_max ? *(const ImU8*)p_max : IM_U8_MAX, format, power, flags); if (r) *(ImU8*)p_v = (ImU8)v32; return r; } - case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)p_v; bool r = DragBehaviorT(ImGuiDataType_S32, &v32, v_speed, p_min ? *(const ImS16*)p_min : IM_S16_MIN, p_max ? *(const ImS16*)p_max : IM_S16_MAX, format, power, flags); if (r) *(ImS16*)p_v = (ImS16)v32; return r; } - case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)p_v; bool r = DragBehaviorT(ImGuiDataType_U32, &v32, v_speed, p_min ? *(const ImU16*)p_min : IM_U16_MIN, p_max ? *(const ImU16*)p_max : IM_U16_MAX, format, power, flags); if (r) *(ImU16*)p_v = (ImU16)v32; return r; } - case ImGuiDataType_S32: return DragBehaviorT(data_type, (ImS32*)p_v, v_speed, p_min ? *(const ImS32* )p_min : IM_S32_MIN, p_max ? *(const ImS32* )p_max : IM_S32_MAX, format, power, flags); - case ImGuiDataType_U32: return DragBehaviorT(data_type, (ImU32*)p_v, v_speed, p_min ? *(const ImU32* )p_min : IM_U32_MIN, p_max ? *(const ImU32* )p_max : IM_U32_MAX, format, power, flags); - case ImGuiDataType_S64: return DragBehaviorT(data_type, (ImS64*)p_v, v_speed, p_min ? *(const ImS64* )p_min : IM_S64_MIN, p_max ? *(const ImS64* )p_max : IM_S64_MAX, format, power, flags); - case ImGuiDataType_U64: return DragBehaviorT(data_type, (ImU64*)p_v, v_speed, p_min ? *(const ImU64* )p_min : IM_U64_MIN, p_max ? *(const ImU64* )p_max : IM_U64_MAX, format, power, flags); - case ImGuiDataType_Float: return DragBehaviorT(data_type, (float*)p_v, v_speed, p_min ? *(const float* )p_min : -FLT_MAX, p_max ? *(const float* )p_max : FLT_MAX, format, power, flags); - case ImGuiDataType_Double: return DragBehaviorT(data_type, (double*)p_v, v_speed, p_min ? *(const double*)p_min : -DBL_MAX, p_max ? *(const double*)p_max : DBL_MAX, format, power, flags); - case ImGuiDataType_COUNT: break; - } - IM_ASSERT(0); - return false; -} - -// Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a Drag widget, p_min and p_max are optional. -// Read code of e.g. SliderFloat(), SliderInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly. -bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - if (power != 1.0f) - IM_ASSERT(p_min != NULL && p_max != NULL); // When using a power curve the drag needs to have known bounds - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const float w = CalcItemWidth(); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); - const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id, &frame_bb)) - return false; - - // Default format string when passing NULL - if (format == NULL) - format = DataTypeGetInfo(data_type)->PrintFmt; - else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.) - format = PatchFormatStringFloatToInt(format); - - // Tabbing or CTRL-clicking on Drag turns it into an input box - const bool hovered = ItemHoverable(frame_bb, id); - bool temp_input_is_active = TempInputIsActive(id); - bool temp_input_start = false; - if (!temp_input_is_active) - { - const bool focus_requested = FocusableItemRegister(window, id); - const bool clicked = (hovered && g.IO.MouseClicked[0]); - const bool double_clicked = (hovered && g.IO.MouseDoubleClicked[0]); - if (focus_requested || clicked || double_clicked || g.NavActivateId == id || g.NavInputId == id) - { - SetActiveID(id, window); - SetFocusID(id, window); - FocusWindow(window); - g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right); - if (focus_requested || (clicked && g.IO.KeyCtrl) || double_clicked || g.NavInputId == id) - { - temp_input_start = true; - FocusableItemUnregister(window); - } - } - } - if (temp_input_is_active || temp_input_start) - return TempInputScalar(frame_bb, id, label, data_type, p_data, format); - - // Draw frame - const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); - RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding); - - // Drag behavior - const bool value_changed = DragBehavior(id, data_type, p_data, v_speed, p_min, p_max, format, power, ImGuiDragFlags_None); - if (value_changed) - MarkItemEdited(id); - - // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. - char value_buf[64]; - const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format); - RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f, 0.5f)); - - if (label_size.x > 0.0f) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); - return value_changed; -} - -bool ImGui::DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - bool value_changed = false; - BeginGroup(); - PushID(label); - PushMultiItemsWidths(components, CalcItemWidth()); - size_t type_size = GDataTypeInfo[data_type].Size; - for (int i = 0; i < components; i++) - { - PushID(i); - if (i > 0) - SameLine(0, g.Style.ItemInnerSpacing.x); - value_changed |= DragScalar("", data_type, p_data, v_speed, p_min, p_max, format, power); - PopID(); - PopItemWidth(); - p_data = (void*)((char*)p_data + type_size); - } - PopID(); - - const char* label_end = FindRenderedTextEnd(label); - if (label != label_end) - { - SameLine(0, g.Style.ItemInnerSpacing.x); - TextEx(label, label_end); - } - - EndGroup(); - return value_changed; -} - -bool ImGui::DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* format, float power) -{ - return DragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, power); -} - -bool ImGui::DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* format, float power) -{ - return DragScalarN(label, ImGuiDataType_Float, v, 2, v_speed, &v_min, &v_max, format, power); -} - -bool ImGui::DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* format, float power) -{ - return DragScalarN(label, ImGuiDataType_Float, v, 3, v_speed, &v_min, &v_max, format, power); -} - -bool ImGui::DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, float power) -{ - return DragScalarN(label, ImGuiDataType_Float, v, 4, v_speed, &v_min, &v_max, format, power); -} - -bool ImGui::DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed, float v_min, float v_max, const char* format, const char* format_max, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - PushID(label); - BeginGroup(); - PushMultiItemsWidths(2, CalcItemWidth()); - - bool value_changed = DragFloat("##min", v_current_min, v_speed, (v_min >= v_max) ? -FLT_MAX : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), format, power); - PopItemWidth(); - SameLine(0, g.Style.ItemInnerSpacing.x); - value_changed |= DragFloat("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? FLT_MAX : v_max, format_max ? format_max : format, power); - PopItemWidth(); - SameLine(0, g.Style.ItemInnerSpacing.x); - - TextEx(label, FindRenderedTextEnd(label)); - EndGroup(); - PopID(); - return value_changed; -} - -// NB: v_speed is float to allow adjusting the drag speed with more precision -bool ImGui::DragInt(const char* label, int* v, float v_speed, int v_min, int v_max, const char* format) -{ - return DragScalar(label, ImGuiDataType_S32, v, v_speed, &v_min, &v_max, format); -} - -bool ImGui::DragInt2(const char* label, int v[2], float v_speed, int v_min, int v_max, const char* format) -{ - return DragScalarN(label, ImGuiDataType_S32, v, 2, v_speed, &v_min, &v_max, format); -} - -bool ImGui::DragInt3(const char* label, int v[3], float v_speed, int v_min, int v_max, const char* format) -{ - return DragScalarN(label, ImGuiDataType_S32, v, 3, v_speed, &v_min, &v_max, format); -} - -bool ImGui::DragInt4(const char* label, int v[4], float v_speed, int v_min, int v_max, const char* format) -{ - return DragScalarN(label, ImGuiDataType_S32, v, 4, v_speed, &v_min, &v_max, format); -} - -bool ImGui::DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed, int v_min, int v_max, const char* format, const char* format_max) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - PushID(label); - BeginGroup(); - PushMultiItemsWidths(2, CalcItemWidth()); - - bool value_changed = DragInt("##min", v_current_min, v_speed, (v_min >= v_max) ? INT_MIN : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), format); - PopItemWidth(); - SameLine(0, g.Style.ItemInnerSpacing.x); - value_changed |= DragInt("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? INT_MAX : v_max, format_max ? format_max : format); - PopItemWidth(); - SameLine(0, g.Style.ItemInnerSpacing.x); - - TextEx(label, FindRenderedTextEnd(label)); - EndGroup(); - PopID(); - - return value_changed; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: SliderScalar, SliderFloat, SliderInt, etc. -//------------------------------------------------------------------------- -// - SliderBehaviorT<>() [Internal] -// - SliderBehavior() [Internal] -// - SliderScalar() -// - SliderScalarN() -// - SliderFloat() -// - SliderFloat2() -// - SliderFloat3() -// - SliderFloat4() -// - SliderAngle() -// - SliderInt() -// - SliderInt2() -// - SliderInt3() -// - SliderInt4() -// - VSliderScalar() -// - VSliderFloat() -// - VSliderInt() -//------------------------------------------------------------------------- - -template -float ImGui::SliderCalcRatioFromValueT(ImGuiDataType data_type, TYPE v, TYPE v_min, TYPE v_max, float power, float linear_zero_pos) -{ - if (v_min == v_max) - return 0.0f; - - const bool is_power = (power != 1.0f) && (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double); - const TYPE v_clamped = (v_min < v_max) ? ImClamp(v, v_min, v_max) : ImClamp(v, v_max, v_min); - if (is_power) - { - if (v_clamped < 0.0f) - { - const float f = 1.0f - (float)((v_clamped - v_min) / (ImMin((TYPE)0, v_max) - v_min)); - return (1.0f - ImPow(f, 1.0f/power)) * linear_zero_pos; - } - else - { - const float f = (float)((v_clamped - ImMax((TYPE)0, v_min)) / (v_max - ImMax((TYPE)0, v_min))); - return linear_zero_pos + ImPow(f, 1.0f/power) * (1.0f - linear_zero_pos); - } - } - - // Linear slider - return (float)((FLOATTYPE)(v_clamped - v_min) / (FLOATTYPE)(v_max - v_min)); -} - -// FIXME: Move some of the code into SliderBehavior(). Current responsability is larger than what the equivalent DragBehaviorT<> does, we also do some rendering, etc. -template -bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, TYPE* v, const TYPE v_min, const TYPE v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb) -{ - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - - const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X; - const bool is_decimal = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double); - const bool is_power = (power != 1.0f) && is_decimal; - - const float grab_padding = 2.0f; - const float slider_sz = (bb.Max[axis] - bb.Min[axis]) - grab_padding * 2.0f; - float grab_sz = style.GrabMinSize; - SIGNEDTYPE v_range = (v_min < v_max ? v_max - v_min : v_min - v_max); - if (!is_decimal && v_range >= 0) // v_range < 0 may happen on integer overflows - grab_sz = ImMax((float)(slider_sz / (v_range + 1)), style.GrabMinSize); // For integer sliders: if possible have the grab size represent 1 unit - grab_sz = ImMin(grab_sz, slider_sz); - const float slider_usable_sz = slider_sz - grab_sz; - const float slider_usable_pos_min = bb.Min[axis] + grab_padding + grab_sz * 0.5f; - const float slider_usable_pos_max = bb.Max[axis] - grab_padding - grab_sz * 0.5f; - - // For power curve sliders that cross over sign boundary we want the curve to be symmetric around 0.0f - float linear_zero_pos; // 0.0->1.0f - if (is_power && v_min * v_max < 0.0f) - { - // Different sign - const FLOATTYPE linear_dist_min_to_0 = ImPow(v_min >= 0 ? (FLOATTYPE)v_min : -(FLOATTYPE)v_min, (FLOATTYPE)1.0f / power); - const FLOATTYPE linear_dist_max_to_0 = ImPow(v_max >= 0 ? (FLOATTYPE)v_max : -(FLOATTYPE)v_max, (FLOATTYPE)1.0f / power); - linear_zero_pos = (float)(linear_dist_min_to_0 / (linear_dist_min_to_0 + linear_dist_max_to_0)); - } - else - { - // Same sign - linear_zero_pos = v_min < 0.0f ? 1.0f : 0.0f; - } - - // Process interacting with the slider - bool value_changed = false; - if (g.ActiveId == id) - { - bool set_new_value = false; - float clicked_t = 0.0f; - if (g.ActiveIdSource == ImGuiInputSource_Mouse) - { - if (!g.IO.MouseDown[0]) - { - ClearActiveID(); - } - else - { - const float mouse_abs_pos = g.IO.MousePos[axis]; - clicked_t = (slider_usable_sz > 0.0f) ? ImClamp((mouse_abs_pos - slider_usable_pos_min) / slider_usable_sz, 0.0f, 1.0f) : 0.0f; - if (axis == ImGuiAxis_Y) - clicked_t = 1.0f - clicked_t; - set_new_value = true; - } - } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) - { - const ImVec2 delta2 = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 0.0f, 0.0f); - float delta = (axis == ImGuiAxis_X) ? delta2.x : -delta2.y; - if (g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) - { - ClearActiveID(); - } - else if (delta != 0.0f) - { - clicked_t = SliderCalcRatioFromValueT(data_type, *v, v_min, v_max, power, linear_zero_pos); - const int decimal_precision = is_decimal ? ImParseFormatPrecision(format, 3) : 0; - if ((decimal_precision > 0) || is_power) - { - delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds - if (IsNavInputDown(ImGuiNavInput_TweakSlow)) - delta /= 10.0f; - } - else - { - if ((v_range >= -100.0f && v_range <= 100.0f) || IsNavInputDown(ImGuiNavInput_TweakSlow)) - delta = ((delta < 0.0f) ? -1.0f : +1.0f) / (float)v_range; // Gamepad/keyboard tweak speeds in integer steps - else - delta /= 100.0f; - } - if (IsNavInputDown(ImGuiNavInput_TweakFast)) - delta *= 10.0f; - set_new_value = true; - if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits - set_new_value = false; - else - clicked_t = ImSaturate(clicked_t + delta); - } - } - - if (set_new_value) - { - TYPE v_new; - if (is_power) - { - // Account for power curve scale on both sides of the zero - if (clicked_t < linear_zero_pos) - { - // Negative: rescale to the negative range before powering - float a = 1.0f - (clicked_t / linear_zero_pos); - a = ImPow(a, power); - v_new = ImLerp(ImMin(v_max, (TYPE)0), v_min, a); - } - else - { - // Positive: rescale to the positive range before powering - float a; - if (ImFabs(linear_zero_pos - 1.0f) > 1.e-6f) - a = (clicked_t - linear_zero_pos) / (1.0f - linear_zero_pos); - else - a = clicked_t; - a = ImPow(a, power); - v_new = ImLerp(ImMax(v_min, (TYPE)0), v_max, a); - } - } - else - { - // Linear slider - if (is_decimal) - { - v_new = ImLerp(v_min, v_max, clicked_t); - } - else - { - // For integer values we want the clicking position to match the grab box so we round above - // This code is carefully tuned to work with large values (e.g. high ranges of U64) while preserving this property.. - FLOATTYPE v_new_off_f = (v_max - v_min) * clicked_t; - TYPE v_new_off_floor = (TYPE)(v_new_off_f); - TYPE v_new_off_round = (TYPE)(v_new_off_f + (FLOATTYPE)0.5); - if (v_new_off_floor < v_new_off_round) - v_new = v_min + v_new_off_round; - else - v_new = v_min + v_new_off_floor; - } - } - - // Round to user desired precision based on format string - v_new = RoundScalarWithFormatT(format, data_type, v_new); - - // Apply result - if (*v != v_new) - { - *v = v_new; - value_changed = true; - } - } - } - - if (slider_sz < 1.0f) - { - *out_grab_bb = ImRect(bb.Min, bb.Min); - } - else - { - // Output grab position so it can be displayed by the caller - float grab_t = SliderCalcRatioFromValueT(data_type, *v, v_min, v_max, power, linear_zero_pos); - if (axis == ImGuiAxis_Y) - grab_t = 1.0f - grab_t; - const float grab_pos = ImLerp(slider_usable_pos_min, slider_usable_pos_max, grab_t); - if (axis == ImGuiAxis_X) - *out_grab_bb = ImRect(grab_pos - grab_sz * 0.5f, bb.Min.y + grab_padding, grab_pos + grab_sz * 0.5f, bb.Max.y - grab_padding); - else - *out_grab_bb = ImRect(bb.Min.x + grab_padding, grab_pos - grab_sz * 0.5f, bb.Max.x - grab_padding, grab_pos + grab_sz * 0.5f); - } - - return value_changed; -} - -// For 32-bit and larger types, slider bounds are limited to half the natural type range. -// So e.g. an integer Slider between INT_MAX-10 and INT_MAX will fail, but an integer Slider between INT_MAX/2-10 and INT_MAX/2 will be ok. -// It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders. -bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb) -{ - switch (data_type) - { - case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)p_v; bool r = SliderBehaviorT(bb, id, ImGuiDataType_S32, &v32, *(const ImS8*)p_min, *(const ImS8*)p_max, format, power, flags, out_grab_bb); if (r) *(ImS8*)p_v = (ImS8)v32; return r; } - case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)p_v; bool r = SliderBehaviorT(bb, id, ImGuiDataType_U32, &v32, *(const ImU8*)p_min, *(const ImU8*)p_max, format, power, flags, out_grab_bb); if (r) *(ImU8*)p_v = (ImU8)v32; return r; } - case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)p_v; bool r = SliderBehaviorT(bb, id, ImGuiDataType_S32, &v32, *(const ImS16*)p_min, *(const ImS16*)p_max, format, power, flags, out_grab_bb); if (r) *(ImS16*)p_v = (ImS16)v32; return r; } - case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)p_v; bool r = SliderBehaviorT(bb, id, ImGuiDataType_U32, &v32, *(const ImU16*)p_min, *(const ImU16*)p_max, format, power, flags, out_grab_bb); if (r) *(ImU16*)p_v = (ImU16)v32; return r; } - case ImGuiDataType_S32: - IM_ASSERT(*(const ImS32*)p_min >= IM_S32_MIN/2 && *(const ImS32*)p_max <= IM_S32_MAX/2); - return SliderBehaviorT(bb, id, data_type, (ImS32*)p_v, *(const ImS32*)p_min, *(const ImS32*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_U32: - IM_ASSERT(*(const ImU32*)p_max <= IM_U32_MAX/2); - return SliderBehaviorT(bb, id, data_type, (ImU32*)p_v, *(const ImU32*)p_min, *(const ImU32*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_S64: - IM_ASSERT(*(const ImS64*)p_min >= IM_S64_MIN/2 && *(const ImS64*)p_max <= IM_S64_MAX/2); - return SliderBehaviorT(bb, id, data_type, (ImS64*)p_v, *(const ImS64*)p_min, *(const ImS64*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_U64: - IM_ASSERT(*(const ImU64*)p_max <= IM_U64_MAX/2); - return SliderBehaviorT(bb, id, data_type, (ImU64*)p_v, *(const ImU64*)p_min, *(const ImU64*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_Float: - IM_ASSERT(*(const float*)p_min >= -FLT_MAX/2.0f && *(const float*)p_max <= FLT_MAX/2.0f); - return SliderBehaviorT(bb, id, data_type, (float*)p_v, *(const float*)p_min, *(const float*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_Double: - IM_ASSERT(*(const double*)p_min >= -DBL_MAX/2.0f && *(const double*)p_max <= DBL_MAX/2.0f); - return SliderBehaviorT(bb, id, data_type, (double*)p_v, *(const double*)p_min, *(const double*)p_max, format, power, flags, out_grab_bb); - case ImGuiDataType_COUNT: break; - } - IM_ASSERT(0); - return false; -} - -// Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a slider, they are all required. -// Read code of e.g. SliderFloat(), SliderInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly. -bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const float w = CalcItemWidth(); - - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); - const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id, &frame_bb)) - return false; - - // Default format string when passing NULL - if (format == NULL) - format = DataTypeGetInfo(data_type)->PrintFmt; - else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.) - format = PatchFormatStringFloatToInt(format); - - // Tabbing or CTRL-clicking on Slider turns it into an input box - const bool hovered = ItemHoverable(frame_bb, id); - bool temp_input_is_active = TempInputIsActive(id); - bool temp_input_start = false; - if (!temp_input_is_active) - { - const bool focus_requested = FocusableItemRegister(window, id); - const bool clicked = (hovered && g.IO.MouseClicked[0]); - if (focus_requested || clicked || g.NavActivateId == id || g.NavInputId == id) - { - SetActiveID(id, window); - SetFocusID(id, window); - FocusWindow(window); - g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right); - if (focus_requested || (clicked && g.IO.KeyCtrl) || g.NavInputId == id) - { - temp_input_start = true; - FocusableItemUnregister(window); - } - } - } - if (temp_input_is_active || temp_input_start) - return TempInputScalar(frame_bb, id, label, data_type, p_data, format); - - // Draw frame - const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); - RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding); - - // Slider behavior - ImRect grab_bb; - const bool value_changed = SliderBehavior(frame_bb, id, data_type, p_data, p_min, p_max, format, power, ImGuiSliderFlags_None, &grab_bb); - if (value_changed) - MarkItemEdited(id); - - // Render grab - if (grab_bb.Max.x > grab_bb.Min.x) - window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding); - - // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. - char value_buf[64]; - const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format); - RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.5f)); - - if (label_size.x > 0.0f) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); - return value_changed; -} - -// Add multiple sliders on 1 line for compact edition of multiple components -bool ImGui::SliderScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* v_min, const void* v_max, const char* format, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - bool value_changed = false; - BeginGroup(); - PushID(label); - PushMultiItemsWidths(components, CalcItemWidth()); - size_t type_size = GDataTypeInfo[data_type].Size; - for (int i = 0; i < components; i++) - { - PushID(i); - if (i > 0) - SameLine(0, g.Style.ItemInnerSpacing.x); - value_changed |= SliderScalar("", data_type, v, v_min, v_max, format, power); - PopID(); - PopItemWidth(); - v = (void*)((char*)v + type_size); - } - PopID(); - - const char* label_end = FindRenderedTextEnd(label); - if (label != label_end) - { - SameLine(0, g.Style.ItemInnerSpacing.x); - TextEx(label, label_end); - } - - EndGroup(); - return value_changed; -} - -bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format, float power) -{ - return SliderScalar(label, ImGuiDataType_Float, v, &v_min, &v_max, format, power); -} - -bool ImGui::SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format, float power) -{ - return SliderScalarN(label, ImGuiDataType_Float, v, 2, &v_min, &v_max, format, power); -} - -bool ImGui::SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format, float power) -{ - return SliderScalarN(label, ImGuiDataType_Float, v, 3, &v_min, &v_max, format, power); -} - -bool ImGui::SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format, float power) -{ - return SliderScalarN(label, ImGuiDataType_Float, v, 4, &v_min, &v_max, format, power); -} - -bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, float v_degrees_max, const char* format) -{ - if (format == NULL) - format = "%.0f deg"; - float v_deg = (*v_rad) * 360.0f / (2*IM_PI); - bool value_changed = SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, format, 1.0f); - *v_rad = v_deg * (2*IM_PI) / 360.0f; - return value_changed; -} - -bool ImGui::SliderInt(const char* label, int* v, int v_min, int v_max, const char* format) -{ - return SliderScalar(label, ImGuiDataType_S32, v, &v_min, &v_max, format); -} - -bool ImGui::SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* format) -{ - return SliderScalarN(label, ImGuiDataType_S32, v, 2, &v_min, &v_max, format); -} - -bool ImGui::SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* format) -{ - return SliderScalarN(label, ImGuiDataType_S32, v, 3, &v_min, &v_max, format); -} - -bool ImGui::SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* format) -{ - return SliderScalarN(label, ImGuiDataType_S32, v, 4, &v_min, &v_max, format); -} - -bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size); - const ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - - ItemSize(bb, style.FramePadding.y); - if (!ItemAdd(frame_bb, id)) - return false; - - // Default format string when passing NULL - if (format == NULL) - format = DataTypeGetInfo(data_type)->PrintFmt; - else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.) - format = PatchFormatStringFloatToInt(format); - - const bool hovered = ItemHoverable(frame_bb, id); - if ((hovered && g.IO.MouseClicked[0]) || g.NavActivateId == id || g.NavInputId == id) - { - SetActiveID(id, window); - SetFocusID(id, window); - FocusWindow(window); - g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); - } - - // Draw frame - const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); - RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding); - - // Slider behavior - ImRect grab_bb; - const bool value_changed = SliderBehavior(frame_bb, id, data_type, p_data, p_min, p_max, format, power, ImGuiSliderFlags_Vertical, &grab_bb); - if (value_changed) - MarkItemEdited(id); - - // Render grab - if (grab_bb.Max.y > grab_bb.Min.y) - window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding); - - // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. - // For the vertical slider we allow centered text to overlap the frame padding - char value_buf[64]; - const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format); - RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.0f)); - if (label_size.x > 0.0f) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - return value_changed; -} - -bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* format, float power) -{ - return VSliderScalar(label, size, ImGuiDataType_Float, v, &v_min, &v_max, format, power); -} - -bool ImGui::VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format) -{ - return VSliderScalar(label, size, ImGuiDataType_S32, v, &v_min, &v_max, format); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: InputScalar, InputFloat, InputInt, etc. -//------------------------------------------------------------------------- -// - ImParseFormatFindStart() [Internal] -// - ImParseFormatFindEnd() [Internal] -// - ImParseFormatTrimDecorations() [Internal] -// - ImParseFormatPrecision() [Internal] -// - TempInputTextScalar() [Internal] -// - InputScalar() -// - InputScalarN() -// - InputFloat() -// - InputFloat2() -// - InputFloat3() -// - InputFloat4() -// - InputInt() -// - InputInt2() -// - InputInt3() -// - InputInt4() -// - InputDouble() -//------------------------------------------------------------------------- - -// We don't use strchr() because our strings are usually very short and often start with '%' -const char* ImParseFormatFindStart(const char* fmt) -{ - while (char c = fmt[0]) - { - if (c == '%' && fmt[1] != '%') - return fmt; - else if (c == '%') - fmt++; - fmt++; - } - return fmt; -} - -const char* ImParseFormatFindEnd(const char* fmt) -{ - // Printf/scanf types modifiers: I/L/h/j/l/t/w/z. Other uppercase letters qualify as types aka end of the format. - if (fmt[0] != '%') - return fmt; - const unsigned int ignored_uppercase_mask = (1 << ('I'-'A')) | (1 << ('L'-'A')); - const unsigned int ignored_lowercase_mask = (1 << ('h'-'a')) | (1 << ('j'-'a')) | (1 << ('l'-'a')) | (1 << ('t'-'a')) | (1 << ('w'-'a')) | (1 << ('z'-'a')); - for (char c; (c = *fmt) != 0; fmt++) - { - if (c >= 'A' && c <= 'Z' && ((1 << (c - 'A')) & ignored_uppercase_mask) == 0) - return fmt + 1; - if (c >= 'a' && c <= 'z' && ((1 << (c - 'a')) & ignored_lowercase_mask) == 0) - return fmt + 1; - } - return fmt; -} - -// Extract the format out of a format string with leading or trailing decorations -// fmt = "blah blah" -> return fmt -// fmt = "%.3f" -> return fmt -// fmt = "hello %.3f" -> return fmt + 6 -// fmt = "%.3f hello" -> return buf written with "%.3f" -const char* ImParseFormatTrimDecorations(const char* fmt, char* buf, size_t buf_size) -{ - const char* fmt_start = ImParseFormatFindStart(fmt); - if (fmt_start[0] != '%') - return fmt; - const char* fmt_end = ImParseFormatFindEnd(fmt_start); - if (fmt_end[0] == 0) // If we only have leading decoration, we don't need to copy the data. - return fmt_start; - ImStrncpy(buf, fmt_start, ImMin((size_t)(fmt_end - fmt_start) + 1, buf_size)); - return buf; -} - -// Parse display precision back from the display format string -// FIXME: This is still used by some navigation code path to infer a minimum tweak step, but we should aim to rework widgets so it isn't needed. -int ImParseFormatPrecision(const char* fmt, int default_precision) -{ - fmt = ImParseFormatFindStart(fmt); - if (fmt[0] != '%') - return default_precision; - fmt++; - while (*fmt >= '0' && *fmt <= '9') - fmt++; - int precision = INT_MAX; - if (*fmt == '.') - { - fmt = ImAtoi(fmt + 1, &precision); - if (precision < 0 || precision > 99) - precision = default_precision; - } - if (*fmt == 'e' || *fmt == 'E') // Maximum precision with scientific notation - precision = -1; - if ((*fmt == 'g' || *fmt == 'G') && precision == INT_MAX) - precision = -1; - return (precision == INT_MAX) ? default_precision : precision; -} - -// Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets) -// FIXME: Facilitate using this in variety of other situations. -bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags) -{ - // On the first frame, g.TempInputTextId == 0, then on subsequent frames it becomes == id. - // We clear ActiveID on the first frame to allow the InputText() taking it back. - ImGuiContext& g = *GImGui; - const bool init = (g.TempInputId != id); - if (init) - ClearActiveID(); - - g.CurrentWindow->DC.CursorPos = bb.Min; - bool value_changed = InputTextEx(label, NULL, buf, buf_size, bb.GetSize(), flags); - if (init) - { - // First frame we started displaying the InputText widget, we expect it to take the active id. - IM_ASSERT(g.ActiveId == id); - g.TempInputId = g.ActiveId; - } - return value_changed; -} - -bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format) -{ - ImGuiContext& g = *GImGui; - - char fmt_buf[32]; - char data_buf[32]; - format = ImParseFormatTrimDecorations(format, fmt_buf, IM_ARRAYSIZE(fmt_buf)); - DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format); - ImStrTrimBlanks(data_buf); - - ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; - flags |= ((data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) ? ImGuiInputTextFlags_CharsScientific : ImGuiInputTextFlags_CharsDecimal); - bool value_changed = TempInputText(bb, id, label, data_buf, IM_ARRAYSIZE(data_buf), flags); - if (value_changed) - { - value_changed = DataTypeApplyOpFromText(data_buf, g.InputTextState.InitialTextA.Data, data_type, p_data, NULL); - if (value_changed) - MarkItemEdited(id); - } - return value_changed; -} - -// Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. -// Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly. -bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - ImGuiStyle& style = g.Style; - - if (format == NULL) - format = DataTypeGetInfo(data_type)->PrintFmt; - - char buf[64]; - DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format); - - bool value_changed = false; - if ((flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0) - flags |= ImGuiInputTextFlags_CharsDecimal; - flags |= ImGuiInputTextFlags_AutoSelectAll; - flags |= ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselve by comparing the actual data rather than the string. - - if (p_step != NULL) - { - const float button_size = GetFrameHeight(); - - BeginGroup(); // The only purpose of the group here is to allow the caller to query item data e.g. IsItemActive() - PushID(label); - SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2)); - if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view - value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format); - - // Step buttons - const ImVec2 backup_frame_padding = style.FramePadding; - style.FramePadding.x = style.FramePadding.y; - ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups; - if (flags & ImGuiInputTextFlags_ReadOnly) - button_flags |= ImGuiButtonFlags_Disabled; - SameLine(0, style.ItemInnerSpacing.x); - if (ButtonEx("-", ImVec2(button_size, button_size), button_flags)) - { - DataTypeApplyOp(data_type, '-', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step); - value_changed = true; - } - SameLine(0, style.ItemInnerSpacing.x); - if (ButtonEx("+", ImVec2(button_size, button_size), button_flags)) - { - DataTypeApplyOp(data_type, '+', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step); - value_changed = true; - } - - const char* label_end = FindRenderedTextEnd(label); - if (label != label_end) - { - SameLine(0, style.ItemInnerSpacing.x); - TextEx(label, label_end); - } - style.FramePadding = backup_frame_padding; - - PopID(); - EndGroup(); - } - else - { - if (InputText(label, buf, IM_ARRAYSIZE(buf), flags)) - value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format); - } - if (value_changed) - MarkItemEdited(window->DC.LastItemId); - - return value_changed; -} - -bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - bool value_changed = false; - BeginGroup(); - PushID(label); - PushMultiItemsWidths(components, CalcItemWidth()); - size_t type_size = GDataTypeInfo[data_type].Size; - for (int i = 0; i < components; i++) - { - PushID(i); - if (i > 0) - SameLine(0, g.Style.ItemInnerSpacing.x); - value_changed |= InputScalar("", data_type, p_data, p_step, p_step_fast, format, flags); - PopID(); - PopItemWidth(); - p_data = (void*)((char*)p_data + type_size); - } - PopID(); - - const char* label_end = FindRenderedTextEnd(label); - if (label != label_end) - { - SameLine(0.0f, g.Style.ItemInnerSpacing.x); - TextEx(label, label_end); - } - - EndGroup(); - return value_changed; -} - -bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, const char* format, ImGuiInputTextFlags flags) -{ - flags |= ImGuiInputTextFlags_CharsScientific; - return InputScalar(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), format, flags); -} - -bool ImGui::InputFloat2(const char* label, float v[2], const char* format, ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_Float, v, 2, NULL, NULL, format, flags); -} - -bool ImGui::InputFloat3(const char* label, float v[3], const char* format, ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_Float, v, 3, NULL, NULL, format, flags); -} - -bool ImGui::InputFloat4(const char* label, float v[4], const char* format, ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_Float, v, 4, NULL, NULL, format, flags); -} - -// Prefer using "const char* format" directly, which is more flexible and consistent with other API. -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS -bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags flags) -{ - char format[16] = "%f"; - if (decimal_precision >= 0) - ImFormatString(format, IM_ARRAYSIZE(format), "%%.%df", decimal_precision); - return InputFloat(label, v, step, step_fast, format, flags); -} - -bool ImGui::InputFloat2(const char* label, float v[2], int decimal_precision, ImGuiInputTextFlags flags) -{ - char format[16] = "%f"; - if (decimal_precision >= 0) - ImFormatString(format, IM_ARRAYSIZE(format), "%%.%df", decimal_precision); - return InputScalarN(label, ImGuiDataType_Float, v, 2, NULL, NULL, format, flags); -} - -bool ImGui::InputFloat3(const char* label, float v[3], int decimal_precision, ImGuiInputTextFlags flags) -{ - char format[16] = "%f"; - if (decimal_precision >= 0) - ImFormatString(format, IM_ARRAYSIZE(format), "%%.%df", decimal_precision); - return InputScalarN(label, ImGuiDataType_Float, v, 3, NULL, NULL, format, flags); -} - -bool ImGui::InputFloat4(const char* label, float v[4], int decimal_precision, ImGuiInputTextFlags flags) -{ - char format[16] = "%f"; - if (decimal_precision >= 0) - ImFormatString(format, IM_ARRAYSIZE(format), "%%.%df", decimal_precision); - return InputScalarN(label, ImGuiDataType_Float, v, 4, NULL, NULL, format, flags); -} -#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS - -bool ImGui::InputInt(const char* label, int* v, int step, int step_fast, ImGuiInputTextFlags flags) -{ - // Hexadecimal input provided as a convenience but the flag name is awkward. Typically you'd use InputText() to parse your own data, if you want to handle prefixes. - const char* format = (flags & ImGuiInputTextFlags_CharsHexadecimal) ? "%08X" : "%d"; - return InputScalar(label, ImGuiDataType_S32, (void*)v, (void*)(step>0 ? &step : NULL), (void*)(step_fast>0 ? &step_fast : NULL), format, flags); -} - -bool ImGui::InputInt2(const char* label, int v[2], ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_S32, v, 2, NULL, NULL, "%d", flags); -} - -bool ImGui::InputInt3(const char* label, int v[3], ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_S32, v, 3, NULL, NULL, "%d", flags); -} - -bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags) -{ - return InputScalarN(label, ImGuiDataType_S32, v, 4, NULL, NULL, "%d", flags); -} - -bool ImGui::InputDouble(const char* label, double* v, double step, double step_fast, const char* format, ImGuiInputTextFlags flags) -{ - flags |= ImGuiInputTextFlags_CharsScientific; - return InputScalar(label, ImGuiDataType_Double, (void*)v, (void*)(step>0.0 ? &step : NULL), (void*)(step_fast>0.0 ? &step_fast : NULL), format, flags); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: InputText, InputTextMultiline, InputTextWithHint -//------------------------------------------------------------------------- -// - InputText() -// - InputTextWithHint() -// - InputTextMultiline() -// - InputTextEx() [Internal] -//------------------------------------------------------------------------- - -bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline() - return InputTextEx(label, NULL, buf, (int)buf_size, ImVec2(0,0), flags, callback, user_data); -} - -bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - return InputTextEx(label, NULL, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data); -} - -bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline() - return InputTextEx(label, hint, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data); -} - -static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end) -{ - int line_count = 0; - const char* s = text_begin; - while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding - if (c == '\n') - line_count++; - s--; - if (s[0] != '\n' && s[0] != '\r') - line_count++; - *out_text_end = s; - return line_count; -} - -static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) -{ - ImGuiContext& g = *GImGui; - ImFont* font = g.Font; - const float line_height = g.FontSize; - const float scale = line_height / font->FontSize; - - ImVec2 text_size = ImVec2(0,0); - float line_width = 0.0f; - - const ImWchar* s = text_begin; - while (s < text_end) - { - unsigned int c = (unsigned int)(*s++); - if (c == '\n') - { - text_size.x = ImMax(text_size.x, line_width); - text_size.y += line_height; - line_width = 0.0f; - if (stop_on_new_line) - break; - continue; - } - if (c == '\r') - continue; - - const float char_width = font->GetCharAdvance((ImWchar)c) * scale; - line_width += char_width; - } - - if (text_size.x < line_width) - text_size.x = line_width; - - if (out_offset) - *out_offset = ImVec2(line_width, text_size.y + line_height); // offset allow for the possibility of sitting after a trailing \n - - if (line_width > 0 || text_size.y == 0.0f) // whereas size.y will ignore the trailing \n - text_size.y += line_height; - - if (remaining) - *remaining = s; - - return text_size; -} - -// Wrapper for stb_textedit.h to edit text (our wrapper is for: statically sized buffer, single-line, wchar characters. InputText converts between UTF-8 and wchar) -namespace ImStb -{ - -static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj) { return obj->CurLenW; } -static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING* obj, int idx) { return obj->TextW[idx]; } -static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *GImGui; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); } -static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x200000 ? 0 : key; } -static ImWchar STB_TEXTEDIT_NEWLINE = '\n'; -static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx) -{ - const ImWchar* text = obj->TextW.Data; - const ImWchar* text_remaining = NULL; - const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true); - r->x0 = 0.0f; - r->x1 = size.x; - r->baseline_y_delta = size.y; - r->ymin = 0.0f; - r->ymax = size.y; - r->num_chars = (int)(text_remaining - (text + line_start_idx)); -} - -static bool is_separator(unsigned int c) { return ImCharIsBlankW(c) || c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|'; } -static int is_word_boundary_from_right(STB_TEXTEDIT_STRING* obj, int idx) { return idx > 0 ? (is_separator( obj->TextW[idx-1] ) && !is_separator( obj->TextW[idx] ) ) : 1; } -static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; } -#ifdef __APPLE__ // FIXME: Move setting to IO structure -static int is_word_boundary_from_left(STB_TEXTEDIT_STRING* obj, int idx) { return idx > 0 ? (!is_separator( obj->TextW[idx-1] ) && is_separator( obj->TextW[idx] ) ) : 1; } -static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; } -#else -static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; } -#endif -#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h -#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL - -static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n) -{ - ImWchar* dst = obj->TextW.Data + pos; - - // We maintain our buffer length in both UTF-8 and wchar formats - obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n); - obj->CurLenW -= n; - - // Offset remaining text (FIXME-OPT: Use memmove) - const ImWchar* src = obj->TextW.Data + pos + n; - while (ImWchar c = *src++) - *dst++ = c; - *dst = '\0'; -} - -static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len) -{ - const bool is_resizable = (obj->UserFlags & ImGuiInputTextFlags_CallbackResize) != 0; - const int text_len = obj->CurLenW; - IM_ASSERT(pos <= text_len); - - const int new_text_len_utf8 = ImTextCountUtf8BytesFromStr(new_text, new_text + new_text_len); - if (!is_resizable && (new_text_len_utf8 + obj->CurLenA + 1 > obj->BufCapacityA)) - return false; - - // Grow internal buffer if needed - if (new_text_len + text_len + 1 > obj->TextW.Size) - { - if (!is_resizable) - return false; - IM_ASSERT(text_len < obj->TextW.Size); - obj->TextW.resize(text_len + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1); - } - - ImWchar* text = obj->TextW.Data; - if (pos != text_len) - memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos) * sizeof(ImWchar)); - memcpy(text + pos, new_text, (size_t)new_text_len * sizeof(ImWchar)); - - obj->CurLenW += new_text_len; - obj->CurLenA += new_text_len_utf8; - obj->TextW[obj->CurLenW] = '\0'; - - return true; -} - -// We don't use an enum so we can build even with conflicting symbols (if another user of stb_textedit.h leak their STB_TEXTEDIT_K_* symbols) -#define STB_TEXTEDIT_K_LEFT 0x200000 // keyboard input to move cursor left -#define STB_TEXTEDIT_K_RIGHT 0x200001 // keyboard input to move cursor right -#define STB_TEXTEDIT_K_UP 0x200002 // keyboard input to move cursor up -#define STB_TEXTEDIT_K_DOWN 0x200003 // keyboard input to move cursor down -#define STB_TEXTEDIT_K_LINESTART 0x200004 // keyboard input to move cursor to start of line -#define STB_TEXTEDIT_K_LINEEND 0x200005 // keyboard input to move cursor to end of line -#define STB_TEXTEDIT_K_TEXTSTART 0x200006 // keyboard input to move cursor to start of text -#define STB_TEXTEDIT_K_TEXTEND 0x200007 // keyboard input to move cursor to end of text -#define STB_TEXTEDIT_K_DELETE 0x200008 // keyboard input to delete selection or character under cursor -#define STB_TEXTEDIT_K_BACKSPACE 0x200009 // keyboard input to delete selection or character left of cursor -#define STB_TEXTEDIT_K_UNDO 0x20000A // keyboard input to perform undo -#define STB_TEXTEDIT_K_REDO 0x20000B // keyboard input to perform redo -#define STB_TEXTEDIT_K_WORDLEFT 0x20000C // keyboard input to move cursor left one word -#define STB_TEXTEDIT_K_WORDRIGHT 0x20000D // keyboard input to move cursor right one word -#define STB_TEXTEDIT_K_SHIFT 0x400000 - -#define STB_TEXTEDIT_IMPLEMENTATION -#include "imstb_textedit.h" - -// stb_textedit internally allows for a single undo record to do addition and deletion, but somehow, calling -// the stb_textedit_paste() function creates two separate records, so we perform it manually. (FIXME: Report to nothings/stb?) -static void stb_textedit_replace(STB_TEXTEDIT_STRING* str, STB_TexteditState* state, const STB_TEXTEDIT_CHARTYPE* text, int text_len) -{ - stb_text_makeundo_replace(str, state, 0, str->CurLenW, text_len); - ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->CurLenW); - if (text_len <= 0) - return; - if (ImStb::STB_TEXTEDIT_INSERTCHARS(str, 0, text, text_len)) - { - state->cursor = text_len; - state->has_preferred_x = 0; - return; - } - IM_ASSERT(0); // Failed to insert character, normally shouldn't happen because of how we currently use stb_textedit_replace() -} - -} // namespace ImStb - -void ImGuiInputTextState::OnKeyPressed(int key) -{ - stb_textedit_key(this, &Stb, key); - CursorFollow = true; - CursorAnimReset(); -} - -ImGuiInputTextCallbackData::ImGuiInputTextCallbackData() -{ - memset(this, 0, sizeof(*this)); -} - -// Public API to manipulate UTF-8 text -// We expose UTF-8 to the user (unlike the STB_TEXTEDIT_* functions which are manipulating wchar) -// FIXME: The existence of this rarely exercised code path is a bit of a nuisance. -void ImGuiInputTextCallbackData::DeleteChars(int pos, int bytes_count) -{ - IM_ASSERT(pos + bytes_count <= BufTextLen); - char* dst = Buf + pos; - const char* src = Buf + pos + bytes_count; - while (char c = *src++) - *dst++ = c; - *dst = '\0'; - - if (CursorPos + bytes_count >= pos) - CursorPos -= bytes_count; - else if (CursorPos >= pos) - CursorPos = pos; - SelectionStart = SelectionEnd = CursorPos; - BufDirty = true; - BufTextLen -= bytes_count; -} - -void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, const char* new_text_end) -{ - const bool is_resizable = (Flags & ImGuiInputTextFlags_CallbackResize) != 0; - const int new_text_len = new_text_end ? (int)(new_text_end - new_text) : (int)strlen(new_text); - if (new_text_len + BufTextLen >= BufSize) - { - if (!is_resizable) - return; - - // Contrary to STB_TEXTEDIT_INSERTCHARS() this is working in the UTF8 buffer, hence the midly similar code (until we remove the U16 buffer alltogether!) - ImGuiContext& g = *GImGui; - ImGuiInputTextState* edit_state = &g.InputTextState; - IM_ASSERT(edit_state->ID != 0 && g.ActiveId == edit_state->ID); - IM_ASSERT(Buf == edit_state->TextA.Data); - int new_buf_size = BufTextLen + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1; - edit_state->TextA.reserve(new_buf_size + 1); - Buf = edit_state->TextA.Data; - BufSize = edit_state->BufCapacityA = new_buf_size; - } - - if (BufTextLen != pos) - memmove(Buf + pos + new_text_len, Buf + pos, (size_t)(BufTextLen - pos)); - memcpy(Buf + pos, new_text, (size_t)new_text_len * sizeof(char)); - Buf[BufTextLen + new_text_len] = '\0'; - - if (CursorPos >= pos) - CursorPos += new_text_len; - SelectionStart = SelectionEnd = CursorPos; - BufDirty = true; - BufTextLen += new_text_len; -} - -// Return false to discard a character. -static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - unsigned int c = *p_char; - - // Filter non-printable (NB: isprint is unreliable! see #2467) - if (c < 0x20) - { - bool pass = false; - pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline)); - pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput)); - if (!pass) - return false; - } - - // We ignore Ascii representation of delete (emitted from Backspace on OSX, see #2578, #2817) - if (c == 127) - return false; - - // Filter private Unicode range. GLFW on OSX seems to send private characters for special keys like arrow keys (FIXME) - if (c >= 0xE000 && c <= 0xF8FF) - return false; - - // Filter Unicode ranges we are not handling in this build. - if (c > IM_UNICODE_CODEPOINT_MAX) - return false; - - // Generic named filters - if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific)) - { - if (flags & ImGuiInputTextFlags_CharsDecimal) - if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/')) - return false; - - if (flags & ImGuiInputTextFlags_CharsScientific) - if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/') && (c != 'e') && (c != 'E')) - return false; - - if (flags & ImGuiInputTextFlags_CharsHexadecimal) - if (!(c >= '0' && c <= '9') && !(c >= 'a' && c <= 'f') && !(c >= 'A' && c <= 'F')) - return false; - - if (flags & ImGuiInputTextFlags_CharsUppercase) - if (c >= 'a' && c <= 'z') - *p_char = (c += (unsigned int)('A'-'a')); - - if (flags & ImGuiInputTextFlags_CharsNoBlank) - if (ImCharIsBlankW(c)) - return false; - } - - // Custom callback filter - if (flags & ImGuiInputTextFlags_CallbackCharFilter) - { - ImGuiInputTextCallbackData callback_data; - memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData)); - callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter; - callback_data.EventChar = (ImWchar)c; - callback_data.Flags = flags; - callback_data.UserData = user_data; - if (callback(&callback_data) != 0) - return false; - *p_char = callback_data.EventChar; - if (!callback_data.EventChar) - return false; - } - - return true; -} - -// Edit a string of text -// - buf_size account for the zero-terminator, so a buf_size of 6 can hold "Hello" but not "Hello!". -// This is so we can easily call InputText() on static arrays using ARRAYSIZE() and to match -// Note that in std::string world, capacity() would omit 1 byte used by the zero-terminator. -// - When active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while the InputText is active has no effect. -// - If you want to use ImGui::InputText() with std::string, see misc/cpp/imgui_stdlib.h -// (FIXME: Rather confusing and messy function, among the worse part of our codebase, expecting to rewrite a V2 at some point.. Partly because we are -// doing UTF8 > U16 > UTF8 conversions on the go to easily interface with stb_textedit. Ideally should stay in UTF-8 all the time. See https://github.com/nothings/stb/issues/188) -bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* callback_user_data) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackHistory) && (flags & ImGuiInputTextFlags_Multiline))); // Can't use both together (they both use up/down keys) - IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackCompletion) && (flags & ImGuiInputTextFlags_AllowTabInput))); // Can't use both together (they both use tab key) - - ImGuiContext& g = *GImGui; - ImGuiIO& io = g.IO; - const ImGuiStyle& style = g.Style; - - const bool RENDER_SELECTION_WHEN_INACTIVE = false; - const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0; - const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0; - const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; - const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0; - const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0; - if (is_resizable) - IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag! - - if (is_multiline) // Open group before calling GetID() because groups tracks id created within their scope, - BeginGroup(); - const ImGuiID id = window->GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - const ImVec2 frame_size = CalcItemSize(size_arg, CalcItemWidth(), (is_multiline ? g.FontSize * 8.0f : label_size.y) + style.FramePadding.y*2.0f); // Arbitrary default of 8 lines high for multi-line - const ImVec2 total_size = ImVec2(frame_size.x + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), frame_size.y); - - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); - const ImRect total_bb(frame_bb.Min, frame_bb.Min + total_size); - - ImGuiWindow* draw_window = window; - ImVec2 inner_size = frame_size; - if (is_multiline) - { - if (!ItemAdd(total_bb, id, &frame_bb)) - { - ItemSize(total_bb, style.FramePadding.y); - EndGroup(); - return false; - } - - // We reproduce the contents of BeginChildFrame() in order to provide 'label' so our window internal data are easier to read/debug. - PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]); - PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding); - PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize); - PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding); - bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysUseWindowPadding); - PopStyleVar(3); - PopStyleColor(); - if (!child_visible) - { - EndChild(); - EndGroup(); - return false; - } - draw_window = g.CurrentWindow; // Child window - draw_window->DC.NavLayerActiveMaskNext |= draw_window->DC.NavLayerCurrentMask; // This is to ensure that EndChild() will display a navigation highlight so we can "enter" into it. - inner_size.x -= draw_window->ScrollbarSizes.x; - } - else - { - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id, &frame_bb)) - return false; - } - const bool hovered = ItemHoverable(frame_bb, id); - if (hovered) - g.MouseCursor = ImGuiMouseCursor_TextInput; - - // We are only allowed to access the state if we are already the active widget. - ImGuiInputTextState* state = GetInputTextState(id); - - const bool focus_requested = FocusableItemRegister(window, id); - const bool focus_requested_by_code = focus_requested && (g.FocusRequestCurrWindow == window && g.FocusRequestCurrCounterRegular == window->DC.FocusCounterRegular); - const bool focus_requested_by_tab = focus_requested && !focus_requested_by_code; - - const bool user_clicked = hovered && io.MouseClicked[0]; - const bool user_nav_input_start = (g.ActiveId != id) && ((g.NavInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_NavKeyboard)); - const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y); - const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetWindowScrollbarID(draw_window, ImGuiAxis_Y); - - bool clear_active_id = false; - bool select_all = (g.ActiveId != id) && ((flags & ImGuiInputTextFlags_AutoSelectAll) != 0 || user_nav_input_start) && (!is_multiline); - - const bool init_make_active = (focus_requested || user_clicked || user_scroll_finish || user_nav_input_start); - const bool init_state = (init_make_active || user_scroll_active); - if (init_state && g.ActiveId != id) - { - // Access state even if we don't own it yet. - state = &g.InputTextState; - state->CursorAnimReset(); - - // Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar) - // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode) - const int buf_len = (int)strlen(buf); - state->InitialTextA.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string. - memcpy(state->InitialTextA.Data, buf, buf_len + 1); - - // Start edition - const char* buf_end = NULL; - state->TextW.resize(buf_size + 1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data is always pointing to at least an empty string. - state->TextA.resize(0); - state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then) - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, buf_size, buf, NULL, &buf_end); - state->CurLenA = (int)(buf_end - buf); // We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. - - // Preserve cursor position and undo/redo stack if we come back to same widget - // FIXME: For non-readonly widgets we might be able to require that TextAIsValid && TextA == buf ? (untested) and discard undo stack if user buffer has changed. - const bool recycle_state = (state->ID == id); - if (recycle_state) - { - // Recycle existing cursor/selection/undo stack but clamp position - // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler. - state->CursorClamp(); - } - else - { - state->ID = id; - state->ScrollX = 0.0f; - stb_textedit_initialize_state(&state->Stb, !is_multiline); - if (!is_multiline && focus_requested_by_code) - select_all = true; - } - if (flags & ImGuiInputTextFlags_AlwaysInsertMode) - state->Stb.insert_mode = 1; - if (!is_multiline && (focus_requested_by_tab || (user_clicked && io.KeyCtrl))) - select_all = true; - } - - if (g.ActiveId != id && init_make_active) - { - IM_ASSERT(state && state->ID == id); - SetActiveID(id, window); - SetFocusID(id, window); - FocusWindow(window); - - // Declare our inputs - IM_ASSERT(ImGuiNavInput_COUNT < 32); - g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right); - if (is_multiline || (flags & ImGuiInputTextFlags_CallbackHistory)) - g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); - g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel); - g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_Home) | ((ImU64)1 << ImGuiKey_End); - if (is_multiline) - g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_PageUp) | ((ImU64)1 << ImGuiKey_PageDown); // FIXME-NAV: Page up/down actually not supported yet by widget, but claim them ahead. - if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character. - g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_Tab); - } - - // We have an edge case if ActiveId was set through another widget (e.g. widget being swapped), clear id immediately (don't wait until the end of the function) - if (g.ActiveId == id && state == NULL) - ClearActiveID(); - - // Release focus when we click outside - if (g.ActiveId == id && io.MouseClicked[0] && !init_state && !init_make_active) //-V560 - clear_active_id = true; - - // Lock the decision of whether we are going to take the path displaying the cursor or selection - const bool render_cursor = (g.ActiveId == id) || (state && user_scroll_active); - bool render_selection = state && state->HasSelection() && (RENDER_SELECTION_WHEN_INACTIVE || render_cursor); - bool value_changed = false; - bool enter_pressed = false; - - // When read-only we always use the live data passed to the function - // FIXME-OPT: Because our selection/cursor code currently needs the wide text we need to convert it when active, which is not ideal :( - if (is_readonly && state != NULL && (render_cursor || render_selection)) - { - const char* buf_end = NULL; - state->TextW.resize(buf_size + 1); - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, buf, NULL, &buf_end); - state->CurLenA = (int)(buf_end - buf); - state->CursorClamp(); - render_selection &= state->HasSelection(); - } - - // Select the buffer to render. - const bool buf_display_from_state = (render_cursor || render_selection || g.ActiveId == id) && !is_readonly && state && state->TextAIsValid; - const bool is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0); - - // Password pushes a temporary font with only a fallback glyph - if (is_password && !is_displaying_hint) - { - const ImFontGlyph* glyph = g.Font->FindGlyph('*'); - ImFont* password_font = &g.InputTextPasswordFont; - password_font->FontSize = g.Font->FontSize; - password_font->Scale = g.Font->Scale; - password_font->DisplayOffset = g.Font->DisplayOffset; - password_font->Ascent = g.Font->Ascent; - password_font->Descent = g.Font->Descent; - password_font->ContainerAtlas = g.Font->ContainerAtlas; - password_font->FallbackGlyph = glyph; - password_font->FallbackAdvanceX = glyph->AdvanceX; - IM_ASSERT(password_font->Glyphs.empty() && password_font->IndexAdvanceX.empty() && password_font->IndexLookup.empty()); - PushFont(password_font); - } - - // Process mouse inputs and character inputs - int backup_current_text_length = 0; - if (g.ActiveId == id) - { - IM_ASSERT(state != NULL); - backup_current_text_length = state->CurLenA; - state->BufCapacityA = buf_size; - state->UserFlags = flags; - state->UserCallback = callback; - state->UserCallbackData = callback_user_data; - - // Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget. - // Down the line we should have a cleaner library-wide concept of Selected vs Active. - g.ActiveIdAllowOverlap = !io.MouseDown[0]; - g.WantTextInputNextFrame = 1; - - // Edit in progress - const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->ScrollX; - const float mouse_y = (is_multiline ? (io.MousePos.y - draw_window->DC.CursorPos.y - style.FramePadding.y) : (g.FontSize*0.5f)); - - const bool is_osx = io.ConfigMacOSXBehaviors; - if (select_all || (hovered && !is_osx && io.MouseDoubleClicked[0])) - { - state->SelectAll(); - state->SelectedAllMouseLock = true; - } - else if (hovered && is_osx && io.MouseDoubleClicked[0]) - { - // Double-click select a word only, OS X style (by simulating keystrokes) - state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT); - state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT); - } - else if (io.MouseClicked[0] && !state->SelectedAllMouseLock) - { - if (hovered) - { - stb_textedit_click(state, &state->Stb, mouse_x, mouse_y); - state->CursorAnimReset(); - } - } - else if (io.MouseDown[0] && !state->SelectedAllMouseLock && (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)) - { - stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y); - state->CursorAnimReset(); - state->CursorFollow = true; - } - if (state->SelectedAllMouseLock && !io.MouseDown[0]) - state->SelectedAllMouseLock = false; - - // It is ill-defined whether the back-end needs to send a \t character when pressing the TAB keys. - // Win32 and GLFW naturally do it but not SDL. - const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeySuper); - if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressedMap(ImGuiKey_Tab) && !ignore_char_inputs && !io.KeyShift && !is_readonly) - if (!io.InputQueueCharacters.contains('\t')) - { - unsigned int c = '\t'; // Insert TAB - if (InputTextFilterCharacter(&c, flags, callback, callback_user_data)) - state->OnKeyPressed((int)c); - } - - // Process regular text input (before we check for Return because using some IME will effectively send a Return?) - // We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters. - if (io.InputQueueCharacters.Size > 0) - { - if (!ignore_char_inputs && !is_readonly && !user_nav_input_start) - for (int n = 0; n < io.InputQueueCharacters.Size; n++) - { - // Insert character if they pass filtering - unsigned int c = (unsigned int)io.InputQueueCharacters[n]; - if (c == '\t' && io.KeyShift) - continue; - if (InputTextFilterCharacter(&c, flags, callback, callback_user_data)) - state->OnKeyPressed((int)c); - } - - // Consume characters - io.InputQueueCharacters.resize(0); - } - } - - // Process other shortcuts/key-presses - bool cancel_edit = false; - if (g.ActiveId == id && !g.ActiveIdIsJustActivated && !clear_active_id) - { - IM_ASSERT(state != NULL); - IM_ASSERT(io.KeyMods == GetMergedKeyModFlags() && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); // We rarely do this check, but if anything let's do it here. - - const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0); - const bool is_osx = io.ConfigMacOSXBehaviors; - const bool is_osx_shift_shortcut = is_osx && (io.KeyMods == (ImGuiKeyModFlags_Super | ImGuiKeyModFlags_Shift)); - const bool is_wordmove_key_down = is_osx ? io.KeyAlt : io.KeyCtrl; // OS X style: Text editing cursor movement using Alt instead of Ctrl - const bool is_startend_key_down = is_osx && io.KeySuper && !io.KeyCtrl && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End - const bool is_ctrl_key_only = (io.KeyMods == ImGuiKeyModFlags_Ctrl); - const bool is_shift_key_only = (io.KeyMods == ImGuiKeyModFlags_Shift); - const bool is_shortcut_key = g.IO.ConfigMacOSXBehaviors ? (io.KeyMods == ImGuiKeyModFlags_Super) : (io.KeyMods == ImGuiKeyModFlags_Ctrl); - - const bool is_cut = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_X)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Delete))) && !is_readonly && !is_password && (!is_multiline || state->HasSelection()); - const bool is_copy = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_C)) || (is_ctrl_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && !is_password && (!is_multiline || state->HasSelection()); - const bool is_paste = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_V)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && !is_readonly; - const bool is_undo = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_Z)) && !is_readonly && is_undoable); - const bool is_redo = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_Y)) || (is_osx_shift_shortcut && IsKeyPressedMap(ImGuiKey_Z))) && !is_readonly && is_undoable; - - if (IsKeyPressedMap(ImGuiKey_LeftArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_RightArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_DownArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMin(draw_window->Scroll.y + g.FontSize, GetScrollMaxY())); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTEND : STB_TEXTEDIT_K_DOWN) | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_Home)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_End)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_Delete) && !is_readonly) { state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_Backspace) && !is_readonly) - { - if (!state->HasSelection()) - { - if (is_wordmove_key_down) - state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT|STB_TEXTEDIT_K_SHIFT); - else if (is_osx && io.KeySuper && !io.KeyAlt && !io.KeyCtrl) - state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART|STB_TEXTEDIT_K_SHIFT); - } - state->OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); - } - else if (IsKeyPressedMap(ImGuiKey_Enter) || IsKeyPressedMap(ImGuiKey_KeyPadEnter)) - { - bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0; - if (!is_multiline || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl)) - { - enter_pressed = clear_active_id = true; - } - else if (!is_readonly) - { - unsigned int c = '\n'; // Insert new line - if (InputTextFilterCharacter(&c, flags, callback, callback_user_data)) - state->OnKeyPressed((int)c); - } - } - else if (IsKeyPressedMap(ImGuiKey_Escape)) - { - clear_active_id = cancel_edit = true; - } - else if (is_undo || is_redo) - { - state->OnKeyPressed(is_undo ? STB_TEXTEDIT_K_UNDO : STB_TEXTEDIT_K_REDO); - state->ClearSelection(); - } - else if (is_shortcut_key && IsKeyPressedMap(ImGuiKey_A)) - { - state->SelectAll(); - state->CursorFollow = true; - } - else if (is_cut || is_copy) - { - // Cut, Copy - if (io.SetClipboardTextFn) - { - const int ib = state->HasSelection() ? ImMin(state->Stb.select_start, state->Stb.select_end) : 0; - const int ie = state->HasSelection() ? ImMax(state->Stb.select_start, state->Stb.select_end) : state->CurLenW; - const int clipboard_data_len = ImTextCountUtf8BytesFromStr(state->TextW.Data + ib, state->TextW.Data + ie) + 1; - char* clipboard_data = (char*)IM_ALLOC(clipboard_data_len * sizeof(char)); - ImTextStrToUtf8(clipboard_data, clipboard_data_len, state->TextW.Data + ib, state->TextW.Data + ie); - SetClipboardText(clipboard_data); - MemFree(clipboard_data); - } - if (is_cut) - { - if (!state->HasSelection()) - state->SelectAll(); - state->CursorFollow = true; - stb_textedit_cut(state, &state->Stb); - } - } - else if (is_paste) - { - if (const char* clipboard = GetClipboardText()) - { - // Filter pasted buffer - const int clipboard_len = (int)strlen(clipboard); - ImWchar* clipboard_filtered = (ImWchar*)IM_ALLOC((clipboard_len+1) * sizeof(ImWchar)); - int clipboard_filtered_len = 0; - for (const char* s = clipboard; *s; ) - { - unsigned int c; - s += ImTextCharFromUtf8(&c, s, NULL); - if (c == 0) - break; - if (!InputTextFilterCharacter(&c, flags, callback, callback_user_data)) - continue; - clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c; - } - clipboard_filtered[clipboard_filtered_len] = 0; - if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation - { - stb_textedit_paste(state, &state->Stb, clipboard_filtered, clipboard_filtered_len); - state->CursorFollow = true; - } - MemFree(clipboard_filtered); - } - } - - // Update render selection flag after events have been handled, so selection highlight can be displayed during the same frame. - render_selection |= state->HasSelection() && (RENDER_SELECTION_WHEN_INACTIVE || render_cursor); - } - - // Process callbacks and apply result back to user's buffer. - if (g.ActiveId == id) - { - IM_ASSERT(state != NULL); - const char* apply_new_text = NULL; - int apply_new_text_length = 0; - if (cancel_edit) - { - // Restore initial value. Only return true if restoring to the initial value changes the current buffer contents. - if (!is_readonly && strcmp(buf, state->InitialTextA.Data) != 0) - { - // Push records into the undo stack so we can CTRL+Z the revert operation itself - apply_new_text = state->InitialTextA.Data; - apply_new_text_length = state->InitialTextA.Size - 1; - ImVector w_text; - if (apply_new_text_length > 0) - { - w_text.resize(ImTextCountCharsFromUtf8(apply_new_text, apply_new_text + apply_new_text_length) + 1); - ImTextStrFromUtf8(w_text.Data, w_text.Size, apply_new_text, apply_new_text + apply_new_text_length); - } - stb_textedit_replace(state, &state->Stb, w_text.Data, (apply_new_text_length > 0) ? (w_text.Size - 1) : 0); - } - } - - // When using 'ImGuiInputTextFlags_EnterReturnsTrue' as a special case we reapply the live buffer back to the input buffer before clearing ActiveId, even though strictly speaking it wasn't modified on this frame. - // If we didn't do that, code like InputInt() with ImGuiInputTextFlags_EnterReturnsTrue would fail. - // This also allows the user to use InputText() with ImGuiInputTextFlags_EnterReturnsTrue without maintaining any user-side storage (please note that if you use this property along ImGuiInputTextFlags_CallbackResize you can end up with your temporary string object unnecessarily allocating once a frame, either store your string data, either if you don't then don't use ImGuiInputTextFlags_CallbackResize). - bool apply_edit_back_to_user_buffer = !cancel_edit || (enter_pressed && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0); - if (apply_edit_back_to_user_buffer) - { - // Apply new value immediately - copy modified buffer back - // Note that as soon as the input box is active, the in-widget value gets priority over any underlying modification of the input buffer - // FIXME: We actually always render 'buf' when calling DrawList->AddText, making the comment above incorrect. - // FIXME-OPT: CPU waste to do this every time the widget is active, should mark dirty state from the stb_textedit callbacks. - if (!is_readonly) - { - state->TextAIsValid = true; - state->TextA.resize(state->TextW.Size * 4 + 1); - ImTextStrToUtf8(state->TextA.Data, state->TextA.Size, state->TextW.Data, NULL); - } - - // User callback - if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackAlways)) != 0) - { - IM_ASSERT(callback != NULL); - - // The reason we specify the usage semantic (Completion/History) is that Completion needs to disable keyboard TABBING at the moment. - ImGuiInputTextFlags event_flag = 0; - ImGuiKey event_key = ImGuiKey_COUNT; - if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressedMap(ImGuiKey_Tab)) - { - event_flag = ImGuiInputTextFlags_CallbackCompletion; - event_key = ImGuiKey_Tab; - } - else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_UpArrow)) - { - event_flag = ImGuiInputTextFlags_CallbackHistory; - event_key = ImGuiKey_UpArrow; - } - else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_DownArrow)) - { - event_flag = ImGuiInputTextFlags_CallbackHistory; - event_key = ImGuiKey_DownArrow; - } - else if (flags & ImGuiInputTextFlags_CallbackAlways) - event_flag = ImGuiInputTextFlags_CallbackAlways; - - if (event_flag) - { - ImGuiInputTextCallbackData callback_data; - memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData)); - callback_data.EventFlag = event_flag; - callback_data.Flags = flags; - callback_data.UserData = callback_user_data; - - callback_data.EventKey = event_key; - callback_data.Buf = state->TextA.Data; - callback_data.BufTextLen = state->CurLenA; - callback_data.BufSize = state->BufCapacityA; - callback_data.BufDirty = false; - - // We have to convert from wchar-positions to UTF-8-positions, which can be pretty slow (an incentive to ditch the ImWchar buffer, see https://github.com/nothings/stb/issues/188) - ImWchar* text = state->TextW.Data; - const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + state->Stb.cursor); - const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_start); - const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_end); - - // Call user code - callback(&callback_data); - - // Read back what user may have modified - IM_ASSERT(callback_data.Buf == state->TextA.Data); // Invalid to modify those fields - IM_ASSERT(callback_data.BufSize == state->BufCapacityA); - IM_ASSERT(callback_data.Flags == flags); - if (callback_data.CursorPos != utf8_cursor_pos) { state->Stb.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos); state->CursorFollow = true; } - if (callback_data.SelectionStart != utf8_selection_start) { state->Stb.select_start = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionStart); } - if (callback_data.SelectionEnd != utf8_selection_end) { state->Stb.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); } - if (callback_data.BufDirty) - { - IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text! - if (callback_data.BufTextLen > backup_current_text_length && is_resizable) - state->TextW.resize(state->TextW.Size + (callback_data.BufTextLen - backup_current_text_length)); - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, callback_data.Buf, NULL); - state->CurLenA = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen() - state->CursorAnimReset(); - } - } - } - - // Will copy result string if modified - if (!is_readonly && strcmp(state->TextA.Data, buf) != 0) - { - apply_new_text = state->TextA.Data; - apply_new_text_length = state->CurLenA; - } - } - - // Copy result to user buffer - if (apply_new_text) - { - // We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size - // of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used - // without any storage on user's side. - IM_ASSERT(apply_new_text_length >= 0); - if (is_resizable) - { - ImGuiInputTextCallbackData callback_data; - callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize; - callback_data.Flags = flags; - callback_data.Buf = buf; - callback_data.BufTextLen = apply_new_text_length; - callback_data.BufSize = ImMax(buf_size, apply_new_text_length + 1); - callback_data.UserData = callback_user_data; - callback(&callback_data); - buf = callback_data.Buf; - buf_size = callback_data.BufSize; - apply_new_text_length = ImMin(callback_data.BufTextLen, buf_size - 1); - IM_ASSERT(apply_new_text_length <= buf_size); - } - //IMGUI_DEBUG_LOG("InputText(\"%s\"): apply_new_text length %d\n", label, apply_new_text_length); - - // If the underlying buffer resize was denied or not carried to the next frame, apply_new_text_length+1 may be >= buf_size. - ImStrncpy(buf, apply_new_text, ImMin(apply_new_text_length + 1, buf_size)); - value_changed = true; - } - - // Clear temporary user storage - state->UserFlags = 0; - state->UserCallback = NULL; - state->UserCallbackData = NULL; - } - - // Release active ID at the end of the function (so e.g. pressing Return still does a final application of the value) - if (clear_active_id && g.ActiveId == id) - ClearActiveID(); - - // Render frame - if (!is_multiline) - { - RenderNavHighlight(frame_bb, id); - RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); - } - - const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + inner_size.x, frame_bb.Min.y + inner_size.y); // Not using frame_bb.Max because we have adjusted size - ImVec2 draw_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding; - ImVec2 text_size(0.0f, 0.0f); - - // Set upper limit of single-line InputTextEx() at 2 million characters strings. The current pathological worst case is a long line - // without any carriage return, which would makes ImFont::RenderText() reserve too many vertices and probably crash. Avoid it altogether. - // Note that we only use this limit on single-line InputText(), so a pathologically large line on a InputTextMultiline() would still crash. - const int buf_display_max_length = 2 * 1024 * 1024; - const char* buf_display = buf_display_from_state ? state->TextA.Data : buf; //-V595 - const char* buf_display_end = NULL; // We have specialized paths below for setting the length - if (is_displaying_hint) - { - buf_display = hint; - buf_display_end = hint + strlen(hint); - } - - // Render text. We currently only render selection when the widget is active or while scrolling. - // FIXME: We could remove the '&& render_cursor' to keep rendering selection when inactive. - if (render_cursor || render_selection) - { - IM_ASSERT(state != NULL); - if (!is_displaying_hint) - buf_display_end = buf_display + state->CurLenA; - - // Render text (with cursor and selection) - // This is going to be messy. We need to: - // - Display the text (this alone can be more easily clipped) - // - Handle scrolling, highlight selection, display cursor (those all requires some form of 1d->2d cursor position calculation) - // - Measure text height (for scrollbar) - // We are attempting to do most of that in **one main pass** to minimize the computation cost (non-negligible for large amount of text) + 2nd pass for selection rendering (we could merge them by an extra refactoring effort) - // FIXME: This should occur on buf_display but we'd need to maintain cursor/select_start/select_end for UTF-8. - const ImWchar* text_begin = state->TextW.Data; - ImVec2 cursor_offset, select_start_offset; - - { - // Find lines numbers straddling 'cursor' (slot 0) and 'select_start' (slot 1) positions. - const ImWchar* searches_input_ptr[2] = { NULL, NULL }; - int searches_result_line_no[2] = { -1000, -1000 }; - int searches_remaining = 0; - if (render_cursor) - { - searches_input_ptr[0] = text_begin + state->Stb.cursor; - searches_result_line_no[0] = -1; - searches_remaining++; - } - if (render_selection) - { - searches_input_ptr[1] = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end); - searches_result_line_no[1] = -1; - searches_remaining++; - } - - // Iterate all lines to find our line numbers - // In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter. - searches_remaining += is_multiline ? 1 : 0; - int line_count = 0; - //for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bit - for (const ImWchar* s = text_begin; *s != 0; s++) - if (*s == '\n') - { - line_count++; - if (searches_result_line_no[0] == -1 && s >= searches_input_ptr[0]) { searches_result_line_no[0] = line_count; if (--searches_remaining <= 0) break; } - if (searches_result_line_no[1] == -1 && s >= searches_input_ptr[1]) { searches_result_line_no[1] = line_count; if (--searches_remaining <= 0) break; } - } - line_count++; - if (searches_result_line_no[0] == -1) - searches_result_line_no[0] = line_count; - if (searches_result_line_no[1] == -1) - searches_result_line_no[1] = line_count; - - // Calculate 2d position by finding the beginning of the line and measuring distance - cursor_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x; - cursor_offset.y = searches_result_line_no[0] * g.FontSize; - if (searches_result_line_no[1] >= 0) - { - select_start_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x; - select_start_offset.y = searches_result_line_no[1] * g.FontSize; - } - - // Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224) - if (is_multiline) - text_size = ImVec2(inner_size.x, line_count * g.FontSize); - } - - // Scroll - if (render_cursor && state->CursorFollow) - { - // Horizontal scroll in chunks of quarter width - if (!(flags & ImGuiInputTextFlags_NoHorizontalScroll)) - { - const float scroll_increment_x = inner_size.x * 0.25f; - if (cursor_offset.x < state->ScrollX) - state->ScrollX = IM_FLOOR(ImMax(0.0f, cursor_offset.x - scroll_increment_x)); - else if (cursor_offset.x - inner_size.x >= state->ScrollX) - state->ScrollX = IM_FLOOR(cursor_offset.x - inner_size.x + scroll_increment_x); - } - else - { - state->ScrollX = 0.0f; - } - - // Vertical scroll - if (is_multiline) - { - float scroll_y = draw_window->Scroll.y; - if (cursor_offset.y - g.FontSize < scroll_y) - scroll_y = ImMax(0.0f, cursor_offset.y - g.FontSize); - else if (cursor_offset.y - inner_size.y >= scroll_y) - scroll_y = cursor_offset.y - inner_size.y; - draw_pos.y += (draw_window->Scroll.y - scroll_y); // Manipulate cursor pos immediately avoid a frame of lag - draw_window->Scroll.y = scroll_y; - } - - state->CursorFollow = false; - } - - // Draw selection - const ImVec2 draw_scroll = ImVec2(state->ScrollX, 0.0f); - if (render_selection) - { - const ImWchar* text_selected_begin = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end); - const ImWchar* text_selected_end = text_begin + ImMax(state->Stb.select_start, state->Stb.select_end); - - ImU32 bg_color = GetColorU32(ImGuiCol_TextSelectedBg, render_cursor ? 1.0f : 0.6f); // FIXME: current code flow mandate that render_cursor is always true here, we are leaving the transparent one for tests. - float bg_offy_up = is_multiline ? 0.0f : -1.0f; // FIXME: those offsets should be part of the style? they don't play so well with multi-line selection. - float bg_offy_dn = is_multiline ? 0.0f : 2.0f; - ImVec2 rect_pos = draw_pos + select_start_offset - draw_scroll; - for (const ImWchar* p = text_selected_begin; p < text_selected_end; ) - { - if (rect_pos.y > clip_rect.w + g.FontSize) - break; - if (rect_pos.y < clip_rect.y) - { - //p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p); // FIXME-OPT: Could use this when wchar_t are 16-bit - //p = p ? p + 1 : text_selected_end; - while (p < text_selected_end) - if (*p++ == '\n') - break; - } - else - { - ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true); - if (rect_size.x <= 0.0f) rect_size.x = IM_FLOOR(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines - ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos +ImVec2(rect_size.x, bg_offy_dn)); - rect.ClipWith(clip_rect); - if (rect.Overlaps(clip_rect)) - draw_window->DrawList->AddRectFilled(rect.Min, rect.Max, bg_color); - } - rect_pos.x = draw_pos.x - draw_scroll.x; - rect_pos.y += g.FontSize; - } - } - - // We test for 'buf_display_max_length' as a way to avoid some pathological cases (e.g. single-line 1 MB string) which would make ImDrawList crash. - if (is_multiline || (buf_display_end - buf_display) < buf_display_max_length) - { - ImU32 col = GetColorU32(is_displaying_hint ? ImGuiCol_TextDisabled : ImGuiCol_Text); - draw_window->DrawList->AddText(g.Font, g.FontSize, draw_pos - draw_scroll, col, buf_display, buf_display_end, 0.0f, is_multiline ? NULL : &clip_rect); - } - - // Draw blinking cursor - if (render_cursor) - { - state->CursorAnim += io.DeltaTime; - bool cursor_is_visible = (!g.IO.ConfigInputTextCursorBlink) || (state->CursorAnim <= 0.0f) || ImFmod(state->CursorAnim, 1.20f) <= 0.80f; - ImVec2 cursor_screen_pos = draw_pos + cursor_offset - draw_scroll; - ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f); - if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect)) - draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text)); - - // Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.) - if (!is_readonly) - g.PlatformImePos = ImVec2(cursor_screen_pos.x - 1.0f, cursor_screen_pos.y - g.FontSize); - } - } - else - { - // Render text only (no selection, no cursor) - if (is_multiline) - text_size = ImVec2(inner_size.x, InputTextCalcTextLenAndLineCount(buf_display, &buf_display_end) * g.FontSize); // We don't need width - else if (!is_displaying_hint && g.ActiveId == id) - buf_display_end = buf_display + state->CurLenA; - else if (!is_displaying_hint) - buf_display_end = buf_display + strlen(buf_display); - - if (is_multiline || (buf_display_end - buf_display) < buf_display_max_length) - { - ImU32 col = GetColorU32(is_displaying_hint ? ImGuiCol_TextDisabled : ImGuiCol_Text); - draw_window->DrawList->AddText(g.Font, g.FontSize, draw_pos, col, buf_display, buf_display_end, 0.0f, is_multiline ? NULL : &clip_rect); - } - } - - if (is_multiline) - { - Dummy(text_size + ImVec2(0.0f, g.FontSize)); // Always add room to scroll an extra line - EndChild(); - EndGroup(); - } - - if (is_password && !is_displaying_hint) - PopFont(); - - // Log as text - if (g.LogEnabled && !(is_password && !is_displaying_hint)) - LogRenderedText(&draw_pos, buf_display, buf_display_end); - - if (label_size.x > 0) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - if (value_changed && !(flags & ImGuiInputTextFlags_NoMarkEdited)) - MarkItemEdited(id); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); - if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0) - return enter_pressed; - else - return value_changed; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc. -//------------------------------------------------------------------------- -// - ColorEdit3() -// - ColorEdit4() -// - ColorPicker3() -// - RenderColorRectWithAlphaCheckerboard() [Internal] -// - ColorPicker4() -// - ColorButton() -// - SetColorEditOptions() -// - ColorTooltip() [Internal] -// - ColorEditOptionsPopup() [Internal] -// - ColorPickerOptionsPopup() [Internal] -//------------------------------------------------------------------------- - -bool ImGui::ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags) -{ - return ColorEdit4(label, col, flags | ImGuiColorEditFlags_NoAlpha); -} - -// Edit colors components (each component in 0.0f..1.0f range). -// See enum ImGuiColorEditFlags_ for available options. e.g. Only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. -// With typical options: Left-click on colored square to open color picker. Right-click to open option menu. CTRL-Click over input fields to edit them and TAB to go to next item. -bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const float square_sz = GetFrameHeight(); - const float w_full = CalcItemWidth(); - const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x); - const float w_inputs = w_full - w_button; - const char* label_display_end = FindRenderedTextEnd(label); - g.NextItemData.ClearFlags(); - - BeginGroup(); - PushID(label); - - // If we're not showing any slider there's no point in doing any HSV conversions - const ImGuiColorEditFlags flags_untouched = flags; - if (flags & ImGuiColorEditFlags_NoInputs) - flags = (flags & (~ImGuiColorEditFlags__DisplayMask)) | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_NoOptions; - - // Context menu: display and modify options (before defaults are applied) - if (!(flags & ImGuiColorEditFlags_NoOptions)) - ColorEditOptionsPopup(col, flags); - - // Read stored options - if (!(flags & ImGuiColorEditFlags__DisplayMask)) - flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DisplayMask); - if (!(flags & ImGuiColorEditFlags__DataTypeMask)) - flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DataTypeMask); - if (!(flags & ImGuiColorEditFlags__PickerMask)) - flags |= (g.ColorEditOptions & ImGuiColorEditFlags__PickerMask); - if (!(flags & ImGuiColorEditFlags__InputMask)) - flags |= (g.ColorEditOptions & ImGuiColorEditFlags__InputMask); - flags |= (g.ColorEditOptions & ~(ImGuiColorEditFlags__DisplayMask | ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask | ImGuiColorEditFlags__InputMask)); - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__DisplayMask)); // Check that only 1 is selected - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__InputMask)); // Check that only 1 is selected - - const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0; - const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0; - const int components = alpha ? 4 : 3; - - // Convert to the formats we need - float f[4] = { col[0], col[1], col[2], alpha ? col[3] : 1.0f }; - if ((flags & ImGuiColorEditFlags_InputHSV) && (flags & ImGuiColorEditFlags_DisplayRGB)) - ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); - else if ((flags & ImGuiColorEditFlags_InputRGB) && (flags & ImGuiColorEditFlags_DisplayHSV)) - { - // Hue is lost when converting from greyscale rgb (saturation=0). Restore it. - ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]); - if (memcmp(g.ColorEditLastColor, col, sizeof(float) * 3) == 0) - { - if (f[1] == 0) - f[0] = g.ColorEditLastHue; - if (f[2] == 0) - f[1] = g.ColorEditLastSat; - } - } - int i[4] = { IM_F32_TO_INT8_UNBOUND(f[0]), IM_F32_TO_INT8_UNBOUND(f[1]), IM_F32_TO_INT8_UNBOUND(f[2]), IM_F32_TO_INT8_UNBOUND(f[3]) }; - - bool value_changed = false; - bool value_changed_as_float = false; - - const ImVec2 pos = window->DC.CursorPos; - const float inputs_offset_x = (style.ColorButtonPosition == ImGuiDir_Left) ? w_button : 0.0f; - window->DC.CursorPos.x = pos.x + inputs_offset_x; - - if ((flags & (ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0) - { - // RGB/HSV 0..255 Sliders - const float w_item_one = ImMax(1.0f, IM_FLOOR((w_inputs - (style.ItemInnerSpacing.x) * (components-1)) / (float)components)); - const float w_item_last = ImMax(1.0f, IM_FLOOR(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components-1))); - - const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x); - static const char* ids[4] = { "##X", "##Y", "##Z", "##W" }; - static const char* fmt_table_int[3][4] = - { - { "%3d", "%3d", "%3d", "%3d" }, // Short display - { "R:%3d", "G:%3d", "B:%3d", "A:%3d" }, // Long display for RGBA - { "H:%3d", "S:%3d", "V:%3d", "A:%3d" } // Long display for HSVA - }; - static const char* fmt_table_float[3][4] = - { - { "%0.3f", "%0.3f", "%0.3f", "%0.3f" }, // Short display - { "R:%0.3f", "G:%0.3f", "B:%0.3f", "A:%0.3f" }, // Long display for RGBA - { "H:%0.3f", "S:%0.3f", "V:%0.3f", "A:%0.3f" } // Long display for HSVA - }; - const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_DisplayHSV) ? 2 : 1; - - for (int n = 0; n < components; n++) - { - if (n > 0) - SameLine(0, style.ItemInnerSpacing.x); - SetNextItemWidth((n + 1 < components) ? w_item_one : w_item_last); - - // FIXME: When ImGuiColorEditFlags_HDR flag is passed HS values snap in weird ways when SV values go below 0. - if (flags & ImGuiColorEditFlags_Float) - { - value_changed |= DragFloat(ids[n], &f[n], 1.0f/255.0f, 0.0f, hdr ? 0.0f : 1.0f, fmt_table_float[fmt_idx][n]); - value_changed_as_float |= value_changed; - } - else - { - value_changed |= DragInt(ids[n], &i[n], 1.0f, 0, hdr ? 0 : 255, fmt_table_int[fmt_idx][n]); - } - if (!(flags & ImGuiColorEditFlags_NoOptions)) - OpenPopupOnItemClick("context"); - } - } - else if ((flags & ImGuiColorEditFlags_DisplayHex) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0) - { - // RGB Hexadecimal Input - char buf[64]; - if (alpha) - ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", ImClamp(i[0],0,255), ImClamp(i[1],0,255), ImClamp(i[2],0,255), ImClamp(i[3],0,255)); - else - ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0],0,255), ImClamp(i[1],0,255), ImClamp(i[2],0,255)); - SetNextItemWidth(w_inputs); - if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase)) - { - value_changed = true; - char* p = buf; - while (*p == '#' || ImCharIsBlankA(*p)) - p++; - i[0] = i[1] = i[2] = i[3] = 0; - if (alpha) - sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]); // Treat at unsigned (%X is unsigned) - else - sscanf(p, "%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2]); - } - if (!(flags & ImGuiColorEditFlags_NoOptions)) - OpenPopupOnItemClick("context"); - } - - ImGuiWindow* picker_active_window = NULL; - if (!(flags & ImGuiColorEditFlags_NoSmallPreview)) - { - const float button_offset_x = ((flags & ImGuiColorEditFlags_NoInputs) || (style.ColorButtonPosition == ImGuiDir_Left)) ? 0.0f : w_inputs + style.ItemInnerSpacing.x; - window->DC.CursorPos = ImVec2(pos.x + button_offset_x, pos.y); - - const ImVec4 col_v4(col[0], col[1], col[2], alpha ? col[3] : 1.0f); - if (ColorButton("##ColorButton", col_v4, flags)) - { - if (!(flags & ImGuiColorEditFlags_NoPicker)) - { - // Store current color and open a picker - g.ColorPickerRef = col_v4; - OpenPopup("picker"); - SetNextWindowPos(window->DC.LastItemRect.GetBL() + ImVec2(-1,style.ItemSpacing.y)); - } - } - if (!(flags & ImGuiColorEditFlags_NoOptions)) - OpenPopupOnItemClick("context"); - - if (BeginPopup("picker")) - { - picker_active_window = g.CurrentWindow; - if (label != label_display_end) - { - TextEx(label, label_display_end); - Spacing(); - } - ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask | ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar; - ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags__DisplayMask | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf; - SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes? - value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x); - EndPopup(); - } - } - - if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel)) - { - const float text_offset_x = (flags & ImGuiColorEditFlags_NoInputs) ? w_button : w_full + style.ItemInnerSpacing.x; - window->DC.CursorPos = ImVec2(pos.x + text_offset_x, pos.y + style.FramePadding.y); - TextEx(label, label_display_end); - } - - // Convert back - if (value_changed && picker_active_window == NULL) - { - if (!value_changed_as_float) - for (int n = 0; n < 4; n++) - f[n] = i[n] / 255.0f; - if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB)) - { - g.ColorEditLastHue = f[0]; - g.ColorEditLastSat = f[1]; - ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); - memcpy(g.ColorEditLastColor, f, sizeof(float) * 3); - } - if ((flags & ImGuiColorEditFlags_DisplayRGB) && (flags & ImGuiColorEditFlags_InputHSV)) - ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]); - - col[0] = f[0]; - col[1] = f[1]; - col[2] = f[2]; - if (alpha) - col[3] = f[3]; - } - - PopID(); - EndGroup(); - - // Drag and Drop Target - // NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test. - if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget()) - { - bool accepted_drag_drop = false; - if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) - { - memcpy((float*)col, payload->Data, sizeof(float) * 3); // Preserve alpha if any //-V512 - value_changed = accepted_drag_drop = true; - } - if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F)) - { - memcpy((float*)col, payload->Data, sizeof(float) * components); - value_changed = accepted_drag_drop = true; - } - - // Drag-drop payloads are always RGB - if (accepted_drag_drop && (flags & ImGuiColorEditFlags_InputHSV)) - ColorConvertRGBtoHSV(col[0], col[1], col[2], col[0], col[1], col[2]); - EndDragDropTarget(); - } - - // When picker is being actively used, use its active id so IsItemActive() will function on ColorEdit4(). - if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window) - window->DC.LastItemId = g.ActiveId; - - if (value_changed) - MarkItemEdited(window->DC.LastItemId); - - return value_changed; -} - -bool ImGui::ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags) -{ - float col4[4] = { col[0], col[1], col[2], 1.0f }; - if (!ColorPicker4(label, col4, flags | ImGuiColorEditFlags_NoAlpha)) - return false; - col[0] = col4[0]; col[1] = col4[1]; col[2] = col4[2]; - return true; -} - -// Helper for ColorPicker4() -static void RenderArrowsForVerticalBar(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, float bar_w, float alpha) -{ - ImU32 alpha8 = IM_F32_TO_INT8_SAT(alpha); - ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + half_sz.x + 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Right, IM_COL32(0,0,0,alpha8)); - ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + half_sz.x, pos.y), half_sz, ImGuiDir_Right, IM_COL32(255,255,255,alpha8)); - ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + bar_w - half_sz.x - 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Left, IM_COL32(0,0,0,alpha8)); - ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + bar_w - half_sz.x, pos.y), half_sz, ImGuiDir_Left, IM_COL32(255,255,255,alpha8)); -} - -// Note: ColorPicker4() only accesses 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. -// (In C++ the 'float col[4]' notation for a function argument is equivalent to 'float* col', we only specify a size to facilitate understanding of the code.) -// FIXME: we adjust the big color square height based on item width, which may cause a flickering feedback loop (if automatic height makes a vertical scrollbar appears, affecting automatic width..) -// FIXME: this is trying to be aware of style.Alpha but not fully correct. Also, the color wheel will have overlapping glitches with (style.Alpha < 1.0) -bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags, const float* ref_col) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImDrawList* draw_list = window->DrawList; - ImGuiStyle& style = g.Style; - ImGuiIO& io = g.IO; - - const float width = CalcItemWidth(); - g.NextItemData.ClearFlags(); - - PushID(label); - BeginGroup(); - - if (!(flags & ImGuiColorEditFlags_NoSidePreview)) - flags |= ImGuiColorEditFlags_NoSmallPreview; - - // Context menu: display and store options. - if (!(flags & ImGuiColorEditFlags_NoOptions)) - ColorPickerOptionsPopup(col, flags); - - // Read stored options - if (!(flags & ImGuiColorEditFlags__PickerMask)) - flags |= ((g.ColorEditOptions & ImGuiColorEditFlags__PickerMask) ? g.ColorEditOptions : ImGuiColorEditFlags__OptionsDefault) & ImGuiColorEditFlags__PickerMask; - if (!(flags & ImGuiColorEditFlags__InputMask)) - flags |= ((g.ColorEditOptions & ImGuiColorEditFlags__InputMask) ? g.ColorEditOptions : ImGuiColorEditFlags__OptionsDefault) & ImGuiColorEditFlags__InputMask; - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__PickerMask)); // Check that only 1 is selected - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__InputMask)); // Check that only 1 is selected - if (!(flags & ImGuiColorEditFlags_NoOptions)) - flags |= (g.ColorEditOptions & ImGuiColorEditFlags_AlphaBar); - - // Setup - int components = (flags & ImGuiColorEditFlags_NoAlpha) ? 3 : 4; - bool alpha_bar = (flags & ImGuiColorEditFlags_AlphaBar) && !(flags & ImGuiColorEditFlags_NoAlpha); - ImVec2 picker_pos = window->DC.CursorPos; - float square_sz = GetFrameHeight(); - float bars_width = square_sz; // Arbitrary smallish width of Hue/Alpha picking bars - float sv_picker_size = ImMax(bars_width * 1, width - (alpha_bar ? 2 : 1) * (bars_width + style.ItemInnerSpacing.x)); // Saturation/Value picking box - float bar0_pos_x = picker_pos.x + sv_picker_size + style.ItemInnerSpacing.x; - float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x; - float bars_triangles_half_sz = IM_FLOOR(bars_width * 0.20f); - - float backup_initial_col[4]; - memcpy(backup_initial_col, col, components * sizeof(float)); - - float wheel_thickness = sv_picker_size * 0.08f; - float wheel_r_outer = sv_picker_size * 0.50f; - float wheel_r_inner = wheel_r_outer - wheel_thickness; - ImVec2 wheel_center(picker_pos.x + (sv_picker_size + bars_width)*0.5f, picker_pos.y + sv_picker_size*0.5f); - - // Note: the triangle is displayed rotated with triangle_pa pointing to Hue, but most coordinates stays unrotated for logic. - float triangle_r = wheel_r_inner - (int)(sv_picker_size * 0.027f); - ImVec2 triangle_pa = ImVec2(triangle_r, 0.0f); // Hue point. - ImVec2 triangle_pb = ImVec2(triangle_r * -0.5f, triangle_r * -0.866025f); // Black point. - ImVec2 triangle_pc = ImVec2(triangle_r * -0.5f, triangle_r * +0.866025f); // White point. - - float H = col[0], S = col[1], V = col[2]; - float R = col[0], G = col[1], B = col[2]; - if (flags & ImGuiColorEditFlags_InputRGB) - { - // Hue is lost when converting from greyscale rgb (saturation=0). Restore it. - ColorConvertRGBtoHSV(R, G, B, H, S, V); - if (memcmp(g.ColorEditLastColor, col, sizeof(float) * 3) == 0) - { - if (S == 0) - H = g.ColorEditLastHue; - if (V == 0) - S = g.ColorEditLastSat; - } - } - else if (flags & ImGuiColorEditFlags_InputHSV) - { - ColorConvertHSVtoRGB(H, S, V, R, G, B); - } - - bool value_changed = false, value_changed_h = false, value_changed_sv = false; - - PushItemFlag(ImGuiItemFlags_NoNav, true); - if (flags & ImGuiColorEditFlags_PickerHueWheel) - { - // Hue wheel + SV triangle logic - InvisibleButton("hsv", ImVec2(sv_picker_size + style.ItemInnerSpacing.x + bars_width, sv_picker_size)); - if (IsItemActive()) - { - ImVec2 initial_off = g.IO.MouseClickedPos[0] - wheel_center; - ImVec2 current_off = g.IO.MousePos - wheel_center; - float initial_dist2 = ImLengthSqr(initial_off); - if (initial_dist2 >= (wheel_r_inner-1)*(wheel_r_inner-1) && initial_dist2 <= (wheel_r_outer+1)*(wheel_r_outer+1)) - { - // Interactive with Hue wheel - H = ImAtan2(current_off.y, current_off.x) / IM_PI*0.5f; - if (H < 0.0f) - H += 1.0f; - value_changed = value_changed_h = true; - } - float cos_hue_angle = ImCos(-H * 2.0f * IM_PI); - float sin_hue_angle = ImSin(-H * 2.0f * IM_PI); - if (ImTriangleContainsPoint(triangle_pa, triangle_pb, triangle_pc, ImRotate(initial_off, cos_hue_angle, sin_hue_angle))) - { - // Interacting with SV triangle - ImVec2 current_off_unrotated = ImRotate(current_off, cos_hue_angle, sin_hue_angle); - if (!ImTriangleContainsPoint(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated)) - current_off_unrotated = ImTriangleClosestPoint(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated); - float uu, vv, ww; - ImTriangleBarycentricCoords(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated, uu, vv, ww); - V = ImClamp(1.0f - vv, 0.0001f, 1.0f); - S = ImClamp(uu / V, 0.0001f, 1.0f); - value_changed = value_changed_sv = true; - } - } - if (!(flags & ImGuiColorEditFlags_NoOptions)) - OpenPopupOnItemClick("context"); - } - else if (flags & ImGuiColorEditFlags_PickerHueBar) - { - // SV rectangle logic - InvisibleButton("sv", ImVec2(sv_picker_size, sv_picker_size)); - if (IsItemActive()) - { - S = ImSaturate((io.MousePos.x - picker_pos.x) / (sv_picker_size-1)); - V = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); - value_changed = value_changed_sv = true; - } - if (!(flags & ImGuiColorEditFlags_NoOptions)) - OpenPopupOnItemClick("context"); - - // Hue bar logic - SetCursorScreenPos(ImVec2(bar0_pos_x, picker_pos.y)); - InvisibleButton("hue", ImVec2(bars_width, sv_picker_size)); - if (IsItemActive()) - { - H = ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); - value_changed = value_changed_h = true; - } - } - - // Alpha bar logic - if (alpha_bar) - { - SetCursorScreenPos(ImVec2(bar1_pos_x, picker_pos.y)); - InvisibleButton("alpha", ImVec2(bars_width, sv_picker_size)); - if (IsItemActive()) - { - col[3] = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); - value_changed = true; - } - } - PopItemFlag(); // ImGuiItemFlags_NoNav - - if (!(flags & ImGuiColorEditFlags_NoSidePreview)) - { - SameLine(0, style.ItemInnerSpacing.x); - BeginGroup(); - } - - if (!(flags & ImGuiColorEditFlags_NoLabel)) - { - const char* label_display_end = FindRenderedTextEnd(label); - if (label != label_display_end) - { - if ((flags & ImGuiColorEditFlags_NoSidePreview)) - SameLine(0, style.ItemInnerSpacing.x); - TextEx(label, label_display_end); - } - } - - if (!(flags & ImGuiColorEditFlags_NoSidePreview)) - { - PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true); - ImVec4 col_v4(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); - if ((flags & ImGuiColorEditFlags_NoLabel)) - Text("Current"); - - ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf | ImGuiColorEditFlags_NoTooltip; - ColorButton("##current", col_v4, (flags & sub_flags_to_forward), ImVec2(square_sz * 3, square_sz * 2)); - if (ref_col != NULL) - { - Text("Original"); - ImVec4 ref_col_v4(ref_col[0], ref_col[1], ref_col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : ref_col[3]); - if (ColorButton("##original", ref_col_v4, (flags & sub_flags_to_forward), ImVec2(square_sz * 3, square_sz * 2))) - { - memcpy(col, ref_col, components * sizeof(float)); - value_changed = true; - } - } - PopItemFlag(); - EndGroup(); - } - - // Convert back color to RGB - if (value_changed_h || value_changed_sv) - { - if (flags & ImGuiColorEditFlags_InputRGB) - { - ColorConvertHSVtoRGB(H >= 1.0f ? H - 10 * 1e-6f : H, S > 0.0f ? S : 10*1e-6f, V > 0.0f ? V : 1e-6f, col[0], col[1], col[2]); - g.ColorEditLastHue = H; - g.ColorEditLastSat = S; - memcpy(g.ColorEditLastColor, col, sizeof(float) * 3); - } - else if (flags & ImGuiColorEditFlags_InputHSV) - { - col[0] = H; - col[1] = S; - col[2] = V; - } - } - - // R,G,B and H,S,V slider color editor - bool value_changed_fix_hue_wrap = false; - if ((flags & ImGuiColorEditFlags_NoInputs) == 0) - { - PushItemWidth((alpha_bar ? bar1_pos_x : bar0_pos_x) + bars_width - picker_pos.x); - ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf; - ImGuiColorEditFlags sub_flags = (flags & sub_flags_to_forward) | ImGuiColorEditFlags_NoPicker; - if (flags & ImGuiColorEditFlags_DisplayRGB || (flags & ImGuiColorEditFlags__DisplayMask) == 0) - if (ColorEdit4("##rgb", col, sub_flags | ImGuiColorEditFlags_DisplayRGB)) - { - // FIXME: Hackily differenciating using the DragInt (ActiveId != 0 && !ActiveIdAllowOverlap) vs. using the InputText or DropTarget. - // For the later we don't want to run the hue-wrap canceling code. If you are well versed in HSV picker please provide your input! (See #2050) - value_changed_fix_hue_wrap = (g.ActiveId != 0 && !g.ActiveIdAllowOverlap); - value_changed = true; - } - if (flags & ImGuiColorEditFlags_DisplayHSV || (flags & ImGuiColorEditFlags__DisplayMask) == 0) - value_changed |= ColorEdit4("##hsv", col, sub_flags | ImGuiColorEditFlags_DisplayHSV); - if (flags & ImGuiColorEditFlags_DisplayHex || (flags & ImGuiColorEditFlags__DisplayMask) == 0) - value_changed |= ColorEdit4("##hex", col, sub_flags | ImGuiColorEditFlags_DisplayHex); - PopItemWidth(); - } - - // Try to cancel hue wrap (after ColorEdit4 call), if any - if (value_changed_fix_hue_wrap && (flags & ImGuiColorEditFlags_InputRGB)) - { - float new_H, new_S, new_V; - ColorConvertRGBtoHSV(col[0], col[1], col[2], new_H, new_S, new_V); - if (new_H <= 0 && H > 0) - { - if (new_V <= 0 && V != new_V) - ColorConvertHSVtoRGB(H, S, new_V <= 0 ? V * 0.5f : new_V, col[0], col[1], col[2]); - else if (new_S <= 0) - ColorConvertHSVtoRGB(H, new_S <= 0 ? S * 0.5f : new_S, new_V, col[0], col[1], col[2]); - } - } - - if (value_changed) - { - if (flags & ImGuiColorEditFlags_InputRGB) - { - R = col[0]; - G = col[1]; - B = col[2]; - ColorConvertRGBtoHSV(R, G, B, H, S, V); - if (memcmp(g.ColorEditLastColor, col, sizeof(float) * 3) == 0) // Fix local Hue as display below will use it immediately. - { - if (S == 0) - H = g.ColorEditLastHue; - if (V == 0) - S = g.ColorEditLastSat; - } - } - else if (flags & ImGuiColorEditFlags_InputHSV) - { - H = col[0]; - S = col[1]; - V = col[2]; - ColorConvertHSVtoRGB(H, S, V, R, G, B); - } - } - - const int style_alpha8 = IM_F32_TO_INT8_SAT(style.Alpha); - const ImU32 col_black = IM_COL32(0,0,0,style_alpha8); - const ImU32 col_white = IM_COL32(255,255,255,style_alpha8); - const ImU32 col_midgrey = IM_COL32(128,128,128,style_alpha8); - const ImU32 col_hues[6 + 1] = { IM_COL32(255,0,0,style_alpha8), IM_COL32(255,255,0,style_alpha8), IM_COL32(0,255,0,style_alpha8), IM_COL32(0,255,255,style_alpha8), IM_COL32(0,0,255,style_alpha8), IM_COL32(255,0,255,style_alpha8), IM_COL32(255,0,0,style_alpha8) }; - - ImVec4 hue_color_f(1, 1, 1, style.Alpha); ColorConvertHSVtoRGB(H, 1, 1, hue_color_f.x, hue_color_f.y, hue_color_f.z); - ImU32 hue_color32 = ColorConvertFloat4ToU32(hue_color_f); - ImU32 user_col32_striped_of_alpha = ColorConvertFloat4ToU32(ImVec4(R, G, B, style.Alpha)); // Important: this is still including the main rendering/style alpha!! - - ImVec2 sv_cursor_pos; - - if (flags & ImGuiColorEditFlags_PickerHueWheel) - { - // Render Hue Wheel - const float aeps = 0.5f / wheel_r_outer; // Half a pixel arc length in radians (2pi cancels out). - const int segment_per_arc = ImMax(4, (int)wheel_r_outer / 12); - for (int n = 0; n < 6; n++) - { - const float a0 = (n) /6.0f * 2.0f * IM_PI - aeps; - const float a1 = (n+1.0f)/6.0f * 2.0f * IM_PI + aeps; - const int vert_start_idx = draw_list->VtxBuffer.Size; - draw_list->PathArcTo(wheel_center, (wheel_r_inner + wheel_r_outer)*0.5f, a0, a1, segment_per_arc); - draw_list->PathStroke(col_white, false, wheel_thickness); - const int vert_end_idx = draw_list->VtxBuffer.Size; - - // Paint colors over existing vertices - ImVec2 gradient_p0(wheel_center.x + ImCos(a0) * wheel_r_inner, wheel_center.y + ImSin(a0) * wheel_r_inner); - ImVec2 gradient_p1(wheel_center.x + ImCos(a1) * wheel_r_inner, wheel_center.y + ImSin(a1) * wheel_r_inner); - ShadeVertsLinearColorGradientKeepAlpha(draw_list, vert_start_idx, vert_end_idx, gradient_p0, gradient_p1, col_hues[n], col_hues[n+1]); - } - - // Render Cursor + preview on Hue Wheel - float cos_hue_angle = ImCos(H * 2.0f * IM_PI); - float sin_hue_angle = ImSin(H * 2.0f * IM_PI); - ImVec2 hue_cursor_pos(wheel_center.x + cos_hue_angle * (wheel_r_inner+wheel_r_outer)*0.5f, wheel_center.y + sin_hue_angle * (wheel_r_inner+wheel_r_outer)*0.5f); - float hue_cursor_rad = value_changed_h ? wheel_thickness * 0.65f : wheel_thickness * 0.55f; - int hue_cursor_segments = ImClamp((int)(hue_cursor_rad / 1.4f), 9, 32); - draw_list->AddCircleFilled(hue_cursor_pos, hue_cursor_rad, hue_color32, hue_cursor_segments); - draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad+1, col_midgrey, hue_cursor_segments); - draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad, col_white, hue_cursor_segments); - - // Render SV triangle (rotated according to hue) - ImVec2 tra = wheel_center + ImRotate(triangle_pa, cos_hue_angle, sin_hue_angle); - ImVec2 trb = wheel_center + ImRotate(triangle_pb, cos_hue_angle, sin_hue_angle); - ImVec2 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle); - ImVec2 uv_white = GetFontTexUvWhitePixel(); - draw_list->PrimReserve(6, 6); - draw_list->PrimVtx(tra, uv_white, hue_color32); - draw_list->PrimVtx(trb, uv_white, hue_color32); - draw_list->PrimVtx(trc, uv_white, col_white); - draw_list->PrimVtx(tra, uv_white, 0); - draw_list->PrimVtx(trb, uv_white, col_black); - draw_list->PrimVtx(trc, uv_white, 0); - draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f); - sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V)); - } - else if (flags & ImGuiColorEditFlags_PickerHueBar) - { - // Render SV Square - draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), col_white, hue_color32, hue_color32, col_white); - draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), 0, 0, col_black, col_black); - RenderFrameBorder(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), 0.0f); - sv_cursor_pos.x = ImClamp(IM_ROUND(picker_pos.x + ImSaturate(S) * sv_picker_size), picker_pos.x + 2, picker_pos.x + sv_picker_size - 2); // Sneakily prevent the circle to stick out too much - sv_cursor_pos.y = ImClamp(IM_ROUND(picker_pos.y + ImSaturate(1 - V) * sv_picker_size), picker_pos.y + 2, picker_pos.y + sv_picker_size - 2); - - // Render Hue Bar - for (int i = 0; i < 6; ++i) - draw_list->AddRectFilledMultiColor(ImVec2(bar0_pos_x, picker_pos.y + i * (sv_picker_size / 6)), ImVec2(bar0_pos_x + bars_width, picker_pos.y + (i + 1) * (sv_picker_size / 6)), col_hues[i], col_hues[i], col_hues[i + 1], col_hues[i + 1]); - float bar0_line_y = IM_ROUND(picker_pos.y + H * sv_picker_size); - RenderFrameBorder(ImVec2(bar0_pos_x, picker_pos.y), ImVec2(bar0_pos_x + bars_width, picker_pos.y + sv_picker_size), 0.0f); - RenderArrowsForVerticalBar(draw_list, ImVec2(bar0_pos_x - 1, bar0_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f, style.Alpha); - } - - // Render cursor/preview circle (clamp S/V within 0..1 range because floating points colors may lead HSV values to be out of range) - float sv_cursor_rad = value_changed_sv ? 10.0f : 6.0f; - draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, 12); - draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad+1, col_midgrey, 12); - draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, col_white, 12); - - // Render alpha bar - if (alpha_bar) - { - float alpha = ImSaturate(col[3]); - ImRect bar1_bb(bar1_pos_x, picker_pos.y, bar1_pos_x + bars_width, picker_pos.y + sv_picker_size); - RenderColorRectWithAlphaCheckerboard(draw_list, bar1_bb.Min, bar1_bb.Max, 0, bar1_bb.GetWidth() / 2.0f, ImVec2(0.0f, 0.0f)); - draw_list->AddRectFilledMultiColor(bar1_bb.Min, bar1_bb.Max, user_col32_striped_of_alpha, user_col32_striped_of_alpha, user_col32_striped_of_alpha & ~IM_COL32_A_MASK, user_col32_striped_of_alpha & ~IM_COL32_A_MASK); - float bar1_line_y = IM_ROUND(picker_pos.y + (1.0f - alpha) * sv_picker_size); - RenderFrameBorder(bar1_bb.Min, bar1_bb.Max, 0.0f); - RenderArrowsForVerticalBar(draw_list, ImVec2(bar1_pos_x - 1, bar1_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f, style.Alpha); - } - - EndGroup(); - - if (value_changed && memcmp(backup_initial_col, col, components * sizeof(float)) == 0) - value_changed = false; - if (value_changed) - MarkItemEdited(window->DC.LastItemId); - - PopID(); - - return value_changed; -} - -// A little colored square. Return true when clicked. -// FIXME: May want to display/ignore the alpha component in the color display? Yet show it in the tooltip. -// 'desc_id' is not called 'label' because we don't display it next to the button, but only in the tooltip. -// Note that 'col' may be encoded in HSV if ImGuiColorEditFlags_InputHSV is set. -bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags, ImVec2 size) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiID id = window->GetID(desc_id); - float default_size = GetFrameHeight(); - if (size.x == 0.0f) - size.x = default_size; - if (size.y == 0.0f) - size.y = default_size; - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - ItemSize(bb, (size.y >= default_size) ? g.Style.FramePadding.y : 0.0f); - if (!ItemAdd(bb, id)) - return false; - - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held); - - if (flags & ImGuiColorEditFlags_NoAlpha) - flags &= ~(ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf); - - ImVec4 col_rgb = col; - if (flags & ImGuiColorEditFlags_InputHSV) - ColorConvertHSVtoRGB(col_rgb.x, col_rgb.y, col_rgb.z, col_rgb.x, col_rgb.y, col_rgb.z); - - ImVec4 col_rgb_without_alpha(col_rgb.x, col_rgb.y, col_rgb.z, 1.0f); - float grid_step = ImMin(size.x, size.y) / 2.99f; - float rounding = ImMin(g.Style.FrameRounding, grid_step * 0.5f); - ImRect bb_inner = bb; - float off = 0.0f; - if ((flags & ImGuiColorEditFlags_NoBorder) == 0) - { - off = -0.75f; // The border (using Col_FrameBg) tends to look off when color is near-opaque and rounding is enabled. This offset seemed like a good middle ground to reduce those artifacts. - bb_inner.Expand(off); - } - if ((flags & ImGuiColorEditFlags_AlphaPreviewHalf) && col_rgb.w < 1.0f) - { - float mid_x = IM_ROUND((bb_inner.Min.x + bb_inner.Max.x) * 0.5f); - RenderColorRectWithAlphaCheckerboard(window->DrawList, ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col_rgb), grid_step, ImVec2(-grid_step + off, off), rounding, ImDrawCornerFlags_TopRight| ImDrawCornerFlags_BotRight); - window->DrawList->AddRectFilled(bb_inner.Min, ImVec2(mid_x, bb_inner.Max.y), GetColorU32(col_rgb_without_alpha), rounding, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotLeft); - } - else - { - // Because GetColorU32() multiplies by the global style Alpha and we don't want to display a checkerboard if the source code had no alpha - ImVec4 col_source = (flags & ImGuiColorEditFlags_AlphaPreview) ? col_rgb : col_rgb_without_alpha; - if (col_source.w < 1.0f) - RenderColorRectWithAlphaCheckerboard(window->DrawList, bb_inner.Min, bb_inner.Max, GetColorU32(col_source), grid_step, ImVec2(off, off), rounding); - else - window->DrawList->AddRectFilled(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), rounding, ImDrawCornerFlags_All); - } - RenderNavHighlight(bb, id); - if ((flags & ImGuiColorEditFlags_NoBorder) == 0) - { - if (g.Style.FrameBorderSize > 0.0f) - RenderFrameBorder(bb.Min, bb.Max, rounding); - else - window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), rounding); // Color button are often in need of some sort of border - } - - // Drag and Drop Source - // NB: The ActiveId test is merely an optional micro-optimization, BeginDragDropSource() does the same test. - if (g.ActiveId == id && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropSource()) - { - if (flags & ImGuiColorEditFlags_NoAlpha) - SetDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F, &col_rgb, sizeof(float) * 3, ImGuiCond_Once); - else - SetDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, &col_rgb, sizeof(float) * 4, ImGuiCond_Once); - ColorButton(desc_id, col, flags); - SameLine(); - TextEx("Color"); - EndDragDropSource(); - } - - // Tooltip - if (!(flags & ImGuiColorEditFlags_NoTooltip) && hovered) - ColorTooltip(desc_id, &col.x, flags & (ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)); - - return pressed; -} - -// Initialize/override default color options -void ImGui::SetColorEditOptions(ImGuiColorEditFlags flags) -{ - ImGuiContext& g = *GImGui; - if ((flags & ImGuiColorEditFlags__DisplayMask) == 0) - flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__DisplayMask; - if ((flags & ImGuiColorEditFlags__DataTypeMask) == 0) - flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__DataTypeMask; - if ((flags & ImGuiColorEditFlags__PickerMask) == 0) - flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__PickerMask; - if ((flags & ImGuiColorEditFlags__InputMask) == 0) - flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__InputMask; - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__DisplayMask)); // Check only 1 option is selected - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__DataTypeMask)); // Check only 1 option is selected - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__PickerMask)); // Check only 1 option is selected - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__InputMask)); // Check only 1 option is selected - g.ColorEditOptions = flags; -} - -// Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. -void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags) -{ - ImGuiContext& g = *GImGui; - - BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip); - const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text; - if (text_end > text) - { - TextEx(text, text_end); - Separator(); - } - - ImVec2 sz(g.FontSize * 3 + g.Style.FramePadding.y * 2, g.FontSize * 3 + g.Style.FramePadding.y * 2); - ImVec4 cf(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); - int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]); - ColorButton("##preview", cf, (flags & (ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz); - SameLine(); - if ((flags & ImGuiColorEditFlags_InputRGB) || !(flags & ImGuiColorEditFlags__InputMask)) - { - if (flags & ImGuiColorEditFlags_NoAlpha) - Text("#%02X%02X%02X\nR: %d, G: %d, B: %d\n(%.3f, %.3f, %.3f)", cr, cg, cb, cr, cg, cb, col[0], col[1], col[2]); - else - Text("#%02X%02X%02X%02X\nR:%d, G:%d, B:%d, A:%d\n(%.3f, %.3f, %.3f, %.3f)", cr, cg, cb, ca, cr, cg, cb, ca, col[0], col[1], col[2], col[3]); - } - else if (flags & ImGuiColorEditFlags_InputHSV) - { - if (flags & ImGuiColorEditFlags_NoAlpha) - Text("H: %.3f, S: %.3f, V: %.3f", col[0], col[1], col[2]); - else - Text("H: %.3f, S: %.3f, V: %.3f, A: %.3f", col[0], col[1], col[2], col[3]); - } - EndTooltip(); -} - -void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags) -{ - bool allow_opt_inputs = !(flags & ImGuiColorEditFlags__DisplayMask); - bool allow_opt_datatype = !(flags & ImGuiColorEditFlags__DataTypeMask); - if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context")) - return; - ImGuiContext& g = *GImGui; - ImGuiColorEditFlags opts = g.ColorEditOptions; - if (allow_opt_inputs) - { - if (RadioButton("RGB", (opts & ImGuiColorEditFlags_DisplayRGB) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayRGB; - if (RadioButton("HSV", (opts & ImGuiColorEditFlags_DisplayHSV) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayHSV; - if (RadioButton("Hex", (opts & ImGuiColorEditFlags_DisplayHex) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayHex; - } - if (allow_opt_datatype) - { - if (allow_opt_inputs) Separator(); - if (RadioButton("0..255", (opts & ImGuiColorEditFlags_Uint8) != 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Uint8; - if (RadioButton("0.00..1.00", (opts & ImGuiColorEditFlags_Float) != 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Float; - } - - if (allow_opt_inputs || allow_opt_datatype) - Separator(); - if (Button("Copy as..", ImVec2(-1,0))) - OpenPopup("Copy"); - if (BeginPopup("Copy")) - { - int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]); - char buf[64]; - ImFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff, %.3ff)", col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); - if (Selectable(buf)) - SetClipboardText(buf); - ImFormatString(buf, IM_ARRAYSIZE(buf), "(%d,%d,%d,%d)", cr, cg, cb, ca); - if (Selectable(buf)) - SetClipboardText(buf); - ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", cr, cg, cb); - if (Selectable(buf)) - SetClipboardText(buf); - if (!(flags & ImGuiColorEditFlags_NoAlpha)) - { - ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", cr, cg, cb, ca); - if (Selectable(buf)) - SetClipboardText(buf); - } - EndPopup(); - } - - g.ColorEditOptions = opts; - EndPopup(); -} - -void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags) -{ - bool allow_opt_picker = !(flags & ImGuiColorEditFlags__PickerMask); - bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar); - if ((!allow_opt_picker && !allow_opt_alpha_bar) || !BeginPopup("context")) - return; - ImGuiContext& g = *GImGui; - if (allow_opt_picker) - { - ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function - PushItemWidth(picker_size.x); - for (int picker_type = 0; picker_type < 2; picker_type++) - { - // Draw small/thumbnail version of each picker type (over an invisible button for selection) - if (picker_type > 0) Separator(); - PushID(picker_type); - ImGuiColorEditFlags picker_flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoOptions|ImGuiColorEditFlags_NoLabel|ImGuiColorEditFlags_NoSidePreview|(flags & ImGuiColorEditFlags_NoAlpha); - if (picker_type == 0) picker_flags |= ImGuiColorEditFlags_PickerHueBar; - if (picker_type == 1) picker_flags |= ImGuiColorEditFlags_PickerHueWheel; - ImVec2 backup_pos = GetCursorScreenPos(); - if (Selectable("##selectable", false, 0, picker_size)) // By default, Selectable() is closing popup - g.ColorEditOptions = (g.ColorEditOptions & ~ImGuiColorEditFlags__PickerMask) | (picker_flags & ImGuiColorEditFlags__PickerMask); - SetCursorScreenPos(backup_pos); - ImVec4 dummy_ref_col; - memcpy(&dummy_ref_col, ref_col, sizeof(float) * ((picker_flags & ImGuiColorEditFlags_NoAlpha) ? 3 : 4)); - ColorPicker4("##dummypicker", &dummy_ref_col.x, picker_flags); - PopID(); - } - PopItemWidth(); - } - if (allow_opt_alpha_bar) - { - if (allow_opt_picker) Separator(); - CheckboxFlags("Alpha Bar", (unsigned int*)&g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar); - } - EndPopup(); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: TreeNode, CollapsingHeader, etc. -//------------------------------------------------------------------------- -// - TreeNode() -// - TreeNodeV() -// - TreeNodeEx() -// - TreeNodeExV() -// - TreeNodeBehavior() [Internal] -// - TreePush() -// - TreePop() -// - GetTreeNodeToLabelSpacing() -// - SetNextItemOpen() -// - CollapsingHeader() -//------------------------------------------------------------------------- - -bool ImGui::TreeNode(const char* str_id, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - bool is_open = TreeNodeExV(str_id, 0, fmt, args); - va_end(args); - return is_open; -} - -bool ImGui::TreeNode(const void* ptr_id, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - bool is_open = TreeNodeExV(ptr_id, 0, fmt, args); - va_end(args); - return is_open; -} - -bool ImGui::TreeNode(const char* label) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - return TreeNodeBehavior(window->GetID(label), 0, label, NULL); -} - -bool ImGui::TreeNodeV(const char* str_id, const char* fmt, va_list args) -{ - return TreeNodeExV(str_id, 0, fmt, args); -} - -bool ImGui::TreeNodeV(const void* ptr_id, const char* fmt, va_list args) -{ - return TreeNodeExV(ptr_id, 0, fmt, args); -} - -bool ImGui::TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - return TreeNodeBehavior(window->GetID(label), flags, label, NULL); -} - -bool ImGui::TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - bool is_open = TreeNodeExV(str_id, flags, fmt, args); - va_end(args); - return is_open; -} - -bool ImGui::TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - bool is_open = TreeNodeExV(ptr_id, flags, fmt, args); - va_end(args); - return is_open; -} - -bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); - return TreeNodeBehavior(window->GetID(str_id), flags, g.TempBuffer, label_end); -} - -bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); - return TreeNodeBehavior(window->GetID(ptr_id), flags, g.TempBuffer, label_end); -} - -bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags) -{ - if (flags & ImGuiTreeNodeFlags_Leaf) - return true; - - // We only write to the tree storage if the user clicks (or explicitly use the SetNextItemOpen function) - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImGuiStorage* storage = window->DC.StateStorage; - - bool is_open; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasOpen) - { - if (g.NextItemData.OpenCond & ImGuiCond_Always) - { - is_open = g.NextItemData.OpenVal; - storage->SetInt(id, is_open); - } - else - { - // We treat ImGuiCond_Once and ImGuiCond_FirstUseEver the same because tree node state are not saved persistently. - const int stored_value = storage->GetInt(id, -1); - if (stored_value == -1) - { - is_open = g.NextItemData.OpenVal; - storage->SetInt(id, is_open); - } - else - { - is_open = stored_value != 0; - } - } - } - else - { - is_open = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0; - } - - // When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior). - // NB- If we are above max depth we still allow manually opened nodes to be logged. - if (g.LogEnabled && !(flags & ImGuiTreeNodeFlags_NoAutoOpenOnLog) && (window->DC.TreeDepth - g.LogDepthRef) < g.LogDepthToExpand) - is_open = true; - - return is_open; -} - -bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const bool display_frame = (flags & ImGuiTreeNodeFlags_Framed) != 0; - const ImVec2 padding = (display_frame || (flags & ImGuiTreeNodeFlags_FramePadding)) ? style.FramePadding : ImVec2(style.FramePadding.x, ImMin(window->DC.CurrLineTextBaseOffset, style.FramePadding.y)); - - if (!label_end) - label_end = FindRenderedTextEnd(label); - const ImVec2 label_size = CalcTextSize(label, label_end, false); - - // We vertically grow up to current line height up the typical widget height. - const float frame_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + style.FramePadding.y*2), label_size.y + padding.y*2); - ImRect frame_bb; - frame_bb.Min.x = (flags & ImGuiTreeNodeFlags_SpanFullWidth) ? window->WorkRect.Min.x : window->DC.CursorPos.x; - frame_bb.Min.y = window->DC.CursorPos.y; - frame_bb.Max.x = window->WorkRect.Max.x; - frame_bb.Max.y = window->DC.CursorPos.y + frame_height; - if (display_frame) - { - // Framed header expand a little outside the default padding, to the edge of InnerClipRect - // (FIXME: May remove this at some point and make InnerClipRect align with WindowPadding.x instead of WindowPadding.x*0.5f) - frame_bb.Min.x -= IM_FLOOR(window->WindowPadding.x * 0.5f - 1.0f); - frame_bb.Max.x += IM_FLOOR(window->WindowPadding.x * 0.5f); - } - - const float text_offset_x = g.FontSize + (display_frame ? padding.x*3 : padding.x*2); // Collapser arrow width + Spacing - const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it - const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x*2 : 0.0f); // Include collapser - ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y); - ItemSize(ImVec2(text_width, frame_height), padding.y); - - // For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing - ImRect interact_bb = frame_bb; - if (!display_frame && (flags & (ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth)) == 0) - interact_bb.Max.x = frame_bb.Min.x + text_width + style.ItemSpacing.x * 2.0f; - - // Store a flag for the current depth to tell if we will allow closing this node when navigating one of its child. - // For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop(). - // This is currently only support 32 level deep and we are fine with (1 << Depth) overflowing into a zero. - const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0; - bool is_open = TreeNodeBehaviorIsOpen(id, flags); - if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) - window->DC.TreeJumpToParentOnPopMask |= (1 << window->DC.TreeDepth); - - bool item_add = ItemAdd(interact_bb, id); - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDisplayRect; - window->DC.LastItemDisplayRect = frame_bb; - - if (!item_add) - { - if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) - TreePushOverrideID(id); - IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); - return is_open; - } - - ImGuiButtonFlags button_flags = ImGuiTreeNodeFlags_None; - if (flags & ImGuiTreeNodeFlags_AllowItemOverlap) - button_flags |= ImGuiButtonFlags_AllowItemOverlap; - if (!is_leaf) - button_flags |= ImGuiButtonFlags_PressedOnDragDropHold; - - // We allow clicking on the arrow section with keyboard modifiers held, in order to easily - // allow browsing a tree while preserving selection with code implementing multi-selection patterns. - // When clicking on the rest of the tree node we always disallow keyboard modifiers. - const float arrow_hit_x1 = (text_pos.x - text_offset_x) - style.TouchExtraPadding.x; - const float arrow_hit_x2 = (text_pos.x - text_offset_x) + (g.FontSize + padding.x * 2.0f) + style.TouchExtraPadding.x; - const bool is_mouse_x_over_arrow = (g.IO.MousePos.x >= arrow_hit_x1 && g.IO.MousePos.x < arrow_hit_x2); - if (window != g.HoveredWindow || !is_mouse_x_over_arrow) - button_flags |= ImGuiButtonFlags_NoKeyModifiers; - - // Open behaviors can be altered with the _OpenOnArrow and _OnOnDoubleClick flags. - // Some alteration have subtle effects (e.g. toggle on MouseUp vs MouseDown events) due to requirements for multi-selection and drag and drop support. - // - Single-click on label = Toggle on MouseUp (default) - // - Single-click on arrow = Toggle on MouseUp (when _OpenOnArrow=0) - // - Single-click on arrow = Toggle on MouseDown (when _OpenOnArrow=1) - // - Double-click on label = Toggle on MouseDoubleClick (when _OpenOnDoubleClick=1) - // - Double-click on arrow = Toggle on MouseDoubleClick (when _OpenOnDoubleClick=1 and _OpenOnArrow=0) - // This makes _OpenOnArrow have a subtle effect on _OpenOnDoubleClick: arrow click reacts on Down rather than Up. - // It is rather standard that arrow click react on Down rather than Up and we'd be tempted to make it the default - // (by removing the _OpenOnArrow test below), however this would have a perhaps surprising effect on CollapsingHeader()? - // So right now we are making this optional. May evolve later. - if (is_mouse_x_over_arrow && (flags & ImGuiTreeNodeFlags_OpenOnArrow)) - button_flags |= ImGuiButtonFlags_PressedOnClick; - else if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) - button_flags |= ImGuiButtonFlags_PressedOnDoubleClick; - else - button_flags |= ImGuiButtonFlags_PressedOnClickRelease; - - bool selected = (flags & ImGuiTreeNodeFlags_Selected) != 0; - const bool was_selected = selected; - - bool hovered, held; - bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, button_flags); - bool toggled = false; - if (!is_leaf) - { - if (pressed) - { - if ((flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) == 0 || (g.NavActivateId == id)) - toggled = true; - if (flags & ImGuiTreeNodeFlags_OpenOnArrow) - toggled |= is_mouse_x_over_arrow && !g.NavDisableMouseHover; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job - if ((flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) && g.IO.MouseDoubleClicked[0]) - toggled = true; - if (g.DragDropActive && is_open) // When using Drag and Drop "hold to open" we keep the node highlighted after opening, but never close it again. - toggled = false; - } - - if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Left && is_open) - { - toggled = true; - NavMoveRequestCancel(); - } - if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Right && !is_open) // If there's something upcoming on the line we may want to give it the priority? - { - toggled = true; - NavMoveRequestCancel(); - } - - if (toggled) - { - is_open = !is_open; - window->DC.StateStorage->SetInt(id, is_open); - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ToggledOpen; - } - } - if (flags & ImGuiTreeNodeFlags_AllowItemOverlap) - SetItemAllowOverlap(); - - // In this branch, TreeNodeBehavior() cannot toggle the selection so this will never trigger. - if (selected != was_selected) //-V547 - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ToggledSelection; - - // Render - const ImU32 text_col = GetColorU32(ImGuiCol_Text); - ImGuiNavHighlightFlags nav_highlight_flags = ImGuiNavHighlightFlags_TypeThin; - if (display_frame) - { - // Framed type - const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding); - RenderNavHighlight(frame_bb, id, nav_highlight_flags); - if (flags & ImGuiTreeNodeFlags_Bullet) - RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col); - else if (!is_leaf) - RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 1.0f); - else // Leaf without bullet, left-adjusted text - text_pos.x -= text_offset_x; - if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton) - frame_bb.Max.x -= g.FontSize + style.FramePadding.x; - if (g.LogEnabled) - { - // NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here. - const char log_prefix[] = "\n##"; - const char log_suffix[] = "##"; - LogRenderedText(&text_pos, log_prefix, log_prefix+3); - RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); - LogRenderedText(&text_pos, log_suffix, log_suffix+2); - } - else - { - RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); - } - } - else - { - // Unframed typed for tree nodes - if (hovered || selected) - { - const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false); - RenderNavHighlight(frame_bb, id, nav_highlight_flags); - } - if (flags & ImGuiTreeNodeFlags_Bullet) - RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col); - else if (!is_leaf) - RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f); - if (g.LogEnabled) - LogRenderedText(&text_pos, ">"); - RenderText(text_pos, label, label_end, false); - } - - if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) - TreePushOverrideID(id); - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); - return is_open; -} - -void ImGui::TreePush(const char* str_id) -{ - ImGuiWindow* window = GetCurrentWindow(); - Indent(); - window->DC.TreeDepth++; - PushID(str_id ? str_id : "#TreePush"); -} - -void ImGui::TreePush(const void* ptr_id) -{ - ImGuiWindow* window = GetCurrentWindow(); - Indent(); - window->DC.TreeDepth++; - PushID(ptr_id ? ptr_id : (const void*)"#TreePush"); -} - -void ImGui::TreePushOverrideID(ImGuiID id) -{ - ImGuiWindow* window = GetCurrentWindow(); - Indent(); - window->DC.TreeDepth++; - window->IDStack.push_back(id); -} - -void ImGui::TreePop() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - Unindent(); - - window->DC.TreeDepth--; - ImU32 tree_depth_mask = (1 << window->DC.TreeDepth); - - // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled) - if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) - if (g.NavIdIsAlive && (window->DC.TreeJumpToParentOnPopMask & tree_depth_mask)) - { - SetNavID(window->IDStack.back(), g.NavLayer, 0); - NavMoveRequestCancel(); - } - window->DC.TreeJumpToParentOnPopMask &= tree_depth_mask - 1; - - IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much. - PopID(); -} - -// Horizontal distance preceding label when using TreeNode() or Bullet() -float ImGui::GetTreeNodeToLabelSpacing() -{ - ImGuiContext& g = *GImGui; - return g.FontSize + (g.Style.FramePadding.x * 2.0f); -} - -// Set next TreeNode/CollapsingHeader open state. -void ImGui::SetNextItemOpen(bool is_open, ImGuiCond cond) -{ - ImGuiContext& g = *GImGui; - if (g.CurrentWindow->SkipItems) - return; - g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasOpen; - g.NextItemData.OpenVal = is_open; - g.NextItemData.OpenCond = cond ? cond : ImGuiCond_Always; -} - -// CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag). -// This is basically the same as calling TreeNodeEx(label, ImGuiTreeNodeFlags_CollapsingHeader). You can remove the _NoTreePushOnOpen flag if you want behavior closer to normal TreeNode(). -bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader, label); -} - -bool ImGui::CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - if (p_open && !*p_open) - return false; - - ImGuiID id = window->GetID(label); - flags |= ImGuiTreeNodeFlags_CollapsingHeader; - if (p_open) - flags |= ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton; - bool is_open = TreeNodeBehavior(id, flags, label); - if (p_open) - { - // Create a small overlapping close button - // FIXME: We can evolve this into user accessible helpers to add extra buttons on title bars, headers, etc. - // FIXME: CloseButton can overlap into text, need find a way to clip the text somehow. - ImGuiContext& g = *GImGui; - ImGuiItemHoveredDataBackup last_item_backup; - float button_size = g.FontSize; - float button_x = ImMax(window->DC.LastItemRect.Min.x, window->DC.LastItemRect.Max.x - g.Style.FramePadding.x * 2.0f - button_size); - float button_y = window->DC.LastItemRect.Min.y; - if (CloseButton(window->GetID((void*)((intptr_t)id + 1)), ImVec2(button_x, button_y))) - *p_open = false; - last_item_backup.Restore(); - } - - return is_open; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Selectable -//------------------------------------------------------------------------- -// - Selectable() -//------------------------------------------------------------------------- - -// Tip: pass a non-visible label (e.g. "##dummy") then you can use the space to draw other text or image. -// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID or use ##unique_id. -// With this scheme, ImGuiSelectableFlags_SpanAllColumns and ImGuiSelectableFlags_AllowItemOverlap are also frequently used flags. -// FIXME: Selectable() with (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported. -bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - - if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns) // FIXME-OPT: Avoid if vertically clipped. - PushColumnsBackground(); - - // Submit label or explicit size to ItemSize(), whereas ItemAdd() will submit a larger/spanning rectangle. - ImGuiID id = window->GetID(label); - ImVec2 label_size = CalcTextSize(label, NULL, true); - ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y); - ImVec2 pos = window->DC.CursorPos; - pos.y += window->DC.CurrLineTextBaseOffset; - ItemSize(size, 0.0f); - - // Fill horizontal space - const float min_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? window->ContentRegionRect.Min.x : pos.x; - const float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? window->ContentRegionRect.Max.x : GetContentRegionMaxAbs().x; - if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_SpanAvailWidth)) - size.x = ImMax(label_size.x, max_x - min_x); - - // Text stays at the submission position, but bounding box may be extended on both sides - const ImVec2 text_min = pos; - const ImVec2 text_max(min_x + size.x, pos.y + size.y); - - // Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable. - ImRect bb_enlarged(min_x, pos.y, text_max.x, text_max.y); - const float spacing_x = style.ItemSpacing.x; - const float spacing_y = style.ItemSpacing.y; - const float spacing_L = IM_FLOOR(spacing_x * 0.50f); - const float spacing_U = IM_FLOOR(spacing_y * 0.50f); - bb_enlarged.Min.x -= spacing_L; - bb_enlarged.Min.y -= spacing_U; - bb_enlarged.Max.x += (spacing_x - spacing_L); - bb_enlarged.Max.y += (spacing_y - spacing_U); - //if (g.IO.KeyCtrl) { GetForegroundDrawList()->AddRect(bb_align.Min, bb_align.Max, IM_COL32(255, 0, 0, 255)); } - //if (g.IO.KeyCtrl) { GetForegroundDrawList()->AddRect(bb_enlarged.Min, bb_enlarged.Max, IM_COL32(0, 255, 0, 255)); } - - bool item_add; - if (flags & ImGuiSelectableFlags_Disabled) - { - ImGuiItemFlags backup_item_flags = window->DC.ItemFlags; - window->DC.ItemFlags |= ImGuiItemFlags_Disabled | ImGuiItemFlags_NoNavDefaultFocus; - item_add = ItemAdd(bb_enlarged, id); - window->DC.ItemFlags = backup_item_flags; - } - else - { - item_add = ItemAdd(bb_enlarged, id); - } - if (!item_add) - { - if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns) - PopColumnsBackground(); - return false; - } - - // We use NoHoldingActiveID on menus so user can click and _hold_ on a menu then drag to browse child entries - ImGuiButtonFlags button_flags = 0; - if (flags & ImGuiSelectableFlags_NoHoldingActiveID) { button_flags |= ImGuiButtonFlags_NoHoldingActiveId; } - if (flags & ImGuiSelectableFlags_SelectOnClick) { button_flags |= ImGuiButtonFlags_PressedOnClick; } - if (flags & ImGuiSelectableFlags_SelectOnRelease) { button_flags |= ImGuiButtonFlags_PressedOnRelease; } - if (flags & ImGuiSelectableFlags_Disabled) { button_flags |= ImGuiButtonFlags_Disabled; } - if (flags & ImGuiSelectableFlags_AllowDoubleClick) { button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; } - if (flags & ImGuiSelectableFlags_AllowItemOverlap) { button_flags |= ImGuiButtonFlags_AllowItemOverlap; } - - if (flags & ImGuiSelectableFlags_Disabled) - selected = false; - - const bool was_selected = selected; - bool hovered, held; - bool pressed = ButtonBehavior(bb_enlarged, id, &hovered, &held, button_flags); - - // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard - if (pressed || (hovered && (flags & ImGuiSelectableFlags_SetNavIdOnHover))) - { - if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent) - { - g.NavDisableHighlight = true; - SetNavID(id, window->DC.NavLayerCurrent, window->DC.NavFocusScopeIdCurrent); - } - } - if (pressed) - MarkItemEdited(id); - - if (flags & ImGuiSelectableFlags_AllowItemOverlap) - SetItemAllowOverlap(); - - // In this branch, Selectable() cannot toggle the selection so this will never trigger. - if (selected != was_selected) //-V547 - window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ToggledSelection; - - // Render - if (held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld)) - hovered = true; - if (hovered || selected) - { - const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(bb_enlarged.Min, bb_enlarged.Max, col, false, 0.0f); - RenderNavHighlight(bb_enlarged, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding); - } - - if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns) - PopColumnsBackground(); - - if (flags & ImGuiSelectableFlags_Disabled) PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); - RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb_enlarged); - if (flags & ImGuiSelectableFlags_Disabled) PopStyleColor(); - - // Automatically close popups - if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup)) - CloseCurrentPopup(); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); - return pressed; -} - -bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags, const ImVec2& size_arg) -{ - if (Selectable(label, *p_selected, flags, size_arg)) - { - *p_selected = !*p_selected; - return true; - } - return false; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: ListBox -//------------------------------------------------------------------------- -// - ListBox() -// - ListBoxHeader() -// - ListBoxFooter() -//------------------------------------------------------------------------- -// FIXME: This is an old API. We should redesign some of it, rename ListBoxHeader->BeginListBox, ListBoxFooter->EndListBox -// and promote using them over existing ListBox() functions, similarly to change with combo boxes. -//------------------------------------------------------------------------- - -// FIXME: In principle this function should be called BeginListBox(). We should rename it after re-evaluating if we want to keep the same signature. -// Helper to calculate the size of a listbox and display a label on the right. -// Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an non-visible label e.g. "##empty" -bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - const ImGuiStyle& style = g.Style; - const ImGuiID id = GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); - - // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar. - ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y); - ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y)); - ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); - ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - window->DC.LastItemRect = bb; // Forward storage for ListBoxFooter.. dodgy. - g.NextItemData.ClearFlags(); - - if (!IsRectVisible(bb.Min, bb.Max)) - { - ItemSize(bb.GetSize(), style.FramePadding.y); - ItemAdd(bb, 0, &frame_bb); - return false; - } - - BeginGroup(); - if (label_size.x > 0) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - - BeginChildFrame(id, frame_bb.GetSize()); - return true; -} - -// FIXME: In principle this function should be called EndListBox(). We should rename it after re-evaluating if we want to keep the same signature. -bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items) -{ - // Size default to hold ~7.25 items. - // We add +25% worth of item height to allow the user to see at a glance if there are more items up/down, without looking at the scrollbar. - // We don't add this extra bit if items_count <= height_in_items. It is slightly dodgy, because it means a dynamic list of items will make the widget resize occasionally when it crosses that size. - // I am expecting that someone will come and complain about this behavior in a remote future, then we can advise on a better solution. - if (height_in_items < 0) - height_in_items = ImMin(items_count, 7); - const ImGuiStyle& style = GetStyle(); - float height_in_items_f = (height_in_items < items_count) ? (height_in_items + 0.25f) : (height_in_items + 0.00f); - - // We include ItemSpacing.y so that a list sized for the exact number of items doesn't make a scrollbar appears. We could also enforce that by passing a flag to BeginChild(). - ImVec2 size; - size.x = 0.0f; - size.y = ImFloor(GetTextLineHeightWithSpacing() * height_in_items_f + style.FramePadding.y * 2.0f); - return ListBoxHeader(label, size); -} - -// FIXME: In principle this function should be called EndListBox(). We should rename it after re-evaluating if we want to keep the same signature. -void ImGui::ListBoxFooter() -{ - ImGuiWindow* parent_window = GetCurrentWindow()->ParentWindow; - const ImRect bb = parent_window->DC.LastItemRect; - const ImGuiStyle& style = GetStyle(); - - EndChildFrame(); - - // Redeclare item size so that it includes the label (we have stored the full size in LastItemRect) - // We call SameLine() to restore DC.CurrentLine* data - SameLine(); - parent_window->DC.CursorPos = bb.Min; - ItemSize(bb, style.FramePadding.y); - EndGroup(); -} - -bool ImGui::ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_items) -{ - const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items); - return value_changed; -} - -bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items) -{ - if (!ListBoxHeader(label, items_count, height_in_items)) - return false; - - // Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper. - ImGuiContext& g = *GImGui; - bool value_changed = false; - ImGuiListClipper clipper(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to. - while (clipper.Step()) - for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) - { - const bool item_selected = (i == *current_item); - const char* item_text; - if (!items_getter(data, i, &item_text)) - item_text = "*Unknown item*"; - - PushID(i); - if (Selectable(item_text, item_selected)) - { - *current_item = i; - value_changed = true; - } - if (item_selected) - SetItemDefaultFocus(); - PopID(); - } - ListBoxFooter(); - if (value_changed) - MarkItemEdited(g.CurrentWindow->DC.LastItemId); - - return value_changed; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: PlotLines, PlotHistogram -//------------------------------------------------------------------------- -// - PlotEx() [Internal] -// - PlotLines() -// - PlotHistogram() -//------------------------------------------------------------------------- - -int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return -1; - - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - - const ImVec2 label_size = CalcTextSize(label, NULL, true); - if (frame_size.x == 0.0f) - frame_size.x = CalcItemWidth(); - if (frame_size.y == 0.0f) - frame_size.y = label_size.y + (style.FramePadding.y * 2); - - const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); - const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); - const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0)); - ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, 0, &frame_bb)) - return -1; - const bool hovered = ItemHoverable(frame_bb, id); - - // Determine scale from values if not specified - if (scale_min == FLT_MAX || scale_max == FLT_MAX) - { - float v_min = FLT_MAX; - float v_max = -FLT_MAX; - for (int i = 0; i < values_count; i++) - { - const float v = values_getter(data, i); - if (v != v) // Ignore NaN values - continue; - v_min = ImMin(v_min, v); - v_max = ImMax(v_max, v); - } - if (scale_min == FLT_MAX) - scale_min = v_min; - if (scale_max == FLT_MAX) - scale_max = v_max; - } - - RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); - - const int values_count_min = (plot_type == ImGuiPlotType_Lines) ? 2 : 1; - int idx_hovered = -1; - if (values_count >= values_count_min) - { - int res_w = ImMin((int)frame_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0); - int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0); - - // Tooltip on hover - if (hovered && inner_bb.Contains(g.IO.MousePos)) - { - const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f); - const int v_idx = (int)(t * item_count); - IM_ASSERT(v_idx >= 0 && v_idx < values_count); - - const float v0 = values_getter(data, (v_idx + values_offset) % values_count); - const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count); - if (plot_type == ImGuiPlotType_Lines) - SetTooltip("%d: %8.4g\n%d: %8.4g", v_idx, v0, v_idx+1, v1); - else if (plot_type == ImGuiPlotType_Histogram) - SetTooltip("%d: %8.4g", v_idx, v0); - idx_hovered = v_idx; - } - - const float t_step = 1.0f / (float)res_w; - const float inv_scale = (scale_min == scale_max) ? 0.0f : (1.0f / (scale_max - scale_min)); - - float v0 = values_getter(data, (0 + values_offset) % values_count); - float t0 = 0.0f; - ImVec2 tp0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) * inv_scale) ); // Point in the normalized space of our target rectangle - float histogram_zero_line_t = (scale_min * scale_max < 0.0f) ? (-scale_min * inv_scale) : (scale_min < 0.0f ? 0.0f : 1.0f); // Where does the zero line stands - - const ImU32 col_base = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram); - const ImU32 col_hovered = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered); - - for (int n = 0; n < res_w; n++) - { - const float t1 = t0 + t_step; - const int v1_idx = (int)(t0 * item_count + 0.5f); - IM_ASSERT(v1_idx >= 0 && v1_idx < values_count); - const float v1 = values_getter(data, (v1_idx + values_offset + 1) % values_count); - const ImVec2 tp1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) * inv_scale) ); - - // NB: Draw calls are merged together by the DrawList system. Still, we should render our batch are lower level to save a bit of CPU. - ImVec2 pos0 = ImLerp(inner_bb.Min, inner_bb.Max, tp0); - ImVec2 pos1 = ImLerp(inner_bb.Min, inner_bb.Max, (plot_type == ImGuiPlotType_Lines) ? tp1 : ImVec2(tp1.x, histogram_zero_line_t)); - if (plot_type == ImGuiPlotType_Lines) - { - window->DrawList->AddLine(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base); - } - else if (plot_type == ImGuiPlotType_Histogram) - { - if (pos1.x >= pos0.x + 2.0f) - pos1.x -= 1.0f; - window->DrawList->AddRectFilled(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base); - } - - t0 = t1; - tp0 = tp1; - } - } - - // Text overlay - if (overlay_text) - RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImVec2(0.5f,0.0f)); - - if (label_size.x > 0.0f) - RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label); - - // Return hovered index or -1 if none are hovered. - // This is currently not exposed in the public API because we need a larger redesign of the whole thing, but in the short-term we are making it available in PlotEx(). - return idx_hovered; -} - -struct ImGuiPlotArrayGetterData -{ - const float* Values; - int Stride; - - ImGuiPlotArrayGetterData(const float* values, int stride) { Values = values; Stride = stride; } -}; - -static float Plot_ArrayGetter(void* data, int idx) -{ - ImGuiPlotArrayGetterData* plot_data = (ImGuiPlotArrayGetterData*)data; - const float v = *(const float*)(const void*)((const unsigned char*)plot_data->Values + (size_t)idx * plot_data->Stride); - return v; -} - -void ImGui::PlotLines(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride) -{ - ImGuiPlotArrayGetterData data(values, stride); - PlotEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); -} - -void ImGui::PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) -{ - PlotEx(ImGuiPlotType_Lines, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); -} - -void ImGui::PlotHistogram(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride) -{ - ImGuiPlotArrayGetterData data(values, stride); - PlotEx(ImGuiPlotType_Histogram, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); -} - -void ImGui::PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) -{ - PlotEx(ImGuiPlotType_Histogram, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Value helpers -// Those is not very useful, legacy API. -//------------------------------------------------------------------------- -// - Value() -//------------------------------------------------------------------------- - -void ImGui::Value(const char* prefix, bool b) -{ - Text("%s: %s", prefix, (b ? "true" : "false")); -} - -void ImGui::Value(const char* prefix, int v) -{ - Text("%s: %d", prefix, v); -} - -void ImGui::Value(const char* prefix, unsigned int v) -{ - Text("%s: %d", prefix, v); -} - -void ImGui::Value(const char* prefix, float v, const char* float_format) -{ - if (float_format) - { - char fmt[64]; - ImFormatString(fmt, IM_ARRAYSIZE(fmt), "%%s: %s", float_format); - Text(fmt, prefix, v); - } - else - { - Text("%s: %.3f", prefix, v); - } -} - -//------------------------------------------------------------------------- -// [SECTION] MenuItem, BeginMenu, EndMenu, etc. -//------------------------------------------------------------------------- -// - ImGuiMenuColumns [Internal] -// - BeginMenuBar() -// - EndMenuBar() -// - BeginMainMenuBar() -// - EndMainMenuBar() -// - BeginMenu() -// - EndMenu() -// - MenuItem() -//------------------------------------------------------------------------- - -// Helpers for internal use -ImGuiMenuColumns::ImGuiMenuColumns() -{ - Spacing = Width = NextWidth = 0.0f; - memset(Pos, 0, sizeof(Pos)); - memset(NextWidths, 0, sizeof(NextWidths)); -} - -void ImGuiMenuColumns::Update(int count, float spacing, bool clear) -{ - IM_ASSERT(count == IM_ARRAYSIZE(Pos)); - IM_UNUSED(count); - Width = NextWidth = 0.0f; - Spacing = spacing; - if (clear) - memset(NextWidths, 0, sizeof(NextWidths)); - for (int i = 0; i < IM_ARRAYSIZE(Pos); i++) - { - if (i > 0 && NextWidths[i] > 0.0f) - Width += Spacing; - Pos[i] = IM_FLOOR(Width); - Width += NextWidths[i]; - NextWidths[i] = 0.0f; - } -} - -float ImGuiMenuColumns::DeclColumns(float w0, float w1, float w2) // not using va_arg because they promote float to double -{ - NextWidth = 0.0f; - NextWidths[0] = ImMax(NextWidths[0], w0); - NextWidths[1] = ImMax(NextWidths[1], w1); - NextWidths[2] = ImMax(NextWidths[2], w2); - for (int i = 0; i < IM_ARRAYSIZE(Pos); i++) - NextWidth += NextWidths[i] + ((i > 0 && NextWidths[i] > 0.0f) ? Spacing : 0.0f); - return ImMax(Width, NextWidth); -} - -float ImGuiMenuColumns::CalcExtraSpace(float avail_w) const -{ - return ImMax(0.0f, avail_w - Width); -} - -// FIXME: Provided a rectangle perhaps e.g. a BeginMenuBarEx() could be used anywhere.. -// Currently the main responsibility of this function being to setup clip-rect + horizontal layout + menu navigation layer. -// Ideally we also want this to be responsible for claiming space out of the main window scrolling rectangle, in which case ImGuiWindowFlags_MenuBar will become unnecessary. -// Then later the same system could be used for multiple menu-bars, scrollbars, side-bars. -bool ImGui::BeginMenuBar() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - if (!(window->Flags & ImGuiWindowFlags_MenuBar)) - return false; - - IM_ASSERT(!window->DC.MenuBarAppending); - BeginGroup(); // Backup position on layer 0 // FIXME: Misleading to use a group for that backup/restore - PushID("##menubar"); - - // We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect. - // We remove 1 worth of rounding to Max.x to that text in long menus and small windows don't tend to display over the lower-right rounded area, which looks particularly glitchy. - ImRect bar_rect = window->MenuBarRect(); - ImRect clip_rect(IM_ROUND(bar_rect.Min.x + window->WindowBorderSize), IM_ROUND(bar_rect.Min.y + window->WindowBorderSize), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize))), IM_ROUND(bar_rect.Max.y)); - clip_rect.ClipWith(window->OuterRectClipped); - PushClipRect(clip_rect.Min, clip_rect.Max, false); - - window->DC.CursorPos = ImVec2(bar_rect.Min.x + window->DC.MenuBarOffset.x, bar_rect.Min.y + window->DC.MenuBarOffset.y); - window->DC.LayoutType = ImGuiLayoutType_Horizontal; - window->DC.NavLayerCurrent = ImGuiNavLayer_Menu; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Menu); - window->DC.MenuBarAppending = true; - AlignTextToFramePadding(); - return true; -} - -void ImGui::EndMenuBar() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - ImGuiContext& g = *GImGui; - - // Nav: When a move request within one of our child menu failed, capture the request to navigate among our siblings. - if (NavMoveRequestButNoResultYet() && (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) && (g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu)) - { - ImGuiWindow* nav_earliest_child = g.NavWindow; - while (nav_earliest_child->ParentWindow && (nav_earliest_child->ParentWindow->Flags & ImGuiWindowFlags_ChildMenu)) - nav_earliest_child = nav_earliest_child->ParentWindow; - if (nav_earliest_child->ParentWindow == window && nav_earliest_child->DC.ParentLayoutType == ImGuiLayoutType_Horizontal && g.NavMoveRequestForward == ImGuiNavForward_None) - { - // To do so we claim focus back, restore NavId and then process the movement request for yet another frame. - // This involve a one-frame delay which isn't very problematic in this situation. We could remove it by scoring in advance for multiple window (probably not worth the hassle/cost) - const ImGuiNavLayer layer = ImGuiNavLayer_Menu; - IM_ASSERT(window->DC.NavLayerActiveMaskNext & (1 << layer)); // Sanity check - FocusWindow(window); - SetNavIDWithRectRel(window->NavLastIds[layer], layer, 0, window->NavRectRel[layer]); - g.NavLayer = layer; - g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection. - g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued; - NavMoveRequestCancel(); - } - } - - IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar); - IM_ASSERT(window->DC.MenuBarAppending); - PopClipRect(); - PopID(); - window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->MenuBarRect().Min.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos. - window->DC.GroupStack.back().EmitItem = false; - EndGroup(); // Restore position on layer 0 - window->DC.LayoutType = ImGuiLayoutType_Vertical; - window->DC.NavLayerCurrent = ImGuiNavLayer_Main; - window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); - window->DC.MenuBarAppending = false; -} - -// For the main menu bar, which cannot be moved, we honor g.Style.DisplaySafeAreaPadding to ensure text can be visible on a TV set. -bool ImGui::BeginMainMenuBar() -{ - ImGuiContext& g = *GImGui; - g.NextWindowData.MenuBarOffsetMinVal = ImVec2(g.Style.DisplaySafeAreaPadding.x, ImMax(g.Style.DisplaySafeAreaPadding.y - g.Style.FramePadding.y, 0.0f)); - SetNextWindowPos(ImVec2(0.0f, 0.0f)); - SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.NextWindowData.MenuBarOffsetMinVal.y + g.FontBaseSize + g.Style.FramePadding.y)); - PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); - PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0, 0)); - ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar; - bool is_open = Begin("##MainMenuBar", NULL, window_flags) && BeginMenuBar(); - PopStyleVar(2); - g.NextWindowData.MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f); - if (!is_open) - { - End(); - return false; - } - return true; //-V1020 -} - -void ImGui::EndMainMenuBar() -{ - EndMenuBar(); - - // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window - // FIXME: With this strategy we won't be able to restore a NULL focus. - ImGuiContext& g = *GImGui; - if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest) - FocusTopMostWindowUnderOne(g.NavWindow, NULL); - - End(); -} - -bool ImGui::BeginMenu(const char* label, bool enabled) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - bool menu_is_open = IsPopupOpen(id); - - // Sub-menus are ChildWindow so that mouse can be hovering across them (otherwise top-most popup menu would steal focus and not allow hovering on parent menu) - ImGuiWindowFlags flags = ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNavFocus; - if (window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) - flags |= ImGuiWindowFlags_ChildWindow; - - // If a menu with same the ID was already submitted, we will append to it, matching the behavior of Begin(). - // We are relying on a O(N) search - so O(N log N) over the frame - which seems like the most efficient for the expected small amount of BeginMenu() calls per frame. - // If somehow this is ever becoming a problem we can switch to use e.g. a ImGuiStorager mapping key to last frame used. - if (g.MenusIdSubmittedThisFrame.contains(id)) - { - if (menu_is_open) - menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display) - else - g.NextWindowData.ClearFlags(); // we behave like Begin() and need to consume those values - return menu_is_open; - } - - // Tag menu as used. Next time BeginMenu() with same ID is called it will append to existing menu - g.MenusIdSubmittedThisFrame.push_back(id); - - ImVec2 label_size = CalcTextSize(label, NULL, true); - bool pressed; - bool menuset_is_open = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].OpenParentId == window->IDStack.back()); - ImGuiWindow* backed_nav_window = g.NavWindow; - if (menuset_is_open) - g.NavWindow = window; // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent) - - // The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu, - // However the final position is going to be different! It is choosen by FindBestWindowPosForPopup(). - // e.g. Menus tend to overlap each other horizontally to amplify relative Z-ordering. - ImVec2 popup_pos, pos = window->DC.CursorPos; - if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) - { - // Menu inside an horizontal menu bar - // Selectable extend their highlight by half ItemSpacing in each direction. - // For ChildMenu, the popup position will be overwritten by the call to FindBestWindowPosForPopup() in Begin() - popup_pos = ImVec2(pos.x - 1.0f - IM_FLOOR(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight()); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f); - PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y)); - float w = label_size.x; - pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f)); - PopStyleVar(); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). - } - else - { - // Menu inside a menu - // (In a typical menu window where all items are BeginMenu() or MenuItem() calls, extra_w will always be 0.0f. - // Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system. - popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y); - float min_w = window->DC.MenuColumns.DeclColumns(label_size.x, 0.0f, IM_FLOOR(g.FontSize * 1.20f)); // Feedback to next frame - float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); - pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_SpanAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(min_w, 0.0f)); - ImU32 text_col = GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled); - RenderArrow(window->DrawList, pos + ImVec2(window->DC.MenuColumns.Pos[2] + extra_w + g.FontSize * 0.30f, 0.0f), text_col, ImGuiDir_Right); - } - - const bool hovered = enabled && ItemHoverable(window->DC.LastItemRect, id); - if (menuset_is_open) - g.NavWindow = backed_nav_window; - - bool want_open = false; - bool want_close = false; - if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) - { - // Close menu when not hovering it anymore unless we are moving roughly in the direction of the menu - // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers, so menus feels more reactive. - bool moving_toward_other_child_menu = false; - - ImGuiWindow* child_menu_window = (g.BeginPopupStack.Size < g.OpenPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].SourceWindow == window) ? g.OpenPopupStack[g.BeginPopupStack.Size].Window : NULL; - if (g.HoveredWindow == window && child_menu_window != NULL && !(window->Flags & ImGuiWindowFlags_MenuBar)) - { - // FIXME-DPI: Values should be derived from a master "scale" factor. - ImRect next_window_rect = child_menu_window->Rect(); - ImVec2 ta = g.IO.MousePos - g.IO.MouseDelta; - ImVec2 tb = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR(); - ImVec2 tc = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR(); - float extra = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, 5.0f, 30.0f); // add a bit of extra slack. - ta.x += (window->Pos.x < child_menu_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues - tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -100.0f); // triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale? - tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +100.0f); - moving_toward_other_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos); - //GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG] - } - if (menu_is_open && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_toward_other_child_menu) - want_close = true; - - if (!menu_is_open && hovered && pressed) // Click to open - want_open = true; - else if (!menu_is_open && hovered && !moving_toward_other_child_menu) // Hover to open - want_open = true; - - if (g.NavActivateId == id) - { - want_close = menu_is_open; - want_open = !menu_is_open; - } - if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open - { - want_open = true; - NavMoveRequestCancel(); - } - } - else - { - // Menu bar - if (menu_is_open && pressed && menuset_is_open) // Click an open menu again to close it - { - want_close = true; - want_open = menu_is_open = false; - } - else if (pressed || (hovered && menuset_is_open && !menu_is_open)) // First click to open, then hover to open others - { - want_open = true; - } - else if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Down) // Nav-Down to open - { - want_open = true; - NavMoveRequestCancel(); - } - } - - if (!enabled) // explicitly close if an open menu becomes disabled, facilitate users code a lot in pattern such as 'if (BeginMenu("options", has_object)) { ..use object.. }' - want_close = true; - if (want_close && IsPopupOpen(id)) - ClosePopupToLevel(g.BeginPopupStack.Size, true); - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0)); - - if (!menu_is_open && want_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size) - { - // Don't recycle same menu level in the same frame, first close the other menu and yield for a frame. - OpenPopup(label); - return false; - } - - menu_is_open |= want_open; - if (want_open) - OpenPopup(label); - - if (menu_is_open) - { - SetNextWindowPos(popup_pos, ImGuiCond_Always); - menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display) - } - else - { - g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values - } - - return menu_is_open; -} - -void ImGui::EndMenu() -{ - // Nav: When a left move request _within our child menu_ failed, close ourselves (the _parent_ menu). - // A menu doesn't close itself because EndMenuBar() wants the catch the last Left<>Right inputs. - // However, it means that with the current code, a BeginMenu() from outside another menu or a menu-bar won't be closable with the Left direction. - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical) - { - ClosePopupToLevel(g.BeginPopupStack.Size, true); - NavMoveRequestCancel(); - } - - EndPopup(); -} - -bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, bool enabled) -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - - ImGuiContext& g = *GImGui; - ImGuiStyle& style = g.Style; - ImVec2 pos = window->DC.CursorPos; - ImVec2 label_size = CalcTextSize(label, NULL, true); - - // We've been using the equivalent of ImGuiSelectableFlags_SetNavIdOnHover on all Selectable() since early Nav system days (commit 43ee5d73), - // but I am unsure whether this should be kept at all. For now moved it to be an opt-in feature used by menus only. - ImGuiSelectableFlags flags = ImGuiSelectableFlags_SelectOnRelease | ImGuiSelectableFlags_SetNavIdOnHover | (enabled ? 0 : ImGuiSelectableFlags_Disabled); - bool pressed; - if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) - { - // Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful - // Note that in this situation we render neither the shortcut neither the selected tick mark - float w = label_size.x; - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f); - PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y)); - pressed = Selectable(label, false, flags, ImVec2(w, 0.0f)); - PopStyleVar(); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). - } - else - { - // Menu item inside a vertical menu - // (In a typical menu window where all items are BeginMenu() or MenuItem() calls, extra_w will always be 0.0f. - // Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system. - float shortcut_w = shortcut ? CalcTextSize(shortcut, NULL).x : 0.0f; - float min_w = window->DC.MenuColumns.DeclColumns(label_size.x, shortcut_w, IM_FLOOR(g.FontSize * 1.20f)); // Feedback for next frame - float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); - pressed = Selectable(label, false, flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f)); - if (shortcut_w > 0.0f) - { - PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]); - RenderText(pos + ImVec2(window->DC.MenuColumns.Pos[1] + extra_w, 0.0f), shortcut, NULL, false); - PopStyleColor(); - } - if (selected) - RenderCheckMark(window->DrawList, pos + ImVec2(window->DC.MenuColumns.Pos[2] + extra_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled), g.FontSize * 0.866f); - } - - IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0)); - return pressed; -} - -bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled) -{ - if (MenuItem(label, shortcut, p_selected ? *p_selected : false, enabled)) - { - if (p_selected) - *p_selected = !*p_selected; - return true; - } - return false; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: BeginTabBar, EndTabBar, etc. -//------------------------------------------------------------------------- -// - BeginTabBar() -// - BeginTabBarEx() [Internal] -// - EndTabBar() -// - TabBarLayout() [Internal] -// - TabBarCalcTabID() [Internal] -// - TabBarCalcMaxTabWidth() [Internal] -// - TabBarFindTabById() [Internal] -// - TabBarRemoveTab() [Internal] -// - TabBarCloseTab() [Internal] -// - TabBarScrollClamp()v -// - TabBarScrollToTab() [Internal] -// - TabBarQueueChangeTabOrder() [Internal] -// - TabBarScrollingButtons() [Internal] -// - TabBarTabListPopupButton() [Internal] -//------------------------------------------------------------------------- - -namespace ImGui -{ - static void TabBarLayout(ImGuiTabBar* tab_bar); - static ImU32 TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label); - static float TabBarCalcMaxTabWidth(); - static float TabBarScrollClamp(ImGuiTabBar* tab_bar, float scrolling); - static void TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); - static ImGuiTabItem* TabBarScrollingButtons(ImGuiTabBar* tab_bar); - static ImGuiTabItem* TabBarTabListPopupButton(ImGuiTabBar* tab_bar); -} - -ImGuiTabBar::ImGuiTabBar() -{ - ID = 0; - SelectedTabId = NextSelectedTabId = VisibleTabId = 0; - CurrFrameVisible = PrevFrameVisible = -1; - LastTabContentHeight = 0.0f; - OffsetMax = OffsetMaxIdeal = OffsetNextTab = 0.0f; - ScrollingAnim = ScrollingTarget = ScrollingTargetDistToVisibility = ScrollingSpeed = 0.0f; - Flags = ImGuiTabBarFlags_None; - ReorderRequestTabId = 0; - ReorderRequestDir = 0; - WantLayout = VisibleTabWasSubmitted = false; - LastTabItemIdx = -1; -} - -static int IMGUI_CDECL TabItemComparerByVisibleOffset(const void* lhs, const void* rhs) -{ - const ImGuiTabItem* a = (const ImGuiTabItem*)lhs; - const ImGuiTabItem* b = (const ImGuiTabItem*)rhs; - return (int)(a->Offset - b->Offset); -} - -static ImGuiTabBar* GetTabBarFromTabBarRef(const ImGuiPtrOrIndex& ref) -{ - ImGuiContext& g = *GImGui; - return ref.Ptr ? (ImGuiTabBar*)ref.Ptr : g.TabBars.GetByIndex(ref.Index); -} - -static ImGuiPtrOrIndex GetTabBarRefFromTabBar(ImGuiTabBar* tab_bar) -{ - ImGuiContext& g = *GImGui; - if (g.TabBars.Contains(tab_bar)) - return ImGuiPtrOrIndex(g.TabBars.GetIndex(tab_bar)); - return ImGuiPtrOrIndex(tab_bar); -} - -bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - - ImGuiID id = window->GetID(str_id); - ImGuiTabBar* tab_bar = g.TabBars.GetOrAddByKey(id); - ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->WorkRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2); - tab_bar->ID = id; - return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused); -} - -bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - - if ((flags & ImGuiTabBarFlags_DockNode) == 0) - PushOverrideID(tab_bar->ID); - - // Add to stack - g.CurrentTabBarStack.push_back(GetTabBarRefFromTabBar(tab_bar)); - g.CurrentTabBar = tab_bar; - - if (tab_bar->CurrFrameVisible == g.FrameCount) - { - //IMGUI_DEBUG_LOG("BeginTabBarEx already called this frame\n", g.FrameCount); - IM_ASSERT(0); - return true; - } - - // When toggling back from ordered to manually-reorderable, shuffle tabs to enforce the last visible order. - // Otherwise, the most recently inserted tabs would move at the end of visible list which can be a little too confusing or magic for the user. - if ((flags & ImGuiTabBarFlags_Reorderable) && !(tab_bar->Flags & ImGuiTabBarFlags_Reorderable) && tab_bar->Tabs.Size > 1 && tab_bar->PrevFrameVisible != -1) - ImQsort(tab_bar->Tabs.Data, tab_bar->Tabs.Size, sizeof(ImGuiTabItem), TabItemComparerByVisibleOffset); - - // Flags - if ((flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0) - flags |= ImGuiTabBarFlags_FittingPolicyDefault_; - - tab_bar->Flags = flags; - tab_bar->BarRect = tab_bar_bb; - tab_bar->WantLayout = true; // Layout will be done on the first call to ItemTab() - tab_bar->PrevFrameVisible = tab_bar->CurrFrameVisible; - tab_bar->CurrFrameVisible = g.FrameCount; - tab_bar->FramePadding = g.Style.FramePadding; - - // Layout - ItemSize(ImVec2(tab_bar->OffsetMaxIdeal, tab_bar->BarRect.GetHeight()), tab_bar->FramePadding.y); - window->DC.CursorPos.x = tab_bar->BarRect.Min.x; - - // Draw separator - const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive); - const float y = tab_bar->BarRect.Max.y - 1.0f; - { - const float separator_min_x = tab_bar->BarRect.Min.x - IM_FLOOR(window->WindowPadding.x * 0.5f); - const float separator_max_x = tab_bar->BarRect.Max.x + IM_FLOOR(window->WindowPadding.x * 0.5f); - window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f); - } - return true; -} - -void ImGui::EndTabBar() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return; - - ImGuiTabBar* tab_bar = g.CurrentTabBar; - if (tab_bar == NULL) - { - IM_ASSERT_USER_ERROR(tab_bar != NULL, "Mismatched BeginTabBar()/EndTabBar()!"); - return; - } - if (tab_bar->WantLayout) - TabBarLayout(tab_bar); - - // Restore the last visible height if no tab is visible, this reduce vertical flicker/movement when a tabs gets removed without calling SetTabItemClosed(). - const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount); - if (tab_bar->VisibleTabWasSubmitted || tab_bar->VisibleTabId == 0 || tab_bar_appearing) - tab_bar->LastTabContentHeight = ImMax(window->DC.CursorPos.y - tab_bar->BarRect.Max.y, 0.0f); - else - window->DC.CursorPos.y = tab_bar->BarRect.Max.y + tab_bar->LastTabContentHeight; - - if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) - PopID(); - - g.CurrentTabBarStack.pop_back(); - g.CurrentTabBar = g.CurrentTabBarStack.empty() ? NULL : GetTabBarFromTabBarRef(g.CurrentTabBarStack.back()); -} - -// This is called only once a frame before by the first call to ItemTab() -// The reason we're not calling it in BeginTabBar() is to leave a chance to the user to call the SetTabItemClosed() functions. -static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) -{ - ImGuiContext& g = *GImGui; - tab_bar->WantLayout = false; - - // Garbage collect - int tab_dst_n = 0; - for (int tab_src_n = 0; tab_src_n < tab_bar->Tabs.Size; tab_src_n++) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_src_n]; - if (tab->LastFrameVisible < tab_bar->PrevFrameVisible) - { - if (tab->ID == tab_bar->SelectedTabId) - tab_bar->SelectedTabId = 0; - continue; - } - if (tab_dst_n != tab_src_n) - tab_bar->Tabs[tab_dst_n] = tab_bar->Tabs[tab_src_n]; - tab_dst_n++; - } - if (tab_bar->Tabs.Size != tab_dst_n) - tab_bar->Tabs.resize(tab_dst_n); - - // Setup next selected tab - ImGuiID scroll_track_selected_tab_id = 0; - if (tab_bar->NextSelectedTabId) - { - tab_bar->SelectedTabId = tab_bar->NextSelectedTabId; - tab_bar->NextSelectedTabId = 0; - scroll_track_selected_tab_id = tab_bar->SelectedTabId; - } - - // Process order change request (we could probably process it when requested but it's just saner to do it in a single spot). - if (tab_bar->ReorderRequestTabId != 0) - { - if (ImGuiTabItem* tab1 = TabBarFindTabByID(tab_bar, tab_bar->ReorderRequestTabId)) - { - //IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_Reorderable); // <- this may happen when using debug tools - int tab2_order = tab_bar->GetTabOrder(tab1) + tab_bar->ReorderRequestDir; - if (tab2_order >= 0 && tab2_order < tab_bar->Tabs.Size) - { - ImGuiTabItem* tab2 = &tab_bar->Tabs[tab2_order]; - ImGuiTabItem item_tmp = *tab1; - *tab1 = *tab2; - *tab2 = item_tmp; - if (tab2->ID == tab_bar->SelectedTabId) - scroll_track_selected_tab_id = tab2->ID; - tab1 = tab2 = NULL; - } - if (tab_bar->Flags & ImGuiTabBarFlags_SaveSettings) - MarkIniSettingsDirty(); - } - tab_bar->ReorderRequestTabId = 0; - } - - // Tab List Popup (will alter tab_bar->BarRect and therefore the available width!) - const bool tab_list_popup_button = (tab_bar->Flags & ImGuiTabBarFlags_TabListPopupButton) != 0; - if (tab_list_popup_button) - if (ImGuiTabItem* tab_to_select = TabBarTabListPopupButton(tab_bar)) // NB: Will alter BarRect.Max.x! - scroll_track_selected_tab_id = tab_bar->SelectedTabId = tab_to_select->ID; - - // Compute ideal widths - g.ShrinkWidthBuffer.resize(tab_bar->Tabs.Size); - float width_total_contents = 0.0f; - ImGuiTabItem* most_recently_selected_tab = NULL; - bool found_selected_tab_id = false; - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; - IM_ASSERT(tab->LastFrameVisible >= tab_bar->PrevFrameVisible); - - if (most_recently_selected_tab == NULL || most_recently_selected_tab->LastFrameSelected < tab->LastFrameSelected) - most_recently_selected_tab = tab; - if (tab->ID == tab_bar->SelectedTabId) - found_selected_tab_id = true; - - // Refresh tab width immediately, otherwise changes of style e.g. style.FramePadding.x would noticeably lag in the tab bar. - // Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet, - // and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window. - const char* tab_name = tab_bar->GetTabName(tab); - const bool has_close_button = (tab->Flags & ImGuiTabItemFlags_NoCloseButton) ? false : true; - tab->ContentWidth = TabItemCalcSize(tab_name, has_close_button).x; - - width_total_contents += (tab_n > 0 ? g.Style.ItemInnerSpacing.x : 0.0f) + tab->ContentWidth; - - // Store data so we can build an array sorted by width if we need to shrink tabs down - g.ShrinkWidthBuffer[tab_n].Index = tab_n; - g.ShrinkWidthBuffer[tab_n].Width = tab->ContentWidth; - } - - // Compute width - const float initial_offset_x = 0.0f; // g.Style.ItemInnerSpacing.x; - const float width_avail = ImMax(tab_bar->BarRect.GetWidth() - initial_offset_x, 0.0f); - float width_excess = (width_avail < width_total_contents) ? (width_total_contents - width_avail) : 0.0f; - if (width_excess > 0.0f && (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyResizeDown)) - { - // If we don't have enough room, resize down the largest tabs first - ShrinkWidths(g.ShrinkWidthBuffer.Data, g.ShrinkWidthBuffer.Size, width_excess); - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - tab_bar->Tabs[g.ShrinkWidthBuffer[tab_n].Index].Width = IM_FLOOR(g.ShrinkWidthBuffer[tab_n].Width); - } - else - { - const float tab_max_width = TabBarCalcMaxTabWidth(); - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; - tab->Width = ImMin(tab->ContentWidth, tab_max_width); - IM_ASSERT(tab->Width > 0.0f); - } - } - - // Layout all active tabs - float offset_x = initial_offset_x; - float offset_x_ideal = offset_x; - tab_bar->OffsetNextTab = offset_x; // This is used by non-reorderable tab bar where the submission order is always honored. - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; - tab->Offset = offset_x; - if (scroll_track_selected_tab_id == 0 && g.NavJustMovedToId == tab->ID) - scroll_track_selected_tab_id = tab->ID; - offset_x += tab->Width + g.Style.ItemInnerSpacing.x; - offset_x_ideal += tab->ContentWidth + g.Style.ItemInnerSpacing.x; - } - tab_bar->OffsetMax = ImMax(offset_x - g.Style.ItemInnerSpacing.x, 0.0f); - tab_bar->OffsetMaxIdeal = ImMax(offset_x_ideal - g.Style.ItemInnerSpacing.x, 0.0f); - - // Horizontal scrolling buttons - const bool scrolling_buttons = (tab_bar->OffsetMax > tab_bar->BarRect.GetWidth() && tab_bar->Tabs.Size > 1) && !(tab_bar->Flags & ImGuiTabBarFlags_NoTabListScrollingButtons) && (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll); - if (scrolling_buttons) - if (ImGuiTabItem* tab_to_select = TabBarScrollingButtons(tab_bar)) // NB: Will alter BarRect.Max.x! - scroll_track_selected_tab_id = tab_bar->SelectedTabId = tab_to_select->ID; - - // If we have lost the selected tab, select the next most recently active one - if (found_selected_tab_id == false) - tab_bar->SelectedTabId = 0; - if (tab_bar->SelectedTabId == 0 && tab_bar->NextSelectedTabId == 0 && most_recently_selected_tab != NULL) - scroll_track_selected_tab_id = tab_bar->SelectedTabId = most_recently_selected_tab->ID; - - // Lock in visible tab - tab_bar->VisibleTabId = tab_bar->SelectedTabId; - tab_bar->VisibleTabWasSubmitted = false; - - // Update scrolling - if (scroll_track_selected_tab_id) - if (ImGuiTabItem* scroll_track_selected_tab = TabBarFindTabByID(tab_bar, scroll_track_selected_tab_id)) - TabBarScrollToTab(tab_bar, scroll_track_selected_tab); - tab_bar->ScrollingAnim = TabBarScrollClamp(tab_bar, tab_bar->ScrollingAnim); - tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget); - if (tab_bar->ScrollingAnim != tab_bar->ScrollingTarget) - { - // Scrolling speed adjust itself so we can always reach our target in 1/3 seconds. - // Teleport if we are aiming far off the visible line - tab_bar->ScrollingSpeed = ImMax(tab_bar->ScrollingSpeed, 70.0f * g.FontSize); - tab_bar->ScrollingSpeed = ImMax(tab_bar->ScrollingSpeed, ImFabs(tab_bar->ScrollingTarget - tab_bar->ScrollingAnim) / 0.3f); - const bool teleport = (tab_bar->PrevFrameVisible + 1 < g.FrameCount) || (tab_bar->ScrollingTargetDistToVisibility > 10.0f * g.FontSize); - tab_bar->ScrollingAnim = teleport ? tab_bar->ScrollingTarget : ImLinearSweep(tab_bar->ScrollingAnim, tab_bar->ScrollingTarget, g.IO.DeltaTime * tab_bar->ScrollingSpeed); - } - else - { - tab_bar->ScrollingSpeed = 0.0f; - } - - // Clear name buffers - if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) - tab_bar->TabsNames.Buf.resize(0); -} - -// Dockables uses Name/ID in the global namespace. Non-dockable items use the ID stack. -static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label) -{ - if (tab_bar->Flags & ImGuiTabBarFlags_DockNode) - { - ImGuiID id = ImHashStr(label); - KeepAliveID(id); - return id; - } - else - { - ImGuiWindow* window = GImGui->CurrentWindow; - return window->GetID(label); - } -} - -static float ImGui::TabBarCalcMaxTabWidth() -{ - ImGuiContext& g = *GImGui; - return g.FontSize * 20.0f; -} - -ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id) -{ - if (tab_id != 0) - for (int n = 0; n < tab_bar->Tabs.Size; n++) - if (tab_bar->Tabs[n].ID == tab_id) - return &tab_bar->Tabs[n]; - return NULL; -} - -// The *TabId fields be already set by the docking system _before_ the actual TabItem was created, so we clear them regardless. -void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id) -{ - if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id)) - tab_bar->Tabs.erase(tab); - if (tab_bar->VisibleTabId == tab_id) { tab_bar->VisibleTabId = 0; } - if (tab_bar->SelectedTabId == tab_id) { tab_bar->SelectedTabId = 0; } - if (tab_bar->NextSelectedTabId == tab_id) { tab_bar->NextSelectedTabId = 0; } -} - -// Called on manual closure attempt -void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) -{ - if ((tab_bar->VisibleTabId == tab->ID) && !(tab->Flags & ImGuiTabItemFlags_UnsavedDocument)) - { - // This will remove a frame of lag for selecting another tab on closure. - // However we don't run it in the case where the 'Unsaved' flag is set, so user gets a chance to fully undo the closure - tab->LastFrameVisible = -1; - tab_bar->SelectedTabId = tab_bar->NextSelectedTabId = 0; - } - else if ((tab_bar->VisibleTabId != tab->ID) && (tab->Flags & ImGuiTabItemFlags_UnsavedDocument)) - { - // Actually select before expecting closure - tab_bar->NextSelectedTabId = tab->ID; - } -} - -static float ImGui::TabBarScrollClamp(ImGuiTabBar* tab_bar, float scrolling) -{ - scrolling = ImMin(scrolling, tab_bar->OffsetMax - tab_bar->BarRect.GetWidth()); - return ImMax(scrolling, 0.0f); -} - -static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) -{ - ImGuiContext& g = *GImGui; - float margin = g.FontSize * 1.0f; // When to scroll to make Tab N+1 visible always make a bit of N visible to suggest more scrolling area (since we don't have a scrollbar) - int order = tab_bar->GetTabOrder(tab); - float tab_x1 = tab->Offset + (order > 0 ? -margin : 0.0f); - float tab_x2 = tab->Offset + tab->Width + (order + 1 < tab_bar->Tabs.Size ? margin : 1.0f); - tab_bar->ScrollingTargetDistToVisibility = 0.0f; - if (tab_bar->ScrollingTarget > tab_x1 || (tab_x2 - tab_x1 >= tab_bar->BarRect.GetWidth())) - { - tab_bar->ScrollingTargetDistToVisibility = ImMax(tab_bar->ScrollingAnim - tab_x2, 0.0f); - tab_bar->ScrollingTarget = tab_x1; - } - else if (tab_bar->ScrollingTarget < tab_x2 - tab_bar->BarRect.GetWidth()) - { - tab_bar->ScrollingTargetDistToVisibility = ImMax((tab_x1 - tab_bar->BarRect.GetWidth()) - tab_bar->ScrollingAnim, 0.0f); - tab_bar->ScrollingTarget = tab_x2 - tab_bar->BarRect.GetWidth(); - } -} - -void ImGui::TabBarQueueChangeTabOrder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int dir) -{ - IM_ASSERT(dir == -1 || dir == +1); - IM_ASSERT(tab_bar->ReorderRequestTabId == 0); - tab_bar->ReorderRequestTabId = tab->ID; - tab_bar->ReorderRequestDir = (ImS8)dir; -} - -static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - const ImVec2 arrow_button_size(g.FontSize - 2.0f, g.FontSize + g.Style.FramePadding.y * 2.0f); - const float scrolling_buttons_width = arrow_button_size.x * 2.0f; - - const ImVec2 backup_cursor_pos = window->DC.CursorPos; - //window->DrawList->AddRect(ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y), ImVec2(tab_bar->BarRect.Max.x, tab_bar->BarRect.Max.y), IM_COL32(255,0,0,255)); - - const ImRect avail_bar_rect = tab_bar->BarRect; - bool want_clip_rect = !avail_bar_rect.Contains(ImRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(scrolling_buttons_width, 0.0f))); - if (want_clip_rect) - PushClipRect(tab_bar->BarRect.Min, tab_bar->BarRect.Max + ImVec2(g.Style.ItemInnerSpacing.x, 0.0f), true); - - ImGuiTabItem* tab_to_select = NULL; - - int select_dir = 0; - ImVec4 arrow_col = g.Style.Colors[ImGuiCol_Text]; - arrow_col.w *= 0.5f; - - PushStyleColor(ImGuiCol_Text, arrow_col); - PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - const float backup_repeat_delay = g.IO.KeyRepeatDelay; - const float backup_repeat_rate = g.IO.KeyRepeatRate; - g.IO.KeyRepeatDelay = 0.250f; - g.IO.KeyRepeatRate = 0.200f; - window->DC.CursorPos = ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y); - if (ArrowButtonEx("##<", ImGuiDir_Left, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat)) - select_dir = -1; - window->DC.CursorPos = ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width + arrow_button_size.x, tab_bar->BarRect.Min.y); - if (ArrowButtonEx("##>", ImGuiDir_Right, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat)) - select_dir = +1; - PopStyleColor(2); - g.IO.KeyRepeatRate = backup_repeat_rate; - g.IO.KeyRepeatDelay = backup_repeat_delay; - - if (want_clip_rect) - PopClipRect(); - - if (select_dir != 0) - if (ImGuiTabItem* tab_item = TabBarFindTabByID(tab_bar, tab_bar->SelectedTabId)) - { - int selected_order = tab_bar->GetTabOrder(tab_item); - int target_order = selected_order + select_dir; - tab_to_select = &tab_bar->Tabs[(target_order >= 0 && target_order < tab_bar->Tabs.Size) ? target_order : selected_order]; // If we are at the end of the list, still scroll to make our tab visible - } - window->DC.CursorPos = backup_cursor_pos; - tab_bar->BarRect.Max.x -= scrolling_buttons_width + 1.0f; - - return tab_to_select; -} - -static ImGuiTabItem* ImGui::TabBarTabListPopupButton(ImGuiTabBar* tab_bar) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - // We use g.Style.FramePadding.y to match the square ArrowButton size - const float tab_list_popup_button_width = g.FontSize + g.Style.FramePadding.y; - const ImVec2 backup_cursor_pos = window->DC.CursorPos; - window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x - g.Style.FramePadding.y, tab_bar->BarRect.Min.y); - tab_bar->BarRect.Min.x += tab_list_popup_button_width; - - ImVec4 arrow_col = g.Style.Colors[ImGuiCol_Text]; - arrow_col.w *= 0.5f; - PushStyleColor(ImGuiCol_Text, arrow_col); - PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - bool open = BeginCombo("##v", NULL, ImGuiComboFlags_NoPreview); - PopStyleColor(2); - - ImGuiTabItem* tab_to_select = NULL; - if (open) - { - for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; - const char* tab_name = tab_bar->GetTabName(tab); - if (Selectable(tab_name, tab_bar->SelectedTabId == tab->ID)) - tab_to_select = tab; - } - EndCombo(); - } - - window->DC.CursorPos = backup_cursor_pos; - return tab_to_select; -} - -//------------------------------------------------------------------------- -// [SECTION] Widgets: BeginTabItem, EndTabItem, etc. -//------------------------------------------------------------------------- -// - BeginTabItem() -// - EndTabItem() -// - TabItemEx() [Internal] -// - SetTabItemClosed() -// - TabItemCalcSize() [Internal] -// - TabItemBackground() [Internal] -// - TabItemLabelAndCloseButton() [Internal] -//------------------------------------------------------------------------- - -bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - - ImGuiTabBar* tab_bar = g.CurrentTabBar; - if (tab_bar == NULL) - { - IM_ASSERT_USER_ERROR(tab_bar, "BeginTabItem() Needs to be called between BeginTabBar() and EndTabBar()!"); - return false; - } - bool ret = TabItemEx(tab_bar, label, p_open, flags); - if (ret && !(flags & ImGuiTabItemFlags_NoPushId)) - { - ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx]; - PushOverrideID(tab->ID); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label) - } - return ret; -} - -void ImGui::EndTabItem() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return; - - ImGuiTabBar* tab_bar = g.CurrentTabBar; - if (tab_bar == NULL) - { - IM_ASSERT(tab_bar != NULL && "Needs to be called between BeginTabBar() and EndTabBar()!"); - return; - } - IM_ASSERT(tab_bar->LastTabItemIdx >= 0); - ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx]; - if (!(tab->Flags & ImGuiTabItemFlags_NoPushId)) - window->IDStack.pop_back(); -} - -bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags) -{ - // Layout whole tab bar if not already done - if (tab_bar->WantLayout) - TabBarLayout(tab_bar); - - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - - const ImGuiStyle& style = g.Style; - const ImGuiID id = TabBarCalcTabID(tab_bar, label); - - // If the user called us with *p_open == false, we early out and don't render. We make a dummy call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID. - if (p_open && !*p_open) - { - PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true); - ItemAdd(ImRect(), id); - PopItemFlag(); - return false; - } - - // Store into ImGuiTabItemFlags_NoCloseButton, also honor ImGuiTabItemFlags_NoCloseButton passed by user (although not documented) - if (flags & ImGuiTabItemFlags_NoCloseButton) - p_open = NULL; - else if (p_open == NULL) - flags |= ImGuiTabItemFlags_NoCloseButton; - - // Calculate tab contents size - ImVec2 size = TabItemCalcSize(label, p_open != NULL); - - // Acquire tab data - ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, id); - bool tab_is_new = false; - if (tab == NULL) - { - tab_bar->Tabs.push_back(ImGuiTabItem()); - tab = &tab_bar->Tabs.back(); - tab->ID = id; - tab->Width = size.x; - tab_is_new = true; - } - tab_bar->LastTabItemIdx = (short)tab_bar->Tabs.index_from_ptr(tab); - tab->ContentWidth = size.x; - - const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount); - const bool tab_bar_focused = (tab_bar->Flags & ImGuiTabBarFlags_IsFocused) != 0; - const bool tab_appearing = (tab->LastFrameVisible + 1 < g.FrameCount); - tab->LastFrameVisible = g.FrameCount; - tab->Flags = flags; - - // Append name with zero-terminator - tab->NameOffset = tab_bar->TabsNames.size(); - tab_bar->TabsNames.append(label, label + strlen(label) + 1); - - // If we are not reorderable, always reset offset based on submission order. - // (We already handled layout and sizing using the previous known order, but sizing is not affected by order!) - if (!tab_appearing && !(tab_bar->Flags & ImGuiTabBarFlags_Reorderable)) - { - tab->Offset = tab_bar->OffsetNextTab; - tab_bar->OffsetNextTab += tab->Width + g.Style.ItemInnerSpacing.x; - } - - // Update selected tab - if (tab_appearing && (tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs) && tab_bar->NextSelectedTabId == 0) - if (!tab_bar_appearing || tab_bar->SelectedTabId == 0) - tab_bar->NextSelectedTabId = id; // New tabs gets activated - if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // SetSelected can only be passed on explicit tab bar - tab_bar->NextSelectedTabId = id; - - // Lock visibility - bool tab_contents_visible = (tab_bar->VisibleTabId == id); - if (tab_contents_visible) - tab_bar->VisibleTabWasSubmitted = true; - - // On the very first frame of a tab bar we let first tab contents be visible to minimize appearing glitches - if (!tab_contents_visible && tab_bar->SelectedTabId == 0 && tab_bar_appearing) - if (tab_bar->Tabs.Size == 1 && !(tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs)) - tab_contents_visible = true; - - if (tab_appearing && !(tab_bar_appearing && !tab_is_new)) - { - PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true); - ItemAdd(ImRect(), id); - PopItemFlag(); - return tab_contents_visible; - } - - if (tab_bar->SelectedTabId == id) - tab->LastFrameSelected = g.FrameCount; - - // Backup current layout position - const ImVec2 backup_main_cursor_pos = window->DC.CursorPos; - - // Layout - size.x = tab->Width; - window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_FLOOR(tab->Offset - tab_bar->ScrollingAnim), 0.0f); - ImVec2 pos = window->DC.CursorPos; - ImRect bb(pos, pos + size); - - // We don't have CPU clipping primitives to clip the CloseButton (until it becomes a texture), so need to add an extra draw call (temporary in the case of vertical animation) - bool want_clip_rect = (bb.Min.x < tab_bar->BarRect.Min.x) || (bb.Max.x > tab_bar->BarRect.Max.x); - if (want_clip_rect) - PushClipRect(ImVec2(ImMax(bb.Min.x, tab_bar->BarRect.Min.x), bb.Min.y - 1), ImVec2(tab_bar->BarRect.Max.x, bb.Max.y), true); - - ImVec2 backup_cursor_max_pos = window->DC.CursorMaxPos; - ItemSize(bb.GetSize(), style.FramePadding.y); - window->DC.CursorMaxPos = backup_cursor_max_pos; - - if (!ItemAdd(bb, id)) - { - if (want_clip_rect) - PopClipRect(); - window->DC.CursorPos = backup_main_cursor_pos; - return tab_contents_visible; - } - - // Click to Select a tab - ImGuiButtonFlags button_flags = (ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_AllowItemOverlap); - if (g.DragDropActive) - button_flags |= ImGuiButtonFlags_PressedOnDragDropHold; - bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags); - if (pressed) - tab_bar->NextSelectedTabId = id; - hovered |= (g.HoveredId == id); - - // Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered) - if (!held) - SetItemAllowOverlap(); - - // Drag and drop: re-order tabs - if (held && !tab_appearing && IsMouseDragging(0)) - { - if (!g.DragDropActive && (tab_bar->Flags & ImGuiTabBarFlags_Reorderable)) - { - // While moving a tab it will jump on the other side of the mouse, so we also test for MouseDelta.x - if (g.IO.MouseDelta.x < 0.0f && g.IO.MousePos.x < bb.Min.x) - { - if (tab_bar->Flags & ImGuiTabBarFlags_Reorderable) - TabBarQueueChangeTabOrder(tab_bar, tab, -1); - } - else if (g.IO.MouseDelta.x > 0.0f && g.IO.MousePos.x > bb.Max.x) - { - if (tab_bar->Flags & ImGuiTabBarFlags_Reorderable) - TabBarQueueChangeTabOrder(tab_bar, tab, +1); - } - } - } - -#if 0 - if (hovered && g.HoveredIdNotActiveTimer > 0.50f && bb.GetWidth() < tab->ContentWidth) - { - // Enlarge tab display when hovering - bb.Max.x = bb.Min.x + IM_FLOOR(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f))); - display_draw_list = GetForegroundDrawList(window); - TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive)); - } -#endif - - // Render tab shape - ImDrawList* display_draw_list = window->DrawList; - const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabUnfocused)); - TabItemBackground(display_draw_list, bb, flags, tab_col); - RenderNavHighlight(bb, id); - - // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget. - const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup); - if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1))) - tab_bar->NextSelectedTabId = id; - - if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton) - flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton; - - // Render tab label, process close button - const ImGuiID close_button_id = p_open ? window->GetID((void*)((intptr_t)id + 1)) : 0; - bool just_closed = TabItemLabelAndCloseButton(display_draw_list, bb, flags, tab_bar->FramePadding, label, id, close_button_id); - if (just_closed && p_open != NULL) - { - *p_open = false; - TabBarCloseTab(tab_bar, tab); - } - - // Restore main window position so user can draw there - if (want_clip_rect) - PopClipRect(); - window->DC.CursorPos = backup_main_cursor_pos; - - // Tooltip (FIXME: Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer) - // We test IsItemHovered() to discard e.g. when another item is active or drag and drop over the tab bar (which g.HoveredId ignores) - if (g.HoveredId == id && !held && g.HoveredIdNotActiveTimer > 0.50f && IsItemHovered()) - if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip)) - SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label); - - return tab_contents_visible; -} - -// [Public] This is call is 100% optional but it allows to remove some one-frame glitches when a tab has been unexpectedly removed. -// To use it to need to call the function SetTabItemClosed() after BeginTabBar() and before any call to BeginTabItem() -void ImGui::SetTabItemClosed(const char* label) -{ - ImGuiContext& g = *GImGui; - bool is_within_manual_tab_bar = g.CurrentTabBar && !(g.CurrentTabBar->Flags & ImGuiTabBarFlags_DockNode); - if (is_within_manual_tab_bar) - { - ImGuiTabBar* tab_bar = g.CurrentTabBar; - IM_ASSERT(tab_bar->WantLayout); // Needs to be called AFTER BeginTabBar() and BEFORE the first call to BeginTabItem() - ImGuiID tab_id = TabBarCalcTabID(tab_bar, label); - TabBarRemoveTab(tab_bar, tab_id); - } -} - -ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button) -{ - ImGuiContext& g = *GImGui; - ImVec2 label_size = CalcTextSize(label, NULL, true); - ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f); - if (has_close_button) - size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle. - else - size.x += g.Style.FramePadding.x + 1.0f; - return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y); -} - -void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col) -{ - // While rendering tabs, we trim 1 pixel off the top of our bounding box so they can fit within a regular frame height while looking "detached" from it. - ImGuiContext& g = *GImGui; - const float width = bb.GetWidth(); - IM_UNUSED(flags); - IM_ASSERT(width > 0.0f); - const float rounding = ImMax(0.0f, ImMin(g.Style.TabRounding, width * 0.5f - 1.0f)); - const float y1 = bb.Min.y + 1.0f; - const float y2 = bb.Max.y - 1.0f; - draw_list->PathLineTo(ImVec2(bb.Min.x, y2)); - draw_list->PathArcToFast(ImVec2(bb.Min.x + rounding, y1 + rounding), rounding, 6, 9); - draw_list->PathArcToFast(ImVec2(bb.Max.x - rounding, y1 + rounding), rounding, 9, 12); - draw_list->PathLineTo(ImVec2(bb.Max.x, y2)); - draw_list->PathFillConvex(col); - if (g.Style.TabBorderSize > 0.0f) - { - draw_list->PathLineTo(ImVec2(bb.Min.x + 0.5f, y2)); - draw_list->PathArcToFast(ImVec2(bb.Min.x + rounding + 0.5f, y1 + rounding + 0.5f), rounding, 6, 9); - draw_list->PathArcToFast(ImVec2(bb.Max.x - rounding - 0.5f, y1 + rounding + 0.5f), rounding, 9, 12); - draw_list->PathLineTo(ImVec2(bb.Max.x - 0.5f, y2)); - draw_list->PathStroke(GetColorU32(ImGuiCol_Border), false, g.Style.TabBorderSize); - } -} - -// Render text label (with custom clipping) + Unsaved Document marker + Close Button logic -// We tend to lock style.FramePadding for a given tab-bar, hence the 'frame_padding' parameter. -bool ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id) -{ - ImGuiContext& g = *GImGui; - ImVec2 label_size = CalcTextSize(label, NULL, true); - if (bb.GetWidth() <= 1.0f) - return false; - - // Render text label (with clipping + alpha gradient) + unsaved marker - const char* TAB_UNSAVED_MARKER = "*"; - ImRect text_pixel_clip_bb(bb.Min.x + frame_padding.x, bb.Min.y + frame_padding.y, bb.Max.x - frame_padding.x, bb.Max.y); - if (flags & ImGuiTabItemFlags_UnsavedDocument) - { - text_pixel_clip_bb.Max.x -= CalcTextSize(TAB_UNSAVED_MARKER, NULL, false).x; - ImVec2 unsaved_marker_pos(ImMin(bb.Min.x + frame_padding.x + label_size.x + 2, text_pixel_clip_bb.Max.x), bb.Min.y + frame_padding.y + IM_FLOOR(-g.FontSize * 0.25f)); - RenderTextClippedEx(draw_list, unsaved_marker_pos, bb.Max - frame_padding, TAB_UNSAVED_MARKER, NULL, NULL); - } - ImRect text_ellipsis_clip_bb = text_pixel_clip_bb; - - // Close Button - // We are relying on a subtle and confusing distinction between 'hovered' and 'g.HoveredId' which happens because we are using ImGuiButtonFlags_AllowOverlapMode + SetItemAllowOverlap() - // 'hovered' will be true when hovering the Tab but NOT when hovering the close button - // 'g.HoveredId==id' will be true when hovering the Tab including when hovering the close button - // 'g.ActiveId==close_button_id' will be true when we are holding on the close button, in which case both hovered booleans are false - bool close_button_pressed = false; - bool close_button_visible = false; - if (close_button_id != 0) - if (g.HoveredId == tab_id || g.HoveredId == close_button_id || g.ActiveId == close_button_id) - close_button_visible = true; - if (close_button_visible) - { - ImGuiItemHoveredDataBackup last_item_backup; - const float close_button_sz = g.FontSize; - PushStyleVar(ImGuiStyleVar_FramePadding, frame_padding); - if (CloseButton(close_button_id, ImVec2(bb.Max.x - frame_padding.x * 2.0f - close_button_sz, bb.Min.y))) - close_button_pressed = true; - PopStyleVar(); - last_item_backup.Restore(); - - // Close with middle mouse button - if (!(flags & ImGuiTabItemFlags_NoCloseWithMiddleMouseButton) && IsMouseClicked(2)) - close_button_pressed = true; - - text_pixel_clip_bb.Max.x -= close_button_sz; - } - - float ellipsis_max_x = close_button_visible ? text_pixel_clip_bb.Max.x : bb.Max.x - 1.0f; - RenderTextEllipsis(draw_list, text_ellipsis_clip_bb.Min, text_ellipsis_clip_bb.Max, text_pixel_clip_bb.Max.x, ellipsis_max_x, label, NULL, &label_size); - - return close_button_pressed; -} - - -//------------------------------------------------------------------------- -// [SECTION] Widgets: Columns, BeginColumns, EndColumns, etc. -// In the current version, Columns are very weak. Needs to be replaced with a more full-featured system. -//------------------------------------------------------------------------- -// - GetColumnIndex() -// - GetColumnCount() -// - GetColumnOffset() -// - GetColumnWidth() -// - SetColumnOffset() -// - SetColumnWidth() -// - PushColumnClipRect() [Internal] -// - PushColumnsBackground() [Internal] -// - PopColumnsBackground() [Internal] -// - FindOrCreateColumns() [Internal] -// - GetColumnsID() [Internal] -// - BeginColumns() -// - NextColumn() -// - EndColumns() -// - Columns() -//------------------------------------------------------------------------- - -int ImGui::GetColumnIndex() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CurrentColumns ? window->DC.CurrentColumns->Current : 0; -} - -int ImGui::GetColumnsCount() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - return window->DC.CurrentColumns ? window->DC.CurrentColumns->Count : 1; -} - -float ImGui::GetColumnOffsetFromNorm(const ImGuiColumns* columns, float offset_norm) -{ - return offset_norm * (columns->OffMaxX - columns->OffMinX); -} - -float ImGui::GetColumnNormFromOffset(const ImGuiColumns* columns, float offset) -{ - return offset / (columns->OffMaxX - columns->OffMinX); -} - -static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f; - -static float GetDraggedColumnOffset(ImGuiColumns* columns, int column_index) -{ - // Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing - // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning. - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. - IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); - - float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x; - x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); - if ((columns->Flags & ImGuiColumnsFlags_NoPreserveWidths)) - x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); - - return x; -} - -float ImGui::GetColumnOffset(int column_index) -{ - ImGuiWindow* window = GetCurrentWindowRead(); - ImGuiColumns* columns = window->DC.CurrentColumns; - if (columns == NULL) - return 0.0f; - - if (column_index < 0) - column_index = columns->Current; - IM_ASSERT(column_index < columns->Columns.Size); - - const float t = columns->Columns[column_index].OffsetNorm; - const float x_offset = ImLerp(columns->OffMinX, columns->OffMaxX, t); - return x_offset; -} - -static float GetColumnWidthEx(ImGuiColumns* columns, int column_index, bool before_resize = false) -{ - if (column_index < 0) - column_index = columns->Current; - - float offset_norm; - if (before_resize) - offset_norm = columns->Columns[column_index + 1].OffsetNormBeforeResize - columns->Columns[column_index].OffsetNormBeforeResize; - else - offset_norm = columns->Columns[column_index + 1].OffsetNorm - columns->Columns[column_index].OffsetNorm; - return ImGui::GetColumnOffsetFromNorm(columns, offset_norm); -} - -float ImGui::GetColumnWidth(int column_index) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImGuiColumns* columns = window->DC.CurrentColumns; - if (columns == NULL) - return GetContentRegionAvail().x; - - if (column_index < 0) - column_index = columns->Current; - return GetColumnOffsetFromNorm(columns, columns->Columns[column_index + 1].OffsetNorm - columns->Columns[column_index].OffsetNorm); -} - -void ImGui::SetColumnOffset(int column_index, float offset) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImGuiColumns* columns = window->DC.CurrentColumns; - IM_ASSERT(columns != NULL); - - if (column_index < 0) - column_index = columns->Current; - IM_ASSERT(column_index < columns->Columns.Size); - - const bool preserve_width = !(columns->Flags & ImGuiColumnsFlags_NoPreserveWidths) && (column_index < columns->Count-1); - const float width = preserve_width ? GetColumnWidthEx(columns, column_index, columns->IsBeingResized) : 0.0f; - - if (!(columns->Flags & ImGuiColumnsFlags_NoForceWithinWindow)) - offset = ImMin(offset, columns->OffMaxX - g.Style.ColumnsMinSpacing * (columns->Count - column_index)); - columns->Columns[column_index].OffsetNorm = GetColumnNormFromOffset(columns, offset - columns->OffMinX); - - if (preserve_width) - SetColumnOffset(column_index + 1, offset + ImMax(g.Style.ColumnsMinSpacing, width)); -} - -void ImGui::SetColumnWidth(int column_index, float width) -{ - ImGuiWindow* window = GetCurrentWindowRead(); - ImGuiColumns* columns = window->DC.CurrentColumns; - IM_ASSERT(columns != NULL); - - if (column_index < 0) - column_index = columns->Current; - SetColumnOffset(column_index + 1, GetColumnOffset(column_index) + width); -} - -void ImGui::PushColumnClipRect(int column_index) -{ - ImGuiWindow* window = GetCurrentWindowRead(); - ImGuiColumns* columns = window->DC.CurrentColumns; - if (column_index < 0) - column_index = columns->Current; - - ImGuiColumnData* column = &columns->Columns[column_index]; - PushClipRect(column->ClipRect.Min, column->ClipRect.Max, false); -} - -// Get into the columns background draw command (which is generally the same draw command as before we called BeginColumns) -void ImGui::PushColumnsBackground() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - ImGuiColumns* columns = window->DC.CurrentColumns; - if (columns->Count == 1) - return; - columns->Splitter.SetCurrentChannel(window->DrawList, 0); - int cmd_size = window->DrawList->CmdBuffer.Size; - PushClipRect(columns->HostClipRect.Min, columns->HostClipRect.Max, false); - IM_UNUSED(cmd_size); - IM_ASSERT(cmd_size == window->DrawList->CmdBuffer.Size); // Being in channel 0 this should not have created an ImDrawCmd -} - -void ImGui::PopColumnsBackground() -{ - ImGuiWindow* window = GetCurrentWindowRead(); - ImGuiColumns* columns = window->DC.CurrentColumns; - if (columns->Count == 1) - return; - columns->Splitter.SetCurrentChannel(window->DrawList, columns->Current + 1); - PopClipRect(); -} - -ImGuiColumns* ImGui::FindOrCreateColumns(ImGuiWindow* window, ImGuiID id) -{ - // We have few columns per window so for now we don't need bother much with turning this into a faster lookup. - for (int n = 0; n < window->ColumnsStorage.Size; n++) - if (window->ColumnsStorage[n].ID == id) - return &window->ColumnsStorage[n]; - - window->ColumnsStorage.push_back(ImGuiColumns()); - ImGuiColumns* columns = &window->ColumnsStorage.back(); - columns->ID = id; - return columns; -} - -ImGuiID ImGui::GetColumnsID(const char* str_id, int columns_count) -{ - ImGuiWindow* window = GetCurrentWindow(); - - // Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget. - // In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer. - PushID(0x11223347 + (str_id ? 0 : columns_count)); - ImGuiID id = window->GetID(str_id ? str_id : "columns"); - PopID(); - - return id; -} - -void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlags flags) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - - IM_ASSERT(columns_count >= 1); - IM_ASSERT(window->DC.CurrentColumns == NULL); // Nested columns are currently not supported - - // Acquire storage for the columns set - ImGuiID id = GetColumnsID(str_id, columns_count); - ImGuiColumns* columns = FindOrCreateColumns(window, id); - IM_ASSERT(columns->ID == id); - columns->Current = 0; - columns->Count = columns_count; - columns->Flags = flags; - window->DC.CurrentColumns = columns; - - columns->HostCursorPosY = window->DC.CursorPos.y; - columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x; - columns->HostClipRect = window->ClipRect; - columns->HostWorkRect = window->WorkRect; - - // Set state for first column - // We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect - const float column_padding = g.Style.ItemSpacing.x; - const float half_clip_extend_x = ImFloor(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize)); - const float max_1 = window->WorkRect.Max.x + column_padding - ImMax(column_padding - window->WindowPadding.x, 0.0f); - const float max_2 = window->WorkRect.Max.x + half_clip_extend_x; - columns->OffMinX = window->DC.Indent.x - column_padding + ImMax(column_padding - window->WindowPadding.x, 0.0f); - columns->OffMaxX = ImMax(ImMin(max_1, max_2) - window->Pos.x, columns->OffMinX + 1.0f); - columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y; - - // Clear data if columns count changed - if (columns->Columns.Size != 0 && columns->Columns.Size != columns_count + 1) - columns->Columns.resize(0); - - // Initialize default widths - columns->IsFirstFrame = (columns->Columns.Size == 0); - if (columns->Columns.Size == 0) - { - columns->Columns.reserve(columns_count + 1); - for (int n = 0; n < columns_count + 1; n++) - { - ImGuiColumnData column; - column.OffsetNorm = n / (float)columns_count; - columns->Columns.push_back(column); - } - } - - for (int n = 0; n < columns_count; n++) - { - // Compute clipping rectangle - ImGuiColumnData* column = &columns->Columns[n]; - float clip_x1 = IM_ROUND(window->Pos.x + GetColumnOffset(n)); - float clip_x2 = IM_ROUND(window->Pos.x + GetColumnOffset(n + 1) - 1.0f); - column->ClipRect = ImRect(clip_x1, -FLT_MAX, clip_x2, +FLT_MAX); - column->ClipRect.ClipWith(window->ClipRect); - } - - if (columns->Count > 1) - { - columns->Splitter.Split(window->DrawList, 1 + columns->Count); - columns->Splitter.SetCurrentChannel(window->DrawList, 1); - PushColumnClipRect(0); - } - - // We don't generally store Indent.x inside ColumnsOffset because it may be manipulated by the user. - float offset_0 = GetColumnOffset(columns->Current); - float offset_1 = GetColumnOffset(columns->Current + 1); - float width = offset_1 - offset_0; - PushItemWidth(width * 0.65f); - window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f); - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); - window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding; -} - -void ImGui::NextColumn() -{ - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems || window->DC.CurrentColumns == NULL) - return; - - ImGuiContext& g = *GImGui; - ImGuiColumns* columns = window->DC.CurrentColumns; - - if (columns->Count == 1) - { - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); - IM_ASSERT(columns->Current == 0); - return; - } - PopItemWidth(); - PopClipRect(); - - const float column_padding = g.Style.ItemSpacing.x; - columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); - if (++columns->Current < columns->Count) - { - // Columns 1+ ignore IndentX (by canceling it out) - // FIXME-COLUMNS: Unnecessary, could be locked? - window->DC.ColumnsOffset.x = GetColumnOffset(columns->Current) - window->DC.Indent.x + column_padding; - columns->Splitter.SetCurrentChannel(window->DrawList, columns->Current + 1); - } - else - { - // New row/line - // Column 0 honor IndentX - window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f); - columns->Splitter.SetCurrentChannel(window->DrawList, 1); - columns->Current = 0; - columns->LineMinY = columns->LineMaxY; - } - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); - window->DC.CursorPos.y = columns->LineMinY; - window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); - window->DC.CurrLineTextBaseOffset = 0.0f; - - PushColumnClipRect(columns->Current); // FIXME-COLUMNS: Could it be an overwrite? - - // FIXME-COLUMNS: Share code with BeginColumns() - move code on columns setup. - float offset_0 = GetColumnOffset(columns->Current); - float offset_1 = GetColumnOffset(columns->Current + 1); - float width = offset_1 - offset_0; - PushItemWidth(width * 0.65f); - window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding; -} - -void ImGui::EndColumns() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - ImGuiColumns* columns = window->DC.CurrentColumns; - IM_ASSERT(columns != NULL); - - PopItemWidth(); - if (columns->Count > 1) - { - PopClipRect(); - columns->Splitter.Merge(window->DrawList); - } - - const ImGuiColumnsFlags flags = columns->Flags; - columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); - window->DC.CursorPos.y = columns->LineMaxY; - if (!(flags & ImGuiColumnsFlags_GrowParentContentsSize)) - window->DC.CursorMaxPos.x = columns->HostCursorMaxPosX; // Restore cursor max pos, as columns don't grow parent - - // Draw columns borders and handle resize - // The IsBeingResized flag ensure we preserve pre-resize columns width so back-and-forth are not lossy - bool is_being_resized = false; - if (!(flags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems) - { - // We clip Y boundaries CPU side because very long triangles are mishandled by some GPU drivers. - const float y1 = ImMax(columns->HostCursorPosY, window->ClipRect.Min.y); - const float y2 = ImMin(window->DC.CursorPos.y, window->ClipRect.Max.y); - int dragging_column = -1; - for (int n = 1; n < columns->Count; n++) - { - ImGuiColumnData* column = &columns->Columns[n]; - float x = window->Pos.x + GetColumnOffset(n); - const ImGuiID column_id = columns->ID + ImGuiID(n); - const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH; - const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2)); - KeepAliveID(column_id); - if (IsClippedEx(column_hit_rect, column_id, false)) - continue; - - bool hovered = false, held = false; - if (!(flags & ImGuiColumnsFlags_NoResize)) - { - ButtonBehavior(column_hit_rect, column_id, &hovered, &held); - if (hovered || held) - g.MouseCursor = ImGuiMouseCursor_ResizeEW; - if (held && !(column->Flags & ImGuiColumnsFlags_NoResize)) - dragging_column = n; - } - - // Draw column - const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); - const float xi = IM_FLOOR(x); - window->DrawList->AddLine(ImVec2(xi, y1 + 1.0f), ImVec2(xi, y2), col); - } - - // Apply dragging after drawing the column lines, so our rendered lines are in sync with how items were displayed during the frame. - if (dragging_column != -1) - { - if (!columns->IsBeingResized) - for (int n = 0; n < columns->Count + 1; n++) - columns->Columns[n].OffsetNormBeforeResize = columns->Columns[n].OffsetNorm; - columns->IsBeingResized = is_being_resized = true; - float x = GetDraggedColumnOffset(columns, dragging_column); - SetColumnOffset(dragging_column, x); - } - } - columns->IsBeingResized = is_being_resized; - - window->WorkRect = columns->HostWorkRect; - window->DC.CurrentColumns = NULL; - window->DC.ColumnsOffset.x = 0.0f; - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); -} - -// [2018-03: This is currently the only public API, while we are working on making BeginColumns/EndColumns user-facing] -void ImGui::Columns(int columns_count, const char* id, bool border) -{ - ImGuiWindow* window = GetCurrentWindow(); - IM_ASSERT(columns_count >= 1); - - ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder); - //flags |= ImGuiColumnsFlags_NoPreserveWidths; // NB: Legacy behavior - ImGuiColumns* columns = window->DC.CurrentColumns; - if (columns != NULL && columns->Count == columns_count && columns->Flags == flags) - return; - - if (columns != NULL) - EndColumns(); - - if (columns_count != 1) - BeginColumns(id, columns_count, flags); -} - -//------------------------------------------------------------------------- - -#endif // #ifndef IMGUI_DISABLE diff --git a/include/imgui/imstb_rectpack.h b/include/imgui/imstb_rectpack.h deleted file mode 100644 index ff2a85df..00000000 --- a/include/imgui/imstb_rectpack.h +++ /dev/null @@ -1,639 +0,0 @@ -// [DEAR IMGUI] -// This is a slightly modified version of stb_rect_pack.h 1.00. -// Those changes would need to be pushed into nothings/stb: -// - Added STBRP__CDECL -// Grep for [DEAR IMGUI] to find the changes. - -// stb_rect_pack.h - v1.00 - public domain - rectangle packing -// Sean Barrett 2014 -// -// Useful for e.g. packing rectangular textures into an atlas. -// Does not do rotation. -// -// Not necessarily the awesomest packing method, but better than -// the totally naive one in stb_truetype (which is primarily what -// this is meant to replace). -// -// Has only had a few tests run, may have issues. -// -// More docs to come. -// -// No memory allocations; uses qsort() and assert() from stdlib. -// Can override those by defining STBRP_SORT and STBRP_ASSERT. -// -// This library currently uses the Skyline Bottom-Left algorithm. -// -// Please note: better rectangle packers are welcome! Please -// implement them to the same API, but with a different init -// function. -// -// Credits -// -// Library -// Sean Barrett -// Minor features -// Martins Mozeiko -// github:IntellectualKitty -// -// Bugfixes / warning fixes -// Jeremy Jaussaud -// Fabian Giesen -// -// Version history: -// -// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles -// 0.99 (2019-02-07) warning fixes -// 0.11 (2017-03-03) return packing success/fail result -// 0.10 (2016-10-25) remove cast-away-const to avoid warnings -// 0.09 (2016-08-27) fix compiler warnings -// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) -// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) -// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort -// 0.05: added STBRP_ASSERT to allow replacing assert -// 0.04: fixed minor bug in STBRP_LARGE_RECTS support -// 0.01: initial release -// -// LICENSE -// -// See end of file for license information. - -////////////////////////////////////////////////////////////////////////////// -// -// INCLUDE SECTION -// - -#ifndef STB_INCLUDE_STB_RECT_PACK_H -#define STB_INCLUDE_STB_RECT_PACK_H - -#define STB_RECT_PACK_VERSION 1 - -#ifdef STBRP_STATIC -#define STBRP_DEF static -#else -#define STBRP_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct stbrp_context stbrp_context; -typedef struct stbrp_node stbrp_node; -typedef struct stbrp_rect stbrp_rect; - -#ifdef STBRP_LARGE_RECTS -typedef int stbrp_coord; -#else -typedef unsigned short stbrp_coord; -#endif - -STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); -// Assign packed locations to rectangles. The rectangles are of type -// 'stbrp_rect' defined below, stored in the array 'rects', and there -// are 'num_rects' many of them. -// -// Rectangles which are successfully packed have the 'was_packed' flag -// set to a non-zero value and 'x' and 'y' store the minimum location -// on each axis (i.e. bottom-left in cartesian coordinates, top-left -// if you imagine y increasing downwards). Rectangles which do not fit -// have the 'was_packed' flag set to 0. -// -// You should not try to access the 'rects' array from another thread -// while this function is running, as the function temporarily reorders -// the array while it executes. -// -// To pack into another rectangle, you need to call stbrp_init_target -// again. To continue packing into the same rectangle, you can call -// this function again. Calling this multiple times with multiple rect -// arrays will probably produce worse packing results than calling it -// a single time with the full rectangle array, but the option is -// available. -// -// The function returns 1 if all of the rectangles were successfully -// packed and 0 otherwise. - -struct stbrp_rect -{ - // reserved for your use: - int id; - - // input: - stbrp_coord w, h; - - // output: - stbrp_coord x, y; - int was_packed; // non-zero if valid packing - -}; // 16 bytes, nominally - - -STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); -// Initialize a rectangle packer to: -// pack a rectangle that is 'width' by 'height' in dimensions -// using temporary storage provided by the array 'nodes', which is 'num_nodes' long -// -// You must call this function every time you start packing into a new target. -// -// There is no "shutdown" function. The 'nodes' memory must stay valid for -// the following stbrp_pack_rects() call (or calls), but can be freed after -// the call (or calls) finish. -// -// Note: to guarantee best results, either: -// 1. make sure 'num_nodes' >= 'width' -// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' -// -// If you don't do either of the above things, widths will be quantized to multiples -// of small integers to guarantee the algorithm doesn't run out of temporary storage. -// -// If you do #2, then the non-quantized algorithm will be used, but the algorithm -// may run out of temporary storage and be unable to pack some rectangles. - -STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem); -// Optionally call this function after init but before doing any packing to -// change the handling of the out-of-temp-memory scenario, described above. -// If you call init again, this will be reset to the default (false). - - -STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic); -// Optionally select which packing heuristic the library should use. Different -// heuristics will produce better/worse results for different data sets. -// If you call init again, this will be reset to the default. - -enum -{ - STBRP_HEURISTIC_Skyline_default=0, - STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, - STBRP_HEURISTIC_Skyline_BF_sortHeight -}; - - -////////////////////////////////////////////////////////////////////////////// -// -// the details of the following structures don't matter to you, but they must -// be visible so you can handle the memory allocations for them - -struct stbrp_node -{ - stbrp_coord x,y; - stbrp_node *next; -}; - -struct stbrp_context -{ - int width; - int height; - int align; - int init_mode; - int heuristic; - int num_nodes; - stbrp_node *active_head; - stbrp_node *free_head; - stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' -}; - -#ifdef __cplusplus -} -#endif - -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// IMPLEMENTATION SECTION -// - -#ifdef STB_RECT_PACK_IMPLEMENTATION -#ifndef STBRP_SORT -#include -#define STBRP_SORT qsort -#endif - -#ifndef STBRP_ASSERT -#include -#define STBRP_ASSERT assert -#endif - -// [DEAR IMGUI] Added STBRP__CDECL -#ifdef _MSC_VER -#define STBRP__NOTUSED(v) (void)(v) -#define STBRP__CDECL __cdecl -#else -#define STBRP__NOTUSED(v) (void)sizeof(v) -#define STBRP__CDECL -#endif - -enum -{ - STBRP__INIT_skyline = 1 -}; - -STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) -{ - switch (context->init_mode) { - case STBRP__INIT_skyline: - STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); - context->heuristic = heuristic; - break; - default: - STBRP_ASSERT(0); - } -} - -STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) -{ - if (allow_out_of_mem) - // if it's ok to run out of memory, then don't bother aligning them; - // this gives better packing, but may fail due to OOM (even though - // the rectangles easily fit). @TODO a smarter approach would be to only - // quantize once we've hit OOM, then we could get rid of this parameter. - context->align = 1; - else { - // if it's not ok to run out of memory, then quantize the widths - // so that num_nodes is always enough nodes. - // - // I.e. num_nodes * align >= width - // align >= width / num_nodes - // align = ceil(width/num_nodes) - - context->align = (context->width + context->num_nodes-1) / context->num_nodes; - } -} - -STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) -{ - int i; -#ifndef STBRP_LARGE_RECTS - STBRP_ASSERT(width <= 0xffff && height <= 0xffff); -#endif - - for (i=0; i < num_nodes-1; ++i) - nodes[i].next = &nodes[i+1]; - nodes[i].next = NULL; - context->init_mode = STBRP__INIT_skyline; - context->heuristic = STBRP_HEURISTIC_Skyline_default; - context->free_head = &nodes[0]; - context->active_head = &context->extra[0]; - context->width = width; - context->height = height; - context->num_nodes = num_nodes; - stbrp_setup_allow_out_of_mem(context, 0); - - // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) - context->extra[0].x = 0; - context->extra[0].y = 0; - context->extra[0].next = &context->extra[1]; - context->extra[1].x = (stbrp_coord) width; -#ifdef STBRP_LARGE_RECTS - context->extra[1].y = (1<<30); -#else - context->extra[1].y = 65535; -#endif - context->extra[1].next = NULL; -} - -// find minimum y position if it starts at x1 -static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) -{ - stbrp_node *node = first; - int x1 = x0 + width; - int min_y, visited_width, waste_area; - - STBRP__NOTUSED(c); - - STBRP_ASSERT(first->x <= x0); - - #if 0 - // skip in case we're past the node - while (node->next->x <= x0) - ++node; - #else - STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency - #endif - - STBRP_ASSERT(node->x <= x0); - - min_y = 0; - waste_area = 0; - visited_width = 0; - while (node->x < x1) { - if (node->y > min_y) { - // raise min_y higher. - // we've accounted for all waste up to min_y, - // but we'll now add more waste for everything we've visted - waste_area += visited_width * (node->y - min_y); - min_y = node->y; - // the first time through, visited_width might be reduced - if (node->x < x0) - visited_width += node->next->x - x0; - else - visited_width += node->next->x - node->x; - } else { - // add waste area - int under_width = node->next->x - node->x; - if (under_width + visited_width > width) - under_width = width - visited_width; - waste_area += under_width * (min_y - node->y); - visited_width += under_width; - } - node = node->next; - } - - *pwaste = waste_area; - return min_y; -} - -typedef struct -{ - int x,y; - stbrp_node **prev_link; -} stbrp__findresult; - -static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) -{ - int best_waste = (1<<30), best_x, best_y = (1 << 30); - stbrp__findresult fr; - stbrp_node **prev, *node, *tail, **best = NULL; - - // align to multiple of c->align - width = (width + c->align - 1); - width -= width % c->align; - STBRP_ASSERT(width % c->align == 0); - - // if it can't possibly fit, bail immediately - if (width > c->width || height > c->height) { - fr.prev_link = NULL; - fr.x = fr.y = 0; - return fr; - } - - node = c->active_head; - prev = &c->active_head; - while (node->x + width <= c->width) { - int y,waste; - y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); - if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL - // bottom left - if (y < best_y) { - best_y = y; - best = prev; - } - } else { - // best-fit - if (y + height <= c->height) { - // can only use it if it first vertically - if (y < best_y || (y == best_y && waste < best_waste)) { - best_y = y; - best_waste = waste; - best = prev; - } - } - } - prev = &node->next; - node = node->next; - } - - best_x = (best == NULL) ? 0 : (*best)->x; - - // if doing best-fit (BF), we also have to try aligning right edge to each node position - // - // e.g, if fitting - // - // ____________________ - // |____________________| - // - // into - // - // | | - // | ____________| - // |____________| - // - // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned - // - // This makes BF take about 2x the time - - if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { - tail = c->active_head; - node = c->active_head; - prev = &c->active_head; - // find first node that's admissible - while (tail->x < width) - tail = tail->next; - while (tail) { - int xpos = tail->x - width; - int y,waste; - STBRP_ASSERT(xpos >= 0); - // find the left position that matches this - while (node->next->x <= xpos) { - prev = &node->next; - node = node->next; - } - STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); - y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); - if (y + height <= c->height) { - if (y <= best_y) { - if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { - best_x = xpos; - STBRP_ASSERT(y <= best_y); - best_y = y; - best_waste = waste; - best = prev; - } - } - } - tail = tail->next; - } - } - - fr.prev_link = best; - fr.x = best_x; - fr.y = best_y; - return fr; -} - -static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) -{ - // find best position according to heuristic - stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); - stbrp_node *node, *cur; - - // bail if: - // 1. it failed - // 2. the best node doesn't fit (we don't always check this) - // 3. we're out of memory - if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { - res.prev_link = NULL; - return res; - } - - // on success, create new node - node = context->free_head; - node->x = (stbrp_coord) res.x; - node->y = (stbrp_coord) (res.y + height); - - context->free_head = node->next; - - // insert the new node into the right starting point, and - // let 'cur' point to the remaining nodes needing to be - // stiched back in - - cur = *res.prev_link; - if (cur->x < res.x) { - // preserve the existing one, so start testing with the next one - stbrp_node *next = cur->next; - cur->next = node; - cur = next; - } else { - *res.prev_link = node; - } - - // from here, traverse cur and free the nodes, until we get to one - // that shouldn't be freed - while (cur->next && cur->next->x <= res.x + width) { - stbrp_node *next = cur->next; - // move the current node to the free list - cur->next = context->free_head; - context->free_head = cur; - cur = next; - } - - // stitch the list back in - node->next = cur; - - if (cur->x < res.x + width) - cur->x = (stbrp_coord) (res.x + width); - -#ifdef _DEBUG - cur = context->active_head; - while (cur->x < context->width) { - STBRP_ASSERT(cur->x < cur->next->x); - cur = cur->next; - } - STBRP_ASSERT(cur->next == NULL); - - { - int count=0; - cur = context->active_head; - while (cur) { - cur = cur->next; - ++count; - } - cur = context->free_head; - while (cur) { - cur = cur->next; - ++count; - } - STBRP_ASSERT(count == context->num_nodes+2); - } -#endif - - return res; -} - -// [DEAR IMGUI] Added STBRP__CDECL -static int STBRP__CDECL rect_height_compare(const void *a, const void *b) -{ - const stbrp_rect *p = (const stbrp_rect *) a; - const stbrp_rect *q = (const stbrp_rect *) b; - if (p->h > q->h) - return -1; - if (p->h < q->h) - return 1; - return (p->w > q->w) ? -1 : (p->w < q->w); -} - -// [DEAR IMGUI] Added STBRP__CDECL -static int STBRP__CDECL rect_original_order(const void *a, const void *b) -{ - const stbrp_rect *p = (const stbrp_rect *) a; - const stbrp_rect *q = (const stbrp_rect *) b; - return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); -} - -#ifdef STBRP_LARGE_RECTS -#define STBRP__MAXVAL 0xffffffff -#else -#define STBRP__MAXVAL 0xffff -#endif - -STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) -{ - int i, all_rects_packed = 1; - - // we use the 'was_packed' field internally to allow sorting/unsorting - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = i; - } - - // sort according to heuristic - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); - - for (i=0; i < num_rects; ++i) { - if (rects[i].w == 0 || rects[i].h == 0) { - rects[i].x = rects[i].y = 0; // empty rect needs no space - } else { - stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); - if (fr.prev_link) { - rects[i].x = (stbrp_coord) fr.x; - rects[i].y = (stbrp_coord) fr.y; - } else { - rects[i].x = rects[i].y = STBRP__MAXVAL; - } - } - } - - // unsort - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); - - // set was_packed flags and all_rects_packed status - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); - if (!rects[i].was_packed) - all_rects_packed = 0; - } - - // return the all_rects_packed status - return all_rects_packed; -} -#endif - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/include/imgui/imstb_textedit.h b/include/imgui/imstb_textedit.h deleted file mode 100644 index 2077d02a..00000000 --- a/include/imgui/imstb_textedit.h +++ /dev/null @@ -1,1417 +0,0 @@ -// [DEAR IMGUI] -// This is a slightly modified version of stb_textedit.h 1.13. -// Those changes would need to be pushed into nothings/stb: -// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321) -// Grep for [DEAR IMGUI] to find the changes. - -// stb_textedit.h - v1.13 - public domain - Sean Barrett -// Development of this library was sponsored by RAD Game Tools -// -// This C header file implements the guts of a multi-line text-editing -// widget; you implement display, word-wrapping, and low-level string -// insertion/deletion, and stb_textedit will map user inputs into -// insertions & deletions, plus updates to the cursor position, -// selection state, and undo state. -// -// It is intended for use in games and other systems that need to build -// their own custom widgets and which do not have heavy text-editing -// requirements (this library is not recommended for use for editing large -// texts, as its performance does not scale and it has limited undo). -// -// Non-trivial behaviors are modelled after Windows text controls. -// -// -// LICENSE -// -// See end of file for license information. -// -// -// DEPENDENCIES -// -// Uses the C runtime function 'memmove', which you can override -// by defining STB_TEXTEDIT_memmove before the implementation. -// Uses no other functions. Performs no runtime allocations. -// -// -// VERSION HISTORY -// -// 1.13 (2019-02-07) fix bug in undo size management -// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash -// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield -// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual -// 1.9 (2016-08-27) customizable move-by-word -// 1.8 (2016-04-02) better keyboard handling when mouse button is down -// 1.7 (2015-09-13) change y range handling in case baseline is non-0 -// 1.6 (2015-04-15) allow STB_TEXTEDIT_memmove -// 1.5 (2014-09-10) add support for secondary keys for OS X -// 1.4 (2014-08-17) fix signed/unsigned warnings -// 1.3 (2014-06-19) fix mouse clicking to round to nearest char boundary -// 1.2 (2014-05-27) fix some RAD types that had crept into the new code -// 1.1 (2013-12-15) move-by-word (requires STB_TEXTEDIT_IS_SPACE ) -// 1.0 (2012-07-26) improve documentation, initial public release -// 0.3 (2012-02-24) bugfixes, single-line mode; insert mode -// 0.2 (2011-11-28) fixes to undo/redo -// 0.1 (2010-07-08) initial version -// -// ADDITIONAL CONTRIBUTORS -// -// Ulf Winklemann: move-by-word in 1.1 -// Fabian Giesen: secondary key inputs in 1.5 -// Martins Mozeiko: STB_TEXTEDIT_memmove in 1.6 -// -// Bugfixes: -// Scott Graham -// Daniel Keller -// Omar Cornut -// Dan Thompson -// -// USAGE -// -// This file behaves differently depending on what symbols you define -// before including it. -// -// -// Header-file mode: -// -// If you do not define STB_TEXTEDIT_IMPLEMENTATION before including this, -// it will operate in "header file" mode. In this mode, it declares a -// single public symbol, STB_TexteditState, which encapsulates the current -// state of a text widget (except for the string, which you will store -// separately). -// -// To compile in this mode, you must define STB_TEXTEDIT_CHARTYPE to a -// primitive type that defines a single character (e.g. char, wchar_t, etc). -// -// To save space or increase undo-ability, you can optionally define the -// following things that are used by the undo system: -// -// STB_TEXTEDIT_POSITIONTYPE small int type encoding a valid cursor position -// STB_TEXTEDIT_UNDOSTATECOUNT the number of undo states to allow -// STB_TEXTEDIT_UNDOCHARCOUNT the number of characters to store in the undo buffer -// -// If you don't define these, they are set to permissive types and -// moderate sizes. The undo system does no memory allocations, so -// it grows STB_TexteditState by the worst-case storage which is (in bytes): -// -// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATE_COUNT -// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHAR_COUNT -// -// -// Implementation mode: -// -// If you define STB_TEXTEDIT_IMPLEMENTATION before including this, it -// will compile the implementation of the text edit widget, depending -// on a large number of symbols which must be defined before the include. -// -// The implementation is defined only as static functions. You will then -// need to provide your own APIs in the same file which will access the -// static functions. -// -// The basic concept is that you provide a "string" object which -// behaves like an array of characters. stb_textedit uses indices to -// refer to positions in the string, implicitly representing positions -// in the displayed textedit. This is true for both plain text and -// rich text; even with rich text stb_truetype interacts with your -// code as if there was an array of all the displayed characters. -// -// Symbols that must be the same in header-file and implementation mode: -// -// STB_TEXTEDIT_CHARTYPE the character type -// STB_TEXTEDIT_POSITIONTYPE small type that is a valid cursor position -// STB_TEXTEDIT_UNDOSTATECOUNT the number of undo states to allow -// STB_TEXTEDIT_UNDOCHARCOUNT the number of characters to store in the undo buffer -// -// Symbols you must define for implementation mode: -// -// STB_TEXTEDIT_STRING the type of object representing a string being edited, -// typically this is a wrapper object with other data you need -// -// STB_TEXTEDIT_STRINGLEN(obj) the length of the string (ideally O(1)) -// STB_TEXTEDIT_LAYOUTROW(&r,obj,n) returns the results of laying out a line of characters -// starting from character #n (see discussion below) -// STB_TEXTEDIT_GETWIDTH(obj,n,i) returns the pixel delta from the xpos of the i'th character -// to the xpos of the i+1'th char for a line of characters -// starting at character #n (i.e. accounts for kerning -// with previous char) -// STB_TEXTEDIT_KEYTOTEXT(k) maps a keyboard input to an insertable character -// (return type is int, -1 means not valid to insert) -// STB_TEXTEDIT_GETCHAR(obj,i) returns the i'th character of obj, 0-based -// STB_TEXTEDIT_NEWLINE the character returned by _GETCHAR() we recognize -// as manually wordwrapping for end-of-line positioning -// -// STB_TEXTEDIT_DELETECHARS(obj,i,n) delete n characters starting at i -// STB_TEXTEDIT_INSERTCHARS(obj,i,c*,n) insert n characters at i (pointed to by STB_TEXTEDIT_CHARTYPE*) -// -// STB_TEXTEDIT_K_SHIFT a power of two that is or'd in to a keyboard input to represent the shift key -// -// STB_TEXTEDIT_K_LEFT keyboard input to move cursor left -// STB_TEXTEDIT_K_RIGHT keyboard input to move cursor right -// STB_TEXTEDIT_K_UP keyboard input to move cursor up -// STB_TEXTEDIT_K_DOWN keyboard input to move cursor down -// STB_TEXTEDIT_K_LINESTART keyboard input to move cursor to start of line // e.g. HOME -// STB_TEXTEDIT_K_LINEEND keyboard input to move cursor to end of line // e.g. END -// STB_TEXTEDIT_K_TEXTSTART keyboard input to move cursor to start of text // e.g. ctrl-HOME -// STB_TEXTEDIT_K_TEXTEND keyboard input to move cursor to end of text // e.g. ctrl-END -// STB_TEXTEDIT_K_DELETE keyboard input to delete selection or character under cursor -// STB_TEXTEDIT_K_BACKSPACE keyboard input to delete selection or character left of cursor -// STB_TEXTEDIT_K_UNDO keyboard input to perform undo -// STB_TEXTEDIT_K_REDO keyboard input to perform redo -// -// Optional: -// STB_TEXTEDIT_K_INSERT keyboard input to toggle insert mode -// STB_TEXTEDIT_IS_SPACE(ch) true if character is whitespace (e.g. 'isspace'), -// required for default WORDLEFT/WORDRIGHT handlers -// STB_TEXTEDIT_MOVEWORDLEFT(obj,i) custom handler for WORDLEFT, returns index to move cursor to -// STB_TEXTEDIT_MOVEWORDRIGHT(obj,i) custom handler for WORDRIGHT, returns index to move cursor to -// STB_TEXTEDIT_K_WORDLEFT keyboard input to move cursor left one word // e.g. ctrl-LEFT -// STB_TEXTEDIT_K_WORDRIGHT keyboard input to move cursor right one word // e.g. ctrl-RIGHT -// STB_TEXTEDIT_K_LINESTART2 secondary keyboard input to move cursor to start of line -// STB_TEXTEDIT_K_LINEEND2 secondary keyboard input to move cursor to end of line -// STB_TEXTEDIT_K_TEXTSTART2 secondary keyboard input to move cursor to start of text -// STB_TEXTEDIT_K_TEXTEND2 secondary keyboard input to move cursor to end of text -// -// Todo: -// STB_TEXTEDIT_K_PGUP keyboard input to move cursor up a page -// STB_TEXTEDIT_K_PGDOWN keyboard input to move cursor down a page -// -// Keyboard input must be encoded as a single integer value; e.g. a character code -// and some bitflags that represent shift states. to simplify the interface, SHIFT must -// be a bitflag, so we can test the shifted state of cursor movements to allow selection, -// i.e. (STB_TEXTED_K_RIGHT|STB_TEXTEDIT_K_SHIFT) should be shifted right-arrow. -// -// You can encode other things, such as CONTROL or ALT, in additional bits, and -// then test for their presence in e.g. STB_TEXTEDIT_K_WORDLEFT. For example, -// my Windows implementations add an additional CONTROL bit, and an additional KEYDOWN -// bit. Then all of the STB_TEXTEDIT_K_ values bitwise-or in the KEYDOWN bit, -// and I pass both WM_KEYDOWN and WM_CHAR events to the "key" function in the -// API below. The control keys will only match WM_KEYDOWN events because of the -// keydown bit I add, and STB_TEXTEDIT_KEYTOTEXT only tests for the KEYDOWN -// bit so it only decodes WM_CHAR events. -// -// STB_TEXTEDIT_LAYOUTROW returns information about the shape of one displayed -// row of characters assuming they start on the i'th character--the width and -// the height and the number of characters consumed. This allows this library -// to traverse the entire layout incrementally. You need to compute word-wrapping -// here. -// -// Each textfield keeps its own insert mode state, which is not how normal -// applications work. To keep an app-wide insert mode, update/copy the -// "insert_mode" field of STB_TexteditState before/after calling API functions. -// -// API -// -// void stb_textedit_initialize_state(STB_TexteditState *state, int is_single_line) -// -// void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) -// void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) -// int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -// int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len) -// void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXEDIT_KEYTYPE key) -// -// Each of these functions potentially updates the string and updates the -// state. -// -// initialize_state: -// set the textedit state to a known good default state when initially -// constructing the textedit. -// -// click: -// call this with the mouse x,y on a mouse down; it will update the cursor -// and reset the selection start/end to the cursor point. the x,y must -// be relative to the text widget, with (0,0) being the top left. -// -// drag: -// call this with the mouse x,y on a mouse drag/up; it will update the -// cursor and the selection end point -// -// cut: -// call this to delete the current selection; returns true if there was -// one. you should FIRST copy the current selection to the system paste buffer. -// (To copy, just copy the current selection out of the string yourself.) -// -// paste: -// call this to paste text at the current cursor point or over the current -// selection if there is one. -// -// key: -// call this for keyboard inputs sent to the textfield. you can use it -// for "key down" events or for "translated" key events. if you need to -// do both (as in Win32), or distinguish Unicode characters from control -// inputs, set a high bit to distinguish the two; then you can define the -// various definitions like STB_TEXTEDIT_K_LEFT have the is-key-event bit -// set, and make STB_TEXTEDIT_KEYTOCHAR check that the is-key-event bit is -// clear. STB_TEXTEDIT_KEYTYPE defaults to int, but you can #define it to -// anything other type you wante before including. -// -// -// When rendering, you can read the cursor position and selection state from -// the STB_TexteditState. -// -// -// Notes: -// -// This is designed to be usable in IMGUI, so it allows for the possibility of -// running in an IMGUI that has NOT cached the multi-line layout. For this -// reason, it provides an interface that is compatible with computing the -// layout incrementally--we try to make sure we make as few passes through -// as possible. (For example, to locate the mouse pointer in the text, we -// could define functions that return the X and Y positions of characters -// and binary search Y and then X, but if we're doing dynamic layout this -// will run the layout algorithm many times, so instead we manually search -// forward in one pass. Similar logic applies to e.g. up-arrow and -// down-arrow movement.) -// -// If it's run in a widget that *has* cached the layout, then this is less -// efficient, but it's not horrible on modern computers. But you wouldn't -// want to edit million-line files with it. - - -//////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// -//// -//// Header-file mode -//// -//// - -#ifndef INCLUDE_STB_TEXTEDIT_H -#define INCLUDE_STB_TEXTEDIT_H - -//////////////////////////////////////////////////////////////////////// -// -// STB_TexteditState -// -// Definition of STB_TexteditState which you should store -// per-textfield; it includes cursor position, selection state, -// and undo state. -// - -#ifndef STB_TEXTEDIT_UNDOSTATECOUNT -#define STB_TEXTEDIT_UNDOSTATECOUNT 99 -#endif -#ifndef STB_TEXTEDIT_UNDOCHARCOUNT -#define STB_TEXTEDIT_UNDOCHARCOUNT 999 -#endif -#ifndef STB_TEXTEDIT_CHARTYPE -#define STB_TEXTEDIT_CHARTYPE int -#endif -#ifndef STB_TEXTEDIT_POSITIONTYPE -#define STB_TEXTEDIT_POSITIONTYPE int -#endif - -typedef struct -{ - // private data - STB_TEXTEDIT_POSITIONTYPE where; - STB_TEXTEDIT_POSITIONTYPE insert_length; - STB_TEXTEDIT_POSITIONTYPE delete_length; - int char_storage; -} StbUndoRecord; - -typedef struct -{ - // private data - StbUndoRecord undo_rec [STB_TEXTEDIT_UNDOSTATECOUNT]; - STB_TEXTEDIT_CHARTYPE undo_char[STB_TEXTEDIT_UNDOCHARCOUNT]; - short undo_point, redo_point; - int undo_char_point, redo_char_point; -} StbUndoState; - -typedef struct -{ - ///////////////////// - // - // public data - // - - int cursor; - // position of the text cursor within the string - - int select_start; // selection start point - int select_end; - // selection start and end point in characters; if equal, no selection. - // note that start may be less than or greater than end (e.g. when - // dragging the mouse, start is where the initial click was, and you - // can drag in either direction) - - unsigned char insert_mode; - // each textfield keeps its own insert mode state. to keep an app-wide - // insert mode, copy this value in/out of the app state - - ///////////////////// - // - // private data - // - unsigned char cursor_at_end_of_line; // not implemented yet - unsigned char initialized; - unsigned char has_preferred_x; - unsigned char single_line; - unsigned char padding1, padding2, padding3; - float preferred_x; // this determines where the cursor up/down tries to seek to along x - StbUndoState undostate; -} STB_TexteditState; - - -//////////////////////////////////////////////////////////////////////// -// -// StbTexteditRow -// -// Result of layout query, used by stb_textedit to determine where -// the text in each row is. - -// result of layout query -typedef struct -{ - float x0,x1; // starting x location, end x location (allows for align=right, etc) - float baseline_y_delta; // position of baseline relative to previous row's baseline - float ymin,ymax; // height of row above and below baseline - int num_chars; -} StbTexteditRow; -#endif //INCLUDE_STB_TEXTEDIT_H - - -//////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// -//// -//// Implementation mode -//// -//// - - -// implementation isn't include-guarded, since it might have indirectly -// included just the "header" portion -#ifdef STB_TEXTEDIT_IMPLEMENTATION - -#ifndef STB_TEXTEDIT_memmove -#include -#define STB_TEXTEDIT_memmove memmove -#endif - - -///////////////////////////////////////////////////////////////////////////// -// -// Mouse input handling -// - -// traverse the layout to locate the nearest character to a display position -static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y) -{ - StbTexteditRow r; - int n = STB_TEXTEDIT_STRINGLEN(str); - float base_y = 0, prev_x; - int i=0, k; - - r.x0 = r.x1 = 0; - r.ymin = r.ymax = 0; - r.num_chars = 0; - - // search rows to find one that straddles 'y' - while (i < n) { - STB_TEXTEDIT_LAYOUTROW(&r, str, i); - if (r.num_chars <= 0) - return n; - - if (i==0 && y < base_y + r.ymin) - return 0; - - if (y < base_y + r.ymax) - break; - - i += r.num_chars; - base_y += r.baseline_y_delta; - } - - // below all text, return 'after' last character - if (i >= n) - return n; - - // check if it's before the beginning of the line - if (x < r.x0) - return i; - - // check if it's before the end of the line - if (x < r.x1) { - // search characters in row for one that straddles 'x' - prev_x = r.x0; - for (k=0; k < r.num_chars; ++k) { - float w = STB_TEXTEDIT_GETWIDTH(str, i, k); - if (x < prev_x+w) { - if (x < prev_x+w/2) - return k+i; - else - return k+i+1; - } - prev_x += w; - } - // shouldn't happen, but if it does, fall through to end-of-line case - } - - // if the last character is a newline, return that. otherwise return 'after' the last character - if (STB_TEXTEDIT_GETCHAR(str, i+r.num_chars-1) == STB_TEXTEDIT_NEWLINE) - return i+r.num_chars-1; - else - return i+r.num_chars; -} - -// API click: on mouse down, move the cursor to the clicked location, and reset the selection -static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) -{ - // In single-line mode, just always make y = 0. This lets the drag keep working if the mouse - // goes off the top or bottom of the text - if( state->single_line ) - { - StbTexteditRow r; - STB_TEXTEDIT_LAYOUTROW(&r, str, 0); - y = r.ymin; - } - - state->cursor = stb_text_locate_coord(str, x, y); - state->select_start = state->cursor; - state->select_end = state->cursor; - state->has_preferred_x = 0; -} - -// API drag: on mouse drag, move the cursor and selection endpoint to the clicked location -static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) -{ - int p = 0; - - // In single-line mode, just always make y = 0. This lets the drag keep working if the mouse - // goes off the top or bottom of the text - if( state->single_line ) - { - StbTexteditRow r; - STB_TEXTEDIT_LAYOUTROW(&r, str, 0); - y = r.ymin; - } - - if (state->select_start == state->select_end) - state->select_start = state->cursor; - - p = stb_text_locate_coord(str, x, y); - state->cursor = state->select_end = p; -} - -///////////////////////////////////////////////////////////////////////////// -// -// Keyboard input handling -// - -// forward declarations -static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); -static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); -static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length); -static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length); -static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length); - -typedef struct -{ - float x,y; // position of n'th character - float height; // height of line - int first_char, length; // first char of row, and length - int prev_first; // first char of previous row -} StbFindState; - -// find the x/y location of a character, and remember info about the previous row in -// case we get a move-up event (for page up, we'll have to rescan) -static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *str, int n, int single_line) -{ - StbTexteditRow r; - int prev_start = 0; - int z = STB_TEXTEDIT_STRINGLEN(str); - int i=0, first; - - if (n == z) { - // if it's at the end, then find the last line -- simpler than trying to - // explicitly handle this case in the regular code - if (single_line) { - STB_TEXTEDIT_LAYOUTROW(&r, str, 0); - find->y = 0; - find->first_char = 0; - find->length = z; - find->height = r.ymax - r.ymin; - find->x = r.x1; - } else { - find->y = 0; - find->x = 0; - find->height = 1; - while (i < z) { - STB_TEXTEDIT_LAYOUTROW(&r, str, i); - prev_start = i; - i += r.num_chars; - } - find->first_char = i; - find->length = 0; - find->prev_first = prev_start; - } - return; - } - - // search rows to find the one that straddles character n - find->y = 0; - - for(;;) { - STB_TEXTEDIT_LAYOUTROW(&r, str, i); - if (n < i + r.num_chars) - break; - prev_start = i; - i += r.num_chars; - find->y += r.baseline_y_delta; - } - - find->first_char = first = i; - find->length = r.num_chars; - find->height = r.ymax - r.ymin; - find->prev_first = prev_start; - - // now scan to find xpos - find->x = r.x0; - for (i=0; first+i < n; ++i) - find->x += STB_TEXTEDIT_GETWIDTH(str, first, i); -} - -#define STB_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end) - -// make the selection/cursor state valid if client altered the string -static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - int n = STB_TEXTEDIT_STRINGLEN(str); - if (STB_TEXT_HAS_SELECTION(state)) { - if (state->select_start > n) state->select_start = n; - if (state->select_end > n) state->select_end = n; - // if clamping forced them to be equal, move the cursor to match - if (state->select_start == state->select_end) - state->cursor = state->select_start; - } - if (state->cursor > n) state->cursor = n; -} - -// delete characters while updating undo -static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len) -{ - stb_text_makeundo_delete(str, state, where, len); - STB_TEXTEDIT_DELETECHARS(str, where, len); - state->has_preferred_x = 0; -} - -// delete the section -static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - stb_textedit_clamp(str, state); - if (STB_TEXT_HAS_SELECTION(state)) { - if (state->select_start < state->select_end) { - stb_textedit_delete(str, state, state->select_start, state->select_end - state->select_start); - state->select_end = state->cursor = state->select_start; - } else { - stb_textedit_delete(str, state, state->select_end, state->select_start - state->select_end); - state->select_start = state->cursor = state->select_end; - } - state->has_preferred_x = 0; - } -} - -// canoncialize the selection so start <= end -static void stb_textedit_sortselection(STB_TexteditState *state) -{ - if (state->select_end < state->select_start) { - int temp = state->select_end; - state->select_end = state->select_start; - state->select_start = temp; - } -} - -// move cursor to first character of selection -static void stb_textedit_move_to_first(STB_TexteditState *state) -{ - if (STB_TEXT_HAS_SELECTION(state)) { - stb_textedit_sortselection(state); - state->cursor = state->select_start; - state->select_end = state->select_start; - state->has_preferred_x = 0; - } -} - -// move cursor to last character of selection -static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - if (STB_TEXT_HAS_SELECTION(state)) { - stb_textedit_sortselection(state); - stb_textedit_clamp(str, state); - state->cursor = state->select_end; - state->select_start = state->select_end; - state->has_preferred_x = 0; - } -} - -#ifdef STB_TEXTEDIT_IS_SPACE -static int is_word_boundary( STB_TEXTEDIT_STRING *str, int idx ) -{ - return idx > 0 ? (STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str,idx-1) ) && !STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str, idx) ) ) : 1; -} - -#ifndef STB_TEXTEDIT_MOVEWORDLEFT -static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c ) -{ - --c; // always move at least one character - while( c >= 0 && !is_word_boundary( str, c ) ) - --c; - - if( c < 0 ) - c = 0; - - return c; -} -#define STB_TEXTEDIT_MOVEWORDLEFT stb_textedit_move_to_word_previous -#endif - -#ifndef STB_TEXTEDIT_MOVEWORDRIGHT -static int stb_textedit_move_to_word_next( STB_TEXTEDIT_STRING *str, int c ) -{ - const int len = STB_TEXTEDIT_STRINGLEN(str); - ++c; // always move at least one character - while( c < len && !is_word_boundary( str, c ) ) - ++c; - - if( c > len ) - c = len; - - return c; -} -#define STB_TEXTEDIT_MOVEWORDRIGHT stb_textedit_move_to_word_next -#endif - -#endif - -// update selection and cursor to match each other -static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state) -{ - if (!STB_TEXT_HAS_SELECTION(state)) - state->select_start = state->select_end = state->cursor; - else - state->cursor = state->select_end; -} - -// API cut: delete selection -static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - if (STB_TEXT_HAS_SELECTION(state)) { - stb_textedit_delete_selection(str,state); // implicitly clamps - state->has_preferred_x = 0; - return 1; - } - return 0; -} - -// API paste: replace existing selection with passed-in text -static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len) -{ - // if there's a selection, the paste should delete it - stb_textedit_clamp(str, state); - stb_textedit_delete_selection(str,state); - // try to insert the characters - if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, len)) { - stb_text_makeundo_insert(state, state->cursor, len); - state->cursor += len; - state->has_preferred_x = 0; - return 1; - } - // remove the undo since we didn't actually insert the characters - if (state->undostate.undo_point) - --state->undostate.undo_point; - return 0; -} - -#ifndef STB_TEXTEDIT_KEYTYPE -#define STB_TEXTEDIT_KEYTYPE int -#endif - -// API key: process a keyboard input -static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key) -{ -retry: - switch (key) { - default: { - int c = STB_TEXTEDIT_KEYTOTEXT(key); - if (c > 0) { - STB_TEXTEDIT_CHARTYPE ch = (STB_TEXTEDIT_CHARTYPE) c; - - // can't add newline in single-line mode - if (c == '\n' && state->single_line) - break; - - if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) { - stb_text_makeundo_replace(str, state, state->cursor, 1, 1); - STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1); - if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { - ++state->cursor; - state->has_preferred_x = 0; - } - } else { - stb_textedit_delete_selection(str,state); // implicitly clamps - if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { - stb_text_makeundo_insert(state, state->cursor, 1); - ++state->cursor; - state->has_preferred_x = 0; - } - } - } - break; - } - -#ifdef STB_TEXTEDIT_K_INSERT - case STB_TEXTEDIT_K_INSERT: - state->insert_mode = !state->insert_mode; - break; -#endif - - case STB_TEXTEDIT_K_UNDO: - stb_text_undo(str, state); - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_REDO: - stb_text_redo(str, state); - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_LEFT: - // if currently there's a selection, move cursor to start of selection - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_first(state); - else - if (state->cursor > 0) - --state->cursor; - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_RIGHT: - // if currently there's a selection, move cursor to end of selection - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_last(str, state); - else - ++state->cursor; - stb_textedit_clamp(str, state); - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_LEFT | STB_TEXTEDIT_K_SHIFT: - stb_textedit_clamp(str, state); - stb_textedit_prep_selection_at_cursor(state); - // move selection left - if (state->select_end > 0) - --state->select_end; - state->cursor = state->select_end; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_MOVEWORDLEFT - case STB_TEXTEDIT_K_WORDLEFT: - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_first(state); - else { - state->cursor = STB_TEXTEDIT_MOVEWORDLEFT(str, state->cursor); - stb_textedit_clamp( str, state ); - } - break; - - case STB_TEXTEDIT_K_WORDLEFT | STB_TEXTEDIT_K_SHIFT: - if( !STB_TEXT_HAS_SELECTION( state ) ) - stb_textedit_prep_selection_at_cursor(state); - - state->cursor = STB_TEXTEDIT_MOVEWORDLEFT(str, state->cursor); - state->select_end = state->cursor; - - stb_textedit_clamp( str, state ); - break; -#endif - -#ifdef STB_TEXTEDIT_MOVEWORDRIGHT - case STB_TEXTEDIT_K_WORDRIGHT: - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_last(str, state); - else { - state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor); - stb_textedit_clamp( str, state ); - } - break; - - case STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT: - if( !STB_TEXT_HAS_SELECTION( state ) ) - stb_textedit_prep_selection_at_cursor(state); - - state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor); - state->select_end = state->cursor; - - stb_textedit_clamp( str, state ); - break; -#endif - - case STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT: - stb_textedit_prep_selection_at_cursor(state); - // move selection right - ++state->select_end; - stb_textedit_clamp(str, state); - state->cursor = state->select_end; - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_DOWN: - case STB_TEXTEDIT_K_DOWN | STB_TEXTEDIT_K_SHIFT: { - StbFindState find; - StbTexteditRow row; - int i, sel = (key & STB_TEXTEDIT_K_SHIFT) != 0; - - if (state->single_line) { - // on windows, up&down in single-line behave like left&right - key = STB_TEXTEDIT_K_RIGHT | (key & STB_TEXTEDIT_K_SHIFT); - goto retry; - } - - if (sel) - stb_textedit_prep_selection_at_cursor(state); - else if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_last(str,state); - - // compute current position of cursor point - stb_textedit_clamp(str, state); - stb_textedit_find_charpos(&find, str, state->cursor, state->single_line); - - // now find character position down a row - if (find.length) { - float goal_x = state->has_preferred_x ? state->preferred_x : find.x; - float x; - int start = find.first_char + find.length; - state->cursor = start; - STB_TEXTEDIT_LAYOUTROW(&row, str, state->cursor); - x = row.x0; - for (i=0; i < row.num_chars; ++i) { - float dx = STB_TEXTEDIT_GETWIDTH(str, start, i); - #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE - if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) - break; - #endif - x += dx; - if (x > goal_x) - break; - ++state->cursor; - } - stb_textedit_clamp(str, state); - - state->has_preferred_x = 1; - state->preferred_x = goal_x; - - if (sel) - state->select_end = state->cursor; - } - break; - } - - case STB_TEXTEDIT_K_UP: - case STB_TEXTEDIT_K_UP | STB_TEXTEDIT_K_SHIFT: { - StbFindState find; - StbTexteditRow row; - int i, sel = (key & STB_TEXTEDIT_K_SHIFT) != 0; - - if (state->single_line) { - // on windows, up&down become left&right - key = STB_TEXTEDIT_K_LEFT | (key & STB_TEXTEDIT_K_SHIFT); - goto retry; - } - - if (sel) - stb_textedit_prep_selection_at_cursor(state); - else if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_move_to_first(state); - - // compute current position of cursor point - stb_textedit_clamp(str, state); - stb_textedit_find_charpos(&find, str, state->cursor, state->single_line); - - // can only go up if there's a previous row - if (find.prev_first != find.first_char) { - // now find character position up a row - float goal_x = state->has_preferred_x ? state->preferred_x : find.x; - float x; - state->cursor = find.prev_first; - STB_TEXTEDIT_LAYOUTROW(&row, str, state->cursor); - x = row.x0; - for (i=0; i < row.num_chars; ++i) { - float dx = STB_TEXTEDIT_GETWIDTH(str, find.prev_first, i); - #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE - if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) - break; - #endif - x += dx; - if (x > goal_x) - break; - ++state->cursor; - } - stb_textedit_clamp(str, state); - - state->has_preferred_x = 1; - state->preferred_x = goal_x; - - if (sel) - state->select_end = state->cursor; - } - break; - } - - case STB_TEXTEDIT_K_DELETE: - case STB_TEXTEDIT_K_DELETE | STB_TEXTEDIT_K_SHIFT: - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_delete_selection(str, state); - else { - int n = STB_TEXTEDIT_STRINGLEN(str); - if (state->cursor < n) - stb_textedit_delete(str, state, state->cursor, 1); - } - state->has_preferred_x = 0; - break; - - case STB_TEXTEDIT_K_BACKSPACE: - case STB_TEXTEDIT_K_BACKSPACE | STB_TEXTEDIT_K_SHIFT: - if (STB_TEXT_HAS_SELECTION(state)) - stb_textedit_delete_selection(str, state); - else { - stb_textedit_clamp(str, state); - if (state->cursor > 0) { - stb_textedit_delete(str, state, state->cursor-1, 1); - --state->cursor; - } - } - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_TEXTSTART2 - case STB_TEXTEDIT_K_TEXTSTART2: -#endif - case STB_TEXTEDIT_K_TEXTSTART: - state->cursor = state->select_start = state->select_end = 0; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_TEXTEND2 - case STB_TEXTEDIT_K_TEXTEND2: -#endif - case STB_TEXTEDIT_K_TEXTEND: - state->cursor = STB_TEXTEDIT_STRINGLEN(str); - state->select_start = state->select_end = 0; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_TEXTSTART2 - case STB_TEXTEDIT_K_TEXTSTART2 | STB_TEXTEDIT_K_SHIFT: -#endif - case STB_TEXTEDIT_K_TEXTSTART | STB_TEXTEDIT_K_SHIFT: - stb_textedit_prep_selection_at_cursor(state); - state->cursor = state->select_end = 0; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_TEXTEND2 - case STB_TEXTEDIT_K_TEXTEND2 | STB_TEXTEDIT_K_SHIFT: -#endif - case STB_TEXTEDIT_K_TEXTEND | STB_TEXTEDIT_K_SHIFT: - stb_textedit_prep_selection_at_cursor(state); - state->cursor = state->select_end = STB_TEXTEDIT_STRINGLEN(str); - state->has_preferred_x = 0; - break; - - -#ifdef STB_TEXTEDIT_K_LINESTART2 - case STB_TEXTEDIT_K_LINESTART2: -#endif - case STB_TEXTEDIT_K_LINESTART: - stb_textedit_clamp(str, state); - stb_textedit_move_to_first(state); - if (state->single_line) - state->cursor = 0; - else while (state->cursor > 0 && STB_TEXTEDIT_GETCHAR(str, state->cursor-1) != STB_TEXTEDIT_NEWLINE) - --state->cursor; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_LINEEND2 - case STB_TEXTEDIT_K_LINEEND2: -#endif - case STB_TEXTEDIT_K_LINEEND: { - int n = STB_TEXTEDIT_STRINGLEN(str); - stb_textedit_clamp(str, state); - stb_textedit_move_to_first(state); - if (state->single_line) - state->cursor = n; - else while (state->cursor < n && STB_TEXTEDIT_GETCHAR(str, state->cursor) != STB_TEXTEDIT_NEWLINE) - ++state->cursor; - state->has_preferred_x = 0; - break; - } - -#ifdef STB_TEXTEDIT_K_LINESTART2 - case STB_TEXTEDIT_K_LINESTART2 | STB_TEXTEDIT_K_SHIFT: -#endif - case STB_TEXTEDIT_K_LINESTART | STB_TEXTEDIT_K_SHIFT: - stb_textedit_clamp(str, state); - stb_textedit_prep_selection_at_cursor(state); - if (state->single_line) - state->cursor = 0; - else while (state->cursor > 0 && STB_TEXTEDIT_GETCHAR(str, state->cursor-1) != STB_TEXTEDIT_NEWLINE) - --state->cursor; - state->select_end = state->cursor; - state->has_preferred_x = 0; - break; - -#ifdef STB_TEXTEDIT_K_LINEEND2 - case STB_TEXTEDIT_K_LINEEND2 | STB_TEXTEDIT_K_SHIFT: -#endif - case STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_SHIFT: { - int n = STB_TEXTEDIT_STRINGLEN(str); - stb_textedit_clamp(str, state); - stb_textedit_prep_selection_at_cursor(state); - if (state->single_line) - state->cursor = n; - else while (state->cursor < n && STB_TEXTEDIT_GETCHAR(str, state->cursor) != STB_TEXTEDIT_NEWLINE) - ++state->cursor; - state->select_end = state->cursor; - state->has_preferred_x = 0; - break; - } - -// @TODO: -// STB_TEXTEDIT_K_PGUP - move cursor up a page -// STB_TEXTEDIT_K_PGDOWN - move cursor down a page - } -} - -///////////////////////////////////////////////////////////////////////////// -// -// Undo processing -// -// @OPTIMIZE: the undo/redo buffer should be circular - -static void stb_textedit_flush_redo(StbUndoState *state) -{ - state->redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; - state->redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; -} - -// discard the oldest entry in the undo list -static void stb_textedit_discard_undo(StbUndoState *state) -{ - if (state->undo_point > 0) { - // if the 0th undo state has characters, clean those up - if (state->undo_rec[0].char_storage >= 0) { - int n = state->undo_rec[0].insert_length, i; - // delete n characters from all other records - state->undo_char_point -= n; - STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE))); - for (i=0; i < state->undo_point; ++i) - if (state->undo_rec[i].char_storage >= 0) - state->undo_rec[i].char_storage -= n; // @OPTIMIZE: get rid of char_storage and infer it - } - --state->undo_point; - STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0]))); - } -} - -// discard the oldest entry in the redo list--it's bad if this -// ever happens, but because undo & redo have to store the actual -// characters in different cases, the redo character buffer can -// fill up even though the undo buffer didn't -static void stb_textedit_discard_redo(StbUndoState *state) -{ - int k = STB_TEXTEDIT_UNDOSTATECOUNT-1; - - if (state->redo_point <= k) { - // if the k'th undo state has characters, clean those up - if (state->undo_rec[k].char_storage >= 0) { - int n = state->undo_rec[k].insert_length, i; - // move the remaining redo character data to the end of the buffer - state->redo_char_point += n; - STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((STB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE))); - // adjust the position of all the other records to account for above memmove - for (i=state->redo_point; i < k; ++i) - if (state->undo_rec[i].char_storage >= 0) - state->undo_rec[i].char_storage += n; - } - // now move all the redo records towards the end of the buffer; the first one is at 'redo_point' - // {DEAR IMGUI] - size_t move_size = (size_t)((STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0])); - const char* buf_begin = (char*)state->undo_rec; (void)buf_begin; - const char* buf_end = (char*)state->undo_rec + sizeof(state->undo_rec); (void)buf_end; - IM_ASSERT(((char*)(state->undo_rec + state->redo_point)) >= buf_begin); - IM_ASSERT(((char*)(state->undo_rec + state->redo_point + 1) + move_size) <= buf_end); - STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size); - - // now move redo_point to point to the new one - ++state->redo_point; - } -} - -static StbUndoRecord *stb_text_create_undo_record(StbUndoState *state, int numchars) -{ - // any time we create a new undo record, we discard redo - stb_textedit_flush_redo(state); - - // if we have no free records, we have to make room, by sliding the - // existing records down - if (state->undo_point == STB_TEXTEDIT_UNDOSTATECOUNT) - stb_textedit_discard_undo(state); - - // if the characters to store won't possibly fit in the buffer, we can't undo - if (numchars > STB_TEXTEDIT_UNDOCHARCOUNT) { - state->undo_point = 0; - state->undo_char_point = 0; - return NULL; - } - - // if we don't have enough free characters in the buffer, we have to make room - while (state->undo_char_point + numchars > STB_TEXTEDIT_UNDOCHARCOUNT) - stb_textedit_discard_undo(state); - - return &state->undo_rec[state->undo_point++]; -} - -static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len) -{ - StbUndoRecord *r = stb_text_create_undo_record(state, insert_len); - if (r == NULL) - return NULL; - - r->where = pos; - r->insert_length = (STB_TEXTEDIT_POSITIONTYPE) insert_len; - r->delete_length = (STB_TEXTEDIT_POSITIONTYPE) delete_len; - - if (insert_len == 0) { - r->char_storage = -1; - return NULL; - } else { - r->char_storage = state->undo_char_point; - state->undo_char_point += insert_len; - return &state->undo_char[r->char_storage]; - } -} - -static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - StbUndoState *s = &state->undostate; - StbUndoRecord u, *r; - if (s->undo_point == 0) - return; - - // we need to do two things: apply the undo record, and create a redo record - u = s->undo_rec[s->undo_point-1]; - r = &s->undo_rec[s->redo_point-1]; - r->char_storage = -1; - - r->insert_length = u.delete_length; - r->delete_length = u.insert_length; - r->where = u.where; - - if (u.delete_length) { - // if the undo record says to delete characters, then the redo record will - // need to re-insert the characters that get deleted, so we need to store - // them. - - // there are three cases: - // there's enough room to store the characters - // characters stored for *redoing* don't leave room for redo - // characters stored for *undoing* don't leave room for redo - // if the last is true, we have to bail - - if (s->undo_char_point + u.delete_length >= STB_TEXTEDIT_UNDOCHARCOUNT) { - // the undo records take up too much character space; there's no space to store the redo characters - r->insert_length = 0; - } else { - int i; - - // there's definitely room to store the characters eventually - while (s->undo_char_point + u.delete_length > s->redo_char_point) { - // should never happen: - if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) - return; - // there's currently not enough room, so discard a redo record - stb_textedit_discard_redo(s); - } - r = &s->undo_rec[s->redo_point-1]; - - r->char_storage = s->redo_char_point - u.delete_length; - s->redo_char_point = s->redo_char_point - u.delete_length; - - // now save the characters - for (i=0; i < u.delete_length; ++i) - s->undo_char[r->char_storage + i] = STB_TEXTEDIT_GETCHAR(str, u.where + i); - } - - // now we can carry out the deletion - STB_TEXTEDIT_DELETECHARS(str, u.where, u.delete_length); - } - - // check type of recorded action: - if (u.insert_length) { - // easy case: was a deletion, so we need to insert n characters - STB_TEXTEDIT_INSERTCHARS(str, u.where, &s->undo_char[u.char_storage], u.insert_length); - s->undo_char_point -= u.insert_length; - } - - state->cursor = u.where + u.insert_length; - - s->undo_point--; - s->redo_point--; -} - -static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) -{ - StbUndoState *s = &state->undostate; - StbUndoRecord *u, r; - if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) - return; - - // we need to do two things: apply the redo record, and create an undo record - u = &s->undo_rec[s->undo_point]; - r = s->undo_rec[s->redo_point]; - - // we KNOW there must be room for the undo record, because the redo record - // was derived from an undo record - - u->delete_length = r.insert_length; - u->insert_length = r.delete_length; - u->where = r.where; - u->char_storage = -1; - - if (r.delete_length) { - // the redo record requires us to delete characters, so the undo record - // needs to store the characters - - if (s->undo_char_point + u->insert_length > s->redo_char_point) { - u->insert_length = 0; - u->delete_length = 0; - } else { - int i; - u->char_storage = s->undo_char_point; - s->undo_char_point = s->undo_char_point + u->insert_length; - - // now save the characters - for (i=0; i < u->insert_length; ++i) - s->undo_char[u->char_storage + i] = STB_TEXTEDIT_GETCHAR(str, u->where + i); - } - - STB_TEXTEDIT_DELETECHARS(str, r.where, r.delete_length); - } - - if (r.insert_length) { - // easy case: need to insert n characters - STB_TEXTEDIT_INSERTCHARS(str, r.where, &s->undo_char[r.char_storage], r.insert_length); - s->redo_char_point += r.insert_length; - } - - state->cursor = r.where + r.insert_length; - - s->undo_point++; - s->redo_point++; -} - -static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length) -{ - stb_text_createundo(&state->undostate, where, 0, length); -} - -static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length) -{ - int i; - STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0); - if (p) { - for (i=0; i < length; ++i) - p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); - } -} - -static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length) -{ - int i; - STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length); - if (p) { - for (i=0; i < old_length; ++i) - p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); - } -} - -// reset the state to default -static void stb_textedit_clear_state(STB_TexteditState *state, int is_single_line) -{ - state->undostate.undo_point = 0; - state->undostate.undo_char_point = 0; - state->undostate.redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; - state->undostate.redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; - state->select_end = state->select_start = 0; - state->cursor = 0; - state->has_preferred_x = 0; - state->preferred_x = 0; - state->cursor_at_end_of_line = 0; - state->initialized = 1; - state->single_line = (unsigned char) is_single_line; - state->insert_mode = 0; -} - -// API initialize -static void stb_textedit_initialize_state(STB_TexteditState *state, int is_single_line) -{ - stb_textedit_clear_state(state, is_single_line); -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - -static int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE const *ctext, int len) -{ - return stb_textedit_paste_internal(str, state, (STB_TEXTEDIT_CHARTYPE *) ctext, len); -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -#endif//STB_TEXTEDIT_IMPLEMENTATION - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/include/imgui/imstb_truetype.h b/include/imgui/imstb_truetype.h deleted file mode 100644 index b4bdbd86..00000000 --- a/include/imgui/imstb_truetype.h +++ /dev/null @@ -1,4903 +0,0 @@ -// [DEAR IMGUI] -// This is a slightly modified version of stb_truetype.h 1.20. -// Mostly fixing for compiler and static analyzer warnings. -// Grep for [DEAR IMGUI] to find the changes. - -// stb_truetype.h - v1.20 - public domain -// authored from 2009-2016 by Sean Barrett / RAD Game Tools -// -// This library processes TrueType files: -// parse files -// extract glyph metrics -// extract glyph shapes -// render glyphs to one-channel bitmaps with antialiasing (box filter) -// render glyphs to one-channel SDF bitmaps (signed-distance field/function) -// -// Todo: -// non-MS cmaps -// crashproof on bad data -// hinting? (no longer patented) -// cleartype-style AA? -// optimize: use simple memory allocator for intermediates -// optimize: build edge-list directly from curves -// optimize: rasterize directly from curves? -// -// ADDITIONAL CONTRIBUTORS -// -// Mikko Mononen: compound shape support, more cmap formats -// Tor Andersson: kerning, subpixel rendering -// Dougall Johnson: OpenType / Type 2 font handling -// Daniel Ribeiro Maciel: basic GPOS-based kerning -// -// Misc other: -// Ryan Gordon -// Simon Glass -// github:IntellectualKitty -// Imanol Celaya -// Daniel Ribeiro Maciel -// -// Bug/warning reports/fixes: -// "Zer" on mollyrocket Fabian "ryg" Giesen -// Cass Everitt Martins Mozeiko -// stoiko (Haemimont Games) Cap Petschulat -// Brian Hook Omar Cornut -// Walter van Niftrik github:aloucks -// David Gow Peter LaValle -// David Given Sergey Popov -// Ivan-Assen Ivanov Giumo X. Clanjor -// Anthony Pesch Higor Euripedes -// Johan Duparc Thomas Fields -// Hou Qiming Derek Vinyard -// Rob Loach Cort Stratton -// Kenney Phillis Jr. github:oyvindjam -// Brian Costabile github:vassvik -// -// VERSION HISTORY -// -// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() -// 1.19 (2018-02-11) GPOS kerning, STBTT_fmod -// 1.18 (2018-01-29) add missing function -// 1.17 (2017-07-23) make more arguments const; doc fix -// 1.16 (2017-07-12) SDF support -// 1.15 (2017-03-03) make more arguments const -// 1.14 (2017-01-16) num-fonts-in-TTC function -// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts -// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// variant PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// -// Full history can be found at the end of this file. -// -// LICENSE -// -// See end of file for license information. -// -// USAGE -// -// Include this file in whatever places need to refer to it. In ONE C/C++ -// file, write: -// #define STB_TRUETYPE_IMPLEMENTATION -// before the #include of this file. This expands out the actual -// implementation into that C/C++ file. -// -// To make the implementation private to the file that generates the implementation, -// #define STBTT_STATIC -// -// Simple 3D API (don't ship this, but it's fine for tools and quick start) -// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture -// stbtt_GetBakedQuad() -- compute quad to draw for a given char -// -// Improved 3D API (more shippable): -// #include "stb_rect_pack.h" -- optional, but you really want it -// stbtt_PackBegin() -// stbtt_PackSetOversampling() -- for improved quality on small fonts -// stbtt_PackFontRanges() -- pack and renders -// stbtt_PackEnd() -// stbtt_GetPackedQuad() -// -// "Load" a font file from a memory buffer (you have to keep the buffer loaded) -// stbtt_InitFont() -// stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections -// stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections -// -// Render a unicode codepoint to a bitmap -// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap -// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide -// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be -// -// Character advance/positioning -// stbtt_GetCodepointHMetrics() -// stbtt_GetFontVMetrics() -// stbtt_GetFontVMetricsOS2() -// stbtt_GetCodepointKernAdvance() -// -// Starting with version 1.06, the rasterizer was replaced with a new, -// faster and generally-more-precise rasterizer. The new rasterizer more -// accurately measures pixel coverage for anti-aliasing, except in the case -// where multiple shapes overlap, in which case it overestimates the AA pixel -// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If -// this turns out to be a problem, you can re-enable the old rasterizer with -// #define STBTT_RASTERIZER_VERSION 1 -// which will incur about a 15% speed hit. -// -// ADDITIONAL DOCUMENTATION -// -// Immediately after this block comment are a series of sample programs. -// -// After the sample programs is the "header file" section. This section -// includes documentation for each API function. -// -// Some important concepts to understand to use this library: -// -// Codepoint -// Characters are defined by unicode codepoints, e.g. 65 is -// uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is -// the hiragana for "ma". -// -// Glyph -// A visual character shape (every codepoint is rendered as -// some glyph) -// -// Glyph index -// A font-specific integer ID representing a glyph -// -// Baseline -// Glyph shapes are defined relative to a baseline, which is the -// bottom of uppercase characters. Characters extend both above -// and below the baseline. -// -// Current Point -// As you draw text to the screen, you keep track of a "current point" -// which is the origin of each character. The current point's vertical -// position is the baseline. Even "baked fonts" use this model. -// -// Vertical Font Metrics -// The vertical qualities of the font, used to vertically position -// and space the characters. See docs for stbtt_GetFontVMetrics. -// -// Font Size in Pixels or Points -// The preferred interface for specifying font sizes in stb_truetype -// is to specify how tall the font's vertical extent should be in pixels. -// If that sounds good enough, skip the next paragraph. -// -// Most font APIs instead use "points", which are a common typographic -// measurement for describing font size, defined as 72 points per inch. -// stb_truetype provides a point API for compatibility. However, true -// "per inch" conventions don't make much sense on computer displays -// since different monitors have different number of pixels per -// inch. For example, Windows traditionally uses a convention that -// there are 96 pixels per inch, thus making 'inch' measurements have -// nothing to do with inches, and thus effectively defining a point to -// be 1.333 pixels. Additionally, the TrueType font data provides -// an explicit scale factor to scale a given font's glyphs to points, -// but the author has observed that this scale factor is often wrong -// for non-commercial fonts, thus making fonts scaled in points -// according to the TrueType spec incoherently sized in practice. -// -// DETAILED USAGE: -// -// Scale: -// Select how high you want the font to be, in points or pixels. -// Call ScaleForPixelHeight or ScaleForMappingEmToPixels to compute -// a scale factor SF that will be used by all other functions. -// -// Baseline: -// You need to select a y-coordinate that is the baseline of where -// your text will appear. Call GetFontBoundingBox to get the baseline-relative -// bounding box for all characters. SF*-y0 will be the distance in pixels -// that the worst-case character could extend above the baseline, so if -// you want the top edge of characters to appear at the top of the -// screen where y=0, then you would set the baseline to SF*-y0. -// -// Current point: -// Set the current point where the first character will appear. The -// first character could extend left of the current point; this is font -// dependent. You can either choose a current point that is the leftmost -// point and hope, or add some padding, or check the bounding box or -// left-side-bearing of the first character to be displayed and set -// the current point based on that. -// -// Displaying a character: -// Compute the bounding box of the character. It will contain signed values -// relative to . I.e. if it returns x0,y0,x1,y1, -// then the character should be displayed in the rectangle from -// to = 32 && *text < 128) { - stbtt_aligned_quad q; - stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 - glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); - glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); - glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); - glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); - } - ++text; - } - glEnd(); -} -#endif -// -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program (this compiles): get a single bitmap, print as ASCII art -// -#if 0 -#include -#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation -#include "stb_truetype.h" - -char ttf_buffer[1<<25]; - -int main(int argc, char **argv) -{ - stbtt_fontinfo font; - unsigned char *bitmap; - int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); - - fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); - - stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); - bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); - - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) - putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); - putchar('\n'); - } - return 0; -} -#endif -// -// Output: -// -// .ii. -// @@@@@@. -// V@Mio@@o -// :i. V@V -// :oM@@M -// :@@@MM@M -// @@o o@M -// :@@. M@M -// @@@o@@@@ -// :M@@V:@@. -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program: print "Hello World!" banner, with bugs -// -#if 0 -char buffer[24<<20]; -unsigned char screen[20][79]; - -int main(int arg, char **argv) -{ - stbtt_fontinfo font; - int i,j,ascent,baseline,ch=0; - float scale, xpos=2; // leave a little padding in case the character extends left - char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness - - fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); - stbtt_InitFont(&font, buffer, 0); - - scale = stbtt_ScaleForPixelHeight(&font, 15); - stbtt_GetFontVMetrics(&font, &ascent,0,0); - baseline = (int) (ascent*scale); - - while (text[ch]) { - int advance,lsb,x0,y0,x1,y1; - float x_shift = xpos - (float) floor(xpos); - stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb); - stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1); - stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]); - // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong - // because this API is really for baking character bitmaps into textures. if you want to render - // a sequence of characters, you really need to render each bitmap to a temp buffer, then - // "alpha blend" that into the working buffer - xpos += (advance * scale); - if (text[ch+1]) - xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]); - ++ch; - } - - for (j=0; j < 20; ++j) { - for (i=0; i < 78; ++i) - putchar(" .:ioVM@"[screen[j][i]>>5]); - putchar('\n'); - } - - return 0; -} -#endif - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -//// -//// INTEGRATION WITH YOUR CODEBASE -//// -//// The following sections allow you to supply alternate definitions -//// of C library functions used by stb_truetype, e.g. if you don't -//// link with the C runtime library. - -#ifdef STB_TRUETYPE_IMPLEMENTATION - // #define your own (u)stbtt_int8/16/32 before including to override this - #ifndef stbtt_uint8 - typedef unsigned char stbtt_uint8; - typedef signed char stbtt_int8; - typedef unsigned short stbtt_uint16; - typedef signed short stbtt_int16; - typedef unsigned int stbtt_uint32; - typedef signed int stbtt_int32; - #endif - - typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; - typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; - - // e.g. #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h - #ifndef STBTT_ifloor - #include - #define STBTT_ifloor(x) ((int) floor(x)) - #define STBTT_iceil(x) ((int) ceil(x)) - #endif - - #ifndef STBTT_sqrt - #include - #define STBTT_sqrt(x) sqrt(x) - #define STBTT_pow(x,y) pow(x,y) - #endif - - #ifndef STBTT_fmod - #include - #define STBTT_fmod(x,y) fmod(x,y) - #endif - - #ifndef STBTT_cos - #include - #define STBTT_cos(x) cos(x) - #define STBTT_acos(x) acos(x) - #endif - - #ifndef STBTT_fabs - #include - #define STBTT_fabs(x) fabs(x) - #endif - - // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h - #ifndef STBTT_malloc - #include - #define STBTT_malloc(x,u) ((void)(u),malloc(x)) - #define STBTT_free(x,u) ((void)(u),free(x)) - #endif - - #ifndef STBTT_assert - #include - #define STBTT_assert(x) assert(x) - #endif - - #ifndef STBTT_strlen - #include - #define STBTT_strlen(x) strlen(x) - #endif - - #ifndef STBTT_memcpy - #include - #define STBTT_memcpy memcpy - #define STBTT_memset memset - #endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// INTERFACE -//// -//// - -#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ -#define __STB_INCLUDE_STB_TRUETYPE_H__ - -#ifdef STBTT_STATIC -#define STBTT_DEF static -#else -#define STBTT_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// private structure -typedef struct -{ - unsigned char *data; - int cursor; - int size; -} stbtt__buf; - -////////////////////////////////////////////////////////////////////////////// -// -// TEXTURE BAKING API -// -// If you use this API, you only have to call two functions ever. -// - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; -} stbtt_bakedchar; - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata); // you allocate this, it's num_chars long -// if return is positive, the first unused row of the bitmap -// if return is negative, returns the negative of the number of characters that fit -// if return is 0, no characters fit and no rows were used -// This uses a very crappy packing. - -typedef struct -{ - float x0,y0,s0,t0; // top-left - float x1,y1,s1,t1; // bottom-right -} stbtt_aligned_quad; - -STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier -// Call GetBakedQuad with char_index = 'character - first_char', and it -// creates the quad you need to draw and advances the current position. -// -// The coordinate system used assumes y increases downwards. -// -// Characters will extend both above and below the current position; -// see discussion of "BASELINE" above. -// -// It's inefficient; you might want to c&p it and optimize it. - -STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap); -// Query the font vertical metrics without having to create a font first. - - -////////////////////////////////////////////////////////////////////////////// -// -// NEW TEXTURE BAKING API -// -// This provides options for packing multiple fonts into one atlas, not -// perfectly but better than nothing. - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; - float xoff2,yoff2; -} stbtt_packedchar; - -typedef struct stbtt_pack_context stbtt_pack_context; -typedef struct stbtt_fontinfo stbtt_fontinfo; -#ifndef STB_RECT_PACK_VERSION -typedef struct stbrp_rect stbrp_rect; -#endif - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); -// Initializes a packing context stored in the passed-in stbtt_pack_context. -// Future calls using this context will pack characters into the bitmap passed -// in here: a 1-channel bitmap that is width * height. stride_in_bytes is -// the distance from one row to the next (or 0 to mean they are packed tightly -// together). "padding" is the amount of padding to leave between each -// character (normally you want '1' for bitmaps you'll use as textures with -// bilinear filtering). -// -// Returns 0 on failure, 1 on success. - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); -// Cleans up the packing context and frees all memory. - -#define STBTT_POINT_SIZE(x) (-(x)) - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, - int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); -// Creates character bitmaps from the font_index'th font found in fontdata (use -// font_index=0 if you don't know what that is). It creates num_chars_in_range -// bitmaps for characters with unicode values starting at first_unicode_char_in_range -// and increasing. Data for how to render them is stored in chardata_for_range; -// pass these to stbtt_GetPackedQuad to get back renderable quads. -// -// font_size is the full height of the character from ascender to descender, -// as computed by stbtt_ScaleForPixelHeight. To use a point size as computed -// by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() -// and pass that result as 'font_size': -// ..., 20 , ... // font max minus min y is 20 pixels tall -// ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall - -typedef struct -{ - float font_size; - int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint - int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints - int num_chars; - stbtt_packedchar *chardata_for_range; // output - unsigned char h_oversample, v_oversample; // don't set these, they're used internally -} stbtt_pack_range; - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges); -// Creates character bitmaps from multiple ranges of characters stored in -// ranges. This will usually create a better-packed bitmap than multiple -// calls to stbtt_PackFontRange. Note that you can call this multiple -// times within a single PackBegin/PackEnd. - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample); -// Oversampling a font increases the quality by allowing higher-quality subpixel -// positioning, and is especially valuable at smaller text sizes. -// -// This function sets the amount of oversampling for all following calls to -// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given -// pack context. The default (no oversampling) is achieved by h_oversample=1 -// and v_oversample=1. The total number of pixels required is -// h_oversample*v_oversample larger than the default; for example, 2x2 -// oversampling requires 4x the storage of 1x1. For best results, render -// oversampled textures with bilinear filtering. Look at the readme in -// stb/tests/oversample for information about oversampled fonts -// -// To use with PackFontRangesGather etc., you must set it before calls -// call to PackFontRangesGatherRects. - -STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); -// If skip != 0, this tells stb_truetype to skip any codepoints for which -// there is no corresponding glyph. If skip=0, which is the default, then -// codepoints without a glyph recived the font's "missing character" glyph, -// typically an empty box by convention. - -STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int align_to_integer); - -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -// Calling these functions in sequence is roughly equivalent to calling -// stbtt_PackFontRanges(). If you more control over the packing of multiple -// fonts, or if you want to pack custom data into a font texture, take a look -// at the source to of stbtt_PackFontRanges() and create a custom version -// using these functions, e.g. call GatherRects multiple times, -// building up a single array of rects, then call PackRects once, -// then call RenderIntoRects repeatedly. This may result in a -// better packing than calling PackFontRanges multiple times -// (or it may not). - -// this is an opaque structure that you shouldn't mess with which holds -// all the context needed from PackBegin to PackEnd. -struct stbtt_pack_context { - void *user_allocator_context; - void *pack_info; - int width; - int height; - int stride_in_bytes; - int padding; - int skip_missing; - unsigned int h_oversample, v_oversample; - unsigned char *pixels; - void *nodes; -}; - -////////////////////////////////////////////////////////////////////////////// -// -// FONT LOADING -// -// - -STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data); -// This function will determine the number of fonts in a font file. TrueType -// collection (.ttc) files may contain multiple fonts, while TrueType font -// (.ttf) files only contain one font. The number of fonts can be used for -// indexing with the previous function where the index is between zero and one -// less than the total fonts. If an error occurs, -1 is returned. - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); -// Each .ttf/.ttc file may have more than one font. Each font has a sequential -// index number starting from 0. Call this function to get the font offset for -// a given index; it returns -1 if the index is out of range. A regular .ttf -// file will only define one font and it always be at offset 0, so it will -// return '0' for index 0, and -1 for all other indices. - -// The following structure is defined publicly so you can declare one on -// the stack or as a global or etc, but you should treat it as opaque. -struct stbtt_fontinfo -{ - void * userdata; - unsigned char * data; // pointer to .ttf file - int fontstart; // offset of start of font - - int numGlyphs; // number of glyphs, needed for range checking - - int loca,head,glyf,hhea,hmtx,kern,gpos; // table locations as offset from start of .ttf - int index_map; // a cmap mapping for our chosen character encoding - int indexToLocFormat; // format needed to map from glyph index to glyph - - stbtt__buf cff; // cff font data - stbtt__buf charstrings; // the charstring index - stbtt__buf gsubrs; // global charstring subroutines index - stbtt__buf subrs; // private charstring subroutines index - stbtt__buf fontdicts; // array of font dicts - stbtt__buf fdselect; // map from glyph to fontdict -}; - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); -// Given an offset into the file that defines a font, this function builds -// the necessary cached info for the rest of the system. You must allocate -// the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't -// need to do anything special to free it, because the contents are pure -// value data with no additional data structures. Returns 0 on failure. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER TO GLYPH-INDEX CONVERSIOn - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); -// If you're going to perform multiple operations on the same character -// and you want a speed-up, call this function with the character you're -// going to process, then use glyph-based functions instead of the -// codepoint-based functions. -// Returns 0 if the character codepoint is not defined in the font. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER PROPERTIES -// - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose "height" is 'pixels' tall. -// Height is measured as the distance from the highest ascender to the lowest -// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics -// and computing: -// scale = pixels / (ascent - descent) -// so if you prefer to measure height by the ascent only, use a similar calculation. - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose EM size is mapped to -// 'pixels' tall. This is probably what traditional APIs compute, but -// I'm not positive. - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); -// ascent is the coordinate above the baseline the font extends; descent -// is the coordinate below the baseline the font extends (i.e. it is typically negative) -// lineGap is the spacing between one row's descent and the next row's ascent... -// so you should advance the vertical position by "*ascent - *descent + *lineGap" -// these are expressed in unscaled coordinates, so you must multiply by -// the scale factor for a given size - -STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap); -// analogous to GetFontVMetrics, but returns the "typographic" values from the OS/2 -// table (specific to MS/Windows TTF files). -// -// Returns 1 on success (table present), 0 on failure. - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); -// the bounding box around all possible characters - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); -// leftSideBearing is the offset from the current horizontal position to the left edge of the character -// advanceWidth is the offset from the current horizontal position to the next horizontal position -// these are expressed in unscaled coordinates - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); -// an additional amount to add to the 'advance' value between ch1 and ch2 - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); -// Gets the bounding box of the visible part of the glyph, in unscaled coordinates - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); -// as above, but takes one or more glyph indices for greater efficiency - - -////////////////////////////////////////////////////////////////////////////// -// -// GLYPH SHAPES (you probably don't need these, but they have to go before -// the bitmaps for C declaration-order reasons) -// - -#ifndef STBTT_vmove // you can predefine these to use different values (but why?) - enum { - STBTT_vmove=1, - STBTT_vline, - STBTT_vcurve, - STBTT_vcubic - }; -#endif - -#ifndef stbtt_vertex // you can predefine this to use different values - // (we share this with other code at RAD) - #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file - typedef struct - { - stbtt_vertex_type x,y,cx,cy,cx1,cy1; - unsigned char type,padding; - } stbtt_vertex; -#endif - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); -// returns non-zero if nothing is drawn for this glyph - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); -// returns # of vertices and fills *vertices with the pointer to them -// these are expressed in "unscaled" coordinates -// -// The shape is a series of contours. Each one starts with -// a STBTT_moveto, then consists of a series of mixed -// STBTT_lineto and STBTT_curveto segments. A lineto -// draws a line from previous endpoint to its x,y; a curveto -// draws a quadratic bezier from previous endpoint to -// its x,y, using cx,cy as the bezier control point. - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); -// frees the data allocated above - -////////////////////////////////////////////////////////////////////////////// -// -// BITMAP RENDERING -// - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); -// frees the bitmap allocated below - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// allocates a large-enough single-channel 8bpp bitmap and renders the -// specified character/glyph at the specified scale into it, with -// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). -// *width & *height are filled out with the width & height of the bitmap, -// which is stored left-to-right, top-to-bottom. -// -// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); -// the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap -// in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap -// is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the -// width and height and positioning info for it first. - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); -// same as stbtt_MakeCodepointBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint); -// same as stbtt_MakeCodepointBitmapSubpixel, but prefiltering -// is performed (see stbtt_PackSetOversampling) - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -// get the bbox of the bitmap centered around the glyph origin; so the -// bitmap width is ix1-ix0, height is iy1-iy0, and location to place -// the bitmap top left is (leftSideBearing*scale,iy0). -// (Note that the bitmap uses y-increases-down, but the shape uses -// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); -// same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel -// shift for the character - -// the following functions are equivalent to the above functions, but operate -// on glyph indices instead of Unicode codepoints (for efficiency) -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int glyph); -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); - - -// @TODO: don't expose this structure -typedef struct -{ - int w,h,stride; - unsigned char *pixels; -} stbtt__bitmap; - -// rasterize a shape with quadratic beziers into a bitmap -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into - float flatness_in_pixels, // allowable error of curve in pixels - stbtt_vertex *vertices, // array of vertices defining shape - int num_verts, // number of vertices in above array - float scale_x, float scale_y, // scale applied to input vertices - float shift_x, float shift_y, // translation applied to input vertices - int x_off, int y_off, // another translation applied to input - int invert, // if non-zero, vertically flip shape - void *userdata); // context for to STBTT_MALLOC - -////////////////////////////////////////////////////////////////////////////// -// -// Signed Distance Function (or Field) rendering - -STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata); -// frees the SDF bitmap allocated below - -STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); -// These functions compute a discretized SDF field for a single character, suitable for storing -// in a single-channel texture, sampling with bilinear filtering, and testing against -// larger than some threshold to produce scalable fonts. -// info -- the font -// scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap -// glyph/codepoint -- the character to generate the SDF for -// padding -- extra "pixels" around the character which are filled with the distance to the character (not 0), -// which allows effects like bit outlines -// onedge_value -- value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) -// pixel_dist_scale -- what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale) -// if positive, > onedge_value is inside; if negative, < onedge_value is inside -// width,height -- output height & width of the SDF bitmap (including padding) -// xoff,yoff -- output origin of the character -// return value -- a 2D array of bytes 0..255, width*height in size -// -// pixel_dist_scale & onedge_value are a scale & bias that allows you to make -// optimal use of the limited 0..255 for your application, trading off precision -// and special effects. SDF values outside the range 0..255 are clamped to 0..255. -// -// Example: -// scale = stbtt_ScaleForPixelHeight(22) -// padding = 5 -// onedge_value = 180 -// pixel_dist_scale = 180/5.0 = 36.0 -// -// This will create an SDF bitmap in which the character is about 22 pixels -// high but the whole bitmap is about 22+5+5=32 pixels high. To produce a filled -// shape, sample the SDF at each pixel and fill the pixel if the SDF value -// is greater than or equal to 180/255. (You'll actually want to antialias, -// which is beyond the scope of this example.) Additionally, you can compute -// offset outlines (e.g. to stroke the character border inside & outside, -// or only outside). For example, to fill outside the character up to 3 SDF -// pixels, you would compare against (180-36.0*3)/255 = 72/255. The above -// choice of variables maps a range from 5 pixels outside the shape to -// 2 pixels inside the shape to 0..255; this is intended primarily for apply -// outside effects only (the interior range is needed to allow proper -// antialiasing of the font at *smaller* sizes) -// -// The function computes the SDF analytically at each SDF pixel, not by e.g. -// building a higher-res bitmap and approximating it. In theory the quality -// should be as high as possible for an SDF of this size & representation, but -// unclear if this is true in practice (perhaps building a higher-res bitmap -// and computing from that can allow drop-out prevention). -// -// The algorithm has not been optimized at all, so expect it to be slow -// if computing lots of characters or very large sizes. - - - -////////////////////////////////////////////////////////////////////////////// -// -// Finding the right font... -// -// You should really just solve this offline, keep your own tables -// of what font is what, and don't try to get it out of the .ttf file. -// That's because getting it out of the .ttf file is really hard, because -// the names in the file can appear in many possible encodings, in many -// possible languages, and e.g. if you need a case-insensitive comparison, -// the details of that depend on the encoding & language in a complex way -// (actually underspecified in truetype, but also gigantic). -// -// But you can use the provided functions in two possible ways: -// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on -// unicode-encoded names to try to find the font you want; -// you can run this before calling stbtt_InitFont() -// -// stbtt_GetFontNameString() lets you get any of the various strings -// from the file yourself and do your own comparisons on them. -// You have to have called stbtt_InitFont() first. - - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); -// returns the offset (not index) of the font that matches, or -1 if none -// if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". -// if you use any other flag, use a font name like "Arial"; this checks -// the 'macStyle' header field; i don't know if fonts set this consistently -#define STBTT_MACSTYLE_DONTCARE 0 -#define STBTT_MACSTYLE_BOLD 1 -#define STBTT_MACSTYLE_ITALIC 2 -#define STBTT_MACSTYLE_UNDERSCORE 4 -#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); -// returns 1/0 whether the first string interpreted as utf8 is identical to -// the second string interpreted as big-endian utf16... useful for strings from next func - -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); -// returns the string (which may be big-endian double byte, e.g. for unicode) -// and puts the length in bytes in *length. -// -// some of the values for the IDs are below; for more see the truetype spec: -// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html -// http://www.microsoft.com/typography/otspec/name.htm - -enum { // platformID - STBTT_PLATFORM_ID_UNICODE =0, - STBTT_PLATFORM_ID_MAC =1, - STBTT_PLATFORM_ID_ISO =2, - STBTT_PLATFORM_ID_MICROSOFT =3 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_UNICODE - STBTT_UNICODE_EID_UNICODE_1_0 =0, - STBTT_UNICODE_EID_UNICODE_1_1 =1, - STBTT_UNICODE_EID_ISO_10646 =2, - STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, - STBTT_UNICODE_EID_UNICODE_2_0_FULL=4 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT - STBTT_MS_EID_SYMBOL =0, - STBTT_MS_EID_UNICODE_BMP =1, - STBTT_MS_EID_SHIFTJIS =2, - STBTT_MS_EID_UNICODE_FULL =10 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes - STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, - STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, - STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, - STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 -}; - -enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... - // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs - STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, - STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, - STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, - STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, - STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, - STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D -}; - -enum { // languageID for STBTT_PLATFORM_ID_MAC - STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, - STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, - STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, - STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , - STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , - STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, - STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 -}; - -#ifdef __cplusplus -} -#endif - -#endif // __STB_INCLUDE_STB_TRUETYPE_H__ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// IMPLEMENTATION -//// -//// - -#ifdef STB_TRUETYPE_IMPLEMENTATION - -#ifndef STBTT_MAX_OVERSAMPLE -#define STBTT_MAX_OVERSAMPLE 8 -#endif - -#if STBTT_MAX_OVERSAMPLE > 255 -#error "STBTT_MAX_OVERSAMPLE cannot be > 255" -#endif - -typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; - -#ifndef STBTT_RASTERIZER_VERSION -#define STBTT_RASTERIZER_VERSION 2 -#endif - -#ifdef _MSC_VER -#define STBTT__NOTUSED(v) (void)(v) -#else -#define STBTT__NOTUSED(v) (void)sizeof(v) -#endif - -////////////////////////////////////////////////////////////////////////// -// -// stbtt__buf helpers to parse data from file -// - -static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b) -{ - if (b->cursor >= b->size) - return 0; - return b->data[b->cursor++]; -} - -static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b) -{ - if (b->cursor >= b->size) - return 0; - return b->data[b->cursor]; -} - -static void stbtt__buf_seek(stbtt__buf *b, int o) -{ - STBTT_assert(!(o > b->size || o < 0)); - b->cursor = (o > b->size || o < 0) ? b->size : o; -} - -static void stbtt__buf_skip(stbtt__buf *b, int o) -{ - stbtt__buf_seek(b, b->cursor + o); -} - -static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n) -{ - stbtt_uint32 v = 0; - int i; - STBTT_assert(n >= 1 && n <= 4); - for (i = 0; i < n; i++) - v = (v << 8) | stbtt__buf_get8(b); - return v; -} - -static stbtt__buf stbtt__new_buf(const void *p, size_t size) -{ - stbtt__buf r; - STBTT_assert(size < 0x40000000); - r.data = (stbtt_uint8*) p; - r.size = (int) size; - r.cursor = 0; - return r; -} - -#define stbtt__buf_get16(b) stbtt__buf_get((b), 2) -#define stbtt__buf_get32(b) stbtt__buf_get((b), 4) - -static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s) -{ - stbtt__buf r = stbtt__new_buf(NULL, 0); - if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r; - r.data = b->data + o; - r.size = s; - return r; -} - -static stbtt__buf stbtt__cff_get_index(stbtt__buf *b) -{ - int count, start, offsize; - start = b->cursor; - count = stbtt__buf_get16(b); - if (count) { - offsize = stbtt__buf_get8(b); - STBTT_assert(offsize >= 1 && offsize <= 4); - stbtt__buf_skip(b, offsize * count); - stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1); - } - return stbtt__buf_range(b, start, b->cursor - start); -} - -static stbtt_uint32 stbtt__cff_int(stbtt__buf *b) -{ - int b0 = stbtt__buf_get8(b); - if (b0 >= 32 && b0 <= 246) return b0 - 139; - else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108; - else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108; - else if (b0 == 28) return stbtt__buf_get16(b); - else if (b0 == 29) return stbtt__buf_get32(b); - STBTT_assert(0); - return 0; -} - -static void stbtt__cff_skip_operand(stbtt__buf *b) { - int v, b0 = stbtt__buf_peek8(b); - STBTT_assert(b0 >= 28); - if (b0 == 30) { - stbtt__buf_skip(b, 1); - while (b->cursor < b->size) { - v = stbtt__buf_get8(b); - if ((v & 0xF) == 0xF || (v >> 4) == 0xF) - break; - } - } else { - stbtt__cff_int(b); - } -} - -static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key) -{ - stbtt__buf_seek(b, 0); - while (b->cursor < b->size) { - int start = b->cursor, end, op; - while (stbtt__buf_peek8(b) >= 28) - stbtt__cff_skip_operand(b); - end = b->cursor; - op = stbtt__buf_get8(b); - if (op == 12) op = stbtt__buf_get8(b) | 0x100; - if (op == key) return stbtt__buf_range(b, start, end-start); - } - return stbtt__buf_range(b, 0, 0); -} - -static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out) -{ - int i; - stbtt__buf operands = stbtt__dict_get(b, key); - for (i = 0; i < outcount && operands.cursor < operands.size; i++) - out[i] = stbtt__cff_int(&operands); -} - -static int stbtt__cff_index_count(stbtt__buf *b) -{ - stbtt__buf_seek(b, 0); - return stbtt__buf_get16(b); -} - -static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) -{ - int count, offsize, start, end; - stbtt__buf_seek(&b, 0); - count = stbtt__buf_get16(&b); - offsize = stbtt__buf_get8(&b); - STBTT_assert(i >= 0 && i < count); - STBTT_assert(offsize >= 1 && offsize <= 4); - stbtt__buf_skip(&b, i*offsize); - start = stbtt__buf_get(&b, offsize); - end = stbtt__buf_get(&b, offsize); - return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start); -} - -////////////////////////////////////////////////////////////////////////// -// -// accessors to parse data from file -// - -// on platforms that don't allow misaligned reads, if we want to allow -// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE - -#define ttBYTE(p) (* (stbtt_uint8 *) (p)) -#define ttCHAR(p) (* (stbtt_int8 *) (p)) -#define ttFixed(p) ttLONG(p) - -static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } -static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } -static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } -static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - -#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) -#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) - -static int stbtt__isfont(stbtt_uint8 *font) -{ - // check the version number - if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 - if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! - if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF - if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 - if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts - return 0; -} - -// @OPTIMIZE: binary search -static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) -{ - stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); - stbtt_uint32 tabledir = fontstart + 12; - stbtt_int32 i; - for (i=0; i < num_tables; ++i) { - stbtt_uint32 loc = tabledir + 16*i; - if (stbtt_tag(data+loc+0, tag)) - return ttULONG(data+loc+8); - } - return 0; -} - -static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index) -{ - // if it's just a font, there's only one valid index - if (stbtt__isfont(font_collection)) - return index == 0 ? 0 : -1; - - // check if it's a TTC - if (stbtt_tag(font_collection, "ttcf")) { - // version 1? - if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { - stbtt_int32 n = ttLONG(font_collection+8); - if (index >= n) - return -1; - return ttULONG(font_collection+12+index*4); - } - } - return -1; -} - -static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection) -{ - // if it's just a font, there's only one valid font - if (stbtt__isfont(font_collection)) - return 1; - - // check if it's a TTC - if (stbtt_tag(font_collection, "ttcf")) { - // version 1? - if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { - return ttLONG(font_collection+8); - } - } - return 0; -} - -static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict) -{ - stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 }; - stbtt__buf pdict; - stbtt__dict_get_ints(&fontdict, 18, 2, private_loc); - if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0); - pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]); - stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff); - if (!subrsoff) return stbtt__new_buf(NULL, 0); - stbtt__buf_seek(&cff, private_loc[1]+subrsoff); - return stbtt__cff_get_index(&cff); -} - -static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart) -{ - stbtt_uint32 cmap, t; - stbtt_int32 i,numTables; - - info->data = data; - info->fontstart = fontstart; - info->cff = stbtt__new_buf(NULL, 0); - - cmap = stbtt__find_table(data, fontstart, "cmap"); // required - info->loca = stbtt__find_table(data, fontstart, "loca"); // required - info->head = stbtt__find_table(data, fontstart, "head"); // required - info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required - info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required - info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required - info->kern = stbtt__find_table(data, fontstart, "kern"); // not required - info->gpos = stbtt__find_table(data, fontstart, "GPOS"); // not required - - if (!cmap || !info->head || !info->hhea || !info->hmtx) - return 0; - if (info->glyf) { - // required for truetype - if (!info->loca) return 0; - } else { - // initialization for CFF / Type2 fonts (OTF) - stbtt__buf b, topdict, topdictidx; - stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0; - stbtt_uint32 cff; - - cff = stbtt__find_table(data, fontstart, "CFF "); - if (!cff) return 0; - - info->fontdicts = stbtt__new_buf(NULL, 0); - info->fdselect = stbtt__new_buf(NULL, 0); - - // @TODO this should use size from table (not 512MB) - info->cff = stbtt__new_buf(data+cff, 512*1024*1024); - b = info->cff; - - // read the header - stbtt__buf_skip(&b, 2); - stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize - - // @TODO the name INDEX could list multiple fonts, - // but we just use the first one. - stbtt__cff_get_index(&b); // name INDEX - topdictidx = stbtt__cff_get_index(&b); - topdict = stbtt__cff_index_get(topdictidx, 0); - stbtt__cff_get_index(&b); // string INDEX - info->gsubrs = stbtt__cff_get_index(&b); - - stbtt__dict_get_ints(&topdict, 17, 1, &charstrings); - stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype); - stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff); - stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff); - info->subrs = stbtt__get_subrs(b, topdict); - - // we only support Type 2 charstrings - if (cstype != 2) return 0; - if (charstrings == 0) return 0; - - if (fdarrayoff) { - // looks like a CID font - if (!fdselectoff) return 0; - stbtt__buf_seek(&b, fdarrayoff); - info->fontdicts = stbtt__cff_get_index(&b); - info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff); - } - - stbtt__buf_seek(&b, charstrings); - info->charstrings = stbtt__cff_get_index(&b); - } - - t = stbtt__find_table(data, fontstart, "maxp"); - if (t) - info->numGlyphs = ttUSHORT(data+t+4); - else - info->numGlyphs = 0xffff; - - // find a cmap encoding table we understand *now* to avoid searching - // later. (todo: could make this installable) - // the same regardless of glyph. - numTables = ttUSHORT(data + cmap + 2); - info->index_map = 0; - for (i=0; i < numTables; ++i) { - stbtt_uint32 encoding_record = cmap + 4 + 8 * i; - // find an encoding we understand: - switch(ttUSHORT(data+encoding_record)) { - case STBTT_PLATFORM_ID_MICROSOFT: - switch (ttUSHORT(data+encoding_record+2)) { - case STBTT_MS_EID_UNICODE_BMP: - case STBTT_MS_EID_UNICODE_FULL: - // MS/Unicode - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - break; - case STBTT_PLATFORM_ID_UNICODE: - // Mac/iOS has these - // all the encodingIDs are unicode, so we don't bother to check it - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - } - if (info->index_map == 0) - return 0; - - info->indexToLocFormat = ttUSHORT(data+info->head + 50); - return 1; -} - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) -{ - stbtt_uint8 *data = info->data; - stbtt_uint32 index_map = info->index_map; - - stbtt_uint16 format = ttUSHORT(data + index_map + 0); - if (format == 0) { // apple byte encoding - stbtt_int32 bytes = ttUSHORT(data + index_map + 2); - if (unicode_codepoint < bytes-6) - return ttBYTE(data + index_map + 6 + unicode_codepoint); - return 0; - } else if (format == 6) { - stbtt_uint32 first = ttUSHORT(data + index_map + 6); - stbtt_uint32 count = ttUSHORT(data + index_map + 8); - if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) - return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); - return 0; - } else if (format == 2) { - STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean - return 0; - } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges - stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; - stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; - stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); - stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; - - // do a binary search of the segments - stbtt_uint32 endCount = index_map + 14; - stbtt_uint32 search = endCount; - - if (unicode_codepoint > 0xffff) - return 0; - - // they lie from endCount .. endCount + segCount - // but searchRange is the nearest power of two, so... - if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) - search += rangeShift*2; - - // now decrement to bias correctly to find smallest - search -= 2; - while (entrySelector) { - stbtt_uint16 end; - searchRange >>= 1; - end = ttUSHORT(data + search + searchRange*2); - if (unicode_codepoint > end) - search += searchRange*2; - --entrySelector; - } - search += 2; - - { - stbtt_uint16 offset, start; - stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); - - STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); - start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); - if (unicode_codepoint < start) - return 0; - - offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); - if (offset == 0) - return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); - - return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); - } - } else if (format == 12 || format == 13) { - stbtt_uint32 ngroups = ttULONG(data+index_map+12); - stbtt_int32 low,high; - low = 0; high = (stbtt_int32)ngroups; - // Binary search the right group. - while (low < high) { - stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high - stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); - stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); - if ((stbtt_uint32) unicode_codepoint < start_char) - high = mid; - else if ((stbtt_uint32) unicode_codepoint > end_char) - low = mid+1; - else { - stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); - if (format == 12) - return start_glyph + unicode_codepoint-start_char; - else // format == 13 - return start_glyph; - } - } - return 0; // not found - } - // @TODO - STBTT_assert(0); - return 0; -} - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) -{ - return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); -} - -static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) -{ - v->type = type; - v->x = (stbtt_int16) x; - v->y = (stbtt_int16) y; - v->cx = (stbtt_int16) cx; - v->cy = (stbtt_int16) cy; -} - -static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) -{ - int g1,g2; - - STBTT_assert(!info->cff.size); - - if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range - if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format - - if (info->indexToLocFormat == 0) { - g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; - g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; - } else { - g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); - g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); - } - - return g1==g2 ? -1 : g1; // if length is 0, return -1 -} - -static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); - -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) -{ - if (info->cff.size) { - stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1); - } else { - int g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 0; - - if (x0) *x0 = ttSHORT(info->data + g + 2); - if (y0) *y0 = ttSHORT(info->data + g + 4); - if (x1) *x1 = ttSHORT(info->data + g + 6); - if (y1) *y1 = ttSHORT(info->data + g + 8); - } - return 1; -} - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) -{ - return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); -} - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) -{ - stbtt_int16 numberOfContours; - int g; - if (info->cff.size) - return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0; - g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 1; - numberOfContours = ttSHORT(info->data + g); - return numberOfContours == 0; -} - -static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, - stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) -{ - if (start_off) { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); - } - return num_vertices; -} - -static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - stbtt_int16 numberOfContours; - stbtt_uint8 *endPtsOfContours; - stbtt_uint8 *data = info->data; - stbtt_vertex *vertices=0; - int num_vertices=0; - int g = stbtt__GetGlyfOffset(info, glyph_index); - - *pvertices = NULL; - - if (g < 0) return 0; - - numberOfContours = ttSHORT(data + g); - - if (numberOfContours > 0) { - stbtt_uint8 flags=0,flagcount; - stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; - stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; - stbtt_uint8 *points; - endPtsOfContours = (data + g + 10); - ins = ttUSHORT(data + g + 10 + numberOfContours * 2); - points = data + g + 10 + numberOfContours * 2 + 2 + ins; - - n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); - - m = n + 2*numberOfContours; // a loose bound on how many vertices we might need - vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); - if (vertices == 0) - return 0; - - next_move = 0; - flagcount=0; - - // in first pass, we load uninterpreted data into the allocated array - // above, shifted to the end of the array so we won't overwrite it when - // we create our final data starting from the front - - off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated - - // first load flags - - for (i=0; i < n; ++i) { - if (flagcount == 0) { - flags = *points++; - if (flags & 8) - flagcount = *points++; - } else - --flagcount; - vertices[off+i].type = flags; - } - - // now load x coordinates - x=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 2) { - stbtt_int16 dx = *points++; - x += (flags & 16) ? dx : -dx; // ??? - } else { - if (!(flags & 16)) { - x = x + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].x = (stbtt_int16) x; - } - - // now load y coordinates - y=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 4) { - stbtt_int16 dy = *points++; - y += (flags & 32) ? dy : -dy; // ??? - } else { - if (!(flags & 32)) { - y = y + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].y = (stbtt_int16) y; - } - - // now convert them to our format - num_vertices=0; - sx = sy = cx = cy = scx = scy = 0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - x = (stbtt_int16) vertices[off+i].x; - y = (stbtt_int16) vertices[off+i].y; - - if (next_move == i) { - if (i != 0) - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - - // now start the new one - start_off = !(flags & 1); - if (start_off) { - // if we start off with an off-curve point, then when we need to find a point on the curve - // where we can start, and we need to save some state for when we wraparound. - scx = x; - scy = y; - if (!(vertices[off+i+1].type & 1)) { - // next point is also a curve point, so interpolate an on-point curve - sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; - sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; - } else { - // otherwise just use the next point as our start point - sx = (stbtt_int32) vertices[off+i+1].x; - sy = (stbtt_int32) vertices[off+i+1].y; - ++i; // we're using point i+1 as the starting point, so skip it - } - } else { - sx = x; - sy = y; - } - stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); - was_off = 0; - next_move = 1 + ttUSHORT(endPtsOfContours+j*2); - ++j; - } else { - if (!(flags & 1)) { // if it's a curve - if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); - cx = x; - cy = y; - was_off = 1; - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); - was_off = 0; - } - } - } - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - } else if (numberOfContours == -1) { - // Compound shapes. - int more = 1; - stbtt_uint8 *comp = data + g + 10; - num_vertices = 0; - vertices = 0; - while (more) { - stbtt_uint16 flags, gidx; - int comp_num_verts = 0, i; - stbtt_vertex *comp_verts = 0, *tmp = 0; - float mtx[6] = {1,0,0,1,0,0}, m, n; - - flags = ttSHORT(comp); comp+=2; - gidx = ttSHORT(comp); comp+=2; - - if (flags & 2) { // XY values - if (flags & 1) { // shorts - mtx[4] = ttSHORT(comp); comp+=2; - mtx[5] = ttSHORT(comp); comp+=2; - } else { - mtx[4] = ttCHAR(comp); comp+=1; - mtx[5] = ttCHAR(comp); comp+=1; - } - } - else { - // @TODO handle matching point - STBTT_assert(0); - } - if (flags & (1<<3)) { // WE_HAVE_A_SCALE - mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } - - // Find transformation scales. - m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); - n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); - - // Get indexed glyph. - comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); - if (comp_num_verts > 0) { - // Transform vertices. - for (i = 0; i < comp_num_verts; ++i) { - stbtt_vertex* v = &comp_verts[i]; - stbtt_vertex_type x,y; - x=v->x; y=v->y; - v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - x=v->cx; y=v->cy; - v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - } - // Append vertices. - tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); - if (!tmp) { - if (vertices) STBTT_free(vertices, info->userdata); - if (comp_verts) STBTT_free(comp_verts, info->userdata); - return 0; - } - if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); //-V595 - STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); - if (vertices) STBTT_free(vertices, info->userdata); - vertices = tmp; - STBTT_free(comp_verts, info->userdata); - num_vertices += comp_num_verts; - } - // More components ? - more = flags & (1<<5); - } - } else if (numberOfContours < 0) { - // @TODO other compound variations? - STBTT_assert(0); - } else { - // numberOfCounters == 0, do nothing - } - - *pvertices = vertices; - return num_vertices; -} - -typedef struct -{ - int bounds; - int started; - float first_x, first_y; - float x, y; - stbtt_int32 min_x, max_x, min_y, max_y; - - stbtt_vertex *pvertices; - int num_vertices; -} stbtt__csctx; - -#define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0} - -static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y) -{ - if (x > c->max_x || !c->started) c->max_x = x; - if (y > c->max_y || !c->started) c->max_y = y; - if (x < c->min_x || !c->started) c->min_x = x; - if (y < c->min_y || !c->started) c->min_y = y; - c->started = 1; -} - -static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1) -{ - if (c->bounds) { - stbtt__track_vertex(c, x, y); - if (type == STBTT_vcubic) { - stbtt__track_vertex(c, cx, cy); - stbtt__track_vertex(c, cx1, cy1); - } - } else { - stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy); - c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1; - c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1; - } - c->num_vertices++; -} - -static void stbtt__csctx_close_shape(stbtt__csctx *ctx) -{ - if (ctx->first_x != ctx->x || ctx->first_y != ctx->y) - stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy) -{ - stbtt__csctx_close_shape(ctx); - ctx->first_x = ctx->x = ctx->x + dx; - ctx->first_y = ctx->y = ctx->y + dy; - stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy) -{ - ctx->x += dx; - ctx->y += dy; - stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) -{ - float cx1 = ctx->x + dx1; - float cy1 = ctx->y + dy1; - float cx2 = cx1 + dx2; - float cy2 = cy1 + dy2; - ctx->x = cx2 + dx3; - ctx->y = cy2 + dy3; - stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2); -} - -static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n) -{ - int count = stbtt__cff_index_count(&idx); - int bias = 107; - if (count >= 33900) - bias = 32768; - else if (count >= 1240) - bias = 1131; - n += bias; - if (n < 0 || n >= count) - return stbtt__new_buf(NULL, 0); - return stbtt__cff_index_get(idx, n); -} - -static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index) -{ - stbtt__buf fdselect = info->fdselect; - int nranges, start, end, v, fmt, fdselector = -1, i; - - stbtt__buf_seek(&fdselect, 0); - fmt = stbtt__buf_get8(&fdselect); - if (fmt == 0) { - // untested - stbtt__buf_skip(&fdselect, glyph_index); - fdselector = stbtt__buf_get8(&fdselect); - } else if (fmt == 3) { - nranges = stbtt__buf_get16(&fdselect); - start = stbtt__buf_get16(&fdselect); - for (i = 0; i < nranges; i++) { - v = stbtt__buf_get8(&fdselect); - end = stbtt__buf_get16(&fdselect); - if (glyph_index >= start && glyph_index < end) { - fdselector = v; - break; - } - start = end; - } - } - if (fdselector == -1) stbtt__new_buf(NULL, 0); - return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector)); -} - -static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c) -{ - int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0; - int has_subrs = 0, clear_stack; - float s[48]; - stbtt__buf subr_stack[10], subrs = info->subrs, b; - float f; - -#define STBTT__CSERR(s) (0) - - // this currently ignores the initial width value, which isn't needed if we have hmtx - b = stbtt__cff_index_get(info->charstrings, glyph_index); - while (b.cursor < b.size) { - i = 0; - clear_stack = 1; - b0 = stbtt__buf_get8(&b); - switch (b0) { - // @TODO implement hinting - case 0x13: // hintmask - case 0x14: // cntrmask - if (in_header) - maskbits += (sp / 2); // implicit "vstem" - in_header = 0; - stbtt__buf_skip(&b, (maskbits + 7) / 8); - break; - - case 0x01: // hstem - case 0x03: // vstem - case 0x12: // hstemhm - case 0x17: // vstemhm - maskbits += (sp / 2); - break; - - case 0x15: // rmoveto - in_header = 0; - if (sp < 2) return STBTT__CSERR("rmoveto stack"); - stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]); - break; - case 0x04: // vmoveto - in_header = 0; - if (sp < 1) return STBTT__CSERR("vmoveto stack"); - stbtt__csctx_rmove_to(c, 0, s[sp-1]); - break; - case 0x16: // hmoveto - in_header = 0; - if (sp < 1) return STBTT__CSERR("hmoveto stack"); - stbtt__csctx_rmove_to(c, s[sp-1], 0); - break; - - case 0x05: // rlineto - if (sp < 2) return STBTT__CSERR("rlineto stack"); - for (; i + 1 < sp; i += 2) - stbtt__csctx_rline_to(c, s[i], s[i+1]); - break; - - // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical - // starting from a different place. - - case 0x07: // vlineto - if (sp < 1) return STBTT__CSERR("vlineto stack"); - goto vlineto; - case 0x06: // hlineto - if (sp < 1) return STBTT__CSERR("hlineto stack"); - for (;;) { - if (i >= sp) break; - stbtt__csctx_rline_to(c, s[i], 0); - i++; - vlineto: - if (i >= sp) break; - stbtt__csctx_rline_to(c, 0, s[i]); - i++; - } - break; - - case 0x1F: // hvcurveto - if (sp < 4) return STBTT__CSERR("hvcurveto stack"); - goto hvcurveto; - case 0x1E: // vhcurveto - if (sp < 4) return STBTT__CSERR("vhcurveto stack"); - for (;;) { - if (i + 3 >= sp) break; - stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f); - i += 4; - hvcurveto: - if (i + 3 >= sp) break; - stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]); - i += 4; - } - break; - - case 0x08: // rrcurveto - if (sp < 6) return STBTT__CSERR("rcurveline stack"); - for (; i + 5 < sp; i += 6) - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - break; - - case 0x18: // rcurveline - if (sp < 8) return STBTT__CSERR("rcurveline stack"); - for (; i + 5 < sp - 2; i += 6) - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack"); - stbtt__csctx_rline_to(c, s[i], s[i+1]); - break; - - case 0x19: // rlinecurve - if (sp < 8) return STBTT__CSERR("rlinecurve stack"); - for (; i + 1 < sp - 6; i += 2) - stbtt__csctx_rline_to(c, s[i], s[i+1]); - if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack"); - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - break; - - case 0x1A: // vvcurveto - case 0x1B: // hhcurveto - if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack"); - f = 0.0; - if (sp & 1) { f = s[i]; i++; } - for (; i + 3 < sp; i += 4) { - if (b0 == 0x1B) - stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0); - else - stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]); - f = 0.0; - } - break; - - case 0x0A: // callsubr - if (!has_subrs) { - if (info->fdselect.size) - subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); - has_subrs = 1; - } - // fallthrough - case 0x1D: // callgsubr - if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); - v = (int) s[--sp]; - if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit"); - subr_stack[subr_stack_height++] = b; - b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v); - if (b.size == 0) return STBTT__CSERR("subr not found"); - b.cursor = 0; - clear_stack = 0; - break; - - case 0x0B: // return - if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr"); - b = subr_stack[--subr_stack_height]; - clear_stack = 0; - break; - - case 0x0E: // endchar - stbtt__csctx_close_shape(c); - return 1; - - case 0x0C: { // two-byte escape - float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6; - float dx, dy; - int b1 = stbtt__buf_get8(&b); - switch (b1) { - // @TODO These "flex" implementations ignore the flex-depth and resolution, - // and always draw beziers. - case 0x22: // hflex - if (sp < 7) return STBTT__CSERR("hflex stack"); - dx1 = s[0]; - dx2 = s[1]; - dy2 = s[2]; - dx3 = s[3]; - dx4 = s[4]; - dx5 = s[5]; - dx6 = s[6]; - stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0); - stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0); - break; - - case 0x23: // flex - if (sp < 13) return STBTT__CSERR("flex stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dy3 = s[5]; - dx4 = s[6]; - dy4 = s[7]; - dx5 = s[8]; - dy5 = s[9]; - dx6 = s[10]; - dy6 = s[11]; - //fd is s[12] - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); - stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); - break; - - case 0x24: // hflex1 - if (sp < 9) return STBTT__CSERR("hflex1 stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dx4 = s[5]; - dx5 = s[6]; - dy5 = s[7]; - dx6 = s[8]; - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0); - stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5)); - break; - - case 0x25: // flex1 - if (sp < 11) return STBTT__CSERR("flex1 stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dy3 = s[5]; - dx4 = s[6]; - dy4 = s[7]; - dx5 = s[8]; - dy5 = s[9]; - dx6 = dy6 = s[10]; - dx = dx1+dx2+dx3+dx4+dx5; - dy = dy1+dy2+dy3+dy4+dy5; - if (STBTT_fabs(dx) > STBTT_fabs(dy)) - dy6 = -dy; - else - dx6 = -dx; - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); - stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); - break; - - default: - return STBTT__CSERR("unimplemented"); - } - } break; - - default: - if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) //-V560 - return STBTT__CSERR("reserved operator"); - - // push immediate - if (b0 == 255) { - f = (float)(stbtt_int32)stbtt__buf_get32(&b) / 0x10000; - } else { - stbtt__buf_skip(&b, -1); - f = (float)(stbtt_int16)stbtt__cff_int(&b); - } - if (sp >= 48) return STBTT__CSERR("push stack overflow"); - s[sp++] = f; - clear_stack = 0; - break; - } - if (clear_stack) sp = 0; - } - return STBTT__CSERR("no endchar"); - -#undef STBTT__CSERR -} - -static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - // runs the charstring twice, once to count and once to output (to avoid realloc) - stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1); - stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0); - if (stbtt__run_charstring(info, glyph_index, &count_ctx)) { - *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata); - output_ctx.pvertices = *pvertices; - if (stbtt__run_charstring(info, glyph_index, &output_ctx)) { - STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices); - return output_ctx.num_vertices; - } - } - *pvertices = NULL; - return 0; -} - -static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) -{ - stbtt__csctx c = STBTT__CSCTX_INIT(1); - int r = stbtt__run_charstring(info, glyph_index, &c); - if (x0) *x0 = r ? c.min_x : 0; - if (y0) *y0 = r ? c.min_y : 0; - if (x1) *x1 = r ? c.max_x : 0; - if (y1) *y1 = r ? c.max_y : 0; - return r ? c.num_vertices : 0; -} - -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - if (!info->cff.size) - return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices); - else - return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices); -} - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) -{ - stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); - if (glyph_index < numOfLongHorMetrics) { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); - } else { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); - } -} - -static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint8 *data = info->data + info->kern; - stbtt_uint32 needle, straw; - int l, r, m; - - // we only look at the first table. it must be 'horizontal' and format 0. - if (!info->kern) - return 0; - if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 - return 0; - if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format - return 0; - - l = 0; - r = ttUSHORT(data+10) - 1; - needle = glyph1 << 16 | glyph2; - while (l <= r) { - m = (l + r) >> 1; - straw = ttULONG(data+18+(m*6)); // note: unaligned read - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else - return ttSHORT(data+22+(m*6)); - } - return 0; -} - -static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) -{ - stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); - switch(coverageFormat) { - case 1: { - stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); - - // Binary search. - stbtt_int32 l=0, r=glyphCount-1, m; - int straw, needle=glyph; - while (l <= r) { - stbtt_uint8 *glyphArray = coverageTable + 4; - stbtt_uint16 glyphID; - m = (l + r) >> 1; - glyphID = ttUSHORT(glyphArray + 2 * m); - straw = glyphID; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - return m; - } - } - } break; - - case 2: { - stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); - stbtt_uint8 *rangeArray = coverageTable + 4; - - // Binary search. - stbtt_int32 l=0, r=rangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *rangeRecord; - m = (l + r) >> 1; - rangeRecord = rangeArray + 6 * m; - strawStart = ttUSHORT(rangeRecord); - strawEnd = ttUSHORT(rangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else { - stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); - return startCoverageIndex + glyph - strawStart; - } - } - } break; - - default: { - // There are no other cases. - STBTT_assert(0); - } break; - } - - return -1; -} - -static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) -{ - stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); - switch(classDefFormat) - { - case 1: { - stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); - stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); - stbtt_uint8 *classDef1ValueArray = classDefTable + 6; - - if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) - return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); - - // [DEAR IMGUI] Commented to fix static analyzer warning - //classDefTable = classDef1ValueArray + 2 * glyphCount; - } break; - - case 2: { - stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); - stbtt_uint8 *classRangeRecords = classDefTable + 4; - - // Binary search. - stbtt_int32 l=0, r=classRangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *classRangeRecord; - m = (l + r) >> 1; - classRangeRecord = classRangeRecords + 6 * m; - strawStart = ttUSHORT(classRangeRecord); - strawEnd = ttUSHORT(classRangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else - return (stbtt_int32)ttUSHORT(classRangeRecord + 4); - } - - // [DEAR IMGUI] Commented to fix static analyzer warning - //classDefTable = classRangeRecords + 6 * classRangeCount; - } break; - - default: { - // There are no other cases. - STBTT_assert(0); - } break; - } - - return -1; -} - -// Define to STBTT_assert(x) if you want to break on unimplemented formats. -#define STBTT_GPOS_TODO_assert(x) - -static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint16 lookupListOffset; - stbtt_uint8 *lookupList; - stbtt_uint16 lookupCount; - stbtt_uint8 *data; - stbtt_int32 i; - - if (!info->gpos) return 0; - - data = info->data + info->gpos; - - if (ttUSHORT(data+0) != 1) return 0; // Major version 1 - if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 - - lookupListOffset = ttUSHORT(data+8); - lookupList = data + lookupListOffset; - lookupCount = ttUSHORT(lookupList); - - for (i=0; i> 1; - pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; - secondGlyph = ttUSHORT(pairValue); - straw = secondGlyph; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - stbtt_int16 xAdvance = ttSHORT(pairValue + 2); - return xAdvance; - } - } - } break; - - case 2: { - stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); - stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); - - stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); - stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); - int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); - int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); - - stbtt_uint16 class1Count = ttUSHORT(table + 12); - stbtt_uint16 class2Count = ttUSHORT(table + 14); - STBTT_assert(glyph1class < class1Count); - STBTT_assert(glyph2class < class2Count); - - // TODO: Support more formats. - STBTT_GPOS_TODO_assert(valueFormat1 == 4); - if (valueFormat1 != 4) return 0; - STBTT_GPOS_TODO_assert(valueFormat2 == 0); - if (valueFormat2 != 0) return 0; - - if (glyph1class >= 0 && glyph1class < class1Count && glyph2class >= 0 && glyph2class < class2Count) { - stbtt_uint8 *class1Records = table + 16; - stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count); - stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class); - return xAdvance; - } - } break; - - default: { - // There are no other cases. - STBTT_assert(0); - break; - } // [DEAR IMGUI] removed ; - } - } - break; - } // [DEAR IMGUI] removed ; - - default: - // TODO: Implement other stuff. - break; - } - } - - return 0; -} - -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2) -{ - int xAdvance = 0; - - if (info->gpos) - xAdvance += stbtt__GetGlyphGPOSInfoAdvance(info, g1, g2); - - if (info->kern) - xAdvance += stbtt__GetGlyphKernInfoAdvance(info, g1, g2); - - return xAdvance; -} - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) -{ - if (!info->kern && !info->gpos) // if no kerning table, don't waste time looking up both codepoint->glyphs - return 0; - return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); -} - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) -{ - stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); -} - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) -{ - if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); - if (descent) *descent = ttSHORT(info->data+info->hhea + 6); - if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); -} - -STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap) -{ - int tab = stbtt__find_table(info->data, info->fontstart, "OS/2"); - if (!tab) - return 0; - if (typoAscent ) *typoAscent = ttSHORT(info->data+tab + 68); - if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70); - if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72); - return 1; -} - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) -{ - *x0 = ttSHORT(info->data + info->head + 36); - *y0 = ttSHORT(info->data + info->head + 38); - *x1 = ttSHORT(info->data + info->head + 40); - *y1 = ttSHORT(info->data + info->head + 42); -} - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) -{ - int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); - return (float) height / fheight; -} - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) -{ - int unitsPerEm = ttUSHORT(info->data + info->head + 18); - return pixels / unitsPerEm; -} - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) -{ - STBTT_free(v, info->userdata); -} - -////////////////////////////////////////////////////////////////////////////// -// -// antialiasing software rasterizer -// - -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning - if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { - // e.g. space character - if (ix0) *ix0 = 0; - if (iy0) *iy0 = 0; - if (ix1) *ix1 = 0; - if (iy1) *iy1 = 0; - } else { - // move to integral bboxes (treating pixels as little squares, what pixels get touched)? - if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); - if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); - if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); - if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); - } -} - -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); -} - -////////////////////////////////////////////////////////////////////////////// -// -// Rasterizer - -typedef struct stbtt__hheap_chunk -{ - struct stbtt__hheap_chunk *next; -} stbtt__hheap_chunk; - -typedef struct stbtt__hheap -{ - struct stbtt__hheap_chunk *head; - void *first_free; - int num_remaining_in_head_chunk; -} stbtt__hheap; - -static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) -{ - if (hh->first_free) { - void *p = hh->first_free; - hh->first_free = * (void **) p; - return p; - } else { - if (hh->num_remaining_in_head_chunk == 0) { - int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); - stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); - if (c == NULL) - return NULL; - c->next = hh->head; - hh->head = c; - hh->num_remaining_in_head_chunk = count; - } - --hh->num_remaining_in_head_chunk; - return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk; - } -} - -static void stbtt__hheap_free(stbtt__hheap *hh, void *p) -{ - *(void **) p = hh->first_free; - hh->first_free = p; -} - -static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) -{ - stbtt__hheap_chunk *c = hh->head; - while (c) { - stbtt__hheap_chunk *n = c->next; - STBTT_free(c, userdata); - c = n; - } -} - -typedef struct stbtt__edge { - float x0,y0, x1,y1; - int invert; -} stbtt__edge; - - -typedef struct stbtt__active_edge -{ - struct stbtt__active_edge *next; - #if STBTT_RASTERIZER_VERSION==1 - int x,dx; - float ey; - int direction; - #elif STBTT_RASTERIZER_VERSION==2 - float fx,fdx,fdy; - float direction; - float sy; - float ey; - #else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" - #endif -} stbtt__active_edge; - -#if STBTT_RASTERIZER_VERSION == 1 -#define STBTT_FIXSHIFT 10 -#define STBTT_FIX (1 << STBTT_FIXSHIFT) -#define STBTT_FIXMASK (STBTT_FIX-1) - -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - if (!z) return z; - - // round dx down to avoid overshooting - if (dxdy < 0) - z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); - else - z->dx = STBTT_ifloor(STBTT_FIX * dxdy); - - z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount - z->x -= off_x * STBTT_FIX; - - z->ey = e->y1; - z->next = 0; - z->direction = e->invert ? 1 : -1; - return z; -} -#elif STBTT_RASTERIZER_VERSION == 2 -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - //STBTT_assert(e->y0 <= start_point); - if (!z) return z; - z->fdx = dxdy; - z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; - z->fx = e->x0 + dxdy * (start_point - e->y0); - z->fx -= off_x; - z->direction = e->invert ? 1.0f : -1.0f; - z->sy = e->y0; - z->ey = e->y1; - z->next = 0; - return z; -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#if STBTT_RASTERIZER_VERSION == 1 -// note: this routine clips fills that extend off the edges... ideally this -// wouldn't happen, but it could happen if the truetype glyph bounding boxes -// are wrong, or if the user supplies a too-small bitmap -static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) -{ - // non-zero winding fill - int x0=0, w=0; - - while (e) { - if (w == 0) { - // if we're currently at zero, we need to record the edge start point - x0 = e->x; w += e->direction; - } else { - int x1 = e->x; w += e->direction; - // if we went to zero, we need to draw - if (w == 0) { - int i = x0 >> STBTT_FIXSHIFT; - int j = x1 >> STBTT_FIXSHIFT; - - if (i < len && j >= 0) { - if (i == j) { - // x0,x1 are the same pixel, so compute combined coverage - scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); - } else { - if (i >= 0) // add antialiasing for x0 - scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); - else - i = -1; // clip - - if (j < len) // add antialiasing for x1 - scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); - else - j = len; // clip - - for (++i; i < j; ++i) // fill pixels between x0 and x1 - scanline[i] = scanline[i] + (stbtt_uint8) max_weight; - } - } - } - } - - e = e->next; - } -} - -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0; - int max_weight = (255 / vsubsample); // weight per vertical scanline - int s; // vertical subsample index - unsigned char scanline_data[512], *scanline; - - if (result->w > 512) - scanline = (unsigned char *) STBTT_malloc(result->w, userdata); - else - scanline = scanline_data; - - y = off_y * vsubsample; - e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; - - while (j < result->h) { - STBTT_memset(scanline, 0, result->w); - for (s=0; s < vsubsample; ++s) { - // find center of pixel for this scanline - float scan_y = y + 0.5f; - stbtt__active_edge **step = &active; - - // update all active edges; - // remove all active edges that terminate before the center of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - z->x += z->dx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - } - - // resort the list if needed - for(;;) { - int changed=0; - step = &active; - while (*step && (*step)->next) { - if ((*step)->x > (*step)->next->x) { - stbtt__active_edge *t = *step; - stbtt__active_edge *q = t->next; - - t->next = q->next; - q->next = t; - *step = q; - changed = 1; - } - step = &(*step)->next; - } - if (!changed) break; - } - - // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline - while (e->y0 <= scan_y) { - if (e->y1 > scan_y) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); - if (z != NULL) { - // find insertion point - if (active == NULL) - active = z; - else if (z->x < active->x) { - // insert at front - z->next = active; - active = z; - } else { - // find thing to insert AFTER - stbtt__active_edge *p = active; - while (p->next && p->next->x < z->x) - p = p->next; - // at this point, p->next->x is NOT < z->x - z->next = p->next; - p->next = z; - } - } - } - ++e; - } - - // now process all active edges in XOR fashion - if (active) - stbtt__fill_active_edges(scanline, result->w, active, max_weight); - - ++y; - } - STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} - -#elif STBTT_RASTERIZER_VERSION == 2 - -// the edge passed in here does not cross the vertical line at x or the vertical line at x+1 -// (i.e. it has already been clipped to those) -static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) -{ - if (y0 == y1) return; - STBTT_assert(y0 < y1); - STBTT_assert(e->sy <= e->ey); - if (y0 > e->ey) return; - if (y1 < e->sy) return; - if (y0 < e->sy) { - x0 += (x1-x0) * (e->sy - y0) / (y1-y0); - y0 = e->sy; - } - if (y1 > e->ey) { - x1 += (x1-x0) * (e->ey - y1) / (y1-y0); - y1 = e->ey; - } - - if (x0 == x) - STBTT_assert(x1 <= x+1); - else if (x0 == x+1) - STBTT_assert(x1 >= x); - else if (x0 <= x) - STBTT_assert(x1 <= x); - else if (x0 >= x+1) - STBTT_assert(x1 >= x+1); - else - STBTT_assert(x1 >= x && x1 <= x+1); - - if (x0 <= x && x1 <= x) - scanline[x] += e->direction * (y1-y0); - else if (x0 >= x+1 && x1 >= x+1) - ; - else { - STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); - scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position - } -} - -static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) -{ - float y_bottom = y_top+1; - - while (e) { - // brute force every pixel - - // compute intersection points with top & bottom - STBTT_assert(e->ey >= y_top); - - if (e->fdx == 0) { - float x0 = e->fx; - if (x0 < len) { - if (x0 >= 0) { - stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); - stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); - } else { - stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); - } - } - } else { - float x0 = e->fx; - float dx = e->fdx; - float xb = x0 + dx; - float x_top, x_bottom; - float sy0,sy1; - float dy = e->fdy; - STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); - - // compute endpoints of line segment clipped to this scanline (if the - // line segment starts on this scanline. x0 is the intersection of the - // line with y_top, but that may be off the line segment. - if (e->sy > y_top) { - x_top = x0 + dx * (e->sy - y_top); - sy0 = e->sy; - } else { - x_top = x0; - sy0 = y_top; - } - if (e->ey < y_bottom) { - x_bottom = x0 + dx * (e->ey - y_top); - sy1 = e->ey; - } else { - x_bottom = xb; - sy1 = y_bottom; - } - - if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { - // from here on, we don't have to range check x values - - if ((int) x_top == (int) x_bottom) { - float height; - // simple case, only spans one pixel - int x = (int) x_top; - height = sy1 - sy0; - STBTT_assert(x >= 0 && x < len); - scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; - scanline_fill[x] += e->direction * height; // everything right of this pixel is filled - } else { - int x,x1,x2; - float y_crossing, step, sign, area; - // covers 2+ pixels - if (x_top > x_bottom) { - // flip scanline vertically; signed area is the same - float t; - sy0 = y_bottom - (sy0 - y_top); - sy1 = y_bottom - (sy1 - y_top); - t = sy0, sy0 = sy1, sy1 = t; - t = x_bottom, x_bottom = x_top, x_top = t; - dx = -dx; - dy = -dy; - t = x0, x0 = xb, xb = t; - // [DEAR IMGUI] Fix static analyzer warning - (void)dx; // [ImGui: fix static analyzer warning] - } - - x1 = (int) x_top; - x2 = (int) x_bottom; - // compute intersection with y axis at x1+1 - y_crossing = (x1+1 - x0) * dy + y_top; - - sign = e->direction; - // area of the rectangle covered from y0..y_crossing - area = sign * (y_crossing-sy0); - // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) - scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); - - step = sign * dy; - for (x = x1+1; x < x2; ++x) { - scanline[x] += area + step/2; - area += step; - } - y_crossing += dy * (x2 - (x1+1)); - - STBTT_assert(STBTT_fabs(area) <= 1.01f); - - scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); - - scanline_fill[x2] += sign * (sy1-sy0); - } - } else { - // if edge goes outside of box we're drawing, we require - // clipping logic. since this does not match the intended use - // of this library, we use a different, very slow brute - // force implementation - int x; - for (x=0; x < len; ++x) { - // cases: - // - // there can be up to two intersections with the pixel. any intersection - // with left or right edges can be handled by splitting into two (or three) - // regions. intersections with top & bottom do not necessitate case-wise logic. - // - // the old way of doing this found the intersections with the left & right edges, - // then used some simple logic to produce up to three segments in sorted order - // from top-to-bottom. however, this had a problem: if an x edge was epsilon - // across the x border, then the corresponding y position might not be distinct - // from the other y segment, and it might ignored as an empty segment. to avoid - // that, we need to explicitly produce segments based on x positions. - - // rename variables to clearly-defined pairs - float y0 = y_top; - float x1 = (float) (x); - float x2 = (float) (x+1); - float x3 = xb; - float y3 = y_bottom; - - // x = e->x + e->dx * (y-y_top) - // (y-y_top) = (x - e->x) / e->dx - // y = (x - e->x) / e->dx + y_top - float y1 = (x - x0) / dx + y_top; - float y2 = (x+1 - x0) / dx + y_top; - - if (x0 < x1 && x3 > x2) { // three segments descending down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x1 && x0 > x2) { // three segments descending down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else { // one segment - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); - } - } - } - } - e = e->next; - } -} - -// directly AA rasterize edges w/o supersampling -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0, i; - float scanline_data[129], *scanline, *scanline2; - - STBTT__NOTUSED(vsubsample); - - if (result->w > 64) - scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); - else - scanline = scanline_data; - - scanline2 = scanline + result->w; - - y = off_y; - e[n].y0 = (float) (off_y + result->h) + 1; - - while (j < result->h) { - // find center of pixel for this scanline - float scan_y_top = y + 0.0f; - float scan_y_bottom = y + 1.0f; - stbtt__active_edge **step = &active; - - STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); - STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); - - // update all active edges; - // remove all active edges that terminate before the top of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y_top) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - step = &((*step)->next); // advance through list - } - } - - // insert all edges that start before the bottom of this scanline - while (e->y0 <= scan_y_bottom) { - if (e->y0 != e->y1) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); - if (z != NULL) { - if (j == 0 && off_y != 0) { - if (z->ey < scan_y_top) { - // this can happen due to subpixel positioning and some kind of fp rounding error i think - z->ey = scan_y_top; - } - } - STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds - // insert at front - z->next = active; - active = z; - } - } - ++e; - } - - // now process all active edges - if (active) - stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); - - { - float sum = 0; - for (i=0; i < result->w; ++i) { - float k; - int m; - sum += scanline2[i]; - k = scanline[i] + sum; - k = (float) STBTT_fabs(k)*255 + 0.5f; - m = (int) k; - if (m > 255) m = 255; - result->pixels[j*result->stride + i] = (unsigned char) m; - } - } - // advance all the edges - step = &active; - while (*step) { - stbtt__active_edge *z = *step; - z->fx += z->fdx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - - ++y; - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) - -static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) -{ - int i,j; - for (i=1; i < n; ++i) { - stbtt__edge t = p[i], *a = &t; - j = i; - while (j > 0) { - stbtt__edge *b = &p[j-1]; - int c = STBTT__COMPARE(a,b); - if (!c) break; - p[j] = p[j-1]; - --j; - } - if (i != j) - p[j] = t; - } -} - -static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) -{ - /* threshold for transitioning to insertion sort */ - while (n > 12) { - stbtt__edge t; - int c01,c12,c,m,i,j; - - /* compute median of three */ - m = n >> 1; - c01 = STBTT__COMPARE(&p[0],&p[m]); - c12 = STBTT__COMPARE(&p[m],&p[n-1]); - /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ - if (c01 != c12) { - /* otherwise, we'll need to swap something else to middle */ - int z; - c = STBTT__COMPARE(&p[0],&p[n-1]); - /* 0>mid && midn => n; 0 0 */ - /* 0n: 0>n => 0; 0 n */ - z = (c == c12) ? 0 : n-1; - t = p[z]; - p[z] = p[m]; - p[m] = t; - } - /* now p[m] is the median-of-three */ - /* swap it to the beginning so it won't move around */ - t = p[0]; - p[0] = p[m]; - p[m] = t; - - /* partition loop */ - i=1; - j=n-1; - for(;;) { - /* handling of equality is crucial here */ - /* for sentinels & efficiency with duplicates */ - for (;;++i) { - if (!STBTT__COMPARE(&p[i], &p[0])) break; - } - for (;;--j) { - if (!STBTT__COMPARE(&p[0], &p[j])) break; - } - /* make sure we haven't crossed */ - if (i >= j) break; - t = p[i]; - p[i] = p[j]; - p[j] = t; - - ++i; - --j; - } - /* recurse on smaller side, iterate on larger */ - if (j < (n-i)) { - stbtt__sort_edges_quicksort(p,j); - p = p+i; - n = n-i; - } else { - stbtt__sort_edges_quicksort(p+i, n-i); - n = j; - } - } -} - -static void stbtt__sort_edges(stbtt__edge *p, int n) -{ - stbtt__sort_edges_quicksort(p, n); - stbtt__sort_edges_ins_sort(p, n); -} - -typedef struct -{ - float x,y; -} stbtt__point; - -static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) -{ - float y_scale_inv = invert ? -scale_y : scale_y; - stbtt__edge *e; - int n,i,j,k,m; -#if STBTT_RASTERIZER_VERSION == 1 - int vsubsample = result->h < 8 ? 15 : 5; -#elif STBTT_RASTERIZER_VERSION == 2 - int vsubsample = 1; -#else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - // vsubsample should divide 255 evenly; otherwise we won't reach full opacity - - // now we have to blow out the windings into explicit edge lists - n = 0; - for (i=0; i < windings; ++i) - n += wcount[i]; - - e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel - if (e == 0) return; - n = 0; - - m=0; - for (i=0; i < windings; ++i) { - stbtt__point *p = pts + m; - m += wcount[i]; - j = wcount[i]-1; - for (k=0; k < wcount[i]; j=k++) { - int a=k,b=j; - // skip the edge if horizontal - if (p[j].y == p[k].y) - continue; - // add edge from j to k to the list - e[n].invert = 0; - if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { - e[n].invert = 1; - a=j,b=k; - } - e[n].x0 = p[a].x * scale_x + shift_x; - e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; - e[n].x1 = p[b].x * scale_x + shift_x; - e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; - ++n; - } - } - - // now sort the edges by their highest point (should snap to integer, and then by x) - //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); - stbtt__sort_edges(e, n); - - // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule - stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); - - STBTT_free(e, userdata); -} - -static void stbtt__add_point(stbtt__point *points, int n, float x, float y) -{ - if (!points) return; // during first pass, it's unallocated - points[n].x = x; - points[n].y = y; -} - -// tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching -static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) -{ - // midpoint - float mx = (x0 + 2*x1 + x2)/4; - float my = (y0 + 2*y1 + y2)/4; - // versus directly drawn line - float dx = (x0+x2)/2 - mx; - float dy = (y0+y2)/2 - my; - if (n > 16) // 65536 segments on one curve better be enough! - return 1; - if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA - stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); - stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); - } else { - stbtt__add_point(points, *num_points,x2,y2); - *num_points = *num_points+1; - } - return 1; -} - -static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n) -{ - // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough - float dx0 = x1-x0; - float dy0 = y1-y0; - float dx1 = x2-x1; - float dy1 = y2-y1; - float dx2 = x3-x2; - float dy2 = y3-y2; - float dx = x3-x0; - float dy = y3-y0; - float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2)); - float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy); - float flatness_squared = longlen*longlen-shortlen*shortlen; - - if (n > 16) // 65536 segments on one curve better be enough! - return; - - if (flatness_squared > objspace_flatness_squared) { - float x01 = (x0+x1)/2; - float y01 = (y0+y1)/2; - float x12 = (x1+x2)/2; - float y12 = (y1+y2)/2; - float x23 = (x2+x3)/2; - float y23 = (y2+y3)/2; - - float xa = (x01+x12)/2; - float ya = (y01+y12)/2; - float xb = (x12+x23)/2; - float yb = (y12+y23)/2; - - float mx = (xa+xb)/2; - float my = (ya+yb)/2; - - stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1); - stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1); - } else { - stbtt__add_point(points, *num_points,x3,y3); - *num_points = *num_points+1; - } -} - -// returns number of contours -static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) -{ - stbtt__point *points=0; - int num_points=0; - - float objspace_flatness_squared = objspace_flatness * objspace_flatness; - int i,n=0,start=0, pass; - - // count how many "moves" there are to get the contour count - for (i=0; i < num_verts; ++i) - if (vertices[i].type == STBTT_vmove) - ++n; - - *num_contours = n; - if (n == 0) return 0; - - *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); - - if (*contour_lengths == 0) { - *num_contours = 0; - return 0; - } - - // make two passes through the points so we don't need to realloc - for (pass=0; pass < 2; ++pass) { - float x=0,y=0; - if (pass == 1) { - points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); - if (points == NULL) goto error; - } - num_points = 0; - n= -1; - for (i=0; i < num_verts; ++i) { - switch (vertices[i].type) { - case STBTT_vmove: - // start the next contour - if (n >= 0) - (*contour_lengths)[n] = num_points - start; - ++n; - start = num_points; - - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x,y); - break; - case STBTT_vline: - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x, y); - break; - case STBTT_vcurve: - stbtt__tesselate_curve(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - case STBTT_vcubic: - stbtt__tesselate_cubic(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].cx1, vertices[i].cy1, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - } - } - (*contour_lengths)[n] = num_points - start; - } - - return points; -error: - STBTT_free(points, userdata); - STBTT_free(*contour_lengths, userdata); - *contour_lengths = 0; - *num_contours = 0; - return NULL; -} - -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) -{ - float scale = scale_x > scale_y ? scale_y : scale_x; - int winding_count = 0; - int *winding_lengths = NULL; - stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); - if (windings) { - stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); - STBTT_free(winding_lengths, userdata); - STBTT_free(windings, userdata); - } -} - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) -{ - STBTT_free(bitmap, userdata); -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - int ix0,iy0,ix1,iy1; - stbtt__bitmap gbm; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - - if (scale_x == 0) scale_x = scale_y; - if (scale_y == 0) { - if (scale_x == 0) { - STBTT_free(vertices, info->userdata); - return NULL; - } - scale_y = scale_x; - } - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); - - // now we get the size - gbm.w = (ix1 - ix0); - gbm.h = (iy1 - iy0); - gbm.pixels = NULL; // in case we error - - if (width ) *width = gbm.w; - if (height) *height = gbm.h; - if (xoff ) *xoff = ix0; - if (yoff ) *yoff = iy0; - - if (gbm.w && gbm.h) { - gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); - if (gbm.pixels) { - gbm.stride = gbm.w; - - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); - } - } - STBTT_free(vertices, info->userdata); - return gbm.pixels; -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); -} - -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) -{ - int ix0,iy0; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); - gbm.pixels = output; - gbm.w = out_w; - gbm.h = out_h; - gbm.stride = out_stride; - - if (gbm.w && gbm.h) - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); - - STBTT_free(vertices, info->userdata); -} - -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint) -{ - stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, stbtt_FindGlyphIndex(info,codepoint)); -} - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) -{ - stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); -} - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-CRAPPY packing to keep source code small - -static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata) -{ - float scale; - int x,y,bottom_y, i; - stbtt_fontinfo f; - f.userdata = NULL; - if (!stbtt_InitFont(&f, data, offset)) - return -1; - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - x=y=1; - bottom_y = 1; - - scale = stbtt_ScaleForPixelHeight(&f, pixel_height); - - for (i=0; i < num_chars; ++i) { - int advance, lsb, x0,y0,x1,y1,gw,gh; - int g = stbtt_FindGlyphIndex(&f, first_char + i); - stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); - stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); - gw = x1-x0; - gh = y1-y0; - if (x + gw + 1 >= pw) - y = bottom_y, x = 1; // advance to next row - if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row - return -i; - STBTT_assert(x+gw < pw); - STBTT_assert(y+gh < ph); - stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); - chardata[i].x0 = (stbtt_int16) x; - chardata[i].y0 = (stbtt_int16) y; - chardata[i].x1 = (stbtt_int16) (x + gw); - chardata[i].y1 = (stbtt_int16) (y + gh); - chardata[i].xadvance = scale * advance; - chardata[i].xoff = (float) x0; - chardata[i].yoff = (float) y0; - x = x + gw + 1; - if (y+gh+1 > bottom_y) - bottom_y = y+gh+1; - } - return bottom_y; -} - -STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) -{ - float d3d_bias = opengl_fillrule ? 0 : -0.5f; - float ipw = 1.0f / pw, iph = 1.0f / ph; - const stbtt_bakedchar *b = chardata + char_index; - int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); - int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); - - q->x0 = round_x + d3d_bias; - q->y0 = round_y + d3d_bias; - q->x1 = round_x + b->x1 - b->x0 + d3d_bias; - q->y1 = round_y + b->y1 - b->y0 + d3d_bias; - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - -////////////////////////////////////////////////////////////////////////////// -// -// rectangle packing replacement routines if you don't have stb_rect_pack.h -// - -#ifndef STB_RECT_PACK_VERSION - -typedef int stbrp_coord; - -//////////////////////////////////////////////////////////////////////////////////// -// // -// // -// COMPILER WARNING ?!?!? // -// // -// // -// if you get a compile warning due to these symbols being defined more than // -// once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // -// // -//////////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ - int width,height; - int x,y,bottom_y; -} stbrp_context; - -typedef struct -{ - unsigned char x; -} stbrp_node; - -struct stbrp_rect -{ - stbrp_coord x,y; - int id,w,h,was_packed; -}; - -static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) -{ - con->width = pw; - con->height = ph; - con->x = 0; - con->y = 0; - con->bottom_y = 0; - STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); -} - -static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) -{ - int i; - for (i=0; i < num_rects; ++i) { - if (con->x + rects[i].w > con->width) { - con->x = 0; - con->y = con->bottom_y; - } - if (con->y + rects[i].h > con->height) - break; - rects[i].x = con->x; - rects[i].y = con->y; - rects[i].was_packed = 1; - con->x += rects[i].w; - if (con->y + rects[i].h > con->bottom_y) - con->bottom_y = con->y + rects[i].h; - } - for ( ; i < num_rects; ++i) - rects[i].was_packed = 0; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If -// stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) -{ - stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); - int num_nodes = pw - padding; - stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); - - if (context == NULL || nodes == NULL) { - if (context != NULL) STBTT_free(context, alloc_context); - if (nodes != NULL) STBTT_free(nodes , alloc_context); - return 0; - } - - spc->user_allocator_context = alloc_context; - spc->width = pw; - spc->height = ph; - spc->pixels = pixels; - spc->pack_info = context; - spc->nodes = nodes; - spc->padding = padding; - spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; - spc->h_oversample = 1; - spc->v_oversample = 1; - spc->skip_missing = 0; - - stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); - - if (pixels) - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - - return 1; -} - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) -{ - STBTT_free(spc->nodes , spc->user_allocator_context); - STBTT_free(spc->pack_info, spc->user_allocator_context); -} - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) -{ - STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); - STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); - if (h_oversample <= STBTT_MAX_OVERSAMPLE) - spc->h_oversample = h_oversample; - if (v_oversample <= STBTT_MAX_OVERSAMPLE) - spc->v_oversample = v_oversample; -} - -STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip) -{ - spc->skip_missing = skip; -} - -#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) - -static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_w = w - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < h; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < w; ++i) { - STBTT_assert(pixels[i] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i] = (unsigned char) (total / kernel_width); - } - - pixels += stride_in_bytes; - } -} - -static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_h = h - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < w; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < h; ++i) { - STBTT_assert(pixels[i*stride_in_bytes] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - - pixels += 1; - } -} - -static float stbtt__oversample_shift(int oversample) -{ - if (!oversample) - return 0.0f; - - // The prefilter is a box filter of width "oversample", - // which shifts phase by (oversample - 1)/2 pixels in - // oversampled space. We want to shift in the opposite - // direction to counter this. - return (float)-(oversample - 1) / (2.0f * (float)oversample); -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k; - - k=0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - ranges[i].h_oversample = (unsigned char) spc->h_oversample; - ranges[i].v_oversample = (unsigned char) spc->v_oversample; - for (j=0; j < ranges[i].num_chars; ++j) { - int x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - if (glyph == 0 && spc->skip_missing) { - rects[k].w = rects[k].h = 0; - } else { - stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - &x0,&y0,&x1,&y1); - rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); - rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); - } - ++k; - } - } - - return k; -} - -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph) -{ - stbtt_MakeGlyphBitmapSubpixel(info, - output, - out_w - (prefilter_x - 1), - out_h - (prefilter_y - 1), - out_stride, - scale_x, - scale_y, - shift_x, - shift_y, - glyph); - - if (prefilter_x > 1) - stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x); - - if (prefilter_y > 1) - stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y); - - *sub_x = stbtt__oversample_shift(prefilter_x); - *sub_y = stbtt__oversample_shift(prefilter_y); -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k, return_value = 1; - - // save current values - int old_h_over = spc->h_oversample; - int old_v_over = spc->v_oversample; - - k = 0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - float recip_h,recip_v,sub_x,sub_y; - spc->h_oversample = ranges[i].h_oversample; - spc->v_oversample = ranges[i].v_oversample; - recip_h = 1.0f / spc->h_oversample; - recip_v = 1.0f / spc->v_oversample; - sub_x = stbtt__oversample_shift(spc->h_oversample); - sub_y = stbtt__oversample_shift(spc->v_oversample); - for (j=0; j < ranges[i].num_chars; ++j) { - stbrp_rect *r = &rects[k]; - if (r->was_packed && r->w != 0 && r->h != 0) { - stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; - int advance, lsb, x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - stbrp_coord pad = (stbrp_coord) spc->padding; - - // pad on left and top - r->x += pad; - r->y += pad; - r->w -= pad; - r->h -= pad; - stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); - stbtt_GetGlyphBitmapBox(info, glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - &x0,&y0,&x1,&y1); - stbtt_MakeGlyphBitmapSubpixel(info, - spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w - spc->h_oversample+1, - r->h - spc->v_oversample+1, - spc->stride_in_bytes, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - glyph); - - if (spc->h_oversample > 1) - stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->h_oversample); - - if (spc->v_oversample > 1) - stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->v_oversample); - - bc->x0 = (stbtt_int16) r->x; - bc->y0 = (stbtt_int16) r->y; - bc->x1 = (stbtt_int16) (r->x + r->w); - bc->y1 = (stbtt_int16) (r->y + r->h); - bc->xadvance = scale * advance; - bc->xoff = (float) x0 * recip_h + sub_x; - bc->yoff = (float) y0 * recip_v + sub_y; - bc->xoff2 = (x0 + r->w) * recip_h + sub_x; - bc->yoff2 = (y0 + r->h) * recip_v + sub_y; - } else { - return_value = 0; // if any fail, report failure - } - - ++k; - } - } - - // restore original values - spc->h_oversample = old_h_over; - spc->v_oversample = old_v_over; - - return return_value; -} - -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) -{ - stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); -} - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) -{ - stbtt_fontinfo info; - int i,j,n, return_value; // [DEAR IMGUI] removed = 1 - //stbrp_context *context = (stbrp_context *) spc->pack_info; - stbrp_rect *rects; - - // flag all characters as NOT packed - for (i=0; i < num_ranges; ++i) - for (j=0; j < ranges[i].num_chars; ++j) - ranges[i].chardata_for_range[j].x0 = - ranges[i].chardata_for_range[j].y0 = - ranges[i].chardata_for_range[j].x1 = - ranges[i].chardata_for_range[j].y1 = 0; - - n = 0; - for (i=0; i < num_ranges; ++i) - n += ranges[i].num_chars; - - rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); - if (rects == NULL) - return 0; - - info.userdata = spc->user_allocator_context; - stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); - - n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); - - stbtt_PackFontRangesPackRects(spc, rects, n); - - return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); - - STBTT_free(rects, spc->user_allocator_context); - return return_value; -} - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, - int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) -{ - stbtt_pack_range range; - range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; - range.array_of_unicode_codepoints = NULL; - range.num_chars = num_chars_in_range; - range.chardata_for_range = chardata_for_range; - range.font_size = font_size; - return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); -} - -STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap) -{ - int i_ascent, i_descent, i_lineGap; - float scale; - stbtt_fontinfo info; - stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index)); - scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size); - stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap); - *ascent = (float) i_ascent * scale; - *descent = (float) i_descent * scale; - *lineGap = (float) i_lineGap * scale; -} - -STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) -{ - float ipw = 1.0f / pw, iph = 1.0f / ph; - const stbtt_packedchar *b = chardata + char_index; - - if (align_to_integer) { - float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); - float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); - q->x0 = x; - q->y0 = y; - q->x1 = x + b->xoff2 - b->xoff; - q->y1 = y + b->yoff2 - b->yoff; - } else { - q->x0 = *xpos + b->xoff; - q->y0 = *ypos + b->yoff; - q->x1 = *xpos + b->xoff2; - q->y1 = *ypos + b->yoff2; - } - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - -////////////////////////////////////////////////////////////////////////////// -// -// sdf computation -// - -#define STBTT_min(a,b) ((a) < (b) ? (a) : (b)) -#define STBTT_max(a,b) ((a) < (b) ? (b) : (a)) - -static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], float q0[2], float q1[2], float q2[2], float hits[2][2]) -{ - float q0perp = q0[1]*ray[0] - q0[0]*ray[1]; - float q1perp = q1[1]*ray[0] - q1[0]*ray[1]; - float q2perp = q2[1]*ray[0] - q2[0]*ray[1]; - float roperp = orig[1]*ray[0] - orig[0]*ray[1]; - - float a = q0perp - 2*q1perp + q2perp; - float b = q1perp - q0perp; - float c = q0perp - roperp; - - float s0 = 0., s1 = 0.; - int num_s = 0; - - if (a != 0.0) { - float discr = b*b - a*c; - if (discr > 0.0) { - float rcpna = -1 / a; - float d = (float) STBTT_sqrt(discr); - s0 = (b+d) * rcpna; - s1 = (b-d) * rcpna; - if (s0 >= 0.0 && s0 <= 1.0) - num_s = 1; - if (d > 0.0 && s1 >= 0.0 && s1 <= 1.0) { - if (num_s == 0) s0 = s1; - ++num_s; - } - } - } else { - // 2*b*s + c = 0 - // s = -c / (2*b) - s0 = c / (-2 * b); - if (s0 >= 0.0 && s0 <= 1.0) - num_s = 1; - } - - if (num_s == 0) - return 0; - else { - float rcp_len2 = 1 / (ray[0]*ray[0] + ray[1]*ray[1]); - float rayn_x = ray[0] * rcp_len2, rayn_y = ray[1] * rcp_len2; - - float q0d = q0[0]*rayn_x + q0[1]*rayn_y; - float q1d = q1[0]*rayn_x + q1[1]*rayn_y; - float q2d = q2[0]*rayn_x + q2[1]*rayn_y; - float rod = orig[0]*rayn_x + orig[1]*rayn_y; - - float q10d = q1d - q0d; - float q20d = q2d - q0d; - float q0rd = q0d - rod; - - hits[0][0] = q0rd + s0*(2.0f - 2.0f*s0)*q10d + s0*s0*q20d; - hits[0][1] = a*s0+b; - - if (num_s > 1) { - hits[1][0] = q0rd + s1*(2.0f - 2.0f*s1)*q10d + s1*s1*q20d; - hits[1][1] = a*s1+b; - return 2; - } else { - return 1; - } - } -} - -static int equal(float *a, float *b) -{ - return (a[0] == b[0] && a[1] == b[1]); -} - -static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex *verts) -{ - int i; - float orig[2], ray[2] = { 1, 0 }; - float y_frac; - int winding = 0; - - orig[0] = x; - //orig[1] = y; // [DEAR IMGUI] commmented double assignment - - // make sure y never passes through a vertex of the shape - y_frac = (float) STBTT_fmod(y, 1.0f); - if (y_frac < 0.01f) - y += 0.01f; - else if (y_frac > 0.99f) - y -= 0.01f; - orig[1] = y; - - // test a ray from (-infinity,y) to (x,y) - for (i=0; i < nverts; ++i) { - if (verts[i].type == STBTT_vline) { - int x0 = (int) verts[i-1].x, y0 = (int) verts[i-1].y; - int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; - if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { - float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) - winding += (y0 < y1) ? 1 : -1; - } - } - if (verts[i].type == STBTT_vcurve) { - int x0 = (int) verts[i-1].x , y0 = (int) verts[i-1].y ; - int x1 = (int) verts[i ].cx, y1 = (int) verts[i ].cy; - int x2 = (int) verts[i ].x , y2 = (int) verts[i ].y ; - int ax = STBTT_min(x0,STBTT_min(x1,x2)), ay = STBTT_min(y0,STBTT_min(y1,y2)); - int by = STBTT_max(y0,STBTT_max(y1,y2)); - if (y > ay && y < by && x > ax) { - float q0[2],q1[2],q2[2]; - float hits[2][2]; - q0[0] = (float)x0; - q0[1] = (float)y0; - q1[0] = (float)x1; - q1[1] = (float)y1; - q2[0] = (float)x2; - q2[1] = (float)y2; - if (equal(q0,q1) || equal(q1,q2)) { - x0 = (int)verts[i-1].x; - y0 = (int)verts[i-1].y; - x1 = (int)verts[i ].x; - y1 = (int)verts[i ].y; - if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { - float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) - winding += (y0 < y1) ? 1 : -1; - } - } else { - int num_hits = stbtt__ray_intersect_bezier(orig, ray, q0, q1, q2, hits); - if (num_hits >= 1) - if (hits[0][0] < 0) - winding += (hits[0][1] < 0 ? -1 : 1); - if (num_hits >= 2) - if (hits[1][0] < 0) - winding += (hits[1][1] < 0 ? -1 : 1); - } - } - } - } - return winding; -} - -static float stbtt__cuberoot( float x ) -{ - if (x<0) - return -(float) STBTT_pow(-x,1.0f/3.0f); - else - return (float) STBTT_pow( x,1.0f/3.0f); -} - -// x^3 + c*x^2 + b*x + a = 0 -static int stbtt__solve_cubic(float a, float b, float c, float* r) -{ - float s = -a / 3; - float p = b - a*a / 3; - float q = a * (2*a*a - 9*b) / 27 + c; - float p3 = p*p*p; - float d = q*q + 4*p3 / 27; - if (d >= 0) { - float z = (float) STBTT_sqrt(d); - float u = (-q + z) / 2; - float v = (-q - z) / 2; - u = stbtt__cuberoot(u); - v = stbtt__cuberoot(v); - r[0] = s + u + v; - return 1; - } else { - float u = (float) STBTT_sqrt(-p/3); - float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative - float m = (float) STBTT_cos(v); - float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f; - r[0] = s + u * 2 * m; - r[1] = s - u * (m + n); - r[2] = s - u * (m - n); - - //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe? - //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f); - //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f); - return 3; - } -} - -STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) -{ - float scale_x = scale, scale_y = scale; - int ix0,iy0,ix1,iy1; - int w,h; - unsigned char *data; - - // if one scale is 0, use same scale for both - if (scale_x == 0) scale_x = scale_y; - if (scale_y == 0) { - if (scale_x == 0) return NULL; // if both scales are 0, return NULL - scale_y = scale_x; - } - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1); - - // if empty, return NULL - if (ix0 == ix1 || iy0 == iy1) - return NULL; - - ix0 -= padding; - iy0 -= padding; - ix1 += padding; - iy1 += padding; - - w = (ix1 - ix0); - h = (iy1 - iy0); - - if (width ) *width = w; - if (height) *height = h; - if (xoff ) *xoff = ix0; - if (yoff ) *yoff = iy0; - - // invert for y-downwards bitmaps - scale_y = -scale_y; - - { - int x,y,i,j; - float *precompute; - stbtt_vertex *verts; - int num_verts = stbtt_GetGlyphShape(info, glyph, &verts); - data = (unsigned char *) STBTT_malloc(w * h, info->userdata); - precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata); - - for (i=0,j=num_verts-1; i < num_verts; j=i++) { - if (verts[i].type == STBTT_vline) { - float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; - float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; - float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); - precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; - } else if (verts[i].type == STBTT_vcurve) { - float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; - float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; - float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; - float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; - float len2 = bx*bx + by*by; - if (len2 != 0.0f) - precompute[i] = 1.0f / (bx*bx + by*by); - else - precompute[i] = 0.0f; - } else - precompute[i] = 0.0f; - } - - for (y=iy0; y < iy1; ++y) { - for (x=ix0; x < ix1; ++x) { - float val; - float min_dist = 999999.0f; - float sx = (float) x + 0.5f; - float sy = (float) y + 0.5f; - float x_gspace = (sx / scale_x); - float y_gspace = (sy / scale_y); - - int winding = stbtt__compute_crossings_x(x_gspace, y_gspace, num_verts, verts); // @OPTIMIZE: this could just be a rasterization, but needs to be line vs. non-tesselated curves so a new path - - for (i=0; i < num_verts; ++i) { - float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; - - // check against every point here rather than inside line/curve primitives -- @TODO: wrong if multiple 'moves' in a row produce a garbage point, and given culling, probably more efficient to do within line/curve - float dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); - if (dist2 < min_dist*min_dist) - min_dist = (float) STBTT_sqrt(dist2); - - if (verts[i].type == STBTT_vline) { - float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y; - - // coarse culling against bbox - //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist && - // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist) - float dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; - STBTT_assert(i != 0); - if (dist < min_dist) { - // check position along line - // x' = x0 + t*(x1-x0), y' = y0 + t*(y1-y0) - // minimize (x'-sx)*(x'-sx)+(y'-sy)*(y'-sy) - float dx = x1-x0, dy = y1-y0; - float px = x0-sx, py = y0-sy; - // minimize (px+t*dx)^2 + (py+t*dy)^2 = px*px + 2*px*dx*t + t^2*dx*dx + py*py + 2*py*dy*t + t^2*dy*dy - // derivative: 2*px*dx + 2*py*dy + (2*dx*dx+2*dy*dy)*t, set to 0 and solve - float t = -(px*dx + py*dy) / (dx*dx + dy*dy); - if (t >= 0.0f && t <= 1.0f) - min_dist = dist; - } - } else if (verts[i].type == STBTT_vcurve) { - float x2 = verts[i-1].x *scale_x, y2 = verts[i-1].y *scale_y; - float x1 = verts[i ].cx*scale_x, y1 = verts[i ].cy*scale_y; - float box_x0 = STBTT_min(STBTT_min(x0,x1),x2); - float box_y0 = STBTT_min(STBTT_min(y0,y1),y2); - float box_x1 = STBTT_max(STBTT_max(x0,x1),x2); - float box_y1 = STBTT_max(STBTT_max(y0,y1),y2); - // coarse culling against bbox to avoid computing cubic unnecessarily - if (sx > box_x0-min_dist && sx < box_x1+min_dist && sy > box_y0-min_dist && sy < box_y1+min_dist) { - int num=0; - float ax = x1-x0, ay = y1-y0; - float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; - float mx = x0 - sx, my = y0 - sy; - float res[3],px,py,t,it; - float a_inv = precompute[i]; - if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula - float a = 3*(ax*bx + ay*by); - float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); - float c = mx*ax+my*ay; - if (a == 0.0) { // if a is 0, it's linear - if (b != 0.0) { - res[num++] = -c/b; - } - } else { - float discriminant = b*b - 4*a*c; - if (discriminant < 0) - num = 0; - else { - float root = (float) STBTT_sqrt(discriminant); - res[0] = (-b - root)/(2*a); - res[1] = (-b + root)/(2*a); - num = 2; // don't bother distinguishing 1-solution case, as code below will still work - } - } - } else { - float b = 3*(ax*bx + ay*by) * a_inv; // could precompute this as it doesn't depend on sample point - float c = (2*(ax*ax + ay*ay) + (mx*bx+my*by)) * a_inv; - float d = (mx*ax+my*ay) * a_inv; - num = stbtt__solve_cubic(b, c, d, res); - } - if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) { - t = res[0], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - if (num >= 2 && res[1] >= 0.0f && res[1] <= 1.0f) { - t = res[1], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - if (num >= 3 && res[2] >= 0.0f && res[2] <= 1.0f) { - t = res[2], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - } - } - } - if (winding == 0) - min_dist = -min_dist; // if outside the shape, value is negative - val = onedge_value + pixel_dist_scale * min_dist; - if (val < 0) - val = 0; - else if (val > 255) - val = 255; - data[(y-iy0)*w+(x-ix0)] = (unsigned char) val; - } - } - STBTT_free(precompute, info->userdata); - STBTT_free(verts, info->userdata); - } - return data; -} - -STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphSDF(info, scale, stbtt_FindGlyphIndex(info, codepoint), padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); -} - -STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) -{ - STBTT_free(bitmap, userdata); -} - -////////////////////////////////////////////////////////////////////////////// -// -// font name matching -- recommended not to use this -// - -// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) -{ - stbtt_int32 i=0; - - // convert utf16 to utf8 and compare the results while converting - while (len2) { - stbtt_uint16 ch = s2[0]*256 + s2[1]; - if (ch < 0x80) { - if (i >= len1) return -1; - if (s1[i++] != ch) return -1; - } else if (ch < 0x800) { - if (i+1 >= len1) return -1; - if (s1[i++] != 0xc0 + (ch >> 6)) return -1; - if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; - } else if (ch >= 0xd800 && ch < 0xdc00) { - stbtt_uint32 c; - stbtt_uint16 ch2 = s2[2]*256 + s2[3]; - if (i+3 >= len1) return -1; - c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; - if (s1[i++] != 0xf0 + (c >> 18)) return -1; - if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; - s2 += 2; // plus another 2 below - len2 -= 2; - } else if (ch >= 0xdc00 && ch < 0xe000) { - return -1; - } else { - if (i+2 >= len1) return -1; - if (s1[i++] != 0xe0 + (ch >> 12)) return -1; - if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; - } - s2 += 2; - len2 -= 2; - } - return i; -} - -static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) -{ - return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); -} - -// returns results in whatever encoding you request... but note that 2-byte encodings -// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) -{ - stbtt_int32 i,count,stringOffset; - stbtt_uint8 *fc = font->data; - stbtt_uint32 offset = font->fontstart; - stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return NULL; - - count = ttUSHORT(fc+nm+2); - stringOffset = nm + ttUSHORT(fc+nm+4); - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) - && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { - *length = ttUSHORT(fc+loc+8); - return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); - } - } - return NULL; -} - -static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) -{ - stbtt_int32 i; - stbtt_int32 count = ttUSHORT(fc+nm+2); - stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); - - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - stbtt_int32 id = ttUSHORT(fc+loc+6); - if (id == target_id) { - // find the encoding - stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); - - // is this a Unicode encoding? - if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { - stbtt_int32 slen = ttUSHORT(fc+loc+8); - stbtt_int32 off = ttUSHORT(fc+loc+10); - - // check if there's a prefix match - stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); - if (matchlen >= 0) { - // check for target_id+1 immediately following, with same encoding & language - if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { - slen = ttUSHORT(fc+loc+12+8); - off = ttUSHORT(fc+loc+12+10); - if (slen == 0) { - if (matchlen == nlen) - return 1; - } else if (matchlen < nlen && name[matchlen] == ' ') { - ++matchlen; - if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) - return 1; - } - } else { - // if nothing immediately following - if (matchlen == nlen) - return 1; - } - } - } - - // @TODO handle other encodings - } - } - return 0; -} - -static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) -{ - stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); - stbtt_uint32 nm,hd; - if (!stbtt__isfont(fc+offset)) return 0; - - // check italics/bold/underline flags in macStyle... - if (flags) { - hd = stbtt__find_table(fc, offset, "head"); - if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; - } - - nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return 0; - - if (flags) { - // if we checked the macStyle flags, then just check the family and ignore the subfamily - if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } else { - if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } - - return 0; -} - -static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags) -{ - stbtt_int32 i; - for (i=0;;++i) { - stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); - if (off < 0) return off; - if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) - return off; - } -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, - float pixel_height, unsigned char *pixels, int pw, int ph, - int first_char, int num_chars, stbtt_bakedchar *chardata) -{ - return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); -} - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) -{ - return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); -} - -STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) -{ - return stbtt_GetNumberOfFonts_internal((unsigned char *) data); -} - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset) -{ - return stbtt_InitFont_internal(info, (unsigned char *) data, offset); -} - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags) -{ - return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags); -} - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) -{ - return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2); -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -#endif // STB_TRUETYPE_IMPLEMENTATION - - -// FULL VERSION HISTORY -// -// 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod -// 1.18 (2018-01-29) add missing function -// 1.17 (2017-07-23) make more arguments const; doc fix -// 1.16 (2017-07-12) SDF support -// 1.15 (2017-03-03) make more arguments const -// 1.14 (2017-01-16) num-fonts-in-TTC function -// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts -// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) allow user-defined fabs() replacement -// fix memory leak if fontsize=0.0 -// fix warning from duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// allow PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) -// also more precise AA rasterizer, except if shapes overlap -// remove need for STBTT_sort -// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC -// 1.04 (2015-04-15) typo in example -// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes -// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ -// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match -// non-oversampled; STBTT_POINT_SIZE for packed case only -// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling -// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) -// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID -// 0.8b (2014-07-07) fix a warning -// 0.8 (2014-05-25) fix a few more warnings -// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back -// 0.6c (2012-07-24) improve documentation -// 0.6b (2012-07-20) fix a few more warnings -// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, -// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty -// 0.5 (2011-12-09) bugfixes: -// subpixel glyph renderer computed wrong bounding box -// first vertex of shape can be off-curve (FreeSans) -// 0.4b (2011-12-03) fixed an error in the font baking example -// 0.4 (2011-12-01) kerning, subpixel rendering (tor) -// bugfixes for: -// codepoint-to-glyph conversion using table fmt=12 -// codepoint-to-glyph conversion using table fmt=4 -// stbtt_GetBakedQuad with non-square texture (Zer) -// updated Hello World! sample to use kerning and subpixel -// fixed some warnings -// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) -// userdata, malloc-from-userdata, non-zero fill (stb) -// 0.2 (2009-03-11) Fix unsigned/signed char warnings -// 0.1 (2009-03-09) First public release -// - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/include/imgui/misc/README.txt b/include/imgui/misc/README.txt deleted file mode 100644 index 86900089..00000000 --- a/include/imgui/misc/README.txt +++ /dev/null @@ -1,24 +0,0 @@ - -misc/cpp/ - InputText() wrappers for C++ standard library (STL) type: std::string. - This is also an example of how you may wrap your own similar types. - -misc/fonts/ - Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts). - Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code. - Suggested fonts and links. - -misc/freetype/ - Font atlas builder/rasterizer using FreeType instead of stb_truetype. - Benefit from better FreeType rasterization, in particular for small fonts. - -misc/natvis/ - Natvis file to describe dear imgui types in the Visual Studio debugger. - With this, types like ImVector<> will be displayed nicely in the debugger. - You can include this file a Visual Studio project file, or install it in Visual Studio folder. - -misc/single_file/ - Single-file header stub. - We use this to validate compiling all *.cpp files in a same compilation unit. - Users of that technique (also called "Unity builds") can generally provide this themselves, - so we don't really recommend you use this in your projects. diff --git a/include/imgui/misc/cpp/README.txt b/include/imgui/misc/cpp/README.txt deleted file mode 100644 index 8d5982e0..00000000 --- a/include/imgui/misc/cpp/README.txt +++ /dev/null @@ -1,10 +0,0 @@ - -imgui_stdlib.h + imgui_stdlib.cpp - InputText() wrappers for C++ standard library (STL) type: std::string. - This is also an example of how you may wrap your own similar types. - -imgui_scoped.h - [Experimental, not currently in main repository] - Additional header file with some RAII-style wrappers for common Dear ImGui functions. - Try by merging: https://github.com/ocornut/imgui/pull/2197 - Discuss at: https://github.com/ocornut/imgui/issues/2096 diff --git a/include/imgui/misc/cpp/imgui_stdlib.cpp b/include/imgui/misc/cpp/imgui_stdlib.cpp deleted file mode 100644 index e2b094ec..00000000 --- a/include/imgui/misc/cpp/imgui_stdlib.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) -// This is also an example of how you may wrap your own similar types. - -// Compatibility: -// - std::string support is only guaranteed to work from C++11. -// If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture) - -// Changelog: -// - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string - -#include "../../imgui.h" -#include "imgui_stdlib.h" - -struct InputTextCallback_UserData -{ - std::string* Str; - ImGuiInputTextCallback ChainCallback; - void* ChainCallbackUserData; -}; - -static int InputTextCallback(ImGuiInputTextCallbackData* data) -{ - InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData; - if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) - { - // Resize string callback - // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want. - std::string* str = user_data->Str; - IM_ASSERT(data->Buf == str->c_str()); - str->resize(data->BufTextLen); - data->Buf = (char*)str->c_str(); - } - else if (user_data->ChainCallback) - { - // Forward to user callback, if any - data->UserData = user_data->ChainCallbackUserData; - return user_data->ChainCallback(data); - } - return 0; -} - -bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); - flags |= ImGuiInputTextFlags_CallbackResize; - - InputTextCallback_UserData cb_user_data; - cb_user_data.Str = str; - cb_user_data.ChainCallback = callback; - cb_user_data.ChainCallbackUserData = user_data; - return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); -} - -bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); - flags |= ImGuiInputTextFlags_CallbackResize; - - InputTextCallback_UserData cb_user_data; - cb_user_data.Str = str; - cb_user_data.ChainCallback = callback; - cb_user_data.ChainCallbackUserData = user_data; - return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data); -} - -bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) -{ - IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); - flags |= ImGuiInputTextFlags_CallbackResize; - - InputTextCallback_UserData cb_user_data; - cb_user_data.Str = str; - cb_user_data.ChainCallback = callback; - cb_user_data.ChainCallbackUserData = user_data; - return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); -} diff --git a/include/imgui/misc/cpp/imgui_stdlib.h b/include/imgui/misc/cpp/imgui_stdlib.h deleted file mode 100644 index f860b0c7..00000000 --- a/include/imgui/misc/cpp/imgui_stdlib.h +++ /dev/null @@ -1,22 +0,0 @@ -// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) -// This is also an example of how you may wrap your own similar types. - -// Compatibility: -// - std::string support is only guaranteed to work from C++11. -// If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture) - -// Changelog: -// - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string - -#pragma once - -#include - -namespace ImGui -{ - // ImGui::InputText() with std::string - // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity - IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); - IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); -} diff --git a/include/imgui/misc/fonts/Cousine-Regular.ttf b/include/imgui/misc/fonts/Cousine-Regular.ttf deleted file mode 100644 index 70a0bf902e1482724d7706f7a0f40d94fe51f4c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43912 zcmb@uc|coLzBqo)x%Xx#xgiM&gph=gumlJY_AQqsArvTqLd#MLv_SVl3v{!#Si90y z?Wm*GR;`Xpou;+gR;%r(EPWf!SHXE=U9CTWIk*!& z*9hmf=6RmHf4UxRhDRQR^S&jk`$u|Y&mTjG2_r-{FIhikYl>U+BD~-@oR<%cEL}bN z69-(AWFjQxmiCX1AQO^9fBEn{zjW26p^~f1*9(_H zgK{HT4Cifdp0aH9*v4i>;9WTX2W;n84KL|mmC*EKgmfRm`I*)I8%NkJWGNhPg!^r4 z`d1HX|5*G_gdY7VLW;bR;nA^AwoLy3p=V?;zKoG|gCqa`;C~-MCh+pFHV zCwn#JpCc>W2A_9^vwk-FJ^e+bg#EeXX*ic5LR;Yj&q$t``Zo0O{`42q|IPkf>?wLJ zx@X0fU!YBhLn{EH1o6m&x&U%nxD_#Qm0{ndx-NwmzL-^(~pKotc)X4R!#^< zSoSy~rv$X|tJ&^ztLD`p0ojt{+5d=aB`(P`WN9Bl$3FT$FrHG*5BJ#+X5U8?$1uX^ zMi^{Bg{T^u-1rMTABWIC&=_X$Tznm^LtD@hbQn#brLaAK9z{FR0el_zp)v7q5dwUo z$I)8Y9!IZ>-|wO@9A86s!G36FYetReAX31+Deza1A3~#8jdo6dh3|!aUqIW@B=kIq z4xtOMjiXP{F0@2!e*s$mhQ5PdgDZYyK#O3c_o3et9ki_?3_Mi~qsoW#W4IYv(T~tJ z7?~A%u7g<=<2-o7VYChAvH@Gr@6bwQMp~pqfTPaW!5rw{Bk-Ps zGk+;?x39wlNk9z)aU+37Fv z0elGepws9KI)g*F3$H=%p>BY+6Mc#PjJ^+}WoEWSpc44NlayY7KM{*N;5!-cODSqA zn#Q?!9(jxWl6+{>+Y)R^wq#qWt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U7Wj?_j~9z+Q&x^ z^SRsTdOqhG&L8CZJ>0@JzWRWq+i=UJ8~#@nrv**S3&68_)rm(nS;jQ`L3QCdN#^8b9lidM5G z*U~yVjZUXCXg%xlEMc=lN=`s3q`e*tl`XZ};2R%SL>0epJ&(Xiozti*dZ}c_#Z`w`Ypcm*r=r35o z->2WBm*_?MCheu~(*MwJ(Z^Wfx3GEaW3_*t&EQw*5SzoTY$QkMcKSHIPDklZHi%!N zU#Gk18Tu3Y1l>(t_RTlwP5RQ@+Ya2knIt+?^CVV`(v!x0A}-N#*UN@^(^rJE^>#RNhW1Zzq+v zlgiskMc2apesl1)tgFAQa+jV5uz$LdGK9~qQkqSGJ3OkVsJCO=IkqSGJ3OkVs zJCO=IkqSGJ3OkVsJCO=IkqSGJ3OkW1cQRG(WGe4uD(_?}?_?_PWGe4uD(_?}?_?_P aWGe4uD(_?}?_?_PWGe4uD(~cOqW=eI(CQrk diff --git a/include/imgui/misc/fonts/Roboto-Medium.ttf b/include/imgui/misc/fonts/Roboto-Medium.ttf deleted file mode 100644 index 39c63d7461796094c0b8889ee8fe2706d344a99a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162588 zcmbS!2S8Lu*Y?cZdv|Hd(h(FE5U?Q#0&3KtVndC+H|!NV*t;n95;ex&jeWgh?_CrX zdsjeBOro)%CMtXPf97rh^7?+?|Noe0&z-sV&YU@O=FFKhvl~JQAujk3iLQRLrY*;B z8#;$DyI%-t?^M5K>)MT1mdPfpTRI^n`ZjGD9=XnO&wfJaGQ5@8BdObvxR3_J2=N(6 zi0j23DI@gaPvsK`2|tSaZF&#slQi~ox9x<4RmM9<`*a&VgxC=`l)n=9o%#$M-Fw&S z?!OaK^%0?$GyC>T8dc-_>Uu&vCV`<>eS3B5`Onzxc6hfWo{#B^42L%kE0Au5bm_iH zBSw|Zi~or9KZLlY4IJE~+v6v_cM=lePKf>aq;8{zXk8hXXa0)(BDW! z(S>|3jv))ha%7V5oK)AAAswZb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RWn$!?~zs5707RHsAD?S}i7iP{ZV zf%#B?#pVmX8+P2pE~H&a%I0t<^X=x4*iv{>b19X2QyQgHe;Po8LSo_h#yxL~yC0A7 zDiMl=)MBLFL}&6`zJe>blIQXK=2!6iU@UeEnkQG_x?nEtkx#IE@*d6O^gWuFiE^8+ zKPuOaO*tgJOthPT0uy)-dFC<}xxH)Ov+vsv?1#4A?zJD;eKeE?(=ZxNL-^0Q XDz@2YO+x)8BOh4hvAddFontFromMemoryCompressedTTF() - -// Build with, e.g: -// # cl.exe binary_to_compressed_c.cpp -// # gcc binary_to_compressed_c.cpp -// You can also find a precompiled Windows binary in the binary/demo package available from https://github.com/ocornut/imgui - -// Usage: -// binary_to_compressed_c.exe [-base85] [-nocompress] -// Usage example: -// # binary_to_compressed_c.exe myfont.ttf MyFont > myfont.cpp -// # binary_to_compressed_c.exe -base85 myfont.ttf MyFont > myfont.cpp - - - -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include - -#pragma warning(push) -#pragma warning(disable : 4244) -// stb_compress* from stb.h - declaration -typedef unsigned int stb_uint; -typedef unsigned char stb_uchar; -stb_uint stb_compress(stb_uchar *out,stb_uchar *in,stb_uint len); - -static bool binary_to_compressed_c(const char* filename, const char* symbol, bool use_base85_encoding, bool use_compression); - -int main(int argc, char** argv) -{ - if (argc < 3) - { - printf("Syntax: %s [-base85] [-nocompress] \n", argv[0]); - return 0; - } - - int argn = 1; - bool use_base85_encoding = false; - bool use_compression = true; - if (argv[argn][0] == '-') - { - if (strcmp(argv[argn], "-base85") == 0) { use_base85_encoding = true; argn++; } - else if (strcmp(argv[argn], "-nocompress") == 0) { use_compression = false; argn++; } - else - { - fprintf(stderr, "Unknown argument: '%s'\n", argv[argn]); - return 1; - } - } - - bool ret = binary_to_compressed_c(argv[argn], argv[argn+1], use_base85_encoding, use_compression); - if (!ret) - fprintf(stderr, "Error opening or reading file: '%s'\n", argv[argn]); - return ret ? 0 : 1; -} - -char Encode85Byte(unsigned int x) -{ - x = (x % 85) + 35; - return (x>='\\') ? x+1 : x; -} - -bool binary_to_compressed_c(const char* filename, const char* symbol, bool use_base85_encoding, bool use_compression) -{ - // Read file - FILE* f = fopen(filename, "rb"); - if (!f) return false; - int data_sz; - if (fseek(f, 0, SEEK_END) || (data_sz = (int)ftell(f)) == -1 || fseek(f, 0, SEEK_SET)) { fclose(f); return false; } - char* data = new char[data_sz+4]; - if (fread(data, 1, data_sz, f) != (size_t)data_sz) { fclose(f); delete[] data; return false; } - memset((void*)(((char*)data) + data_sz), 0, 4); - fclose(f); - - // Compress - int maxlen = data_sz + 512 + (data_sz >> 2) + sizeof(int); // total guess - char* compressed = use_compression ? new char[maxlen] : data; - int compressed_sz = use_compression ? stb_compress((stb_uchar*)compressed, (stb_uchar*)data, data_sz) : data_sz; - if (use_compression) - memset(compressed + compressed_sz, 0, maxlen - compressed_sz); - - // Output as Base85 encoded - FILE* out = stdout; - fprintf(out, "// File: '%s' (%d bytes)\n", filename, (int)data_sz); - fprintf(out, "// Exported using binary_to_compressed_c.cpp\n"); - const char* compressed_str = use_compression ? "compressed_" : ""; - if (use_base85_encoding) - { - fprintf(out, "static const char %s_%sdata_base85[%d+1] =\n \"", symbol, compressed_str, (int)((compressed_sz+3)/4)*5); - char prev_c = 0; - for (int src_i = 0; src_i < compressed_sz; src_i += 4) - { - // This is made a little more complicated by the fact that ??X sequences are interpreted as trigraphs by old C/C++ compilers. So we need to escape pairs of ??. - unsigned int d = *(unsigned int*)(compressed + src_i); - for (unsigned int n5 = 0; n5 < 5; n5++, d /= 85) - { - char c = Encode85Byte(d); - fprintf(out, (c == '?' && prev_c == '?') ? "\\%c" : "%c", c); - prev_c = c; - } - if ((src_i % 112) == 112-4) - fprintf(out, "\"\n \""); - } - fprintf(out, "\";\n\n"); - } - else - { - fprintf(out, "static const unsigned int %s_%ssize = %d;\n", symbol, compressed_str, (int)compressed_sz); - fprintf(out, "static const unsigned int %s_%sdata[%d/4] =\n{", symbol, compressed_str, (int)((compressed_sz+3)/4)*4); - int column = 0; - for (int i = 0; i < compressed_sz; i += 4) - { - unsigned int d = *(unsigned int*)(compressed + i); - if ((column++ % 12) == 0) - fprintf(out, "\n 0x%08x, ", d); - else - fprintf(out, "0x%08x, ", d); - } - fprintf(out, "\n};\n\n"); - } - - // Cleanup - delete[] data; - if (use_compression) - delete[] compressed; - return true; -} - -// stb_compress* from stb.h - definition - -//////////////////// compressor /////////////////////// - -static stb_uint stb_adler32(stb_uint adler32, stb_uchar *buffer, stb_uint buflen) -{ - const unsigned long ADLER_MOD = 65521; - unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16; - unsigned long blocklen, i; - - blocklen = buflen % 5552; - while (buflen) { - for (i=0; i + 7 < blocklen; i += 8) { - s1 += buffer[0], s2 += s1; - s1 += buffer[1], s2 += s1; - s1 += buffer[2], s2 += s1; - s1 += buffer[3], s2 += s1; - s1 += buffer[4], s2 += s1; - s1 += buffer[5], s2 += s1; - s1 += buffer[6], s2 += s1; - s1 += buffer[7], s2 += s1; - - buffer += 8; - } - - for (; i < blocklen; ++i) - s1 += *buffer++, s2 += s1; - - s1 %= ADLER_MOD, s2 %= ADLER_MOD; - buflen -= blocklen; - blocklen = 5552; - } - return (s2 << 16) + s1; -} - -static unsigned int stb_matchlen(stb_uchar *m1, stb_uchar *m2, stb_uint maxlen) -{ - stb_uint i; - for (i=0; i < maxlen; ++i) - if (m1[i] != m2[i]) return i; - return i; -} - -// simple implementation that just takes the source data in a big block - -static stb_uchar *stb__out; -static FILE *stb__outfile; -static stb_uint stb__outbytes; - -static void stb__write(unsigned char v) -{ - fputc(v, stb__outfile); - ++stb__outbytes; -} - -//#define stb_out(v) (stb__out ? *stb__out++ = (stb_uchar) (v) : stb__write((stb_uchar) (v))) -#define stb_out(v) do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0) - -static void stb_out2(stb_uint v) { stb_out(v >> 8); stb_out(v); } -static void stb_out3(stb_uint v) { stb_out(v >> 16); stb_out(v >> 8); stb_out(v); } -static void stb_out4(stb_uint v) { stb_out(v >> 24); stb_out(v >> 16); stb_out(v >> 8 ); stb_out(v); } - -static void outliterals(stb_uchar *in, int numlit) -{ - while (numlit > 65536) { - outliterals(in,65536); - in += 65536; - numlit -= 65536; - } - - if (numlit == 0) ; - else if (numlit <= 32) stb_out (0x000020 + numlit-1); - else if (numlit <= 2048) stb_out2(0x000800 + numlit-1); - else /* numlit <= 65536) */ stb_out3(0x070000 + numlit-1); - - if (stb__out) { - memcpy(stb__out,in,numlit); - stb__out += numlit; - } else - fwrite(in, 1, numlit, stb__outfile); -} - -static int stb__window = 0x40000; // 256K - -static int stb_not_crap(int best, int dist) -{ - return ((best > 2 && dist <= 0x00100) - || (best > 5 && dist <= 0x04000) - || (best > 7 && dist <= 0x80000)); -} - -static stb_uint stb__hashsize = 32768; - -// note that you can play with the hashing functions all you -// want without needing to change the decompressor -#define stb__hc(q,h,c) (((h) << 7) + ((h) >> 25) + q[c]) -#define stb__hc2(q,h,c,d) (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d]) -#define stb__hc3(q,c,d,e) ((q[c] << 14) + (q[d] << 7) + q[e]) - -static unsigned int stb__running_adler; - -static int stb_compress_chunk(stb_uchar *history, - stb_uchar *start, - stb_uchar *end, - int length, - int *pending_literals, - stb_uchar **chash, - stb_uint mask) -{ - (void)history; - int window = stb__window; - stb_uint match_max; - stb_uchar *lit_start = start - *pending_literals; - stb_uchar *q = start; - -#define STB__SCRAMBLE(h) (((h) + ((h) >> 16)) & mask) - - // stop short of the end so we don't scan off the end doing - // the hashing; this means we won't compress the last few bytes - // unless they were part of something longer - while (q < start+length && q+12 < end) { - int m; - stb_uint h1,h2,h3,h4, h; - stb_uchar *t; - int best = 2, dist=0; - - if (q+65536 > end) - match_max = (stb_uint)(end-q); - else - match_max = 65536; - -#define stb__nc(b,d) ((d) <= window && ((b) > 9 || stb_not_crap(b,d))) - -#define STB__TRY(t,p) /* avoid retrying a match we already tried */ \ - if (p ? dist != q-t : 1) \ - if ((m = stb_matchlen(t, q, match_max)) > best) \ - if (stb__nc(m,q-(t))) \ - best = m, dist = q - (t) - - // rather than search for all matches, only try 4 candidate locations, - // chosen based on 4 different hash functions of different lengths. - // this strategy is inspired by LZO; hashing is unrolled here using the - // 'hc' macro - h = stb__hc3(q,0, 1, 2); h1 = STB__SCRAMBLE(h); - t = chash[h1]; if (t) STB__TRY(t,0); - h = stb__hc2(q,h, 3, 4); h2 = STB__SCRAMBLE(h); - h = stb__hc2(q,h, 5, 6); t = chash[h2]; if (t) STB__TRY(t,1); - h = stb__hc2(q,h, 7, 8); h3 = STB__SCRAMBLE(h); - h = stb__hc2(q,h, 9,10); t = chash[h3]; if (t) STB__TRY(t,1); - h = stb__hc2(q,h,11,12); h4 = STB__SCRAMBLE(h); - t = chash[h4]; if (t) STB__TRY(t,1); - - // because we use a shared hash table, can only update it - // _after_ we've probed all of them - chash[h1] = chash[h2] = chash[h3] = chash[h4] = q; - - if (best > 2) - assert(dist > 0); - - // see if our best match qualifies - if (best < 3) { // fast path literals - ++q; - } else if (best > 2 && best <= 0x80 && dist <= 0x100) { - outliterals(lit_start, q-lit_start); lit_start = (q += best); - stb_out(0x80 + best-1); - stb_out(dist-1); - } else if (best > 5 && best <= 0x100 && dist <= 0x4000) { - outliterals(lit_start, q-lit_start); lit_start = (q += best); - stb_out2(0x4000 + dist-1); - stb_out(best-1); - } else if (best > 7 && best <= 0x100 && dist <= 0x80000) { - outliterals(lit_start, q-lit_start); lit_start = (q += best); - stb_out3(0x180000 + dist-1); - stb_out(best-1); - } else if (best > 8 && best <= 0x10000 && dist <= 0x80000) { - outliterals(lit_start, q-lit_start); lit_start = (q += best); - stb_out3(0x100000 + dist-1); - stb_out2(best-1); - } else if (best > 9 && dist <= 0x1000000) { - if (best > 65536) best = 65536; - outliterals(lit_start, q-lit_start); lit_start = (q += best); - if (best <= 0x100) { - stb_out(0x06); - stb_out3(dist-1); - stb_out(best-1); - } else { - stb_out(0x04); - stb_out3(dist-1); - stb_out2(best-1); - } - } else { // fallback literals if no match was a balanced tradeoff - ++q; - } - } - - // if we didn't get all the way, add the rest to literals - if (q-start < length) - q = start+length; - - // the literals are everything from lit_start to q - *pending_literals = (q - lit_start); - - stb__running_adler = stb_adler32(stb__running_adler, start, q - start); - return q - start; -} - -static int stb_compress_inner(stb_uchar *input, stb_uint length) -{ - int literals = 0; - stb_uint len,i; - - stb_uchar **chash; - chash = (stb_uchar**) malloc(stb__hashsize * sizeof(stb_uchar*)); - if (chash == NULL) return 0; // failure - for (i=0; i < stb__hashsize; ++i) - chash[i] = NULL; - - // stream signature - stb_out(0x57); stb_out(0xbc); - stb_out2(0); - - stb_out4(0); // 64-bit length requires 32-bit leading 0 - stb_out4(length); - stb_out4(stb__window); - - stb__running_adler = 1; - - len = stb_compress_chunk(input, input, input+length, length, &literals, chash, stb__hashsize-1); - assert(len == length); - - outliterals(input+length - literals, literals); - - free(chash); - - stb_out2(0x05fa); // end opcode - - stb_out4(stb__running_adler); - - return 1; // success -} - -stb_uint stb_compress(stb_uchar *out, stb_uchar *input, stb_uint length) -{ - stb__out = out; - stb__outfile = NULL; - - stb_compress_inner(input, length); - - return (stb_uint)(stb__out - out); -} -#pragma warning(pop) \ No newline at end of file diff --git a/include/imgui/misc/natvis/README.txt b/include/imgui/misc/natvis/README.txt deleted file mode 100644 index 1219db45..00000000 --- a/include/imgui/misc/natvis/README.txt +++ /dev/null @@ -1,4 +0,0 @@ - -Natvis file to describe dear imgui types in the Visual Studio debugger. -With this, types like ImVector<> will be displayed nicely in the debugger. -You can include this file a Visual Studio project file, or install it in Visual Studio folder. diff --git a/include/imgui/misc/natvis/imgui.natvis b/include/imgui/misc/natvis/imgui.natvis deleted file mode 100644 index cc768bfb..00000000 --- a/include/imgui/misc/natvis/imgui.natvis +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - {{Size={Size} Capacity={Capacity}}} - - - Size - Data - - - - - - {{x={x,g} y={y,g}}} - - - - {{x={x,g} y={y,g} z={z,g} w={w,g}}} - - - - {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} - - Min - Max - Max.x - Min.x - Max.y - Min.y - - - - - {{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}} - - - \ No newline at end of file diff --git a/include/imgui/misc/single_file/imgui_single_file.h b/include/imgui/misc/single_file/imgui_single_file.h deleted file mode 100644 index 6c849441..00000000 --- a/include/imgui/misc/single_file/imgui_single_file.h +++ /dev/null @@ -1,17 +0,0 @@ -// dear imgui: single-file wrapper include -// We use this to validate compiling all *.cpp files in a same compilation unit. -// Users of that technique (also called "Unity builds") can generally provide this themselves, -// so we don't really recommend you use this in your projects. - -// Do this: -// #define IMGUI_IMPLEMENTATION -// Before you include this file in *one* C++ file to create the implementation. -// Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit. -#include "../../imgui.h" - -#ifdef IMGUI_IMPLEMENTATION -#include "../../imgui.cpp" -#include "../../imgui_demo.cpp" -#include "../../imgui_draw.cpp" -#include "../../imgui_widgets.cpp" -#endif From 48bad428fe73d1560cd700a6985a03725f4c6d4c Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 1 Sep 2020 14:59:43 +0200 Subject: [PATCH 105/419] Add Beta stuff to public --- Horion/Command/CommandMgr.cpp | 2 -- Horion/Command/CommandMgr.h | 2 -- Horion/Module/ModuleManager.cpp | 2 -- Memory/GameData.h | 10 ++++------ Memory/Hooks.cpp | 3 +-- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index 00febb7f..ae31a168 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -41,13 +41,11 @@ void CommandMgr::initCommands() { commandList.push_back(new SetprefixCommand()); commandList.push_back(new NbtCommand()); -#if defined(_BETA) or defined(_DEBUG) commandList.push_back(new CommandBlockExploitCommand()); commandList.push_back(new NameSpoofCommand()); commandList.push_back(new ExecuteCommand()); commandList.push_back(new ScriptCommand()); commandList.push_back(new PathCommand()); -#endif #ifdef _DEBUG commandList.push_back(new TestCommand()); diff --git a/Horion/Command/CommandMgr.h b/Horion/Command/CommandMgr.h index e76bebb0..c49f25a1 100644 --- a/Horion/Command/CommandMgr.h +++ b/Horion/Command/CommandMgr.h @@ -32,10 +32,8 @@ #include "Commands/NbtCommand.h" #include "Commands/ExecuteCommand.h" -#if defined(_DEBUG) or defined(_BETA) #include "Commands/ScriptCommand.h" #include "Commands/PathCommand.h" -#endif #ifdef _DEBUG #include "Commands/TestCommand.h" diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index ebef6de8..00a92a40 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -96,9 +96,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); -#if defined(_BETA) or defined(_DEBUG) this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); -#endif #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); diff --git a/Memory/GameData.h b/Memory/GameData.h index 5fb45618..af60fbf7 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -194,10 +194,8 @@ class GameData { inline bool allowWIPFeatures() { #ifdef _DEBUG return true; -#elif defined _BETA - return isAllowingWIPFeatures; #else - return false; + return isAllowingWIPFeatures; #endif } inline void setAllowWIPFeatures(bool enable = false) { isAllowingWIPFeatures = enable; }; @@ -221,17 +219,17 @@ class GameData { inline C_ClientInstance* getClientInstance() { return clientInstance; }; inline C_GuiData* getGuiData() { return clientInstance->getGuiData(); }; inline C_LocalPlayer* getLocalPlayer() { - #ifdef _BETA + /*#ifdef _BETA unsigned int converted = networkedData.localPlayerOffset ^ networkedData.xorKey; if (networkedData.localPlayerOffset < 0x110 || converted < 0x125 || converted > 0x191 || networkedData.dataSet == false) localPlayer = nullptr; else localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); - #else + #else*/ localPlayer = clientInstance->localPlayer; - #endif + //#endif if (localPlayer == nullptr) gameMode = nullptr; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index cf0d55e5..bad0043a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -501,7 +501,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { DrawUtils::drawText(textPos, &text, MC_Color(255, 255, 255, 1), 8.f); }*/ -#if defined(_BETA) or defined(_DEBUG) // Draw Custom Geo Button if (g_Data.allowWIPFeatures()) { if (HImGui.Button("Load Script Folder", vec2_t(wid.x * (0.765f - 0.5f), wid.y * 0.92f), true)) { @@ -614,7 +613,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { g_Data.sendPacketToInjector(packet); } } -#endif + } else { shouldRenderTabGui = hudModule->tabgui && hudModule->isEnabled(); shouldRenderArrayList = hudModule->arraylist && hudModule->isEnabled(); From 624decad6d4c7800c51db358037f59ebf1f49c72 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 1 Sep 2020 15:06:18 +0200 Subject: [PATCH 106/419] Fix vs build --- Horion.vcxproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 4209c7fb..f14960c2 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -375,14 +375,6 @@ - - - - - - - - From 4e381128fe18250384b98ea0dec508ccf74af9b0 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 4 Sep 2020 03:08:53 -0400 Subject: [PATCH 107/419] Add files via upload Added negative zoom strength to set higher fov's. --- Horion/Module/Modules/Zoom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Zoom.cpp b/Horion/Module/Modules/Zoom.cpp index 4f96902d..74f5b834 100644 --- a/Horion/Module/Modules/Zoom.cpp +++ b/Horion/Module/Modules/Zoom.cpp @@ -1,7 +1,7 @@ #include "Zoom.h" -Zoom::Zoom() : IModule('C', Category::VISUAL, "Zoom in!") { - registerFloatSetting("Strength", &this->strength, this->strength, 1.f, 100.f); +Zoom::Zoom() : IModule('C', Category::VISUAL, "Zoom in or out!") { + registerFloatSetting("Strength", &this->strength, this->strength, -100.f, 100.f); registerBoolSetting("Smooth", &this->smooth, this->smooth); } From f8af014746975983495320305705a11b3256cf10 Mon Sep 17 00:00:00 2001 From: Johnmacrocraft Date: Fri, 4 Sep 2020 17:44:12 +0900 Subject: [PATCH 108/419] Fix #266 --- Horion/Module/Modules/Glide.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Horion/Module/Modules/Glide.cpp b/Horion/Module/Modules/Glide.cpp index 09cad109..d1b2c01c 100644 --- a/Horion/Module/Modules/Glide.cpp +++ b/Horion/Module/Modules/Glide.cpp @@ -18,10 +18,14 @@ const char* Glide::getModuleName() { void Glide::onTick(C_GameMode* gm) { glideModEffective = glideMod; - if (GameData::isKeyDown(VK_SPACE)) - glideModEffective += 0.2f; - if (GameData::isKeyDown(*g_Data.getClientInstance()->getGameSettingsInput()->sneakKey)) - glideModEffective -= 0.2f; + C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); + + if (g_Data.canUseMoveKeys()) { + if (GameData::isKeyDown(*input->spaceBarKey)) + glideModEffective += 0.2f; + if (GameData::isKeyDown(*input->sneakKey)) + glideModEffective -= 0.2f; + } gm->player->velocity.y = glideModEffective; } From 10d98d7ca2925ceb02e81d4ed40c021d68b5ce9b Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 4 Sep 2020 16:23:10 +0200 Subject: [PATCH 109/419] 1.16.40 update --- Horion/DrawUtils.cpp | 2 +- Memory/GameData.cpp | 11 ++--------- Memory/Hooks.cpp | 40 +++++++--------------------------------- 3 files changed, 10 insertions(+), 43 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 38b268dc..54dbca03 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -89,7 +89,7 @@ void DrawUtils::setColor(float r, float g, float b, float a) { C_Font* DrawUtils::getFont(Fonts font) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) + if (true) return g_Data.getClientInstance()->N0000080D->getOldFont(); switch (font) { case Fonts::SMOOTH: diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index cd932eb3..7a3d14b6 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -10,21 +10,14 @@ void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; uintptr_t sigOffset = 0x0; if (clientInstanceOffset == 0x0) { - - if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) - sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); - else - sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 01 FF 90 ?? ?? ?? ?? 4C 8B E0"); + sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } } - if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x380, 0x10})); - else - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x78, 0x160})); + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x380, 0x10})); #ifdef _DEBUG if (g_Data.clientInstance == 0) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index bad0043a..716fa43a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -197,13 +197,8 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - void* ChestTick = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_20) - ChestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0")); - else - ChestTick = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? 00 48 8B FA 48 89")); - - g_Hooks.ChestBlockActor_tickHook = std::make_unique(ChestTick, Hooks::ChestBlockActor_tick); + void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0")); + g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -217,12 +212,7 @@ void Hooks::Init() { uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); - void* getFov = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - getFov = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ?? 0F 29 74 24 ? 0F 29 7C 24 ? 44 0F 29 44 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F 28 C1")); - else - getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); - + void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); @@ -240,21 +230,13 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - fullbright = reinterpret_cast(FindSignature("4C 8B DC 57 48 83 EC ?? 49 C7 43 ?? FE FF FF FF 49 89 5B ?? 49 89 73 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 33 C0 49 89 43 ?? 49 89 43 ?? 48 8B 01 49")); - else - fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); + void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); - void* onAppSuspended = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B F1 E8 ?? ?? ?? ?? 48")); - else - onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); + void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F1 48 C7 85 ?? ?? ?? ?? ?? ?? ?? ?? 48 8D 95 ?? ?? ?? ?? 48 8B 89")); @@ -266,11 +248,7 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); - else - _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 85 ? ? ? ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); + void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 85 ? ? ? ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); @@ -296,11 +274,7 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - void* MobIsImmobile = nullptr; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 48 8B D9 75 ?? 33")); - else - MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 80 B9 ? ? ? ? ? 48 8B D9 75 5E")); + void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 80 B9 ? ? ? ? ? 48 8B D9 75 5E")); g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); From 06750dac46670a8d8e4c75925dbc7c7feff5f6ec Mon Sep 17 00:00:00 2001 From: Johnmacrocraft Date: Sat, 5 Sep 2020 12:33:49 +0900 Subject: [PATCH 110/419] 1.16.40 update round 2? --- Horion/Command/Commands/EnchantCommand.cpp | 6 +++--- Memory/Hooks.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index f97cd672..41f9a3ec 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -103,10 +103,10 @@ bool EnchantCommand::execute(std::vector* args) { static saveEnchantsToUserData_t saveEnchantsToUserData = 0x0; if (!saveEnchantsToUserData) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) - saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); - else + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) saveEnchantsToUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 25")); + else + saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); } if (strcmp(args->at(1).c_str(), "all") == 0) { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 716fa43a..2a414fe5 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -328,10 +328,10 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { cmdMgr->execute(message); __int64 a1 = 0; - if (g_Data.getVersion() == GAMEVERSION::g_1_16_20) - a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); - else + if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + else + a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) From 458451994400454b1c5c8fd526744e3988f42ce9 Mon Sep 17 00:00:00 2001 From: Johnmacrocraft Date: Sat, 5 Sep 2020 12:54:38 +0900 Subject: [PATCH 111/419] yes i'm not --- Horion/Command/Commands/EnchantCommand.cpp | 5 +---- Memory/Hooks.cpp | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index 41f9a3ec..caea8e1f 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -103,10 +103,7 @@ bool EnchantCommand::execute(std::vector* args) { static saveEnchantsToUserData_t saveEnchantsToUserData = 0x0; if (!saveEnchantsToUserData) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - saveEnchantsToUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 25")); - else - saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); + saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); } if (strcmp(args->at(1).c_str(), "all") == 0) { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2a414fe5..924a6feb 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -328,10 +328,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { cmdMgr->execute(message); __int64 a1 = 0; - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x960i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); - else - a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) From 182eb7074e02c73c2b278cba5a16155400b85c88 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:16:20 -0400 Subject: [PATCH 112/419] Add files via upload --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6bc6fe9..310edc4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,8 +172,8 @@ add_library(Horion SHARED Horion/Module/Modules/Hitbox.h Horion/Module/Modules/HudModule.cpp Horion/Module/Modules/HudModule.h - Horion/Module/Modules/InfiniteBlockReach.cpp - Horion/Module/Modules/InfiniteBlockReach.h + Horion/Module/Modules/ExtendedBlockReach.cpp + Horion/Module/Modules/ExtendedBlockReach.h Horion/Module/Modules/InfiniteReach.cpp Horion/Module/Modules/InfiniteReach.h Horion/Module/Modules/InstaBreak.cpp From 1e0360e8c3f81b9d69b8541c2a744287690a7a31 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:16:53 -0400 Subject: [PATCH 113/419] Add files via upload --- Horion.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index f14960c2..02063b4d 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -311,7 +311,7 @@ - + @@ -483,7 +483,7 @@ - + From 96b5a514702016a7ff6bad9b78adae1ddceb0301 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:17:40 -0400 Subject: [PATCH 114/419] Add files via upload --- Horion/Module/ModuleManager.cpp | 2 +- Horion/Module/ModuleManager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 00a92a40..7439f0a3 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -64,7 +64,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new FastEat())); this->moduleList.push_back(std::shared_ptr(new Jesus())); this->moduleList.push_back(std::shared_ptr(new AutoArmor())); - this->moduleList.push_back(std::shared_ptr(new InfiniteBlockReach())); + this->moduleList.push_back(std::shared_ptr(new ExtendedBlockReach())); this->moduleList.push_back(std::shared_ptr(new AutoClicker())); this->moduleList.push_back(std::shared_ptr(new NameTags())); this->moduleList.push_back(std::shared_ptr(new Criticals())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 69c92445..32feac34 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -44,7 +44,7 @@ #include "Modules/HighJump.h" #include "Modules/Hitbox.h" #include "Modules/HudModule.h" -#include "Modules/InfiniteBlockReach.h" +#include "Modules/ExtendedBlockReach.h" #include "Modules/InfiniteReach.h" #include "Modules/InstaBreak.h" #include "Modules/InventoryCleaner.h" From 3e8e6e638a8c94c5a95c2954082025b5872a2ccf Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:18:31 -0400 Subject: [PATCH 115/419] Add files via upload --- Horion/Module/Modules/ExtendedBlockReach.cpp | 12 ++++++++++++ Horion/Module/Modules/ExtendedBlockReach.h | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Horion/Module/Modules/ExtendedBlockReach.cpp create mode 100644 Horion/Module/Modules/ExtendedBlockReach.h diff --git a/Horion/Module/Modules/ExtendedBlockReach.cpp b/Horion/Module/Modules/ExtendedBlockReach.cpp new file mode 100644 index 00000000..67762492 --- /dev/null +++ b/Horion/Module/Modules/ExtendedBlockReach.cpp @@ -0,0 +1,12 @@ +#include "ExtendedBlockReach.h" + +ExtendedBlockReach::ExtendedBlockReach() : IModule(0x0, Category::PLAYER, "Exteneded reach for placing/breaking blocks") { + this->registerFloatSetting(std::string("reach"), &this->blockReach, this->blockReach, 7, 20); +} + +ExtendedBlockReach::~ExtendedBlockReach() { +} + +const char* ExtendedBlockReach::getModuleName() { + return ("ExtendedBlockReach"); +} diff --git a/Horion/Module/Modules/ExtendedBlockReach.h b/Horion/Module/Modules/ExtendedBlockReach.h new file mode 100644 index 00000000..7d99a6e5 --- /dev/null +++ b/Horion/Module/Modules/ExtendedBlockReach.h @@ -0,0 +1,16 @@ +#pragma once +#include "Module.h" + +class ExtendedBlockReach : public IModule { +private: + float blockReach = 50.f; + +public: + ExtendedBlockReach(); + ~ExtendedBlockReach(); + + inline float getBlockReach() { return blockReach; }; + inline void setBlockReach(float reach) { blockReach = reach; }; + // Inherited via IModule + virtual const char* getModuleName() override; +}; From e7d293d4b30e73f75fe20b37cc4cfca764447903 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:19:25 -0400 Subject: [PATCH 116/419] Delete InfiniteBlockReach.cpp --- Horion/Module/Modules/InfiniteBlockReach.cpp | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Horion/Module/Modules/InfiniteBlockReach.cpp diff --git a/Horion/Module/Modules/InfiniteBlockReach.cpp b/Horion/Module/Modules/InfiniteBlockReach.cpp deleted file mode 100644 index 60cae018..00000000 --- a/Horion/Module/Modules/InfiniteBlockReach.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "InfiniteBlockReach.h" - -InfiniteBlockReach::InfiniteBlockReach() : IModule(0x0, Category::PLAYER, "Infinite reach for placing/breaking blocks") { - this->registerFloatSetting(std::string("reach"), &this->blockReach, this->blockReach, 7, 255); -} - -InfiniteBlockReach::~InfiniteBlockReach() { -} - -const char* InfiniteBlockReach::getModuleName() { - return ("InfiniteBlockReach"); -} From 993c95a0c6c2572bed33dff64c3b977aa2b73c7a Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:19:43 -0400 Subject: [PATCH 117/419] Delete InfiniteBlockReach.h --- Horion/Module/Modules/InfiniteBlockReach.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 Horion/Module/Modules/InfiniteBlockReach.h diff --git a/Horion/Module/Modules/InfiniteBlockReach.h b/Horion/Module/Modules/InfiniteBlockReach.h deleted file mode 100644 index 47f73630..00000000 --- a/Horion/Module/Modules/InfiniteBlockReach.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include "Module.h" - -class InfiniteBlockReach : public IModule { -private: - float blockReach = 50.f; - -public: - InfiniteBlockReach(); - ~InfiniteBlockReach(); - - inline float getBlockReach() { return blockReach; }; - inline void setBlockReach(float reach) { blockReach = reach; }; - // Inherited via IModule - virtual const char* getModuleName() override; -}; From 37b0e0fc70b86a22aa75cdb3f800e54bea988c3f Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 5 Sep 2020 13:20:42 -0400 Subject: [PATCH 118/419] Add files via upload --- Memory/Hooks.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 924a6feb..1645a245 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1418,9 +1418,9 @@ float Hooks::GameMode_getPickRange(C_GameMode* _this, __int64 a2, char a3) { static auto oFunc = g_Hooks.GameMode_getPickRangeHook->GetFastcall(); if (g_Data.getLocalPlayer() != nullptr) { - static auto infiniteBlockReachModule = moduleMgr->getModule(); - if (infiniteBlockReachModule->isEnabled()) - return infiniteBlockReachModule->getBlockReach(); + static auto extendedBlockReachModule = moduleMgr->getModule(); + if (extendedBlockReachModule->isEnabled()) + return extendedBlockReachModule->getBlockReach(); static auto teleportModule = moduleMgr->getModule(); if (teleportModule->isEnabled()) From dc7b2753acbd85084ea79239e186d486cafbfdd8 Mon Sep 17 00:00:00 2001 From: marshall Date: Mon, 7 Sep 2020 06:03:22 +0800 Subject: [PATCH 119/419] Fix 2D ESP --- Horion/DrawUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 54dbca03..c9588ad9 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -366,10 +366,10 @@ void DrawUtils::draw2D(C_Entity* ent, float lineWidth) { vec3_t corners[4]; vec2_t corners2d[4]; - corners[0] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y, base.z - ent->width / 1.5f * cos(ofs)); - corners[1] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y, base.z + ent->width / 1.5f * cos(ofs)); - corners[2] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y - ent->height, base.z - ent->width / 1.5f * cos(ofs)); - corners[3] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y - ent->height, base.z + ent->width / 1.5f * cos(ofs)); + corners[0] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y + ent->height, base.z - ent->width / 1.5f * cos(ofs)); + corners[1] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y + ent->height, base.z + ent->width / 1.5f * cos(ofs)); + corners[2] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y, base.z - ent->width / 1.5f * cos(ofs)); + corners[3] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y, base.z + ent->width / 1.5f * cos(ofs)); if (refdef->OWorldToScreen(origin, corners[0], corners2d[0], fov, screenSize) && refdef->OWorldToScreen(origin, corners[1], corners2d[1], fov, screenSize) && From 2df67b05f963f77e6d810b451efed16028c629d8 Mon Sep 17 00:00:00 2001 From: marshall Date: Mon, 7 Sep 2020 06:49:44 +0800 Subject: [PATCH 120/419] actually this works better --- Horion/DrawUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index c9588ad9..ab35d7fe 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -366,10 +366,10 @@ void DrawUtils::draw2D(C_Entity* ent, float lineWidth) { vec3_t corners[4]; vec2_t corners2d[4]; - corners[0] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y + ent->height, base.z - ent->width / 1.5f * cos(ofs)); - corners[1] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y + ent->height, base.z + ent->width / 1.5f * cos(ofs)); - corners[2] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), base.y, base.z - ent->width / 1.5f * cos(ofs)); - corners[3] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), base.y, base.z + ent->width / 1.5f * cos(ofs)); + corners[0] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), ent->aabb.upper.y + (float)0.1, base.z - ent->width / 1.5f * cos(ofs)); + corners[1] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), ent->aabb.upper.y + (float)0.1, base.z + ent->width / 1.5f * cos(ofs)); + corners[2] = vec3_t(base.x - ent->width / 1.5f * -sin(ofs), ent->aabb.lower.y, base.z - ent->width / 1.5f * cos(ofs)); + corners[3] = vec3_t(base.x + ent->width / 1.5f * -sin(ofs), ent->aabb.lower.y, base.z + ent->width / 1.5f * cos(ofs)); if (refdef->OWorldToScreen(origin, corners[0], corners2d[0], fov, screenSize) && refdef->OWorldToScreen(origin, corners[1], corners2d[1], fov, screenSize) && From 68c835ca5baf7703217d1bbb9b98cb7c3b791c79 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 11:21:58 +0800 Subject: [PATCH 121/419] Implement Spider, Close #3 --- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/Spider.cpp | 47 ++++++++++++++++++++++++++++++++ Horion/Module/Modules/Spider.h | 14 ++++++++++ Utils/HMath.h | 10 +++++++ 5 files changed, 73 insertions(+) create mode 100644 Horion/Module/Modules/Spider.cpp create mode 100644 Horion/Module/Modules/Spider.h diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 00a92a40..5cab8039 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -95,6 +95,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); + this->moduleList.push_back(std::shared_ptr(new Spider())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 69c92445..acede14d 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -88,6 +88,7 @@ #include "Modules/AntiImmobile.h" #include "Modules/FollowPathModule.h" #include "Modules/NoPaintingCrash.h" +#include "Modules/Spider.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp new file mode 100644 index 00000000..47c3d7cc --- /dev/null +++ b/Horion/Module/Modules/Spider.cpp @@ -0,0 +1,47 @@ +#include "Spider.h" + +#include "../../../Utils/Logger.h" + +Spider::Spider() : IModule('Z', Category::MOVEMENT, "Climb walls") { + registerFloatSetting("Speed", &speed, speed, 0.1, 1); +} + +Spider::~Spider() { +} + +const char* Spider::getModuleName() { + return "Spider"; +} + +void Spider::onMove(C_MoveInputHandler* input) { + if (g_Data.getLocalPlayer() == nullptr) + return; + C_LocalPlayer* player = g_Data.getLocalPlayer(); + + if (player->isInLava() == 1 || player->isInWater() == 1) + return; + + if (player->isSneaking()) + return; + + if (!(input->forward || input->backward) || (input->forward && input->backward)) + return; + + static std::vector sideBlocks; + if (sideBlocks.empty()) { + sideBlocks.push_back(new vec3_ti(0, 0, -1)); + sideBlocks.push_back(new vec3_ti(0, 0, 1)); + sideBlocks.push_back(new vec3_ti(-1, 0, 0)); + sideBlocks.push_back(new vec3_ti(1, 0, 0)); + } + + for (auto current : sideBlocks) { + vec3_ti side = vec3_ti(player->currentPos.floor()).add(*current); + C_BlockLegacy* sideBlock = *(player->region->getBlock(side)->blockLegacy); + AABB fullBlock = AABB(side.toFloatVector(), side.add(1, 1, 1).toFloatVector()); // todo: idk why all blocks have no AABB + if (sideBlock->material->isBlockingMotion && fullBlock.intersects(player->aabb.expanded(0.25))) { + player->velocity.y = speed; + return; + } + } +} \ No newline at end of file diff --git a/Horion/Module/Modules/Spider.h b/Horion/Module/Modules/Spider.h new file mode 100644 index 00000000..095e0587 --- /dev/null +++ b/Horion/Module/Modules/Spider.h @@ -0,0 +1,14 @@ +#pragma once +#include "Module.h" +class Spider : public IModule { +private: + float speed = 0.6f; + +public: + Spider(); + ~Spider(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onMove(C_MoveInputHandler* input) override; +}; diff --git a/Utils/HMath.h b/Utils/HMath.h index 53aa7f53..9b6a5f83 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -514,6 +514,16 @@ struct AABB { auto diff = lower.sub(upper); return fabsf(diff.y) == 1 && fabsf(diff.x) == 1 && fabsf(diff.z) == 1; } + + AABB expanded(float amount) { + return AABB(lower.sub(amount), upper.add(amount)); + } + + bool intersects(AABB aabb) { + return aabb.upper.x - lower.x > 0.00001 && upper.x - aabb.lower.x > 0.00001 && + aabb.upper.y - lower.y > 0.00001 && upper.y - aabb.lower.y > 0.00001 && + aabb.upper.z - lower.z > 0.00001 && upper.z - aabb.lower.z > 0.00001; + } }; /* From 0ef2e9a68f7b4caa89f03bb2d1a412b613cf6cb0 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 11:38:24 +0800 Subject: [PATCH 122/419] simplify AABB::intersects() --- Horion.vcxproj | 2 + Horion/Module/Modules/Spider.cpp | 2 - Utils/HMath.h | 6 +- ...i \357\200\274target-commit\357\200\276~1" | 8064 +++++++++++++++++ 4 files changed, 8069 insertions(+), 5 deletions(-) create mode 100644 "e -i \357\200\274target-commit\357\200\276~1" diff --git a/Horion.vcxproj b/Horion.vcxproj index f14960c2..2a784d86 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -341,6 +341,7 @@ + @@ -513,6 +514,7 @@ + diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp index 47c3d7cc..007d7f2c 100644 --- a/Horion/Module/Modules/Spider.cpp +++ b/Horion/Module/Modules/Spider.cpp @@ -1,7 +1,5 @@ #include "Spider.h" -#include "../../../Utils/Logger.h" - Spider::Spider() : IModule('Z', Category::MOVEMENT, "Climb walls") { registerFloatSetting("Speed", &speed, speed, 0.1, 1); } diff --git a/Utils/HMath.h b/Utils/HMath.h index 9b6a5f83..d71761ad 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -520,9 +520,9 @@ struct AABB { } bool intersects(AABB aabb) { - return aabb.upper.x - lower.x > 0.00001 && upper.x - aabb.lower.x > 0.00001 && - aabb.upper.y - lower.y > 0.00001 && upper.y - aabb.lower.y > 0.00001 && - aabb.upper.z - lower.z > 0.00001 && upper.z - aabb.lower.z > 0.00001; + return aabb.upper.x > lower.x && upper.x > aabb.lower.x && + aabb.upper.y > lower.y && upper.y > aabb.lower.y && + aabb.upper.z > lower.z && upper.z > aabb.lower.z; } }; diff --git "a/e -i \357\200\274target-commit\357\200\276~1" "b/e -i \357\200\274target-commit\357\200\276~1" new file mode 100644 index 00000000..26dd740e --- /dev/null +++ "b/e -i \357\200\274target-commit\357\200\276~1" @@ -0,0 +1,8064 @@ +commit 0cb118c08bbc0d0ab22b76ceec54cd1ee5c9c05a (HEAD -> feature-spider, origin/feature-spider, patch-2) +Author: CortexPE +Date: Mon Sep 7 11:21:58 2020 +0800 + + Implement Spider, Close #3 + +commit 0e9bf7e53cc2b8176ccbabe4f84f44aae46d8a92 (origin/patch-2) +Author: CortexPE +Date: Mon Sep 7 07:20:40 2020 +0800 + + simplify + +commit ab6152c1e05875dca2b416c69511a99453e3c8cd +Author: CortexPE +Date: Mon Sep 7 07:10:09 2020 +0800 + + remove un-needed header file + +commit daa45a0367aa072374a10d1bcfd144243138787d +Author: CortexPE +Date: Mon Sep 7 07:08:26 2020 +0800 + + make it so that FollowPath doesn't easily stop when jumping + +commit 2fb08352292a16315d751dc2e3c9d7259cf06843 (origin/master, origin/HEAD, master) +Merge: bb0aefa 4584519 +Author: GodGamer029 +Date: Sat Sep 5 11:28:18 2020 +0200 + + Merge pull request #272 from Johnmacrocraft/1-16-40-update-round-2 + + 1.16.40 update round 2? + +commit 458451994400454b1c5c8fd526744e3988f42ce9 +Author: Johnmacrocraft +Date: Sat Sep 5 12:54:38 2020 +0900 + + yes i'm not + +commit 06750dac46670a8d8e4c75925dbc7c7feff5f6ec +Author: Johnmacrocraft +Date: Sat Sep 5 12:33:49 2020 +0900 + + 1.16.40 update round 2? + +commit bb0aefa2a21c77ef578834edcb03af1bb14bf64b +Merge: 10d98d7 4e38112 +Author: Richard +Date: Fri Sep 4 17:05:20 2020 +0200 + + Merge pull request #267 from FloppyDolphin57/master + + Added more zoom customization + +commit 10d98d7ca2925ceb02e81d4ed40c021d68b5ce9b +Author: godgamer029 +Date: Fri Sep 4 16:23:10 2020 +0200 + + 1.16.40 update + +commit 49d884fdb4bd155174057cd350e6cd6717408c5e +Merge: 624deca f8af014 +Author: Richard +Date: Fri Sep 4 13:20:28 2020 +0200 + + Merge pull request #268 from Johnmacrocraft/fix-glide + + Fix #266 + +commit f8af014746975983495320305705a11b3256cf10 +Author: Johnmacrocraft +Date: Fri Sep 4 17:44:12 2020 +0900 + + Fix #266 + +commit 4e381128fe18250384b98ea0dec508ccf74af9b0 +Author: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> +Date: Fri Sep 4 03:08:53 2020 -0400 + + Add files via upload + + Added negative zoom strength to set higher fov's. + +commit 624decad6d4c7800c51db358037f59ebf1f49c72 +Author: godgamer029 +Date: Tue Sep 1 15:06:18 2020 +0200 + + Fix vs build + +commit 48bad428fe73d1560cd700a6985a03725f4c6d4c +Author: godgamer029 +Date: Tue Sep 1 14:59:43 2020 +0200 + + Add Beta stuff to public + +commit 951524e71c28b0be3aacfd92cab53d4134f51bc3 +Merge: d5c4b98 14faeb8 +Author: GodGamer029 +Date: Tue Sep 1 14:52:58 2020 +0200 + + Merge pull request #260 from baseds/master + + remove imgui + +commit 14faeb8dfa4f29e17696bcedaeb69b098b2f5998 +Merge: 246ffc8 ba00d13 +Author: baseds +Date: Tue Sep 1 13:50:10 2020 +0100 + + Merge branch 'master' of https://github.com/baseds/Horion + +commit 246ffc81fdaf90b43750b5e894114c89e362fdb1 +Author: baseds +Date: Tue Sep 1 13:49:37 2020 +0100 + + remove imgui + + useless + +commit d5c4b985c632d7552b0709e3c8b9c6cf8cf263fa +Merge: 6604353 ba00d13 +Author: GodGamer029 +Date: Tue Sep 1 14:42:32 2020 +0200 + + Merge pull request #259 from baseds/master + + better .gitignore + +commit 6604353fa240101f5313dc7abc11a331550aa324 +Author: godgamer029 +Date: Tue Sep 1 14:42:17 2020 +0200 + + Add Nukkit Dupe + +commit ba00d13f9723a9fccd8e6979f622d222d782894d +Author: segment <70320706+baseds@users.noreply.github.com> +Date: Tue Sep 1 13:39:34 2020 +0100 + + remove .lib (minhook binary is in repository) + +commit 9ce0f72a58fc715f73be02309b268eb8663445cc +Author: baseds +Date: Tue Sep 1 13:11:21 2020 +0100 + + better gitignore + +commit d2d2a85a3b79b1af72692082812de2fa9f638d0d +Merge: 5e7ef86 5b1ce6e +Author: godgamer029 +Date: Tue Sep 1 13:42:31 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 5e7ef8666d91305f65e59bfd6b4621172419a49a +Author: godgamer029 +Date: Tue Sep 1 13:42:21 2020 +0200 + + No idea what i did tbh + +commit 5b1ce6ed183def6d38a233d09a9a2f7714758207 +Author: Richard +Date: Sun Aug 30 15:09:18 2020 +0200 + + remove out + +commit daba1aa1c980b8dcb168dbc2ea0c28a805d2b819 +Author: Richard +Date: Sun Aug 30 14:58:54 2020 +0200 + + CC-BY-NC-ND 4.0 to CC-BY-NC 4.0 + +commit 4a70cd75fda150789eaf013618feee904a76b3cb +Author: Richard +Date: Wed Aug 26 14:34:18 2020 +0200 + + Update README.md + +commit bbdb7ab28c2b143bee95aeae312d57570ca1656a +Author: Richard +Date: Wed Aug 26 14:31:02 2020 +0200 + + Add files via upload + +commit f6fcf6b5655ed592693cd1fdc2bbd926d4058a14 +Author: Richard +Date: Tue Aug 18 11:05:58 2020 +0200 + + Delete FUNDING.yml + +commit 17c3eadcb3de03d6fa0ec3a5fb467e76c10e816c +Author: Richard +Date: Tue Aug 18 11:05:03 2020 +0200 + + Update README.md + +commit 5fe55939689252590388c085ad389e4529240eeb +Author: erwan celanie +Date: Sat Aug 15 13:04:33 2020 -0400 + + fix tracer , enchant , autosneak & clickgui + +commit 963bcd3d012f4278b4af0ed016d40c767557dfe9 +Merge: 77d4be2 7868d13 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Fri Aug 14 16:44:24 2020 -0400 + + Merge pull request #257 from richardletshacks/beta-support + + 1.16.20 support + +commit 7868d134aad627f8f41a179db33026f0d361e15b (origin/beta-support) +Author: erwan celanie +Date: Fri Aug 14 16:42:15 2020 -0400 + + yeet + +commit 53f876962de107560f45beb463688238f10ac721 +Author: erwan celanie +Date: Thu Aug 13 16:34:32 2020 -0400 + + fix client instance struct + +commit 4c781db8ca692eb2a1823b50f259b534dd0a4545 +Merge: 94354dd 77d4be2 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Thu Aug 13 16:19:48 2020 -0400 + + Merge pull request #256 from richardletshacks/master + + starting update + +commit 77d4be2b0814af22410528786f7ef53e512ca954 +Author: godgamer029 +Date: Thu Jul 23 13:16:33 2020 +0200 + + Very important changes to horion + +commit f8296513ca06f40975a1157463ee1ea3eb4b2e6c +Author: godgamer029 +Date: Tue Jul 21 23:00:10 2020 +0200 + + Update to 1.16.10 + +commit fcde620534f766d2374c5dc1a963b3d670a51f82 +Author: godgamer029 +Date: Tue Jul 21 22:36:26 2020 +0200 + + Fix vs + +commit aaa2f910110d59b310dcd06b7577039ed2df9b10 +Author: godgamer029 +Date: Mon Jul 20 23:20:39 2020 +0200 + + Linestrip3d + +commit 7b94fd0566bdcfef8015576b10d4bbcc02ecb134 +Author: godgamer029 +Date: Sun Jul 19 23:25:56 2020 +0200 + + Epic drawLine3d + +commit 5ba94846fc9aa08136da86fb9c863f12b0d6b16d +Author: Richard +Date: Sun Jul 12 18:45:16 2020 +0200 + + add to public + +commit 41a03e42287730d5af8d3b237c81cae684ce40b3 +Author: Richard +Date: Sun Jul 12 18:15:48 2020 +0200 + + remove this + +commit 91a2bc7e2a4c29482fcd57d2e7777832ee9f2642 +Author: erwan celanie +Date: Sun Jul 12 11:43:10 2020 -0400 + + fix fastladder + +commit 8a996e4f418441e0069ccb3f1b4bea40af94a2e1 +Author: godgamer029 +Date: Fri Jul 10 19:49:51 2020 +0200 + + Joe Water fixes + +commit 5474a45e8187bb37b4dcb4a27de740cbeb61c82e +Author: Richard +Date: Thu Jul 9 14:38:08 2020 +0200 + + use moveinputhandler for bhop and fix joe getting stuck in water when in creative + +commit cbb270b16964043036b7486e4304cee83a57772d +Author: godgamer029 +Date: Tue Jul 7 17:18:20 2020 +0200 + + Fix vs project + +commit 748b1203cd77d2d2f3cb686c4a38ec53bb06e087 +Author: godgamer029 +Date: Tue Jul 7 16:42:13 2020 +0200 + + Joe sprints, fix seagrass and kelp + +commit d48c14406841c5ebf2f29b31de8b9fc080981bb3 +Merge: b07b52e a20cd89 +Author: Richard +Date: Mon Jul 6 21:51:51 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit b07b52e16e67bd48784cdcc2379a213f13b89c47 +Author: Richard +Date: Mon Jul 6 21:51:31 2020 +0200 + + fix this + +commit a20cd89ac165123b755ef8a077d62c61041d53de +Author: godgamer029 +Date: Sat Jul 4 17:20:37 2020 +0200 + + Fix joe + +commit cc88d2a34e13ac6b35be581b3c5529292e012683 +Author: godgamer029 +Date: Sat Jul 4 15:09:44 2020 +0200 + + Fix cmake build + +commit 10aa5d0d5bbde1aec675b5fa6b5cfe421a68d30d +Author: Richard +Date: Sat Jul 4 13:06:08 2020 +0200 + + minor improvements + +commit 33dad0f672dfa4b52623a0ea1c455a63239ab87f +Author: Richard +Date: Fri Jul 3 13:33:53 2020 +0200 + + fix spammer and add back silent scaffold + +commit 5c4f68c089a2c21d1eef02752dd589187deaeb55 +Author: Richard +Date: Wed Jul 1 12:44:32 2020 +0200 + + fix coordinates text offset + +commit 1ea10132de4cbe704abf664c126f197f41366e74 +Author: Richard +Date: Wed Jul 1 12:03:06 2020 +0200 + + refactor this check + +commit c1fd6164c41eb4af98d9ae4f457134751ff11d48 +Author: Richard +Date: Wed Jul 1 11:41:59 2020 +0200 + + hud sale option + +commit ad4906bafd0e045bbdb6cfeeb4473ce25396c86e +Author: Richard +Date: Wed Jul 1 02:21:27 2020 +0200 + + for some reason it doesnt work without these pointers + +commit d90dc556d279fbb35f209a6c21493b053b6517d3 +Author: erwan celanie +Date: Tue Jun 30 19:08:40 2020 -0400 + + fix auto armor + +commit 260232ce5b758b8f3b7ae5c59964d8d7ae19b95a +Merge: bf8691c b622096 +Author: erwan celanie +Date: Tue Jun 30 19:06:15 2020 -0400 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit bf8691c3111f4d2a9acfc8340fb0ddb88bb99ece +Author: erwan celanie +Date: Tue Jun 30 19:06:12 2020 -0400 + + fix .nbt load + +commit b622096d73fa96cc4fb52cc4b09382905d8ef456 +Author: Richard +Date: Wed Jul 1 00:03:16 2020 +0200 + + enhanced cheststealer + +commit 7d4e146c6c0028ff5af67b8ee72ddc10280f6b10 +Author: erwan celanie +Date: Tue Jun 30 16:44:29 2020 -0400 + + test + +commit 644cc02b5e680ddb93495db6fe13f711bd763967 +Author: erwan celanie +Date: Tue Jun 30 16:43:20 2020 -0400 + + FIX item struct & mob equipment packet + +commit a73d42ad20512629ccf1ba001a08f075070dade2 +Author: Richard +Date: Tue Jun 30 17:16:41 2020 +0200 + + fix cheststealer always being enabled + +commit 30355baca2dfceee11d0be61f36def1660127cec +Author: Richard +Date: Tue Jun 30 17:15:22 2020 +0200 + + make scripts render in clickgui + +commit 1fe2dda66ea8d16d178cb67e6c6b28ab83986a7d +Author: Richard +Date: Tue Jun 30 16:28:29 2020 +0200 + + tick to chestscreencontroller_tick + +commit beb67073c965a3b414234169346fb1170636aaed +Author: Richard +Date: Tue Jun 30 12:13:45 2020 +0200 + + add killaura hurttime + +commit ea6f18bea9b28129d7cd5ee28f82efb32736d0ab +Author: erwan celanie +Date: Tue Jun 30 01:20:21 2020 -0400 + + fix cbe + +commit ce2bde03588f97e27cc89eb4a1449e7891606029 +Author: erwan celanie +Date: Tue Jun 30 00:58:00 2020 -0400 + + fix + +commit ca54bacc06c9134161906716012ca6420db9baee +Merge: 2fa5259 94354dd +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Tue Jun 30 00:56:31 2020 -0400 + + Merge pull request #255 from richardletshacks/beta-support + + 1.16.1 support + +commit 94354ddc8c4bf6ed34e9f16ea985476f214b7bd4 +Author: erwan celanie +Date: Tue Jun 30 00:51:08 2020 -0400 + + support 1.16.1 + +commit e53219cb7d680f86e3e8b7ddd5250f4ce78baf85 +Merge: 327ecee 2fa5259 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Mon Jun 29 16:59:04 2020 -0400 + + Merge pull request #254 from richardletshacks/master + + yeet + +commit 2fa5259f303333022bba52c50ad3690fe60ce2de +Author: Richard +Date: Sun Jun 28 13:52:52 2020 +0200 + + make nametags draw over each other + render them in right order (dist) + +commit 666a69eeae74a4a5ae5715b04217a7654d963929 +Author: Richard +Date: Sun Jun 28 13:19:59 2020 +0200 + + make esp & nametags not draw over hud + +commit c9f21b141c097856ec7dfde60b6ae2c8378ad506 +Author: Richard +Date: Sun Jun 28 13:06:42 2020 +0200 + + improve cheststealer + +commit 3f7a4452bc0e133ca81dd48f2e934a330c25f2af +Author: Richard +Date: Sun Jun 28 12:45:36 2020 +0200 + + display nametags correctly above the entity + +commit afc51566f0706c67b0e9f62c968761898cd4baf0 +Author: erwan celanie +Date: Sat Jun 27 14:22:11 2020 -0400 + + fix cheststealer + +commit 95329b6e146027585f822beb14b891c2bde7ee96 +Author: Richard +Date: Sat Jun 27 19:59:10 2020 +0200 + + fix autototem, inventorycleaner autosort + +commit 2024edc1b097afe6bb5d5c23607b56bd779b3bf2 +Merge: facc03d c139124 +Author: Richard +Date: Sat Jun 27 10:59:03 2020 +0200 + + merge + +commit facc03df5d1ca98da41ce0056fe8325c5048f3bd +Author: Richard +Date: Sat Jun 27 10:56:40 2020 +0200 + + some crashes + +commit c1391242f9553bc44430f185d900e536bc43c07f +Author: erwan celanie +Date: Fri Jun 26 21:44:46 2020 -0400 + + fix ? + +commit 6e39b8ea8ae09f87e3ae440e9134e0ebd6a69584 +Author: erwan celanie +Date: Fri Jun 26 21:43:04 2020 -0400 + + bruh + +commit 305e5fd9e9682e437f2c3abc6ff511963791fea5 +Author: erwan celanie +Date: Fri Jun 26 21:37:02 2020 -0400 + + test + +commit 67ae041cff23f6c69342c7d26875bf8e1254759c +Merge: d314e15 be19d65 +Author: Richard +Date: Sat Jun 27 01:31:17 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit d314e15738da63b064af532d96c4227af5139e8f +Author: Richard +Date: Sat Jun 27 01:31:06 2020 +0200 + + fix + +commit 1b85ee64a9f81ec963683deeafcbaf41600ba050 +Author: Richard +Date: Sat Jun 27 01:22:07 2020 +0200 + + autosneak, command blocks in xray & cbe fix + +commit be19d656c1d23a55f743b3ee1edf1a68dad3ffd5 +Author: erwan celanie +Date: Fri Jun 26 16:09:23 2020 -0400 + + fix custom skin pack + +commit 6056dd3f3b976b3f04670c9ce8660d6aea87e6d9 +Author: godgamer029 +Date: Fri Jun 26 18:53:37 2020 +0200 + + Fix dupe + +commit 53851189b7ba64d2a0f3957cbf0b1f1897087e84 +Merge: 9063c25 4119ed4 +Author: godgamer029 +Date: Fri Jun 26 18:34:31 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 9063c25bbecfe382485f4e4fb756d520b1b98b12 +Author: godgamer029 +Date: Fri Jun 26 18:32:48 2020 +0200 + + Fix joe not saying anything when he's done + +commit 4119ed4afe54a9cedc0c5c32c7b0392cc102cb39 +Author: Richard +Date: Fri Jun 26 18:28:47 2020 +0200 + + ancient debris xray + +commit 8f37b23930b2a09ded99cf9dc913561d41649cdf +Merge: db9fe54 5442dfc +Author: Richard +Date: Fri Jun 26 18:17:24 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit db9fe54669cee30c8a7a63ba14cc9b3158e4aa54 +Author: Richard +Date: Fri Jun 26 18:16:53 2020 +0200 + + cbe + +commit 5442dfcc3ce82e85ae6ec4a69c21649c6c05dfc8 +Author: godgamer029 +Date: Fri Jun 26 18:10:37 2020 +0200 + + Fix unepic crash + +commit 6c45b5d724e3e7104e1611ab15310af777f6a14f +Merge: 1cc9063 a356ec9 +Author: godgamer029 +Date: Fri Jun 26 17:54:44 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 1cc906395ff0a91bf328fa6e5e7c5de71bd5a3e9 +Author: godgamer029 +Date: Fri Jun 26 17:54:35 2020 +0200 + + Fix protection + +commit a356ec9337be8ca62078be68b9193346a999b991 +Merge: 3da5a6d b9c7fae +Author: erwan celanie +Date: Fri Jun 26 11:46:19 2020 -0400 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 3da5a6debd6fa96b006a6737384f76e1d9370233 +Author: erwan celanie +Date: Fri Jun 26 11:46:17 2020 -0400 + + fix joe + +commit b9c7faeaa8d45ccd1500cb7e3aa3da0861279f2d +Author: godgamer029 +Date: Fri Jun 26 17:36:47 2020 +0200 + + Fix Dimension_getFogColor crash + +commit 6368df5b2ff8f57fb780c1f5b25593352041024b +Author: godgamer029 +Date: Fri Jun 26 17:26:35 2020 +0200 + + Fix auto armor + +commit ca9a95d59607c3c293f0143a55b142b291b23671 +Merge: cca86b0 327ecee +Author: godgamer029 +Date: Fri Jun 26 17:19:02 2020 +0200 + + 1.16 Support + +commit 327eceea7e3337e5b0b1d9c15c138d328418fa10 +Author: godgamer029 +Date: Fri Jun 26 17:13:01 2020 +0200 + + Fix auto armor + +commit 3912a04aaa4fb5cc92fade28a46c7aaed67c613b +Author: godgamer029 +Date: Fri Jun 26 16:57:30 2020 +0200 + + fix scaffold + +commit 078f3d7f50d5b6c860cdf1630c4fc1bd83dd43a9 +Author: godgamer029 +Date: Fri Jun 26 16:35:27 2020 +0200 + + Fix rainbow sky + +commit ebe844f61d58929309dbbf80d4739c36091f89b7 +Author: godgamer029 +Date: Fri Jun 26 16:29:12 2020 +0200 + + Fix fullbright + +commit f88b038a75d09dac132bd2a81e5555fdfbf74982 +Author: godgamer029 +Date: Fri Jun 26 15:38:59 2020 +0200 + + Fix velocity + +commit 3db207982f5755f442881b5bf580065bee55a19d +Author: godgamer029 +Date: Fri Jun 26 15:32:27 2020 +0200 + + Fix autocomplete + +commit 2b224719bd7ec9fc3467b4e232fa713e590db0c7 +Author: godgamer029 +Date: Fri Jun 26 14:54:39 2020 +0200 + + Fix drawLine3d + +commit 6b16d67ef16c714c094b5ab9ca0809ce9bd563d4 +Author: erwan celanie +Date: Thu Jun 25 23:03:54 2020 -0400 + + fix + +commit 4c763f4b10e2e6fdcda43fd3ef70e26e4bab05b6 +Author: erwan celanie +Date: Thu Jun 25 20:09:02 2020 -0400 + + yeet + +commit b69859657b6eddffd73d414f6357c139fc4a4bf3 +Author: erwan celanie +Date: Thu Jun 25 20:07:51 2020 -0400 + + fix sigs & player vtable + entity vtable + +commit 5cdae71d5275292e85e0c78de2bfefea2b707170 +Author: erwan celanie +Date: Thu Jun 25 14:09:54 2020 -0400 + + fix epic nbt + +commit 9dd0cfeac531ca4db01465ff2d932e75684d7163 +Author: erwan celanie +Date: Wed Jun 24 17:34:02 2020 -0400 + + fix vtable + +commit 768fbf7c62a56dd650e8ababbdc0078a1f1bc10a +Author: erwan celanie +Date: Wed Jun 24 17:27:50 2020 -0400 + + fix amor hud + +commit f089fc7082c08ba70f7fa602f4b04a10b47b825d +Author: erwan celanie +Date: Wed Jun 24 15:12:40 2020 -0400 + + fix .enchant + +commit d7a8897315c6cc1146dfd9c55d67493f6df426ac +Author: erwan celanie +Date: Wed Jun 24 14:42:37 2020 -0400 + + fix .give + +commit 2b58bbcbb3e4a0d15eb25c8b449a8da5f5e9e0b7 +Author: erwan celanie +Date: Tue Jun 23 19:38:41 2020 -0400 + + fix sigs + +commit 8b7c230482b82438840bc1abbd66050c74896b03 +Merge: c8e1c9a 7d1a7c6 +Author: godgamer029 +Date: Tue Jun 23 22:47:33 2020 +0200 + + Merge branch 'beta-support' of https://github.com/richardletshacks/Horion into beta-support + +commit c8e1c9a701298b2509b355d2b981afdd19e7edfd +Author: godgamer029 +Date: Tue Jun 23 22:47:08 2020 +0200 + + Epic emote logging + +commit 7d1a7c6e2c93bfc067e2d80e28d6b6d8f20dc240 +Author: erwan celanie +Date: Tue Jun 23 16:43:33 2020 -0400 + + fix client instance vTable + +commit 7b493a8f04e0fd8fb6cfdbda29429eeacad11bf1 +Author: godgamer029 +Date: Tue Jun 23 22:24:04 2020 +0200 + + Fix cool sigs + +commit 9ebe92b1417ff50378e3c96fa141c10c4a96f302 +Author: godgamer029 +Date: Tue Jun 23 22:07:00 2020 +0200 + + fix commands + +commit d57d8ccc6bf4aa413ee088c80e6c482d9297c62e +Author: godgamer029 +Date: Tue Jun 23 21:46:17 2020 +0200 + + Fix 2d drawing + +commit 190d8f2b34e0940e70ae96ead62043be54edfe46 +Author: godgamer029 +Date: Tue Jun 23 21:31:31 2020 +0200 + + Fix sigs + +commit 85a8ebe6567021f3e68a553025e677d97a2c5a90 +Author: godgamer029 +Date: Tue Jun 23 20:41:49 2020 +0200 + + Full Entity class fixed + +commit 79aa36c3a78c19cbc0e1a8714e05343bd37f90da +Merge: ace0228 ad2b1df +Author: godgamer029 +Date: Tue Jun 23 20:24:50 2020 +0200 + + Merge branch 'beta-support' of https://github.com/richardletshacks/Horion into beta-support + +commit ace0228ddb12812f2bc3fb9853bec362feca5842 +Author: godgamer029 +Date: Tue Jun 23 20:24:37 2020 +0200 + + Fix Entity Class + +commit ad2b1df0b7f1c6e5fda48c42cb84dd011978600a +Author: erwan celanie +Date: Tue Jun 23 14:06:10 2020 -0400 + + fix guidata + +commit db5c3de2ee43334d582d60e3bf4dd951b25fb428 +Author: godgamer029 +Date: Tue Jun 23 19:27:13 2020 +0200 + + Update some entity stuff + +commit a8b8d816891829b0067045367e6258c355406481 +Author: godgamer029 +Date: Tue Jun 23 19:02:48 2020 +0200 + + Chat messages + +commit fa05bb0acf5fa6a2a87032236bfa80bb913c2340 +Author: godgamer029 +Date: Tue Jun 23 18:42:15 2020 +0200 + + Get ingame + +commit 4a0017d3d1e15d53daa3d6e1bc962d10872f0e12 +Author: godgamer029 +Date: Tue Jun 23 18:39:44 2020 +0200 + + Fix that + +commit febec7df6fe5cee73aa8020a910da5ccb41cf676 +Author: godgamer029 +Date: Mon Jun 22 15:37:19 2020 +0200 + + Crashless main menu + +commit a903abade576f19ea38297afe662a279d401beee +Merge: 0a1efae 61f3fa0 +Author: godgamer029 +Date: Mon Jun 22 15:19:32 2020 +0200 + + Merge master + +commit 0a1efae1de9ba3863e934d3ec16c2b517382b284 +Author: godgamer029 +Date: Mon Jun 22 15:11:24 2020 +0200 + + Fix sigs + +commit cca86b00c3598d4c9f8237cfd7c6157393eab323 +Author: erwan celanie +Date: Sun Jun 21 21:23:46 2020 -0400 + + yes + +commit 21df31105ca3eaca8b1cd73bf0e2926dc88ad0ad +Author: erwan celanie +Date: Sun Jun 21 21:22:02 2020 -0400 + + fix painting not rendering + +commit 61f3fa0c1110c19d32f1b1ce10e1bebb57a73dc5 +Author: godgamer029 +Date: Sun Jun 21 12:53:56 2020 +0200 + + Add EntityList to Scripting API + +commit 84a887bd0c6915aea1a4bf1c3a28436500c03056 +Author: godgamer029 +Date: Sat Jun 20 20:22:42 2020 +0200 + + Add .nbtraw alias + +commit 0885e23501a7381e00d5d27c19af56a15428dc17 +Author: erwan celanie +Date: Wed Jun 17 16:52:54 2020 -0400 + + epic + +commit 18c4747a2a5045e4f502d172aee12b095b608749 +Author: Richard +Date: Wed Jun 17 18:57:19 2020 +0200 + + push teleport + +commit fba191142953d0e223e9e3b09fd472c1a5154579 +Author: Richard +Date: Wed Jun 17 17:59:54 2020 +0200 + + proper nametags + +commit cfb01e19434ed832ab3fdea2435218d42efbcabd +Author: test +Date: Wed Jun 17 15:58:23 2020 +0200 + + idk + +commit bb7b231c0e6a4989fcb0ca9bea128a18c401228a +Author: test +Date: Wed Jun 17 15:56:41 2020 +0200 + + Fix BowAimbot and remove unnecessary allocations + +commit 4e9f8a4e963c79a536f695b81733340452bfd0ab +Author: godgamer029 +Date: Tue Jun 16 20:21:57 2020 +0200 + + Joe now recalculates path whenever it finishes an incomplete one + +commit 6474d424d19399b77cfc8058820c13b363cded3b +Author: godgamer029 +Date: Tue Jun 16 17:52:59 2020 +0200 + + Fix tracers + +commit 2d6bc1291cb53c9d8acd02f59497a01ad1cc6822 +Author: godgamer029 +Date: Tue Jun 16 17:39:19 2020 +0200 + + Fix drawline + +commit b35ead1b9ebb25e0144c0bcab9f0883cedabceef +Author: godgamer029 +Date: Mon Jun 15 14:26:49 2020 +0200 + + Execute Commands via console + +commit 326f2dd3ce9f05d17791b1cbba7174fd7f928616 +Author: godgamer029 +Date: Mon Jun 15 13:31:25 2020 +0200 + + Remove Windows.h from Logger.h + +commit 3cd9b72c5041d634498ae6a39e6d431842459052 +Author: erwan celanie +Date: Sun Jun 14 19:27:59 2020 -0400 + + yeet + +commit 92914aee391315d2da19ae242b8c2b0447f37a1b +Merge: 8b5dcfc 12b5606 +Author: godgamer029 +Date: Sun Jun 14 23:39:46 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 8b5dcfc3177f26d39654d294c2c1a99a9a2c2141 +Author: godgamer029 +Date: Sun Jun 14 23:39:36 2020 +0200 + + Do Tracers properly this time + +commit 12b56063b612ac5cfcd9a4206dbb94c1cea80ee3 +Merge: edb8f5d b25ceed +Author: erwan celanie +Date: Sun Jun 14 17:05:53 2020 -0400 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit edb8f5da6b851b53a97241aa4db20b3e23d6863a +Author: erwan celanie +Date: Sun Jun 14 17:05:50 2020 -0400 + + Nametags improvements + +commit b25ceedac2736a1800729fd7a135d477957cfaa0 +Merge: cf949f5 0f6a022 +Author: godgamer029 +Date: Sun Jun 14 14:12:42 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit cf949f5f22e41fef9656b8eb631e0bb4f8e53b28 +Author: godgamer029 +Date: Sun Jun 14 14:12:30 2020 +0200 + + Fix NoKnockback + +commit 0f6a0221c75d0b1966481db5fa70fff055effa78 +Author: erwan celanie +Date: Fri Jun 12 19:07:37 2020 -0400 + + bruh + +commit 2b5d672f8be021272b05e7687c4eeda90f25decd +Author: erwan celanie +Date: Fri Jun 12 19:04:30 2020 -0400 + + fix .give + +commit 928ce98eae0335ebd4404a1966dbee5792e320cd +Author: godgamer029 +Date: Fri Jun 12 22:41:46 2020 +0200 + + Horion = Hat confirmed doe???? + +commit 5938094dd8a27c24d359ae7a26d34164443cdac9 +Merge: bd203d0 f7e04e5 +Author: godgamer029 +Date: Fri Jun 12 15:58:24 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit bd203d00029dfac8fec7d71981737163cb08d28a +Author: godgamer029 +Date: Fri Jun 12 15:58:15 2020 +0200 + + Allow incomplete paths + +commit f7e04e5214705f3cb8fa5833363cf0563fc5e502 +Author: Richard +Date: Fri Jun 12 15:23:52 2020 +0200 + + bruh was this always broken? + +commit 42f6a3f81d9120e9c5493984625b6e23e85d2f33 +Merge: 90337b1 c6e0123 +Author: Richard +Date: Fri Jun 12 00:32:07 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 90337b172f0074498c91a503786908e8d6a1bf22 +Author: Richard +Date: Fri Jun 12 00:31:54 2020 +0200 + + escape codes in .say + +commit c6e0123b95a95ec486162ec71c2991a94cc0b2d7 +Author: godgamer029 +Date: Thu Jun 11 20:38:34 2020 +0200 + + Don't run into bamboo + +commit 7b529e8cf4987253a95c081f6b45a94809f19aab +Author: godgamer029 +Date: Thu Jun 11 15:35:03 2020 +0200 + + .path player + +commit d55e5a2e5dec0bbfabcfd6e8e1989fc5f18552f6 +Author: godgamer029 +Date: Wed Jun 10 22:25:31 2020 +0200 + + Fix water + +commit b443b0f1a3720a2e2beb4247b36344b9346d2b75 +Author: godgamer029 +Date: Wed Jun 10 21:23:26 2020 +0200 + + Use maps for storing nodes (massive performance improvement) + +commit e4c139a8a5bb2f3f1ba255da4cc88487406485d9 +Author: godgamer029 +Date: Wed Jun 10 18:22:06 2020 +0200 + + Avoid magma blocks & Performance improvements + +commit 6fdab9f88b6a6633500d66fe1c1e4512f7cd6e8f +Author: godgamer029 +Date: Wed Jun 10 18:04:58 2020 +0200 + + Don'd do risky jumps when eating + +commit 5c1f11ef24fd363f661f29fde1caf641e895a410 +Author: godgamer029 +Date: Wed Jun 10 16:06:34 2020 +0200 + + Fix jumping in tight spaces + +commit d77e26c6c85aa5930ff2b1269d485ceb43797d6c +Author: godgamer029 +Date: Wed Jun 10 15:45:33 2020 +0200 + + Jump improvements, fix long drop bug + +commit 59c4a20b92ae54cbf371f5f8708f00e78feb638c +Author: godgamer029 +Date: Wed Jun 10 15:25:02 2020 +0200 + + Walk on slabs and chests + +commit 3252bd217fa13eaebc39f158d7cd3e525bd4aefb +Author: godgamer029 +Date: Wed Jun 10 14:59:57 2020 +0200 + + Avoid wither roses + +commit 3435490cce47f578bc9638719864534033c79553 +Author: godgamer029 +Date: Wed Jun 10 00:39:46 2020 +0200 + + Fix ImmediateGui & flowing Water cost improvements + +commit c9d012b20098637ccd5cbe1c3f3eaf5f082b0171 +Author: godgamer029 +Date: Wed Jun 10 00:10:49 2020 +0200 + + Actual Epic water movement + +commit a49996fa008dac872714acf9dc951f9386d9b02f +Author: godgamer029 +Date: Tue Jun 9 23:40:01 2020 +0200 + + Fix NoPacket not allowing you to join worlds/servers + +commit d45fbae36bf699e1a28a1793428912755e4e3514 +Author: godgamer029 +Date: Tue Jun 9 21:36:32 2020 +0200 + + Water fixes + +commit f64ff7d8d3ad55af8efed98bf74ec5101644a467 +Author: godgamer029 +Date: Tue Jun 9 21:10:46 2020 +0200 + + Joe can now drop down 1-block-gaps with bigger heights + +commit f16efc00877e0a7543b404924931a4c53c4155c6 +Author: godgamer029 +Date: Tue Jun 9 14:33:23 2020 +0200 + + Minor joe fixes + +commit fc04b5051a8f4fa1095c73454279166f72dd4f5b +Author: godgamer029 +Date: Tue Jun 9 13:29:44 2020 +0200 + + More parkour + +commit 15ef53e08ba00186530ff03bb20e50c326ba2c61 +Author: godgamer029 +Date: Tue Jun 9 01:33:20 2020 +0200 + + Don't do this joe + +commit d5e93f3a91c9d3675f37b182b385720f03cf228b +Author: godgamer029 +Date: Tue Jun 9 01:14:52 2020 +0200 + + Minor tuning + +commit a49ff76c5e5af95c7693dc9aaf9681439b1c54e1 +Author: godgamer029 +Date: Tue Jun 9 01:03:07 2020 +0200 + + More epic water movement + +commit 775895c45dbfb299119f8a4198b514d88c095de7 +Author: godgamer029 +Date: Tue Jun 9 00:32:33 2020 +0200 + + Simple water movement + +commit d0b34414262e6a7604c2b78760d3aab01d3d836d +Author: godgamer029 +Date: Mon Jun 8 23:16:40 2020 +0200 + + Fix a bug where the path was immediately discarded + Fix jumps where the block above the end position is obstructed + Penalize diagonal movement when we scrub against a wall + +commit a6cddaa157812ff05b51ce7dba6a0aafd8831c22 +Author: godgamer029 +Date: Mon Jun 8 20:11:31 2020 +0200 + + Walk down blocks & Fix .path xyz + +commit 3c215e81722f88a44769f207399f3b69eeb3caaa +Author: godgamer029 +Date: Mon Jun 8 19:47:50 2020 +0200 + + Fix jump 2 + +commit 0b2cd1a85a1b944cecd5ad5d00eb5e507e008878 +Author: godgamer029 +Date: Mon Jun 8 19:38:20 2020 +0200 + + Fix jump + +commit d10b5f860fd505561eee1e8fce96779c1e4973fc +Author: godgamer029 +Date: Mon Jun 8 19:36:36 2020 +0200 + + Epic jumps + +commit 6a95d6af13e0cf8076c6269ffb8a53a13ba39a5b +Author: godgamer029 +Date: Mon Jun 8 17:18:47 2020 +0200 + + joe beta release + +commit d22c4baf4752b94c43eff97b0a44a939d5c1c7f6 +Author: godgamer029 +Date: Mon Jun 8 17:10:57 2020 +0200 + + Epic followpath command & module + +commit 968daa03f5dd6f948822d1fd3120d5401a890d30 +Author: godgamer029 +Date: Mon Jun 8 16:06:24 2020 +0200 + + Joe goals + +commit 3e4391b2b6ebf0ae44a39b4098d1e2340c9464e0 +Merge: 1fdeb40 c2d49b3 +Author: godgamer029 +Date: Mon Jun 8 15:00:47 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 1fdeb4040236fa968d33f1dab5c6414933dcb196 +Author: godgamer029 +Date: Mon Jun 8 15:00:38 2020 +0200 + + Joe movement improvements + +commit c2d49b3abb58c798388430da771a4acd6891ee14 +Author: Richard +Date: Sun Jun 7 23:14:13 2020 +0200 + + fix criticals sound + +commit 5a184e1e9d1f5f757b1e1a0cc5f7a92153d80d3f +Author: godgamer029 +Date: Sun Jun 7 22:47:28 2020 +0200 + + WIP joe movement controller + +commit cad6a9fc69bd3af4b5b19e332b9fb72682144028 +Author: godgamer029 +Date: Sun Jun 7 17:22:51 2020 +0200 + + Fix cobwebs & put drops in a loop + +commit e8062fb6c3eff7242d907523f0c8d6274f63fe2f +Author: godgamer029 +Date: Sat Jun 6 14:47:19 2020 +0200 + + Avoid dangerous paths + +commit 33df97865fcf798299bf61c2b1f0b5c6927e074d +Author: godgamer029 +Date: Sat Jun 6 13:39:37 2020 +0200 + + 3 Block drop + +commit d78a2d13c97d3264b61fc29c9465b12729005efe +Author: godgamer029 +Date: Fri Jun 5 23:45:35 2020 +0200 + + dev-only joe + +commit f6f971ae2262ca699e69adf3099edb9cee2bcebf +Author: godgamer029 +Date: Fri Jun 5 00:49:16 2020 +0200 + + Fix mobkillaura + +commit e13c2228c1eb90588022b09cb00aabd5bfa3ed4d +Author: godgamer029 +Date: Thu Jun 4 23:58:10 2020 +0200 + + Update Item vtables & epic shulkers + +commit d94b543dfe387db922fc3ceaf37b10ccc8e1426e +Merge: 3ee27f9 a2e8d24 +Author: godgamer029 +Date: Thu Jun 4 20:29:26 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 3ee27f973e8be26c8d4f204059905cd6fa465a8b +Author: godgamer029 +Date: Thu Jun 4 20:29:15 2020 +0200 + + Fix game crash when .giving invalid items + +commit a2e8d249594c3f649af7a3e4a9b183f5f36f7e06 +Author: godgamer029 +Date: Thu Jun 4 16:13:38 2020 +0200 + + Add to solution + +commit 9e98862713ba84b81faa35387c163041e0812d1e +Merge: 5ab3c49 28e4df2 +Author: godgamer029 +Date: Thu Jun 4 16:12:28 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 5ab3c496882c2dd26da51fac2bb3921f2cfe6969 +Author: godgamer029 +Date: Thu Jun 4 16:12:19 2020 +0200 + + add AntiImmobile + +commit 28e4df21d532258f02f7bb497410ac4848c95649 +Author: godgamer029 +Date: Thu Jun 4 14:25:59 2020 +0200 + + Add to solution + +commit 8504b30582a5382555ecbe3af93b148ed24ba01b +Merge: 6b8f813 780a5e5 +Author: godgamer029 +Date: Thu Jun 4 14:23:17 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 6b8f813036a4653d241f87374ff9261ed51fd0d5 +Author: godgamer029 +Date: Thu Jun 4 14:20:30 2020 +0200 + + Add nohurtcam + +commit 780a5e55bfe314ce9c312fb11b59c14545597abd +Author: godgamer029 +Date: Wed Jun 3 20:03:35 2020 +0200 + + Add new files to solution + +commit 31b97a225d28bd011f97f1275143188094b8d10d +Author: godgamer029 +Date: Wed Jun 3 20:01:00 2020 +0200 + + Add freelook & camera sdk + +commit 9e8531542479299f3ec6b7fd30d28b9aab2cd90c +Author: godgamer029 +Date: Tue Jun 2 23:59:44 2020 +0200 + + Fix scroll wheel + +commit 48c4e6f40794bbba383a34002b6290ec233f2e72 +Author: godgamer029 +Date: Tue Jun 2 23:34:59 2020 +0200 + + Clickgui positions are now saved in configs & clion said i should replace all these loops + +commit 2be0d5631b51c36bf2e1ce9923a97bfd537b0452 +Author: godgamer029 +Date: Tue Jun 2 14:55:00 2020 +0200 + + reenable xor + +commit fb011466751ff6e98e4bb117a1bd4c55c6c384de +Author: Richard +Date: Mon Jun 1 15:57:59 2020 +0200 + + scaffold spoof + +commit 98b1f4ce76deb14146880bb6b104395433f98c02 +Author: godgamer029 +Date: Mon Jun 1 14:24:40 2020 +0200 + + Player action packet + +commit 9e02124757c7164368d67194f1b6f7e21383a88f +Author: godgamer029 +Date: Mon Jun 1 00:28:05 2020 +0200 + + Fix entity list + +commit eb2c520eebb19c8446f2844f4b1a687703e0f31d +Author: godgamer029 +Date: Sun May 31 17:20:54 2020 +0200 + + Add onEnabled and onDisabled for scripts + +commit 506d928c05abb30ba35182cee38e4779d3ae6c5a +Merge: 40f443c 4a7ba8a +Author: godgamer029 +Date: Sun May 31 17:11:14 2020 +0200 + + Merge remote-tracking branch 'origin/master' + +commit 40f443c59b31dcc5bbd86bf62a037bbfc2a7d538 +Author: godgamer029 +Date: Sun May 31 17:11:04 2020 +0200 + + Scripts in tabgui + +commit 4a7ba8ab02e16862839ea09dcc944c73023cef79 +Author: godgamer029 +Date: Sun May 31 16:50:29 2020 +0200 + + Fix visual studio + +commit f791e75f5096949a40b9d411100c58196baeffdc +Author: godgamer029 +Date: Sun May 31 16:23:41 2020 +0200 + + cmake & compilation speed improvements + +commit 99cd27928748ede0b5deec205d85dae50aa54615 +Merge: 930408f 970ce95 +Author: godgamer029 +Date: Sat May 30 14:00:09 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 930408f465141e2f86aca8d2b6af96d8a4d0d6ec +Author: godgamer029 +Date: Sat May 30 14:00:00 2020 +0200 + + Nothing to see here + +commit 970ce959cfe4870b41cad1ba694bbcf370524080 +Author: Richard +Date: Wed May 27 10:47:46 2020 +0200 + + godmode epic + +commit e5b514765d434a1a99c9d33ad583ad1a071d377d +Author: Richard +Date: Wed May 27 02:40:58 2020 +0200 + + improve fucker + +commit 2db9e351695666f05fb99dabe657f0159785f9fe +Author: Richard +Date: Mon May 25 17:07:54 2020 +0200 + + fix crash + +commit 8b6c109fc1341c36c2c97ebe45efe94d067a2275 +Merge: 7b0851b 702bec7 +Author: Richard +Date: Mon May 25 01:16:19 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 7b0851b07cd405d9a5d1773f6416fe2c13c3b973 +Author: Richard +Date: Sun May 24 23:43:07 2020 +0200 + + silent rotations option + +commit 1b83a7bf7f46d7073843ce58acb606c144cd47b0 +Author: Richard +Date: Sun May 24 23:31:16 2020 +0200 + + criticals + +commit 84a2ed012f3b11b3a5ad96570e3b68ac2c2b4d06 +Author: Richard +Date: Fri May 22 18:37:39 2020 +0200 + + improve inventorycleaner + +commit a501f73f857cdae29e97633e2e81f4db138f60d1 +Author: Richard +Date: Fri May 22 18:08:20 2020 +0200 + + bunch of refactoring + +commit 702bec7745f92bacea68b8d27c025a9b6a8b8a9b +Author: Richard +Date: Wed May 20 23:27:35 2020 +0200 + + Update README.md + +commit 45ee528ced3d253fa5dad2970cb30eecb10a4ced +Author: Richard +Date: Mon May 11 18:51:07 2020 +0200 + + improv + +commit e61158079e9ee91316b5200fa0c33ef2160eea58 +Author: Richard +Date: Fri May 8 17:47:39 2020 +0200 + + always show option for hud, some bugfixes + +commit 29bc0948ae4c70e9607de9a093e42fd1704bdd7c +Author: Richard +Date: Fri May 1 03:10:15 2020 +0200 + + removed unused code + +commit dcfbbbfb5aab24d5f1550f1dc07b74f7afe450f6 +Merge: bc438e9 280c4bb +Author: Richard +Date: Thu Apr 30 14:30:14 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit bc438e90f1aa115459d35e06ab1152df4c7c0c51 +Author: Richard +Date: Thu Apr 30 14:29:55 2020 +0200 + + fix blink name + +commit 280c4bba423d86846dd7e3be7560b18ccae29ea5 +Author: godgamer029 +Date: Thu Apr 30 14:01:55 2020 +0200 + + Fix public build + +commit ce3a9bdc46b74f6cd29531f37b5c38ff0272f5ac +Author: erwan celanie +Date: Tue Apr 28 16:57:59 2020 -0400 + + bruh + +commit e73647ed1e15877487115b85655190437b32a05a +Author: erwan celanie +Date: Tue Apr 28 16:56:26 2020 -0400 + + i'm done + +commit f5b2d515367512acba340800b9b3cae2f7263bea +Author: godgamer029 +Date: Tue Apr 28 14:37:19 2020 +0200 + + Fix barrels + +commit fd9c464d604e7de66a14981cb6d0c5fcf1263172 +Merge: 1ab1191 542a546 +Author: godgamer029 +Date: Tue Apr 28 14:13:03 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit 1ab11915337c59013d185241325d85f5a7de5373 +Author: godgamer029 +Date: Tue Apr 28 14:12:52 2020 +0200 + + Fix connected chests + +commit 542a546439a9031f4ebd9e38a5dbcf7636262cf0 +Author: erwan celanie +Date: Mon Apr 27 16:17:43 2020 -0400 + + fix + +commit 8e24b174e731a97c15458010a18c27581956ad91 +Author: erwan celanie +Date: Mon Apr 27 16:12:11 2020 -0400 + + gaming + +commit abb33afe1210147ca7f0c81e42fd4e89069fd85c +Author: godgamer029 +Date: Mon Apr 27 17:44:18 2020 +0200 + + Outline chestesp (totally not copied from hat) + +commit fb4751bf7896d2897fc11d3ede60d2f4c3d62a90 +Author: godgamer029 +Date: Mon Apr 27 16:29:14 2020 +0200 + + Fix Memory leak and more epic esp + +commit bf51c0bf92ac1e5545023b06424826e18c33bc7b +Author: godgamer029 +Date: Fri Apr 24 23:03:42 2020 +0200 + + Dont load the same script twice + +commit 7f87b5c29d33c400d1bc6295e41baee7e4c09cfd +Author: godgamer029 +Date: Fri Apr 24 22:32:47 2020 +0200 + + Actual Script support + +commit aab87f70d61ef0d1ac8edc12d7670a47c9f07f4b +Author: godgamer029 +Date: Thu Apr 23 14:13:34 2020 +0200 + + Disable this for now + +commit 5ef8a5a64810302e4d88fef4aa7a5b3083eedb53 +Author: godgamer029 +Date: Wed Apr 22 13:41:31 2020 +0200 + + Cool shaders & Gamer server is experimental + +commit 7c24127a1423b3e513060805610445cd8e99246a +Author: godgamer029 +Date: Wed Apr 22 00:43:49 2020 +0200 + + fix + +commit 4ef8dc94e7ebcb43729da1b0c03c40c6a1d5acb9 +Author: godgamer029 +Date: Wed Apr 22 00:08:01 2020 +0200 + + present hook + +commit 6609c53422bcffcdfde75313278cc8da689fc45b +Author: godgamer029 +Date: Tue Apr 21 22:11:19 2020 +0200 + + Add epic horion server + +commit 9b92d26e2fd3be194217bcbf94c0dcf8f0d7e315 +Author: godgamer029 +Date: Mon Apr 20 01:22:14 2020 +0200 + + Module manager api + +commit 23e383697378c6123baca0248fca7cbb1fd66e61 +Author: godgamer029 +Date: Sun Apr 19 20:24:49 2020 +0200 + + Command Manager + +commit 0b81c2037a5080288e2e734b2cae5130841329d1 +Merge: 32c129d 7776f1d +Author: godgamer029 +Date: Sun Apr 19 18:13:52 2020 +0200 + + Merge branch 'scripting2' + +commit 7776f1df223e360fcd994884574fb7ad5cb5da5e (origin/scripting2) +Author: godgamer029 +Date: Sun Apr 19 18:11:33 2020 +0200 + + Fix + +commit 32c129dc633ebda51055903680d71545fdcce165 +Merge: f34171e 4b17cde +Author: GodGamer029 +Date: Sun Apr 19 18:03:18 2020 +0200 + + Merge pull request #251 from richardletshacks/scripting2 + + Merge Scripting into master + +commit 4b17cded01bd1a281def1bbbef01ee1a58aeaf51 +Author: godgamer029 +Date: Sun Apr 19 16:00:27 2020 +0200 + + Console in injector + +commit ea9d692a9f927a8261ae8b06dd4c63a4d4fe57a1 +Author: godgamer029 +Date: Sun Apr 19 15:03:14 2020 +0200 + + Final changes + +commit b82bd7bc937adc226f5d0e164bec3d4b62fadd07 +Author: godgamer029 +Date: Sun Apr 19 12:57:25 2020 +0200 + + More functions, fixes + +commit d3a68db64fcb26ce9ba2a0e87be783dc6ee26617 +Author: godgamer029 +Date: Sun Apr 19 12:00:30 2020 +0200 + + More functions, local player setters added + +commit 35ee63c3a3dbfa53fb5046d7f4a54500cd152027 +Author: godgamer029 +Date: Sun Apr 19 01:25:10 2020 +0200 + + More functions & prototypes + +commit 7f7ce196586ebde17b58a53ea08135241102ef75 +Author: godgamer029 +Date: Sun Apr 19 00:30:34 2020 +0200 + + Execute command + +commit a324159fe70efc3548ec06379e590d3ec820dde8 +Author: godgamer029 +Date: Sun Apr 19 00:19:10 2020 +0200 + + Implement Entity and Vector3 + +commit 7debdc0690ef6381705dc869ee091775634a7c53 +Author: godgamer029 +Date: Sat Apr 18 19:28:20 2020 +0200 + + Refactor stuff away from TestCommand + +commit bbebc95fc315238f45a8caae794ee0b8d1b89a00 +Merge: 698c6ab f34171e +Author: godgamer029 +Date: Sat Apr 18 16:45:25 2020 +0200 + + Cool update + +commit f34171ee354c7d5ab84037f344951fad0493b756 +Author: godgamer029 +Date: Sat Apr 18 16:05:37 2020 +0200 + + Fix fullbright + +commit da0648530a887000f581811032ef52702942717b +Merge: ac67c7f a96551d +Author: godgamer029 +Date: Sat Apr 18 14:59:53 2020 +0200 + + Merge branch 'master' of https://github.com/richardletshacks/Horion + +commit ac67c7fcfc833150bbdcae34b557f6acac1ea008 +Author: godgamer029 +Date: Sat Apr 18 14:59:40 2020 +0200 + + Fix Geometries + +commit a96551ddb7a5c8de72974f58089f9ef6bae6c364 +Author: Richard +Date: Fri Apr 17 02:43:15 2020 +0200 + + remade 2d esp so hat team wont bully me + +commit 4a90ef7cc7a99f6c872db7cffb6596bc99c79ed1 +Author: godgamer029 +Date: Thu Apr 16 11:54:40 2020 +0200 + + Fix a shit ton of bugs + +commit 34562a798b03703d834aeac7eb082879c6264623 +Author: erwan celanie +Date: Wed Apr 15 23:00:55 2020 -0400 + + support for 1.14.6 + +commit 0e63a5c9273f6920a0a3364c54ce9990f75745b2 +Author: godgamer029 +Date: Fri Mar 27 19:28:15 2020 +0100 + + Fix beta + +commit 7069b7a469ec064b2d26f372b0218daa7d5251ec +Author: godgamer029 +Date: Fri Mar 27 19:08:42 2020 +0100 + + Fix logger + +commit 3f4e6b0302b002ec01f349413a2931bb65fc1e99 +Author: godgamer029 +Date: Fri Mar 27 19:05:31 2020 +0100 + + Bruh + +commit 2a60e02e1238da328888813283209c30ca14b70c +Author: godgamer029 +Date: Fri Mar 27 18:53:11 2020 +0100 + + More logging + +commit e05a84f7f1e567ee74fbed50e6722990b8149c07 +Author: godgamer029 +Date: Fri Mar 27 18:36:09 2020 +0100 + + Fix up these bois + +commit f8a0b15d080f726b84a02f2162b2ed2a343b9916 +Author: godgamer029 +Date: Fri Mar 27 18:30:49 2020 +0100 + + Fix that badboi + +commit aa208752ac2d32e75c7e0138f6e5b8e40770f8de +Author: godgamer029 +Date: Fri Mar 27 18:18:37 2020 +0100 + + More debugging information + +commit d1e46149c89df327b580a5cd28a5b1ab4cb1f642 +Author: godgamer029 +Date: Fri Mar 27 17:57:42 2020 +0100 + + Fix crash + +commit 93d32177da64c5781770ecd0e351c5fee8c2e204 +Author: Richard +Date: Fri Mar 27 13:49:12 2020 +0100 + + fix toggle command + +commit f13bb8f20d300e83c8ba64c908cf1caba5c495be +Author: Richard +Date: Fri Mar 27 12:49:03 2020 +0100 + + fix cbe beehive + +commit 2ed204e680774b3d8cf6f4f5746520073c093606 +Author: godgamer029 +Date: Fri Mar 27 01:09:56 2020 +0100 + + Pack it up boys + +commit 68561cb2a03b67720722f8ea866a3e78875d884f +Author: godgamer029 +Date: Fri Mar 27 01:00:10 2020 +0100 + + Fix + +commit 3ef860bbfd1e1bb3e672daf32e15a70c57921249 +Author: godgamer029 +Date: Fri Mar 27 00:43:34 2020 +0100 + + Surely this would fix it + +commit 5cefa2a9a40cd4a9abcc43a10e7ff547e59af7d1 +Author: godgamer029 +Date: Fri Mar 27 00:42:22 2020 +0100 + + pls work now? + +commit 2eb696f753050f58add44382da0fc63c41700675 +Author: godgamer029 +Date: Fri Mar 27 00:34:50 2020 +0100 + + Bruh + +commit 5d5f230a4889c4a262b27a0cd5ea0e9a4ea944a0 +Author: godgamer029 +Date: Fri Mar 27 00:31:40 2020 +0100 + + Fix Beta Build Config + +commit d2e10a34bab79541123516e5792138e4af0dcf4f +Author: godgamer029 +Date: Fri Mar 27 00:22:08 2020 +0100 + + I hope we never go open source again + +commit 0722fab4cbe925b6970baee61b6170afd4067503 +Author: godgamer029 +Date: Thu Mar 26 23:55:09 2020 +0100 + + Might as well use https now + +commit dfff12b9aa96971a383feaf7bfe8de6e75ebcff3 +Author: godgamer029 +Date: Thu Mar 26 23:51:10 2020 +0100 + + Little hack + +commit 7fe2ca680de9c582dba78724fbf0209a444dfca9 +Author: godgamer029 +Date: Thu Mar 26 23:46:12 2020 +0100 + + Mixing it up a little + +commit ef8330cd52bcc64dae57807ce6543299fef827de +Author: godgamer029 +Date: Thu Mar 26 23:37:37 2020 +0100 + + Workaround richards epic logging + +commit 698c6ab91913b89220ea915c8791e488a617620e +Author: godgamer029 +Date: Thu Mar 26 16:37:54 2020 +0100 + + Right + +commit 9449f2e3311197bdb8a84b2f0ca4b74b4eb87165 +Author: godgamer029 +Date: Thu Mar 26 16:34:41 2020 +0100 + + Revert "Gaming?" + + This reverts commit 127bd5bdace6caa9fbddfd469fdcb001199bfb25. + +commit 127bd5bdace6caa9fbddfd469fdcb001199bfb25 +Author: godgamer029 +Date: Thu Mar 26 16:33:27 2020 +0100 + + Gaming? + +commit 957054ec0cd17607553fe43565fcf34ceb14b36a +Author: erwan celanie +Date: Tue Mar 24 20:14:36 2020 -0400 + + added nbt save/load & fix cbe + +commit 4a4c36c2347c1f4f0697ba24c385d5f6a6a8fedb +Author: erwan celanie +Date: Mon Mar 23 22:25:35 2020 -0400 + + minor fixes + +commit b5e5bb58916750e2c635b37c60468ec9ad46feda +Author: erwan celanie +Date: Mon Mar 23 22:09:57 2020 -0400 + + fix + +commit c241ab45d5b4077d7a4a7de08bf99f66f8a7fa38 +Author: erwan celanie +Date: Mon Mar 23 01:20:06 2020 -0400 + + fix bunch of sigs & client instance + +commit 8d8d3d01f623bac85dc4b4e60a10f0bf3a8dc018 +Author: Richard +Date: Wed Mar 18 21:27:22 2020 +0100 + + bruh + +commit 0eaa8e5981cfad55bdf39f78fc557f59366a4003 +Author: Richard +Date: Wed Mar 18 21:26:11 2020 +0100 + + fix + +commit f4969a4e785e3276286c0e13e6158b1dd4a1b6b7 +Author: erwan celanie +Date: Wed Mar 18 15:06:00 2020 -0400 + + fix + +commit e362567b1441305720b4a17f929cf430cc2c33b7 +Author: erwan celanie +Date: Wed Mar 18 14:08:04 2020 -0400 + + added .nbt command/module + +commit 9924631e8f8ad1e8c8ad787491bf291572cde122 +Author: Richard +Date: Tue Mar 17 23:13:14 2020 +0100 + + zoom smooth option + +commit 33b4d92e9011d47a85f740001221832b3a8fbca6 +Author: Richard +Date: Tue Mar 17 20:18:31 2020 +0100 + + fix tracer color + +commit 9bcb2072f2062ef3a9cbce644dba288a3490dabd +Author: Richard +Date: Tue Mar 17 19:56:46 2020 +0100 + + nuker autodestroy + +commit ed235305031335cf8142627caccf6994ef9578b1 +Author: Richard +Date: Tue Mar 17 16:57:11 2020 +0100 + + improved 2d esp + +commit c799fec94107d465cddde647c904f75dfae98990 +Author: Richard +Date: Tue Mar 17 15:32:28 2020 +0100 + + 2d esp is working fine now + +commit 7e6f566d1399b80da62330b69d9e4adca04cf696 +Author: Richard +Date: Tue Mar 17 14:25:28 2020 +0100 + + aimbot lock option + +commit 76fae96de1de046b7519111b8c5c0a698f5137b2 +Author: Richard +Date: Tue Mar 17 10:55:43 2020 +0100 + + add .cbe beehive + +commit 08d2429817818f820c27509bf26443a7a4004869 +Author: erwan celanie +Date: Tue Mar 17 03:13:31 2020 -0400 + + improvements + +commit bf2123bf541654a4e579518be7db75632dab8994 +Author: erwan celanie +Date: Tue Mar 17 02:38:43 2020 -0400 + + clean up + +commit 62f0095def0395aad05ad3f1097517a61090199d +Author: erwan celanie +Date: Tue Mar 17 02:37:57 2020 -0400 + + epic nbt + +commit 6c71cf903b97e996453b0db0c5a01d975b61cc21 +Author: Richard +Date: Mon Mar 16 23:52:41 2020 +0100 + + ok + +commit 05c5c8738f971fb09ad78e88c584997f992ae816 +Author: Richard +Date: Mon Mar 16 23:47:40 2020 +0100 + + more output + +commit e979d0b85c08ac06a4c0941499cb2e1b3103c555 +Author: Richard +Date: Mon Mar 16 23:31:42 2020 +0100 + + fix + +commit ecf4031910b70926ab6dcf7e7538f77be84a27ba +Author: Richard +Date: Mon Mar 16 23:24:07 2020 +0100 + + 2d esp improvements + +commit 7344422619c864fd556e645a93e3506bdefc12c1 +Author: Richard +Date: Mon Mar 16 14:13:22 2020 +0100 + + still not good 2d esp + +commit 4d498a4b95a817b85299b87e7b6c2a5c75f72eea +Author: Richard +Date: Mon Mar 16 09:34:34 2020 +0100 + + make it toggleable + +commit cdac3ec7a0851ee8655b17378d748cd68475537e +Author: Richard +Date: Mon Mar 16 09:32:25 2020 +0100 + + weird 2d esp that still needs some improvement + +commit d6e25d7198ed08d715b3748f8cfc2372f15b4505 +Author: erwan celanie +Date: Sun Mar 15 14:24:26 2020 -0400 + + improve give & soh command + +commit 86d275a183d0c3390b7ef086b536d18d3082327c +Author: erwan celanie +Date: Sun Mar 15 02:27:08 2020 -0400 + + added mojangson parser + +commit 4f5eb54e828d447e18078e33d75346d29841b2d6 +Author: Richard +Date: Sat Mar 14 00:39:20 2020 +0100 + + 2d esp (not yet in release) + +commit bc50f85cd0d7ee0f6c8c38a398c7dc4c1304be11 +Author: Richard +Date: Fri Mar 13 23:29:40 2020 +0100 + + enable log file for release builds + +commit 2cb20117f4bca9be71e13bc817b49dcf438094c5 +Author: GodGamer029 +Date: Sun Mar 8 13:12:32 2020 +0100 + + do be gaming doe + +commit 5db7413f942a0876c19037df4155b69a21cf9bee +Author: GodGamer029 +Date: Sat Mar 7 12:36:43 2020 +0100 + + Fix beta? + +commit 9df21d3aa7fc210f0f1b7e478a69fe6902153c19 +Author: GodGamer029 +Date: Fri Mar 6 17:51:27 2020 +0100 + + Oops + +commit 543ecd5ed78d27d16c3ca4b04254d48880bcea37 +Author: GodGamer029 +Date: Fri Mar 6 17:48:36 2020 +0100 + + Minor fixes + +commit d938387d164d18ad97eea247af96b28c96d02f45 +Author: GodGamer029 +Date: Sun Mar 1 19:45:57 2020 +0100 + + Fix wierd colors + +commit 818541e0f0a65b4d0d549b18fdfb3d825b31128c +Author: GodGamer029 +Date: Sun Mar 1 16:57:38 2020 +0100 + + Add custom Texture & button fix + +commit 43dd281c4fe7e1643b39540241f58636071edabb +Author: GodGamer029 +Date: Sun Mar 1 13:30:27 2020 +0100 + + Fix crash when injector isn't connected yet + +commit 615bd6be0ea15b768162bf356cf38166cc67293d +Author: GodGamer029 +Date: Sun Mar 1 13:22:58 2020 +0100 + + Fix all this module manager mess + +commit fea84a9d337553348a5f8eea45fd763f1c07ade1 +Author: GodGamer029 +Date: Sun Mar 1 13:04:27 2020 +0100 + + Enable Hooks after initialisation of Modules + +commit 0c792b1525e3f11fa2c5cb8c03233291d9fa6b8b +Author: Richard +Date: Sun Mar 1 00:39:18 2020 +0100 + + fix + +commit f4286b58a55cdd4ceca6676c7b59576d57c9818a +Author: Richard +Date: Sat Feb 29 11:36:53 2020 +0100 + + faster cubecraft fly + +commit 59757128c7301c5d9b10abbfac37e91db32eb326 +Author: GodGamer029 +Date: Fri Feb 28 15:19:34 2020 +0100 + + Fix corrupted world bug & add rtti name info + +commit 760dad9e32587ffab4a18dfd1d66b28f64f27ed7 +Author: GodGamer029 +Date: Thu Feb 27 21:43:20 2020 +0100 + + Dont corrupt worlds thanks + +commit 1c4151ed56ccdc20cb40c96cfc1810862e7b6581 +Author: GodGamer029 +Date: Thu Feb 27 21:35:24 2020 +0100 + + Bypass skin pack verification + +commit 53c91822e52206b1ec10b8fc309e10706edc4862 +Author: GodGamer029 +Date: Thu Feb 27 17:17:25 2020 +0100 + + Fixed a crash caused by ChestESP & Minor Tabgui fixes + +commit afc8f9e45d00dc2a7f062a1302208ff3d426e335 +Merge: 7d2c7fe 18a2c6d +Author: GodGamer029 +Date: Thu Feb 27 15:02:33 2020 +0100 + + Merging + +commit 7d2c7febb23202662f4413ced003563d07cffcfc +Author: GodGamer029 +Date: Thu Feb 27 15:01:43 2020 +0100 + + Minor refactors and improvements + +commit 18a2c6dd0e7d935e96ce67035fc93471f95e2ff1 +Author: Richard +Date: Wed Feb 26 19:41:20 2020 +0100 + + autoarmor *should* select the best armor piece + +commit 57d3e33656f22226da95785239d4bce90cad0837 +Author: Richard +Date: Wed Feb 26 14:49:10 2020 +0100 + + if horion is in hidden mode, it will no show a "uninjected" text when uninjecting + +commit 846f5416ea2a198197dfadc9286aa79220d6463d +Author: Richard +Date: Wed Feb 26 12:58:41 2020 +0100 + + add nightmode modifier + +commit c9dffdfa054c635557d1abda8b472681fa091403 +Author: Richard +Date: Tue Feb 25 23:20:57 2020 +0100 + + setprefix command + +commit f974c654dafa8cdda7b68f28f6081799e2b9e647 +Author: Richard +Date: Tue Feb 25 19:53:43 2020 +0100 + + show cps + +commit 922cba6265796f17119b30ab6eeffff8f6accd1a +Author: Richard +Date: Tue Feb 25 14:31:23 2020 +0100 + + fps counter, better coordinates and spacebar keystroke + +commit 9dbc115ceba1000be233f89212fc7c8b8a070af3 +Author: Richard +Date: Tue Feb 25 00:55:50 2020 +0100 + + fix coordinates + +commit d5e3c7b6f9cf8ee7c7186a08d2afb6f718f66e17 +Author: Richard +Date: Mon Feb 24 19:48:40 2020 +0100 + + fix zoom + +commit e81ee6cd09dc662915a543ae6ab02fcda7de8809 +Author: Richard +Date: Mon Feb 24 18:37:12 2020 +0100 + + Searching for command blocks is now done in a new thread + +commit c3ffed5c311f0c8be597e3dcda369c6db761e063 +Author: Richard +Date: Mon Feb 24 18:22:58 2020 +0100 + + epic smooth zoom + +commit da1359c47a5531af6c209b9324db4c482dbbc6e6 +Author: Richard +Date: Mon Feb 24 10:18:56 2020 +0100 + + fix + +commit d8060d2932f7a7938e4164df01e839004648cdcc +Author: Richard +Date: Mon Feb 24 10:07:05 2020 +0100 + + Add AirStuck and Zoom (kinda weird zoom) + +commit 48b1481526ac2669af25393a09298e2b9a4696d0 +Author: GodGamer029 +Date: Sun Feb 23 21:32:06 2020 +0100 + + Bind command improvements + +commit fc0ab2174fc93fcaa72d3bdd7348d341479b9432 +Author: GodGamer029 +Date: Sun Feb 23 17:23:01 2020 +0100 + + Triangle Face Support + +commit 9908c8730b58443f3fb41fb86555eadf2b23d236 +Merge: adb1016 d266e36 +Author: GodGamer029 +Date: Sun Feb 23 15:24:04 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit adb1016ed3154ef4426cdf1a475323b4b7ee94ff +Author: GodGamer029 +Date: Sun Feb 23 15:23:49 2020 +0100 + + Make custom geometry button experimental + +commit d266e369aeb46f92100573778cceb75f5a35bc26 +Author: Richard +Date: Sun Feb 23 11:39:55 2020 +0100 + + NameSpoofer! + +commit ee4321c4ef306fa13cd677388c1edfc61111449e +Author: Richard +Date: Sat Feb 22 17:09:04 2020 +0100 + + update + +commit 08357ce6f1db75832c6723951cea32560b64bfe0 +Author: erwan celanie +Date: Thu Feb 20 13:44:34 2020 -0400 + + fix fly + +commit 444bacfa5cb68b610945541c7650990fd2be34c4 +Author: Richard +Date: Thu Feb 20 18:27:22 2020 +0100 + + epic name change thing + +commit ea17aea68781b3806a51ccd3065b482ee8664d60 +Author: Richard +Date: Thu Feb 20 00:08:46 2020 +0100 + + fix chestaura + +commit 34f1728885436b091b316913254d44c382ef732e +Author: Richard +Date: Wed Feb 19 21:13:42 2020 +0100 + + keystrokes n other stuff + +commit 6f60c6b876a0378815634b5d34beabf23c76e28b +Author: Richard +Date: Tue Feb 18 23:45:15 2020 +0100 + + fix + +commit a89c6239f622994ea352432844cbffb6f9503910 +Author: Richard +Date: Tue Feb 18 21:13:20 2020 +0100 + + cubecraft glide & fix antibots + +commit 5b5865ecd17dc1b37d5ef172a150ed1f72fca00e +Author: GodGamer029 +Date: Tue Feb 18 17:42:55 2020 +0100 + + Add geometry import box + +commit c15496634a63ca039dd20f6c694c73289810c507 +Author: GodGamer029 +Date: Tue Feb 18 16:03:40 2020 +0100 + + Gamer Messages + +commit 0a50a902243889c75c9e7da79521a652e29876ca +Author: GodGamer029 +Date: Tue Feb 18 15:40:04 2020 +0100 + + Fix crash when no texture mappings are found on the skin + +commit 9ae5dd44702db1e00b649a36bc4d24d25b9f9ed0 +Author: erwan celanie +Date: Mon Feb 17 20:48:10 2020 -0400 + + added nbt for mob spawner + +commit 1d3df0beb447d49822b02dc918591e5c481920f2 +Author: GodGamer029 +Date: Mon Feb 17 19:03:37 2020 +0100 + + Make Custom Geometry Beta only + +commit 3dd09da19b27775dbb7083ae0c7acd5e23c49d2b +Merge: 3373210 4460c2b +Author: GodGamer029 +Date: Mon Feb 17 18:42:06 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 337321074739273b018e3a61d76dbf2583b1aa2b +Author: GodGamer029 +Date: Mon Feb 17 18:40:03 2020 +0100 + + Horion connection update + +commit 4460c2b3af7e686d1a94d5c8f1e9febc0781ccc5 +Author: Richard +Date: Mon Feb 17 17:40:54 2020 +0100 + + add noswing + +commit b48deee68ae60d242ee98a1d14b2d7f3d58d68a4 +Author: GodGamer029 +Date: Mon Feb 17 17:35:50 2020 +0100 + + Add thread back + +commit 97b0c083c808da1c2990026f50de730f49b1a4c8 +Author: erwan celanie +Date: Sun Feb 16 17:46:07 2020 -0400 + + fix painting crash + +commit b5bd872dd7bf5ec41659bee528dacca29214dac5 +Author: Richard +Date: Sun Feb 16 22:32:30 2020 +0100 + + test without thread + +commit 3e3a7c30cb3e10fd3b77967367537d1fb1a2b7dd +Author: Richard +Date: Sun Feb 16 22:25:13 2020 +0100 + + epic horion text in main menu + +commit 09f58caf82ec519f631a15b4594579b8cded492c +Author: GodGamer029 +Date: Sun Feb 16 21:48:31 2020 +0100 + + Fix position + +commit 371da1e47001d34bd7c6b24287096734ee9a15c4 +Author: GodGamer029 +Date: Sun Feb 16 21:47:33 2020 +0100 + + Functional + +commit 5bc3045431f1cae65d46524b83bdc9c4a75bad4b +Author: Richard +Date: Sun Feb 16 21:45:32 2020 +0100 + + design + +commit 1b38b0f8b553db82c50f003df4b0db61c2adf074 +Author: GodGamer029 +Date: Sun Feb 16 21:30:22 2020 +0100 + + ImmeadiateGui + +commit 669e1e21c1cb5dc3c5833c72c6aae7813ffefa9f +Author: GodGamer029 +Date: Sun Feb 16 20:26:01 2020 +0100 + + Fix Tabgui animation speed + +commit 2722f186e6610dea057051271354916258c02b45 +Author: GodGamer029 +Date: Sun Feb 16 20:12:20 2020 +0100 + + Make Command block exploit beta only + +commit 776d9a8773d42e450905e344784dc2367a0593c7 +Author: GodGamer029 +Date: Sun Feb 16 20:10:30 2020 +0100 + + Fix Injector connection screen not showing + +commit 1efc51927fd7bfe2bc0302f94b5654f700a7ab01 +Author: GodGamer029 +Date: Sun Feb 16 19:51:30 2020 +0100 + + Fix unepic beta exploit + +commit 42623be5bb6239b0074cb173884f3657122fa78c +Author: GodGamer029 +Date: Sun Feb 16 19:48:55 2020 +0100 + + Add Beta config + +commit e7dfbd854953febcf3913dafe108dcb216766a6a +Author: Richard +Date: Sun Feb 16 19:44:46 2020 +0100 + + kinda fix airswim + +commit 03c7118617e4935e82184d283f7bcffa93b924ee +Author: GodGamer029 +Date: Sun Feb 16 19:38:48 2020 +0100 + + Fix Click Gui animations + +commit 5273d4f371c5dd065a7b11a04540322e0e80ed86 +Author: GodGamer029 +Date: Sun Feb 16 19:08:45 2020 +0100 + + Fix ClickGui background + +commit c03ad76020c70690eef3af98842639be741ede52 +Author: GodGamer029 +Date: Sun Feb 16 18:35:16 2020 +0100 + + crash fix + +commit 5bfa595e3c4e39c5da818b3546d0f116f677a092 +Author: GodGamer029 +Date: Sun Feb 16 18:24:50 2020 +0100 + + Minor Performance improvements + +commit f846f653df1e844eaa3546f3cd7c9713da94dd4a +Author: GodGamer029 +Date: Sun Feb 16 18:12:27 2020 +0100 + + Only draw gui once per frame + +commit 923fe7b7df7601eb1279611262d7df091ad90b56 +Author: GodGamer029 +Date: Sun Feb 16 17:17:38 2020 +0100 + + Hot swap skins + +commit bdb175e2095e3db53dfef3c2ce4eaa406cfef2a3 +Author: Richard +Date: Sun Feb 16 12:26:05 2020 +0100 + + hotfix + +commit 7859695440ca9fc32919f4e9ab0de71681f864b4 +Author: Richard +Date: Sun Feb 16 11:51:11 2020 +0100 + + fix command blocks closing after remote opening them + +commit 48a4a6b65afad289b700419b57683819d419b4c4 +Author: Richard +Date: Sun Feb 16 01:42:26 2020 +0100 + + fix tabgui use in menu/chat + +commit bd1090d25c9a8c0ceee77d6de3210b1d1c8c45a9 +Author: GodGamer029 +Date: Sun Feb 16 01:11:59 2020 +0100 + + fix + +commit b7dd2194efe262a9989b1379dd057c9bd0a0996d +Merge: f8fe764 88337d9 +Author: GodGamer029 +Date: Sun Feb 16 01:11:06 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit f8fe7649a429e4e32a973658fd22d12eda8c27a5 +Author: GodGamer029 +Date: Sun Feb 16 01:10:57 2020 +0100 + + config + +commit 88337d909a21f5df4358cdfea605a47a76a8ca9a +Author: Richard +Date: Sun Feb 16 01:02:12 2020 +0100 + + fix + +commit 2567ad69155b3e6cbdb7911bfdf139c65cfab956 +Author: Richard +Date: Sun Feb 16 00:50:34 2020 +0100 + + add showarmor option to hud + +commit d5619efc63228a32397a66277cda7a0d5407fc6e +Author: GodGamer029 +Date: Sat Feb 15 15:30:38 2020 +0100 + + Simplify Some Modules + +commit f64a4db5f0615906d0ff18058282ba6e931b6be2 +Author: Richard +Date: Sat Feb 15 14:20:32 2020 +0100 + + another fix + +commit 11ecad1b86ea9b6eaa01cdbe0b9b1754b1abc887 +Merge: f60e37e 1d3c04c +Author: GodGamer029 +Date: Sat Feb 15 14:19:50 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit f60e37e7109e2112eb4a724c78317fdd52b47d7c +Author: GodGamer029 +Date: Sat Feb 15 14:18:41 2020 +0100 + + Autocomplete & Performance enhancements + +commit 1d3c04cc2e248c59afd41f9d3c864206078678a6 +Author: Richard +Date: Sat Feb 15 14:09:53 2020 +0100 + + fix and improve tracer + +commit 807a8bb3aa5b17cd616c07ceab04cebe74d45383 +Author: Richard +Date: Sat Feb 15 12:53:48 2020 +0100 + + config manager + +commit 3eeb3cc29da38fc2a439ef6b679efa68d3442517 +Author: Richard +Date: Sat Feb 15 11:56:01 2020 +0100 + + fix command block opening multiple times + +commit 4d5a8d4061bc452ec6f6941cecadbe9fa4c88474 +Author: Richard +Date: Sat Feb 15 11:48:13 2020 +0100 + + commandblockexploti command to find and remote open + +commit 9dc93f0bb7627176ee057c09645ca98f969ece32 +Author: Richard +Date: Tue Feb 11 22:48:58 2020 +0100 + + fix + +commit f3e3a5c01f14d8f7d5e07c1565f9307a5f14129a +Author: Richard +Date: Tue Feb 11 22:38:08 2020 +0100 + + fix cut off usernames + +commit 4c446de31952cd9ab8bb88a408904f0bd73d8a8a +Author: Richard +Date: Tue Feb 11 21:53:25 2020 +0100 + + fixes (command block exploit now works on chain and repeat command blocks, chestaura does use the given chest open function and teleport doesnt set position when in menu) + +commit ba9a259ede57da94c5d2b3199efe6386fb17f6ed +Author: GodGamer029 +Date: Tue Feb 11 20:10:11 2020 +0100 + + Get Beta :tm: + +commit caf915b442ef08eedd68263f12fd6c01d98e15b3 +Author: erwan celanie +Date: Mon Feb 10 20:54:46 2020 -0400 + + command block exploit + +commit ed8a09ddd7abf50907053b9bba7c03e643cdf8a7 +Author: Richard +Date: Sun Feb 9 20:19:39 2020 +0100 + + improved teleport quality + +commit 2be05a753e660dc6d1807c1fcfa6d1f74de8f847 +Author: Richard +Date: Sun Feb 9 18:07:52 2020 +0100 + + Create LICENSE + +commit 00dca412aa185cdd90f35569ab111e11f2aa1704 +Author: Richard +Date: Sun Feb 9 18:03:05 2020 +0100 + + add license information + +commit ab506b522ee7360a264105a4e9298a042feb3f76 +Author: Richard +Date: Sun Feb 9 17:46:26 2020 +0100 + + teleport hive bypass + working fucker + +commit 6d46071c3b017b3e4b298e2cc958af5221e0d06a +Author: GodGamer029 +Date: Sun Feb 9 12:43:43 2020 +0100 + + Make NightMode its own module + +commit 28240780a009f5735ee78c89a4ad9b4e8f4b12b5 +Author: GodGamer029 +Date: Sun Feb 9 12:18:55 2020 +0100 + + Fix Crash + +commit 23c63b732783879af9cb9da95e805b5a12eaaf25 +Author: GodGamer029 +Date: Sat Feb 8 23:23:01 2020 +0100 + + gaming + +commit 958a4a816405135a15ea89d36783bf7f3a55e4fd +Author: GodGamer029 +Date: Sat Feb 8 23:14:47 2020 +0100 + + Fix shadow-text bug + +commit ef995a3f5409af1a27ad5588958b55960b374755 +Author: GodGamer029 +Date: Sat Feb 8 22:27:48 2020 +0100 + + Remove unnecessary allocations + +commit 67dac2d3fdc56267ea66b5d9a324ec5b4bba394e +Author: Richard +Date: Sat Feb 8 21:06:45 2020 +0100 + + add autosprint alldirections option + +commit 632e97e5d92e79eea9c109edbfdb852cda8a5958 +Author: Richard +Date: Sat Feb 8 15:33:12 2020 +0100 + + better nametags that actually show a players armor + +commit 957993867f170d0261a3e5c1803783935d73baa5 +Merge: 58c3081 167e9a8 +Author: GodGamer029 +Date: Fri Feb 7 21:13:43 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 58c3081ad3f506e66e47f6cdc0a5d9927769707a +Author: GodGamer029 +Date: Fri Feb 7 21:13:29 2020 +0100 + + Zepellin + +commit 167e9a8d7770a11e34505d25412557a630108ce5 +Author: GodGamer029 +Date: Thu Feb 6 13:27:06 2020 +0100 + + Update .gitignore + +commit 34d98ce11568aa1a3cfa9e278471632df1e3a9b7 +Author: erwan celanie +Date: Wed Feb 5 23:54:51 2020 -0400 + + fix + +commit a359326f079bb420e3da906efad9c5673d2bee03 +Author: erwan celanie +Date: Wed Feb 5 12:15:49 2020 -0400 + + added not really working drawImage function + +commit 015dd21820d238047c7309167c13494531d95d29 +Author: GodGamer029 +Date: Tue Feb 4 14:10:19 2020 +0100 + + Yeet the heap + +commit 76e82eaf3785cd8c403100e80a9dcccfca8244be +Author: GodGamer029 +Date: Tue Feb 4 13:52:10 2020 +0100 + + Fix ArmorHud for 1.14.20 + +commit 126eed893fc2b5b3870655e4394d8b9a3fa43597 +Merge: 9461a67 cb389ab +Author: GodGamer029 +Date: Tue Feb 4 13:42:59 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 9461a6726655dcefff415bb71fb1e28eb193a731 +Author: GodGamer029 +Date: Tue Feb 4 13:42:47 2020 +0100 + + gamer tractor + +commit cb389aba5531b5c28e3ecfcde4ce5bca438f4340 +Merge: c8fa7cc dea3723 +Author: erwan celanie +Date: Tue Feb 4 00:23:27 2020 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit c8fa7ccc3edcb0caadef0400c014a27776542eec +Author: erwan celanie +Date: Tue Feb 4 00:22:55 2020 -0400 + + epic ArmorHud + +commit dea3723185cbab28cf29346028e56b80b41f4fbf +Author: Richard +Date: Sun Feb 2 16:25:23 2020 +0100 + + ready for beta release + +commit ec49d502ec2ec37538a87e02154aaad51836bac8 +Author: Richard +Date: Sun Feb 2 14:08:43 2020 +0100 + + fix clickgui + +commit 1661defcc23ae7f4ce8c7ddf6aff509325d71f2f +Author: GodGamer029 +Date: Sun Feb 2 13:53:15 2020 +0100 + + Fix formatting + +commit 8e67f12243d55a29fd07cb19cceefcc564e239b2 +Author: GodGamer029 +Date: Sun Feb 2 13:51:44 2020 +0100 + + Improve Yoda performance + +commit a735bc32b7563dc8225c554345997579bd03f6c2 +Author: GodGamer029 +Date: Sun Feb 2 13:11:13 2020 +0100 + + Ok gamers, here's your yoda + +commit 261bd401c3a6e0e19cfddfe5605cea49af7050f9 +Author: Richard +Date: Sun Feb 2 11:23:12 2020 +0100 + + crystalaura autoplace, autoclicker hold option, silent bowaimbot + +commit 1d12b70fe28760517a3c7ea37d33b38b0b3648e9 +Author: erwan celanie +Date: Sat Feb 1 19:48:29 2020 -0400 + + epic arraylist animation + +commit 90bcf5567d9c06a201f201d60f253d22515c31fe +Author: Richard +Date: Sat Feb 1 23:25:38 2020 +0100 + + changed colors to light theme + +commit a07ecd82cccbfca369d4ad2a7b265e3f9154a8e9 +Author: GodGamer029 +Date: Sat Feb 1 19:36:23 2020 +0100 + + Yoda skin + +commit 5429223a496ec142a3f602dbd9679647178ab841 +Author: GodGamer029 +Date: Fri Jan 31 15:37:12 2020 +0100 + + Fix Inventory Cleaner not dropping all armor + +commit 26f5e9211bd006f02fcc5177623d5e2e6688c43d +Author: GodGamer029 +Date: Fri Jan 31 14:57:22 2020 +0100 + + TabGui lookin kinda sick doe + +commit a6c722fb64c716eb1608d7da900c0e7da41c6730 +Author: GodGamer029 +Date: Fri Jan 31 14:45:48 2020 +0100 + + Not sure about this one either + +commit 9714bb4d187f896eb51d386e1e7891a9fd2a7979 +Author: GodGamer029 +Date: Fri Jan 31 14:43:46 2020 +0100 + + bruh why did i do this + +commit 9e37efe515b6690b7a3974aa02855b651a82054f +Author: GodGamer029 +Date: Fri Jan 31 14:40:52 2020 +0100 + + gamer moment + +commit b66e4a606d0b25ca6435b9a10d432d3c5d264e9a +Author: GodGamer029 +Date: Fri Jan 31 13:56:49 2020 +0100 + + Fix + +commit be88c51233b1357735c6a0d099bf1c76b2f02332 +Author: GodGamer029 +Date: Fri Jan 31 13:44:17 2020 +0100 + + Fix Tower & Scaffold + +commit e05960aee9c1f89938e13b69c1813bfd6640c6cb +Author: GodGamer029 +Date: Fri Jan 31 13:34:33 2020 +0100 + + oops my bad + +commit 1176d4e977d5901cad7f195a29d7b8a1c973384b +Author: GodGamer029 +Date: Fri Jan 31 13:28:38 2020 +0100 + + Fix Click Gui Mouse bug + +commit 7c973ec8e4b930e0c743827be17619408af5feca +Author: GodGamer029 +Date: Fri Jan 31 13:16:18 2020 +0100 + + Remove some stupid allocation + +commit 97e99a61799da927cba15cf78682b51dabc08b7e +Author: GodGamer029 +Date: Fri Jan 31 12:41:03 2020 +0100 + + XOR all signatures + +commit 320bf55bfaece317f3b6e42eea80c0c0a17c457c +Author: GodGamer029 +Date: Fri Jan 31 12:07:31 2020 +0100 + + TabGui animations + +commit 2f41d50344fc0b5598f6a41d0df7422372e7b4a4 +Author: GodGamer029 +Date: Fri Jan 31 11:42:10 2020 +0100 + + Cool colors + +commit d86d134bf15ccaa8f52fbb2fbeaa01712c612dfb +Author: GodGamer029 +Date: Fri Jan 31 11:33:59 2020 +0100 + + Rearrange code related to the logo + +commit 94137e5f039358e4d299c32bd7061ac85891c758 +Merge: 7c4d746 1f0f2bd +Author: GodGamer029 +Date: Fri Jan 31 11:08:33 2020 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 7c4d74640d31922916752b6191ec1f383080673b +Author: GodGamer029 +Date: Fri Jan 31 11:08:27 2020 +0100 + + honestly no idea what the fuck git wants me to do + +commit 1f0f2bde30eb1e3b57d813c75c79bfc6fa9a1b71 +Author: Richard +Date: Thu Jan 30 23:07:21 2020 +0100 + + this + +commit 850b7efc7ce5810530cef1933ad393e007abf73f +Author: Richard +Date: Thu Jan 30 19:09:39 2020 +0100 + + changes + +commit 70062246559b125752a090c1603e7515e0ebd177 +Author: GodGamer029 +Date: Thu Jan 30 18:28:34 2020 +0100 + + Fix formatting + +commit 5f16de89c4f7d967a46fa19335f4b90f9a5c59e8 +Author: GodGamer029 +Date: Thu Jan 30 18:25:57 2020 +0100 + + Fix AppSuspendedHook + +commit 8732372a28117a4ae11fb8169b75e14451d66f94 +Merge: 2941c79 7cd0913 +Author: GodGamer029 +Date: Thu Jan 30 07:28:03 2020 +0100 + + Merge pull request #245 from GrelTheL/master + + Update discord link & move CrystalAura to combat + +commit 7cd091306b2cc58ba2d1caf3c9b6b801ac27651a +Author: GrelTheL <59349394+GrelTheL@users.noreply.github.com> +Date: Tue Jan 28 04:36:36 2020 +1100 + + ez + +commit 231f2adc23b238cc77ac9c2c7f09c5f0cef6f906 +Author: GrelTheL <59349394+GrelTheL@users.noreply.github.com> +Date: Sat Jan 25 12:03:49 2020 +1100 + + Update README.md + +commit 2941c792af0abe854311e5c7d75e8c1d9e955f6c +Merge: b33a847 586645a +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Fri Jan 24 19:51:29 2020 -0400 + + Merge pull request #244 from S-B99/master + + Fix discord link in readme + +commit 586645a38d6477f5cdec8b06e2da9203777b98e1 +Author: Bella Who +Date: Fri Jan 24 18:38:18 2020 -0500 + + Fix discord link in readme + +commit b33a84719ed500b72b5714f7add3ed3fb85c2dcf +Author: GodGamer029 +Date: Mon Jan 6 19:38:39 2020 +0100 + + "Fix" crash + +commit e2d2ab68c39a37a1999e66e98b6f2195d11e6d2b +Author: GodGamer029 +Date: Sat Jan 4 15:06:10 2020 +0100 + + Use msvc for Debug Builds as well + +commit 6b7b37ea622634b407fbbde2e7d8bf9c0e995dbb +Author: GodGamer029 +Date: Sat Jan 4 14:24:45 2020 +0100 + + Clang optimizations + +commit 8821d6dce6f448a3fa14cf78fd008d58f9ae777b +Author: GodGamer029 +Date: Sat Jan 4 13:18:36 2020 +0100 + + Use clang + +commit 46bd033be9a57ecb51662ee0825af05128a883ec +Merge: b04256e e1dd0e9 +Author: erwan celanie +Date: Mon Dec 30 12:01:25 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit b04256e70b7f5fabf087ed0da2c250c82dff9f36 +Author: erwan celanie +Date: Mon Dec 30 12:01:02 2019 -0400 + + Nofall now works on all servers + +commit e1dd0e9d51287b8f7004f9eca8453ad8b11b1280 +Author: GodGamer029 +Date: Fri Dec 27 21:35:54 2019 +0100 + + Format all other files + +commit cd01e9899871776928084c88f0492726427d81b5 +Author: GodGamer029 +Date: Fri Dec 27 21:32:53 2019 +0100 + + Format Commands + +commit 30b69469e61c24d1d481b99d8a0d5927bd817de2 +Author: GodGamer029 +Date: Fri Dec 27 21:27:05 2019 +0100 + + Format Modules + +commit d7c3e9798a4ed310520ad96d4e4e94983bdd3d73 +Author: GodGamer029 +Date: Fri Dec 27 21:19:35 2019 +0100 + + Format SDK and importan Files + +commit d9ed32e7ff76c6f8ea507b3fc43950bdf9ccd98a +Author: GodGamer029 +Date: Fri Dec 27 21:03:23 2019 +0100 + + Changes to clang-format + +commit c42d6d00f00599fe69f7beaadbac550795067a1b +Author: GodGamer029 +Date: Fri Dec 27 20:59:13 2019 +0100 + + Add clang-format + +commit f61345bb951018a1baa59501e882ea0ae7a48285 +Author: erwan celanie +Date: Fri Dec 27 11:09:58 2019 -0400 + + fix + +commit fe74a25dcdc3ec84615a69220293c65ce5087046 +Author: erwan celanie +Date: Fri Dec 27 11:05:21 2019 -0400 + + added timer + +commit 30aafdbde389a7ef22272ffcdae46d810f6a3cd5 +Merge: ab58cca c6a92ba +Author: erwan celanie +Date: Wed Dec 25 12:54:13 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit ab58ccaf261c9f956ee961df96ae16e9fbe7d5aa +Author: erwan celanie +Date: Wed Dec 25 12:53:58 2019 -0400 + + improved crasher + +commit c6a92ba9c0f26448a89b05251e8a73f839b1f83f +Merge: 534de8f a1e59c3 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Wed Dec 25 11:33:42 2019 -0400 + + Merge pull request #220 from brandonr1337/master + + Added Crystal Aura + +commit 534de8f7461f696f9d1caa632f0c1ae10be50710 +Author: erwan celanie +Date: Tue Dec 24 13:55:56 2019 -0400 + + support for 1.14.0 + +commit 2a648cc288a3db6f1757db76613d5593bb6ad39e +Author: GodGamer029 +Date: Sat Dec 21 14:04:15 2019 +0100 + + Better naming + +commit a1e59c3eaa5672488387ff75ba0a0f14ca968bfa +Author: n +Date: Sat Dec 21 12:56:06 2019 +0000 + + Temporarily Removed The Block Reach Option While I Fix + +commit 4d127b84321245bdb252c40edfd5d5b253777fc2 +Author: n +Date: Sat Dec 21 11:10:35 2019 +0000 + + Update CrystalAura.cpp + +commit 89411224c90260f9465edc0eee7f9413fdf3eb82 +Author: n +Date: Sat Dec 21 11:04:47 2019 +0000 + + t e s t i n g + +commit 00c3bd92d91de671b3116edb19c82a9cc2d66b4c +Author: erwan celanie +Date: Fri Dec 20 20:48:09 2019 -0400 + + fix text + +commit 2fce601af66c7a5d71e753e74dea64facac563e6 +Author: Richard +Date: Sun Dec 15 17:44:00 2019 +0100 + + fixed spelling and added onlyinv check to inventorycleaner + +commit 57cc62f9079334a4ee18f34620c0b7862e205d04 +Merge: 37fd911 ef74ef9 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Dec 15 00:05:18 2019 -0400 + + Merge pull request #204 from Johnmacrocraft/fix-build + + TestModule: Fix release build + +commit 37fd9111e97246fc50f502954c12f1aa47526ec1 +Author: erwan celanie +Date: Sat Dec 14 23:49:35 2019 -0400 + + added realm crasher + +commit ef74ef930f24a3bdca3cafee7ced8916c5ba63ea +Author: Johnmacrocraft +Date: Sun Dec 15 12:23:21 2019 +0900 + + TestModule: Fix release build + +commit c11c4dd4ffdaf9842a0c7008fd8d82af5dd41ec1 +Merge: 663a036 320e2f3 +Author: erwan celanie +Date: Sat Dec 14 23:14:38 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit 663a0364a5214925a1e092b388b9318164211ec8 +Author: erwan celanie +Date: Sat Dec 14 23:14:22 2019 -0400 + + fix crash + +commit 320e2f3981d310aa3778707dcee4d364790eafc7 +Author: GodGamer029 +Date: Sun Dec 15 00:05:24 2019 +0100 + + Epic TestModule + +commit 160e03c58232760956bc28329893547fa895e42a +Author: GodGamer029 +Date: Sat Dec 14 22:21:38 2019 +0100 + + Fix antibot + +commit 8e9260e45568417e3bc454d5e6d08f5204d34569 +Author: GodGamer029 +Date: Sat Dec 14 21:58:04 2019 +0100 + + Fix Inventory Cleaner & AutoArmor + +commit a8c85b671c0cb7a6e7d9f7e7b27e207c0eacd356 +Author: GodGamer029 +Date: Sat Dec 14 16:30:17 2019 +0100 + + Fix Auto Armor + +commit f810d0c5119b4ef2bd1ed15964963b786e974c5b +Author: GodGamer029 +Date: Sat Dec 14 15:10:28 2019 +0100 + + Fix Click Gui Tooltips + +commit 79c061425ba5767603c4ca7565f346f7e2d582fb +Author: GodGamer029 +Date: Sat Dec 14 14:51:06 2019 +0100 + + Fix Text + +commit 2475fb6351c5dd2d528d5d5f8e2beff874225c79 +Author: erwan celanie +Date: Thu Dec 12 19:24:05 2019 -0400 + + fix x-ray + +commit 07ce40512a2287a805b49496f45335273359ddc8 +Author: erwan celanie +Date: Thu Dec 12 16:17:56 2019 -0400 + + fix .give & .soh + +commit e831f0bbd3dfaa9dd85775abcd2e41b32ead4311 +Author: erwan celanie +Date: Wed Dec 11 23:52:58 2019 -0400 + + fix esp & spammer + +commit 2554c9e5da29a14b17702149fbfafe096f6c8124 +Author: erwan celanie +Date: Tue Dec 10 23:04:20 2019 -0400 + + fix forEachEntity callback + +commit 8cd7a2083ea9688d2f6ae151469a7753a0e7b82a +Author: erwan celanie +Date: Tue Dec 10 21:55:33 2019 -0400 + + fix sigs & sendChatMessage Hook + +commit 804fd8f79d119f0392f571b30214773aefe5f4e1 +Author: erwan celanie +Date: Tue Dec 10 18:43:21 2019 -0400 + + fix ClientInstance vTable + +commit e7410be892357878b16f434b6f971e6b6263b3a3 +Author: GodGamer029 +Date: Tue Dec 10 17:33:05 2019 +0100 + + Experimental 1.14 build + +commit eaad8abd575709cdfe574ec91cd48469b5d160b6 +Author: erwan celanie +Date: Sun Dec 1 15:43:22 2019 -0400 + + fix Killaura not working on ng + +commit b5d0c79dab54168932f644950c769d51033c5777 +Author: erwan celanie +Date: Sun Dec 1 15:21:53 2019 -0400 + + Improvements + +commit 24b47078a7878dde239df6671ff273bce3d03073 +Author: GodGamer029 +Date: Thu Nov 21 15:29:37 2019 +0100 + + Possibly Fix an injector bug + +commit 9e38ba6bf5d154974fe3b8e7208a43b70f1f416b +Author: GodGamer029 +Date: Wed Nov 20 20:48:42 2019 +0100 + + Fix azure + +commit 2d64c6f74a0286da400e9c5f5308f4e6e6a70e02 +Merge: 9a14702 454c425 +Author: GodGamer029 +Date: Wed Nov 20 20:25:41 2019 +0100 + + Enforcing the use of the new Injector + + Also updates Json.hpp and fixes a bug in IntelliSense + Opens up various opportunities for doing stuff outside the sandbox + +commit 454c425591325b00162d297d77f3232ffcb7b0b3 +Author: GodGamer029 +Date: Wed Nov 20 20:03:03 2019 +0100 + + Finishing up the new injector + +commit acee37a95f38a84d2a3e330d6b2e06defbb0dbc5 +Author: GodGamer029 +Date: Mon Nov 18 15:46:29 2019 +0100 + + Transmit Account Information, update Json & allow enabling WIP features + +commit 5d8d7987cc0876197c7c5f0d4790e0617d1646df +Author: GodGamer029 +Date: Mon Nov 18 12:42:58 2019 +0100 + + Lower timeout a bit, connection is now stable + +commit 28084c98d28ca146767c312b372407521f150860 +Author: GodGamer029 +Date: Sun Nov 17 23:19:33 2019 +0100 + + Packets are a thing now + +commit 7bbdaef9966aa5e6c0121e34e03102782db0913a +Author: GodGamer029 +Date: Sun Nov 17 18:21:24 2019 +0100 + + Initial Connection accomplished + +commit 9a1470285a01feca25a84781e09cf48a41073565 +Author: GodGamer029 +Date: Sun Nov 17 00:50:10 2019 +0100 + + invcleaner + +commit 1fee3b25016bf55e6e660147c210f8139a9c55e1 +Author: Richard +Date: Sat Nov 16 23:14:57 2019 +0100 + + yeet + +commit 7c00a40acc1516431a42239118e46e2250d64521 +Author: GodGamer029 +Date: Sat Nov 16 20:48:58 2019 +0100 + + Epic Raknet fix + +commit 2b5a7f0e6b03ebd08b9f126f4045ed4a96311f6f +Author: GodGamer029 +Date: Sat Nov 16 20:19:07 2019 +0100 + + Disable Gamer skin for Beta Builds + +commit b27a1b1d019619fc6bd0e1a68345abc7e6e26dfa +Author: GodGamer029 +Date: Sat Nov 16 19:46:26 2019 +0100 + + Epic horion gamer skin + +commit 97f3f4d3fcd59eb49dba2cea7aa1646f61db36cd +Author: GodGamer029 +Date: Sat Nov 16 17:29:54 2019 +0100 + + Make cool gamer skin available to everyone + +commit f824b4738ed459df07b88effc01556d855ec1484 +Author: Richard +Date: Sat Nov 16 14:53:27 2019 +0100 + + Killaura now aims at targets (serverside) + +commit aa0d6d0421d2f993760fea217216e24f260be1c6 +Author: GodGamer029 +Date: Sat Nov 16 01:23:02 2019 +0100 + + Trigger ci + +commit f64f1d691d5c049c30d274cfc60aa6f704b2045d +Merge: d21e6e6 fd300ff +Author: GodGamer029 +Date: Sat Nov 16 00:16:49 2019 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit d21e6e6991ebf559a48139b7523337ff5973be63 +Author: GodGamer029 +Date: Sat Nov 16 00:16:27 2019 +0100 + + Gamer Skin + +commit fd300ffecc5a5f3895887bde946ccf68abab2930 +Author: Richard +Date: Sat Nov 16 00:06:58 2019 +0100 + + hey we got text shadow + +commit ab664be724c12e909a48776a33a9fb33600bcfda +Author: Richard +Date: Fri Nov 15 23:53:20 2019 +0100 + + Some fixes, improved InventoryCleaner + +commit ea3776dd122966107a8bfa8e0e9c7721d9617a89 +Author: Richard +Date: Thu Nov 14 20:01:32 2019 +0100 + + Several bug fixes. + +commit f8997299d41f7e13de1da43dcaafb8ec04ba1808 +Author: GodGamer029 +Date: Tue Nov 12 18:24:01 2019 +0100 + + Fix epic Xray bug + +commit c3008e8ac8e9fec7498babcaea7c04b42d7824a4 +Author: GodGamer029 +Date: Tue Nov 12 18:13:42 2019 +0100 + + i hav stork + +commit 25e02c68c82197c34be216f7d3f866f76909b977 +Author: GodGamer029 +Date: Tue Nov 12 18:04:14 2019 +0100 + + Fix unepic .give bug + +commit 465ff3f5d56c1e2e2b40b967e50ac046205b6971 +Merge: 8ba2de2 de86bb5 +Author: erwan celanie +Date: Mon Nov 11 12:47:59 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit 8ba2de25a53e8f150f9d4a7fd4cbedb4cca41b6d +Author: erwan celanie +Date: Mon Nov 11 12:47:49 2019 -0400 + + fix blink & freecam + +commit de86bb524c7a001e65228ad664f93b78968d5459 +Author: Richard +Date: Mon Nov 11 17:01:54 2019 +0100 + + Updated ServerCommand to also show Port, fixed SayCommand and Spammer to work on Cubecraft + +commit 7872eef99b9331a885686d67fc55ec7360e2d413 +Author: erwan celanie +Date: Sun Nov 10 20:34:31 2019 -0400 + + PacketLogger + +commit 081b169375bff79943bcc0569f3b3b030fd3761b +Author: Richard +Date: Sun Nov 10 22:29:44 2019 +0100 + + Added setting to show/hide keybinds in arraylist + +commit e4be249e3e19c61fee10490fa7715a2cd40661fc +Author: erwan celanie +Date: Sun Nov 10 00:55:34 2019 -0400 + + fix + +commit 93dab2002e85d9bb1ccbd11e69fe7c342e7e8a2e +Merge: 0f81bcf 319ae4c +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sat Nov 9 11:15:23 2019 -0400 + + Merge pull request #151 from OhBoyItsGrelAgain/OhBoyItsGrelAgain-patch-1 + + Update Fcker.cpp and Fcker.h to support chests and barrels + +commit 0f81bcfc84e557b44caab871ba89b13d7da335ac +Merge: 345d36e 7fbfcc1 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sat Nov 9 11:15:12 2019 -0400 + + Merge pull request #150 from Johnmacrocraft/fix-stuffs + + Fix 9ab1bdd9b928b657134a00d6974eb164a3364c33 + +commit 319ae4c0c0713549c9c90aca2cb1eaeb30d9975e +Author: OhBoyItsGrelAgain <57557404+OhBoyItsGrelAgain@users.noreply.github.com> +Date: Sat Nov 9 19:21:30 2019 +1000 + + Update Fcker.cpp to support chests and barrels. + + Option turned off by default because it may wreck the user's base accidentally. + +commit 3f17260da55f6f11c18c74cd953703cc5895a5f9 +Author: OhBoyItsGrelAgain <57557404+OhBoyItsGrelAgain@users.noreply.github.com> +Date: Sat Nov 9 19:19:06 2019 +1000 + + Add chest and barrel bool in Fcker.h + +commit 7fbfcc181f5665f7b40f77c62bb654b196f16378 +Author: Johnmacrocraft +Date: Sat Nov 9 17:25:29 2019 +0900 + + Fix 9ab1bdd9b928b657134a00d6974eb164a3364c33 + + Also minor code style fix + +commit 345d36e1efca451aee0b85a4479ac83e626d35bd +Author: erwan celanie +Date: Sat Nov 9 01:38:23 2019 -0400 + + somehow fix noSlowDown + +commit 9ab1bdd9b928b657134a00d6974eb164a3364c33 +Author: erwan celanie +Date: Sat Nov 9 01:04:29 2019 -0400 + + fix chestStealer,itemData with .give &bunch of others stuffs + +commit 3e8f10d3fec42b87c1a4a15048006bb6e8dba2b6 +Merge: e588f3d 255fc5a +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Fri Nov 8 19:53:55 2019 -0400 + + Merge pull request #146 from Johnmacrocraft/improve-give-and-dupe + + Improve .give, .enchant and .dupe + +commit e588f3d296110ba7a003ace708b59e197172b771 +Author: Richard +Date: Sat Nov 9 00:19:09 2019 +0100 + + Better ArrayList gradient animation + +commit 286973a303caca49e500e91e2fee2ace1c8b8a59 +Author: Richard +Date: Fri Nov 8 21:03:54 2019 +0100 + + kinda weird rainbow animation + +commit 28667110cb064edc2ad5c6e9cf2cfd46570b6d45 +Author: Richard +Date: Fri Nov 8 17:13:49 2019 +0100 + + Update (Beta Channel) + - Damage Command now toggles NoFall automatically + - Aimbot require click now works + - Fixed TriggerBot + +commit 255fc5aae3bf2495aba2bc04f193852b705e406c +Author: Johnmacrocraft +Date: Fri Nov 8 15:33:11 2019 +0900 + + Missed one + +commit 263a1483983e8a423921447d348bf5959ce62c59 +Author: Johnmacrocraft +Date: Fri Nov 8 15:30:44 2019 +0900 + + I am the harbinger of consistency + +commit 35929750c147183e9e8795129eb58c442d7dfbeb +Author: Johnmacrocraft +Date: Fri Nov 8 15:20:49 2019 +0900 + + Added some code "just in case" + +commit 99f0ad3e2d50116cedd8b6851bc7b041e7097c62 +Author: Johnmacrocraft +Date: Fri Nov 8 14:54:04 2019 +0900 + + Improve .give, .enchant and .dupe + + - .give and .enchant once again works correctly on Mineplex + - .dupe is now fully automated just like .give and .enchant (the previous method is still available) + +commit 50c92bedefa017cc8022a542640d886682f00d0e +Author: erwan celanie +Date: Thu Nov 7 21:18:58 2019 -0400 + + fix freecam + +commit 441e9a9cf322fbf02ec5d89e0f90d5e4cff1779f +Author: erwan celanie +Date: Thu Nov 7 21:16:21 2019 -0400 + + fix airswim , blink,fly & glide + +commit 52438e6db18e561581e3f7c65d32d7507e1d7525 +Author: Richard +Date: Thu Nov 7 19:19:58 2019 +0100 + + Fixed ESP and other stuff + +commit f4392777727f8cbdbf1314bf8fbe0e0410d780f3 +Author: Richard +Date: Wed Nov 6 22:06:10 2019 +0100 + + I added some not so good working derp + +commit 16f9e1554b35946df2a7d69df59a91cd10d2d9e5 +Author: Richard +Date: Wed Nov 6 21:24:51 2019 +0100 + + Update (Beta Channel) + - Improved AntiBot checks + - Improved InventoryCleaner + - Log file is now named logs.txt + + - GAMER FONT IS GONE :CRABRAVE: (survivor please dont hate me) + +commit a63dafba2ea951becab5b1574865e3c720575cd1 +Author: erwan celanie +Date: Wed Nov 6 00:15:33 2019 -0400 + + fix Bhop ,InventoryMove,Tower , + Airrjump,GameSettingsInput + +commit 5757d2f8259d5817e017f963b6958b377deb2811 +Author: erwan celanie +Date: Tue Nov 5 22:09:54 2019 -0400 + + fix .enchant completely + +commit 5cb7cd61cbfddc11e48c44bc67a071d72214000b +Merge: 82bb885 c2ae3b6 +Author: GodGamer029 +Date: Tue Nov 5 14:10:47 2019 +0100 + + Merge pull request #137 from Johnmacrocraft/fix-chestesp + + Fix ChestESP + +commit c2ae3b6ac9015ab9550fdb2ec8092e068a5d10a5 +Author: Johnmacrocraft +Date: Tue Nov 5 14:09:41 2019 +0900 + + Fix ChestESP + +commit 82bb8854cce0d468a6ce038e2ccf19f6b2efb97a +Author: erwan celanie +Date: Mon Nov 4 23:29:09 2019 -0400 + + fix weird crash + +commit fa69ab65114741b6609bcdac7ea348fa85501668 +Author: erwan celanie +Date: Mon Nov 4 22:35:13 2019 -0400 + + Improvements + +commit 6b4732347db72243bbffe91c5e1038d92b036681 +Author: erwan celanie +Date: Mon Nov 4 22:06:05 2019 -0400 + + fix auto give + +commit 45bd27fb32f077050ea2751ead1476a98cec5239 +Author: GodGamer029 +Date: Mon Nov 4 11:17:39 2019 +0100 + + Fix Fullbright & #135 + +commit 36df253131c6bc03cf5168a8f04b2d6fedcbd012 +Author: Richard +Date: Mon Nov 4 01:07:26 2019 +0100 + + Update (Beta Channel) + - Minor Changes: + - ChestAura now opens only one chest at a time + - Added InventoryCleaner (needs improvements) + +commit 963153be60f4e6164d966b9784de5a579392b310 +Merge: 458061e 2d995bf +Author: erwan celanie +Date: Sun Nov 3 14:52:26 2019 -0400 + + fix .give & .soh + +commit 458061e8223e4d3593c6753127246cfd25e77523 +Author: erwan celanie +Date: Sun Nov 3 14:49:46 2019 -0400 + + fix .give & .soh + +commit 2d995bfe4dc224502f7cf3c278fc4a048693d3fb +Author: GodGamer029 +Date: Sun Nov 3 17:29:24 2019 +0100 + + Fix xray + +commit 3e8c8ae559a4a72bba5be875a4139c168597bd87 +Author: GodGamer029 +Date: Sun Nov 3 17:23:31 2019 +0100 + + Fix ClickTp + +commit 40245fb2a657fbfa322b474eba5168779c840bc9 +Author: GodGamer029 +Date: Sun Nov 3 17:14:54 2019 +0100 + + Fix Command History + +commit a456d2d4a3f0e084b2d1f4a4e471d3df7a471bfe +Author: GodGamer029 +Date: Sun Nov 3 16:32:25 2019 +0100 + + Progress on fixing Chest Stealer + +commit 7787782661c991d8fa75e31497ce83fe8dc03442 +Merge: 89aae62 b91b8f2 +Author: GodGamer029 +Date: Sun Nov 3 15:37:41 2019 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 89aae625650c542f2f25b9db7983c70bfff69b1e +Author: GodGamer029 +Date: Sun Nov 3 15:37:34 2019 +0100 + + Fix AutoArmor + +commit 084ad529a40b3c7804e29f0186be58a56938a7a1 +Author: GodGamer029 +Date: Sun Nov 3 12:50:17 2019 +0100 + + Comment a function + +commit b91b8f239e30970357585ee253eb8956b3cfe485 +Author: erwan celanie +Date: Sat Nov 2 17:08:36 2019 -0400 + + nameTags in Gamer Font + +commit fca5a7e19649c529785989e4d00afb57b49eca9a +Merge: fc013f4 8565e54 +Author: erwan celanie +Date: Sat Nov 2 16:56:32 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit fc013f4890d3fd8509cd9fc805d413686a6ffb37 +Author: erwan celanie +Date: Sat Nov 2 16:56:14 2019 -0400 + + added Gamer Font !!!!! & new ClientInstancePtr + +commit 8565e5485bdfffe83ee5c7690a3bb1f8c4f3155f +Author: GodGamer029 +Date: Sat Nov 2 20:19:56 2019 +0100 + + Fix C_MovePlayerPacket & setGameModeType + +commit 1105681b5530c6f38f5d305cba448aa7facba943 +Merge: 21cb811 a23cb1e +Author: GodGamer029 +Date: Sat Nov 2 19:44:25 2019 +0100 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 21cb811f3026e30db4e3030622b1c7ba0bb4f976 +Author: GodGamer029 +Date: Sat Nov 2 19:44:14 2019 +0100 + + I might have fixed TextPacket + +commit a23cb1ef29add09a096f27f2c3c71653fea758e5 +Merge: 50d7b86 8d66b0f +Author: GodGamer029 +Date: Sat Nov 2 19:19:15 2019 +0100 + + Merge pull request #126 from Johnmacrocraft/fix-trailing-whitespace + + Fix trailing whitespace + +commit 8d66b0fdb621d1e3d2d6cad82afcb82bec16f1b6 +Author: Johnmacrocraft +Date: Sun Nov 3 03:08:26 2019 +0900 + + Fix trailing whitespace + +commit 50d7b8683bc6201e9831678c8bc83a4df1fa57d3 +Author: GodGamer029 +Date: Sat Nov 2 19:02:23 2019 +0100 + + "Fix" C_MobEquipmentPacket + +commit 3c4e881ff127fee141c860e4bdc4b1d72fcbb4ef +Author: GodGamer029 +Date: Sat Nov 2 17:53:45 2019 +0100 + + Fix C_InventoryTransactionPacket + +commit eed3ae0df16f8d0256cccd106c14a7e4d0db79a7 +Author: GodGamer029 +Date: Sat Nov 2 17:45:25 2019 +0100 + + Fix ActorFallPacket + +commit 80d2e07108adbe62688b0bbb06f444294107c374 +Author: GodGamer029 +Date: Sat Nov 2 17:31:20 2019 +0100 + + Bunch of inlining & more premium + +commit 39e3d596b2c37e3b3b73f0d91eb55b094c033bd7 +Author: GodGamer029 +Date: Sat Nov 2 17:19:09 2019 +0100 + + Remove debug stuff + +commit 1a26b56e60ea45acef7335a5907afac878d9e54e +Author: GodGamer029 +Date: Sat Nov 2 17:17:18 2019 +0100 + + interpolation for the bois + +commit 1c9979f5bc32aded9ba9a6c3135061b977c98169 +Author: GodGamer029 +Date: Sat Nov 2 16:13:56 2019 +0100 + + sig fix + +commit 70ef36636486f723ce93a21643636ff9724f4c55 +Author: GodGamer029 +Date: Sat Nov 2 15:37:32 2019 +0100 + + Fix origin + +commit 32ba8486aa27283fa74ce8ba77ef80493b25ba9b +Author: GodGamer029 +Date: Sat Nov 2 13:31:18 2019 +0100 + + Fix syncShit + +commit d4ca6ca8648733d29d6d5863f1f2b7ae16444dca +Author: erwan celanie +Date: Sat Nov 2 01:23:02 2019 -0400 + + Update player struct & vTable , sendChatMsg Hook & other things + +commit be5ab900fbd94ace7b89f416b3ecc218913e6c66 +Author: erwan celanie +Date: Fri Nov 1 01:29:59 2019 -0400 + + fix Actor::vTable + +commit 04e60fbabc2aa9f9295e06af609dde58a2d49408 +Author: erwan celanie +Date: Fri Nov 1 00:24:37 2019 -0400 + + Fix ClickGui & Crash when connecting to a world + +commit abe2b633389dd3b4c31a78704a6864951420d49c +Author: erwan celanie +Date: Thu Oct 31 19:52:23 2019 -0400 + + Correctly fix ClientInstance::vTable + +commit 36c68e18e999dd39a5a1ac478feadfbbf965181c +Author: erwan celanie +Date: Thu Oct 31 02:06:09 2019 -0400 + + fix ClientInstance vTable + +commit ff79c4a8e5652a12128bdbf0156ba78af5ee1e5f +Author: erwan celanie +Date: Wed Oct 30 21:34:32 2019 -0400 + + fix crash when injecting + +commit 43c84736893d48e0972e1851c56c1f66416f26a0 +Author: erwan celanie +Date: Wed Oct 30 14:15:12 2019 -0400 + + fix some hooks , displayChatMsg & ClientInstance class + +commit a9f3aeef3f6eca0d03bcbf5970ddcac349ad5a8b +Author: erwan celanie +Date: Tue Oct 29 22:20:19 2019 -0400 + + fix tess_begin + +commit 0de7b49ac12e1f09d830ecd5c51563764003682a +Author: erwan celanie +Date: Tue Oct 29 19:22:39 2019 -0400 + + fix HIDController + +commit ade39fed83555fc2d2f497354a36d4a2bfc3607e +Author: GodGamer029 +Date: Tue Oct 29 21:43:12 2019 +0100 + + Kind of fix drawing? + +commit 22a9e14fa140ff83e225eb52217b01b5c8b22ce5 +Author: GodGamer029 +Date: Tue Oct 29 20:43:13 2019 +0100 + + Fresh Client Instance Ptr + +commit f81638c1baea44f29f1a73d16e096e124f836384 +Author: GodGamer029 +Date: Tue Oct 29 19:52:19 2019 +0100 + + Hooks are working again + +commit 6e83054f8edfc00f8e3cac621485eba2622864dd +Author: GodGamer029 +Date: Tue Oct 29 19:35:04 2019 +0100 + + Its ya boy, commit message! Today we are gonna yeet big time and hope no one reads this far! + +commit 9c1f5e6c67d231cd82a7b905735fe500f4959047 +Author: erwan celanie +Date: Mon Oct 28 22:59:05 2019 -0400 + + return bool + +commit d99ab745039325ad1d1db4a9d2f768328ad5bb4c +Author: erwan celanie +Date: Mon Oct 28 22:57:14 2019 -0400 + + temporarily fix some issues with antibot + +commit e9d650592f75f1a857af48ca98095aa547164f41 +Merge: 8120019 0538d4c +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Oct 27 10:43:35 2019 -0400 + + Merge pull request #120 from GodGamer029/hook_cleanup + + Hook-Class Cleanup + +commit 0538d4cf5d7d67833d52e4ff2c74b9b8376b9afe +Author: GodGamer029 +Date: Sun Oct 27 15:26:18 2019 +0100 + + Group Initializers & Remove FuncHook::init call + +commit a51f349abfa1d09d6a92fd20e78eb0cf5c031da4 +Author: GodGamer029 +Date: Sun Oct 27 15:18:37 2019 +0100 + + Actor_ladderUp & No static variable for vtables + +commit 9d6df8a0f4ce546c7c4f83b084977c2c54b012ec +Author: GodGamer029 +Date: Sun Oct 27 15:12:14 2019 +0100 + + They call me Mr.Clean + +commit 6d78712e530d484988ca65e29b7b1e319eefa691 +Author: GodGamer029 +Date: Sun Oct 27 15:08:23 2019 +0100 + + Removed even more __fastcall + +commit 5400a141d1f8b9dfd6a452d4dbddb83b5214a432 +Author: GodGamer029 +Date: Sun Oct 27 15:05:10 2019 +0100 + + Remove VMTHook & '__fastcall' keyword + +commit ce1e8b4b6f59480a01738384bca510466e075046 +Author: GodGamer029 +Date: Sun Oct 27 15:03:34 2019 +0100 + + Consistent Naming Scheme + +commit 31da719f1cbca347df5e1321c429f7c75697cafd +Author: GodGamer029 +Date: Sun Oct 27 14:45:26 2019 +0100 + + Remove typedefs & GetOriginal() + +commit a22b8309bb6b3cbd58ae833e5852ec4dee06acd4 +Author: GodGamer029 +Date: Sun Oct 27 14:43:09 2019 +0100 + + Cleanup Hook->GetOriginal & Removed unused Hooks + +commit 8120019b6f2dcef2c006510516ddd80ad6c36649 +Author: Richard +Date: Sun Oct 27 09:16:57 2019 +0100 + + Update (Beta Channel) + Mainly bug fixes: + - Fixed typo in AntiBot settings + - Fixed Fucker + - Fixed tooltip option being disabled in ClickGUI + - Added some (still unused) functions to ModuleManager + - Removed DirectX + - Fixed Horion Watermarked being drawed not aligned correctly + - TargetCheck should now correctly check if an entity is a mob + - AntiBot now detects NetherGames's bots + + This is the last update by me for the next 10 days, see you later! + +commit 1b2c3de1a71db54ea2ecad841e66147994efe5ee +Author: Richard +Date: Fri Oct 25 02:22:12 2019 +0200 + + Update (Beta Channel) + - Added AntiBots module with settings (to enable/disable specific target checks for killaura/esp) + - Renamed 'BedFucker' to 'Fucker' + - Fucker now has toggelable options (beds, eggs, cakes, treasures) and a range slider + - Fixed some crash occuring when injecting the mod whilest in game (Sadly the 'auto hide when in menu' had to be disabled for this) + - Fixed config saving + - Updated strings + +commit 4473b296b65f0befd803ade700cb9711a7ccf03c +Author: Richard +Date: Wed Oct 23 22:11:24 2019 +0200 + + Updates (Beta Channel) + - HUD now has an option to not display when e. g. in chat or inventory + - ChestStealer close delay can now be changed + - Removed Bhop jump height option (just use highjump now) + - Fixed some crashes occuring on Hive, NetherGames and other servers + +commit f9f0e9b5b56d246b86c360d2c07497ec6d544c33 +Author: Richard +Date: Tue Oct 22 23:49:07 2019 +0200 + + Updates + - Modules are now sorted alphabetically + - ChestAura range can be modified (1-10) + - .modules Command now shows module description + +commit ea407c559cb16f906de90df0241217b5f39e046e +Author: Richard +Date: Tue Oct 22 19:39:37 2019 +0200 + + Improvements & Additions + - Added ability to change command prefix + - Fixed Freecam onDisable() + +commit 59d500feb53364f8c35614b4b90031c030c57ec1 +Author: Richard +Date: Tue Oct 22 15:00:10 2019 +0200 + + Added patreon funding feature + +commit f0d49627ea0469b56686faa484ecb6668bc774e0 +Author: Richard +Date: Mon Oct 21 21:14:39 2019 +0200 + + Improved Bhop module + +commit c105c72cd76fd817dd2b5b187c2b3b305c866fbb +Merge: 34b4d5f cde119d +Author: erwan celanie +Date: Sun Oct 20 17:11:36 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit 34b4d5fd4542bf3d0e223427f5a150308a57a77b +Author: erwan celanie +Date: Sun Oct 20 17:11:16 2019 -0400 + + Tooltips + +commit cde119dc18d25fd48e246ce98aab55e6a480a973 +Author: Richard +Date: Sun Oct 20 21:29:20 2019 +0200 + + Fixed Bugs, Added Coordinates Display + +commit c0078b8c5bddaa25e87b46911587e9084a37bc14 +Author: erwan celanie +Date: Sun Oct 20 13:40:45 2019 -0400 + + fixed bunch of warnings + +commit 539cbdb92a587ed77fc62fdecee30f4e9fec9cd1 +Author: Richard +Date: Sun Oct 20 17:58:44 2019 +0200 + + Added manual spam function back + +commit f24e10bdaefb6edfb444629f62e7993b6eeedd87 +Author: Richard +Date: Sat Oct 19 13:30:10 2019 +0200 + + Fixes and improvements + +commit 214bc2eb0d9bf55a9db8be8b9c4ad69cec748709 +Author: Richard +Date: Fri Oct 18 19:55:16 2019 +0200 + + Added ChestAura + +commit 066689339ef29e1aab18748c2dffbffe13d9b00f +Author: Richard +Date: Fri Oct 18 15:09:16 2019 +0200 + + fix clicktp and add only hand option + +commit 169244061754557e7c795e79493feb133976413d +Author: Richard +Date: Thu Oct 17 23:58:18 2019 +0200 + + Removed spam command, added Spammer + +commit 5ec89cade1ca92dce97aeff486c8c796c75e0c15 +Author: Richard +Date: Thu Oct 17 20:32:45 2019 +0200 + + Added tooltips (not finished), minor improvements + +commit 8b14701b0dcb64c67770f1c397682baddc5133b6 +Merge: f9d420f 812e5f5 +Author: erwan celanie +Date: Wed Oct 16 18:29:19 2019 -0400 + + Merge branch 'master' of https://github.com/horionclient/Horion + +commit f9d420f4b678b786a0aeebcaf96ab66cd365bd24 +Author: erwan celanie +Date: Wed Oct 16 18:29:07 2019 -0400 + + fix + +commit 812e5f5716688b54c2a59cd3a5fe364b11935b73 +Author: Richard +Date: Wed Oct 16 22:52:50 2019 +0200 + + TabGui, ArrayList and Watermark are now one module called HUD which you can toggle as whole, or just tick the checkboxes to enable/disable specific things + +commit b0cf59155f6df66a5084daa279ed9783906d9ec0 +Author: erwan celanie +Date: Wed Oct 16 16:20:44 2019 -0400 + + fixed some warnings + +commit f68bb8c42789235a8497cfe23fb298e741c676a0 +Author: Richard +Date: Wed Oct 16 15:11:18 2019 +0200 + + improved (not yet working) silent scaffold (needs delay) + +commit a53371cd8f5a19ea18ffcae315113d3b51884003 +Author: Richard +Date: Wed Oct 16 14:48:41 2019 +0200 + + Improved Targets check, added (not yet working) autoselect scaffold + +commit 9fbff6f44173d34aaad3c250b3060cf656ff18b6 +Merge: 12ad381 23835ba +Author: Richard +Date: Wed Oct 16 14:16:30 2019 +0200 + + Merge pull request #101 from Johnmacrocraft/fix-give + + Fix .give, improve .dupe + +commit 23835ba32a03e737c4baf8c8506702a2614676c6 +Author: Johnmacrocraft +Date: Wed Oct 16 21:05:19 2019 +0900 + + Fixed the infamous .give ID crash + +commit 12ad381e251227a790626196f5e4d0d138178eaa +Author: Richard +Date: Tue Oct 15 22:13:24 2019 +0200 + + Killaura AutoWeapon option + +commit 20ea903369f34c595214eff50f6e67fe27eb2925 +Author: Richard +Date: Tue Oct 15 20:45:10 2019 +0200 + + Added .damage Command, expanded SDK + +commit 3f03e0dee01b2b9f93fa28b4f76240cdafe8c516 +Author: Richard +Date: Tue Oct 15 19:41:30 2019 +0200 + + Add NoFriends module + +commit 305768ba19529359b06802e0c5710d4db74d1e27 +Author: Johnmacrocraft +Date: Wed Oct 16 00:31:34 2019 +0900 + + DupeCommand: Allow specifying count + +commit caa38913c640efcb12e46e497d1cbcde893e676d +Author: Richard +Date: Tue Oct 15 16:42:39 2019 +0200 + + Added step height setting and improved ClickTP + +commit f86a4f82e428b637cbef85ed4d424b35f46a479b +Author: Johnmacrocraft +Date: Tue Oct 15 21:59:57 2019 +0900 + + Fix .give doing weird things when inventory is full + +commit c6407bafd2462a35f310ab94961d997ca7b7b808 +Author: Richard +Date: Tue Oct 15 03:14:47 2019 +0200 + + Add ClickTP + +commit e11a140970ecbfbf706d672173bc0875d633255e +Author: Richard +Date: Tue Oct 15 01:52:08 2019 +0200 + + Added MidClick module, improved isValidTarget() check + +commit 855eabc6c8388afb87eb34656aaca2cbe42fc932 +Merge: 923677f 04673a0 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Mon Oct 14 17:30:15 2019 -0400 + + Merge pull request #96 from Johnmacrocraft/add-dupe + + Implement .dupe + +commit 04673a046bb13678c152cc3cb420a833ec10a59a +Author: Johnmacrocraft +Date: Tue Oct 15 02:34:29 2019 +0900 + + Minor comment fix + +commit 923677fe1a38e125c7a3bd0b8bfbce7afa3e2c1e +Author: Richard +Date: Mon Oct 14 16:59:13 2019 +0200 + + Update issue templates + +commit 601f25e6ee7e5e66c64a270330d4dfb65e9061f4 +Author: Richard +Date: Mon Oct 14 16:54:45 2019 +0200 + + Update README.md + +commit 6e4429233059ce741554f7e11925033c1349bdec +Author: Richard +Date: Mon Oct 14 16:52:51 2019 +0200 + + Update README.md + +commit 19774b07c29d3a76bba6e241e60dad961694841c +Author: Johnmacrocraft +Date: Mon Oct 14 22:48:54 2019 +0900 + + Implement .dupe + +commit 1752077e2feaef6521b5f09ac186f5b0e9a2b906 +Author: erwan celanie +Date: Sun Oct 13 16:11:30 2019 -0400 + + fix bhop working while in chat + +commit 4e395bfd934a75c0b5f17bf2b5f997899715e20e +Author: erwan celanie +Date: Sun Oct 13 13:42:25 2019 -0400 + + keybind + +commit 6cc104456f85b8ad4388f5005d31beaeb4845da4 +Author: erwan celanie +Date: Sun Oct 13 12:37:39 2019 -0400 + + fix BugUp not working with nofall & elytraFlight + +commit 57411910ccb81bc1be6a60fb206652050c6a828f +Author: erwan celanie +Date: Sun Oct 13 12:01:52 2019 -0400 + + quick fix + +commit 0d47e477b966d61a2b2df667dd9aa8ff1bf7e85f +Author: erwan celanie +Date: Sun Oct 13 11:44:40 2019 -0400 + + autoarmor + +commit 049fa5c24669c12b0dd7fd6f90cbe0b72518d9b6 +Author: Richard +Date: Thu Oct 10 20:18:53 2019 +0200 + + Added BugUp (teleports to last safe pos when falling more than x blocks) + +commit e828b75ae6fb8656f6934602385d53f96df0a709 +Author: Richard +Date: Wed Oct 9 23:25:00 2019 +0200 + + AutoClicker rightclick option + +commit 169ceced9e67a9cbba99e8d35c31d065d0b5a725 +Author: Richard +Date: Wed Oct 9 15:16:28 2019 +0200 + + Enhanced AirJump + +commit 531c095f814a13867a96abe030639b6bd4c1cc5a +Author: Richard +Date: Tue Oct 8 17:09:53 2019 +0200 + + Add Tower + +commit 223152eb0d98c08d4facc76637b2bf8e18aeaba8 +Merge: 425d6ad f182f7e +Author: Richard +Date: Mon Oct 7 17:40:43 2019 +0200 + + Merge pull request #75 from Johnmacrocraft/fix-readme-url + + Update some readme URLs + +commit f182f7e85e6f258833a21fdfe01ffa53473589f0 +Author: Johnmacrocraft +Date: Tue Oct 8 00:25:45 2019 +0900 + + Update some readme URLs + +commit 425d6adaefa3a4be835325a64e949ec27979f052 +Merge: c403bb1 aa60d4b +Author: Richard +Date: Mon Oct 7 17:03:00 2019 +0200 + + NameTags: Unicode setting (by Johnmacro) + + NameTags: Add Use Unicode font setting (as a workaround) for names containing Unicode characters + +commit c403bb1673282b3a985d26ad79f365b1d6ed1382 +Merge: d13e4e6 87b1d8f +Author: Richard +Date: Mon Oct 7 16:42:46 2019 +0200 + + Merge pull request #74 from Johnmacrocraft/fix-speed-crash + + Disabling Speed when not in-game no longer crashes the game + +commit 87b1d8fa773ca45d1a8514a88b8e552163ce0a99 +Author: Johnmacrocraft +Date: Mon Oct 7 23:33:04 2019 +0900 + + Disabling Speed when not in-game no longer crashes the game + +commit d13e4e65e7753c638c43ed8155c4dbf71a3f6a8b +Author: Richard +Date: Mon Oct 7 16:07:21 2019 +0200 + + Added Bhop + +commit 96fc374b943a424fd77da0e152f6658501885d5a +Author: Richard +Date: Mon Oct 7 14:08:29 2019 +0200 + + Added .spam command + +commit bace4c93594150e60924fdc5cdf8efdcecc7bf5a +Author: Richard +Date: Sun Oct 6 16:54:39 2019 +0200 + + Update ReadME + + Changed Azure DevOps organisation + +commit 5b9010fdf62287e551a48053b211b1f838b9eb4f +Author: Richard +Date: Sun Oct 6 16:32:12 2019 +0200 + + This is not needed anymore + +commit a78ccf08b77f68cac4a6287417eecf462101eb56 +Author: Richard +Date: Sun Oct 6 16:28:24 2019 +0200 + + Update azure-pipelines.yml for Azure Pipelines + +commit 2825bbfc965e04b7b088c962775fdc10c510ffc4 +Merge: 0b4ffe8 0b18d58 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Oct 6 07:52:59 2019 -0400 + + Merge pull request #73 from richardletshacks/patch-1 + + Changed Code Quality label to fit other labels + +commit 0b4ffe8ec20ba8f8e0c93ad2229dbae54ce2398b +Merge: cb7c08a 53c8ccc +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Oct 6 07:52:26 2019 -0400 + + Merge pull request #72 from richardletshacks/master + + Minor edits, added .bind none support. + +commit 53c8ccc544ca881683dbd2651573f7046a42d12f +Author: Richard +Date: Sun Oct 6 12:35:53 2019 +0200 + + Minor edits, added .bind none support. + +commit cb7c08a1223cc1fee59cc2ea522a9c79e40d7cf7 +Merge: 23fffd0 3f7f210 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Oct 6 05:58:36 2019 -0400 + + Merge pull request #71 from richardletshacks/master + + Fixed Criticals + +commit 0b18d588b5eaf59aa71a47a5352ea39f421d43b3 +Author: Richard +Date: Sun Oct 6 10:27:28 2019 +0200 + + Changed Code Quality label to fit other labels + +commit 3f7f210e885fbef846832945d854b5a3aa0c3677 +Author: Richard +Date: Sun Oct 6 10:21:36 2019 +0200 + + Fixed Criticals + +commit 23fffd0179c6abbbf3e192f4c32bd332e3957eaf +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sat Oct 5 23:38:02 2019 -0400 + + Update README.md + +commit 25e7bc16d8f4373bff7de4bec1078212316a69ff +Merge: 973eaab bd7bd70 +Author: erwan celanie +Date: Sat Oct 5 21:35:25 2019 -0400 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 973eaab6eb53c341f4253ca6ef442b9f53b527a1 +Author: erwan celanie +Date: Sat Oct 5 21:35:09 2019 -0400 + + criticals + +commit bd7bd7004df7c724eeb25be2d0db65b37e247285 +Merge: e8235fa 37e7fcd +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sat Oct 5 18:28:30 2019 -0400 + + Merge pull request #69 from richardletshacks/patch-1 + + Updated ReadMe + +commit 37e7fcd9d802472783dde96bc874f9228fc19d86 +Author: Richard +Date: Sat Oct 5 23:08:15 2019 +0200 + + Updated ReadMe + + 1. Changed "Download Latest" label to "Download Injector" to avoid misunderstanding + 2. Fixed typo in Installation bullet point 1, changed text to avoid misunderstanding + 3. Updated Azure Pipelines label and text, updated link + +commit e8235fa4f041b7e5b44b9899d40d14c9fdbde4c4 +Author: erwan celanie +Date: Wed Oct 2 17:25:02 2019 -0400 + + .give & .enchant working on cubecraft + +commit aa60d4b5f4de1b519f2d67bdef57945060e9af93 +Author: Johnmacrocraft +Date: Tue Oct 1 21:35:44 2019 +0900 + + NameTags: Add Use Unicode font setting for names containing Unicode characters + + This is not the best way to handle this problem, but it will do the job for now... + +commit 9dfe37580f1751d6f80d803c905bec2bdf2d1608 +Author: erwan celanie +Date: Mon Sep 30 20:10:25 2019 -0400 + + improvements + +commit e517118b008a5570f67806a348d984977a5bf793 +Author: erwan celanie +Date: Sun Sep 22 17:54:19 2019 -0400 + + auto enchant + +commit c5a4acb07b219faea0e8639829643d977efc761d +Merge: 2af4ce6 d56e86b +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Sep 22 15:02:23 2019 -0400 + + Merge pull request #63 from richardletshacks/master + + Added .ip Command + +commit d56e86b9e21ac2c194c1a12d8bb646b732d5657a +Author: Richard +Date: Sun Sep 22 21:00:51 2019 +0200 + + Added .ip Command + +commit 301af43a3dde683c7665696fa49de2d7f33e214e +Author: Richard +Date: Sun Sep 22 20:56:56 2019 +0200 + + oops + +commit 7fadea415759209b43b49503bc0732b6965c09a0 +Author: Richard +Date: Sun Sep 22 20:38:18 2019 +0200 + + yup + +commit 2af4ce63731c0f3d093e7c3297b1dd457cfdef8e +Author: erwan celanie +Date: Sun Sep 15 19:19:48 2019 -0400 + + auto give + +commit 94720fd24614d0b9a75630e488285af175f991a0 +Merge: f133695 04f01ab +Author: erwan celanie +Date: Mon Sep 2 00:25:39 2019 -0400 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit f133695e9be34d4bd9605bbf7d4707846c08e65c +Author: erwan celanie +Date: Mon Sep 2 00:24:43 2019 -0400 + + Reversed more and more stuff + +commit 04f01ab43682fb93681ac2857ce783df9ab76269 +Merge: c2102c8 1fcef39 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Sun Sep 1 14:55:22 2019 -0400 + + Merge pull request #57 from Godsoft029/alright + + Improved User Experience + +commit c2102c819340429e7f6187f734684c3c6a0cb5b6 +Author: erwan celanie +Date: Sun Sep 1 14:29:42 2019 -0400 + + reversed more stuff + +commit 1fcef394c2a17cedaa2684526b96d70135898485 +Author: GodSoft029 +Date: Sun Sep 1 20:18:31 2019 +0200 + + Update Loader.cpp + +commit f809d41e305390bc1bd5dc2101cdb6857966be68 +Author: erwan celanie +Date: Sat Aug 31 01:52:05 2019 -0400 + + reversed InventoryTransactionPacket + +commit e206604ab79095b8f7dfd5ee42c7e6a7b22cac59 +Author: erwan celanie +Date: Wed Aug 28 19:30:11 2019 -0400 + + better NameTags + +commit 86380818dd9fb73f37b9ba896485fc64f4b40b48 +Author: erwan celanie +Date: Tue Aug 27 00:49:17 2019 -0400 + + some corrections + +commit d71f088eaa7e7c75439d0a19740a0a31c5f241fd +Author: erwan celanie +Date: Mon Aug 26 23:23:53 2019 -0400 + + added nametags and 200 iq player check + +commit f90fe5774fb5b2398fc3b7826c7ad5225628c9fd +Author: erwan celanie +Date: Sun Aug 25 18:22:20 2019 -0400 + + why delete .enchant all + +commit a320bc40dff19e75923c237427b54a27523fdbd2 +Author: erwan celanie +Date: Sun Aug 25 17:30:20 2019 -0400 + + more corrections + +commit a59805d3509d2ca3454035c831299c60a013ee7e +Author: erwan celanie +Date: Sun Aug 25 16:59:28 2019 -0400 + + some corrections + +commit 8d600aa1c05affe7f23af5ec4f2f20743f54e54a +Merge: ef66ca3 d1d1dfd +Author: erwan celanie +Date: Sun Aug 25 16:52:53 2019 -0400 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit ef66ca3c9929bb6c08151ab578a14be6b7573ca6 +Author: erwan celanie +Date: Sun Aug 25 16:52:34 2019 -0400 + + some clean up + +commit d1d1dfd13e49b1a00f0daf8636c21398ec333fa2 +Author: hYdos +Date: Mon Aug 26 06:24:23 2019 +1000 + + added name support to /enchant command (#43) + + * added name support to /enchant command + +commit c4a01e179814257f1049177aa299004a33412fe7 +Author: GodGamer029 +Date: Sun Aug 25 21:34:04 2019 +0200 + + code actually compiles now + +commit 73abf2d9cf9dee94b722d7b026e3b9d40bb5533f +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:30:26 2019 -0700 + + Create AutoClicker.cpp (#45) + +commit 97c5958149c967d7944821ca53cfc24ea9f60137 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:30:18 2019 -0700 + + Create AutoClicker.h (#46) + +commit 0d3e15a8c86aeef73d3002ca6f029bad177736e4 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:30:11 2019 -0700 + + Update Aimbot.cpp (#47) + +commit f3b0a0e79c0616f816ac344e648e5c2a0cc405e6 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:29:51 2019 -0700 + + Update Aimbot.h (#48) + +commit 65b8af7ffb84301cfef6a6a041ef75ea7f5550f1 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:29:37 2019 -0700 + + Update TriggerBot.h (#49) + +commit 1d9ea1d05a2cd333524f9e387db3dd90f43f8c66 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:29:28 2019 -0700 + + Update TriggerBot.cpp (#50) + +commit 3891a438ac25236b07ea2328bf724ede048a69d0 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:29:18 2019 -0700 + + Update ModuleManager.cpp (#51) + +commit 302a3815797729e4a7f5be3459eb03a4d9d84aa4 +Author: zzolr <49467061+zzolr@users.noreply.github.com> +Date: Sun Aug 25 12:29:06 2019 -0700 + + Update ModuleManager.h (#52) + +commit d2979d322c0ee6db3580f257fbcd7f2daa01d6ca +Author: GodSoft029 +Date: Sun Aug 25 18:03:46 2019 +0200 + + Update README.md + +commit 487f7d0c6c7d86ee48b489325817f25f66c311d5 +Author: GodSoft029 +Date: Sun Aug 25 17:52:34 2019 +0200 + + Update README.md + +commit d9f9aeeb5c87c6e7daf8df2fe7b3e8eef119283e +Merge: 489abdc f903809 +Author: GodGamer029 +Date: Sun Aug 25 17:49:36 2019 +0200 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 489abdceaad882d19f7fa251a977cfe3df3b5eef +Author: GodGamer029 +Date: Sun Aug 25 17:49:34 2019 +0200 + + fix airswim crash + +commit f9038091ba9e7a3571839893475de65090fd5cc4 +Author: GodSoft029 +Date: Sun Aug 25 17:44:51 2019 +0200 + + test azure build + +commit af4a114b819351ededede1e3d11631fc619920d3 +Author: GodSoft029 +Date: Sun Aug 25 17:05:09 2019 +0200 + + Set up CI with Azure Pipelines + + [skip ci] + +commit 2f0a6209b2a966bfd4ce9c6c92321f56913869df +Author: GodGamer029 +Date: Sun Aug 25 16:31:13 2019 +0200 + + Added more AirSwim effects + +commit bb4a8f3e6bd86bc8f86a5fe13f1f8aa88fdb7ba7 +Author: SwiftHD +Date: Sat Aug 24 01:11:12 2019 +0100 + + Added checks for friends and valid entities in Triggerbot (#40) + + and SwiftHD gets a medal for extra effort + +commit f83899b9cd15a62cbf343d3d905945e30579cdb3 +Author: GodGamer029 +Date: Fri Aug 23 22:58:48 2019 +0200 + + test + +commit 0524e29e155bee23373ace44cedec47b064d8486 +Author: erwan celanie +Date: Fri Aug 23 11:35:15 2019 -0400 + + variable name + +commit 29471d3e3cff9bde8bb8c09c5678deb148c30cd2 +Author: GodGamer029 +Date: Fri Aug 23 15:37:41 2019 +0200 + + remove 'idk' + +commit 43515db7035f71f6f52002f5e42ca3c4b53f75c6 +Author: GodGamer029 +Date: Fri Aug 23 15:31:38 2019 +0200 + + Remove 'oof' + +commit 4fd65ca8a2c01d5a5956fad489660ad29ae8db1c +Author: GodGamer029 +Date: Fri Aug 23 15:29:39 2019 +0200 + + Remove 'yeet' + +commit c66ce5630ca23ef9db68f91e8edc8bcf374aab65 +Author: GodGamer029 +Date: Fri Aug 23 15:23:48 2019 +0200 + + Remove 'boi' + +commit a2a1572558d3cadbba8c7aa48bf75dc04014f8ae +Author: GodSoft029 +Date: Fri Aug 23 15:12:47 2019 +0200 + + yeess + +commit 76ad36c8144c32627c2781474456381e8f2958ea +Author: GodSoft029 +Date: Fri Aug 23 15:12:12 2019 +0200 + + Update README.md + +commit f66383828074bf9a9e65b7a02a75672bc38fc590 +Author: GodGamer029 +Date: Fri Aug 23 14:41:49 2019 +0200 + + fix warning (https://github.com/SurvirvorHRG/Horion/commit/01affee524aa537a404b4e786b217d1392a5942f#r34808909) + +commit fd6762dcf7852c1a0280041da850ec66cd3bb1ff +Merge: 01affee 4c7b799 +Author: GodGamer029 +Date: Fri Aug 23 14:36:04 2019 +0200 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit 01affee524aa537a404b4e786b217d1392a5942f +Author: GodGamer029 +Date: Fri Aug 23 14:36:02 2019 +0200 + + Fix some bad code + +commit f8df580021802064393aefd40edf35dec60aa38f +Author: GodGamer029 +Date: Fri Aug 23 14:35:02 2019 +0200 + + Fix error message: 'byte' ambigous symbol + +commit 4c7b7997b36df6008a96a3f586a7b86e4dfe6912 +Author: erwan celanie +Date: Thu Aug 22 23:58:08 2019 -0400 + + Improvements + +commit 4e20a0252ddc14c82135708b3665830ba30a9c0f +Author: erwan celanie +Date: Wed Aug 21 18:04:44 2019 -0400 + + watermark to bottom right + +commit 532af874266c7f85db6db6c14e0d6eba91412a57 +Author: erwan celanie +Date: Wed Aug 21 17:05:36 2019 -0400 + + some correction + +commit 65f785d6690b5e98238dd5e00d51566ca3b8dea0 +Merge: de86df9 39d880f +Author: erwan celanie +Date: Wed Aug 21 16:48:14 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit de86df9ef5b30a12f822e050e1cacb000cac0ec3 +Author: erwan celanie +Date: Wed Aug 21 16:47:52 2019 -0400 + + Rtti at compiling time + +commit 39d880fe8b8a146c5a98f3bd642bce4f3eb538f7 +Merge: a73e6fe 3578e64 +Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> +Date: Wed Aug 21 14:51:37 2019 -0400 + + Merge pull request #33 from richardletshacks/master + + Update Readme + +commit 3578e64ca0d48e28d2b3d797717929ce92560dca +Author: Richard +Date: Wed Aug 21 20:48:00 2019 +0200 + + woops + +commit 8c2c93e654ab652aa71191263ea84343057cf82c +Author: Richard +Date: Wed Aug 21 20:47:42 2019 +0200 + + Make ReadMe better + +commit a73e6fec4b3913969749bc3a9ac46024239e4d5b +Author: GodSoft029 +Date: Wed Aug 21 17:54:37 2019 +0200 + + say sike right now + +commit 449f8294adcbed2ad0a7fcae27e6fdcb30fc6c99 +Author: GodSoft029 +Date: Wed Aug 21 17:53:57 2019 +0200 + + Update README.md + +commit 67261904025e901eb74637d1e5616e17d346fd23 +Author: erwan celanie +Date: Wed Aug 21 00:06:39 2019 -0400 + + same for setoffhand + +commit 5b6ad895f304922323838559bfe7dd577adf345f +Author: erwan celanie +Date: Mon Aug 19 16:33:16 2019 -0400 + + itemId & name + +commit caf26e27a60b5f74cabad5b5f73812d4113c299c +Author: erwan celanie +Date: Mon Aug 19 12:25:24 2019 -0400 + + BlockReach + +commit 225fc72f47e56384e99d3ca1854f671b54857a1a +Author: erwan celanie +Date: Mon Aug 19 01:27:31 2019 -0400 + + .enchant all + +commit 6dcdc0d2bed6461c42ee488b66dfc8eca755e47d +Author: erwan celanie +Date: Mon Aug 19 01:21:12 2019 -0400 + + FastEat disabled when turned off + +commit 2a7ad81fe4698bd3329e27121e1ad77e1258fa40 +Author: erwan celanie +Date: Mon Aug 19 01:05:22 2019 -0400 + + correction + +commit f7febb3ad0deeaa5d2c981db95351096cdb3d039 +Author: erwan celanie +Date: Mon Aug 19 00:59:01 2019 -0400 + + Improved setOffhand/give + +commit 54e08ba3ad75db406eb70fc4c4a760aa4709e51a +Author: GodGamer029 +Date: Sun Aug 18 19:28:14 2019 +0200 + + actual ItemStack size + +commit b66e00e44e894d08de870dc6b2dd083afb062447 +Author: GodGamer029 +Date: Sun Aug 18 15:13:09 2019 +0200 + + why the fuck was release build using build tools for vs2017 + +commit cb71229025ce9b3737308c287ecc5d8ea592dd17 +Author: GodGamer029 +Date: Sun Aug 18 15:11:53 2019 +0200 + + 200iq exception handling + +commit 1a47581e647cdcd4c2d239ec5bf23c751ac9f023 +Author: GodGamer029 +Date: Sun Aug 18 15:07:19 2019 +0200 + + Use a big ass try-except statement to avoid crashes + +commit 6dba00a14ba7e4bebd8d14809cc39089024ff9eb +Author: GodGamer029 +Date: Sun Aug 18 14:48:24 2019 +0200 + + Set delay back to 2 minutes + +commit 5245ab360f0e90edd195d0af4cdb06a1525a251e +Author: GodGamer029 +Date: Sun Aug 18 14:47:59 2019 +0200 + + Replace 'Sleep' in analytics thread + +commit 317a1d99ff813af7c4250cbefa748af2cc3c2f16 +Author: erwan celanie +Date: Sat Aug 17 15:48:05 2019 -0400 + + added delay & other things + +commit cf3862ed893482fc164ad6247144384a64d1675b +Author: erwan celanie +Date: Sat Aug 17 14:36:56 2019 -0400 + + Correction + +commit dbf6a0bc8d7e600e34037124a130f778eedc799a +Author: erwan celanie +Date: Sat Aug 17 14:36:02 2019 -0400 + + cvorr + +commit 6d8160edbca49ac6f1b7fa73e5998db2ca75f79a +Author: erwan celanie +Date: Sat Aug 17 14:20:42 2019 -0400 + + update is ready + +commit 6f30373079ffe80f6330fc97b8c9b8e8b0cb79b2 +Author: erwan celanie +Date: Sat Aug 17 14:18:43 2019 -0400 + + Hides all Horion text while client is hidden + +commit 6af7e5e89d95443de15016b88a46acb65ed41c11 +Author: erwan celanie +Date: Sat Aug 17 14:07:45 2019 -0400 + + improvements + +commit c405b9d807881104c0bde146b20ca73f8f067c6d +Author: erwan celanie +Date: Sat Aug 17 13:34:06 2019 -0400 + + .enchant all + +commit ee8221fb2ebe871416a0d6b8b9223bea02f5a92c +Author: erwan celanie +Date: Sat Aug 17 13:30:22 2019 -0400 + + WIP autoarmor + +commit 991d16c5f2df15cdfc2abb8507d37228107feea6 +Author: GodGamer029 +Date: Fri Aug 16 16:04:00 2019 +0200 + + making sure this works + +commit 1140f6176b9ea3f3016713c818dbd688c19e7d23 +Author: GodGamer029 +Date: Fri Aug 16 15:58:18 2019 +0200 + + analytics + +commit e9b9807b1035ad6f335455a72df7d1f8dd330ad6 +Merge: af6d07b 3f385aa +Author: Rateek +Date: Fri Aug 16 04:50:31 2019 +0200 + + Merge branch 'master' of https://github.com/SurvirvorHRG/Horion + +commit af6d07b118b20f042344bbbc7065aa93b95f6a89 +Author: Rateek +Date: Fri Aug 16 04:50:20 2019 +0200 + + fix + +commit 3f385aaad1c3b3cda8cb85e04a97dc09caecda07 +Author: erwan celanie +Date: Thu Aug 15 22:43:19 2019 -0400 + + json update + +commit 5ad6490daa310ebd9b0fa17e54936d8600ff1bff +Author: erwan celanie +Date: Thu Aug 15 20:08:13 2019 -0400 + + hot fix + +commit b732beee4af31a57f651a66d57ef1cb934ced2b6 +Author: erwan celanie +Date: Thu Aug 15 18:49:56 2019 -0400 + + started working on autoarmor + +commit e44d73635c4c105af946222500dd3ba2eae829ea +Author: erwan celanie +Date: Thu Aug 15 13:01:49 2019 -0400 + + yeet + +commit bf92b8d168296878ff0e00db9c29327b66fc742f +Author: erwan celanie +Date: Thu Aug 15 11:41:44 2019 -0400 + + RakNetInstance + +commit b217102422b1258387ffd85ed4f8193374667f7c +Author: erwan celanie +Date: Mon Aug 12 23:48:07 2019 -0400 + + Improvements + +commit 7ea73848b0d051ecee8a341032f76d5b4411906f +Author: GodGamer029 +Date: Mon Aug 12 17:09:17 2019 +0200 + + Implement .say + +commit c7530002fc35cc1af363312574be879d41abca3d +Author: GodGamer029 +Date: Mon Aug 12 16:58:40 2019 +0200 + + reverse engineered TextPacket + +commit 99c605dce0ac1349236c2f121db9e56884f01a6d +Author: GodGamer029 +Date: Mon Aug 12 16:08:52 2019 +0200 + + Start work on .say and enhance jesus + +commit 58438bc5b14ca7fed8319a9c2e584873e174edc4 +Author: GodGamer029 +Date: Mon Aug 12 15:05:59 2019 +0200 + + Fix some warnings + +commit 47f4f8214e81948ca4d729a152ae11262866fb1b +Author: GodGamer029 +Date: Mon Aug 12 14:52:51 2019 +0200 + + fix warning + +commit 035e70bfd684010718a82cb9cbc04294ab4ce299 +Author: GodGamer029 +Date: Mon Aug 12 14:23:28 2019 +0200 + + Add .coords command + +commit 62d98f675b6ab36e9e198da3c707f29a042604ad +Author: GodGamer029 +Date: Mon Aug 12 14:13:30 2019 +0200 + + Add trash jesus and fix some bugs in the memory leak fix + +commit 90a1c323ff06b141db2444e0f996ef34b392608e +Author: erwan celanie +Date: Sat Aug 10 18:19:46 2019 -0400 + + fix more memory leaks + +commit 17240bdf51b5f8f9fca618d6174557ca854534df +Author: erwan celanie +Date: Sat Aug 10 02:20:29 2019 -0400 + + Fix Memory Leak Part 1 + +commit 7d4ec4395cace59d59ba23443f2886810355b77a +Author: AnimeThighss <50558821+AnimeThighss@users.noreply.github.com> +Date: Thu Aug 8 16:50:46 2019 -0600 + + Made it easier to enchant (.enchant) + + Now goes into your offhand once you enchant. + +commit d85b0e50e3060c621086fc90a30a11364ef6c8e9 +Author: AnimeThighss <50558821+AnimeThighss@users.noreply.github.com> +Date: Tue Aug 6 15:32:06 2019 -0600 + + added setoffhandcommand + + hi im new person pls love me + +commit 7fda51714579a6f0f2ca2963a825ea26b53bb381 +Author: erwan celanie +Date: Mon Aug 5 16:05:42 2019 -0400 + + remove + +commit b960b0a20ca3fb1767f78653a7b74b838533fe88 +Author: erwan celanie +Date: Mon Aug 5 15:57:54 2019 -0400 + + .nbt (no) LMFAO + +commit 88fb1d0b08e815e31e720f4e3cef40e655fa7af7 +Author: erwan celanie +Date: Mon Aug 5 15:50:37 2019 -0400 + + Improvements + +commit 261644eec1b0159e70e01b3cdfadb9789b6d1962 +Author: GodSoft029 +Date: Mon Aug 5 18:32:37 2019 +0200 + + bruh + +commit 9e972a5b89cf1f7c5bce0fbd905669a3cfa2cf5a +Author: GodSoft029 +Date: Mon Aug 5 18:31:21 2019 +0200 + + Update CommandMgr.h + +commit fc61c7fc89a1ee10fad4ca42336fb700fa02ac9f +Author: GodSoft029 +Date: Mon Aug 5 18:30:19 2019 +0200 + + Create BruhCommand.cpp + +commit 01df63d7453f87d79c3394f6d49b2275564ba57f +Author: GodSoft029 +Date: Mon Aug 5 18:24:08 2019 +0200 + + Create BruhCommand.h + + web editor sucks + +commit 8e6978d75da4692bd03c76351a2dc5b4ac92ab73 +Author: erwan celanie +Date: Sat Aug 3 15:35:23 2019 -0400 + + clean up + +commit 34706295c191ce9f37d3726d43f0b556c4cc4c30 +Author: erwan celanie +Date: Sat Aug 3 14:45:23 2019 -0400 + + .give + +commit a9c3df334efecc5591b52d29cd806d6eaf74c1d6 +Author: erwan celanie +Date: Thu Aug 1 19:35:18 2019 -0400 + + FastEat + +commit ef807efdf1b7b547374d63d2e5063cd1adc73344 +Author: erwan celanie +Date: Thu Aug 1 12:41:36 2019 -0400 + + revert + +commit 8f91b083e9e68f18f318e14741bfa76890151821 +Author: erwan celanie +Date: Thu Aug 1 12:09:18 2019 -0400 + + github test + +commit 981acbb705483169162a4b27c9c90104be1bd006 +Author: erwan celanie +Date: Thu Aug 1 09:23:15 2019 -0400 + + i like visual 2019 + +commit 3d381521f1b262645cffe7799eb2be143c33de9e +Author: GodSoft029 +Date: Thu Aug 1 11:14:50 2019 +0200 + + Use discord invite as watermark + +commit 87e148dbe644bd060710110b37c3e5113aa7ae45 +Author: Rateek +Date: Wed Jul 31 07:56:37 2019 +0200 + + Add AutoSneak + +commit fc9295c558aef8b38c1da10c732908e1d8ee6873 +Author: erwan celanie +Date: Tue Jul 30 17:46:33 2019 -0400 + + Player Category + +commit c12827a7c4a6a1f9eb613481bf33fbd8d01bf68d +Author: erwan celanie +Date: Tue Jul 30 12:43:49 2019 -0400 + + stackable item + +commit 353cee2597314a8b182c8e365726d8d91788240c +Author: erwan celanie +Date: Tue Jul 30 00:28:54 2019 -0400 + + clean + +commit 3d2da2a66d63ca7477b1e29ebe43156a53e6ea6a +Author: erwan celanie +Date: Tue Jul 30 00:23:37 2019 -0400 + + yeet + +commit b2d694ad496fc5ae1f12ef1485b1e72a4d744a1e +Author: erwan celanie +Date: Thu Jul 18 23:50:15 2019 -0400 + + Fix InventoryMove + +commit 60872f6c21ef775d3ed9eaeb66f99c18ac411a8d +Author: erwan celanie +Date: Thu Jul 18 18:40:07 2019 -0400 + + added delay for triggerbot & killaura + +commit b6e79b27c4e784e4b49c6acba2e362269f8ad9a7 +Author: erwan celanie +Date: Thu Jul 18 18:27:48 2019 -0400 + + added settings to NoKnockBack + +commit 804d6f029d3ea3fb00d16ccf3591578eb3593a30 +Author: godgamer029 +Date: Thu Jul 18 21:37:12 2019 +0200 + + Refactor Command & add http + +commit 032f344df3b1fd9762e98beb327492c494b346dd +Author: erwan celanie +Date: Thu Jul 18 12:30:37 2019 -0400 + + fix 3 + +commit a8298b743a5119cc34a8050b4b494a13218941a6 +Author: erwan celanie +Date: Thu Jul 18 12:28:39 2019 -0400 + + added settings to aimbot + +commit 43ae31b4e7e5a6423388b4c79339315790178fc4 +Author: erwan celanie +Date: Thu Jul 18 12:10:45 2019 -0400 + + second fix + +commit 9cba0b2b13462319d943a4193175507b5a48b303 +Author: erwan celanie +Date: Thu Jul 18 02:52:46 2019 -0400 + + fix + +commit 48a9f277a9b29eeefd1a318c6a6df11fb899afa6 +Author: erwan celanie +Date: Thu Jul 18 02:48:16 2019 -0400 + + NoWeb & FastLadder + +commit a3ef07f5f8f7faafeb2d74712135f129ff46a0cf +Author: erwan celanie +Date: Thu Jul 18 01:23:41 2019 -0400 + + settings saved when game closed + +commit ec41ba9c76b5388b2640f83ae2e22b6ca5e3bf85 +Author: erwan celanie +Date: Wed Jul 17 00:54:09 2019 -0400 + + HighJump + +commit 282d18dafe882da91242b2acf90937f325036def +Author: erwan celanie +Date: Tue Jul 16 22:30:15 2019 -0400 + + more improvements + +commit 610b99b2062a6d537c8a9524be15519cc92bafd2 +Author: erwan celanie +Date: Tue Jul 16 22:18:30 2019 -0400 + + good inventory walk + +commit abd779653fe4cbfd156cb3f90176d8ba210cf40a +Author: erwan celanie +Date: Tue Jul 16 20:06:50 2019 -0400 + + added settings to speed + +commit 26d0c153e3046c649420d36dbc0f12a62196fb48 +Author: erwan celanie +Date: Tue Jul 16 13:48:48 2019 -0400 + + working inventoryMove + +commit 9b48ab77439245d4fe4a1bd1249eabd6bd6b8650 +Author: erwan celanie +Date: Tue Jul 16 01:34:49 2019 -0400 + + started working InventoryWalk + +commit 17ba13885459a69a7a847a061f594f3cc2b9f874 +Author: erwan celanie +Date: Sun Jul 14 05:19:08 2019 -0400 + + AirSwim + +commit e7410bfca883baca6b67f08f2fd33dade022ce5e +Author: godgamer029 +Date: Sat Jul 13 23:03:11 2019 +0200 + + 2 decimal places in clickgui + +commit 5405535f57b49670cb58ba57a808677f6724bef3 +Author: godgamer029 +Date: Sat Jul 13 23:02:30 2019 +0200 + + Add glide value setting + +commit 4ad4933bfbee82e8eb19ecfff3da9932aa791491 +Author: godgamer029 +Date: Sat Jul 13 22:45:37 2019 +0200 + + add debugging for other components as well + +commit 440bb883cf9c8302729de1a29c889540f38cd470 +Author: godgamer029 +Date: Sat Jul 13 22:42:21 2019 +0200 + + Fix CheckBox Bug + +commit c5af0fccc397b6be572b3e0c3b59375cf17a4338 +Author: erwan celanie +Date: Sat Jul 13 02:11:22 2019 -0400 + + FullBright & watermark + +commit 47b732d23b6f2d1d344396b53a22567bc5e1e34e +Author: erwan celanie +Date: Fri Jul 12 18:57:22 2019 -0400 + + fix bowAimbot + +commit 427bf8a1c254b9a7bbf6cf5ec63d00f0a2f6c2e4 +Author: godgamer029 +Date: Fri Jul 12 19:14:00 2019 +0200 + + Add watermark + +commit e0ab230f49974a2106040013fbc9997d2befc6b5 +Author: erwan celanie +Date: Fri Jul 12 12:48:12 2019 -0400 + + fixed reach + +commit 9da084491fd12a95999d116a9702b0c4a4aa8a7f +Author: erwan celanie +Date: Fri Jul 12 12:14:10 2019 -0400 + + reach + +commit be1d689090a2d4b76f5d7bc4221af8a08b873aed +Author: erwan celanie +Date: Fri Jul 12 04:09:03 2019 -0400 + + hitbox check + +commit de85845f82b87ed6d5570a157c0762d3e1e33173 +Author: erwan celanie +Date: Fri Jul 12 03:50:04 2019 -0400 + + hitbox + +commit f4a8d845878b4a21d769c51656df41f96e30c8d4 +Author: erwan celanie +Date: Fri Jul 12 03:14:43 2019 -0400 + + MobAura and MobEsp + +commit 60277e510a1ffedd8be10f1e10a58ff97f84e767 +Author: erwan celanie +Date: Fri Jul 12 02:09:22 2019 -0400 + + fix autototem + clean + +commit 5bbe07bb60a376995c1e86f23a1e762fc2029376 +Author: godgamer029 +Date: Thu Jul 11 19:35:15 2019 +0200 + + remove debug + +commit f347f8d46ad6cc459857306d65dcb1a33bb88503 +Author: godgamer029 +Date: Thu Jul 11 19:34:53 2019 +0200 + + fix chest stealer + +commit afd605ffb3195e43c50d889f287aa97272db5815 +Merge: 7e69679 5cbe280 +Author: erwan celanie +Date: Thu Jul 11 13:04:47 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 7e69679be48bb2c434b20c818ae6d08e6ff6cfa3 +Author: erwan celanie +Date: Thu Jul 11 13:03:52 2019 -0400 + + fix ChestStealer + +commit 5cbe28057271b20455b2e8300f0c2e138bee984e +Author: godgamer029 +Date: Thu Jul 11 18:30:01 2019 +0200 + + fix gamemode + +commit 3d1875b7b434fbd0ef0fd068cf0343d3fd90a354 +Author: godgamer029 +Date: Thu Jul 11 18:19:46 2019 +0200 + + fix enchant command + +commit b4f9e21d9d7d06040fb1303f4b07ab09495012c5 +Author: godgamer029 +Date: Thu Jul 11 17:35:37 2019 +0200 + + Fix nuker n stuff + +commit 80cf7ad94a4fe0931eaa552c69da190376ac37b2 +Author: godgamer029 +Date: Thu Jul 11 17:25:23 2019 +0200 + + Fix scaffold + +commit 4c6b3303670b5e4cd2205dbce42c907c563bb028 +Author: godgamer029 +Date: Thu Jul 11 17:03:47 2019 +0200 + + Fix autosprint & NoKnockback + +commit db87449801666ab084b5dd054530a7c80c2d8c34 +Author: godgamer029 +Date: Thu Jul 11 16:50:09 2019 +0200 + + fix bowaimbot + +commit 36298068845b28e7a10028d0161abb108282aad0 +Author: godgamer029 +Date: Thu Jul 11 16:32:23 2019 +0200 + + fix triggerbot + +commit a898f0e7b81208569db3eed931f42a65f2797853 +Author: godgamer029 +Date: Thu Jul 11 16:21:53 2019 +0200 + + Clickgui fix a la richardus + +commit a220d364cbf76e9fa52e04e8d036298cccdf559a +Author: godgamer029 +Date: Thu Jul 11 16:13:35 2019 +0200 + + ClientInstanceFix + +commit a21ecc776ece9ad91d942720eedfd4436eebc82a +Author: godgamer029 +Date: Thu Jul 11 16:00:05 2019 +0200 + + fix getRenderLayer + +commit 4120a0eece8024b70aa86f58c5d05d50fc3eda03 +Author: godgamer029 +Date: Thu Jul 11 15:45:00 2019 +0200 + + remove debug + +commit ba1188ee44f09915c30275af377ff96aa57eb5af +Author: godgamer029 +Date: Thu Jul 11 15:44:35 2019 +0200 + + Actually fix vtables + +commit e138dcd57db74f7275442b286f32a95469797d58 +Author: godgamer029 +Date: Thu Jul 11 12:23:23 2019 +0200 + + update vtable + +commit f5b69bdd35e26f9cdfebdb0f849688a4d66d4ae7 +Author: godgamer029 +Date: Wed Jul 10 19:34:21 2019 +0200 + + remove some ghetto + +commit 72041a8470d130228267005ac0371fa7ce9985bf +Author: godgamer029 +Date: Wed Jul 10 19:30:52 2019 +0200 + + fix ESP + +commit e181bff135a746c5f32245433f6c2a1b9c47b93b +Author: godgamer029 +Date: Wed Jul 10 18:15:17 2019 +0200 + + fix player struct + +commit 95e94fccbcc8af77cfad0a19c5500a53538672cf +Author: godgamer029 +Date: Wed Jul 10 16:19:26 2019 +0200 + + fix can use keys + +commit 4ba58e73d7a452ceb5466efefd7ac0ff26972bed +Author: godgamer029 +Date: Wed Jul 10 16:06:33 2019 +0200 + + fix command autocomplete + +commit 68e4b3acb5fe25ff4430eeec391285b9469e64da +Author: godgamer029 +Date: Wed Jul 10 15:53:39 2019 +0200 + + Fix chat commands + +commit a1322d379824adb111065a958fae8e505bcc1511 +Author: godgamer029 +Date: Wed Jul 10 15:08:49 2019 +0200 + + proper sig + +commit 90b09d92f0e78bebcffc5e7b2189c19b8021b33c +Author: godgamer029 +Date: Wed Jul 10 15:00:26 2019 +0200 + + fix click gui + +commit 40eeacbc4401fb146a8cc684c258569a598a3964 +Author: erwan celanie +Date: Wed Jul 10 02:07:05 2019 -0400 + + fixed MousePos + +commit 33e5f860747bb1fc011a5592013b38adb289d05b +Author: erwan celanie +Date: Wed Jul 10 01:48:46 2019 -0400 + + Fixed sigs + +commit 05153c5d100959d0037f2f9ca6e0d7ff85501075 +Author: godgamer029 +Date: Tue Jul 9 21:24:17 2019 +0200 + + WIP + +commit 579031d218391e5d943bb83fbcec90d0c0203076 +Author: godgamer029 +Date: Tue Jul 9 20:53:29 2019 +0200 + + hi i liek minecrafp + +commit 230514f31e1ae36f2816414304670fcf359ad830 +Merge: 081e77a d9c2f5b +Author: godgamer029 +Date: Tue Jul 9 18:35:22 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 081e77a28e2db81ae7c3a68bd06a2b8e27004458 +Author: godgamer029 +Date: Tue Jul 9 18:35:16 2019 +0200 + + inject doesnt crash anymoire + +commit d9c2f5bb274f886abac1ff34269bfb535d8f4dad +Author: erwan celanie +Date: Sun Jul 7 11:55:36 2019 -0400 + + Hide + +commit 46ceac90254408b4971afb455915dd0dd0b88199 +Author: erwan celanie +Date: Sun Jul 7 02:36:38 2019 -0400 + + yikes + +commit a661d4e609883b5aeda5317a75a64aaca040f2b1 +Author: erwan celanie +Date: Sun Jul 7 01:56:43 2019 -0400 + + Fly and Bypass + Freecam Improvements + +commit 762012c4aaa64cb73d6471f638e8024fa0e52a94 +Author: godgamer029 +Date: Sat Jul 6 14:40:56 2019 +0200 + + add killaura range setting + +commit 0cdb96f7143de532a1211e6acd2e4105973b6cd9 +Author: godgamer029 +Date: Sat Jul 6 14:29:27 2019 +0200 + + add hbop noslowdown + +commit 79dfd97c6d5e12f715681a4d8a173b5be447be36 +Author: godgamer029 +Date: Sat Jul 6 14:00:42 2019 +0200 + + vein miner + +commit e1606d06c882b1c4efc5e97de047381de5678780 +Author: godgamer029 +Date: Fri Jul 5 20:06:01 2019 +0200 + + Add Multi Aura + +commit a137d40d8b2e41aaa6cd7a1a4c65d6ba0b5ec2b2 +Author: godgamer029 +Date: Fri Jul 5 19:57:39 2019 +0200 + + nice clickgui animations + +commit 611b0252c7f026de8fc4201aab287e8db3dd0e6a +Author: godgamer029 +Date: Fri Jul 5 18:24:19 2019 +0200 + + Addecd Checkboxes to Clickgui + +commit baafeb0fa15a156fcad57dbe92644057cc3272cf +Author: godgamer029 +Date: Fri Jul 5 17:38:38 2019 +0200 + + Add Float Slider and Anti Idiot Code + +commit 008f0bb2fb2da8d98f239d89be645de02d4e487b +Author: godgamer029 +Date: Fri Jul 5 17:27:25 2019 +0200 + + improve nuker performance + +commit 4267eb263150c57dc8a8e50541ebde87723cc4cf +Author: godgamer029 +Date: Fri Jul 5 17:24:23 2019 +0200 + + nice design + +commit 4cf5e68767f4bacb75f1f16ab1e731db7c1c610e +Author: godgamer029 +Date: Fri Jul 5 17:20:39 2019 +0200 + + nice line + +commit fc82d104f76bc4968db2024367e9c99443c1afdb +Author: godgamer029 +Date: Fri Jul 5 16:45:38 2019 +0200 + + remove aids keybind + +commit 548e71eb9b43e765389290bd59fc00c0f2f24947 +Author: godgamer029 +Date: Fri Jul 5 16:42:11 2019 +0200 + + Minor Improvements + +commit c52231fc2dea4ba2d528be6d2bd7e7ad06fb91b2 +Author: godgamer029 +Date: Fri Jul 5 16:30:05 2019 +0200 + + Added Text for current value + +commit dfbffe97b24efef12ea28ff0c6eabf75744a8fac +Author: godgamer029 +Date: Fri Jul 5 16:17:47 2019 +0200 + + Sliders! + +commit 78ccc164dae5c4490d3aab772c2e0ac100bb943d +Author: godgamer029 +Date: Fri Jul 5 15:05:02 2019 +0200 + + add necessary structure for sliders + +commit 8a7c7b918b307bd6d006590a6b59b4b230db1b90 +Author: godgamer029 +Date: Fri Jul 5 13:59:52 2019 +0200 + + Settings yay + +commit b21119c5658f5b01a9bf6998860640991a8342aa +Author: godgamer029 +Date: Fri Jul 5 13:48:23 2019 +0200 + + Refactor window Size + +commit e720428871d52f53fd138100e002eb1159ba0697 +Author: erwan celanie +Date: Tue Jul 2 18:05:39 2019 -0400 + + clean + +commit 8caf151635a46527ea061bdaad79b4c7a757717d +Author: erwan celanie +Date: Tue Jul 2 17:33:03 2019 -0400 + + cheststealer + +commit 1d90d6248d81ee6529045809afa06177b9d6234c +Author: godgamer029 +Date: Mon Jul 1 15:43:16 2019 +0200 + + yeet im outta here + +commit eaf3badc1b054a36f0f5c1087f9d14f15a3efec1 +Author: godgamer029 +Date: Mon Jul 1 14:23:02 2019 +0200 + + E N H A N C E M E N T S + +commit 3e47de59534254932938261c401ef0780c51fdd8 +Author: godgamer029 +Date: Mon Jul 1 13:58:51 2019 +0200 + + preparations + +commit 99d10080da7b854ae84fe2b97d2ff165f3c5dc5f +Author: godgamer029 +Date: Mon Jul 1 13:51:28 2019 +0200 + + start work on settings + +commit 4611ce1e7f2e6dc9e56c59550f320993fd32e488 +Author: godgamer029 +Date: Mon Jul 1 13:45:35 2019 +0200 + + design adjustments + +commit 3a8458d09be3e14cdcbcce219a2e90d3721f435a +Author: godgamer029 +Date: Mon Jul 1 13:38:27 2019 +0200 + + category margin + +commit 3e3ad579c5911b6b9c8d59e8c67600e4c75fdae2 +Author: erwan celanie +Date: Mon Jul 1 01:49:53 2019 -0400 + + fix + +commit 422cc23da56b68fe315940f43e8d93931fc30d98 +Author: erwan celanie +Date: Mon Jul 1 01:34:33 2019 -0400 + + need help + +commit ff646c219cfbb19c197a1f94a7d4b5a08f1ef942 +Author: erwan celanie +Date: Mon Jul 1 01:33:15 2019 -0400 + + please help + +commit dba56b855e991cb24970e5fc71d3a4bd5e9f4d37 +Author: erwan celanie +Date: Fri Jun 28 20:40:54 2019 -0400 + + started settings xd + +commit 8a2ad1823fd8c43f1e8dc1cc913fbc0c658e1596 +Author: erwan celanie +Date: Thu Jun 27 01:39:07 2019 -0400 + + improvements + +commit 2678e2d8fda19f656292ffd8ac6f98a48bc75f4d +Merge: 4b07955 9517ee9 +Author: godgamer029 +Date: Wed Jun 26 20:36:25 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 4b07955115feee3404db10990705707d45d42a65 +Author: godgamer029 +Date: Wed Jun 26 20:36:19 2019 +0200 + + nice + +commit 9517ee931e38172f1f455dfb8c71bba312beb1c2 +Author: erwan celanie +Date: Wed Jun 26 14:21:24 2019 -0400 + + fix + +commit 4f1564631e49911c5efb81cec2a3a5b7ec428aaf +Author: godgamer029 +Date: Wed Jun 26 20:02:01 2019 +0200 + + fix Clicks buggy + +commit 0df1651233fe9553c066c44695c683f38ed4c3f8 +Author: godgamer029 +Date: Wed Jun 26 19:58:38 2019 +0200 + + fix some stuff + +commit 75ce0b6d27077f9867291c886bc2cd04670fba04 +Merge: 34ec8e9 1df8f68 +Author: godgamer029 +Date: Wed Jun 26 19:50:47 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 34ec8e9a2ec996e1dd611e0f92dc57c51177eb94 +Author: godgamer029 +Date: Wed Jun 26 19:50:41 2019 +0200 + + mor cleanup + +commit 1df8f684b364f08ddd61b2dd1cecae60b292b0fa +Merge: 62ad3c7 ab06777 +Author: erwan celanie +Date: Wed Jun 26 13:47:23 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 62ad3c7dd0bc439533499795d2bbe40aaa8b6ff3 +Author: erwan celanie +Date: Wed Jun 26 13:46:51 2019 -0400 + + Click not detected by Minecraft + +commit ab0677748e82e2465579cdac5fbc6972c5e99c9e +Author: godgamer029 +Date: Wed Jun 26 19:15:55 2019 +0200 + + cleanup + +commit ade3db36492a1633a22ec47262cd9f06986f8748 +Author: godgamer029 +Date: Wed Jun 26 19:03:22 2019 +0200 + + revert + +commit ac5b552d171ce4c85d20d6bae9d0489277e98bfd +Author: godgamer029 +Date: Wed Jun 26 19:01:48 2019 +0200 + + sync test + +commit 317966c9271ec28f660edd178ab632c1c920d1e4 +Author: erwan celanie +Date: Mon Jun 24 22:19:53 2019 -0400 + + Visual + +commit 3602a157cd157208df0e7fff2436cedeb331cc76 +Author: godgamer029 +Date: Sun Jun 23 19:13:51 2019 +0200 + + remove ghetto + +commit 909717709e7b55e9c6ea7d8e8a2c20f86f55e364 +Author: godgamer029 +Date: Sun Jun 23 19:11:51 2019 +0200 + + remove logging + +commit 77cc1efae64c38356ebb0d22500b7e6b69e6d48a +Author: godgamer029 +Date: Sun Jun 23 19:11:22 2019 +0200 + + Fixed ClickGuii + +commit 992c3075c0322ce0361b289bfdff59fff18ad383 +Author: godgamer029 +Date: Sun Jun 23 18:21:15 2019 +0200 + + drag fix + +commit 37499dc10b4c141dbb9f575b975bd70dd31d1989 +Author: godgamer029 +Date: Sun Jun 23 18:16:54 2019 +0200 + + Only render in specific screens + +commit 47b3799f716051bae5462b38a620f110f76eadb0 +Author: godgamer029 +Date: Sun Jun 23 16:45:47 2019 +0200 + + draggin work in progress + +commit 15ef03284eca6f09cd344ec0e0c9ec5c9ce45220 +Author: godgamer029 +Date: Sun Jun 23 16:20:00 2019 +0200 + + exposed + +commit 249086f71b8c08912a90884287e7f835f8c72c7e +Author: godgamer029 +Date: Sun Jun 23 16:11:49 2019 +0200 + + Fix Some Stuff + +commit 2bc1f5b554bc607b9f003bf46424a56a8a07488e +Author: godgamer029 +Date: Sun Jun 23 16:00:11 2019 +0200 + + remove debugging + +commit 6184b95fa9b355871ebe4d71354a18ac667e1687 +Author: godgamer029 +Date: Sun Jun 23 15:59:28 2019 +0200 + + clicking works + +commit e3ecb29721d46e5b581ed88025c1a9f97a4a9702 +Author: godgamer029 +Date: Sun Jun 23 15:39:54 2019 +0200 + + Documentation, Clicking is broken + +commit a9cfe0e5e47f3528f5635531fa45470da7d68a68 +Author: godgamer029 +Date: Sun Jun 23 15:32:31 2019 +0200 + + Mouse CLick management + +commit 8ecb068164c50f3cee6263f1915409e7a5de15f4 +Author: godgamer029 +Date: Sun Jun 23 15:00:09 2019 +0200 + + idk + +commit a079ce3b5e9196b0194e58a686389b68a781e7ed +Author: godgamer029 +Date: Sun Jun 23 14:51:51 2019 +0200 + + variable naming + +commit bb194bca55bb9aac611a1b79f20d6f3ef9e9df67 +Author: godgamer029 +Date: Sun Jun 23 14:49:17 2019 +0200 + + moduleList handling + +commit d451dca93bf52184d091c47994152cee0b9ca155 +Author: godgamer029 +Date: Sun Jun 23 14:40:38 2019 +0200 + + readability + +commit fa1213a7e89a5b6b74cc1beeeb2dffa182a0d0fb +Author: godgamer029 +Date: Sun Jun 23 14:35:23 2019 +0200 + + remove unused variable + +commit 09d73e9da78c30ea319fd96b43be08b2fbf0fc66 +Author: godgamer029 +Date: Sun Jun 23 14:33:26 2019 +0200 + + formatting + +commit 77889704b9bc22e52512ac6ebd268d9514323f75 +Author: godgamer029 +Date: Sun Jun 23 14:28:56 2019 +0200 + + Formatting + +commit c1e9fa7afc080bfe2d594b03dec13f9483f9fd66 +Author: godgamer029 +Date: Sun Jun 23 14:26:22 2019 +0200 + + Adjustments to bind command + +commit 1c7b488ecfdf8108a9d9caea82c6b9ed1b7d49c8 +Author: erwan celanie +Date: Sun Jun 23 00:57:41 2019 -0400 + + Improvements + +commit 91f85f7a863276c623f0ac5eaca8df09977cbc70 +Author: erwan celanie +Date: Sun Jun 23 00:25:12 2019 -0400 + + Category + Crossline + +commit 0452e5ba62dee8749907860ace9565083b735f62 +Author: erwan celanie +Date: Fri Jun 21 17:37:54 2019 -0400 + + dank ClickGui + +commit 396a38359cbc60696d42f83781222f8edc3041ef +Author: erwan celanie +Date: Tue Jun 18 02:24:06 2019 -0400 + + autoTotem + +commit 5d154ef9c8bfbc9f293192973769da51d3f39b69 +Author: godgamer029 +Date: Sun Jun 16 11:12:15 2019 +0200 + + gui improvements + +commit e6d15d79b7416102c225e83ec3f9053000dd5617 +Author: godgamer029 +Date: Sun Jun 16 11:07:52 2019 +0200 + + Improvement + +commit 9e350f2c8596d297d8049f419d94281bd1e406e5 +Author: erwan celanie +Date: Fri Jun 14 14:09:34 2019 -0400 + + more improvements + +commit 2e1ac0a2deb9ba924298dfb1ea73cd35cb499cec +Author: erwan celanie +Date: Tue Jun 11 23:43:16 2019 -0400 + + Improvements + +commit c726b18753134e2a865aad0bb964a8262076fda1 +Author: erwan celanie +Date: Tue Jun 11 22:33:55 2019 -0400 + + NoSlowDown + +commit 8a56dda0d5d1e3e2743e68af752c808b66d1a504 +Author: godgamer029 +Date: Tue Jun 11 15:43:52 2019 +0200 + + Design changes + +commit af4fc09cb2a6eb783149df9b677f0622b7889dfc +Author: godgamer029 +Date: Tue Jun 11 12:17:47 2019 +0200 + + Unbind all + +commit af5d84d7e6871c329765fdb65c47a0f3ac9dd68c +Author: godgamer029 +Date: Tue Jun 11 12:08:14 2019 +0200 + + Add Panic Command + +commit 16c41832d5cb0c39f9531ca18bb096dbb5587d26 +Author: godgamer029 +Date: Tue Jun 11 12:04:42 2019 +0200 + + Add Modules Command + +commit 975e9a13c501eba1e10fb738ac423c7b0d49bcea +Author: godgamer029 +Date: Tue Jun 11 11:59:10 2019 +0200 + + Add Help Command + +commit b66694a9ef518cbdee8451a9af10d5a82c92f0d4 +Author: godgamer029 +Date: Tue Jun 11 10:39:29 2019 +0200 + + Add Enchant Command + +commit 5c63884a5bef718d315023bb6aa32cf17d578c08 +Author: godgamer029 +Date: Tue Jun 11 10:22:36 2019 +0200 + + Nuker Size adjustment + +commit 5e731a08446512a4a28cb3ee0c58aafb1a2615c6 +Author: godgamer029 +Date: Tue Jun 11 10:02:10 2019 +0200 + + formatting + +commit 0fc470a49fdd890784b1408d7e2af94ca480b7b8 +Author: godgamer029 +Date: Tue Jun 11 09:54:17 2019 +0200 + + Improve Compiel Performance + +commit 7734f0765015f29795fb00b3528128ae0054cdef +Author: godgamer029 +Date: Tue Jun 11 09:46:33 2019 +0200 + + Improve Utils::FIndSignature performance + +commit caaa1e52d020acc9456d41ed9f5613e9b273d466 +Author: godgamer029 +Date: Tue Jun 11 09:40:48 2019 +0200 + + Removed unused code + +commit 81156ca11a960ab3fe1c2217334173b0f21031d9 +Author: godgamer029 +Date: Tue Jun 11 09:36:35 2019 +0200 + + Improve Compile Times + +commit 2ac24948f40662bc8922aa42f3f479cc7ef14e4c +Author: godgamer029 +Date: Tue Jun 11 09:23:40 2019 +0200 + + Disable Keybinds in main menu + +commit 7f31e2af662f72b5dccc37cd9ccca421c7a19b9d +Author: godgamer029 +Date: Mon Jun 10 17:39:52 2019 +0200 + + quick fix + +commit 3cd95dfeabfa6a732e39419050d1d31f51594217 +Author: erwan celanie +Date: Mon Jun 10 11:37:41 2019 -0400 + + fix + +commit 3f1205b1630be6a91c5ce21e6f4c6dc2d1aca492 +Author: erwan celanie +Date: Mon Jun 10 11:36:11 2019 -0400 + + UnbindCommand + +commit 130e19afbcf1475e850add6fb89ae5b6a2922a28 +Author: godgamer029 +Date: Mon Jun 10 14:17:27 2019 +0200 + + tests + +commit 98ed5a0f6faae711934efb84f742f093b538f494 +Author: godgamer029 +Date: Mon Jun 10 13:58:24 2019 +0200 + + ClientInstance sdk added + +commit 9707cacd3e7834a8591150f20514f37f37706d38 +Author: godgamer029 +Date: Mon Jun 10 13:17:57 2019 +0200 + + Tweak design of tabgui and Horion logo + +commit f54e45aa3864a83d440b31d4b1feb71bb7fd62db +Merge: a3b281e 7f4700a +Author: godgamer029 +Date: Mon Jun 10 12:24:06 2019 +0200 + + merge + +commit a3b281e6ab27411167a8dfd403545897f3d9e378 +Author: godgamer029 +Date: Mon Jun 10 12:22:30 2019 +0200 + + Reload chunks when xray is toggled + +commit 7f4700afad5fed3d6ac27707423c95d645d100f9 +Merge: d678e40 e992cd4 +Author: erwan celanie +Date: Sun Jun 9 15:35:45 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit d678e404c4ea0f7541b83794b9a0f28a2863084c +Author: erwan celanie +Date: Sun Jun 9 15:35:27 2019 -0400 + + nice xray + +commit e992cd491ea86b464fd4fc7c6518c57efcc15159 +Author: godgamer029 +Date: Sun Jun 9 17:34:32 2019 +0200 + + SDK + +commit 1ff50e51544dae814e2d5ca02f3ca01daaa77e61 +Author: godgamer029 +Date: Sun Jun 9 14:37:49 2019 +0200 + + yeet + +commit 2901015f09e95a79a1f23b617c4895689321db5b +Author: godgamer029 +Date: Sun Jun 9 14:12:05 2019 +0200 + + Exclude MobESP/Aura + +commit 69b6c6bb30033c557e88da8442de8341e210f462 +Merge: 883fd2d 3f5a139 +Author: godgamer029 +Date: Sun Jun 9 12:58:30 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 883fd2dc2b36254929ebdc6fbfa50615e3520907 +Author: godgamer029 +Date: Sun Jun 9 12:58:23 2019 +0200 + + Add Entity::isInWater and Entity::isInLava + +commit 0e299dd1ab5dc6ab8db7473323c911c3cb844154 +Author: godgamer029 +Date: Sun Jun 9 12:24:27 2019 +0200 + + Clarification + +commit 3f5a139fb80dcb22b305cd9c6e8f99954a4a2b2e +Author: erwan celanie +Date: Sat Jun 8 23:45:45 2019 -0400 + + fix 2 + +commit 94f0c0c5bc1c62a5a21a3d8056eab0e1e2e3ea99 +Author: erwan celanie +Date: Sat Jun 8 23:39:07 2019 -0400 + + fix + +commit 30919c56b3b3040eb5fc746edaa2ef944c40cd27 +Author: erwan celanie +Date: Sat Jun 8 23:23:21 2019 -0400 + + I like MobEsp and MobAura + +commit 55ea2f3630b8220c1fa6d8a0b87bea06686381d5 +Author: godgamer029 +Date: Sat Jun 8 23:15:58 2019 +0200 + + idk y u no work + +commit fd8431f559c1c174698e425e9c213e886143dda4 +Author: godgamer029 +Date: Sat Jun 8 22:47:43 2019 +0200 + + Test Command enchants + +commit bc6ba9694c5907859c9dae1578242200d6d89e88 +Author: godgamer029 +Date: Sat Jun 8 21:06:27 2019 +0200 + + PlayerInventory & TestCommand + +commit b253c2bc6e2e7bc4976d411efab2bfcc551ce475 +Author: godgamer029 +Date: Sat Jun 8 20:20:02 2019 +0200 + + Add test command for debugging + +commit 895bd1130dcd261c88e8b1e62c891cd86bd09ad3 +Author: godgamer029 +Date: Sat Jun 8 16:50:51 2019 +0200 + + Target and Callbacks + +commit 5e954e6f67a407b6374927a576ba1feeab0648e5 +Merge: 0dfeeed 56777c3 +Author: godgamer029 +Date: Sat Jun 8 16:12:03 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 0dfeeedcf3314f9de64b280868afb101e779a0a3 +Author: godgamer029 +Date: Sat Jun 8 16:11:56 2019 +0200 + + New entity list + +commit 56777c3b796bf93b05efc1ca9e53590540ab880e +Author: Kevin Fischer +Date: Sat Jun 8 14:10:13 2019 +0200 + + added cake and dragonegg to bedfucker + +commit 328b3d361f0d896fa42c6a5c6def7f333508b4f5 +Author: godgamer029 +Date: Sat Jun 8 14:03:15 2019 +0200 + + even more improvements + +commit fd23d6302db9045b7755b80f648b58b8dcefef3e +Author: godgamer029 +Date: Sat Jun 8 14:02:02 2019 +0200 + + improvements in Killaura + +commit f5b5168a8b33c67c5418b3deaabd40293c1d6ac9 +Author: godgamer029 +Date: Sat Jun 8 13:49:40 2019 +0200 + + fixes + +commit 422cbc5f6167f12804d2c40b036d9ccc26496e2f +Merge: 25dc0a3 911f476 +Author: godgamer029 +Date: Sat Jun 8 13:46:17 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 25dc0a38a9fe26c991a5311c478cb2933c087d0e +Author: godgamer029 +Date: Sat Jun 8 13:46:11 2019 +0200 + + Reduce BedFucker delay and Range + +commit 911f476f263e4fb8c79003e61b8b3e4d9d4da977 +Merge: aca35e5 07f33a1 +Author: Kevin Fischer +Date: Sat Jun 8 13:45:46 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit aca35e51aa40e05daaf204400979892999ed8299 +Author: Kevin Fischer +Date: Sat Jun 8 13:45:42 2019 +0200 + + Started Tower + +commit 07f33a152b19c2b9e2654c53c73173b1531b3ae1 +Author: godgamer029 +Date: Sat Jun 8 13:45:06 2019 +0200 + + Fix GameMode::destroyBlock + +commit 8c188f2baa5866fb12bde13f441c7fa1de883ece +Merge: f89b73f 1720f77 +Author: godgamer029 +Date: Sat Jun 8 13:19:42 2019 +0200 + + yikes + +commit f89b73f285365819dd342492521ebf7b838436c1 +Author: godgamer029 +Date: Sat Jun 8 13:19:20 2019 +0200 + + performance + +commit 1720f77e5dbea4b1d9db848131b8456c1fea10ee +Author: Kevin Fischer +Date: Sat Jun 8 13:18:28 2019 +0200 + + Updated BedFucker + +commit acb4acb40b03bcb9fbf757748007626ce5375946 +Author: godgamer029 +Date: Sat Jun 8 13:16:25 2019 +0200 + + formatting + +commit 7856adbdce6dd31dc6dc04e2870ad58edc905773 +Merge: 5bc6d06 2d298c0 +Author: godgamer029 +Date: Sat Jun 8 13:15:31 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 5bc6d06c6bfb1de1d9c8563297a9d41345232776 +Author: godgamer029 +Date: Sat Jun 8 13:15:00 2019 +0200 + + Enhanced BlockLegacy + +commit 2d298c00796681cac77337ac5a653884c5ed8b76 +Author: Kevin Fischer +Date: Sat Jun 8 13:14:38 2019 +0200 + + Started BedFucker + +commit 5bc2e9bb05c3ab1a537017558f2f0407269c4f59 +Author: godgamer029 +Date: Fri Jun 7 20:24:02 2019 +0200 + + > Enhancements + +commit 265b205c1e338b8e5ffcd2815c09fe43c00b58e1 +Author: erwan celanie +Date: Fri Jun 7 12:21:47 2019 -0400 + + removed force creative + +commit 054229ea93a6bf83f59973cb0c0870884aaabb2a +Author: erwan celanie +Date: Fri Jun 7 12:17:46 2019 -0400 + + changing keybind + +commit 49d0324aa6ec235da596d58828c8504024a963b7 +Author: erwan celanie +Date: Fri Jun 7 12:11:36 2019 -0400 + + working xray + +commit 111911b37b257efadf80719ac28f741f7acf0801 +Author: godgamer029 +Date: Fri Jun 7 17:29:04 2019 +0200 + + Structural changes + +commit 663639204639e30da958575661647e31a40306b0 +Author: erwan celanie +Date: Thu Jun 6 01:10:24 2019 -0400 + + started working on X-ray + +commit 3c968be4e6c321246f459223cb057c32c55f1842 +Author: Kevin Fischer +Date: Mon Jun 3 22:15:42 2019 +0200 + + Added Speed + +commit 59279147877f8af1cefa6440acaaef2f02b0a91e +Author: godgamer029 +Date: Sat Jun 1 15:53:13 2019 +0200 + + remove some memes + +commit deed35e0654794479cea0184b2de6fdfb4707fc8 +Author: godgamer029 +Date: Sat Jun 1 15:39:50 2019 +0200 + + Enhancements + +commit 84d226253bd701717c4e190fcbd5f26bcb486036 +Author: godgamer029 +Date: Sat Jun 1 15:34:24 2019 +0200 + + improvements + +commit 476ec210f10f0a6eef1813e498c9a50f6d1a49d0 +Author: godgamer029 +Date: Sat Jun 1 15:26:00 2019 +0200 + + TabGui + +commit 94235745716d78528396338e4e3d99b428293ba0 +Author: godgamer029 +Date: Sat Jun 1 12:14:46 2019 +0200 + + Improve performance + +commit 9baf77f78d8d1669d91795e77da9ff6933a24eea +Author: godgamer029 +Date: Sat Jun 1 12:10:44 2019 +0200 + + Delete ConfigObj + +commit f61eb8785b8a62af8114d65110bdb5e22a3558fd +Author: godgamer029 +Date: Sat Jun 1 12:07:57 2019 +0200 + + fix more warnings + +commit 89f3b8797dcb4a2b823ab8af2078b89e516fd114 +Author: godgamer029 +Date: Sat Jun 1 11:57:20 2019 +0200 + + Fix compiler warnings + +commit 10be145878e62aaf32773229c40bf5c00b50b647 +Author: godgamer029 +Date: Sat Jun 1 11:50:22 2019 +0200 + + Change getModuleName to const char* + +commit 994b69c5ee4e19b7a2ced79c87abe767e28ba6a5 +Merge: cee22da e964ef8 +Author: erwan celanie +Date: Fri May 31 23:54:48 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit cee22da03877ff4147e6d40a406d11edd03a228a +Author: erwan celanie +Date: Fri May 31 23:54:40 2019 -0400 + + delete + +commit e964ef85da585d8417b811a2e45358287f6e461c +Author: godgamer029 +Date: Sat Jun 1 00:31:35 2019 +0200 + + Improved performance + +commit a24393cd804a78d685fba108602646f937376cb1 +Author: godgamer029 +Date: Fri May 31 22:53:03 2019 +0200 + + Working + +commit 58d7c834ae592025f2cd90d5aa43214d1db863b8 +Author: godgamer029 +Date: Fri May 31 21:16:33 2019 +0200 + + Remove getVersionStringHook + +commit 226bf024ad51d95ae37b8ee34bcd6af4be427c3a +Author: godgamer029 +Date: Fri May 31 21:11:17 2019 +0200 + + Final adjustments + +commit b558deb54d4ef88c14fb1e87175fd8f57be5439d +Author: godgamer029 +Date: Fri May 31 21:05:16 2019 +0200 + + C l e a n + +commit 3b220e26f0ecc74eea2c63964dc747b6a9e04abf +Author: godgamer029 +Date: Fri May 31 20:03:13 2019 +0200 + + idk how to fix this mess + +commit 34489729d800cfdf44180f25f45c493e2faa6b14 +Author: godgamer029 +Date: Fri May 31 19:53:03 2019 +0200 + + clean + +commit 5b6b495cedf582f49fef0d10dea67d8e409268e5 +Author: godgamer029 +Date: Fri May 31 19:44:40 2019 +0200 + + yikes + +commit 037cb552139ab33fd90cc1644d040feac2287be7 +Author: godgamer029 +Date: Fri May 31 19:30:26 2019 +0200 + + Cleanup & Fix errors + +commit 401878bc1a0d5bacea9c69b971d857f636f1b410 +Author: godgamer029 +Date: Fri May 31 19:23:27 2019 +0200 + + Cleannnn + +commit ffb1c43f83a9b5414d8b03faeefbf39d92902b6f +Author: godgamer029 +Date: Fri May 31 19:20:14 2019 +0200 + + Readability + +commit 872a17e556b2941a534abbb2fbddb152b27838b4 +Author: godgamer029 +Date: Fri May 31 19:15:14 2019 +0200 + + remove ugly code + +commit 2bd4ca6de68fbb9d42e4bcecfa60bcaa56f87af6 +Author: godgamer029 +Date: Fri May 31 19:13:14 2019 +0200 + + Ocean cleanup + +commit 915ed522802d30037ef75f29e7ad1dde5bfd0087 +Author: godgamer029 +Date: Fri May 31 18:50:56 2019 +0200 + + fixes + +commit d06238cd21048ecf23e3dc315a9a302a757ec2e7 +Author: erwan celanie +Date: Fri May 31 12:39:46 2019 -0400 + + l + +commit 35b422a6ea095104b8bcc4b86f2c95bf06dc3846 +Author: erwan celanie +Date: Fri May 31 12:38:50 2019 -0400 + + shit + +commit 78307a8da45aa34c75b932e2715c5ade72f1c7e0 +Author: godgamer029 +Date: Thu May 30 23:58:17 2019 +0200 + + Tabgui improvements + +commit 6a2dd24735e77e144c72ce1ec3107e00e09bd0d8 +Author: godgamer029 +Date: Thu May 30 23:41:46 2019 +0200 + + Roll around + +commit 1c4a52d2f6b119843c4a07cb5420476c5086869c +Author: godgamer029 +Date: Thu May 30 23:35:54 2019 +0200 + + started work on TabGui + +commit 601ee53c56090b767e686efa7237d0ad831d65c7 +Author: godgamer029 +Date: Thu May 30 22:10:44 2019 +0200 + + Add GuiUtils + +commit ac7f80dbe855fef4578918d1b434247cb27afdda +Author: godgamer029 +Date: Thu May 30 22:07:47 2019 +0200 + + Module states (enabled/disabled) are now being saved + + Rainbow Sky can be bound to a key + + Blink keybind is now properly being worked around + +commit d649817ca1c6016213014c4499a31bbdb3edd72c +Author: godgamer029 +Date: Thu May 30 21:46:58 2019 +0200 + + fix + +commit 6b02d055fbd9600dbfa079f2e19abf3f915ded73 +Author: godgamer029 +Date: Thu May 30 21:43:06 2019 +0200 + + enhancement + +commit aabd1d2e20e812f30a6cbd26e2ed0e7730bea982 +Author: godgamer029 +Date: Thu May 30 20:33:51 2019 +0200 + + fixed compiler errors + +commit e526e0fddd181a8108b3acd2e53ce376823d64d3 +Merge: e35c9ee e50d8b2 +Author: godgamer029 +Date: Thu May 30 20:29:55 2019 +0200 + + yikes + +commit e35c9eef2061e4c203405258b0af66627d03beb9 +Author: godgamer029 +Date: Thu May 30 20:28:23 2019 +0200 + + Categorys + +commit 80c7a2d66cb4558a12fd70aa12c90dac3b8e3936 +Author: godgamer029 +Date: Thu May 30 20:03:56 2019 +0200 + + idk + +commit e50d8b2a4cd9c7167412afd45b9f1896c5c4fa3b +Author: erwan celanie +Date: Thu May 30 12:02:21 2019 -0400 + + Better MousePos + +commit 5e7666a1e585ed9974744f5ef4cfa8a89f1c6f06 +Author: erwan celanie +Date: Thu May 30 00:58:28 2019 -0400 + + fix + +commit 52219e34f42243fce28f4d3a054ed872365a41ef +Author: erwan celanie +Date: Wed May 29 01:02:49 2019 -0400 + + MousePos and Fix + +commit ae6b080de29b73ddce997d0b0405144d4291bb94 +Merge: 0aa3a82 aa27bf2 +Author: godgamer029 +Date: Tue May 28 15:52:16 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 0aa3a82d7ae5da22232ad8ffeec6ce1f6ad4392b +Author: godgamer029 +Date: Tue May 28 15:52:09 2019 +0200 + + scaffold comment + +commit aa27bf268657cdb2a072437d68b2c0a61dd63e46 +Author: Kevin Fischer +Date: Tue May 28 15:43:30 2019 +0200 + + Made a speed + +commit 354b38250f31a87792850954d30fe22bdbf1cef3 +Author: godgamer029 +Date: Tue May 28 15:26:30 2019 +0200 + + fix nopacket crash + +commit 9884b54dfaadb58d77cb926887d609bdc53dca74 +Author: Kevin Fischer +Date: Tue May 28 14:59:04 2019 +0200 + + fdgf + +commit d7cf9f154fb6cb120970922b85b4aa4b43107926 +Merge: b7a3413 efc1f9b +Author: Kevin Fischer +Date: Tue May 28 11:11:11 2019 +0200 + + qww + +commit b7a341301eaa80fde7eb35444d1c4e643755421e +Author: Kevin Fischer +Date: Tue May 28 11:07:41 2019 +0200 + + working on speed + +commit efc1f9b55b0b768647dedeb8e520017c535ea747 +Author: erwan celanie +Date: Mon May 27 21:10:10 2019 -0400 + + Big fix + +commit a849da5ca337261e4ec3dd5e2203b38184322631 +Author: erwan celanie +Date: Mon May 27 12:54:20 2019 -0400 + + fix + +commit ce39c0ad3696caf962c23995ac05336debf53362 +Author: godgamer029 +Date: Mon May 27 18:23:25 2019 +0200 + + fix 3 + +commit ca32f0ab458c695690b626ca52ce68ffcbbe690a +Author: godgamer029 +Date: Mon May 27 18:22:12 2019 +0200 + + fix 2 + +commit 8dbe6584154f17966e31d1a8dd8ff7620cef25d8 +Author: godgamer029 +Date: Mon May 27 18:21:29 2019 +0200 + + Fix teleport + +commit 0bb9ffb37f37c802a6f14bbb9c0eaa38d604ea16 +Author: godgamer029 +Date: Mon May 27 17:16:17 2019 +0200 + + chungus + +commit 328c17ec92290d43774f32ba43801fb84857dde9 +Author: godgamer029 +Date: Mon May 27 17:12:16 2019 +0200 + + gamemode + +commit ce9d8543ddaf415e2ea3d58ebe4b2f579bd54efc +Author: godgamer029 +Date: Mon May 27 17:07:58 2019 +0200 + + Friendlist + +commit 52aeb6d86553aa452b0193f24d2d6c4e68060a94 +Author: godgamer029 +Date: Mon May 27 17:01:24 2019 +0200 + + Upper case description & Usage + +commit d7d6b730252e6141d34a94ee612f88ed488de055 +Author: erwan celanie +Date: Mon May 27 09:55:31 2019 -0400 + + some fix + +commit 3bf11b50f67d3421be5b84a1ccca6b75d5254dde +Author: erwan celanie +Date: Mon May 27 09:42:36 2019 -0400 + + Update is ready + +commit cbe9f688ae8c3e4dee8c9e1576570796e4b3151d +Author: erwan celanie +Date: Sun May 26 09:35:05 2019 -0400 + + Bunch of stuffs + +commit cd38947114b51478cc70e7128e31ba1da548876f +Author: erwan celanie +Date: Sat May 25 13:32:04 2019 -0400 + + Good Nofall and GameMode + +commit 5d60641ecc3502a83ad36ea508ca0dc10b16068c +Author: erwan celanie +Date: Fri May 24 23:24:35 2019 -0400 + + Fix C_Entity + +commit 978a319461a63f32cc88e427fd4a509699813da1 +Author: erwan celanie +Date: Fri May 24 16:26:06 2019 -0400 + + Good Player teleport command + +commit 58bb71c4e24480fa99a3131edd06c193d86cb0ee +Author: erwan celanie +Date: Thu May 23 23:34:06 2019 -0400 + + fix arraylist + +commit c949cd91c5ddd23eb96d76ea566712f3be96862d +Author: erwan celanie +Date: Thu May 23 23:01:34 2019 -0400 + + fix Blink + +commit f127ca42b95ae9b1b26392b1a9eb67c09149ac43 +Author: erwan celanie +Date: Thu May 23 22:17:10 2019 -0400 + + Player Teleport Command + +commit f9e250be58e88abad9dacd878f16e5164db14f55 +Author: erwan celanie +Date: Wed May 22 00:04:44 2019 -0400 + + Blink Meme + +commit bd1f937470ab6c0622fef0abe060677f495dc58e +Author: erwan celanie +Date: Tue May 21 15:43:08 2019 -0400 + + NoFall + +commit f3f6149550f145d0f49d6a14ba9d120d62136000 +Author: erwan celanie +Date: Mon May 20 18:48:21 2019 -0400 + + bind numpad key + +commit c8d6cac42981f74ce17fbe00ac208064bd304c86 +Author: erwan celanie +Date: Sun May 19 23:40:55 2019 -0400 + + name check + +commit c63c5bcc75ff635f0867f9950582cace928bb613 +Author: godgamer029 +Date: Sat May 18 22:28:13 2019 +0200 + + fix + +commit b41c91c834cf5bd8662f8d180b51ae1709fa557c +Author: godgamer029 +Date: Sat May 18 22:17:53 2019 +0200 + + fix fov hook + +commit 30f7a691167e79faac61cb67cb43f74c979b45a7 +Author: godgamer029 +Date: Sat May 18 21:57:29 2019 +0200 + + Start work on Speed + +commit b09652132102bd5318a028aea7bbb781c4b51be1 +Author: godgamer029 +Date: Sat May 18 21:22:36 2019 +0200 + + Add RelTP & Toggle Command + +commit d4c9e26b232f13fc7046545bfda6bcf3dff2be66 +Author: erwan celanie +Date: Sat May 18 13:08:07 2019 -0400 + + Better sig + +commit e48b0b3514c12050d1bd6cd19c34716a5348daab +Author: erwan celanie +Date: Sat May 18 11:36:30 2019 -0400 + + Better entitylist + +commit 8ea3c3baaded587b283faae464d4bf3884902dee +Author: godgamer029 +Date: Sat May 18 17:24:24 2019 +0200 + + Scaffold is nice + +commit 297963260a93d2695e32de73a9295d9dae18c75c +Author: godgamer029 +Date: Sat May 18 17:18:52 2019 +0200 + + Fix some issues + +commit 90572bff8b70b40fd86327ebacc9d73affe09d9d +Author: godgamer029 +Date: Sat May 18 17:15:15 2019 +0200 + + cleanup + +commit c5b68ec40e0645d3221730b964cb566416eceaa5 +Author: godgamer029 +Date: Sat May 18 17:01:22 2019 +0200 + + Good scaffold + +commit 9a73ca9aae1458d416f08057f192027adfce3570 +Author: godgamer029 +Date: Sat May 18 16:19:06 2019 +0200 + + Working scaffold + +commit 87eee300f44ffbad30db46d4407f6310feed6456 +Author: godgamer029 +Date: Sat May 18 13:43:00 2019 +0200 + + comment + +commit 824d4802c0d12c180a5c2593ca516728e36167d7 +Author: godgamer029 +Date: Fri May 17 20:26:52 2019 +0200 + + scaffold + +commit 24b42926659a8d0703bf23d08c67be65bf01d12c +Author: godgamer029 +Date: Fri May 17 17:35:24 2019 +0200 + + Start work on Scaffold & getFovHook + +commit fe853841bcdebd2bd90e6b0e8c76609fd7d44c23 +Author: godgamer029 +Date: Fri May 17 15:38:38 2019 +0200 + + Ocean Cleanup mission + +commit 9546dac7db9541bb481a410b9678b7bc72880c7e +Author: godgamer029 +Date: Fri May 17 15:33:25 2019 +0200 + + Same with bowaimbot + +commit 4d5ff0b34ed40b8f0270d1b71de4046814230da3 +Author: godgamer029 +Date: Fri May 17 15:28:38 2019 +0200 + + Aimbot Improvements + +commit 0cef38fe80b9651ffa23f34a51c7b939cb68465e +Author: erwan celanie +Date: Wed May 15 23:27:09 2019 -0400 + + LocalPlayer::Turn + +commit eb2f5fa8eab98b0d929e6857976a95ab1dc595b0 +Author: godgamer029 +Date: Wed May 15 16:59:49 2019 +0200 + + bowaimbot + +commit aae4632e62c537a85ed79290363203812d75c128 +Author: erwan celanie +Date: Wed May 15 02:00:10 2019 -0400 + + Tracer Module + +commit 97163548d5e67b0ef00a997590358d29b4728aa6 +Author: erwan celanie +Date: Wed May 15 01:18:03 2019 -0400 + + tracers + +commit 70d5f5ed173ae794e0efb3e1ad846272097ae7b8 +Author: godgamer029 +Date: Tue May 14 21:02:38 2019 +0200 + + improof + +commit c1dd4916efacd1211348578f95a138bb60eb8cd8 +Author: godgamer029 +Date: Tue May 14 20:58:45 2019 +0200 + + Better visibility + +commit f83482b8c198a2462f82ee88b242e053c54cecdd +Author: godgamer029 +Date: Tue May 14 20:50:27 2019 +0200 + + nICE looks + +commit 18999b1f7e1fe7251242f1d3dd3d03b81c6a6c24 +Author: godgamer029 +Date: Tue May 14 20:35:08 2019 +0200 + + Arraylist sorted by Text Length + +commit 48984c17efb19325be49d7b41585e609db63bf76 +Author: godgamer029 +Date: Tue May 14 20:16:29 2019 +0200 + + Give dat boi some space + +commit f56e9e287aee6b83e1e8a1f6eb37b8af97b0ffa5 +Author: godgamer029 +Date: Tue May 14 20:15:05 2019 +0200 + + Actual Keybind Names + +commit 6f171e375d13bf25fe7d84ea44f186ebfa95306d +Author: godgamer029 +Date: Tue May 14 20:06:22 2019 +0200 + + AutoSprint + +commit c12f284e3bc9506ab48ca7451cd10fa6920b5a3c +Author: godgamer029 +Date: Tue May 14 19:54:23 2019 +0200 + + Remove unnecessry headers + +commit 72db32f9406c42f941c852c703a87883bbc7dde3 +Author: godgamer029 +Date: Tue May 14 19:52:40 2019 +0200 + + Yay we can now access old commands + +commit 6f05b46bc86bc412ced8b44c96eb8cb20d4b5fbf +Author: godgamer029 +Date: Tue May 14 15:00:03 2019 +0200 + + Dont show esp in menus + +commit 7ead4b4628e1c8eda1ab7361a1a1443e2838bb6f +Author: godgamer029 +Date: Tue May 14 14:16:40 2019 +0200 + + Fix a bunch of crashes + +commit 1ec6297b89d2c806fabda28abe00089865149137 +Author: godgamer029 +Date: Tue May 14 14:01:28 2019 +0200 + + be gone + +commit 951a8853d1e2772b3bed3b752d5e0a88e20d5d45 +Author: godgamer029 +Date: Tue May 14 13:54:23 2019 +0200 + + Fix a bunch of more leaks + +commit b79efd7b4862dd0a1990e86c9debc9d70bb8feb5 +Author: godgamer029 +Date: Tue May 14 13:49:34 2019 +0200 + + Fix more leaks + +commit cc6670ee197669da1fe4859a850af6715921198c +Author: godgamer029 +Date: Tue May 14 13:45:32 2019 +0200 + + Fix some memory leaks + +commit 96eebc14ca7b769f331f2e7273d58fbc6937cce9 +Author: godgamer029 +Date: Tue May 14 13:31:06 2019 +0200 + + Keybinds are now being saved + +commit e56398b17f53777a9e342cb7fbf737132096a912 +Author: erwan celanie +Date: Mon May 13 20:17:36 2019 -0400 + + fix GUI + +commit 608d663e26d0003a7c10f5048ac66e5b9200083b +Author: erwan celanie +Date: Mon May 13 00:14:50 2019 -0400 + + Broke Gui + +commit 0c41878b610c8561221b725636187ee917ef7350 +Author: erwan celanie +Date: Sun May 12 12:12:31 2019 -0400 + + Phase,Freecam,Gui + +commit e57f869640e523985e8c33feb56d6b0bf83870ed +Author: godgamer029 +Date: Sun May 12 14:54:49 2019 +0200 + + Configs + +commit 7ce247c991efe5d4f5acb7a092c04c83c9e770d0 +Author: erwan celanie +Date: Sun May 12 08:27:26 2019 -0400 + + gui color + +commit e1b85433035d43e71a83fba45d1078746f88ec4c +Author: erwan celanie +Date: Sun May 12 07:34:11 2019 -0400 + + ArrayList on the right + +commit 4d75177a0feb3114fa428018c72dec57294eb279 +Author: godgamer029 +Date: Sun May 12 11:58:32 2019 +0200 + + Bug Fixes + +commit 51175a2ff85e3f77a16a1498c4a58df4590f1b25 +Author: godgamer029 +Date: Sun May 12 11:21:55 2019 +0200 + + Fix jetpack + +commit 33662377b77393b0a3aed48ccd5b3d9b744bf425 +Author: godgamer029 +Date: Sat May 11 23:50:56 2019 +0200 + + Bind Command + +commit 6c31ea6bab5536c632633af7d7bd23e07c897615 +Author: godgamer029 +Date: Sat May 11 23:28:54 2019 +0200 + + Improvements for Commands + +commit 9288caae2715f6864c07b2b2236661802a344ee2 +Author: godgamer029 +Date: Sat May 11 22:07:02 2019 +0200 + + Actual autocomplete + +commit 0a88f425802ce411d3d5a18c35c79ed60793cd54 +Author: godgamer029 +Date: Sat May 11 20:16:24 2019 +0200 + + Partial autocomplete + +commit 918691fb1ec6e50375b39d4b1411f99d8fee0dfc +Author: godgamer029 +Date: Sat May 11 18:39:01 2019 +0200 + + Teleport command + +commit 467563cd36aeb9928bb07b27c43ce13f3c4ca5dc +Author: godgamer029 +Date: Sat May 11 15:56:26 2019 +0200 + + Commands n stuff + +commit 0ff8f4e1a24bb4eb85ead08ffbd4664515747a36 +Author: godgamer029 +Date: Sat May 11 15:52:22 2019 +0200 + + EjectCommand & Commands actually work now + +commit c19bcf2b58579c3371430ac5f75a7352be1cc7ca +Author: godgamer029 +Date: Sat May 11 14:07:17 2019 +0200 + + Start work on Command Manager + +commit 969573334e957a0d9dac3729c9c2836b45d90a79 +Author: godgamer029 +Date: Sat May 11 13:54:33 2019 +0200 + + Activate edition changer + +commit 90c87a05bf18cbd94fd61d1c8e80b10f56b6bde0 +Author: godgamer029 +Date: Sat May 11 12:45:45 2019 +0200 + + Game Edition CHanger + +commit 28b92c41879c42397ee8520cd5e7e43e17bf16b4 +Author: godgamer029 +Date: Fri May 10 21:20:18 2019 +0200 + + Only press keybinds when not in inventory etc + +commit d126deee17e378a5344ac6cccdf48237bec4cf19 +Author: godgamer029 +Date: Fri May 10 20:21:43 2019 +0200 + + Add Glide + +commit b170896f59ad9cb277c2f43b40339ac6a2d86f39 +Author: godgamer029 +Date: Fri May 10 20:07:53 2019 +0200 + + Step added + +commit e4216a61e6136af3de0ee6a3e2f9e1d3416a6a66 +Author: godgamer029 +Date: Fri May 10 18:21:56 2019 +0200 + + AirJump + +commit 7bfcd06c5d5c6b46b218a97f5c3c4b8551387a16 +Author: godgamer029 +Date: Fri May 10 18:17:16 2019 +0200 + + Toggle RainbowSky + +commit d4be076054e2f652922265b506c2c054a6a9f952 +Author: godgamer029 +Date: Wed May 8 21:34:37 2019 +0200 + + Add easy way to get Modules + +commit e585bdc5bc9fca8729eb776688fb2a66de30ddac +Author: godgamer029 +Date: Wed May 8 21:13:37 2019 +0200 + + Chest ESP + +commit 67cf71d16412abd6b81ebccc9dc0c96075834b3a +Author: erwan celanie +Date: Wed May 8 13:29:12 2019 -0400 + + ChestEsp + +commit 666afd6625853701e46265fb1699a9466e0bd893 +Author: godgamer029 +Date: Tue May 7 22:04:22 2019 +0200 + + fix + +commit 5cc9745510ca111617ca407d4c4eb436fe95e782 +Author: godgamer029 +Date: Tue May 7 21:53:18 2019 +0200 + + y + +commit cf336a93b652512ee83112095c87f8f9afb012da +Author: godgamer029 +Date: Tue May 7 21:41:59 2019 +0200 + + Some Support for 1.11.0 + +commit 46e74c74e80bb0228f03d77081dc03a2693aa9ca +Author: godgamer029 +Date: Tue May 7 18:08:41 2019 +0200 + + Fix aimbot n trigger + +commit b630fd28c3f4e7b85dc42d905b8b53dba4f57396 +Author: godgamer029 +Date: Tue May 7 18:01:06 2019 +0200 + + Fix project + +commit 7e29d53d3b06767332f35ff53b941cf6e2101eb4 +Merge: eef61d6 f73ec91 +Author: godgamer029 +Date: Tue May 7 17:54:32 2019 +0200 + + i prolly broke something here + +commit eef61d68a1e3e2ac7b72b693da48ba8ead301a05 +Author: godgamer029 +Date: Tue May 7 17:51:53 2019 +0200 + + Add Jetpack & Flash Mode + +commit 6bdfda222cc2f055717637c439a5b35e0122df67 +Author: godgamer029 +Date: Tue May 7 17:34:23 2019 +0200 + + Remove Close String + +commit f73ec91c4d175ac7b089a58fc56e1642af948f45 +Author: erwan celanie +Date: Mon May 6 23:31:08 2019 -0400 + + Aimbot + +commit 27af8b544552dc956c38f48755ac2fd7159a4652 +Author: godgamer029 +Date: Mon May 6 21:20:54 2019 +0200 + + stuff idk + +commit b0614a76bfb213ab238e96ea82251c8af498417a +Author: godgamer029 +Date: Mon May 6 20:15:48 2019 +0200 + + ESP n stuff + +commit c1c06fcdcb197ea24ce6d8ff843e1c0a0b73492a +Author: godgamer029 +Date: Mon May 6 18:59:05 2019 +0200 + + change uninject key to CTRL + L + +commit 8fd1517d7f30a9dfcc827fa7063fff6095af8eb0 +Author: godgamer029 +Date: Sun May 5 21:52:44 2019 +0200 + + fix bug + +commit 78016414f51688048933ec01df6b4d7c6c293091 +Author: godgamer029 +Date: Sun May 5 20:24:05 2019 +0200 + + Entity ESP + +commit bbe319d601d955c8c3e90967bac0cd856d7e3594 +Author: godgamer029 +Date: Sun May 5 20:11:59 2019 +0200 + + Entity ESP + +commit e4d10280b54ecf54c5c87f229a3a007bf29d8dd7 +Author: godgamer029 +Date: Sun May 5 17:31:35 2019 +0200 + + World to screen + +commit 3a078e9c3e4139b5738df95844e820b33536dbc4 +Author: godgamer029 +Date: Sun May 5 16:16:38 2019 +0200 + + Good Font + +commit c336ce5290b6fc1d5fbea98f89bea9e2147615bf +Author: godgamer029 +Date: Sun May 5 15:33:30 2019 +0200 + + dont use this thanks + +commit fb8c17bb773e13049276d23303256909b6401328 +Author: godgamer029 +Date: Sun May 5 14:21:36 2019 +0200 + + yea idk + +commit 657cd76d02c1011ba9391075fcbe24b3d0f46300 +Author: godgamer029 +Date: Sun May 5 11:12:22 2019 +0200 + + Fix some Compiler Warnings + +commit f97565387646d794b344afa589ff6b28613cd557 +Author: godgamer029 +Date: Sun May 5 11:06:59 2019 +0200 + + Sig & FIxed some compiler warnings + +commit ccb1eb6d71908bbb45d6ffbadac33abb8b31fde2 +Author: godgamer029 +Date: Sun May 5 10:50:27 2019 +0200 + + Slick Background n DrawUtils + +commit 9364bdc0f99ffa2d9047f7ba03d793f79616c22b +Author: erwan celanie +Date: Sat May 4 23:10:51 2019 -0400 + + font + +commit 82d0f369119f2fdb4d6869799057787c4e5c8e72 +Author: godgamer029 +Date: Fri May 3 22:34:34 2019 +0200 + + color support + +commit b5624c05e83ab53204a7c1f230f878357392774a +Author: godgamer029 +Date: Fri May 3 22:01:25 2019 +0200 + + Draw sum lines + +commit 48d32e642765f10aadf0fbf64e12deb287c1b483 +Author: godgamer029 +Date: Fri May 3 16:49:41 2019 +0200 + + SurvivalMode::tick + +commit c69842e6b91b7d53a65234a691444617b224802c +Author: godgamer029 +Date: Fri May 3 15:46:22 2019 +0200 + + killaura + +commit 208900a47a249124f24bb15a2dc832712614a63a +Author: godgamer029 +Date: Fri May 3 15:41:50 2019 +0200 + + OnTick now actually works + +commit f87ac9c27d17e6c5d713f8da19c35701e88f7d7c +Author: godgamer029 +Date: Fri May 3 15:35:42 2019 +0200 + + Clean up Log + +commit d6652c7e5811d9ae527e87cd7e7810f146173498 +Author: godgamer029 +Date: Fri May 3 15:31:38 2019 +0200 + + Improvements + +commit 3933c217c1bff59fd3a793739734d1085b2133c9 +Author: godgamer029 +Date: Fri May 3 14:41:29 2019 +0200 + + Keybinds n stuff + +commit d842aa248cd5455e2e9deada28b733774166c206 +Author: godgamer029 +Date: Thu May 2 21:14:19 2019 +0200 + + le singleton + +commit 1cfd300cab5f4986d21e1878c8a29be23b4bc774 +Author: godgamer029 +Date: Thu May 2 21:12:04 2019 +0200 + + Beginnings of a ModuleSystem + +commit 5f6290498bf0dfa252be69502348affeb836005d +Author: godgamer029 +Date: Thu May 2 19:51:09 2019 +0200 + + refactor + +commit 80ec345fa40c30201eb5d693e590a301f39c6998 +Author: godgamer029 +Date: Thu May 2 19:44:00 2019 +0200 + + Moved some stuff + +commit 2cc4a3e24466ed3866319c73d648708a946c6936 +Author: godgamer029 +Date: Thu May 2 19:13:15 2019 +0200 + + Rainbow sky + +commit 15fafdf32c33f9e99f4b5f2cbdddb64d9ab1b368 +Author: godgamer029 +Date: Thu May 2 18:42:00 2019 +0200 + + added getLineLength + +commit 079b8632f3044324d51b5cf7a3fdaf6f568268a8 +Author: godgamer029 +Date: Wed May 1 21:45:32 2019 +0200 + + yeet + +commit 00480fce9e969a1774f6bb4e2a625d113512ef8a +Author: godgamer029 +Date: Wed May 1 21:30:51 2019 +0200 + + Horion logo + +commit 837e5d9f67b06d0c36938d0f95ecd38811e3592b +Author: godgamer029 +Date: Wed May 1 21:25:06 2019 +0200 + + Faster build settings + +commit 813bfe88091556ca93ef4e1c950db6b4615642e7 +Author: godgamer029 +Date: Wed May 1 20:58:11 2019 +0200 + + fixed entity struct + +commit 8dd208f9bec8eed170aa317c85da303e061fc45e +Author: godgamer029 +Date: Wed May 1 20:46:55 2019 +0200 + + release / grab mouse + +commit 36ce2b93fa780c0fb01653d0fb578905b591195f +Author: godgamer029 +Date: Wed May 1 20:19:00 2019 +0200 + + ocean cleanup mission + +commit 7cc7cca97774a27f13ad4baa76f8cec36becd034 +Author: godgamer029 +Date: Wed May 1 19:36:08 2019 +0200 + + drawText + +commit 1addb505623abb933205331dc85c63ea3b8fc182 +Author: godgamer029 +Date: Tue Apr 30 20:22:28 2019 +0200 + + yeet + +commit 304bc9ba1966800f230ee67cbdc98b5948a9150c +Merge: da7466c 2177b0f +Author: godgamer029 +Date: Tue Apr 30 20:15:14 2019 +0200 + + meeerge + +commit da7466c3b3c4c6b29cb1975f6e0b95fe4b3c6d1a +Author: godgamer029 +Date: Tue Apr 30 20:14:04 2019 +0200 + + B1g Rectangle + +commit 2177b0f77ac5c7916c28ffd1ef2e42ef07e75a41 +Author: erwan celanie +Date: Tue Apr 30 14:10:51 2019 -0400 + + diretcx hook fail + +commit 4f8d00baa4a451656de34d9364afa1d52068d399 +Author: godgamer029 +Date: Mon Apr 29 17:43:47 2019 +0200 + + Fixed minor Logger thread safety issues + +commit b94a1f02384a2399a78da5a2df718d569b7456b9 +Author: godgamer029 +Date: Mon Apr 29 17:35:13 2019 +0200 + + d3d11 present hook + +commit 019a75b819223c3cce3f075a2ea40930a3a4cce1 +Author: erwan celanie +Date: Mon Apr 29 11:14:42 2019 -0400 + + Directx Yeet + +commit 45687ce79a4d9ff9e31708193f2ce951f82ac5e6 +Author: godgamer029 +Date: Sun Apr 28 21:50:51 2019 +0200 + + command system + +commit 5f9b4cb00b8110d19e58c83af975221b9dd54b7e +Author: godgamer029 +Date: Sun Apr 28 20:38:09 2019 +0200 + + unlock achievements + +commit 82b8ed98a301cde977fba473873f0509241d41aa +Author: godgamer029 +Date: Sun Apr 28 18:28:16 2019 +0200 + + color + +commit 035e59c9f13893a4093eec73ec59625cf01d051a +Author: godgamer029 +Date: Sun Apr 28 16:18:57 2019 +0200 + + stuff + +commit 112f8f4e8d26bc897e1f8815e3479cd87d852d8f +Author: godgamer029 +Date: Sat Apr 27 23:59:33 2019 +0200 + + refactor lots of stuff + +commit 8ed913f3be21aa1e9ac4efa179a8c16ed6d78fbd +Author: godgamer029 +Date: Sat Apr 27 23:17:59 2019 +0200 + + GameMode::tick hook & Logger fix + +commit f962883d8f61b70949f8a8b858fe897f94e7433c +Author: godgamer029 +Date: Sat Apr 27 22:49:06 2019 +0200 + + FuncHook + +commit 5acfa1b87d67e5ee47a2ef817a2a4df9ffdbab81 +Author: godgamer029 +Date: Sat Apr 27 22:38:54 2019 +0200 + + rcx with signature + +commit 60fa3bb420e7e2ad3283b00c0c4d67216965b92b +Author: godgamer029 +Date: Sat Apr 27 22:21:32 2019 +0200 + + fix + +commit 9b64b084f7c06b30b06af449973a4669489addfe +Merge: 211b703 e23e468 +Author: godgamer029 +Date: Sat Apr 27 22:12:54 2019 +0200 + + chungus + +commit 211b703e53020044996168c922e238ceb715f300 +Author: godgamer029 +Date: Sat Apr 27 22:11:18 2019 +0200 + + idek + +commit e23e46821bba239dce9e937a3a068bc008ef509a +Merge: 213bb7d 695dabc +Author: erwan celanie +Date: Sat Apr 27 16:09:53 2019 -0400 + + sorry + +commit 213bb7d2b96fb1b5bdd08319d4c3366769cba73e +Author: erwan celanie +Date: Sat Apr 27 16:08:36 2019 -0400 + + sorry + +commit 695dabc35fdee1629573406ef0b916155f70227e +Merge: 52446e1 adaee53 +Author: godgamer029 +Date: Sat Apr 27 22:08:06 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 52446e17b479c58c6de49bfad07ebe6d63b2b6da +Author: godgamer029 +Date: Sat Apr 27 22:08:00 2019 +0200 + + wtf men + +commit b1a9c4cc2e2401f7ddfcbbe163d039b93b506a1c +Author: godgamer029 +Date: Sat Apr 27 22:07:51 2019 +0200 + + Revert "fine" + + This reverts commit adaee53dff97003bb8ba119ab9ce661b64ed4761. + +commit adaee53dff97003bb8ba119ab9ce661b64ed4761 +Author: erwan celanie +Date: Sat Apr 27 15:52:08 2019 -0400 + + fine + +commit c4e731a7813a78499c4d9d6bbe27a527512a23c6 +Merge: 6ee3d2a cb97db8 +Author: erwan celanie +Date: Sat Apr 27 15:51:20 2019 -0400 + + Fine + +commit cb97db8b170d891f3068dbb8b7039eb63bfa39be +Author: godgamer029 +Date: Sat Apr 27 21:40:17 2019 +0200 + + even less ghetto + +commit 6392964b8e69daa149919d61c1a4a2b7ff019c5e +Author: godgamer029 +Date: Sat Apr 27 21:37:13 2019 +0200 + + good + +commit 6ee3d2aa03ae496c33fbddd26076c2ba8208fdd6 +Author: godgamer029 +Date: Sat Apr 27 20:55:33 2019 +0200 + + ͡° ͜ʖ ͡°) + +commit 3b83e4760edb89056b48456eb9d0f5f89071ec13 +Author: godgamer029 +Date: Sat Apr 27 21:16:15 2019 +0200 + + i liek signatures + +commit de412731f52d8072438731b94b907857ceadb4ed +Author: godgamer029 +Date: Sat Apr 27 20:55:33 2019 +0200 + + ͡° ͜ʖ ͡°) + +commit 0adb598a19ef86e9fb57e73fbd99df61d6856eb9 +Author: godgamer029 +Date: Sat Apr 27 20:54:51 2019 +0200 + + vtable via signature + +commit 64b64f18fb7af531a0e30cf67be32908b52617f3 +Author: godgamer029 +Date: Sat Apr 27 20:36:40 2019 +0200 + + moveplaypacket + +commit d1d5a1afc046ff15f425b9e6cfbedb15639ef321 +Author: godgamer029 +Date: Sat Apr 27 20:01:15 2019 +0200 + + updated some stuff + +commit 50cd17657eb3e5088093a80a2ca131c2d6d17c30 +Author: godgamer029 +Date: Sat Apr 27 19:32:57 2019 +0200 + + Start work on FuncHook class + +commit aec80f0d768bf4ac1b6916411abe758c4fe3adeb +Author: erwan celanie +Date: Sat Apr 27 13:29:43 2019 -0400 + + Send Packets + +commit 4b12ff4da63383eec61448bae1c519998ae04a22 +Author: godgamer029 +Date: Sat Apr 27 18:33:31 2019 +0200 + + add vmt hook class + +commit 3efcfbb2d02db3e75b6dc013c266aec7ed16e6a0 +Author: godgamer029 +Date: Sat Apr 27 18:09:32 2019 +0200 + + minhook update + +commit 554e99b8bcdecce53c1cc00399f439a470ca6705 +Author: godgamer029 +Date: Sat Apr 27 17:19:14 2019 +0200 + + updet + +commit c82c64cfa398fc3a4a7942e5ed50080f993da225 +Author: godgamer029 +Date: Sat Apr 27 16:19:06 2019 +0200 + + ghetto code + +commit 419d2b2693fb6f6dfca37d59277d11975d24edd1 +Author: godgamer029 +Date: Sat Apr 27 15:14:32 2019 +0200 + + actually add minhook + +commit 4c2114fccad18fdadb41138cede78f7ca7646ed8 +Author: godgamer029 +Date: Sat Apr 27 15:09:45 2019 +0200 + + add minhook + +commit 57533528a25485ff7260ea8c14f5ba00a459e391 +Merge: 0cf1776 852a372 +Author: godgamer029 +Date: Sat Apr 27 13:37:39 2019 +0200 + + boi + +commit 0cf17769e496f6b0fe7d04163b30042e2c15219b +Author: godgamer029 +Date: Sat Apr 27 13:37:13 2019 +0200 + + boi + +commit 852a37292905b5c1f14662956a23e1426fc4e62b +Author: erwan celanie +Date: Sat Apr 27 00:42:36 2019 -0400 + + Update for 1.11.1 + +commit 8b5517fddac6053367d5502be8dc8428637613aa +Author: godgamer029 +Date: Fri Apr 26 23:49:53 2019 +0200 + + _destroyBlockInternal + +commit 21a0d8133f964055751b69eb521fa49010b5960d +Author: godgamer029 +Date: Fri Apr 26 22:52:14 2019 +0200 + + comment + +commit 0d7d5185e7737b7ed5dfa379650bc4adeed46159 +Merge: 13216b3 39b160e +Author: godgamer029 +Date: Fri Apr 26 22:51:42 2019 +0200 + + yeee + +commit 13216b3362b38eb2824f730bf9045dfd20686663 +Author: godgamer029 +Date: Fri Apr 26 22:51:13 2019 +0200 + + yeehawt + +commit 39b160ed8adfd6b7ffdcb789accb7a1102e91dbd +Author: erwan celanie +Date: Fri Apr 26 16:48:47 2019 -0400 + + Yeet + +commit 2bff575d0f7cf58d2313ea70d7de1d34db057edb +Author: erwan celanie +Date: Fri Apr 26 13:23:48 2019 -0400 + + Check by EntityType + +commit 4261ae8ad6ce06a8792797b1647aeec3dd825783 +Author: erwan celanie +Date: Fri Apr 26 11:20:36 2019 -0400 + + Check by Hitbox + +commit afa81cd2960d44286957109f742a877f46484919 +Author: godgamer029 +Date: Fri Apr 26 15:48:09 2019 +0200 + + he attac + +commit 940ea494b755d610c77eb20a84e0cc9aac05f1b9 +Author: godgamer029 +Date: Fri Apr 26 13:54:43 2019 +0200 + + fix mit x + +commit 6f2572b293fd1ea7f0843d64a0a58b121bb88c3d +Author: godgamer029 +Date: Thu Apr 25 21:32:50 2019 +0200 + + Send Chat Message + +commit 83a04daa8c949db0608bc35cbf785dbc76d93633 +Author: godgamer029 +Date: Thu Apr 25 16:40:19 2019 +0200 + + added ClientInstance + +commit 1df8b5029ea9893ed113d4751a90a4020e503f45 +Author: godgamer029 +Date: Thu Apr 25 15:21:52 2019 +0200 + + Update Proof KeyMap + +commit 1114e48d722bfc908ed358622821c69b2bafc559 +Author: godgamer029 +Date: Thu Apr 25 14:42:18 2019 +0200 + + Swing Func & Graceful Logger close + +commit 99536946c0d41a5f05fcc87d6d9d85bdb1d867de +Author: godgamer029 +Date: Thu Apr 25 14:00:26 2019 +0200 + + Use other form of synchronizing log + +commit 5ec788d781bcd7f0c4054b260793efce2b8c491f +Author: godgamer029 +Date: Thu Apr 25 13:47:53 2019 +0200 + + fix some warnings + +commit 8c1ca2b7720869d6c15e90ef469e4b13616256e0 +Author: godgamer029 +Date: Thu Apr 25 13:42:56 2019 +0200 + + remove unnecessary logging + +commit ecc6f078d28b81add255255a5cbca098de8ac428 +Author: godgamer029 +Date: Thu Apr 25 13:41:46 2019 +0200 + + Fix struct alignment + +commit c8fafa3330577f871700eb70d3fab7f0801d7344 +Author: godgamer029 +Date: Thu Apr 25 12:59:10 2019 +0200 + + sdk + +commit 6756564187cf149af14490c47ee1e80094449c49 +Author: godgamer029 +Date: Thu Apr 25 12:12:46 2019 +0200 + + Cleanup & SlimMem now uses internal ways of reading & writing + +commit aa8cc1f98c75652b12bba527315edbdba882f67d +Author: erwan celanie +Date: Thu Apr 25 00:27:15 2019 -0400 + + FIX + +commit 4de788f46af2d87a59813f798a75574bf48bcf9a +Author: erwan celanie +Date: Thu Apr 25 00:22:59 2019 -0400 + + FIX + +commit 4af2cd0801e95c200c70fdff6760c571fa21e342 +Author: erwan celanie +Date: Thu Apr 25 00:02:43 2019 -0400 + + Fix i'm so tired + +commit 525546ceb9fe3e6218a9788592a6a7ec1b2bed7b +Author: godgamer029 +Date: Thu Apr 25 00:55:35 2019 +0200 + + cleanuü + +commit 1f168635dd5a68a0f47ec0b89ca5d27dc1c78613 +Author: godgamer029 +Date: Thu Apr 25 00:23:03 2019 +0200 + + idk + +commit 0d593d229dc250dc694f7484d4b97584cd2f419e +Author: godgamer029 +Date: Wed Apr 24 23:57:43 2019 +0200 + + cleanup + +commit 789e7c90179861fda3cc42e7124d0eee494023fb +Author: godgamer029 +Date: Wed Apr 24 23:55:07 2019 +0200 + + remove hardcoded values + +commit aa55a20a8db4c41ecd89d3ac34ca82e41ca78b9b +Author: godgamer029 +Date: Wed Apr 24 23:53:26 2019 +0200 + + Key change + +commit 242edcb9621c44027492abd95e6fd4c372233157 +Author: godgamer029 +Date: Wed Apr 24 23:29:53 2019 +0200 + + quickfix + +commit 53cc734636ed08cc443dc8ec6213b0597fc11745 +Author: godgamer029 +Date: Wed Apr 24 23:28:06 2019 +0200 + + Use new Entity Class + +commit f4734fa6975dbef2acc054d358ebad6b2e6a4101 +Author: godgamer029 +Date: Wed Apr 24 23:20:34 2019 +0200 + + add Entity SDK + +commit ee6443a8fb9f2a0a6ffe26a92e0de7194608bcbc +Author: erwan celanie +Date: Wed Apr 24 17:18:45 2019 -0400 + + Test + +commit b49c677a80be55c1133b14a77286c5c6b8a53156 +Author: godgamer029 +Date: Wed Apr 24 22:07:48 2019 +0200 + + idk + +commit 7b55c1bac33f8b197d9bcf131d145893f06e468a +Author: godgamer029 +Date: Wed Apr 24 21:55:45 2019 +0200 + + implement math + +commit 978e8d3034bdda03bc563838582d126ca2f588dc +Author: godgamer029 +Date: Wed Apr 24 21:54:20 2019 +0200 + + Add HBob math + +commit e35a875d771a815d258d6bac559e0d0b46151b91 +Author: godgamer029 +Date: Wed Apr 24 21:51:24 2019 +0200 + + fix + +commit d364fb4a56d602ef84227f54bdcb7e0d259f1050 +Author: godgamer029 +Date: Wed Apr 24 21:50:57 2019 +0200 + + A start + +commit 9bcffbc5e7af93f334daedd4b015a69953f46a58 +Author: godgamer029 +Date: Wed Apr 24 21:29:05 2019 +0200 + + fix code + +commit abb1442e2efd1f360239fe4bfe04b1f4abd8081b +Merge: d12dce5 14867c5 +Author: godgamer029 +Date: Wed Apr 24 21:24:08 2019 +0200 + + yeezt + +commit d12dce5388da1ef411cdd17696a1e9b827cbb73e +Author: godgamer029 +Date: Wed Apr 24 21:22:33 2019 +0200 + + More Comments & Time + +commit 14867c56edff2b1815e27b529b53a5b6761cd8a9 +Author: erwan celanie +Date: Wed Apr 24 15:19:47 2019 -0400 + + dank! + +commit 688b9d55209d335a61bfeae7fc14ac6ce35c3575 +Author: godgamer029 +Date: Wed Apr 24 19:50:04 2019 +0200 + + Comment + +commit 31d1fb4ebe54d709d2bd5718e8a520fe1eba5caf +Author: godgamer029 +Date: Wed Apr 24 19:48:09 2019 +0200 + + Add Utils + +commit 712cac0f9f5cccd28062f8b8da27c5e32c959769 +Author: godgamer029 +Date: Wed Apr 24 18:04:34 2019 +0200 + + text + +commit e5818fa99842b22f500c0bce44b38aaefa7dd4ab +Author: godgamer029 +Date: Wed Apr 24 17:56:04 2019 +0200 + + Press L to uninject + +commit 4ceb6aabb4a26c8cfb978d9bda535f954ffa6625 +Author: godgamer029 +Date: Wed Apr 24 17:06:44 2019 +0200 + + Get Async Key State still not working + +commit 0df04a3317ef8fd34dfb98a850711c596a172bba +Author: godgamer029 +Date: Wed Apr 24 16:15:46 2019 +0200 + + refactor + +commit e8b5c07c586068b03bfccd03bb59cc4178b6b8c0 +Author: godgamer029 +Date: Wed Apr 24 16:09:54 2019 +0200 + + fix + +commit 81c0f990f0fd4551299103a23edd7f9defbef008 +Author: godgamer029 +Date: Wed Apr 24 16:07:10 2019 +0200 + + logging works now + +commit f0005ee858000e7d7fd6fe607941604f6e269b97 +Merge: 24b4532 0ac9b72 +Author: godgamer029 +Date: Wed Apr 24 15:14:53 2019 +0200 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 24b4532f4c84615068058d1f2f30c15fec31e3de +Author: godgamer029 +Date: Wed Apr 24 15:14:46 2019 +0200 + + sdad + +commit 0ac9b72cd1da4e3ca8744559da7c468e3b12232b +Merge: 1791d24 eb2111e +Author: erwan celanie +Date: Wed Apr 24 09:14:00 2019 -0400 + + Merge branch 'master' of https://github.com/Godsoft029/Horion + +commit 1791d243920817ad5548c8c8ec389b4dbd48c4e0 +Author: erwan celanie +Date: Wed Apr 24 09:13:51 2019 -0400 + + Hi ! + +commit eb2111ea83832331ea97191f85c1956404ea8c9f +Author: godgamer029 +Date: Wed Apr 24 15:13:27 2019 +0200 + + some changes + +commit f03a2cfe5569836f36c17400daccb8d3d158143d +Author: erwan celanie +Date: Wed Apr 24 09:11:18 2019 -0400 + + HI ! + +commit 16c1674b25f068b2311cc77a78b652ee3b890318 +Author: godgamer029 +Date: Wed Apr 24 15:05:24 2019 +0200 + + big chngeww + +commit e8c72d56b894c48abf0b9f5860f7dbb5462160a2 +Author: godgamer029 +Date: Wed Apr 24 14:43:04 2019 +0200 + + add dll main + +commit 4cdfe40197ccde5d47e6c49c1dcf3212097dddb2 +Author: godgamer029 +Date: Wed Apr 24 14:38:53 2019 +0200 + + Add Solution + +commit 90f566e99623411315f4a3fdcfa4a17de4836e02 +Author: GodSoft029 +Date: Wed Apr 24 14:38:12 2019 +0200 + + Create .gitignore + +commit c788179064c8088898bf331c0937c945f02c6d13 +Author: GodSoft029 +Date: Wed Apr 24 14:37:30 2019 +0200 + + Delete .gitignore + +commit 7fe4958aa43db5ce337727221f89b733b0e5a6b2 +Author: GodSoft029 +Date: Wed Apr 24 14:25:40 2019 +0200 + + Initial commit From 79b0c9c4e1e9708d15b525480573e252a8415f75 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 11:39:52 +0800 Subject: [PATCH 123/419] wtf git --- ...i \357\200\274target-commit\357\200\276~1" | 8064 ----------------- 1 file changed, 8064 deletions(-) delete mode 100644 "e -i \357\200\274target-commit\357\200\276~1" diff --git "a/e -i \357\200\274target-commit\357\200\276~1" "b/e -i \357\200\274target-commit\357\200\276~1" deleted file mode 100644 index 26dd740e..00000000 --- "a/e -i \357\200\274target-commit\357\200\276~1" +++ /dev/null @@ -1,8064 +0,0 @@ -commit 0cb118c08bbc0d0ab22b76ceec54cd1ee5c9c05a (HEAD -> feature-spider, origin/feature-spider, patch-2) -Author: CortexPE -Date: Mon Sep 7 11:21:58 2020 +0800 - - Implement Spider, Close #3 - -commit 0e9bf7e53cc2b8176ccbabe4f84f44aae46d8a92 (origin/patch-2) -Author: CortexPE -Date: Mon Sep 7 07:20:40 2020 +0800 - - simplify - -commit ab6152c1e05875dca2b416c69511a99453e3c8cd -Author: CortexPE -Date: Mon Sep 7 07:10:09 2020 +0800 - - remove un-needed header file - -commit daa45a0367aa072374a10d1bcfd144243138787d -Author: CortexPE -Date: Mon Sep 7 07:08:26 2020 +0800 - - make it so that FollowPath doesn't easily stop when jumping - -commit 2fb08352292a16315d751dc2e3c9d7259cf06843 (origin/master, origin/HEAD, master) -Merge: bb0aefa 4584519 -Author: GodGamer029 -Date: Sat Sep 5 11:28:18 2020 +0200 - - Merge pull request #272 from Johnmacrocraft/1-16-40-update-round-2 - - 1.16.40 update round 2? - -commit 458451994400454b1c5c8fd526744e3988f42ce9 -Author: Johnmacrocraft -Date: Sat Sep 5 12:54:38 2020 +0900 - - yes i'm not - -commit 06750dac46670a8d8e4c75925dbc7c7feff5f6ec -Author: Johnmacrocraft -Date: Sat Sep 5 12:33:49 2020 +0900 - - 1.16.40 update round 2? - -commit bb0aefa2a21c77ef578834edcb03af1bb14bf64b -Merge: 10d98d7 4e38112 -Author: Richard -Date: Fri Sep 4 17:05:20 2020 +0200 - - Merge pull request #267 from FloppyDolphin57/master - - Added more zoom customization - -commit 10d98d7ca2925ceb02e81d4ed40c021d68b5ce9b -Author: godgamer029 -Date: Fri Sep 4 16:23:10 2020 +0200 - - 1.16.40 update - -commit 49d884fdb4bd155174057cd350e6cd6717408c5e -Merge: 624deca f8af014 -Author: Richard -Date: Fri Sep 4 13:20:28 2020 +0200 - - Merge pull request #268 from Johnmacrocraft/fix-glide - - Fix #266 - -commit f8af014746975983495320305705a11b3256cf10 -Author: Johnmacrocraft -Date: Fri Sep 4 17:44:12 2020 +0900 - - Fix #266 - -commit 4e381128fe18250384b98ea0dec508ccf74af9b0 -Author: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> -Date: Fri Sep 4 03:08:53 2020 -0400 - - Add files via upload - - Added negative zoom strength to set higher fov's. - -commit 624decad6d4c7800c51db358037f59ebf1f49c72 -Author: godgamer029 -Date: Tue Sep 1 15:06:18 2020 +0200 - - Fix vs build - -commit 48bad428fe73d1560cd700a6985a03725f4c6d4c -Author: godgamer029 -Date: Tue Sep 1 14:59:43 2020 +0200 - - Add Beta stuff to public - -commit 951524e71c28b0be3aacfd92cab53d4134f51bc3 -Merge: d5c4b98 14faeb8 -Author: GodGamer029 -Date: Tue Sep 1 14:52:58 2020 +0200 - - Merge pull request #260 from baseds/master - - remove imgui - -commit 14faeb8dfa4f29e17696bcedaeb69b098b2f5998 -Merge: 246ffc8 ba00d13 -Author: baseds -Date: Tue Sep 1 13:50:10 2020 +0100 - - Merge branch 'master' of https://github.com/baseds/Horion - -commit 246ffc81fdaf90b43750b5e894114c89e362fdb1 -Author: baseds -Date: Tue Sep 1 13:49:37 2020 +0100 - - remove imgui - - useless - -commit d5c4b985c632d7552b0709e3c8b9c6cf8cf263fa -Merge: 6604353 ba00d13 -Author: GodGamer029 -Date: Tue Sep 1 14:42:32 2020 +0200 - - Merge pull request #259 from baseds/master - - better .gitignore - -commit 6604353fa240101f5313dc7abc11a331550aa324 -Author: godgamer029 -Date: Tue Sep 1 14:42:17 2020 +0200 - - Add Nukkit Dupe - -commit ba00d13f9723a9fccd8e6979f622d222d782894d -Author: segment <70320706+baseds@users.noreply.github.com> -Date: Tue Sep 1 13:39:34 2020 +0100 - - remove .lib (minhook binary is in repository) - -commit 9ce0f72a58fc715f73be02309b268eb8663445cc -Author: baseds -Date: Tue Sep 1 13:11:21 2020 +0100 - - better gitignore - -commit d2d2a85a3b79b1af72692082812de2fa9f638d0d -Merge: 5e7ef86 5b1ce6e -Author: godgamer029 -Date: Tue Sep 1 13:42:31 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 5e7ef8666d91305f65e59bfd6b4621172419a49a -Author: godgamer029 -Date: Tue Sep 1 13:42:21 2020 +0200 - - No idea what i did tbh - -commit 5b1ce6ed183def6d38a233d09a9a2f7714758207 -Author: Richard -Date: Sun Aug 30 15:09:18 2020 +0200 - - remove out - -commit daba1aa1c980b8dcb168dbc2ea0c28a805d2b819 -Author: Richard -Date: Sun Aug 30 14:58:54 2020 +0200 - - CC-BY-NC-ND 4.0 to CC-BY-NC 4.0 - -commit 4a70cd75fda150789eaf013618feee904a76b3cb -Author: Richard -Date: Wed Aug 26 14:34:18 2020 +0200 - - Update README.md - -commit bbdb7ab28c2b143bee95aeae312d57570ca1656a -Author: Richard -Date: Wed Aug 26 14:31:02 2020 +0200 - - Add files via upload - -commit f6fcf6b5655ed592693cd1fdc2bbd926d4058a14 -Author: Richard -Date: Tue Aug 18 11:05:58 2020 +0200 - - Delete FUNDING.yml - -commit 17c3eadcb3de03d6fa0ec3a5fb467e76c10e816c -Author: Richard -Date: Tue Aug 18 11:05:03 2020 +0200 - - Update README.md - -commit 5fe55939689252590388c085ad389e4529240eeb -Author: erwan celanie -Date: Sat Aug 15 13:04:33 2020 -0400 - - fix tracer , enchant , autosneak & clickgui - -commit 963bcd3d012f4278b4af0ed016d40c767557dfe9 -Merge: 77d4be2 7868d13 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Fri Aug 14 16:44:24 2020 -0400 - - Merge pull request #257 from richardletshacks/beta-support - - 1.16.20 support - -commit 7868d134aad627f8f41a179db33026f0d361e15b (origin/beta-support) -Author: erwan celanie -Date: Fri Aug 14 16:42:15 2020 -0400 - - yeet - -commit 53f876962de107560f45beb463688238f10ac721 -Author: erwan celanie -Date: Thu Aug 13 16:34:32 2020 -0400 - - fix client instance struct - -commit 4c781db8ca692eb2a1823b50f259b534dd0a4545 -Merge: 94354dd 77d4be2 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Thu Aug 13 16:19:48 2020 -0400 - - Merge pull request #256 from richardletshacks/master - - starting update - -commit 77d4be2b0814af22410528786f7ef53e512ca954 -Author: godgamer029 -Date: Thu Jul 23 13:16:33 2020 +0200 - - Very important changes to horion - -commit f8296513ca06f40975a1157463ee1ea3eb4b2e6c -Author: godgamer029 -Date: Tue Jul 21 23:00:10 2020 +0200 - - Update to 1.16.10 - -commit fcde620534f766d2374c5dc1a963b3d670a51f82 -Author: godgamer029 -Date: Tue Jul 21 22:36:26 2020 +0200 - - Fix vs - -commit aaa2f910110d59b310dcd06b7577039ed2df9b10 -Author: godgamer029 -Date: Mon Jul 20 23:20:39 2020 +0200 - - Linestrip3d - -commit 7b94fd0566bdcfef8015576b10d4bbcc02ecb134 -Author: godgamer029 -Date: Sun Jul 19 23:25:56 2020 +0200 - - Epic drawLine3d - -commit 5ba94846fc9aa08136da86fb9c863f12b0d6b16d -Author: Richard -Date: Sun Jul 12 18:45:16 2020 +0200 - - add to public - -commit 41a03e42287730d5af8d3b237c81cae684ce40b3 -Author: Richard -Date: Sun Jul 12 18:15:48 2020 +0200 - - remove this - -commit 91a2bc7e2a4c29482fcd57d2e7777832ee9f2642 -Author: erwan celanie -Date: Sun Jul 12 11:43:10 2020 -0400 - - fix fastladder - -commit 8a996e4f418441e0069ccb3f1b4bea40af94a2e1 -Author: godgamer029 -Date: Fri Jul 10 19:49:51 2020 +0200 - - Joe Water fixes - -commit 5474a45e8187bb37b4dcb4a27de740cbeb61c82e -Author: Richard -Date: Thu Jul 9 14:38:08 2020 +0200 - - use moveinputhandler for bhop and fix joe getting stuck in water when in creative - -commit cbb270b16964043036b7486e4304cee83a57772d -Author: godgamer029 -Date: Tue Jul 7 17:18:20 2020 +0200 - - Fix vs project - -commit 748b1203cd77d2d2f3cb686c4a38ec53bb06e087 -Author: godgamer029 -Date: Tue Jul 7 16:42:13 2020 +0200 - - Joe sprints, fix seagrass and kelp - -commit d48c14406841c5ebf2f29b31de8b9fc080981bb3 -Merge: b07b52e a20cd89 -Author: Richard -Date: Mon Jul 6 21:51:51 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit b07b52e16e67bd48784cdcc2379a213f13b89c47 -Author: Richard -Date: Mon Jul 6 21:51:31 2020 +0200 - - fix this - -commit a20cd89ac165123b755ef8a077d62c61041d53de -Author: godgamer029 -Date: Sat Jul 4 17:20:37 2020 +0200 - - Fix joe - -commit cc88d2a34e13ac6b35be581b3c5529292e012683 -Author: godgamer029 -Date: Sat Jul 4 15:09:44 2020 +0200 - - Fix cmake build - -commit 10aa5d0d5bbde1aec675b5fa6b5cfe421a68d30d -Author: Richard -Date: Sat Jul 4 13:06:08 2020 +0200 - - minor improvements - -commit 33dad0f672dfa4b52623a0ea1c455a63239ab87f -Author: Richard -Date: Fri Jul 3 13:33:53 2020 +0200 - - fix spammer and add back silent scaffold - -commit 5c4f68c089a2c21d1eef02752dd589187deaeb55 -Author: Richard -Date: Wed Jul 1 12:44:32 2020 +0200 - - fix coordinates text offset - -commit 1ea10132de4cbe704abf664c126f197f41366e74 -Author: Richard -Date: Wed Jul 1 12:03:06 2020 +0200 - - refactor this check - -commit c1fd6164c41eb4af98d9ae4f457134751ff11d48 -Author: Richard -Date: Wed Jul 1 11:41:59 2020 +0200 - - hud sale option - -commit ad4906bafd0e045bbdb6cfeeb4473ce25396c86e -Author: Richard -Date: Wed Jul 1 02:21:27 2020 +0200 - - for some reason it doesnt work without these pointers - -commit d90dc556d279fbb35f209a6c21493b053b6517d3 -Author: erwan celanie -Date: Tue Jun 30 19:08:40 2020 -0400 - - fix auto armor - -commit 260232ce5b758b8f3b7ae5c59964d8d7ae19b95a -Merge: bf8691c b622096 -Author: erwan celanie -Date: Tue Jun 30 19:06:15 2020 -0400 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit bf8691c3111f4d2a9acfc8340fb0ddb88bb99ece -Author: erwan celanie -Date: Tue Jun 30 19:06:12 2020 -0400 - - fix .nbt load - -commit b622096d73fa96cc4fb52cc4b09382905d8ef456 -Author: Richard -Date: Wed Jul 1 00:03:16 2020 +0200 - - enhanced cheststealer - -commit 7d4e146c6c0028ff5af67b8ee72ddc10280f6b10 -Author: erwan celanie -Date: Tue Jun 30 16:44:29 2020 -0400 - - test - -commit 644cc02b5e680ddb93495db6fe13f711bd763967 -Author: erwan celanie -Date: Tue Jun 30 16:43:20 2020 -0400 - - FIX item struct & mob equipment packet - -commit a73d42ad20512629ccf1ba001a08f075070dade2 -Author: Richard -Date: Tue Jun 30 17:16:41 2020 +0200 - - fix cheststealer always being enabled - -commit 30355baca2dfceee11d0be61f36def1660127cec -Author: Richard -Date: Tue Jun 30 17:15:22 2020 +0200 - - make scripts render in clickgui - -commit 1fe2dda66ea8d16d178cb67e6c6b28ab83986a7d -Author: Richard -Date: Tue Jun 30 16:28:29 2020 +0200 - - tick to chestscreencontroller_tick - -commit beb67073c965a3b414234169346fb1170636aaed -Author: Richard -Date: Tue Jun 30 12:13:45 2020 +0200 - - add killaura hurttime - -commit ea6f18bea9b28129d7cd5ee28f82efb32736d0ab -Author: erwan celanie -Date: Tue Jun 30 01:20:21 2020 -0400 - - fix cbe - -commit ce2bde03588f97e27cc89eb4a1449e7891606029 -Author: erwan celanie -Date: Tue Jun 30 00:58:00 2020 -0400 - - fix - -commit ca54bacc06c9134161906716012ca6420db9baee -Merge: 2fa5259 94354dd -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Tue Jun 30 00:56:31 2020 -0400 - - Merge pull request #255 from richardletshacks/beta-support - - 1.16.1 support - -commit 94354ddc8c4bf6ed34e9f16ea985476f214b7bd4 -Author: erwan celanie -Date: Tue Jun 30 00:51:08 2020 -0400 - - support 1.16.1 - -commit e53219cb7d680f86e3e8b7ddd5250f4ce78baf85 -Merge: 327ecee 2fa5259 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Mon Jun 29 16:59:04 2020 -0400 - - Merge pull request #254 from richardletshacks/master - - yeet - -commit 2fa5259f303333022bba52c50ad3690fe60ce2de -Author: Richard -Date: Sun Jun 28 13:52:52 2020 +0200 - - make nametags draw over each other + render them in right order (dist) - -commit 666a69eeae74a4a5ae5715b04217a7654d963929 -Author: Richard -Date: Sun Jun 28 13:19:59 2020 +0200 - - make esp & nametags not draw over hud - -commit c9f21b141c097856ec7dfde60b6ae2c8378ad506 -Author: Richard -Date: Sun Jun 28 13:06:42 2020 +0200 - - improve cheststealer - -commit 3f7a4452bc0e133ca81dd48f2e934a330c25f2af -Author: Richard -Date: Sun Jun 28 12:45:36 2020 +0200 - - display nametags correctly above the entity - -commit afc51566f0706c67b0e9f62c968761898cd4baf0 -Author: erwan celanie -Date: Sat Jun 27 14:22:11 2020 -0400 - - fix cheststealer - -commit 95329b6e146027585f822beb14b891c2bde7ee96 -Author: Richard -Date: Sat Jun 27 19:59:10 2020 +0200 - - fix autototem, inventorycleaner autosort - -commit 2024edc1b097afe6bb5d5c23607b56bd779b3bf2 -Merge: facc03d c139124 -Author: Richard -Date: Sat Jun 27 10:59:03 2020 +0200 - - merge - -commit facc03df5d1ca98da41ce0056fe8325c5048f3bd -Author: Richard -Date: Sat Jun 27 10:56:40 2020 +0200 - - some crashes - -commit c1391242f9553bc44430f185d900e536bc43c07f -Author: erwan celanie -Date: Fri Jun 26 21:44:46 2020 -0400 - - fix ? - -commit 6e39b8ea8ae09f87e3ae440e9134e0ebd6a69584 -Author: erwan celanie -Date: Fri Jun 26 21:43:04 2020 -0400 - - bruh - -commit 305e5fd9e9682e437f2c3abc6ff511963791fea5 -Author: erwan celanie -Date: Fri Jun 26 21:37:02 2020 -0400 - - test - -commit 67ae041cff23f6c69342c7d26875bf8e1254759c -Merge: d314e15 be19d65 -Author: Richard -Date: Sat Jun 27 01:31:17 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit d314e15738da63b064af532d96c4227af5139e8f -Author: Richard -Date: Sat Jun 27 01:31:06 2020 +0200 - - fix - -commit 1b85ee64a9f81ec963683deeafcbaf41600ba050 -Author: Richard -Date: Sat Jun 27 01:22:07 2020 +0200 - - autosneak, command blocks in xray & cbe fix - -commit be19d656c1d23a55f743b3ee1edf1a68dad3ffd5 -Author: erwan celanie -Date: Fri Jun 26 16:09:23 2020 -0400 - - fix custom skin pack - -commit 6056dd3f3b976b3f04670c9ce8660d6aea87e6d9 -Author: godgamer029 -Date: Fri Jun 26 18:53:37 2020 +0200 - - Fix dupe - -commit 53851189b7ba64d2a0f3957cbf0b1f1897087e84 -Merge: 9063c25 4119ed4 -Author: godgamer029 -Date: Fri Jun 26 18:34:31 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 9063c25bbecfe382485f4e4fb756d520b1b98b12 -Author: godgamer029 -Date: Fri Jun 26 18:32:48 2020 +0200 - - Fix joe not saying anything when he's done - -commit 4119ed4afe54a9cedc0c5c32c7b0392cc102cb39 -Author: Richard -Date: Fri Jun 26 18:28:47 2020 +0200 - - ancient debris xray - -commit 8f37b23930b2a09ded99cf9dc913561d41649cdf -Merge: db9fe54 5442dfc -Author: Richard -Date: Fri Jun 26 18:17:24 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit db9fe54669cee30c8a7a63ba14cc9b3158e4aa54 -Author: Richard -Date: Fri Jun 26 18:16:53 2020 +0200 - - cbe - -commit 5442dfcc3ce82e85ae6ec4a69c21649c6c05dfc8 -Author: godgamer029 -Date: Fri Jun 26 18:10:37 2020 +0200 - - Fix unepic crash - -commit 6c45b5d724e3e7104e1611ab15310af777f6a14f -Merge: 1cc9063 a356ec9 -Author: godgamer029 -Date: Fri Jun 26 17:54:44 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 1cc906395ff0a91bf328fa6e5e7c5de71bd5a3e9 -Author: godgamer029 -Date: Fri Jun 26 17:54:35 2020 +0200 - - Fix protection - -commit a356ec9337be8ca62078be68b9193346a999b991 -Merge: 3da5a6d b9c7fae -Author: erwan celanie -Date: Fri Jun 26 11:46:19 2020 -0400 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 3da5a6debd6fa96b006a6737384f76e1d9370233 -Author: erwan celanie -Date: Fri Jun 26 11:46:17 2020 -0400 - - fix joe - -commit b9c7faeaa8d45ccd1500cb7e3aa3da0861279f2d -Author: godgamer029 -Date: Fri Jun 26 17:36:47 2020 +0200 - - Fix Dimension_getFogColor crash - -commit 6368df5b2ff8f57fb780c1f5b25593352041024b -Author: godgamer029 -Date: Fri Jun 26 17:26:35 2020 +0200 - - Fix auto armor - -commit ca9a95d59607c3c293f0143a55b142b291b23671 -Merge: cca86b0 327ecee -Author: godgamer029 -Date: Fri Jun 26 17:19:02 2020 +0200 - - 1.16 Support - -commit 327eceea7e3337e5b0b1d9c15c138d328418fa10 -Author: godgamer029 -Date: Fri Jun 26 17:13:01 2020 +0200 - - Fix auto armor - -commit 3912a04aaa4fb5cc92fade28a46c7aaed67c613b -Author: godgamer029 -Date: Fri Jun 26 16:57:30 2020 +0200 - - fix scaffold - -commit 078f3d7f50d5b6c860cdf1630c4fc1bd83dd43a9 -Author: godgamer029 -Date: Fri Jun 26 16:35:27 2020 +0200 - - Fix rainbow sky - -commit ebe844f61d58929309dbbf80d4739c36091f89b7 -Author: godgamer029 -Date: Fri Jun 26 16:29:12 2020 +0200 - - Fix fullbright - -commit f88b038a75d09dac132bd2a81e5555fdfbf74982 -Author: godgamer029 -Date: Fri Jun 26 15:38:59 2020 +0200 - - Fix velocity - -commit 3db207982f5755f442881b5bf580065bee55a19d -Author: godgamer029 -Date: Fri Jun 26 15:32:27 2020 +0200 - - Fix autocomplete - -commit 2b224719bd7ec9fc3467b4e232fa713e590db0c7 -Author: godgamer029 -Date: Fri Jun 26 14:54:39 2020 +0200 - - Fix drawLine3d - -commit 6b16d67ef16c714c094b5ab9ca0809ce9bd563d4 -Author: erwan celanie -Date: Thu Jun 25 23:03:54 2020 -0400 - - fix - -commit 4c763f4b10e2e6fdcda43fd3ef70e26e4bab05b6 -Author: erwan celanie -Date: Thu Jun 25 20:09:02 2020 -0400 - - yeet - -commit b69859657b6eddffd73d414f6357c139fc4a4bf3 -Author: erwan celanie -Date: Thu Jun 25 20:07:51 2020 -0400 - - fix sigs & player vtable + entity vtable - -commit 5cdae71d5275292e85e0c78de2bfefea2b707170 -Author: erwan celanie -Date: Thu Jun 25 14:09:54 2020 -0400 - - fix epic nbt - -commit 9dd0cfeac531ca4db01465ff2d932e75684d7163 -Author: erwan celanie -Date: Wed Jun 24 17:34:02 2020 -0400 - - fix vtable - -commit 768fbf7c62a56dd650e8ababbdc0078a1f1bc10a -Author: erwan celanie -Date: Wed Jun 24 17:27:50 2020 -0400 - - fix amor hud - -commit f089fc7082c08ba70f7fa602f4b04a10b47b825d -Author: erwan celanie -Date: Wed Jun 24 15:12:40 2020 -0400 - - fix .enchant - -commit d7a8897315c6cc1146dfd9c55d67493f6df426ac -Author: erwan celanie -Date: Wed Jun 24 14:42:37 2020 -0400 - - fix .give - -commit 2b58bbcbb3e4a0d15eb25c8b449a8da5f5e9e0b7 -Author: erwan celanie -Date: Tue Jun 23 19:38:41 2020 -0400 - - fix sigs - -commit 8b7c230482b82438840bc1abbd66050c74896b03 -Merge: c8e1c9a 7d1a7c6 -Author: godgamer029 -Date: Tue Jun 23 22:47:33 2020 +0200 - - Merge branch 'beta-support' of https://github.com/richardletshacks/Horion into beta-support - -commit c8e1c9a701298b2509b355d2b981afdd19e7edfd -Author: godgamer029 -Date: Tue Jun 23 22:47:08 2020 +0200 - - Epic emote logging - -commit 7d1a7c6e2c93bfc067e2d80e28d6b6d8f20dc240 -Author: erwan celanie -Date: Tue Jun 23 16:43:33 2020 -0400 - - fix client instance vTable - -commit 7b493a8f04e0fd8fb6cfdbda29429eeacad11bf1 -Author: godgamer029 -Date: Tue Jun 23 22:24:04 2020 +0200 - - Fix cool sigs - -commit 9ebe92b1417ff50378e3c96fa141c10c4a96f302 -Author: godgamer029 -Date: Tue Jun 23 22:07:00 2020 +0200 - - fix commands - -commit d57d8ccc6bf4aa413ee088c80e6c482d9297c62e -Author: godgamer029 -Date: Tue Jun 23 21:46:17 2020 +0200 - - Fix 2d drawing - -commit 190d8f2b34e0940e70ae96ead62043be54edfe46 -Author: godgamer029 -Date: Tue Jun 23 21:31:31 2020 +0200 - - Fix sigs - -commit 85a8ebe6567021f3e68a553025e677d97a2c5a90 -Author: godgamer029 -Date: Tue Jun 23 20:41:49 2020 +0200 - - Full Entity class fixed - -commit 79aa36c3a78c19cbc0e1a8714e05343bd37f90da -Merge: ace0228 ad2b1df -Author: godgamer029 -Date: Tue Jun 23 20:24:50 2020 +0200 - - Merge branch 'beta-support' of https://github.com/richardletshacks/Horion into beta-support - -commit ace0228ddb12812f2bc3fb9853bec362feca5842 -Author: godgamer029 -Date: Tue Jun 23 20:24:37 2020 +0200 - - Fix Entity Class - -commit ad2b1df0b7f1c6e5fda48c42cb84dd011978600a -Author: erwan celanie -Date: Tue Jun 23 14:06:10 2020 -0400 - - fix guidata - -commit db5c3de2ee43334d582d60e3bf4dd951b25fb428 -Author: godgamer029 -Date: Tue Jun 23 19:27:13 2020 +0200 - - Update some entity stuff - -commit a8b8d816891829b0067045367e6258c355406481 -Author: godgamer029 -Date: Tue Jun 23 19:02:48 2020 +0200 - - Chat messages - -commit fa05bb0acf5fa6a2a87032236bfa80bb913c2340 -Author: godgamer029 -Date: Tue Jun 23 18:42:15 2020 +0200 - - Get ingame - -commit 4a0017d3d1e15d53daa3d6e1bc962d10872f0e12 -Author: godgamer029 -Date: Tue Jun 23 18:39:44 2020 +0200 - - Fix that - -commit febec7df6fe5cee73aa8020a910da5ccb41cf676 -Author: godgamer029 -Date: Mon Jun 22 15:37:19 2020 +0200 - - Crashless main menu - -commit a903abade576f19ea38297afe662a279d401beee -Merge: 0a1efae 61f3fa0 -Author: godgamer029 -Date: Mon Jun 22 15:19:32 2020 +0200 - - Merge master - -commit 0a1efae1de9ba3863e934d3ec16c2b517382b284 -Author: godgamer029 -Date: Mon Jun 22 15:11:24 2020 +0200 - - Fix sigs - -commit cca86b00c3598d4c9f8237cfd7c6157393eab323 -Author: erwan celanie -Date: Sun Jun 21 21:23:46 2020 -0400 - - yes - -commit 21df31105ca3eaca8b1cd73bf0e2926dc88ad0ad -Author: erwan celanie -Date: Sun Jun 21 21:22:02 2020 -0400 - - fix painting not rendering - -commit 61f3fa0c1110c19d32f1b1ce10e1bebb57a73dc5 -Author: godgamer029 -Date: Sun Jun 21 12:53:56 2020 +0200 - - Add EntityList to Scripting API - -commit 84a887bd0c6915aea1a4bf1c3a28436500c03056 -Author: godgamer029 -Date: Sat Jun 20 20:22:42 2020 +0200 - - Add .nbtraw alias - -commit 0885e23501a7381e00d5d27c19af56a15428dc17 -Author: erwan celanie -Date: Wed Jun 17 16:52:54 2020 -0400 - - epic - -commit 18c4747a2a5045e4f502d172aee12b095b608749 -Author: Richard -Date: Wed Jun 17 18:57:19 2020 +0200 - - push teleport - -commit fba191142953d0e223e9e3b09fd472c1a5154579 -Author: Richard -Date: Wed Jun 17 17:59:54 2020 +0200 - - proper nametags - -commit cfb01e19434ed832ab3fdea2435218d42efbcabd -Author: test -Date: Wed Jun 17 15:58:23 2020 +0200 - - idk - -commit bb7b231c0e6a4989fcb0ca9bea128a18c401228a -Author: test -Date: Wed Jun 17 15:56:41 2020 +0200 - - Fix BowAimbot and remove unnecessary allocations - -commit 4e9f8a4e963c79a536f695b81733340452bfd0ab -Author: godgamer029 -Date: Tue Jun 16 20:21:57 2020 +0200 - - Joe now recalculates path whenever it finishes an incomplete one - -commit 6474d424d19399b77cfc8058820c13b363cded3b -Author: godgamer029 -Date: Tue Jun 16 17:52:59 2020 +0200 - - Fix tracers - -commit 2d6bc1291cb53c9d8acd02f59497a01ad1cc6822 -Author: godgamer029 -Date: Tue Jun 16 17:39:19 2020 +0200 - - Fix drawline - -commit b35ead1b9ebb25e0144c0bcab9f0883cedabceef -Author: godgamer029 -Date: Mon Jun 15 14:26:49 2020 +0200 - - Execute Commands via console - -commit 326f2dd3ce9f05d17791b1cbba7174fd7f928616 -Author: godgamer029 -Date: Mon Jun 15 13:31:25 2020 +0200 - - Remove Windows.h from Logger.h - -commit 3cd9b72c5041d634498ae6a39e6d431842459052 -Author: erwan celanie -Date: Sun Jun 14 19:27:59 2020 -0400 - - yeet - -commit 92914aee391315d2da19ae242b8c2b0447f37a1b -Merge: 8b5dcfc 12b5606 -Author: godgamer029 -Date: Sun Jun 14 23:39:46 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 8b5dcfc3177f26d39654d294c2c1a99a9a2c2141 -Author: godgamer029 -Date: Sun Jun 14 23:39:36 2020 +0200 - - Do Tracers properly this time - -commit 12b56063b612ac5cfcd9a4206dbb94c1cea80ee3 -Merge: edb8f5d b25ceed -Author: erwan celanie -Date: Sun Jun 14 17:05:53 2020 -0400 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit edb8f5da6b851b53a97241aa4db20b3e23d6863a -Author: erwan celanie -Date: Sun Jun 14 17:05:50 2020 -0400 - - Nametags improvements - -commit b25ceedac2736a1800729fd7a135d477957cfaa0 -Merge: cf949f5 0f6a022 -Author: godgamer029 -Date: Sun Jun 14 14:12:42 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit cf949f5f22e41fef9656b8eb631e0bb4f8e53b28 -Author: godgamer029 -Date: Sun Jun 14 14:12:30 2020 +0200 - - Fix NoKnockback - -commit 0f6a0221c75d0b1966481db5fa70fff055effa78 -Author: erwan celanie -Date: Fri Jun 12 19:07:37 2020 -0400 - - bruh - -commit 2b5d672f8be021272b05e7687c4eeda90f25decd -Author: erwan celanie -Date: Fri Jun 12 19:04:30 2020 -0400 - - fix .give - -commit 928ce98eae0335ebd4404a1966dbee5792e320cd -Author: godgamer029 -Date: Fri Jun 12 22:41:46 2020 +0200 - - Horion = Hat confirmed doe???? - -commit 5938094dd8a27c24d359ae7a26d34164443cdac9 -Merge: bd203d0 f7e04e5 -Author: godgamer029 -Date: Fri Jun 12 15:58:24 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit bd203d00029dfac8fec7d71981737163cb08d28a -Author: godgamer029 -Date: Fri Jun 12 15:58:15 2020 +0200 - - Allow incomplete paths - -commit f7e04e5214705f3cb8fa5833363cf0563fc5e502 -Author: Richard -Date: Fri Jun 12 15:23:52 2020 +0200 - - bruh was this always broken? - -commit 42f6a3f81d9120e9c5493984625b6e23e85d2f33 -Merge: 90337b1 c6e0123 -Author: Richard -Date: Fri Jun 12 00:32:07 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 90337b172f0074498c91a503786908e8d6a1bf22 -Author: Richard -Date: Fri Jun 12 00:31:54 2020 +0200 - - escape codes in .say - -commit c6e0123b95a95ec486162ec71c2991a94cc0b2d7 -Author: godgamer029 -Date: Thu Jun 11 20:38:34 2020 +0200 - - Don't run into bamboo - -commit 7b529e8cf4987253a95c081f6b45a94809f19aab -Author: godgamer029 -Date: Thu Jun 11 15:35:03 2020 +0200 - - .path player - -commit d55e5a2e5dec0bbfabcfd6e8e1989fc5f18552f6 -Author: godgamer029 -Date: Wed Jun 10 22:25:31 2020 +0200 - - Fix water - -commit b443b0f1a3720a2e2beb4247b36344b9346d2b75 -Author: godgamer029 -Date: Wed Jun 10 21:23:26 2020 +0200 - - Use maps for storing nodes (massive performance improvement) - -commit e4c139a8a5bb2f3f1ba255da4cc88487406485d9 -Author: godgamer029 -Date: Wed Jun 10 18:22:06 2020 +0200 - - Avoid magma blocks & Performance improvements - -commit 6fdab9f88b6a6633500d66fe1c1e4512f7cd6e8f -Author: godgamer029 -Date: Wed Jun 10 18:04:58 2020 +0200 - - Don'd do risky jumps when eating - -commit 5c1f11ef24fd363f661f29fde1caf641e895a410 -Author: godgamer029 -Date: Wed Jun 10 16:06:34 2020 +0200 - - Fix jumping in tight spaces - -commit d77e26c6c85aa5930ff2b1269d485ceb43797d6c -Author: godgamer029 -Date: Wed Jun 10 15:45:33 2020 +0200 - - Jump improvements, fix long drop bug - -commit 59c4a20b92ae54cbf371f5f8708f00e78feb638c -Author: godgamer029 -Date: Wed Jun 10 15:25:02 2020 +0200 - - Walk on slabs and chests - -commit 3252bd217fa13eaebc39f158d7cd3e525bd4aefb -Author: godgamer029 -Date: Wed Jun 10 14:59:57 2020 +0200 - - Avoid wither roses - -commit 3435490cce47f578bc9638719864534033c79553 -Author: godgamer029 -Date: Wed Jun 10 00:39:46 2020 +0200 - - Fix ImmediateGui & flowing Water cost improvements - -commit c9d012b20098637ccd5cbe1c3f3eaf5f082b0171 -Author: godgamer029 -Date: Wed Jun 10 00:10:49 2020 +0200 - - Actual Epic water movement - -commit a49996fa008dac872714acf9dc951f9386d9b02f -Author: godgamer029 -Date: Tue Jun 9 23:40:01 2020 +0200 - - Fix NoPacket not allowing you to join worlds/servers - -commit d45fbae36bf699e1a28a1793428912755e4e3514 -Author: godgamer029 -Date: Tue Jun 9 21:36:32 2020 +0200 - - Water fixes - -commit f64ff7d8d3ad55af8efed98bf74ec5101644a467 -Author: godgamer029 -Date: Tue Jun 9 21:10:46 2020 +0200 - - Joe can now drop down 1-block-gaps with bigger heights - -commit f16efc00877e0a7543b404924931a4c53c4155c6 -Author: godgamer029 -Date: Tue Jun 9 14:33:23 2020 +0200 - - Minor joe fixes - -commit fc04b5051a8f4fa1095c73454279166f72dd4f5b -Author: godgamer029 -Date: Tue Jun 9 13:29:44 2020 +0200 - - More parkour - -commit 15ef53e08ba00186530ff03bb20e50c326ba2c61 -Author: godgamer029 -Date: Tue Jun 9 01:33:20 2020 +0200 - - Don't do this joe - -commit d5e93f3a91c9d3675f37b182b385720f03cf228b -Author: godgamer029 -Date: Tue Jun 9 01:14:52 2020 +0200 - - Minor tuning - -commit a49ff76c5e5af95c7693dc9aaf9681439b1c54e1 -Author: godgamer029 -Date: Tue Jun 9 01:03:07 2020 +0200 - - More epic water movement - -commit 775895c45dbfb299119f8a4198b514d88c095de7 -Author: godgamer029 -Date: Tue Jun 9 00:32:33 2020 +0200 - - Simple water movement - -commit d0b34414262e6a7604c2b78760d3aab01d3d836d -Author: godgamer029 -Date: Mon Jun 8 23:16:40 2020 +0200 - - Fix a bug where the path was immediately discarded - Fix jumps where the block above the end position is obstructed - Penalize diagonal movement when we scrub against a wall - -commit a6cddaa157812ff05b51ce7dba6a0aafd8831c22 -Author: godgamer029 -Date: Mon Jun 8 20:11:31 2020 +0200 - - Walk down blocks & Fix .path xyz - -commit 3c215e81722f88a44769f207399f3b69eeb3caaa -Author: godgamer029 -Date: Mon Jun 8 19:47:50 2020 +0200 - - Fix jump 2 - -commit 0b2cd1a85a1b944cecd5ad5d00eb5e507e008878 -Author: godgamer029 -Date: Mon Jun 8 19:38:20 2020 +0200 - - Fix jump - -commit d10b5f860fd505561eee1e8fce96779c1e4973fc -Author: godgamer029 -Date: Mon Jun 8 19:36:36 2020 +0200 - - Epic jumps - -commit 6a95d6af13e0cf8076c6269ffb8a53a13ba39a5b -Author: godgamer029 -Date: Mon Jun 8 17:18:47 2020 +0200 - - joe beta release - -commit d22c4baf4752b94c43eff97b0a44a939d5c1c7f6 -Author: godgamer029 -Date: Mon Jun 8 17:10:57 2020 +0200 - - Epic followpath command & module - -commit 968daa03f5dd6f948822d1fd3120d5401a890d30 -Author: godgamer029 -Date: Mon Jun 8 16:06:24 2020 +0200 - - Joe goals - -commit 3e4391b2b6ebf0ae44a39b4098d1e2340c9464e0 -Merge: 1fdeb40 c2d49b3 -Author: godgamer029 -Date: Mon Jun 8 15:00:47 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 1fdeb4040236fa968d33f1dab5c6414933dcb196 -Author: godgamer029 -Date: Mon Jun 8 15:00:38 2020 +0200 - - Joe movement improvements - -commit c2d49b3abb58c798388430da771a4acd6891ee14 -Author: Richard -Date: Sun Jun 7 23:14:13 2020 +0200 - - fix criticals sound - -commit 5a184e1e9d1f5f757b1e1a0cc5f7a92153d80d3f -Author: godgamer029 -Date: Sun Jun 7 22:47:28 2020 +0200 - - WIP joe movement controller - -commit cad6a9fc69bd3af4b5b19e332b9fb72682144028 -Author: godgamer029 -Date: Sun Jun 7 17:22:51 2020 +0200 - - Fix cobwebs & put drops in a loop - -commit e8062fb6c3eff7242d907523f0c8d6274f63fe2f -Author: godgamer029 -Date: Sat Jun 6 14:47:19 2020 +0200 - - Avoid dangerous paths - -commit 33df97865fcf798299bf61c2b1f0b5c6927e074d -Author: godgamer029 -Date: Sat Jun 6 13:39:37 2020 +0200 - - 3 Block drop - -commit d78a2d13c97d3264b61fc29c9465b12729005efe -Author: godgamer029 -Date: Fri Jun 5 23:45:35 2020 +0200 - - dev-only joe - -commit f6f971ae2262ca699e69adf3099edb9cee2bcebf -Author: godgamer029 -Date: Fri Jun 5 00:49:16 2020 +0200 - - Fix mobkillaura - -commit e13c2228c1eb90588022b09cb00aabd5bfa3ed4d -Author: godgamer029 -Date: Thu Jun 4 23:58:10 2020 +0200 - - Update Item vtables & epic shulkers - -commit d94b543dfe387db922fc3ceaf37b10ccc8e1426e -Merge: 3ee27f9 a2e8d24 -Author: godgamer029 -Date: Thu Jun 4 20:29:26 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 3ee27f973e8be26c8d4f204059905cd6fa465a8b -Author: godgamer029 -Date: Thu Jun 4 20:29:15 2020 +0200 - - Fix game crash when .giving invalid items - -commit a2e8d249594c3f649af7a3e4a9b183f5f36f7e06 -Author: godgamer029 -Date: Thu Jun 4 16:13:38 2020 +0200 - - Add to solution - -commit 9e98862713ba84b81faa35387c163041e0812d1e -Merge: 5ab3c49 28e4df2 -Author: godgamer029 -Date: Thu Jun 4 16:12:28 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 5ab3c496882c2dd26da51fac2bb3921f2cfe6969 -Author: godgamer029 -Date: Thu Jun 4 16:12:19 2020 +0200 - - add AntiImmobile - -commit 28e4df21d532258f02f7bb497410ac4848c95649 -Author: godgamer029 -Date: Thu Jun 4 14:25:59 2020 +0200 - - Add to solution - -commit 8504b30582a5382555ecbe3af93b148ed24ba01b -Merge: 6b8f813 780a5e5 -Author: godgamer029 -Date: Thu Jun 4 14:23:17 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 6b8f813036a4653d241f87374ff9261ed51fd0d5 -Author: godgamer029 -Date: Thu Jun 4 14:20:30 2020 +0200 - - Add nohurtcam - -commit 780a5e55bfe314ce9c312fb11b59c14545597abd -Author: godgamer029 -Date: Wed Jun 3 20:03:35 2020 +0200 - - Add new files to solution - -commit 31b97a225d28bd011f97f1275143188094b8d10d -Author: godgamer029 -Date: Wed Jun 3 20:01:00 2020 +0200 - - Add freelook & camera sdk - -commit 9e8531542479299f3ec6b7fd30d28b9aab2cd90c -Author: godgamer029 -Date: Tue Jun 2 23:59:44 2020 +0200 - - Fix scroll wheel - -commit 48c4e6f40794bbba383a34002b6290ec233f2e72 -Author: godgamer029 -Date: Tue Jun 2 23:34:59 2020 +0200 - - Clickgui positions are now saved in configs & clion said i should replace all these loops - -commit 2be0d5631b51c36bf2e1ce9923a97bfd537b0452 -Author: godgamer029 -Date: Tue Jun 2 14:55:00 2020 +0200 - - reenable xor - -commit fb011466751ff6e98e4bb117a1bd4c55c6c384de -Author: Richard -Date: Mon Jun 1 15:57:59 2020 +0200 - - scaffold spoof - -commit 98b1f4ce76deb14146880bb6b104395433f98c02 -Author: godgamer029 -Date: Mon Jun 1 14:24:40 2020 +0200 - - Player action packet - -commit 9e02124757c7164368d67194f1b6f7e21383a88f -Author: godgamer029 -Date: Mon Jun 1 00:28:05 2020 +0200 - - Fix entity list - -commit eb2c520eebb19c8446f2844f4b1a687703e0f31d -Author: godgamer029 -Date: Sun May 31 17:20:54 2020 +0200 - - Add onEnabled and onDisabled for scripts - -commit 506d928c05abb30ba35182cee38e4779d3ae6c5a -Merge: 40f443c 4a7ba8a -Author: godgamer029 -Date: Sun May 31 17:11:14 2020 +0200 - - Merge remote-tracking branch 'origin/master' - -commit 40f443c59b31dcc5bbd86bf62a037bbfc2a7d538 -Author: godgamer029 -Date: Sun May 31 17:11:04 2020 +0200 - - Scripts in tabgui - -commit 4a7ba8ab02e16862839ea09dcc944c73023cef79 -Author: godgamer029 -Date: Sun May 31 16:50:29 2020 +0200 - - Fix visual studio - -commit f791e75f5096949a40b9d411100c58196baeffdc -Author: godgamer029 -Date: Sun May 31 16:23:41 2020 +0200 - - cmake & compilation speed improvements - -commit 99cd27928748ede0b5deec205d85dae50aa54615 -Merge: 930408f 970ce95 -Author: godgamer029 -Date: Sat May 30 14:00:09 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 930408f465141e2f86aca8d2b6af96d8a4d0d6ec -Author: godgamer029 -Date: Sat May 30 14:00:00 2020 +0200 - - Nothing to see here - -commit 970ce959cfe4870b41cad1ba694bbcf370524080 -Author: Richard -Date: Wed May 27 10:47:46 2020 +0200 - - godmode epic - -commit e5b514765d434a1a99c9d33ad583ad1a071d377d -Author: Richard -Date: Wed May 27 02:40:58 2020 +0200 - - improve fucker - -commit 2db9e351695666f05fb99dabe657f0159785f9fe -Author: Richard -Date: Mon May 25 17:07:54 2020 +0200 - - fix crash - -commit 8b6c109fc1341c36c2c97ebe45efe94d067a2275 -Merge: 7b0851b 702bec7 -Author: Richard -Date: Mon May 25 01:16:19 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 7b0851b07cd405d9a5d1773f6416fe2c13c3b973 -Author: Richard -Date: Sun May 24 23:43:07 2020 +0200 - - silent rotations option - -commit 1b83a7bf7f46d7073843ce58acb606c144cd47b0 -Author: Richard -Date: Sun May 24 23:31:16 2020 +0200 - - criticals - -commit 84a2ed012f3b11b3a5ad96570e3b68ac2c2b4d06 -Author: Richard -Date: Fri May 22 18:37:39 2020 +0200 - - improve inventorycleaner - -commit a501f73f857cdae29e97633e2e81f4db138f60d1 -Author: Richard -Date: Fri May 22 18:08:20 2020 +0200 - - bunch of refactoring - -commit 702bec7745f92bacea68b8d27c025a9b6a8b8a9b -Author: Richard -Date: Wed May 20 23:27:35 2020 +0200 - - Update README.md - -commit 45ee528ced3d253fa5dad2970cb30eecb10a4ced -Author: Richard -Date: Mon May 11 18:51:07 2020 +0200 - - improv - -commit e61158079e9ee91316b5200fa0c33ef2160eea58 -Author: Richard -Date: Fri May 8 17:47:39 2020 +0200 - - always show option for hud, some bugfixes - -commit 29bc0948ae4c70e9607de9a093e42fd1704bdd7c -Author: Richard -Date: Fri May 1 03:10:15 2020 +0200 - - removed unused code - -commit dcfbbbfb5aab24d5f1550f1dc07b74f7afe450f6 -Merge: bc438e9 280c4bb -Author: Richard -Date: Thu Apr 30 14:30:14 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit bc438e90f1aa115459d35e06ab1152df4c7c0c51 -Author: Richard -Date: Thu Apr 30 14:29:55 2020 +0200 - - fix blink name - -commit 280c4bba423d86846dd7e3be7560b18ccae29ea5 -Author: godgamer029 -Date: Thu Apr 30 14:01:55 2020 +0200 - - Fix public build - -commit ce3a9bdc46b74f6cd29531f37b5c38ff0272f5ac -Author: erwan celanie -Date: Tue Apr 28 16:57:59 2020 -0400 - - bruh - -commit e73647ed1e15877487115b85655190437b32a05a -Author: erwan celanie -Date: Tue Apr 28 16:56:26 2020 -0400 - - i'm done - -commit f5b2d515367512acba340800b9b3cae2f7263bea -Author: godgamer029 -Date: Tue Apr 28 14:37:19 2020 +0200 - - Fix barrels - -commit fd9c464d604e7de66a14981cb6d0c5fcf1263172 -Merge: 1ab1191 542a546 -Author: godgamer029 -Date: Tue Apr 28 14:13:03 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit 1ab11915337c59013d185241325d85f5a7de5373 -Author: godgamer029 -Date: Tue Apr 28 14:12:52 2020 +0200 - - Fix connected chests - -commit 542a546439a9031f4ebd9e38a5dbcf7636262cf0 -Author: erwan celanie -Date: Mon Apr 27 16:17:43 2020 -0400 - - fix - -commit 8e24b174e731a97c15458010a18c27581956ad91 -Author: erwan celanie -Date: Mon Apr 27 16:12:11 2020 -0400 - - gaming - -commit abb33afe1210147ca7f0c81e42fd4e89069fd85c -Author: godgamer029 -Date: Mon Apr 27 17:44:18 2020 +0200 - - Outline chestesp (totally not copied from hat) - -commit fb4751bf7896d2897fc11d3ede60d2f4c3d62a90 -Author: godgamer029 -Date: Mon Apr 27 16:29:14 2020 +0200 - - Fix Memory leak and more epic esp - -commit bf51c0bf92ac1e5545023b06424826e18c33bc7b -Author: godgamer029 -Date: Fri Apr 24 23:03:42 2020 +0200 - - Dont load the same script twice - -commit 7f87b5c29d33c400d1bc6295e41baee7e4c09cfd -Author: godgamer029 -Date: Fri Apr 24 22:32:47 2020 +0200 - - Actual Script support - -commit aab87f70d61ef0d1ac8edc12d7670a47c9f07f4b -Author: godgamer029 -Date: Thu Apr 23 14:13:34 2020 +0200 - - Disable this for now - -commit 5ef8a5a64810302e4d88fef4aa7a5b3083eedb53 -Author: godgamer029 -Date: Wed Apr 22 13:41:31 2020 +0200 - - Cool shaders & Gamer server is experimental - -commit 7c24127a1423b3e513060805610445cd8e99246a -Author: godgamer029 -Date: Wed Apr 22 00:43:49 2020 +0200 - - fix - -commit 4ef8dc94e7ebcb43729da1b0c03c40c6a1d5acb9 -Author: godgamer029 -Date: Wed Apr 22 00:08:01 2020 +0200 - - present hook - -commit 6609c53422bcffcdfde75313278cc8da689fc45b -Author: godgamer029 -Date: Tue Apr 21 22:11:19 2020 +0200 - - Add epic horion server - -commit 9b92d26e2fd3be194217bcbf94c0dcf8f0d7e315 -Author: godgamer029 -Date: Mon Apr 20 01:22:14 2020 +0200 - - Module manager api - -commit 23e383697378c6123baca0248fca7cbb1fd66e61 -Author: godgamer029 -Date: Sun Apr 19 20:24:49 2020 +0200 - - Command Manager - -commit 0b81c2037a5080288e2e734b2cae5130841329d1 -Merge: 32c129d 7776f1d -Author: godgamer029 -Date: Sun Apr 19 18:13:52 2020 +0200 - - Merge branch 'scripting2' - -commit 7776f1df223e360fcd994884574fb7ad5cb5da5e (origin/scripting2) -Author: godgamer029 -Date: Sun Apr 19 18:11:33 2020 +0200 - - Fix - -commit 32c129dc633ebda51055903680d71545fdcce165 -Merge: f34171e 4b17cde -Author: GodGamer029 -Date: Sun Apr 19 18:03:18 2020 +0200 - - Merge pull request #251 from richardletshacks/scripting2 - - Merge Scripting into master - -commit 4b17cded01bd1a281def1bbbef01ee1a58aeaf51 -Author: godgamer029 -Date: Sun Apr 19 16:00:27 2020 +0200 - - Console in injector - -commit ea9d692a9f927a8261ae8b06dd4c63a4d4fe57a1 -Author: godgamer029 -Date: Sun Apr 19 15:03:14 2020 +0200 - - Final changes - -commit b82bd7bc937adc226f5d0e164bec3d4b62fadd07 -Author: godgamer029 -Date: Sun Apr 19 12:57:25 2020 +0200 - - More functions, fixes - -commit d3a68db64fcb26ce9ba2a0e87be783dc6ee26617 -Author: godgamer029 -Date: Sun Apr 19 12:00:30 2020 +0200 - - More functions, local player setters added - -commit 35ee63c3a3dbfa53fb5046d7f4a54500cd152027 -Author: godgamer029 -Date: Sun Apr 19 01:25:10 2020 +0200 - - More functions & prototypes - -commit 7f7ce196586ebde17b58a53ea08135241102ef75 -Author: godgamer029 -Date: Sun Apr 19 00:30:34 2020 +0200 - - Execute command - -commit a324159fe70efc3548ec06379e590d3ec820dde8 -Author: godgamer029 -Date: Sun Apr 19 00:19:10 2020 +0200 - - Implement Entity and Vector3 - -commit 7debdc0690ef6381705dc869ee091775634a7c53 -Author: godgamer029 -Date: Sat Apr 18 19:28:20 2020 +0200 - - Refactor stuff away from TestCommand - -commit bbebc95fc315238f45a8caae794ee0b8d1b89a00 -Merge: 698c6ab f34171e -Author: godgamer029 -Date: Sat Apr 18 16:45:25 2020 +0200 - - Cool update - -commit f34171ee354c7d5ab84037f344951fad0493b756 -Author: godgamer029 -Date: Sat Apr 18 16:05:37 2020 +0200 - - Fix fullbright - -commit da0648530a887000f581811032ef52702942717b -Merge: ac67c7f a96551d -Author: godgamer029 -Date: Sat Apr 18 14:59:53 2020 +0200 - - Merge branch 'master' of https://github.com/richardletshacks/Horion - -commit ac67c7fcfc833150bbdcae34b557f6acac1ea008 -Author: godgamer029 -Date: Sat Apr 18 14:59:40 2020 +0200 - - Fix Geometries - -commit a96551ddb7a5c8de72974f58089f9ef6bae6c364 -Author: Richard -Date: Fri Apr 17 02:43:15 2020 +0200 - - remade 2d esp so hat team wont bully me - -commit 4a90ef7cc7a99f6c872db7cffb6596bc99c79ed1 -Author: godgamer029 -Date: Thu Apr 16 11:54:40 2020 +0200 - - Fix a shit ton of bugs - -commit 34562a798b03703d834aeac7eb082879c6264623 -Author: erwan celanie -Date: Wed Apr 15 23:00:55 2020 -0400 - - support for 1.14.6 - -commit 0e63a5c9273f6920a0a3364c54ce9990f75745b2 -Author: godgamer029 -Date: Fri Mar 27 19:28:15 2020 +0100 - - Fix beta - -commit 7069b7a469ec064b2d26f372b0218daa7d5251ec -Author: godgamer029 -Date: Fri Mar 27 19:08:42 2020 +0100 - - Fix logger - -commit 3f4e6b0302b002ec01f349413a2931bb65fc1e99 -Author: godgamer029 -Date: Fri Mar 27 19:05:31 2020 +0100 - - Bruh - -commit 2a60e02e1238da328888813283209c30ca14b70c -Author: godgamer029 -Date: Fri Mar 27 18:53:11 2020 +0100 - - More logging - -commit e05a84f7f1e567ee74fbed50e6722990b8149c07 -Author: godgamer029 -Date: Fri Mar 27 18:36:09 2020 +0100 - - Fix up these bois - -commit f8a0b15d080f726b84a02f2162b2ed2a343b9916 -Author: godgamer029 -Date: Fri Mar 27 18:30:49 2020 +0100 - - Fix that badboi - -commit aa208752ac2d32e75c7e0138f6e5b8e40770f8de -Author: godgamer029 -Date: Fri Mar 27 18:18:37 2020 +0100 - - More debugging information - -commit d1e46149c89df327b580a5cd28a5b1ab4cb1f642 -Author: godgamer029 -Date: Fri Mar 27 17:57:42 2020 +0100 - - Fix crash - -commit 93d32177da64c5781770ecd0e351c5fee8c2e204 -Author: Richard -Date: Fri Mar 27 13:49:12 2020 +0100 - - fix toggle command - -commit f13bb8f20d300e83c8ba64c908cf1caba5c495be -Author: Richard -Date: Fri Mar 27 12:49:03 2020 +0100 - - fix cbe beehive - -commit 2ed204e680774b3d8cf6f4f5746520073c093606 -Author: godgamer029 -Date: Fri Mar 27 01:09:56 2020 +0100 - - Pack it up boys - -commit 68561cb2a03b67720722f8ea866a3e78875d884f -Author: godgamer029 -Date: Fri Mar 27 01:00:10 2020 +0100 - - Fix - -commit 3ef860bbfd1e1bb3e672daf32e15a70c57921249 -Author: godgamer029 -Date: Fri Mar 27 00:43:34 2020 +0100 - - Surely this would fix it - -commit 5cefa2a9a40cd4a9abcc43a10e7ff547e59af7d1 -Author: godgamer029 -Date: Fri Mar 27 00:42:22 2020 +0100 - - pls work now? - -commit 2eb696f753050f58add44382da0fc63c41700675 -Author: godgamer029 -Date: Fri Mar 27 00:34:50 2020 +0100 - - Bruh - -commit 5d5f230a4889c4a262b27a0cd5ea0e9a4ea944a0 -Author: godgamer029 -Date: Fri Mar 27 00:31:40 2020 +0100 - - Fix Beta Build Config - -commit d2e10a34bab79541123516e5792138e4af0dcf4f -Author: godgamer029 -Date: Fri Mar 27 00:22:08 2020 +0100 - - I hope we never go open source again - -commit 0722fab4cbe925b6970baee61b6170afd4067503 -Author: godgamer029 -Date: Thu Mar 26 23:55:09 2020 +0100 - - Might as well use https now - -commit dfff12b9aa96971a383feaf7bfe8de6e75ebcff3 -Author: godgamer029 -Date: Thu Mar 26 23:51:10 2020 +0100 - - Little hack - -commit 7fe2ca680de9c582dba78724fbf0209a444dfca9 -Author: godgamer029 -Date: Thu Mar 26 23:46:12 2020 +0100 - - Mixing it up a little - -commit ef8330cd52bcc64dae57807ce6543299fef827de -Author: godgamer029 -Date: Thu Mar 26 23:37:37 2020 +0100 - - Workaround richards epic logging - -commit 698c6ab91913b89220ea915c8791e488a617620e -Author: godgamer029 -Date: Thu Mar 26 16:37:54 2020 +0100 - - Right - -commit 9449f2e3311197bdb8a84b2f0ca4b74b4eb87165 -Author: godgamer029 -Date: Thu Mar 26 16:34:41 2020 +0100 - - Revert "Gaming?" - - This reverts commit 127bd5bdace6caa9fbddfd469fdcb001199bfb25. - -commit 127bd5bdace6caa9fbddfd469fdcb001199bfb25 -Author: godgamer029 -Date: Thu Mar 26 16:33:27 2020 +0100 - - Gaming? - -commit 957054ec0cd17607553fe43565fcf34ceb14b36a -Author: erwan celanie -Date: Tue Mar 24 20:14:36 2020 -0400 - - added nbt save/load & fix cbe - -commit 4a4c36c2347c1f4f0697ba24c385d5f6a6a8fedb -Author: erwan celanie -Date: Mon Mar 23 22:25:35 2020 -0400 - - minor fixes - -commit b5e5bb58916750e2c635b37c60468ec9ad46feda -Author: erwan celanie -Date: Mon Mar 23 22:09:57 2020 -0400 - - fix - -commit c241ab45d5b4077d7a4a7de08bf99f66f8a7fa38 -Author: erwan celanie -Date: Mon Mar 23 01:20:06 2020 -0400 - - fix bunch of sigs & client instance - -commit 8d8d3d01f623bac85dc4b4e60a10f0bf3a8dc018 -Author: Richard -Date: Wed Mar 18 21:27:22 2020 +0100 - - bruh - -commit 0eaa8e5981cfad55bdf39f78fc557f59366a4003 -Author: Richard -Date: Wed Mar 18 21:26:11 2020 +0100 - - fix - -commit f4969a4e785e3276286c0e13e6158b1dd4a1b6b7 -Author: erwan celanie -Date: Wed Mar 18 15:06:00 2020 -0400 - - fix - -commit e362567b1441305720b4a17f929cf430cc2c33b7 -Author: erwan celanie -Date: Wed Mar 18 14:08:04 2020 -0400 - - added .nbt command/module - -commit 9924631e8f8ad1e8c8ad787491bf291572cde122 -Author: Richard -Date: Tue Mar 17 23:13:14 2020 +0100 - - zoom smooth option - -commit 33b4d92e9011d47a85f740001221832b3a8fbca6 -Author: Richard -Date: Tue Mar 17 20:18:31 2020 +0100 - - fix tracer color - -commit 9bcb2072f2062ef3a9cbce644dba288a3490dabd -Author: Richard -Date: Tue Mar 17 19:56:46 2020 +0100 - - nuker autodestroy - -commit ed235305031335cf8142627caccf6994ef9578b1 -Author: Richard -Date: Tue Mar 17 16:57:11 2020 +0100 - - improved 2d esp - -commit c799fec94107d465cddde647c904f75dfae98990 -Author: Richard -Date: Tue Mar 17 15:32:28 2020 +0100 - - 2d esp is working fine now - -commit 7e6f566d1399b80da62330b69d9e4adca04cf696 -Author: Richard -Date: Tue Mar 17 14:25:28 2020 +0100 - - aimbot lock option - -commit 76fae96de1de046b7519111b8c5c0a698f5137b2 -Author: Richard -Date: Tue Mar 17 10:55:43 2020 +0100 - - add .cbe beehive - -commit 08d2429817818f820c27509bf26443a7a4004869 -Author: erwan celanie -Date: Tue Mar 17 03:13:31 2020 -0400 - - improvements - -commit bf2123bf541654a4e579518be7db75632dab8994 -Author: erwan celanie -Date: Tue Mar 17 02:38:43 2020 -0400 - - clean up - -commit 62f0095def0395aad05ad3f1097517a61090199d -Author: erwan celanie -Date: Tue Mar 17 02:37:57 2020 -0400 - - epic nbt - -commit 6c71cf903b97e996453b0db0c5a01d975b61cc21 -Author: Richard -Date: Mon Mar 16 23:52:41 2020 +0100 - - ok - -commit 05c5c8738f971fb09ad78e88c584997f992ae816 -Author: Richard -Date: Mon Mar 16 23:47:40 2020 +0100 - - more output - -commit e979d0b85c08ac06a4c0941499cb2e1b3103c555 -Author: Richard -Date: Mon Mar 16 23:31:42 2020 +0100 - - fix - -commit ecf4031910b70926ab6dcf7e7538f77be84a27ba -Author: Richard -Date: Mon Mar 16 23:24:07 2020 +0100 - - 2d esp improvements - -commit 7344422619c864fd556e645a93e3506bdefc12c1 -Author: Richard -Date: Mon Mar 16 14:13:22 2020 +0100 - - still not good 2d esp - -commit 4d498a4b95a817b85299b87e7b6c2a5c75f72eea -Author: Richard -Date: Mon Mar 16 09:34:34 2020 +0100 - - make it toggleable - -commit cdac3ec7a0851ee8655b17378d748cd68475537e -Author: Richard -Date: Mon Mar 16 09:32:25 2020 +0100 - - weird 2d esp that still needs some improvement - -commit d6e25d7198ed08d715b3748f8cfc2372f15b4505 -Author: erwan celanie -Date: Sun Mar 15 14:24:26 2020 -0400 - - improve give & soh command - -commit 86d275a183d0c3390b7ef086b536d18d3082327c -Author: erwan celanie -Date: Sun Mar 15 02:27:08 2020 -0400 - - added mojangson parser - -commit 4f5eb54e828d447e18078e33d75346d29841b2d6 -Author: Richard -Date: Sat Mar 14 00:39:20 2020 +0100 - - 2d esp (not yet in release) - -commit bc50f85cd0d7ee0f6c8c38a398c7dc4c1304be11 -Author: Richard -Date: Fri Mar 13 23:29:40 2020 +0100 - - enable log file for release builds - -commit 2cb20117f4bca9be71e13bc817b49dcf438094c5 -Author: GodGamer029 -Date: Sun Mar 8 13:12:32 2020 +0100 - - do be gaming doe - -commit 5db7413f942a0876c19037df4155b69a21cf9bee -Author: GodGamer029 -Date: Sat Mar 7 12:36:43 2020 +0100 - - Fix beta? - -commit 9df21d3aa7fc210f0f1b7e478a69fe6902153c19 -Author: GodGamer029 -Date: Fri Mar 6 17:51:27 2020 +0100 - - Oops - -commit 543ecd5ed78d27d16c3ca4b04254d48880bcea37 -Author: GodGamer029 -Date: Fri Mar 6 17:48:36 2020 +0100 - - Minor fixes - -commit d938387d164d18ad97eea247af96b28c96d02f45 -Author: GodGamer029 -Date: Sun Mar 1 19:45:57 2020 +0100 - - Fix wierd colors - -commit 818541e0f0a65b4d0d549b18fdfb3d825b31128c -Author: GodGamer029 -Date: Sun Mar 1 16:57:38 2020 +0100 - - Add custom Texture & button fix - -commit 43dd281c4fe7e1643b39540241f58636071edabb -Author: GodGamer029 -Date: Sun Mar 1 13:30:27 2020 +0100 - - Fix crash when injector isn't connected yet - -commit 615bd6be0ea15b768162bf356cf38166cc67293d -Author: GodGamer029 -Date: Sun Mar 1 13:22:58 2020 +0100 - - Fix all this module manager mess - -commit fea84a9d337553348a5f8eea45fd763f1c07ade1 -Author: GodGamer029 -Date: Sun Mar 1 13:04:27 2020 +0100 - - Enable Hooks after initialisation of Modules - -commit 0c792b1525e3f11fa2c5cb8c03233291d9fa6b8b -Author: Richard -Date: Sun Mar 1 00:39:18 2020 +0100 - - fix - -commit f4286b58a55cdd4ceca6676c7b59576d57c9818a -Author: Richard -Date: Sat Feb 29 11:36:53 2020 +0100 - - faster cubecraft fly - -commit 59757128c7301c5d9b10abbfac37e91db32eb326 -Author: GodGamer029 -Date: Fri Feb 28 15:19:34 2020 +0100 - - Fix corrupted world bug & add rtti name info - -commit 760dad9e32587ffab4a18dfd1d66b28f64f27ed7 -Author: GodGamer029 -Date: Thu Feb 27 21:43:20 2020 +0100 - - Dont corrupt worlds thanks - -commit 1c4151ed56ccdc20cb40c96cfc1810862e7b6581 -Author: GodGamer029 -Date: Thu Feb 27 21:35:24 2020 +0100 - - Bypass skin pack verification - -commit 53c91822e52206b1ec10b8fc309e10706edc4862 -Author: GodGamer029 -Date: Thu Feb 27 17:17:25 2020 +0100 - - Fixed a crash caused by ChestESP & Minor Tabgui fixes - -commit afc8f9e45d00dc2a7f062a1302208ff3d426e335 -Merge: 7d2c7fe 18a2c6d -Author: GodGamer029 -Date: Thu Feb 27 15:02:33 2020 +0100 - - Merging - -commit 7d2c7febb23202662f4413ced003563d07cffcfc -Author: GodGamer029 -Date: Thu Feb 27 15:01:43 2020 +0100 - - Minor refactors and improvements - -commit 18a2c6dd0e7d935e96ce67035fc93471f95e2ff1 -Author: Richard -Date: Wed Feb 26 19:41:20 2020 +0100 - - autoarmor *should* select the best armor piece - -commit 57d3e33656f22226da95785239d4bce90cad0837 -Author: Richard -Date: Wed Feb 26 14:49:10 2020 +0100 - - if horion is in hidden mode, it will no show a "uninjected" text when uninjecting - -commit 846f5416ea2a198197dfadc9286aa79220d6463d -Author: Richard -Date: Wed Feb 26 12:58:41 2020 +0100 - - add nightmode modifier - -commit c9dffdfa054c635557d1abda8b472681fa091403 -Author: Richard -Date: Tue Feb 25 23:20:57 2020 +0100 - - setprefix command - -commit f974c654dafa8cdda7b68f28f6081799e2b9e647 -Author: Richard -Date: Tue Feb 25 19:53:43 2020 +0100 - - show cps - -commit 922cba6265796f17119b30ab6eeffff8f6accd1a -Author: Richard -Date: Tue Feb 25 14:31:23 2020 +0100 - - fps counter, better coordinates and spacebar keystroke - -commit 9dbc115ceba1000be233f89212fc7c8b8a070af3 -Author: Richard -Date: Tue Feb 25 00:55:50 2020 +0100 - - fix coordinates - -commit d5e3c7b6f9cf8ee7c7186a08d2afb6f718f66e17 -Author: Richard -Date: Mon Feb 24 19:48:40 2020 +0100 - - fix zoom - -commit e81ee6cd09dc662915a543ae6ab02fcda7de8809 -Author: Richard -Date: Mon Feb 24 18:37:12 2020 +0100 - - Searching for command blocks is now done in a new thread - -commit c3ffed5c311f0c8be597e3dcda369c6db761e063 -Author: Richard -Date: Mon Feb 24 18:22:58 2020 +0100 - - epic smooth zoom - -commit da1359c47a5531af6c209b9324db4c482dbbc6e6 -Author: Richard -Date: Mon Feb 24 10:18:56 2020 +0100 - - fix - -commit d8060d2932f7a7938e4164df01e839004648cdcc -Author: Richard -Date: Mon Feb 24 10:07:05 2020 +0100 - - Add AirStuck and Zoom (kinda weird zoom) - -commit 48b1481526ac2669af25393a09298e2b9a4696d0 -Author: GodGamer029 -Date: Sun Feb 23 21:32:06 2020 +0100 - - Bind command improvements - -commit fc0ab2174fc93fcaa72d3bdd7348d341479b9432 -Author: GodGamer029 -Date: Sun Feb 23 17:23:01 2020 +0100 - - Triangle Face Support - -commit 9908c8730b58443f3fb41fb86555eadf2b23d236 -Merge: adb1016 d266e36 -Author: GodGamer029 -Date: Sun Feb 23 15:24:04 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit adb1016ed3154ef4426cdf1a475323b4b7ee94ff -Author: GodGamer029 -Date: Sun Feb 23 15:23:49 2020 +0100 - - Make custom geometry button experimental - -commit d266e369aeb46f92100573778cceb75f5a35bc26 -Author: Richard -Date: Sun Feb 23 11:39:55 2020 +0100 - - NameSpoofer! - -commit ee4321c4ef306fa13cd677388c1edfc61111449e -Author: Richard -Date: Sat Feb 22 17:09:04 2020 +0100 - - update - -commit 08357ce6f1db75832c6723951cea32560b64bfe0 -Author: erwan celanie -Date: Thu Feb 20 13:44:34 2020 -0400 - - fix fly - -commit 444bacfa5cb68b610945541c7650990fd2be34c4 -Author: Richard -Date: Thu Feb 20 18:27:22 2020 +0100 - - epic name change thing - -commit ea17aea68781b3806a51ccd3065b482ee8664d60 -Author: Richard -Date: Thu Feb 20 00:08:46 2020 +0100 - - fix chestaura - -commit 34f1728885436b091b316913254d44c382ef732e -Author: Richard -Date: Wed Feb 19 21:13:42 2020 +0100 - - keystrokes n other stuff - -commit 6f60c6b876a0378815634b5d34beabf23c76e28b -Author: Richard -Date: Tue Feb 18 23:45:15 2020 +0100 - - fix - -commit a89c6239f622994ea352432844cbffb6f9503910 -Author: Richard -Date: Tue Feb 18 21:13:20 2020 +0100 - - cubecraft glide & fix antibots - -commit 5b5865ecd17dc1b37d5ef172a150ed1f72fca00e -Author: GodGamer029 -Date: Tue Feb 18 17:42:55 2020 +0100 - - Add geometry import box - -commit c15496634a63ca039dd20f6c694c73289810c507 -Author: GodGamer029 -Date: Tue Feb 18 16:03:40 2020 +0100 - - Gamer Messages - -commit 0a50a902243889c75c9e7da79521a652e29876ca -Author: GodGamer029 -Date: Tue Feb 18 15:40:04 2020 +0100 - - Fix crash when no texture mappings are found on the skin - -commit 9ae5dd44702db1e00b649a36bc4d24d25b9f9ed0 -Author: erwan celanie -Date: Mon Feb 17 20:48:10 2020 -0400 - - added nbt for mob spawner - -commit 1d3df0beb447d49822b02dc918591e5c481920f2 -Author: GodGamer029 -Date: Mon Feb 17 19:03:37 2020 +0100 - - Make Custom Geometry Beta only - -commit 3dd09da19b27775dbb7083ae0c7acd5e23c49d2b -Merge: 3373210 4460c2b -Author: GodGamer029 -Date: Mon Feb 17 18:42:06 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 337321074739273b018e3a61d76dbf2583b1aa2b -Author: GodGamer029 -Date: Mon Feb 17 18:40:03 2020 +0100 - - Horion connection update - -commit 4460c2b3af7e686d1a94d5c8f1e9febc0781ccc5 -Author: Richard -Date: Mon Feb 17 17:40:54 2020 +0100 - - add noswing - -commit b48deee68ae60d242ee98a1d14b2d7f3d58d68a4 -Author: GodGamer029 -Date: Mon Feb 17 17:35:50 2020 +0100 - - Add thread back - -commit 97b0c083c808da1c2990026f50de730f49b1a4c8 -Author: erwan celanie -Date: Sun Feb 16 17:46:07 2020 -0400 - - fix painting crash - -commit b5bd872dd7bf5ec41659bee528dacca29214dac5 -Author: Richard -Date: Sun Feb 16 22:32:30 2020 +0100 - - test without thread - -commit 3e3a7c30cb3e10fd3b77967367537d1fb1a2b7dd -Author: Richard -Date: Sun Feb 16 22:25:13 2020 +0100 - - epic horion text in main menu - -commit 09f58caf82ec519f631a15b4594579b8cded492c -Author: GodGamer029 -Date: Sun Feb 16 21:48:31 2020 +0100 - - Fix position - -commit 371da1e47001d34bd7c6b24287096734ee9a15c4 -Author: GodGamer029 -Date: Sun Feb 16 21:47:33 2020 +0100 - - Functional - -commit 5bc3045431f1cae65d46524b83bdc9c4a75bad4b -Author: Richard -Date: Sun Feb 16 21:45:32 2020 +0100 - - design - -commit 1b38b0f8b553db82c50f003df4b0db61c2adf074 -Author: GodGamer029 -Date: Sun Feb 16 21:30:22 2020 +0100 - - ImmeadiateGui - -commit 669e1e21c1cb5dc3c5833c72c6aae7813ffefa9f -Author: GodGamer029 -Date: Sun Feb 16 20:26:01 2020 +0100 - - Fix Tabgui animation speed - -commit 2722f186e6610dea057051271354916258c02b45 -Author: GodGamer029 -Date: Sun Feb 16 20:12:20 2020 +0100 - - Make Command block exploit beta only - -commit 776d9a8773d42e450905e344784dc2367a0593c7 -Author: GodGamer029 -Date: Sun Feb 16 20:10:30 2020 +0100 - - Fix Injector connection screen not showing - -commit 1efc51927fd7bfe2bc0302f94b5654f700a7ab01 -Author: GodGamer029 -Date: Sun Feb 16 19:51:30 2020 +0100 - - Fix unepic beta exploit - -commit 42623be5bb6239b0074cb173884f3657122fa78c -Author: GodGamer029 -Date: Sun Feb 16 19:48:55 2020 +0100 - - Add Beta config - -commit e7dfbd854953febcf3913dafe108dcb216766a6a -Author: Richard -Date: Sun Feb 16 19:44:46 2020 +0100 - - kinda fix airswim - -commit 03c7118617e4935e82184d283f7bcffa93b924ee -Author: GodGamer029 -Date: Sun Feb 16 19:38:48 2020 +0100 - - Fix Click Gui animations - -commit 5273d4f371c5dd065a7b11a04540322e0e80ed86 -Author: GodGamer029 -Date: Sun Feb 16 19:08:45 2020 +0100 - - Fix ClickGui background - -commit c03ad76020c70690eef3af98842639be741ede52 -Author: GodGamer029 -Date: Sun Feb 16 18:35:16 2020 +0100 - - crash fix - -commit 5bfa595e3c4e39c5da818b3546d0f116f677a092 -Author: GodGamer029 -Date: Sun Feb 16 18:24:50 2020 +0100 - - Minor Performance improvements - -commit f846f653df1e844eaa3546f3cd7c9713da94dd4a -Author: GodGamer029 -Date: Sun Feb 16 18:12:27 2020 +0100 - - Only draw gui once per frame - -commit 923fe7b7df7601eb1279611262d7df091ad90b56 -Author: GodGamer029 -Date: Sun Feb 16 17:17:38 2020 +0100 - - Hot swap skins - -commit bdb175e2095e3db53dfef3c2ce4eaa406cfef2a3 -Author: Richard -Date: Sun Feb 16 12:26:05 2020 +0100 - - hotfix - -commit 7859695440ca9fc32919f4e9ab0de71681f864b4 -Author: Richard -Date: Sun Feb 16 11:51:11 2020 +0100 - - fix command blocks closing after remote opening them - -commit 48a4a6b65afad289b700419b57683819d419b4c4 -Author: Richard -Date: Sun Feb 16 01:42:26 2020 +0100 - - fix tabgui use in menu/chat - -commit bd1090d25c9a8c0ceee77d6de3210b1d1c8c45a9 -Author: GodGamer029 -Date: Sun Feb 16 01:11:59 2020 +0100 - - fix - -commit b7dd2194efe262a9989b1379dd057c9bd0a0996d -Merge: f8fe764 88337d9 -Author: GodGamer029 -Date: Sun Feb 16 01:11:06 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit f8fe7649a429e4e32a973658fd22d12eda8c27a5 -Author: GodGamer029 -Date: Sun Feb 16 01:10:57 2020 +0100 - - config - -commit 88337d909a21f5df4358cdfea605a47a76a8ca9a -Author: Richard -Date: Sun Feb 16 01:02:12 2020 +0100 - - fix - -commit 2567ad69155b3e6cbdb7911bfdf139c65cfab956 -Author: Richard -Date: Sun Feb 16 00:50:34 2020 +0100 - - add showarmor option to hud - -commit d5619efc63228a32397a66277cda7a0d5407fc6e -Author: GodGamer029 -Date: Sat Feb 15 15:30:38 2020 +0100 - - Simplify Some Modules - -commit f64a4db5f0615906d0ff18058282ba6e931b6be2 -Author: Richard -Date: Sat Feb 15 14:20:32 2020 +0100 - - another fix - -commit 11ecad1b86ea9b6eaa01cdbe0b9b1754b1abc887 -Merge: f60e37e 1d3c04c -Author: GodGamer029 -Date: Sat Feb 15 14:19:50 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit f60e37e7109e2112eb4a724c78317fdd52b47d7c -Author: GodGamer029 -Date: Sat Feb 15 14:18:41 2020 +0100 - - Autocomplete & Performance enhancements - -commit 1d3c04cc2e248c59afd41f9d3c864206078678a6 -Author: Richard -Date: Sat Feb 15 14:09:53 2020 +0100 - - fix and improve tracer - -commit 807a8bb3aa5b17cd616c07ceab04cebe74d45383 -Author: Richard -Date: Sat Feb 15 12:53:48 2020 +0100 - - config manager - -commit 3eeb3cc29da38fc2a439ef6b679efa68d3442517 -Author: Richard -Date: Sat Feb 15 11:56:01 2020 +0100 - - fix command block opening multiple times - -commit 4d5a8d4061bc452ec6f6941cecadbe9fa4c88474 -Author: Richard -Date: Sat Feb 15 11:48:13 2020 +0100 - - commandblockexploti command to find and remote open - -commit 9dc93f0bb7627176ee057c09645ca98f969ece32 -Author: Richard -Date: Tue Feb 11 22:48:58 2020 +0100 - - fix - -commit f3e3a5c01f14d8f7d5e07c1565f9307a5f14129a -Author: Richard -Date: Tue Feb 11 22:38:08 2020 +0100 - - fix cut off usernames - -commit 4c446de31952cd9ab8bb88a408904f0bd73d8a8a -Author: Richard -Date: Tue Feb 11 21:53:25 2020 +0100 - - fixes (command block exploit now works on chain and repeat command blocks, chestaura does use the given chest open function and teleport doesnt set position when in menu) - -commit ba9a259ede57da94c5d2b3199efe6386fb17f6ed -Author: GodGamer029 -Date: Tue Feb 11 20:10:11 2020 +0100 - - Get Beta :tm: - -commit caf915b442ef08eedd68263f12fd6c01d98e15b3 -Author: erwan celanie -Date: Mon Feb 10 20:54:46 2020 -0400 - - command block exploit - -commit ed8a09ddd7abf50907053b9bba7c03e643cdf8a7 -Author: Richard -Date: Sun Feb 9 20:19:39 2020 +0100 - - improved teleport quality - -commit 2be05a753e660dc6d1807c1fcfa6d1f74de8f847 -Author: Richard -Date: Sun Feb 9 18:07:52 2020 +0100 - - Create LICENSE - -commit 00dca412aa185cdd90f35569ab111e11f2aa1704 -Author: Richard -Date: Sun Feb 9 18:03:05 2020 +0100 - - add license information - -commit ab506b522ee7360a264105a4e9298a042feb3f76 -Author: Richard -Date: Sun Feb 9 17:46:26 2020 +0100 - - teleport hive bypass + working fucker - -commit 6d46071c3b017b3e4b298e2cc958af5221e0d06a -Author: GodGamer029 -Date: Sun Feb 9 12:43:43 2020 +0100 - - Make NightMode its own module - -commit 28240780a009f5735ee78c89a4ad9b4e8f4b12b5 -Author: GodGamer029 -Date: Sun Feb 9 12:18:55 2020 +0100 - - Fix Crash - -commit 23c63b732783879af9cb9da95e805b5a12eaaf25 -Author: GodGamer029 -Date: Sat Feb 8 23:23:01 2020 +0100 - - gaming - -commit 958a4a816405135a15ea89d36783bf7f3a55e4fd -Author: GodGamer029 -Date: Sat Feb 8 23:14:47 2020 +0100 - - Fix shadow-text bug - -commit ef995a3f5409af1a27ad5588958b55960b374755 -Author: GodGamer029 -Date: Sat Feb 8 22:27:48 2020 +0100 - - Remove unnecessary allocations - -commit 67dac2d3fdc56267ea66b5d9a324ec5b4bba394e -Author: Richard -Date: Sat Feb 8 21:06:45 2020 +0100 - - add autosprint alldirections option - -commit 632e97e5d92e79eea9c109edbfdb852cda8a5958 -Author: Richard -Date: Sat Feb 8 15:33:12 2020 +0100 - - better nametags that actually show a players armor - -commit 957993867f170d0261a3e5c1803783935d73baa5 -Merge: 58c3081 167e9a8 -Author: GodGamer029 -Date: Fri Feb 7 21:13:43 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 58c3081ad3f506e66e47f6cdc0a5d9927769707a -Author: GodGamer029 -Date: Fri Feb 7 21:13:29 2020 +0100 - - Zepellin - -commit 167e9a8d7770a11e34505d25412557a630108ce5 -Author: GodGamer029 -Date: Thu Feb 6 13:27:06 2020 +0100 - - Update .gitignore - -commit 34d98ce11568aa1a3cfa9e278471632df1e3a9b7 -Author: erwan celanie -Date: Wed Feb 5 23:54:51 2020 -0400 - - fix - -commit a359326f079bb420e3da906efad9c5673d2bee03 -Author: erwan celanie -Date: Wed Feb 5 12:15:49 2020 -0400 - - added not really working drawImage function - -commit 015dd21820d238047c7309167c13494531d95d29 -Author: GodGamer029 -Date: Tue Feb 4 14:10:19 2020 +0100 - - Yeet the heap - -commit 76e82eaf3785cd8c403100e80a9dcccfca8244be -Author: GodGamer029 -Date: Tue Feb 4 13:52:10 2020 +0100 - - Fix ArmorHud for 1.14.20 - -commit 126eed893fc2b5b3870655e4394d8b9a3fa43597 -Merge: 9461a67 cb389ab -Author: GodGamer029 -Date: Tue Feb 4 13:42:59 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 9461a6726655dcefff415bb71fb1e28eb193a731 -Author: GodGamer029 -Date: Tue Feb 4 13:42:47 2020 +0100 - - gamer tractor - -commit cb389aba5531b5c28e3ecfcde4ce5bca438f4340 -Merge: c8fa7cc dea3723 -Author: erwan celanie -Date: Tue Feb 4 00:23:27 2020 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit c8fa7ccc3edcb0caadef0400c014a27776542eec -Author: erwan celanie -Date: Tue Feb 4 00:22:55 2020 -0400 - - epic ArmorHud - -commit dea3723185cbab28cf29346028e56b80b41f4fbf -Author: Richard -Date: Sun Feb 2 16:25:23 2020 +0100 - - ready for beta release - -commit ec49d502ec2ec37538a87e02154aaad51836bac8 -Author: Richard -Date: Sun Feb 2 14:08:43 2020 +0100 - - fix clickgui - -commit 1661defcc23ae7f4ce8c7ddf6aff509325d71f2f -Author: GodGamer029 -Date: Sun Feb 2 13:53:15 2020 +0100 - - Fix formatting - -commit 8e67f12243d55a29fd07cb19cceefcc564e239b2 -Author: GodGamer029 -Date: Sun Feb 2 13:51:44 2020 +0100 - - Improve Yoda performance - -commit a735bc32b7563dc8225c554345997579bd03f6c2 -Author: GodGamer029 -Date: Sun Feb 2 13:11:13 2020 +0100 - - Ok gamers, here's your yoda - -commit 261bd401c3a6e0e19cfddfe5605cea49af7050f9 -Author: Richard -Date: Sun Feb 2 11:23:12 2020 +0100 - - crystalaura autoplace, autoclicker hold option, silent bowaimbot - -commit 1d12b70fe28760517a3c7ea37d33b38b0b3648e9 -Author: erwan celanie -Date: Sat Feb 1 19:48:29 2020 -0400 - - epic arraylist animation - -commit 90bcf5567d9c06a201f201d60f253d22515c31fe -Author: Richard -Date: Sat Feb 1 23:25:38 2020 +0100 - - changed colors to light theme - -commit a07ecd82cccbfca369d4ad2a7b265e3f9154a8e9 -Author: GodGamer029 -Date: Sat Feb 1 19:36:23 2020 +0100 - - Yoda skin - -commit 5429223a496ec142a3f602dbd9679647178ab841 -Author: GodGamer029 -Date: Fri Jan 31 15:37:12 2020 +0100 - - Fix Inventory Cleaner not dropping all armor - -commit 26f5e9211bd006f02fcc5177623d5e2e6688c43d -Author: GodGamer029 -Date: Fri Jan 31 14:57:22 2020 +0100 - - TabGui lookin kinda sick doe - -commit a6c722fb64c716eb1608d7da900c0e7da41c6730 -Author: GodGamer029 -Date: Fri Jan 31 14:45:48 2020 +0100 - - Not sure about this one either - -commit 9714bb4d187f896eb51d386e1e7891a9fd2a7979 -Author: GodGamer029 -Date: Fri Jan 31 14:43:46 2020 +0100 - - bruh why did i do this - -commit 9e37efe515b6690b7a3974aa02855b651a82054f -Author: GodGamer029 -Date: Fri Jan 31 14:40:52 2020 +0100 - - gamer moment - -commit b66e4a606d0b25ca6435b9a10d432d3c5d264e9a -Author: GodGamer029 -Date: Fri Jan 31 13:56:49 2020 +0100 - - Fix - -commit be88c51233b1357735c6a0d099bf1c76b2f02332 -Author: GodGamer029 -Date: Fri Jan 31 13:44:17 2020 +0100 - - Fix Tower & Scaffold - -commit e05960aee9c1f89938e13b69c1813bfd6640c6cb -Author: GodGamer029 -Date: Fri Jan 31 13:34:33 2020 +0100 - - oops my bad - -commit 1176d4e977d5901cad7f195a29d7b8a1c973384b -Author: GodGamer029 -Date: Fri Jan 31 13:28:38 2020 +0100 - - Fix Click Gui Mouse bug - -commit 7c973ec8e4b930e0c743827be17619408af5feca -Author: GodGamer029 -Date: Fri Jan 31 13:16:18 2020 +0100 - - Remove some stupid allocation - -commit 97e99a61799da927cba15cf78682b51dabc08b7e -Author: GodGamer029 -Date: Fri Jan 31 12:41:03 2020 +0100 - - XOR all signatures - -commit 320bf55bfaece317f3b6e42eea80c0c0a17c457c -Author: GodGamer029 -Date: Fri Jan 31 12:07:31 2020 +0100 - - TabGui animations - -commit 2f41d50344fc0b5598f6a41d0df7422372e7b4a4 -Author: GodGamer029 -Date: Fri Jan 31 11:42:10 2020 +0100 - - Cool colors - -commit d86d134bf15ccaa8f52fbb2fbeaa01712c612dfb -Author: GodGamer029 -Date: Fri Jan 31 11:33:59 2020 +0100 - - Rearrange code related to the logo - -commit 94137e5f039358e4d299c32bd7061ac85891c758 -Merge: 7c4d746 1f0f2bd -Author: GodGamer029 -Date: Fri Jan 31 11:08:33 2020 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 7c4d74640d31922916752b6191ec1f383080673b -Author: GodGamer029 -Date: Fri Jan 31 11:08:27 2020 +0100 - - honestly no idea what the fuck git wants me to do - -commit 1f0f2bde30eb1e3b57d813c75c79bfc6fa9a1b71 -Author: Richard -Date: Thu Jan 30 23:07:21 2020 +0100 - - this - -commit 850b7efc7ce5810530cef1933ad393e007abf73f -Author: Richard -Date: Thu Jan 30 19:09:39 2020 +0100 - - changes - -commit 70062246559b125752a090c1603e7515e0ebd177 -Author: GodGamer029 -Date: Thu Jan 30 18:28:34 2020 +0100 - - Fix formatting - -commit 5f16de89c4f7d967a46fa19335f4b90f9a5c59e8 -Author: GodGamer029 -Date: Thu Jan 30 18:25:57 2020 +0100 - - Fix AppSuspendedHook - -commit 8732372a28117a4ae11fb8169b75e14451d66f94 -Merge: 2941c79 7cd0913 -Author: GodGamer029 -Date: Thu Jan 30 07:28:03 2020 +0100 - - Merge pull request #245 from GrelTheL/master - - Update discord link & move CrystalAura to combat - -commit 7cd091306b2cc58ba2d1caf3c9b6b801ac27651a -Author: GrelTheL <59349394+GrelTheL@users.noreply.github.com> -Date: Tue Jan 28 04:36:36 2020 +1100 - - ez - -commit 231f2adc23b238cc77ac9c2c7f09c5f0cef6f906 -Author: GrelTheL <59349394+GrelTheL@users.noreply.github.com> -Date: Sat Jan 25 12:03:49 2020 +1100 - - Update README.md - -commit 2941c792af0abe854311e5c7d75e8c1d9e955f6c -Merge: b33a847 586645a -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Fri Jan 24 19:51:29 2020 -0400 - - Merge pull request #244 from S-B99/master - - Fix discord link in readme - -commit 586645a38d6477f5cdec8b06e2da9203777b98e1 -Author: Bella Who -Date: Fri Jan 24 18:38:18 2020 -0500 - - Fix discord link in readme - -commit b33a84719ed500b72b5714f7add3ed3fb85c2dcf -Author: GodGamer029 -Date: Mon Jan 6 19:38:39 2020 +0100 - - "Fix" crash - -commit e2d2ab68c39a37a1999e66e98b6f2195d11e6d2b -Author: GodGamer029 -Date: Sat Jan 4 15:06:10 2020 +0100 - - Use msvc for Debug Builds as well - -commit 6b7b37ea622634b407fbbde2e7d8bf9c0e995dbb -Author: GodGamer029 -Date: Sat Jan 4 14:24:45 2020 +0100 - - Clang optimizations - -commit 8821d6dce6f448a3fa14cf78fd008d58f9ae777b -Author: GodGamer029 -Date: Sat Jan 4 13:18:36 2020 +0100 - - Use clang - -commit 46bd033be9a57ecb51662ee0825af05128a883ec -Merge: b04256e e1dd0e9 -Author: erwan celanie -Date: Mon Dec 30 12:01:25 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit b04256e70b7f5fabf087ed0da2c250c82dff9f36 -Author: erwan celanie -Date: Mon Dec 30 12:01:02 2019 -0400 - - Nofall now works on all servers - -commit e1dd0e9d51287b8f7004f9eca8453ad8b11b1280 -Author: GodGamer029 -Date: Fri Dec 27 21:35:54 2019 +0100 - - Format all other files - -commit cd01e9899871776928084c88f0492726427d81b5 -Author: GodGamer029 -Date: Fri Dec 27 21:32:53 2019 +0100 - - Format Commands - -commit 30b69469e61c24d1d481b99d8a0d5927bd817de2 -Author: GodGamer029 -Date: Fri Dec 27 21:27:05 2019 +0100 - - Format Modules - -commit d7c3e9798a4ed310520ad96d4e4e94983bdd3d73 -Author: GodGamer029 -Date: Fri Dec 27 21:19:35 2019 +0100 - - Format SDK and importan Files - -commit d9ed32e7ff76c6f8ea507b3fc43950bdf9ccd98a -Author: GodGamer029 -Date: Fri Dec 27 21:03:23 2019 +0100 - - Changes to clang-format - -commit c42d6d00f00599fe69f7beaadbac550795067a1b -Author: GodGamer029 -Date: Fri Dec 27 20:59:13 2019 +0100 - - Add clang-format - -commit f61345bb951018a1baa59501e882ea0ae7a48285 -Author: erwan celanie -Date: Fri Dec 27 11:09:58 2019 -0400 - - fix - -commit fe74a25dcdc3ec84615a69220293c65ce5087046 -Author: erwan celanie -Date: Fri Dec 27 11:05:21 2019 -0400 - - added timer - -commit 30aafdbde389a7ef22272ffcdae46d810f6a3cd5 -Merge: ab58cca c6a92ba -Author: erwan celanie -Date: Wed Dec 25 12:54:13 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit ab58ccaf261c9f956ee961df96ae16e9fbe7d5aa -Author: erwan celanie -Date: Wed Dec 25 12:53:58 2019 -0400 - - improved crasher - -commit c6a92ba9c0f26448a89b05251e8a73f839b1f83f -Merge: 534de8f a1e59c3 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Wed Dec 25 11:33:42 2019 -0400 - - Merge pull request #220 from brandonr1337/master - - Added Crystal Aura - -commit 534de8f7461f696f9d1caa632f0c1ae10be50710 -Author: erwan celanie -Date: Tue Dec 24 13:55:56 2019 -0400 - - support for 1.14.0 - -commit 2a648cc288a3db6f1757db76613d5593bb6ad39e -Author: GodGamer029 -Date: Sat Dec 21 14:04:15 2019 +0100 - - Better naming - -commit a1e59c3eaa5672488387ff75ba0a0f14ca968bfa -Author: n -Date: Sat Dec 21 12:56:06 2019 +0000 - - Temporarily Removed The Block Reach Option While I Fix - -commit 4d127b84321245bdb252c40edfd5d5b253777fc2 -Author: n -Date: Sat Dec 21 11:10:35 2019 +0000 - - Update CrystalAura.cpp - -commit 89411224c90260f9465edc0eee7f9413fdf3eb82 -Author: n -Date: Sat Dec 21 11:04:47 2019 +0000 - - t e s t i n g - -commit 00c3bd92d91de671b3116edb19c82a9cc2d66b4c -Author: erwan celanie -Date: Fri Dec 20 20:48:09 2019 -0400 - - fix text - -commit 2fce601af66c7a5d71e753e74dea64facac563e6 -Author: Richard -Date: Sun Dec 15 17:44:00 2019 +0100 - - fixed spelling and added onlyinv check to inventorycleaner - -commit 57cc62f9079334a4ee18f34620c0b7862e205d04 -Merge: 37fd911 ef74ef9 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Dec 15 00:05:18 2019 -0400 - - Merge pull request #204 from Johnmacrocraft/fix-build - - TestModule: Fix release build - -commit 37fd9111e97246fc50f502954c12f1aa47526ec1 -Author: erwan celanie -Date: Sat Dec 14 23:49:35 2019 -0400 - - added realm crasher - -commit ef74ef930f24a3bdca3cafee7ced8916c5ba63ea -Author: Johnmacrocraft -Date: Sun Dec 15 12:23:21 2019 +0900 - - TestModule: Fix release build - -commit c11c4dd4ffdaf9842a0c7008fd8d82af5dd41ec1 -Merge: 663a036 320e2f3 -Author: erwan celanie -Date: Sat Dec 14 23:14:38 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit 663a0364a5214925a1e092b388b9318164211ec8 -Author: erwan celanie -Date: Sat Dec 14 23:14:22 2019 -0400 - - fix crash - -commit 320e2f3981d310aa3778707dcee4d364790eafc7 -Author: GodGamer029 -Date: Sun Dec 15 00:05:24 2019 +0100 - - Epic TestModule - -commit 160e03c58232760956bc28329893547fa895e42a -Author: GodGamer029 -Date: Sat Dec 14 22:21:38 2019 +0100 - - Fix antibot - -commit 8e9260e45568417e3bc454d5e6d08f5204d34569 -Author: GodGamer029 -Date: Sat Dec 14 21:58:04 2019 +0100 - - Fix Inventory Cleaner & AutoArmor - -commit a8c85b671c0cb7a6e7d9f7e7b27e207c0eacd356 -Author: GodGamer029 -Date: Sat Dec 14 16:30:17 2019 +0100 - - Fix Auto Armor - -commit f810d0c5119b4ef2bd1ed15964963b786e974c5b -Author: GodGamer029 -Date: Sat Dec 14 15:10:28 2019 +0100 - - Fix Click Gui Tooltips - -commit 79c061425ba5767603c4ca7565f346f7e2d582fb -Author: GodGamer029 -Date: Sat Dec 14 14:51:06 2019 +0100 - - Fix Text - -commit 2475fb6351c5dd2d528d5d5f8e2beff874225c79 -Author: erwan celanie -Date: Thu Dec 12 19:24:05 2019 -0400 - - fix x-ray - -commit 07ce40512a2287a805b49496f45335273359ddc8 -Author: erwan celanie -Date: Thu Dec 12 16:17:56 2019 -0400 - - fix .give & .soh - -commit e831f0bbd3dfaa9dd85775abcd2e41b32ead4311 -Author: erwan celanie -Date: Wed Dec 11 23:52:58 2019 -0400 - - fix esp & spammer - -commit 2554c9e5da29a14b17702149fbfafe096f6c8124 -Author: erwan celanie -Date: Tue Dec 10 23:04:20 2019 -0400 - - fix forEachEntity callback - -commit 8cd7a2083ea9688d2f6ae151469a7753a0e7b82a -Author: erwan celanie -Date: Tue Dec 10 21:55:33 2019 -0400 - - fix sigs & sendChatMessage Hook - -commit 804fd8f79d119f0392f571b30214773aefe5f4e1 -Author: erwan celanie -Date: Tue Dec 10 18:43:21 2019 -0400 - - fix ClientInstance vTable - -commit e7410be892357878b16f434b6f971e6b6263b3a3 -Author: GodGamer029 -Date: Tue Dec 10 17:33:05 2019 +0100 - - Experimental 1.14 build - -commit eaad8abd575709cdfe574ec91cd48469b5d160b6 -Author: erwan celanie -Date: Sun Dec 1 15:43:22 2019 -0400 - - fix Killaura not working on ng - -commit b5d0c79dab54168932f644950c769d51033c5777 -Author: erwan celanie -Date: Sun Dec 1 15:21:53 2019 -0400 - - Improvements - -commit 24b47078a7878dde239df6671ff273bce3d03073 -Author: GodGamer029 -Date: Thu Nov 21 15:29:37 2019 +0100 - - Possibly Fix an injector bug - -commit 9e38ba6bf5d154974fe3b8e7208a43b70f1f416b -Author: GodGamer029 -Date: Wed Nov 20 20:48:42 2019 +0100 - - Fix azure - -commit 2d64c6f74a0286da400e9c5f5308f4e6e6a70e02 -Merge: 9a14702 454c425 -Author: GodGamer029 -Date: Wed Nov 20 20:25:41 2019 +0100 - - Enforcing the use of the new Injector - - Also updates Json.hpp and fixes a bug in IntelliSense - Opens up various opportunities for doing stuff outside the sandbox - -commit 454c425591325b00162d297d77f3232ffcb7b0b3 -Author: GodGamer029 -Date: Wed Nov 20 20:03:03 2019 +0100 - - Finishing up the new injector - -commit acee37a95f38a84d2a3e330d6b2e06defbb0dbc5 -Author: GodGamer029 -Date: Mon Nov 18 15:46:29 2019 +0100 - - Transmit Account Information, update Json & allow enabling WIP features - -commit 5d8d7987cc0876197c7c5f0d4790e0617d1646df -Author: GodGamer029 -Date: Mon Nov 18 12:42:58 2019 +0100 - - Lower timeout a bit, connection is now stable - -commit 28084c98d28ca146767c312b372407521f150860 -Author: GodGamer029 -Date: Sun Nov 17 23:19:33 2019 +0100 - - Packets are a thing now - -commit 7bbdaef9966aa5e6c0121e34e03102782db0913a -Author: GodGamer029 -Date: Sun Nov 17 18:21:24 2019 +0100 - - Initial Connection accomplished - -commit 9a1470285a01feca25a84781e09cf48a41073565 -Author: GodGamer029 -Date: Sun Nov 17 00:50:10 2019 +0100 - - invcleaner - -commit 1fee3b25016bf55e6e660147c210f8139a9c55e1 -Author: Richard -Date: Sat Nov 16 23:14:57 2019 +0100 - - yeet - -commit 7c00a40acc1516431a42239118e46e2250d64521 -Author: GodGamer029 -Date: Sat Nov 16 20:48:58 2019 +0100 - - Epic Raknet fix - -commit 2b5a7f0e6b03ebd08b9f126f4045ed4a96311f6f -Author: GodGamer029 -Date: Sat Nov 16 20:19:07 2019 +0100 - - Disable Gamer skin for Beta Builds - -commit b27a1b1d019619fc6bd0e1a68345abc7e6e26dfa -Author: GodGamer029 -Date: Sat Nov 16 19:46:26 2019 +0100 - - Epic horion gamer skin - -commit 97f3f4d3fcd59eb49dba2cea7aa1646f61db36cd -Author: GodGamer029 -Date: Sat Nov 16 17:29:54 2019 +0100 - - Make cool gamer skin available to everyone - -commit f824b4738ed459df07b88effc01556d855ec1484 -Author: Richard -Date: Sat Nov 16 14:53:27 2019 +0100 - - Killaura now aims at targets (serverside) - -commit aa0d6d0421d2f993760fea217216e24f260be1c6 -Author: GodGamer029 -Date: Sat Nov 16 01:23:02 2019 +0100 - - Trigger ci - -commit f64f1d691d5c049c30d274cfc60aa6f704b2045d -Merge: d21e6e6 fd300ff -Author: GodGamer029 -Date: Sat Nov 16 00:16:49 2019 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit d21e6e6991ebf559a48139b7523337ff5973be63 -Author: GodGamer029 -Date: Sat Nov 16 00:16:27 2019 +0100 - - Gamer Skin - -commit fd300ffecc5a5f3895887bde946ccf68abab2930 -Author: Richard -Date: Sat Nov 16 00:06:58 2019 +0100 - - hey we got text shadow - -commit ab664be724c12e909a48776a33a9fb33600bcfda -Author: Richard -Date: Fri Nov 15 23:53:20 2019 +0100 - - Some fixes, improved InventoryCleaner - -commit ea3776dd122966107a8bfa8e0e9c7721d9617a89 -Author: Richard -Date: Thu Nov 14 20:01:32 2019 +0100 - - Several bug fixes. - -commit f8997299d41f7e13de1da43dcaafb8ec04ba1808 -Author: GodGamer029 -Date: Tue Nov 12 18:24:01 2019 +0100 - - Fix epic Xray bug - -commit c3008e8ac8e9fec7498babcaea7c04b42d7824a4 -Author: GodGamer029 -Date: Tue Nov 12 18:13:42 2019 +0100 - - i hav stork - -commit 25e02c68c82197c34be216f7d3f866f76909b977 -Author: GodGamer029 -Date: Tue Nov 12 18:04:14 2019 +0100 - - Fix unepic .give bug - -commit 465ff3f5d56c1e2e2b40b967e50ac046205b6971 -Merge: 8ba2de2 de86bb5 -Author: erwan celanie -Date: Mon Nov 11 12:47:59 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit 8ba2de25a53e8f150f9d4a7fd4cbedb4cca41b6d -Author: erwan celanie -Date: Mon Nov 11 12:47:49 2019 -0400 - - fix blink & freecam - -commit de86bb524c7a001e65228ad664f93b78968d5459 -Author: Richard -Date: Mon Nov 11 17:01:54 2019 +0100 - - Updated ServerCommand to also show Port, fixed SayCommand and Spammer to work on Cubecraft - -commit 7872eef99b9331a885686d67fc55ec7360e2d413 -Author: erwan celanie -Date: Sun Nov 10 20:34:31 2019 -0400 - - PacketLogger - -commit 081b169375bff79943bcc0569f3b3b030fd3761b -Author: Richard -Date: Sun Nov 10 22:29:44 2019 +0100 - - Added setting to show/hide keybinds in arraylist - -commit e4be249e3e19c61fee10490fa7715a2cd40661fc -Author: erwan celanie -Date: Sun Nov 10 00:55:34 2019 -0400 - - fix - -commit 93dab2002e85d9bb1ccbd11e69fe7c342e7e8a2e -Merge: 0f81bcf 319ae4c -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sat Nov 9 11:15:23 2019 -0400 - - Merge pull request #151 from OhBoyItsGrelAgain/OhBoyItsGrelAgain-patch-1 - - Update Fcker.cpp and Fcker.h to support chests and barrels - -commit 0f81bcfc84e557b44caab871ba89b13d7da335ac -Merge: 345d36e 7fbfcc1 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sat Nov 9 11:15:12 2019 -0400 - - Merge pull request #150 from Johnmacrocraft/fix-stuffs - - Fix 9ab1bdd9b928b657134a00d6974eb164a3364c33 - -commit 319ae4c0c0713549c9c90aca2cb1eaeb30d9975e -Author: OhBoyItsGrelAgain <57557404+OhBoyItsGrelAgain@users.noreply.github.com> -Date: Sat Nov 9 19:21:30 2019 +1000 - - Update Fcker.cpp to support chests and barrels. - - Option turned off by default because it may wreck the user's base accidentally. - -commit 3f17260da55f6f11c18c74cd953703cc5895a5f9 -Author: OhBoyItsGrelAgain <57557404+OhBoyItsGrelAgain@users.noreply.github.com> -Date: Sat Nov 9 19:19:06 2019 +1000 - - Add chest and barrel bool in Fcker.h - -commit 7fbfcc181f5665f7b40f77c62bb654b196f16378 -Author: Johnmacrocraft -Date: Sat Nov 9 17:25:29 2019 +0900 - - Fix 9ab1bdd9b928b657134a00d6974eb164a3364c33 - - Also minor code style fix - -commit 345d36e1efca451aee0b85a4479ac83e626d35bd -Author: erwan celanie -Date: Sat Nov 9 01:38:23 2019 -0400 - - somehow fix noSlowDown - -commit 9ab1bdd9b928b657134a00d6974eb164a3364c33 -Author: erwan celanie -Date: Sat Nov 9 01:04:29 2019 -0400 - - fix chestStealer,itemData with .give &bunch of others stuffs - -commit 3e8f10d3fec42b87c1a4a15048006bb6e8dba2b6 -Merge: e588f3d 255fc5a -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Fri Nov 8 19:53:55 2019 -0400 - - Merge pull request #146 from Johnmacrocraft/improve-give-and-dupe - - Improve .give, .enchant and .dupe - -commit e588f3d296110ba7a003ace708b59e197172b771 -Author: Richard -Date: Sat Nov 9 00:19:09 2019 +0100 - - Better ArrayList gradient animation - -commit 286973a303caca49e500e91e2fee2ace1c8b8a59 -Author: Richard -Date: Fri Nov 8 21:03:54 2019 +0100 - - kinda weird rainbow animation - -commit 28667110cb064edc2ad5c6e9cf2cfd46570b6d45 -Author: Richard -Date: Fri Nov 8 17:13:49 2019 +0100 - - Update (Beta Channel) - - Damage Command now toggles NoFall automatically - - Aimbot require click now works - - Fixed TriggerBot - -commit 255fc5aae3bf2495aba2bc04f193852b705e406c -Author: Johnmacrocraft -Date: Fri Nov 8 15:33:11 2019 +0900 - - Missed one - -commit 263a1483983e8a423921447d348bf5959ce62c59 -Author: Johnmacrocraft -Date: Fri Nov 8 15:30:44 2019 +0900 - - I am the harbinger of consistency - -commit 35929750c147183e9e8795129eb58c442d7dfbeb -Author: Johnmacrocraft -Date: Fri Nov 8 15:20:49 2019 +0900 - - Added some code "just in case" - -commit 99f0ad3e2d50116cedd8b6851bc7b041e7097c62 -Author: Johnmacrocraft -Date: Fri Nov 8 14:54:04 2019 +0900 - - Improve .give, .enchant and .dupe - - - .give and .enchant once again works correctly on Mineplex - - .dupe is now fully automated just like .give and .enchant (the previous method is still available) - -commit 50c92bedefa017cc8022a542640d886682f00d0e -Author: erwan celanie -Date: Thu Nov 7 21:18:58 2019 -0400 - - fix freecam - -commit 441e9a9cf322fbf02ec5d89e0f90d5e4cff1779f -Author: erwan celanie -Date: Thu Nov 7 21:16:21 2019 -0400 - - fix airswim , blink,fly & glide - -commit 52438e6db18e561581e3f7c65d32d7507e1d7525 -Author: Richard -Date: Thu Nov 7 19:19:58 2019 +0100 - - Fixed ESP and other stuff - -commit f4392777727f8cbdbf1314bf8fbe0e0410d780f3 -Author: Richard -Date: Wed Nov 6 22:06:10 2019 +0100 - - I added some not so good working derp - -commit 16f9e1554b35946df2a7d69df59a91cd10d2d9e5 -Author: Richard -Date: Wed Nov 6 21:24:51 2019 +0100 - - Update (Beta Channel) - - Improved AntiBot checks - - Improved InventoryCleaner - - Log file is now named logs.txt - - - GAMER FONT IS GONE :CRABRAVE: (survivor please dont hate me) - -commit a63dafba2ea951becab5b1574865e3c720575cd1 -Author: erwan celanie -Date: Wed Nov 6 00:15:33 2019 -0400 - - fix Bhop ,InventoryMove,Tower , - Airrjump,GameSettingsInput - -commit 5757d2f8259d5817e017f963b6958b377deb2811 -Author: erwan celanie -Date: Tue Nov 5 22:09:54 2019 -0400 - - fix .enchant completely - -commit 5cb7cd61cbfddc11e48c44bc67a071d72214000b -Merge: 82bb885 c2ae3b6 -Author: GodGamer029 -Date: Tue Nov 5 14:10:47 2019 +0100 - - Merge pull request #137 from Johnmacrocraft/fix-chestesp - - Fix ChestESP - -commit c2ae3b6ac9015ab9550fdb2ec8092e068a5d10a5 -Author: Johnmacrocraft -Date: Tue Nov 5 14:09:41 2019 +0900 - - Fix ChestESP - -commit 82bb8854cce0d468a6ce038e2ccf19f6b2efb97a -Author: erwan celanie -Date: Mon Nov 4 23:29:09 2019 -0400 - - fix weird crash - -commit fa69ab65114741b6609bcdac7ea348fa85501668 -Author: erwan celanie -Date: Mon Nov 4 22:35:13 2019 -0400 - - Improvements - -commit 6b4732347db72243bbffe91c5e1038d92b036681 -Author: erwan celanie -Date: Mon Nov 4 22:06:05 2019 -0400 - - fix auto give - -commit 45bd27fb32f077050ea2751ead1476a98cec5239 -Author: GodGamer029 -Date: Mon Nov 4 11:17:39 2019 +0100 - - Fix Fullbright & #135 - -commit 36df253131c6bc03cf5168a8f04b2d6fedcbd012 -Author: Richard -Date: Mon Nov 4 01:07:26 2019 +0100 - - Update (Beta Channel) - - Minor Changes: - - ChestAura now opens only one chest at a time - - Added InventoryCleaner (needs improvements) - -commit 963153be60f4e6164d966b9784de5a579392b310 -Merge: 458061e 2d995bf -Author: erwan celanie -Date: Sun Nov 3 14:52:26 2019 -0400 - - fix .give & .soh - -commit 458061e8223e4d3593c6753127246cfd25e77523 -Author: erwan celanie -Date: Sun Nov 3 14:49:46 2019 -0400 - - fix .give & .soh - -commit 2d995bfe4dc224502f7cf3c278fc4a048693d3fb -Author: GodGamer029 -Date: Sun Nov 3 17:29:24 2019 +0100 - - Fix xray - -commit 3e8c8ae559a4a72bba5be875a4139c168597bd87 -Author: GodGamer029 -Date: Sun Nov 3 17:23:31 2019 +0100 - - Fix ClickTp - -commit 40245fb2a657fbfa322b474eba5168779c840bc9 -Author: GodGamer029 -Date: Sun Nov 3 17:14:54 2019 +0100 - - Fix Command History - -commit a456d2d4a3f0e084b2d1f4a4e471d3df7a471bfe -Author: GodGamer029 -Date: Sun Nov 3 16:32:25 2019 +0100 - - Progress on fixing Chest Stealer - -commit 7787782661c991d8fa75e31497ce83fe8dc03442 -Merge: 89aae62 b91b8f2 -Author: GodGamer029 -Date: Sun Nov 3 15:37:41 2019 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 89aae625650c542f2f25b9db7983c70bfff69b1e -Author: GodGamer029 -Date: Sun Nov 3 15:37:34 2019 +0100 - - Fix AutoArmor - -commit 084ad529a40b3c7804e29f0186be58a56938a7a1 -Author: GodGamer029 -Date: Sun Nov 3 12:50:17 2019 +0100 - - Comment a function - -commit b91b8f239e30970357585ee253eb8956b3cfe485 -Author: erwan celanie -Date: Sat Nov 2 17:08:36 2019 -0400 - - nameTags in Gamer Font - -commit fca5a7e19649c529785989e4d00afb57b49eca9a -Merge: fc013f4 8565e54 -Author: erwan celanie -Date: Sat Nov 2 16:56:32 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit fc013f4890d3fd8509cd9fc805d413686a6ffb37 -Author: erwan celanie -Date: Sat Nov 2 16:56:14 2019 -0400 - - added Gamer Font !!!!! & new ClientInstancePtr - -commit 8565e5485bdfffe83ee5c7690a3bb1f8c4f3155f -Author: GodGamer029 -Date: Sat Nov 2 20:19:56 2019 +0100 - - Fix C_MovePlayerPacket & setGameModeType - -commit 1105681b5530c6f38f5d305cba448aa7facba943 -Merge: 21cb811 a23cb1e -Author: GodGamer029 -Date: Sat Nov 2 19:44:25 2019 +0100 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 21cb811f3026e30db4e3030622b1c7ba0bb4f976 -Author: GodGamer029 -Date: Sat Nov 2 19:44:14 2019 +0100 - - I might have fixed TextPacket - -commit a23cb1ef29add09a096f27f2c3c71653fea758e5 -Merge: 50d7b86 8d66b0f -Author: GodGamer029 -Date: Sat Nov 2 19:19:15 2019 +0100 - - Merge pull request #126 from Johnmacrocraft/fix-trailing-whitespace - - Fix trailing whitespace - -commit 8d66b0fdb621d1e3d2d6cad82afcb82bec16f1b6 -Author: Johnmacrocraft -Date: Sun Nov 3 03:08:26 2019 +0900 - - Fix trailing whitespace - -commit 50d7b8683bc6201e9831678c8bc83a4df1fa57d3 -Author: GodGamer029 -Date: Sat Nov 2 19:02:23 2019 +0100 - - "Fix" C_MobEquipmentPacket - -commit 3c4e881ff127fee141c860e4bdc4b1d72fcbb4ef -Author: GodGamer029 -Date: Sat Nov 2 17:53:45 2019 +0100 - - Fix C_InventoryTransactionPacket - -commit eed3ae0df16f8d0256cccd106c14a7e4d0db79a7 -Author: GodGamer029 -Date: Sat Nov 2 17:45:25 2019 +0100 - - Fix ActorFallPacket - -commit 80d2e07108adbe62688b0bbb06f444294107c374 -Author: GodGamer029 -Date: Sat Nov 2 17:31:20 2019 +0100 - - Bunch of inlining & more premium - -commit 39e3d596b2c37e3b3b73f0d91eb55b094c033bd7 -Author: GodGamer029 -Date: Sat Nov 2 17:19:09 2019 +0100 - - Remove debug stuff - -commit 1a26b56e60ea45acef7335a5907afac878d9e54e -Author: GodGamer029 -Date: Sat Nov 2 17:17:18 2019 +0100 - - interpolation for the bois - -commit 1c9979f5bc32aded9ba9a6c3135061b977c98169 -Author: GodGamer029 -Date: Sat Nov 2 16:13:56 2019 +0100 - - sig fix - -commit 70ef36636486f723ce93a21643636ff9724f4c55 -Author: GodGamer029 -Date: Sat Nov 2 15:37:32 2019 +0100 - - Fix origin - -commit 32ba8486aa27283fa74ce8ba77ef80493b25ba9b -Author: GodGamer029 -Date: Sat Nov 2 13:31:18 2019 +0100 - - Fix syncShit - -commit d4ca6ca8648733d29d6d5863f1f2b7ae16444dca -Author: erwan celanie -Date: Sat Nov 2 01:23:02 2019 -0400 - - Update player struct & vTable , sendChatMsg Hook & other things - -commit be5ab900fbd94ace7b89f416b3ecc218913e6c66 -Author: erwan celanie -Date: Fri Nov 1 01:29:59 2019 -0400 - - fix Actor::vTable - -commit 04e60fbabc2aa9f9295e06af609dde58a2d49408 -Author: erwan celanie -Date: Fri Nov 1 00:24:37 2019 -0400 - - Fix ClickGui & Crash when connecting to a world - -commit abe2b633389dd3b4c31a78704a6864951420d49c -Author: erwan celanie -Date: Thu Oct 31 19:52:23 2019 -0400 - - Correctly fix ClientInstance::vTable - -commit 36c68e18e999dd39a5a1ac478feadfbbf965181c -Author: erwan celanie -Date: Thu Oct 31 02:06:09 2019 -0400 - - fix ClientInstance vTable - -commit ff79c4a8e5652a12128bdbf0156ba78af5ee1e5f -Author: erwan celanie -Date: Wed Oct 30 21:34:32 2019 -0400 - - fix crash when injecting - -commit 43c84736893d48e0972e1851c56c1f66416f26a0 -Author: erwan celanie -Date: Wed Oct 30 14:15:12 2019 -0400 - - fix some hooks , displayChatMsg & ClientInstance class - -commit a9f3aeef3f6eca0d03bcbf5970ddcac349ad5a8b -Author: erwan celanie -Date: Tue Oct 29 22:20:19 2019 -0400 - - fix tess_begin - -commit 0de7b49ac12e1f09d830ecd5c51563764003682a -Author: erwan celanie -Date: Tue Oct 29 19:22:39 2019 -0400 - - fix HIDController - -commit ade39fed83555fc2d2f497354a36d4a2bfc3607e -Author: GodGamer029 -Date: Tue Oct 29 21:43:12 2019 +0100 - - Kind of fix drawing? - -commit 22a9e14fa140ff83e225eb52217b01b5c8b22ce5 -Author: GodGamer029 -Date: Tue Oct 29 20:43:13 2019 +0100 - - Fresh Client Instance Ptr - -commit f81638c1baea44f29f1a73d16e096e124f836384 -Author: GodGamer029 -Date: Tue Oct 29 19:52:19 2019 +0100 - - Hooks are working again - -commit 6e83054f8edfc00f8e3cac621485eba2622864dd -Author: GodGamer029 -Date: Tue Oct 29 19:35:04 2019 +0100 - - Its ya boy, commit message! Today we are gonna yeet big time and hope no one reads this far! - -commit 9c1f5e6c67d231cd82a7b905735fe500f4959047 -Author: erwan celanie -Date: Mon Oct 28 22:59:05 2019 -0400 - - return bool - -commit d99ab745039325ad1d1db4a9d2f768328ad5bb4c -Author: erwan celanie -Date: Mon Oct 28 22:57:14 2019 -0400 - - temporarily fix some issues with antibot - -commit e9d650592f75f1a857af48ca98095aa547164f41 -Merge: 8120019 0538d4c -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Oct 27 10:43:35 2019 -0400 - - Merge pull request #120 from GodGamer029/hook_cleanup - - Hook-Class Cleanup - -commit 0538d4cf5d7d67833d52e4ff2c74b9b8376b9afe -Author: GodGamer029 -Date: Sun Oct 27 15:26:18 2019 +0100 - - Group Initializers & Remove FuncHook::init call - -commit a51f349abfa1d09d6a92fd20e78eb0cf5c031da4 -Author: GodGamer029 -Date: Sun Oct 27 15:18:37 2019 +0100 - - Actor_ladderUp & No static variable for vtables - -commit 9d6df8a0f4ce546c7c4f83b084977c2c54b012ec -Author: GodGamer029 -Date: Sun Oct 27 15:12:14 2019 +0100 - - They call me Mr.Clean - -commit 6d78712e530d484988ca65e29b7b1e319eefa691 -Author: GodGamer029 -Date: Sun Oct 27 15:08:23 2019 +0100 - - Removed even more __fastcall - -commit 5400a141d1f8b9dfd6a452d4dbddb83b5214a432 -Author: GodGamer029 -Date: Sun Oct 27 15:05:10 2019 +0100 - - Remove VMTHook & '__fastcall' keyword - -commit ce1e8b4b6f59480a01738384bca510466e075046 -Author: GodGamer029 -Date: Sun Oct 27 15:03:34 2019 +0100 - - Consistent Naming Scheme - -commit 31da719f1cbca347df5e1321c429f7c75697cafd -Author: GodGamer029 -Date: Sun Oct 27 14:45:26 2019 +0100 - - Remove typedefs & GetOriginal() - -commit a22b8309bb6b3cbd58ae833e5852ec4dee06acd4 -Author: GodGamer029 -Date: Sun Oct 27 14:43:09 2019 +0100 - - Cleanup Hook->GetOriginal & Removed unused Hooks - -commit 8120019b6f2dcef2c006510516ddd80ad6c36649 -Author: Richard -Date: Sun Oct 27 09:16:57 2019 +0100 - - Update (Beta Channel) - Mainly bug fixes: - - Fixed typo in AntiBot settings - - Fixed Fucker - - Fixed tooltip option being disabled in ClickGUI - - Added some (still unused) functions to ModuleManager - - Removed DirectX - - Fixed Horion Watermarked being drawed not aligned correctly - - TargetCheck should now correctly check if an entity is a mob - - AntiBot now detects NetherGames's bots - - This is the last update by me for the next 10 days, see you later! - -commit 1b2c3de1a71db54ea2ecad841e66147994efe5ee -Author: Richard -Date: Fri Oct 25 02:22:12 2019 +0200 - - Update (Beta Channel) - - Added AntiBots module with settings (to enable/disable specific target checks for killaura/esp) - - Renamed 'BedFucker' to 'Fucker' - - Fucker now has toggelable options (beds, eggs, cakes, treasures) and a range slider - - Fixed some crash occuring when injecting the mod whilest in game (Sadly the 'auto hide when in menu' had to be disabled for this) - - Fixed config saving - - Updated strings - -commit 4473b296b65f0befd803ade700cb9711a7ccf03c -Author: Richard -Date: Wed Oct 23 22:11:24 2019 +0200 - - Updates (Beta Channel) - - HUD now has an option to not display when e. g. in chat or inventory - - ChestStealer close delay can now be changed - - Removed Bhop jump height option (just use highjump now) - - Fixed some crashes occuring on Hive, NetherGames and other servers - -commit f9f0e9b5b56d246b86c360d2c07497ec6d544c33 -Author: Richard -Date: Tue Oct 22 23:49:07 2019 +0200 - - Updates - - Modules are now sorted alphabetically - - ChestAura range can be modified (1-10) - - .modules Command now shows module description - -commit ea407c559cb16f906de90df0241217b5f39e046e -Author: Richard -Date: Tue Oct 22 19:39:37 2019 +0200 - - Improvements & Additions - - Added ability to change command prefix - - Fixed Freecam onDisable() - -commit 59d500feb53364f8c35614b4b90031c030c57ec1 -Author: Richard -Date: Tue Oct 22 15:00:10 2019 +0200 - - Added patreon funding feature - -commit f0d49627ea0469b56686faa484ecb6668bc774e0 -Author: Richard -Date: Mon Oct 21 21:14:39 2019 +0200 - - Improved Bhop module - -commit c105c72cd76fd817dd2b5b187c2b3b305c866fbb -Merge: 34b4d5f cde119d -Author: erwan celanie -Date: Sun Oct 20 17:11:36 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit 34b4d5fd4542bf3d0e223427f5a150308a57a77b -Author: erwan celanie -Date: Sun Oct 20 17:11:16 2019 -0400 - - Tooltips - -commit cde119dc18d25fd48e246ce98aab55e6a480a973 -Author: Richard -Date: Sun Oct 20 21:29:20 2019 +0200 - - Fixed Bugs, Added Coordinates Display - -commit c0078b8c5bddaa25e87b46911587e9084a37bc14 -Author: erwan celanie -Date: Sun Oct 20 13:40:45 2019 -0400 - - fixed bunch of warnings - -commit 539cbdb92a587ed77fc62fdecee30f4e9fec9cd1 -Author: Richard -Date: Sun Oct 20 17:58:44 2019 +0200 - - Added manual spam function back - -commit f24e10bdaefb6edfb444629f62e7993b6eeedd87 -Author: Richard -Date: Sat Oct 19 13:30:10 2019 +0200 - - Fixes and improvements - -commit 214bc2eb0d9bf55a9db8be8b9c4ad69cec748709 -Author: Richard -Date: Fri Oct 18 19:55:16 2019 +0200 - - Added ChestAura - -commit 066689339ef29e1aab18748c2dffbffe13d9b00f -Author: Richard -Date: Fri Oct 18 15:09:16 2019 +0200 - - fix clicktp and add only hand option - -commit 169244061754557e7c795e79493feb133976413d -Author: Richard -Date: Thu Oct 17 23:58:18 2019 +0200 - - Removed spam command, added Spammer - -commit 5ec89cade1ca92dce97aeff486c8c796c75e0c15 -Author: Richard -Date: Thu Oct 17 20:32:45 2019 +0200 - - Added tooltips (not finished), minor improvements - -commit 8b14701b0dcb64c67770f1c397682baddc5133b6 -Merge: f9d420f 812e5f5 -Author: erwan celanie -Date: Wed Oct 16 18:29:19 2019 -0400 - - Merge branch 'master' of https://github.com/horionclient/Horion - -commit f9d420f4b678b786a0aeebcaf96ab66cd365bd24 -Author: erwan celanie -Date: Wed Oct 16 18:29:07 2019 -0400 - - fix - -commit 812e5f5716688b54c2a59cd3a5fe364b11935b73 -Author: Richard -Date: Wed Oct 16 22:52:50 2019 +0200 - - TabGui, ArrayList and Watermark are now one module called HUD which you can toggle as whole, or just tick the checkboxes to enable/disable specific things - -commit b0cf59155f6df66a5084daa279ed9783906d9ec0 -Author: erwan celanie -Date: Wed Oct 16 16:20:44 2019 -0400 - - fixed some warnings - -commit f68bb8c42789235a8497cfe23fb298e741c676a0 -Author: Richard -Date: Wed Oct 16 15:11:18 2019 +0200 - - improved (not yet working) silent scaffold (needs delay) - -commit a53371cd8f5a19ea18ffcae315113d3b51884003 -Author: Richard -Date: Wed Oct 16 14:48:41 2019 +0200 - - Improved Targets check, added (not yet working) autoselect scaffold - -commit 9fbff6f44173d34aaad3c250b3060cf656ff18b6 -Merge: 12ad381 23835ba -Author: Richard -Date: Wed Oct 16 14:16:30 2019 +0200 - - Merge pull request #101 from Johnmacrocraft/fix-give - - Fix .give, improve .dupe - -commit 23835ba32a03e737c4baf8c8506702a2614676c6 -Author: Johnmacrocraft -Date: Wed Oct 16 21:05:19 2019 +0900 - - Fixed the infamous .give ID crash - -commit 12ad381e251227a790626196f5e4d0d138178eaa -Author: Richard -Date: Tue Oct 15 22:13:24 2019 +0200 - - Killaura AutoWeapon option - -commit 20ea903369f34c595214eff50f6e67fe27eb2925 -Author: Richard -Date: Tue Oct 15 20:45:10 2019 +0200 - - Added .damage Command, expanded SDK - -commit 3f03e0dee01b2b9f93fa28b4f76240cdafe8c516 -Author: Richard -Date: Tue Oct 15 19:41:30 2019 +0200 - - Add NoFriends module - -commit 305768ba19529359b06802e0c5710d4db74d1e27 -Author: Johnmacrocraft -Date: Wed Oct 16 00:31:34 2019 +0900 - - DupeCommand: Allow specifying count - -commit caa38913c640efcb12e46e497d1cbcde893e676d -Author: Richard -Date: Tue Oct 15 16:42:39 2019 +0200 - - Added step height setting and improved ClickTP - -commit f86a4f82e428b637cbef85ed4d424b35f46a479b -Author: Johnmacrocraft -Date: Tue Oct 15 21:59:57 2019 +0900 - - Fix .give doing weird things when inventory is full - -commit c6407bafd2462a35f310ab94961d997ca7b7b808 -Author: Richard -Date: Tue Oct 15 03:14:47 2019 +0200 - - Add ClickTP - -commit e11a140970ecbfbf706d672173bc0875d633255e -Author: Richard -Date: Tue Oct 15 01:52:08 2019 +0200 - - Added MidClick module, improved isValidTarget() check - -commit 855eabc6c8388afb87eb34656aaca2cbe42fc932 -Merge: 923677f 04673a0 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Mon Oct 14 17:30:15 2019 -0400 - - Merge pull request #96 from Johnmacrocraft/add-dupe - - Implement .dupe - -commit 04673a046bb13678c152cc3cb420a833ec10a59a -Author: Johnmacrocraft -Date: Tue Oct 15 02:34:29 2019 +0900 - - Minor comment fix - -commit 923677fe1a38e125c7a3bd0b8bfbce7afa3e2c1e -Author: Richard -Date: Mon Oct 14 16:59:13 2019 +0200 - - Update issue templates - -commit 601f25e6ee7e5e66c64a270330d4dfb65e9061f4 -Author: Richard -Date: Mon Oct 14 16:54:45 2019 +0200 - - Update README.md - -commit 6e4429233059ce741554f7e11925033c1349bdec -Author: Richard -Date: Mon Oct 14 16:52:51 2019 +0200 - - Update README.md - -commit 19774b07c29d3a76bba6e241e60dad961694841c -Author: Johnmacrocraft -Date: Mon Oct 14 22:48:54 2019 +0900 - - Implement .dupe - -commit 1752077e2feaef6521b5f09ac186f5b0e9a2b906 -Author: erwan celanie -Date: Sun Oct 13 16:11:30 2019 -0400 - - fix bhop working while in chat - -commit 4e395bfd934a75c0b5f17bf2b5f997899715e20e -Author: erwan celanie -Date: Sun Oct 13 13:42:25 2019 -0400 - - keybind - -commit 6cc104456f85b8ad4388f5005d31beaeb4845da4 -Author: erwan celanie -Date: Sun Oct 13 12:37:39 2019 -0400 - - fix BugUp not working with nofall & elytraFlight - -commit 57411910ccb81bc1be6a60fb206652050c6a828f -Author: erwan celanie -Date: Sun Oct 13 12:01:52 2019 -0400 - - quick fix - -commit 0d47e477b966d61a2b2df667dd9aa8ff1bf7e85f -Author: erwan celanie -Date: Sun Oct 13 11:44:40 2019 -0400 - - autoarmor - -commit 049fa5c24669c12b0dd7fd6f90cbe0b72518d9b6 -Author: Richard -Date: Thu Oct 10 20:18:53 2019 +0200 - - Added BugUp (teleports to last safe pos when falling more than x blocks) - -commit e828b75ae6fb8656f6934602385d53f96df0a709 -Author: Richard -Date: Wed Oct 9 23:25:00 2019 +0200 - - AutoClicker rightclick option - -commit 169ceced9e67a9cbba99e8d35c31d065d0b5a725 -Author: Richard -Date: Wed Oct 9 15:16:28 2019 +0200 - - Enhanced AirJump - -commit 531c095f814a13867a96abe030639b6bd4c1cc5a -Author: Richard -Date: Tue Oct 8 17:09:53 2019 +0200 - - Add Tower - -commit 223152eb0d98c08d4facc76637b2bf8e18aeaba8 -Merge: 425d6ad f182f7e -Author: Richard -Date: Mon Oct 7 17:40:43 2019 +0200 - - Merge pull request #75 from Johnmacrocraft/fix-readme-url - - Update some readme URLs - -commit f182f7e85e6f258833a21fdfe01ffa53473589f0 -Author: Johnmacrocraft -Date: Tue Oct 8 00:25:45 2019 +0900 - - Update some readme URLs - -commit 425d6adaefa3a4be835325a64e949ec27979f052 -Merge: c403bb1 aa60d4b -Author: Richard -Date: Mon Oct 7 17:03:00 2019 +0200 - - NameTags: Unicode setting (by Johnmacro) - - NameTags: Add Use Unicode font setting (as a workaround) for names containing Unicode characters - -commit c403bb1673282b3a985d26ad79f365b1d6ed1382 -Merge: d13e4e6 87b1d8f -Author: Richard -Date: Mon Oct 7 16:42:46 2019 +0200 - - Merge pull request #74 from Johnmacrocraft/fix-speed-crash - - Disabling Speed when not in-game no longer crashes the game - -commit 87b1d8fa773ca45d1a8514a88b8e552163ce0a99 -Author: Johnmacrocraft -Date: Mon Oct 7 23:33:04 2019 +0900 - - Disabling Speed when not in-game no longer crashes the game - -commit d13e4e65e7753c638c43ed8155c4dbf71a3f6a8b -Author: Richard -Date: Mon Oct 7 16:07:21 2019 +0200 - - Added Bhop - -commit 96fc374b943a424fd77da0e152f6658501885d5a -Author: Richard -Date: Mon Oct 7 14:08:29 2019 +0200 - - Added .spam command - -commit bace4c93594150e60924fdc5cdf8efdcecc7bf5a -Author: Richard -Date: Sun Oct 6 16:54:39 2019 +0200 - - Update ReadME - - Changed Azure DevOps organisation - -commit 5b9010fdf62287e551a48053b211b1f838b9eb4f -Author: Richard -Date: Sun Oct 6 16:32:12 2019 +0200 - - This is not needed anymore - -commit a78ccf08b77f68cac4a6287417eecf462101eb56 -Author: Richard -Date: Sun Oct 6 16:28:24 2019 +0200 - - Update azure-pipelines.yml for Azure Pipelines - -commit 2825bbfc965e04b7b088c962775fdc10c510ffc4 -Merge: 0b4ffe8 0b18d58 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Oct 6 07:52:59 2019 -0400 - - Merge pull request #73 from richardletshacks/patch-1 - - Changed Code Quality label to fit other labels - -commit 0b4ffe8ec20ba8f8e0c93ad2229dbae54ce2398b -Merge: cb7c08a 53c8ccc -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Oct 6 07:52:26 2019 -0400 - - Merge pull request #72 from richardletshacks/master - - Minor edits, added .bind none support. - -commit 53c8ccc544ca881683dbd2651573f7046a42d12f -Author: Richard -Date: Sun Oct 6 12:35:53 2019 +0200 - - Minor edits, added .bind none support. - -commit cb7c08a1223cc1fee59cc2ea522a9c79e40d7cf7 -Merge: 23fffd0 3f7f210 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Oct 6 05:58:36 2019 -0400 - - Merge pull request #71 from richardletshacks/master - - Fixed Criticals - -commit 0b18d588b5eaf59aa71a47a5352ea39f421d43b3 -Author: Richard -Date: Sun Oct 6 10:27:28 2019 +0200 - - Changed Code Quality label to fit other labels - -commit 3f7f210e885fbef846832945d854b5a3aa0c3677 -Author: Richard -Date: Sun Oct 6 10:21:36 2019 +0200 - - Fixed Criticals - -commit 23fffd0179c6abbbf3e192f4c32bd332e3957eaf -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sat Oct 5 23:38:02 2019 -0400 - - Update README.md - -commit 25e7bc16d8f4373bff7de4bec1078212316a69ff -Merge: 973eaab bd7bd70 -Author: erwan celanie -Date: Sat Oct 5 21:35:25 2019 -0400 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 973eaab6eb53c341f4253ca6ef442b9f53b527a1 -Author: erwan celanie -Date: Sat Oct 5 21:35:09 2019 -0400 - - criticals - -commit bd7bd7004df7c724eeb25be2d0db65b37e247285 -Merge: e8235fa 37e7fcd -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sat Oct 5 18:28:30 2019 -0400 - - Merge pull request #69 from richardletshacks/patch-1 - - Updated ReadMe - -commit 37e7fcd9d802472783dde96bc874f9228fc19d86 -Author: Richard -Date: Sat Oct 5 23:08:15 2019 +0200 - - Updated ReadMe - - 1. Changed "Download Latest" label to "Download Injector" to avoid misunderstanding - 2. Fixed typo in Installation bullet point 1, changed text to avoid misunderstanding - 3. Updated Azure Pipelines label and text, updated link - -commit e8235fa4f041b7e5b44b9899d40d14c9fdbde4c4 -Author: erwan celanie -Date: Wed Oct 2 17:25:02 2019 -0400 - - .give & .enchant working on cubecraft - -commit aa60d4b5f4de1b519f2d67bdef57945060e9af93 -Author: Johnmacrocraft -Date: Tue Oct 1 21:35:44 2019 +0900 - - NameTags: Add Use Unicode font setting for names containing Unicode characters - - This is not the best way to handle this problem, but it will do the job for now... - -commit 9dfe37580f1751d6f80d803c905bec2bdf2d1608 -Author: erwan celanie -Date: Mon Sep 30 20:10:25 2019 -0400 - - improvements - -commit e517118b008a5570f67806a348d984977a5bf793 -Author: erwan celanie -Date: Sun Sep 22 17:54:19 2019 -0400 - - auto enchant - -commit c5a4acb07b219faea0e8639829643d977efc761d -Merge: 2af4ce6 d56e86b -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Sep 22 15:02:23 2019 -0400 - - Merge pull request #63 from richardletshacks/master - - Added .ip Command - -commit d56e86b9e21ac2c194c1a12d8bb646b732d5657a -Author: Richard -Date: Sun Sep 22 21:00:51 2019 +0200 - - Added .ip Command - -commit 301af43a3dde683c7665696fa49de2d7f33e214e -Author: Richard -Date: Sun Sep 22 20:56:56 2019 +0200 - - oops - -commit 7fadea415759209b43b49503bc0732b6965c09a0 -Author: Richard -Date: Sun Sep 22 20:38:18 2019 +0200 - - yup - -commit 2af4ce63731c0f3d093e7c3297b1dd457cfdef8e -Author: erwan celanie -Date: Sun Sep 15 19:19:48 2019 -0400 - - auto give - -commit 94720fd24614d0b9a75630e488285af175f991a0 -Merge: f133695 04f01ab -Author: erwan celanie -Date: Mon Sep 2 00:25:39 2019 -0400 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit f133695e9be34d4bd9605bbf7d4707846c08e65c -Author: erwan celanie -Date: Mon Sep 2 00:24:43 2019 -0400 - - Reversed more and more stuff - -commit 04f01ab43682fb93681ac2857ce783df9ab76269 -Merge: c2102c8 1fcef39 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Sun Sep 1 14:55:22 2019 -0400 - - Merge pull request #57 from Godsoft029/alright - - Improved User Experience - -commit c2102c819340429e7f6187f734684c3c6a0cb5b6 -Author: erwan celanie -Date: Sun Sep 1 14:29:42 2019 -0400 - - reversed more stuff - -commit 1fcef394c2a17cedaa2684526b96d70135898485 -Author: GodSoft029 -Date: Sun Sep 1 20:18:31 2019 +0200 - - Update Loader.cpp - -commit f809d41e305390bc1bd5dc2101cdb6857966be68 -Author: erwan celanie -Date: Sat Aug 31 01:52:05 2019 -0400 - - reversed InventoryTransactionPacket - -commit e206604ab79095b8f7dfd5ee42c7e6a7b22cac59 -Author: erwan celanie -Date: Wed Aug 28 19:30:11 2019 -0400 - - better NameTags - -commit 86380818dd9fb73f37b9ba896485fc64f4b40b48 -Author: erwan celanie -Date: Tue Aug 27 00:49:17 2019 -0400 - - some corrections - -commit d71f088eaa7e7c75439d0a19740a0a31c5f241fd -Author: erwan celanie -Date: Mon Aug 26 23:23:53 2019 -0400 - - added nametags and 200 iq player check - -commit f90fe5774fb5b2398fc3b7826c7ad5225628c9fd -Author: erwan celanie -Date: Sun Aug 25 18:22:20 2019 -0400 - - why delete .enchant all - -commit a320bc40dff19e75923c237427b54a27523fdbd2 -Author: erwan celanie -Date: Sun Aug 25 17:30:20 2019 -0400 - - more corrections - -commit a59805d3509d2ca3454035c831299c60a013ee7e -Author: erwan celanie -Date: Sun Aug 25 16:59:28 2019 -0400 - - some corrections - -commit 8d600aa1c05affe7f23af5ec4f2f20743f54e54a -Merge: ef66ca3 d1d1dfd -Author: erwan celanie -Date: Sun Aug 25 16:52:53 2019 -0400 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit ef66ca3c9929bb6c08151ab578a14be6b7573ca6 -Author: erwan celanie -Date: Sun Aug 25 16:52:34 2019 -0400 - - some clean up - -commit d1d1dfd13e49b1a00f0daf8636c21398ec333fa2 -Author: hYdos -Date: Mon Aug 26 06:24:23 2019 +1000 - - added name support to /enchant command (#43) - - * added name support to /enchant command - -commit c4a01e179814257f1049177aa299004a33412fe7 -Author: GodGamer029 -Date: Sun Aug 25 21:34:04 2019 +0200 - - code actually compiles now - -commit 73abf2d9cf9dee94b722d7b026e3b9d40bb5533f -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:30:26 2019 -0700 - - Create AutoClicker.cpp (#45) - -commit 97c5958149c967d7944821ca53cfc24ea9f60137 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:30:18 2019 -0700 - - Create AutoClicker.h (#46) - -commit 0d3e15a8c86aeef73d3002ca6f029bad177736e4 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:30:11 2019 -0700 - - Update Aimbot.cpp (#47) - -commit f3b0a0e79c0616f816ac344e648e5c2a0cc405e6 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:29:51 2019 -0700 - - Update Aimbot.h (#48) - -commit 65b8af7ffb84301cfef6a6a041ef75ea7f5550f1 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:29:37 2019 -0700 - - Update TriggerBot.h (#49) - -commit 1d9ea1d05a2cd333524f9e387db3dd90f43f8c66 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:29:28 2019 -0700 - - Update TriggerBot.cpp (#50) - -commit 3891a438ac25236b07ea2328bf724ede048a69d0 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:29:18 2019 -0700 - - Update ModuleManager.cpp (#51) - -commit 302a3815797729e4a7f5be3459eb03a4d9d84aa4 -Author: zzolr <49467061+zzolr@users.noreply.github.com> -Date: Sun Aug 25 12:29:06 2019 -0700 - - Update ModuleManager.h (#52) - -commit d2979d322c0ee6db3580f257fbcd7f2daa01d6ca -Author: GodSoft029 -Date: Sun Aug 25 18:03:46 2019 +0200 - - Update README.md - -commit 487f7d0c6c7d86ee48b489325817f25f66c311d5 -Author: GodSoft029 -Date: Sun Aug 25 17:52:34 2019 +0200 - - Update README.md - -commit d9f9aeeb5c87c6e7daf8df2fe7b3e8eef119283e -Merge: 489abdc f903809 -Author: GodGamer029 -Date: Sun Aug 25 17:49:36 2019 +0200 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 489abdceaad882d19f7fa251a977cfe3df3b5eef -Author: GodGamer029 -Date: Sun Aug 25 17:49:34 2019 +0200 - - fix airswim crash - -commit f9038091ba9e7a3571839893475de65090fd5cc4 -Author: GodSoft029 -Date: Sun Aug 25 17:44:51 2019 +0200 - - test azure build - -commit af4a114b819351ededede1e3d11631fc619920d3 -Author: GodSoft029 -Date: Sun Aug 25 17:05:09 2019 +0200 - - Set up CI with Azure Pipelines - - [skip ci] - -commit 2f0a6209b2a966bfd4ce9c6c92321f56913869df -Author: GodGamer029 -Date: Sun Aug 25 16:31:13 2019 +0200 - - Added more AirSwim effects - -commit bb4a8f3e6bd86bc8f86a5fe13f1f8aa88fdb7ba7 -Author: SwiftHD -Date: Sat Aug 24 01:11:12 2019 +0100 - - Added checks for friends and valid entities in Triggerbot (#40) - - and SwiftHD gets a medal for extra effort - -commit f83899b9cd15a62cbf343d3d905945e30579cdb3 -Author: GodGamer029 -Date: Fri Aug 23 22:58:48 2019 +0200 - - test - -commit 0524e29e155bee23373ace44cedec47b064d8486 -Author: erwan celanie -Date: Fri Aug 23 11:35:15 2019 -0400 - - variable name - -commit 29471d3e3cff9bde8bb8c09c5678deb148c30cd2 -Author: GodGamer029 -Date: Fri Aug 23 15:37:41 2019 +0200 - - remove 'idk' - -commit 43515db7035f71f6f52002f5e42ca3c4b53f75c6 -Author: GodGamer029 -Date: Fri Aug 23 15:31:38 2019 +0200 - - Remove 'oof' - -commit 4fd65ca8a2c01d5a5956fad489660ad29ae8db1c -Author: GodGamer029 -Date: Fri Aug 23 15:29:39 2019 +0200 - - Remove 'yeet' - -commit c66ce5630ca23ef9db68f91e8edc8bcf374aab65 -Author: GodGamer029 -Date: Fri Aug 23 15:23:48 2019 +0200 - - Remove 'boi' - -commit a2a1572558d3cadbba8c7aa48bf75dc04014f8ae -Author: GodSoft029 -Date: Fri Aug 23 15:12:47 2019 +0200 - - yeess - -commit 76ad36c8144c32627c2781474456381e8f2958ea -Author: GodSoft029 -Date: Fri Aug 23 15:12:12 2019 +0200 - - Update README.md - -commit f66383828074bf9a9e65b7a02a75672bc38fc590 -Author: GodGamer029 -Date: Fri Aug 23 14:41:49 2019 +0200 - - fix warning (https://github.com/SurvirvorHRG/Horion/commit/01affee524aa537a404b4e786b217d1392a5942f#r34808909) - -commit fd6762dcf7852c1a0280041da850ec66cd3bb1ff -Merge: 01affee 4c7b799 -Author: GodGamer029 -Date: Fri Aug 23 14:36:04 2019 +0200 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit 01affee524aa537a404b4e786b217d1392a5942f -Author: GodGamer029 -Date: Fri Aug 23 14:36:02 2019 +0200 - - Fix some bad code - -commit f8df580021802064393aefd40edf35dec60aa38f -Author: GodGamer029 -Date: Fri Aug 23 14:35:02 2019 +0200 - - Fix error message: 'byte' ambigous symbol - -commit 4c7b7997b36df6008a96a3f586a7b86e4dfe6912 -Author: erwan celanie -Date: Thu Aug 22 23:58:08 2019 -0400 - - Improvements - -commit 4e20a0252ddc14c82135708b3665830ba30a9c0f -Author: erwan celanie -Date: Wed Aug 21 18:04:44 2019 -0400 - - watermark to bottom right - -commit 532af874266c7f85db6db6c14e0d6eba91412a57 -Author: erwan celanie -Date: Wed Aug 21 17:05:36 2019 -0400 - - some correction - -commit 65f785d6690b5e98238dd5e00d51566ca3b8dea0 -Merge: de86df9 39d880f -Author: erwan celanie -Date: Wed Aug 21 16:48:14 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit de86df9ef5b30a12f822e050e1cacb000cac0ec3 -Author: erwan celanie -Date: Wed Aug 21 16:47:52 2019 -0400 - - Rtti at compiling time - -commit 39d880fe8b8a146c5a98f3bd642bce4f3eb538f7 -Merge: a73e6fe 3578e64 -Author: Survivor <49885447+SurvirvorHRG@users.noreply.github.com> -Date: Wed Aug 21 14:51:37 2019 -0400 - - Merge pull request #33 from richardletshacks/master - - Update Readme - -commit 3578e64ca0d48e28d2b3d797717929ce92560dca -Author: Richard -Date: Wed Aug 21 20:48:00 2019 +0200 - - woops - -commit 8c2c93e654ab652aa71191263ea84343057cf82c -Author: Richard -Date: Wed Aug 21 20:47:42 2019 +0200 - - Make ReadMe better - -commit a73e6fec4b3913969749bc3a9ac46024239e4d5b -Author: GodSoft029 -Date: Wed Aug 21 17:54:37 2019 +0200 - - say sike right now - -commit 449f8294adcbed2ad0a7fcae27e6fdcb30fc6c99 -Author: GodSoft029 -Date: Wed Aug 21 17:53:57 2019 +0200 - - Update README.md - -commit 67261904025e901eb74637d1e5616e17d346fd23 -Author: erwan celanie -Date: Wed Aug 21 00:06:39 2019 -0400 - - same for setoffhand - -commit 5b6ad895f304922323838559bfe7dd577adf345f -Author: erwan celanie -Date: Mon Aug 19 16:33:16 2019 -0400 - - itemId & name - -commit caf26e27a60b5f74cabad5b5f73812d4113c299c -Author: erwan celanie -Date: Mon Aug 19 12:25:24 2019 -0400 - - BlockReach - -commit 225fc72f47e56384e99d3ca1854f671b54857a1a -Author: erwan celanie -Date: Mon Aug 19 01:27:31 2019 -0400 - - .enchant all - -commit 6dcdc0d2bed6461c42ee488b66dfc8eca755e47d -Author: erwan celanie -Date: Mon Aug 19 01:21:12 2019 -0400 - - FastEat disabled when turned off - -commit 2a7ad81fe4698bd3329e27121e1ad77e1258fa40 -Author: erwan celanie -Date: Mon Aug 19 01:05:22 2019 -0400 - - correction - -commit f7febb3ad0deeaa5d2c981db95351096cdb3d039 -Author: erwan celanie -Date: Mon Aug 19 00:59:01 2019 -0400 - - Improved setOffhand/give - -commit 54e08ba3ad75db406eb70fc4c4a760aa4709e51a -Author: GodGamer029 -Date: Sun Aug 18 19:28:14 2019 +0200 - - actual ItemStack size - -commit b66e00e44e894d08de870dc6b2dd083afb062447 -Author: GodGamer029 -Date: Sun Aug 18 15:13:09 2019 +0200 - - why the fuck was release build using build tools for vs2017 - -commit cb71229025ce9b3737308c287ecc5d8ea592dd17 -Author: GodGamer029 -Date: Sun Aug 18 15:11:53 2019 +0200 - - 200iq exception handling - -commit 1a47581e647cdcd4c2d239ec5bf23c751ac9f023 -Author: GodGamer029 -Date: Sun Aug 18 15:07:19 2019 +0200 - - Use a big ass try-except statement to avoid crashes - -commit 6dba00a14ba7e4bebd8d14809cc39089024ff9eb -Author: GodGamer029 -Date: Sun Aug 18 14:48:24 2019 +0200 - - Set delay back to 2 minutes - -commit 5245ab360f0e90edd195d0af4cdb06a1525a251e -Author: GodGamer029 -Date: Sun Aug 18 14:47:59 2019 +0200 - - Replace 'Sleep' in analytics thread - -commit 317a1d99ff813af7c4250cbefa748af2cc3c2f16 -Author: erwan celanie -Date: Sat Aug 17 15:48:05 2019 -0400 - - added delay & other things - -commit cf3862ed893482fc164ad6247144384a64d1675b -Author: erwan celanie -Date: Sat Aug 17 14:36:56 2019 -0400 - - Correction - -commit dbf6a0bc8d7e600e34037124a130f778eedc799a -Author: erwan celanie -Date: Sat Aug 17 14:36:02 2019 -0400 - - cvorr - -commit 6d8160edbca49ac6f1b7fa73e5998db2ca75f79a -Author: erwan celanie -Date: Sat Aug 17 14:20:42 2019 -0400 - - update is ready - -commit 6f30373079ffe80f6330fc97b8c9b8e8b0cb79b2 -Author: erwan celanie -Date: Sat Aug 17 14:18:43 2019 -0400 - - Hides all Horion text while client is hidden - -commit 6af7e5e89d95443de15016b88a46acb65ed41c11 -Author: erwan celanie -Date: Sat Aug 17 14:07:45 2019 -0400 - - improvements - -commit c405b9d807881104c0bde146b20ca73f8f067c6d -Author: erwan celanie -Date: Sat Aug 17 13:34:06 2019 -0400 - - .enchant all - -commit ee8221fb2ebe871416a0d6b8b9223bea02f5a92c -Author: erwan celanie -Date: Sat Aug 17 13:30:22 2019 -0400 - - WIP autoarmor - -commit 991d16c5f2df15cdfc2abb8507d37228107feea6 -Author: GodGamer029 -Date: Fri Aug 16 16:04:00 2019 +0200 - - making sure this works - -commit 1140f6176b9ea3f3016713c818dbd688c19e7d23 -Author: GodGamer029 -Date: Fri Aug 16 15:58:18 2019 +0200 - - analytics - -commit e9b9807b1035ad6f335455a72df7d1f8dd330ad6 -Merge: af6d07b 3f385aa -Author: Rateek -Date: Fri Aug 16 04:50:31 2019 +0200 - - Merge branch 'master' of https://github.com/SurvirvorHRG/Horion - -commit af6d07b118b20f042344bbbc7065aa93b95f6a89 -Author: Rateek -Date: Fri Aug 16 04:50:20 2019 +0200 - - fix - -commit 3f385aaad1c3b3cda8cb85e04a97dc09caecda07 -Author: erwan celanie -Date: Thu Aug 15 22:43:19 2019 -0400 - - json update - -commit 5ad6490daa310ebd9b0fa17e54936d8600ff1bff -Author: erwan celanie -Date: Thu Aug 15 20:08:13 2019 -0400 - - hot fix - -commit b732beee4af31a57f651a66d57ef1cb934ced2b6 -Author: erwan celanie -Date: Thu Aug 15 18:49:56 2019 -0400 - - started working on autoarmor - -commit e44d73635c4c105af946222500dd3ba2eae829ea -Author: erwan celanie -Date: Thu Aug 15 13:01:49 2019 -0400 - - yeet - -commit bf92b8d168296878ff0e00db9c29327b66fc742f -Author: erwan celanie -Date: Thu Aug 15 11:41:44 2019 -0400 - - RakNetInstance - -commit b217102422b1258387ffd85ed4f8193374667f7c -Author: erwan celanie -Date: Mon Aug 12 23:48:07 2019 -0400 - - Improvements - -commit 7ea73848b0d051ecee8a341032f76d5b4411906f -Author: GodGamer029 -Date: Mon Aug 12 17:09:17 2019 +0200 - - Implement .say - -commit c7530002fc35cc1af363312574be879d41abca3d -Author: GodGamer029 -Date: Mon Aug 12 16:58:40 2019 +0200 - - reverse engineered TextPacket - -commit 99c605dce0ac1349236c2f121db9e56884f01a6d -Author: GodGamer029 -Date: Mon Aug 12 16:08:52 2019 +0200 - - Start work on .say and enhance jesus - -commit 58438bc5b14ca7fed8319a9c2e584873e174edc4 -Author: GodGamer029 -Date: Mon Aug 12 15:05:59 2019 +0200 - - Fix some warnings - -commit 47f4f8214e81948ca4d729a152ae11262866fb1b -Author: GodGamer029 -Date: Mon Aug 12 14:52:51 2019 +0200 - - fix warning - -commit 035e70bfd684010718a82cb9cbc04294ab4ce299 -Author: GodGamer029 -Date: Mon Aug 12 14:23:28 2019 +0200 - - Add .coords command - -commit 62d98f675b6ab36e9e198da3c707f29a042604ad -Author: GodGamer029 -Date: Mon Aug 12 14:13:30 2019 +0200 - - Add trash jesus and fix some bugs in the memory leak fix - -commit 90a1c323ff06b141db2444e0f996ef34b392608e -Author: erwan celanie -Date: Sat Aug 10 18:19:46 2019 -0400 - - fix more memory leaks - -commit 17240bdf51b5f8f9fca618d6174557ca854534df -Author: erwan celanie -Date: Sat Aug 10 02:20:29 2019 -0400 - - Fix Memory Leak Part 1 - -commit 7d4ec4395cace59d59ba23443f2886810355b77a -Author: AnimeThighss <50558821+AnimeThighss@users.noreply.github.com> -Date: Thu Aug 8 16:50:46 2019 -0600 - - Made it easier to enchant (.enchant) - - Now goes into your offhand once you enchant. - -commit d85b0e50e3060c621086fc90a30a11364ef6c8e9 -Author: AnimeThighss <50558821+AnimeThighss@users.noreply.github.com> -Date: Tue Aug 6 15:32:06 2019 -0600 - - added setoffhandcommand - - hi im new person pls love me - -commit 7fda51714579a6f0f2ca2963a825ea26b53bb381 -Author: erwan celanie -Date: Mon Aug 5 16:05:42 2019 -0400 - - remove - -commit b960b0a20ca3fb1767f78653a7b74b838533fe88 -Author: erwan celanie -Date: Mon Aug 5 15:57:54 2019 -0400 - - .nbt (no) LMFAO - -commit 88fb1d0b08e815e31e720f4e3cef40e655fa7af7 -Author: erwan celanie -Date: Mon Aug 5 15:50:37 2019 -0400 - - Improvements - -commit 261644eec1b0159e70e01b3cdfadb9789b6d1962 -Author: GodSoft029 -Date: Mon Aug 5 18:32:37 2019 +0200 - - bruh - -commit 9e972a5b89cf1f7c5bce0fbd905669a3cfa2cf5a -Author: GodSoft029 -Date: Mon Aug 5 18:31:21 2019 +0200 - - Update CommandMgr.h - -commit fc61c7fc89a1ee10fad4ca42336fb700fa02ac9f -Author: GodSoft029 -Date: Mon Aug 5 18:30:19 2019 +0200 - - Create BruhCommand.cpp - -commit 01df63d7453f87d79c3394f6d49b2275564ba57f -Author: GodSoft029 -Date: Mon Aug 5 18:24:08 2019 +0200 - - Create BruhCommand.h - - web editor sucks - -commit 8e6978d75da4692bd03c76351a2dc5b4ac92ab73 -Author: erwan celanie -Date: Sat Aug 3 15:35:23 2019 -0400 - - clean up - -commit 34706295c191ce9f37d3726d43f0b556c4cc4c30 -Author: erwan celanie -Date: Sat Aug 3 14:45:23 2019 -0400 - - .give - -commit a9c3df334efecc5591b52d29cd806d6eaf74c1d6 -Author: erwan celanie -Date: Thu Aug 1 19:35:18 2019 -0400 - - FastEat - -commit ef807efdf1b7b547374d63d2e5063cd1adc73344 -Author: erwan celanie -Date: Thu Aug 1 12:41:36 2019 -0400 - - revert - -commit 8f91b083e9e68f18f318e14741bfa76890151821 -Author: erwan celanie -Date: Thu Aug 1 12:09:18 2019 -0400 - - github test - -commit 981acbb705483169162a4b27c9c90104be1bd006 -Author: erwan celanie -Date: Thu Aug 1 09:23:15 2019 -0400 - - i like visual 2019 - -commit 3d381521f1b262645cffe7799eb2be143c33de9e -Author: GodSoft029 -Date: Thu Aug 1 11:14:50 2019 +0200 - - Use discord invite as watermark - -commit 87e148dbe644bd060710110b37c3e5113aa7ae45 -Author: Rateek -Date: Wed Jul 31 07:56:37 2019 +0200 - - Add AutoSneak - -commit fc9295c558aef8b38c1da10c732908e1d8ee6873 -Author: erwan celanie -Date: Tue Jul 30 17:46:33 2019 -0400 - - Player Category - -commit c12827a7c4a6a1f9eb613481bf33fbd8d01bf68d -Author: erwan celanie -Date: Tue Jul 30 12:43:49 2019 -0400 - - stackable item - -commit 353cee2597314a8b182c8e365726d8d91788240c -Author: erwan celanie -Date: Tue Jul 30 00:28:54 2019 -0400 - - clean - -commit 3d2da2a66d63ca7477b1e29ebe43156a53e6ea6a -Author: erwan celanie -Date: Tue Jul 30 00:23:37 2019 -0400 - - yeet - -commit b2d694ad496fc5ae1f12ef1485b1e72a4d744a1e -Author: erwan celanie -Date: Thu Jul 18 23:50:15 2019 -0400 - - Fix InventoryMove - -commit 60872f6c21ef775d3ed9eaeb66f99c18ac411a8d -Author: erwan celanie -Date: Thu Jul 18 18:40:07 2019 -0400 - - added delay for triggerbot & killaura - -commit b6e79b27c4e784e4b49c6acba2e362269f8ad9a7 -Author: erwan celanie -Date: Thu Jul 18 18:27:48 2019 -0400 - - added settings to NoKnockBack - -commit 804d6f029d3ea3fb00d16ccf3591578eb3593a30 -Author: godgamer029 -Date: Thu Jul 18 21:37:12 2019 +0200 - - Refactor Command & add http - -commit 032f344df3b1fd9762e98beb327492c494b346dd -Author: erwan celanie -Date: Thu Jul 18 12:30:37 2019 -0400 - - fix 3 - -commit a8298b743a5119cc34a8050b4b494a13218941a6 -Author: erwan celanie -Date: Thu Jul 18 12:28:39 2019 -0400 - - added settings to aimbot - -commit 43ae31b4e7e5a6423388b4c79339315790178fc4 -Author: erwan celanie -Date: Thu Jul 18 12:10:45 2019 -0400 - - second fix - -commit 9cba0b2b13462319d943a4193175507b5a48b303 -Author: erwan celanie -Date: Thu Jul 18 02:52:46 2019 -0400 - - fix - -commit 48a9f277a9b29eeefd1a318c6a6df11fb899afa6 -Author: erwan celanie -Date: Thu Jul 18 02:48:16 2019 -0400 - - NoWeb & FastLadder - -commit a3ef07f5f8f7faafeb2d74712135f129ff46a0cf -Author: erwan celanie -Date: Thu Jul 18 01:23:41 2019 -0400 - - settings saved when game closed - -commit ec41ba9c76b5388b2640f83ae2e22b6ca5e3bf85 -Author: erwan celanie -Date: Wed Jul 17 00:54:09 2019 -0400 - - HighJump - -commit 282d18dafe882da91242b2acf90937f325036def -Author: erwan celanie -Date: Tue Jul 16 22:30:15 2019 -0400 - - more improvements - -commit 610b99b2062a6d537c8a9524be15519cc92bafd2 -Author: erwan celanie -Date: Tue Jul 16 22:18:30 2019 -0400 - - good inventory walk - -commit abd779653fe4cbfd156cb3f90176d8ba210cf40a -Author: erwan celanie -Date: Tue Jul 16 20:06:50 2019 -0400 - - added settings to speed - -commit 26d0c153e3046c649420d36dbc0f12a62196fb48 -Author: erwan celanie -Date: Tue Jul 16 13:48:48 2019 -0400 - - working inventoryMove - -commit 9b48ab77439245d4fe4a1bd1249eabd6bd6b8650 -Author: erwan celanie -Date: Tue Jul 16 01:34:49 2019 -0400 - - started working InventoryWalk - -commit 17ba13885459a69a7a847a061f594f3cc2b9f874 -Author: erwan celanie -Date: Sun Jul 14 05:19:08 2019 -0400 - - AirSwim - -commit e7410bfca883baca6b67f08f2fd33dade022ce5e -Author: godgamer029 -Date: Sat Jul 13 23:03:11 2019 +0200 - - 2 decimal places in clickgui - -commit 5405535f57b49670cb58ba57a808677f6724bef3 -Author: godgamer029 -Date: Sat Jul 13 23:02:30 2019 +0200 - - Add glide value setting - -commit 4ad4933bfbee82e8eb19ecfff3da9932aa791491 -Author: godgamer029 -Date: Sat Jul 13 22:45:37 2019 +0200 - - add debugging for other components as well - -commit 440bb883cf9c8302729de1a29c889540f38cd470 -Author: godgamer029 -Date: Sat Jul 13 22:42:21 2019 +0200 - - Fix CheckBox Bug - -commit c5af0fccc397b6be572b3e0c3b59375cf17a4338 -Author: erwan celanie -Date: Sat Jul 13 02:11:22 2019 -0400 - - FullBright & watermark - -commit 47b732d23b6f2d1d344396b53a22567bc5e1e34e -Author: erwan celanie -Date: Fri Jul 12 18:57:22 2019 -0400 - - fix bowAimbot - -commit 427bf8a1c254b9a7bbf6cf5ec63d00f0a2f6c2e4 -Author: godgamer029 -Date: Fri Jul 12 19:14:00 2019 +0200 - - Add watermark - -commit e0ab230f49974a2106040013fbc9997d2befc6b5 -Author: erwan celanie -Date: Fri Jul 12 12:48:12 2019 -0400 - - fixed reach - -commit 9da084491fd12a95999d116a9702b0c4a4aa8a7f -Author: erwan celanie -Date: Fri Jul 12 12:14:10 2019 -0400 - - reach - -commit be1d689090a2d4b76f5d7bc4221af8a08b873aed -Author: erwan celanie -Date: Fri Jul 12 04:09:03 2019 -0400 - - hitbox check - -commit de85845f82b87ed6d5570a157c0762d3e1e33173 -Author: erwan celanie -Date: Fri Jul 12 03:50:04 2019 -0400 - - hitbox - -commit f4a8d845878b4a21d769c51656df41f96e30c8d4 -Author: erwan celanie -Date: Fri Jul 12 03:14:43 2019 -0400 - - MobAura and MobEsp - -commit 60277e510a1ffedd8be10f1e10a58ff97f84e767 -Author: erwan celanie -Date: Fri Jul 12 02:09:22 2019 -0400 - - fix autototem + clean - -commit 5bbe07bb60a376995c1e86f23a1e762fc2029376 -Author: godgamer029 -Date: Thu Jul 11 19:35:15 2019 +0200 - - remove debug - -commit f347f8d46ad6cc459857306d65dcb1a33bb88503 -Author: godgamer029 -Date: Thu Jul 11 19:34:53 2019 +0200 - - fix chest stealer - -commit afd605ffb3195e43c50d889f287aa97272db5815 -Merge: 7e69679 5cbe280 -Author: erwan celanie -Date: Thu Jul 11 13:04:47 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 7e69679be48bb2c434b20c818ae6d08e6ff6cfa3 -Author: erwan celanie -Date: Thu Jul 11 13:03:52 2019 -0400 - - fix ChestStealer - -commit 5cbe28057271b20455b2e8300f0c2e138bee984e -Author: godgamer029 -Date: Thu Jul 11 18:30:01 2019 +0200 - - fix gamemode - -commit 3d1875b7b434fbd0ef0fd068cf0343d3fd90a354 -Author: godgamer029 -Date: Thu Jul 11 18:19:46 2019 +0200 - - fix enchant command - -commit b4f9e21d9d7d06040fb1303f4b07ab09495012c5 -Author: godgamer029 -Date: Thu Jul 11 17:35:37 2019 +0200 - - Fix nuker n stuff - -commit 80cf7ad94a4fe0931eaa552c69da190376ac37b2 -Author: godgamer029 -Date: Thu Jul 11 17:25:23 2019 +0200 - - Fix scaffold - -commit 4c6b3303670b5e4cd2205dbce42c907c563bb028 -Author: godgamer029 -Date: Thu Jul 11 17:03:47 2019 +0200 - - Fix autosprint & NoKnockback - -commit db87449801666ab084b5dd054530a7c80c2d8c34 -Author: godgamer029 -Date: Thu Jul 11 16:50:09 2019 +0200 - - fix bowaimbot - -commit 36298068845b28e7a10028d0161abb108282aad0 -Author: godgamer029 -Date: Thu Jul 11 16:32:23 2019 +0200 - - fix triggerbot - -commit a898f0e7b81208569db3eed931f42a65f2797853 -Author: godgamer029 -Date: Thu Jul 11 16:21:53 2019 +0200 - - Clickgui fix a la richardus - -commit a220d364cbf76e9fa52e04e8d036298cccdf559a -Author: godgamer029 -Date: Thu Jul 11 16:13:35 2019 +0200 - - ClientInstanceFix - -commit a21ecc776ece9ad91d942720eedfd4436eebc82a -Author: godgamer029 -Date: Thu Jul 11 16:00:05 2019 +0200 - - fix getRenderLayer - -commit 4120a0eece8024b70aa86f58c5d05d50fc3eda03 -Author: godgamer029 -Date: Thu Jul 11 15:45:00 2019 +0200 - - remove debug - -commit ba1188ee44f09915c30275af377ff96aa57eb5af -Author: godgamer029 -Date: Thu Jul 11 15:44:35 2019 +0200 - - Actually fix vtables - -commit e138dcd57db74f7275442b286f32a95469797d58 -Author: godgamer029 -Date: Thu Jul 11 12:23:23 2019 +0200 - - update vtable - -commit f5b69bdd35e26f9cdfebdb0f849688a4d66d4ae7 -Author: godgamer029 -Date: Wed Jul 10 19:34:21 2019 +0200 - - remove some ghetto - -commit 72041a8470d130228267005ac0371fa7ce9985bf -Author: godgamer029 -Date: Wed Jul 10 19:30:52 2019 +0200 - - fix ESP - -commit e181bff135a746c5f32245433f6c2a1b9c47b93b -Author: godgamer029 -Date: Wed Jul 10 18:15:17 2019 +0200 - - fix player struct - -commit 95e94fccbcc8af77cfad0a19c5500a53538672cf -Author: godgamer029 -Date: Wed Jul 10 16:19:26 2019 +0200 - - fix can use keys - -commit 4ba58e73d7a452ceb5466efefd7ac0ff26972bed -Author: godgamer029 -Date: Wed Jul 10 16:06:33 2019 +0200 - - fix command autocomplete - -commit 68e4b3acb5fe25ff4430eeec391285b9469e64da -Author: godgamer029 -Date: Wed Jul 10 15:53:39 2019 +0200 - - Fix chat commands - -commit a1322d379824adb111065a958fae8e505bcc1511 -Author: godgamer029 -Date: Wed Jul 10 15:08:49 2019 +0200 - - proper sig - -commit 90b09d92f0e78bebcffc5e7b2189c19b8021b33c -Author: godgamer029 -Date: Wed Jul 10 15:00:26 2019 +0200 - - fix click gui - -commit 40eeacbc4401fb146a8cc684c258569a598a3964 -Author: erwan celanie -Date: Wed Jul 10 02:07:05 2019 -0400 - - fixed MousePos - -commit 33e5f860747bb1fc011a5592013b38adb289d05b -Author: erwan celanie -Date: Wed Jul 10 01:48:46 2019 -0400 - - Fixed sigs - -commit 05153c5d100959d0037f2f9ca6e0d7ff85501075 -Author: godgamer029 -Date: Tue Jul 9 21:24:17 2019 +0200 - - WIP - -commit 579031d218391e5d943bb83fbcec90d0c0203076 -Author: godgamer029 -Date: Tue Jul 9 20:53:29 2019 +0200 - - hi i liek minecrafp - -commit 230514f31e1ae36f2816414304670fcf359ad830 -Merge: 081e77a d9c2f5b -Author: godgamer029 -Date: Tue Jul 9 18:35:22 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 081e77a28e2db81ae7c3a68bd06a2b8e27004458 -Author: godgamer029 -Date: Tue Jul 9 18:35:16 2019 +0200 - - inject doesnt crash anymoire - -commit d9c2f5bb274f886abac1ff34269bfb535d8f4dad -Author: erwan celanie -Date: Sun Jul 7 11:55:36 2019 -0400 - - Hide - -commit 46ceac90254408b4971afb455915dd0dd0b88199 -Author: erwan celanie -Date: Sun Jul 7 02:36:38 2019 -0400 - - yikes - -commit a661d4e609883b5aeda5317a75a64aaca040f2b1 -Author: erwan celanie -Date: Sun Jul 7 01:56:43 2019 -0400 - - Fly and Bypass + Freecam Improvements - -commit 762012c4aaa64cb73d6471f638e8024fa0e52a94 -Author: godgamer029 -Date: Sat Jul 6 14:40:56 2019 +0200 - - add killaura range setting - -commit 0cdb96f7143de532a1211e6acd2e4105973b6cd9 -Author: godgamer029 -Date: Sat Jul 6 14:29:27 2019 +0200 - - add hbop noslowdown - -commit 79dfd97c6d5e12f715681a4d8a173b5be447be36 -Author: godgamer029 -Date: Sat Jul 6 14:00:42 2019 +0200 - - vein miner - -commit e1606d06c882b1c4efc5e97de047381de5678780 -Author: godgamer029 -Date: Fri Jul 5 20:06:01 2019 +0200 - - Add Multi Aura - -commit a137d40d8b2e41aaa6cd7a1a4c65d6ba0b5ec2b2 -Author: godgamer029 -Date: Fri Jul 5 19:57:39 2019 +0200 - - nice clickgui animations - -commit 611b0252c7f026de8fc4201aab287e8db3dd0e6a -Author: godgamer029 -Date: Fri Jul 5 18:24:19 2019 +0200 - - Addecd Checkboxes to Clickgui - -commit baafeb0fa15a156fcad57dbe92644057cc3272cf -Author: godgamer029 -Date: Fri Jul 5 17:38:38 2019 +0200 - - Add Float Slider and Anti Idiot Code - -commit 008f0bb2fb2da8d98f239d89be645de02d4e487b -Author: godgamer029 -Date: Fri Jul 5 17:27:25 2019 +0200 - - improve nuker performance - -commit 4267eb263150c57dc8a8e50541ebde87723cc4cf -Author: godgamer029 -Date: Fri Jul 5 17:24:23 2019 +0200 - - nice design - -commit 4cf5e68767f4bacb75f1f16ab1e731db7c1c610e -Author: godgamer029 -Date: Fri Jul 5 17:20:39 2019 +0200 - - nice line - -commit fc82d104f76bc4968db2024367e9c99443c1afdb -Author: godgamer029 -Date: Fri Jul 5 16:45:38 2019 +0200 - - remove aids keybind - -commit 548e71eb9b43e765389290bd59fc00c0f2f24947 -Author: godgamer029 -Date: Fri Jul 5 16:42:11 2019 +0200 - - Minor Improvements - -commit c52231fc2dea4ba2d528be6d2bd7e7ad06fb91b2 -Author: godgamer029 -Date: Fri Jul 5 16:30:05 2019 +0200 - - Added Text for current value - -commit dfbffe97b24efef12ea28ff0c6eabf75744a8fac -Author: godgamer029 -Date: Fri Jul 5 16:17:47 2019 +0200 - - Sliders! - -commit 78ccc164dae5c4490d3aab772c2e0ac100bb943d -Author: godgamer029 -Date: Fri Jul 5 15:05:02 2019 +0200 - - add necessary structure for sliders - -commit 8a7c7b918b307bd6d006590a6b59b4b230db1b90 -Author: godgamer029 -Date: Fri Jul 5 13:59:52 2019 +0200 - - Settings yay - -commit b21119c5658f5b01a9bf6998860640991a8342aa -Author: godgamer029 -Date: Fri Jul 5 13:48:23 2019 +0200 - - Refactor window Size - -commit e720428871d52f53fd138100e002eb1159ba0697 -Author: erwan celanie -Date: Tue Jul 2 18:05:39 2019 -0400 - - clean - -commit 8caf151635a46527ea061bdaad79b4c7a757717d -Author: erwan celanie -Date: Tue Jul 2 17:33:03 2019 -0400 - - cheststealer - -commit 1d90d6248d81ee6529045809afa06177b9d6234c -Author: godgamer029 -Date: Mon Jul 1 15:43:16 2019 +0200 - - yeet im outta here - -commit eaf3badc1b054a36f0f5c1087f9d14f15a3efec1 -Author: godgamer029 -Date: Mon Jul 1 14:23:02 2019 +0200 - - E N H A N C E M E N T S - -commit 3e47de59534254932938261c401ef0780c51fdd8 -Author: godgamer029 -Date: Mon Jul 1 13:58:51 2019 +0200 - - preparations - -commit 99d10080da7b854ae84fe2b97d2ff165f3c5dc5f -Author: godgamer029 -Date: Mon Jul 1 13:51:28 2019 +0200 - - start work on settings - -commit 4611ce1e7f2e6dc9e56c59550f320993fd32e488 -Author: godgamer029 -Date: Mon Jul 1 13:45:35 2019 +0200 - - design adjustments - -commit 3a8458d09be3e14cdcbcce219a2e90d3721f435a -Author: godgamer029 -Date: Mon Jul 1 13:38:27 2019 +0200 - - category margin - -commit 3e3ad579c5911b6b9c8d59e8c67600e4c75fdae2 -Author: erwan celanie -Date: Mon Jul 1 01:49:53 2019 -0400 - - fix - -commit 422cc23da56b68fe315940f43e8d93931fc30d98 -Author: erwan celanie -Date: Mon Jul 1 01:34:33 2019 -0400 - - need help - -commit ff646c219cfbb19c197a1f94a7d4b5a08f1ef942 -Author: erwan celanie -Date: Mon Jul 1 01:33:15 2019 -0400 - - please help - -commit dba56b855e991cb24970e5fc71d3a4bd5e9f4d37 -Author: erwan celanie -Date: Fri Jun 28 20:40:54 2019 -0400 - - started settings xd - -commit 8a2ad1823fd8c43f1e8dc1cc913fbc0c658e1596 -Author: erwan celanie -Date: Thu Jun 27 01:39:07 2019 -0400 - - improvements - -commit 2678e2d8fda19f656292ffd8ac6f98a48bc75f4d -Merge: 4b07955 9517ee9 -Author: godgamer029 -Date: Wed Jun 26 20:36:25 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 4b07955115feee3404db10990705707d45d42a65 -Author: godgamer029 -Date: Wed Jun 26 20:36:19 2019 +0200 - - nice - -commit 9517ee931e38172f1f455dfb8c71bba312beb1c2 -Author: erwan celanie -Date: Wed Jun 26 14:21:24 2019 -0400 - - fix - -commit 4f1564631e49911c5efb81cec2a3a5b7ec428aaf -Author: godgamer029 -Date: Wed Jun 26 20:02:01 2019 +0200 - - fix Clicks buggy - -commit 0df1651233fe9553c066c44695c683f38ed4c3f8 -Author: godgamer029 -Date: Wed Jun 26 19:58:38 2019 +0200 - - fix some stuff - -commit 75ce0b6d27077f9867291c886bc2cd04670fba04 -Merge: 34ec8e9 1df8f68 -Author: godgamer029 -Date: Wed Jun 26 19:50:47 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 34ec8e9a2ec996e1dd611e0f92dc57c51177eb94 -Author: godgamer029 -Date: Wed Jun 26 19:50:41 2019 +0200 - - mor cleanup - -commit 1df8f684b364f08ddd61b2dd1cecae60b292b0fa -Merge: 62ad3c7 ab06777 -Author: erwan celanie -Date: Wed Jun 26 13:47:23 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 62ad3c7dd0bc439533499795d2bbe40aaa8b6ff3 -Author: erwan celanie -Date: Wed Jun 26 13:46:51 2019 -0400 - - Click not detected by Minecraft - -commit ab0677748e82e2465579cdac5fbc6972c5e99c9e -Author: godgamer029 -Date: Wed Jun 26 19:15:55 2019 +0200 - - cleanup - -commit ade3db36492a1633a22ec47262cd9f06986f8748 -Author: godgamer029 -Date: Wed Jun 26 19:03:22 2019 +0200 - - revert - -commit ac5b552d171ce4c85d20d6bae9d0489277e98bfd -Author: godgamer029 -Date: Wed Jun 26 19:01:48 2019 +0200 - - sync test - -commit 317966c9271ec28f660edd178ab632c1c920d1e4 -Author: erwan celanie -Date: Mon Jun 24 22:19:53 2019 -0400 - - Visual - -commit 3602a157cd157208df0e7fff2436cedeb331cc76 -Author: godgamer029 -Date: Sun Jun 23 19:13:51 2019 +0200 - - remove ghetto - -commit 909717709e7b55e9c6ea7d8e8a2c20f86f55e364 -Author: godgamer029 -Date: Sun Jun 23 19:11:51 2019 +0200 - - remove logging - -commit 77cc1efae64c38356ebb0d22500b7e6b69e6d48a -Author: godgamer029 -Date: Sun Jun 23 19:11:22 2019 +0200 - - Fixed ClickGuii - -commit 992c3075c0322ce0361b289bfdff59fff18ad383 -Author: godgamer029 -Date: Sun Jun 23 18:21:15 2019 +0200 - - drag fix - -commit 37499dc10b4c141dbb9f575b975bd70dd31d1989 -Author: godgamer029 -Date: Sun Jun 23 18:16:54 2019 +0200 - - Only render in specific screens - -commit 47b3799f716051bae5462b38a620f110f76eadb0 -Author: godgamer029 -Date: Sun Jun 23 16:45:47 2019 +0200 - - draggin work in progress - -commit 15ef03284eca6f09cd344ec0e0c9ec5c9ce45220 -Author: godgamer029 -Date: Sun Jun 23 16:20:00 2019 +0200 - - exposed - -commit 249086f71b8c08912a90884287e7f835f8c72c7e -Author: godgamer029 -Date: Sun Jun 23 16:11:49 2019 +0200 - - Fix Some Stuff - -commit 2bc1f5b554bc607b9f003bf46424a56a8a07488e -Author: godgamer029 -Date: Sun Jun 23 16:00:11 2019 +0200 - - remove debugging - -commit 6184b95fa9b355871ebe4d71354a18ac667e1687 -Author: godgamer029 -Date: Sun Jun 23 15:59:28 2019 +0200 - - clicking works - -commit e3ecb29721d46e5b581ed88025c1a9f97a4a9702 -Author: godgamer029 -Date: Sun Jun 23 15:39:54 2019 +0200 - - Documentation, Clicking is broken - -commit a9cfe0e5e47f3528f5635531fa45470da7d68a68 -Author: godgamer029 -Date: Sun Jun 23 15:32:31 2019 +0200 - - Mouse CLick management - -commit 8ecb068164c50f3cee6263f1915409e7a5de15f4 -Author: godgamer029 -Date: Sun Jun 23 15:00:09 2019 +0200 - - idk - -commit a079ce3b5e9196b0194e58a686389b68a781e7ed -Author: godgamer029 -Date: Sun Jun 23 14:51:51 2019 +0200 - - variable naming - -commit bb194bca55bb9aac611a1b79f20d6f3ef9e9df67 -Author: godgamer029 -Date: Sun Jun 23 14:49:17 2019 +0200 - - moduleList handling - -commit d451dca93bf52184d091c47994152cee0b9ca155 -Author: godgamer029 -Date: Sun Jun 23 14:40:38 2019 +0200 - - readability - -commit fa1213a7e89a5b6b74cc1beeeb2dffa182a0d0fb -Author: godgamer029 -Date: Sun Jun 23 14:35:23 2019 +0200 - - remove unused variable - -commit 09d73e9da78c30ea319fd96b43be08b2fbf0fc66 -Author: godgamer029 -Date: Sun Jun 23 14:33:26 2019 +0200 - - formatting - -commit 77889704b9bc22e52512ac6ebd268d9514323f75 -Author: godgamer029 -Date: Sun Jun 23 14:28:56 2019 +0200 - - Formatting - -commit c1e9fa7afc080bfe2d594b03dec13f9483f9fd66 -Author: godgamer029 -Date: Sun Jun 23 14:26:22 2019 +0200 - - Adjustments to bind command - -commit 1c7b488ecfdf8108a9d9caea82c6b9ed1b7d49c8 -Author: erwan celanie -Date: Sun Jun 23 00:57:41 2019 -0400 - - Improvements - -commit 91f85f7a863276c623f0ac5eaca8df09977cbc70 -Author: erwan celanie -Date: Sun Jun 23 00:25:12 2019 -0400 - - Category + Crossline - -commit 0452e5ba62dee8749907860ace9565083b735f62 -Author: erwan celanie -Date: Fri Jun 21 17:37:54 2019 -0400 - - dank ClickGui - -commit 396a38359cbc60696d42f83781222f8edc3041ef -Author: erwan celanie -Date: Tue Jun 18 02:24:06 2019 -0400 - - autoTotem - -commit 5d154ef9c8bfbc9f293192973769da51d3f39b69 -Author: godgamer029 -Date: Sun Jun 16 11:12:15 2019 +0200 - - gui improvements - -commit e6d15d79b7416102c225e83ec3f9053000dd5617 -Author: godgamer029 -Date: Sun Jun 16 11:07:52 2019 +0200 - - Improvement - -commit 9e350f2c8596d297d8049f419d94281bd1e406e5 -Author: erwan celanie -Date: Fri Jun 14 14:09:34 2019 -0400 - - more improvements - -commit 2e1ac0a2deb9ba924298dfb1ea73cd35cb499cec -Author: erwan celanie -Date: Tue Jun 11 23:43:16 2019 -0400 - - Improvements - -commit c726b18753134e2a865aad0bb964a8262076fda1 -Author: erwan celanie -Date: Tue Jun 11 22:33:55 2019 -0400 - - NoSlowDown - -commit 8a56dda0d5d1e3e2743e68af752c808b66d1a504 -Author: godgamer029 -Date: Tue Jun 11 15:43:52 2019 +0200 - - Design changes - -commit af4fc09cb2a6eb783149df9b677f0622b7889dfc -Author: godgamer029 -Date: Tue Jun 11 12:17:47 2019 +0200 - - Unbind all - -commit af5d84d7e6871c329765fdb65c47a0f3ac9dd68c -Author: godgamer029 -Date: Tue Jun 11 12:08:14 2019 +0200 - - Add Panic Command - -commit 16c41832d5cb0c39f9531ca18bb096dbb5587d26 -Author: godgamer029 -Date: Tue Jun 11 12:04:42 2019 +0200 - - Add Modules Command - -commit 975e9a13c501eba1e10fb738ac423c7b0d49bcea -Author: godgamer029 -Date: Tue Jun 11 11:59:10 2019 +0200 - - Add Help Command - -commit b66694a9ef518cbdee8451a9af10d5a82c92f0d4 -Author: godgamer029 -Date: Tue Jun 11 10:39:29 2019 +0200 - - Add Enchant Command - -commit 5c63884a5bef718d315023bb6aa32cf17d578c08 -Author: godgamer029 -Date: Tue Jun 11 10:22:36 2019 +0200 - - Nuker Size adjustment - -commit 5e731a08446512a4a28cb3ee0c58aafb1a2615c6 -Author: godgamer029 -Date: Tue Jun 11 10:02:10 2019 +0200 - - formatting - -commit 0fc470a49fdd890784b1408d7e2af94ca480b7b8 -Author: godgamer029 -Date: Tue Jun 11 09:54:17 2019 +0200 - - Improve Compiel Performance - -commit 7734f0765015f29795fb00b3528128ae0054cdef -Author: godgamer029 -Date: Tue Jun 11 09:46:33 2019 +0200 - - Improve Utils::FIndSignature performance - -commit caaa1e52d020acc9456d41ed9f5613e9b273d466 -Author: godgamer029 -Date: Tue Jun 11 09:40:48 2019 +0200 - - Removed unused code - -commit 81156ca11a960ab3fe1c2217334173b0f21031d9 -Author: godgamer029 -Date: Tue Jun 11 09:36:35 2019 +0200 - - Improve Compile Times - -commit 2ac24948f40662bc8922aa42f3f479cc7ef14e4c -Author: godgamer029 -Date: Tue Jun 11 09:23:40 2019 +0200 - - Disable Keybinds in main menu - -commit 7f31e2af662f72b5dccc37cd9ccca421c7a19b9d -Author: godgamer029 -Date: Mon Jun 10 17:39:52 2019 +0200 - - quick fix - -commit 3cd95dfeabfa6a732e39419050d1d31f51594217 -Author: erwan celanie -Date: Mon Jun 10 11:37:41 2019 -0400 - - fix - -commit 3f1205b1630be6a91c5ce21e6f4c6dc2d1aca492 -Author: erwan celanie -Date: Mon Jun 10 11:36:11 2019 -0400 - - UnbindCommand - -commit 130e19afbcf1475e850add6fb89ae5b6a2922a28 -Author: godgamer029 -Date: Mon Jun 10 14:17:27 2019 +0200 - - tests - -commit 98ed5a0f6faae711934efb84f742f093b538f494 -Author: godgamer029 -Date: Mon Jun 10 13:58:24 2019 +0200 - - ClientInstance sdk added - -commit 9707cacd3e7834a8591150f20514f37f37706d38 -Author: godgamer029 -Date: Mon Jun 10 13:17:57 2019 +0200 - - Tweak design of tabgui and Horion logo - -commit f54e45aa3864a83d440b31d4b1feb71bb7fd62db -Merge: a3b281e 7f4700a -Author: godgamer029 -Date: Mon Jun 10 12:24:06 2019 +0200 - - merge - -commit a3b281e6ab27411167a8dfd403545897f3d9e378 -Author: godgamer029 -Date: Mon Jun 10 12:22:30 2019 +0200 - - Reload chunks when xray is toggled - -commit 7f4700afad5fed3d6ac27707423c95d645d100f9 -Merge: d678e40 e992cd4 -Author: erwan celanie -Date: Sun Jun 9 15:35:45 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit d678e404c4ea0f7541b83794b9a0f28a2863084c -Author: erwan celanie -Date: Sun Jun 9 15:35:27 2019 -0400 - - nice xray - -commit e992cd491ea86b464fd4fc7c6518c57efcc15159 -Author: godgamer029 -Date: Sun Jun 9 17:34:32 2019 +0200 - - SDK - -commit 1ff50e51544dae814e2d5ca02f3ca01daaa77e61 -Author: godgamer029 -Date: Sun Jun 9 14:37:49 2019 +0200 - - yeet - -commit 2901015f09e95a79a1f23b617c4895689321db5b -Author: godgamer029 -Date: Sun Jun 9 14:12:05 2019 +0200 - - Exclude MobESP/Aura - -commit 69b6c6bb30033c557e88da8442de8341e210f462 -Merge: 883fd2d 3f5a139 -Author: godgamer029 -Date: Sun Jun 9 12:58:30 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 883fd2dc2b36254929ebdc6fbfa50615e3520907 -Author: godgamer029 -Date: Sun Jun 9 12:58:23 2019 +0200 - - Add Entity::isInWater and Entity::isInLava - -commit 0e299dd1ab5dc6ab8db7473323c911c3cb844154 -Author: godgamer029 -Date: Sun Jun 9 12:24:27 2019 +0200 - - Clarification - -commit 3f5a139fb80dcb22b305cd9c6e8f99954a4a2b2e -Author: erwan celanie -Date: Sat Jun 8 23:45:45 2019 -0400 - - fix 2 - -commit 94f0c0c5bc1c62a5a21a3d8056eab0e1e2e3ea99 -Author: erwan celanie -Date: Sat Jun 8 23:39:07 2019 -0400 - - fix - -commit 30919c56b3b3040eb5fc746edaa2ef944c40cd27 -Author: erwan celanie -Date: Sat Jun 8 23:23:21 2019 -0400 - - I like MobEsp and MobAura - -commit 55ea2f3630b8220c1fa6d8a0b87bea06686381d5 -Author: godgamer029 -Date: Sat Jun 8 23:15:58 2019 +0200 - - idk y u no work - -commit fd8431f559c1c174698e425e9c213e886143dda4 -Author: godgamer029 -Date: Sat Jun 8 22:47:43 2019 +0200 - - Test Command enchants - -commit bc6ba9694c5907859c9dae1578242200d6d89e88 -Author: godgamer029 -Date: Sat Jun 8 21:06:27 2019 +0200 - - PlayerInventory & TestCommand - -commit b253c2bc6e2e7bc4976d411efab2bfcc551ce475 -Author: godgamer029 -Date: Sat Jun 8 20:20:02 2019 +0200 - - Add test command for debugging - -commit 895bd1130dcd261c88e8b1e62c891cd86bd09ad3 -Author: godgamer029 -Date: Sat Jun 8 16:50:51 2019 +0200 - - Target and Callbacks - -commit 5e954e6f67a407b6374927a576ba1feeab0648e5 -Merge: 0dfeeed 56777c3 -Author: godgamer029 -Date: Sat Jun 8 16:12:03 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 0dfeeedcf3314f9de64b280868afb101e779a0a3 -Author: godgamer029 -Date: Sat Jun 8 16:11:56 2019 +0200 - - New entity list - -commit 56777c3b796bf93b05efc1ca9e53590540ab880e -Author: Kevin Fischer -Date: Sat Jun 8 14:10:13 2019 +0200 - - added cake and dragonegg to bedfucker - -commit 328b3d361f0d896fa42c6a5c6def7f333508b4f5 -Author: godgamer029 -Date: Sat Jun 8 14:03:15 2019 +0200 - - even more improvements - -commit fd23d6302db9045b7755b80f648b58b8dcefef3e -Author: godgamer029 -Date: Sat Jun 8 14:02:02 2019 +0200 - - improvements in Killaura - -commit f5b5168a8b33c67c5418b3deaabd40293c1d6ac9 -Author: godgamer029 -Date: Sat Jun 8 13:49:40 2019 +0200 - - fixes - -commit 422cbc5f6167f12804d2c40b036d9ccc26496e2f -Merge: 25dc0a3 911f476 -Author: godgamer029 -Date: Sat Jun 8 13:46:17 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 25dc0a38a9fe26c991a5311c478cb2933c087d0e -Author: godgamer029 -Date: Sat Jun 8 13:46:11 2019 +0200 - - Reduce BedFucker delay and Range - -commit 911f476f263e4fb8c79003e61b8b3e4d9d4da977 -Merge: aca35e5 07f33a1 -Author: Kevin Fischer -Date: Sat Jun 8 13:45:46 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit aca35e51aa40e05daaf204400979892999ed8299 -Author: Kevin Fischer -Date: Sat Jun 8 13:45:42 2019 +0200 - - Started Tower - -commit 07f33a152b19c2b9e2654c53c73173b1531b3ae1 -Author: godgamer029 -Date: Sat Jun 8 13:45:06 2019 +0200 - - Fix GameMode::destroyBlock - -commit 8c188f2baa5866fb12bde13f441c7fa1de883ece -Merge: f89b73f 1720f77 -Author: godgamer029 -Date: Sat Jun 8 13:19:42 2019 +0200 - - yikes - -commit f89b73f285365819dd342492521ebf7b838436c1 -Author: godgamer029 -Date: Sat Jun 8 13:19:20 2019 +0200 - - performance - -commit 1720f77e5dbea4b1d9db848131b8456c1fea10ee -Author: Kevin Fischer -Date: Sat Jun 8 13:18:28 2019 +0200 - - Updated BedFucker - -commit acb4acb40b03bcb9fbf757748007626ce5375946 -Author: godgamer029 -Date: Sat Jun 8 13:16:25 2019 +0200 - - formatting - -commit 7856adbdce6dd31dc6dc04e2870ad58edc905773 -Merge: 5bc6d06 2d298c0 -Author: godgamer029 -Date: Sat Jun 8 13:15:31 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 5bc6d06c6bfb1de1d9c8563297a9d41345232776 -Author: godgamer029 -Date: Sat Jun 8 13:15:00 2019 +0200 - - Enhanced BlockLegacy - -commit 2d298c00796681cac77337ac5a653884c5ed8b76 -Author: Kevin Fischer -Date: Sat Jun 8 13:14:38 2019 +0200 - - Started BedFucker - -commit 5bc2e9bb05c3ab1a537017558f2f0407269c4f59 -Author: godgamer029 -Date: Fri Jun 7 20:24:02 2019 +0200 - - > Enhancements - -commit 265b205c1e338b8e5ffcd2815c09fe43c00b58e1 -Author: erwan celanie -Date: Fri Jun 7 12:21:47 2019 -0400 - - removed force creative - -commit 054229ea93a6bf83f59973cb0c0870884aaabb2a -Author: erwan celanie -Date: Fri Jun 7 12:17:46 2019 -0400 - - changing keybind - -commit 49d0324aa6ec235da596d58828c8504024a963b7 -Author: erwan celanie -Date: Fri Jun 7 12:11:36 2019 -0400 - - working xray - -commit 111911b37b257efadf80719ac28f741f7acf0801 -Author: godgamer029 -Date: Fri Jun 7 17:29:04 2019 +0200 - - Structural changes - -commit 663639204639e30da958575661647e31a40306b0 -Author: erwan celanie -Date: Thu Jun 6 01:10:24 2019 -0400 - - started working on X-ray - -commit 3c968be4e6c321246f459223cb057c32c55f1842 -Author: Kevin Fischer -Date: Mon Jun 3 22:15:42 2019 +0200 - - Added Speed - -commit 59279147877f8af1cefa6440acaaef2f02b0a91e -Author: godgamer029 -Date: Sat Jun 1 15:53:13 2019 +0200 - - remove some memes - -commit deed35e0654794479cea0184b2de6fdfb4707fc8 -Author: godgamer029 -Date: Sat Jun 1 15:39:50 2019 +0200 - - Enhancements - -commit 84d226253bd701717c4e190fcbd5f26bcb486036 -Author: godgamer029 -Date: Sat Jun 1 15:34:24 2019 +0200 - - improvements - -commit 476ec210f10f0a6eef1813e498c9a50f6d1a49d0 -Author: godgamer029 -Date: Sat Jun 1 15:26:00 2019 +0200 - - TabGui - -commit 94235745716d78528396338e4e3d99b428293ba0 -Author: godgamer029 -Date: Sat Jun 1 12:14:46 2019 +0200 - - Improve performance - -commit 9baf77f78d8d1669d91795e77da9ff6933a24eea -Author: godgamer029 -Date: Sat Jun 1 12:10:44 2019 +0200 - - Delete ConfigObj - -commit f61eb8785b8a62af8114d65110bdb5e22a3558fd -Author: godgamer029 -Date: Sat Jun 1 12:07:57 2019 +0200 - - fix more warnings - -commit 89f3b8797dcb4a2b823ab8af2078b89e516fd114 -Author: godgamer029 -Date: Sat Jun 1 11:57:20 2019 +0200 - - Fix compiler warnings - -commit 10be145878e62aaf32773229c40bf5c00b50b647 -Author: godgamer029 -Date: Sat Jun 1 11:50:22 2019 +0200 - - Change getModuleName to const char* - -commit 994b69c5ee4e19b7a2ced79c87abe767e28ba6a5 -Merge: cee22da e964ef8 -Author: erwan celanie -Date: Fri May 31 23:54:48 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit cee22da03877ff4147e6d40a406d11edd03a228a -Author: erwan celanie -Date: Fri May 31 23:54:40 2019 -0400 - - delete - -commit e964ef85da585d8417b811a2e45358287f6e461c -Author: godgamer029 -Date: Sat Jun 1 00:31:35 2019 +0200 - - Improved performance - -commit a24393cd804a78d685fba108602646f937376cb1 -Author: godgamer029 -Date: Fri May 31 22:53:03 2019 +0200 - - Working - -commit 58d7c834ae592025f2cd90d5aa43214d1db863b8 -Author: godgamer029 -Date: Fri May 31 21:16:33 2019 +0200 - - Remove getVersionStringHook - -commit 226bf024ad51d95ae37b8ee34bcd6af4be427c3a -Author: godgamer029 -Date: Fri May 31 21:11:17 2019 +0200 - - Final adjustments - -commit b558deb54d4ef88c14fb1e87175fd8f57be5439d -Author: godgamer029 -Date: Fri May 31 21:05:16 2019 +0200 - - C l e a n - -commit 3b220e26f0ecc74eea2c63964dc747b6a9e04abf -Author: godgamer029 -Date: Fri May 31 20:03:13 2019 +0200 - - idk how to fix this mess - -commit 34489729d800cfdf44180f25f45c493e2faa6b14 -Author: godgamer029 -Date: Fri May 31 19:53:03 2019 +0200 - - clean - -commit 5b6b495cedf582f49fef0d10dea67d8e409268e5 -Author: godgamer029 -Date: Fri May 31 19:44:40 2019 +0200 - - yikes - -commit 037cb552139ab33fd90cc1644d040feac2287be7 -Author: godgamer029 -Date: Fri May 31 19:30:26 2019 +0200 - - Cleanup & Fix errors - -commit 401878bc1a0d5bacea9c69b971d857f636f1b410 -Author: godgamer029 -Date: Fri May 31 19:23:27 2019 +0200 - - Cleannnn - -commit ffb1c43f83a9b5414d8b03faeefbf39d92902b6f -Author: godgamer029 -Date: Fri May 31 19:20:14 2019 +0200 - - Readability - -commit 872a17e556b2941a534abbb2fbddb152b27838b4 -Author: godgamer029 -Date: Fri May 31 19:15:14 2019 +0200 - - remove ugly code - -commit 2bd4ca6de68fbb9d42e4bcecfa60bcaa56f87af6 -Author: godgamer029 -Date: Fri May 31 19:13:14 2019 +0200 - - Ocean cleanup - -commit 915ed522802d30037ef75f29e7ad1dde5bfd0087 -Author: godgamer029 -Date: Fri May 31 18:50:56 2019 +0200 - - fixes - -commit d06238cd21048ecf23e3dc315a9a302a757ec2e7 -Author: erwan celanie -Date: Fri May 31 12:39:46 2019 -0400 - - l - -commit 35b422a6ea095104b8bcc4b86f2c95bf06dc3846 -Author: erwan celanie -Date: Fri May 31 12:38:50 2019 -0400 - - shit - -commit 78307a8da45aa34c75b932e2715c5ade72f1c7e0 -Author: godgamer029 -Date: Thu May 30 23:58:17 2019 +0200 - - Tabgui improvements - -commit 6a2dd24735e77e144c72ce1ec3107e00e09bd0d8 -Author: godgamer029 -Date: Thu May 30 23:41:46 2019 +0200 - - Roll around - -commit 1c4a52d2f6b119843c4a07cb5420476c5086869c -Author: godgamer029 -Date: Thu May 30 23:35:54 2019 +0200 - - started work on TabGui - -commit 601ee53c56090b767e686efa7237d0ad831d65c7 -Author: godgamer029 -Date: Thu May 30 22:10:44 2019 +0200 - - Add GuiUtils - -commit ac7f80dbe855fef4578918d1b434247cb27afdda -Author: godgamer029 -Date: Thu May 30 22:07:47 2019 +0200 - - Module states (enabled/disabled) are now being saved - - Rainbow Sky can be bound to a key - - Blink keybind is now properly being worked around - -commit d649817ca1c6016213014c4499a31bbdb3edd72c -Author: godgamer029 -Date: Thu May 30 21:46:58 2019 +0200 - - fix - -commit 6b02d055fbd9600dbfa079f2e19abf3f915ded73 -Author: godgamer029 -Date: Thu May 30 21:43:06 2019 +0200 - - enhancement - -commit aabd1d2e20e812f30a6cbd26e2ed0e7730bea982 -Author: godgamer029 -Date: Thu May 30 20:33:51 2019 +0200 - - fixed compiler errors - -commit e526e0fddd181a8108b3acd2e53ce376823d64d3 -Merge: e35c9ee e50d8b2 -Author: godgamer029 -Date: Thu May 30 20:29:55 2019 +0200 - - yikes - -commit e35c9eef2061e4c203405258b0af66627d03beb9 -Author: godgamer029 -Date: Thu May 30 20:28:23 2019 +0200 - - Categorys - -commit 80c7a2d66cb4558a12fd70aa12c90dac3b8e3936 -Author: godgamer029 -Date: Thu May 30 20:03:56 2019 +0200 - - idk - -commit e50d8b2a4cd9c7167412afd45b9f1896c5c4fa3b -Author: erwan celanie -Date: Thu May 30 12:02:21 2019 -0400 - - Better MousePos - -commit 5e7666a1e585ed9974744f5ef4cfa8a89f1c6f06 -Author: erwan celanie -Date: Thu May 30 00:58:28 2019 -0400 - - fix - -commit 52219e34f42243fce28f4d3a054ed872365a41ef -Author: erwan celanie -Date: Wed May 29 01:02:49 2019 -0400 - - MousePos and Fix - -commit ae6b080de29b73ddce997d0b0405144d4291bb94 -Merge: 0aa3a82 aa27bf2 -Author: godgamer029 -Date: Tue May 28 15:52:16 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 0aa3a82d7ae5da22232ad8ffeec6ce1f6ad4392b -Author: godgamer029 -Date: Tue May 28 15:52:09 2019 +0200 - - scaffold comment - -commit aa27bf268657cdb2a072437d68b2c0a61dd63e46 -Author: Kevin Fischer -Date: Tue May 28 15:43:30 2019 +0200 - - Made a speed - -commit 354b38250f31a87792850954d30fe22bdbf1cef3 -Author: godgamer029 -Date: Tue May 28 15:26:30 2019 +0200 - - fix nopacket crash - -commit 9884b54dfaadb58d77cb926887d609bdc53dca74 -Author: Kevin Fischer -Date: Tue May 28 14:59:04 2019 +0200 - - fdgf - -commit d7cf9f154fb6cb120970922b85b4aa4b43107926 -Merge: b7a3413 efc1f9b -Author: Kevin Fischer -Date: Tue May 28 11:11:11 2019 +0200 - - qww - -commit b7a341301eaa80fde7eb35444d1c4e643755421e -Author: Kevin Fischer -Date: Tue May 28 11:07:41 2019 +0200 - - working on speed - -commit efc1f9b55b0b768647dedeb8e520017c535ea747 -Author: erwan celanie -Date: Mon May 27 21:10:10 2019 -0400 - - Big fix - -commit a849da5ca337261e4ec3dd5e2203b38184322631 -Author: erwan celanie -Date: Mon May 27 12:54:20 2019 -0400 - - fix - -commit ce39c0ad3696caf962c23995ac05336debf53362 -Author: godgamer029 -Date: Mon May 27 18:23:25 2019 +0200 - - fix 3 - -commit ca32f0ab458c695690b626ca52ce68ffcbbe690a -Author: godgamer029 -Date: Mon May 27 18:22:12 2019 +0200 - - fix 2 - -commit 8dbe6584154f17966e31d1a8dd8ff7620cef25d8 -Author: godgamer029 -Date: Mon May 27 18:21:29 2019 +0200 - - Fix teleport - -commit 0bb9ffb37f37c802a6f14bbb9c0eaa38d604ea16 -Author: godgamer029 -Date: Mon May 27 17:16:17 2019 +0200 - - chungus - -commit 328c17ec92290d43774f32ba43801fb84857dde9 -Author: godgamer029 -Date: Mon May 27 17:12:16 2019 +0200 - - gamemode - -commit ce9d8543ddaf415e2ea3d58ebe4b2f579bd54efc -Author: godgamer029 -Date: Mon May 27 17:07:58 2019 +0200 - - Friendlist - -commit 52aeb6d86553aa452b0193f24d2d6c4e68060a94 -Author: godgamer029 -Date: Mon May 27 17:01:24 2019 +0200 - - Upper case description & Usage - -commit d7d6b730252e6141d34a94ee612f88ed488de055 -Author: erwan celanie -Date: Mon May 27 09:55:31 2019 -0400 - - some fix - -commit 3bf11b50f67d3421be5b84a1ccca6b75d5254dde -Author: erwan celanie -Date: Mon May 27 09:42:36 2019 -0400 - - Update is ready - -commit cbe9f688ae8c3e4dee8c9e1576570796e4b3151d -Author: erwan celanie -Date: Sun May 26 09:35:05 2019 -0400 - - Bunch of stuffs - -commit cd38947114b51478cc70e7128e31ba1da548876f -Author: erwan celanie -Date: Sat May 25 13:32:04 2019 -0400 - - Good Nofall and GameMode - -commit 5d60641ecc3502a83ad36ea508ca0dc10b16068c -Author: erwan celanie -Date: Fri May 24 23:24:35 2019 -0400 - - Fix C_Entity - -commit 978a319461a63f32cc88e427fd4a509699813da1 -Author: erwan celanie -Date: Fri May 24 16:26:06 2019 -0400 - - Good Player teleport command - -commit 58bb71c4e24480fa99a3131edd06c193d86cb0ee -Author: erwan celanie -Date: Thu May 23 23:34:06 2019 -0400 - - fix arraylist - -commit c949cd91c5ddd23eb96d76ea566712f3be96862d -Author: erwan celanie -Date: Thu May 23 23:01:34 2019 -0400 - - fix Blink - -commit f127ca42b95ae9b1b26392b1a9eb67c09149ac43 -Author: erwan celanie -Date: Thu May 23 22:17:10 2019 -0400 - - Player Teleport Command - -commit f9e250be58e88abad9dacd878f16e5164db14f55 -Author: erwan celanie -Date: Wed May 22 00:04:44 2019 -0400 - - Blink Meme - -commit bd1f937470ab6c0622fef0abe060677f495dc58e -Author: erwan celanie -Date: Tue May 21 15:43:08 2019 -0400 - - NoFall - -commit f3f6149550f145d0f49d6a14ba9d120d62136000 -Author: erwan celanie -Date: Mon May 20 18:48:21 2019 -0400 - - bind numpad key - -commit c8d6cac42981f74ce17fbe00ac208064bd304c86 -Author: erwan celanie -Date: Sun May 19 23:40:55 2019 -0400 - - name check - -commit c63c5bcc75ff635f0867f9950582cace928bb613 -Author: godgamer029 -Date: Sat May 18 22:28:13 2019 +0200 - - fix - -commit b41c91c834cf5bd8662f8d180b51ae1709fa557c -Author: godgamer029 -Date: Sat May 18 22:17:53 2019 +0200 - - fix fov hook - -commit 30f7a691167e79faac61cb67cb43f74c979b45a7 -Author: godgamer029 -Date: Sat May 18 21:57:29 2019 +0200 - - Start work on Speed - -commit b09652132102bd5318a028aea7bbb781c4b51be1 -Author: godgamer029 -Date: Sat May 18 21:22:36 2019 +0200 - - Add RelTP & Toggle Command - -commit d4c9e26b232f13fc7046545bfda6bcf3dff2be66 -Author: erwan celanie -Date: Sat May 18 13:08:07 2019 -0400 - - Better sig - -commit e48b0b3514c12050d1bd6cd19c34716a5348daab -Author: erwan celanie -Date: Sat May 18 11:36:30 2019 -0400 - - Better entitylist - -commit 8ea3c3baaded587b283faae464d4bf3884902dee -Author: godgamer029 -Date: Sat May 18 17:24:24 2019 +0200 - - Scaffold is nice - -commit 297963260a93d2695e32de73a9295d9dae18c75c -Author: godgamer029 -Date: Sat May 18 17:18:52 2019 +0200 - - Fix some issues - -commit 90572bff8b70b40fd86327ebacc9d73affe09d9d -Author: godgamer029 -Date: Sat May 18 17:15:15 2019 +0200 - - cleanup - -commit c5b68ec40e0645d3221730b964cb566416eceaa5 -Author: godgamer029 -Date: Sat May 18 17:01:22 2019 +0200 - - Good scaffold - -commit 9a73ca9aae1458d416f08057f192027adfce3570 -Author: godgamer029 -Date: Sat May 18 16:19:06 2019 +0200 - - Working scaffold - -commit 87eee300f44ffbad30db46d4407f6310feed6456 -Author: godgamer029 -Date: Sat May 18 13:43:00 2019 +0200 - - comment - -commit 824d4802c0d12c180a5c2593ca516728e36167d7 -Author: godgamer029 -Date: Fri May 17 20:26:52 2019 +0200 - - scaffold - -commit 24b42926659a8d0703bf23d08c67be65bf01d12c -Author: godgamer029 -Date: Fri May 17 17:35:24 2019 +0200 - - Start work on Scaffold & getFovHook - -commit fe853841bcdebd2bd90e6b0e8c76609fd7d44c23 -Author: godgamer029 -Date: Fri May 17 15:38:38 2019 +0200 - - Ocean Cleanup mission - -commit 9546dac7db9541bb481a410b9678b7bc72880c7e -Author: godgamer029 -Date: Fri May 17 15:33:25 2019 +0200 - - Same with bowaimbot - -commit 4d5ff0b34ed40b8f0270d1b71de4046814230da3 -Author: godgamer029 -Date: Fri May 17 15:28:38 2019 +0200 - - Aimbot Improvements - -commit 0cef38fe80b9651ffa23f34a51c7b939cb68465e -Author: erwan celanie -Date: Wed May 15 23:27:09 2019 -0400 - - LocalPlayer::Turn - -commit eb2f5fa8eab98b0d929e6857976a95ab1dc595b0 -Author: godgamer029 -Date: Wed May 15 16:59:49 2019 +0200 - - bowaimbot - -commit aae4632e62c537a85ed79290363203812d75c128 -Author: erwan celanie -Date: Wed May 15 02:00:10 2019 -0400 - - Tracer Module - -commit 97163548d5e67b0ef00a997590358d29b4728aa6 -Author: erwan celanie -Date: Wed May 15 01:18:03 2019 -0400 - - tracers - -commit 70d5f5ed173ae794e0efb3e1ad846272097ae7b8 -Author: godgamer029 -Date: Tue May 14 21:02:38 2019 +0200 - - improof - -commit c1dd4916efacd1211348578f95a138bb60eb8cd8 -Author: godgamer029 -Date: Tue May 14 20:58:45 2019 +0200 - - Better visibility - -commit f83482b8c198a2462f82ee88b242e053c54cecdd -Author: godgamer029 -Date: Tue May 14 20:50:27 2019 +0200 - - nICE looks - -commit 18999b1f7e1fe7251242f1d3dd3d03b81c6a6c24 -Author: godgamer029 -Date: Tue May 14 20:35:08 2019 +0200 - - Arraylist sorted by Text Length - -commit 48984c17efb19325be49d7b41585e609db63bf76 -Author: godgamer029 -Date: Tue May 14 20:16:29 2019 +0200 - - Give dat boi some space - -commit f56e9e287aee6b83e1e8a1f6eb37b8af97b0ffa5 -Author: godgamer029 -Date: Tue May 14 20:15:05 2019 +0200 - - Actual Keybind Names - -commit 6f171e375d13bf25fe7d84ea44f186ebfa95306d -Author: godgamer029 -Date: Tue May 14 20:06:22 2019 +0200 - - AutoSprint - -commit c12f284e3bc9506ab48ca7451cd10fa6920b5a3c -Author: godgamer029 -Date: Tue May 14 19:54:23 2019 +0200 - - Remove unnecessry headers - -commit 72db32f9406c42f941c852c703a87883bbc7dde3 -Author: godgamer029 -Date: Tue May 14 19:52:40 2019 +0200 - - Yay we can now access old commands - -commit 6f05b46bc86bc412ced8b44c96eb8cb20d4b5fbf -Author: godgamer029 -Date: Tue May 14 15:00:03 2019 +0200 - - Dont show esp in menus - -commit 7ead4b4628e1c8eda1ab7361a1a1443e2838bb6f -Author: godgamer029 -Date: Tue May 14 14:16:40 2019 +0200 - - Fix a bunch of crashes - -commit 1ec6297b89d2c806fabda28abe00089865149137 -Author: godgamer029 -Date: Tue May 14 14:01:28 2019 +0200 - - be gone - -commit 951a8853d1e2772b3bed3b752d5e0a88e20d5d45 -Author: godgamer029 -Date: Tue May 14 13:54:23 2019 +0200 - - Fix a bunch of more leaks - -commit b79efd7b4862dd0a1990e86c9debc9d70bb8feb5 -Author: godgamer029 -Date: Tue May 14 13:49:34 2019 +0200 - - Fix more leaks - -commit cc6670ee197669da1fe4859a850af6715921198c -Author: godgamer029 -Date: Tue May 14 13:45:32 2019 +0200 - - Fix some memory leaks - -commit 96eebc14ca7b769f331f2e7273d58fbc6937cce9 -Author: godgamer029 -Date: Tue May 14 13:31:06 2019 +0200 - - Keybinds are now being saved - -commit e56398b17f53777a9e342cb7fbf737132096a912 -Author: erwan celanie -Date: Mon May 13 20:17:36 2019 -0400 - - fix GUI - -commit 608d663e26d0003a7c10f5048ac66e5b9200083b -Author: erwan celanie -Date: Mon May 13 00:14:50 2019 -0400 - - Broke Gui - -commit 0c41878b610c8561221b725636187ee917ef7350 -Author: erwan celanie -Date: Sun May 12 12:12:31 2019 -0400 - - Phase,Freecam,Gui - -commit e57f869640e523985e8c33feb56d6b0bf83870ed -Author: godgamer029 -Date: Sun May 12 14:54:49 2019 +0200 - - Configs - -commit 7ce247c991efe5d4f5acb7a092c04c83c9e770d0 -Author: erwan celanie -Date: Sun May 12 08:27:26 2019 -0400 - - gui color - -commit e1b85433035d43e71a83fba45d1078746f88ec4c -Author: erwan celanie -Date: Sun May 12 07:34:11 2019 -0400 - - ArrayList on the right - -commit 4d75177a0feb3114fa428018c72dec57294eb279 -Author: godgamer029 -Date: Sun May 12 11:58:32 2019 +0200 - - Bug Fixes - -commit 51175a2ff85e3f77a16a1498c4a58df4590f1b25 -Author: godgamer029 -Date: Sun May 12 11:21:55 2019 +0200 - - Fix jetpack - -commit 33662377b77393b0a3aed48ccd5b3d9b744bf425 -Author: godgamer029 -Date: Sat May 11 23:50:56 2019 +0200 - - Bind Command - -commit 6c31ea6bab5536c632633af7d7bd23e07c897615 -Author: godgamer029 -Date: Sat May 11 23:28:54 2019 +0200 - - Improvements for Commands - -commit 9288caae2715f6864c07b2b2236661802a344ee2 -Author: godgamer029 -Date: Sat May 11 22:07:02 2019 +0200 - - Actual autocomplete - -commit 0a88f425802ce411d3d5a18c35c79ed60793cd54 -Author: godgamer029 -Date: Sat May 11 20:16:24 2019 +0200 - - Partial autocomplete - -commit 918691fb1ec6e50375b39d4b1411f99d8fee0dfc -Author: godgamer029 -Date: Sat May 11 18:39:01 2019 +0200 - - Teleport command - -commit 467563cd36aeb9928bb07b27c43ce13f3c4ca5dc -Author: godgamer029 -Date: Sat May 11 15:56:26 2019 +0200 - - Commands n stuff - -commit 0ff8f4e1a24bb4eb85ead08ffbd4664515747a36 -Author: godgamer029 -Date: Sat May 11 15:52:22 2019 +0200 - - EjectCommand & Commands actually work now - -commit c19bcf2b58579c3371430ac5f75a7352be1cc7ca -Author: godgamer029 -Date: Sat May 11 14:07:17 2019 +0200 - - Start work on Command Manager - -commit 969573334e957a0d9dac3729c9c2836b45d90a79 -Author: godgamer029 -Date: Sat May 11 13:54:33 2019 +0200 - - Activate edition changer - -commit 90c87a05bf18cbd94fd61d1c8e80b10f56b6bde0 -Author: godgamer029 -Date: Sat May 11 12:45:45 2019 +0200 - - Game Edition CHanger - -commit 28b92c41879c42397ee8520cd5e7e43e17bf16b4 -Author: godgamer029 -Date: Fri May 10 21:20:18 2019 +0200 - - Only press keybinds when not in inventory etc - -commit d126deee17e378a5344ac6cccdf48237bec4cf19 -Author: godgamer029 -Date: Fri May 10 20:21:43 2019 +0200 - - Add Glide - -commit b170896f59ad9cb277c2f43b40339ac6a2d86f39 -Author: godgamer029 -Date: Fri May 10 20:07:53 2019 +0200 - - Step added - -commit e4216a61e6136af3de0ee6a3e2f9e1d3416a6a66 -Author: godgamer029 -Date: Fri May 10 18:21:56 2019 +0200 - - AirJump - -commit 7bfcd06c5d5c6b46b218a97f5c3c4b8551387a16 -Author: godgamer029 -Date: Fri May 10 18:17:16 2019 +0200 - - Toggle RainbowSky - -commit d4be076054e2f652922265b506c2c054a6a9f952 -Author: godgamer029 -Date: Wed May 8 21:34:37 2019 +0200 - - Add easy way to get Modules - -commit e585bdc5bc9fca8729eb776688fb2a66de30ddac -Author: godgamer029 -Date: Wed May 8 21:13:37 2019 +0200 - - Chest ESP - -commit 67cf71d16412abd6b81ebccc9dc0c96075834b3a -Author: erwan celanie -Date: Wed May 8 13:29:12 2019 -0400 - - ChestEsp - -commit 666afd6625853701e46265fb1699a9466e0bd893 -Author: godgamer029 -Date: Tue May 7 22:04:22 2019 +0200 - - fix - -commit 5cc9745510ca111617ca407d4c4eb436fe95e782 -Author: godgamer029 -Date: Tue May 7 21:53:18 2019 +0200 - - y - -commit cf336a93b652512ee83112095c87f8f9afb012da -Author: godgamer029 -Date: Tue May 7 21:41:59 2019 +0200 - - Some Support for 1.11.0 - -commit 46e74c74e80bb0228f03d77081dc03a2693aa9ca -Author: godgamer029 -Date: Tue May 7 18:08:41 2019 +0200 - - Fix aimbot n trigger - -commit b630fd28c3f4e7b85dc42d905b8b53dba4f57396 -Author: godgamer029 -Date: Tue May 7 18:01:06 2019 +0200 - - Fix project - -commit 7e29d53d3b06767332f35ff53b941cf6e2101eb4 -Merge: eef61d6 f73ec91 -Author: godgamer029 -Date: Tue May 7 17:54:32 2019 +0200 - - i prolly broke something here - -commit eef61d68a1e3e2ac7b72b693da48ba8ead301a05 -Author: godgamer029 -Date: Tue May 7 17:51:53 2019 +0200 - - Add Jetpack & Flash Mode - -commit 6bdfda222cc2f055717637c439a5b35e0122df67 -Author: godgamer029 -Date: Tue May 7 17:34:23 2019 +0200 - - Remove Close String - -commit f73ec91c4d175ac7b089a58fc56e1642af948f45 -Author: erwan celanie -Date: Mon May 6 23:31:08 2019 -0400 - - Aimbot - -commit 27af8b544552dc956c38f48755ac2fd7159a4652 -Author: godgamer029 -Date: Mon May 6 21:20:54 2019 +0200 - - stuff idk - -commit b0614a76bfb213ab238e96ea82251c8af498417a -Author: godgamer029 -Date: Mon May 6 20:15:48 2019 +0200 - - ESP n stuff - -commit c1c06fcdcb197ea24ce6d8ff843e1c0a0b73492a -Author: godgamer029 -Date: Mon May 6 18:59:05 2019 +0200 - - change uninject key to CTRL + L - -commit 8fd1517d7f30a9dfcc827fa7063fff6095af8eb0 -Author: godgamer029 -Date: Sun May 5 21:52:44 2019 +0200 - - fix bug - -commit 78016414f51688048933ec01df6b4d7c6c293091 -Author: godgamer029 -Date: Sun May 5 20:24:05 2019 +0200 - - Entity ESP - -commit bbe319d601d955c8c3e90967bac0cd856d7e3594 -Author: godgamer029 -Date: Sun May 5 20:11:59 2019 +0200 - - Entity ESP - -commit e4d10280b54ecf54c5c87f229a3a007bf29d8dd7 -Author: godgamer029 -Date: Sun May 5 17:31:35 2019 +0200 - - World to screen - -commit 3a078e9c3e4139b5738df95844e820b33536dbc4 -Author: godgamer029 -Date: Sun May 5 16:16:38 2019 +0200 - - Good Font - -commit c336ce5290b6fc1d5fbea98f89bea9e2147615bf -Author: godgamer029 -Date: Sun May 5 15:33:30 2019 +0200 - - dont use this thanks - -commit fb8c17bb773e13049276d23303256909b6401328 -Author: godgamer029 -Date: Sun May 5 14:21:36 2019 +0200 - - yea idk - -commit 657cd76d02c1011ba9391075fcbe24b3d0f46300 -Author: godgamer029 -Date: Sun May 5 11:12:22 2019 +0200 - - Fix some Compiler Warnings - -commit f97565387646d794b344afa589ff6b28613cd557 -Author: godgamer029 -Date: Sun May 5 11:06:59 2019 +0200 - - Sig & FIxed some compiler warnings - -commit ccb1eb6d71908bbb45d6ffbadac33abb8b31fde2 -Author: godgamer029 -Date: Sun May 5 10:50:27 2019 +0200 - - Slick Background n DrawUtils - -commit 9364bdc0f99ffa2d9047f7ba03d793f79616c22b -Author: erwan celanie -Date: Sat May 4 23:10:51 2019 -0400 - - font - -commit 82d0f369119f2fdb4d6869799057787c4e5c8e72 -Author: godgamer029 -Date: Fri May 3 22:34:34 2019 +0200 - - color support - -commit b5624c05e83ab53204a7c1f230f878357392774a -Author: godgamer029 -Date: Fri May 3 22:01:25 2019 +0200 - - Draw sum lines - -commit 48d32e642765f10aadf0fbf64e12deb287c1b483 -Author: godgamer029 -Date: Fri May 3 16:49:41 2019 +0200 - - SurvivalMode::tick - -commit c69842e6b91b7d53a65234a691444617b224802c -Author: godgamer029 -Date: Fri May 3 15:46:22 2019 +0200 - - killaura - -commit 208900a47a249124f24bb15a2dc832712614a63a -Author: godgamer029 -Date: Fri May 3 15:41:50 2019 +0200 - - OnTick now actually works - -commit f87ac9c27d17e6c5d713f8da19c35701e88f7d7c -Author: godgamer029 -Date: Fri May 3 15:35:42 2019 +0200 - - Clean up Log - -commit d6652c7e5811d9ae527e87cd7e7810f146173498 -Author: godgamer029 -Date: Fri May 3 15:31:38 2019 +0200 - - Improvements - -commit 3933c217c1bff59fd3a793739734d1085b2133c9 -Author: godgamer029 -Date: Fri May 3 14:41:29 2019 +0200 - - Keybinds n stuff - -commit d842aa248cd5455e2e9deada28b733774166c206 -Author: godgamer029 -Date: Thu May 2 21:14:19 2019 +0200 - - le singleton - -commit 1cfd300cab5f4986d21e1878c8a29be23b4bc774 -Author: godgamer029 -Date: Thu May 2 21:12:04 2019 +0200 - - Beginnings of a ModuleSystem - -commit 5f6290498bf0dfa252be69502348affeb836005d -Author: godgamer029 -Date: Thu May 2 19:51:09 2019 +0200 - - refactor - -commit 80ec345fa40c30201eb5d693e590a301f39c6998 -Author: godgamer029 -Date: Thu May 2 19:44:00 2019 +0200 - - Moved some stuff - -commit 2cc4a3e24466ed3866319c73d648708a946c6936 -Author: godgamer029 -Date: Thu May 2 19:13:15 2019 +0200 - - Rainbow sky - -commit 15fafdf32c33f9e99f4b5f2cbdddb64d9ab1b368 -Author: godgamer029 -Date: Thu May 2 18:42:00 2019 +0200 - - added getLineLength - -commit 079b8632f3044324d51b5cf7a3fdaf6f568268a8 -Author: godgamer029 -Date: Wed May 1 21:45:32 2019 +0200 - - yeet - -commit 00480fce9e969a1774f6bb4e2a625d113512ef8a -Author: godgamer029 -Date: Wed May 1 21:30:51 2019 +0200 - - Horion logo - -commit 837e5d9f67b06d0c36938d0f95ecd38811e3592b -Author: godgamer029 -Date: Wed May 1 21:25:06 2019 +0200 - - Faster build settings - -commit 813bfe88091556ca93ef4e1c950db6b4615642e7 -Author: godgamer029 -Date: Wed May 1 20:58:11 2019 +0200 - - fixed entity struct - -commit 8dd208f9bec8eed170aa317c85da303e061fc45e -Author: godgamer029 -Date: Wed May 1 20:46:55 2019 +0200 - - release / grab mouse - -commit 36ce2b93fa780c0fb01653d0fb578905b591195f -Author: godgamer029 -Date: Wed May 1 20:19:00 2019 +0200 - - ocean cleanup mission - -commit 7cc7cca97774a27f13ad4baa76f8cec36becd034 -Author: godgamer029 -Date: Wed May 1 19:36:08 2019 +0200 - - drawText - -commit 1addb505623abb933205331dc85c63ea3b8fc182 -Author: godgamer029 -Date: Tue Apr 30 20:22:28 2019 +0200 - - yeet - -commit 304bc9ba1966800f230ee67cbdc98b5948a9150c -Merge: da7466c 2177b0f -Author: godgamer029 -Date: Tue Apr 30 20:15:14 2019 +0200 - - meeerge - -commit da7466c3b3c4c6b29cb1975f6e0b95fe4b3c6d1a -Author: godgamer029 -Date: Tue Apr 30 20:14:04 2019 +0200 - - B1g Rectangle - -commit 2177b0f77ac5c7916c28ffd1ef2e42ef07e75a41 -Author: erwan celanie -Date: Tue Apr 30 14:10:51 2019 -0400 - - diretcx hook fail - -commit 4f8d00baa4a451656de34d9364afa1d52068d399 -Author: godgamer029 -Date: Mon Apr 29 17:43:47 2019 +0200 - - Fixed minor Logger thread safety issues - -commit b94a1f02384a2399a78da5a2df718d569b7456b9 -Author: godgamer029 -Date: Mon Apr 29 17:35:13 2019 +0200 - - d3d11 present hook - -commit 019a75b819223c3cce3f075a2ea40930a3a4cce1 -Author: erwan celanie -Date: Mon Apr 29 11:14:42 2019 -0400 - - Directx Yeet - -commit 45687ce79a4d9ff9e31708193f2ce951f82ac5e6 -Author: godgamer029 -Date: Sun Apr 28 21:50:51 2019 +0200 - - command system - -commit 5f9b4cb00b8110d19e58c83af975221b9dd54b7e -Author: godgamer029 -Date: Sun Apr 28 20:38:09 2019 +0200 - - unlock achievements - -commit 82b8ed98a301cde977fba473873f0509241d41aa -Author: godgamer029 -Date: Sun Apr 28 18:28:16 2019 +0200 - - color - -commit 035e59c9f13893a4093eec73ec59625cf01d051a -Author: godgamer029 -Date: Sun Apr 28 16:18:57 2019 +0200 - - stuff - -commit 112f8f4e8d26bc897e1f8815e3479cd87d852d8f -Author: godgamer029 -Date: Sat Apr 27 23:59:33 2019 +0200 - - refactor lots of stuff - -commit 8ed913f3be21aa1e9ac4efa179a8c16ed6d78fbd -Author: godgamer029 -Date: Sat Apr 27 23:17:59 2019 +0200 - - GameMode::tick hook & Logger fix - -commit f962883d8f61b70949f8a8b858fe897f94e7433c -Author: godgamer029 -Date: Sat Apr 27 22:49:06 2019 +0200 - - FuncHook - -commit 5acfa1b87d67e5ee47a2ef817a2a4df9ffdbab81 -Author: godgamer029 -Date: Sat Apr 27 22:38:54 2019 +0200 - - rcx with signature - -commit 60fa3bb420e7e2ad3283b00c0c4d67216965b92b -Author: godgamer029 -Date: Sat Apr 27 22:21:32 2019 +0200 - - fix - -commit 9b64b084f7c06b30b06af449973a4669489addfe -Merge: 211b703 e23e468 -Author: godgamer029 -Date: Sat Apr 27 22:12:54 2019 +0200 - - chungus - -commit 211b703e53020044996168c922e238ceb715f300 -Author: godgamer029 -Date: Sat Apr 27 22:11:18 2019 +0200 - - idek - -commit e23e46821bba239dce9e937a3a068bc008ef509a -Merge: 213bb7d 695dabc -Author: erwan celanie -Date: Sat Apr 27 16:09:53 2019 -0400 - - sorry - -commit 213bb7d2b96fb1b5bdd08319d4c3366769cba73e -Author: erwan celanie -Date: Sat Apr 27 16:08:36 2019 -0400 - - sorry - -commit 695dabc35fdee1629573406ef0b916155f70227e -Merge: 52446e1 adaee53 -Author: godgamer029 -Date: Sat Apr 27 22:08:06 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 52446e17b479c58c6de49bfad07ebe6d63b2b6da -Author: godgamer029 -Date: Sat Apr 27 22:08:00 2019 +0200 - - wtf men - -commit b1a9c4cc2e2401f7ddfcbbe163d039b93b506a1c -Author: godgamer029 -Date: Sat Apr 27 22:07:51 2019 +0200 - - Revert "fine" - - This reverts commit adaee53dff97003bb8ba119ab9ce661b64ed4761. - -commit adaee53dff97003bb8ba119ab9ce661b64ed4761 -Author: erwan celanie -Date: Sat Apr 27 15:52:08 2019 -0400 - - fine - -commit c4e731a7813a78499c4d9d6bbe27a527512a23c6 -Merge: 6ee3d2a cb97db8 -Author: erwan celanie -Date: Sat Apr 27 15:51:20 2019 -0400 - - Fine - -commit cb97db8b170d891f3068dbb8b7039eb63bfa39be -Author: godgamer029 -Date: Sat Apr 27 21:40:17 2019 +0200 - - even less ghetto - -commit 6392964b8e69daa149919d61c1a4a2b7ff019c5e -Author: godgamer029 -Date: Sat Apr 27 21:37:13 2019 +0200 - - good - -commit 6ee3d2aa03ae496c33fbddd26076c2ba8208fdd6 -Author: godgamer029 -Date: Sat Apr 27 20:55:33 2019 +0200 - - ͡° ͜ʖ ͡°) - -commit 3b83e4760edb89056b48456eb9d0f5f89071ec13 -Author: godgamer029 -Date: Sat Apr 27 21:16:15 2019 +0200 - - i liek signatures - -commit de412731f52d8072438731b94b907857ceadb4ed -Author: godgamer029 -Date: Sat Apr 27 20:55:33 2019 +0200 - - ͡° ͜ʖ ͡°) - -commit 0adb598a19ef86e9fb57e73fbd99df61d6856eb9 -Author: godgamer029 -Date: Sat Apr 27 20:54:51 2019 +0200 - - vtable via signature - -commit 64b64f18fb7af531a0e30cf67be32908b52617f3 -Author: godgamer029 -Date: Sat Apr 27 20:36:40 2019 +0200 - - moveplaypacket - -commit d1d5a1afc046ff15f425b9e6cfbedb15639ef321 -Author: godgamer029 -Date: Sat Apr 27 20:01:15 2019 +0200 - - updated some stuff - -commit 50cd17657eb3e5088093a80a2ca131c2d6d17c30 -Author: godgamer029 -Date: Sat Apr 27 19:32:57 2019 +0200 - - Start work on FuncHook class - -commit aec80f0d768bf4ac1b6916411abe758c4fe3adeb -Author: erwan celanie -Date: Sat Apr 27 13:29:43 2019 -0400 - - Send Packets - -commit 4b12ff4da63383eec61448bae1c519998ae04a22 -Author: godgamer029 -Date: Sat Apr 27 18:33:31 2019 +0200 - - add vmt hook class - -commit 3efcfbb2d02db3e75b6dc013c266aec7ed16e6a0 -Author: godgamer029 -Date: Sat Apr 27 18:09:32 2019 +0200 - - minhook update - -commit 554e99b8bcdecce53c1cc00399f439a470ca6705 -Author: godgamer029 -Date: Sat Apr 27 17:19:14 2019 +0200 - - updet - -commit c82c64cfa398fc3a4a7942e5ed50080f993da225 -Author: godgamer029 -Date: Sat Apr 27 16:19:06 2019 +0200 - - ghetto code - -commit 419d2b2693fb6f6dfca37d59277d11975d24edd1 -Author: godgamer029 -Date: Sat Apr 27 15:14:32 2019 +0200 - - actually add minhook - -commit 4c2114fccad18fdadb41138cede78f7ca7646ed8 -Author: godgamer029 -Date: Sat Apr 27 15:09:45 2019 +0200 - - add minhook - -commit 57533528a25485ff7260ea8c14f5ba00a459e391 -Merge: 0cf1776 852a372 -Author: godgamer029 -Date: Sat Apr 27 13:37:39 2019 +0200 - - boi - -commit 0cf17769e496f6b0fe7d04163b30042e2c15219b -Author: godgamer029 -Date: Sat Apr 27 13:37:13 2019 +0200 - - boi - -commit 852a37292905b5c1f14662956a23e1426fc4e62b -Author: erwan celanie -Date: Sat Apr 27 00:42:36 2019 -0400 - - Update for 1.11.1 - -commit 8b5517fddac6053367d5502be8dc8428637613aa -Author: godgamer029 -Date: Fri Apr 26 23:49:53 2019 +0200 - - _destroyBlockInternal - -commit 21a0d8133f964055751b69eb521fa49010b5960d -Author: godgamer029 -Date: Fri Apr 26 22:52:14 2019 +0200 - - comment - -commit 0d7d5185e7737b7ed5dfa379650bc4adeed46159 -Merge: 13216b3 39b160e -Author: godgamer029 -Date: Fri Apr 26 22:51:42 2019 +0200 - - yeee - -commit 13216b3362b38eb2824f730bf9045dfd20686663 -Author: godgamer029 -Date: Fri Apr 26 22:51:13 2019 +0200 - - yeehawt - -commit 39b160ed8adfd6b7ffdcb789accb7a1102e91dbd -Author: erwan celanie -Date: Fri Apr 26 16:48:47 2019 -0400 - - Yeet - -commit 2bff575d0f7cf58d2313ea70d7de1d34db057edb -Author: erwan celanie -Date: Fri Apr 26 13:23:48 2019 -0400 - - Check by EntityType - -commit 4261ae8ad6ce06a8792797b1647aeec3dd825783 -Author: erwan celanie -Date: Fri Apr 26 11:20:36 2019 -0400 - - Check by Hitbox - -commit afa81cd2960d44286957109f742a877f46484919 -Author: godgamer029 -Date: Fri Apr 26 15:48:09 2019 +0200 - - he attac - -commit 940ea494b755d610c77eb20a84e0cc9aac05f1b9 -Author: godgamer029 -Date: Fri Apr 26 13:54:43 2019 +0200 - - fix mit x - -commit 6f2572b293fd1ea7f0843d64a0a58b121bb88c3d -Author: godgamer029 -Date: Thu Apr 25 21:32:50 2019 +0200 - - Send Chat Message - -commit 83a04daa8c949db0608bc35cbf785dbc76d93633 -Author: godgamer029 -Date: Thu Apr 25 16:40:19 2019 +0200 - - added ClientInstance - -commit 1df8b5029ea9893ed113d4751a90a4020e503f45 -Author: godgamer029 -Date: Thu Apr 25 15:21:52 2019 +0200 - - Update Proof KeyMap - -commit 1114e48d722bfc908ed358622821c69b2bafc559 -Author: godgamer029 -Date: Thu Apr 25 14:42:18 2019 +0200 - - Swing Func & Graceful Logger close - -commit 99536946c0d41a5f05fcc87d6d9d85bdb1d867de -Author: godgamer029 -Date: Thu Apr 25 14:00:26 2019 +0200 - - Use other form of synchronizing log - -commit 5ec788d781bcd7f0c4054b260793efce2b8c491f -Author: godgamer029 -Date: Thu Apr 25 13:47:53 2019 +0200 - - fix some warnings - -commit 8c1ca2b7720869d6c15e90ef469e4b13616256e0 -Author: godgamer029 -Date: Thu Apr 25 13:42:56 2019 +0200 - - remove unnecessary logging - -commit ecc6f078d28b81add255255a5cbca098de8ac428 -Author: godgamer029 -Date: Thu Apr 25 13:41:46 2019 +0200 - - Fix struct alignment - -commit c8fafa3330577f871700eb70d3fab7f0801d7344 -Author: godgamer029 -Date: Thu Apr 25 12:59:10 2019 +0200 - - sdk - -commit 6756564187cf149af14490c47ee1e80094449c49 -Author: godgamer029 -Date: Thu Apr 25 12:12:46 2019 +0200 - - Cleanup & SlimMem now uses internal ways of reading & writing - -commit aa8cc1f98c75652b12bba527315edbdba882f67d -Author: erwan celanie -Date: Thu Apr 25 00:27:15 2019 -0400 - - FIX - -commit 4de788f46af2d87a59813f798a75574bf48bcf9a -Author: erwan celanie -Date: Thu Apr 25 00:22:59 2019 -0400 - - FIX - -commit 4af2cd0801e95c200c70fdff6760c571fa21e342 -Author: erwan celanie -Date: Thu Apr 25 00:02:43 2019 -0400 - - Fix i'm so tired - -commit 525546ceb9fe3e6218a9788592a6a7ec1b2bed7b -Author: godgamer029 -Date: Thu Apr 25 00:55:35 2019 +0200 - - cleanuü - -commit 1f168635dd5a68a0f47ec0b89ca5d27dc1c78613 -Author: godgamer029 -Date: Thu Apr 25 00:23:03 2019 +0200 - - idk - -commit 0d593d229dc250dc694f7484d4b97584cd2f419e -Author: godgamer029 -Date: Wed Apr 24 23:57:43 2019 +0200 - - cleanup - -commit 789e7c90179861fda3cc42e7124d0eee494023fb -Author: godgamer029 -Date: Wed Apr 24 23:55:07 2019 +0200 - - remove hardcoded values - -commit aa55a20a8db4c41ecd89d3ac34ca82e41ca78b9b -Author: godgamer029 -Date: Wed Apr 24 23:53:26 2019 +0200 - - Key change - -commit 242edcb9621c44027492abd95e6fd4c372233157 -Author: godgamer029 -Date: Wed Apr 24 23:29:53 2019 +0200 - - quickfix - -commit 53cc734636ed08cc443dc8ec6213b0597fc11745 -Author: godgamer029 -Date: Wed Apr 24 23:28:06 2019 +0200 - - Use new Entity Class - -commit f4734fa6975dbef2acc054d358ebad6b2e6a4101 -Author: godgamer029 -Date: Wed Apr 24 23:20:34 2019 +0200 - - add Entity SDK - -commit ee6443a8fb9f2a0a6ffe26a92e0de7194608bcbc -Author: erwan celanie -Date: Wed Apr 24 17:18:45 2019 -0400 - - Test - -commit b49c677a80be55c1133b14a77286c5c6b8a53156 -Author: godgamer029 -Date: Wed Apr 24 22:07:48 2019 +0200 - - idk - -commit 7b55c1bac33f8b197d9bcf131d145893f06e468a -Author: godgamer029 -Date: Wed Apr 24 21:55:45 2019 +0200 - - implement math - -commit 978e8d3034bdda03bc563838582d126ca2f588dc -Author: godgamer029 -Date: Wed Apr 24 21:54:20 2019 +0200 - - Add HBob math - -commit e35a875d771a815d258d6bac559e0d0b46151b91 -Author: godgamer029 -Date: Wed Apr 24 21:51:24 2019 +0200 - - fix - -commit d364fb4a56d602ef84227f54bdcb7e0d259f1050 -Author: godgamer029 -Date: Wed Apr 24 21:50:57 2019 +0200 - - A start - -commit 9bcffbc5e7af93f334daedd4b015a69953f46a58 -Author: godgamer029 -Date: Wed Apr 24 21:29:05 2019 +0200 - - fix code - -commit abb1442e2efd1f360239fe4bfe04b1f4abd8081b -Merge: d12dce5 14867c5 -Author: godgamer029 -Date: Wed Apr 24 21:24:08 2019 +0200 - - yeezt - -commit d12dce5388da1ef411cdd17696a1e9b827cbb73e -Author: godgamer029 -Date: Wed Apr 24 21:22:33 2019 +0200 - - More Comments & Time - -commit 14867c56edff2b1815e27b529b53a5b6761cd8a9 -Author: erwan celanie -Date: Wed Apr 24 15:19:47 2019 -0400 - - dank! - -commit 688b9d55209d335a61bfeae7fc14ac6ce35c3575 -Author: godgamer029 -Date: Wed Apr 24 19:50:04 2019 +0200 - - Comment - -commit 31d1fb4ebe54d709d2bd5718e8a520fe1eba5caf -Author: godgamer029 -Date: Wed Apr 24 19:48:09 2019 +0200 - - Add Utils - -commit 712cac0f9f5cccd28062f8b8da27c5e32c959769 -Author: godgamer029 -Date: Wed Apr 24 18:04:34 2019 +0200 - - text - -commit e5818fa99842b22f500c0bce44b38aaefa7dd4ab -Author: godgamer029 -Date: Wed Apr 24 17:56:04 2019 +0200 - - Press L to uninject - -commit 4ceb6aabb4a26c8cfb978d9bda535f954ffa6625 -Author: godgamer029 -Date: Wed Apr 24 17:06:44 2019 +0200 - - Get Async Key State still not working - -commit 0df04a3317ef8fd34dfb98a850711c596a172bba -Author: godgamer029 -Date: Wed Apr 24 16:15:46 2019 +0200 - - refactor - -commit e8b5c07c586068b03bfccd03bb59cc4178b6b8c0 -Author: godgamer029 -Date: Wed Apr 24 16:09:54 2019 +0200 - - fix - -commit 81c0f990f0fd4551299103a23edd7f9defbef008 -Author: godgamer029 -Date: Wed Apr 24 16:07:10 2019 +0200 - - logging works now - -commit f0005ee858000e7d7fd6fe607941604f6e269b97 -Merge: 24b4532 0ac9b72 -Author: godgamer029 -Date: Wed Apr 24 15:14:53 2019 +0200 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 24b4532f4c84615068058d1f2f30c15fec31e3de -Author: godgamer029 -Date: Wed Apr 24 15:14:46 2019 +0200 - - sdad - -commit 0ac9b72cd1da4e3ca8744559da7c468e3b12232b -Merge: 1791d24 eb2111e -Author: erwan celanie -Date: Wed Apr 24 09:14:00 2019 -0400 - - Merge branch 'master' of https://github.com/Godsoft029/Horion - -commit 1791d243920817ad5548c8c8ec389b4dbd48c4e0 -Author: erwan celanie -Date: Wed Apr 24 09:13:51 2019 -0400 - - Hi ! - -commit eb2111ea83832331ea97191f85c1956404ea8c9f -Author: godgamer029 -Date: Wed Apr 24 15:13:27 2019 +0200 - - some changes - -commit f03a2cfe5569836f36c17400daccb8d3d158143d -Author: erwan celanie -Date: Wed Apr 24 09:11:18 2019 -0400 - - HI ! - -commit 16c1674b25f068b2311cc77a78b652ee3b890318 -Author: godgamer029 -Date: Wed Apr 24 15:05:24 2019 +0200 - - big chngeww - -commit e8c72d56b894c48abf0b9f5860f7dbb5462160a2 -Author: godgamer029 -Date: Wed Apr 24 14:43:04 2019 +0200 - - add dll main - -commit 4cdfe40197ccde5d47e6c49c1dcf3212097dddb2 -Author: godgamer029 -Date: Wed Apr 24 14:38:53 2019 +0200 - - Add Solution - -commit 90f566e99623411315f4a3fdcfa4a17de4836e02 -Author: GodSoft029 -Date: Wed Apr 24 14:38:12 2019 +0200 - - Create .gitignore - -commit c788179064c8088898bf331c0937c945f02c6d13 -Author: GodSoft029 -Date: Wed Apr 24 14:37:30 2019 +0200 - - Delete .gitignore - -commit 7fe4958aa43db5ce337727221f89b733b0e5a6b2 -Author: GodSoft029 -Date: Wed Apr 24 14:25:40 2019 +0200 - - Initial commit From 19eca4132a55efac5375016a48eeb87a036a0270 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 18:35:38 +0800 Subject: [PATCH 124/419] Implement Waypoints --- Horion.vcxproj | 4 + Horion/Command/CommandMgr.cpp | 1 + Horion/Command/CommandMgr.h | 1 + Horion/Command/Commands/WaypointCommand.cpp | 40 ++++++++ Horion/Command/Commands/WaypointCommand.h | 14 +++ Horion/DrawUtils.cpp | 22 +++++ Horion/DrawUtils.h | 1 + Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/Waypoints.cpp | 100 ++++++++++++++++++++ Horion/Module/Modules/Waypoints.h | 44 +++++++++ 11 files changed, 229 insertions(+) create mode 100644 Horion/Command/Commands/WaypointCommand.cpp create mode 100644 Horion/Command/Commands/WaypointCommand.h create mode 100644 Horion/Module/Modules/Waypoints.cpp create mode 100644 Horion/Module/Modules/Waypoints.h diff --git a/Horion.vcxproj b/Horion.vcxproj index f14960c2..1abd4deb 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -261,6 +261,7 @@ + @@ -351,6 +352,7 @@ + @@ -433,6 +435,7 @@ + @@ -523,6 +526,7 @@ + diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index ae31a168..e67987c3 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -40,6 +40,7 @@ void CommandMgr::initCommands() { commandList.push_back(new ConfigCommand()); commandList.push_back(new SetprefixCommand()); commandList.push_back(new NbtCommand()); + commandList.push_back(new WaypointCommand()); commandList.push_back(new CommandBlockExploitCommand()); commandList.push_back(new NameSpoofCommand()); diff --git a/Horion/Command/CommandMgr.h b/Horion/Command/CommandMgr.h index c49f25a1..dc1ca31d 100644 --- a/Horion/Command/CommandMgr.h +++ b/Horion/Command/CommandMgr.h @@ -31,6 +31,7 @@ #include "Commands/SetprefixCommand.h" #include "Commands/NbtCommand.h" #include "Commands/ExecuteCommand.h" +#include "Commands/WaypointCommand.h" #include "Commands/ScriptCommand.h" #include "Commands/PathCommand.h" diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp new file mode 100644 index 00000000..5939692d --- /dev/null +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -0,0 +1,40 @@ +#include "WaypointCommand.h" + +WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " ") { + registerAlias("wp"); +} + +WaypointCommand::~WaypointCommand() { +} + +bool WaypointCommand::execute(std::vector* args) { + C_LocalPlayer* player = g_Data.getLocalPlayer(); + assertTrue(player != nullptr); + assertTrue(args->size() > 2); + + static auto mod = moduleMgr->getModule(); + if (mod == nullptr) + return true; + + auto opt = args->at(1); + std::string name = args->at(2); + assertTrue(name.length() > 0); + + if (opt == "add") { + if (mod->add(name, player->currentPos.floor().add(0.5, player->eyePos0.y - player->currentPos.y, 0.5))) { + clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); + } else { + clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); + } + } else if (opt == "remove") { + if (mod->remove(name)) { + clientMessageF("%sRemoved waypoint \"%s\"", RED, name.c_str()); + } else { + clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); + } + } else { + return false; + } + + return true; +} diff --git a/Horion/Command/Commands/WaypointCommand.h b/Horion/Command/Commands/WaypointCommand.h new file mode 100644 index 00000000..b1c5075a --- /dev/null +++ b/Horion/Command/Commands/WaypointCommand.h @@ -0,0 +1,14 @@ +#pragma once + +#include "ICommand.h" +#include "../../Module/ModuleManager.h" +#include "../../Module/Modules/Waypoints.h" + +class WaypointCommand : public IMCCommand { +public: + WaypointCommand(); + ~WaypointCommand(); + + // Inherited via IMCCommand + virtual bool execute(std::vector* args) override; +}; diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 54dbca03..e45918d7 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -506,3 +506,25 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { tess_end(game3dContext, myTess, entityFlatStaticMaterial); } + +void DrawUtils::drawHologram(vec3_t pos, std::string text, float size) { + vec2_t textPos; + vec4_t rectPos; + + text = Utils::sanitize(text); + + float textWidth = getTextWidth(&text, size); + float textHeight = DrawUtils::getFont(Fonts::RUNE)->getLineHeight() * size; + + if (refdef->OWorldToScreen(origin, pos, textPos, fov, screenSize)) { + textPos.y -= textHeight; + textPos.x -= textWidth / 2.f; + rectPos.x = textPos.x - 1.f * size; + rectPos.y = textPos.y - 1.f * size; + rectPos.z = textPos.x + textWidth + 1.f * size; + rectPos.w = textPos.y + textHeight + 2.f * size; + + fillRectangle(rectPos, MC_Color(0, 0, 0), 0.5f); + drawText(textPos, &text, MC_Color(255, 255, 255), size); + } +} diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 457f20ae..53a95569 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -115,6 +115,7 @@ class DrawUtils { static void drawItem(C_ItemStack* item, vec2_t ItemPos, float opacity, float scale, bool isEnchanted); static void drawKeystroke(char key, vec2_t pos); static float getLerpTime(); + static void drawHologram(vec3_t pos, std::string textStr, float textSize); static vec2_t worldToScreen(const vec3_t& world); }; diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 00a92a40..db244b89 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -95,6 +95,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); + this->moduleList.push_back(std::shared_ptr(new Waypoints())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 69c92445..304d3e8d 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -88,6 +88,7 @@ #include "Modules/AntiImmobile.h" #include "Modules/FollowPathModule.h" #include "Modules/NoPaintingCrash.h" +#include "Modules/Waypoints.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp new file mode 100644 index 00000000..edecbffd --- /dev/null +++ b/Horion/Module/Modules/Waypoints.cpp @@ -0,0 +1,100 @@ +#include "Waypoints.h" + +Waypoints::Waypoints() : IModule(0x0, Category::VISUAL, "Shows holograms for user-defined coordinates") { + registerFloatSetting("Size", &size, size, 0.3, 1.6); +} + +Waypoints::~Waypoints() { +} + +const char* Waypoints::getModuleName() { + return "Waypoints"; +} + +void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { + C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); + + if (localPlayer != nullptr && GameData::canUseMoveKeys()) { + for (const auto& wp : waypoints) { + float dist = wp.second.dist(*g_Data.getLocalPlayer()->getPos()); + + std::ostringstream out; + out.precision(2); + out << wp.first << " (" << std::fixed << dist << " m)"; + + DrawUtils::drawHologram(wp.second, out.str(), fmax(size, 3.f / dist)); + DrawUtils::flush(); + } + } +} + +void Waypoints::onEnable() { + waypoints["Spawn"] = vec3_t(0.5, (double)69, 0.5); +} + +using json = nlohmann::json; +void Waypoints::onLoadConfig(void* confVoid) { + IModule::onLoadConfig(confVoid); // retain keybinds & enabled state + waypoints.clear(); + json* conf = reinterpret_cast(confVoid); + std::string modName = getRawModuleName(); + if (conf->contains(modName.c_str())) { + auto obj = conf->at(modName.c_str()); + if (obj.is_null()) + return; + if (obj.contains("list")) { + auto value = obj.at("list"); + if (value.is_null() || !value.is_object()) + return; + + for (json::iterator it = value.begin(); it != value.end(); ++it) { + vec3_t _pos; + auto val = it.value(); + if (!val.contains("pos")) + continue; + auto pos = val.at("pos"); + if (!pos.is_null() && pos.contains("x") && pos["x"].is_number_float() && pos.contains("y") && pos["y"].is_number_float() && pos.contains("z") && pos["z"].is_number_float()) { + try { + _pos = vec3_t(pos["x"].get(), pos["y"].get(), pos["z"].get()); + } catch (std::exception e) { + } + } else { + continue; + } + waypoints[it.key().c_str()] = _pos; + } + } + } +} + +void Waypoints::onSaveConfig(void* confVoid) { + IModule::onSaveConfig(confVoid); // retain keybinds & enabled state + json* conf = reinterpret_cast(confVoid); + + std::string modName = getRawModuleName(); + json obj = {}; + + if (conf->contains(modName.c_str())) { + obj = conf->at(modName.c_str()); + conf->erase(modName.c_str()); + } + if (obj.contains("list")) { + obj.erase("list"); + } + + json myList = {}; + + for (const auto& wp : waypoints) { + json subObj = {}; + subObj["pos"]["x"] = (float)wp.second.x; + subObj["pos"]["y"] = (float)wp.second.y; + subObj["pos"]["z"] = (float)wp.second.z; + myList.emplace(wp.first.c_str(), subObj); + } + + if (waypoints.size() > 0) { + obj.emplace("list", myList); + } + + conf->emplace(modName.c_str(), obj); +} diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h new file mode 100644 index 00000000..6831a3f3 --- /dev/null +++ b/Horion/Module/Modules/Waypoints.h @@ -0,0 +1,44 @@ +#pragma once + +#include +#include "../../DrawUtils.h" +#include "Module.h" +#include "../../../Utils/Json.hpp" + +class Waypoints : public IModule { +private: + std::map waypoints; + +public: + Waypoints(); + ~Waypoints(); + + float size = 0.6f; + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onEnable() override; + virtual void onLoadConfig(void* confVoid) override; + virtual void onSaveConfig(void* confVoid) override; + + bool add(std::string text, vec3_t pos) { + for (const auto& _wp : waypoints) { + if (text == _wp.first) { + return false; + } + } + waypoints[text] = pos; + return true; + } + + bool remove(std::string name) { + for (const auto& _wp : waypoints) { + if (name == _wp.first) { + waypoints.erase(name); + return true; + } + } + return false; + } +}; \ No newline at end of file From c18378144d0dd6ad73dae842df62c6f1ffef75cb Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 18:40:42 +0800 Subject: [PATCH 125/419] Remove test code --- Horion/Module/Modules/Waypoints.cpp | 4 ---- Horion/Module/Modules/Waypoints.h | 1 - 2 files changed, 5 deletions(-) diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index edecbffd..f03dc4f3 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -28,10 +28,6 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { } } -void Waypoints::onEnable() { - waypoints["Spawn"] = vec3_t(0.5, (double)69, 0.5); -} - using json = nlohmann::json; void Waypoints::onLoadConfig(void* confVoid) { IModule::onLoadConfig(confVoid); // retain keybinds & enabled state diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index 6831a3f3..d9d85db6 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -18,7 +18,6 @@ class Waypoints : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; - virtual void onEnable() override; virtual void onLoadConfig(void* confVoid) override; virtual void onSaveConfig(void* confVoid) override; From 2fbf0fe93f3e6738c0133f0c40d11fefa83e8ade Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 19:00:09 +0800 Subject: [PATCH 126/419] Implement .waypoint tp --- Horion/Command/Commands/WaypointCommand.cpp | 12 ++++++++++-- Horion/Module/Modules/Waypoints.cpp | 5 +++-- Horion/Module/Modules/Waypoints.h | 7 +++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 5939692d..7277b135 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -1,6 +1,6 @@ #include "WaypointCommand.h" -WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " ") { +WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " ") { registerAlias("wp"); } @@ -21,7 +21,7 @@ bool WaypointCommand::execute(std::vector* args) { assertTrue(name.length() > 0); if (opt == "add") { - if (mod->add(name, player->currentPos.floor().add(0.5, player->eyePos0.y - player->currentPos.y, 0.5))) { + if (mod->add(name, player->currentPos.floor().add(0.5, 0, 0.5))) { clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); } else { clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); @@ -32,6 +32,14 @@ bool WaypointCommand::execute(std::vector* args) { } else { clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); } + } else if (opt == "tp" || opt == "teleport") { + vec3_t* pos = mod->getWaypoint(name); + if (pos != nullptr) { + player->setPos(*pos); + clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos->x, pos->y, pos->z); + } else { + clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); + } } else { return false; } diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index f03dc4f3..0b4566a5 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -16,13 +16,14 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (localPlayer != nullptr && GameData::canUseMoveKeys()) { for (const auto& wp : waypoints) { - float dist = wp.second.dist(*g_Data.getLocalPlayer()->getPos()); + vec3_t pos = wp.second; + float dist = pos.dist(*g_Data.getLocalPlayer()->getPos()); std::ostringstream out; out.precision(2); out << wp.first << " (" << std::fixed << dist << " m)"; - DrawUtils::drawHologram(wp.second, out.str(), fmax(size, 3.f / dist)); + DrawUtils::drawHologram(pos.add(0, 1.68, 0), out.str(), fmax(size, 3.f / dist)); DrawUtils::flush(); } } diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index d9d85db6..ee6be7c7 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -40,4 +40,11 @@ class Waypoints : public IModule { } return false; } + + vec3_t* getWaypoint(std::string name) { + if (waypoints.find(name) == waypoints.end()) + return nullptr; + + return &waypoints[name]; + }; }; \ No newline at end of file From b3362f039ffce60f847787491b8bbbe75870a008 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Mon, 7 Sep 2020 22:37:51 +0800 Subject: [PATCH 127/419] remove unnecessary string length assert --- Horion/Command/Commands/WaypointCommand.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 7277b135..9d398b56 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -18,7 +18,6 @@ bool WaypointCommand::execute(std::vector* args) { auto opt = args->at(1); std::string name = args->at(2); - assertTrue(name.length() > 0); if (opt == "add") { if (mod->add(name, player->currentPos.floor().add(0.5, 0, 0.5))) { From 6e3512b7a616089a776a184ed567fcc7bc2eca53 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Tue, 8 Sep 2020 05:57:27 +0800 Subject: [PATCH 128/419] Implement Compass --- Horion.vcxproj | 2 + Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/Compass.cpp | 78 +++++++++++++++++++++++++++++++ Horion/Module/Modules/Compass.h | 15 ++++++ 5 files changed, 97 insertions(+) create mode 100644 Horion/Module/Modules/Compass.cpp create mode 100644 Horion/Module/Modules/Compass.h diff --git a/Horion.vcxproj b/Horion.vcxproj index f14960c2..a3b3afed 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -291,6 +291,7 @@ + @@ -463,6 +464,7 @@ + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 00a92a40..0838263e 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -95,6 +95,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); + this->moduleList.push_back(std::shared_ptr(new Compass())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 69c92445..1e23d2bf 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -88,6 +88,7 @@ #include "Modules/AntiImmobile.h" #include "Modules/FollowPathModule.h" #include "Modules/NoPaintingCrash.h" +#include "Modules/Compass.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp new file mode 100644 index 00000000..903fc43d --- /dev/null +++ b/Horion/Module/Modules/Compass.cpp @@ -0,0 +1,78 @@ +#include "Compass.h" +#include "../../../Utils/Logger.h" +#include "../../DrawUtils.h" + +Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { + registerFloatSetting("Opacity", &opacity, opacity, 0.1, 1); +} + +Compass::~Compass() { +} + +const char* Compass::getModuleName() { + return "Compass"; +} + +void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { + C_LocalPlayer* player = g_Data.getLocalPlayer(); + + if (player == nullptr) return; + + int deg = player->yaw + 180; + float sCenter = g_Data.getGuiData()->widthGame / 2; + + for (int off = -90; off <= 90; off++) { + int oDeg = (deg + off) % 360; + if (oDeg < 0) oDeg += 360; + switch (oDeg) { + case 0: + drawCenteredText(vec2_t(sCenter + off, 30), "N", 1); + break; + case 45: + drawCenteredText(vec2_t(sCenter + off, 30), "NE", 1); + break; + case 90: + drawCenteredText(vec2_t(sCenter + off, 30), "E", 1); + break; + case 135: + drawCenteredText(vec2_t(sCenter + off, 30), "SE", 1); + break; + case 180: + drawCenteredText(vec2_t(sCenter + off, 30), "S", 1); + break; + case 225: + drawCenteredText(vec2_t(sCenter + off, 30), "SW", 1); + break; + case 270: + drawCenteredText(vec2_t(sCenter + off, 30), "W", 1); + break; + case 315: + drawCenteredText(vec2_t(sCenter + off, 30), "NW", 1); + break; + } + if (off != 0) { + if ((oDeg % 15) != 0) { + if ((oDeg % 5) == 0) { + DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.25, 16, sCenter + off + 0.25, 19), MC_Color(255, 255, 255), opacity); + } + continue; + } + if (off <= 10 && off >= -10) { + DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.25, 16, sCenter + off + 0.25, 19), MC_Color(255, 255, 255), opacity); + continue; + } + DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.5, 15, sCenter + off + 0.5, 20), MC_Color(255, 255, 255), opacity); + drawCenteredText(vec2_t(sCenter + off, 20), std::to_string(oDeg), 0.75); + } + } + DrawUtils::fillRectangle(vec4_t(sCenter - 0.5, 15, sCenter + 0.5, 25), MC_Color(255, 255, 255), opacity); + drawCenteredText(vec2_t(sCenter, 25), std::to_string(deg), 0.75); + + //drawCenteredText(vec2_t(g_Data.getGuiData()->widthGame / 2, 10), std::to_string(deg), 1); + DrawUtils::flush(); +} + +void Compass::drawCenteredText(vec2_t pos, std::string text, float size) { + pos.x -= DrawUtils::getTextWidth(&text, size) / 2; + DrawUtils::drawText(pos, &text, MC_Color(255, 255, 255), size, opacity); +} diff --git a/Horion/Module/Modules/Compass.h b/Horion/Module/Modules/Compass.h new file mode 100644 index 00000000..037a87d8 --- /dev/null +++ b/Horion/Module/Modules/Compass.h @@ -0,0 +1,15 @@ +#pragma once +#include "Module.h" +class Compass : public IModule { +private: + float opacity = 0.5; + void drawCenteredText(vec2_t pos, std::string text, float size); + +public: + Compass(); + ~Compass(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; +}; From f33328a42acbf24841023c74f7bebac3061c1519 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Tue, 8 Sep 2020 06:17:47 +0800 Subject: [PATCH 129/419] Move imports & fix ClickGUI being layered --- Horion/Module/Modules/Compass.cpp | 6 +----- Horion/Module/Modules/Compass.h | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 903fc43d..e161c507 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -1,6 +1,4 @@ #include "Compass.h" -#include "../../../Utils/Logger.h" -#include "../../DrawUtils.h" Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { registerFloatSetting("Opacity", &opacity, opacity, 0.1, 1); @@ -16,7 +14,7 @@ const char* Compass::getModuleName() { void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* player = g_Data.getLocalPlayer(); - if (player == nullptr) return; + if (player == nullptr || !GameData::canUseMoveKeys()) return; int deg = player->yaw + 180; float sCenter = g_Data.getGuiData()->widthGame / 2; @@ -67,8 +65,6 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { } DrawUtils::fillRectangle(vec4_t(sCenter - 0.5, 15, sCenter + 0.5, 25), MC_Color(255, 255, 255), opacity); drawCenteredText(vec2_t(sCenter, 25), std::to_string(deg), 0.75); - - //drawCenteredText(vec2_t(g_Data.getGuiData()->widthGame / 2, 10), std::to_string(deg), 1); DrawUtils::flush(); } diff --git a/Horion/Module/Modules/Compass.h b/Horion/Module/Modules/Compass.h index 037a87d8..71d78e11 100644 --- a/Horion/Module/Modules/Compass.h +++ b/Horion/Module/Modules/Compass.h @@ -1,5 +1,6 @@ #pragma once #include "Module.h" +#include "../../DrawUtils.h" class Compass : public IModule { private: float opacity = 0.5; From 64d59c5cc39b6df5146defcf73f3ed72766932fd Mon Sep 17 00:00:00 2001 From: CortexPE Date: Tue, 8 Sep 2020 06:31:11 +0800 Subject: [PATCH 130/419] Allow changing range --- Horion/Module/Modules/Compass.cpp | 3 ++- Horion/Module/Modules/Compass.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index e161c507..7124750c 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -2,6 +2,7 @@ Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { registerFloatSetting("Opacity", &opacity, opacity, 0.1, 1); + registerIntSetting("Range", &range, range, 45, 180); } Compass::~Compass() { @@ -19,7 +20,7 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { int deg = player->yaw + 180; float sCenter = g_Data.getGuiData()->widthGame / 2; - for (int off = -90; off <= 90; off++) { + for (int off = -range; off <= range; off++) { int oDeg = (deg + off) % 360; if (oDeg < 0) oDeg += 360; switch (oDeg) { diff --git a/Horion/Module/Modules/Compass.h b/Horion/Module/Modules/Compass.h index 71d78e11..060ea633 100644 --- a/Horion/Module/Modules/Compass.h +++ b/Horion/Module/Modules/Compass.h @@ -4,6 +4,7 @@ class Compass : public IModule { private: float opacity = 0.5; + int range = 90; void drawCenteredText(vec2_t pos, std::string text, float size); public: From 036640d11e19f3860621431ed623532c8a84d18c Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:20:52 +0100 Subject: [PATCH 131/419] Add TimeChanger --- Horion.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Horion.vcxproj b/Horion.vcxproj index f14960c2..e32603ba 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -347,6 +347,7 @@ + @@ -519,6 +520,7 @@ + From 188057e776616174b2423bc7abfc68aab4c88cc8 Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:21:42 +0100 Subject: [PATCH 132/419] Add TimeChanger --- Horion/Module/ModuleManager.cpp | 2 +- Horion/Module/ModuleManager.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 00a92a40..e97d0029 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -95,7 +95,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new NoHurtcam())); this->moduleList.push_back(std::shared_ptr(new AntiImmobile())); this->moduleList.push_back(std::shared_ptr(new NoPaintingCrash())); - + this->moduleList.push_back(std::shared_ptr(new TimeChanger())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); #ifdef _DEBUG diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 69c92445..9c034fca 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -70,6 +70,7 @@ #include "Modules/Speed.h" #include "Modules/StackableItem.h" #include "Modules/Step.h" +#include "Modules/TimeChanger.h" #include "Modules/Timer.h" #include "Modules/Tower.h" #include "Modules/Tracer.h" From 1810c2ddf63f52a559c8a5aa3f2becb00b47e188 Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:23:18 +0100 Subject: [PATCH 133/419] Remove modifier, as it's now in TimeChanger --- Horion/Module/Modules/NightMode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/NightMode.cpp b/Horion/Module/Modules/NightMode.cpp index 4208ba9e..58d64345 100644 --- a/Horion/Module/Modules/NightMode.cpp +++ b/Horion/Module/Modules/NightMode.cpp @@ -1,7 +1,7 @@ #include "NightMode.h" NightMode::NightMode() : IModule(0x0, Category::VISUAL, "Darkens the environment") { - registerFloatSetting("modifier", &this->modifier, this->modifier, 0.1f, 1.f); + //registerFloatSetting("modifier", &this->modifier, this->modifier, 0.1f, 1.f); } NightMode::~NightMode() { From 4269ef5c72feec6ce7f0f31efbd1277cd4d15a39 Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:24:02 +0100 Subject: [PATCH 134/419] Add TimeChanger Module --- Horion/Module/Modules/TimeChanger.cpp | 18 ++++++++++++++++++ Horion/Module/Modules/TimeChanger.h | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Horion/Module/Modules/TimeChanger.cpp create mode 100644 Horion/Module/Modules/TimeChanger.h diff --git a/Horion/Module/Modules/TimeChanger.cpp b/Horion/Module/Modules/TimeChanger.cpp new file mode 100644 index 00000000..9c8b2c53 --- /dev/null +++ b/Horion/Module/Modules/TimeChanger.cpp @@ -0,0 +1,18 @@ +#include "TimeChanger.h" + +TimeChanger::TimeChanger() : IModule(0x0, Category::VISUAL, "Changes the client-sided time.") { + registerFloatSetting("modifier", &this->modifier, this->modifier, 0.1f, 1.f); +} + +TimeChanger::~TimeChanger() { +} + +const char* TimeChanger::getModuleName() { + return "TimeChanger"; +} + +void TimeChanger::onEnable() { + static auto rainbowSkyMod = moduleMgr->getModule(); + if (rainbowSkyMod->isEnabled()) + rainbowSkyMod->setEnabled(false); +} \ No newline at end of file diff --git a/Horion/Module/Modules/TimeChanger.h b/Horion/Module/Modules/TimeChanger.h new file mode 100644 index 00000000..d1b8bd92 --- /dev/null +++ b/Horion/Module/Modules/TimeChanger.h @@ -0,0 +1,15 @@ +#pragma once +#include "../ModuleManager.h" +#include "Module.h" + +class TimeChanger : public IModule { +public: + TimeChanger(); + ~TimeChanger(); + + float modifier = 0.5f; + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onEnable() override; +}; From 9e7e9ad5a2e775d167a31daf91148782e3786271 Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:24:56 +0100 Subject: [PATCH 135/419] Separate NightMode and TimeChanger --- Memory/Hooks.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 924a6feb..39b56d73 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -892,9 +892,9 @@ float* Hooks::Dimension_getFogColor(__int64 _this, float* color, __int64 a3, flo float Hooks::Dimension_getTimeOfDay(__int64 _this, int a2, float a3) { static auto oGetTimeOfDay = g_Hooks.Dimension_getTimeOfDayHook->GetFastcall(); - static auto nightMod = moduleMgr->getModule(); - if (nightMod->isEnabled()) { - return nightMod->modifier; + static auto TimeChange = moduleMgr->getModule(); + if (TimeChange->isEnabled()) { + return TimeChange->modifier; } return oGetTimeOfDay(_this, a2, a3); From 187d5ab10b5ef2b1169385c069153af42408ee22 Mon Sep 17 00:00:00 2001 From: Cryptxy <59030594+Cryptxy@users.noreply.github.com> Date: Tue, 8 Sep 2020 04:30:44 +0100 Subject: [PATCH 136/419] Fix --- Horion/Module/Modules/TimeChanger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/TimeChanger.cpp b/Horion/Module/Modules/TimeChanger.cpp index 9c8b2c53..a03a649c 100644 --- a/Horion/Module/Modules/TimeChanger.cpp +++ b/Horion/Module/Modules/TimeChanger.cpp @@ -11,8 +11,8 @@ const char* TimeChanger::getModuleName() { return "TimeChanger"; } -void TimeChanger::onEnable() { +/*void TimeChanger::onEnable() { static auto rainbowSkyMod = moduleMgr->getModule(); if (rainbowSkyMod->isEnabled()) rainbowSkyMod->setEnabled(false); -} \ No newline at end of file +}*/ From 19feeacef96a041726ed54112aa80719a6d3fd35 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 8 Sep 2020 01:33:09 -0400 Subject: [PATCH 137/419] Update ExtendedBlockReach.h Fixed Default Value --- Horion/Module/Modules/ExtendedBlockReach.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/ExtendedBlockReach.h b/Horion/Module/Modules/ExtendedBlockReach.h index 7d99a6e5..4d670080 100644 --- a/Horion/Module/Modules/ExtendedBlockReach.h +++ b/Horion/Module/Modules/ExtendedBlockReach.h @@ -3,7 +3,7 @@ class ExtendedBlockReach : public IModule { private: - float blockReach = 50.f; + float blockReach = 3.f; public: ExtendedBlockReach(); From 762e45cb0ef0cd1f9ef29d9692e6cbafb28938ac Mon Sep 17 00:00:00 2001 From: CortexPE Date: Tue, 8 Sep 2020 17:45:02 +0800 Subject: [PATCH 138/419] resolve requested change --- Horion/Module/Modules/Spider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp index 007d7f2c..61445f2e 100644 --- a/Horion/Module/Modules/Spider.cpp +++ b/Horion/Module/Modules/Spider.cpp @@ -12,9 +12,9 @@ const char* Spider::getModuleName() { } void Spider::onMove(C_MoveInputHandler* input) { - if (g_Data.getLocalPlayer() == nullptr) - return; C_LocalPlayer* player = g_Data.getLocalPlayer(); + if (player == nullptr) + return; if (player->isInLava() == 1 || player->isInWater() == 1) return; From 19e7f31dc96e0273c595d9d4a4d39e374dbe80dc Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:58:27 -0400 Subject: [PATCH 139/419] Update ExtendedBlockReach.h I am very stupid lol --- Horion/Module/Modules/ExtendedBlockReach.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/ExtendedBlockReach.h b/Horion/Module/Modules/ExtendedBlockReach.h index 4d670080..6d308c65 100644 --- a/Horion/Module/Modules/ExtendedBlockReach.h +++ b/Horion/Module/Modules/ExtendedBlockReach.h @@ -3,7 +3,7 @@ class ExtendedBlockReach : public IModule { private: - float blockReach = 3.f; + float blockReach = 7.f; public: ExtendedBlockReach(); From eac9d2d0f4ced34bc639612df569c7f37f6c10b7 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 9 Sep 2020 16:14:57 +0800 Subject: [PATCH 140/419] Implement Scrolling ClickGUI --- Horion/Menu/ClickGui.cpp | 55 +++++++++++++++++++++++++++++++++++++++- Horion/Menu/ClickGui.h | 3 +++ Memory/Hooks.cpp | 12 ++++++--- 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 82fd5d46..8abbab16 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -12,6 +12,8 @@ bool shouldToggleLeftClick = false; // If true, toggle the focused module bool shouldToggleRightClick = false; bool resetStartPos = true; bool initialised = false; +bool shouldScrollUp = false; +bool shouldScrollDown = false; struct SavedWindowSettings { vec2_t pos = {-1, -1}; @@ -199,7 +201,17 @@ void ClickGui::renderCategory(Category category) { currentYOffset -= ourWindow->animation * moduleList.size() * (textHeight + (textPadding * 2)); } + bool overflowing = false; + int cYoff = 0; for (auto& mod : moduleList) { + cYoff += 1; + if (cYoff < ourWindow->yOffset) continue; + + if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + overflowing = true; + break; + } + std::string textStr = mod->getModuleName(); vec2_t textPos = vec2_t( @@ -268,6 +280,11 @@ void ClickGui::renderCategory(Category category) { xEnd, 0); + if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + overflowing = true; + break; + } + switch (setting->valueType) { case ValueType::BOOL_T: { rectPos.w = currentYOffset + textHeight + (textPadding * 2); @@ -337,6 +354,11 @@ void ClickGui::renderCategory(Category category) { rectPos.w = currentYOffset; DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); } + + if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + overflowing = true; + break; + } // Slider { vec4_t rect = vec4_t( @@ -428,6 +450,10 @@ void ClickGui::renderCategory(Category category) { rectPos.w = currentYOffset; DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); } + if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + overflowing = true; + break; + } // Slider { vec4_t rect = vec4_t( @@ -514,7 +540,7 @@ void ClickGui::renderCategory(Category category) { } } float endYOffset = currentYOffset; - if (endYOffset - startYOffset > textHeight + 5) { + if (endYOffset - startYOffset > textHeight + 5 || overflowing) { startYOffset += textPadding; endYOffset -= textPadding; DrawUtils::setColor(1, 1, 1, 1); @@ -525,6 +551,25 @@ void ClickGui::renderCategory(Category category) { currentYOffset += textHeight + (textPadding * 2); } } + + vec4_t winRectPos = vec4_t( + xOffset, + yOffset, + xEnd, + currentYOffset); + + if (winRectPos.contains(&mousePos)) { + if (shouldScrollUp && overflowing) { + ourWindow->yOffset += 1; + } else if (shouldScrollDown) { + ourWindow->yOffset -= 1; + } + shouldScrollUp = false; + shouldScrollDown = false; + if (ourWindow->yOffset < 0) { + ourWindow->yOffset = 0; + } + } } DrawUtils::flush(); // Draw Category Header @@ -660,6 +705,14 @@ void ClickGui::onMouseClickUpdate(int key, bool isDown) { } } +void ClickGui::onWheelScroll(bool direction) { + if (!direction) { + shouldScrollUp = true; + } else { + shouldScrollDown = true; + } +} + void ClickGui::onKeyUpdate(int key, bool isDown) { if (!initialised) return; diff --git a/Horion/Menu/ClickGui.h b/Horion/Menu/ClickGui.h index 050126cb..268fe321 100644 --- a/Horion/Menu/ClickGui.h +++ b/Horion/Menu/ClickGui.h @@ -27,6 +27,8 @@ struct ClickWindow { float animation = 0; const char* name; std::map> moduleMap; + + int yOffset = 0; }; class ClickGui { @@ -78,6 +80,7 @@ class ClickGui { static void render(); static void onKeyUpdate(int key, bool isDown); static void onMouseClickUpdate(int key, bool isDown); + static void onWheelScroll(bool direction); // true = up, false = down static void onLoadConfig(void* confVoid); static void onSaveConfig(void* confVoid); }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 924a6feb..2d4db086 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1279,15 +1279,21 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) return ret; } -void Hooks::ClickFunc(__int64 a1, char mouseButton, char isDown, __int16 mouseX, __int16 mouseY, __int16 a6, __int16 a7, char a8) { +void Hooks::ClickFunc(__int64 a1, char mouseButton, char isDown, __int16 mouseX, __int16 mouseY, __int16 relativeMovementX, __int16 relativeMovementY, char a8) { static auto oFunc = g_Hooks.ClickFuncHook->GetFastcall(); static auto clickGuiModule = moduleMgr->getModule(); - + //logF("%d %d %d %d %d %d %d %d", a1, mouseButton, isDown, mouseX, mouseY, relativeMovementX, relativeMovementY, a8); + if (mouseButton == 4) { + // mouseButton = 4 (WHEEL) + // isDown = -120 (SCROLL DOWN) + // isDown = 120 (SCROLL UP) + ClickGui::onWheelScroll(isDown > 0); + } if (clickGuiModule->isEnabled()) { if (mouseButton != 0) // Mouse click event return; } - return oFunc(a1, mouseButton, isDown, mouseX, mouseY, a6, a7, a8); + return oFunc(a1, mouseButton, isDown, mouseX, mouseY, relativeMovementX, relativeMovementY, a8); } __int64 Hooks::MoveInputHandler_tick(C_MoveInputHandler* a1, C_Entity* a2) { From 368c672af7f4367f1cb66ff5028483afc6b367a2 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 9 Sep 2020 16:19:58 +0800 Subject: [PATCH 141/419] Fix ClickGUI scrolling when not enabled --- Memory/Hooks.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2d4db086..85dfbebe 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1282,14 +1282,14 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) void Hooks::ClickFunc(__int64 a1, char mouseButton, char isDown, __int16 mouseX, __int16 mouseY, __int16 relativeMovementX, __int16 relativeMovementY, char a8) { static auto oFunc = g_Hooks.ClickFuncHook->GetFastcall(); static auto clickGuiModule = moduleMgr->getModule(); - //logF("%d %d %d %d %d %d %d %d", a1, mouseButton, isDown, mouseX, mouseY, relativeMovementX, relativeMovementY, a8); - if (mouseButton == 4) { - // mouseButton = 4 (WHEEL) - // isDown = -120 (SCROLL DOWN) - // isDown = 120 (SCROLL UP) - ClickGui::onWheelScroll(isDown > 0); - } + if (clickGuiModule->isEnabled()) { + if (mouseButton == 4) { + // mouseButton = 4 (WHEEL) + // isDown = -120 (SCROLL DOWN) + // isDown = 120 (SCROLL UP) + ClickGui::onWheelScroll(isDown > 0); + } if (mouseButton != 0) // Mouse click event return; } From 8e5b3cb6bdf8f9924d3876acf11249cb5eb0c98e Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 9 Sep 2020 16:32:02 +0800 Subject: [PATCH 142/419] use a var for dis --- Horion/Menu/ClickGui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 8abbab16..c0efa702 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -203,11 +203,12 @@ void ClickGui::renderCategory(Category category) { bool overflowing = false; int cYoff = 0; + float cutoffHeight = g_Data.getGuiData()->heightGame * 0.75; for (auto& mod : moduleList) { cYoff += 1; if (cYoff < ourWindow->yOffset) continue; - if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { overflowing = true; break; } @@ -280,7 +281,7 @@ void ClickGui::renderCategory(Category category) { xEnd, 0); - if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { overflowing = true; break; } @@ -355,7 +356,7 @@ void ClickGui::renderCategory(Category category) { DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); } - if ((currentYOffset - ourWindow->pos.y) > (g_Data.getGuiData()->heightGame * 0.75)) { + if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { overflowing = true; break; } From 21ef06d508686c74d122b22d72482724c52631e9 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Fri, 11 Sep 2020 02:13:02 +0800 Subject: [PATCH 143/419] remove un-needed == 1 --- Horion/Module/Modules/Spider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp index 61445f2e..766e55b3 100644 --- a/Horion/Module/Modules/Spider.cpp +++ b/Horion/Module/Modules/Spider.cpp @@ -16,7 +16,7 @@ void Spider::onMove(C_MoveInputHandler* input) { if (player == nullptr) return; - if (player->isInLava() == 1 || player->isInWater() == 1) + if (player->isInLava() || player->isInWater()) return; if (player->isSneaking()) From ac66d00c1eb1f08a1624b76109424a8029010a66 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 15 Sep 2020 13:54:09 +0200 Subject: [PATCH 144/419] Fix error and format correctly --- Horion/Module/Modules/TimeChanger.cpp | 6 ------ Horion/Module/Modules/TimeChanger.h | 1 - Memory/Hooks.cpp | 6 +++--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Horion/Module/Modules/TimeChanger.cpp b/Horion/Module/Modules/TimeChanger.cpp index a03a649c..377123b3 100644 --- a/Horion/Module/Modules/TimeChanger.cpp +++ b/Horion/Module/Modules/TimeChanger.cpp @@ -10,9 +10,3 @@ TimeChanger::~TimeChanger() { const char* TimeChanger::getModuleName() { return "TimeChanger"; } - -/*void TimeChanger::onEnable() { - static auto rainbowSkyMod = moduleMgr->getModule(); - if (rainbowSkyMod->isEnabled()) - rainbowSkyMod->setEnabled(false); -}*/ diff --git a/Horion/Module/Modules/TimeChanger.h b/Horion/Module/Modules/TimeChanger.h index d1b8bd92..81fe8ec1 100644 --- a/Horion/Module/Modules/TimeChanger.h +++ b/Horion/Module/Modules/TimeChanger.h @@ -11,5 +11,4 @@ class TimeChanger : public IModule { // Inherited via IModule virtual const char* getModuleName() override; - virtual void onEnable() override; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 39b56d73..e9b15867 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -892,9 +892,9 @@ float* Hooks::Dimension_getFogColor(__int64 _this, float* color, __int64 a3, flo float Hooks::Dimension_getTimeOfDay(__int64 _this, int a2, float a3) { static auto oGetTimeOfDay = g_Hooks.Dimension_getTimeOfDayHook->GetFastcall(); - static auto TimeChange = moduleMgr->getModule(); - if (TimeChange->isEnabled()) { - return TimeChange->modifier; + static auto timeChange = moduleMgr->getModule(); + if (timeChange->isEnabled()) { + return timeChange->modifier; } return oGetTimeOfDay(_this, a2, a3); From 048ab131e58d2bf30eff944ad581bb9b9ab231ab Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 15 Sep 2020 15:04:14 +0200 Subject: [PATCH 145/419] Improvements to compass --- Horion/Module/Modules/Compass.cpp | 62 +++++++++++++++++++------------ Horion/Module/Modules/Compass.h | 2 +- Utils/HMath.h | 4 ++ 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 7124750c..076ad4d8 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -1,7 +1,7 @@ #include "Compass.h" Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { - registerFloatSetting("Opacity", &opacity, opacity, 0.1, 1); + registerFloatSetting("Opacity", &opacity, opacity, 0.1f, 1); registerIntSetting("Range", &range, range, 45, 180); } @@ -17,59 +17,75 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (player == nullptr || !GameData::canUseMoveKeys()) return; - int deg = player->yaw + 180; - float sCenter = g_Data.getGuiData()->widthGame / 2; + const int deg = (int)(player->yaw + 180); + const float degSubOffset = 0; // -fmodf(player->yaw, 1) + const float sCenter = g_Data.getGuiData()->widthGame / 2; for (int off = -range; off <= range; off++) { int oDeg = (deg + off) % 360; if (oDeg < 0) oDeg += 360; + + const float xOff = sCenter + off + degSubOffset; + constexpr float fadeOutPos = 0.25f; + constexpr float centerCutoff = 5, centerFadeout = 10; + float majorOpacity = this->opacity; // big compass text + float minorOpacity = majorOpacity; // minor features, degree numbers + + // Fading logic + { + if((range - abs(off)) < range * fadeOutPos) // Far from center + minorOpacity = majorOpacity = lerp(0, opacity, (range - abs(off)) / (range * fadeOutPos)); + else if (abs(off) < centerFadeout) // Close to center + minorOpacity = lerp(0, opacity, (abs(off) - centerCutoff) / (centerFadeout - centerCutoff)); + } + switch (oDeg) { case 0: - drawCenteredText(vec2_t(sCenter + off, 30), "N", 1); + drawCenteredText(vec2_t(xOff, 30), "N", 1, majorOpacity); break; case 45: - drawCenteredText(vec2_t(sCenter + off, 30), "NE", 1); + drawCenteredText(vec2_t(xOff, 30), "NE", 1, majorOpacity); break; case 90: - drawCenteredText(vec2_t(sCenter + off, 30), "E", 1); + drawCenteredText(vec2_t(xOff, 30), "E", 1, majorOpacity); break; case 135: - drawCenteredText(vec2_t(sCenter + off, 30), "SE", 1); + drawCenteredText(vec2_t(xOff, 30), "SE", 1, majorOpacity); break; case 180: - drawCenteredText(vec2_t(sCenter + off, 30), "S", 1); + drawCenteredText(vec2_t(xOff, 30), "S", 1, majorOpacity); break; case 225: - drawCenteredText(vec2_t(sCenter + off, 30), "SW", 1); + drawCenteredText(vec2_t(xOff, 30), "SW", 1, majorOpacity); break; case 270: - drawCenteredText(vec2_t(sCenter + off, 30), "W", 1); + drawCenteredText(vec2_t(xOff, 30), "W", 1, majorOpacity); break; case 315: - drawCenteredText(vec2_t(sCenter + off, 30), "NW", 1); + drawCenteredText(vec2_t(xOff, 30), "NW", 1, majorOpacity); break; } - if (off != 0) { + if (off != 0 && minorOpacity > 0) { if ((oDeg % 15) != 0) { if ((oDeg % 5) == 0) { - DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.25, 16, sCenter + off + 0.25, 19), MC_Color(255, 255, 255), opacity); + DrawUtils::fillRectangle(vec4_t(xOff - 0.25f, 16, xOff + 0.25f, 19), MC_Color(255, 255, 255), minorOpacity); } continue; } - if (off <= 10 && off >= -10) { - DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.25, 16, sCenter + off + 0.25, 19), MC_Color(255, 255, 255), opacity); - continue; - } - DrawUtils::fillRectangle(vec4_t(sCenter + off - 0.5, 15, sCenter + off + 0.5, 20), MC_Color(255, 255, 255), opacity); - drawCenteredText(vec2_t(sCenter + off, 20), std::to_string(oDeg), 0.75); + + // Bigger line with degree displayed + DrawUtils::fillRectangle(vec4_t(xOff - 0.5f, 15, xOff + 0.5f, 20), MC_Color(255, 255, 255), minorOpacity); + drawCenteredText(vec2_t(xOff, 20), std::to_string(oDeg), 0.75f, minorOpacity); } } - DrawUtils::fillRectangle(vec4_t(sCenter - 0.5, 15, sCenter + 0.5, 25), MC_Color(255, 255, 255), opacity); - drawCenteredText(vec2_t(sCenter, 25), std::to_string(deg), 0.75); + + // Center line + DrawUtils::fillRectangle(vec4_t(sCenter - 0.5f, 15, sCenter + 0.5f, 25), MC_Color(255, 255, 255), opacity); + drawCenteredText(vec2_t(sCenter, 25), std::to_string(deg), 0.75f, opacity); DrawUtils::flush(); } -void Compass::drawCenteredText(vec2_t pos, std::string text, float size) { +void Compass::drawCenteredText(vec2_t pos, std::string text, float size, float textOpacity) { pos.x -= DrawUtils::getTextWidth(&text, size) / 2; - DrawUtils::drawText(pos, &text, MC_Color(255, 255, 255), size, opacity); + DrawUtils::drawText(pos, &text, MC_Color(255, 255, 255), size, textOpacity); } diff --git a/Horion/Module/Modules/Compass.h b/Horion/Module/Modules/Compass.h index 060ea633..7b4d38ac 100644 --- a/Horion/Module/Modules/Compass.h +++ b/Horion/Module/Modules/Compass.h @@ -5,7 +5,7 @@ class Compass : public IModule { private: float opacity = 0.5; int range = 90; - void drawCenteredText(vec2_t pos, std::string text, float size); + void drawCenteredText(vec2_t pos, std::string text, float size, float textOpacity = 1); public: Compass(); diff --git a/Utils/HMath.h b/Utils/HMath.h index d71761ad..1d35bf96 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -7,6 +7,10 @@ static constexpr float DEG_RAD2 = PI / 360.0f; static constexpr float DEG_RAD = 180.0f / PI; static constexpr float RAD_DEG = PI / 180.f; +inline float lerp(float a, float b, float t) { + return a + t * (b - a); +} + struct vec2_t { float x, y; From ecb2c9d95c48f9ee6dbca7542185ddd314b1b8ce Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Tue, 15 Sep 2020 15:48:37 +0200 Subject: [PATCH 146/419] Fixed some minor issues --- Horion/Menu/ClickGui.cpp | 46 +++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index c0efa702..87f7bc64 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -12,8 +12,7 @@ bool shouldToggleLeftClick = false; // If true, toggle the focused module bool shouldToggleRightClick = false; bool resetStartPos = true; bool initialised = false; -bool shouldScrollUp = false; -bool shouldScrollDown = false; +int scrollingDirection = 0; struct SavedWindowSettings { vec2_t pos = {-1, -1}; @@ -185,8 +184,11 @@ void ClickGui::renderCategory(Category category) { if (ourWindow->isInAnimation) { if (ourWindow->isExtended) { ourWindow->animation *= 0.85f; - if (ourWindow->animation < 0.001f) + if (ourWindow->animation < 0.001f) { + ourWindow->yOffset = 0; // reset scroll ourWindow->isInAnimation = false; + } + } else { ourWindow->animation = 1 - ((1 - ourWindow->animation) * 0.85f); if (1 - ourWindow->animation < 0.001f) @@ -202,18 +204,25 @@ void ClickGui::renderCategory(Category category) { } bool overflowing = false; - int cYoff = 0; - float cutoffHeight = g_Data.getGuiData()->heightGame * 0.75; + const float cutoffHeight = roundf(g_Data.getGuiData()->heightGame * 0.75f) + 0.5f /*fix flickering related to rounding errors*/; + int moduleIndex = 0; for (auto& mod : moduleList) { - cYoff += 1; - if (cYoff < ourWindow->yOffset) continue; - - if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { + moduleIndex++; + if (moduleIndex < ourWindow->yOffset) + continue; + float probableYOffset = (moduleIndex - ourWindow->yOffset) * (textHeight + (textPadding * 2)); + + if (ourWindow->isInAnimation) { // Estimate, we don't know about module settings yet + if (probableYOffset > cutoffHeight) { + overflowing = true; + break; + } + }else if ((currentYOffset - ourWindow->pos.y) > cutoffHeight || currentYOffset > g_Data.getGuiData()->heightGame - 5) { overflowing = true; break; } - std::string textStr = mod->getModuleName(); + std::string textStr = mod->getModuleName(); vec2_t textPos = vec2_t( currentXOffset + textPadding, @@ -541,7 +550,7 @@ void ClickGui::renderCategory(Category category) { } } float endYOffset = currentYOffset; - if (endYOffset - startYOffset > textHeight + 5 || overflowing) { + if (endYOffset - startYOffset > textHeight + 1 || overflowing) { startYOffset += textPadding; endYOffset -= textPadding; DrawUtils::setColor(1, 1, 1, 1); @@ -560,13 +569,12 @@ void ClickGui::renderCategory(Category category) { currentYOffset); if (winRectPos.contains(&mousePos)) { - if (shouldScrollUp && overflowing) { - ourWindow->yOffset += 1; - } else if (shouldScrollDown) { - ourWindow->yOffset -= 1; + if (scrollingDirection > 0 && overflowing) { + ourWindow->yOffset += scrollingDirection; + } else if (scrollingDirection < 0) { + ourWindow->yOffset += scrollingDirection; } - shouldScrollUp = false; - shouldScrollDown = false; + scrollingDirection = 0; if (ourWindow->yOffset < 0) { ourWindow->yOffset = 0; } @@ -708,9 +716,9 @@ void ClickGui::onMouseClickUpdate(int key, bool isDown) { void ClickGui::onWheelScroll(bool direction) { if (!direction) { - shouldScrollUp = true; + scrollingDirection++; } else { - shouldScrollDown = true; + scrollingDirection--; } } From 02aaaa22be6786941a5303f56d22d8a8235f27c9 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Sat, 19 Sep 2020 23:05:33 +0800 Subject: [PATCH 147/419] Allow setting waypoints on other positions --- Horion/Command/Commands/WaypointCommand.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 9d398b56..36529a11 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -1,6 +1,6 @@ #include "WaypointCommand.h" -WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " ") { +WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " [x y z]") { registerAlias("wp"); } @@ -15,12 +15,19 @@ bool WaypointCommand::execute(std::vector* args) { static auto mod = moduleMgr->getModule(); if (mod == nullptr) return true; - - auto opt = args->at(1); + std::string opt = args->at(1); std::string name = args->at(2); if (opt == "add") { - if (mod->add(name, player->currentPos.floor().add(0.5, 0, 0.5))) { + vec3_t pos = player->currentPos; + if (args->size() == 6) { + pos.x = assertInt(args->at(3)); + pos.y = assertInt(args->at(4)); + pos.z = assertInt(args->at(5)); + } else if (args->size() != 3) { + return false; + } + if (mod->add(name, pos.floor().add(0.5, 0, 0.5))) { clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); } else { clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); From c02018be1c4ed43a5ec628e0ca5eba6c1d61e319 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 23 Sep 2020 03:54:51 +0800 Subject: [PATCH 148/419] Implement Radar --- Horion.vcxproj | 6 +- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/Radar.cpp | 99 +++++++++++++++++++++++++++++++++ Horion/Module/Modules/Radar.h | 12 ++++ 5 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 Horion/Module/Modules/Radar.cpp create mode 100644 Horion/Module/Modules/Radar.h diff --git a/Horion.vcxproj b/Horion.vcxproj index c3d1764d..124f5a58 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -337,6 +337,7 @@ + @@ -349,7 +350,7 @@ - + @@ -512,6 +513,7 @@ + @@ -524,7 +526,7 @@ - + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 3e34c947..7328d87e 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -98,6 +98,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new TimeChanger())); this->moduleList.push_back(std::shared_ptr(new Spider())); this->moduleList.push_back(std::shared_ptr(new Compass())); + this->moduleList.push_back(std::shared_ptr(new Radar())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 42499b15..528356d0 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -91,6 +91,7 @@ #include "Modules/NoPaintingCrash.h" #include "Modules/Spider.h" #include "Modules/Compass.h" +#include "Modules/Radar.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/Radar.cpp b/Horion/Module/Modules/Radar.cpp new file mode 100644 index 00000000..90217e91 --- /dev/null +++ b/Horion/Module/Modules/Radar.cpp @@ -0,0 +1,99 @@ +#include "Radar.h" + +static float rcolors[4]; +static int size = 100; +static int pixelSize = 2; +static float cent = size / 2; +static float pxSize = pixelSize / 2; +static float topPad = -1; +static float zoom = 1; +static float pxOpacity = 1; +// didn't bother puting this onto the header file and making it non-static... +// it's the only one that could be. since everything else is accessed at renderEntity() +static float bgOpacity = 0.2; + +Radar::Radar() : IModule(0x0, Category::VISUAL, "Radar") { + registerIntSetting("Size", &size, size, 50, 200); + registerIntSetting("Pixel Size", &pixelSize, pixelSize, 2, 4); + registerFloatSetting("Zoom", &zoom, zoom, 1.0f / 4.0f, 4.0f); + registerFloatSetting("Background Opacity", &bgOpacity, bgOpacity, 0.1f, 1.0f); + registerFloatSetting("Pixel Opacity", &pxOpacity, pxOpacity, 0.1f, 1.0f); +} + +Radar::~Radar() { +} + +const char* Radar::getModuleName() { + return "Radar"; +} + +void recalculateScale() { + cent = size / 2; + pxSize = pixelSize / 2; + topPad = g_Data.getGuiData()->heightGame / 2; +} + +void renderEntity(C_Entity* currentEntity, bool isRegularEntity) { + C_LocalPlayer* player = g_Data.getLocalPlayer(); + if (currentEntity == nullptr) + return; + + if (currentEntity == player) // Skip Local player + return; + + if (!g_Data.getLocalPlayer()->canAttack(currentEntity, false)) + return; + + if (!currentEntity->isAlive()) + return; + + if (!Target::isValidTarget(currentEntity)) + return; + + vec3_t* start = currentEntity->getPosOld(); + vec3_t* end = currentEntity->getPos(); + + vec3_t lerped = start->lerp(end, DrawUtils::getLerpTime()); + + const float deltaX = lerped.x - player->currentPos.x; + const float deltaZ = lerped.z - player->currentPos.z; + const float dist = sqrt(powf(deltaX, 2) + powf(deltaZ, 2)); + + float angle = (180.0f - player->yaw) + 180.0f; + if (angle < 0) angle += 360; + angle *= RAD_DEG; + + const float s = sin(angle); + const float c = cos(angle); + + const vec2_t relPos = vec2_t( + cent - ((deltaX * (c * zoom)) - (deltaZ * (s * zoom))), + topPad - ((deltaX * (s * zoom)) + (deltaZ * (c * zoom))) + ); + if (relPos.x > 0 && relPos.x < size && relPos.y > topPad - cent && relPos.y < topPad + cent) { + DrawUtils::fillRectangle(vec4_t(relPos.x - pxSize, relPos.y - pxSize, relPos.x + pxSize, relPos.y + pxSize), MC_Color(rcolors[0], rcolors[1], rcolors[2]), pxOpacity); + } +} + +void Radar::onPreRender(C_MinecraftUIRenderContext* renderCtx) { + C_LocalPlayer* player = g_Data.getLocalPlayer(); + + if (player == nullptr || !GameData::canUseMoveKeys()) return; + + if (rcolors[3] < 1) { + rcolors[0] = 0.2f; + rcolors[1] = 0.2f; + rcolors[2] = 1.f; + rcolors[3] = 1; + } + recalculateScale(); + + Utils::ApplyRainbow(rcolors, 0.0015f); + + DrawUtils::fillRectangle(vec4_t(0, topPad - cent, size, topPad + cent), MC_Color(0, 0, 0), bgOpacity); + + g_Data.forEachEntity(renderEntity); + + const float pxSize = pixelSize / 2; + DrawUtils::fillRectangle(vec4_t(cent - pxSize, topPad - pxSize, cent + pxSize, topPad + pxSize), MC_Color(255, 255, 255), pxOpacity); +} diff --git a/Horion/Module/Modules/Radar.h b/Horion/Module/Modules/Radar.h new file mode 100644 index 00000000..fda07815 --- /dev/null +++ b/Horion/Module/Modules/Radar.h @@ -0,0 +1,12 @@ +#pragma once +#include "Module.h" +#include "../../DrawUtils.h" +class Radar : public IModule { +public: + Radar(); + ~Radar(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; +}; From 6caba3991ca7fb04f79a37cb88ae59820bd78797 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 23 Sep 2020 04:00:32 +0800 Subject: [PATCH 149/419] missed... --- Horion/Module/Modules/Radar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Radar.cpp b/Horion/Module/Modules/Radar.cpp index 90217e91..eedead71 100644 --- a/Horion/Module/Modules/Radar.cpp +++ b/Horion/Module/Modules/Radar.cpp @@ -41,7 +41,7 @@ void renderEntity(C_Entity* currentEntity, bool isRegularEntity) { if (currentEntity == player) // Skip Local player return; - if (!g_Data.getLocalPlayer()->canAttack(currentEntity, false)) + if (!player->canAttack(currentEntity, false)) return; if (!currentEntity->isAlive()) From 02b529839206cdbab3fd602fe269f1d8551601ee Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 23 Sep 2020 15:40:23 +0800 Subject: [PATCH 150/419] Integrate with Compass --- Horion/Module/Modules/Compass.cpp | 48 +++++++++++++++++++++++++++++-- Horion/Module/Modules/Compass.h | 1 + Horion/Module/Modules/Waypoints.h | 4 +++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 076ad4d8..612a860c 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -1,8 +1,11 @@ #include "Compass.h" +#include "../ModuleManager.h" + Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { registerFloatSetting("Opacity", &opacity, opacity, 0.1f, 1); registerIntSetting("Range", &range, range, 45, 180); + registerBoolSetting("Show Waypoints", &showWaypoints, showWaypoints); } Compass::~Compass() { @@ -17,8 +20,24 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (player == nullptr || !GameData::canUseMoveKeys()) return; + static auto wpMod = moduleMgr->getModule(); + + auto extraPoints = std::multimap{}; + + if (wpMod != nullptr && showWaypoints) { + std::map* waypoints = wpMod->getWaypoints(); + for (std::map::iterator it = waypoints->begin(); it != waypoints->end(); it++) { + int angle = (int)(player->getPos()->CalcAngle(it->second).y + 180.0f) % 360; + if (angle < 0) angle += 360; + + extraPoints.insert(std::make_pair(angle, it->first)); + } + } + + auto stacking = std::vector{}; + const int deg = (int)(player->yaw + 180); - const float degSubOffset = 0; // -fmodf(player->yaw, 1) + const float degSubOffset = 0; // -fmodf(player->yaw, 1) const float sCenter = g_Data.getGuiData()->widthGame / 2; for (int off = -range; off <= range; off++) { @@ -30,10 +49,10 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { constexpr float centerCutoff = 5, centerFadeout = 10; float majorOpacity = this->opacity; // big compass text float minorOpacity = majorOpacity; // minor features, degree numbers - + // Fading logic { - if((range - abs(off)) < range * fadeOutPos) // Far from center + if ((range - abs(off)) < range * fadeOutPos) // Far from center minorOpacity = majorOpacity = lerp(0, opacity, (range - abs(off)) / (range * fadeOutPos)); else if (abs(off) < centerFadeout) // Close to center minorOpacity = lerp(0, opacity, (abs(off) - centerCutoff) / (centerFadeout - centerCutoff)); @@ -65,6 +84,29 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { drawCenteredText(vec2_t(xOff, 30), "NW", 1, majorOpacity); break; } + typedef std::multimap::iterator multimap_iter; + std::pair result = extraPoints.equal_range(oDeg); + for (multimap_iter it = result.first; it != result.second; it++) { + std::string pName = it->second; + std::transform(pName.begin(), pName.end(), pName.begin(), ::toupper); + + vec2_t pos = vec2_t(xOff, 31); + + int overlapping = 0; + const float tSize = 0.75f; + const float tWidth = DrawUtils::getTextWidth(&pName, tSize); + pos.x -= tWidth / 2; + const vec2_t mySpace = vec2_t(pos.x, pos.x + tWidth); // anyone remember this site? + for (const vec2_t vect : stacking) { + if (mySpace.x < vect.y && vect.x < mySpace.y) { + overlapping++; + } + } + stacking.push_back(mySpace); + pos.y += 5 * (overlapping + 1); + DrawUtils::drawText(pos, &pName, MC_Color(255, 255, 255), tSize, majorOpacity); + } + if (off != 0 && minorOpacity > 0) { if ((oDeg % 15) != 0) { if ((oDeg % 5) == 0) { diff --git a/Horion/Module/Modules/Compass.h b/Horion/Module/Modules/Compass.h index 7b4d38ac..0c54cf30 100644 --- a/Horion/Module/Modules/Compass.h +++ b/Horion/Module/Modules/Compass.h @@ -5,6 +5,7 @@ class Compass : public IModule { private: float opacity = 0.5; int range = 90; + bool showWaypoints = true; void drawCenteredText(vec2_t pos, std::string text, float size, float textOpacity = 1); public: diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index ee6be7c7..c39f74a4 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -47,4 +47,8 @@ class Waypoints : public IModule { return &waypoints[name]; }; + + std::map* getWaypoints() { + return &waypoints; + } }; \ No newline at end of file From b4601746c5042beb8fd12a47270446a06fddac01 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 30 Sep 2020 15:31:53 +0800 Subject: [PATCH 151/419] resolve requested changes --- Horion/Command/Commands/WaypointCommand.cpp | 19 ++++++++-------- Horion/Module/Modules/Compass.cpp | 9 ++++---- Horion/Module/Modules/Waypoints.cpp | 22 +++++++++---------- Horion/Module/Modules/Waypoints.h | 24 ++++++++++----------- 4 files changed, 36 insertions(+), 38 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 36529a11..8b5d2050 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -13,21 +13,20 @@ bool WaypointCommand::execute(std::vector* args) { assertTrue(args->size() > 2); static auto mod = moduleMgr->getModule(); - if (mod == nullptr) - return true; + std::string opt = args->at(1); std::string name = args->at(2); if (opt == "add") { - vec3_t pos = player->currentPos; + vec3_t pos = player->currentPos.floor().add(0.5, 0, 0.5); if (args->size() == 6) { - pos.x = assertInt(args->at(3)); - pos.y = assertInt(args->at(4)); - pos.z = assertInt(args->at(5)); + pos.x = assertFloat(args->at(3)); + pos.y = assertFloat(args->at(4)); + pos.z = assertFloat(args->at(5)); } else if (args->size() != 3) { return false; } - if (mod->add(name, pos.floor().add(0.5, 0, 0.5))) { + if (mod->add(name, pos)) { clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); } else { clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); @@ -39,10 +38,10 @@ bool WaypointCommand::execute(std::vector* args) { clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); } } else if (opt == "tp" || opt == "teleport") { - vec3_t* pos = mod->getWaypoint(name); + vec3_t pos = mod->getWaypoint(name); if (pos != nullptr) { - player->setPos(*pos); - clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos->x, pos->y, pos->z); + player->setPos(pos); + clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos.x, pos.y, pos.z); } else { clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); } diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 612a860c..6998d049 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -24,8 +24,8 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { auto extraPoints = std::multimap{}; - if (wpMod != nullptr && showWaypoints) { - std::map* waypoints = wpMod->getWaypoints(); + if (showWaypoints) { + auto waypoints = wpMod->getWaypoints(); for (std::map::iterator it = waypoints->begin(); it != waypoints->end(); it++) { int angle = (int)(player->getPos()->CalcAngle(it->second).y + 180.0f) % 360; if (angle < 0) angle += 360; @@ -84,9 +84,8 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { drawCenteredText(vec2_t(xOff, 30), "NW", 1, majorOpacity); break; } - typedef std::multimap::iterator multimap_iter; - std::pair result = extraPoints.equal_range(oDeg); - for (multimap_iter it = result.first; it != result.second; it++) { + auto result = extraPoints.equal_range(oDeg); + for (auto it = result.first; it != result.second; it++) { std::string pName = it->second; std::transform(pName.begin(), pName.end(), pName.begin(), ::toupper); diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index 0b4566a5..e6d343a0 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -15,13 +15,13 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); if (localPlayer != nullptr && GameData::canUseMoveKeys()) { - for (const auto& wp : waypoints) { - vec3_t pos = wp.second; + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { + vec3_t pos = it->second; float dist = pos.dist(*g_Data.getLocalPlayer()->getPos()); std::ostringstream out; out.precision(2); - out << wp.first << " (" << std::fixed << dist << " m)"; + out << it->first << " (" << std::fixed << dist << " m)"; DrawUtils::drawHologram(pos.add(0, 1.68, 0), out.str(), fmax(size, 3.f / dist)); DrawUtils::flush(); @@ -32,7 +32,7 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { using json = nlohmann::json; void Waypoints::onLoadConfig(void* confVoid) { IModule::onLoadConfig(confVoid); // retain keybinds & enabled state - waypoints.clear(); + waypoints->clear(); json* conf = reinterpret_cast(confVoid); std::string modName = getRawModuleName(); if (conf->contains(modName.c_str())) { @@ -58,7 +58,7 @@ void Waypoints::onLoadConfig(void* confVoid) { } else { continue; } - waypoints[it.key().c_str()] = _pos; + waypoints->emplace(it.key().c_str(), _pos); } } } @@ -81,15 +81,15 @@ void Waypoints::onSaveConfig(void* confVoid) { json myList = {}; - for (const auto& wp : waypoints) { + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { json subObj = {}; - subObj["pos"]["x"] = (float)wp.second.x; - subObj["pos"]["y"] = (float)wp.second.y; - subObj["pos"]["z"] = (float)wp.second.z; - myList.emplace(wp.first.c_str(), subObj); + subObj["pos"]["x"] = (float)it->second.x; + subObj["pos"]["y"] = (float)it->second.y; + subObj["pos"]["z"] = (float)it->second.z; + myList.emplace(it->first.c_str(), subObj); } - if (waypoints.size() > 0) { + if (waypoints->size() > 0) { obj.emplace("list", myList); } diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index c39f74a4..43d061df 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -7,7 +7,7 @@ class Waypoints : public IModule { private: - std::map waypoints; + std::shared_ptr > waypoints; public: Waypoints(); @@ -22,33 +22,33 @@ class Waypoints : public IModule { virtual void onSaveConfig(void* confVoid) override; bool add(std::string text, vec3_t pos) { - for (const auto& _wp : waypoints) { - if (text == _wp.first) { + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { + if (text == it->first) { return false; } } - waypoints[text] = pos; + waypoints->emplace(text, pos); return true; } bool remove(std::string name) { - for (const auto& _wp : waypoints) { - if (name == _wp.first) { - waypoints.erase(name); + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { + if (name == it->first) { + waypoints->erase(name); return true; } } return false; } - vec3_t* getWaypoint(std::string name) { - if (waypoints.find(name) == waypoints.end()) + vec3_t getWaypoint(std::string name) { + if (waypoints->find(name) == waypoints->end()) return nullptr; - return &waypoints[name]; + return waypoints->at(name); }; - std::map* getWaypoints() { - return &waypoints; + std::shared_ptr> getWaypoints() { + return waypoints; } }; \ No newline at end of file From 350bd678b6f532d6afb6b13f8af6fbd058818e30 Mon Sep 17 00:00:00 2001 From: CortexPE Date: Wed, 30 Sep 2020 18:07:08 +0800 Subject: [PATCH 152/419] fix crashes --- Horion/Command/Commands/WaypointCommand.cpp | 4 ++-- Horion/Module/Modules/Waypoints.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 8b5d2050..85299b77 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -38,8 +38,8 @@ bool WaypointCommand::execute(std::vector* args) { clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); } } else if (opt == "tp" || opt == "teleport") { - vec3_t pos = mod->getWaypoint(name); - if (pos != nullptr) { + if (auto wp = mod->getWaypoint(name)) { + vec3_t pos = wp.value(); player->setPos(pos); clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos.x, pos.y, pos.z); } else { diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index 43d061df..ad320273 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -4,10 +4,11 @@ #include "../../DrawUtils.h" #include "Module.h" #include "../../../Utils/Json.hpp" +#include class Waypoints : public IModule { private: - std::shared_ptr > waypoints; + std::shared_ptr> waypoints = std::make_shared>(); public: Waypoints(); @@ -41,9 +42,9 @@ class Waypoints : public IModule { return false; } - vec3_t getWaypoint(std::string name) { + std::optional getWaypoint(std::string name) { if (waypoints->find(name) == waypoints->end()) - return nullptr; + return {}; return waypoints->at(name); }; From e704cbb9f79b07a5413d6682dd199e365e6169b8 Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Fri, 9 Oct 2020 14:50:13 -0700 Subject: [PATCH 153/419] Fix inventorymove not moving when looking down Not sure why it calculates pitch for walking --- Horion/Module/Modules/InventoryMove.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/InventoryMove.cpp b/Horion/Module/Modules/InventoryMove.cpp index fb7ddb87..d0430432 100644 --- a/Horion/Module/Modules/InventoryMove.cpp +++ b/Horion/Module/Modules/InventoryMove.cpp @@ -54,11 +54,11 @@ void InventoryMove::onTick(C_GameMode* gm) { yaw -= 360.f; float calcYaw = (yaw + 90) * (PI / 180); - float calcPitch = (gm->player->pitch) * -(PI / 180); + //float calcPitch = (gm->player->pitch) * -(PI / 180); vec3_t moveVec; - moveVec.x = cos(calcYaw) * cos(calcPitch) * speed; + moveVec.x = cos(calcYaw) * speed; moveVec.y = gm->player->velocity.y; - moveVec.z = sin(calcYaw) * cos(calcPitch) * speed; + moveVec.z = sin(calcYaw) * speed; if (keyPressed) { gm->player->lerpMotion(moveVec); keyPressed = false; From f2aca10114596eeeed25519caaccab6d8263becf Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 21 Oct 2020 23:12:00 +0200 Subject: [PATCH 154/419] Refactor stuff & fade out waypoints at a distance --- Horion/Command/Commands/WaypointCommand.cpp | 10 +++- Horion/DrawUtils.cpp | 22 -------- Horion/DrawUtils.h | 1 - Horion/Module/Modules/Compass.cpp | 11 ++-- Horion/Module/Modules/Waypoints.cpp | 60 +++++++++++++++++++-- 5 files changed, 70 insertions(+), 34 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 85299b77..89bea7ae 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -1,6 +1,6 @@ #include "WaypointCommand.h" -WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " [x y z]") { +WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " [x y z]") { registerAlias("wp"); } @@ -16,18 +16,26 @@ bool WaypointCommand::execute(std::vector* args) { std::string opt = args->at(1); std::string name = args->at(2); + name = Utils::sanitize(name); + if (name.size() <= 1 || name.size() > 30) { + clientMessageF("%sInvalid name! Must be less than 30 characters!", RED); + return true; + } if (opt == "add") { vec3_t pos = player->currentPos.floor().add(0.5, 0, 0.5); if (args->size() == 6) { pos.x = assertFloat(args->at(3)); pos.y = assertFloat(args->at(4)); + assertTrue(pos.y >= 0); pos.z = assertFloat(args->at(5)); } else if (args->size() != 3) { return false; } if (mod->add(name, pos)) { clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); + if (!mod->isEnabled()) + clientMessageF("%sEnable the waypoints module to see it ingame!", YELLOW); } else { clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); } diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index f15ff818..ab35d7fe 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -506,25 +506,3 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { tess_end(game3dContext, myTess, entityFlatStaticMaterial); } - -void DrawUtils::drawHologram(vec3_t pos, std::string text, float size) { - vec2_t textPos; - vec4_t rectPos; - - text = Utils::sanitize(text); - - float textWidth = getTextWidth(&text, size); - float textHeight = DrawUtils::getFont(Fonts::RUNE)->getLineHeight() * size; - - if (refdef->OWorldToScreen(origin, pos, textPos, fov, screenSize)) { - textPos.y -= textHeight; - textPos.x -= textWidth / 2.f; - rectPos.x = textPos.x - 1.f * size; - rectPos.y = textPos.y - 1.f * size; - rectPos.z = textPos.x + textWidth + 1.f * size; - rectPos.w = textPos.y + textHeight + 2.f * size; - - fillRectangle(rectPos, MC_Color(0, 0, 0), 0.5f); - drawText(textPos, &text, MC_Color(255, 255, 255), size); - } -} diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 53a95569..457f20ae 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -115,7 +115,6 @@ class DrawUtils { static void drawItem(C_ItemStack* item, vec2_t ItemPos, float opacity, float scale, bool isEnchanted); static void drawKeystroke(char key, vec2_t pos); static float getLerpTime(); - static void drawHologram(vec3_t pos, std::string textStr, float textSize); static vec2_t worldToScreen(const vec3_t& world); }; diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 6998d049..f27fce00 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -34,7 +34,7 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { } } - auto stacking = std::vector{}; + std::vector stacking{}; const int deg = (int)(player->yaw + 180); const float degSubOffset = 0; // -fmodf(player->yaw, 1) @@ -95,13 +95,14 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { const float tSize = 0.75f; const float tWidth = DrawUtils::getTextWidth(&pName, tSize); pos.x -= tWidth / 2; - const vec2_t mySpace = vec2_t(pos.x, pos.x + tWidth); // anyone remember this site? - for (const vec2_t vect : stacking) { - if (mySpace.x < vect.y && vect.x < mySpace.y) { + const vec2_t myTextRange = vec2_t(pos.x, pos.x + tWidth); + for (const vec2_t otherTextRange : stacking) { + // Check if other text overlaps us + if (myTextRange.x < otherTextRange.y && otherTextRange.x < myTextRange.y) { overlapping++; } } - stacking.push_back(mySpace); + stacking.push_back(myTextRange); pos.y += 5 * (overlapping + 1); DrawUtils::drawText(pos, &pName, MC_Color(255, 255, 255), tSize, majorOpacity); } diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index e6d343a0..fcc38caa 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -1,7 +1,9 @@ #include "Waypoints.h" +#include + Waypoints::Waypoints() : IModule(0x0, Category::VISUAL, "Shows holograms for user-defined coordinates") { - registerFloatSetting("Size", &size, size, 0.3, 1.6); + registerFloatSetting("Size", &size, size, 0.3f, 1.6f); } Waypoints::~Waypoints() { @@ -19,11 +21,59 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { vec3_t pos = it->second; float dist = pos.dist(*g_Data.getLocalPlayer()->getPos()); - std::ostringstream out; - out.precision(2); - out << it->first << " (" << std::fixed << dist << " m)"; + constexpr bool useFloatingPoint = false; + constexpr bool fadeOutAtDistance = true; + + std::string txt; + if (useFloatingPoint) { + std::ostringstream out; + out.precision(2); + out << it->first << " (" << std::fixed << dist << " m)"; + txt = out.str(); + } else { + txt = it->first + " (" + std::to_string(int(dist)) + "m)"; + } + + float alpha = 1; + + if (fadeOutAtDistance && dist > 15) { + + vec2_t angle = localPlayer->currentPos.CalcAngle(pos); + float diff = angle.sub(localPlayer->viewAngles).normAngles().magnitude(); + if (dist > 30) { + float neededDiff = lerp(40, 15, std::min((dist - 30) / 300, 1.f)); + float minAlpha = lerp(0.6f, 0.3f, std::min((dist - 30) / 50, 1.f)); + if (diff < neededDiff) + alpha = 1.f; + else if (diff > neededDiff + 10) + alpha = minAlpha; + else + alpha = lerp(1.f, minAlpha, (diff - neededDiff) / 10); + } + } + + if (alpha < 0.01f) + continue; - DrawUtils::drawHologram(pos.add(0, 1.68, 0), out.str(), fmax(size, 3.f / dist)); + vec4_t rectPos; + + txt = Utils::sanitize(txt); + + float textWidth = DrawUtils::getTextWidth(&txt, size); + float textHeight = DrawUtils::getFont(Fonts::RUNE)->getLineHeight() * size; + + vec2_t textPos = DrawUtils::worldToScreen(pos); + if (textPos.x != -1) { + textPos.y -= textHeight; + textPos.x -= textWidth / 2.f; + rectPos.x = textPos.x - 1.f * size; + rectPos.y = textPos.y - 1.f * size; + rectPos.z = textPos.x + textWidth + 1.f * size; + rectPos.w = textPos.y + textHeight + 2.f * size; + + DrawUtils::fillRectangle(rectPos, MC_Color(0, 0, 0), alpha * 0.5f); + DrawUtils::drawText(textPos, &txt, MC_Color(255, 255, 255), size, alpha); + } DrawUtils::flush(); } } From ebffc749d71255ed95dc3e1e9529c6fbda0fa504 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 02:15:41 +0200 Subject: [PATCH 155/419] Radar grid lines & general QoL improvements --- Horion/DrawUtils.cpp | 11 ++ Horion/DrawUtils.h | 1 + Horion/Module/Modules/Compass.cpp | 20 +-- Horion/Module/Modules/HudModule.cpp | 10 +- Horion/Module/Modules/Radar.cpp | 187 +++++++++++++++++++++++----- Utils/HMath.h | 4 + 6 files changed, 186 insertions(+), 47 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index ab35d7fe..069d4956 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -121,6 +121,17 @@ void DrawUtils::flush() { renderCtx->flushText(0); } +void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { + + DrawUtils::tess__begin(tesselator, 3); + + tess_vertex(tesselator, p1.x, p1.y, 0); + tess_vertex(tesselator, p2.x, p2.y, 0); + tess_vertex(tesselator, p3.x, p3.y, 0); + + tess_end(screenContext2d, tesselator, uiMaterial); +} + void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { float modX = 0 - (start.y - end.y); float modY = start.x - end.x; diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 457f20ae..35f2ff3e 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -87,6 +87,7 @@ class DrawUtils { static C_Font* getFont(Fonts font); static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); + static void drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3); static void drawLine(vec2_t start, vec2_t end, float lineWidth); // rgba static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 076ad4d8..8e725fb5 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -41,28 +41,28 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { switch (oDeg) { case 0: - drawCenteredText(vec2_t(xOff, 30), "N", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "N", 1, majorOpacity); break; case 45: - drawCenteredText(vec2_t(xOff, 30), "NE", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "NE", 1, majorOpacity); break; case 90: - drawCenteredText(vec2_t(xOff, 30), "E", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "E", 1, majorOpacity); break; case 135: - drawCenteredText(vec2_t(xOff, 30), "SE", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "SE", 1, majorOpacity); break; case 180: - drawCenteredText(vec2_t(xOff, 30), "S", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "S", 1, majorOpacity); break; case 225: - drawCenteredText(vec2_t(xOff, 30), "SW", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "SW", 1, majorOpacity); break; case 270: - drawCenteredText(vec2_t(xOff, 30), "W", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "W", 1, majorOpacity); break; case 315: - drawCenteredText(vec2_t(xOff, 30), "NW", 1, majorOpacity); + drawCenteredText(vec2_t(xOff, 30.f), "NW", 1, majorOpacity); break; } if (off != 0 && minorOpacity > 0) { @@ -75,13 +75,13 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { // Bigger line with degree displayed DrawUtils::fillRectangle(vec4_t(xOff - 0.5f, 15, xOff + 0.5f, 20), MC_Color(255, 255, 255), minorOpacity); - drawCenteredText(vec2_t(xOff, 20), std::to_string(oDeg), 0.75f, minorOpacity); + drawCenteredText(vec2_t(xOff, 20.f), std::to_string(oDeg), 0.75f, minorOpacity); } } // Center line DrawUtils::fillRectangle(vec4_t(sCenter - 0.5f, 15, sCenter + 0.5f, 25), MC_Color(255, 255, 255), opacity); - drawCenteredText(vec2_t(sCenter, 25), std::to_string(deg), 0.75f, opacity); + drawCenteredText(vec2_t(sCenter, 25.f), std::to_string(deg), 0.75f, opacity); DrawUtils::flush(); } diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index cc80c1a8..063073ef 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -97,11 +97,11 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { { // Keystrokes if (!(g_Data.getLocalPlayer() == nullptr || !this->keystrokes || !GameData::canUseMoveKeys())) { C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); - DrawUtils::drawKeystroke(*input->forwardKey, vec2_t(32, windowSize.y - 74)); - DrawUtils::drawKeystroke(*input->leftKey, vec2_t(10, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->backKey, vec2_t(32, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->rightKey, vec2_t(54, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->spaceBarKey, vec2_t(10, windowSize.y - 30)); + DrawUtils::drawKeystroke(*input->forwardKey, vec2_t(32.f, windowSize.y - 74)); + DrawUtils::drawKeystroke(*input->leftKey, vec2_t(10.f, windowSize.y - 52)); + DrawUtils::drawKeystroke(*input->backKey, vec2_t(32.f, windowSize.y - 52)); + DrawUtils::drawKeystroke(*input->rightKey, vec2_t(54.f, windowSize.y - 52)); + DrawUtils::drawKeystroke(*input->spaceBarKey, vec2_t(10.f, windowSize.y - 30)); } } } \ No newline at end of file diff --git a/Horion/Module/Modules/Radar.cpp b/Horion/Module/Modules/Radar.cpp index eedead71..7ff9607b 100644 --- a/Horion/Module/Modules/Radar.cpp +++ b/Horion/Module/Modules/Radar.cpp @@ -1,20 +1,23 @@ #include "Radar.h" - -static float rcolors[4]; -static int size = 100; -static int pixelSize = 2; -static float cent = size / 2; -static float pxSize = pixelSize / 2; -static float topPad = -1; -static float zoom = 1; -static float pxOpacity = 1; +#include + +float rcolors[4]; +int size = 100; +float pixelSize = 2.5f; +float cent = size / 2.f; +float pxSize = pixelSize / 2.f; +float topPad = -1; +float zoom = 1; +float pxOpacity = 1; +bool grid = true; // didn't bother puting this onto the header file and making it non-static... // it's the only one that could be. since everything else is accessed at renderEntity() -static float bgOpacity = 0.2; +float bgOpacity = 0.2f; Radar::Radar() : IModule(0x0, Category::VISUAL, "Radar") { + registerBoolSetting("Show Grid", &grid, true); registerIntSetting("Size", &size, size, 50, 200); - registerIntSetting("Pixel Size", &pixelSize, pixelSize, 2, 4); + registerFloatSetting("Pixel Size", &pixelSize, pixelSize, 2, 4); registerFloatSetting("Zoom", &zoom, zoom, 1.0f / 4.0f, 4.0f); registerFloatSetting("Background Opacity", &bgOpacity, bgOpacity, 0.1f, 1.0f); registerFloatSetting("Pixel Opacity", &pxOpacity, pxOpacity, 0.1f, 1.0f); @@ -27,10 +30,17 @@ const char* Radar::getModuleName() { return "Radar"; } +float effectiveZoom = 1; +float angle = 0; +float c, s; +vec3_t playerPos; + void recalculateScale() { - cent = size / 2; - pxSize = pixelSize / 2; - topPad = g_Data.getGuiData()->heightGame / 2; + effectiveZoom = zoom * (size / 100.f); + cent = size / 2.f; + pxSize = pixelSize / 2.f * effectiveZoom; + topPad = g_Data.getGuiData()->heightGame / 2.f; + } void renderEntity(C_Entity* currentEntity, bool isRegularEntity) { @@ -54,21 +64,13 @@ void renderEntity(C_Entity* currentEntity, bool isRegularEntity) { vec3_t* end = currentEntity->getPos(); vec3_t lerped = start->lerp(end, DrawUtils::getLerpTime()); - - const float deltaX = lerped.x - player->currentPos.x; - const float deltaZ = lerped.z - player->currentPos.z; - const float dist = sqrt(powf(deltaX, 2) + powf(deltaZ, 2)); - - float angle = (180.0f - player->yaw) + 180.0f; - if (angle < 0) angle += 360; - angle *= RAD_DEG; - - const float s = sin(angle); - const float c = cos(angle); - + + const auto delta = lerped.sub(playerPos); + const float dist = delta.magnitudexz(); + const vec2_t relPos = vec2_t( - cent - ((deltaX * (c * zoom)) - (deltaZ * (s * zoom))), - topPad - ((deltaX * (s * zoom)) + (deltaZ * (c * zoom))) + cent - ((delta.x * c) - (delta.z * s)), + topPad - ((delta.x * s) + (delta.z * c)) ); if (relPos.x > 0 && relPos.x < size && relPos.y > topPad - cent && relPos.y < topPad + cent) { DrawUtils::fillRectangle(vec4_t(relPos.x - pxSize, relPos.y - pxSize, relPos.x + pxSize, relPos.y + pxSize), MC_Color(rcolors[0], rcolors[1], rcolors[2]), pxOpacity); @@ -78,7 +80,7 @@ void renderEntity(C_Entity* currentEntity, bool isRegularEntity) { void Radar::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* player = g_Data.getLocalPlayer(); - if (player == nullptr || !GameData::canUseMoveKeys()) return; + if (player == nullptr) return; if (rcolors[3] < 1) { rcolors[0] = 0.2f; @@ -90,10 +92,131 @@ void Radar::onPreRender(C_MinecraftUIRenderContext* renderCtx) { Utils::ApplyRainbow(rcolors, 0.0015f); - DrawUtils::fillRectangle(vec4_t(0, topPad - cent, size, topPad + cent), MC_Color(0, 0, 0), bgOpacity); + DrawUtils::fillRectangle(vec4_t(0, topPad - cent, (float)size, topPad + cent), MC_Color(0, 0, 0), bgOpacity); + + auto pPos = g_Data.getClientInstance()->levelRenderer->origin; + playerPos = pPos; + + angle = (180.0f - player->yaw) + 180.0f; + if (angle < 0) angle += 360; + angle *= RAD_DEG; + + s = sin(angle) * effectiveZoom; + c = cos(angle) * effectiveZoom; + + auto computePos = [=](vec2_t pos) { + auto delta = pos.sub(pPos.x, pPos.z); + return vec2_t( + cent - ((delta.x * c) - (delta.y * s)), + topPad - ((delta.x * s) + (delta.y * c))); + }; + + int chunkX = int(floor(pPos.x)) & ~(15); + int chunkZ = int(floor(pPos.z)) & ~(15); + // Draw grid + if (grid) + { + // we start at the player pos, and clip the grid lines to the view rectangle until the lines are no longer inside, then we repeat the process in the opposite direction, then we do the same for the other axis + + struct FiniteLine { + vec2_t a, b; + + // copied straight from wikipedia line-line intersections + bool intersectionPointWithInfOther(vec2_t oa, vec2_t ob, vec2_t& out) { + float den = (a.x - b.x) * (oa.y - ob.y) - (a.y - b.y) * (oa.x - ob.x); + if (den == 0) // lines are parallel + return false; + + float t = ((a.x - oa.x) * (oa.y - ob.y) - (a.y - oa.y) * (oa.x - ob.x)) / den; + if (t >= 0 && t <= 1) { + out = {a.x + t * (b.x - a.x), + a.y + t * (b.y - a.y)}; + return true; + } + return false; + } + }; + + std::array clipRectPoints = {vec2_t{0.f, topPad - cent}, vec2_t{(float)size, topPad - cent}, vec2_t{(float)size, topPad + cent}, vec2_t{0.f, topPad + cent}}; + std::array clipRectLines; + auto last = clipRectPoints[3]; + + for (int i = 0; i < 4; i++) { + auto cur = clipRectPoints[i]; + + clipRectLines[i] = {last, cur}; + last = cur; + } + + std::vector lines; + + auto computeRectIntersections = [&](vec2_t p1, vec2_t p2) { + vec2_t a, b; + bool hadIntersection = false; + for (int i = 0; i < (hadIntersection ? 4 : 3); i++) { + auto& line = clipRectLines[i]; + bool didIntersect = line.intersectionPointWithInfOther(p1, p2, hadIntersection ? b : a); + if (didIntersect) { + if (hadIntersection) { + lines.push_back({a, b}); + return true; + } + hadIntersection = true; + } + } + return false; + }; + + //x axis + for (int gridX = chunkX; true; gridX += 16) { + vec2_t p1 = computePos({gridX, chunkZ}), p2 = computePos({gridX, chunkZ + 1}); + if (!computeRectIntersections(p1, p2)) + break; + } + for (int gridX = chunkX - 16; true; gridX -= 16) { + vec2_t p1 = computePos({gridX, chunkZ}), p2 = computePos({gridX, chunkZ + 1}); + if (!computeRectIntersections(p1, p2)) + break; + } + + //z axis + for (int gridZ = chunkZ; true; gridZ += 16) { + vec2_t p1 = computePos({chunkX, gridZ}), p2 = computePos({chunkX + 1, gridZ}); + if (!computeRectIntersections(p1, p2)) + break; + } + for (int gridZ = chunkZ - 16; true; gridZ -= 16) { + vec2_t p1 = computePos({chunkX, gridZ}), p2 = computePos({chunkX + 1, gridZ}); + if (!computeRectIntersections(p1, p2)) + break; + } + + DrawUtils::setColor(0.7f, 0.7f, 0.7f, 0.1f); + // draw all lines + for (auto line : lines) { + DrawUtils::drawLine(line.a, line.b, 0.25f); + } + } + + // Draw the chunk the player is in + if (grid) + { + DrawUtils::setColor(0.9f, 0.9f, 0.9f, 0.6f); + std::array rect = {computePos({chunkX, chunkZ}), computePos({chunkX + 16, chunkZ}), computePos({chunkX + 16, chunkZ + 16}), computePos({chunkX, chunkZ + 16})}; + auto last = rect[3]; + + for (int i = 0; i < 4; i++) { + auto cur = rect[i]; + + DrawUtils::drawLine(last, cur, 0.25f); + last = cur; + } + } g_Data.forEachEntity(renderEntity); - const float pxSize = pixelSize / 2; - DrawUtils::fillRectangle(vec4_t(cent - pxSize, topPad - pxSize, cent + pxSize, topPad + pxSize), MC_Color(255, 255, 255), pxOpacity); + const float pxSize = pixelSize * 0.75f * effectiveZoom; + DrawUtils::setColor(1, 1, 1, pxOpacity); + vec2_t center(cent, topPad); + DrawUtils::drawTriangle(center.add(-pxSize * 0.9f, pxSize * 2.f), center.add(pxSize * 0.9f, pxSize * 2.f), center); } diff --git a/Utils/HMath.h b/Utils/HMath.h index 1d35bf96..789b7324 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -16,6 +16,7 @@ struct vec2_t { float x, y; vec2_t() { x = y = 0; } vec2_t(float a, float b) : x(a), y(b) {} + vec2_t(int a, int b) : x((float)a), y((float)b) {} vec2_t &operator=(const vec2_t ©) { x = copy.x; y = copy.y; @@ -32,6 +33,9 @@ struct vec2_t { vec2_t sub(float f) { return vec2_t(x - f, y - f); } + vec2_t sub(float ox, float oy) { + return vec2_t(x - ox, y - oy); + } vec2_t div(float f) { return vec2_t(x / f, y / f); } From 3fba1ffd6297056633c0e56c0bd787df022df8e9 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 02:17:57 +0200 Subject: [PATCH 156/419] Fix warnings --- Horion/Module/Modules/Compass.cpp | 2 +- Horion/Module/Modules/Spider.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 41fc93c5..8c5d3a10 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -89,7 +89,7 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { std::string pName = it->second; std::transform(pName.begin(), pName.end(), pName.begin(), ::toupper); - vec2_t pos = vec2_t(xOff, 31); + vec2_t pos = vec2_t(xOff, 31.f); int overlapping = 0; const float tSize = 0.75f; diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp index 766e55b3..7e94750b 100644 --- a/Horion/Module/Modules/Spider.cpp +++ b/Horion/Module/Modules/Spider.cpp @@ -1,7 +1,7 @@ #include "Spider.h" Spider::Spider() : IModule('Z', Category::MOVEMENT, "Climb walls") { - registerFloatSetting("Speed", &speed, speed, 0.1, 1); + registerFloatSetting("Speed", &speed, speed, 0.1f, 1); } Spider::~Spider() { From efa28bd59990e4ba625825c7b5d20874aa571d99 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 02:38:13 +0200 Subject: [PATCH 157/419] Fix autocomplete & command history --- Memory/Hooks.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index c5b621b7..df708564 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -337,9 +337,9 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { __int64 v16 = *v15; if (*(BYTE*)(_this + 0xA9A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x968))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x970))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x960))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x968))(v15); *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); *reinterpret_cast<__int64*>(_this + 0xA80) = 0i64; @@ -962,11 +962,11 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) static syncShit_t syncShit = nullptr; if (syncShit == nullptr) { uintptr_t sigOffset = 0; - - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - sigOffset = FindSignature("40 53 48 83 EC ?? 48 C7 44 24 20 FE FF FF FF 48 8B DA 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 90 48 8B C8 E8 ?? ?? ?? ?? 48 8B 08 4C 8B 81 ?? 04"); - else - sigOffset = FindSignature("40 57 48 83 EC 40 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B F2 48 8D 3D ? ? ? ? 48 8B CF"); + // sig of function: (present 3 times in the exe) + //sigOffset = FindSignature("40 57 48 83 EC 40 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B F2 48 8D 3D ? ? ? ? 48 8B CF"); + sigOffset = FindSignature("49 8B D6 E8 ?? ?? ?? ?? 48 8B 5D ?? 48 85") + 4; + auto funcOffset = *reinterpret_cast(sigOffset); + sigOffset += 4 + funcOffset; syncShit = reinterpret_cast(sigOffset); } From 3594bb13c9144e0e4416465d686661fa34f55805 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 02:47:44 +0200 Subject: [PATCH 158/419] Make log() print a message in chat --- Horion/Scripting/Functions/GlobalFunctions.cpp | 12 ++++++++++++ Horion/Scripting/ScriptManager.cpp | 6 +++--- Horion/Scripting/ScriptManager.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Horion/Scripting/Functions/GlobalFunctions.cpp b/Horion/Scripting/Functions/GlobalFunctions.cpp index 98f51b79..ef01a268 100644 --- a/Horion/Scripting/Functions/GlobalFunctions.cpp +++ b/Horion/Scripting/Functions/GlobalFunctions.cpp @@ -20,7 +20,19 @@ JsValueRef CALLBACK GlobalFunctions::log(JsValueRef callee, bool isConstructCall strstream << string; } + #ifdef _DEBUG logF("Script: %S", strstream.str().c_str()); + #else + + auto obj = reinterpret_cast(callbackState); + if (obj->scriptInstance == nullptr) { + GameData::log("[invalid]: %s", strstream.str().c_str()); + } else { + GameData::log("[script]: %s", strstream.str().c_str()); + } + + + #endif return JS_INVALID_REFERENCE; } \ No newline at end of file diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index a7cb024d..56766651 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -31,8 +31,8 @@ JsValueRef ScriptManager::prepareEntity(long long runtimeId, ContextObjects* obj return obj; } -void ScriptManager::prepareGlobals(JsValueRef global) { - chakra.defineFunction(global, L"log", GlobalFunctions::log); +void ScriptManager::prepareGlobals(JsValueRef global, ContextObjects* obj) { + chakra.defineFunction(global, L"log", GlobalFunctions::log, obj); } void ScriptManager::prepareVector3Prototype(JsValueRef global, ContextObjects* obj) { @@ -167,7 +167,7 @@ void ScriptManager::prepareContext(JsContextRef* ctx, ContextObjects* obj) { JsValueRef globalObject; chakra.JsGetGlobalObject_(&globalObject); - prepareGlobals(globalObject); + prepareGlobals(globalObject, obj); prepareHorionFunctions(globalObject, obj); prepareGameFunctions(globalObject, obj); prepareVector3Prototype(globalObject, obj); diff --git a/Horion/Scripting/ScriptManager.h b/Horion/Scripting/ScriptManager.h index 31329908..ef3413cd 100644 --- a/Horion/Scripting/ScriptManager.h +++ b/Horion/Scripting/ScriptManager.h @@ -98,7 +98,7 @@ class ScriptManager { std::vector> scriptInstances; - void prepareGlobals(JsValueRef global); + void prepareGlobals(JsValueRef global, ContextObjects*); void prepareVector3Prototype(JsValueRef global, ContextObjects*); void prepareEntityPrototype(JsValueRef proto, ContextObjects* objs); From e8f126a1d5726eb61668573048bebd5eea341c8d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 02:49:47 +0200 Subject: [PATCH 159/419] Fix log() --- Horion/Scripting/Functions/GlobalFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Scripting/Functions/GlobalFunctions.cpp b/Horion/Scripting/Functions/GlobalFunctions.cpp index ef01a268..64c3a91a 100644 --- a/Horion/Scripting/Functions/GlobalFunctions.cpp +++ b/Horion/Scripting/Functions/GlobalFunctions.cpp @@ -26,9 +26,9 @@ JsValueRef CALLBACK GlobalFunctions::log(JsValueRef callee, bool isConstructCall auto obj = reinterpret_cast(callbackState); if (obj->scriptInstance == nullptr) { - GameData::log("[invalid]: %s", strstream.str().c_str()); + GameData::log("[inline]: %S", strstream.str().c_str()); } else { - GameData::log("[script]: %s", strstream.str().c_str()); + GameData::log("[script]: %S", strstream.str().c_str()); } From b377179f0dd7e16fb54f8a757fb58285563ecca0 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 18:57:33 +0200 Subject: [PATCH 160/419] Add glm library --- include/glm/.appveyor.yml | 87 + include/glm/.gitignore | 61 + include/glm/.travis.yml | 735 ++++ include/glm/CMakeLists.txt | 15 + include/glm/cmake/glm/glmConfig-version.cmake | 11 + include/glm/cmake/glm/glmConfig.cmake | 22 + include/glm/copying.txt | 54 + include/glm/glm/CMakeLists.txt | 70 + include/glm/glm/common.hpp | 539 +++ include/glm/glm/detail/_features.hpp | 394 ++ include/glm/glm/detail/_fixes.hpp | 27 + include/glm/glm/detail/_noise.hpp | 81 + include/glm/glm/detail/_swizzle.hpp | 804 ++++ include/glm/glm/detail/_swizzle_func.hpp | 682 +++ include/glm/glm/detail/_vectorize.hpp | 162 + include/glm/glm/detail/compute_common.hpp | 50 + .../glm/detail/compute_vector_relational.hpp | 30 + include/glm/glm/detail/func_common.inl | 792 ++++ include/glm/glm/detail/func_common_simd.inl | 231 + include/glm/glm/detail/func_exponential.inl | 152 + .../glm/glm/detail/func_exponential_simd.inl | 37 + include/glm/glm/detail/func_geometric.inl | 243 + .../glm/glm/detail/func_geometric_simd.inl | 163 + include/glm/glm/detail/func_integer.inl | 372 ++ include/glm/glm/detail/func_integer_simd.inl | 65 + include/glm/glm/detail/func_matrix.inl | 398 ++ include/glm/glm/detail/func_matrix_simd.inl | 249 ++ include/glm/glm/detail/func_packing.inl | 189 + include/glm/glm/detail/func_packing_simd.inl | 6 + include/glm/glm/detail/func_trigonometric.inl | 197 + .../glm/detail/func_trigonometric_simd.inl | 0 .../glm/glm/detail/func_vector_relational.inl | 87 + .../detail/func_vector_relational_simd.inl | 6 + include/glm/glm/detail/glm.cpp | 263 ++ include/glm/glm/detail/qualifier.hpp | 230 + include/glm/glm/detail/setup.hpp | 1135 +++++ include/glm/glm/detail/type_float.hpp | 68 + include/glm/glm/detail/type_half.hpp | 16 + include/glm/glm/detail/type_half.inl | 241 + include/glm/glm/detail/type_mat2x2.hpp | 177 + include/glm/glm/detail/type_mat2x2.inl | 536 +++ include/glm/glm/detail/type_mat2x3.hpp | 159 + include/glm/glm/detail/type_mat2x3.inl | 510 +++ include/glm/glm/detail/type_mat2x4.hpp | 161 + include/glm/glm/detail/type_mat2x4.inl | 520 +++ include/glm/glm/detail/type_mat3x2.hpp | 167 + include/glm/glm/detail/type_mat3x2.inl | 532 +++ include/glm/glm/detail/type_mat3x3.hpp | 184 + include/glm/glm/detail/type_mat3x3.inl | 601 +++ include/glm/glm/detail/type_mat3x4.hpp | 166 + include/glm/glm/detail/type_mat3x4.inl | 578 +++ include/glm/glm/detail/type_mat4x2.hpp | 171 + include/glm/glm/detail/type_mat4x2.inl | 574 +++ include/glm/glm/detail/type_mat4x3.hpp | 171 + include/glm/glm/detail/type_mat4x3.inl | 598 +++ include/glm/glm/detail/type_mat4x4.hpp | 189 + include/glm/glm/detail/type_mat4x4.inl | 706 +++ include/glm/glm/detail/type_mat4x4_simd.inl | 6 + include/glm/glm/detail/type_quat.hpp | 186 + include/glm/glm/detail/type_quat.inl | 408 ++ include/glm/glm/detail/type_quat_simd.inl | 188 + include/glm/glm/detail/type_vec1.hpp | 308 ++ include/glm/glm/detail/type_vec1.inl | 551 +++ include/glm/glm/detail/type_vec2.hpp | 399 ++ include/glm/glm/detail/type_vec2.inl | 913 ++++ include/glm/glm/detail/type_vec3.hpp | 432 ++ include/glm/glm/detail/type_vec3.inl | 1068 +++++ include/glm/glm/detail/type_vec4.hpp | 505 +++ include/glm/glm/detail/type_vec4.inl | 1140 +++++ include/glm/glm/detail/type_vec4_simd.inl | 775 ++++ include/glm/glm/exponential.hpp | 110 + include/glm/glm/ext.hpp | 253 ++ include/glm/glm/ext/matrix_clip_space.hpp | 522 +++ include/glm/glm/ext/matrix_clip_space.inl | 555 +++ include/glm/glm/ext/matrix_common.hpp | 36 + include/glm/glm/ext/matrix_common.inl | 16 + include/glm/glm/ext/matrix_double2x2.hpp | 23 + .../glm/ext/matrix_double2x2_precision.hpp | 49 + include/glm/glm/ext/matrix_double2x3.hpp | 18 + .../glm/ext/matrix_double2x3_precision.hpp | 31 + include/glm/glm/ext/matrix_double2x4.hpp | 18 + .../glm/ext/matrix_double2x4_precision.hpp | 31 + include/glm/glm/ext/matrix_double3x2.hpp | 18 + .../glm/ext/matrix_double3x2_precision.hpp | 31 + include/glm/glm/ext/matrix_double3x3.hpp | 23 + .../glm/ext/matrix_double3x3_precision.hpp | 49 + include/glm/glm/ext/matrix_double3x4.hpp | 18 + .../glm/ext/matrix_double3x4_precision.hpp | 31 + include/glm/glm/ext/matrix_double4x2.hpp | 18 + .../glm/ext/matrix_double4x2_precision.hpp | 31 + include/glm/glm/ext/matrix_double4x3.hpp | 18 + .../glm/ext/matrix_double4x3_precision.hpp | 31 + include/glm/glm/ext/matrix_double4x4.hpp | 23 + .../glm/ext/matrix_double4x4_precision.hpp | 49 + include/glm/glm/ext/matrix_float2x2.hpp | 23 + .../glm/glm/ext/matrix_float2x2_precision.hpp | 49 + include/glm/glm/ext/matrix_float2x3.hpp | 18 + .../glm/glm/ext/matrix_float2x3_precision.hpp | 31 + include/glm/glm/ext/matrix_float2x4.hpp | 18 + .../glm/glm/ext/matrix_float2x4_precision.hpp | 31 + include/glm/glm/ext/matrix_float3x2.hpp | 18 + .../glm/glm/ext/matrix_float3x2_precision.hpp | 31 + include/glm/glm/ext/matrix_float3x3.hpp | 23 + .../glm/glm/ext/matrix_float3x3_precision.hpp | 49 + include/glm/glm/ext/matrix_float3x4.hpp | 18 + .../glm/glm/ext/matrix_float3x4_precision.hpp | 31 + include/glm/glm/ext/matrix_float4x2.hpp | 18 + .../glm/glm/ext/matrix_float4x2_precision.hpp | 31 + include/glm/glm/ext/matrix_float4x3.hpp | 18 + .../glm/glm/ext/matrix_float4x3_precision.hpp | 31 + include/glm/glm/ext/matrix_float4x4.hpp | 23 + .../glm/glm/ext/matrix_float4x4_precision.hpp | 49 + include/glm/glm/ext/matrix_int2x2.hpp | 38 + include/glm/glm/ext/matrix_int2x2_sized.hpp | 70 + include/glm/glm/ext/matrix_int2x3.hpp | 33 + include/glm/glm/ext/matrix_int2x3_sized.hpp | 49 + include/glm/glm/ext/matrix_int2x4.hpp | 33 + include/glm/glm/ext/matrix_int2x4_sized.hpp | 49 + include/glm/glm/ext/matrix_int3x2.hpp | 33 + include/glm/glm/ext/matrix_int3x2_sized.hpp | 49 + include/glm/glm/ext/matrix_int3x3.hpp | 38 + include/glm/glm/ext/matrix_int3x3_sized.hpp | 70 + include/glm/glm/ext/matrix_int3x4.hpp | 33 + include/glm/glm/ext/matrix_int3x4_sized.hpp | 49 + include/glm/glm/ext/matrix_int4x2.hpp | 33 + include/glm/glm/ext/matrix_int4x2_sized.hpp | 49 + include/glm/glm/ext/matrix_int4x3.hpp | 33 + include/glm/glm/ext/matrix_int4x3_sized.hpp | 49 + include/glm/glm/ext/matrix_int4x4.hpp | 38 + include/glm/glm/ext/matrix_int4x4_sized.hpp | 70 + include/glm/glm/ext/matrix_projection.hpp | 149 + include/glm/glm/ext/matrix_projection.inl | 106 + include/glm/glm/ext/matrix_relational.hpp | 132 + include/glm/glm/ext/matrix_relational.inl | 82 + include/glm/glm/ext/matrix_transform.hpp | 144 + include/glm/glm/ext/matrix_transform.inl | 152 + include/glm/glm/ext/matrix_uint2x2.hpp | 38 + include/glm/glm/ext/matrix_uint2x2_sized.hpp | 70 + include/glm/glm/ext/matrix_uint2x3.hpp | 33 + include/glm/glm/ext/matrix_uint2x3_sized.hpp | 49 + include/glm/glm/ext/matrix_uint2x4.hpp | 33 + include/glm/glm/ext/matrix_uint2x4_sized.hpp | 49 + include/glm/glm/ext/matrix_uint3x2.hpp | 33 + include/glm/glm/ext/matrix_uint3x2_sized.hpp | 49 + include/glm/glm/ext/matrix_uint3x3.hpp | 38 + include/glm/glm/ext/matrix_uint3x3_sized.hpp | 70 + include/glm/glm/ext/matrix_uint3x4.hpp | 33 + include/glm/glm/ext/matrix_uint3x4_sized.hpp | 49 + include/glm/glm/ext/matrix_uint4x2.hpp | 33 + include/glm/glm/ext/matrix_uint4x2_sized.hpp | 49 + include/glm/glm/ext/matrix_uint4x3.hpp | 33 + include/glm/glm/ext/matrix_uint4x3_sized.hpp | 49 + include/glm/glm/ext/matrix_uint4x4.hpp | 38 + include/glm/glm/ext/matrix_uint4x4_sized.hpp | 70 + include/glm/glm/ext/quaternion_common.hpp | 135 + include/glm/glm/ext/quaternion_common.inl | 144 + .../glm/glm/ext/quaternion_common_simd.inl | 18 + include/glm/glm/ext/quaternion_double.hpp | 39 + .../glm/ext/quaternion_double_precision.hpp | 42 + .../glm/glm/ext/quaternion_exponential.hpp | 63 + .../glm/glm/ext/quaternion_exponential.inl | 85 + include/glm/glm/ext/quaternion_float.hpp | 39 + .../glm/ext/quaternion_float_precision.hpp | 36 + include/glm/glm/ext/quaternion_geometric.hpp | 70 + include/glm/glm/ext/quaternion_geometric.inl | 36 + include/glm/glm/ext/quaternion_relational.hpp | 62 + include/glm/glm/ext/quaternion_relational.inl | 35 + include/glm/glm/ext/quaternion_transform.hpp | 47 + include/glm/glm/ext/quaternion_transform.inl | 24 + .../glm/glm/ext/quaternion_trigonometric.hpp | 63 + .../glm/glm/ext/quaternion_trigonometric.inl | 34 + include/glm/glm/ext/scalar_common.hpp | 157 + include/glm/glm/ext/scalar_common.inl | 152 + include/glm/glm/ext/scalar_constants.hpp | 40 + include/glm/glm/ext/scalar_constants.inl | 24 + include/glm/glm/ext/scalar_int_sized.hpp | 70 + include/glm/glm/ext/scalar_integer.hpp | 92 + include/glm/glm/ext/scalar_integer.inl | 243 + include/glm/glm/ext/scalar_packing.hpp | 32 + include/glm/glm/ext/scalar_packing.inl | 0 include/glm/glm/ext/scalar_relational.hpp | 65 + include/glm/glm/ext/scalar_relational.inl | 40 + include/glm/glm/ext/scalar_uint_sized.hpp | 70 + include/glm/glm/ext/scalar_ulp.hpp | 74 + include/glm/glm/ext/scalar_ulp.inl | 284 ++ include/glm/glm/ext/vector_bool1.hpp | 30 + .../glm/glm/ext/vector_bool1_precision.hpp | 34 + include/glm/glm/ext/vector_bool2.hpp | 18 + .../glm/glm/ext/vector_bool2_precision.hpp | 31 + include/glm/glm/ext/vector_bool3.hpp | 18 + .../glm/glm/ext/vector_bool3_precision.hpp | 31 + include/glm/glm/ext/vector_bool4.hpp | 18 + .../glm/glm/ext/vector_bool4_precision.hpp | 31 + include/glm/glm/ext/vector_common.hpp | 204 + include/glm/glm/ext/vector_common.inl | 129 + include/glm/glm/ext/vector_double1.hpp | 31 + .../glm/glm/ext/vector_double1_precision.hpp | 36 + include/glm/glm/ext/vector_double2.hpp | 18 + .../glm/glm/ext/vector_double2_precision.hpp | 31 + include/glm/glm/ext/vector_double3.hpp | 18 + .../glm/glm/ext/vector_double3_precision.hpp | 34 + include/glm/glm/ext/vector_double4.hpp | 18 + .../glm/glm/ext/vector_double4_precision.hpp | 35 + include/glm/glm/ext/vector_float1.hpp | 31 + .../glm/glm/ext/vector_float1_precision.hpp | 36 + include/glm/glm/ext/vector_float2.hpp | 18 + .../glm/glm/ext/vector_float2_precision.hpp | 31 + include/glm/glm/ext/vector_float3.hpp | 18 + .../glm/glm/ext/vector_float3_precision.hpp | 31 + include/glm/glm/ext/vector_float4.hpp | 18 + .../glm/glm/ext/vector_float4_precision.hpp | 31 + include/glm/glm/ext/vector_int1.hpp | 32 + include/glm/glm/ext/vector_int1_sized.hpp | 49 + include/glm/glm/ext/vector_int2.hpp | 18 + include/glm/glm/ext/vector_int2_sized.hpp | 49 + include/glm/glm/ext/vector_int3.hpp | 18 + include/glm/glm/ext/vector_int3_sized.hpp | 49 + include/glm/glm/ext/vector_int4.hpp | 18 + include/glm/glm/ext/vector_int4_sized.hpp | 49 + include/glm/glm/ext/vector_integer.hpp | 149 + include/glm/glm/ext/vector_integer.inl | 85 + include/glm/glm/ext/vector_packing.hpp | 32 + include/glm/glm/ext/vector_packing.inl | 0 include/glm/glm/ext/vector_relational.hpp | 107 + include/glm/glm/ext/vector_relational.inl | 75 + include/glm/glm/ext/vector_uint1.hpp | 32 + include/glm/glm/ext/vector_uint1_sized.hpp | 49 + include/glm/glm/ext/vector_uint2.hpp | 18 + include/glm/glm/ext/vector_uint2_sized.hpp | 49 + include/glm/glm/ext/vector_uint3.hpp | 18 + include/glm/glm/ext/vector_uint3_sized.hpp | 49 + include/glm/glm/ext/vector_uint4.hpp | 18 + include/glm/glm/ext/vector_uint4_sized.hpp | 49 + include/glm/glm/ext/vector_ulp.hpp | 109 + include/glm/glm/ext/vector_ulp.inl | 74 + include/glm/glm/fwd.hpp | 1233 ++++++ include/glm/glm/geometric.hpp | 116 + include/glm/glm/glm.hpp | 136 + include/glm/glm/gtc/bitfield.hpp | 266 ++ include/glm/glm/gtc/bitfield.inl | 626 +++ include/glm/glm/gtc/color_space.hpp | 56 + include/glm/glm/gtc/color_space.inl | 84 + include/glm/glm/gtc/constants.hpp | 165 + include/glm/glm/gtc/constants.inl | 167 + include/glm/glm/gtc/epsilon.hpp | 60 + include/glm/glm/gtc/epsilon.inl | 80 + include/glm/glm/gtc/integer.hpp | 65 + include/glm/glm/gtc/integer.inl | 68 + include/glm/glm/gtc/matrix_access.hpp | 60 + include/glm/glm/gtc/matrix_access.inl | 62 + include/glm/glm/gtc/matrix_integer.hpp | 433 ++ include/glm/glm/gtc/matrix_inverse.hpp | 50 + include/glm/glm/gtc/matrix_inverse.inl | 118 + include/glm/glm/gtc/matrix_transform.hpp | 36 + include/glm/glm/gtc/matrix_transform.inl | 3 + include/glm/glm/gtc/noise.hpp | 61 + include/glm/glm/gtc/noise.inl | 807 ++++ include/glm/glm/gtc/packing.hpp | 728 +++ include/glm/glm/gtc/packing.inl | 938 ++++ include/glm/glm/gtc/quaternion.hpp | 173 + include/glm/glm/gtc/quaternion.inl | 202 + include/glm/glm/gtc/quaternion_simd.inl | 0 include/glm/glm/gtc/random.hpp | 82 + include/glm/glm/gtc/random.inl | 303 ++ include/glm/glm/gtc/reciprocal.hpp | 135 + include/glm/glm/gtc/reciprocal.inl | 191 + include/glm/glm/gtc/round.hpp | 160 + include/glm/glm/gtc/round.inl | 155 + include/glm/glm/gtc/type_aligned.hpp | 1315 ++++++ include/glm/glm/gtc/type_precision.hpp | 2094 +++++++++ include/glm/glm/gtc/type_precision.inl | 6 + include/glm/glm/gtc/type_ptr.hpp | 230 + include/glm/glm/gtc/type_ptr.inl | 386 ++ include/glm/glm/gtc/ulp.hpp | 152 + include/glm/glm/gtc/ulp.inl | 173 + include/glm/glm/gtc/vec1.hpp | 30 + include/glm/glm/gtx/associated_min_max.hpp | 207 + include/glm/glm/gtx/associated_min_max.inl | 354 ++ include/glm/glm/gtx/bit.hpp | 98 + include/glm/glm/gtx/bit.inl | 92 + include/glm/glm/gtx/closest_point.hpp | 49 + include/glm/glm/gtx/closest_point.inl | 45 + include/glm/glm/gtx/color_encoding.hpp | 54 + include/glm/glm/gtx/color_encoding.inl | 45 + include/glm/glm/gtx/color_space.hpp | 72 + include/glm/glm/gtx/color_space.inl | 141 + include/glm/glm/gtx/color_space_YCoCg.hpp | 60 + include/glm/glm/gtx/color_space_YCoCg.inl | 107 + include/glm/glm/gtx/common.hpp | 76 + include/glm/glm/gtx/common.inl | 125 + include/glm/glm/gtx/compatibility.hpp | 133 + include/glm/glm/gtx/compatibility.inl | 62 + include/glm/glm/gtx/component_wise.hpp | 69 + include/glm/glm/gtx/component_wise.inl | 127 + include/glm/glm/gtx/dual_quaternion.hpp | 274 ++ include/glm/glm/gtx/dual_quaternion.inl | 352 ++ include/glm/glm/gtx/easing.hpp | 219 + include/glm/glm/gtx/easing.inl | 436 ++ include/glm/glm/gtx/euler_angles.hpp | 335 ++ include/glm/glm/gtx/euler_angles.inl | 899 ++++ include/glm/glm/gtx/extend.hpp | 42 + include/glm/glm/gtx/extend.inl | 48 + include/glm/glm/gtx/extended_min_max.hpp | 137 + include/glm/glm/gtx/extended_min_max.inl | 138 + include/glm/glm/gtx/exterior_product.hpp | 45 + include/glm/glm/gtx/exterior_product.inl | 26 + include/glm/glm/gtx/fast_exponential.hpp | 95 + include/glm/glm/gtx/fast_exponential.inl | 136 + include/glm/glm/gtx/fast_square_root.hpp | 92 + include/glm/glm/gtx/fast_square_root.inl | 75 + include/glm/glm/gtx/fast_trigonometry.hpp | 79 + include/glm/glm/gtx/fast_trigonometry.inl | 142 + include/glm/glm/gtx/float_notmalize.inl | 13 + include/glm/glm/gtx/functions.hpp | 56 + include/glm/glm/gtx/functions.inl | 30 + include/glm/glm/gtx/gradient_paint.hpp | 53 + include/glm/glm/gtx/gradient_paint.inl | 36 + .../glm/glm/gtx/handed_coordinate_space.hpp | 50 + .../glm/glm/gtx/handed_coordinate_space.inl | 26 + include/glm/glm/gtx/hash.hpp | 142 + include/glm/glm/gtx/hash.inl | 184 + include/glm/glm/gtx/integer.hpp | 76 + include/glm/glm/gtx/integer.inl | 185 + include/glm/glm/gtx/intersect.hpp | 92 + include/glm/glm/gtx/intersect.inl | 200 + include/glm/glm/gtx/io.hpp | 201 + include/glm/glm/gtx/io.inl | 440 ++ include/glm/glm/gtx/log_base.hpp | 48 + include/glm/glm/gtx/log_base.inl | 16 + include/glm/glm/gtx/matrix_cross_product.hpp | 47 + include/glm/glm/gtx/matrix_cross_product.inl | 37 + include/glm/glm/gtx/matrix_decompose.hpp | 46 + include/glm/glm/gtx/matrix_decompose.inl | 186 + include/glm/glm/gtx/matrix_factorisation.hpp | 69 + include/glm/glm/gtx/matrix_factorisation.inl | 84 + include/glm/glm/gtx/matrix_interpolation.hpp | 60 + include/glm/glm/gtx/matrix_interpolation.inl | 129 + include/glm/glm/gtx/matrix_major_storage.hpp | 119 + include/glm/glm/gtx/matrix_major_storage.inl | 166 + include/glm/glm/gtx/matrix_operation.hpp | 103 + include/glm/glm/gtx/matrix_operation.inl | 176 + include/glm/glm/gtx/matrix_query.hpp | 77 + include/glm/glm/gtx/matrix_query.inl | 113 + include/glm/glm/gtx/matrix_transform_2d.hpp | 81 + include/glm/glm/gtx/matrix_transform_2d.inl | 68 + include/glm/glm/gtx/mixed_product.hpp | 41 + include/glm/glm/gtx/mixed_product.inl | 15 + include/glm/glm/gtx/norm.hpp | 88 + include/glm/glm/gtx/norm.inl | 95 + include/glm/glm/gtx/normal.hpp | 41 + include/glm/glm/gtx/normal.inl | 15 + include/glm/glm/gtx/normalize_dot.hpp | 49 + include/glm/glm/gtx/normalize_dot.inl | 16 + include/glm/glm/gtx/number_precision.hpp | 61 + include/glm/glm/gtx/number_precision.inl | 6 + include/glm/glm/gtx/optimum_pow.hpp | 54 + include/glm/glm/gtx/optimum_pow.inl | 22 + include/glm/glm/gtx/orthonormalize.hpp | 49 + include/glm/glm/gtx/orthonormalize.inl | 29 + include/glm/glm/gtx/perpendicular.hpp | 41 + include/glm/glm/gtx/perpendicular.inl | 10 + include/glm/glm/gtx/polar_coordinates.hpp | 48 + include/glm/glm/gtx/polar_coordinates.inl | 36 + include/glm/glm/gtx/projection.hpp | 43 + include/glm/glm/gtx/projection.inl | 10 + include/glm/glm/gtx/quaternion.hpp | 174 + include/glm/glm/gtx/quaternion.inl | 159 + include/glm/glm/gtx/range.hpp | 98 + include/glm/glm/gtx/raw_data.hpp | 51 + include/glm/glm/gtx/raw_data.inl | 2 + .../glm/glm/gtx/rotate_normalized_axis.hpp | 68 + .../glm/glm/gtx/rotate_normalized_axis.inl | 58 + include/glm/glm/gtx/rotate_vector.hpp | 123 + include/glm/glm/gtx/rotate_vector.inl | 187 + include/glm/glm/gtx/scalar_multiplication.hpp | 75 + include/glm/glm/gtx/scalar_relational.hpp | 36 + include/glm/glm/gtx/scalar_relational.inl | 88 + include/glm/glm/gtx/spline.hpp | 65 + include/glm/glm/gtx/spline.inl | 60 + include/glm/glm/gtx/std_based_type.hpp | 68 + include/glm/glm/gtx/std_based_type.inl | 6 + include/glm/glm/gtx/string_cast.hpp | 52 + include/glm/glm/gtx/string_cast.inl | 492 +++ include/glm/glm/gtx/texture.hpp | 46 + include/glm/glm/gtx/texture.inl | 17 + include/glm/glm/gtx/transform.hpp | 60 + include/glm/glm/gtx/transform.inl | 23 + include/glm/glm/gtx/transform2.hpp | 89 + include/glm/glm/gtx/transform2.inl | 125 + include/glm/glm/gtx/type_aligned.hpp | 982 +++++ include/glm/glm/gtx/type_aligned.inl | 6 + include/glm/glm/gtx/type_trait.hpp | 85 + include/glm/glm/gtx/type_trait.inl | 61 + include/glm/glm/gtx/vec_swizzle.hpp | 2782 ++++++++++++ include/glm/glm/gtx/vector_angle.hpp | 57 + include/glm/glm/gtx/vector_angle.inl | 44 + include/glm/glm/gtx/vector_query.hpp | 66 + include/glm/glm/gtx/vector_query.inl | 154 + include/glm/glm/gtx/wrap.hpp | 37 + include/glm/glm/gtx/wrap.inl | 6 + include/glm/glm/integer.hpp | 212 + include/glm/glm/mat2x2.hpp | 9 + include/glm/glm/mat2x3.hpp | 9 + include/glm/glm/mat2x4.hpp | 9 + include/glm/glm/mat3x2.hpp | 9 + include/glm/glm/mat3x3.hpp | 8 + include/glm/glm/mat3x4.hpp | 8 + include/glm/glm/mat4x2.hpp | 9 + include/glm/glm/mat4x3.hpp | 8 + include/glm/glm/mat4x4.hpp | 9 + include/glm/glm/matrix.hpp | 161 + include/glm/glm/packing.hpp | 173 + include/glm/glm/simd/common.h | 240 + include/glm/glm/simd/exponential.h | 20 + include/glm/glm/simd/geometric.h | 124 + include/glm/glm/simd/integer.h | 115 + include/glm/glm/simd/matrix.h | 1028 +++++ include/glm/glm/simd/neon.h | 155 + include/glm/glm/simd/packing.h | 8 + include/glm/glm/simd/platform.h | 398 ++ include/glm/glm/simd/trigonometric.h | 9 + include/glm/glm/simd/vector_relational.h | 8 + include/glm/glm/trigonometric.hpp | 210 + include/glm/glm/vec2.hpp | 14 + include/glm/glm/vec3.hpp | 14 + include/glm/glm/vec4.hpp | 15 + include/glm/glm/vector_relational.hpp | 121 + include/glm/manual.md | 2411 ++++++++++ include/glm/readme.md | 1209 +++++ include/glm/util/autoexp.txt | 28 + include/glm/util/autoexp.vc2010.dat | 3896 +++++++++++++++++ include/glm/util/glm.natvis | 65 + include/glm/util/usertype.dat | 407 ++ 433 files changed, 71431 insertions(+) create mode 100644 include/glm/.appveyor.yml create mode 100644 include/glm/.gitignore create mode 100644 include/glm/.travis.yml create mode 100644 include/glm/CMakeLists.txt create mode 100644 include/glm/cmake/glm/glmConfig-version.cmake create mode 100644 include/glm/cmake/glm/glmConfig.cmake create mode 100644 include/glm/copying.txt create mode 100644 include/glm/glm/CMakeLists.txt create mode 100644 include/glm/glm/common.hpp create mode 100644 include/glm/glm/detail/_features.hpp create mode 100644 include/glm/glm/detail/_fixes.hpp create mode 100644 include/glm/glm/detail/_noise.hpp create mode 100644 include/glm/glm/detail/_swizzle.hpp create mode 100644 include/glm/glm/detail/_swizzle_func.hpp create mode 100644 include/glm/glm/detail/_vectorize.hpp create mode 100644 include/glm/glm/detail/compute_common.hpp create mode 100644 include/glm/glm/detail/compute_vector_relational.hpp create mode 100644 include/glm/glm/detail/func_common.inl create mode 100644 include/glm/glm/detail/func_common_simd.inl create mode 100644 include/glm/glm/detail/func_exponential.inl create mode 100644 include/glm/glm/detail/func_exponential_simd.inl create mode 100644 include/glm/glm/detail/func_geometric.inl create mode 100644 include/glm/glm/detail/func_geometric_simd.inl create mode 100644 include/glm/glm/detail/func_integer.inl create mode 100644 include/glm/glm/detail/func_integer_simd.inl create mode 100644 include/glm/glm/detail/func_matrix.inl create mode 100644 include/glm/glm/detail/func_matrix_simd.inl create mode 100644 include/glm/glm/detail/func_packing.inl create mode 100644 include/glm/glm/detail/func_packing_simd.inl create mode 100644 include/glm/glm/detail/func_trigonometric.inl create mode 100644 include/glm/glm/detail/func_trigonometric_simd.inl create mode 100644 include/glm/glm/detail/func_vector_relational.inl create mode 100644 include/glm/glm/detail/func_vector_relational_simd.inl create mode 100644 include/glm/glm/detail/glm.cpp create mode 100644 include/glm/glm/detail/qualifier.hpp create mode 100644 include/glm/glm/detail/setup.hpp create mode 100644 include/glm/glm/detail/type_float.hpp create mode 100644 include/glm/glm/detail/type_half.hpp create mode 100644 include/glm/glm/detail/type_half.inl create mode 100644 include/glm/glm/detail/type_mat2x2.hpp create mode 100644 include/glm/glm/detail/type_mat2x2.inl create mode 100644 include/glm/glm/detail/type_mat2x3.hpp create mode 100644 include/glm/glm/detail/type_mat2x3.inl create mode 100644 include/glm/glm/detail/type_mat2x4.hpp create mode 100644 include/glm/glm/detail/type_mat2x4.inl create mode 100644 include/glm/glm/detail/type_mat3x2.hpp create mode 100644 include/glm/glm/detail/type_mat3x2.inl create mode 100644 include/glm/glm/detail/type_mat3x3.hpp create mode 100644 include/glm/glm/detail/type_mat3x3.inl create mode 100644 include/glm/glm/detail/type_mat3x4.hpp create mode 100644 include/glm/glm/detail/type_mat3x4.inl create mode 100644 include/glm/glm/detail/type_mat4x2.hpp create mode 100644 include/glm/glm/detail/type_mat4x2.inl create mode 100644 include/glm/glm/detail/type_mat4x3.hpp create mode 100644 include/glm/glm/detail/type_mat4x3.inl create mode 100644 include/glm/glm/detail/type_mat4x4.hpp create mode 100644 include/glm/glm/detail/type_mat4x4.inl create mode 100644 include/glm/glm/detail/type_mat4x4_simd.inl create mode 100644 include/glm/glm/detail/type_quat.hpp create mode 100644 include/glm/glm/detail/type_quat.inl create mode 100644 include/glm/glm/detail/type_quat_simd.inl create mode 100644 include/glm/glm/detail/type_vec1.hpp create mode 100644 include/glm/glm/detail/type_vec1.inl create mode 100644 include/glm/glm/detail/type_vec2.hpp create mode 100644 include/glm/glm/detail/type_vec2.inl create mode 100644 include/glm/glm/detail/type_vec3.hpp create mode 100644 include/glm/glm/detail/type_vec3.inl create mode 100644 include/glm/glm/detail/type_vec4.hpp create mode 100644 include/glm/glm/detail/type_vec4.inl create mode 100644 include/glm/glm/detail/type_vec4_simd.inl create mode 100644 include/glm/glm/exponential.hpp create mode 100644 include/glm/glm/ext.hpp create mode 100644 include/glm/glm/ext/matrix_clip_space.hpp create mode 100644 include/glm/glm/ext/matrix_clip_space.inl create mode 100644 include/glm/glm/ext/matrix_common.hpp create mode 100644 include/glm/glm/ext/matrix_common.inl create mode 100644 include/glm/glm/ext/matrix_double2x2.hpp create mode 100644 include/glm/glm/ext/matrix_double2x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double2x3.hpp create mode 100644 include/glm/glm/ext/matrix_double2x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double2x4.hpp create mode 100644 include/glm/glm/ext/matrix_double2x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double3x2.hpp create mode 100644 include/glm/glm/ext/matrix_double3x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double3x3.hpp create mode 100644 include/glm/glm/ext/matrix_double3x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double3x4.hpp create mode 100644 include/glm/glm/ext/matrix_double3x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double4x2.hpp create mode 100644 include/glm/glm/ext/matrix_double4x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double4x3.hpp create mode 100644 include/glm/glm/ext/matrix_double4x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_double4x4.hpp create mode 100644 include/glm/glm/ext/matrix_double4x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float2x2.hpp create mode 100644 include/glm/glm/ext/matrix_float2x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float2x3.hpp create mode 100644 include/glm/glm/ext/matrix_float2x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float2x4.hpp create mode 100644 include/glm/glm/ext/matrix_float2x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float3x2.hpp create mode 100644 include/glm/glm/ext/matrix_float3x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float3x3.hpp create mode 100644 include/glm/glm/ext/matrix_float3x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float3x4.hpp create mode 100644 include/glm/glm/ext/matrix_float3x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float4x2.hpp create mode 100644 include/glm/glm/ext/matrix_float4x2_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float4x3.hpp create mode 100644 include/glm/glm/ext/matrix_float4x3_precision.hpp create mode 100644 include/glm/glm/ext/matrix_float4x4.hpp create mode 100644 include/glm/glm/ext/matrix_float4x4_precision.hpp create mode 100644 include/glm/glm/ext/matrix_int2x2.hpp create mode 100644 include/glm/glm/ext/matrix_int2x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int2x3.hpp create mode 100644 include/glm/glm/ext/matrix_int2x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int2x4.hpp create mode 100644 include/glm/glm/ext/matrix_int2x4_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int3x2.hpp create mode 100644 include/glm/glm/ext/matrix_int3x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int3x3.hpp create mode 100644 include/glm/glm/ext/matrix_int3x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int3x4.hpp create mode 100644 include/glm/glm/ext/matrix_int3x4_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int4x2.hpp create mode 100644 include/glm/glm/ext/matrix_int4x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int4x3.hpp create mode 100644 include/glm/glm/ext/matrix_int4x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_int4x4.hpp create mode 100644 include/glm/glm/ext/matrix_int4x4_sized.hpp create mode 100644 include/glm/glm/ext/matrix_projection.hpp create mode 100644 include/glm/glm/ext/matrix_projection.inl create mode 100644 include/glm/glm/ext/matrix_relational.hpp create mode 100644 include/glm/glm/ext/matrix_relational.inl create mode 100644 include/glm/glm/ext/matrix_transform.hpp create mode 100644 include/glm/glm/ext/matrix_transform.inl create mode 100644 include/glm/glm/ext/matrix_uint2x2.hpp create mode 100644 include/glm/glm/ext/matrix_uint2x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint2x3.hpp create mode 100644 include/glm/glm/ext/matrix_uint2x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint2x4.hpp create mode 100644 include/glm/glm/ext/matrix_uint2x4_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x2.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x3.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x4.hpp create mode 100644 include/glm/glm/ext/matrix_uint3x4_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x2.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x2_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x3.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x3_sized.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x4.hpp create mode 100644 include/glm/glm/ext/matrix_uint4x4_sized.hpp create mode 100644 include/glm/glm/ext/quaternion_common.hpp create mode 100644 include/glm/glm/ext/quaternion_common.inl create mode 100644 include/glm/glm/ext/quaternion_common_simd.inl create mode 100644 include/glm/glm/ext/quaternion_double.hpp create mode 100644 include/glm/glm/ext/quaternion_double_precision.hpp create mode 100644 include/glm/glm/ext/quaternion_exponential.hpp create mode 100644 include/glm/glm/ext/quaternion_exponential.inl create mode 100644 include/glm/glm/ext/quaternion_float.hpp create mode 100644 include/glm/glm/ext/quaternion_float_precision.hpp create mode 100644 include/glm/glm/ext/quaternion_geometric.hpp create mode 100644 include/glm/glm/ext/quaternion_geometric.inl create mode 100644 include/glm/glm/ext/quaternion_relational.hpp create mode 100644 include/glm/glm/ext/quaternion_relational.inl create mode 100644 include/glm/glm/ext/quaternion_transform.hpp create mode 100644 include/glm/glm/ext/quaternion_transform.inl create mode 100644 include/glm/glm/ext/quaternion_trigonometric.hpp create mode 100644 include/glm/glm/ext/quaternion_trigonometric.inl create mode 100644 include/glm/glm/ext/scalar_common.hpp create mode 100644 include/glm/glm/ext/scalar_common.inl create mode 100644 include/glm/glm/ext/scalar_constants.hpp create mode 100644 include/glm/glm/ext/scalar_constants.inl create mode 100644 include/glm/glm/ext/scalar_int_sized.hpp create mode 100644 include/glm/glm/ext/scalar_integer.hpp create mode 100644 include/glm/glm/ext/scalar_integer.inl create mode 100644 include/glm/glm/ext/scalar_packing.hpp create mode 100644 include/glm/glm/ext/scalar_packing.inl create mode 100644 include/glm/glm/ext/scalar_relational.hpp create mode 100644 include/glm/glm/ext/scalar_relational.inl create mode 100644 include/glm/glm/ext/scalar_uint_sized.hpp create mode 100644 include/glm/glm/ext/scalar_ulp.hpp create mode 100644 include/glm/glm/ext/scalar_ulp.inl create mode 100644 include/glm/glm/ext/vector_bool1.hpp create mode 100644 include/glm/glm/ext/vector_bool1_precision.hpp create mode 100644 include/glm/glm/ext/vector_bool2.hpp create mode 100644 include/glm/glm/ext/vector_bool2_precision.hpp create mode 100644 include/glm/glm/ext/vector_bool3.hpp create mode 100644 include/glm/glm/ext/vector_bool3_precision.hpp create mode 100644 include/glm/glm/ext/vector_bool4.hpp create mode 100644 include/glm/glm/ext/vector_bool4_precision.hpp create mode 100644 include/glm/glm/ext/vector_common.hpp create mode 100644 include/glm/glm/ext/vector_common.inl create mode 100644 include/glm/glm/ext/vector_double1.hpp create mode 100644 include/glm/glm/ext/vector_double1_precision.hpp create mode 100644 include/glm/glm/ext/vector_double2.hpp create mode 100644 include/glm/glm/ext/vector_double2_precision.hpp create mode 100644 include/glm/glm/ext/vector_double3.hpp create mode 100644 include/glm/glm/ext/vector_double3_precision.hpp create mode 100644 include/glm/glm/ext/vector_double4.hpp create mode 100644 include/glm/glm/ext/vector_double4_precision.hpp create mode 100644 include/glm/glm/ext/vector_float1.hpp create mode 100644 include/glm/glm/ext/vector_float1_precision.hpp create mode 100644 include/glm/glm/ext/vector_float2.hpp create mode 100644 include/glm/glm/ext/vector_float2_precision.hpp create mode 100644 include/glm/glm/ext/vector_float3.hpp create mode 100644 include/glm/glm/ext/vector_float3_precision.hpp create mode 100644 include/glm/glm/ext/vector_float4.hpp create mode 100644 include/glm/glm/ext/vector_float4_precision.hpp create mode 100644 include/glm/glm/ext/vector_int1.hpp create mode 100644 include/glm/glm/ext/vector_int1_sized.hpp create mode 100644 include/glm/glm/ext/vector_int2.hpp create mode 100644 include/glm/glm/ext/vector_int2_sized.hpp create mode 100644 include/glm/glm/ext/vector_int3.hpp create mode 100644 include/glm/glm/ext/vector_int3_sized.hpp create mode 100644 include/glm/glm/ext/vector_int4.hpp create mode 100644 include/glm/glm/ext/vector_int4_sized.hpp create mode 100644 include/glm/glm/ext/vector_integer.hpp create mode 100644 include/glm/glm/ext/vector_integer.inl create mode 100644 include/glm/glm/ext/vector_packing.hpp create mode 100644 include/glm/glm/ext/vector_packing.inl create mode 100644 include/glm/glm/ext/vector_relational.hpp create mode 100644 include/glm/glm/ext/vector_relational.inl create mode 100644 include/glm/glm/ext/vector_uint1.hpp create mode 100644 include/glm/glm/ext/vector_uint1_sized.hpp create mode 100644 include/glm/glm/ext/vector_uint2.hpp create mode 100644 include/glm/glm/ext/vector_uint2_sized.hpp create mode 100644 include/glm/glm/ext/vector_uint3.hpp create mode 100644 include/glm/glm/ext/vector_uint3_sized.hpp create mode 100644 include/glm/glm/ext/vector_uint4.hpp create mode 100644 include/glm/glm/ext/vector_uint4_sized.hpp create mode 100644 include/glm/glm/ext/vector_ulp.hpp create mode 100644 include/glm/glm/ext/vector_ulp.inl create mode 100644 include/glm/glm/fwd.hpp create mode 100644 include/glm/glm/geometric.hpp create mode 100644 include/glm/glm/glm.hpp create mode 100644 include/glm/glm/gtc/bitfield.hpp create mode 100644 include/glm/glm/gtc/bitfield.inl create mode 100644 include/glm/glm/gtc/color_space.hpp create mode 100644 include/glm/glm/gtc/color_space.inl create mode 100644 include/glm/glm/gtc/constants.hpp create mode 100644 include/glm/glm/gtc/constants.inl create mode 100644 include/glm/glm/gtc/epsilon.hpp create mode 100644 include/glm/glm/gtc/epsilon.inl create mode 100644 include/glm/glm/gtc/integer.hpp create mode 100644 include/glm/glm/gtc/integer.inl create mode 100644 include/glm/glm/gtc/matrix_access.hpp create mode 100644 include/glm/glm/gtc/matrix_access.inl create mode 100644 include/glm/glm/gtc/matrix_integer.hpp create mode 100644 include/glm/glm/gtc/matrix_inverse.hpp create mode 100644 include/glm/glm/gtc/matrix_inverse.inl create mode 100644 include/glm/glm/gtc/matrix_transform.hpp create mode 100644 include/glm/glm/gtc/matrix_transform.inl create mode 100644 include/glm/glm/gtc/noise.hpp create mode 100644 include/glm/glm/gtc/noise.inl create mode 100644 include/glm/glm/gtc/packing.hpp create mode 100644 include/glm/glm/gtc/packing.inl create mode 100644 include/glm/glm/gtc/quaternion.hpp create mode 100644 include/glm/glm/gtc/quaternion.inl create mode 100644 include/glm/glm/gtc/quaternion_simd.inl create mode 100644 include/glm/glm/gtc/random.hpp create mode 100644 include/glm/glm/gtc/random.inl create mode 100644 include/glm/glm/gtc/reciprocal.hpp create mode 100644 include/glm/glm/gtc/reciprocal.inl create mode 100644 include/glm/glm/gtc/round.hpp create mode 100644 include/glm/glm/gtc/round.inl create mode 100644 include/glm/glm/gtc/type_aligned.hpp create mode 100644 include/glm/glm/gtc/type_precision.hpp create mode 100644 include/glm/glm/gtc/type_precision.inl create mode 100644 include/glm/glm/gtc/type_ptr.hpp create mode 100644 include/glm/glm/gtc/type_ptr.inl create mode 100644 include/glm/glm/gtc/ulp.hpp create mode 100644 include/glm/glm/gtc/ulp.inl create mode 100644 include/glm/glm/gtc/vec1.hpp create mode 100644 include/glm/glm/gtx/associated_min_max.hpp create mode 100644 include/glm/glm/gtx/associated_min_max.inl create mode 100644 include/glm/glm/gtx/bit.hpp create mode 100644 include/glm/glm/gtx/bit.inl create mode 100644 include/glm/glm/gtx/closest_point.hpp create mode 100644 include/glm/glm/gtx/closest_point.inl create mode 100644 include/glm/glm/gtx/color_encoding.hpp create mode 100644 include/glm/glm/gtx/color_encoding.inl create mode 100644 include/glm/glm/gtx/color_space.hpp create mode 100644 include/glm/glm/gtx/color_space.inl create mode 100644 include/glm/glm/gtx/color_space_YCoCg.hpp create mode 100644 include/glm/glm/gtx/color_space_YCoCg.inl create mode 100644 include/glm/glm/gtx/common.hpp create mode 100644 include/glm/glm/gtx/common.inl create mode 100644 include/glm/glm/gtx/compatibility.hpp create mode 100644 include/glm/glm/gtx/compatibility.inl create mode 100644 include/glm/glm/gtx/component_wise.hpp create mode 100644 include/glm/glm/gtx/component_wise.inl create mode 100644 include/glm/glm/gtx/dual_quaternion.hpp create mode 100644 include/glm/glm/gtx/dual_quaternion.inl create mode 100644 include/glm/glm/gtx/easing.hpp create mode 100644 include/glm/glm/gtx/easing.inl create mode 100644 include/glm/glm/gtx/euler_angles.hpp create mode 100644 include/glm/glm/gtx/euler_angles.inl create mode 100644 include/glm/glm/gtx/extend.hpp create mode 100644 include/glm/glm/gtx/extend.inl create mode 100644 include/glm/glm/gtx/extended_min_max.hpp create mode 100644 include/glm/glm/gtx/extended_min_max.inl create mode 100644 include/glm/glm/gtx/exterior_product.hpp create mode 100644 include/glm/glm/gtx/exterior_product.inl create mode 100644 include/glm/glm/gtx/fast_exponential.hpp create mode 100644 include/glm/glm/gtx/fast_exponential.inl create mode 100644 include/glm/glm/gtx/fast_square_root.hpp create mode 100644 include/glm/glm/gtx/fast_square_root.inl create mode 100644 include/glm/glm/gtx/fast_trigonometry.hpp create mode 100644 include/glm/glm/gtx/fast_trigonometry.inl create mode 100644 include/glm/glm/gtx/float_notmalize.inl create mode 100644 include/glm/glm/gtx/functions.hpp create mode 100644 include/glm/glm/gtx/functions.inl create mode 100644 include/glm/glm/gtx/gradient_paint.hpp create mode 100644 include/glm/glm/gtx/gradient_paint.inl create mode 100644 include/glm/glm/gtx/handed_coordinate_space.hpp create mode 100644 include/glm/glm/gtx/handed_coordinate_space.inl create mode 100644 include/glm/glm/gtx/hash.hpp create mode 100644 include/glm/glm/gtx/hash.inl create mode 100644 include/glm/glm/gtx/integer.hpp create mode 100644 include/glm/glm/gtx/integer.inl create mode 100644 include/glm/glm/gtx/intersect.hpp create mode 100644 include/glm/glm/gtx/intersect.inl create mode 100644 include/glm/glm/gtx/io.hpp create mode 100644 include/glm/glm/gtx/io.inl create mode 100644 include/glm/glm/gtx/log_base.hpp create mode 100644 include/glm/glm/gtx/log_base.inl create mode 100644 include/glm/glm/gtx/matrix_cross_product.hpp create mode 100644 include/glm/glm/gtx/matrix_cross_product.inl create mode 100644 include/glm/glm/gtx/matrix_decompose.hpp create mode 100644 include/glm/glm/gtx/matrix_decompose.inl create mode 100644 include/glm/glm/gtx/matrix_factorisation.hpp create mode 100644 include/glm/glm/gtx/matrix_factorisation.inl create mode 100644 include/glm/glm/gtx/matrix_interpolation.hpp create mode 100644 include/glm/glm/gtx/matrix_interpolation.inl create mode 100644 include/glm/glm/gtx/matrix_major_storage.hpp create mode 100644 include/glm/glm/gtx/matrix_major_storage.inl create mode 100644 include/glm/glm/gtx/matrix_operation.hpp create mode 100644 include/glm/glm/gtx/matrix_operation.inl create mode 100644 include/glm/glm/gtx/matrix_query.hpp create mode 100644 include/glm/glm/gtx/matrix_query.inl create mode 100644 include/glm/glm/gtx/matrix_transform_2d.hpp create mode 100644 include/glm/glm/gtx/matrix_transform_2d.inl create mode 100644 include/glm/glm/gtx/mixed_product.hpp create mode 100644 include/glm/glm/gtx/mixed_product.inl create mode 100644 include/glm/glm/gtx/norm.hpp create mode 100644 include/glm/glm/gtx/norm.inl create mode 100644 include/glm/glm/gtx/normal.hpp create mode 100644 include/glm/glm/gtx/normal.inl create mode 100644 include/glm/glm/gtx/normalize_dot.hpp create mode 100644 include/glm/glm/gtx/normalize_dot.inl create mode 100644 include/glm/glm/gtx/number_precision.hpp create mode 100644 include/glm/glm/gtx/number_precision.inl create mode 100644 include/glm/glm/gtx/optimum_pow.hpp create mode 100644 include/glm/glm/gtx/optimum_pow.inl create mode 100644 include/glm/glm/gtx/orthonormalize.hpp create mode 100644 include/glm/glm/gtx/orthonormalize.inl create mode 100644 include/glm/glm/gtx/perpendicular.hpp create mode 100644 include/glm/glm/gtx/perpendicular.inl create mode 100644 include/glm/glm/gtx/polar_coordinates.hpp create mode 100644 include/glm/glm/gtx/polar_coordinates.inl create mode 100644 include/glm/glm/gtx/projection.hpp create mode 100644 include/glm/glm/gtx/projection.inl create mode 100644 include/glm/glm/gtx/quaternion.hpp create mode 100644 include/glm/glm/gtx/quaternion.inl create mode 100644 include/glm/glm/gtx/range.hpp create mode 100644 include/glm/glm/gtx/raw_data.hpp create mode 100644 include/glm/glm/gtx/raw_data.inl create mode 100644 include/glm/glm/gtx/rotate_normalized_axis.hpp create mode 100644 include/glm/glm/gtx/rotate_normalized_axis.inl create mode 100644 include/glm/glm/gtx/rotate_vector.hpp create mode 100644 include/glm/glm/gtx/rotate_vector.inl create mode 100644 include/glm/glm/gtx/scalar_multiplication.hpp create mode 100644 include/glm/glm/gtx/scalar_relational.hpp create mode 100644 include/glm/glm/gtx/scalar_relational.inl create mode 100644 include/glm/glm/gtx/spline.hpp create mode 100644 include/glm/glm/gtx/spline.inl create mode 100644 include/glm/glm/gtx/std_based_type.hpp create mode 100644 include/glm/glm/gtx/std_based_type.inl create mode 100644 include/glm/glm/gtx/string_cast.hpp create mode 100644 include/glm/glm/gtx/string_cast.inl create mode 100644 include/glm/glm/gtx/texture.hpp create mode 100644 include/glm/glm/gtx/texture.inl create mode 100644 include/glm/glm/gtx/transform.hpp create mode 100644 include/glm/glm/gtx/transform.inl create mode 100644 include/glm/glm/gtx/transform2.hpp create mode 100644 include/glm/glm/gtx/transform2.inl create mode 100644 include/glm/glm/gtx/type_aligned.hpp create mode 100644 include/glm/glm/gtx/type_aligned.inl create mode 100644 include/glm/glm/gtx/type_trait.hpp create mode 100644 include/glm/glm/gtx/type_trait.inl create mode 100644 include/glm/glm/gtx/vec_swizzle.hpp create mode 100644 include/glm/glm/gtx/vector_angle.hpp create mode 100644 include/glm/glm/gtx/vector_angle.inl create mode 100644 include/glm/glm/gtx/vector_query.hpp create mode 100644 include/glm/glm/gtx/vector_query.inl create mode 100644 include/glm/glm/gtx/wrap.hpp create mode 100644 include/glm/glm/gtx/wrap.inl create mode 100644 include/glm/glm/integer.hpp create mode 100644 include/glm/glm/mat2x2.hpp create mode 100644 include/glm/glm/mat2x3.hpp create mode 100644 include/glm/glm/mat2x4.hpp create mode 100644 include/glm/glm/mat3x2.hpp create mode 100644 include/glm/glm/mat3x3.hpp create mode 100644 include/glm/glm/mat3x4.hpp create mode 100644 include/glm/glm/mat4x2.hpp create mode 100644 include/glm/glm/mat4x3.hpp create mode 100644 include/glm/glm/mat4x4.hpp create mode 100644 include/glm/glm/matrix.hpp create mode 100644 include/glm/glm/packing.hpp create mode 100644 include/glm/glm/simd/common.h create mode 100644 include/glm/glm/simd/exponential.h create mode 100644 include/glm/glm/simd/geometric.h create mode 100644 include/glm/glm/simd/integer.h create mode 100644 include/glm/glm/simd/matrix.h create mode 100644 include/glm/glm/simd/neon.h create mode 100644 include/glm/glm/simd/packing.h create mode 100644 include/glm/glm/simd/platform.h create mode 100644 include/glm/glm/simd/trigonometric.h create mode 100644 include/glm/glm/simd/vector_relational.h create mode 100644 include/glm/glm/trigonometric.hpp create mode 100644 include/glm/glm/vec2.hpp create mode 100644 include/glm/glm/vec3.hpp create mode 100644 include/glm/glm/vec4.hpp create mode 100644 include/glm/glm/vector_relational.hpp create mode 100644 include/glm/manual.md create mode 100644 include/glm/readme.md create mode 100644 include/glm/util/autoexp.txt create mode 100644 include/glm/util/autoexp.vc2010.dat create mode 100644 include/glm/util/glm.natvis create mode 100644 include/glm/util/usertype.dat diff --git a/include/glm/.appveyor.yml b/include/glm/.appveyor.yml new file mode 100644 index 00000000..f82b848e --- /dev/null +++ b/include/glm/.appveyor.yml @@ -0,0 +1,87 @@ +shallow_clone: true + +platform: + - x86 + - x64 + +configuration: + - Debug + - Release + +image: + - Visual Studio 2013 + - Visual Studio 2015 + - Visual Studio 2017 + - Visual Studio 2019 + +environment: + matrix: + - GLM_ARGUMENTS: -DGLM_TEST_FORCE_PURE=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + +matrix: + exclude: + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + - image: Visual Studio 2013 + configuration: Debug + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + - image: Visual Studio 2015 + platform: x86 + - image: Visual Studio 2015 + configuration: Debug + - image: Visual Studio 2017 + platform: x86 + - image: Visual Studio 2017 + configuration: Debug + - image: Visual Studio 2019 + platform: x64 + +before_build: + - ps: | + mkdir build + cd build + + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2013") { + $env:generator="Visual Studio 12 2013" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2015") { + $env:generator="Visual Studio 14 2015" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2017") { + $env:generator="Visual Studio 15 2017" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2019") { + $env:generator="Visual Studio 16 2019" + } + if ($env:PLATFORM -eq "x64") { + $env:generator="$env:generator Win64" + } + echo generator="$env:generator" + cmake .. -G "$env:generator" -DGLM_QUIET=ON -DGLM_TEST_ENABLE=ON "$env:GLM_ARGUMENTS" + +build_script: + - cmake --build . --config %CONFIGURATION% -- /m /v:minimal + +test_script: + - ctest -j4 -C %CONFIGURATION% + - cd .. + - ps: | + mkdir build_test_cmake + cd build_test_cmake + cmake ..\test\cmake\ -G "$env:generator" -Dglm_DIR="$env:APPVEYOR_BUILD_FOLDER/cmake/glm/" + - cmake --build . --config %CONFIGURATION% -- /m /v:minimal + +deploy: off diff --git a/include/glm/.gitignore b/include/glm/.gitignore new file mode 100644 index 00000000..9dbd6d8c --- /dev/null +++ b/include/glm/.gitignore @@ -0,0 +1,61 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# CMake +CMakeCache.txt +CMakeFiles +cmake_install.cmake +install_manifest.txt +*.cmake +!glmConfig.cmake +!glmConfig-version.cmake +# ^ May need to add future .cmake files as exceptions + +# Test logs +Testing/* + +# Test input +test/gtc/*.dds + +# Project Files +Makefile +*.cbp +*.user + +# Misc. +*.log + +# local build(s) +build* + +/.vs +/.vscode +/CMakeSettings.json +.DS_Store +*.swp diff --git a/include/glm/.travis.yml b/include/glm/.travis.yml new file mode 100644 index 00000000..8eae8f73 --- /dev/null +++ b/include/glm/.travis.yml @@ -0,0 +1,735 @@ +language: cpp + +matrix: + include: + - os: osx + osx_image: xcode7.3 + script: + - cmake --version + - mkdir ./build_unknown_release + - cd ./build_unknown_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_DISABLE_AUTO_DETECTION=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++unknown-release" + + - os: osx + osx_image: xcode7.3 + script: + - cmake --version + - mkdir ./build_pure_98_release + - cd ./build_pure_98_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++98-pure-release" + + - os: osx + osx_image: xcode7.3 + script: + - cmake --version + - mkdir ./build_pure_ms_release + - cd ./build_pure_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++98-pure-ms-release" + + - os: osx + osx_image: xcode7.3 + script: + - cmake --version + - mkdir ./build_pure_11_release + - cd ./build_pure_11_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++11-pure-release" + + - os: osx + osx_image: xcode7.3 + script: + - cmake --version + - mkdir ./build_sse2_11_release + - cd ./build_sse2_11_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++11-sse2-release" + + - os: osx + osx_image: xcode8 + script: + - cmake --version + - mkdir ./build_pure_14_release + - cd ./build_pure_14_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++14-pure-release" + + - os: osx + osx_image: xcode8 + script: + - cmake --version + - mkdir ./build_sse3_14_release + - cd ./build_sse3_14_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++14-sse3-release" + + - os: osx + osx_image: xcode8 + script: + - cmake --version + - mkdir ./build_avx_14_release + - cd ./build_avx_14_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++14-avx-release" + + - os: osx + osx_image: xcode8 + script: + - cmake --version + - mkdir ./build_avx_14_debug + - cd ./build_avx_14_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++14-avx-debug" + + - os: osx + osx_image: xcode11 + script: + - cmake --version + - mkdir ./build_pure_17_release + - cd ./build_pure_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++17-pure-release" + + - os: osx + osx_image: xcode11 + script: + - cmake --version + - mkdir ./build_pure_17_debug + - cd ./build_pure_17_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++17-pure-debug" + + - os: osx + osx_image: xcode11 + script: + - cmake --version + - mkdir ./build_avx_17_release + - cd ./build_avx_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++17-avx-release" + + - os: osx + osx_image: xcode11 + script: + - cmake --version + - mkdir ./build_avx_17_debug + - cd ./build_avx_17_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + env: + - MATRIX_EVAL="INFO=C++17-avx-debug" + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && INFO=C++98-pure-release" + script: + - cmake --version + - mkdir ./build_pure_98_release + - cd ./build_pure_98_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && INFO=C++98-pure-debug" + script: + - cmake --version + - mkdir ./build_pure_98_debug + - cd ./build_pure_98_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && INFO=C++98-pure-ms" + script: + - cmake --version + - mkdir ./build_pure_ms_release + - cd ./build_pure_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && INFO=C++11-pure-release" + script: + - cmake --version + - mkdir ./build_pure_11_release + - cd ./build_pure_11_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && INFO=C++11-pure-debug" + script: + - cmake --version + - mkdir ./build_pure_11_debug + - cd ./build_pure_11_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && INFO=C++11-pure-ms" + script: + - cmake --version + - mkdir ./build_pure_ms_release + - cd ./build_pure_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && INFO=C++11-sse3-release" + script: + - cmake --version + - mkdir ./build_sse3_ms_release + - cd ./build_sse3_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && INFO=C++14-pure-release" + script: + - cmake --version + - mkdir ./build_pure_14_release + - cd ./build_pure_14_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && INFO=C++14-pure-debug" + script: + - cmake --version + - mkdir ./build_pure_14_debug + - cd ./build_pure_14_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && INFO=C++14-pure-ms" + script: + - cmake --version + - mkdir ./build_pure_ms_release + - cd ./build_pure_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && INFO=C++14-sse3-release" + script: + - cmake --version + - mkdir ./build_sse3_ms_release + - cd ./build_sse3_ms_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && INFO=C++17-pure-release" + script: + - cmake --version + - mkdir ./build_pure_17_release + - cd ./build_pure_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && INFO=C++17-sse2-release" + script: + - cmake --version + - mkdir ./build_sse2_17_release + - cd ./build_sse2_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && INFO=C++17-sse3-release" + script: + - cmake --version + - mkdir ./build_sse3_17_release + - cd ./build_sse3_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && INFO=C++17-avx-release" + script: + - cmake --version + - mkdir ./build_avx_17_release + - cd ./build_avx_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && INFO=C++17-avx2-release" + script: + - cmake --version + - mkdir ./build_avx2_17_release + - cd ./build_avx2_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX2=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + packages: + - clang-3.6 + env: + - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6 && INFO=C++14-pure-release" + script: + - cmake --version + - mkdir ./build_pure_14_release + - cd ./build_pure_14_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + packages: + - clang-3.6 + env: + - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6 && INFO=C++14-pure-debug" + script: + - cmake --version + - mkdir ./build_pure_14_debug + - cd ./build_pure_14_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + packages: + - clang-3.6 + env: + - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6 && INFO=C++14-avx-debug" + script: + - cmake --version + - mkdir ./build_avx_14_debug + - cd ./build_avx_14_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + dist: bionic + env: + - MATRIX_EVAL="CC=clang && CXX=clang++ && INFO=C++17-pure-release" + script: + - cmake --version + - mkdir ./build_pure_17_release + - cd ./build_pure_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + dist: bionic + env: + - MATRIX_EVAL="CC=clang && CXX=clang++ && INFO=C++17-pure-debug" + script: + - cmake --version + - mkdir ./build_pure_17_debug + - cd ./build_pure_17_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + dist: bionic + env: + - MATRIX_EVAL="CC=clang && CXX=clang++ && INFO=C++17-sse3-release + script: + - cmake --version + - mkdir ./build_sse3_17_release + - cd ./build_sse3_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + dist: bionic + env: + - MATRIX_EVAL="CC=clang && CXX=clang++ && INFO=C++17-sse3-debug" + script: + - cmake --version + - mkdir ./build_sse3_17_debug + - cd ./build_sse3_17_debug + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + + - os: linux + dist: bionic + env: + - MATRIX_EVAL="CC=clang && CXX=clang++ && INFO=C++17-ssse3-release" + script: + - cmake --version + - mkdir ./build_ssse3_17_release + - cd ./build_ssse3_17_release + - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSSE3=ON .. + - cmake -E time cmake --build . + - ctest + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -Dglm_DIR=$TRAVIS_BUILD_DIR/cmake/glm/ + - cmake --build . + +before_install: + - eval "${MATRIX_EVAL}" + + diff --git a/include/glm/CMakeLists.txt b/include/glm/CMakeLists.txt new file mode 100644 index 00000000..843e7546 --- /dev/null +++ b/include/glm/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +cmake_policy(VERSION 3.2) + +set(GLM_VERSION "0.9.9") +project(glm VERSION ${GLM_VERSION} LANGUAGES CXX) +enable_testing() + +add_subdirectory(glm) +add_library(glm::glm ALIAS glm) + +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + +add_subdirectory(test) + +endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/include/glm/cmake/glm/glmConfig-version.cmake b/include/glm/cmake/glm/glmConfig-version.cmake new file mode 100644 index 00000000..6e63a4a3 --- /dev/null +++ b/include/glm/cmake/glm/glmConfig-version.cmake @@ -0,0 +1,11 @@ +if(${PACKAGE_FIND_VERSION_MAJOR} EQUAL 0) + if (${PACKAGE_FIND_VERSION} VERSION_LESS ${GLM_VERSION}) + set(PACKAGE_VERSION_COMPATIBLE 1) + endif() + if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${GLM_VERSION}) + set(PACKAGE_VERSION_EXACT 1) + endif() +else() + set(PACKAGE_VERSION_UNSUITABLE 1) +endif() + diff --git a/include/glm/cmake/glm/glmConfig.cmake b/include/glm/cmake/glm/glmConfig.cmake new file mode 100644 index 00000000..4fba5116 --- /dev/null +++ b/include/glm/cmake/glm/glmConfig.cmake @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +cmake_policy(VERSION 3.2) + +set(GLM_VERSION 0.9.9) + +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if (_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Set the old GLM_INCLUDE_DIRS variable for backwards compatibility +set(GLM_INCLUDE_DIRS ${_IMPORT_PREFIX}) + +add_library(glm::glm INTERFACE IMPORTED) +set_target_properties(glm::glm PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${GLM_INCLUDE_DIRS}) + +mark_as_advanced(glm_DIR) +set(_IMPORT_PREFIX) + diff --git a/include/glm/copying.txt b/include/glm/copying.txt new file mode 100644 index 00000000..779c32fb --- /dev/null +++ b/include/glm/copying.txt @@ -0,0 +1,54 @@ +================================================================================ +OpenGL Mathematics (GLM) +-------------------------------------------------------------------------------- +GLM is licensed under The Happy Bunny License or MIT License + +================================================================================ +The Happy Bunny License (Modified MIT License) +-------------------------------------------------------------------------------- +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Restrictions: + By making use of the Software for military purposes, you choose to make a + Bunny unhappy. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +================================================================================ +The MIT License +-------------------------------------------------------------------------------- +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/include/glm/glm/CMakeLists.txt b/include/glm/glm/CMakeLists.txt new file mode 100644 index 00000000..4ff51c81 --- /dev/null +++ b/include/glm/glm/CMakeLists.txt @@ -0,0 +1,70 @@ +file(GLOB ROOT_SOURCE *.cpp) +file(GLOB ROOT_INLINE *.inl) +file(GLOB ROOT_HEADER *.hpp) +file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_MD ../*.md) +file(GLOB ROOT_NAT ../util/glm.natvis) + +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) +file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) +file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) + +file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp) +file(GLOB_RECURSE EXT_INLINE ./ext/*.inl) +file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp) + +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) +file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) +file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) + +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) +file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) +file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) + +file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) +file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) +file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) + +source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) +source_group("Core Files" FILES ${CORE_SOURCE}) +source_group("Core Files" FILES ${CORE_INLINE}) +source_group("Core Files" FILES ${CORE_HEADER}) +source_group("EXT Files" FILES ${EXT_SOURCE}) +source_group("EXT Files" FILES ${EXT_INLINE}) +source_group("EXT Files" FILES ${EXT_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) +source_group("GTC Files" FILES ${GTC_INLINE}) +source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) +source_group("GTX Files" FILES ${GTX_INLINE}) +source_group("GTX Files" FILES ${GTX_HEADER}) +source_group("SIMD Files" FILES ${SIMD_SOURCE}) +source_group("SIMD Files" FILES ${SIMD_INLINE}) +source_group("SIMD Files" FILES ${SIMD_HEADER}) + +add_library(glm INTERFACE) +target_include_directories(glm INTERFACE ../) + +if(BUILD_STATIC_LIBS) +add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + target_link_libraries(glm_static PUBLIC glm) + add_library(glm::glm_static ALIAS glm_static) +endif() + +if(BUILD_SHARED_LIBS) +add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + target_link_libraries(glm_shared PUBLIC glm) + add_library(glm::glm_shared ALIAS glm_shared) +endif() diff --git a/include/glm/glm/common.hpp b/include/glm/glm/common.hpp new file mode 100644 index 00000000..0328dc91 --- /dev/null +++ b/include/glm/glm/common.hpp @@ -0,0 +1,539 @@ +/// @ref core +/// @file glm/common.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.3 Common Functions +/// +/// @defgroup core_func_common Common functions +/// @ingroup core +/// +/// Provides GLSL common functions +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/qualifier.hpp" +#include "detail/_fixes.hpp" + +namespace glm +{ + /// @addtogroup core_func_common + /// @{ + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam genType floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x); + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec abs(vec const& x); + + /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec sign(vec const& x); + + /// Returns a value equal to the nearest integer that is less then or equal to x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floor(vec const& x); + + /// Returns a value equal to the nearest integer to x + /// whose absolute value is not larger than the absolute value of x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec trunc(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// This includes the possibility that round(x) returns the + /// same value as roundEven(x) for all values of x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec round(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// A fractional part of 0.5 will round toward the nearest even + /// integer. (Both 3.5 and 4.5 for x will return 4.0.) + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see New round to even technique + template + GLM_FUNC_DECL vec roundEven(vec const& x); + + /// Returns a value equal to the nearest integer + /// that is greater than or equal to x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL ceil man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec ceil(vec const& x); + + /// Return x - floor(x). + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fract(genType x); + + /// Return x - floor(x). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec fract(vec const& x); + + template + GLM_FUNC_DECL genType mod(genType x, genType y); + + template + GLM_FUNC_DECL vec mod(vec const& x, T y); + + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec mod(vec const& x, vec const& y); + + /// Returns the fractional part of x and sets i to the integer + /// part (as a whole number floating point value). Both the + /// return value and the output parameter will have the same + /// sign as x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType modf(genType x, genType& i); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, T y); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, vec const& y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, T y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal); + + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of 'a' that is false, the + /// corresponding component of 'x' is returned. For a + /// component of 'a' that is true, the corresponding + /// component of 'y' is returned. Components of 'x' and 'y' that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @param[in] x Value to interpolate. + /// @param[in] y Value to interpolate. + /// @param[in] a Interpolant. + /// + /// @tparam genTypeT Floating point scalar or vector. + /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. + /// + /// @code + /// #include + /// ... + /// float a; + /// bool b; + /// glm::dvec3 e; + /// glm::dvec3 f; + /// glm::vec4 g; + /// glm::vec4 h; + /// ... + /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. + /// glm::vec4 s = glm::mix(g, h, b); // Returns g or h; + /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. + /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. + /// @endcode + template + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); + + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType step(genType edge, genType x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec step(T edge, vec const& x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec step(vec const& edge, vec const& x); + + /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and + /// performs smooth Hermite interpolation between 0 and 1 + /// when edge0 < x < edge1. This is useful in cases where + /// you would want a threshold function with a smooth + /// transition. This is equivalent to: + /// genType t; + /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); + /// return t * t * (3 - 2 * t); + /// Results are undefined if edge0 >= edge1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL smoothstep man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); + + template + GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x); + + template + GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x); + + /// Returns true if x holds a NaN (not a number) + /// representation in the underlying implementation's set of + /// floating point representations. Returns false otherwise, + /// including for implementations with no NaN + /// representations. + /// + /// /!\ When using compiler fast math, this function may fail. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL isnan man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec isnan(vec const& x); + + /// Returns true if x holds a positive infinity or negative + /// infinity representation in the underlying implementation's + /// set of floating point representations. Returns false + /// otherwise, including for implementations with no infinity + /// representations. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL isinf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec isinf(vec const& x); + + /// Returns a signed integer value representing + /// the encoding of a floating-point value. The floating-point + /// value's bit-level representation is preserved. + /// + /// @see GLSL floatBitsToInt man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL int floatBitsToInt(float const& v); + + /// Returns a signed integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floatBitsToInt man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floatBitsToInt(vec const& v); + + /// Returns a unsigned integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @see GLSL floatBitsToUint man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL uint floatBitsToUint(float const& v); + + /// Returns a unsigned integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floatBitsToUint man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floatBitsToUint(vec const& v); + + /// Returns a floating-point value corresponding to a signed + /// integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @see GLSL intBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL float intBitsToFloat(int const& v); + + /// Returns a floating-point value corresponding to a signed + /// integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL intBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec intBitsToFloat(vec const& v); + + /// Returns a floating-point value corresponding to a + /// unsigned integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @see GLSL uintBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL float uintBitsToFloat(uint const& v); + + /// Returns a floating-point value corresponding to a + /// unsigned integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL uintBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec uintBitsToFloat(vec const& v); + + /// Computes and returns a * b + c. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fma man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c); + + /// Splits x into a floating-point significand in the range + /// [0.5, 1.0) and an integral exponent of two, such that: + /// x = significand * exp(2, exponent) + /// + /// The significand is returned by the function and the + /// exponent is returned in the parameter exp. For a + /// floating-point value of zero, the significant and exponent + /// are both zero. For a floating-point value that is an + /// infinity or is not a number, the results are undefined. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL frexp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType frexp(genType x, int& exp); + + template + GLM_FUNC_DECL vec frexp(vec const& v, vec& exp); + + /// Builds a floating-point number from x and the + /// corresponding integral exponent of two in exp, returning: + /// significand * exp(2, exponent) + /// + /// If this product is too large to be represented in the + /// floating-point type, the result is undefined. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL ldexp man page; + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp); + + template + GLM_FUNC_DECL vec ldexp(vec const& v, vec const& exp); + + /// @} +}//namespace glm + +#include "detail/func_common.inl" + diff --git a/include/glm/glm/detail/_features.hpp b/include/glm/glm/detail/_features.hpp new file mode 100644 index 00000000..b0cbe9ff --- /dev/null +++ b/include/glm/glm/detail/_features.hpp @@ -0,0 +1,394 @@ +#pragma once + +// #define GLM_CXX98_EXCEPTIONS +// #define GLM_CXX98_RTTI + +// #define GLM_CXX11_RVALUE_REFERENCES +// Rvalue references - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html + +// GLM_CXX11_TRAILING_RETURN +// Rvalue references for *this - GCC not supported +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Initialization of class objects by rvalues - GCC any +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Non-static data member initializers - GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm + +// #define GLM_CXX11_VARIADIC_TEMPLATE +// Variadic templates - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf + +// +// Extending variadic template template parameters - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf + +// #define GLM_CXX11_GENERALIZED_INITIALIZERS +// Initializer lists - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + +// #define GLM_CXX11_STATIC_ASSERT +// Static assertions - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + +// #define GLM_CXX11_AUTO_TYPE +// auto-typed variables - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Multi-declarator auto - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Removal of auto as a storage-class specifier - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm + +// #define GLM_CXX11_AUTO_TYPE +// New function declarator syntax - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm + +// #define GLM_CXX11_LAMBDAS +// New wording for C++0x lambdas - GCC 4.5 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf + +// #define GLM_CXX11_DECLTYPE +// Declared type of an expression - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf + +// +// Right angle brackets - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html + +// +// Default template arguments for function templates DR226 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 + +// +// Solving the SFINAE problem for expressions DR339 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html + +// #define GLM_CXX11_ALIAS_TEMPLATE +// Template aliases N2258 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf + +// +// Extern templates N1987 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm + +// #define GLM_CXX11_NULLPTR +// Null pointer constant N2431 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + +// #define GLM_CXX11_STRONG_ENUMS +// Strongly-typed enums N2347 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + +// +// Forward declarations for enums N2764 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf + +// +// Generalized attributes N2761 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf + +// +// Generalized constant expressions N2235 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + +// +// Alignment support N2341 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf + +// #define GLM_CXX11_DELEGATING_CONSTRUCTORS +// Delegating constructors N1986 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf + +// +// Inheriting constructors N2540 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm + +// #define GLM_CXX11_EXPLICIT_CONVERSIONS +// Explicit conversion operators N2437 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf + +// +// New character types N2249 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html + +// +// Unicode string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Raw string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Universal character name literals N2170 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html + +// #define GLM_CXX11_USER_LITERALS +// User-defined literals N2765 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf + +// +// Standard Layout Types N2342 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm + +// #define GLM_CXX11_DEFAULTED_FUNCTIONS +// #define GLM_CXX11_DELETED_FUNCTIONS +// Defaulted and deleted functions N2346 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm + +// +// Extended friend declarations N1791 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf + +// +// Extending sizeof N2253 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html + +// #define GLM_CXX11_INLINE_NAMESPACES +// Inline namespaces N2535 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm + +// #define GLM_CXX11_UNRESTRICTED_UNIONS +// Unrestricted unions N2544 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + +// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +// Local and unnamed types as template arguments N2657 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm + +// #define GLM_CXX11_RANGE_FOR +// Range-based for N2930 GCC 4.6 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html + +// #define GLM_CXX11_OVERRIDE_CONTROL +// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm + +// +// Minimal support for garbage collection and reachability-based leak detection N2670 No +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm + +// #define GLM_CXX11_NOEXCEPT +// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html + +// +// Defining move special member functions N3053 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html + +// +// Sequence points N2239 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Atomic operations N2427 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Strong Compare and Exchange N2748 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html + +// +// Bidirectional Fences N2752 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm + +// +// Memory model N2429 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm + +// +// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm + +// +// Propagating exceptions N2179 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html + +// +// Abandoning a process and at_quick_exit N2440 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm + +// +// Allow atomics use in signal handlers N2547 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm + +// +// Thread-local storage N2659 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm + +// +// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm + +// +// __func__ predefined identifier N2340 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm + +// +// C99 preprocessor N1653 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm + +// +// long long N1811 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf + +// +// Extended integral types N1988 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf + +#if(GLM_COMPILER & GLM_COMPILER_GCC) + +# define GLM_CXX11_STATIC_ASSERT + +#elif(GLM_COMPILER & GLM_COMPILER_CLANG) +# if(__has_feature(cxx_exceptions)) +# define GLM_CXX98_EXCEPTIONS +# endif + +# if(__has_feature(cxx_rtti)) +# define GLM_CXX98_RTTI +# endif + +# if(__has_feature(cxx_access_control_sfinae)) +# define GLM_CXX11_ACCESS_CONTROL_SFINAE +# endif + +# if(__has_feature(cxx_alias_templates)) +# define GLM_CXX11_ALIAS_TEMPLATE +# endif + +# if(__has_feature(cxx_alignas)) +# define GLM_CXX11_ALIGNAS +# endif + +# if(__has_feature(cxx_attributes)) +# define GLM_CXX11_ATTRIBUTES +# endif + +# if(__has_feature(cxx_constexpr)) +# define GLM_CXX11_CONSTEXPR +# endif + +# if(__has_feature(cxx_decltype)) +# define GLM_CXX11_DECLTYPE +# endif + +# if(__has_feature(cxx_default_function_template_args)) +# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_defaulted_functions)) +# define GLM_CXX11_DEFAULTED_FUNCTIONS +# endif + +# if(__has_feature(cxx_delegating_constructors)) +# define GLM_CXX11_DELEGATING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_deleted_functions)) +# define GLM_CXX11_DELETED_FUNCTIONS +# endif + +# if(__has_feature(cxx_explicit_conversions)) +# define GLM_CXX11_EXPLICIT_CONVERSIONS +# endif + +# if(__has_feature(cxx_generalized_initializers)) +# define GLM_CXX11_GENERALIZED_INITIALIZERS +# endif + +# if(__has_feature(cxx_implicit_moves)) +# define GLM_CXX11_IMPLICIT_MOVES +# endif + +# if(__has_feature(cxx_inheriting_constructors)) +# define GLM_CXX11_INHERITING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_inline_namespaces)) +# define GLM_CXX11_INLINE_NAMESPACES +# endif + +# if(__has_feature(cxx_lambdas)) +# define GLM_CXX11_LAMBDAS +# endif + +# if(__has_feature(cxx_local_type_template_args)) +# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_noexcept)) +# define GLM_CXX11_NOEXCEPT +# endif + +# if(__has_feature(cxx_nonstatic_member_init)) +# define GLM_CXX11_NONSTATIC_MEMBER_INIT +# endif + +# if(__has_feature(cxx_nullptr)) +# define GLM_CXX11_NULLPTR +# endif + +# if(__has_feature(cxx_override_control)) +# define GLM_CXX11_OVERRIDE_CONTROL +# endif + +# if(__has_feature(cxx_reference_qualified_functions)) +# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS +# endif + +# if(__has_feature(cxx_range_for)) +# define GLM_CXX11_RANGE_FOR +# endif + +# if(__has_feature(cxx_raw_string_literals)) +# define GLM_CXX11_RAW_STRING_LITERALS +# endif + +# if(__has_feature(cxx_rvalue_references)) +# define GLM_CXX11_RVALUE_REFERENCES +# endif + +# if(__has_feature(cxx_static_assert)) +# define GLM_CXX11_STATIC_ASSERT +# endif + +# if(__has_feature(cxx_auto_type)) +# define GLM_CXX11_AUTO_TYPE +# endif + +# if(__has_feature(cxx_strong_enums)) +# define GLM_CXX11_STRONG_ENUMS +# endif + +# if(__has_feature(cxx_trailing_return)) +# define GLM_CXX11_TRAILING_RETURN +# endif + +# if(__has_feature(cxx_unicode_literals)) +# define GLM_CXX11_UNICODE_LITERALS +# endif + +# if(__has_feature(cxx_unrestricted_unions)) +# define GLM_CXX11_UNRESTRICTED_UNIONS +# endif + +# if(__has_feature(cxx_user_literals)) +# define GLM_CXX11_USER_LITERALS +# endif + +# if(__has_feature(cxx_variadic_templates)) +# define GLM_CXX11_VARIADIC_TEMPLATES +# endif + +#endif//(GLM_COMPILER & GLM_COMPILER_CLANG) diff --git a/include/glm/glm/detail/_fixes.hpp b/include/glm/glm/detail/_fixes.hpp new file mode 100644 index 00000000..a503c7c0 --- /dev/null +++ b/include/glm/glm/detail/_fixes.hpp @@ -0,0 +1,27 @@ +#include + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif + +//! Workaround for Android +#ifdef isnan +#undef isnan +#endif + +//! Workaround for Android +#ifdef isinf +#undef isinf +#endif + +//! Workaround for Chrone Native Client +#ifdef log2 +#undef log2 +#endif + diff --git a/include/glm/glm/detail/_noise.hpp b/include/glm/glm/detail/_noise.hpp new file mode 100644 index 00000000..5a874a02 --- /dev/null +++ b/include/glm/glm/detail/_noise.hpp @@ -0,0 +1,81 @@ +#pragma once + +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mod289(T const& x) + { + return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0); + } + + template + GLM_FUNC_QUALIFIER T permute(T const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } +}//namespace detail +}//namespace glm + diff --git a/include/glm/glm/detail/_swizzle.hpp b/include/glm/glm/detail/_swizzle.hpp new file mode 100644 index 00000000..87896ef4 --- /dev/null +++ b/include/glm/glm/detail/_swizzle.hpp @@ -0,0 +1,804 @@ +#pragma once + +namespace glm{ +namespace detail +{ + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + protected: + GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } + }; + + template + struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template + struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + T = type of scalar values (e.g. float, double) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template + struct _swizzle_base2 : public _swizzle_base1::value> + { + struct op_equal + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; } + }; + + struct op_minus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; } + }; + + struct op_plus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; } + }; + + struct op_mul + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; } + }; + + struct op_div + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; } + }; + + public: + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) + { + for (int i = 0; i < N; ++i) + (*this)[i] = t; + return *this; + } + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) + { + _apply_op(that, op_equal()); + return *this; + } + + GLM_FUNC_QUALIFIER void operator -= (vec const& that) + { + _apply_op(that, op_minus()); + } + + GLM_FUNC_QUALIFIER void operator += (vec const& that) + { + _apply_op(that, op_plus()); + } + + GLM_FUNC_QUALIFIER void operator *= (vec const& that) + { + _apply_op(that, op_mul()); + } + + GLM_FUNC_QUALIFIER void operator /= (vec const& that) + { + _apply_op(that, op_div()); + } + + GLM_FUNC_QUALIFIER T& operator[](size_t i) + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + GLM_FUNC_QUALIFIER T operator[](size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + + protected: + template + GLM_FUNC_QUALIFIER void _apply_op(vec const& that, const U& op) + { + // Make a copy of the data in this == &that. + // The copier should optimize out the copy in cases where the function is + // properly inlined and the copy is not necessary. + T t[N]; + for (int i = 0; i < N; ++i) + t[i] = that[i]; + for (int i = 0; i < N; ++i) + op( (*this)[i], t[i] ); + } + }; + + // Specialization for swizzles containing duplicate elements. These cannot be modified. + template + struct _swizzle_base2 : public _swizzle_base1::value> + { + struct Stub {}; + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; } + + GLM_FUNC_QUALIFIER T operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + }; + + template + struct _swizzle : public _swizzle_base2 + { + typedef _swizzle_base2 base_type; + + using base_type::operator=; + + GLM_FUNC_QUALIFIER operator vec () const { return (*this)(); } + }; + +// +// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros +// +#define GLM_SWIZZLE_TEMPLATE1 template +#define GLM_SWIZZLE_TEMPLATE2 template +#define GLM_SWIZZLE_TYPE1 _swizzle +#define GLM_SWIZZLE_TYPE2 _swizzle + +// +// Wrapper for a binary operator (e.g. u.yy + v.zy) +// +#define GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ + { \ + return a() OPERAND b(); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const vec& b) \ + { \ + return a() OPERAND b; \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const vec& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) +// +#define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Macro for wrapping a function taking one argument (e.g. abs()) +// +#define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ + } + +// +// Macro for wrapping a function taking two vector arguments (e.g. dot()). +// +#define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + { \ + return FUNCTION(a(), b); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a, b()); \ + } + +// +// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). +// +#define GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + { \ + return FUNCTION(a(), b, c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a, b(), c); \ + } + +}//namespace detail +}//namespace glm + +namespace glm +{ + namespace detail + { + GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) + GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) + } + + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); +} + +#define GLM_SWIZZLE2_2_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; }; + +#define GLM_SWIZZLE2_3_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; + +#define GLM_SWIZZLE2_4_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + +#define GLM_SWIZZLE3_2_MEMBERS(T, Q, E0,E1,E2) \ + struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; + +#define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ + struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; + +#define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ + struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + +#define GLM_SWIZZLE4_2_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; + +#define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; + +#define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/include/glm/glm/detail/_swizzle_func.hpp b/include/glm/glm/detail/_swizzle_func.hpp new file mode 100644 index 00000000..d93c6afd --- /dev/null +++ b/include/glm/glm/detail/_swizzle_func.hpp @@ -0,0 +1,682 @@ +#pragma once + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ + vec<2, T, Q> A ## B() CONST \ + { \ + return vec<2, T, Q>(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ + vec<3, T, Q> A ## B ## C() CONST \ + { \ + return vec<3, T, Q>(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ + vec<4, T, Q> A ## B ## C ## D() CONST \ + { \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ + } + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ + template \ + vec vec::A ## B() CONST \ + { \ + return vec<2, T, Q>(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ + template \ + vec<3, T, Q> vec::A ## B ## C() CONST \ + { \ + return vec<3, T, Q>(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ + template \ + vec<4, T, Q> vec::A ## B ## C ## D() CONST \ + { \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ + } + +#define GLM_MUTABLE + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(T, P) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, x, y) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, r, g) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, s, t) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(T, P) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, x, y, z) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, r, g, b) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, s, t, p) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, C) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, B) + +#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, C, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, x, y, z, w) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, r, g, b, a) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, s, t, p, q) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, x, y) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, r, g) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, s, t) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, x, y, z) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, r, g, b) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, s, t, p) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, D) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, x, y, z, w) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, r, g, b, a) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, s, t, p, q) + diff --git a/include/glm/glm/detail/_vectorize.hpp b/include/glm/glm/detail/_vectorize.hpp new file mode 100644 index 00000000..1fcaec31 --- /dev/null +++ b/include/glm/glm/detail/_vectorize.hpp @@ -0,0 +1,162 @@ +#pragma once + +namespace glm{ +namespace detail +{ + template class vec, length_t L, typename R, typename T, qualifier Q> + struct functor1{}; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) + { + return vec<1, R, Q>(Func(v.x)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) + { + return vec<2, R, Q>(Func(v.x), Func(v.y)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) + { + return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) + { + return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + } + }; + + template class vec, length_t L, typename T, qualifier Q> + struct functor2{}; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) + { + return vec<1, T, Q>(Func(a.x, b.x)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) + { + return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; + + template class vec, length_t L, typename T, qualifier Q> + struct functor2_vec_sca{}; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) + { + return vec<1, T, Q>(Func(a.x, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) + { + return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) + { + return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) + { + return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; + + template + struct functor2_vec_int {}; + + template + struct functor2_vec_int<1, T, Q> + { + GLM_FUNC_QUALIFIER static vec<1, int, Q> call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, Q> const& b) + { + return vec<1, int, Q>(Func(a.x, b.x)); + } + }; + + template + struct functor2_vec_int<2, T, Q> + { + GLM_FUNC_QUALIFIER static vec<2, int, Q> call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, Q> const& b) + { + return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2_vec_int<3, T, Q> + { + GLM_FUNC_QUALIFIER static vec<3, int, Q> call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, Q> const& b) + { + return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2_vec_int<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, Q> const& b) + { + return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/compute_common.hpp b/include/glm/glm/detail/compute_common.hpp new file mode 100644 index 00000000..cc24b9e6 --- /dev/null +++ b/include/glm/glm/detail/compute_common.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "setup.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_abs + {}; + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, + "'abs' only accept floating-point and integer scalar or vector inputs"); + + return x >= genFIType(0) ? x : -x; + // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; + } + }; + +#if GLM_COMPILER & GLM_COMPILER_CUDA + template<> + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) + { + return fabsf(x); + } + }; +#endif + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + (!std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'abs' only accept floating-point and integer scalar or vector inputs"); + return x; + } + }; +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/compute_vector_relational.hpp b/include/glm/glm/detail/compute_vector_relational.hpp new file mode 100644 index 00000000..167b6345 --- /dev/null +++ b/include/glm/glm/detail/compute_vector_relational.hpp @@ -0,0 +1,30 @@ +#pragma once + +//#include "compute_common.hpp" +#include "setup.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) + { + return a == b; + } + }; +/* + template + struct compute_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) + { + return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); + //return std::memcmp(&a, &b, sizeof(T)) == 0; + } + }; +*/ +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/func_common.inl b/include/glm/glm/detail/func_common.inl new file mode 100644 index 00000000..4b5f1441 --- /dev/null +++ b/include/glm/glm/detail/func_common.inl @@ -0,0 +1,792 @@ +/// @ref core +/// @file glm/detail/func_common.inl + +#include "../vector_relational.hpp" +#include "compute_common.hpp" +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include "_vectorize.hpp" +#include + +namespace glm +{ + // min + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return (y < x) ? y : x; + } + + // max + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + + return (x < y) ? y : x; + } + + // abs + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR int abs(int x) + { + int const y = x >> (sizeof(int) * 8 - 1); + return (x ^ y) - y; + } + + // round +# if GLM_HAS_CXX11_STL + using ::std::round; +# else + template + GLM_FUNC_QUALIFIER genType round(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + + return x < static_cast(0) ? static_cast(int(x - static_cast(0.5))) : static_cast(int(x + static_cast(0.5))); + } +# endif + + // trunc +# if GLM_HAS_CXX11_STL + using ::std::trunc; +# else + template + GLM_FUNC_QUALIFIER genType trunc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + + return x < static_cast(0) ? -std::floor(-x) : std::floor(x); + } +# endif + +}//namespace glm + +namespace glm{ +namespace detail +{ + template + struct compute_abs_vector + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) + { + return detail::functor1::call(abs, x); + } + }; + + template + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); + } + }; + + template + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + { + vec Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = a[i] ? y[i] : x[i]; + return Result; + } + }; + + template + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); + } + }; + + template + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) + { + return a ? y : x; + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return static_cast(static_cast(x) * (static_cast(1) - a) + static_cast(y) * a); + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, bool const& a) + { + return a ? y : x; + } + }; + + template + struct compute_sign + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); + } + }; + +# if GLM_ARCH == GLM_ARCH_X86 + template + struct compute_sign + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + T const Shift(static_cast(sizeof(T) * 8 - 1)); + vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift)); + + return (x >> Shift) | y; + } + }; +# endif + + template + struct compute_floor + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::floor, x); + } + }; + + template + struct compute_ceil + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::ceil, x); + } + }; + + template + struct compute_fract + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return x - floor(x); + } + }; + + template + struct compute_trunc + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(trunc, x); + } + }; + + template + struct compute_round + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(round, x); + } + }; + + template + struct compute_mod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); + return a - b * floor(a / b); + } + }; + + template + struct compute_min_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + { + return detail::functor2::call(min, x, y); + } + }; + + template + struct compute_max_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + { + return detail::functor2::call(max, x, y); + } + }; + + template + struct compute_clamp_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& minVal, vec const& maxVal) + { + return min(max(x, minVal), maxVal); + } + }; + + template + struct compute_step_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& edge, vec const& x) + { + return mix(vec(1), vec(0), glm::lessThan(x, edge)); + } + }; + + template + struct compute_smoothstep_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); + return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType abs(genFIType x) + { + return detail::compute_abs::is_signed>::call(x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec abs(vec const& x) + { + return detail::compute_abs_vector::value>::call(x); + } + + // sign + // fast and works for any type + template + GLM_FUNC_QUALIFIER genFIType sign(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign<1, genFIType, defaultp, + std::numeric_limits::is_iec559, detail::is_aligned::value>::call(vec<1, genFIType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec sign(vec const& x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign::is_iec559, detail::is_aligned::value>::call(x); + } + + // floor + using ::std::floor; + template + GLM_FUNC_QUALIFIER vec floor(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); + return detail::compute_floor::value>::call(x); + } + + template + GLM_FUNC_QUALIFIER vec trunc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + return detail::compute_trunc::value>::call(x); + } + + template + GLM_FUNC_QUALIFIER vec round(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + return detail::compute_round::value>::call(x); + } + +/* + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + + return genType(int(x + genType(int(x) % 2))); + } +*/ + + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + + int Integer = static_cast(x); + genType IntegerPart = static_cast(Integer); + genType FractionalPart = fract(x); + + if(FractionalPart > static_cast(0.5) || FractionalPart < static_cast(0.5)) + { + return round(x); + } + else if((Integer % 2) == 0) + { + return IntegerPart; + } + else if(x <= static_cast(0)) // Work around... + { + return IntegerPart - static_cast(1); + } + else + { + return IntegerPart + static_cast(1); + } + //else // Bug on MinGW 4.5.2 + //{ + // return mix(IntegerPart + genType(-1), IntegerPart + genType(1), x <= genType(0)); + //} + } + + template + GLM_FUNC_QUALIFIER vec roundEven(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + return detail::functor1::call(roundEven, x); + } + + // ceil + using ::std::ceil; + template + GLM_FUNC_QUALIFIER vec ceil(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); + return detail::compute_ceil::value>::call(x); + } + + // fract + template + GLM_FUNC_QUALIFIER genType fract(genType x) + { + return fract(vec<1, genType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec fract(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); + return detail::compute_fract::value>::call(x); + } + + // mod + template + GLM_FUNC_QUALIFIER genType mod(genType x, genType y) + { +# if GLM_COMPILER & GLM_COMPILER_CUDA + // Another Cuda compiler bug https://github.com/g-truc/glm/issues/530 + vec<1, genType, defaultp> Result(mod(vec<1, genType, defaultp>(x), y)); + return Result.x; +# else + return mod(vec<1, genType, defaultp>(x), y).x; +# endif + } + + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, T y) + { + return detail::compute_mod::value>::call(x, vec(y)); + } + + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, vec const& y) + { + return detail::compute_mod::value>::call(x, y); + } + + // modf + template + GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'modf' only accept floating-point inputs"); + return std::modf(x, &i); + } + + template + GLM_FUNC_QUALIFIER vec<1, T, Q> modf(vec<1, T, Q> const& x, vec<1, T, Q> & i) + { + return vec<1, T, Q>( + modf(x.x, i.x)); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> modf(vec<2, T, Q> const& x, vec<2, T, Q> & i) + { + return vec<2, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> modf(vec<3, T, Q> const& x, vec<3, T, Q> & i) + { + return vec<3, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> modf(vec<4, T, Q> const& x, vec<4, T, Q> & i) + { + return vec<4, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z), + modf(x.w, i.w)); + } + + //// Only valid if (INT_MIN <= x-y <= INT_MAX) + //// min(x,y) + //r = y + ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT - 1))); + //// max(x,y) + //r = x - ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT - 1))); + + // min + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return detail::compute_min_vector::value>::call(a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, vec const& b) + { + return detail::compute_min_vector::value>::call(a, b); + } + + // max + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return detail::compute_max_vector::value>::call(a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, vec const& b) + { + return detail::compute_max_vector::value>::call(a, b); + } + + // clamp + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return min(max(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); + } + + template + GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) + { + return detail::compute_mix::call(x, y, a); + } + + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) + { + return detail::compute_mix_scalar::value>::call(x, y, a); + } + + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) + { + return detail::compute_mix_vector::value>::call(x, y, a); + } + + // step + template + GLM_FUNC_QUALIFIER genType step(genType edge, genType x) + { + return mix(static_cast(1), static_cast(0), x < edge); + } + + template + GLM_FUNC_QUALIFIER vec step(T edge, vec const& x) + { + return detail::compute_step_vector::value>::call(vec(edge), x); + } + + template + GLM_FUNC_QUALIFIER vec step(vec const& edge, vec const& x) + { + return detail::compute_step_vector::value>::call(edge, x); + } + + // smoothstep + template + GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + + genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); + return tmp * tmp * (genType(3) - genType(2) * tmp); + } + + template + GLM_FUNC_QUALIFIER vec smoothstep(T edge0, T edge1, vec const& x) + { + return detail::compute_smoothstep_vector::value>::call(vec(edge0), vec(edge1), x); + } + + template + GLM_FUNC_QUALIFIER vec smoothstep(vec const& edge0, vec const& edge1, vec const& x) + { + return detail::compute_smoothstep_vector::value>::call(edge0, edge1, x); + } + +# if GLM_HAS_CXX11_STL + using std::isnan; +# else + template + GLM_FUNC_QUALIFIER bool isnan(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::isnan(x); +# elif GLM_COMPILER & GLM_COMPILER_VC + return _isnan(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS + return _isnan(x) != 0; +# else + return ::isnan(x) != 0; +# endif +# elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L + return _isnan(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_CUDA + return ::isnan(x) != 0; +# else + return std::isnan(x); +# endif + } +# endif + + template + GLM_FUNC_QUALIFIER vec isnan(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = glm::isnan(v[l]); + return Result; + } + +# if GLM_HAS_CXX11_STL + using std::isinf; +# else + template + GLM_FUNC_QUALIFIER bool isinf(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::isinf(x); +# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) +# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# else + return ::isinf(x); +# endif +# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) + return _isinf(x) != 0; +# else + return std::isinf(x); +# endif +# elif GLM_COMPILER & GLM_COMPILER_CUDA + // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab + return ::isinf(double(x)) != 0; +# else + return std::isinf(x); +# endif + } +# endif + + template + GLM_FUNC_QUALIFIER vec isinf(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = glm::isinf(v[l]); + return Result; + } + + GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v) + { + union + { + float in; + int out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v) + { + union + { + float in; + uint out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v) + { + union + { + int in; + float out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v) + { + union + { + uint in; + float out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec uintBitsToFloat(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + +# if GLM_HAS_CXX11_STL + using std::fma; +# else + template + GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) + { + return a * b + c; + } +# endif + + template + GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); + + return std::frexp(x, &exp); + } + + template + GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = std::frexp(v[l], &exp[l]); + return Result; + } + + template + GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); + + return std::ldexp(x, exp); + } + + template + GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = std::ldexp(v[l], exp[l]); + return Result; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_common_simd.inl" +#endif diff --git a/include/glm/glm/detail/func_common_simd.inl b/include/glm/glm/detail/func_common_simd.inl new file mode 100644 index 00000000..ce0032d3 --- /dev/null +++ b/include/glm/glm/detail/func_common_simd.inl @@ -0,0 +1,231 @@ +/// @ref core +/// @file glm/detail/func_common_simd.inl + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#include "../simd/common.h" + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_abs_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_abs(v.data); + return result; + } + }; + + template + struct compute_abs_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) + { + vec<4, int, Q> result; + result.data = glm_ivec4_abs(v.data); + return result; + } + }; + + template + struct compute_floor<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_floor(v.data); + return result; + } + }; + + template + struct compute_ceil<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_ceil(v.data); + return result; + } + }; + + template + struct compute_fract<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_fract(v.data); + return result; + } + }; + + template + struct compute_round<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_round(v.data); + return result; + } + }; + + template + struct compute_mod<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { + vec<4, float, Q> result; + result.data = glm_vec4_mod(x.data, y.data); + return result; + } + }; + + template + struct compute_min_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + vec<4, float, Q> result; + result.data = _mm_min_ps(v1.data, v2.data); + return result; + } + }; + + template + struct compute_min_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + vec<4, int, Q> result; + result.data = _mm_min_epi32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_min_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + vec<4, uint, Q> result; + result.data = _mm_min_epu32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + vec<4, float, Q> result; + result.data = _mm_max_ps(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + vec<4, int, Q> result; + result.data = _mm_max_epi32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + vec<4, uint, Q> result; + result.data = _mm_max_epu32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal) + { + vec<4, float, Q> result; + result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal) + { + vec<4, int, Q> result; + result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal) + { + vec<4, uint, Q> result; + result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_mix_vector<4, float, bool, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a) + { + __m128i const Load = _mm_set_epi32(-static_cast(a.w), -static_cast(a.z), -static_cast(a.y), -static_cast(a.x)); + __m128 const Mask = _mm_castsi128_ps(Load); + + vec<4, float, Q> Result; +# if 0 && GLM_ARCH & GLM_ARCH_AVX + Result.data = _mm_blendv_ps(x.data, y.data, Mask); +# else + Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data)); +# endif + return Result; + } + }; +/* FIXME + template + struct compute_step_vector + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x) + { + vec<4, float, Q> Result; + result.data = glm_vec4_step(edge.data, x.data); + return result; + } + }; +*/ + template + struct compute_smoothstep_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/detail/func_exponential.inl b/include/glm/glm/detail/func_exponential.inl new file mode 100644 index 00000000..2040d41f --- /dev/null +++ b/include/glm/glm/detail/func_exponential.inl @@ -0,0 +1,152 @@ +/// @ref core +/// @file glm/detail/func_exponential.inl + +#include "../vector_relational.hpp" +#include "_vectorize.hpp" +#include +#include +#include + +namespace glm{ +namespace detail +{ +# if GLM_HAS_CXX11_STL + using std::log2; +# else + template + genType log2(genType Value) + { + return std::log(Value) * static_cast(1.4426950408889634073599246810019); + } +# endif + + template + struct compute_log2 + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'log2' only accept floating-point inputs. Include for integer inputs."); + + return detail::functor1::call(log2, v); + } + }; + + template + struct compute_sqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::sqrt, x); + } + }; + + template + struct compute_inversesqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return static_cast(1) / sqrt(x); + } + }; + + template + struct compute_inversesqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + vec tmp(x); + vec xhalf(tmp * 0.5f); + vec* p = reinterpret_cast*>(const_cast*>(&x)); + vec i = vec(0x5f375a86) - (*p >> vec(1)); + vec* ptmp = reinterpret_cast*>(&i); + tmp = *ptmp; + tmp = tmp * (1.5f - xhalf * tmp * tmp); + return tmp; + } + }; +}//namespace detail + + // pow + using std::pow; + template + GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) + { + return detail::functor2::call(pow, base, exponent); + } + + // exp + using std::exp; + template + GLM_FUNC_QUALIFIER vec exp(vec const& x) + { + return detail::functor1::call(exp, x); + } + + // log + using std::log; + template + GLM_FUNC_QUALIFIER vec log(vec const& x) + { + return detail::functor1::call(log, x); + } + +# if GLM_HAS_CXX11_STL + using std::exp2; +# else + //exp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType exp2(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'exp2' only accept floating-point inputs"); + + return std::exp(static_cast(0.69314718055994530941723212145818) * x); + } +# endif + + template + GLM_FUNC_QUALIFIER vec exp2(vec const& x) + { + return detail::functor1::call(exp2, x); + } + + // log2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType log2(genType x) + { + return log2(vec<1, genType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec log2(vec const& x) + { + return detail::compute_log2::is_iec559, detail::is_aligned::value>::call(x); + } + + // sqrt + using std::sqrt; + template + GLM_FUNC_QUALIFIER vec sqrt(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sqrt' only accept floating-point inputs"); + return detail::compute_sqrt::value>::call(x); + } + + // inversesqrt + template + GLM_FUNC_QUALIFIER genType inversesqrt(genType x) + { + return static_cast(1) / sqrt(x); + } + + template + GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'inversesqrt' only accept floating-point inputs"); + return detail::compute_inversesqrt::value>::call(x); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_exponential_simd.inl" +#endif + diff --git a/include/glm/glm/detail/func_exponential_simd.inl b/include/glm/glm/detail/func_exponential_simd.inl new file mode 100644 index 00000000..fb789517 --- /dev/null +++ b/include/glm/glm/detail/func_exponential_simd.inl @@ -0,0 +1,37 @@ +/// @ref core +/// @file glm/detail/func_exponential_simd.inl + +#include "../simd/exponential.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_sqrt<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> Result; + Result.data = _mm_sqrt_ps(v.data); + return Result; + } + }; + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + struct compute_sqrt<4, float, aligned_lowp, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v) + { + vec<4, float, aligned_lowp> Result; + Result.data = glm_vec4_sqrt_lowp(v.data); + return Result; + } + }; +# endif +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/detail/func_geometric.inl b/include/glm/glm/detail/func_geometric.inl new file mode 100644 index 00000000..9cde28fe --- /dev/null +++ b/include/glm/glm/detail/func_geometric.inl @@ -0,0 +1,243 @@ +#include "../exponential.hpp" +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_length + { + GLM_FUNC_QUALIFIER static T call(vec const& v) + { + return sqrt(dot(v, v)); + } + }; + + template + struct compute_distance + { + GLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1) + { + return length(p1 - p0); + } + }; + + template + struct compute_dot{}; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) + { + return a.x * b.x; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) + { + vec<2, T, Q> tmp(a * b); + return tmp.x + tmp.y; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + vec<3, T, Q> tmp(a * b); + return tmp.x + tmp.y + tmp.z; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> tmp(a * b); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + } + }; + + template + struct compute_cross + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + + return vec<3, T, Q>( + x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y); + } + }; + + template + struct compute_normalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return v * inversesqrt(dot(v, v)); + } + }; + + template + struct compute_faceforward + { + GLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return dot(Nref, I) < static_cast(0) ? N : -N; + } + }; + + template + struct compute_reflect + { + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N) + { + return I - N * dot(N, I) * static_cast(2); + } + }; + + template + struct compute_refract + { + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta) + { + T const dotValue(dot(N, I)); + T const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); + vec const Result = + (k >= static_cast(0)) ? (eta * I - (eta * dotValue + std::sqrt(k)) * N) : vec(0); + return Result; + } + }; +}//namespace detail + + // length + template + GLM_FUNC_QUALIFIER genType length(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); + + return abs(x); + } + + template + GLM_FUNC_QUALIFIER T length(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); + + return detail::compute_length::value>::call(v); + } + + // distance + template + GLM_FUNC_QUALIFIER genType distance(genType const& p0, genType const& p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance' accepts only floating-point inputs"); + + return length(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1) + { + return detail::compute_distance::value>::call(p0, p1); + } + + // dot + template + GLM_FUNC_QUALIFIER T dot(T x, T y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return x * y; + } + + template + GLM_FUNC_QUALIFIER T dot(vec const& x, vec const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); + } + + // cross + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + return detail::compute_cross::value>::call(x, y); + } +/* + // normalize + template + GLM_FUNC_QUALIFIER genType normalize(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return x < genType(0) ? genType(-1) : genType(1); + } +*/ + template + GLM_FUNC_QUALIFIER vec normalize(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return detail::compute_normalize::value>::call(x); + } + + // faceforward + template + GLM_FUNC_QUALIFIER genType faceforward(genType const& N, genType const& I, genType const& Nref) + { + return dot(Nref, I) < static_cast(0) ? N : -N; + } + + template + GLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref) + { + return detail::compute_faceforward::value>::call(N, I, Nref); + } + + // reflect + template + GLM_FUNC_QUALIFIER genType reflect(genType const& I, genType const& N) + { + return I - N * dot(N, I) * genType(2); + } + + template + GLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N) + { + return detail::compute_reflect::value>::call(I, N); + } + + // refract + template + GLM_FUNC_QUALIFIER genType refract(genType const& I, genType const& N, genType eta) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); + genType const dotValue(dot(N, I)); + genType const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); + return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast(k >= static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); + return detail::compute_refract::value>::call(I, N, eta); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_geometric_simd.inl" +#endif diff --git a/include/glm/glm/detail/func_geometric_simd.inl b/include/glm/glm/detail/func_geometric_simd.inl new file mode 100644 index 00000000..2076dae0 --- /dev/null +++ b/include/glm/glm/detail/func_geometric_simd.inl @@ -0,0 +1,163 @@ +/// @ref core +/// @file glm/detail/func_geometric_simd.inl + +#include "../simd/geometric.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_length<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) + { + return _mm_cvtss_f32(glm_vec4_length(v.data)); + } + }; + + template + struct compute_distance<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) + { + return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data)); + } + }; + + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { + return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); + } + }; + + template + struct compute_cross + { + GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) + { + __m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x); + __m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x); + __m128 const xpd0 = glm_vec4_cross(set0, set1); + + vec<4, float, Q> Result; + Result.data = xpd0; + return vec<3, float, Q>(Result); + } + }; + + template + struct compute_normalize<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_normalize(v.data); + return Result; + } + }; + + template + struct compute_faceforward<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data); + return Result; + } + }; + + template + struct compute_reflect<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_reflect(I.data, N.data); + return Result; + } + }; + + template + struct compute_refract<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N, float eta) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta)); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm{ +namespace detail +{ + template + struct compute_length<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) + { + return sqrt(compute_dot, float, true>::call(v, v)); + } + }; + + template + struct compute_distance<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) + { + return compute_length<4, float, Q, true>::call(p1 - p0); + } + }; + + + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + float32x4_t v = vmulq_f32(x.data, y.data); + return vaddvq_f32(v); +#else // Armv7a with Neon + float32x4_t p = vmulq_f32(x.data, y.data); + float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + v = vpadd_f32(v, v); + return vget_lane_f32(v, 0); +#endif + } + }; + + template + struct compute_normalize<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + float32x4_t p = vmulq_f32(v.data, v.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + p = vpaddq_f32(p, p); + p = vpaddq_f32(p, p); +#else + float32x2_t t = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + t = vpadd_f32(t, t); + p = vcombine_f32(t, t); +#endif + + float32x4_t vd = vrsqrteq_f32(p); + vec<4, float, Q> Result; + Result.data = vmulq_f32(v.data, vd); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/detail/func_integer.inl b/include/glm/glm/detail/func_integer.inl new file mode 100644 index 00000000..091e1e0c --- /dev/null +++ b/include/glm/glm/detail/func_integer.inl @@ -0,0 +1,372 @@ +/// @ref core + +#include "_vectorize.hpp" +#if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) +# include +# pragma intrinsic(_BitScanReverse) +#endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) +#include + +#if !GLM_HAS_EXTENDED_INTEGER_TYPE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic ignored "-Wc++11-long-long" +# endif +#endif + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mask(T Bits) + { + return Bits >= static_cast(sizeof(T) * 8) ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); + } + + template + struct compute_bitfieldReverseStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + { + return v; + } + }; + + template + struct compute_bitfieldReverseStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + { + return (v & Mask) << Shift | (v & (~Mask)) >> Shift; + } + }; + + template + struct compute_bitfieldBitCountStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + { + return v; + } + }; + + template + struct compute_bitfieldBitCountStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + { + return (v & Mask) + ((v >> Shift) & Mask); + } + }; + + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + if(Value == 0) + return -1; + + return glm::bitCount(~Value & (Value - static_cast(1))); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; + +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; +# endif +# endif//GLM_HAS_BITSCAN_WINDOWS + + template + struct compute_findMSB_step_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, T Shift) + { + return x | (x >> Shift); + } + }; + + template + struct compute_findMSB_step_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, T) + { + return x; + } + }; + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + vec x(v); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 1)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 2)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 4)); + x = compute_findMSB_step_vec= 16>::call(x, static_cast( 8)); + x = compute_findMSB_step_vec= 32>::call(x, static_cast(16)); + x = compute_findMSB_step_vec= 64>::call(x, static_cast(32)); + return vec(sizeof(T) * 8 - 1) - glm::bitCount(~x); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(compute_findMSB_32, x); + } + }; + +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) + template + GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(compute_findMSB_64, x); + } + }; +# endif +# endif//GLM_HAS_BITSCAN_WINDOWS +}//namespace detail + + // uaddCarry + GLM_FUNC_QUALIFIER uint uaddCarry(uint const& x, uint const& y, uint & Carry) + { + detail::uint64 const Value64(static_cast(x) + static_cast(y)); + detail::uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = Value64 > Max32 ? 1u : 0u; + return static_cast(Value64 % (Max32 + static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) + { + vec Value64(vec(x) + vec(y)); + vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); + return vec(Value64 % (Max32 + static_cast(1))); + } + + // usubBorrow + GLM_FUNC_QUALIFIER uint usubBorrow(uint const& x, uint const& y, uint & Borrow) + { + Borrow = x >= y ? static_cast(0) : static_cast(1); + if(y >= x) + return y - x; + else + return static_cast((static_cast(1) << static_cast(32)) + (static_cast(y) - static_cast(x))); + } + + template + GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) + { + Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); + vec const YgeX(y - x); + vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); + return mix(XgeY, YgeX, greaterThanEqual(y, x)); + } + + // umulExtended + GLM_FUNC_QUALIFIER void umulExtended(uint const& x, uint const& y, uint & msb, uint & lsb) + { + detail::uint64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); + } + + template + GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + { + vec Value64(vec(x) * vec(y)); + msb = vec(Value64 >> static_cast(32)); + lsb = vec(Value64); + } + + // imulExtended + GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int& msb, int& lsb) + { + detail::int64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); + } + + template + GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + { + vec Value64(vec(x) * vec(y)); + lsb = vec(Value64 & static_cast(0xFFFFFFFF)); + msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); + } + + // bitfieldExtract + template + GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits) + { + return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldExtract(vec const& Value, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldExtract' only accept integer inputs"); + + return (Value >> static_cast(Offset)) & static_cast(detail::mask(Bits)); + } + + // bitfieldInsert + template + GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); + + return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldInsert(vec const& Base, vec const& Insert, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); + + T const Mask = static_cast(detail::mask(Bits) << Offset); + return (Base & ~Mask) | ((Insert << static_cast(Offset)) & Mask); + } + + // bitfieldReverse + template + GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + return bitfieldReverse(glm::vec<1, genIUType, glm::defaultp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + vec x(v); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); + return x; + } + + // bitCount + template + GLM_FUNC_QUALIFIER int bitCount(genIUType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + + return bitCount(glm::vec<1, genIUType, glm::defaultp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec bitCount(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4310) //cast truncates constant value +# endif + + vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned::type( 8)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned::type(16)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned::type(0x00000000FFFFFFFFull), typename detail::make_unsigned::type(32)); + return vec(x); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + } + + // findLSB + template + GLM_FUNC_QUALIFIER int findLSB(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + + return detail::compute_findLSB::call(Value); + } + + template + GLM_FUNC_QUALIFIER vec findLSB(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + + return detail::functor1::call(findLSB, x); + } + + // findMSB + template + GLM_FUNC_QUALIFIER int findMSB(genIUType v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + return findMSB(vec<1, genIUType>(v)).x; + } + + template + GLM_FUNC_QUALIFIER vec findMSB(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + return detail::compute_findMSB_vec::call(v); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_integer_simd.inl" +#endif + diff --git a/include/glm/glm/detail/func_integer_simd.inl b/include/glm/glm/detail/func_integer_simd.inl new file mode 100644 index 00000000..8be6c9ce --- /dev/null +++ b/include/glm/glm/detail/func_integer_simd.inl @@ -0,0 +1,65 @@ +#include "../simd/integer.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_bitfieldReverseStep<4, uint, Q, true, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) + { + __m128i const set0 = v.data; + + __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); + __m128i const and1 = _mm_and_si128(set0, set1); + __m128i const sft1 = _mm_slli_epi32(and1, Shift); + + __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); + __m128i const and2 = _mm_and_si128(set0, set2); + __m128i const sft2 = _mm_srai_epi32(and2, Shift); + + __m128i const or0 = _mm_or_si128(sft1, sft2); + + return or0; + } + }; + + template + struct compute_bitfieldBitCountStep<4, uint, Q, true, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) + { + __m128i const set0 = v.data; + + __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); + __m128i const and0 = _mm_and_si128(set0, set1); + __m128i const sft0 = _mm_slli_epi32(set0, Shift); + __m128i const and1 = _mm_and_si128(sft0, set1); + __m128i const add0 = _mm_add_epi32(and0, and1); + + return add0; + } + }; +}//namespace detail + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template<> + GLM_FUNC_QUALIFIER int bitCount(uint x) + { + return _mm_popcnt_u32(x); + } + +# if(GLM_MODEL == GLM_MODEL_64) + template<> + GLM_FUNC_QUALIFIER int bitCount(detail::uint64 x) + { + return static_cast(_mm_popcnt_u64(x)); + } +# endif//GLM_MODEL +# endif//GLM_ARCH + +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/detail/func_matrix.inl b/include/glm/glm/detail/func_matrix.inl new file mode 100644 index 00000000..d980c6d3 --- /dev/null +++ b/include/glm/glm/detail/func_matrix.inl @@ -0,0 +1,398 @@ +#include "../geometric.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_matrixCompMult + { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + mat Result; + for(length_t i = 0; i < Result.length(); ++i) + Result[i] = x[i] * y[i]; + return Result; + } + }; + + template + struct compute_transpose{}; + + template + struct compute_transpose<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) + { + mat<2, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + return Result; + } + }; + + template + struct compute_transpose<2, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m) + { + mat<3,2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + return Result; + } + }; + + template + struct compute_transpose<2, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m) + { + mat<4, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + return Result; + } + }; + + template + struct compute_transpose<3, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m) + { + mat<2, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + return Result; + } + }; + + template + struct compute_transpose<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + mat<3, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + return Result; + } + }; + + template + struct compute_transpose<3, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m) + { + mat<4, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + return Result; + } + }; + + template + struct compute_transpose<4, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m) + { + mat<2, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + return Result; + } + }; + + template + struct compute_transpose<4, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m) + { + mat<3, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + return Result; + } + }; + + template + struct compute_transpose<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) + { + mat<4, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + Result[3][3] = m[3][3]; + return Result; + } + }; + + template + struct compute_determinant{}; + + template + struct compute_determinant<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, Q> const& m) + { + return m[0][0] * m[1][1] - m[1][0] * m[0][1]; + } + }; + + template + struct compute_determinant<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, Q> const& m) + { + return + + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + } + }; + + template + struct compute_determinant<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, Q> const& m) + { + T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + vec<4, T, Q> DetCof( + + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + return + m[0][0] * DetCof[0] + m[0][1] * DetCof[1] + + m[0][2] * DetCof[2] + m[0][3] * DetCof[3]; + } + }; + + template + struct compute_inverse{}; + + template + struct compute_inverse<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) + { + T OneOverDeterminant = static_cast(1) / ( + + m[0][0] * m[1][1] + - m[1][0] * m[0][1]); + + mat<2, 2, T, Q> Inverse( + + m[1][1] * OneOverDeterminant, + - m[0][1] * OneOverDeterminant, + - m[1][0] * OneOverDeterminant, + + m[0][0] * OneOverDeterminant); + + return Inverse; + } + }; + + template + struct compute_inverse<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + T OneOverDeterminant = static_cast(1) / ( + + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); + + mat<3, 3, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; + Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; + Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; + Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant; + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant; + Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant; + Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant; + Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant; + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant; + + return Inverse; + } + }; + + template + struct compute_inverse<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) + { + T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + vec<4, T, Q> Fac0(Coef00, Coef00, Coef02, Coef03); + vec<4, T, Q> Fac1(Coef04, Coef04, Coef06, Coef07); + vec<4, T, Q> Fac2(Coef08, Coef08, Coef10, Coef11); + vec<4, T, Q> Fac3(Coef12, Coef12, Coef14, Coef15); + vec<4, T, Q> Fac4(Coef16, Coef16, Coef18, Coef19); + vec<4, T, Q> Fac5(Coef20, Coef20, Coef22, Coef23); + + vec<4, T, Q> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); + vec<4, T, Q> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); + vec<4, T, Q> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); + vec<4, T, Q> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); + + vec<4, T, Q> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); + vec<4, T, Q> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); + vec<4, T, Q> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); + vec<4, T, Q> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); + + vec<4, T, Q> SignA(+1, -1, +1, -1); + vec<4, T, Q> SignB(-1, +1, -1, +1); + mat<4, 4, T, Q> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); + + vec<4, T, Q> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); + + vec<4, T, Q> Dot0(m[0] * Row0); + T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w); + + T OneOverDeterminant = static_cast(1) / Dot1; + + return Inverse * OneOverDeterminant; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); + return detail::compute_matrixCompMult::value>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); + + typename detail::outerProduct_trait::type m; + for(length_t i = 0; i < m.length(); ++i) + m[i] = c * r[i]; + return m; + } + + template + GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); + return detail::compute_transpose::value>::call(m); + } + + template + GLM_FUNC_QUALIFIER T determinant(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); + return detail::compute_determinant::value>::call(m); + } + + template + GLM_FUNC_QUALIFIER mat inverse(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); + return detail::compute_inverse::value>::call(m); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_matrix_simd.inl" +#endif + diff --git a/include/glm/glm/detail/func_matrix_simd.inl b/include/glm/glm/detail/func_matrix_simd.inl new file mode 100644 index 00000000..f67ac66a --- /dev/null +++ b/include/glm/glm/detail/func_matrix_simd.inl @@ -0,0 +1,249 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#include "type_mat4x4.hpp" +#include "../geometric.hpp" +#include "../simd/matrix.h" +#include + +namespace glm{ +namespace detail +{ +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template + struct compute_matrixCompMult<4, 4, float, Q, true> + { + GLM_STATIC_ASSERT(detail::is_aligned::value, "Specialization requires aligned"); + + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y) + { + mat<4, 4, float, Q> Result; + glm_mat4_matrixCompMult( + *static_cast(&x[0].data), + *static_cast(&y[0].data), + *static_cast(&Result[0].data)); + return Result; + } + }; +# endif + + template + struct compute_transpose<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + mat<4, 4, float, Q> Result; + glm_mat4_transpose(&m[0].data, &Result[0].data); + return Result; + } + }; + + template + struct compute_determinant<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m) + { + return _mm_cvtss_f32(glm_mat4_determinant(&m[0].data)); + } + }; + + template + struct compute_inverse<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + mat<4, 4, float, Q> Result; + glm_mat4_inverse(&m[0].data, &Result[0].data); + return Result; + } + }; +}//namespace detail + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_lowp> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump>(vec<4, float, aligned_mediump> const& c, vec<4, float, aligned_mediump> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_mediump> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_highp> outerProduct<4, 4, float, aligned_highp>(vec<4, float, aligned_highp> const& c, vec<4, float, aligned_highp> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_highp> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } +# endif +}//namespace glm + +#elif GLM_ARCH & GLM_ARCH_NEON_BIT + +namespace glm { +#if GLM_LANG & GLM_LANG_CXX11_FLAG + template + GLM_FUNC_QUALIFIER + typename std::enable_if::value, mat<4, 4, float, Q>>::type + operator*(mat<4, 4, float, Q> const & m1, mat<4, 4, float, Q> const & m2) + { + auto MulRow = [&](int l) { + float32x4_t const SrcA = m2[l].data; + + float32x4_t r = neon::mul_lane(m1[0].data, SrcA, 0); + r = neon::madd_lane(r, m1[1].data, SrcA, 1); + r = neon::madd_lane(r, m1[2].data, SrcA, 2); + r = neon::madd_lane(r, m1[3].data, SrcA, 3); + + return r; + }; + + mat<4, 4, float, aligned_highp> Result; + Result[0].data = MulRow(0); + Result[1].data = MulRow(1); + Result[2].data = MulRow(2); + Result[3].data = MulRow(3); + + return Result; + } +#endif // CXX11 + + template + struct detail::compute_inverse<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + float32x4_t const& m0 = m[0].data; + float32x4_t const& m1 = m[1].data; + float32x4_t const& m2 = m[2].data; + float32x4_t const& m3 = m[3].data; + + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + float32x4_t Fac0; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac0 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + float32x4_t Fac1; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac1 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + float32x4_t Fac2; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac2 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + float32x4_t Fac3; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac3 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + float32x4_t Fac4; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac4 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + float32x4_t Fac5; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + Fac5 = w0 * w1 - w2 * w3; + } + + float32x4_t Vec0 = neon::copy_lane(neon::dupq_lane(m0, 0), 0, m1, 0); // (m[1][0], m[0][0], m[0][0], m[0][0]); + float32x4_t Vec1 = neon::copy_lane(neon::dupq_lane(m0, 1), 0, m1, 1); // (m[1][1], m[0][1], m[0][1], m[0][1]); + float32x4_t Vec2 = neon::copy_lane(neon::dupq_lane(m0, 2), 0, m1, 2); // (m[1][2], m[0][2], m[0][2], m[0][2]); + float32x4_t Vec3 = neon::copy_lane(neon::dupq_lane(m0, 3), 0, m1, 3); // (m[1][3], m[0][3], m[0][3], m[0][3]); + + float32x4_t Inv0 = Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2; + float32x4_t Inv1 = Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4; + float32x4_t Inv2 = Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5; + float32x4_t Inv3 = Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5; + + float32x4_t r0 = float32x4_t{-1, +1, -1, +1} * Inv0; + float32x4_t r1 = float32x4_t{+1, -1, +1, -1} * Inv1; + float32x4_t r2 = float32x4_t{-1, +1, -1, +1} * Inv2; + float32x4_t r3 = float32x4_t{+1, -1, +1, -1} * Inv3; + + float32x4_t det = neon::mul_lane(r0, m0, 0); + det = neon::madd_lane(det, r1, m0, 1); + det = neon::madd_lane(det, r2, m0, 2); + det = neon::madd_lane(det, r3, m0, 3); + + float32x4_t rdet = vdupq_n_f32(1 / vgetq_lane_f32(det, 0)); + + mat<4, 4, float, Q> r; + r[0].data = vmulq_f32(r0, rdet); + r[1].data = vmulq_f32(r1, rdet); + r[2].data = vmulq_f32(r2, rdet); + r[3].data = vmulq_f32(r3, rdet); + return r; + } + }; +}//namespace glm +#endif diff --git a/include/glm/glm/detail/func_packing.inl b/include/glm/glm/detail/func_packing.inl new file mode 100644 index 00000000..234b093c --- /dev/null +++ b/include/glm/glm/detail/func_packing.inl @@ -0,0 +1,189 @@ +/// @ref core +/// @file glm/detail/func_packing.inl + +#include "../common.hpp" +#include "type_half.hpp" + +namespace glm +{ + GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const& v) + { + union + { + unsigned short in[2]; + uint out; + } u; + + vec<2, unsigned short, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) + { + union + { + uint in; + unsigned short out[2]; + } u; + + u.in = p; + + return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f; + } + + GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const& v) + { + union + { + signed short in[2]; + uint out; + } u; + + vec<2, short, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) + { + union + { + uint in; + signed short out[2]; + } u; + + u.in = p; + + return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const& v) + { + union + { + unsigned char in[4]; + uint out; + } u; + + vec<4, unsigned char, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) + { + union + { + uint in; + unsigned char out[4]; + } u; + + u.in = p; + + return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f; + } + + GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const& v) + { + union + { + signed char in[4]; + uint out; + } u; + + vec<4, signed char, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; + } + + GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) + { + union + { + uint in; + signed char out[4]; + } u; + + u.in = p; + + return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const& v) + { + union + { + uint in[2]; + double out; + } u; + + u.in[0] = v[0]; + u.in[1] = v[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) + { + union + { + double in; + uint out[2]; + } u; + + u.in = v; + + return uvec2(u.out[0], u.out[1]); + } + + GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const& v) + { + union + { + signed short in[2]; + uint out; + } u; + + u.in[0] = detail::toFloat16(v.x); + u.in[1] = detail::toFloat16(v.y); + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) + { + union + { + uint in; + signed short out[2]; + } u; + + u.in = v; + + return vec2( + detail::toFloat32(u.out[0]), + detail::toFloat32(u.out[1])); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_packing_simd.inl" +#endif + diff --git a/include/glm/glm/detail/func_packing_simd.inl b/include/glm/glm/detail/func_packing_simd.inl new file mode 100644 index 00000000..fd0fe8b7 --- /dev/null +++ b/include/glm/glm/detail/func_packing_simd.inl @@ -0,0 +1,6 @@ +namespace glm{ +namespace detail +{ + +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/func_trigonometric.inl b/include/glm/glm/detail/func_trigonometric.inl new file mode 100644 index 00000000..e129dcea --- /dev/null +++ b/include/glm/glm/detail/func_trigonometric.inl @@ -0,0 +1,197 @@ +#include "_vectorize.hpp" +#include +#include + +namespace glm +{ + // radians + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'radians' only accept floating-point input"); + + return degrees * static_cast(0.01745329251994329576923690768489); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) + { + return detail::functor1::call(radians, v); + } + + // degrees + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'degrees' only accept floating-point input"); + + return radians * static_cast(57.295779513082320876798154814105); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) + { + return detail::functor1::call(degrees, v); + } + + // sin + using ::std::sin; + + template + GLM_FUNC_QUALIFIER vec sin(vec const& v) + { + return detail::functor1::call(sin, v); + } + + // cos + using std::cos; + + template + GLM_FUNC_QUALIFIER vec cos(vec const& v) + { + return detail::functor1::call(cos, v); + } + + // tan + using std::tan; + + template + GLM_FUNC_QUALIFIER vec tan(vec const& v) + { + return detail::functor1::call(tan, v); + } + + // asin + using std::asin; + + template + GLM_FUNC_QUALIFIER vec asin(vec const& v) + { + return detail::functor1::call(asin, v); + } + + // acos + using std::acos; + + template + GLM_FUNC_QUALIFIER vec acos(vec const& v) + { + return detail::functor1::call(acos, v); + } + + // atan + template + GLM_FUNC_QUALIFIER genType atan(genType y, genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atan' only accept floating-point input"); + + return ::std::atan2(y, x); + } + + template + GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) + { + return detail::functor2::call(::std::atan2, a, b); + } + + using std::atan; + + template + GLM_FUNC_QUALIFIER vec atan(vec const& v) + { + return detail::functor1::call(atan, v); + } + + // sinh + using std::sinh; + + template + GLM_FUNC_QUALIFIER vec sinh(vec const& v) + { + return detail::functor1::call(sinh, v); + } + + // cosh + using std::cosh; + + template + GLM_FUNC_QUALIFIER vec cosh(vec const& v) + { + return detail::functor1::call(cosh, v); + } + + // tanh + using std::tanh; + + template + GLM_FUNC_QUALIFIER vec tanh(vec const& v) + { + return detail::functor1::call(tanh, v); + } + + // asinh +# if GLM_HAS_CXX11_STL + using std::asinh; +# else + template + GLM_FUNC_QUALIFIER genType asinh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); + + return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(std::abs(x) + sqrt(static_cast(1) + x * x)); + } +# endif + + template + GLM_FUNC_QUALIFIER vec asinh(vec const& v) + { + return detail::functor1::call(asinh, v); + } + + // acosh +# if GLM_HAS_CXX11_STL + using std::acosh; +# else + template + GLM_FUNC_QUALIFIER genType acosh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acosh' only accept floating-point input"); + + if(x < static_cast(1)) + return static_cast(0); + return log(x + sqrt(x * x - static_cast(1))); + } +# endif + + template + GLM_FUNC_QUALIFIER vec acosh(vec const& v) + { + return detail::functor1::call(acosh, v); + } + + // atanh +# if GLM_HAS_CXX11_STL + using std::atanh; +# else + template + GLM_FUNC_QUALIFIER genType atanh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); + + if(std::abs(x) >= static_cast(1)) + return 0; + return static_cast(0.5) * log((static_cast(1) + x) / (static_cast(1) - x)); + } +# endif + + template + GLM_FUNC_QUALIFIER vec atanh(vec const& v) + { + return detail::functor1::call(atanh, v); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_trigonometric_simd.inl" +#endif + diff --git a/include/glm/glm/detail/func_trigonometric_simd.inl b/include/glm/glm/detail/func_trigonometric_simd.inl new file mode 100644 index 00000000..e69de29b diff --git a/include/glm/glm/detail/func_vector_relational.inl b/include/glm/glm/detail/func_vector_relational.inl new file mode 100644 index 00000000..80c9e87f --- /dev/null +++ b/include/glm/glm/detail/func_vector_relational.inl @@ -0,0 +1,87 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] < y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] <= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] > y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] >= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec const& v) + { + bool Result = false; + for(length_t i = 0; i < L; ++i) + Result = Result || v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec const& v) + { + bool Result = true; + for(length_t i = 0; i < L; ++i) + Result = Result && v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec not_(vec const& v) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = !v[i]; + return Result; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_vector_relational_simd.inl" +#endif diff --git a/include/glm/glm/detail/func_vector_relational_simd.inl b/include/glm/glm/detail/func_vector_relational_simd.inl new file mode 100644 index 00000000..fd0fe8b7 --- /dev/null +++ b/include/glm/glm/detail/func_vector_relational_simd.inl @@ -0,0 +1,6 @@ +namespace glm{ +namespace detail +{ + +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/glm.cpp b/include/glm/glm/detail/glm.cpp new file mode 100644 index 00000000..e0755bd6 --- /dev/null +++ b/include/glm/glm/detail/glm.cpp @@ -0,0 +1,263 @@ +/// @ref core +/// @file glm/glm.cpp + +#ifndef GLM_ENABLE_EXPERIMENTAL +#define GLM_ENABLE_EXPERIMENTAL +#endif +#include +#include +#include +#include +#include +#include + +namespace glm +{ +// tvec1 type explicit instantiation +template struct vec<1, uint8, lowp>; +template struct vec<1, uint16, lowp>; +template struct vec<1, uint32, lowp>; +template struct vec<1, uint64, lowp>; +template struct vec<1, int8, lowp>; +template struct vec<1, int16, lowp>; +template struct vec<1, int32, lowp>; +template struct vec<1, int64, lowp>; +template struct vec<1, float32, lowp>; +template struct vec<1, float64, lowp>; + +template struct vec<1, uint8, mediump>; +template struct vec<1, uint16, mediump>; +template struct vec<1, uint32, mediump>; +template struct vec<1, uint64, mediump>; +template struct vec<1, int8, mediump>; +template struct vec<1, int16, mediump>; +template struct vec<1, int32, mediump>; +template struct vec<1, int64, mediump>; +template struct vec<1, float32, mediump>; +template struct vec<1, float64, mediump>; + +template struct vec<1, uint8, highp>; +template struct vec<1, uint16, highp>; +template struct vec<1, uint32, highp>; +template struct vec<1, uint64, highp>; +template struct vec<1, int8, highp>; +template struct vec<1, int16, highp>; +template struct vec<1, int32, highp>; +template struct vec<1, int64, highp>; +template struct vec<1, float32, highp>; +template struct vec<1, float64, highp>; + +// tvec2 type explicit instantiation +template struct vec<2, uint8, lowp>; +template struct vec<2, uint16, lowp>; +template struct vec<2, uint32, lowp>; +template struct vec<2, uint64, lowp>; +template struct vec<2, int8, lowp>; +template struct vec<2, int16, lowp>; +template struct vec<2, int32, lowp>; +template struct vec<2, int64, lowp>; +template struct vec<2, float32, lowp>; +template struct vec<2, float64, lowp>; + +template struct vec<2, uint8, mediump>; +template struct vec<2, uint16, mediump>; +template struct vec<2, uint32, mediump>; +template struct vec<2, uint64, mediump>; +template struct vec<2, int8, mediump>; +template struct vec<2, int16, mediump>; +template struct vec<2, int32, mediump>; +template struct vec<2, int64, mediump>; +template struct vec<2, float32, mediump>; +template struct vec<2, float64, mediump>; + +template struct vec<2, uint8, highp>; +template struct vec<2, uint16, highp>; +template struct vec<2, uint32, highp>; +template struct vec<2, uint64, highp>; +template struct vec<2, int8, highp>; +template struct vec<2, int16, highp>; +template struct vec<2, int32, highp>; +template struct vec<2, int64, highp>; +template struct vec<2, float32, highp>; +template struct vec<2, float64, highp>; + +// tvec3 type explicit instantiation +template struct vec<3, uint8, lowp>; +template struct vec<3, uint16, lowp>; +template struct vec<3, uint32, lowp>; +template struct vec<3, uint64, lowp>; +template struct vec<3, int8, lowp>; +template struct vec<3, int16, lowp>; +template struct vec<3, int32, lowp>; +template struct vec<3, int64, lowp>; +template struct vec<3, float32, lowp>; +template struct vec<3, float64, lowp>; + +template struct vec<3, uint8, mediump>; +template struct vec<3, uint16, mediump>; +template struct vec<3, uint32, mediump>; +template struct vec<3, uint64, mediump>; +template struct vec<3, int8, mediump>; +template struct vec<3, int16, mediump>; +template struct vec<3, int32, mediump>; +template struct vec<3, int64, mediump>; +template struct vec<3, float32, mediump>; +template struct vec<3, float64, mediump>; + +template struct vec<3, uint8, highp>; +template struct vec<3, uint16, highp>; +template struct vec<3, uint32, highp>; +template struct vec<3, uint64, highp>; +template struct vec<3, int8, highp>; +template struct vec<3, int16, highp>; +template struct vec<3, int32, highp>; +template struct vec<3, int64, highp>; +template struct vec<3, float32, highp>; +template struct vec<3, float64, highp>; + +// tvec4 type explicit instantiation +template struct vec<4, uint8, lowp>; +template struct vec<4, uint16, lowp>; +template struct vec<4, uint32, lowp>; +template struct vec<4, uint64, lowp>; +template struct vec<4, int8, lowp>; +template struct vec<4, int16, lowp>; +template struct vec<4, int32, lowp>; +template struct vec<4, int64, lowp>; +template struct vec<4, float32, lowp>; +template struct vec<4, float64, lowp>; + +template struct vec<4, uint8, mediump>; +template struct vec<4, uint16, mediump>; +template struct vec<4, uint32, mediump>; +template struct vec<4, uint64, mediump>; +template struct vec<4, int8, mediump>; +template struct vec<4, int16, mediump>; +template struct vec<4, int32, mediump>; +template struct vec<4, int64, mediump>; +template struct vec<4, float32, mediump>; +template struct vec<4, float64, mediump>; + +template struct vec<4, uint8, highp>; +template struct vec<4, uint16, highp>; +template struct vec<4, uint32, highp>; +template struct vec<4, uint64, highp>; +template struct vec<4, int8, highp>; +template struct vec<4, int16, highp>; +template struct vec<4, int32, highp>; +template struct vec<4, int64, highp>; +template struct vec<4, float32, highp>; +template struct vec<4, float64, highp>; + +// tmat2x2 type explicit instantiation +template struct mat<2, 2, float32, lowp>; +template struct mat<2, 2, float64, lowp>; + +template struct mat<2, 2, float32, mediump>; +template struct mat<2, 2, float64, mediump>; + +template struct mat<2, 2, float32, highp>; +template struct mat<2, 2, float64, highp>; + +// tmat2x3 type explicit instantiation +template struct mat<2, 3, float32, lowp>; +template struct mat<2, 3, float64, lowp>; + +template struct mat<2, 3, float32, mediump>; +template struct mat<2, 3, float64, mediump>; + +template struct mat<2, 3, float32, highp>; +template struct mat<2, 3, float64, highp>; + +// tmat2x4 type explicit instantiation +template struct mat<2, 4, float32, lowp>; +template struct mat<2, 4, float64, lowp>; + +template struct mat<2, 4, float32, mediump>; +template struct mat<2, 4, float64, mediump>; + +template struct mat<2, 4, float32, highp>; +template struct mat<2, 4, float64, highp>; + +// tmat3x2 type explicit instantiation +template struct mat<3, 2, float32, lowp>; +template struct mat<3, 2, float64, lowp>; + +template struct mat<3, 2, float32, mediump>; +template struct mat<3, 2, float64, mediump>; + +template struct mat<3, 2, float32, highp>; +template struct mat<3, 2, float64, highp>; + +// tmat3x3 type explicit instantiation +template struct mat<3, 3, float32, lowp>; +template struct mat<3, 3, float64, lowp>; + +template struct mat<3, 3, float32, mediump>; +template struct mat<3, 3, float64, mediump>; + +template struct mat<3, 3, float32, highp>; +template struct mat<3, 3, float64, highp>; + +// tmat3x4 type explicit instantiation +template struct mat<3, 4, float32, lowp>; +template struct mat<3, 4, float64, lowp>; + +template struct mat<3, 4, float32, mediump>; +template struct mat<3, 4, float64, mediump>; + +template struct mat<3, 4, float32, highp>; +template struct mat<3, 4, float64, highp>; + +// tmat4x2 type explicit instantiation +template struct mat<4, 2, float32, lowp>; +template struct mat<4, 2, float64, lowp>; + +template struct mat<4, 2, float32, mediump>; +template struct mat<4, 2, float64, mediump>; + +template struct mat<4, 2, float32, highp>; +template struct mat<4, 2, float64, highp>; + +// tmat4x3 type explicit instantiation +template struct mat<4, 3, float32, lowp>; +template struct mat<4, 3, float64, lowp>; + +template struct mat<4, 3, float32, mediump>; +template struct mat<4, 3, float64, mediump>; + +template struct mat<4, 3, float32, highp>; +template struct mat<4, 3, float64, highp>; + +// tmat4x4 type explicit instantiation +template struct mat<4, 4, float32, lowp>; +template struct mat<4, 4, float64, lowp>; + +template struct mat<4, 4, float32, mediump>; +template struct mat<4, 4, float64, mediump>; + +template struct mat<4, 4, float32, highp>; +template struct mat<4, 4, float64, highp>; + +// tquat type explicit instantiation +template struct qua; +template struct qua; + +template struct qua; +template struct qua; + +template struct qua; +template struct qua; + +//tdualquat type explicit instantiation +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; + +}//namespace glm + diff --git a/include/glm/glm/detail/qualifier.hpp b/include/glm/glm/detail/qualifier.hpp new file mode 100644 index 00000000..b6c9df0c --- /dev/null +++ b/include/glm/glm/detail/qualifier.hpp @@ -0,0 +1,230 @@ +#pragma once + +#include "setup.hpp" + +namespace glm +{ + /// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp) + enum qualifier + { + packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs + packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance + packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs + aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance + aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance + aligned = aligned_highp, ///< By default aligned qualifier is also high precision +# endif + + highp = packed_highp, ///< By default highp qualifier is also packed + mediump = packed_mediump, ///< By default mediump qualifier is also packed + lowp = packed_lowp, ///< By default lowp qualifier is also packed + packed = packed_highp, ///< By default packed qualifier is also high precision + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) + defaultp = aligned_highp +# else + defaultp = highp +# endif + }; + + typedef qualifier precision; + + template struct vec; + template struct mat; + template struct qua; + +# if GLM_HAS_TEMPLATE_ALIASES + template using tvec1 = vec<1, T, Q>; + template using tvec2 = vec<2, T, Q>; + template using tvec3 = vec<3, T, Q>; + template using tvec4 = vec<4, T, Q>; + template using tmat2x2 = mat<2, 2, T, Q>; + template using tmat2x3 = mat<2, 3, T, Q>; + template using tmat2x4 = mat<2, 4, T, Q>; + template using tmat3x2 = mat<3, 2, T, Q>; + template using tmat3x3 = mat<3, 3, T, Q>; + template using tmat3x4 = mat<3, 4, T, Q>; + template using tmat4x2 = mat<4, 2, T, Q>; + template using tmat4x3 = mat<4, 3, T, Q>; + template using tmat4x4 = mat<4, 4, T, Q>; + template using tquat = qua; +# endif + +namespace detail +{ + template + struct is_aligned + { + static const bool value = false; + }; + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + struct is_aligned + { + static const bool value = true; + }; + + template<> + struct is_aligned + { + static const bool value = true; + }; + + template<> + struct is_aligned + { + static const bool value = true; + }; +# endif + + template + struct storage + { + typedef struct type { + T data[L]; + } type; + }; + +# if GLM_HAS_ALIGNOF + template + struct storage + { + typedef struct alignas(L * sizeof(T)) type { + T data[L]; + } type; + }; + + template + struct storage<3, T, true> + { + typedef struct alignas(4 * sizeof(T)) type { + T data[4]; + } type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_SSE2_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<2, double, true> + { + typedef glm_f64vec2 type; + }; + + template<> + struct storage<2, detail::int64, true> + { + typedef glm_i64vec2 type; + }; + + template<> + struct storage<2, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; +# endif + +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + template<> + struct storage<4, double, true> + { + typedef glm_f64vec4 type; + }; +# endif + +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) + template<> + struct storage<4, detail::int64, true> + { + typedef glm_i64vec4 type; + }; + + template<> + struct storage<4, detail::uint64, true> + { + typedef glm_u64vec4 type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_NEON_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; +# endif + + enum genTypeEnum + { + GENTYPE_VEC, + GENTYPE_MAT, + GENTYPE_QUAT + }; + + template + struct genTypeTrait + {}; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_MAT; + }; + + template + struct init_gentype + { + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1, 0, 0, 0); + } + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1); + } + }; +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/setup.hpp b/include/glm/glm/detail/setup.hpp new file mode 100644 index 00000000..2c01e02f --- /dev/null +++ b/include/glm/glm/detail/setup.hpp @@ -0,0 +1,1135 @@ +#ifndef GLM_SETUP_INCLUDED + +#include +#include + +#define GLM_VERSION_MAJOR 0 +#define GLM_VERSION_MINOR 9 +#define GLM_VERSION_PATCH 9 +#define GLM_VERSION_REVISION 8 +#define GLM_VERSION 998 +#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.8" + +#define GLM_SETUP_INCLUDED GLM_VERSION + +/////////////////////////////////////////////////////////////////////////////////// +// Active states + +#define GLM_DISABLE 0 +#define GLM_ENABLE 1 + +/////////////////////////////////////////////////////////////////////////////////// +// Messages + +#if defined(GLM_FORCE_MESSAGES) +# define GLM_MESSAGES GLM_ENABLE +#else +# define GLM_MESSAGES GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Detect the platform + +#include "../simd/platform.h" + +/////////////////////////////////////////////////////////////////////////////////// +// Build model + +#if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) +# define GLM_MODEL GLM_MODEL_64 +#elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM) +# define GLM_MODEL GLM_MODEL_32 +#else +# define GLM_MODEL GLM_MODEL_32 +#endif// + +#if !defined(GLM_MODEL) && GLM_COMPILER != 0 +# error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." +#endif//GLM_MODEL + +/////////////////////////////////////////////////////////////////////////////////// +// C++ Version + +// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A + +#define GLM_LANG_CXX98_FLAG (1 << 1) +#define GLM_LANG_CXX03_FLAG (1 << 2) +#define GLM_LANG_CXX0X_FLAG (1 << 3) +#define GLM_LANG_CXX11_FLAG (1 << 4) +#define GLM_LANG_CXX14_FLAG (1 << 5) +#define GLM_LANG_CXX17_FLAG (1 << 6) +#define GLM_LANG_CXX2A_FLAG (1 << 7) +#define GLM_LANG_CXXMS_FLAG (1 << 8) +#define GLM_LANG_CXXGNU_FLAG (1 << 9) + +#define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG +#define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) +#define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) +#define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) +#define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) +#define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) +#define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG) +#define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG +#define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG + +#if (defined(_MSC_EXTENSIONS)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#else +# define GLM_LANG_EXT 0 +#endif + +#if (defined(GLM_FORCE_CXX_UNKNOWN)) +# define GLM_LANG 0 +#elif defined(GLM_FORCE_CXX2A) +# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX17) +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX14) +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX11) +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX03) +# define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) +#elif defined(GLM_FORCE_CXX98) +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) +#else +# if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) +# if GLM_COMPILER >= GLM_COMPILER_VC15_7 +# define GLM_LANG_PLATFORM _MSVC_LANG +# elif GLM_COMPILER >= GLM_COMPILER_VC15 +# if _MSVC_LANG > 201402L +# define GLM_LANG_PLATFORM 201402L +# else +# define GLM_LANG_PLATFORM _MSVC_LANG +# endif +# else +# define GLM_LANG_PLATFORM 0 +# endif +# else +# define GLM_LANG_PLATFORM 0 +# endif + +# if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L +# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +# elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# elif __cplusplus == 201402L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) +# elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) +# elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) +# elif __cplusplus == 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) +# else +# define GLM_LANG (0 | GLM_LANG_EXT) +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Has of C++ features + +// http://clang.llvm.org/cxx_status.html +// http://gcc.gnu.org/projects/cxx0x.html +// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx + +// Android has multiple STLs but C++11 STL detection doesn't always work #284 #564 +#if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) +# define GLM_HAS_CXX11_STL 0 +#elif GLM_COMPILER & GLM_COMPILER_CLANG +# if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED)) +# define GLM_HAS_CXX11_STL 1 +# else +# define GLM_HAS_CXX11_STL 0 +# endif +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_CXX11_STL 1 +#else +# define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))) +#endif + +// N1720 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_STATIC_ASSERT 1 +#else +# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC)))) +#endif + +// N1988 +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_EXTENDED_INTEGER_TYPE 1 +#else +# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG))) +#endif + +// N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_INITIALIZER_LISTS 1 +#else +# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_UNRESTRICTED_UNIONS 1 +#else +# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + (GLM_COMPILER & GLM_COMPILER_VC) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA))) +#endif + +// N2346 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_DEFAULTED_FUNCTIONS 1 +#else +# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + (GLM_COMPILER & GLM_COMPILER_CUDA))) +#endif + +// N2118 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_RVALUE_REFERENCES 1 +#else +# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 +#else +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_TEMPLATE_ALIASES 1 +#else +# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_RANGE_FOR 1 +#else +# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_ALIGNOF 1 +#else +# define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf +// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html +#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... +# define GLM_HAS_CONSTEXPR 0 +#elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) +#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# define GLM_HAS_CONSTEXPR 1 +#else +# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) +#endif + +#if GLM_HAS_CONSTEXPR +# define GLM_CONSTEXPR constexpr +#else +# define GLM_CONSTEXPR +#endif + +// +#if GLM_HAS_CONSTEXPR +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# if __has_feature(cxx_if_constexpr) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +#else +# define GLM_HAS_IF_CONSTEXPR 0 +#endif + +#if GLM_HAS_IF_CONSTEXPR +# define GLM_IF_CONSTEXPR if constexpr +#else +# define GLM_IF_CONSTEXPR if +#endif + +// +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_ASSIGNABLE 1 +#else +# define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) +#endif + +// +#define GLM_HAS_TRIVIAL_QUERIES 0 + +// +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_MAKE_SIGNED 1 +#else +# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)))) +#endif + +// +#if defined(GLM_FORCE_INTRINSICS) +# define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) +#else +# define GLM_HAS_BITSCAN_WINDOWS 0 +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// OpenMP +#ifdef _OPENMP +# if GLM_COMPILER & GLM_COMPILER_GCC +# if GLM_COMPILER >= GLM_COMPILER_GCC61 +# define GLM_HAS_OPENMP 45 +# elif GLM_COMPILER >= GLM_COMPILER_GCC49 +# define GLM_HAS_OPENMP 40 +# elif GLM_COMPILER >= GLM_COMPILER_GCC47 +# define GLM_HAS_OPENMP 31 +# else +# define GLM_HAS_OPENMP 0 +# endif +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# if GLM_COMPILER >= GLM_COMPILER_CLANG38 +# define GLM_HAS_OPENMP 31 +# else +# define GLM_HAS_OPENMP 0 +# endif +# elif GLM_COMPILER & GLM_COMPILER_VC +# define GLM_HAS_OPENMP 20 +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_COMPILER >= GLM_COMPILER_INTEL16 +# define GLM_HAS_OPENMP 40 +# else +# define GLM_HAS_OPENMP 0 +# endif +# else +# define GLM_HAS_OPENMP 0 +# endif +#else +# define GLM_HAS_OPENMP 0 +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// nullptr + +#if GLM_LANG & GLM_LANG_CXX0X_FLAG +# define GLM_CONFIG_NULLPTR GLM_ENABLE +#else +# define GLM_CONFIG_NULLPTR GLM_DISABLE +#endif + +#if GLM_CONFIG_NULLPTR == GLM_ENABLE +# define GLM_NULLPTR nullptr +#else +# define GLM_NULLPTR 0 +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Static assert + +#if GLM_HAS_STATIC_ASSERT +# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) +#elif GLM_COMPILER & GLM_COMPILER_VC +# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] +#else +# define GLM_STATIC_ASSERT(x, message) assert(x) +#endif//GLM_LANG + +/////////////////////////////////////////////////////////////////////////////////// +// Qualifiers + +#if GLM_COMPILER & GLM_COMPILER_CUDA +# define GLM_CUDA_FUNC_DEF __device__ __host__ +# define GLM_CUDA_FUNC_DECL __device__ __host__ +#else +# define GLM_CUDA_FUNC_DEF +# define GLM_CUDA_FUNC_DECL +#endif + +#if defined(GLM_FORCE_INLINE) +# if GLM_COMPILER & GLM_COMPILER_VC +# define GLM_INLINE __forceinline +# define GLM_NEVER_INLINE __declspec((noinline)) +# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) +# define GLM_INLINE inline __attribute__((__always_inline__)) +# define GLM_NEVER_INLINE __attribute__((__noinline__)) +# elif GLM_COMPILER & GLM_COMPILER_CUDA +# define GLM_INLINE __forceinline__ +# define GLM_NEVER_INLINE __noinline__ +# else +# define GLM_INLINE inline +# define GLM_NEVER_INLINE +# endif//GLM_COMPILER +#else +# define GLM_INLINE inline +# define GLM_NEVER_INLINE +#endif//defined(GLM_FORCE_INLINE) + +#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL +#define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE + +/////////////////////////////////////////////////////////////////////////////////// +// Swizzle operators + +// User defines: GLM_FORCE_SWIZZLE + +#define GLM_SWIZZLE_DISABLED 0 +#define GLM_SWIZZLE_OPERATOR 1 +#define GLM_SWIZZLE_FUNCTION 2 + +#if defined(GLM_FORCE_XYZW_ONLY) +# undef GLM_FORCE_SWIZZLE +#endif + +#if defined(GLM_SWIZZLE) +# pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") +# define GLM_FORCE_SWIZZLE +#endif + +#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR +#elif defined(GLM_FORCE_SWIZZLE) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION +#else +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Allows using not basic types as genType + +// #define GLM_FORCE_UNRESTRICTED_GENTYPE + +#ifdef GLM_FORCE_UNRESTRICTED_GENTYPE +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE +#else +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM +// to use a clip space between 0 to 1. +// Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM +// to use left handed coordinate system by default. + +#define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE +#define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE +#define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan +#define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM + +#define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) +#define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) + +#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO +# endif +#else +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Qualifiers + +#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) +# define GLM_DEPRECATED __declspec(deprecated) +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name +#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) +# define GLM_DEPRECATED __attribute__((__deprecated__)) +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) +#elif GLM_COMPILER & GLM_COMPILER_CUDA +# define GLM_DEPRECATED +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) +#else +# define GLM_DEPRECATED +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name +#endif + +/////////////////////////////////////////////////////////////////////////////////// + +#ifdef GLM_FORCE_EXPLICIT_CTOR +# define GLM_EXPLICIT explicit +#else +# define GLM_EXPLICIT +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// SYCL + +#if GLM_COMPILER==GLM_COMPILER_SYCL + +#include +#include + +namespace glm { +namespace std { + // Import SYCL's functions into the namespace glm::std to force their usages. + // It's important to use the math built-in function (sin, exp, ...) + // of SYCL instead the std ones. + using namespace cl::sycl; + + /////////////////////////////////////////////////////////////////////////////// + // Import some "harmless" std's stuffs used by glm into + // the new glm::std namespace. + template + using numeric_limits = ::std::numeric_limits; + + using ::std::size_t; + + using ::std::uint8_t; + using ::std::uint16_t; + using ::std::uint32_t; + using ::std::uint64_t; + + using ::std::int8_t; + using ::std::int16_t; + using ::std::int32_t; + using ::std::int64_t; + + using ::std::make_unsigned; + /////////////////////////////////////////////////////////////////////////////// +} //namespace std +} //namespace glm + +#endif + +/////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////// +// Length type: all length functions returns a length_t type. +// When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise +// length_t is a typedef of int like GLSL defines it. + +#define GLM_LENGTH_INT 1 +#define GLM_LENGTH_SIZE_T 2 + +#ifdef GLM_FORCE_SIZE_T_LENGTH +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T +#else +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT +#endif + +namespace glm +{ + using std::size_t; +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T + typedef size_t length_t; +# else + typedef int length_t; +# endif +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// constexpr + +#if GLM_HAS_CONSTEXPR +# define GLM_CONFIG_CONSTEXP GLM_ENABLE + + namespace glm + { + template + constexpr std::size_t countof(T const (&)[N]) + { + return N; + } + }//namespace glm +# define GLM_COUNTOF(arr) glm::countof(arr) +#elif defined(_MSC_VER) +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + +# define GLM_COUNTOF(arr) _countof(arr) +#else +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + +# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// uint + +namespace glm{ +namespace detail +{ + template + struct is_int + { + enum test {value = 0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + typedef unsigned int uint; +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// 64-bit int + +#if GLM_HAS_EXTENDED_INTEGER_TYPE +# include +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint64_t uint64; + typedef std::int64_t int64; +# elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available + typedef uint64_t uint64; + typedef int64_t int64; +# elif GLM_COMPILER & GLM_COMPILER_VC + typedef unsigned __int64 uint64; + typedef signed __int64 int64; +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic ignored "-Wlong-long" + __extension__ typedef unsigned long long uint64; + __extension__ typedef signed long long int64; +# elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic ignored "-Wc++11-long-long" + typedef unsigned long long uint64; + typedef signed long long int64; +# else//unknown compiler + typedef unsigned long long uint64; + typedef signed long long int64; +# endif +}//namespace detail +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// make_unsigned + +#if GLM_HAS_MAKE_SIGNED +# include + +namespace glm{ +namespace detail +{ + using std::make_unsigned; +}//namespace detail +}//namespace glm + +#else + +namespace glm{ +namespace detail +{ + template + struct make_unsigned + {}; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; +}//namespace detail +}//namespace glm +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Only use x, y, z, w as vector type components + +#ifdef GLM_FORCE_XYZW_ONLY +# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE +#else +# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted initialized types + +#define GLM_CTOR_INIT_DISABLE 0 +#define GLM_CTOR_INITIALIZER_LIST 1 +#define GLM_CTOR_INITIALISATION 2 + +#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST +#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION +#else +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Use SIMD instruction sets + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) +# define GLM_CONFIG_SIMD GLM_ENABLE +#else +# define GLM_CONFIG_SIMD GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted function + +#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE +# define GLM_DEFAULT = default +#else +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE +# define GLM_DEFAULT +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of aligned gentypes + +#ifdef GLM_FORCE_ALIGNED // Legacy define +# define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#endif + +#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# define GLM_FORCE_ALIGNED_GENTYPES +#endif + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE +#else +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of anonymous structure as implementation detail + +#if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE +#else +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Silent warnings + +#ifdef GLM_FORCE_SILENT_WARNINGS +# define GLM_SILENT_WARNINGS GLM_ENABLE +#else +# define GLM_SILENT_WARNINGS GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Precision + +#define GLM_HIGHP 1 +#define GLM_MEDIUMP 2 +#define GLM_LOWP 3 + +#if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Check inclusions of different versions of GLM + +#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) +# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." +#elif GLM_SETUP_INCLUDED == GLM_VERSION + +/////////////////////////////////////////////////////////////////////////////////// +// Messages + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) +# define GLM_MESSAGE_DISPLAYED +# define GLM_STR_HELPER(x) #x +# define GLM_STR(x) GLM_STR_HELPER(x) + + // Report GLM version +# pragma message (GLM_STR(GLM_VERSION_MESSAGE)) + + // Report C++ language +# if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 2A with extensions") +# elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) +# pragma message("GLM: C++ 2A") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 17 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# pragma message("GLM: C++ 17") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 14 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# pragma message("GLM: C++ 14") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 11 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) +# pragma message("GLM: C++ 11") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 0x with extensions") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) +# pragma message("GLM: C++ 0x") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 03 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) +# pragma message("GLM: C++ 03") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 98 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) +# pragma message("GLM: C++ 98") +# else +# pragma message("GLM: C++ language undetected") +# endif//GLM_LANG + + // Report compiler detection +# if GLM_COMPILER & GLM_COMPILER_CUDA +# pragma message("GLM: CUDA compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma message("GLM: Visual C++ compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma message("GLM: Clang compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# pragma message("GLM: Intel Compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma message("GLM: GCC compiler detected") +# else +# pragma message("GLM: Compiler not detected") +# endif + + // Report build target +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits with Neon instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits with Neon instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: MIPS 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: MIPS 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: PowerPC 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: PowerPC 32 bits build target") +# else +# pragma message("GLM: Unknown build target") +# endif//GLM_ARCH + + // Report platform name +# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) +# pragma message("GLM: QNX platform detected") +//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) +//# pragma message("GLM: iOS platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) +# pragma message("GLM: Apple platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) +# pragma message("GLM: WinCE platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) +# pragma message("GLM: Windows platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) +# pragma message("GLM: Native Client detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# pragma message("GLM: Android platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) +# pragma message("GLM: Linux platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) +# pragma message("GLM: UNIX platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) +# pragma message("GLM: platform unknown") +# else +# pragma message("GLM: platform not detected") +# endif + + // Report whether only xyzw component are used +# if defined GLM_FORCE_XYZW_ONLY +# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") +# endif + + // Report swizzle operator support +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") +# elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") +# else +# pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") +# endif + + // Report .length() type +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") +# else +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") +# endif + +# if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") +# else +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.") +# else +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.") +# endif + +# ifdef GLM_FORCE_SINGLE_ONLY +# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") +# endif + +# if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") +# elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# endif + +# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE +# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") +# endif +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") +# else +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") +# else +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") +# endif +#endif//GLM_MESSAGES + +#endif//GLM_SETUP_INCLUDED diff --git a/include/glm/glm/detail/type_float.hpp b/include/glm/glm/detail/type_float.hpp new file mode 100644 index 00000000..c8037ebd --- /dev/null +++ b/include/glm/glm/detail/type_float.hpp @@ -0,0 +1,68 @@ +#pragma once + +#include "setup.hpp" + +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(push) +# pragma warning(disable: 4512) // assignment operator could not be generated +#endif + +namespace glm{ +namespace detail +{ + template + union float_t + {}; + + // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ + template <> + union float_t + { + typedef int int_type; + typedef float float_type; + + GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {} + + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } + + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); } + + int_type i; + float_type f; + }; + + template <> + union float_t + { + typedef detail::int64 int_type; + typedef double float_type; + + GLM_CONSTEXPR float_t(float_type Num = static_cast(0)) : f(Num) {} + + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } + + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); } + + int_type i; + float_type f; + }; +}//namespace detail +}//namespace glm + +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(pop) +#endif diff --git a/include/glm/glm/detail/type_half.hpp b/include/glm/glm/detail/type_half.hpp new file mode 100644 index 00000000..40b8bec0 --- /dev/null +++ b/include/glm/glm/detail/type_half.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "setup.hpp" + +namespace glm{ +namespace detail +{ + typedef short hdata; + + GLM_FUNC_DECL float toFloat32(hdata value); + GLM_FUNC_DECL hdata toFloat16(float const& value); + +}//namespace detail +}//namespace glm + +#include "type_half.inl" diff --git a/include/glm/glm/detail/type_half.inl b/include/glm/glm/detail/type_half.inl new file mode 100644 index 00000000..b0723e36 --- /dev/null +++ b/include/glm/glm/detail/type_half.inl @@ -0,0 +1,241 @@ +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER float overflow() + { + volatile float f = 1e10; + + for(int i = 0; i < 10; ++i) + f *= f; // this will overflow before the for loop terminates + return f; + } + + union uif32 + { + GLM_FUNC_QUALIFIER uif32() : + i(0) + {} + + GLM_FUNC_QUALIFIER uif32(float f_) : + f(f_) + {} + + GLM_FUNC_QUALIFIER uif32(unsigned int i_) : + i(i_) + {} + + float f; + unsigned int i; + }; + + GLM_FUNC_QUALIFIER float toFloat32(hdata value) + { + int s = (value >> 15) & 0x00000001; + int e = (value >> 10) & 0x0000001f; + int m = value & 0x000003ff; + + if(e == 0) + { + if(m == 0) + { + // + // Plus or minus zero + // + + detail::uif32 result; + result.i = static_cast(s << 31); + return result.f; + } + else + { + // + // Denormalized number -- renormalize it + // + + while(!(m & 0x00000400)) + { + m <<= 1; + e -= 1; + } + + e += 1; + m &= ~0x00000400; + } + } + else if(e == 31) + { + if(m == 0) + { + // + // Positive or negative infinity + // + + uif32 result; + result.i = static_cast((s << 31) | 0x7f800000); + return result.f; + } + else + { + // + // Nan -- preserve sign and significand bits + // + + uif32 result; + result.i = static_cast((s << 31) | 0x7f800000 | (m << 13)); + return result.f; + } + } + + // + // Normalized number + // + + e = e + (127 - 15); + m = m << 13; + + // + // Assemble s, e and m. + // + + uif32 Result; + Result.i = static_cast((s << 31) | (e << 23) | m); + return Result.f; + } + + GLM_FUNC_QUALIFIER hdata toFloat16(float const& f) + { + uif32 Entry; + Entry.f = f; + int i = static_cast(Entry.i); + + // + // Our floating point number, f, is represented by the bit + // pattern in integer i. Disassemble that bit pattern into + // the sign, s, the exponent, e, and the significand, m. + // Shift s into the position where it will go in the + // resulting half number. + // Adjust e, accounting for the different exponent bias + // of float and half (127 versus 15). + // + + int s = (i >> 16) & 0x00008000; + int e = ((i >> 23) & 0x000000ff) - (127 - 15); + int m = i & 0x007fffff; + + // + // Now reassemble s, e and m into a half: + // + + if(e <= 0) + { + if(e < -10) + { + // + // E is less than -10. The absolute value of f is + // less than half_MIN (f may be a small normalized + // float, a denormalized float or a zero). + // + // We convert f to a half zero. + // + + return hdata(s); + } + + // + // E is between -10 and 0. F is a normalized float, + // whose magnitude is less than __half_NRM_MIN. + // + // We convert f to a denormalized half. + // + + m = (m | 0x00800000) >> (1 - e); + + // + // Round to nearest, round "0.5" up. + // + // Rounding may cause the significand to overflow and make + // our number normalized. Because of the way a half's bits + // are laid out, we don't have to treat this case separately; + // the code below will handle it correctly. + // + + if(m & 0x00001000) + m += 0x00002000; + + // + // Assemble the half from s, e (zero) and m. + // + + return hdata(s | (m >> 13)); + } + else if(e == 0xff - (127 - 15)) + { + if(m == 0) + { + // + // F is an infinity; convert f to a half + // infinity with the same sign as f. + // + + return hdata(s | 0x7c00); + } + else + { + // + // F is a NAN; we produce a half NAN that preserves + // the sign bit and the 10 leftmost bits of the + // significand of f, with one exception: If the 10 + // leftmost bits are all zero, the NAN would turn + // into an infinity, so we have to set at least one + // bit in the significand. + // + + m >>= 13; + + return hdata(s | 0x7c00 | m | (m == 0)); + } + } + else + { + // + // E is greater than zero. F is a normalized float. + // We try to convert f to a normalized half. + // + + // + // Round to nearest, round "0.5" up + // + + if(m & 0x00001000) + { + m += 0x00002000; + + if(m & 0x00800000) + { + m = 0; // overflow in significand, + e += 1; // adjust exponent + } + } + + // + // Handle exponent overflow + // + + if (e > 30) + { + overflow(); // Cause a hardware floating point overflow; + + return hdata(s | 0x7c00); + // if this returns, the half becomes an + } // infinity with the same sign as f. + + // + // Assemble the half from s, e and m. + // + + return hdata(s | (e << 10) | (m >> 13)); + } + } + +}//namespace detail +}//namespace glm diff --git a/include/glm/glm/detail/type_mat2x2.hpp b/include/glm/glm/detail/type_mat2x2.hpp new file mode 100644 index 00000000..033908f4 --- /dev/null +++ b/include/glm/glm/detail/type_mat2x2.hpp @@ -0,0 +1,177 @@ +/// @ref core +/// @file glm/detail/type_mat2x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 2, T, Q> type; + typedef mat<2, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x1, T const& y1, + T const& x2, T const& y2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + U const& x1, V const& y1, + M const& x2, N const& y2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, U, Q> const& v1, + vec<2, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); +} //namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x2.inl" +#endif diff --git a/include/glm/glm/detail/type_mat2x2.inl b/include/glm/glm/detail/type_mat2x2.inl new file mode 100644 index 00000000..fe5d1aa3 --- /dev/null +++ b/include/glm/glm/detail/type_mat2x2.inl @@ -0,0 +1,536 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{m[0], m[1]} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0), col_type(0, scalar)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat + ( + T const& x0, T const& y0, + T const& x1, T const& y1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{v0, v1} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif + } + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat + ( + X1 const& x1, Y1 const& y1, + X2 const& x2, Y2 const& y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(static_cast(x1), value_type(y1)); + this->value[1] = col_type(static_cast(x2), value_type(y2)); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- mat2x2 matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) + { + this->value[0] += scalar; + this->value[1] += scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) + { + this->value[0] -= scalar; + this->value[1] -= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) + { + this->value[0] *= scalar; + this->value[1] *= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) + { + this->value[0] /= scalar; + this->value[1] /= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) + { + mat<2, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) + { + mat<2, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + scalar - m[0], + scalar - m[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator* + ( + mat<2, 2, T, Q> const& m, + typename mat<2, 2, T, Q>::row_type const& v + ) + { + return vec<2, T, Q>( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator* + ( + typename mat<2, 2, T, Q>::col_type const& v, + mat<2, 2, T, Q> const& m + ) + { + return vec<2, T, Q>( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + mat<2, 2, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat2x3.hpp b/include/glm/glm/detail/type_mat2x3.hpp new file mode 100644 index 00000000..d6596e46 --- /dev/null +++ b/include/glm/glm/detail/type_mat2x3.hpp @@ -0,0 +1,159 @@ +/// @ref core +/// @file glm/detail/type_mat2x3.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 3, T, Q> type; + typedef mat<3, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, + T x1, T y1, T z1); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1); + + // -- Conversions -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, U, Q> const& v1, + vec<3, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x3.inl" +#endif diff --git a/include/glm/glm/detail/type_mat2x3.inl b/include/glm/glm/detail/type_mat2x3.inl new file mode 100644 index 00000000..5fec17e5 --- /dev/null +++ b/include/glm/glm/detail/type_mat2x3.inl @@ -0,0 +1,510 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{m.value[0], m.value[1]} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0, 0); + this->value[1] = col_type(0, scalar, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat + ( + T x0, T y0, T z0, + T x1, T y1, T z1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) + { + mat<2, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) + { + mat<2, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator* + ( + mat<2, 3, T, Q> const& m, + typename mat<2, 3, T, Q>::row_type const& v) + { + return typename mat<2, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator* + ( + typename mat<2, 3, T, Q>::col_type const& v, + mat<2, 3, T, Q> const& m) + { + return typename mat<2, 3, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; + + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat2x4.hpp b/include/glm/glm/detail/type_mat2x4.hpp new file mode 100644 index 00000000..ff03e215 --- /dev/null +++ b/include/glm/glm/detail/type_mat2x4.hpp @@ -0,0 +1,161 @@ +/// @ref core +/// @file glm/detail/type_mat2x4.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 4, T, Q> type; + typedef mat<4, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, U, Q> const& v1, + vec<4, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x4.inl" +#endif diff --git a/include/glm/glm/detail/type_mat2x4.inl b/include/glm/glm/detail/type_mat2x4.inl new file mode 100644 index 00000000..b6d2b9dd --- /dev/null +++ b/include/glm/glm/detail/type_mat2x4.inl @@ -0,0 +1,520 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{m[0], m[1]} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat + ( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) + { + mat<2, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) + { + mat<2, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) + { + return typename mat<2, 4, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y, + m[0][3] * v.x + m[1][3] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) + { + return typename mat<2, 4, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA03 = m1[0][3]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; + T SrcA13 = m1[1][3]; + + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; + T SrcB30 = m2[3][0]; + T SrcB31 = m2[3][1]; + + mat<4, 4, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat3x2.hpp b/include/glm/glm/detail/type_mat3x2.hpp new file mode 100644 index 00000000..e1665813 --- /dev/null +++ b/include/glm/glm/detail/type_mat3x2.hpp @@ -0,0 +1,167 @@ +/// @ref core +/// @file glm/detail/type_mat3x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 2, T, Q> type; + typedef mat<2, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, + T x1, T y1, + T x2, T y2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x2.inl" +#endif diff --git a/include/glm/glm/detail/type_mat3x2.inl b/include/glm/glm/detail/type_mat3x2.inl new file mode 100644 index 00000000..b4b948b7 --- /dev/null +++ b/include/glm/glm/detail/type_mat3x2.inl @@ -0,0 +1,532 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat + ( + T x0, T y0, + T x1, T y1, + T x2, T y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat + ( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) + { + mat<3, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) + { + mat<3, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) + { + return typename mat<3, 2, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) + { + return typename mat<3, 2, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + + mat<2, 2, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat3x3.hpp b/include/glm/glm/detail/type_mat3x3.hpp new file mode 100644 index 00000000..3174872e --- /dev/null +++ b/include/glm/glm/detail/type_mat3x3.hpp @@ -0,0 +1,184 @@ +/// @ref core +/// @file glm/detail/type_mat3x3.hpp + +#pragma once + +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 3, T, Q> type; + typedef mat<3, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x3.inl" +#endif diff --git a/include/glm/glm/detail/type_mat3x3.inl b/include/glm/glm/detail/type_mat3x3.inl new file mode 100644 index 00000000..1ddaf99d --- /dev/null +++ b/include/glm/glm/detail/type_mat3x3.inl @@ -0,0 +1,601 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat + ( + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); + this->value[2] = col_type(x3, y3, z3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) + { + mat<3, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) + { + mat<3, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + scalar - m[0], + scalar - m[1], + scalar - m[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + { + return typename mat<3, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + { + return typename mat<3, 3, T, Q>::row_type( + m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, + m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, + m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + mat<3, 3, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat3x4.hpp b/include/glm/glm/detail/type_mat3x4.hpp new file mode 100644 index 00000000..6e40b903 --- /dev/null +++ b/include/glm/glm/detail/type_mat3x4.hpp @@ -0,0 +1,166 @@ +/// @ref core +/// @file glm/detail/type_mat3x4.hpp + +#pragma once + +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 4, T, Q> type; + typedef mat<4, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2, + X3 x3, Y3 y3, Z3 z3, W3 w3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x4.inl" +#endif diff --git a/include/glm/glm/detail/type_mat3x4.inl b/include/glm/glm/detail/type_mat3x4.inl new file mode 100644 index 00000000..6ee416cf --- /dev/null +++ b/include/glm/glm/detail/type_mat3x4.inl @@ -0,0 +1,578 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat + ( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, typename Z0, typename W0, + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat + ( + X0 x0, Y0 y0, Z0 z0, W0 w0, + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) + { + mat<3, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) + { + mat<3, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator* + ( + mat<3, 4, T, Q> const& m, + typename mat<3, 4, T, Q>::row_type const& v + ) + { + return typename mat<3, 4, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator* + ( + typename mat<3, 4, T, Q>::col_type const& v, + mat<3, 4, T, Q> const& m + ) + { + return typename mat<3, 4, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA03 = m1[0][3]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA13 = m1[1][3]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + const T SrcA23 = m1[2][3]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + const T SrcB32 = m2[3][2]; + + mat<4, 4, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat4x2.hpp b/include/glm/glm/detail/type_mat4x2.hpp new file mode 100644 index 00000000..8d343527 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x2.hpp @@ -0,0 +1,171 @@ +/// @ref core +/// @file glm/detail/type_mat4x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 2, T, Q> type; + typedef mat<2, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3, + vec<2, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x2.inl" +#endif diff --git a/include/glm/glm/detail/type_mat4x2.inl b/include/glm/glm/detail/type_mat4x2.inl new file mode 100644 index 00000000..419c80c4 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x2.inl @@ -0,0 +1,574 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat + ( + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat + ( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); + this->value[3] = col_type(v3); +# endif + } + + // -- Conversion -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) + { + mat<4, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) + { + mat<4, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar, + m[3] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) + { + return typename mat<4, 2, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) + { + return typename mat<4, 2, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1], + v.x * m[3][0] + v.y * m[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; + + mat<2, 2, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar, + m[3] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2], + scalar / m[3]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat4x3.hpp b/include/glm/glm/detail/type_mat4x3.hpp new file mode 100644 index 00000000..16e42705 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x3.hpp @@ -0,0 +1,171 @@ +/// @ref core +/// @file glm/detail/type_mat4x3.hpp + +#pragma once + +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 3, T, Q> type; + typedef mat<3, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x0, T const& y0, T const& z0, + T const& x1, T const& y1, T const& z1, + T const& x2, T const& y2, T const& z2, + T const& x3, T const& y3, T const& z3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 const& x1, Y1 const& y1, Z1 const& z1, + X2 const& x2, Y2 const& y2, Z2 const& z2, + X3 const& x3, Y3 const& y3, Z3 const& z3, + X4 const& x4, Y4 const& y4, Z4 const& z4); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3, + vec<3, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); + GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); + GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x3.inl" +#endif //GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_mat4x3.inl b/include/glm/glm/detail/type_mat4x3.inl new file mode 100644 index 00000000..11b1ee35 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x3.inl @@ -0,0 +1,598 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0, 0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(T const& s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); + this->value[3] = col_type(0, 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat + ( + T const& x0, T const& y0, T const& z0, + T const& x1, T const& y1, T const& z1, + T const& x2, T const& y2, T const& z2, + T const& x3, T const& y3, T const& z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, typename Z0, + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat + ( + X0 const& x0, Y0 const& y0, Z0 const& z0, + X1 const& x1, Y1 const& y1, Z1 const& z1, + X2 const& x2, Y2 const& y2, Z2 const& z2, + X3 const& x3, Y3 const& y3, Z3 const& z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(m[3], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) + { + mat<4, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) + { + mat<4, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator* + ( + mat<4, 3, T, Q> const& m, + typename mat<4, 3, T, Q>::row_type const& v) + { + return typename mat<4, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator* + ( + typename mat<4, 3, T, Q>::col_type const& v, + mat<4, 3, T, Q> const& m) + { + return typename mat<4, 3, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], + v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; + T const SrcA32 = m1[3][2]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; + T const SrcB23 = m2[2][3]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +} //namespace glm diff --git a/include/glm/glm/detail/type_mat4x4.hpp b/include/glm/glm/detail/type_mat4x4.hpp new file mode 100644 index 00000000..3517f9f5 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x4.hpp @@ -0,0 +1,189 @@ +/// @ref core +/// @file glm/detail/type_mat4x4.hpp + +#pragma once + +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 4, T, Q> type; + typedef mat<4, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x0, T const& y0, T const& z0, T const& w0, + T const& x1, T const& y1, T const& z1, T const& w1, + T const& x2, T const& y2, T const& z2, T const& w2, + T const& x3, T const& y3, T const& z3, T const& w3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, + X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, + X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, + X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3, + vec<4, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x4.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_mat4x4.inl b/include/glm/glm/detail/type_mat4x4.inl new file mode 100644 index 00000000..e38b87f7 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x4.inl @@ -0,0 +1,706 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(T const& s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); + this->value[3] = col_type(0, 0, 0, s); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat + ( + T const& x0, T const& y0, T const& z0, T const& w0, + T const& x1, T const& y1, T const& z1, T const& w1, + T const& x2, T const& y2, T const& z2, T const& w2, + T const& x3, T const& y3, T const& z3, T const& w3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2), + col_type(x3, y3, z3, w3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); + this->value[3] = col_type(x3, y3, z3, w3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + // -- Conversions -- + + template + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat + ( + X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, + X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, + X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, + X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} +# endif + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); + +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); + this->value[2] = col_type(x3, y3, z3, w3); + this->value[3] = col_type(x4, y4, z4, w4); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif + } + + // -- Matrix conversions -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(m[3], 1); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary arithmetic operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) + { + mat<4, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) + { + mat<4, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + s - m[0], + s - m[1], + s - m[2], + s - m[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s) + { + return mat<4, 4, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator* + ( + mat<4, 4, T, Q> const& m, + typename mat<4, 4, T, Q>::row_type const& v + ) + { +/* + __m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(m[0].data, v0); + __m128 m1 = _mm_mul_ps(m[1].data, v1); + __m128 a0 = _mm_add_ps(m0, m1); + + __m128 m2 = _mm_mul_ps(m[2].data, v2); + __m128 m3 = _mm_mul_ps(m[3].data, v3); + __m128 a1 = _mm_add_ps(m2, m3); + + __m128 a2 = _mm_add_ps(a0, a1); + + return typename mat<4, 4, T, Q>::col_type(a2); +*/ + + typename mat<4, 4, T, Q>::col_type const Mov0(v[0]); + typename mat<4, 4, T, Q>::col_type const Mov1(v[1]); + typename mat<4, 4, T, Q>::col_type const Mul0 = m[0] * Mov0; + typename mat<4, 4, T, Q>::col_type const Mul1 = m[1] * Mov1; + typename mat<4, 4, T, Q>::col_type const Add0 = Mul0 + Mul1; + typename mat<4, 4, T, Q>::col_type const Mov2(v[2]); + typename mat<4, 4, T, Q>::col_type const Mov3(v[3]); + typename mat<4, 4, T, Q>::col_type const Mul2 = m[2] * Mov2; + typename mat<4, 4, T, Q>::col_type const Mul3 = m[3] * Mov3; + typename mat<4, 4, T, Q>::col_type const Add1 = Mul2 + Mul3; + typename mat<4, 4, T, Q>::col_type const Add2 = Add0 + Add1; + return Add2; + +/* + return typename mat<4, 4, T, Q>::col_type( + m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], + m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], + m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], + m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]); +*/ + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator* + ( + typename mat<4, 4, T, Q>::col_type const& v, + mat<4, 4, T, Q> const& m + ) + { + return typename mat<4, 4, T, Q>::row_type( + m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], + m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], + m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], + m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; + typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; + typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; + typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; + + typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; + typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; + typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; + typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; + + mat<4, 4, T, Q> Result; + Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; + Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; + Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; + Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + mat<4, 4, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_mat4x4_simd.inl" +#endif diff --git a/include/glm/glm/detail/type_mat4x4_simd.inl b/include/glm/glm/detail/type_mat4x4_simd.inl new file mode 100644 index 00000000..fb3a16f0 --- /dev/null +++ b/include/glm/glm/detail/type_mat4x4_simd.inl @@ -0,0 +1,6 @@ +/// @ref core + +namespace glm +{ + +}//namespace glm diff --git a/include/glm/glm/detail/type_quat.hpp b/include/glm/glm/detail/type_quat.hpp new file mode 100644 index 00000000..0e60bc33 --- /dev/null +++ b/include/glm/glm/detail/type_quat.hpp @@ -0,0 +1,186 @@ +/// @ref core +/// @file glm/detail/type_quat.hpp + +#pragma once + +// Dependency: +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/matrix_transform.hpp" + +namespace glm +{ + template + struct qua + { + // -- Implementation detail -- + + typedef qua type; + typedef T value_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_LANG & GLM_LANG_CXXMS_FLAG + union + { +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + struct { T w, x, y, z; }; +# else + struct { T x, y, z, w; }; +# endif + + typename detail::storage<4, T, detail::is_aligned::value>::type data; + }; +# else +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + T w, x, y, z; +# else + T x, y, z, w; +# endif +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + typedef length_t length_type; + + /// Return the count of components of a quaternion + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z); + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua const& q); + + /// Explicit conversion operators +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const; + GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const; +# endif + + /// Create a quaternion from two normalized axis + /// + /// @param u A first normalized axis + /// @param v A second normalized axis + /// @see gtc_quaternion + /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors + GLM_FUNC_DECL qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); + + /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); + GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); + GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(U s); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator/=(U s); + }; + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, T const& s); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(T const& s, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator/(qua const& q, T const& s); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2); +} //namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_quat.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_quat.inl b/include/glm/glm/detail/type_quat.inl new file mode 100644 index 00000000..67b9310a --- /dev/null +++ b/include/glm/glm/detail/type_quat.inl @@ -0,0 +1,408 @@ +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "../ext/quaternion_geometric.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_QUAT; + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(qua const& a, qua const& b) + { + vec<4, T, Q> tmp(a.w * b.w, a.x * b.x, a.y * b.y, a.z * b.z); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + } + }; + + template + struct compute_quat_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); + } + }; + + template + struct compute_quat_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); + } + }; + + template + struct compute_quat_mul_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua(q.w * s, q.x * s, q.y * s, q.z * s); + } + }; + + template + struct compute_quat_div_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua(q.w / s, q.x / s, q.y / s, q.z / s); + } + }; + + template + struct compute_quat_mul_vec4 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(qua const& q, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); + } + }; +}//namespace detail + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) + { + assert(i >= 0 && i < this->length()); +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const + { + assert(i >= 0 && i < this->length()); +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif + } + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(1), x(0), y(0), z(0) +# else + : x(0), y(0), z(0), w(1) +# endif +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(q.w), x(q.x), y(q.y), z(q.z) +# else + : x(q.x), y(q.y), z(q.z), w(q.w) +# endif + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(q.w), x(q.x), y(q.y), z(q.z) +# else + : x(q.x), y(q.y), z(q.z), w(q.w) +# endif + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T s, vec<3, T, Q> const& v) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(s), x(v.x), y(v.y), z(v.z) +# else + : x(v.x), y(v.y), z(v.z), w(s) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(_w), x(_x), y(_y), z(_z) +# else + : x(_x), y(_y), z(_z), w(_w) +# endif + {} + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(static_cast(q.w)), x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)) +# else + : x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)), w(static_cast(q.w)) +# endif + {} + + //template + //GLM_FUNC_QUALIFIER qua::qua + //( + // valType const& pitch, + // valType const& yaw, + // valType const& roll + //) + //{ + // vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); + // vec<3, valType> c = glm::cos(eulerAngle * valType(0.5)); + // vec<3, valType> s = glm::sin(eulerAngle * valType(0.5)); + // + // this->w = c.x * c.y * c.z + s.x * s.y * s.z; + // this->x = s.x * c.y * c.z - c.x * s.y * s.z; + // this->y = c.x * s.y * c.z + s.x * c.y * s.z; + // this->z = c.x * c.y * s.z - s.x * s.y * c.z; + //} + + template + GLM_FUNC_QUALIFIER qua::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v) + { + T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); + T real_part = norm_u_norm_v + dot(u, v); + vec<3, T, Q> t; + + if(real_part < static_cast(1.e-6f) * norm_u_norm_v) + { + // If u and v are exactly opposite, rotate 180 degrees + // around an arbitrary orthogonal axis. Axis normalisation + // can happen later, when we normalise the quaternion. + real_part = static_cast(0); + t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast(0)) : vec<3, T, Q>(static_cast(0), -u.z, u.y); + } + else + { + // Otherwise, build quaternion the standard way. + t = cross(u, v); + } + + *this = normalize(qua(real_part, t.x, t.y, t.z)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(vec<3, T, Q> const& eulerAngle) + { + vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); + vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); + + this->w = c.x * c.y * c.z + s.x * s.y * s.z; + this->x = s.x * c.y * c.z - c.x * s.y * s.z; + this->y = c.x * s.y * c.z + s.x * c.y * s.z; + this->z = c.x * c.y * s.z - s.x * s.y * c.z; + } + + template + GLM_FUNC_QUALIFIER qua::qua(mat<3, 3, T, Q> const& m) + { + *this = quat_cast(m); + } + + template + GLM_FUNC_QUALIFIER qua::qua(mat<4, 4, T, Q> const& m) + { + *this = quat_cast(m); + } + +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + template + GLM_FUNC_QUALIFIER qua::operator mat<3, 3, T, Q>() const + { + return mat3_cast(*this); + } + + template + GLM_FUNC_QUALIFIER qua::operator mat<4, 4, T, Q>() const + { + return mat4_cast(*this); + } +# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = q.w; + this->x = q.x; + this->y = q.y; + this->z = q.z; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = static_cast(q.w); + this->x = static_cast(q.x); + this->y = static_cast(q.y); + this->z = static_cast(q.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator+=(qua const& q) + { + return (*this = detail::compute_quat_add::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator-=(qua const& q) + { + return (*this = detail::compute_quat_sub::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(qua const& r) + { + qua const p(*this); + qua const q(r); + + this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; + this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; + this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; + this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(U s) + { + return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator/=(U s) + { + return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); + } + + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q) + { + return q; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q) + { + return qua(-q.w, -q.x, -q.y, -q.z); + } + + // -- Binary operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q, qua const& p) + { + return qua(q) += p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q, qua const& p) + { + return qua(q) -= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, qua const& p) + { + return qua(q) *= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v) + { + vec<3, T, Q> const QuatVector(q.x, q.y, q.z); + vec<3, T, Q> const uv(glm::cross(QuatVector, v)); + vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); + + return v + ((uv * q.w) + uuv) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v) + { + return detail::compute_quat_mul_vec4::value>::call(q, v); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, T const& s) + { + return qua( + q.w * s, q.x * s, q.y * s, q.z * s); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(T const& s, qua const& q) + { + return q * s; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator/(qua const& q, T const& s) + { + return qua( + q.w / s, q.x / s, q.y / s, q.z / s); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2) + { + return q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2) + { + return q1.x != q2.x || q1.y != q2.y || q1.z != q2.z || q1.w != q2.w; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_quat_simd.inl" +#endif + diff --git a/include/glm/glm/detail/type_quat_simd.inl b/include/glm/glm/detail/type_quat_simd.inl new file mode 100644 index 00000000..3333e59f --- /dev/null +++ b/include/glm/glm/detail/type_quat_simd.inl @@ -0,0 +1,188 @@ +/// @ref core + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ +/* + template + struct compute_quat_mul + { + static qua call(qua const& q1, qua const& q2) + { + // SSE2 STATS: 11 shuffle, 8 mul, 8 add + // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps + + __m128 const mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3))); + __m128 const mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2))); + __m128 const mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1))); + __m128 const mul3 = _mm_mul_ps(q1.Data, q2.Data); + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + __m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); + __m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); + __m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); + __m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); +# else + __m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); + __m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4)); + __m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); + + __m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); + __m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5)); + __m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); + + __m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); + __m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6)); + __m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); + + __m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); + __m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7)); + __m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); + #endif + + // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than + // the final code below. I'll keep this here for reference - maybe somebody else can do something better... + // + //__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0)); + //__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0)); + // + //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); + + qua Result; + _mm_store_ss(&Result.x, add4); + _mm_store_ss(&Result.y, add5); + _mm_store_ss(&Result.z, add6); + _mm_store_ss(&Result.w, add7); + return Result; + } + }; +*/ + + template + struct compute_quat_add + { + static qua call(qua const& q, qua const& p) + { + qua Result; + Result.data = _mm_add_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_add + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_add_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_sub + { + static qua call(qua const& q, qua const& p) + { + vec<4, float, Q> Result; + Result.data = _mm_sub_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_sub + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_sub_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, float s) + { + vec<4, float, Q> Result; + Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, float s) + { + vec<4, float, Q> Result; + Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_vec4 + { + static vec<4, float, Q> call(qua const& q, vec<4, float, Q> const& v) + { + __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); + + __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); + __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); + + __m128 const two = _mm_set1_ps(2.0f); + uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); + uuv = _mm_mul_ps(uuv, two); + + vec<4, float, Q> Result; + Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv)); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/include/glm/glm/detail/type_vec1.hpp b/include/glm/glm/detail/type_vec1.hpp new file mode 100644 index 00000000..51163f14 --- /dev/null +++ b/include/glm/glm/detail/type_vec1.hpp @@ -0,0 +1,308 @@ +/// @ref core +/// @file glm/detail/type_vec1.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<1, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<1, T, Q> type; + typedef vec<1, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + T x; + T r; + T s; + + typename detail::storage<1, T, detail::is_aligned::value>::type data; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, s) +# endif +*/ + }; +# else + union {T x, r, s;}; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) +# endif +*/ +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, P> const& v); + + // -- Swizzle constructors -- +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) + { + *this = that(); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +*/ + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec1.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_vec1.inl b/include/glm/glm/detail/type_vec1.inl new file mode 100644 index 00000000..c5883ceb --- /dev/null +++ b/include/glm/glm/detail/type_vec1.inl @@ -0,0 +1,551 @@ +/// @ref core + +#include "./compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, Q> const& v) + : x(v.x) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, P> const& v) + : x(v.x) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(T scalar) + : x(scalar) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<2, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) + { + return x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) const + { + return x; + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) + { + this->x = v.x; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) + { + this->x = static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) + { + this->x /= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator++() + { + ++this->x; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator--() + { + --this->x; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int) + { + vec<1, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int) + { + vec<1, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) + { + this->x %= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) + { + this->x &= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) + { + this->x |= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= U(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) + { + this->x ^= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) + { + this->x <<= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + return *this; + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + -v.x); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar + v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x + v2.x); + } + + //operator- + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar - v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x - v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar * v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x * v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar / v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x / v2.x); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar % v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x % v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar & v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x & v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar | v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x | v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar ^ v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x ^ v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + static_cast(v.x << scalar)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + static_cast(scalar << v.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + static_cast(v1.x << v2.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + static_cast(v.x >> scalar)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + static_cast(scalar >> v.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + static_cast(v1.x >> v2.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + ~v.x); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return detail::compute_equal::is_iec559>::call(v1.x, v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + { + return vec<1, bool, Q>(v1.x && v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + { + return vec<1, bool, Q>(v1.x || v2.x); + } +}//namespace glm diff --git a/include/glm/glm/detail/type_vec2.hpp b/include/glm/glm/detail/type_vec2.hpp new file mode 100644 index 00000000..52ef408e --- /dev/null +++ b/include/glm/glm/detail/type_vec2.hpp @@ -0,0 +1,399 @@ +/// @ref core +/// @file glm/detail/type_vec2.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<2, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<2, T, Q> type; + typedef vec<2, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct{ T x, y; }; + struct{ T r, g; }; + struct{ T s, t; }; + + typename detail::storage<2, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) + GLM_SWIZZLE2_3_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_3_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_3_MEMBERS(T, Q, s, t) + GLM_SWIZZLE2_4_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_4_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_4_MEMBERS(T, Q, s, t) +# endif + }; +# else + union {T x, r, s;}; + union {T y, g, t;}; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) +# endif//GLM_CONFIG_SWIZZLE +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} + + GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, B y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, vec<1, B, Q> const& y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) + { + *this = that(); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec2.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_vec2.inl b/include/glm/glm/detail/type_vec2.inl new file mode 100644 index 00000000..8e65d6bb --- /dev/null +++ b/include/glm/glm/detail/type_vec2.inl @@ -0,0 +1,913 @@ +/// @ref core + +#include "./compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, Q> const& v) + : x(v.x), y(v.y) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, P> const& v) + : x(v.x), y(v.y) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T scalar) + : x(scalar), y(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T _x, T _y) + : x(_x), y(_y) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, B _y) + : x(static_cast(_x)) + , y(static_cast(_y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, B _y) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, vec<1, B, Q> const& _y) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + this->y += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) + { + this->x /= static_cast(scalar); + this->y /= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.y); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator++() + { + ++this->x; + ++this->y; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator--() + { + --this->x; + --this->y; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int) + { + vec<2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int) + { + vec<2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) + { + this->x %= static_cast(scalar); + this->y %= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= static_cast(v.x); + this->y %= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) + { + this->x %= static_cast(v.x); + this->y %= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) + { + this->x &= static_cast(scalar); + this->y &= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= static_cast(v.x); + this->y &= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) + { + this->x &= static_cast(v.x); + this->y &= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) + { + this->x |= static_cast(scalar); + this->y |= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= static_cast(v.x); + this->y |= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) + { + this->x |= static_cast(v.x); + this->y |= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) + { + this->x ^= static_cast(scalar); + this->y ^= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= static_cast(v.x); + this->y ^= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) + { + this->x ^= static_cast(v.x); + this->y ^= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) + { + this->x <<= static_cast(scalar); + this->y <<= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.y); + return *this; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + -v.x, + -v.y); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x + scalar, + v.y + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.y + v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar + v.x, + scalar + v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.x + v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.y + v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x - scalar, + v.y - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.y - v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar - v.x, + scalar - v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.x - v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.y - v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x * scalar, + v.y * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.y * v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar * v.x, + scalar * v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.x * v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.y * v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x / scalar, + v.y / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.y / v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar / v.x, + scalar / v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.x / v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.y / v2.y); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x % scalar, + v.y % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.y % v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar % v.x, + scalar % v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.x % v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.y % v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x & scalar, + v.y & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.y & v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar & v.x, + scalar & v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.x & v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.y & v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x | scalar, + v.y | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.y | v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar | v.x, + scalar | v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.x | v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.y | v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x ^ scalar, + v.y ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar ^ v.x, + scalar ^ v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.x ^ v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x << scalar, + v.y << scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.y << v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar << v.x, + scalar << v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.x << v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.y << v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x >> scalar, + v.y >> scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.y >> v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar >> v.x, + scalar >> v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.x >> v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.y >> v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + ~v.x, + ~v.y); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + { + return vec<2, bool, Q>(v1.x && v2.x, v1.y && v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + { + return vec<2, bool, Q>(v1.x || v2.x, v1.y || v2.y); + } +}//namespace glm diff --git a/include/glm/glm/detail/type_vec3.hpp b/include/glm/glm/detail/type_vec3.hpp new file mode 100644 index 00000000..d83cde67 --- /dev/null +++ b/include/glm/glm/detail/type_vec3.hpp @@ -0,0 +1,432 @@ +/// @ref core +/// @file glm/detail/type_vec3.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<3, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<3, T, Q> type; + typedef vec<3, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma warning(disable: 4324) // structure was padded due to alignment specifier +# endif +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y, z; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct{ T x, y, z; }; + struct{ T r, g, b; }; + struct{ T s, t, p; }; + + typename detail::storage<3, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) + GLM_SWIZZLE3_3_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_3_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_3_MEMBERS(T, Q, s, t, p) + GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p) +# endif + }; +# else + union { T x, r, s; }; + union { T y, g, t; }; + union { T z, b, p; }; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) +# endif//GLM_CONFIG_SWIZZLE +# endif//GLM_LANG + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c); + + // -- Conversion scalar constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) + { + *this = that(); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) + { + *this = vec(v(), scalar); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + { + *this = vec(scalar, v()); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec3.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_vec3.inl b/include/glm/glm/detail/type_vec3.inl new file mode 100644 index 00000000..6532c9e6 --- /dev/null +++ b/include/glm/glm/detail/type_vec3.inl @@ -0,0 +1,1068 @@ +/// @ref core + +#include "compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0), z(0) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, Q> const& v) + : x(v.x), y(v.y), z(v.z) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, P> const& v) + : x(v.x), y(v.y), z(v.z) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T scalar) + : x(scalar), y(scalar), z(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T _x, T _y, T _z) + : x(_x), y(_y), z(_z) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + this->z = static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + this->y += static_cast(scalar); + this->z += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.x); + this->z += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.y); + this->z += static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); + this->z -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.x); + this->z -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.y); + this->z -= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); + this->z *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.x); + this->z *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.y); + this->z *= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) + { + this->x /= static_cast(v); + this->y /= static_cast(v); + this->z /= static_cast(v); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.x); + this->z /= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.y); + this->z /= static_cast(v.z); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator++() + { + ++this->x; + ++this->y; + ++this->z; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator--() + { + --this->x; + --this->y; + --this->z; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int) + { + vec<3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int) + { + vec<3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) + { + this->x %= scalar; + this->y %= scalar; + this->z %= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= v.x; + this->y %= v.x; + this->z %= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) + { + this->x %= v.x; + this->y %= v.y; + this->z %= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) + { + this->x &= scalar; + this->y &= scalar; + this->z &= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= v.x; + this->y &= v.x; + this->z &= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) + { + this->x &= v.x; + this->y &= v.y; + this->z &= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) + { + this->x |= scalar; + this->y |= scalar; + this->z |= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= v.x; + this->y |= v.x; + this->z |= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) + { + this->x |= v.x; + this->y |= v.y; + this->z |= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) + { + this->x ^= scalar; + this->y ^= scalar; + this->z ^= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= v.x; + this->y ^= v.x; + this->z ^= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) + { + this->x ^= v.x; + this->y ^= v.y; + this->z ^= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) + { + this->x <<= scalar; + this->y <<= scalar; + this->z <<= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.x); + this->z <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.y); + this->z <<= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); + this->z >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.x); + this->z >>= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.y); + this->z >>= static_cast(v.z); + return *this; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + -v.x, + -v.y, + -v.z); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x + scalar, + v.y + scalar, + v.z + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x + scalar.x, + v.y + scalar.x, + v.z + scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar + v.x, + scalar + v.y, + scalar + v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x + v.x, + scalar.x + v.y, + scalar.x + v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x + v2.x, + v1.y + v2.y, + v1.z + v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x - scalar, + v.y - scalar, + v.z - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x - scalar.x, + v.y - scalar.x, + v.z - scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar - v.x, + scalar - v.y, + scalar - v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x - v.x, + scalar.x - v.y, + scalar.x - v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x - v2.x, + v1.y - v2.y, + v1.z - v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x * scalar, + v.y * scalar, + v.z * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x * scalar.x, + v.y * scalar.x, + v.z * scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar * v.x, + scalar * v.y, + scalar * v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x * v.x, + scalar.x * v.y, + scalar.x * v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x * v2.x, + v1.y * v2.y, + v1.z * v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x / scalar, + v.y / scalar, + v.z / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x / scalar.x, + v.y / scalar.x, + v.z / scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar / v.x, + scalar / v.y, + scalar / v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x / v.x, + scalar.x / v.y, + scalar.x / v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x / v2.x, + v1.y / v2.y, + v1.z / v2.z); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x % scalar, + v.y % scalar, + v.z % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x % scalar.x, + v.y % scalar.x, + v.z % scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar % v.x, + scalar % v.y, + scalar % v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x % v.x, + scalar.x % v.y, + scalar.x % v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x % v2.x, + v1.y % v2.y, + v1.z % v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x & scalar, + v.y & scalar, + v.z & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x & scalar.x, + v.y & scalar.x, + v.z & scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar & v.x, + scalar & v.y, + scalar & v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x & v.x, + scalar.x & v.y, + scalar.x & v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x & v2.x, + v1.y & v2.y, + v1.z & v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x | scalar, + v.y | scalar, + v.z | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x | scalar.x, + v.y | scalar.x, + v.z | scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar | v.x, + scalar | v.y, + scalar | v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x | v.x, + scalar.x | v.y, + scalar.x | v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x | v2.x, + v1.y | v2.y, + v1.z | v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x ^ scalar, + v.y ^ scalar, + v.z ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x ^ scalar.x, + v.y ^ scalar.x, + v.z ^ scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar ^ v.x, + scalar ^ v.y, + scalar ^ v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x ^ v.x, + scalar.x ^ v.y, + scalar.x ^ v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.y, + v1.z ^ v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x << scalar, + v.y << scalar, + v.z << scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x << scalar.x, + v.y << scalar.x, + v.z << scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar << v.x, + scalar << v.y, + scalar << v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x << v.x, + scalar.x << v.y, + scalar.x << v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x << v2.x, + v1.y << v2.y, + v1.z << v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x >> scalar, + v.y >> scalar, + v.z >> scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x >> scalar.x, + v.y >> scalar.x, + v.z >> scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar >> v.x, + scalar >> v.y, + scalar >> v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x >> v.x, + scalar.x >> v.y, + scalar.x >> v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x >> v2.x, + v1.y >> v2.y, + v1.z >> v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + ~v.x, + ~v.y, + ~v.z); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + { + return vec<3, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + { + return vec<3, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); + } +}//namespace glm diff --git a/include/glm/glm/detail/type_vec4.hpp b/include/glm/glm/detail/type_vec4.hpp new file mode 100644 index 00000000..4a364346 --- /dev/null +++ b/include/glm/glm/detail/type_vec4.hpp @@ -0,0 +1,505 @@ +/// @ref core +/// @file glm/detail/type_vec4.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<4, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<4, T, Q> type; + typedef vec<4, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y, z, w; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct { T x, y, z, w; }; + struct { T r, g, b, a; }; + struct { T s, t, p, q; }; + + typename detail::storage<4, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) + GLM_SWIZZLE4_3_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_3_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_3_MEMBERS(T, Q, s, t, p, q) + GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q) +# endif + }; +# else + union { T x, r, s; }; + union { T y, g, t; }; + union { T z, b, p; }; + union { T w, a, q; }; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) +# endif +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + typedef length_t length_type; + + /// Return the count of components of the vector + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y, T z, T w); + + // -- Conversion scalar constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, B _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, P> const& _yzw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) + { + *this = that(); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) + { + *this = vec<4, T, Q>(v(), u()); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + { + *this = vec<4, T, Q>(x, y, v()); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) + { + *this = vec<4, T, Q>(x, v(), w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) + { + *this = vec<4, T, Q>(v(), z, w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) + { + *this = vec<4, T, Q>(v(), w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) + { + *this = vec<4, T, Q>(x, v()); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec4.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/include/glm/glm/detail/type_vec4.inl b/include/glm/glm/detail/type_vec4.inl new file mode 100644 index 00000000..3c212d98 --- /dev/null +++ b/include/glm/glm/detail/type_vec4.inl @@ -0,0 +1,1140 @@ +/// @ref core + +#include "compute_vector_relational.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_vec4_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + } + }; + + template + struct compute_vec4_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + } + }; + + template + struct compute_vec4_mul + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + } + }; + + template + struct compute_vec4_div + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + } + }; + + template + struct compute_vec4_mod + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); + } + }; + + template + struct compute_vec4_and + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); + } + }; + + template + struct compute_vec4_or + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); + } + }; + + template + struct compute_vec4_xor + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); + } + }; + + template + struct compute_vec4_shift_left + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); + } + }; + + template + struct compute_vec4_shift_right + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); + } + }; + + template + struct compute_vec4_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z) && + detail::compute_equal::is_iec559>::call(v1.w, v2.w); + } + }; + + template + struct compute_vec4_nequal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + }; + + template + struct compute_vec4_bitwise_not + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + return vec<4, T, Q>(~v.x, ~v.y, ~v.z, ~v.w); + } + }; +}//namespace detail + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0), z(0), w(0) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, Q> const& v) + : x(v.x), y(v.y), z(v.z), w(v.w) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, P> const& v) + : x(v.x), y(v.y), z(v.z), w(v.w) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T scalar) + : x(scalar), y(scalar), z(scalar), w(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) + : x(_x), y(_y), z(_z), w(_w) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + , w(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x.x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + , w(static_cast(v.w)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + this->z = static_cast(v.z); + this->w = static_cast(v.w); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v))); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator++() + { + ++this->x; + ++this->y; + ++this->z; + ++this->w; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator--() + { + --this->x; + --this->y; + --this->z; + --this->w; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int) + { + vec<4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int) + { + vec<4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v) + { + return vec<4, T, Q>(0) -= v; + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) += scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) += v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(v) += scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v2) += v1; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) += v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) -= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) -= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) *= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) *= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(v) *= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v2) *= v1; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) *= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) /= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) /= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) /= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) /= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) /= v2; + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) %= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) %= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) %= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar.x) %= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) %= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) &= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<4, T, Q>(v) &= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) &= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) &= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) &= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) |= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) |= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) |= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) |= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) |= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) ^= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) ^= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) ^= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) ^= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) ^= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) <<= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) <<= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) <<= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) <<= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) <<= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) >>= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) >>= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) >>= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) >>= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) >>= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v) + { + return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + { + return vec<4, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + { + return vec<4, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_vec4_simd.inl" +#endif diff --git a/include/glm/glm/detail/type_vec4_simd.inl b/include/glm/glm/detail/type_vec4_simd.inl new file mode 100644 index 00000000..29559b53 --- /dev/null +++ b/include/glm/glm/detail/type_vec4_simd.inl @@ -0,0 +1,775 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const + { + __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); + + vec<4, float, Q> Result; +# if GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0)); +# else + Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0)); +# endif + return Result; + } + }; + + template + struct _swizzle_base1<4, int, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, int, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, int, Q> Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; + + template + struct _swizzle_base1<4, uint, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, uint, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, uint, Q> Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; +# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + template + struct compute_vec4_add + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_add_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_add + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_add_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_sub + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_sub_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_sub + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_sub_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_mul + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_mul_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_mul + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_mul_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_div + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_div_ps(a.data, b.data); + return Result; + } + }; + + # if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_div + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_div_pd(a.data, b.data); + return Result; + } + }; +# endif + + template<> + struct compute_vec4_div + { + static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& a, vec<4, float, aligned_lowp> const& b) + { + vec<4, float, aligned_lowp> Result; + Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); + return Result; + } + }; + + template + struct compute_vec4_and + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_and_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_and + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_and_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_or + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_or_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_or + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_or_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_xor + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_xor_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_xor + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_xor_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_shift_left + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_sll_epi32(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_shift_left + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_sll_epi64(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_shift_right + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_srl_epi32(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_shift_right + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_srl_epi64(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_bitwise_not + { + static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + vec<4, T, Q> Result; + Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_bitwise_not + { + static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + vec<4, T, Q> Result; + Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1)); + return Result; + } + }; +# endif + + template + struct compute_vec4_equal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec4_equal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + //return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) == 0; + } + }; +# endif + + template + struct compute_vec4_nequal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + //return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) != 0; + } + }; +# endif +}//namespace detail + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_lowp>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_mediump>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_highp>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} +# endif + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_lowp>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_mediump>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_highp>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} +# endif + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm { +namespace detail { + + template + struct compute_vec4_add + { + static + vec<4, float, Q> + call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vaddq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, uint, Q> + call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vaddq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, int, Q> + call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vaddq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vsubq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vsubq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vsubq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vmulq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vmulq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vmulq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_div + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vdivq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + uint32x4_t cmp = vceqq_f32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + uint32x4_t cmp = vceqq_u32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + uint32x4_t cmp = vceqq_s32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + +}//namespace detail + +#if !GLM_CONFIG_XYZW_ONLY + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_lowp>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_mediump>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_highp>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, float, aligned_highp>& rhs) : + data(rhs.data) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, int, aligned_highp>& rhs) : + data(vcvtq_f32_s32(rhs.data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, uint, aligned_highp>& rhs) : + data(vcvtq_f32_u32(rhs.data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_lowp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_mediump>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_highp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_lowp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_mediump>(_x, _y, _z, _w).data)) + {} + + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_highp>(_x, _y, _z, _w).data)) + {} + +#endif +}//namespace glm + +#endif diff --git a/include/glm/glm/exponential.hpp b/include/glm/glm/exponential.hpp new file mode 100644 index 00000000..f8fb886f --- /dev/null +++ b/include/glm/glm/exponential.hpp @@ -0,0 +1,110 @@ +/// @ref core +/// @file glm/exponential.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions +/// +/// @defgroup core_func_exponential Exponential functions +/// @ingroup core +/// +/// Provides GLSL exponential functions +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/type_vec1.hpp" +#include "detail/type_vec2.hpp" +#include "detail/type_vec3.hpp" +#include "detail/type_vec4.hpp" +#include + +namespace glm +{ + /// @addtogroup core_func_exponential + /// @{ + + /// Returns 'base' raised to the power 'exponent'. + /// + /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @param exponent Floating point value representing the 'exponent'. + /// + /// @see GLSL pow man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); + + /// Returns the natural exponentiation of x, i.e., e^x. + /// + /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL exp man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec exp(vec const& v); + + /// Returns the natural logarithm of v, i.e., + /// returns the value y which satisfies the equation x = e^y. + /// Results are undefined if v <= 0. + /// + /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL log man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec log(vec const& v); + + /// Returns 2 raised to the v power. + /// + /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL exp2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec exp2(vec const& v); + + /// Returns the base 2 log of x, i.e., returns the value y, + /// which satisfies the equation x = 2 ^ y. + /// + /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL log2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec log2(vec const& v); + + /// Returns the positive square root of v. + /// + /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL sqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec sqrt(vec const& v); + + /// Returns the reciprocal of the positive square root of v. + /// + /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL inversesqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec inversesqrt(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_exponential.inl" diff --git a/include/glm/glm/ext.hpp b/include/glm/glm/ext.hpp new file mode 100644 index 00000000..3249fb99 --- /dev/null +++ b/include/glm/glm/ext.hpp @@ -0,0 +1,253 @@ +/// @file glm/ext.hpp +/// +/// @ref core (Dependence) + +#include "detail/setup.hpp" + +#pragma once + +#include "glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED) +# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED +# pragma message("GLM: All extensions included (not recommended)") +#endif//GLM_MESSAGES + +#include "./ext/matrix_clip_space.hpp" +#include "./ext/matrix_common.hpp" + +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" + +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" + +#include "./ext/matrix_int2x2.hpp" +#include "./ext/matrix_int2x2_sized.hpp" +#include "./ext/matrix_int2x3.hpp" +#include "./ext/matrix_int2x3_sized.hpp" +#include "./ext/matrix_int2x4.hpp" +#include "./ext/matrix_int2x4_sized.hpp" +#include "./ext/matrix_int3x2.hpp" +#include "./ext/matrix_int3x2_sized.hpp" +#include "./ext/matrix_int3x3.hpp" +#include "./ext/matrix_int3x3_sized.hpp" +#include "./ext/matrix_int3x4.hpp" +#include "./ext/matrix_int3x4_sized.hpp" +#include "./ext/matrix_int4x2.hpp" +#include "./ext/matrix_int4x2_sized.hpp" +#include "./ext/matrix_int4x3.hpp" +#include "./ext/matrix_int4x3_sized.hpp" +#include "./ext/matrix_int4x4.hpp" +#include "./ext/matrix_int4x4_sized.hpp" + +#include "./ext/matrix_uint2x2.hpp" +#include "./ext/matrix_uint2x2_sized.hpp" +#include "./ext/matrix_uint2x3.hpp" +#include "./ext/matrix_uint2x3_sized.hpp" +#include "./ext/matrix_uint2x4.hpp" +#include "./ext/matrix_uint2x4_sized.hpp" +#include "./ext/matrix_uint3x2.hpp" +#include "./ext/matrix_uint3x2_sized.hpp" +#include "./ext/matrix_uint3x3.hpp" +#include "./ext/matrix_uint3x3_sized.hpp" +#include "./ext/matrix_uint3x4.hpp" +#include "./ext/matrix_uint3x4_sized.hpp" +#include "./ext/matrix_uint4x2.hpp" +#include "./ext/matrix_uint4x2_sized.hpp" +#include "./ext/matrix_uint4x3.hpp" +#include "./ext/matrix_uint4x3_sized.hpp" +#include "./ext/matrix_uint4x4.hpp" +#include "./ext/matrix_uint4x4_sized.hpp" + +#include "./ext/matrix_projection.hpp" +#include "./ext/matrix_relational.hpp" +#include "./ext/matrix_transform.hpp" + +#include "./ext/quaternion_common.hpp" +#include "./ext/quaternion_double.hpp" +#include "./ext/quaternion_double_precision.hpp" +#include "./ext/quaternion_float.hpp" +#include "./ext/quaternion_float_precision.hpp" +#include "./ext/quaternion_exponential.hpp" +#include "./ext/quaternion_geometric.hpp" +#include "./ext/quaternion_relational.hpp" +#include "./ext/quaternion_transform.hpp" +#include "./ext/quaternion_trigonometric.hpp" + +#include "./ext/scalar_common.hpp" +#include "./ext/scalar_constants.hpp" +#include "./ext/scalar_integer.hpp" +#include "./ext/scalar_packing.hpp" +#include "./ext/scalar_relational.hpp" +#include "./ext/scalar_ulp.hpp" + +#include "./ext/scalar_int_sized.hpp" +#include "./ext/scalar_uint_sized.hpp" + +#include "./ext/vector_common.hpp" +#include "./ext/vector_integer.hpp" +#include "./ext/vector_packing.hpp" +#include "./ext/vector_relational.hpp" +#include "./ext/vector_ulp.hpp" + +#include "./ext/vector_bool1.hpp" +#include "./ext/vector_bool1_precision.hpp" +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" + +#include "./ext/vector_double1.hpp" +#include "./ext/vector_double1_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" + +#include "./ext/vector_float1.hpp" +#include "./ext/vector_float1_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" + +#include "./ext/vector_int1.hpp" +#include "./ext/vector_int1_sized.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" + +#include "./ext/vector_uint1.hpp" +#include "./ext/vector_uint1_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" + +#include "./gtc/bitfield.hpp" +#include "./gtc/color_space.hpp" +#include "./gtc/constants.hpp" +#include "./gtc/epsilon.hpp" +#include "./gtc/integer.hpp" +#include "./gtc/matrix_access.hpp" +#include "./gtc/matrix_integer.hpp" +#include "./gtc/matrix_inverse.hpp" +#include "./gtc/matrix_transform.hpp" +#include "./gtc/noise.hpp" +#include "./gtc/packing.hpp" +#include "./gtc/quaternion.hpp" +#include "./gtc/random.hpp" +#include "./gtc/reciprocal.hpp" +#include "./gtc/round.hpp" +#include "./gtc/type_precision.hpp" +#include "./gtc/type_ptr.hpp" +#include "./gtc/ulp.hpp" +#include "./gtc/vec1.hpp" +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# include "./gtc/type_aligned.hpp" +#endif + +#ifdef GLM_ENABLE_EXPERIMENTAL +#include "./gtx/associated_min_max.hpp" +#include "./gtx/bit.hpp" +#include "./gtx/closest_point.hpp" +#include "./gtx/color_encoding.hpp" +#include "./gtx/color_space.hpp" +#include "./gtx/color_space_YCoCg.hpp" +#include "./gtx/compatibility.hpp" +#include "./gtx/component_wise.hpp" +#include "./gtx/dual_quaternion.hpp" +#include "./gtx/euler_angles.hpp" +#include "./gtx/extend.hpp" +#include "./gtx/extended_min_max.hpp" +#include "./gtx/fast_exponential.hpp" +#include "./gtx/fast_square_root.hpp" +#include "./gtx/fast_trigonometry.hpp" +#include "./gtx/functions.hpp" +#include "./gtx/gradient_paint.hpp" +#include "./gtx/handed_coordinate_space.hpp" +#include "./gtx/integer.hpp" +#include "./gtx/intersect.hpp" +#include "./gtx/log_base.hpp" +#include "./gtx/matrix_cross_product.hpp" +#include "./gtx/matrix_interpolation.hpp" +#include "./gtx/matrix_major_storage.hpp" +#include "./gtx/matrix_operation.hpp" +#include "./gtx/matrix_query.hpp" +#include "./gtx/mixed_product.hpp" +#include "./gtx/norm.hpp" +#include "./gtx/normal.hpp" +#include "./gtx/normalize_dot.hpp" +#include "./gtx/number_precision.hpp" +#include "./gtx/optimum_pow.hpp" +#include "./gtx/orthonormalize.hpp" +#include "./gtx/perpendicular.hpp" +#include "./gtx/polar_coordinates.hpp" +#include "./gtx/projection.hpp" +#include "./gtx/quaternion.hpp" +#include "./gtx/raw_data.hpp" +#include "./gtx/rotate_vector.hpp" +#include "./gtx/spline.hpp" +#include "./gtx/std_based_type.hpp" +#if !(GLM_COMPILER & GLM_COMPILER_CUDA) +# include "./gtx/string_cast.hpp" +#endif +#include "./gtx/transform.hpp" +#include "./gtx/transform2.hpp" +#include "./gtx/vec_swizzle.hpp" +#include "./gtx/vector_angle.hpp" +#include "./gtx/vector_query.hpp" +#include "./gtx/wrap.hpp" + +#if GLM_HAS_TEMPLATE_ALIASES +# include "./gtx/scalar_multiplication.hpp" +#endif + +#if GLM_HAS_RANGE_FOR +# include "./gtx/range.hpp" +#endif +#endif//GLM_ENABLE_EXPERIMENTAL diff --git a/include/glm/glm/ext/matrix_clip_space.hpp b/include/glm/glm/ext/matrix_clip_space.hpp new file mode 100644 index 00000000..c3874f2f --- /dev/null +++ b/include/glm/glm/ext/matrix_clip_space.hpp @@ -0,0 +1,522 @@ +/// @ref ext_matrix_clip_space +/// @file glm/ext/matrix_clip_space.hpp +/// +/// @defgroup ext_matrix_clip_space GLM_EXT_matrix_clip_space +/// @ingroup ext +/// +/// Defines functions that generate clip space transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_projection + +#pragma once + +// Dependencies +#include "../ext/scalar_constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_clip_space extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_clip_space + /// @{ + + /// Creates a matrix for projecting two-dimensional coordinates onto the screen. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar) + /// @see gluOrtho2D man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoNO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + /// @see glOrtho man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a left handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumNO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// @see glFrustum man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( + T left, T right, T bottom, T top, T near, T far); + + + /// Creates a matrix for a right handed, symetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right handed, symetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left handed, symetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left handed, symetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveNO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right handed, symetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left handed, symetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + /// @see gluPerspective man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( + T fovy, T aspect, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovNO( + T fov, T width, T height, T near, T far); + + /// Builds a right handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( + T fov, T width, T height, T near, T far); + + /// Builds a left handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( + T fov, T width, T height, T near, T far); + + /// Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( + T fovy, T aspect, T near); + + /// Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param ep Epsilon + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near, T ep); + + /// @} +}//namespace glm + +#include "matrix_clip_space.inl" diff --git a/include/glm/glm/ext/matrix_clip_space.inl b/include/glm/glm/ext/matrix_clip_space.inl new file mode 100644 index 00000000..7e4df330 --- /dev/null +++ b/include/glm/glm/ext/matrix_clip_space.inl @@ -0,0 +1,555 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top) + { + mat<4, 4, T, defaultp> Result(static_cast(1)); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = farVal / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = farVal / (nearVal - farVal); + Result[2][3] = static_cast(-1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(-1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[2][3] = - static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(T(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = static_cast(1); + Result[2][3] = static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return infinitePerspectiveLH(fovy, aspect, zNear); +# else + return infinitePerspectiveRH(fovy, aspect, zNear); +# endif + } + + // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = ep - static_cast(1); + Result[2][3] = static_cast(-1); + Result[3][2] = (ep - static_cast(2)) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) + { + return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); + } +}//namespace glm diff --git a/include/glm/glm/ext/matrix_common.hpp b/include/glm/glm/ext/matrix_common.hpp new file mode 100644 index 00000000..05c37991 --- /dev/null +++ b/include/glm/glm/ext/matrix_common.hpp @@ -0,0 +1,36 @@ +/// @ref ext_matrix_common +/// @file glm/ext/matrix_common.hpp +/// +/// @defgroup ext_matrix_common GLM_EXT_matrix_common +/// @ingroup ext +/// +/// Defines functions for common matrix operations. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_common + +#pragma once + +#include "../detail/qualifier.hpp" +#include "../detail/_fixes.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_common + /// @{ + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); + + /// @} +}//namespace glm + +#include "matrix_common.inl" diff --git a/include/glm/glm/ext/matrix_common.inl b/include/glm/glm/ext/matrix_common.inl new file mode 100644 index 00000000..9d508485 --- /dev/null +++ b/include/glm/glm/ext/matrix_common.inl @@ -0,0 +1,16 @@ +#include "../matrix.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) + { + return mat(x) * (static_cast(1) - a) + mat(y) * a; + } + + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) + { + return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); + } +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x2.hpp b/include/glm/glm/ext/matrix_double2x2.hpp new file mode 100644 index 00000000..94dca54b --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x2_precision.hpp b/include/glm/glm/ext/matrix_double2x2_precision.hpp new file mode 100644 index 00000000..9e2c174e --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x3.hpp b/include/glm/glm/ext/matrix_double2x3.hpp new file mode 100644 index 00000000..bfef87a6 --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, double, defaultp> dmat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x3_precision.hpp b/include/glm/glm/ext/matrix_double2x3_precision.hpp new file mode 100644 index 00000000..098fb604 --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, highp> highp_dmat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x4.hpp b/include/glm/glm/ext/matrix_double2x4.hpp new file mode 100644 index 00000000..499284bc --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, double, defaultp> dmat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double2x4_precision.hpp b/include/glm/glm/ext/matrix_double2x4_precision.hpp new file mode 100644 index 00000000..9b61ebce --- /dev/null +++ b/include/glm/glm/ext/matrix_double2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, highp> highp_dmat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x2.hpp b/include/glm/glm/ext/matrix_double3x2.hpp new file mode 100644 index 00000000..dd23f36c --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, double, defaultp> dmat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x2_precision.hpp b/include/glm/glm/ext/matrix_double3x2_precision.hpp new file mode 100644 index 00000000..068d9e91 --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, highp> highp_dmat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x3.hpp b/include/glm/glm/ext/matrix_double3x3.hpp new file mode 100644 index 00000000..53572b73 --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x3_precision.hpp b/include/glm/glm/ext/matrix_double3x3_precision.hpp new file mode 100644 index 00000000..8691e780 --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x4.hpp b/include/glm/glm/ext/matrix_double3x4.hpp new file mode 100644 index 00000000..c572d637 --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, double, defaultp> dmat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double3x4_precision.hpp b/include/glm/glm/ext/matrix_double3x4_precision.hpp new file mode 100644 index 00000000..f040217e --- /dev/null +++ b/include/glm/glm/ext/matrix_double3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, highp> highp_dmat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x2.hpp b/include/glm/glm/ext/matrix_double4x2.hpp new file mode 100644 index 00000000..9b229f47 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, double, defaultp> dmat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x2_precision.hpp b/include/glm/glm/ext/matrix_double4x2_precision.hpp new file mode 100644 index 00000000..6ad18ba9 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2_precision.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, highp> highp_dmat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x3.hpp b/include/glm/glm/ext/matrix_double4x3.hpp new file mode 100644 index 00000000..dca4cf95 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, double, defaultp> dmat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x3_precision.hpp b/include/glm/glm/ext/matrix_double4x3_precision.hpp new file mode 100644 index 00000000..f7371de8 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, highp> highp_dmat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x4.hpp b/include/glm/glm/ext/matrix_double4x4.hpp new file mode 100644 index 00000000..81e1bf65 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_double4x4_precision.hpp b/include/glm/glm/ext/matrix_double4x4_precision.hpp new file mode 100644 index 00000000..4c36a848 --- /dev/null +++ b/include/glm/glm/ext/matrix_double4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x2.hpp b/include/glm/glm/ext/matrix_float2x2.hpp new file mode 100644 index 00000000..53df921f --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x2_precision.hpp b/include/glm/glm/ext/matrix_float2x2_precision.hpp new file mode 100644 index 00000000..898b6db7 --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x3.hpp b/include/glm/glm/ext/matrix_float2x3.hpp new file mode 100644 index 00000000..6f68822d --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, float, defaultp> mat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x3_precision.hpp b/include/glm/glm/ext/matrix_float2x3_precision.hpp new file mode 100644 index 00000000..50c10324 --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, lowp> lowp_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, mediump> mediump_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, highp> highp_mat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x4.hpp b/include/glm/glm/ext/matrix_float2x4.hpp new file mode 100644 index 00000000..30f30de3 --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, float, defaultp> mat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float2x4_precision.hpp b/include/glm/glm/ext/matrix_float2x4_precision.hpp new file mode 100644 index 00000000..079d6382 --- /dev/null +++ b/include/glm/glm/ext/matrix_float2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, lowp> lowp_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, mediump> mediump_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, highp> highp_mat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x2.hpp b/include/glm/glm/ext/matrix_float3x2.hpp new file mode 100644 index 00000000..d39dd2fe --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, float, defaultp> mat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x2_precision.hpp b/include/glm/glm/ext/matrix_float3x2_precision.hpp new file mode 100644 index 00000000..8572c2a1 --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, lowp> lowp_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, mediump> mediump_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, highp> highp_mat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x3.hpp b/include/glm/glm/ext/matrix_float3x3.hpp new file mode 100644 index 00000000..177d809f --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x3_precision.hpp b/include/glm/glm/ext/matrix_float3x3_precision.hpp new file mode 100644 index 00000000..8a900c16 --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x4.hpp b/include/glm/glm/ext/matrix_float3x4.hpp new file mode 100644 index 00000000..64b8459d --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, float, defaultp> mat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float3x4_precision.hpp b/include/glm/glm/ext/matrix_float3x4_precision.hpp new file mode 100644 index 00000000..bc36bf13 --- /dev/null +++ b/include/glm/glm/ext/matrix_float3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, lowp> lowp_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, mediump> mediump_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, highp> highp_mat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x2.hpp b/include/glm/glm/ext/matrix_float4x2.hpp new file mode 100644 index 00000000..1ed5227b --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, float, defaultp> mat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x2_precision.hpp b/include/glm/glm/ext/matrix_float4x2_precision.hpp new file mode 100644 index 00000000..88fd0696 --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, lowp> lowp_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, mediump> mediump_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, highp> highp_mat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x3.hpp b/include/glm/glm/ext/matrix_float4x3.hpp new file mode 100644 index 00000000..5dbe7657 --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, float, defaultp> mat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x3_precision.hpp b/include/glm/glm/ext/matrix_float4x3_precision.hpp new file mode 100644 index 00000000..846ed4fc --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, lowp> lowp_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, mediump> mediump_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, highp> highp_mat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x4.hpp b/include/glm/glm/ext/matrix_float4x4.hpp new file mode 100644 index 00000000..5ba111de --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @ingroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_float4x4_precision.hpp b/include/glm/glm/ext/matrix_float4x4_precision.hpp new file mode 100644 index 00000000..597149bc --- /dev/null +++ b/include/glm/glm/ext/matrix_float4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x2.hpp b/include/glm/glm/ext/matrix_int2x2.hpp new file mode 100644 index 00000000..c6aa0686 --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int2x2 +/// @file glm/ext/matrix_int2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2 GLM_EXT_matrix_int2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2 + /// @{ + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2x2; + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x2_sized.hpp b/include/glm/glm/ext/matrix_int2x2_sized.hpp new file mode 100644 index 00000000..70c0c210 --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int2x2_sized +/// @file glm/ext/matrix_int2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2_sized GLM_EXT_matrix_int2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2_sized + /// @{ + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2x2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2x2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2x2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2x2; + + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x3.hpp b/include/glm/glm/ext/matrix_int2x3.hpp new file mode 100644 index 00000000..aee415ca --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x3 +/// @file glm/ext/matrix_int2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_int2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3 + /// @{ + + /// Signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3 + typedef mat<2, 3, int, defaultp> imat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x3_sized.hpp b/include/glm/glm/ext/matrix_int2x3_sized.hpp new file mode 100644 index 00000000..b5526fe5 --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x3_sized +/// @file glm/ext/matrix_int2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3_sized GLM_EXT_matrix_int2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3_sized + /// @{ + + /// 8 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int8, defaultp> i8mat2x3; + + /// 16 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int16, defaultp> i16mat2x3; + + /// 32 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int32, defaultp> i32mat2x3; + + /// 64 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int64, defaultp> i64mat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x4.hpp b/include/glm/glm/ext/matrix_int2x4.hpp new file mode 100644 index 00000000..4f36331d --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x4 +/// @file glm/ext/matrix_int2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4 + /// @{ + + /// Signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4 + typedef mat<2, 4, int, defaultp> imat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int2x4_sized.hpp b/include/glm/glm/ext/matrix_int2x4_sized.hpp new file mode 100644 index 00000000..a66a5e72 --- /dev/null +++ b/include/glm/glm/ext/matrix_int2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x4_sized +/// @file glm/ext/matrix_int2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4_sized GLM_EXT_matrix_int2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4_sized + /// @{ + + /// 8 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int8, defaultp> i8mat2x4; + + /// 16 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int16, defaultp> i16mat2x4; + + /// 32 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int32, defaultp> i32mat2x4; + + /// 64 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int64, defaultp> i64mat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x2.hpp b/include/glm/glm/ext/matrix_int3x2.hpp new file mode 100644 index 00000000..3bd563b7 --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x2 +/// @file glm/ext/matrix_int3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_int3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2 + /// @{ + + /// Signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2 + typedef mat<3, 2, int, defaultp> imat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x2_sized.hpp b/include/glm/glm/ext/matrix_int3x2_sized.hpp new file mode 100644 index 00000000..7e34c524 --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x2_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2_sized GLM_EXT_matrix_int3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int8, defaultp> i8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int16, defaultp> i16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int32, defaultp> i32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int64, defaultp> i64mat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x3.hpp b/include/glm/glm/ext/matrix_int3x3.hpp new file mode 100644 index 00000000..287488da --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int3x3 +/// @file glm/ext/matrix_int3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3 GLM_EXT_matrix_int3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3 + /// @{ + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3x3; + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x3_sized.hpp b/include/glm/glm/ext/matrix_int3x3_sized.hpp new file mode 100644 index 00000000..577e305a --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int3x3_sized +/// @file glm/ext/matrix_int3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3_sized GLM_EXT_matrix_int3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3_sized + /// @{ + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3x3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3x3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3x3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3x3; + + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x4.hpp b/include/glm/glm/ext/matrix_int3x4.hpp new file mode 100644 index 00000000..08e534d9 --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x4 +/// @file glm/ext/matrix_int3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4 GLM_EXT_matrix_int3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4 + typedef mat<3, 4, int, defaultp> imat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int3x4_sized.hpp b/include/glm/glm/ext/matrix_int3x4_sized.hpp new file mode 100644 index 00000000..692c48c4 --- /dev/null +++ b/include/glm/glm/ext/matrix_int3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x4_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4_sized GLM_EXT_matrix_int3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4_sized + /// @{ + + /// 8 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int8, defaultp> i8mat3x4; + + /// 16 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int16, defaultp> i16mat3x4; + + /// 32 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int32, defaultp> i32mat3x4; + + /// 64 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int64, defaultp> i64mat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x2.hpp b/include/glm/glm/ext/matrix_int4x2.hpp new file mode 100644 index 00000000..f756ef28 --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x2 +/// @file glm/ext/matrix_int4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2 GLM_EXT_matrix_int4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2 + /// @{ + + /// Signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2 + typedef mat<4, 2, int, defaultp> imat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x2_sized.hpp b/include/glm/glm/ext/matrix_int4x2_sized.hpp new file mode 100644 index 00000000..63a99d60 --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x2_sized +/// @file glm/ext/matrix_int4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2_sized GLM_EXT_matrix_int4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2_sized + /// @{ + + /// 8 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int8, defaultp> i8mat4x2; + + /// 16 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int16, defaultp> i16mat4x2; + + /// 32 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int32, defaultp> i32mat4x2; + + /// 64 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int64, defaultp> i64mat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x3.hpp b/include/glm/glm/ext/matrix_int4x3.hpp new file mode 100644 index 00000000..d5d97a7a --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x3 +/// @file glm/ext/matrix_int4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3 GLM_EXT_matrix_int4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3 + /// @{ + + /// Signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3 + typedef mat<4, 3, int, defaultp> imat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x3_sized.hpp b/include/glm/glm/ext/matrix_int4x3_sized.hpp new file mode 100644 index 00000000..55078fad --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x3_sized +/// @file glm/ext/matrix_int4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3_sized GLM_EXT_matrix_int4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3_sized + /// @{ + + /// 8 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int8, defaultp> i8mat4x3; + + /// 16 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int16, defaultp> i16mat4x3; + + /// 32 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int32, defaultp> i32mat4x3; + + /// 64 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int64, defaultp> i64mat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x4.hpp b/include/glm/glm/ext/matrix_int4x4.hpp new file mode 100644 index 00000000..e17cff17 --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int4x4 +/// @file glm/ext/matrix_int4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4 GLM_EXT_matrix_int4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4 + /// @{ + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4x4; + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_int4x4_sized.hpp b/include/glm/glm/ext/matrix_int4x4_sized.hpp new file mode 100644 index 00000000..4a11203e --- /dev/null +++ b/include/glm/glm/ext/matrix_int4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int4x4_sized +/// @file glm/ext/matrix_int4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4_sized GLM_EXT_matrix_int4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4_sized + /// @{ + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_projection.hpp b/include/glm/glm/ext/matrix_projection.hpp new file mode 100644 index 00000000..51fd01bd --- /dev/null +++ b/include/glm/glm/ext/matrix_projection.hpp @@ -0,0 +1,149 @@ +/// @ref ext_matrix_projection +/// @file glm/ext/matrix_projection.hpp +/// +/// @defgroup ext_matrix_projection GLM_EXT_matrix_projection +/// @ingroup ext +/// +/// Functions that generate common projection transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_projection extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_projection + /// @{ + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectZO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectNO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> project( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectZO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectNO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProject( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Define a picking region + /// + /// @param center Specify the center of a picking region in window coordinates. + /// @param delta Specify the width and height, respectively, of the picking region in window coordinates. + /// @param viewport Rendering viewport + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluPickMatrix man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( + vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport); + + /// @} +}//namespace glm + +#include "matrix_projection.inl" diff --git a/include/glm/glm/ext/matrix_projection.inl b/include/glm/glm/ext/matrix_projection.inl new file mode 100644 index 00000000..2f2c196a --- /dev/null +++ b/include/glm/glm/ext/matrix_projection.inl @@ -0,0 +1,106 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectZO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp.x = tmp.x * static_cast(0.5) + static_cast(0.5); + tmp.y = tmp.y * static_cast(0.5) + static_cast(0.5); + + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectNO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp = tmp * static_cast(0.5) + static_cast(0.5); + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return projectZO(obj, model, proj, viewport); +# else + return projectNO(obj, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectZO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp.x = tmp.x * static_cast(2) - static_cast(1); + tmp.y = tmp.y * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectNO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp = tmp * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return unProjectZO(win, model, proj, viewport); +# else + return unProjectNO(win, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) + { + assert(delta.x > static_cast(0) && delta.y > static_cast(0)); + mat<4, 4, T, Q> Result(static_cast(1)); + + if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) + return Result; // Error + + vec<3, T, Q> Temp( + (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, + (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, + static_cast(0)); + + // Translate and scale the picked region to the entire window + Result = translate(Result, Temp); + return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); + } +}//namespace glm diff --git a/include/glm/glm/ext/matrix_relational.hpp b/include/glm/glm/ext/matrix_relational.hpp new file mode 100644 index 00000000..20023ad8 --- /dev/null +++ b/include/glm/glm/ext/matrix_relational.hpp @@ -0,0 +1,132 @@ +/// @ref ext_matrix_relational +/// @file glm/ext/matrix_relational.hpp +/// +/// @defgroup ext_matrix_relational GLM_EXT_matrix_relational +/// @ingroup ext +/// +/// Exposes comparison functions for matrix types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_relational +/// @see ext_scalar_relational +/// @see ext_quaternion_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_relational + /// @{ + + /// Perform a component-wise equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y); + + /// Perform a component-wise not-equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& ULPs); + + /// @} +}//namespace glm + +#include "matrix_relational.inl" diff --git a/include/glm/glm/ext/matrix_relational.inl b/include/glm/glm/ext/matrix_relational.inl new file mode 100644 index 00000000..b2b87530 --- /dev/null +++ b/include/glm/glm/ext/matrix_relational.inl @@ -0,0 +1,82 @@ +/// @ref ext_vector_relational +/// @file glm/ext/vector_relational.inl + +// Dependency: +#include "../ext/vector_relational.hpp" +#include "../common.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b) + { + return equal(a, b, static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, T Epsilon) + { + return equal(a, b, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y) + { + return notEqual(x, y, static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, T Epsilon) + { + return notEqual(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, int MaxULPs) + { + return equal(a, b, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], MaxULPs[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int MaxULPs) + { + return notEqual(x, y, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], MaxULPs[i])); + return Result; + } + +}//namespace glm diff --git a/include/glm/glm/ext/matrix_transform.hpp b/include/glm/glm/ext/matrix_transform.hpp new file mode 100644 index 00000000..cbd187ef --- /dev/null +++ b/include/glm/glm/ext/matrix_transform.hpp @@ -0,0 +1,144 @@ +/// @ref ext_matrix_transform +/// @file glm/ext/matrix_transform.hpp +/// +/// @defgroup ext_matrix_transform GLM_EXT_matrix_transform +/// @ingroup ext +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_projection +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_transform + /// @{ + + /// Builds an identity matrix. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType identity(); + + /// Builds a translation 4 * 4 matrix created from a vector of 3 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a translation vector. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @code + /// #include + /// #include + /// ... + /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); + /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f + /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f + /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f + /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f + /// @endcode + /// + /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - translate(vec<3, T, Q> const& v) + /// @see glTranslate man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. + /// + /// @param m Input matrix multiplied by this rotation matrix. + /// @param angle Rotation angle expressed in radians. + /// @param axis Rotation axis, recommended to be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + /// @see glRotate man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis); + + /// Builds a scale 4 * 4 matrix created from 3 scalars. + /// + /// @param m Input matrix multiplied by this scale matrix. + /// @param v Ratio of scaling for each axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - scale(vec<3, T, Q> const& v) + /// @see glScale man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Build a right handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a left handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a look at view matrix based on the default handedness. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + /// @see gluLookAt man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// @} +}//namespace glm + +#include "matrix_transform.inl" diff --git a/include/glm/glm/ext/matrix_transform.inl b/include/glm/glm/ext/matrix_transform.inl new file mode 100644 index 00000000..a415157e --- /dev/null +++ b/include/glm/glm/ext/matrix_transform.inl @@ -0,0 +1,152 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType identity() + { + return detail::init_gentype::GENTYPE>::identity(); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(m); + Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + vec<3, T, Q> axis(normalize(v)); + vec<3, T, Q> temp((T(1) - c) * axis); + + mat<4, 4, T, Q> Rotate; + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + mat<4, 4, T, Q> Result; + + vec<3, T, Q> axis = normalize(v); + + Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; + Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; + Result[0][2] = (static_cast(1) - c) * axis.x * axis.z - s * axis.y; + Result[0][3] = static_cast(0); + + Result[1][0] = (static_cast(1) - c) * axis.y * axis.x - s * axis.z; + Result[1][1] = c + (static_cast(1) - c) * axis.y * axis.y; + Result[1][2] = (static_cast(1) - c) * axis.y * axis.z + s * axis.x; + Result[1][3] = static_cast(0); + + Result[2][0] = (static_cast(1) - c) * axis.z * axis.x + s * axis.y; + Result[2][1] = (static_cast(1) - c) * axis.z * axis.y - s * axis.x; + Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; + Result[2][3] = static_cast(0); + + Result[3] = vec<4, T, Q>(0, 0, 0, 1); + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result; + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2] * v[2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(T(1)); + Result[0][0] = v.x; + Result[1][1] = v.y; + Result[2][2] = v.z; + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(f, up))); + vec<3, T, Q> const u(cross(s, f)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] =-f.x; + Result[1][2] =-f.y; + Result[2][2] =-f.z; + Result[3][0] =-dot(s, eye); + Result[3][1] =-dot(u, eye); + Result[3][2] = dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(up, f))); + vec<3, T, Q> const u(cross(f, s)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] = f.x; + Result[1][2] = f.y; + Result[2][2] = f.z; + Result[3][0] = -dot(s, eye); + Result[3][1] = -dot(u, eye); + Result[3][2] = -dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + GLM_IF_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) + return lookAtLH(eye, center, up); + else + return lookAtRH(eye, center, up); + } +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x2.hpp b/include/glm/glm/ext/matrix_uint2x2.hpp new file mode 100644 index 00000000..034771ae --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint2x2 +/// @file glm/ext/matrix_uint2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2 GLM_EXT_matrix_uint2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2 + /// @{ + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2x2; + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x2_sized.hpp b/include/glm/glm/ext/matrix_uint2x2_sized.hpp new file mode 100644 index 00000000..4555324d --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint2x2_sized +/// @file glm/ext/matrix_uint2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2_sized GLM_EXT_matrix_uint2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2_sized + /// @{ + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x3.hpp b/include/glm/glm/ext/matrix_uint2x3.hpp new file mode 100644 index 00000000..7de62f6f --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x3 +/// @file glm/ext/matrix_uint2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_uint2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3 + /// @{ + + /// Unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3 + typedef mat<2, 3, uint, defaultp> umat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x3_sized.hpp b/include/glm/glm/ext/matrix_uint2x3_sized.hpp new file mode 100644 index 00000000..db7939c9 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x3_sized +/// @file glm/ext/matrix_uint2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x3_sized GLM_EXT_matrix_uint2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3_sized + /// @{ + + /// 8 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + + /// 16 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + + /// 32 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + + /// 64 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x4.hpp b/include/glm/glm/ext/matrix_uint2x4.hpp new file mode 100644 index 00000000..0f993509 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x4 +/// @file glm/ext/matrix_uint2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4 + /// @{ + + /// Unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4 + typedef mat<2, 4, uint, defaultp> umat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint2x4_sized.hpp b/include/glm/glm/ext/matrix_uint2x4_sized.hpp new file mode 100644 index 00000000..5cb8e546 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x4_sized +/// @file glm/ext/matrixu_uint2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4_sized GLM_EXT_matrix_uint2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4_sized + /// @{ + + /// 8 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + + /// 16 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + + /// 32 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + + /// 64 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x2.hpp b/include/glm/glm/ext/matrix_uint3x2.hpp new file mode 100644 index 00000000..47f48737 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x2 +/// @file glm/ext/matrix_uint3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_uint3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2 + /// @{ + + /// Unsigned integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2 + typedef mat<3, 2, uint, defaultp> umat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x2_sized.hpp b/include/glm/glm/ext/matrix_uint3x2_sized.hpp new file mode 100644 index 00000000..c81af8f9 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x2_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x2_sized GLM_EXT_matrix_uint3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x3.hpp b/include/glm/glm/ext/matrix_uint3x3.hpp new file mode 100644 index 00000000..1004c0d2 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint3x3 +/// @file glm/ext/matrix_uint3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3 GLM_EXT_matrix_uint3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3 + /// @{ + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3x3; + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x3_sized.hpp b/include/glm/glm/ext/matrix_uint3x3_sized.hpp new file mode 100644 index 00000000..41a8be74 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint3x3_sized +/// @file glm/ext/matrix_uint3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3_sized GLM_EXT_matrix_uint3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3_sized + /// @{ + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x4.hpp b/include/glm/glm/ext/matrix_uint3x4.hpp new file mode 100644 index 00000000..c6dd78c4 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x4 +/// @file glm/ext/matrix_uint3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4 GLM_EXT_matrix_uint3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4 + typedef mat<3, 4, uint, defaultp> umat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint3x4_sized.hpp b/include/glm/glm/ext/matrix_uint3x4_sized.hpp new file mode 100644 index 00000000..2ce28ad8 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x4_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4_sized GLM_EXT_matrix_uint3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4_sized + /// @{ + + /// 8 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + + /// 16 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + + /// 32 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + + /// 64 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x2.hpp b/include/glm/glm/ext/matrix_uint4x2.hpp new file mode 100644 index 00000000..0446f574 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x2 +/// @file glm/ext/matrix_uint4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2 GLM_EXT_matrix_uint4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2 + /// @{ + + /// Unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2 + typedef mat<4, 2, uint, defaultp> umat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x2_sized.hpp b/include/glm/glm/ext/matrix_uint4x2_sized.hpp new file mode 100644 index 00000000..57a66bf9 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x2_sized +/// @file glm/ext/matrix_uint4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2_sized GLM_EXT_matrix_uint4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2_sized + /// @{ + + /// 8 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + + /// 16 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + + /// 32 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + + /// 64 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x3.hpp b/include/glm/glm/ext/matrix_uint4x3.hpp new file mode 100644 index 00000000..54c24e4e --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x3 +/// @file glm/ext/matrix_uint4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3 GLM_EXT_matrix_uint4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3 + /// @{ + + /// Unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3 + typedef mat<4, 3, uint, defaultp> umat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x3_sized.hpp b/include/glm/glm/ext/matrix_uint4x3_sized.hpp new file mode 100644 index 00000000..2e61124d --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x3_sized +/// @file glm/ext/matrix_uint4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3_sized GLM_EXT_matrix_uint4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3_sized + /// @{ + + /// 8 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + + /// 16 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + + /// 32 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + + /// 64 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x4.hpp b/include/glm/glm/ext/matrix_uint4x4.hpp new file mode 100644 index 00000000..5cc84553 --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint4x4 +/// @file glm/ext/matrix_uint4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4 GLM_EXT_matrix_uint4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4 + /// @{ + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4x4; + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/matrix_uint4x4_sized.hpp b/include/glm/glm/ext/matrix_uint4x4_sized.hpp new file mode 100644 index 00000000..bb10bd2b --- /dev/null +++ b/include/glm/glm/ext/matrix_uint4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint4x4_sized +/// @file glm/ext/matrix_uint4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4_sized GLM_EXT_matrix_uint4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4_sized + /// @{ + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/quaternion_common.hpp b/include/glm/glm/ext/quaternion_common.hpp new file mode 100644 index 00000000..f519d559 --- /dev/null +++ b/include/glm/glm/ext/quaternion_common.hpp @@ -0,0 +1,135 @@ +/// @ref ext_quaternion_common +/// @file glm/ext/quaternion_common.hpp +/// +/// @defgroup ext_quaternion_common GLM_EXT_quaternion_common +/// @ingroup ext +/// +/// Provides common functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_common +/// @see ext_vector_common +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../ext/scalar_constants.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_common + /// @{ + + /// Spherical linear interpolation of two quaternions. + /// The interpolation is oriented and the rotation is performed at constant speed. + /// For short path spherical linear interpolation, use the slerp function. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - slerp(qua const& x, qua const& y, T const& a) + template + GLM_FUNC_DECL qua mix(qua const& x, qua const& y, T a); + + /// Linear interpolation of two quaternions. + /// The interpolation is oriented. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua lerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions. + /// The interpolation always take the short path and the rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions with multiple spins over rotation axis. + /// The interpolation always take the short path when the spin count is positive and long path + /// when count is negative. Rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// @param k Additional spin count. If Value is negative interpolation will be on "long" path. + /// + /// @tparam T A floating-point scalar type + /// @tparam S An integer scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a, S k); + + /// Returns the q conjugate. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua conjugate(qua const& q); + + /// Returns the q inverse. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua inverse(qua const& q); + + /// Returns true if x holds a NaN (not a number) + /// representation in the underlying implementation's set of + /// floating point representations. Returns false otherwise, + /// including for implementations with no NaN + /// representations. + /// + /// /!\ When using compiler fast math, this function may fail. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isnan(qua const& x); + + /// Returns true if x holds a positive infinity or negative + /// infinity representation in the underlying implementation's + /// set of floating point representations. Returns false + /// otherwise, including for implementations with no infinity + /// representations. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isinf(qua const& x); + + /// @} +} //namespace glm + +#include "quaternion_common.inl" diff --git a/include/glm/glm/ext/quaternion_common.inl b/include/glm/glm/ext/quaternion_common.inl new file mode 100644 index 00000000..0e4a3bb2 --- /dev/null +++ b/include/glm/glm/ext/quaternion_common.inl @@ -0,0 +1,144 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua mix(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs"); + + T const cosTheta = dot(x, y); + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, y.w, a), + mix(x.x, y.x, a), + mix(x.y, y.y, a), + mix(x.z, y.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua lerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'lerp' only accept floating-point inputs"); + + // Lerp is only defined in [0, 1] + assert(a >= static_cast(0)); + assert(a <= static_cast(1)); + + return x * (static_cast(1) - a) + (y * a); + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if(cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a, S k) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'slerp' only accept integer for spin count"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if (cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if (cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Graphics Gems III, page 96 + T angle = acos(cosTheta); + T phi = angle + k * glm::pi(); + return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua conjugate(qua const& q) + { + return qua(q.w, -q.x, -q.y, -q.z); + } + + template + GLM_FUNC_QUALIFIER qua inverse(qua const& q) + { + return conjugate(q) / dot(q, q); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + + return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + + return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "quaternion_common_simd.inl" +#endif + diff --git a/include/glm/glm/ext/quaternion_common_simd.inl b/include/glm/glm/ext/quaternion_common_simd.inl new file mode 100644 index 00000000..ddfc8a44 --- /dev/null +++ b/include/glm/glm/ext/quaternion_common_simd.inl @@ -0,0 +1,18 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_dot, float, true> + { + static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) + { + return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/include/glm/glm/ext/quaternion_double.hpp b/include/glm/glm/ext/quaternion_double.hpp new file mode 100644 index 00000000..63b24de4 --- /dev/null +++ b/include/glm/glm/ext/quaternion_double.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_double +/// @file glm/ext/quaternion_double.hpp +/// +/// @defgroup ext_quaternion_double GLM_EXT_quaternion_double +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double + /// @{ + + /// Quaternion of double-precision floating-point numbers. + typedef qua dquat; + + /// @} +} //namespace glm + diff --git a/include/glm/glm/ext/quaternion_double_precision.hpp b/include/glm/glm/ext/quaternion_double_precision.hpp new file mode 100644 index 00000000..8aa24a17 --- /dev/null +++ b/include/glm/glm/ext/quaternion_double_precision.hpp @@ -0,0 +1,42 @@ +/// @ref ext_quaternion_double_precision +/// @file glm/ext/quaternion_double_precision.hpp +/// +/// @defgroup ext_quaternion_double_precision GLM_EXT_quaternion_double_precision +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double_precision + /// @{ + + /// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua lowp_dquat; + + /// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua mediump_dquat; + + /// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua highp_dquat; + + /// @} +} //namespace glm + diff --git a/include/glm/glm/ext/quaternion_exponential.hpp b/include/glm/glm/ext/quaternion_exponential.hpp new file mode 100644 index 00000000..affe2979 --- /dev/null +++ b/include/glm/glm/ext/quaternion_exponential.hpp @@ -0,0 +1,63 @@ +/// @ref ext_quaternion_exponential +/// @file glm/ext/quaternion_exponential.hpp +/// +/// @defgroup ext_quaternion_exponential GLM_EXT_quaternion_exponential +/// @ingroup ext +/// +/// Provides exponential functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_exponential +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" +#include "../ext/scalar_constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_exponential extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Returns a exponential of a quaternion. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua exp(qua const& q); + + /// Returns a logarithm of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua log(qua const& q); + + /// Returns a quaternion raised to a power. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua pow(qua const& q, T y); + + /// Returns the square root of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua sqrt(qua const& q); + + /// @} +} //namespace glm + +#include "quaternion_exponential.inl" diff --git a/include/glm/glm/ext/quaternion_exponential.inl b/include/glm/glm/ext/quaternion_exponential.inl new file mode 100644 index 00000000..8456c00a --- /dev/null +++ b/include/glm/glm/ext/quaternion_exponential.inl @@ -0,0 +1,85 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua exp(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T const Angle = glm::length(u); + if (Angle < epsilon()) + return qua(); + + vec<3, T, Q> const v(u / Angle); + return qua(cos(Angle), sin(Angle) * v); + } + + template + GLM_FUNC_QUALIFIER qua log(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T Vec3Len = length(u); + + if (Vec3Len < epsilon()) + { + if(q.w > static_cast(0)) + return qua(log(q.w), static_cast(0), static_cast(0), static_cast(0)); + else if(q.w < static_cast(0)) + return qua(log(-q.w), pi(), static_cast(0), static_cast(0)); + else + return qua(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + } + else + { + T t = atan(Vec3Len, T(q.w)) / Vec3Len; + T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; + return qua(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); + } + } + + template + GLM_FUNC_QUALIFIER qua pow(qua const& x, T y) + { + //Raising to the power of 0 should yield 1 + //Needed to prevent a division by 0 error later on + if(y > -epsilon() && y < epsilon()) + return qua(1,0,0,0); + + //To deal with non-unit quaternions + T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); + + T Angle; + if(abs(x.w / magnitude) > cos_one_over_two()) + { + //Scalar component is close to 1; using it to recover angle would lose precision + //Instead, we use the non-scalar components since sin() is accurate around 0 + + //Prevent a division by 0 error later on + T VectorMagnitude = x.x * x.x + x.y * x.y + x.z * x.z; + if (glm::abs(VectorMagnitude - static_cast(0)) < glm::epsilon()) { + //Equivalent to raising a real number to a power + return qua(pow(x.w, y), 0, 0, 0); + } + + Angle = asin(sqrt(VectorMagnitude) / magnitude); + } + else + { + //Scalar component is small, shouldn't cause loss of precision + Angle = acos(x.w / magnitude); + } + + T NewAngle = Angle * y; + T Div = sin(NewAngle) / sin(Angle); + T Mag = pow(magnitude, y - static_cast(1)); + return qua(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + } + + template + GLM_FUNC_QUALIFIER qua sqrt(qua const& x) + { + return pow(x, static_cast(0.5)); + } +}//namespace glm + + diff --git a/include/glm/glm/ext/quaternion_float.hpp b/include/glm/glm/ext/quaternion_float.hpp new file mode 100644 index 00000000..ca42a605 --- /dev/null +++ b/include/glm/glm/ext/quaternion_float.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_float +/// @file glm/ext/quaternion_float.hpp +/// +/// @defgroup ext_quaternion_float GLM_EXT_quaternion_float +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_double +/// @see ext_quaternion_float_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float + /// @{ + + /// Quaternion of single-precision floating-point numbers. + typedef qua quat; + + /// @} +} //namespace glm + diff --git a/include/glm/glm/ext/quaternion_float_precision.hpp b/include/glm/glm/ext/quaternion_float_precision.hpp new file mode 100644 index 00000000..f9e4f5c2 --- /dev/null +++ b/include/glm/glm/ext/quaternion_float_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_quaternion_float_precision +/// @file glm/ext/quaternion_float_precision.hpp +/// +/// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float_precision + /// @{ + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua lowp_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua mediump_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua highp_quat; + + /// @} +} //namespace glm + diff --git a/include/glm/glm/ext/quaternion_geometric.hpp b/include/glm/glm/ext/quaternion_geometric.hpp new file mode 100644 index 00000000..6d98bbe9 --- /dev/null +++ b/include/glm/glm/ext/quaternion_geometric.hpp @@ -0,0 +1,70 @@ +/// @ref ext_quaternion_geometric +/// @file glm/ext/quaternion_geometric.hpp +/// +/// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric +/// @ingroup ext +/// +/// Provides geometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_geometric +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "../ext/vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_geometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_geometric + /// @{ + + /// Returns the norm of a quaternions + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL T length(qua const& q); + + /// Returns the normalized quaternion. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL qua normalize(qua const& q); + + /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... + /// + /// @tparam T Floating-point scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL T dot(qua const& x, qua const& y); + + /// Compute a cross product. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2); + + /// @} +} //namespace glm + +#include "quaternion_geometric.inl" diff --git a/include/glm/glm/ext/quaternion_geometric.inl b/include/glm/glm/ext/quaternion_geometric.inl new file mode 100644 index 00000000..e155ac52 --- /dev/null +++ b/include/glm/glm/ext/quaternion_geometric.inl @@ -0,0 +1,36 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER T dot(qua const& x, qua const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER T length(qua const& q) + { + return glm::sqrt(dot(q, q)); + } + + template + GLM_FUNC_QUALIFIER qua normalize(qua const& q) + { + T len = length(q); + if(len <= static_cast(0)) // Problem + return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + T oneOverLen = static_cast(1) / len; + return qua(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + } + + template + GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) + { + return qua( + q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, + q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, + q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, + q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); + } +}//namespace glm + diff --git a/include/glm/glm/ext/quaternion_relational.hpp b/include/glm/glm/ext/quaternion_relational.hpp new file mode 100644 index 00000000..7aa121da --- /dev/null +++ b/include/glm/glm/ext/quaternion_relational.hpp @@ -0,0 +1,62 @@ +/// @ref ext_quaternion_relational +/// @file glm/ext/quaternion_relational.hpp +/// +/// @defgroup ext_quaternion_relational GLM_EXT_quaternion_relational +/// @ingroup ext +/// +/// Exposes comparison functions for quaternion types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_relational + /// @{ + + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon); + + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon); + + /// @} +} //namespace glm + +#include "quaternion_relational.inl" diff --git a/include/glm/glm/ext/quaternion_relational.inl b/include/glm/glm/ext/quaternion_relational.inl new file mode 100644 index 00000000..b1713e95 --- /dev/null +++ b/include/glm/glm/ext/quaternion_relational.inl @@ -0,0 +1,35 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); + } +}//namespace glm + diff --git a/include/glm/glm/ext/quaternion_transform.hpp b/include/glm/glm/ext/quaternion_transform.hpp new file mode 100644 index 00000000..a9cc5c2b --- /dev/null +++ b/include/glm/glm/ext/quaternion_transform.hpp @@ -0,0 +1,47 @@ +/// @ref ext_quaternion_transform +/// @file glm/ext/quaternion_transform.hpp +/// +/// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform +/// @ingroup ext +/// +/// Provides transformation functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Rotates a quaternion from a vector of 3 components axis and an angle. + /// + /// @param q Source orientation + /// @param angle Angle expressed in radians. + /// @param axis Axis of the rotation + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); + /// @} +} //namespace glm + +#include "quaternion_transform.inl" diff --git a/include/glm/glm/ext/quaternion_transform.inl b/include/glm/glm/ext/quaternion_transform.inl new file mode 100644 index 00000000..b87ecb65 --- /dev/null +++ b/include/glm/glm/ext/quaternion_transform.inl @@ -0,0 +1,24 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) + { + vec<3, T, Q> Tmp = v; + + // Axis of rotation must be normalised + T len = glm::length(Tmp); + if(abs(len - static_cast(1)) > static_cast(0.001)) + { + T oneOverLen = static_cast(1) / len; + Tmp.x *= oneOverLen; + Tmp.y *= oneOverLen; + Tmp.z *= oneOverLen; + } + + T const AngleRad(angle); + T const Sin = sin(AngleRad * static_cast(0.5)); + + return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + } +}//namespace glm + diff --git a/include/glm/glm/ext/quaternion_trigonometric.hpp b/include/glm/glm/ext/quaternion_trigonometric.hpp new file mode 100644 index 00000000..76cea27a --- /dev/null +++ b/include/glm/glm/ext/quaternion_trigonometric.hpp @@ -0,0 +1,63 @@ +/// @ref ext_quaternion_trigonometric +/// @file glm/ext/quaternion_trigonometric.hpp +/// +/// @defgroup ext_quaternion_trigonometric GLM_EXT_quaternion_trigonometric +/// @ingroup ext +/// +/// Provides trigonometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "scalar_constants.hpp" +#include "vector_relational.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_trigonometric + /// @{ + + /// Returns the quaternion rotation angle. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL T angle(qua const& x); + + /// Returns the q rotation axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<3, T, Q> axis(qua const& x); + + /// Build a quaternion from an angle and a normalized axis. + /// + /// @param angle Angle expressed in radians. + /// @param axis Axis of the quaternion, must be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua angleAxis(T const& angle, vec<3, T, Q> const& axis); + + /// @} +} //namespace glm + +#include "quaternion_trigonometric.inl" diff --git a/include/glm/glm/ext/quaternion_trigonometric.inl b/include/glm/glm/ext/quaternion_trigonometric.inl new file mode 100644 index 00000000..06b7c4c3 --- /dev/null +++ b/include/glm/glm/ext/quaternion_trigonometric.inl @@ -0,0 +1,34 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T angle(qua const& x) + { + if (abs(x.w) > cos_one_over_two()) + { + return asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); + } + + return acos(x.w) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) + { + T const tmp1 = static_cast(1) - x.w * x.w; + if(tmp1 <= static_cast(0)) + return vec<3, T, Q>(0, 0, 1); + T const tmp2 = static_cast(1) / sqrt(tmp1); + return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); + } + + template + GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) + { + T const a(angle); + T const s = glm::sin(a * static_cast(0.5)); + + return qua(glm::cos(a * static_cast(0.5)), v * s); + } +}//namespace glm diff --git a/include/glm/glm/ext/scalar_common.hpp b/include/glm/glm/ext/scalar_common.hpp new file mode 100644 index 00000000..aa5a1807 --- /dev/null +++ b/include/glm/glm/ext/scalar_common.hpp @@ -0,0 +1,157 @@ +/// @ref ext_scalar_common +/// @file glm/ext/scalar_common.hpp +/// +/// @defgroup ext_scalar_common GLM_EXT_scalar_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 scalar parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_func_common +/// @see ext_vector_common + +#pragma once + +// Dependency: +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_common + /// @{ + + /// Returns the minimum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T min(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T min(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T max(T a, T b, T c); + + /// Returns the maximum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T max(T a, T b, T c, T d); + + /// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b); + + /// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b); + + /// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b, T C); + + /// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b, T C, T D); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType clamp(genType const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType repeat(genType const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); + + /// @} +}//namespace glm + +#include "scalar_common.inl" diff --git a/include/glm/glm/ext/scalar_common.inl b/include/glm/glm/ext/scalar_common.inl new file mode 100644 index 00000000..7d9207af --- /dev/null +++ b/include/glm/glm/ext/scalar_common.inl @@ -0,0 +1,152 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER T min(T a, T b, T c) + { + return glm::min(glm::min(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T min(T a, T b, T c, T d) + { + return glm::min(glm::min(a, b), glm::min(c, d)); + } + + template + GLM_FUNC_QUALIFIER T max(T a, T b, T c) + { + return glm::max(glm::max(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T max(T a, T b, T c, T d) + { + return glm::max(glm::max(a, b), glm::max(c, d)); + } + +# if GLM_HAS_CXX11_STL + using std::fmin; +# else + template + GLM_FUNC_QUALIFIER T fmin(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return b; + return min(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T fmin(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return fmin(b, c); + if (isnan(b)) + return fmin(a, c); + if (isnan(c)) + return min(a, b); + return min(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T fmin(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return fmin(b, c, d); + if (isnan(b)) + return min(a, fmin(c, d)); + if (isnan(c)) + return fmin(min(a, b), d); + if (isnan(d)) + return min(a, b, c); + return min(a, b, c, d); + } + + +# if GLM_HAS_CXX11_STL + using std::fmax; +# else + template + GLM_FUNC_QUALIFIER T fmax(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return b; + return max(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T fmax(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return fmax(b, c); + if (isnan(b)) + return fmax(a, c); + if (isnan(c)) + return max(a, b); + return max(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T fmax(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return fmax(b, c, d); + if (isnan(b)) + return max(a, fmax(c, d)); + if (isnan(c)) + return fmax(max(a, b), d); + if (isnan(d)) + return max(a, b, c); + return max(a, b, c, d); + } + + // fclamp + template + GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fclamp' only accept floating-point or integer inputs"); + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER genType clamp(genType const& Texcoord) + { + return glm::clamp(Texcoord, static_cast(0), static_cast(1)); + } + + template + GLM_FUNC_QUALIFIER genType repeat(genType const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER genType mirrorClamp(genType const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) + { + genType const Abs = glm::abs(Texcoord); + genType const Clamp = glm::mod(glm::floor(Abs), static_cast(2)); + genType const Floor = glm::floor(Abs); + genType const Rest = Abs - Floor; + genType const Mirror = Clamp + Rest; + return mix(Rest, static_cast(1) - Rest, Mirror >= static_cast(1)); + } +}//namespace glm diff --git a/include/glm/glm/ext/scalar_constants.hpp b/include/glm/glm/ext/scalar_constants.hpp new file mode 100644 index 00000000..74e210d9 --- /dev/null +++ b/include/glm/glm/ext/scalar_constants.hpp @@ -0,0 +1,40 @@ +/// @ref ext_scalar_constants +/// @file glm/ext/scalar_constants.hpp +/// +/// @defgroup ext_scalar_constants GLM_EXT_scalar_constants +/// @ingroup ext +/// +/// Provides a list of constants and precomputed useful values. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_constants extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_constants + /// @{ + + /// Return the epsilon constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); + + /// Return the pi constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); + + /// Return the value of cos(1 / 2) for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); + + /// @} +} //namespace glm + +#include "scalar_constants.inl" diff --git a/include/glm/glm/ext/scalar_constants.inl b/include/glm/glm/ext/scalar_constants.inl new file mode 100644 index 00000000..b475adf8 --- /dev/null +++ b/include/glm/glm/ext/scalar_constants.inl @@ -0,0 +1,24 @@ +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); + return std::numeric_limits::epsilon(); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'pi' only accepts floating-point inputs"); + return static_cast(3.14159265358979323846264338327950288); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() + { + return genType(0.877582561890372716130286068203503191); + } +} //namespace glm diff --git a/include/glm/glm/ext/scalar_int_sized.hpp b/include/glm/glm/ext/scalar_int_sized.hpp new file mode 100644 index 00000000..8e9c511c --- /dev/null +++ b/include/glm/glm/ext/scalar_int_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_int_sized +/// @file glm/ext/scalar_int_sized.hpp +/// +/// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized +/// @ingroup ext +/// +/// Exposes sized signed integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_int_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; +# else + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; +#endif// + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_int_sized + /// @{ + + /// 8 bit signed integer type. + typedef detail::int8 int8; + + /// 16 bit signed integer type. + typedef detail::int16 int16; + + /// 32 bit signed integer type. + typedef detail::int32 int32; + + /// 64 bit signed integer type. + typedef detail::int64 int64; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/scalar_integer.hpp b/include/glm/glm/ext/scalar_integer.hpp new file mode 100644 index 00000000..a2ca8a2a --- /dev/null +++ b/include/glm/glm/ext/scalar_integer.hpp @@ -0,0 +1,92 @@ +/// @ref ext_scalar_integer +/// @file glm/ext/scalar_integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_integer GLM_EXT_scalar_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../detail/type_float.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount); + + /// @} +} //namespace glm + +#include "scalar_integer.inl" diff --git a/include/glm/glm/ext/scalar_integer.inl b/include/glm/glm/ext/scalar_integer.inl new file mode 100644 index 00000000..efba9600 --- /dev/null +++ b/include/glm/glm/ext/scalar_integer.inl @@ -0,0 +1,243 @@ +#include "../integer.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T) + { + return v; + } + }; + + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) + { + return v | (v >> Shift); + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec const Sign(sign(x)); + + vec v(abs(x)); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return (v + static_cast(1)) * Sign; + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec v(x); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return v + static_cast(1); + } + }; + + template + struct compute_ceilMultiple{}; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source > genType(0)) + return Source + (Multiple - std::fmod(Source, Multiple)); + else + return Source + std::fmod(-Source, Multiple); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + assert(Multiple > genType(0)); + if(Source > genType(0)) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + else + return Source + (-Source % Multiple); + } + }; + + template + struct compute_floorMultiple{}; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - std::fmod(Source, Multiple); + else + return Source - std::fmod(Source, Multiple) - Multiple; + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool isPowerOfTwo(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + genIUType const Result = glm::abs(Value); + return !(Result & (Result - 1)); + } + + template + GLM_FUNC_QUALIFIER genIUType nextPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo<1, genIUType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genIUType, defaultp>(value)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType prevPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return isPowerOfTwo(value) ? value : static_cast(static_cast(1) << static_cast(findMSB(value))); + } + + template + GLM_FUNC_QUALIFIER bool isMultiple(genIUType Value, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return isMultiple(vec<1, genIUType>(Value), vec<1, genIUType>(Multiple)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType nextMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER genIUType prevMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER int findNSB(genIUType x, int significantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + if(bitCount(x) < significantBitCount) + return -1; + + genIUType const One = static_cast(1); + int bitPos = 0; + + genIUType key = x; + int nBitCount = significantBitCount; + int Step = sizeof(x) * 8 / 2; + while (key > One) + { + genIUType Mask = static_cast((One << Step) - One); + genIUType currentKey = key & Mask; + int currentBitCount = bitCount(currentKey); + if (nBitCount > currentBitCount) + { + nBitCount -= currentBitCount; + bitPos += Step; + key >>= static_cast(Step); + } + else + { + key = key & Mask; + } + + Step >>= 1; + } + + return static_cast(bitPos); + } +}//namespace glm diff --git a/include/glm/glm/ext/scalar_packing.hpp b/include/glm/glm/ext/scalar_packing.hpp new file mode 100644 index 00000000..18b85b72 --- /dev/null +++ b/include/glm/glm/ext/scalar_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_scalar_packing +/// @file glm/ext/scalar_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_packing GLM_EXT_scalar_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert scalar values to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_packing + /// @{ + + + /// @} +}// namespace glm + +#include "scalar_packing.inl" diff --git a/include/glm/glm/ext/scalar_packing.inl b/include/glm/glm/ext/scalar_packing.inl new file mode 100644 index 00000000..e69de29b diff --git a/include/glm/glm/ext/scalar_relational.hpp b/include/glm/glm/ext/scalar_relational.hpp new file mode 100644 index 00000000..3076a5e6 --- /dev/null +++ b/include/glm/glm/ext/scalar_relational.hpp @@ -0,0 +1,65 @@ +/// @ref ext_scalar_relational +/// @file glm/ext/scalar_relational.hpp +/// +/// @defgroup ext_scalar_relational GLM_EXT_scalar_relational +/// @ingroup ext +/// +/// Exposes comparison functions for scalar types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_relational extension included") +#endif + +namespace glm +{ + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs); + + /// @} +}//namespace glm + +#include "scalar_relational.inl" diff --git a/include/glm/glm/ext/scalar_relational.inl b/include/glm/glm/ext/scalar_relational.inl new file mode 100644 index 00000000..c85583ef --- /dev/null +++ b/include/glm/glm/ext/scalar_relational.inl @@ -0,0 +1,40 @@ +#include "../common.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_float.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) <= epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) > epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) + { + detail::float_t const a(x); + detail::float_t const b(y); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + return false; + + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + return DiffULPs <= MaxULPs; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) + { + return !equal(x, y, ULPs); + } +}//namespace glm diff --git a/include/glm/glm/ext/scalar_uint_sized.hpp b/include/glm/glm/ext/scalar_uint_sized.hpp new file mode 100644 index 00000000..fd5267fa --- /dev/null +++ b/include/glm/glm/ext/scalar_uint_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_uint_sized +/// @file glm/ext/scalar_uint_sized.hpp +/// +/// @defgroup ext_scalar_uint_sized GLM_EXT_scalar_uint_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_uint_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; +# else + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; +#endif + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_uint_sized + /// @{ + + /// 8 bit unsigned integer type. + typedef detail::uint8 uint8; + + /// 16 bit unsigned integer type. + typedef detail::uint16 uint16; + + /// 32 bit unsigned integer type. + typedef detail::uint32 uint32; + + /// 64 bit unsigned integer type. + typedef detail::uint64 uint64; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/scalar_ulp.hpp b/include/glm/glm/ext/scalar_ulp.hpp new file mode 100644 index 00000000..941ada3e --- /dev/null +++ b/include/glm/glm/ext/scalar_ulp.hpp @@ -0,0 +1,74 @@ +/// @ref ext_scalar_ulp +/// @file glm/ext/scalar_ulp.hpp +/// +/// @defgroup ext_scalar_ulp GLM_EXT_scalar_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_ulp +/// @see ext_scalar_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_ulp extension included") +#endif + +namespace glm +{ + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int floatDistance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int64 floatDistance(double x, double y); + + /// @} +}//namespace glm + +#include "scalar_ulp.inl" diff --git a/include/glm/glm/ext/scalar_ulp.inl b/include/glm/glm/ext/scalar_ulp.inl new file mode 100644 index 00000000..308df150 --- /dev/null +++ b/include/glm/glm/ext/scalar_ulp.inl @@ -0,0 +1,284 @@ +/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. +/// +/// Developed at SunPro, a Sun Microsystems, Inc. business. +/// Permission to use, copy, modify, and distribute this +/// software is freely granted, provided that this notice +/// is preserved. + +#include "../detail/type_float.hpp" +#include "../ext/scalar_constants.hpp" +#include +#include + +#if(GLM_COMPILER & GLM_COMPILER_VC) +# pragma warning(push) +# pragma warning(disable : 4127) +#endif + +typedef union +{ + float value; + /* FIXME: Assumes 32 bit int. */ + unsigned int word; +} ieee_float_shape_type; + +typedef union +{ + double value; + struct + { + int lsw; + int msw; + } parts; +} ieee_double_shape_type; + +#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ + do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ + } while (0) + +#define GLM_GET_FLOAT_WORD(i,d) \ + do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ + } while (0) + +#define GLM_SET_FLOAT_WORD(d,i) \ + do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ + } while (0) + +#define GLM_INSERT_WORDS(d,ix0,ix1) \ + do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ + } while (0) + +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER float nextafterf(float x, float y) + { + volatile float t; + int hx, hy, ix, iy; + + GLM_GET_FLOAT_WORD(hx, x); + GLM_GET_FLOAT_WORD(hy, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if((ix > 0x7f800000) || // x is nan + (iy > 0x7f800000)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if(ix == 0) + { // x == 0 + GLM_SET_FLOAT_WORD(x, (hy & 0x80000000) | 1);// return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) + { // x > 0 + if(hx > hy) // x > y, x -= ulp + hx -= 1; + else // x < y, x += ulp + hx += 1; + } + else + { // x < 0 + if(hy >= 0 || hx > hy) // x < y, x -= ulp + hx -= 1; + else // x > y, x += ulp + hx += 1; + } + hy = hx & 0x7f800000; + if(hy >= 0x7f800000) + return x + x; // overflow + if(hy < 0x00800000) // underflow + { + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_SET_FLOAT_WORD(y, hx); + return y; + } + } + GLM_SET_FLOAT_WORD(x, hx); + return x; + } + + GLM_FUNC_QUALIFIER double nextafter(double x, double y) + { + volatile double t; + int hx, hy, ix, iy; + unsigned int lx, ly; + + GLM_EXTRACT_WORDS(hx, lx, x); + GLM_EXTRACT_WORDS(hy, ly, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if(((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0) || // x is nan + ((iy >= 0x7ff00000) && ((iy - 0x7ff00000) | ly) != 0)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if((ix | lx) == 0) + { // x == 0 + GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) { // x > 0 + if(hx > hy || ((hx == hy) && (lx > ly))) { // x > y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x < y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + else { // x < 0 + if(hy >= 0 || hx > hy || ((hx == hy) && (lx > ly))){// x < y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x > y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + hy = hx & 0x7ff00000; + if(hy >= 0x7ff00000) + return x + x; // overflow + if(hy < 0x00100000) + { // underflow + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_INSERT_WORDS(y, hx, lx); + return y; + } + } + GLM_INSERT_WORDS(x, hx, lx); + return x; + } +}//namespace detail +}//namespace glm + +#if(GLM_COMPILER & GLM_COMPILER_VC) +# pragma warning(pop) +#endif + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER float nextFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MAX); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MAX); +# else + return nextafterf(x, FLT_MAX); +# endif + } + + template<> + GLM_FUNC_QUALIFIER double nextFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafter(x, std::numeric_limits::max()); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MAX); +# else + return nextafter(x, DBL_MAX); +# endif + } + + template + GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = nextFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER float prevFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MIN); +# else + return nextafterf(x, FLT_MIN); +# endif + } + + GLM_FUNC_QUALIFIER double prevFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return _nextafter(x, DBL_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MIN); +# else + return nextafter(x, DBL_MIN); +# endif + } + + template + GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = prevFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int floatDistance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 floatDistance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool1.hpp b/include/glm/glm/ext/vector_bool1.hpp new file mode 100644 index 00000000..002c3202 --- /dev/null +++ b/include/glm/glm/ext/vector_bool1.hpp @@ -0,0 +1,30 @@ +/// @ref ext_vector_bool1 +/// @file glm/ext/vector_bool1.hpp +/// +/// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 +/// @ingroup ext +/// +/// Exposes bvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_bool1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1 + /// @{ + + /// 1 components vector of boolean. + typedef vec<1, bool, defaultp> bvec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool1_precision.hpp b/include/glm/glm/ext/vector_bool1_precision.hpp new file mode 100644 index 00000000..e62d3cfb --- /dev/null +++ b/include/glm/glm/ext/vector_bool1_precision.hpp @@ -0,0 +1,34 @@ +/// @ref ext_vector_bool1_precision +/// @file glm/ext/vector_bool1_precision.hpp +/// +/// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision +/// @ingroup ext +/// +/// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. +/// +/// Include to use the features of this extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1_precision + /// @{ + + /// 1 component vector of bool values. + typedef vec<1, bool, highp> highp_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, mediump> mediump_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, lowp> lowp_bvec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool2.hpp b/include/glm/glm/ext/vector_bool2.hpp new file mode 100644 index 00000000..52288b75 --- /dev/null +++ b/include/glm/glm/ext/vector_bool2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, bool, defaultp> bvec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool2_precision.hpp b/include/glm/glm/ext/vector_bool2_precision.hpp new file mode 100644 index 00000000..43709332 --- /dev/null +++ b/include/glm/glm/ext/vector_bool2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, highp> highp_bvec2; + + /// 2 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, mediump> mediump_bvec2; + + /// 2 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, lowp> lowp_bvec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool3.hpp b/include/glm/glm/ext/vector_bool3.hpp new file mode 100644 index 00000000..90a0b7ea --- /dev/null +++ b/include/glm/glm/ext/vector_bool3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, bool, defaultp> bvec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool3_precision.hpp b/include/glm/glm/ext/vector_bool3_precision.hpp new file mode 100644 index 00000000..89cd2d32 --- /dev/null +++ b/include/glm/glm/ext/vector_bool3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, highp> highp_bvec3; + + /// 3 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, mediump> mediump_bvec3; + + /// 3 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, lowp> lowp_bvec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool4.hpp b/include/glm/glm/ext/vector_bool4.hpp new file mode 100644 index 00000000..18aa71bd --- /dev/null +++ b/include/glm/glm/ext/vector_bool4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, bool, defaultp> bvec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_bool4_precision.hpp b/include/glm/glm/ext/vector_bool4_precision.hpp new file mode 100644 index 00000000..79786e54 --- /dev/null +++ b/include/glm/glm/ext/vector_bool4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, highp> highp_bvec4; + + /// 4 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, mediump> mediump_bvec4; + + /// 4 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, lowp> lowp_bvec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_common.hpp b/include/glm/glm/ext/vector_common.hpp new file mode 100644 index 00000000..521ec01e --- /dev/null +++ b/include/glm/glm/ext/vector_common.hpp @@ -0,0 +1,204 @@ +/// @ref ext_vector_common +/// @file glm/ext/vector_common.hpp +/// +/// @defgroup ext_vector_common GLM_EXT_vector_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 vector parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_common +/// @see ext_scalar_common + +#pragma once + +// Dependency: +#include "../ext/scalar_common.hpp" +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_common + /// @{ + + /// Return the minimum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c); + + /// Return the minimum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Return the maximum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z); + + /// Return the maximum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max( vec const& x, vec const& y, vec const& z, vec const& w); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, T y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, vec const& y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, T b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, T minVal, T maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, vec const& minVal, vec const& maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec clamp(vec const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec repeat(vec const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorClamp(vec const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorRepeat(vec const& Texcoord); + + /// @} +}//namespace glm + +#include "vector_common.inl" diff --git a/include/glm/glm/ext/vector_common.inl b/include/glm/glm/ext/vector_common.inl new file mode 100644 index 00000000..e2747be7 --- /dev/null +++ b/include/glm/glm/ext/vector_common.inl @@ -0,0 +1,129 @@ +#include "../detail/_vectorize.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), fmin(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), fmax(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) + { + return fmin(fmax(x, vec(minVal)), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) + { + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) + { + return glm::clamp(Texcoord, vec(0), vec(1)); + } + + template + GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) + { + vec const Abs = glm::abs(Texcoord); + vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); + vec const Floor = glm::floor(Abs); + vec const Rest = Abs - Floor; + vec const Mirror = Clamp + Rest; + return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); + } +}//namespace glm diff --git a/include/glm/glm/ext/vector_double1.hpp b/include/glm/glm/ext/vector_double1.hpp new file mode 100644 index 00000000..38826677 --- /dev/null +++ b/include/glm/glm/ext/vector_double1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_double1 +/// @file glm/ext/vector_double1.hpp +/// +/// @defgroup ext_vector_double1 GLM_EXT_vector_double1 +/// @ingroup ext +/// +/// Exposes double-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1_precision extension. +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1 + /// @{ + + /// 1 components vector of double-precision floating-point numbers. + typedef vec<1, double, defaultp> dvec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double1_precision.hpp b/include/glm/glm/ext/vector_double1_precision.hpp new file mode 100644 index 00000000..1d471959 --- /dev/null +++ b/include/glm/glm/ext/vector_double1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_double1_precision +/// @file glm/ext/vector_double1_precision.hpp +/// +/// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision +/// @ingroup ext +/// +/// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1 + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1_precision + /// @{ + + /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, highp> highp_dvec1; + + /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, mediump> mediump_dvec1; + + /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, lowp> lowp_dvec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double2.hpp b/include/glm/glm/ext/vector_double2.hpp new file mode 100644 index 00000000..60e35775 --- /dev/null +++ b/include/glm/glm/ext/vector_double2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, double, defaultp> dvec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double2_precision.hpp b/include/glm/glm/ext/vector_double2_precision.hpp new file mode 100644 index 00000000..fa53940f --- /dev/null +++ b/include/glm/glm/ext/vector_double2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_double2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, highp> highp_dvec2; + + /// 2 components vector of medium double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, mediump> mediump_dvec2; + + /// 2 components vector of low double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, lowp> lowp_dvec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double3.hpp b/include/glm/glm/ext/vector_double3.hpp new file mode 100644 index 00000000..6dfe4c67 --- /dev/null +++ b/include/glm/glm/ext/vector_double3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, double, defaultp> dvec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double3_precision.hpp b/include/glm/glm/ext/vector_double3_precision.hpp new file mode 100644 index 00000000..a8cfa37a --- /dev/null +++ b/include/glm/glm/ext/vector_double3_precision.hpp @@ -0,0 +1,34 @@ +/// @ref core +/// @file glm/ext/vector_double3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, highp> highp_dvec3; + + /// 3 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, mediump> mediump_dvec3; + + /// 3 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, lowp> lowp_dvec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double4.hpp b/include/glm/glm/ext/vector_double4.hpp new file mode 100644 index 00000000..87f225f6 --- /dev/null +++ b/include/glm/glm/ext/vector_double4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, double, defaultp> dvec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_double4_precision.hpp b/include/glm/glm/ext/vector_double4_precision.hpp new file mode 100644 index 00000000..09cafa1e --- /dev/null +++ b/include/glm/glm/ext/vector_double4_precision.hpp @@ -0,0 +1,35 @@ +/// @ref core +/// @file glm/ext/vector_double4_precision.hpp + +#pragma once +#include "../detail/setup.hpp" +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, highp> highp_dvec4; + + /// 4 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, mediump> mediump_dvec4; + + /// 4 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, lowp> lowp_dvec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float1.hpp b/include/glm/glm/ext/vector_float1.hpp new file mode 100644 index 00000000..28acc2c9 --- /dev/null +++ b/include/glm/glm/ext/vector_float1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_float1 +/// @file glm/ext/vector_float1.hpp +/// +/// @defgroup ext_vector_float1 GLM_EXT_vector_float1 +/// @ingroup ext +/// +/// Exposes single-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1_precision extension. +/// @see ext_vector_double1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1 + /// @{ + + /// 1 components vector of single-precision floating-point numbers. + typedef vec<1, float, defaultp> vec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float1_precision.hpp b/include/glm/glm/ext/vector_float1_precision.hpp new file mode 100644 index 00000000..6e8dad8d --- /dev/null +++ b/include/glm/glm/ext/vector_float1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_float1_precision +/// @file glm/ext/vector_float1_precision.hpp +/// +/// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision +/// @ingroup ext +/// +/// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1_precision + /// @{ + + /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, highp> highp_vec1; + + /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, mediump> mediump_vec1; + + /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, lowp> lowp_vec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float2.hpp b/include/glm/glm/ext/vector_float2.hpp new file mode 100644 index 00000000..d31545dc --- /dev/null +++ b/include/glm/glm/ext/vector_float2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, float, defaultp> vec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float2_precision.hpp b/include/glm/glm/ext/vector_float2_precision.hpp new file mode 100644 index 00000000..23c0820d --- /dev/null +++ b/include/glm/glm/ext/vector_float2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, highp> highp_vec2; + + /// 2 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, mediump> mediump_vec2; + + /// 2 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, lowp> lowp_vec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float3.hpp b/include/glm/glm/ext/vector_float3.hpp new file mode 100644 index 00000000..cd79a620 --- /dev/null +++ b/include/glm/glm/ext/vector_float3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, float, defaultp> vec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float3_precision.hpp b/include/glm/glm/ext/vector_float3_precision.hpp new file mode 100644 index 00000000..be640b53 --- /dev/null +++ b/include/glm/glm/ext/vector_float3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, highp> highp_vec3; + + /// 3 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, mediump> mediump_vec3; + + /// 3 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, lowp> lowp_vec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float4.hpp b/include/glm/glm/ext/vector_float4.hpp new file mode 100644 index 00000000..d84adcc2 --- /dev/null +++ b/include/glm/glm/ext/vector_float4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, float, defaultp> vec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_float4_precision.hpp b/include/glm/glm/ext/vector_float4_precision.hpp new file mode 100644 index 00000000..aede8388 --- /dev/null +++ b/include/glm/glm/ext/vector_float4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, highp> highp_vec4; + + /// 4 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, mediump> mediump_vec4; + + /// 4 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, lowp> lowp_vec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int1.hpp b/include/glm/glm/ext/vector_int1.hpp new file mode 100644 index 00000000..dc860389 --- /dev/null +++ b/include/glm/glm/ext/vector_int1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_int1 +/// @file glm/ext/vector_int1.hpp +/// +/// @defgroup ext_vector_int1 GLM_EXT_vector_int1 +/// @ingroup ext +/// +/// Exposes ivec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_uint1 extension. +/// @see ext_vector_int1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1 + /// @{ + + /// 1 component vector of signed integer numbers. + typedef vec<1, int, defaultp> ivec1; + + /// @} +}//namespace glm + diff --git a/include/glm/glm/ext/vector_int1_sized.hpp b/include/glm/glm/ext/vector_int1_sized.hpp new file mode 100644 index 00000000..de0d4cf8 --- /dev/null +++ b/include/glm/glm/ext/vector_int1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int1_sized +/// @file glm/ext/vector_int1_sized.hpp +/// +/// @defgroup ext_vector_int1_sized GLM_EXT_vector_int1_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint1_sized + +#pragma once + +#include "../ext/vector_int1.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1_sized + /// @{ + + /// 8 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int8, defaultp> i8vec1; + + /// 16 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int16, defaultp> i16vec1; + + /// 32 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int32, defaultp> i32vec1; + + /// 64 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int64, defaultp> i64vec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int2.hpp b/include/glm/glm/ext/vector_int2.hpp new file mode 100644 index 00000000..aef803e9 --- /dev/null +++ b/include/glm/glm/ext/vector_int2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, int, defaultp> ivec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int2_sized.hpp b/include/glm/glm/ext/vector_int2_sized.hpp new file mode 100644 index 00000000..1fd57eef --- /dev/null +++ b/include/glm/glm/ext/vector_int2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int2_sized +/// @file glm/ext/vector_int2_sized.hpp +/// +/// @defgroup ext_vector_int2_sized GLM_EXT_vector_int2_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint2_sized + +#pragma once + +#include "../ext/vector_int2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int2_sized + /// @{ + + /// 8 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int8, defaultp> i8vec2; + + /// 16 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int16, defaultp> i16vec2; + + /// 32 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int32, defaultp> i32vec2; + + /// 64 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int64, defaultp> i64vec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int3.hpp b/include/glm/glm/ext/vector_int3.hpp new file mode 100644 index 00000000..4767e61e --- /dev/null +++ b/include/glm/glm/ext/vector_int3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, int, defaultp> ivec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int3_sized.hpp b/include/glm/glm/ext/vector_int3_sized.hpp new file mode 100644 index 00000000..085a3feb --- /dev/null +++ b/include/glm/glm/ext/vector_int3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int3_sized +/// @file glm/ext/vector_int3_sized.hpp +/// +/// @defgroup ext_vector_int3_sized GLM_EXT_vector_int3_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint3_sized + +#pragma once + +#include "../ext/vector_int3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int3_sized + /// @{ + + /// 8 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int8, defaultp> i8vec3; + + /// 16 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int16, defaultp> i16vec3; + + /// 32 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int32, defaultp> i32vec3; + + /// 64 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int64, defaultp> i64vec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int4.hpp b/include/glm/glm/ext/vector_int4.hpp new file mode 100644 index 00000000..bb23adf7 --- /dev/null +++ b/include/glm/glm/ext/vector_int4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, int, defaultp> ivec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_int4_sized.hpp b/include/glm/glm/ext/vector_int4_sized.hpp new file mode 100644 index 00000000..c63d4654 --- /dev/null +++ b/include/glm/glm/ext/vector_int4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int4_sized +/// @file glm/ext/vector_int4_sized.hpp +/// +/// @defgroup ext_vector_int4_sized GLM_EXT_vector_int4_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint4_sized + +#pragma once + +#include "../ext/vector_int4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int4_sized + /// @{ + + /// 8 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int8, defaultp> i8vec4; + + /// 16 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int16, defaultp> i16vec4; + + /// 32 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int32, defaultp> i32vec4; + + /// 64 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int64, defaultp> i64vec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_integer.hpp b/include/glm/glm/ext/vector_integer.hpp new file mode 100644 index 00000000..1304dd8d --- /dev/null +++ b/include/glm/glm/ext/vector_integer.hpp @@ -0,0 +1,149 @@ +/// @ref ext_vector_integer +/// @file glm/ext/vector_integer.hpp +/// +/// @see core (dependence) +/// @see ext_vector_integer (dependence) +/// +/// @defgroup ext_vector_integer GLM_EXT_vector_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevPowerOfTwo(vec const& v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, T Multiple); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, vec const& Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, T Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, T Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, vec const& Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec findNSB(vec const& Source, vec SignificantBitCount); + + /// @} +} //namespace glm + +#include "vector_integer.inl" diff --git a/include/glm/glm/ext/vector_integer.inl b/include/glm/glm/ext/vector_integer.inl new file mode 100644 index 00000000..939ff5e2 --- /dev/null +++ b/include/glm/glm/ext/vector_integer.inl @@ -0,0 +1,85 @@ +#include "scalar_integer.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + vec const Result(abs(Value)); + return equal(Result & (Result - vec(1)), vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec nextPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER vec prevPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return detail::functor1::call(prevPowerOfTwo, v); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return (Value % Multiple) == vec(0); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return (Value % Multiple) == vec(0); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec findNSB(vec const& Source, vec SignificantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + return detail::functor2_vec_int::call(findNSB, Source, SignificantBitCount); + } +}//namespace glm diff --git a/include/glm/glm/ext/vector_packing.hpp b/include/glm/glm/ext/vector_packing.hpp new file mode 100644 index 00000000..76e5d0cc --- /dev/null +++ b/include/glm/glm/ext/vector_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_packing +/// @file glm/ext/vector_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_vector_packing GLM_EXT_vector_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert vectors to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_packing + /// @{ + + + /// @} +}// namespace glm + +#include "vector_packing.inl" diff --git a/include/glm/glm/ext/vector_packing.inl b/include/glm/glm/ext/vector_packing.inl new file mode 100644 index 00000000..e69de29b diff --git a/include/glm/glm/ext/vector_relational.hpp b/include/glm/glm/ext/vector_relational.hpp new file mode 100644 index 00000000..1c2367dc --- /dev/null +++ b/include/glm/glm/ext/vector_relational.hpp @@ -0,0 +1,107 @@ +/// @ref ext_vector_relational +/// @file glm/ext/vector_relational.hpp +/// +/// @see core (dependence) +/// @see ext_scalar_integer (dependence) +/// +/// @defgroup ext_vector_relational GLM_EXT_vector_relational +/// @ingroup ext +/// +/// Exposes comparison functions for vector types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_scalar_relational +/// @see ext_matrix_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_relational + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& ULPs); + + /// @} +}//namespace glm + +#include "vector_relational.inl" diff --git a/include/glm/glm/ext/vector_relational.inl b/include/glm/glm/ext/vector_relational.inl new file mode 100644 index 00000000..7a39ab50 --- /dev/null +++ b/include/glm/glm/ext/vector_relational.inl @@ -0,0 +1,75 @@ +#include "../vector_relational.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/type_float.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T Epsilon) + { + return equal(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& Epsilon) + { + return lessThanEqual(abs(x - y), Epsilon); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T Epsilon) + { + return notEqual(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& Epsilon) + { + return greaterThan(abs(x - y), Epsilon); + } + + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int MaxULPs) + { + return equal(x, y, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& MaxULPs) + { + vec Result(false); + for(length_t i = 0; i < L; ++i) + { + detail::float_t const a(x[i]); + detail::float_t const b(y[i]); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + { + // Check for equality to make sure +0==-0 + Result[i] = a.mantissa() == b.mantissa() && a.exponent() == b.exponent(); + } + else + { + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + Result[i] = DiffULPs <= MaxULPs[i]; + } + } + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int MaxULPs) + { + return notEqual(x, y, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& MaxULPs) + { + return not_(equal(x, y, MaxULPs)); + } +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint1.hpp b/include/glm/glm/ext/vector_uint1.hpp new file mode 100644 index 00000000..eb8a7049 --- /dev/null +++ b/include/glm/glm/ext/vector_uint1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_uint1 +/// @file glm/ext/vector_uint1.hpp +/// +/// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 +/// @ingroup ext +/// +/// Exposes uvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_int1 extension. +/// @see ext_vector_uint1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1 + /// @{ + + /// 1 component vector of unsigned integer numbers. + typedef vec<1, unsigned int, defaultp> uvec1; + + /// @} +}//namespace glm + diff --git a/include/glm/glm/ext/vector_uint1_sized.hpp b/include/glm/glm/ext/vector_uint1_sized.hpp new file mode 100644 index 00000000..2a938bba --- /dev/null +++ b/include/glm/glm/ext/vector_uint1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint1_sized +/// @file glm/ext/vector_uint1_sized.hpp +/// +/// @defgroup ext_vector_uint1_sized GLM_EXT_vector_uint1_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int1_sized + +#pragma once + +#include "../ext/vector_uint1.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1_sized + /// @{ + + /// 8 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint8, defaultp> u8vec1; + + /// 16 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint16, defaultp> u16vec1; + + /// 32 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint32, defaultp> u32vec1; + + /// 64 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint64, defaultp> u64vec1; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint2.hpp b/include/glm/glm/ext/vector_uint2.hpp new file mode 100644 index 00000000..03c00f5f --- /dev/null +++ b/include/glm/glm/ext/vector_uint2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, unsigned int, defaultp> uvec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint2_sized.hpp b/include/glm/glm/ext/vector_uint2_sized.hpp new file mode 100644 index 00000000..620fdc6e --- /dev/null +++ b/include/glm/glm/ext/vector_uint2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint2_sized +/// @file glm/ext/vector_uint2_sized.hpp +/// +/// @defgroup ext_vector_uint2_sized GLM_EXT_vector_uint2_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int2_sized + +#pragma once + +#include "../ext/vector_uint2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint2_sized + /// @{ + + /// 8 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint8, defaultp> u8vec2; + + /// 16 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint16, defaultp> u16vec2; + + /// 32 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint32, defaultp> u32vec2; + + /// 64 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint64, defaultp> u64vec2; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint3.hpp b/include/glm/glm/ext/vector_uint3.hpp new file mode 100644 index 00000000..f5b41c40 --- /dev/null +++ b/include/glm/glm/ext/vector_uint3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, unsigned int, defaultp> uvec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint3_sized.hpp b/include/glm/glm/ext/vector_uint3_sized.hpp new file mode 100644 index 00000000..6f96b98e --- /dev/null +++ b/include/glm/glm/ext/vector_uint3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint3_sized +/// @file glm/ext/vector_uint3_sized.hpp +/// +/// @defgroup ext_vector_uint3_sized GLM_EXT_vector_uint3_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int3_sized + +#pragma once + +#include "../ext/vector_uint3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint3_sized + /// @{ + + /// 8 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint8, defaultp> u8vec3; + + /// 16 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint16, defaultp> u16vec3; + + /// 32 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint32, defaultp> u32vec3; + + /// 64 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint64, defaultp> u64vec3; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint4.hpp b/include/glm/glm/ext/vector_uint4.hpp new file mode 100644 index 00000000..32ced58a --- /dev/null +++ b/include/glm/glm/ext/vector_uint4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, unsigned int, defaultp> uvec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_uint4_sized.hpp b/include/glm/glm/ext/vector_uint4_sized.hpp new file mode 100644 index 00000000..da992ea2 --- /dev/null +++ b/include/glm/glm/ext/vector_uint4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint4_sized +/// @file glm/ext/vector_uint4_sized.hpp +/// +/// @defgroup ext_vector_uint4_sized GLM_EXT_vector_uint4_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int4_sized + +#pragma once + +#include "../ext/vector_uint4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint4_sized + /// @{ + + /// 8 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint8, defaultp> u8vec4; + + /// 16 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint16, defaultp> u16vec4; + + /// 32 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint32, defaultp> u32vec4; + + /// 64 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint64, defaultp> u64vec4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/ext/vector_ulp.hpp b/include/glm/glm/ext/vector_ulp.hpp new file mode 100644 index 00000000..6210396b --- /dev/null +++ b/include/glm/glm/ext/vector_ulp.hpp @@ -0,0 +1,109 @@ +/// @ref ext_vector_ulp +/// @file glm/ext/vector_ulp.hpp +/// +/// @defgroup ext_vector_ulp GLM_EXT_vector_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_ulp +/// @see ext_scalar_relational +/// @see ext_vector_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_ulp.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_ulp extension included") +#endif + +namespace glm +{ + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "vector_ulp.inl" diff --git a/include/glm/glm/ext/vector_ulp.inl b/include/glm/glm/ext/vector_ulp.inl new file mode 100644 index 00000000..91565ce5 --- /dev/null +++ b/include/glm/glm/ext/vector_ulp.inl @@ -0,0 +1,74 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, int ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, vec const& ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, int ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, vec const& ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } +}//namespace glm diff --git a/include/glm/glm/fwd.hpp b/include/glm/glm/fwd.hpp new file mode 100644 index 00000000..89177f46 --- /dev/null +++ b/include/glm/glm/fwd.hpp @@ -0,0 +1,1233 @@ +#pragma once + +#include "detail/qualifier.hpp" + +namespace glm +{ +#if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; + typedef std::int64_t int64; + + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; + typedef std::uint64_t uint64; +#else + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + typedef detail::int64 int64; + + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef detail::uint64 uint64; +#endif + + // Scalar int + + typedef int8 lowp_i8; + typedef int8 mediump_i8; + typedef int8 highp_i8; + typedef int8 i8; + + typedef int8 lowp_int8; + typedef int8 mediump_int8; + typedef int8 highp_int8; + + typedef int8 lowp_int8_t; + typedef int8 mediump_int8_t; + typedef int8 highp_int8_t; + typedef int8 int8_t; + + typedef int16 lowp_i16; + typedef int16 mediump_i16; + typedef int16 highp_i16; + typedef int16 i16; + + typedef int16 lowp_int16; + typedef int16 mediump_int16; + typedef int16 highp_int16; + + typedef int16 lowp_int16_t; + typedef int16 mediump_int16_t; + typedef int16 highp_int16_t; + typedef int16 int16_t; + + typedef int32 lowp_i32; + typedef int32 mediump_i32; + typedef int32 highp_i32; + typedef int32 i32; + + typedef int32 lowp_int32; + typedef int32 mediump_int32; + typedef int32 highp_int32; + + typedef int32 lowp_int32_t; + typedef int32 mediump_int32_t; + typedef int32 highp_int32_t; + typedef int32 int32_t; + + typedef int64 lowp_i64; + typedef int64 mediump_i64; + typedef int64 highp_i64; + typedef int64 i64; + + typedef int64 lowp_int64; + typedef int64 mediump_int64; + typedef int64 highp_int64; + + typedef int64 lowp_int64_t; + typedef int64 mediump_int64_t; + typedef int64 highp_int64_t; + typedef int64 int64_t; + + // Scalar uint + + typedef unsigned int uint; + + typedef uint8 lowp_u8; + typedef uint8 mediump_u8; + typedef uint8 highp_u8; + typedef uint8 u8; + + typedef uint8 lowp_uint8; + typedef uint8 mediump_uint8; + typedef uint8 highp_uint8; + + typedef uint8 lowp_uint8_t; + typedef uint8 mediump_uint8_t; + typedef uint8 highp_uint8_t; + typedef uint8 uint8_t; + + typedef uint16 lowp_u16; + typedef uint16 mediump_u16; + typedef uint16 highp_u16; + typedef uint16 u16; + + typedef uint16 lowp_uint16; + typedef uint16 mediump_uint16; + typedef uint16 highp_uint16; + + typedef uint16 lowp_uint16_t; + typedef uint16 mediump_uint16_t; + typedef uint16 highp_uint16_t; + typedef uint16 uint16_t; + + typedef uint32 lowp_u32; + typedef uint32 mediump_u32; + typedef uint32 highp_u32; + typedef uint32 u32; + + typedef uint32 lowp_uint32; + typedef uint32 mediump_uint32; + typedef uint32 highp_uint32; + + typedef uint32 lowp_uint32_t; + typedef uint32 mediump_uint32_t; + typedef uint32 highp_uint32_t; + typedef uint32 uint32_t; + + typedef uint64 lowp_u64; + typedef uint64 mediump_u64; + typedef uint64 highp_u64; + typedef uint64 u64; + + typedef uint64 lowp_uint64; + typedef uint64 mediump_uint64; + typedef uint64 highp_uint64; + + typedef uint64 lowp_uint64_t; + typedef uint64 mediump_uint64_t; + typedef uint64 highp_uint64_t; + typedef uint64 uint64_t; + + // Scalar float + + typedef float lowp_f32; + typedef float mediump_f32; + typedef float highp_f32; + typedef float f32; + + typedef float lowp_float32; + typedef float mediump_float32; + typedef float highp_float32; + typedef float float32; + + typedef float lowp_float32_t; + typedef float mediump_float32_t; + typedef float highp_float32_t; + typedef float float32_t; + + + typedef double lowp_f64; + typedef double mediump_f64; + typedef double highp_f64; + typedef double f64; + + typedef double lowp_float64; + typedef double mediump_float64; + typedef double highp_float64; + typedef double float64; + + typedef double lowp_float64_t; + typedef double mediump_float64_t; + typedef double highp_float64_t; + typedef double float64_t; + + // Vector bool + + typedef vec<1, bool, lowp> lowp_bvec1; + typedef vec<2, bool, lowp> lowp_bvec2; + typedef vec<3, bool, lowp> lowp_bvec3; + typedef vec<4, bool, lowp> lowp_bvec4; + + typedef vec<1, bool, mediump> mediump_bvec1; + typedef vec<2, bool, mediump> mediump_bvec2; + typedef vec<3, bool, mediump> mediump_bvec3; + typedef vec<4, bool, mediump> mediump_bvec4; + + typedef vec<1, bool, highp> highp_bvec1; + typedef vec<2, bool, highp> highp_bvec2; + typedef vec<3, bool, highp> highp_bvec3; + typedef vec<4, bool, highp> highp_bvec4; + + typedef vec<1, bool, defaultp> bvec1; + typedef vec<2, bool, defaultp> bvec2; + typedef vec<3, bool, defaultp> bvec3; + typedef vec<4, bool, defaultp> bvec4; + + // Vector int + + typedef vec<1, int, lowp> lowp_ivec1; + typedef vec<2, int, lowp> lowp_ivec2; + typedef vec<3, int, lowp> lowp_ivec3; + typedef vec<4, int, lowp> lowp_ivec4; + + typedef vec<1, int, mediump> mediump_ivec1; + typedef vec<2, int, mediump> mediump_ivec2; + typedef vec<3, int, mediump> mediump_ivec3; + typedef vec<4, int, mediump> mediump_ivec4; + + typedef vec<1, int, highp> highp_ivec1; + typedef vec<2, int, highp> highp_ivec2; + typedef vec<3, int, highp> highp_ivec3; + typedef vec<4, int, highp> highp_ivec4; + + typedef vec<1, int, defaultp> ivec1; + typedef vec<2, int, defaultp> ivec2; + typedef vec<3, int, defaultp> ivec3; + typedef vec<4, int, defaultp> ivec4; + + typedef vec<1, i8, lowp> lowp_i8vec1; + typedef vec<2, i8, lowp> lowp_i8vec2; + typedef vec<3, i8, lowp> lowp_i8vec3; + typedef vec<4, i8, lowp> lowp_i8vec4; + + typedef vec<1, i8, mediump> mediump_i8vec1; + typedef vec<2, i8, mediump> mediump_i8vec2; + typedef vec<3, i8, mediump> mediump_i8vec3; + typedef vec<4, i8, mediump> mediump_i8vec4; + + typedef vec<1, i8, highp> highp_i8vec1; + typedef vec<2, i8, highp> highp_i8vec2; + typedef vec<3, i8, highp> highp_i8vec3; + typedef vec<4, i8, highp> highp_i8vec4; + + typedef vec<1, i8, defaultp> i8vec1; + typedef vec<2, i8, defaultp> i8vec2; + typedef vec<3, i8, defaultp> i8vec3; + typedef vec<4, i8, defaultp> i8vec4; + + typedef vec<1, i16, lowp> lowp_i16vec1; + typedef vec<2, i16, lowp> lowp_i16vec2; + typedef vec<3, i16, lowp> lowp_i16vec3; + typedef vec<4, i16, lowp> lowp_i16vec4; + + typedef vec<1, i16, mediump> mediump_i16vec1; + typedef vec<2, i16, mediump> mediump_i16vec2; + typedef vec<3, i16, mediump> mediump_i16vec3; + typedef vec<4, i16, mediump> mediump_i16vec4; + + typedef vec<1, i16, highp> highp_i16vec1; + typedef vec<2, i16, highp> highp_i16vec2; + typedef vec<3, i16, highp> highp_i16vec3; + typedef vec<4, i16, highp> highp_i16vec4; + + typedef vec<1, i16, defaultp> i16vec1; + typedef vec<2, i16, defaultp> i16vec2; + typedef vec<3, i16, defaultp> i16vec3; + typedef vec<4, i16, defaultp> i16vec4; + + typedef vec<1, i32, lowp> lowp_i32vec1; + typedef vec<2, i32, lowp> lowp_i32vec2; + typedef vec<3, i32, lowp> lowp_i32vec3; + typedef vec<4, i32, lowp> lowp_i32vec4; + + typedef vec<1, i32, mediump> mediump_i32vec1; + typedef vec<2, i32, mediump> mediump_i32vec2; + typedef vec<3, i32, mediump> mediump_i32vec3; + typedef vec<4, i32, mediump> mediump_i32vec4; + + typedef vec<1, i32, highp> highp_i32vec1; + typedef vec<2, i32, highp> highp_i32vec2; + typedef vec<3, i32, highp> highp_i32vec3; + typedef vec<4, i32, highp> highp_i32vec4; + + typedef vec<1, i32, defaultp> i32vec1; + typedef vec<2, i32, defaultp> i32vec2; + typedef vec<3, i32, defaultp> i32vec3; + typedef vec<4, i32, defaultp> i32vec4; + + typedef vec<1, i64, lowp> lowp_i64vec1; + typedef vec<2, i64, lowp> lowp_i64vec2; + typedef vec<3, i64, lowp> lowp_i64vec3; + typedef vec<4, i64, lowp> lowp_i64vec4; + + typedef vec<1, i64, mediump> mediump_i64vec1; + typedef vec<2, i64, mediump> mediump_i64vec2; + typedef vec<3, i64, mediump> mediump_i64vec3; + typedef vec<4, i64, mediump> mediump_i64vec4; + + typedef vec<1, i64, highp> highp_i64vec1; + typedef vec<2, i64, highp> highp_i64vec2; + typedef vec<3, i64, highp> highp_i64vec3; + typedef vec<4, i64, highp> highp_i64vec4; + + typedef vec<1, i64, defaultp> i64vec1; + typedef vec<2, i64, defaultp> i64vec2; + typedef vec<3, i64, defaultp> i64vec3; + typedef vec<4, i64, defaultp> i64vec4; + + // Vector uint + + typedef vec<1, uint, lowp> lowp_uvec1; + typedef vec<2, uint, lowp> lowp_uvec2; + typedef vec<3, uint, lowp> lowp_uvec3; + typedef vec<4, uint, lowp> lowp_uvec4; + + typedef vec<1, uint, mediump> mediump_uvec1; + typedef vec<2, uint, mediump> mediump_uvec2; + typedef vec<3, uint, mediump> mediump_uvec3; + typedef vec<4, uint, mediump> mediump_uvec4; + + typedef vec<1, uint, highp> highp_uvec1; + typedef vec<2, uint, highp> highp_uvec2; + typedef vec<3, uint, highp> highp_uvec3; + typedef vec<4, uint, highp> highp_uvec4; + + typedef vec<1, uint, defaultp> uvec1; + typedef vec<2, uint, defaultp> uvec2; + typedef vec<3, uint, defaultp> uvec3; + typedef vec<4, uint, defaultp> uvec4; + + typedef vec<1, u8, lowp> lowp_u8vec1; + typedef vec<2, u8, lowp> lowp_u8vec2; + typedef vec<3, u8, lowp> lowp_u8vec3; + typedef vec<4, u8, lowp> lowp_u8vec4; + + typedef vec<1, u8, mediump> mediump_u8vec1; + typedef vec<2, u8, mediump> mediump_u8vec2; + typedef vec<3, u8, mediump> mediump_u8vec3; + typedef vec<4, u8, mediump> mediump_u8vec4; + + typedef vec<1, u8, highp> highp_u8vec1; + typedef vec<2, u8, highp> highp_u8vec2; + typedef vec<3, u8, highp> highp_u8vec3; + typedef vec<4, u8, highp> highp_u8vec4; + + typedef vec<1, u8, defaultp> u8vec1; + typedef vec<2, u8, defaultp> u8vec2; + typedef vec<3, u8, defaultp> u8vec3; + typedef vec<4, u8, defaultp> u8vec4; + + typedef vec<1, u16, lowp> lowp_u16vec1; + typedef vec<2, u16, lowp> lowp_u16vec2; + typedef vec<3, u16, lowp> lowp_u16vec3; + typedef vec<4, u16, lowp> lowp_u16vec4; + + typedef vec<1, u16, mediump> mediump_u16vec1; + typedef vec<2, u16, mediump> mediump_u16vec2; + typedef vec<3, u16, mediump> mediump_u16vec3; + typedef vec<4, u16, mediump> mediump_u16vec4; + + typedef vec<1, u16, highp> highp_u16vec1; + typedef vec<2, u16, highp> highp_u16vec2; + typedef vec<3, u16, highp> highp_u16vec3; + typedef vec<4, u16, highp> highp_u16vec4; + + typedef vec<1, u16, defaultp> u16vec1; + typedef vec<2, u16, defaultp> u16vec2; + typedef vec<3, u16, defaultp> u16vec3; + typedef vec<4, u16, defaultp> u16vec4; + + typedef vec<1, u32, lowp> lowp_u32vec1; + typedef vec<2, u32, lowp> lowp_u32vec2; + typedef vec<3, u32, lowp> lowp_u32vec3; + typedef vec<4, u32, lowp> lowp_u32vec4; + + typedef vec<1, u32, mediump> mediump_u32vec1; + typedef vec<2, u32, mediump> mediump_u32vec2; + typedef vec<3, u32, mediump> mediump_u32vec3; + typedef vec<4, u32, mediump> mediump_u32vec4; + + typedef vec<1, u32, highp> highp_u32vec1; + typedef vec<2, u32, highp> highp_u32vec2; + typedef vec<3, u32, highp> highp_u32vec3; + typedef vec<4, u32, highp> highp_u32vec4; + + typedef vec<1, u32, defaultp> u32vec1; + typedef vec<2, u32, defaultp> u32vec2; + typedef vec<3, u32, defaultp> u32vec3; + typedef vec<4, u32, defaultp> u32vec4; + + typedef vec<1, u64, lowp> lowp_u64vec1; + typedef vec<2, u64, lowp> lowp_u64vec2; + typedef vec<3, u64, lowp> lowp_u64vec3; + typedef vec<4, u64, lowp> lowp_u64vec4; + + typedef vec<1, u64, mediump> mediump_u64vec1; + typedef vec<2, u64, mediump> mediump_u64vec2; + typedef vec<3, u64, mediump> mediump_u64vec3; + typedef vec<4, u64, mediump> mediump_u64vec4; + + typedef vec<1, u64, highp> highp_u64vec1; + typedef vec<2, u64, highp> highp_u64vec2; + typedef vec<3, u64, highp> highp_u64vec3; + typedef vec<4, u64, highp> highp_u64vec4; + + typedef vec<1, u64, defaultp> u64vec1; + typedef vec<2, u64, defaultp> u64vec2; + typedef vec<3, u64, defaultp> u64vec3; + typedef vec<4, u64, defaultp> u64vec4; + + // Vector float + + typedef vec<1, float, lowp> lowp_vec1; + typedef vec<2, float, lowp> lowp_vec2; + typedef vec<3, float, lowp> lowp_vec3; + typedef vec<4, float, lowp> lowp_vec4; + + typedef vec<1, float, mediump> mediump_vec1; + typedef vec<2, float, mediump> mediump_vec2; + typedef vec<3, float, mediump> mediump_vec3; + typedef vec<4, float, mediump> mediump_vec4; + + typedef vec<1, float, highp> highp_vec1; + typedef vec<2, float, highp> highp_vec2; + typedef vec<3, float, highp> highp_vec3; + typedef vec<4, float, highp> highp_vec4; + + typedef vec<1, float, defaultp> vec1; + typedef vec<2, float, defaultp> vec2; + typedef vec<3, float, defaultp> vec3; + typedef vec<4, float, defaultp> vec4; + + typedef vec<1, float, lowp> lowp_fvec1; + typedef vec<2, float, lowp> lowp_fvec2; + typedef vec<3, float, lowp> lowp_fvec3; + typedef vec<4, float, lowp> lowp_fvec4; + + typedef vec<1, float, mediump> mediump_fvec1; + typedef vec<2, float, mediump> mediump_fvec2; + typedef vec<3, float, mediump> mediump_fvec3; + typedef vec<4, float, mediump> mediump_fvec4; + + typedef vec<1, float, highp> highp_fvec1; + typedef vec<2, float, highp> highp_fvec2; + typedef vec<3, float, highp> highp_fvec3; + typedef vec<4, float, highp> highp_fvec4; + + typedef vec<1, f32, defaultp> fvec1; + typedef vec<2, f32, defaultp> fvec2; + typedef vec<3, f32, defaultp> fvec3; + typedef vec<4, f32, defaultp> fvec4; + + typedef vec<1, f32, lowp> lowp_f32vec1; + typedef vec<2, f32, lowp> lowp_f32vec2; + typedef vec<3, f32, lowp> lowp_f32vec3; + typedef vec<4, f32, lowp> lowp_f32vec4; + + typedef vec<1, f32, mediump> mediump_f32vec1; + typedef vec<2, f32, mediump> mediump_f32vec2; + typedef vec<3, f32, mediump> mediump_f32vec3; + typedef vec<4, f32, mediump> mediump_f32vec4; + + typedef vec<1, f32, highp> highp_f32vec1; + typedef vec<2, f32, highp> highp_f32vec2; + typedef vec<3, f32, highp> highp_f32vec3; + typedef vec<4, f32, highp> highp_f32vec4; + + typedef vec<1, f32, defaultp> f32vec1; + typedef vec<2, f32, defaultp> f32vec2; + typedef vec<3, f32, defaultp> f32vec3; + typedef vec<4, f32, defaultp> f32vec4; + + typedef vec<1, f64, lowp> lowp_dvec1; + typedef vec<2, f64, lowp> lowp_dvec2; + typedef vec<3, f64, lowp> lowp_dvec3; + typedef vec<4, f64, lowp> lowp_dvec4; + + typedef vec<1, f64, mediump> mediump_dvec1; + typedef vec<2, f64, mediump> mediump_dvec2; + typedef vec<3, f64, mediump> mediump_dvec3; + typedef vec<4, f64, mediump> mediump_dvec4; + + typedef vec<1, f64, highp> highp_dvec1; + typedef vec<2, f64, highp> highp_dvec2; + typedef vec<3, f64, highp> highp_dvec3; + typedef vec<4, f64, highp> highp_dvec4; + + typedef vec<1, f64, defaultp> dvec1; + typedef vec<2, f64, defaultp> dvec2; + typedef vec<3, f64, defaultp> dvec3; + typedef vec<4, f64, defaultp> dvec4; + + typedef vec<1, f64, lowp> lowp_f64vec1; + typedef vec<2, f64, lowp> lowp_f64vec2; + typedef vec<3, f64, lowp> lowp_f64vec3; + typedef vec<4, f64, lowp> lowp_f64vec4; + + typedef vec<1, f64, mediump> mediump_f64vec1; + typedef vec<2, f64, mediump> mediump_f64vec2; + typedef vec<3, f64, mediump> mediump_f64vec3; + typedef vec<4, f64, mediump> mediump_f64vec4; + + typedef vec<1, f64, highp> highp_f64vec1; + typedef vec<2, f64, highp> highp_f64vec2; + typedef vec<3, f64, highp> highp_f64vec3; + typedef vec<4, f64, highp> highp_f64vec4; + + typedef vec<1, f64, defaultp> f64vec1; + typedef vec<2, f64, defaultp> f64vec2; + typedef vec<3, f64, defaultp> f64vec3; + typedef vec<4, f64, defaultp> f64vec4; + + // Matrix NxN + + typedef mat<2, 2, f32, lowp> lowp_mat2; + typedef mat<3, 3, f32, lowp> lowp_mat3; + typedef mat<4, 4, f32, lowp> lowp_mat4; + + typedef mat<2, 2, f32, mediump> mediump_mat2; + typedef mat<3, 3, f32, mediump> mediump_mat3; + typedef mat<4, 4, f32, mediump> mediump_mat4; + + typedef mat<2, 2, f32, highp> highp_mat2; + typedef mat<3, 3, f32, highp> highp_mat3; + typedef mat<4, 4, f32, highp> highp_mat4; + + typedef mat<2, 2, f32, defaultp> mat2; + typedef mat<3, 3, f32, defaultp> mat3; + typedef mat<4, 4, f32, defaultp> mat4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2; + typedef mat<3, 3, f32, lowp> lowp_fmat3; + typedef mat<4, 4, f32, lowp> lowp_fmat4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2; + typedef mat<3, 3, f32, mediump> mediump_fmat3; + typedef mat<4, 4, f32, mediump> mediump_fmat4; + + typedef mat<2, 2, f32, highp> highp_fmat2; + typedef mat<3, 3, f32, highp> highp_fmat3; + typedef mat<4, 4, f32, highp> highp_fmat4; + + typedef mat<2, 2, f32, defaultp> fmat2; + typedef mat<3, 3, f32, defaultp> fmat3; + typedef mat<4, 4, f32, defaultp> fmat4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4; + + typedef mat<2, 2, f32, highp> highp_f32mat2; + typedef mat<3, 3, f32, highp> highp_f32mat3; + typedef mat<4, 4, f32, highp> highp_f32mat4; + + typedef mat<2, 2, f32, defaultp> f32mat2; + typedef mat<3, 3, f32, defaultp> f32mat3; + typedef mat<4, 4, f32, defaultp> f32mat4; + + typedef mat<2, 2, f64, lowp> lowp_dmat2; + typedef mat<3, 3, f64, lowp> lowp_dmat3; + typedef mat<4, 4, f64, lowp> lowp_dmat4; + + typedef mat<2, 2, f64, mediump> mediump_dmat2; + typedef mat<3, 3, f64, mediump> mediump_dmat3; + typedef mat<4, 4, f64, mediump> mediump_dmat4; + + typedef mat<2, 2, f64, highp> highp_dmat2; + typedef mat<3, 3, f64, highp> highp_dmat3; + typedef mat<4, 4, f64, highp> highp_dmat4; + + typedef mat<2, 2, f64, defaultp> dmat2; + typedef mat<3, 3, f64, defaultp> dmat3; + typedef mat<4, 4, f64, defaultp> dmat4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4; + + typedef mat<2, 2, f64, highp> highp_f64mat2; + typedef mat<3, 3, f64, highp> highp_f64mat3; + typedef mat<4, 4, f64, highp> highp_f64mat4; + + typedef mat<2, 2, f64, defaultp> f64mat2; + typedef mat<3, 3, f64, defaultp> f64mat3; + typedef mat<4, 4, f64, defaultp> f64mat4; + + // Matrix MxN + + typedef mat<2, 2, f32, lowp> lowp_mat2x2; + typedef mat<2, 3, f32, lowp> lowp_mat2x3; + typedef mat<2, 4, f32, lowp> lowp_mat2x4; + typedef mat<3, 2, f32, lowp> lowp_mat3x2; + typedef mat<3, 3, f32, lowp> lowp_mat3x3; + typedef mat<3, 4, f32, lowp> lowp_mat3x4; + typedef mat<4, 2, f32, lowp> lowp_mat4x2; + typedef mat<4, 3, f32, lowp> lowp_mat4x3; + typedef mat<4, 4, f32, lowp> lowp_mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_mat2x2; + typedef mat<2, 3, f32, mediump> mediump_mat2x3; + typedef mat<2, 4, f32, mediump> mediump_mat2x4; + typedef mat<3, 2, f32, mediump> mediump_mat3x2; + typedef mat<3, 3, f32, mediump> mediump_mat3x3; + typedef mat<3, 4, f32, mediump> mediump_mat3x4; + typedef mat<4, 2, f32, mediump> mediump_mat4x2; + typedef mat<4, 3, f32, mediump> mediump_mat4x3; + typedef mat<4, 4, f32, mediump> mediump_mat4x4; + + typedef mat<2, 2, f32, highp> highp_mat2x2; + typedef mat<2, 3, f32, highp> highp_mat2x3; + typedef mat<2, 4, f32, highp> highp_mat2x4; + typedef mat<3, 2, f32, highp> highp_mat3x2; + typedef mat<3, 3, f32, highp> highp_mat3x3; + typedef mat<3, 4, f32, highp> highp_mat3x4; + typedef mat<4, 2, f32, highp> highp_mat4x2; + typedef mat<4, 3, f32, highp> highp_mat4x3; + typedef mat<4, 4, f32, highp> highp_mat4x4; + + typedef mat<2, 2, f32, defaultp> mat2x2; + typedef mat<3, 2, f32, defaultp> mat3x2; + typedef mat<4, 2, f32, defaultp> mat4x2; + typedef mat<2, 3, f32, defaultp> mat2x3; + typedef mat<3, 3, f32, defaultp> mat3x3; + typedef mat<4, 3, f32, defaultp> mat4x3; + typedef mat<2, 4, f32, defaultp> mat2x4; + typedef mat<3, 4, f32, defaultp> mat3x4; + typedef mat<4, 4, f32, defaultp> mat4x4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + typedef mat<2, 2, f32, highp> highp_fmat2x2; + typedef mat<2, 3, f32, highp> highp_fmat2x3; + typedef mat<2, 4, f32, highp> highp_fmat2x4; + typedef mat<3, 2, f32, highp> highp_fmat3x2; + typedef mat<3, 3, f32, highp> highp_fmat3x3; + typedef mat<3, 4, f32, highp> highp_fmat3x4; + typedef mat<4, 2, f32, highp> highp_fmat4x2; + typedef mat<4, 3, f32, highp> highp_fmat4x3; + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + typedef mat<2, 2, f32, defaultp> fmat2x2; + typedef mat<3, 2, f32, defaultp> fmat3x2; + typedef mat<4, 2, f32, defaultp> fmat4x2; + typedef mat<2, 3, f32, defaultp> fmat2x3; + typedef mat<3, 3, f32, defaultp> fmat3x3; + typedef mat<4, 3, f32, defaultp> fmat4x3; + typedef mat<2, 4, f32, defaultp> fmat2x4; + typedef mat<3, 4, f32, defaultp> fmat3x4; + typedef mat<4, 4, f32, defaultp> fmat4x4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + typedef mat<2, 2, f32, defaultp> f32mat2x2; + typedef mat<3, 2, f32, defaultp> f32mat3x2; + typedef mat<4, 2, f32, defaultp> f32mat4x2; + typedef mat<2, 3, f32, defaultp> f32mat2x3; + typedef mat<3, 3, f32, defaultp> f32mat3x3; + typedef mat<4, 3, f32, defaultp> f32mat4x3; + typedef mat<2, 4, f32, defaultp> f32mat2x4; + typedef mat<3, 4, f32, defaultp> f32mat3x4; + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + typedef mat<2, 2, double, highp> highp_dmat2x2; + typedef mat<2, 3, double, highp> highp_dmat2x3; + typedef mat<2, 4, double, highp> highp_dmat2x4; + typedef mat<3, 2, double, highp> highp_dmat3x2; + typedef mat<3, 3, double, highp> highp_dmat3x3; + typedef mat<3, 4, double, highp> highp_dmat3x4; + typedef mat<4, 2, double, highp> highp_dmat4x2; + typedef mat<4, 3, double, highp> highp_dmat4x3; + typedef mat<4, 4, double, highp> highp_dmat4x4; + + typedef mat<2, 2, double, defaultp> dmat2x2; + typedef mat<3, 2, double, defaultp> dmat3x2; + typedef mat<4, 2, double, defaultp> dmat4x2; + typedef mat<2, 3, double, defaultp> dmat2x3; + typedef mat<3, 3, double, defaultp> dmat3x3; + typedef mat<4, 3, double, defaultp> dmat4x3; + typedef mat<2, 4, double, defaultp> dmat2x4; + typedef mat<3, 4, double, defaultp> dmat3x4; + typedef mat<4, 4, double, defaultp> dmat4x4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + typedef mat<2, 2, f64, defaultp> f64mat2x2; + typedef mat<3, 2, f64, defaultp> f64mat3x2; + typedef mat<4, 2, f64, defaultp> f64mat4x2; + typedef mat<2, 3, f64, defaultp> f64mat2x3; + typedef mat<3, 3, f64, defaultp> f64mat3x3; + typedef mat<4, 3, f64, defaultp> f64mat4x3; + typedef mat<2, 4, f64, defaultp> f64mat2x4; + typedef mat<3, 4, f64, defaultp> f64mat3x4; + typedef mat<4, 4, f64, defaultp> f64mat4x4; + + // Signed integer matrix MxN + + typedef mat<2, 2, int, lowp> lowp_imat2x2; + typedef mat<2, 3, int, lowp> lowp_imat2x3; + typedef mat<2, 4, int, lowp> lowp_imat2x4; + typedef mat<3, 2, int, lowp> lowp_imat3x2; + typedef mat<3, 3, int, lowp> lowp_imat3x3; + typedef mat<3, 4, int, lowp> lowp_imat3x4; + typedef mat<4, 2, int, lowp> lowp_imat4x2; + typedef mat<4, 3, int, lowp> lowp_imat4x3; + typedef mat<4, 4, int, lowp> lowp_imat4x4; + + typedef mat<2, 2, int, mediump> mediump_imat2x2; + typedef mat<2, 3, int, mediump> mediump_imat2x3; + typedef mat<2, 4, int, mediump> mediump_imat2x4; + typedef mat<3, 2, int, mediump> mediump_imat3x2; + typedef mat<3, 3, int, mediump> mediump_imat3x3; + typedef mat<3, 4, int, mediump> mediump_imat3x4; + typedef mat<4, 2, int, mediump> mediump_imat4x2; + typedef mat<4, 3, int, mediump> mediump_imat4x3; + typedef mat<4, 4, int, mediump> mediump_imat4x4; + + typedef mat<2, 2, int, highp> highp_imat2x2; + typedef mat<2, 3, int, highp> highp_imat2x3; + typedef mat<2, 4, int, highp> highp_imat2x4; + typedef mat<3, 2, int, highp> highp_imat3x2; + typedef mat<3, 3, int, highp> highp_imat3x3; + typedef mat<3, 4, int, highp> highp_imat3x4; + typedef mat<4, 2, int, highp> highp_imat4x2; + typedef mat<4, 3, int, highp> highp_imat4x3; + typedef mat<4, 4, int, highp> highp_imat4x4; + + typedef mat<2, 2, int, defaultp> imat2x2; + typedef mat<3, 2, int, defaultp> imat3x2; + typedef mat<4, 2, int, defaultp> imat4x2; + typedef mat<2, 3, int, defaultp> imat2x3; + typedef mat<3, 3, int, defaultp> imat3x3; + typedef mat<4, 3, int, defaultp> imat4x3; + typedef mat<2, 4, int, defaultp> imat2x4; + typedef mat<3, 4, int, defaultp> imat3x4; + typedef mat<4, 4, int, defaultp> imat4x4; + + + typedef mat<2, 2, int8, lowp> lowp_i8mat2x2; + typedef mat<2, 3, int8, lowp> lowp_i8mat2x3; + typedef mat<2, 4, int8, lowp> lowp_i8mat2x4; + typedef mat<3, 2, int8, lowp> lowp_i8mat3x2; + typedef mat<3, 3, int8, lowp> lowp_i8mat3x3; + typedef mat<3, 4, int8, lowp> lowp_i8mat3x4; + typedef mat<4, 2, int8, lowp> lowp_i8mat4x2; + typedef mat<4, 3, int8, lowp> lowp_i8mat4x3; + typedef mat<4, 4, int8, lowp> lowp_i8mat4x4; + + typedef mat<2, 2, int8, mediump> mediump_i8mat2x2; + typedef mat<2, 3, int8, mediump> mediump_i8mat2x3; + typedef mat<2, 4, int8, mediump> mediump_i8mat2x4; + typedef mat<3, 2, int8, mediump> mediump_i8mat3x2; + typedef mat<3, 3, int8, mediump> mediump_i8mat3x3; + typedef mat<3, 4, int8, mediump> mediump_i8mat3x4; + typedef mat<4, 2, int8, mediump> mediump_i8mat4x2; + typedef mat<4, 3, int8, mediump> mediump_i8mat4x3; + typedef mat<4, 4, int8, mediump> mediump_i8mat4x4; + + typedef mat<2, 2, int8, highp> highp_i8mat2x2; + typedef mat<2, 3, int8, highp> highp_i8mat2x3; + typedef mat<2, 4, int8, highp> highp_i8mat2x4; + typedef mat<3, 2, int8, highp> highp_i8mat3x2; + typedef mat<3, 3, int8, highp> highp_i8mat3x3; + typedef mat<3, 4, int8, highp> highp_i8mat3x4; + typedef mat<4, 2, int8, highp> highp_i8mat4x2; + typedef mat<4, 3, int8, highp> highp_i8mat4x3; + typedef mat<4, 4, int8, highp> highp_i8mat4x4; + + typedef mat<2, 2, int8, defaultp> i8mat2x2; + typedef mat<3, 2, int8, defaultp> i8mat3x2; + typedef mat<4, 2, int8, defaultp> i8mat4x2; + typedef mat<2, 3, int8, defaultp> i8mat2x3; + typedef mat<3, 3, int8, defaultp> i8mat3x3; + typedef mat<4, 3, int8, defaultp> i8mat4x3; + typedef mat<2, 4, int8, defaultp> i8mat2x4; + typedef mat<3, 4, int8, defaultp> i8mat3x4; + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + + typedef mat<2, 2, int16, lowp> lowp_i16mat2x2; + typedef mat<2, 3, int16, lowp> lowp_i16mat2x3; + typedef mat<2, 4, int16, lowp> lowp_i16mat2x4; + typedef mat<3, 2, int16, lowp> lowp_i16mat3x2; + typedef mat<3, 3, int16, lowp> lowp_i16mat3x3; + typedef mat<3, 4, int16, lowp> lowp_i16mat3x4; + typedef mat<4, 2, int16, lowp> lowp_i16mat4x2; + typedef mat<4, 3, int16, lowp> lowp_i16mat4x3; + typedef mat<4, 4, int16, lowp> lowp_i16mat4x4; + + typedef mat<2, 2, int16, mediump> mediump_i16mat2x2; + typedef mat<2, 3, int16, mediump> mediump_i16mat2x3; + typedef mat<2, 4, int16, mediump> mediump_i16mat2x4; + typedef mat<3, 2, int16, mediump> mediump_i16mat3x2; + typedef mat<3, 3, int16, mediump> mediump_i16mat3x3; + typedef mat<3, 4, int16, mediump> mediump_i16mat3x4; + typedef mat<4, 2, int16, mediump> mediump_i16mat4x2; + typedef mat<4, 3, int16, mediump> mediump_i16mat4x3; + typedef mat<4, 4, int16, mediump> mediump_i16mat4x4; + + typedef mat<2, 2, int16, highp> highp_i16mat2x2; + typedef mat<2, 3, int16, highp> highp_i16mat2x3; + typedef mat<2, 4, int16, highp> highp_i16mat2x4; + typedef mat<3, 2, int16, highp> highp_i16mat3x2; + typedef mat<3, 3, int16, highp> highp_i16mat3x3; + typedef mat<3, 4, int16, highp> highp_i16mat3x4; + typedef mat<4, 2, int16, highp> highp_i16mat4x2; + typedef mat<4, 3, int16, highp> highp_i16mat4x3; + typedef mat<4, 4, int16, highp> highp_i16mat4x4; + + typedef mat<2, 2, int16, defaultp> i16mat2x2; + typedef mat<3, 2, int16, defaultp> i16mat3x2; + typedef mat<4, 2, int16, defaultp> i16mat4x2; + typedef mat<2, 3, int16, defaultp> i16mat2x3; + typedef mat<3, 3, int16, defaultp> i16mat3x3; + typedef mat<4, 3, int16, defaultp> i16mat4x3; + typedef mat<2, 4, int16, defaultp> i16mat2x4; + typedef mat<3, 4, int16, defaultp> i16mat3x4; + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + + typedef mat<2, 2, int32, lowp> lowp_i32mat2x2; + typedef mat<2, 3, int32, lowp> lowp_i32mat2x3; + typedef mat<2, 4, int32, lowp> lowp_i32mat2x4; + typedef mat<3, 2, int32, lowp> lowp_i32mat3x2; + typedef mat<3, 3, int32, lowp> lowp_i32mat3x3; + typedef mat<3, 4, int32, lowp> lowp_i32mat3x4; + typedef mat<4, 2, int32, lowp> lowp_i32mat4x2; + typedef mat<4, 3, int32, lowp> lowp_i32mat4x3; + typedef mat<4, 4, int32, lowp> lowp_i32mat4x4; + + typedef mat<2, 2, int32, mediump> mediump_i32mat2x2; + typedef mat<2, 3, int32, mediump> mediump_i32mat2x3; + typedef mat<2, 4, int32, mediump> mediump_i32mat2x4; + typedef mat<3, 2, int32, mediump> mediump_i32mat3x2; + typedef mat<3, 3, int32, mediump> mediump_i32mat3x3; + typedef mat<3, 4, int32, mediump> mediump_i32mat3x4; + typedef mat<4, 2, int32, mediump> mediump_i32mat4x2; + typedef mat<4, 3, int32, mediump> mediump_i32mat4x3; + typedef mat<4, 4, int32, mediump> mediump_i32mat4x4; + + typedef mat<2, 2, int32, highp> highp_i32mat2x2; + typedef mat<2, 3, int32, highp> highp_i32mat2x3; + typedef mat<2, 4, int32, highp> highp_i32mat2x4; + typedef mat<3, 2, int32, highp> highp_i32mat3x2; + typedef mat<3, 3, int32, highp> highp_i32mat3x3; + typedef mat<3, 4, int32, highp> highp_i32mat3x4; + typedef mat<4, 2, int32, highp> highp_i32mat4x2; + typedef mat<4, 3, int32, highp> highp_i32mat4x3; + typedef mat<4, 4, int32, highp> highp_i32mat4x4; + + typedef mat<2, 2, int32, defaultp> i32mat2x2; + typedef mat<3, 2, int32, defaultp> i32mat3x2; + typedef mat<4, 2, int32, defaultp> i32mat4x2; + typedef mat<2, 3, int32, defaultp> i32mat2x3; + typedef mat<3, 3, int32, defaultp> i32mat3x3; + typedef mat<4, 3, int32, defaultp> i32mat4x3; + typedef mat<2, 4, int32, defaultp> i32mat2x4; + typedef mat<3, 4, int32, defaultp> i32mat3x4; + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + + typedef mat<2, 2, int64, lowp> lowp_i64mat2x2; + typedef mat<2, 3, int64, lowp> lowp_i64mat2x3; + typedef mat<2, 4, int64, lowp> lowp_i64mat2x4; + typedef mat<3, 2, int64, lowp> lowp_i64mat3x2; + typedef mat<3, 3, int64, lowp> lowp_i64mat3x3; + typedef mat<3, 4, int64, lowp> lowp_i64mat3x4; + typedef mat<4, 2, int64, lowp> lowp_i64mat4x2; + typedef mat<4, 3, int64, lowp> lowp_i64mat4x3; + typedef mat<4, 4, int64, lowp> lowp_i64mat4x4; + + typedef mat<2, 2, int64, mediump> mediump_i64mat2x2; + typedef mat<2, 3, int64, mediump> mediump_i64mat2x3; + typedef mat<2, 4, int64, mediump> mediump_i64mat2x4; + typedef mat<3, 2, int64, mediump> mediump_i64mat3x2; + typedef mat<3, 3, int64, mediump> mediump_i64mat3x3; + typedef mat<3, 4, int64, mediump> mediump_i64mat3x4; + typedef mat<4, 2, int64, mediump> mediump_i64mat4x2; + typedef mat<4, 3, int64, mediump> mediump_i64mat4x3; + typedef mat<4, 4, int64, mediump> mediump_i64mat4x4; + + typedef mat<2, 2, int64, highp> highp_i64mat2x2; + typedef mat<2, 3, int64, highp> highp_i64mat2x3; + typedef mat<2, 4, int64, highp> highp_i64mat2x4; + typedef mat<3, 2, int64, highp> highp_i64mat3x2; + typedef mat<3, 3, int64, highp> highp_i64mat3x3; + typedef mat<3, 4, int64, highp> highp_i64mat3x4; + typedef mat<4, 2, int64, highp> highp_i64mat4x2; + typedef mat<4, 3, int64, highp> highp_i64mat4x3; + typedef mat<4, 4, int64, highp> highp_i64mat4x4; + + typedef mat<2, 2, int64, defaultp> i64mat2x2; + typedef mat<3, 2, int64, defaultp> i64mat3x2; + typedef mat<4, 2, int64, defaultp> i64mat4x2; + typedef mat<2, 3, int64, defaultp> i64mat2x3; + typedef mat<3, 3, int64, defaultp> i64mat3x3; + typedef mat<4, 3, int64, defaultp> i64mat4x3; + typedef mat<2, 4, int64, defaultp> i64mat2x4; + typedef mat<3, 4, int64, defaultp> i64mat3x4; + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + // Unsigned integer matrix MxN + + typedef mat<2, 2, uint, lowp> lowp_umat2x2; + typedef mat<2, 3, uint, lowp> lowp_umat2x3; + typedef mat<2, 4, uint, lowp> lowp_umat2x4; + typedef mat<3, 2, uint, lowp> lowp_umat3x2; + typedef mat<3, 3, uint, lowp> lowp_umat3x3; + typedef mat<3, 4, uint, lowp> lowp_umat3x4; + typedef mat<4, 2, uint, lowp> lowp_umat4x2; + typedef mat<4, 3, uint, lowp> lowp_umat4x3; + typedef mat<4, 4, uint, lowp> lowp_umat4x4; + + typedef mat<2, 2, uint, mediump> mediump_umat2x2; + typedef mat<2, 3, uint, mediump> mediump_umat2x3; + typedef mat<2, 4, uint, mediump> mediump_umat2x4; + typedef mat<3, 2, uint, mediump> mediump_umat3x2; + typedef mat<3, 3, uint, mediump> mediump_umat3x3; + typedef mat<3, 4, uint, mediump> mediump_umat3x4; + typedef mat<4, 2, uint, mediump> mediump_umat4x2; + typedef mat<4, 3, uint, mediump> mediump_umat4x3; + typedef mat<4, 4, uint, mediump> mediump_umat4x4; + + typedef mat<2, 2, uint, highp> highp_umat2x2; + typedef mat<2, 3, uint, highp> highp_umat2x3; + typedef mat<2, 4, uint, highp> highp_umat2x4; + typedef mat<3, 2, uint, highp> highp_umat3x2; + typedef mat<3, 3, uint, highp> highp_umat3x3; + typedef mat<3, 4, uint, highp> highp_umat3x4; + typedef mat<4, 2, uint, highp> highp_umat4x2; + typedef mat<4, 3, uint, highp> highp_umat4x3; + typedef mat<4, 4, uint, highp> highp_umat4x4; + + typedef mat<2, 2, uint, defaultp> umat2x2; + typedef mat<3, 2, uint, defaultp> umat3x2; + typedef mat<4, 2, uint, defaultp> umat4x2; + typedef mat<2, 3, uint, defaultp> umat2x3; + typedef mat<3, 3, uint, defaultp> umat3x3; + typedef mat<4, 3, uint, defaultp> umat4x3; + typedef mat<2, 4, uint, defaultp> umat2x4; + typedef mat<3, 4, uint, defaultp> umat3x4; + typedef mat<4, 4, uint, defaultp> umat4x4; + + + typedef mat<2, 2, uint8, lowp> lowp_u8mat2x2; + typedef mat<2, 3, uint8, lowp> lowp_u8mat2x3; + typedef mat<2, 4, uint8, lowp> lowp_u8mat2x4; + typedef mat<3, 2, uint8, lowp> lowp_u8mat3x2; + typedef mat<3, 3, uint8, lowp> lowp_u8mat3x3; + typedef mat<3, 4, uint8, lowp> lowp_u8mat3x4; + typedef mat<4, 2, uint8, lowp> lowp_u8mat4x2; + typedef mat<4, 3, uint8, lowp> lowp_u8mat4x3; + typedef mat<4, 4, uint8, lowp> lowp_u8mat4x4; + + typedef mat<2, 2, uint8, mediump> mediump_u8mat2x2; + typedef mat<2, 3, uint8, mediump> mediump_u8mat2x3; + typedef mat<2, 4, uint8, mediump> mediump_u8mat2x4; + typedef mat<3, 2, uint8, mediump> mediump_u8mat3x2; + typedef mat<3, 3, uint8, mediump> mediump_u8mat3x3; + typedef mat<3, 4, uint8, mediump> mediump_u8mat3x4; + typedef mat<4, 2, uint8, mediump> mediump_u8mat4x2; + typedef mat<4, 3, uint8, mediump> mediump_u8mat4x3; + typedef mat<4, 4, uint8, mediump> mediump_u8mat4x4; + + typedef mat<2, 2, uint8, highp> highp_u8mat2x2; + typedef mat<2, 3, uint8, highp> highp_u8mat2x3; + typedef mat<2, 4, uint8, highp> highp_u8mat2x4; + typedef mat<3, 2, uint8, highp> highp_u8mat3x2; + typedef mat<3, 3, uint8, highp> highp_u8mat3x3; + typedef mat<3, 4, uint8, highp> highp_u8mat3x4; + typedef mat<4, 2, uint8, highp> highp_u8mat4x2; + typedef mat<4, 3, uint8, highp> highp_u8mat4x3; + typedef mat<4, 4, uint8, highp> highp_u8mat4x4; + + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + + typedef mat<2, 2, uint16, lowp> lowp_u16mat2x2; + typedef mat<2, 3, uint16, lowp> lowp_u16mat2x3; + typedef mat<2, 4, uint16, lowp> lowp_u16mat2x4; + typedef mat<3, 2, uint16, lowp> lowp_u16mat3x2; + typedef mat<3, 3, uint16, lowp> lowp_u16mat3x3; + typedef mat<3, 4, uint16, lowp> lowp_u16mat3x4; + typedef mat<4, 2, uint16, lowp> lowp_u16mat4x2; + typedef mat<4, 3, uint16, lowp> lowp_u16mat4x3; + typedef mat<4, 4, uint16, lowp> lowp_u16mat4x4; + + typedef mat<2, 2, uint16, mediump> mediump_u16mat2x2; + typedef mat<2, 3, uint16, mediump> mediump_u16mat2x3; + typedef mat<2, 4, uint16, mediump> mediump_u16mat2x4; + typedef mat<3, 2, uint16, mediump> mediump_u16mat3x2; + typedef mat<3, 3, uint16, mediump> mediump_u16mat3x3; + typedef mat<3, 4, uint16, mediump> mediump_u16mat3x4; + typedef mat<4, 2, uint16, mediump> mediump_u16mat4x2; + typedef mat<4, 3, uint16, mediump> mediump_u16mat4x3; + typedef mat<4, 4, uint16, mediump> mediump_u16mat4x4; + + typedef mat<2, 2, uint16, highp> highp_u16mat2x2; + typedef mat<2, 3, uint16, highp> highp_u16mat2x3; + typedef mat<2, 4, uint16, highp> highp_u16mat2x4; + typedef mat<3, 2, uint16, highp> highp_u16mat3x2; + typedef mat<3, 3, uint16, highp> highp_u16mat3x3; + typedef mat<3, 4, uint16, highp> highp_u16mat3x4; + typedef mat<4, 2, uint16, highp> highp_u16mat4x2; + typedef mat<4, 3, uint16, highp> highp_u16mat4x3; + typedef mat<4, 4, uint16, highp> highp_u16mat4x4; + + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + + typedef mat<2, 2, uint32, lowp> lowp_u32mat2x2; + typedef mat<2, 3, uint32, lowp> lowp_u32mat2x3; + typedef mat<2, 4, uint32, lowp> lowp_u32mat2x4; + typedef mat<3, 2, uint32, lowp> lowp_u32mat3x2; + typedef mat<3, 3, uint32, lowp> lowp_u32mat3x3; + typedef mat<3, 4, uint32, lowp> lowp_u32mat3x4; + typedef mat<4, 2, uint32, lowp> lowp_u32mat4x2; + typedef mat<4, 3, uint32, lowp> lowp_u32mat4x3; + typedef mat<4, 4, uint32, lowp> lowp_u32mat4x4; + + typedef mat<2, 2, uint32, mediump> mediump_u32mat2x2; + typedef mat<2, 3, uint32, mediump> mediump_u32mat2x3; + typedef mat<2, 4, uint32, mediump> mediump_u32mat2x4; + typedef mat<3, 2, uint32, mediump> mediump_u32mat3x2; + typedef mat<3, 3, uint32, mediump> mediump_u32mat3x3; + typedef mat<3, 4, uint32, mediump> mediump_u32mat3x4; + typedef mat<4, 2, uint32, mediump> mediump_u32mat4x2; + typedef mat<4, 3, uint32, mediump> mediump_u32mat4x3; + typedef mat<4, 4, uint32, mediump> mediump_u32mat4x4; + + typedef mat<2, 2, uint32, highp> highp_u32mat2x2; + typedef mat<2, 3, uint32, highp> highp_u32mat2x3; + typedef mat<2, 4, uint32, highp> highp_u32mat2x4; + typedef mat<3, 2, uint32, highp> highp_u32mat3x2; + typedef mat<3, 3, uint32, highp> highp_u32mat3x3; + typedef mat<3, 4, uint32, highp> highp_u32mat3x4; + typedef mat<4, 2, uint32, highp> highp_u32mat4x2; + typedef mat<4, 3, uint32, highp> highp_u32mat4x3; + typedef mat<4, 4, uint32, highp> highp_u32mat4x4; + + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + + typedef mat<2, 2, uint64, lowp> lowp_u64mat2x2; + typedef mat<2, 3, uint64, lowp> lowp_u64mat2x3; + typedef mat<2, 4, uint64, lowp> lowp_u64mat2x4; + typedef mat<3, 2, uint64, lowp> lowp_u64mat3x2; + typedef mat<3, 3, uint64, lowp> lowp_u64mat3x3; + typedef mat<3, 4, uint64, lowp> lowp_u64mat3x4; + typedef mat<4, 2, uint64, lowp> lowp_u64mat4x2; + typedef mat<4, 3, uint64, lowp> lowp_u64mat4x3; + typedef mat<4, 4, uint64, lowp> lowp_u64mat4x4; + + typedef mat<2, 2, uint64, mediump> mediump_u64mat2x2; + typedef mat<2, 3, uint64, mediump> mediump_u64mat2x3; + typedef mat<2, 4, uint64, mediump> mediump_u64mat2x4; + typedef mat<3, 2, uint64, mediump> mediump_u64mat3x2; + typedef mat<3, 3, uint64, mediump> mediump_u64mat3x3; + typedef mat<3, 4, uint64, mediump> mediump_u64mat3x4; + typedef mat<4, 2, uint64, mediump> mediump_u64mat4x2; + typedef mat<4, 3, uint64, mediump> mediump_u64mat4x3; + typedef mat<4, 4, uint64, mediump> mediump_u64mat4x4; + + typedef mat<2, 2, uint64, highp> highp_u64mat2x2; + typedef mat<2, 3, uint64, highp> highp_u64mat2x3; + typedef mat<2, 4, uint64, highp> highp_u64mat2x4; + typedef mat<3, 2, uint64, highp> highp_u64mat3x2; + typedef mat<3, 3, uint64, highp> highp_u64mat3x3; + typedef mat<3, 4, uint64, highp> highp_u64mat3x4; + typedef mat<4, 2, uint64, highp> highp_u64mat4x2; + typedef mat<4, 3, uint64, highp> highp_u64mat4x3; + typedef mat<4, 4, uint64, highp> highp_u64mat4x4; + + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + // Quaternion + + typedef qua lowp_quat; + typedef qua mediump_quat; + typedef qua highp_quat; + typedef qua quat; + + typedef qua lowp_fquat; + typedef qua mediump_fquat; + typedef qua highp_fquat; + typedef qua fquat; + + typedef qua lowp_f32quat; + typedef qua mediump_f32quat; + typedef qua highp_f32quat; + typedef qua f32quat; + + typedef qua lowp_dquat; + typedef qua mediump_dquat; + typedef qua highp_dquat; + typedef qua dquat; + + typedef qua lowp_f64quat; + typedef qua mediump_f64quat; + typedef qua highp_f64quat; + typedef qua f64quat; +}//namespace glm + + diff --git a/include/glm/glm/geometric.hpp b/include/glm/glm/geometric.hpp new file mode 100644 index 00000000..c068a3cb --- /dev/null +++ b/include/glm/glm/geometric.hpp @@ -0,0 +1,116 @@ +/// @ref core +/// @file glm/geometric.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions +/// +/// @defgroup core_func_geometric Geometric functions +/// @ingroup core +/// +/// These operate on vectors as vectors, not component-wise. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_func_geometric + /// @{ + + /// Returns the length of x, i.e., sqrt(x * x). + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL length man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL T length(vec const& x); + + /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL distance man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL T distance(vec const& p0, vec const& p1); + + /// Returns the dot product of x and y, i.e., result = x * y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL dot man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL T dot(vec const& x, vec const& y); + + /// Returns the cross product of x and y. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL cross man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + /// Returns a vector in the same direction as x but with length of 1. + /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL normalize man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec normalize(vec const& x); + + /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL faceforward man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec faceforward( + vec const& N, + vec const& I, + vec const& Nref); + + /// For the incident vector I and surface orientation N, + /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL reflect man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec reflect( + vec const& I, + vec const& N); + + /// For the incident vector I and surface normal N, + /// and the ratio of indices of refraction eta, + /// return the refraction vector. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL refract man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec refract( + vec const& I, + vec const& N, + T eta); + + /// @} +}//namespace glm + +#include "detail/func_geometric.inl" diff --git a/include/glm/glm/glm.hpp b/include/glm/glm/glm.hpp new file mode 100644 index 00000000..8b610649 --- /dev/null +++ b/include/glm/glm/glm.hpp @@ -0,0 +1,136 @@ +/// @ref core +/// @file glm/glm.hpp +/// +/// @defgroup core Core features +/// +/// @brief Features that implement in C++ the GLSL specification as closely as possible. +/// +/// The GLM core consists of C++ types that mirror GLSL types and +/// C++ functions that mirror the GLSL functions. +/// +/// The best documentation for GLM Core is the current GLSL specification, +/// version 4.2 +/// (pdf file). +/// +/// GLM core functionalities require to be included to be used. +/// +/// +/// @defgroup core_vector Vector types +/// +/// Vector types of two to four components with an exhaustive set of operators. +/// +/// @ingroup core +/// +/// +/// @defgroup core_vector_precision Vector types with precision qualifiers +/// +/// @brief Vector types with precision qualifiers which may result in various precision in term of ULPs +/// +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. +/// +/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: +/// a number of typedefs that use a particular qualifier. +/// +/// None of these types make any guarantees about the actual qualifier used. +/// +/// @ingroup core +/// +/// +/// @defgroup core_matrix Matrix types +/// +/// Matrix types of with C columns and R rows where C and R are values between 2 to 4 included. +/// These types have exhaustive sets of operators. +/// +/// @ingroup core +/// +/// +/// @defgroup core_matrix_precision Matrix types with precision qualifiers +/// +/// @brief Matrix types with precision qualifiers which may result in various precision in term of ULPs +/// +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. +/// +/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: +/// a number of typedefs that use a particular qualifier. +/// +/// None of these types make any guarantees about the actual qualifier used. +/// +/// @ingroup core +/// +/// +/// @defgroup ext Stable extensions +/// +/// @brief Additional features not specified by GLSL specification. +/// +/// EXT extensions are fully tested and documented. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions at once by +/// including . Otherwise, each extension needs to be included a specific file. +/// +/// +/// @defgroup gtc Recommended extensions +/// +/// @brief Additional features not specified by GLSL specification. +/// +/// GTC extensions aim to be stable with tests and documentation. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions at once by +/// including . Otherwise, each extension needs to be included a specific file. +/// +/// +/// @defgroup gtx Experimental extensions +/// +/// @brief Experimental features not specified by GLSL specification. +/// +/// Experimental extensions are useful functions and types, but the development of +/// their API and functionality is not necessarily stable. They can change +/// substantially between versions. Backwards compatibility is not much of an issue +/// for them. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions +/// at once by including . Otherwise, each extension needs to be +/// included a specific file. +/// +/// @mainpage OpenGL Mathematics (GLM) +/// - Website: glm.g-truc.net +/// - GLM API documentation +/// - GLM Manual + +#include "detail/_fixes.hpp" + +#include "detail/setup.hpp" + +#pragma once + +#include +#include +#include +#include +#include +#include "fwd.hpp" + +#include "vec2.hpp" +#include "vec3.hpp" +#include "vec4.hpp" +#include "mat2x2.hpp" +#include "mat2x3.hpp" +#include "mat2x4.hpp" +#include "mat3x2.hpp" +#include "mat3x3.hpp" +#include "mat3x4.hpp" +#include "mat4x2.hpp" +#include "mat4x3.hpp" +#include "mat4x4.hpp" + +#include "trigonometric.hpp" +#include "exponential.hpp" +#include "common.hpp" +#include "packing.hpp" +#include "geometric.hpp" +#include "matrix.hpp" +#include "vector_relational.hpp" +#include "integer.hpp" diff --git a/include/glm/glm/gtc/bitfield.hpp b/include/glm/glm/gtc/bitfield.hpp new file mode 100644 index 00000000..084fbe75 --- /dev/null +++ b/include/glm/glm/gtc/bitfield.hpp @@ -0,0 +1,266 @@ +/// @ref gtc_bitfield +/// @file glm/gtc/bitfield.hpp +/// +/// @see core (dependence) +/// @see gtc_bitfield (dependence) +/// +/// @defgroup gtc_bitfield GLM_GTC_bitfield +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#include "../detail/setup.hpp" + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "type_precision.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_bitfield extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_bitfield + /// @{ + + /// Build a mask of 'count' bits + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType mask(genIUType Bits); + + /// Build a mask of 'count' bits + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec mask(vec const& v); + + /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); + + /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldRotateRight(vec const& In, int Shift); + + /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); + + /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldRotateLeft(vec const& In, int Shift); + + /// Set to 1 a range of bits. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); + + /// Set to 1 a range of bits. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount); + + /// Set to 0 a range of bits. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); + + /// Set to 0 a range of bits. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint16 bitfieldInterleave(u8vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u8vec2 bitfieldDeinterleave(glm::uint16 x); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(u16vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u16vec2 bitfieldDeinterleave(glm::uint32 x); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(u32vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u32vec2 bitfieldDeinterleave(glm::uint64 x); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); + + /// @} +} //namespace glm + +#include "bitfield.inl" diff --git a/include/glm/glm/gtc/bitfield.inl b/include/glm/glm/gtc/bitfield.inl new file mode 100644 index 00000000..06cf1889 --- /dev/null +++ b/include/glm/glm/gtc/bitfield.inl @@ -0,0 +1,626 @@ +/// @ref gtc_bitfield + +#include "../simd/integer.h" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); + + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); + + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); + + template<> + GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) + { + glm::uint16 REG1(x); + glm::uint16 REG2(y); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555); + + return REG1 | static_cast(REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x33333333); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x33333333); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x55555555); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x55555555); + + return REG1 | (REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x0000FFFF0000FFFFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x0000FFFF0000FFFFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF00FF00FFull); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF00FF00FFull); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333333333333333ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333333333333333ull); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555555555555555ull); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555555555555555ull); + + return REG1 | (REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + glm::uint32 REG3(z); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0xFF0000FFu); + REG2 = ((REG2 << 16) | REG2) & static_cast(0xFF0000FFu); + REG3 = ((REG3 << 16) | REG3) & static_cast(0xFF0000FFu); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x0F00F00Fu); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x0F00F00Fu); + REG3 = ((REG3 << 8) | REG3) & static_cast(0x0F00F00Fu); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0xC30C30C3u); + REG2 = ((REG2 << 4) | REG2) & static_cast(0xC30C30C3u); + REG3 = ((REG3 << 4) | REG3) & static_cast(0xC30C30C3u); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x49249249u); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x49249249u); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x49249249u); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + + REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + + REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + glm::uint32 REG3(z); + glm::uint32 REG4(w); + + REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000Fu); + REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000Fu); + REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000Fu); + REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000Fu); + + REG1 = ((REG1 << 6) | REG1) & static_cast(0x03030303u); + REG2 = ((REG2 << 6) | REG2) & static_cast(0x03030303u); + REG3 = ((REG3 << 6) | REG3) & static_cast(0x03030303u); + REG4 = ((REG4 << 6) | REG4) & static_cast(0x03030303u); + + REG1 = ((REG1 << 3) | REG1) & static_cast(0x11111111u); + REG2 = ((REG2 << 3) | REG2) & static_cast(0x11111111u); + REG3 = ((REG3 << 3) | REG3) & static_cast(0x11111111u); + REG4 = ((REG4 << 3) | REG4) & static_cast(0x11111111u); + + return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + glm::uint64 REG4(w); + + REG1 = ((REG1 << 24) | REG1) & static_cast(0x000000FF000000FFull); + REG2 = ((REG2 << 24) | REG2) & static_cast(0x000000FF000000FFull); + REG3 = ((REG3 << 24) | REG3) & static_cast(0x000000FF000000FFull); + REG4 = ((REG4 << 24) | REG4) & static_cast(0x000000FF000000FFull); + + REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000F000F000Full); + REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000F000F000Full); + REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000F000F000Full); + REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000F000F000Full); + + REG1 = ((REG1 << 6) | REG1) & static_cast(0x0303030303030303ull); + REG2 = ((REG2 << 6) | REG2) & static_cast(0x0303030303030303ull); + REG3 = ((REG3 << 6) | REG3) & static_cast(0x0303030303030303ull); + REG4 = ((REG4 << 6) | REG4) & static_cast(0x0303030303030303ull); + + REG1 = ((REG1 << 3) | REG1) & static_cast(0x1111111111111111ull); + REG2 = ((REG2 << 3) | REG2) & static_cast(0x1111111111111111ull); + REG3 = ((REG3 << 3) | REG3) & static_cast(0x1111111111111111ull); + REG4 = ((REG4 << 3) | REG4) & static_cast(0x1111111111111111ull); + + return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); + + return Bits >= sizeof(genIUType) * 8 ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); + } + + template + GLM_FUNC_QUALIFIER vec mask(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); + + return detail::functor1::call(mask, v); + } + + template + GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); + + int const BitSize = static_cast(sizeof(genIType) * 8); + return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldRotateRight(vec const& In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); + + int const BitSize = static_cast(sizeof(T) * 8); + return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); + + int const BitSize = static_cast(sizeof(genIType) * 8); + return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldRotateLeft(vec const& In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); + + int const BitSize = static_cast(sizeof(T) * 8); + return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) + { + return Value | static_cast(mask(BitCount) << FirstBit); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount) + { + return Value | static_cast(mask(BitCount) << FirstBit); + } + + template + GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) + { + return Value & static_cast(~(mask(BitCount) << FirstBit)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount) + { + return Value & static_cast(~(mask(BitCount) << FirstBit)); + } + + GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y; + + union sign16 + { + int16 i; + uint16 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(u8vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER u8vec2 bitfieldDeinterleave(glm::uint16 x) + { + uint16 REG1(x); + uint16 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555); + REG2 = REG2 & static_cast(0x5555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0xFFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0xFFFF); + + return glm::u8vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(u16vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave(glm::uint32 x) + { + glm::uint32 REG1(x); + glm::uint32 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x55555555); + REG2 = REG2 & static_cast(0x55555555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x33333333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x33333333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF); + + return glm::u16vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) + { + union sign32 + { + int32 i; + uint32 u; + } sign_x, sign_y; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(u32vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u32vec2 bitfieldDeinterleave(glm::uint64 x) + { + glm::uint64 REG1(x); + glm::uint64 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555555555555555ull); + REG2 = REG2 & static_cast(0x5555555555555555ull); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333333333333333ull); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333333333333333ull); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF00FF00FFull); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF00FF00FFull); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF0000FFFFull); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF0000FFFFull); + + REG1 = ((REG1 >> 16) | REG1) & static_cast(0x00000000FFFFFFFFull); + REG2 = ((REG2 >> 16) | REG2) & static_cast(0x00000000FFFFFFFFull); + + return glm::u32vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y, sign_z; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y, sign_z; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) + { + union sign16 + { + int32 i; + uint32 u; + } sign_x, sign_y, sign_z; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u32vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y, sign_z, sign_w; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + sign_w.i = w; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) + { + return detail::bitfieldInterleave(x, y, z, w); + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y, sign_z, sign_w; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + sign_w.i = w; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) + { + return detail::bitfieldInterleave(x, y, z, w); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } +}//namespace glm diff --git a/include/glm/glm/gtc/color_space.hpp b/include/glm/glm/gtc/color_space.hpp new file mode 100644 index 00000000..cffd9f09 --- /dev/null +++ b/include/glm/glm/gtc/color_space.hpp @@ -0,0 +1,56 @@ +/// @ref gtc_color_space +/// @file glm/gtc/color_space.hpp +/// +/// @see core (dependence) +/// @see gtc_color_space (dependence) +/// +/// @defgroup gtc_color_space GLM_GTC_color_space +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../exponential.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_color_space extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_color_space + /// @{ + + /// Convert a linear color to sRGB color using a standard gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear); + + /// Convert a linear color to sRGB color using a custom gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma); + + /// Convert a sRGB color to linear color using a standard gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB); + + /// Convert a sRGB color to linear color using a custom gamma correction. + // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma); + + /// @} +} //namespace glm + +#include "color_space.inl" diff --git a/include/glm/glm/gtc/color_space.inl b/include/glm/glm/gtc/color_space.inl new file mode 100644 index 00000000..2a900044 --- /dev/null +++ b/include/glm/glm/gtc/color_space.inl @@ -0,0 +1,84 @@ +/// @ref gtc_color_space + +namespace glm{ +namespace detail +{ + template + struct compute_rgbToSrgb + { + GLM_FUNC_QUALIFIER static vec call(vec const& ColorRGB, T GammaCorrection) + { + vec const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); + + return mix( + pow(ClampedColor, vec(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), + ClampedColor * static_cast(12.92), + lessThan(ClampedColor, vec(static_cast(0.0031308)))); + } + }; + + template + struct compute_rgbToSrgb<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorRGB, T GammaCorrection) + { + return vec<4, T, Q>(compute_rgbToSrgb<3, T, Q>::call(vec<3, T, Q>(ColorRGB), GammaCorrection), ColorRGB.w); + } + }; + + template + struct compute_srgbToRgb + { + GLM_FUNC_QUALIFIER static vec call(vec const& ColorSRGB, T Gamma) + { + return mix( + pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vec(Gamma)), + ColorSRGB * static_cast(0.07739938080495356037151702786378), + lessThanEqual(ColorSRGB, vec(static_cast(0.04045)))); + } + }; + + template + struct compute_srgbToRgb<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorSRGB, T Gamma) + { + return vec<4, T, Q>(compute_srgbToRgb<3, T, Q>::call(vec<3, T, Q>(ColorSRGB), Gamma), ColorSRGB.w); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear) + { + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); + } + + // Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html + template<> + GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear) + { + vec<3, float, lowp> S1 = sqrt(ColorLinear); + vec<3, float, lowp> S2 = sqrt(S1); + vec<3, float, lowp> S3 = sqrt(S2); + return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear; + } + + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear, T Gamma) + { + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); + } + + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB) + { + return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); + } + + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma) + { + return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); + } +}//namespace glm diff --git a/include/glm/glm/gtc/constants.hpp b/include/glm/glm/gtc/constants.hpp new file mode 100644 index 00000000..99f21286 --- /dev/null +++ b/include/glm/glm/gtc/constants.hpp @@ -0,0 +1,165 @@ +/// @ref gtc_constants +/// @file glm/gtc/constants.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_constants GLM_GTC_constants +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Provide a list of constants and precomputed useful values. + +#pragma once + +// Dependencies +#include "../ext/scalar_constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_constants extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_constants + /// @{ + + /// Return 0. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); + + /// Return 1. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one(); + + /// Return pi * 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); + + /// Return square root of pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); + + /// Return pi / 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); + + /// Return pi / 2 * 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); + + /// Return pi / 4. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); + + /// Return 1 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); + + /// Return 1 / (pi * 2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); + + /// Return 2 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); + + /// Return 4 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); + + /// Return 2 / sqrt(pi). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); + + /// Return 1 / sqrt(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); + + /// Return sqrt(pi / 2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); + + /// Return sqrt(2 * pi). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); + + /// Return sqrt(ln(4)). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); + + /// Return e constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType e(); + + /// Return Euler's constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); + + /// Return sqrt(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); + + /// Return sqrt(3). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); + + /// Return sqrt(5). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); + + /// Return ln(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); + + /// Return ln(10). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); + + /// Return ln(ln(2)). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); + + /// Return 1 / 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType third(); + + /// Return 2 / 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); + + /// Return the golden ratio constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); + + /// @} +} //namespace glm + +#include "constants.inl" diff --git a/include/glm/glm/gtc/constants.inl b/include/glm/glm/gtc/constants.inl new file mode 100644 index 00000000..bb98c6bf --- /dev/null +++ b/include/glm/glm/gtc/constants.inl @@ -0,0 +1,167 @@ +/// @ref gtc_constants + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() + { + return genType(0); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() + { + return genType(1); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() + { + return genType(6.28318530717958647692528676655900576); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() + { + return genType(1.772453850905516027); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() + { + return genType(1.57079632679489661923132169163975144); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() + { + return genType(4.71238898038468985769396507491925432); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() + { + return genType(0.785398163397448309615660845819875721); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() + { + return genType(0.318309886183790671537767526745028724); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() + { + return genType(0.159154943091895335768883763372514362); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() + { + return genType(0.636619772367581343075535053490057448); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() + { + return genType(1.273239544735162686151070106980114898); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() + { + return genType(1.12837916709551257389615890312154517); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() + { + return genType(0.707106781186547524400844362104849039); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() + { + return genType(1.253314137315500251); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() + { + return genType(2.506628274631000502); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() + { + return genType(1.17741002251547469); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() + { + return genType(2.71828182845904523536); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() + { + return genType(0.577215664901532860606); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() + { + return genType(1.41421356237309504880168872420969808); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() + { + return genType(1.73205080756887729352744634150587236); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() + { + return genType(2.23606797749978969640917366873127623); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() + { + return genType(0.693147180559945309417232121458176568); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() + { + return genType(2.30258509299404568401799145468436421); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() + { + return genType(-0.3665129205816643); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() + { + return genType(0.3333333333333333333333333333333333333333); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() + { + return genType(0.666666666666666666666666666666666666667); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() + { + return genType(1.61803398874989484820458683436563811); + } + +} //namespace glm diff --git a/include/glm/glm/gtc/epsilon.hpp b/include/glm/glm/gtc/epsilon.hpp new file mode 100644 index 00000000..640439b1 --- /dev/null +++ b/include/glm/glm/gtc/epsilon.hpp @@ -0,0 +1,60 @@ +/// @ref gtc_epsilon +/// @file glm/gtc/epsilon.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_epsilon GLM_GTC_epsilon +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Comparison functions for a user defined epsilon values. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_epsilon extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_epsilon + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is not satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon); + + /// @} +}//namespace glm + +#include "epsilon.inl" diff --git a/include/glm/glm/gtc/epsilon.inl b/include/glm/glm/gtc/epsilon.inl new file mode 100644 index 00000000..508b9f89 --- /dev/null +++ b/include/glm/glm/gtc/epsilon.inl @@ -0,0 +1,80 @@ +/// @ref gtc_epsilon + +// Dependency: +#include "../vector_relational.hpp" +#include "../common.hpp" + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + float const& x, + float const& y, + float const& epsilon + ) + { + return abs(x - y) < epsilon; + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + double const& x, + double const& y, + double const& epsilon + ) + { + return abs(x - y) < epsilon; + } + + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, T const& epsilon) + { + return lessThan(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, vec const& epsilon) + { + return lessThan(abs(x - y), vec(epsilon)); + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon) + { + return abs(x - y) >= epsilon; + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon) + { + return abs(x - y) >= epsilon; + } + + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon) + { + return greaterThanEqual(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, vec const& epsilon) + { + return greaterThanEqual(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(qua const& x, qua const& y, T const& epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(qua const& x, qua const& y, T const& epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); + } +}//namespace glm diff --git a/include/glm/glm/gtc/integer.hpp b/include/glm/glm/gtc/integer.hpp new file mode 100644 index 00000000..64ce10bb --- /dev/null +++ b/include/glm/glm/gtc/integer.hpp @@ -0,0 +1,65 @@ +/// @ref gtc_integer +/// @file glm/gtc/integer.hpp +/// +/// @see core (dependence) +/// @see gtc_integer (dependence) +/// +/// @defgroup gtc_integer GLM_GTC_integer +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../common.hpp" +#include "../integer.hpp" +#include "../exponential.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_integer + /// @{ + + /// Returns the log2 of x for integer values. Usefull to compute mipmap count from the texture size. + /// @see gtc_integer + template + GLM_FUNC_DECL genIUType log2(genIUType x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see gtc_integer + template + GLM_FUNC_DECL vec iround(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see gtc_integer + template + GLM_FUNC_DECL vec uround(vec const& x); + + /// @} +} //namespace glm + +#include "integer.inl" diff --git a/include/glm/glm/gtc/integer.inl b/include/glm/glm/gtc/integer.inl new file mode 100644 index 00000000..f0a8b4f2 --- /dev/null +++ b/include/glm/glm/gtc/integer.inl @@ -0,0 +1,68 @@ +/// @ref gtc_integer + +namespace glm{ +namespace detail +{ + template + struct compute_log2 + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + //Equivalent to return findMSB(vec); but save one function call in ASM with VC + //return findMSB(vec); + return vec(detail::compute_findMSB_vec::call(v)); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + struct compute_log2<4, int, Q, false, Aligned> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) + { + vec<4, int, Q> Result; + _BitScanReverse(reinterpret_cast(&Result.x), v.x); + _BitScanReverse(reinterpret_cast(&Result.y), v.y); + _BitScanReverse(reinterpret_cast(&Result.z), v.z); + _BitScanReverse(reinterpret_cast(&Result.w), v.w); + return Result; + } + }; +# endif//GLM_HAS_BITSCAN_WINDOWS +}//namespace detail + template + GLM_FUNC_QUALIFIER int iround(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER vec iround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER uint uround(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER vec uround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } +}//namespace glm diff --git a/include/glm/glm/gtc/matrix_access.hpp b/include/glm/glm/gtc/matrix_access.hpp new file mode 100644 index 00000000..4935ba75 --- /dev/null +++ b/include/glm/glm/gtc/matrix_access.hpp @@ -0,0 +1,60 @@ +/// @ref gtc_matrix_access +/// @file glm/gtc/matrix_access.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_access GLM_GTC_matrix_access +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines functions to access rows or columns of a matrix easily. + +#pragma once + +// Dependency: +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_access extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_access + /// @{ + + /// Get a specific row of a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL typename genType::row_type row( + genType const& m, + length_t index); + + /// Set a specific row to a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL genType row( + genType const& m, + length_t index, + typename genType::row_type const& x); + + /// Get a specific column of a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL typename genType::col_type column( + genType const& m, + length_t index); + + /// Set a specific column to a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL genType column( + genType const& m, + length_t index, + typename genType::col_type const& x); + + /// @} +}//namespace glm + +#include "matrix_access.inl" diff --git a/include/glm/glm/gtc/matrix_access.inl b/include/glm/glm/gtc/matrix_access.inl new file mode 100644 index 00000000..09fcc10d --- /dev/null +++ b/include/glm/glm/gtc/matrix_access.inl @@ -0,0 +1,62 @@ +/// @ref gtc_matrix_access + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType row + ( + genType const& m, + length_t index, + typename genType::row_type const& x + ) + { + assert(index >= 0 && index < m[0].length()); + + genType Result = m; + for(length_t i = 0; i < m.length(); ++i) + Result[i][index] = x[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER typename genType::row_type row + ( + genType const& m, + length_t index + ) + { + assert(index >= 0 && index < m[0].length()); + + typename genType::row_type Result(0); + for(length_t i = 0; i < m.length(); ++i) + Result[i] = m[i][index]; + return Result; + } + + template + GLM_FUNC_QUALIFIER genType column + ( + genType const& m, + length_t index, + typename genType::col_type const& x + ) + { + assert(index >= 0 && index < m.length()); + + genType Result = m; + Result[index] = x; + return Result; + } + + template + GLM_FUNC_QUALIFIER typename genType::col_type column + ( + genType const& m, + length_t index + ) + { + assert(index >= 0 && index < m.length()); + + return m[index]; + } +}//namespace glm diff --git a/include/glm/glm/gtc/matrix_integer.hpp b/include/glm/glm/gtc/matrix_integer.hpp new file mode 100644 index 00000000..d7ebdc71 --- /dev/null +++ b/include/glm/glm/gtc/matrix_integer.hpp @@ -0,0 +1,433 @@ +/// @ref gtc_matrix_integer +/// @file glm/gtc/matrix_integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_integer + /// @{ + + /// High-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, highp> highp_imat2; + + /// High-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, highp> highp_imat3; + + /// High-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, highp> highp_imat4; + + /// High-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, highp> highp_imat2x2; + + /// High-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, highp> highp_imat2x3; + + /// High-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, highp> highp_imat2x4; + + /// High-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, highp> highp_imat3x2; + + /// High-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, highp> highp_imat3x3; + + /// High-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, highp> highp_imat3x4; + + /// High-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, highp> highp_imat4x2; + + /// High-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, highp> highp_imat4x3; + + /// High-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, highp> highp_imat4x4; + + + /// Medium-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, mediump> mediump_imat2; + + /// Medium-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, mediump> mediump_imat3; + + /// Medium-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, mediump> mediump_imat4; + + + /// Medium-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, mediump> mediump_imat2x2; + + /// Medium-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, mediump> mediump_imat2x3; + + /// Medium-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, mediump> mediump_imat2x4; + + /// Medium-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, mediump> mediump_imat3x2; + + /// Medium-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, mediump> mediump_imat3x3; + + /// Medium-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, mediump> mediump_imat3x4; + + /// Medium-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, mediump> mediump_imat4x2; + + /// Medium-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, mediump> mediump_imat4x3; + + /// Medium-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, mediump> mediump_imat4x4; + + + /// Low-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, lowp> lowp_imat2; + + /// Low-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, lowp> lowp_imat3; + + /// Low-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, lowp> lowp_imat4; + + + /// Low-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, lowp> lowp_imat2x2; + + /// Low-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, lowp> lowp_imat2x3; + + /// Low-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, lowp> lowp_imat2x4; + + /// Low-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, lowp> lowp_imat3x2; + + /// Low-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, lowp> lowp_imat3x3; + + /// Low-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, lowp> lowp_imat3x4; + + /// Low-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, lowp> lowp_imat4x2; + + /// Low-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, lowp> lowp_imat4x3; + + /// Low-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, lowp> lowp_imat4x4; + + + /// High-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, highp> highp_umat2; + + /// High-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, highp> highp_umat3; + + /// High-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, highp> highp_umat4; + + /// High-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, highp> highp_umat2x2; + + /// High-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, highp> highp_umat2x3; + + /// High-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, highp> highp_umat2x4; + + /// High-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, highp> highp_umat3x2; + + /// High-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, highp> highp_umat3x3; + + /// High-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, highp> highp_umat3x4; + + /// High-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, highp> highp_umat4x2; + + /// High-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, highp> highp_umat4x3; + + /// High-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, highp> highp_umat4x4; + + + /// Medium-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, mediump> mediump_umat2; + + /// Medium-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, mediump> mediump_umat3; + + /// Medium-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, mediump> mediump_umat4; + + + /// Medium-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, mediump> mediump_umat2x2; + + /// Medium-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, mediump> mediump_umat2x3; + + /// Medium-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, mediump> mediump_umat2x4; + + /// Medium-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, mediump> mediump_umat3x2; + + /// Medium-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, mediump> mediump_umat3x3; + + /// Medium-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, mediump> mediump_umat3x4; + + /// Medium-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, mediump> mediump_umat4x2; + + /// Medium-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, mediump> mediump_umat4x3; + + /// Medium-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, mediump> mediump_umat4x4; + + + /// Low-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, lowp> lowp_umat2; + + /// Low-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, lowp> lowp_umat3; + + /// Low-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, lowp> lowp_umat4; + + + /// Low-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, lowp> lowp_umat2x2; + + /// Low-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, lowp> lowp_umat2x3; + + /// Low-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, lowp> lowp_umat2x4; + + /// Low-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, lowp> lowp_umat3x2; + + /// Low-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, lowp> lowp_umat3x3; + + /// Low-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, lowp> lowp_umat3x4; + + /// Low-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, lowp> lowp_umat4x2; + + /// Low-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, lowp> lowp_umat4x3; + + /// Low-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, lowp> lowp_umat4x4; + + + + /// Signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, defaultp> imat2; + + /// Signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, defaultp> imat3; + + /// Signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, defaultp> imat4; + + /// Signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, defaultp> imat2x2; + + /// Signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, defaultp> imat2x3; + + /// Signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, defaultp> imat2x4; + + /// Signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, defaultp> imat3x2; + + /// Signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, defaultp> imat3x3; + + /// Signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, defaultp> imat3x4; + + /// Signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, defaultp> imat4x2; + + /// Signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, defaultp> imat4x3; + + /// Signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, defaultp> imat4x4; + + + + /// Unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, defaultp> umat2; + + /// Unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, defaultp> umat3; + + /// Unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, defaultp> umat4; + + /// Unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, defaultp> umat2x2; + + /// Unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, defaultp> umat2x3; + + /// Unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, defaultp> umat2x4; + + /// Unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, defaultp> umat3x2; + + /// Unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, defaultp> umat3x3; + + /// Unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, defaultp> umat3x4; + + /// Unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, defaultp> umat4x2; + + /// Unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, defaultp> umat4x3; + + /// Unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, defaultp> umat4x4; + + /// @} +}//namespace glm diff --git a/include/glm/glm/gtc/matrix_inverse.hpp b/include/glm/glm/gtc/matrix_inverse.hpp new file mode 100644 index 00000000..a1900adc --- /dev/null +++ b/include/glm/glm/gtc/matrix_inverse.hpp @@ -0,0 +1,50 @@ +/// @ref gtc_matrix_inverse +/// @file glm/gtc/matrix_inverse.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines additional matrix inverting functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../matrix.hpp" +#include "../mat2x2.hpp" +#include "../mat3x3.hpp" +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_inverse extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_inverse + /// @{ + + /// Fast matrix inverse for affine matrix. + /// + /// @param m Input matrix to invert. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. + /// @see gtc_matrix_inverse + template + GLM_FUNC_DECL genType affineInverse(genType const& m); + + /// Compute the inverse transpose of a matrix. + /// + /// @param m Input matrix to invert transpose. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. + /// @see gtc_matrix_inverse + template + GLM_FUNC_DECL genType inverseTranspose(genType const& m); + + /// @} +}//namespace glm + +#include "matrix_inverse.inl" diff --git a/include/glm/glm/gtc/matrix_inverse.inl b/include/glm/glm/gtc/matrix_inverse.inl new file mode 100644 index 00000000..c004b9e1 --- /dev/null +++ b/include/glm/glm/gtc/matrix_inverse.inl @@ -0,0 +1,118 @@ +/// @ref gtc_matrix_inverse + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> affineInverse(mat<3, 3, T, Q> const& m) + { + mat<2, 2, T, Q> const Inv(inverse(mat<2, 2, T, Q>(m))); + + return mat<3, 3, T, Q>( + vec<3, T, Q>(Inv[0], static_cast(0)), + vec<3, T, Q>(Inv[1], static_cast(0)), + vec<3, T, Q>(-Inv * vec<2, T, Q>(m[2]), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> affineInverse(mat<4, 4, T, Q> const& m) + { + mat<3, 3, T, Q> const Inv(inverse(mat<3, 3, T, Q>(m))); + + return mat<4, 4, T, Q>( + vec<4, T, Q>(Inv[0], static_cast(0)), + vec<4, T, Q>(Inv[1], static_cast(0)), + vec<4, T, Q>(Inv[2], static_cast(0)), + vec<4, T, Q>(-Inv * vec<3, T, Q>(m[3]), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> inverseTranspose(mat<2, 2, T, Q> const& m) + { + T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; + + mat<2, 2, T, Q> Inverse( + + m[1][1] / Determinant, + - m[0][1] / Determinant, + - m[1][0] / Determinant, + + m[0][0] / Determinant); + + return Inverse; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> inverseTranspose(mat<3, 3, T, Q> const& m) + { + T Determinant = + + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) + - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); + + mat<3, 3, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); + Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); + Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); + Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); + Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); + Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); + Inverse /= Determinant; + + return Inverse; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> inverseTranspose(mat<4, 4, T, Q> const& m) + { + T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + T SubFactor11 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + T SubFactor12 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + T SubFactor13 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + T SubFactor14 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + T SubFactor15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + T SubFactor16 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + T SubFactor17 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + mat<4, 4, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); + Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); + Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); + Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); + + Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); + Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); + Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); + Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); + + Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); + Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); + Inverse[2][2] = + (m[0][0] * SubFactor07 - m[0][1] * SubFactor09 + m[0][3] * SubFactor11); + Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor11); + + Inverse[3][0] = - (m[0][1] * SubFactor12 - m[0][2] * SubFactor13 + m[0][3] * SubFactor14); + Inverse[3][1] = + (m[0][0] * SubFactor12 - m[0][2] * SubFactor15 + m[0][3] * SubFactor16); + Inverse[3][2] = - (m[0][0] * SubFactor13 - m[0][1] * SubFactor15 + m[0][3] * SubFactor17); + Inverse[3][3] = + (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][2] * SubFactor17); + + T Determinant = + + m[0][0] * Inverse[0][0] + + m[0][1] * Inverse[0][1] + + m[0][2] * Inverse[0][2] + + m[0][3] * Inverse[0][3]; + + Inverse /= Determinant; + + return Inverse; + } +}//namespace glm diff --git a/include/glm/glm/gtc/matrix_transform.hpp b/include/glm/glm/gtc/matrix_transform.hpp new file mode 100644 index 00000000..612418fa --- /dev/null +++ b/include/glm/glm/gtc/matrix_transform.hpp @@ -0,0 +1,36 @@ +/// @ref gtc_matrix_transform +/// @file glm/gtc/matrix_transform.hpp +/// +/// @see core (dependence) +/// @see gtx_transform +/// @see gtx_transform2 +/// +/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. + +#pragma once + +// Dependencies +#include "../mat4x4.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../ext/matrix_projection.hpp" +#include "../ext/matrix_clip_space.hpp" +#include "../ext/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_transform extension included") +#endif + +#include "matrix_transform.inl" diff --git a/include/glm/glm/gtc/matrix_transform.inl b/include/glm/glm/gtc/matrix_transform.inl new file mode 100644 index 00000000..15b46bc9 --- /dev/null +++ b/include/glm/glm/gtc/matrix_transform.inl @@ -0,0 +1,3 @@ +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" diff --git a/include/glm/glm/gtc/noise.hpp b/include/glm/glm/gtc/noise.hpp new file mode 100644 index 00000000..ab1772e7 --- /dev/null +++ b/include/glm/glm/gtc/noise.hpp @@ -0,0 +1,61 @@ +/// @ref gtc_noise +/// @file glm/gtc/noise.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_noise GLM_GTC_noise +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines 2D, 3D and 4D procedural noise functions +/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": +/// https://github.com/ashima/webgl-noise +/// Following Stefan Gustavson's paper "Simplex noise demystified": +/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_noise.hpp" +#include "../geometric.hpp" +#include "../common.hpp" +#include "../vector_relational.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_noise extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_noise + /// @{ + + /// Classic perlin noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T perlin( + vec const& p); + + /// Periodic perlin noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T perlin( + vec const& p, + vec const& rep); + + /// Simplex noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T simplex( + vec const& p); + + /// @} +}//namespace glm + +#include "noise.inl" diff --git a/include/glm/glm/gtc/noise.inl b/include/glm/glm/gtc/noise.inl new file mode 100644 index 00000000..30d0b274 --- /dev/null +++ b/include/glm/glm/gtc/noise.inl @@ -0,0 +1,807 @@ +/// @ref gtc_noise +/// +// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": +// https://github.com/ashima/webgl-noise +// Following Stefan Gustavson's paper "Simplex noise demystified": +// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf + +namespace glm{ +namespace gtc +{ + template + GLM_FUNC_QUALIFIER vec<4, T, Q> grad4(T const& j, vec<4, T, Q> const& ip) + { + vec<3, T, Q> pXYZ = floor(fract(vec<3, T, Q>(j) * vec<3, T, Q>(ip)) * T(7)) * ip[2] - T(1); + T pW = static_cast(1.5) - dot(abs(pXYZ), vec<3, T, Q>(1)); + vec<4, T, Q> s = vec<4, T, Q>(lessThan(vec<4, T, Q>(pXYZ, pW), vec<4, T, Q>(0.0))); + pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w; + return vec<4, T, Q>(pXYZ, pW); + } +}//namespace gtc + + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position) + { + vec<4, T, Q> Pi = glm::floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = glm::fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); + + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); + + vec<4, T, Q> gx = static_cast(2) * glm::fract(i / T(41)) - T(1); + vec<4, T, Q> gy = glm::abs(gx) - T(0.5); + vec<4, T, Q> tx = glm::floor(gx + T(0.5)); + gx = gx - tx; + + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); + + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + g00 *= norm.x; + g01 *= norm.y; + g10 *= norm.z; + g11 *= norm.w; + + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); + + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); + T n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return T(2.3) * n_xy; + } + + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position) + { + vec<3, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = detail::mod289(Pi0); + Pi1 = detail::mod289(Pi1); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(vec<2, T, Q>(Pi0.y), vec<2, T, Q>(Pi1.y)); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 * T(1.0 / 7.0); + vec<4, T, Q> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); + gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); + gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 * T(1.0 / 7.0); + vec<4, T, Q> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + /* + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& P) + { + vec<3, T, Q> Pi0 = floor(P); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = mod(Pi0, T(289)); + Pi1 = mod(Pi1, T(289)); + vec<3, T, Q> Pf0 = fract(P); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = permute(permute(ix) + iy); + vec<4, T, Q> ixy0 = permute(ixy + iz0); + vec<4, T, Q> ixy1 = permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); + gx0 -= sz0 * (step(0.0, gx0) - T(0.5)); + gy0 -= sz0 * (step(0.0, gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix( + vec<2, T, Q>(n_z.x, n_z.y), + vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + */ + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position) + { + vec<4, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<4, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = mod(Pi0, vec<4, T, Q>(289)); + Pi1 = mod(Pi1, vec<4, T, Q>(289)); + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); + + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); + gx00 = fract(gx00) - T(0.5); + gy00 = fract(gy00) - T(0.5); + gz00 = fract(gz00) - T(0.5); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0.0)); + gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); + gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); + + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); + gx01 = fract(gx01) - T(0.5); + gy01 = fract(gy01) - T(0.5); + gz01 = fract(gz01) - T(0.5); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); + gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); + gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); + + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); + gx10 = fract(gx10) - T(0.5); + gy10 = fract(gy10) - T(0.5); + gz10 = fract(gz10) - T(0.5); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0)); + gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); + gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); + + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); + gx11 = fract(gx11) - T(0.5); + gy11 = fract(gy11) - T(0.5); + gz11 = fract(gz11) - T(0.5); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(0.0)); + gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); + gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); + + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + g0000 *= norm00.x; + g0100 *= norm00.y; + g1000 *= norm00.z; + g1100 *= norm00.w; + + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + g0001 *= norm01.x; + g0101 *= norm01.y; + g1001 *= norm01.z; + g1101 *= norm01.w; + + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + g0010 *= norm10.x; + g0110 *= norm10.y; + g1010 *= norm10.z; + g1110 *= norm10.w; + + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + g0011 *= norm11.x; + g0111 *= norm11.y; + g1011 *= norm11.z; + g1111 *= norm11.w; + + T n0000 = dot(g0000, Pf0); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1111 = dot(g1111, Pf1); + + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); + T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + return T(2.2) * n_xyzw; + } + + // Classic Perlin noise, periodic variant + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position, vec<2, T, Q> const& rep) + { + vec<4, T, Q> Pi = floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); + + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); + + vec<4, T, Q> gx = static_cast(2) * fract(i / T(41)) - T(1); + vec<4, T, Q> gy = abs(gx) - T(0.5); + vec<4, T, Q> tx = floor(gx + T(0.5)); + gx = gx - tx; + + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); + + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + g00 *= norm.x; + g01 *= norm.y; + g10 *= norm.z; + g11 *= norm.w; + + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); + + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); + T n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return T(2.3) * n_xy; + } + + // Classic Perlin noise, periodic variant + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position, vec<3, T, Q> const& rep) + { + vec<3, T, Q> Pi0 = mod(floor(Position), rep); // Integer part, modulo period + vec<3, T, Q> Pi1 = mod(Pi0 + vec<3, T, Q>(T(1)), rep); // Integer part + 1, mod period + Pi0 = mod(Pi0, vec<3, T, Q>(289)); + Pi1 = mod(Pi1, vec<3, T, Q>(289)); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - vec<3, T, Q>(T(1)); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0)); + gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); + gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(T(0))); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000 = vec<3, T, Q>(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100 = vec<3, T, Q>(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010 = vec<3, T, Q>(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110 = vec<3, T, Q>(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001 = vec<3, T, Q>(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101 = vec<3, T, Q>(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011 = vec<3, T, Q>(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111 = vec<3, T, Q>(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + + // Classic Perlin noise, periodic version + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position, vec<4, T, Q> const& rep) + { + vec<4, T, Q> Pi0 = mod(floor(Position), rep); // Integer part modulo rep + vec<4, T, Q> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); + + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); + gx00 = fract(gx00) - T(0.5); + gy00 = fract(gy00) - T(0.5); + gz00 = fract(gz00) - T(0.5); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0)); + gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); + gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); + + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); + gx01 = fract(gx01) - T(0.5); + gy01 = fract(gy01) - T(0.5); + gz01 = fract(gz01) - T(0.5); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); + gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); + gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); + + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); + gx10 = fract(gx10) - T(0.5); + gy10 = fract(gy10) - T(0.5); + gz10 = fract(gz10) - T(0.5); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0.0)); + gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); + gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); + + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); + gx11 = fract(gx11) - T(0.5); + gy11 = fract(gy11) - T(0.5); + gz11 = fract(gz11) - T(0.5); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(T(0))); + gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); + gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); + + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + g0000 *= norm00.x; + g0100 *= norm00.y; + g1000 *= norm00.z; + g1100 *= norm00.w; + + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + g0001 *= norm01.x; + g0101 *= norm01.y; + g1001 *= norm01.z; + g1101 *= norm01.w; + + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + g0010 *= norm10.x; + g0110 *= norm10.y; + g1010 *= norm10.z; + g1110 *= norm10.w; + + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + g0011 *= norm11.x; + g0111 *= norm11.y; + g1011 *= norm11.z; + g1111 *= norm11.w; + + T n0000 = dot(g0000, Pf0); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1111 = dot(g1111, Pf1); + + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); + T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + return T(2.2) * n_xyzw; + } + + template + GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, Q> const& v) + { + vec<4, T, Q> const C = vec<4, T, Q>( + T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 + T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) + T(-0.577350269189626), // -1.0 + 2.0 * C.x + T( 0.024390243902439)); // 1.0 / 41.0 + + // First corner + vec<2, T, Q> i = floor(v + dot(v, vec<2, T, Q>(C[1]))); + vec<2, T, Q> x0 = v - i + dot(i, vec<2, T, Q>(C[0])); + + // Other corners + //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 + //i1.y = 1.0 - i1.x; + vec<2, T, Q> i1 = (x0.x > x0.y) ? vec<2, T, Q>(1, 0) : vec<2, T, Q>(0, 1); + // x0 = x0 - 0.0 + 0.0 * C.xx ; + // x1 = x0 - i1 + 1.0 * C.xx ; + // x2 = x0 - 1.0 + 2.0 * C.xx ; + vec<4, T, Q> x12 = vec<4, T, Q>(x0.x, x0.y, x0.x, x0.y) + vec<4, T, Q>(C.x, C.x, C.z, C.z); + x12 = vec<4, T, Q>(vec<2, T, Q>(x12) - i1, x12.z, x12.w); + + // Permutations + i = mod(i, vec<2, T, Q>(289)); // Avoid truncation effects in permutation + vec<3, T, Q> p = detail::permute( + detail::permute(i.y + vec<3, T, Q>(T(0), i1.y, T(1))) + + i.x + vec<3, T, Q>(T(0), i1.x, T(1))); + + vec<3, T, Q> m = max(vec<3, T, Q>(0.5) - vec<3, T, Q>( + dot(x0, x0), + dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)), + dot(vec<2, T, Q>(x12.z, x12.w), vec<2, T, Q>(x12.z, x12.w))), vec<3, T, Q>(0)); + m = m * m ; + m = m * m ; + + // Gradients: 41 points uniformly over a line, mapped onto a diamond. + // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) + + vec<3, T, Q> x = static_cast(2) * fract(p * C.w) - T(1); + vec<3, T, Q> h = abs(x) - T(0.5); + vec<3, T, Q> ox = floor(x + T(0.5)); + vec<3, T, Q> a0 = x - ox; + + // Normalise gradients implicitly by scaling m + // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); + m *= static_cast(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); + + // Compute final noise value at P + vec<3, T, Q> g; + g.x = a0.x * x0.x + h.x * x0.y; + //g.yz = a0.yz * x12.xz + h.yz * x12.yw; + g.y = a0.y * x12.x + h.y * x12.y; + g.z = a0.z * x12.z + h.z * x12.w; + return T(130) * dot(m, g); + } + + template + GLM_FUNC_QUALIFIER T simplex(vec<3, T, Q> const& v) + { + vec<2, T, Q> const C(1.0 / 6.0, 1.0 / 3.0); + vec<4, T, Q> const D(0.0, 0.5, 1.0, 2.0); + + // First corner + vec<3, T, Q> i(floor(v + dot(v, vec<3, T, Q>(C.y)))); + vec<3, T, Q> x0(v - i + dot(i, vec<3, T, Q>(C.x))); + + // Other corners + vec<3, T, Q> g(step(vec<3, T, Q>(x0.y, x0.z, x0.x), x0)); + vec<3, T, Q> l(T(1) - g); + vec<3, T, Q> i1(min(g, vec<3, T, Q>(l.z, l.x, l.y))); + vec<3, T, Q> i2(max(g, vec<3, T, Q>(l.z, l.x, l.y))); + + // x0 = x0 - 0.0 + 0.0 * C.xxx; + // x1 = x0 - i1 + 1.0 * C.xxx; + // x2 = x0 - i2 + 2.0 * C.xxx; + // x3 = x0 - 1.0 + 3.0 * C.xxx; + vec<3, T, Q> x1(x0 - i1 + C.x); + vec<3, T, Q> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y + vec<3, T, Q> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y + + // Permutations + i = detail::mod289(i); + vec<4, T, Q> p(detail::permute(detail::permute(detail::permute( + i.z + vec<4, T, Q>(T(0), i1.z, i2.z, T(1))) + + i.y + vec<4, T, Q>(T(0), i1.y, i2.y, T(1))) + + i.x + vec<4, T, Q>(T(0), i1.x, i2.x, T(1)))); + + // Gradients: 7x7 points over a square, mapped onto an octahedron. + // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) + T n_ = static_cast(0.142857142857); // 1.0/7.0 + vec<3, T, Q> ns(n_ * vec<3, T, Q>(D.w, D.y, D.z) - vec<3, T, Q>(D.x, D.z, D.x)); + + vec<4, T, Q> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) + + vec<4, T, Q> x_(floor(j * ns.z)); + vec<4, T, Q> y_(floor(j - T(7) * x_)); // mod(j,N) + + vec<4, T, Q> x(x_ * ns.x + ns.y); + vec<4, T, Q> y(y_ * ns.x + ns.y); + vec<4, T, Q> h(T(1) - abs(x) - abs(y)); + + vec<4, T, Q> b0(x.x, x.y, y.x, y.y); + vec<4, T, Q> b1(x.z, x.w, y.z, y.w); + + // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; + // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; + vec<4, T, Q> s0(floor(b0) * T(2) + T(1)); + vec<4, T, Q> s1(floor(b1) * T(2) + T(1)); + vec<4, T, Q> sh(-step(h, vec<4, T, Q>(0.0))); + + vec<4, T, Q> a0 = vec<4, T, Q>(b0.x, b0.z, b0.y, b0.w) + vec<4, T, Q>(s0.x, s0.z, s0.y, s0.w) * vec<4, T, Q>(sh.x, sh.x, sh.y, sh.y); + vec<4, T, Q> a1 = vec<4, T, Q>(b1.x, b1.z, b1.y, b1.w) + vec<4, T, Q>(s1.x, s1.z, s1.y, s1.w) * vec<4, T, Q>(sh.z, sh.z, sh.w, sh.w); + + vec<3, T, Q> p0(a0.x, a0.y, h.x); + vec<3, T, Q> p1(a0.z, a0.w, h.y); + vec<3, T, Q> p2(a1.x, a1.y, h.z); + vec<3, T, Q> p3(a1.z, a1.w, h.w); + + // Normalise gradients + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + + // Mix final noise value + vec<4, T, Q> m = max(T(0.6) - vec<4, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), vec<4, T, Q>(0)); + m = m * m; + return T(42) * dot(m * m, vec<4, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); + } + + template + GLM_FUNC_QUALIFIER T simplex(vec<4, T, Q> const& v) + { + vec<4, T, Q> const C( + 0.138196601125011, // (5 - sqrt(5))/20 G4 + 0.276393202250021, // 2 * G4 + 0.414589803375032, // 3 * G4 + -0.447213595499958); // -1 + 4 * G4 + + // (sqrt(5) - 1)/4 = F4, used once below + T const F4 = static_cast(0.309016994374947451); + + // First corner + vec<4, T, Q> i = floor(v + dot(v, vec<4, T, Q>(F4))); + vec<4, T, Q> x0 = v - i + dot(i, vec<4, T, Q>(C.x)); + + // Other corners + + // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) + vec<4, T, Q> i0; + vec<3, T, Q> isX = step(vec<3, T, Q>(x0.y, x0.z, x0.w), vec<3, T, Q>(x0.x)); + vec<3, T, Q> isYZ = step(vec<3, T, Q>(x0.z, x0.w, x0.w), vec<3, T, Q>(x0.y, x0.y, x0.z)); + // i0.x = dot(isX, vec3(1.0)); + //i0.x = isX.x + isX.y + isX.z; + //i0.yzw = static_cast(1) - isX; + i0 = vec<4, T, Q>(isX.x + isX.y + isX.z, T(1) - isX); + // i0.y += dot(isYZ.xy, vec2(1.0)); + i0.y += isYZ.x + isYZ.y; + //i0.zw += 1.0 - vec<2, T, Q>(isYZ.x, isYZ.y); + i0.z += static_cast(1) - isYZ.x; + i0.w += static_cast(1) - isYZ.y; + i0.z += isYZ.z; + i0.w += static_cast(1) - isYZ.z; + + // i0 now contains the unique values 0,1,2,3 in each channel + vec<4, T, Q> i3 = clamp(i0, T(0), T(1)); + vec<4, T, Q> i2 = clamp(i0 - T(1), T(0), T(1)); + vec<4, T, Q> i1 = clamp(i0 - T(2), T(0), T(1)); + + // x0 = x0 - 0.0 + 0.0 * C.xxxx + // x1 = x0 - i1 + 0.0 * C.xxxx + // x2 = x0 - i2 + 0.0 * C.xxxx + // x3 = x0 - i3 + 0.0 * C.xxxx + // x4 = x0 - 1.0 + 4.0 * C.xxxx + vec<4, T, Q> x1 = x0 - i1 + C.x; + vec<4, T, Q> x2 = x0 - i2 + C.y; + vec<4, T, Q> x3 = x0 - i3 + C.z; + vec<4, T, Q> x4 = x0 + C.w; + + // Permutations + i = mod(i, vec<4, T, Q>(289)); + T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); + vec<4, T, Q> j1 = detail::permute(detail::permute(detail::permute(detail::permute( + i.w + vec<4, T, Q>(i1.w, i2.w, i3.w, T(1))) + + i.z + vec<4, T, Q>(i1.z, i2.z, i3.z, T(1))) + + i.y + vec<4, T, Q>(i1.y, i2.y, i3.y, T(1))) + + i.x + vec<4, T, Q>(i1.x, i2.x, i3.x, T(1))); + + // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope + // 7*7*6 = 294, which is close to the ring size 17*17 = 289. + vec<4, T, Q> ip = vec<4, T, Q>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); + + vec<4, T, Q> p0 = gtc::grad4(j0, ip); + vec<4, T, Q> p1 = gtc::grad4(j1.x, ip); + vec<4, T, Q> p2 = gtc::grad4(j1.y, ip); + vec<4, T, Q> p3 = gtc::grad4(j1.z, ip); + vec<4, T, Q> p4 = gtc::grad4(j1.w, ip); + + // Normalise gradients + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + p4 *= detail::taylorInvSqrt(dot(p4, p4)); + + // Mix contributions from the five corners + vec<3, T, Q> m0 = max(T(0.6) - vec<3, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), vec<3, T, Q>(0)); + vec<2, T, Q> m1 = max(T(0.6) - vec<2, T, Q>(dot(x3, x3), dot(x4, x4) ), vec<2, T, Q>(0)); + m0 = m0 * m0; + m1 = m1 * m1; + return T(49) * + (dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + + dot(m1 * m1, vec<2, T, Q>(dot(p3, x3), dot(p4, x4)))); + } +}//namespace glm diff --git a/include/glm/glm/gtc/packing.hpp b/include/glm/glm/gtc/packing.hpp new file mode 100644 index 00000000..8e416b3f --- /dev/null +++ b/include/glm/glm/gtc/packing.hpp @@ -0,0 +1,728 @@ +/// @ref gtc_packing +/// @file glm/gtc/packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_packing GLM_GTC_packing +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert vertors to packed +/// formats. + +#pragma once + +// Dependency: +#include "type_precision.hpp" +#include "../ext/vector_packing.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_packing + /// @{ + + /// First, converts the normalized floating-point value v into a 8-bit integer value. + /// Then, the results are packed into the returned 8-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm1x8: round(clamp(c, 0, +1) * 255.0) + /// + /// @see gtc_packing + /// @see uint16 packUnorm2x8(vec2 const& v) + /// @see uint32 packUnorm4x8(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint8 packUnorm1x8(float v); + + /// Convert a single 8-bit integer to a normalized floating-point value. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x8(uint16 p) + /// @see vec4 unpackUnorm4x8(uint32 p) + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); + + /// First, converts each component of the normalized floating-point value v into 8-bit integer values. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm2x8: round(clamp(c, 0, +1) * 255.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint8 packUnorm1x8(float const& v) + /// @see uint32 packUnorm4x8(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v); + + /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackUnorm1x8(uint8 v) + /// @see vec4 unpackUnorm4x8(uint32 p) + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p); + + /// First, converts the normalized floating-point value v into 8-bit integer value. + /// Then, the results are packed into the returned 8-bit unsigned integer. + /// + /// The conversion to fixed point is done as follows: + /// packSnorm1x8: round(clamp(s, -1, +1) * 127.0) + /// + /// @see gtc_packing + /// @see uint16 packSnorm2x8(vec2 const& v) + /// @see uint32 packSnorm4x8(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint8 packSnorm1x8(float s); + + /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. + /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm1x8: clamp(f / 127.0, -1, +1) + /// + /// @see gtc_packing + /// @see vec2 unpackSnorm2x8(uint16 p) + /// @see vec4 unpackSnorm4x8(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); + + /// First, converts each component of the normalized floating-point value v into 8-bit integer values. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x8: round(clamp(c, -1, +1) * 127.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint8 packSnorm1x8(float const& v) + /// @see uint32 packSnorm4x8(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v); + + /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm2x8: clamp(f / 127.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackSnorm1x8(uint8 p) + /// @see vec4 unpackSnorm4x8(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); + + /// First, converts the normalized floating-point value v into a 16-bit integer value. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// @see gtc_packing + /// @see uint16 packSnorm1x16(float const& v) + /// @see uint64 packSnorm4x16(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packUnorm1x16(float v); + + /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. + /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm1x16: f / 65535.0 + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x16(uint32 p) + /// @see vec4 unpackUnorm4x16(uint64 p) + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); + + /// First, converts each component of the normalized floating-point value v into 16-bit integer values. + /// Then, the results are packed into the returned 64-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm4x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint16 packUnorm1x16(float const& v) + /// @see uint32 packUnorm2x16(vec2 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v); + + /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnormx4x16: f / 65535.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackUnorm1x16(uint16 p) + /// @see vec2 unpackUnorm2x16(uint32 p) + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); + + /// First, converts the normalized floating-point value v into 16-bit integer value. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion to fixed point is done as follows: + /// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0) + /// + /// @see gtc_packing + /// @see uint32 packSnorm2x16(vec2 const& v) + /// @see uint64 packSnorm4x16(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packSnorm1x16(float v); + + /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm1x16: clamp(f / 32767.0, -1, +1) + /// + /// @see gtc_packing + /// @see vec2 unpackSnorm2x16(uint32 p) + /// @see vec4 unpackSnorm4x16(uint64 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); + + /// First, converts each component of the normalized floating-point value v into 16-bit integer values. + /// Then, the results are packed into the returned 64-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x8: round(clamp(c, -1, +1) * 32767.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint16 packSnorm1x16(float const& v) + /// @see uint32 packSnorm2x16(vec2 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v); + + /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm4x16: clamp(f / 32767.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackSnorm1x16(uint16 p) + /// @see vec2 unpackSnorm2x16(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); + + /// Returns an unsigned integer obtained by converting the components of a floating-point scalar + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing this 16-bit value into a 16-bit unsigned integer. + /// + /// @see gtc_packing + /// @see uint32 packHalf2x16(vec2 const& v) + /// @see uint64 packHalf4x16(vec4 const& v) + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packHalf1x16(float v); + + /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, + /// interpreted as a 16-bit floating-point number according to the OpenGL Specification, + /// and converting it to 32-bit floating-point values. + /// + /// @see gtc_packing + /// @see vec2 unpackHalf2x16(uint32 const& v) + /// @see vec4 unpackHalf4x16(uint64 const& v) + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackHalf1x16(uint16 v); + + /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing these four 16-bit values into a 64-bit unsigned integer. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see uint16 packHalf1x16(float const& v) + /// @see uint32 packHalf2x16(vec2 const& v) + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v); + + /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, + /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, + /// and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see float unpackHalf1x16(uint16 const& v) + /// @see vec2 unpackHalf2x16(uint32 const& v) + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); + + /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector + /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, + /// and then packing these four values into a 32-bit unsigned integer. + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see uint32 packI3x10_1x2(uvec4 const& v) + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see ivec4 unpackI3x10_1x2(uint32 const& p) + GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v); + + /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); + /// @see uvec4 unpackI3x10_1x2(uint32 const& p); + GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); + + /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector + /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, + /// and then packing these four values into a 32-bit unsigned integer. + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see uint32 packI3x10_1x2(ivec4 const& v) + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see ivec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v); + + /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); + /// @see uvec4 unpackI3x10_1x2(uint32 const& p); + GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); + + /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. + /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0) + /// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0) + /// + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see uint32 packI3x10_1x2(ivec4 const& v) + GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1) + /// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)) + /// @see uvec4 unpackI3x10_1x2(uint32 const& p) + /// @see uvec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); + + /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. + /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0) + /// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0) + /// + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see uint32 packI3x10_1x2(ivec4 const& v) + GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1) + /// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see vec4 unpackInorm3x10_1x2(uint32 const& p)) + /// @see uvec4 unpackI3x10_1x2(uint32 const& p) + /// @see uvec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); + + /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. + /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The first vector component specifies the 11 least-significant bits of the result; + /// the last component specifies the 10 most-significant bits. + /// + /// @see gtc_packing + /// @see vec3 unpackF2x11_1x10(uint32 const& p) + GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . + /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packF2x11_1x10(vec3 const& v) + GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); + + + /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. + /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The first vector component specifies the 11 least-significant bits of the result; + /// the last component specifies the 10 most-significant bits. + /// + /// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format + /// + /// @see gtc_packing + /// @see vec3 unpackF3x9_E1x5(uint32 const& p) + GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . + /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data + /// + /// @see gtc_packing + /// @see uint32 packF3x9_E1x5(vec3 const& v) + GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p); + + /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb); + + /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm); + + /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see vec unpackHalf(vec const& p) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec packHalf(vec const& v); + + /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see vec packHalf(vec const& v) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec unpackHalf(vec const& p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec unpackUnorm(vec const& p); + template + GLM_FUNC_DECL vec packUnorm(vec const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see vec packUnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackUnorm(vec const& v); + + /// Convert each component of the normalized floating-point vector into signed integer values. + /// + /// @see gtc_packing + /// @see vec unpackSnorm(vec const& p); + template + GLM_FUNC_DECL vec packSnorm(vec const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see vec packSnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackSnorm(vec const& v); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x4(uint8 p) + GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint8 packUnorm2x4(vec2 const& v) + GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm4x4(uint16 p) + GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm4x4(vec4 const& v) + GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p) + GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v) + GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm3x5_1x1(uint16 p) + GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm3x5_1x1(vec4 const& v) + GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec3 unpackUnorm2x3_1x2(uint8 p) + GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint8 packUnorm2x3_1x2(vec3 const& v) + GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p); + + + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i8vec2 unpackInt2x8(int16 p) + GLM_FUNC_DECL int16 packInt2x8(i8vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int16 packInt2x8(i8vec2 const& v) + GLM_FUNC_DECL i8vec2 unpackInt2x8(int16 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u8vec2 unpackInt2x8(uint16 p) + GLM_FUNC_DECL uint16 packUint2x8(u8vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint16 packInt2x8(u8vec2 const& v) + GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i8vec4 unpackInt4x8(int32 p) + GLM_FUNC_DECL int32 packInt4x8(i8vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int32 packInt2x8(i8vec4 const& v) + GLM_FUNC_DECL i8vec4 unpackInt4x8(int32 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u8vec4 unpackUint4x8(uint32 p) + GLM_FUNC_DECL uint32 packUint4x8(u8vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint32 packUint4x8(u8vec2 const& v) + GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i16vec2 unpackInt2x16(int p) + GLM_FUNC_DECL int packInt2x16(i16vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packInt2x16(i16vec2 const& v) + GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i16vec4 unpackInt4x16(int64 p) + GLM_FUNC_DECL int64 packInt4x16(i16vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int64 packInt4x16(i16vec4 const& v) + GLM_FUNC_DECL i16vec4 unpackInt4x16(int64 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u16vec2 unpackUint2x16(uint p) + GLM_FUNC_DECL uint packUint2x16(u16vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint packUint2x16(u16vec2 const& v) + GLM_FUNC_DECL u16vec2 unpackUint2x16(uint p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u16vec4 unpackUint4x16(uint64 p) + GLM_FUNC_DECL uint64 packUint4x16(u16vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint64 packUint4x16(u16vec4 const& v) + GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i32vec2 unpackInt2x32(int p) + GLM_FUNC_DECL int64 packInt2x32(i32vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packInt2x16(i32vec2 const& v) + GLM_FUNC_DECL i32vec2 unpackInt2x32(int64 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u32vec2 unpackUint2x32(int p) + GLM_FUNC_DECL uint64 packUint2x32(u32vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packUint2x16(u32vec2 const& v) + GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p); + + /// @} +}// namespace glm + +#include "packing.inl" diff --git a/include/glm/glm/gtc/packing.inl b/include/glm/glm/gtc/packing.inl new file mode 100644 index 00000000..8c906e16 --- /dev/null +++ b/include/glm/glm/gtc/packing.inl @@ -0,0 +1,938 @@ +/// @ref gtc_packing + +#include "../ext/scalar_relational.hpp" +#include "../ext/vector_relational.hpp" +#include "../common.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../detail/type_half.hpp" +#include +#include + +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((f >> 16) & 0x8000) | // sign + ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential + ((f >> 13) & 0x03ff); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x000007c0 => 00000000 00000000 00000111 11000000 + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((f & 0x7f800000) - 0x38000000) >> 17) & 0x07c0) | // exponential + ((f >> 17) & 0x003f); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x000007c0 => 00000000 00000000 00000111 11000000 + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((p & 0x07c0) << 17) + 0x38000000) & 0x7f800000) | // exponential + ((p & 0x003f) << 17); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x0000001F => 00000000 00000000 00000000 00011111 + // 0x0000003F => 00000000 00000000 00000000 00111111 + // 0x000003E0 => 00000000 00000000 00000011 11100000 + // 0x000007C0 => 00000000 00000000 00000111 11000000 + // 0x00007C00 => 00000000 00000000 01111100 00000000 + // 0x000003FF => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((f & 0x7f800000) - 0x38000000) >> 18) & 0x03E0) | // exponential + ((f >> 18) & 0x001f); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x0000001F => 00000000 00000000 00000000 00011111 + // 0x0000003F => 00000000 00000000 00000000 00111111 + // 0x000003E0 => 00000000 00000000 00000011 11100000 + // 0x000007C0 => 00000000 00000000 00000111 11000000 + // 0x00007C00 => 00000000 00000000 01111100 00000000 + // 0x000003FF => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((p & 0x03E0) << 18) + 0x38000000) & 0x7f800000) | // exponential + ((p & 0x001f) << 18); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) + { + return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); + } + + GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) + { + if(x == 0.0f) + return 0u; + else if(glm::isnan(x)) + return ~0u; + else if(glm::isinf(x)) + return 0x1Fu << 6u; + + uint Pack = 0u; + memcpy(&Pack, &x, sizeof(Pack)); + return float2packed11(Pack); + } + + GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) + { + if(x == 0) + return 0.0f; + else if(x == ((1 << 11) - 1)) + return ~0;//NaN + else if(x == (0x1f << 6)) + return ~0;//Inf + + uint Result = packed11ToFloat(x); + + float Temp = 0; + memcpy(&Temp, &Result, sizeof(Temp)); + return Temp; + } + + GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) + { + if(x == 0.0f) + return 0u; + else if(glm::isnan(x)) + return ~0u; + else if(glm::isinf(x)) + return 0x1Fu << 5u; + + uint Pack = 0; + memcpy(&Pack, &x, sizeof(Pack)); + return float2packed10(Pack); + } + + GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) + { + if(x == 0) + return 0.0f; + else if(x == ((1 << 10) - 1)) + return ~0;//NaN + else if(x == (0x1f << 5)) + return ~0;//Inf + + uint Result = packed10ToFloat(x); + + float Temp = 0; + memcpy(&Temp, &Result, sizeof(Temp)); + return Temp; + } + +// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) +// { +// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); +// } + + union u3u3u2 + { + struct + { + uint x : 3; + uint y : 3; + uint z : 2; + } data; + uint8 pack; + }; + + union u4u4 + { + struct + { + uint x : 4; + uint y : 4; + } data; + uint8 pack; + }; + + union u4u4u4u4 + { + struct + { + uint x : 4; + uint y : 4; + uint z : 4; + uint w : 4; + } data; + uint16 pack; + }; + + union u5u6u5 + { + struct + { + uint x : 5; + uint y : 6; + uint z : 5; + } data; + uint16 pack; + }; + + union u5u5u5u1 + { + struct + { + uint x : 5; + uint y : 5; + uint z : 5; + uint w : 1; + } data; + uint16 pack; + }; + + union u10u10u10u2 + { + struct + { + uint x : 10; + uint y : 10; + uint z : 10; + uint w : 2; + } data; + uint32 pack; + }; + + union i10i10i10i2 + { + struct + { + int x : 10; + int y : 10; + int z : 10; + int w : 2; + } data; + uint32 pack; + }; + + union u9u9u9e5 + { + struct + { + uint x : 9; + uint y : 9; + uint z : 9; + uint w : 5; + } data; + uint32 pack; + }; + + template + struct compute_half + {}; + + template + struct compute_half<1, Q> + { + GLM_FUNC_QUALIFIER static vec<1, uint16, Q> pack(vec<1, float, Q> const& v) + { + int16 const Unpack(detail::toFloat16(v.x)); + u16vec1 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v) + { + i16vec1 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<1, float, Q>(detail::toFloat32(v.x)); + } + }; + + template + struct compute_half<2, Q> + { + GLM_FUNC_QUALIFIER static vec<2, uint16, Q> pack(vec<2, float, Q> const& v) + { + vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); + u16vec2 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v) + { + i16vec2 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y)); + } + }; + + template + struct compute_half<3, Q> + { + GLM_FUNC_QUALIFIER static vec<3, uint16, Q> pack(vec<3, float, Q> const& v) + { + vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); + u16vec3 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v) + { + i16vec3 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); + } + }; + + template + struct compute_half<4, Q> + { + GLM_FUNC_QUALIFIER static vec<4, uint16, Q> pack(vec<4, float, Q> const& v) + { + vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); + u16vec4 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v) + { + i16vec4 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); + } + }; +}//namespace detail + + GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) + { + return static_cast(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + } + + GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) + { + float const Unpack(p); + return Unpack * static_cast(0.0039215686274509803921568627451); // 1 / 255 + } + + GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v) + { + u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + + uint16 Unpack = 0; + memcpy(&Unpack, &Topack, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) + { + u8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return vec2(Unpack) * float(0.0039215686274509803921568627451); // 1 / 255 + } + + GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) + { + int8 const Topack(static_cast(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); + uint8 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) + { + int8 Unpack = 0; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + static_cast(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v) + { + i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) + { + i8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + vec2(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) + { + return static_cast(round(clamp(s, 0.0f, 1.0f) * 65535.0f)); + } + + GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) + { + float const Unpack(p); + return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 + } + + GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const& v) + { + u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); + uint64 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) + { + u16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return vec4(Unpack) * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 + } + + GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) + { + int16 const Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) + { + int16 Unpack = 0; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + static_cast(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const& v) + { + i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + uint64 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) + { + i16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + vec4(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) + { + int16 const Topack(detail::toFloat16(v)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) + { + int16 Unpack = 0; + memcpy(&Unpack, &v, sizeof(Unpack)); + return detail::toFloat32(Unpack); + } + + GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const& v) + { + i16vec4 const Unpack( + detail::toFloat16(v.x), + detail::toFloat16(v.y), + detail::toFloat16(v.z), + detail::toFloat16(v.w)); + uint64 Packed = 0; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) + { + i16vec4 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec4( + detail::toFloat32(Unpack.x), + detail::toFloat32(Unpack.y), + detail::toFloat32(Unpack.z), + detail::toFloat32(Unpack.w)); + } + + GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const& v) + { + detail::i10i10i10i2 Result; + Result.data.x = v.x; + Result.data.y = v.y; + Result.data.z = v.z; + Result.data.w = v.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) + { + detail::i10i10i10i2 Unpack; + Unpack.pack = v; + return ivec4( + Unpack.data.x, + Unpack.data.y, + Unpack.data.z, + Unpack.data.w); + } + + GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const& v) + { + detail::u10u10u10u2 Result; + Result.data.x = v.x; + Result.data.y = v.y; + Result.data.z = v.z; + Result.data.w = v.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) + { + detail::u10u10u10u2 Unpack; + Unpack.pack = v; + return uvec4( + Unpack.data.x, + Unpack.data.y, + Unpack.data.z, + Unpack.data.w); + } + + GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const& v) + { + ivec4 const Pack(round(clamp(v,-1.0f, 1.0f) * vec4(511.f, 511.f, 511.f, 1.f))); + + detail::i10i10i10i2 Result; + Result.data.x = Pack.x; + Result.data.y = Pack.y; + Result.data.z = Pack.z; + Result.data.w = Pack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) + { + detail::i10i10i10i2 Unpack; + Unpack.pack = v; + + vec4 const Result(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w); + + return clamp(Result * vec4(1.f / 511.f, 1.f / 511.f, 1.f / 511.f, 1.f), -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const& v) + { + uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f))); + + detail::u10u10u10u2 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) + { + vec4 const ScaleFactors(1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 3.f); + + detail::u10u10u10u2 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors; + } + + GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const& v) + { + return + ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | + ((detail::floatTo11bit(v.y) & ((1 << 11) - 1)) << 11) | + ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); + } + + GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) + { + return vec3( + detail::packed11bitToFloat(v >> 0), + detail::packed11bitToFloat(v >> 11), + detail::packed10bitToFloat(v >> 22)); + } + + GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const& v) + { + float const SharedExpMax = (pow(2.0f, 9.0f - 1.0f) / pow(2.0f, 9.0f)) * pow(2.0f, 31.f - 15.f); + vec3 const Color = clamp(v, 0.0f, SharedExpMax); + float const MaxColor = max(Color.x, max(Color.y, Color.z)); + + float const ExpSharedP = max(-15.f - 1.f, floor(log2(MaxColor))) + 1.0f + 15.f; + float const MaxShared = floor(MaxColor / pow(2.0f, (ExpSharedP - 15.f - 9.f)) + 0.5f); + float const ExpShared = equal(MaxShared, pow(2.0f, 9.0f), epsilon()) ? ExpSharedP + 1.0f : ExpSharedP; + + uvec3 const ColorComp(floor(Color / pow(2.f, (ExpShared - 15.f - 9.f)) + 0.5f)); + + detail::u9u9u9e5 Unpack; + Unpack.data.x = ColorComp.x; + Unpack.data.y = ColorComp.y; + Unpack.data.z = ColorComp.z; + Unpack.data.w = uint(ExpShared); + return Unpack.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackF3x9_E1x5(uint32 v) + { + detail::u9u9u9e5 Unpack; + Unpack.pack = v; + + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * pow(2.0f, Unpack.data.w - 15.f - 9.f); + } + + // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html + template + GLM_FUNC_QUALIFIER vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb) + { + vec<3, T, Q> const Color(rgb * static_cast(1.0 / 6.0)); + T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast(1e-6))), static_cast(0), static_cast(1)); + Alpha = ceil(Alpha * static_cast(255.0)) / static_cast(255.0); + return vec<4, T, Q>(Color / Alpha, Alpha); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm) + { + return vec<3, T, Q>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast(6); + } + + template + GLM_FUNC_QUALIFIER vec packHalf(vec const& v) + { + return detail::compute_half::pack(v); + } + + template + GLM_FUNC_QUALIFIER vec unpackHalf(vec const& v) + { + return detail::compute_half::unpack(v); + } + + template + GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); + } + + template + GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + } + + template + GLM_FUNC_QUALIFIER vec packSnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); + } + + template + GLM_FUNC_QUALIFIER vec unpackSnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); + } + + GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v) + { + u32vec2 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); + detail::u4u4 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x4(uint8 v) + { + float const ScaleFactor(1.f / 15.f); + detail::u4u4 Unpack; + Unpack.pack = v; + return vec2(Unpack.data.x, Unpack.data.y) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const& v) + { + u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); + detail::u4u4u4u4 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x4(uint16 v) + { + float const ScaleFactor(1.f / 15.f); + detail::u4u4u4u4 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const& v) + { + u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(31.f, 63.f, 31.f))); + detail::u5u6u5 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackUnorm1x5_1x6_1x5(uint16 v) + { + vec3 const ScaleFactor(1.f / 31.f, 1.f / 63.f, 1.f / 31.f); + detail::u5u6u5 Unpack; + Unpack.pack = v; + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const& v) + { + u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(31.f, 31.f, 31.f, 1.f))); + detail::u5u5u5u1 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm3x5_1x1(uint16 v) + { + vec4 const ScaleFactor(1.f / 31.f, 1.f / 31.f, 1.f / 31.f, 1.f); + detail::u5u5u5u1 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const& v) + { + u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(7.f, 7.f, 3.f))); + detail::u3u3u2 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackUnorm2x3_1x2(uint8 v) + { + vec3 const ScaleFactor(1.f / 7.f, 1.f / 7.f, 1.f / 3.f); + detail::u3u3u2 Unpack; + Unpack.pack = v; + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER int16 packInt2x8(i8vec2 const& v) + { + int16 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i8vec2 unpackInt2x8(int16 p) + { + i8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint16 packUint2x8(u8vec2 const& v) + { + uint16 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u8vec2 unpackUint2x8(uint16 p) + { + u8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int32 packInt4x8(i8vec4 const& v) + { + int32 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i8vec4 unpackInt4x8(int32 p) + { + i8vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint32 packUint4x8(u8vec4 const& v) + { + uint32 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u8vec4 unpackUint4x8(uint32 p) + { + u8vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int packInt2x16(i16vec2 const& v) + { + int Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i16vec2 unpackInt2x16(int p) + { + i16vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int64 packInt4x16(i16vec4 const& v) + { + int64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i16vec4 unpackInt4x16(int64 p) + { + i16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint packUint2x16(u16vec2 const& v) + { + uint Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u16vec2 unpackUint2x16(uint p) + { + u16vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint64 packUint4x16(u16vec4 const& v) + { + uint64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u16vec4 unpackUint4x16(uint64 p) + { + u16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int64 packInt2x32(i32vec2 const& v) + { + int64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i32vec2 unpackInt2x32(int64 p) + { + i32vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint64 packUint2x32(u32vec2 const& v) + { + uint64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u32vec2 unpackUint2x32(uint64 p) + { + u32vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } +}//namespace glm + diff --git a/include/glm/glm/gtc/quaternion.hpp b/include/glm/glm/gtc/quaternion.hpp new file mode 100644 index 00000000..359e072b --- /dev/null +++ b/include/glm/glm/gtc/quaternion.hpp @@ -0,0 +1,173 @@ +/// @ref gtc_quaternion +/// @file glm/gtc/quaternion.hpp +/// +/// @see core (dependence) +/// @see gtc_constants (dependence) +/// +/// @defgroup gtc_quaternion GLM_GTC_quaternion +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines a templated quaternion type and several quaternion operations. + +#pragma once + +// Dependency: +#include "../gtc/constants.hpp" +#include "../gtc/matrix_transform.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_common.hpp" +#include "../ext/quaternion_float.hpp" +#include "../ext/quaternion_float_precision.hpp" +#include "../ext/quaternion_double.hpp" +#include "../ext/quaternion_double_precision.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../ext/quaternion_trigonometric.hpp" +#include "../ext/quaternion_transform.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_quaternion extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_quaternion + /// @{ + + /// Returns euler angles, pitch as x, yaw as y, roll as z. + /// The result is expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua const& x); + + /// Returns roll value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T roll(qua const& x); + + /// Returns pitch value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T pitch(qua const& x); + + /// Returns yaw value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T yaw(qua const& x); + + /// Converts a quaternion to a 3 * 3 matrix. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua const& x); + + /// Converts a quaternion to a 4 * 4 matrix. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua const& x); + + /// Converts a pure rotation 3 * 3 matrix to a quaternion. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL qua quat_cast(mat<3, 3, T, Q> const& x); + + /// Converts a pure rotation 4 * 4 matrix to a quaternion. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL qua quat_cast(mat<4, 4, T, Q> const& x); + + /// Returns the component-wise comparison result of x < y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x <= y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x > y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x >= y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); + + /// Build a look at quaternion based on the default handedness. + /// + /// @param direction Desired forward direction. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAt( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + + /// Build a right-handed look at quaternion. + /// + /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAtRH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + + /// Build a left-handed look at quaternion. + /// + /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAtLH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + /// @} +} //namespace glm + +#include "quaternion.inl" diff --git a/include/glm/glm/gtc/quaternion.inl b/include/glm/glm/gtc/quaternion.inl new file mode 100644 index 00000000..06f9f020 --- /dev/null +++ b/include/glm/glm/gtc/quaternion.inl @@ -0,0 +1,202 @@ +#include "../trigonometric.hpp" +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "epsilon.hpp" +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(qua const& x) + { + return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); + } + + template + GLM_FUNC_QUALIFIER T roll(qua const& q) + { + return static_cast(atan(static_cast(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); + } + + template + GLM_FUNC_QUALIFIER T pitch(qua const& q) + { + //return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); + T const y = static_cast(2) * (q.y * q.z + q.w * q.x); + T const x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; + + if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis + return static_cast(static_cast(2) * atan(q.x, q.w)); + + return static_cast(atan(y, x)); + } + + template + GLM_FUNC_QUALIFIER T yaw(qua const& q) + { + return asin(clamp(static_cast(-2) * (q.x * q.z - q.w * q.y), static_cast(-1), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(qua const& q) + { + mat<3, 3, T, Q> Result(T(1)); + T qxx(q.x * q.x); + T qyy(q.y * q.y); + T qzz(q.z * q.z); + T qxz(q.x * q.z); + T qxy(q.x * q.y); + T qyz(q.y * q.z); + T qwx(q.w * q.x); + T qwy(q.w * q.y); + T qwz(q.w * q.z); + + Result[0][0] = T(1) - T(2) * (qyy + qzz); + Result[0][1] = T(2) * (qxy + qwz); + Result[0][2] = T(2) * (qxz - qwy); + + Result[1][0] = T(2) * (qxy - qwz); + Result[1][1] = T(1) - T(2) * (qxx + qzz); + Result[1][2] = T(2) * (qyz + qwx); + + Result[2][0] = T(2) * (qxz + qwy); + Result[2][1] = T(2) * (qyz - qwx); + Result[2][2] = T(1) - T(2) * (qxx + qyy); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(qua const& q) + { + return mat<4, 4, T, Q>(mat3_cast(q)); + } + + template + GLM_FUNC_QUALIFIER qua quat_cast(mat<3, 3, T, Q> const& m) + { + T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; + T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; + T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; + T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; + + int biggestIndex = 0; + T fourBiggestSquaredMinus1 = fourWSquaredMinus1; + if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourXSquaredMinus1; + biggestIndex = 1; + } + if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourYSquaredMinus1; + biggestIndex = 2; + } + if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourZSquaredMinus1; + biggestIndex = 3; + } + + T biggestVal = sqrt(fourBiggestSquaredMinus1 + static_cast(1)) * static_cast(0.5); + T mult = static_cast(0.25) / biggestVal; + + switch(biggestIndex) + { + case 0: + return qua(biggestVal, (m[1][2] - m[2][1]) * mult, (m[2][0] - m[0][2]) * mult, (m[0][1] - m[1][0]) * mult); + case 1: + return qua((m[1][2] - m[2][1]) * mult, biggestVal, (m[0][1] + m[1][0]) * mult, (m[2][0] + m[0][2]) * mult); + case 2: + return qua((m[2][0] - m[0][2]) * mult, (m[0][1] + m[1][0]) * mult, biggestVal, (m[1][2] + m[2][1]) * mult); + case 3: + return qua((m[0][1] - m[1][0]) * mult, (m[2][0] + m[0][2]) * mult, (m[1][2] + m[2][1]) * mult, biggestVal); + default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. + assert(false); + return qua(1, 0, 0, 0); + } + } + + template + GLM_FUNC_QUALIFIER qua quat_cast(mat<4, 4, T, Q> const& m4) + { + return quat_cast(mat<3, 3, T, Q>(m4)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] < y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] <= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] > y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] >= y[i]; + return Result; + } + + + template + GLM_FUNC_QUALIFIER qua quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return quatLookAtLH(direction, up); +# else + return quatLookAtRH(direction, up); +# endif + } + + template + GLM_FUNC_QUALIFIER qua quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { + mat<3, 3, T, Q> Result; + + Result[2] = -direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); + + return quat_cast(Result); + } + + template + GLM_FUNC_QUALIFIER qua quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { + mat<3, 3, T, Q> Result; + + Result[2] = direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); + + return quat_cast(Result); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "quaternion_simd.inl" +#endif + diff --git a/include/glm/glm/gtc/quaternion_simd.inl b/include/glm/glm/gtc/quaternion_simd.inl new file mode 100644 index 00000000..e69de29b diff --git a/include/glm/glm/gtc/random.hpp b/include/glm/glm/gtc/random.hpp new file mode 100644 index 00000000..9a859580 --- /dev/null +++ b/include/glm/glm/gtc/random.hpp @@ -0,0 +1,82 @@ +/// @ref gtc_random +/// @file glm/gtc/random.hpp +/// +/// @see core (dependence) +/// @see gtx_random (extended) +/// +/// @defgroup gtc_random GLM_GTC_random +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Generate random number from various distribution methods. + +#pragma once + +// Dependency: +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_random extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_random + /// @{ + + /// Generate random numbers in the interval [Min, Max], according a linear distribution + /// + /// @param Min Minimum value included in the sampling + /// @param Max Maximum value included in the sampling + /// @tparam genType Value type. Currently supported: float or double scalars. + /// @see gtc_random + template + GLM_FUNC_DECL genType linearRand(genType Min, genType Max); + + /// Generate random numbers in the interval [Min, Max], according a linear distribution + /// + /// @param Min Minimum value included in the sampling + /// @param Max Maximum value included in the sampling + /// @tparam T Value type. Currently supported: float or double. + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec linearRand(vec const& Min, vec const& Max); + + /// Generate random numbers in the interval [Min, Max], according a gaussian distribution + /// + /// @see gtc_random + template + GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation); + + /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius); + + /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius); + + /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius); + + /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius); + + /// @} +}//namespace glm + +#include "random.inl" diff --git a/include/glm/glm/gtc/random.inl b/include/glm/glm/gtc/random.inl new file mode 100644 index 00000000..70485098 --- /dev/null +++ b/include/glm/glm/gtc/random.inl @@ -0,0 +1,303 @@ +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "../trigonometric.hpp" +#include "../detail/type_vec1.hpp" +#include +#include +#include +#include + +namespace glm{ +namespace detail +{ + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call(); + }; + + template + struct compute_rand<1, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<1, uint8, P> call() + { + return vec<1, uint8, P>( + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand<2, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<2, uint8, P> call() + { + return vec<2, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand<3, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<3, uint8, P> call() + { + return vec<3, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand<4, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<4, uint8, P> call() + { + return vec<4, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(8)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(16)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(32)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max); + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) + { + return detail::compute_linearRand<1, genType, highp>::call( + vec<1, genType, highp>(Min), + vec<1, genType, highp>(Max)).x; + } + + template + GLM_FUNC_QUALIFIER vec linearRand(vec const& Min, vec const& Max) + { + return detail::compute_linearRand::call(Min, Max); + } + + template + GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) + { + genType w, x1, x2; + + do + { + x1 = linearRand(genType(-1), genType(1)); + x2 = linearRand(genType(-1), genType(1)); + + w = x1 * x1 + x2 * x2; + } while(w > genType(1)); + + return static_cast(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); + } + + template + GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) + { + return detail::functor2::call(gaussRand, Mean, Deviation); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius) + { + assert(Radius > static_cast(0)); + + vec<2, T, defaultp> Result(T(0)); + T LenRadius(T(0)); + + do + { + Result = linearRand( + vec<2, T, defaultp>(-Radius), + vec<2, T, defaultp>(Radius)); + LenRadius = length(Result); + } + while(LenRadius > Radius); + + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius) + { + assert(Radius > static_cast(0)); + + vec<3, T, defaultp> Result(T(0)); + T LenRadius(T(0)); + + do + { + Result = linearRand( + vec<3, T, defaultp>(-Radius), + vec<3, T, defaultp>(Radius)); + LenRadius = length(Result); + } + while(LenRadius > Radius); + + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius) + { + assert(Radius > static_cast(0)); + + T a = linearRand(T(0), static_cast(6.283185307179586476925286766559)); + return vec<2, T, defaultp>(glm::cos(a), glm::sin(a)) * Radius; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius) + { + assert(Radius > static_cast(0)); + + T theta = linearRand(T(0), T(6.283185307179586476925286766559f)); + T phi = std::acos(linearRand(T(-1.0f), T(1.0f))); + + T x = std::sin(phi) * std::cos(theta); + T y = std::sin(phi) * std::sin(theta); + T z = std::cos(phi); + + return vec<3, T, defaultp>(x, y, z) * Radius; + } +}//namespace glm diff --git a/include/glm/glm/gtc/reciprocal.hpp b/include/glm/glm/gtc/reciprocal.hpp new file mode 100644 index 00000000..c7d13303 --- /dev/null +++ b/include/glm/glm/gtc/reciprocal.hpp @@ -0,0 +1,135 @@ +/// @ref gtc_reciprocal +/// @file glm/gtc/reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_reciprocal GLM_GTC_reciprocal +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_reciprocal + /// @{ + + /// Secant function. + /// hypotenuse / adjacent or 1 / cos(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType sec(genType angle); + + /// Cosecant function. + /// hypotenuse / opposite or 1 / sin(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType csc(genType angle); + + /// Cotangent function. + /// adjacent / opposite or 1 / tan(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType cot(genType angle); + + /// Inverse secant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType asec(genType x); + + /// Inverse cosecant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType acsc(genType x); + + /// Inverse cotangent function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType acot(genType x); + + /// Secant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType sech(genType angle); + + /// Cosecant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType csch(genType angle); + + /// Cotangent hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType coth(genType angle); + + /// Inverse secant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType asech(genType x); + + /// Inverse cosecant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType acsch(genType x); + + /// Inverse cotangent hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see gtc_reciprocal + template + GLM_FUNC_DECL genType acoth(genType x); + + /// @} +}//namespace glm + +#include "reciprocal.inl" diff --git a/include/glm/glm/gtc/reciprocal.inl b/include/glm/glm/gtc/reciprocal.inl new file mode 100644 index 00000000..d88729e8 --- /dev/null +++ b/include/glm/glm/gtc/reciprocal.inl @@ -0,0 +1,191 @@ +/// @ref gtc_reciprocal + +#include "../trigonometric.hpp" +#include + +namespace glm +{ + // sec + template + GLM_FUNC_QUALIFIER genType sec(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point values"); + return genType(1) / glm::cos(angle); + } + + template + GLM_FUNC_QUALIFIER vec sec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point inputs"); + return detail::functor1::call(sec, x); + } + + // csc + template + GLM_FUNC_QUALIFIER genType csc(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point values"); + return genType(1) / glm::sin(angle); + } + + template + GLM_FUNC_QUALIFIER vec csc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point inputs"); + return detail::functor1::call(csc, x); + } + + // cot + template + GLM_FUNC_QUALIFIER genType cot(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return glm::tan(pi_over_2 - angle); + } + + template + GLM_FUNC_QUALIFIER vec cot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point inputs"); + return detail::functor1::call(cot, x); + } + + // asec + template + GLM_FUNC_QUALIFIER genType asec(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point values"); + return acos(genType(1) / x); + } + + template + GLM_FUNC_QUALIFIER vec asec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point inputs"); + return detail::functor1::call(asec, x); + } + + // acsc + template + GLM_FUNC_QUALIFIER genType acsc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point values"); + return asin(genType(1) / x); + } + + template + GLM_FUNC_QUALIFIER vec acsc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point inputs"); + return detail::functor1::call(acsc, x); + } + + // acot + template + GLM_FUNC_QUALIFIER genType acot(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - atan(x); + } + + template + GLM_FUNC_QUALIFIER vec acot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point inputs"); + return detail::functor1::call(acot, x); + } + + // sech + template + GLM_FUNC_QUALIFIER genType sech(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point values"); + return genType(1) / glm::cosh(angle); + } + + template + GLM_FUNC_QUALIFIER vec sech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point inputs"); + return detail::functor1::call(sech, x); + } + + // csch + template + GLM_FUNC_QUALIFIER genType csch(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point values"); + return genType(1) / glm::sinh(angle); + } + + template + GLM_FUNC_QUALIFIER vec csch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point inputs"); + return detail::functor1::call(csch, x); + } + + // coth + template + GLM_FUNC_QUALIFIER genType coth(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point values"); + return glm::cosh(angle) / glm::sinh(angle); + } + + template + GLM_FUNC_QUALIFIER vec coth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point inputs"); + return detail::functor1::call(coth, x); + } + + // asech + template + GLM_FUNC_QUALIFIER genType asech(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point values"); + return acosh(genType(1) / x); + } + + template + GLM_FUNC_QUALIFIER vec asech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point inputs"); + return detail::functor1::call(asech, x); + } + + // acsch + template + GLM_FUNC_QUALIFIER genType acsch(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point values"); + return asinh(genType(1) / x); + } + + template + GLM_FUNC_QUALIFIER vec acsch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point inputs"); + return detail::functor1::call(acsch, x); + } + + // acoth + template + GLM_FUNC_QUALIFIER genType acoth(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point values"); + return atanh(genType(1) / x); + } + + template + GLM_FUNC_QUALIFIER vec acoth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point inputs"); + return detail::functor1::call(acoth, x); + } +}//namespace glm diff --git a/include/glm/glm/gtc/round.hpp b/include/glm/glm/gtc/round.hpp new file mode 100644 index 00000000..56edbbca --- /dev/null +++ b/include/glm/glm/gtc/round.hpp @@ -0,0 +1,160 @@ +/// @ref gtc_round +/// @file glm/gtc/round.hpp +/// +/// @see core (dependence) +/// @see gtc_round (dependence) +/// +/// @defgroup gtc_round GLM_GTC_round +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Rounding value to specific boundings + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_round extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_round + /// @{ + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec ceilPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec floorPowerOfTwo(vec const& v); + + /// Return the power of two number which value is the closet to the input value. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v); + + /// Return the power of two number which value is the closet to the input value. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec roundPowerOfTwo(vec const& v); + + /// Higher multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec ceilMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec floorMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec roundMultiple(vec const& v, vec const& Multiple); + + /// @} +} //namespace glm + +#include "round.inl" diff --git a/include/glm/glm/gtc/round.inl b/include/glm/glm/gtc/round.inl new file mode 100644 index 00000000..48411e41 --- /dev/null +++ b/include/glm/glm/gtc/round.inl @@ -0,0 +1,155 @@ +/// @ref gtc_round + +#include "../integer.hpp" +#include "../ext/vector_integer.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_roundMultiple {}; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - std::fmod(Source, Multiple); + else + { + genType Tmp = Source + genType(1); + return Tmp - std::fmod(Tmp, Multiple) - Multiple; + } + } + }; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; +}//namespace detail + + ////////////////// + // ceilPowerOfTwo + + template + GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) + { + return detail::compute_ceilPowerOfTwo<1, genType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genType, defaultp>(value)).x; + } + + template + GLM_FUNC_QUALIFIER vec ceilPowerOfTwo(vec const& v) + { + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + } + + /////////////////// + // floorPowerOfTwo + + template + GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) + { + return isPowerOfTwo(value) ? value : static_cast(1) << findMSB(value); + } + + template + GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) + { + return detail::functor1::call(floorPowerOfTwo, v); + } + + /////////////////// + // roundPowerOfTwo + + template + GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) + { + if(isPowerOfTwo(value)) + return value; + + genIUType const prev = static_cast(1) << findMSB(value); + genIUType const next = prev << static_cast(1); + return (next - value) < (value - prev) ? next : prev; + } + + template + GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) + { + return detail::functor1::call(roundPowerOfTwo, v); + } + + ////////////////////// + // ceilMultiple + + template + GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) + { + return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(ceilMultiple, Source, Multiple); + } + + ////////////////////// + // floorMultiple + + template + GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) + { + return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(floorMultiple, Source, Multiple); + } + + ////////////////////// + // roundMultiple + + template + GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) + { + return detail::compute_roundMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(roundMultiple, Source, Multiple); + } +}//namespace glm diff --git a/include/glm/glm/gtc/type_aligned.hpp b/include/glm/glm/gtc/type_aligned.hpp new file mode 100644 index 00000000..5403abf6 --- /dev/null +++ b/include/glm/glm/gtc/type_aligned.hpp @@ -0,0 +1,1315 @@ +/// @ref gtc_type_aligned +/// @file glm/gtc/type_aligned.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_type_aligned GLM_GTC_type_aligned +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Aligned types allowing SIMD optimizations of vectors and matrices types + +#pragma once + +#if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types." +#endif + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_aligned extension included") +#endif + +#include "../mat4x4.hpp" +#include "../mat4x3.hpp" +#include "../mat4x2.hpp" +#include "../mat3x4.hpp" +#include "../mat3x3.hpp" +#include "../mat3x2.hpp" +#include "../mat2x4.hpp" +#include "../mat2x3.hpp" +#include "../mat2x2.hpp" +#include "../gtc/vec1.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" + +namespace glm +{ + /// @addtogroup gtc_type_aligned + /// @{ + + // -- *vec1 -- + + /// 1 component vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_highp> aligned_highp_vec1; + + /// 1 component vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_mediump> aligned_mediump_vec1; + + /// 1 component vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_lowp> aligned_lowp_vec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_highp> aligned_highp_dvec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_highp> aligned_highp_ivec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_highp> aligned_highp_uvec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_highp> aligned_highp_bvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, packed_highp> packed_highp_vec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, packed_mediump> packed_mediump_vec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, packed_lowp> packed_lowp_vec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, packed_highp> packed_highp_dvec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, packed_mediump> packed_mediump_dvec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, packed_lowp> packed_lowp_dvec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_highp> packed_highp_ivec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_mediump> packed_mediump_ivec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_lowp> packed_lowp_ivec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_highp> packed_highp_uvec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_mediump> packed_mediump_uvec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_lowp> packed_lowp_uvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_highp> packed_highp_bvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_mediump> packed_mediump_bvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_lowp> packed_lowp_bvec1; + + // -- *vec2 -- + + /// 2 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_highp> aligned_highp_vec2; + + /// 2 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_mediump> aligned_mediump_vec2; + + /// 2 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_lowp> aligned_lowp_vec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_highp> aligned_highp_dvec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_mediump> aligned_mediump_dvec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_lowp> aligned_lowp_dvec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_highp> aligned_highp_ivec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_highp> aligned_highp_uvec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_highp> aligned_highp_bvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_mediump> aligned_mediump_bvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_lowp> aligned_lowp_bvec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, float, packed_highp> packed_highp_vec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, float, packed_mediump> packed_mediump_vec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, float, packed_lowp> packed_lowp_vec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, double, packed_highp> packed_highp_dvec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, double, packed_mediump> packed_mediump_dvec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, double, packed_lowp> packed_lowp_dvec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_highp> packed_highp_ivec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_mediump> packed_mediump_ivec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_lowp> packed_lowp_ivec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_highp> packed_highp_uvec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_mediump> packed_mediump_uvec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_lowp> packed_lowp_uvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_highp> packed_highp_bvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_mediump> packed_mediump_bvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_lowp> packed_lowp_bvec2; + + // -- *vec3 -- + + /// 3 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_highp> aligned_highp_vec3; + + /// 3 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_mediump> aligned_mediump_vec3; + + /// 3 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_lowp> aligned_lowp_vec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_highp> aligned_highp_dvec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_highp> aligned_highp_ivec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_highp> aligned_highp_uvec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_highp> aligned_highp_bvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, float, packed_highp> packed_highp_vec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, float, packed_mediump> packed_mediump_vec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, float, packed_lowp> packed_lowp_vec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, double, packed_highp> packed_highp_dvec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, double, packed_mediump> packed_mediump_dvec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, double, packed_lowp> packed_lowp_dvec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_highp> packed_highp_ivec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_mediump> packed_mediump_ivec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_lowp> packed_lowp_ivec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_highp> packed_highp_uvec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_mediump> packed_mediump_uvec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_lowp> packed_lowp_uvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_highp> packed_highp_bvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_mediump> packed_mediump_bvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_lowp> packed_lowp_bvec3; + + // -- *vec4 -- + + /// 4 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_highp> aligned_highp_vec4; + + /// 4 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_mediump> aligned_mediump_vec4; + + /// 4 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_lowp> aligned_lowp_vec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_highp> aligned_highp_dvec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_highp> aligned_highp_ivec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_highp> aligned_highp_uvec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_highp> aligned_highp_bvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, float, packed_highp> packed_highp_vec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, float, packed_mediump> packed_mediump_vec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, float, packed_lowp> packed_lowp_vec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, double, packed_highp> packed_highp_dvec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, double, packed_mediump> packed_mediump_dvec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, double, packed_lowp> packed_lowp_dvec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_highp> packed_highp_ivec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_mediump> packed_mediump_ivec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_lowp> packed_lowp_ivec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_highp> packed_highp_uvec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_mediump> packed_mediump_uvec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_lowp> packed_lowp_uvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_highp> packed_highp_bvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_mediump> packed_mediump_bvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_lowp> packed_lowp_bvec4; + + // -- *mat2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2; + + // -- *mat3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3; + + // -- *mat4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4; + + // -- *mat2x2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2x2; + + // -- *mat2x3 -- + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_highp> aligned_highp_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_mediump> aligned_mediump_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_lowp> aligned_lowp_mat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_highp> aligned_highp_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_mediump> aligned_mediump_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_lowp> aligned_lowp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_highp> packed_highp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_mediump> packed_mediump_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_lowp> packed_lowp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_highp> packed_highp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_mediump> packed_mediump_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_lowp> packed_lowp_dmat2x3; + + // -- *mat2x4 -- + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_highp> aligned_highp_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_mediump> aligned_mediump_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_lowp> aligned_lowp_mat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_highp> aligned_highp_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_mediump> aligned_mediump_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_lowp> aligned_lowp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_highp> packed_highp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_mediump> packed_mediump_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_lowp> packed_lowp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_highp> packed_highp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_mediump> packed_mediump_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_lowp> packed_lowp_dmat2x4; + + // -- *mat3x2 -- + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_highp> aligned_highp_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_mediump> aligned_mediump_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_lowp> aligned_lowp_mat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_highp> aligned_highp_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_mediump> aligned_mediump_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_lowp> aligned_lowp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_highp> packed_highp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_mediump> packed_mediump_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_lowp> packed_lowp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_highp> packed_highp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_mediump> packed_mediump_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_lowp> packed_lowp_dmat3x2; + + // -- *mat3x3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3x3; + + // -- *mat3x4 -- + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_highp> aligned_highp_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_mediump> aligned_mediump_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_lowp> aligned_lowp_mat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_highp> aligned_highp_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_mediump> aligned_mediump_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_lowp> aligned_lowp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_highp> packed_highp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_mediump> packed_mediump_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_lowp> packed_lowp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_highp> packed_highp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_mediump> packed_mediump_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_lowp> packed_lowp_dmat3x4; + + // -- *mat4x2 -- + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_highp> aligned_highp_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_mediump> aligned_mediump_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_lowp> aligned_lowp_mat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_highp> aligned_highp_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_mediump> aligned_mediump_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_lowp> aligned_lowp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_highp> packed_highp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_mediump> packed_mediump_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_lowp> packed_lowp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_highp> packed_highp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_mediump> packed_mediump_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_lowp> packed_lowp_dmat4x2; + + // -- *mat4x3 -- + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_highp> aligned_highp_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_mediump> aligned_mediump_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_lowp> aligned_lowp_mat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_highp> aligned_highp_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_mediump> aligned_mediump_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_lowp> aligned_lowp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_highp> packed_highp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_mediump> packed_mediump_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_lowp> packed_lowp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_highp> packed_highp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_mediump> packed_mediump_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_lowp> packed_lowp_dmat4x3; + + // -- *mat4x4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4; + + // -- default -- + +#if(defined(GLM_PRECISION_LOWP_FLOAT)) + typedef aligned_lowp_vec1 aligned_vec1; + typedef aligned_lowp_vec2 aligned_vec2; + typedef aligned_lowp_vec3 aligned_vec3; + typedef aligned_lowp_vec4 aligned_vec4; + typedef packed_lowp_vec1 packed_vec1; + typedef packed_lowp_vec2 packed_vec2; + typedef packed_lowp_vec3 packed_vec3; + typedef packed_lowp_vec4 packed_vec4; + + typedef aligned_lowp_mat2 aligned_mat2; + typedef aligned_lowp_mat3 aligned_mat3; + typedef aligned_lowp_mat4 aligned_mat4; + typedef packed_lowp_mat2 packed_mat2; + typedef packed_lowp_mat3 packed_mat3; + typedef packed_lowp_mat4 packed_mat4; + + typedef aligned_lowp_mat2x2 aligned_mat2x2; + typedef aligned_lowp_mat2x3 aligned_mat2x3; + typedef aligned_lowp_mat2x4 aligned_mat2x4; + typedef aligned_lowp_mat3x2 aligned_mat3x2; + typedef aligned_lowp_mat3x3 aligned_mat3x3; + typedef aligned_lowp_mat3x4 aligned_mat3x4; + typedef aligned_lowp_mat4x2 aligned_mat4x2; + typedef aligned_lowp_mat4x3 aligned_mat4x3; + typedef aligned_lowp_mat4x4 aligned_mat4x4; + typedef packed_lowp_mat2x2 packed_mat2x2; + typedef packed_lowp_mat2x3 packed_mat2x3; + typedef packed_lowp_mat2x4 packed_mat2x4; + typedef packed_lowp_mat3x2 packed_mat3x2; + typedef packed_lowp_mat3x3 packed_mat3x3; + typedef packed_lowp_mat3x4 packed_mat3x4; + typedef packed_lowp_mat4x2 packed_mat4x2; + typedef packed_lowp_mat4x3 packed_mat4x3; + typedef packed_lowp_mat4x4 packed_mat4x4; +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + typedef aligned_mediump_vec1 aligned_vec1; + typedef aligned_mediump_vec2 aligned_vec2; + typedef aligned_mediump_vec3 aligned_vec3; + typedef aligned_mediump_vec4 aligned_vec4; + typedef packed_mediump_vec1 packed_vec1; + typedef packed_mediump_vec2 packed_vec2; + typedef packed_mediump_vec3 packed_vec3; + typedef packed_mediump_vec4 packed_vec4; + + typedef aligned_mediump_mat2 aligned_mat2; + typedef aligned_mediump_mat3 aligned_mat3; + typedef aligned_mediump_mat4 aligned_mat4; + typedef packed_mediump_mat2 packed_mat2; + typedef packed_mediump_mat3 packed_mat3; + typedef packed_mediump_mat4 packed_mat4; + + typedef aligned_mediump_mat2x2 aligned_mat2x2; + typedef aligned_mediump_mat2x3 aligned_mat2x3; + typedef aligned_mediump_mat2x4 aligned_mat2x4; + typedef aligned_mediump_mat3x2 aligned_mat3x2; + typedef aligned_mediump_mat3x3 aligned_mat3x3; + typedef aligned_mediump_mat3x4 aligned_mat3x4; + typedef aligned_mediump_mat4x2 aligned_mat4x2; + typedef aligned_mediump_mat4x3 aligned_mat4x3; + typedef aligned_mediump_mat4x4 aligned_mat4x4; + typedef packed_mediump_mat2x2 packed_mat2x2; + typedef packed_mediump_mat2x3 packed_mat2x3; + typedef packed_mediump_mat2x4 packed_mat2x4; + typedef packed_mediump_mat3x2 packed_mat3x2; + typedef packed_mediump_mat3x3 packed_mat3x3; + typedef packed_mediump_mat3x4 packed_mat3x4; + typedef packed_mediump_mat4x2 packed_mat4x2; + typedef packed_mediump_mat4x3 packed_mat4x3; + typedef packed_mediump_mat4x4 packed_mat4x4; +#else //defined(GLM_PRECISION_HIGHP_FLOAT) + /// 1 component vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec1 aligned_vec1; + + /// 2 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec2 aligned_vec2; + + /// 3 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec3 aligned_vec3; + + /// 4 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec4 aligned_vec4; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec1 packed_vec1; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec2 packed_vec2; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec3 packed_vec3; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec4 packed_vec4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2 aligned_mat2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3 aligned_mat3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4 aligned_mat4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2 packed_mat2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3 packed_mat3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4 packed_mat4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x2 aligned_mat2x2; + + /// 2 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x3 aligned_mat2x3; + + /// 2 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x4 aligned_mat2x4; + + /// 3 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x2 aligned_mat3x2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x3 aligned_mat3x3; + + /// 3 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x4 aligned_mat3x4; + + /// 4 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x2 aligned_mat4x2; + + /// 4 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x3 aligned_mat4x3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x4 aligned_mat4x4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x2 packed_mat2x2; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x3 packed_mat2x3; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x4 packed_mat2x4; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x2 packed_mat3x2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x3 packed_mat3x3; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x4 packed_mat3x4; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x2 packed_mat4x2; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x3 packed_mat4x3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x4 packed_mat4x4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef aligned_lowp_dvec1 aligned_dvec1; + typedef aligned_lowp_dvec2 aligned_dvec2; + typedef aligned_lowp_dvec3 aligned_dvec3; + typedef aligned_lowp_dvec4 aligned_dvec4; + typedef packed_lowp_dvec1 packed_dvec1; + typedef packed_lowp_dvec2 packed_dvec2; + typedef packed_lowp_dvec3 packed_dvec3; + typedef packed_lowp_dvec4 packed_dvec4; + + typedef aligned_lowp_dmat2 aligned_dmat2; + typedef aligned_lowp_dmat3 aligned_dmat3; + typedef aligned_lowp_dmat4 aligned_dmat4; + typedef packed_lowp_dmat2 packed_dmat2; + typedef packed_lowp_dmat3 packed_dmat3; + typedef packed_lowp_dmat4 packed_dmat4; + + typedef aligned_lowp_dmat2x2 aligned_dmat2x2; + typedef aligned_lowp_dmat2x3 aligned_dmat2x3; + typedef aligned_lowp_dmat2x4 aligned_dmat2x4; + typedef aligned_lowp_dmat3x2 aligned_dmat3x2; + typedef aligned_lowp_dmat3x3 aligned_dmat3x3; + typedef aligned_lowp_dmat3x4 aligned_dmat3x4; + typedef aligned_lowp_dmat4x2 aligned_dmat4x2; + typedef aligned_lowp_dmat4x3 aligned_dmat4x3; + typedef aligned_lowp_dmat4x4 aligned_dmat4x4; + typedef packed_lowp_dmat2x2 packed_dmat2x2; + typedef packed_lowp_dmat2x3 packed_dmat2x3; + typedef packed_lowp_dmat2x4 packed_dmat2x4; + typedef packed_lowp_dmat3x2 packed_dmat3x2; + typedef packed_lowp_dmat3x3 packed_dmat3x3; + typedef packed_lowp_dmat3x4 packed_dmat3x4; + typedef packed_lowp_dmat4x2 packed_dmat4x2; + typedef packed_lowp_dmat4x3 packed_dmat4x3; + typedef packed_lowp_dmat4x4 packed_dmat4x4; +#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) + typedef aligned_mediump_dvec1 aligned_dvec1; + typedef aligned_mediump_dvec2 aligned_dvec2; + typedef aligned_mediump_dvec3 aligned_dvec3; + typedef aligned_mediump_dvec4 aligned_dvec4; + typedef packed_mediump_dvec1 packed_dvec1; + typedef packed_mediump_dvec2 packed_dvec2; + typedef packed_mediump_dvec3 packed_dvec3; + typedef packed_mediump_dvec4 packed_dvec4; + + typedef aligned_mediump_dmat2 aligned_dmat2; + typedef aligned_mediump_dmat3 aligned_dmat3; + typedef aligned_mediump_dmat4 aligned_dmat4; + typedef packed_mediump_dmat2 packed_dmat2; + typedef packed_mediump_dmat3 packed_dmat3; + typedef packed_mediump_dmat4 packed_dmat4; + + typedef aligned_mediump_dmat2x2 aligned_dmat2x2; + typedef aligned_mediump_dmat2x3 aligned_dmat2x3; + typedef aligned_mediump_dmat2x4 aligned_dmat2x4; + typedef aligned_mediump_dmat3x2 aligned_dmat3x2; + typedef aligned_mediump_dmat3x3 aligned_dmat3x3; + typedef aligned_mediump_dmat3x4 aligned_dmat3x4; + typedef aligned_mediump_dmat4x2 aligned_dmat4x2; + typedef aligned_mediump_dmat4x3 aligned_dmat4x3; + typedef aligned_mediump_dmat4x4 aligned_dmat4x4; + typedef packed_mediump_dmat2x2 packed_dmat2x2; + typedef packed_mediump_dmat2x3 packed_dmat2x3; + typedef packed_mediump_dmat2x4 packed_dmat2x4; + typedef packed_mediump_dmat3x2 packed_dmat3x2; + typedef packed_mediump_dmat3x3 packed_dmat3x3; + typedef packed_mediump_dmat3x4 packed_dmat3x4; + typedef packed_mediump_dmat4x2 packed_dmat4x2; + typedef packed_mediump_dmat4x3 packed_dmat4x3; + typedef packed_mediump_dmat4x4 packed_dmat4x4; +#else //defined(GLM_PRECISION_HIGHP_DOUBLE) + /// 1 component vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec1 aligned_dvec1; + + /// 2 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec2 aligned_dvec2; + + /// 3 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec3 aligned_dvec3; + + /// 4 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec4 aligned_dvec4; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec1 packed_dvec1; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec2 packed_dvec2; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec3 packed_dvec3; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec4 packed_dvec4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2 aligned_dmat2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3 aligned_dmat3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4 aligned_dmat4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2 packed_dmat2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3 packed_dmat3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4 packed_dmat4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x2 aligned_dmat2x2; + + /// 2 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x3 aligned_dmat2x3; + + /// 2 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x4 aligned_dmat2x4; + + /// 3 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x2 aligned_dmat3x2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x3 aligned_dmat3x3; + + /// 3 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x4 aligned_dmat3x4; + + /// 4 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x2 aligned_dmat4x2; + + /// 4 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x3 aligned_dmat4x3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x4 aligned_dmat4x4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x2 packed_dmat2x2; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x3 packed_dmat2x3; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x4 packed_dmat2x4; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x2 packed_dmat3x2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x3 packed_dmat3x3; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x4 packed_dmat3x4; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x2 packed_dmat4x2; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x3 packed_dmat4x3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x4 packed_dmat4x4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_INT)) + typedef aligned_lowp_ivec1 aligned_ivec1; + typedef aligned_lowp_ivec2 aligned_ivec2; + typedef aligned_lowp_ivec3 aligned_ivec3; + typedef aligned_lowp_ivec4 aligned_ivec4; +#elif(defined(GLM_PRECISION_MEDIUMP_INT)) + typedef aligned_mediump_ivec1 aligned_ivec1; + typedef aligned_mediump_ivec2 aligned_ivec2; + typedef aligned_mediump_ivec3 aligned_ivec3; + typedef aligned_mediump_ivec4 aligned_ivec4; +#else //defined(GLM_PRECISION_HIGHP_INT) + /// 1 component vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec1 aligned_ivec1; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec2 aligned_ivec2; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec3 aligned_ivec3; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec4 aligned_ivec4; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec1 packed_ivec1; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec2 packed_ivec2; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec3 packed_ivec3; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec4 packed_ivec4; +#endif//GLM_PRECISION + + // -- Unsigned integer definition -- + +#if(defined(GLM_PRECISION_LOWP_UINT)) + typedef aligned_lowp_uvec1 aligned_uvec1; + typedef aligned_lowp_uvec2 aligned_uvec2; + typedef aligned_lowp_uvec3 aligned_uvec3; + typedef aligned_lowp_uvec4 aligned_uvec4; +#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) + typedef aligned_mediump_uvec1 aligned_uvec1; + typedef aligned_mediump_uvec2 aligned_uvec2; + typedef aligned_mediump_uvec3 aligned_uvec3; + typedef aligned_mediump_uvec4 aligned_uvec4; +#else //defined(GLM_PRECISION_HIGHP_UINT) + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec1 aligned_uvec1; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec2 aligned_uvec2; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec3 aligned_uvec3; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec4 aligned_uvec4; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec1 packed_uvec1; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec2 packed_uvec2; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec3 packed_uvec3; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec4 packed_uvec4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_BOOL)) + typedef aligned_lowp_bvec1 aligned_bvec1; + typedef aligned_lowp_bvec2 aligned_bvec2; + typedef aligned_lowp_bvec3 aligned_bvec3; + typedef aligned_lowp_bvec4 aligned_bvec4; +#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) + typedef aligned_mediump_bvec1 aligned_bvec1; + typedef aligned_mediump_bvec2 aligned_bvec2; + typedef aligned_mediump_bvec3 aligned_bvec3; + typedef aligned_mediump_bvec4 aligned_bvec4; +#else //defined(GLM_PRECISION_HIGHP_BOOL) + /// 1 component vector aligned in memory of bool values. + typedef aligned_highp_bvec1 aligned_bvec1; + + /// 2 components vector aligned in memory of bool values. + typedef aligned_highp_bvec2 aligned_bvec2; + + /// 3 components vector aligned in memory of bool values. + typedef aligned_highp_bvec3 aligned_bvec3; + + /// 4 components vector aligned in memory of bool values. + typedef aligned_highp_bvec4 aligned_bvec4; + + /// 1 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec1 packed_bvec1; + + /// 2 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec2 packed_bvec2; + + /// 3 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec3 packed_bvec3; + + /// 4 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec4 packed_bvec4; +#endif//GLM_PRECISION + + /// @} +}//namespace glm diff --git a/include/glm/glm/gtc/type_precision.hpp b/include/glm/glm/gtc/type_precision.hpp new file mode 100644 index 00000000..775e2f48 --- /dev/null +++ b/include/glm/glm/gtc/type_precision.hpp @@ -0,0 +1,2094 @@ +/// @ref gtc_type_precision +/// @file glm/gtc/type_precision.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_type_precision GLM_GTC_type_precision +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines specific C++-based qualifier types. + +#pragma once + +// Dependency: +#include "../gtc/quaternion.hpp" +#include "../gtc/vec1.hpp" +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_int2_sized.hpp" +#include "../ext/vector_int3_sized.hpp" +#include "../ext/vector_int4_sized.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/vector_uint1_sized.hpp" +#include "../ext/vector_uint2_sized.hpp" +#include "../ext/vector_uint3_sized.hpp" +#include "../ext/vector_uint4_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_vec2.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../detail/type_mat2x2.hpp" +#include "../detail/type_mat2x3.hpp" +#include "../detail/type_mat2x4.hpp" +#include "../detail/type_mat3x2.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat3x4.hpp" +#include "../detail/type_mat4x2.hpp" +#include "../detail/type_mat4x3.hpp" +#include "../detail/type_mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_precision extension included") +#endif + +namespace glm +{ + /////////////////////////// + // Signed int vector types + + /// @addtogroup gtc_type_precision + /// @{ + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_int8; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_int16; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_int32; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_int64; + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_int8_t; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_int16_t; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_int32_t; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_int64_t; + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_i8; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_i16; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_i32; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_i64; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_int8; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_int16; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_int32; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_int64; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_int8_t; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_int16_t; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_int32_t; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_int64_t; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_i8; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_i16; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_i32; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_i64; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_int8; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_int16; + + /// High qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_int32; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_int64; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_int8_t; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_int16_t; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_int32_t; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_int64_t; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_i8; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_i16; + + /// High qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_i32; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_i64; + + +#if GLM_HAS_EXTENDED_INTEGER_TYPE + using std::int8_t; + using std::int16_t; + using std::int32_t; + using std::int64_t; +#else + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 int8_t; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 int16_t; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 int32_t; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 int64_t; +#endif + + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 i8; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 i16; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 i32; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 i64; + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_uint8; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_uint16; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_uint32; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_uint64; + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_uint8_t; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_uint16_t; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_uint32_t; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_uint64_t; + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_u8; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_u16; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_u32; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_u64; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_uint8; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_uint16; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_uint32; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_uint64; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_uint8_t; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_uint16_t; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_uint32_t; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_uint64_t; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_u8; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_u16; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_u32; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_u64; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_uint8; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_uint16; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_uint32; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_uint64; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_uint8_t; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_uint16_t; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_uint32_t; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_uint64_t; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_u8; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_u16; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_u32; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_u64; + +#if GLM_HAS_EXTENDED_INTEGER_TYPE + using std::uint8_t; + using std::uint16_t; + using std::uint32_t; + using std::uint64_t; +#else + /// Default qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 uint8_t; + + /// Default qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 uint16_t; + + /// Default qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 uint32_t; + + /// Default qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 uint64_t; +#endif + + /// Default qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 u8; + + /// Default qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 u16; + + /// Default qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 u32; + + /// Default qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 u64; + + + + + + ////////////////////// + // Float vector types + + /// Single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float float32; + + /// Double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef double float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_float32; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_float64; + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_float32_t; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_float64_t; + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_f32; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_f64; + + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_float32; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_float64; + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_float32_t; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_float64_t; + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_f32; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_f64; + + +#if(defined(GLM_PRECISION_LOWP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_float32_t float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_float64_t float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_f32 f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_f64 f64; + +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 f64; + +#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float32_t float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float64_t float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float32_t f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float64_t f64; +#endif + + + /// Low single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, lowp> lowp_fvec1; + + /// Low single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, lowp> lowp_fvec2; + + /// Low single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, lowp> lowp_fvec3; + + /// Low single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, lowp> lowp_fvec4; + + + /// Medium single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, mediump> mediump_fvec1; + + /// Medium Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, mediump> mediump_fvec2; + + /// Medium Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, mediump> mediump_fvec3; + + /// Medium Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, mediump> mediump_fvec4; + + + /// High single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, highp> highp_fvec1; + + /// High Single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, float, highp> highp_fvec2; + + /// High Single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, float, highp> highp_fvec3; + + /// High Single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, float, highp> highp_fvec4; + + + /// Low single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, lowp> lowp_f32vec1; + + /// Low single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, lowp> lowp_f32vec2; + + /// Low single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, lowp> lowp_f32vec3; + + /// Low single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, lowp> lowp_f32vec4; + + /// Medium single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, mediump> mediump_f32vec1; + + /// Medium single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, mediump> mediump_f32vec2; + + /// Medium single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, mediump> mediump_f32vec3; + + /// Medium single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, mediump> mediump_f32vec4; + + /// High single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, highp> highp_f32vec1; + + /// High single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, highp> highp_f32vec2; + + /// High single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f32, highp> highp_f32vec3; + + /// High single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f32, highp> highp_f32vec4; + + + /// Low double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, lowp> lowp_f64vec1; + + /// Low double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, lowp> lowp_f64vec2; + + /// Low double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, lowp> lowp_f64vec3; + + /// Low double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, lowp> lowp_f64vec4; + + /// Medium double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, mediump> mediump_f64vec1; + + /// Medium double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, mediump> mediump_f64vec2; + + /// Medium double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, mediump> mediump_f64vec3; + + /// Medium double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, mediump> mediump_f64vec4; + + /// High double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, highp> highp_f64vec1; + + /// High double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, highp> highp_f64vec2; + + /// High double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, highp> highp_f64vec3; + + /// High double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, highp> highp_f64vec4; + + + + ////////////////////// + // Float matrix types + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_f32 lowp_fmat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; + + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; + + /// Low single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; + + /// Low single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; + + /// Low single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; + + /// Low single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_fmat1x1 lowp_fmat1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_fmat2x2 lowp_fmat2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_fmat3x3 lowp_fmat3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_fmat4x4 lowp_fmat4; + + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_f32 mediump_fmat1x1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; + + /// Medium single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; + + /// Medium single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; + + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; + + /// Medium single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; + + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_fmat1x1 mediump_fmat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_fmat2x2 mediump_fmat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_fmat3x3 mediump_fmat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_fmat4x4 mediump_fmat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f32 highp_fmat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_fmat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_fmat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_fmat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_fmat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_fmat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_fmat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_fmat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_fmat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_fmat1x1 highp_fmat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_fmat2x2 highp_fmat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_fmat3x3 highp_fmat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_fmat4x4 highp_fmat4; + + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 lowp_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + + /// Low single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + + /// Low single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + + /// Low single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + + /// Low single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 lowp_f32mat1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat2x2 lowp_f32mat2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat3x3 lowp_f32mat3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat4x4 lowp_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 mediump_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + + /// Medium single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + + /// Medium single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + + /// Medium single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat2x2 mediump_f32mat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat3x3 mediump_f32mat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat4x4 mediump_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 highp_f32mat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f32mat2x2 highp_f32mat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f32mat3x3 highp_f32mat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f32mat4x4 highp_f32mat4; + + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 lowp_f64mat1x1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + + /// Low double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + + /// Low double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + + /// Low double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + + /// Low double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + + /// Low double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + + /// Low double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_f64mat1x1 lowp_f64mat1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat2x2 lowp_f64mat2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat3x3 lowp_f64mat3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat4x4 lowp_f64mat4; + + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 Highp_f64mat1x1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + + /// Medium double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + + /// Medium double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + + /// Medium double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + + /// Medium double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + + /// Medium double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + + /// Medium double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_f64mat1x1 mediump_f64mat1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat2x2 mediump_f64mat2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat3x3 mediump_f64mat3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat4x4 mediump_f64mat4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 highp_f64mat1x1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + + /// High double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + + /// High double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + + /// High double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + + /// High double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + + /// High double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + + /// High double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f64mat1x1 highp_f64mat1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f64mat2x2 highp_f64mat2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f64mat3x3 highp_f64mat3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f64mat4x4 highp_f64mat4; + + + ///////////////////////////// + // Signed int vector types + + /// Low qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, lowp> lowp_ivec1; + + /// Low qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, lowp> lowp_ivec2; + + /// Low qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, lowp> lowp_ivec3; + + /// Low qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, lowp> lowp_ivec4; + + + /// Medium qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, mediump> mediump_ivec1; + + /// Medium qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, mediump> mediump_ivec2; + + /// Medium qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, mediump> mediump_ivec3; + + /// Medium qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, mediump> mediump_ivec4; + + + /// High qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, highp> highp_ivec1; + + /// High qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, highp> highp_ivec2; + + /// High qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, highp> highp_ivec3; + + /// High qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, highp> highp_ivec4; + + + /// Low qualifier 8 bit signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, i8, lowp> lowp_i8vec1; + + /// Low qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, lowp> lowp_i8vec2; + + /// Low qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, lowp> lowp_i8vec3; + + /// Low qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, lowp> lowp_i8vec4; + + + /// Medium qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, mediump> mediump_i8vec1; + + /// Medium qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, mediump> mediump_i8vec2; + + /// Medium qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, mediump> mediump_i8vec3; + + /// Medium qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, mediump> mediump_i8vec4; + + + /// High qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, highp> highp_i8vec1; + + /// High qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, highp> highp_i8vec2; + + /// High qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, highp> highp_i8vec3; + + /// High qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, highp> highp_i8vec4; + + + /// Low qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, lowp> lowp_i16vec1; + + /// Low qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, lowp> lowp_i16vec2; + + /// Low qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, lowp> lowp_i16vec3; + + /// Low qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, lowp> lowp_i16vec4; + + + /// Medium qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, mediump> mediump_i16vec1; + + /// Medium qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, mediump> mediump_i16vec2; + + /// Medium qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, mediump> mediump_i16vec3; + + /// Medium qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, mediump> mediump_i16vec4; + + + /// High qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, highp> highp_i16vec1; + + /// High qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, highp> highp_i16vec2; + + /// High qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, highp> highp_i16vec3; + + /// High qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, highp> highp_i16vec4; + + + /// Low qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, lowp> lowp_i32vec1; + + /// Low qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, lowp> lowp_i32vec2; + + /// Low qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, lowp> lowp_i32vec3; + + /// Low qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, lowp> lowp_i32vec4; + + + /// Medium qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, mediump> mediump_i32vec1; + + /// Medium qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, mediump> mediump_i32vec2; + + /// Medium qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, mediump> mediump_i32vec3; + + /// Medium qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, mediump> mediump_i32vec4; + + + /// High qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, highp> highp_i32vec1; + + /// High qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, highp> highp_i32vec2; + + /// High qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, highp> highp_i32vec3; + + /// High qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, highp> highp_i32vec4; + + + /// Low qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, lowp> lowp_i64vec1; + + /// Low qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, lowp> lowp_i64vec2; + + /// Low qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, lowp> lowp_i64vec3; + + /// Low qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, lowp> lowp_i64vec4; + + + /// Medium qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, mediump> mediump_i64vec1; + + /// Medium qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, mediump> mediump_i64vec2; + + /// Medium qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, mediump> mediump_i64vec3; + + /// Medium qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, mediump> mediump_i64vec4; + + + /// High qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, highp> highp_i64vec1; + + /// High qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, highp> highp_i64vec2; + + /// High qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, highp> highp_i64vec3; + + /// High qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, highp> highp_i64vec4; + + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, lowp> lowp_uvec1; + + /// Low qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, lowp> lowp_uvec2; + + /// Low qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, lowp> lowp_uvec3; + + /// Low qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, lowp> lowp_uvec4; + + + /// Medium qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, mediump> mediump_uvec1; + + /// Medium qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, mediump> mediump_uvec2; + + /// Medium qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, mediump> mediump_uvec3; + + /// Medium qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, mediump> mediump_uvec4; + + + /// High qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, highp> highp_uvec1; + + /// High qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, highp> highp_uvec2; + + /// High qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, highp> highp_uvec3; + + /// High qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, highp> highp_uvec4; + + + /// Low qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, lowp> lowp_u8vec1; + + /// Low qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, lowp> lowp_u8vec2; + + /// Low qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, lowp> lowp_u8vec3; + + /// Low qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, lowp> lowp_u8vec4; + + + /// Medium qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, mediump> mediump_u8vec1; + + /// Medium qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, mediump> mediump_u8vec2; + + /// Medium qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, mediump> mediump_u8vec3; + + /// Medium qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, mediump> mediump_u8vec4; + + + /// High qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, highp> highp_u8vec1; + + /// High qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, highp> highp_u8vec2; + + /// High qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, highp> highp_u8vec3; + + /// High qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, highp> highp_u8vec4; + + + /// Low qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, lowp> lowp_u16vec1; + + /// Low qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, lowp> lowp_u16vec2; + + /// Low qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, lowp> lowp_u16vec3; + + /// Low qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, lowp> lowp_u16vec4; + + + /// Medium qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, mediump> mediump_u16vec1; + + /// Medium qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, mediump> mediump_u16vec2; + + /// Medium qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, mediump> mediump_u16vec3; + + /// Medium qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, mediump> mediump_u16vec4; + + + /// High qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, highp> highp_u16vec1; + + /// High qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, highp> highp_u16vec2; + + /// High qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, highp> highp_u16vec3; + + /// High qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, highp> highp_u16vec4; + + + /// Low qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, lowp> lowp_u32vec1; + + /// Low qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, lowp> lowp_u32vec2; + + /// Low qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, lowp> lowp_u32vec3; + + /// Low qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, lowp> lowp_u32vec4; + + + /// Medium qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, mediump> mediump_u32vec1; + + /// Medium qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, mediump> mediump_u32vec2; + + /// Medium qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, mediump> mediump_u32vec3; + + /// Medium qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, mediump> mediump_u32vec4; + + + /// High qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, highp> highp_u32vec1; + + /// High qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, highp> highp_u32vec2; + + /// High qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, highp> highp_u32vec3; + + /// High qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, highp> highp_u32vec4; + + + /// Low qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, lowp> lowp_u64vec1; + + /// Low qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, lowp> lowp_u64vec2; + + /// Low qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, lowp> lowp_u64vec3; + + /// Low qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, lowp> lowp_u64vec4; + + + /// Medium qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, mediump> mediump_u64vec1; + + /// Medium qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, mediump> mediump_u64vec2; + + /// Medium qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, mediump> mediump_u64vec3; + + /// Medium qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, mediump> mediump_u64vec4; + + + /// High qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, highp> highp_u64vec1; + + /// High qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, highp> highp_u64vec2; + + /// High qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, highp> highp_u64vec3; + + /// High qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, highp> highp_u64vec4; + + + ////////////////////// + // Float vector types + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 float32_t; + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 f32; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 float64_t; + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 f64; +# endif//GLM_FORCE_SINGLE_ONLY + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, defaultp> fvec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, defaultp> fvec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, defaultp> fvec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, defaultp> fvec4; + + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, defaultp> f32vec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, defaultp> f32vec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f32, defaultp> f32vec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f32, defaultp> f32vec4; + +# ifndef GLM_FORCE_SINGLE_ONLY + /// Double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, defaultp> f64vec1; + + /// Double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, defaultp> f64vec2; + + /// Double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, defaultp> f64vec3; + + /// Double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, defaultp> f64vec4; +# endif//GLM_FORCE_SINGLE_ONLY + + + ////////////////////// + // Float matrix types + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 fmat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 fmat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> fmat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> fmat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> fmat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> fmat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> fmat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> fmat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4x4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 f32mat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> f32mat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> f32mat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> f32mat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> f32mat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> f32mat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> f32mat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f64mat1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4; + + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 f64mat1x1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2x2; + + /// Double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, defaultp> f64mat2x3; + + /// Double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, defaultp> f64mat2x4; + + /// Double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, defaultp> f64mat3x2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3x3; + + /// Double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, defaultp> f64mat3x4; + + /// Double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, defaultp> f64mat4x2; + + /// Double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, defaultp> f64mat4x3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4x4; + +# endif//GLM_FORCE_SINGLE_ONLY + + ////////////////////////// + // Quaternion types + + /// Single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua f32quat; + + /// Low single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f32quat; + + /// Low double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f64quat; + + /// Medium single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f32quat; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Medium double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f64quat; + + /// High single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f32quat; + + /// High double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f64quat; + + /// Double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua f64quat; + +# endif//GLM_FORCE_SINGLE_ONLY + + /// @} +}//namespace glm + +#include "type_precision.inl" diff --git a/include/glm/glm/gtc/type_precision.inl b/include/glm/glm/gtc/type_precision.inl new file mode 100644 index 00000000..ae809120 --- /dev/null +++ b/include/glm/glm/gtc/type_precision.inl @@ -0,0 +1,6 @@ +/// @ref gtc_precision + +namespace glm +{ + +} diff --git a/include/glm/glm/gtc/type_ptr.hpp b/include/glm/glm/gtc/type_ptr.hpp new file mode 100644 index 00000000..d7e625aa --- /dev/null +++ b/include/glm/glm/gtc/type_ptr.hpp @@ -0,0 +1,230 @@ +/// @ref gtc_type_ptr +/// @file glm/gtc/type_ptr.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_type_ptr GLM_GTC_type_ptr +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Handles the interaction between pointers and vector, matrix types. +/// +/// This extension defines an overloaded function, glm::value_ptr. It returns +/// a pointer to the memory layout of the object. Matrix types store their values +/// in column-major order. +/// +/// This is useful for uploading data to matrices or copying data to buffer objects. +/// +/// Example: +/// @code +/// #include +/// #include +/// +/// glm::vec3 aVector(3); +/// glm::mat4 someMatrix(1.0); +/// +/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector)); +/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix)); +/// @endcode +/// +/// need to be included to use the features of this extension. + +#pragma once + +// Dependency: +#include "../gtc/quaternion.hpp" +#include "../gtc/vec1.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_ptr extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_type_ptr + /// @{ + + /// Return the constant address to the data of the input parameter. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr); + + /// Build a quaternion from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL qua make_quat(T const * const ptr); + + /// @} +}//namespace glm + +#include "type_ptr.inl" diff --git a/include/glm/glm/gtc/type_ptr.inl b/include/glm/glm/gtc/type_ptr.inl new file mode 100644 index 00000000..71df4d30 --- /dev/null +++ b/include/glm/glm/gtc/type_ptr.inl @@ -0,0 +1,386 @@ +/// @ref gtc_type_ptr + +#include + +namespace glm +{ + /// @addtogroup gtc_type_ptr + /// @{ + + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const * value_ptr(qua const& q) + { + return &(q[0]); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(qua& q) + { + return &(q[0]); + } + + template + inline vec<1, T, Q> make_vec1(vec<1, T, Q> const& v) + { + return v; + } + + template + inline vec<1, T, Q> make_vec1(vec<2, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + inline vec<1, T, Q> make_vec1(vec<3, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + inline vec<1, T, Q> make_vec1(vec<4, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + inline vec<2, T, Q> make_vec2(vec<1, T, Q> const& v) + { + return vec<2, T, Q>(v.x, static_cast(0)); + } + + template + inline vec<2, T, Q> make_vec2(vec<2, T, Q> const& v) + { + return v; + } + + template + inline vec<2, T, Q> make_vec2(vec<3, T, Q> const& v) + { + return vec<2, T, Q>(v); + } + + template + inline vec<2, T, Q> make_vec2(vec<4, T, Q> const& v) + { + return vec<2, T, Q>(v); + } + + template + inline vec<3, T, Q> make_vec3(vec<1, T, Q> const& v) + { + return vec<3, T, Q>(v.x, static_cast(0), static_cast(0)); + } + + template + inline vec<3, T, Q> make_vec3(vec<2, T, Q> const& v) + { + return vec<3, T, Q>(v.x, v.y, static_cast(0)); + } + + template + inline vec<3, T, Q> make_vec3(vec<3, T, Q> const& v) + { + return v; + } + + template + inline vec<3, T, Q> make_vec3(vec<4, T, Q> const& v) + { + return vec<3, T, Q>(v); + } + + template + inline vec<4, T, Q> make_vec4(vec<1, T, Q> const& v) + { + return vec<4, T, Q>(v.x, static_cast(0), static_cast(0), static_cast(1)); + } + + template + inline vec<4, T, Q> make_vec4(vec<2, T, Q> const& v) + { + return vec<4, T, Q>(v.x, v.y, static_cast(0), static_cast(1)); + } + + template + inline vec<4, T, Q> make_vec4(vec<3, T, Q> const& v) + { + return vec<4, T, Q>(v.x, v.y, v.z, static_cast(1)); + } + + template + inline vec<4, T, Q> make_vec4(vec<4, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const *const ptr) + { + vec<2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const *const ptr) + { + vec<3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const *const ptr) + { + vec<4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const *const ptr) + { + mat<2, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const *const ptr) + { + mat<2, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const *const ptr) + { + mat<2, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const *const ptr) + { + mat<3, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const *const ptr) + { + mat<3, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const *const ptr) + { + mat<3, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const *const ptr) + { + mat<4, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const *const ptr) + { + mat<4, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const *const ptr) + { + mat<4, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const *const ptr) + { + return make_mat2x2(ptr); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const *const ptr) + { + return make_mat3x3(ptr); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const *const ptr) + { + return make_mat4x4(ptr); + } + + template + GLM_FUNC_QUALIFIER qua make_quat(T const *const ptr) + { + qua Result; + memcpy(value_ptr(Result), ptr, sizeof(qua)); + return Result; + } + + /// @} +}//namespace glm + diff --git a/include/glm/glm/gtc/ulp.hpp b/include/glm/glm/gtc/ulp.hpp new file mode 100644 index 00000000..0d80a758 --- /dev/null +++ b/include/glm/glm/gtc/ulp.hpp @@ -0,0 +1,152 @@ +/// @ref gtc_ulp +/// @file glm/gtc/ulp.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_ulp GLM_GTC_ulp +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_ulp extension included") +#endif + +namespace glm +{ + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType next_float(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType prev_float(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType next_float(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType prev_float(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see gtc_ulp + GLM_FUNC_DECL int float_distance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see gtc_ulp + GLM_FUNC_DECL int64 float_distance(double x, double y); + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "ulp.inl" diff --git a/include/glm/glm/gtc/ulp.inl b/include/glm/glm/gtc/ulp.inl new file mode 100644 index 00000000..4ecbd3f4 --- /dev/null +++ b/include/glm/glm/gtc/ulp.inl @@ -0,0 +1,173 @@ +/// @ref gtc_ulp + +#include "../ext/scalar_ulp.hpp" + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER float next_float(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MAX); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MAX); +# else + return nextafterf(x, FLT_MAX); +# endif + } + + template<> + GLM_FUNC_QUALIFIER double next_float(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafter(x, std::numeric_limits::max()); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MAX); +# else + return nextafter(x, DBL_MAX); +# endif + } + + template + GLM_FUNC_QUALIFIER T next_float(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = next_float(temp); + return temp; + } + + GLM_FUNC_QUALIFIER float prev_float(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MIN); +# else + return nextafterf(x, FLT_MIN); +# endif + } + + GLM_FUNC_QUALIFIER double prev_float(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return _nextafter(x, DBL_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MIN); +# else + return nextafter(x, DBL_MIN); +# endif + } + + template + GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = prev_float(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int float_distance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 float_distance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, int ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, int ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = float_distance(x[i], y[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = float_distance(x[i], y[i]); + return Result; + } +}//namespace glm + diff --git a/include/glm/glm/gtc/vec1.hpp b/include/glm/glm/gtc/vec1.hpp new file mode 100644 index 00000000..63697a21 --- /dev/null +++ b/include/glm/glm/gtc/vec1.hpp @@ -0,0 +1,30 @@ +/// @ref gtc_vec1 +/// @file glm/gtc/vec1.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_vec1 GLM_GTC_vec1 +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Add vec1, ivec1, uvec1 and bvec1 types. + +#pragma once + +// Dependency: +#include "../ext/vector_bool1.hpp" +#include "../ext/vector_bool1_precision.hpp" +#include "../ext/vector_float1.hpp" +#include "../ext/vector_float1_precision.hpp" +#include "../ext/vector_double1.hpp" +#include "../ext/vector_double1_precision.hpp" +#include "../ext/vector_int1.hpp" +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_uint1.hpp" +#include "../ext/vector_uint1_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_vec1 extension included") +#endif + diff --git a/include/glm/glm/gtx/associated_min_max.hpp b/include/glm/glm/gtx/associated_min_max.hpp new file mode 100644 index 00000000..d1a41c06 --- /dev/null +++ b/include/glm/glm/gtx/associated_min_max.hpp @@ -0,0 +1,207 @@ +/// @ref gtx_associated_min_max +/// @file glm/gtx/associated_min_max.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Min and max functions that return associated values not the compared onces. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_associated_min_max extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_associated_min_max + /// @{ + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec<2, U, Q> associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + T x, const vec& a, + T y, const vec& b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b); + + /// Minimum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin( + T x, U a, + T y, U b, + T z, U c); + + /// Minimum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin( + T x, U a, + T y, U b, + T z, U c, + T w, U d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec<2, U, Q> associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax( + T x, U a, + T y, U b, + T z, U c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax( + T x, U a, + T y, U b, + T z, U c, + T w, U d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); + + /// @} +} //namespace glm + +#include "associated_min_max.inl" diff --git a/include/glm/glm/gtx/associated_min_max.inl b/include/glm/glm/gtx/associated_min_max.inl new file mode 100644 index 00000000..5186c471 --- /dev/null +++ b/include/glm/glm/gtx/associated_min_max.inl @@ -0,0 +1,354 @@ +/// @ref gtx_associated_min_max + +namespace glm{ + +// Min comparison between 2 variables +template +GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) +{ + return x < y ? a : b; +} + +template +GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? a[i] : b[i]; + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + T x, const vec& a, + T y, const vec& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x < y ? a[i] : b[i]; + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, U a, + vec const& y, U b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? a : b; + return Result; +} + +// Min comparison between 3 variables +template +GLM_FUNC_QUALIFIER U associatedMin +( + T x, U a, + T y, U b, + T z, U c +) +{ + U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER U associatedMin +( + T x, U a, + T y, U b, + T z, U c, + T w, U d +) +{ + T Test1 = min(x, y); + T Test2 = min(z, w); + U Result1 = x < y ? a : b; + U Result2 = z < w ? c : d; + U Result = Test1 < Test2 ? Result1 : Result2; + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a[i] : b[i]; + U Result2 = z[i] < w[i] ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d +) +{ + T Test1 = min(x, y); + T Test2 = min(z, w); + + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + U Result1 = x < y ? a[i] : b[i]; + U Result2 = z < w ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a : b; + U Result2 = z[i] < w[i] ? c : d; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) +{ + return x > y ? a : b; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? a[i] : b[i]; + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x > y ? a[i] : b[i]; + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? a : b; + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER U associatedMax +( + T x, U a, + T y, U b, + T z, U c +) +{ + U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER U associatedMax +( + T x, U a, + T y, U b, + T z, U c, + T w, U d +) +{ + T Test1 = max(x, y); + T Test2 = max(z, w); + U Result1 = x > y ? a : b; + U Result2 = z > w ? c : d; + U Result = Test1 > Test2 ? Result1 : Result2; + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a[i] : b[i]; + U Result2 = z[i] > w[i] ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d +) +{ + T Test1 = max(x, y); + T Test2 = max(z, w); + + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + U Result1 = x > y ? a[i] : b[i]; + U Result2 = z > w ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a : b; + U Result2 = z[i] > w[i] ? c : d; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} +}//namespace glm diff --git a/include/glm/glm/gtx/bit.hpp b/include/glm/glm/gtx/bit.hpp new file mode 100644 index 00000000..60a7aef1 --- /dev/null +++ b/include/glm/glm/gtx/bit.hpp @@ -0,0 +1,98 @@ +/// @ref gtx_bit +/// @file glm/gtx/bit.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_bit GLM_GTX_bit +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../gtc/bitfield.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_bit extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_bit + /// @{ + + /// @see gtx_bit + template + GLM_FUNC_DECL genIUType highestBitValue(genIUType Value); + + /// @see gtx_bit + template + GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value); + + /// Find the highest bit set to 1 in a integer variable and return its value. + /// + /// @see gtx_bit + template + GLM_FUNC_DECL vec highestBitValue(vec const& value); + + /// Return the power of two number which value is just higher the input value. + /// Deprecated, use ceilPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value); + + /// Return the power of two number which value is just higher the input value. + /// Deprecated, use ceilPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoAbove(vec const& value); + + /// Return the power of two number which value is just lower the input value. + /// Deprecated, use floorPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value); + + /// Return the power of two number which value is just lower the input value. + /// Deprecated, use floorPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoBelow(vec const& value); + + /// Return the power of two number which value is the closet to the input value. + /// Deprecated, use roundPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value); + + /// Return the power of two number which value is the closet to the input value. + /// Deprecated, use roundPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoNearest(vec const& value); + + /// @} +} //namespace glm + + +#include "bit.inl" + diff --git a/include/glm/glm/gtx/bit.inl b/include/glm/glm/gtx/bit.inl new file mode 100644 index 00000000..621b6262 --- /dev/null +++ b/include/glm/glm/gtx/bit.inl @@ -0,0 +1,92 @@ +/// @ref gtx_bit + +namespace glm +{ + /////////////////// + // highestBitValue + + template + GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) + { + genIUType tmp = Value; + genIUType result = genIUType(0); + while(tmp) + { + result = (tmp & (~tmp + 1)); // grab lowest bit + tmp &= ~result; // clear lowest bit + } + return result; + } + + template + GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) + { + return detail::functor1::call(highestBitValue, v); + } + + /////////////////// + // lowestBitValue + + template + GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value) + { + return (Value & (~Value + 1)); + } + + template + GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) + { + return detail::functor1::call(lowestBitValue, v); + } + + /////////////////// + // powerOfTwoAbove + + template + GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value) + { + return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) + { + return detail::functor1::call(powerOfTwoAbove, v); + } + + /////////////////// + // powerOfTwoBelow + + template + GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value) + { + return isPowerOfTwo(value) ? value : highestBitValue(value); + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) + { + return detail::functor1::call(powerOfTwoBelow, v); + } + + ///////////////////// + // powerOfTwoNearest + + template + GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value) + { + if(isPowerOfTwo(value)) + return value; + + genType const prev = highestBitValue(value); + genType const next = prev << 1; + return (next - value) < (value - prev) ? next : prev; + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) + { + return detail::functor1::call(powerOfTwoNearest, v); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/closest_point.hpp b/include/glm/glm/gtx/closest_point.hpp new file mode 100644 index 00000000..de6dbbff --- /dev/null +++ b/include/glm/glm/gtx/closest_point.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_closest_point +/// @file glm/gtx/closest_point.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_closest_point GLM_GTX_closest_point +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Find the point on a straight line which is the closet of a point. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_closest_point extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_closest_point + /// @{ + + /// Find the point on a straight line which is the closet of a point. + /// @see gtx_closest_point + template + GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine( + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b); + + /// 2d lines work as well + template + GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine( + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b); + + /// @} +}// namespace glm + +#include "closest_point.inl" diff --git a/include/glm/glm/gtx/closest_point.inl b/include/glm/glm/gtx/closest_point.inl new file mode 100644 index 00000000..0a39b042 --- /dev/null +++ b/include/glm/glm/gtx/closest_point.inl @@ -0,0 +1,45 @@ +/// @ref gtx_closest_point + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine + ( + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b + ) + { + T LineLength = distance(a, b); + vec<3, T, Q> Vector = point - a; + vec<3, T, Q> LineDirection = (b - a) / LineLength; + + // Project Vector to LineDirection to get the distance of point from a + T Distance = dot(Vector, LineDirection); + + if(Distance <= T(0)) return a; + if(Distance >= LineLength) return b; + return a + LineDirection * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine + ( + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b + ) + { + T LineLength = distance(a, b); + vec<2, T, Q> Vector = point - a; + vec<2, T, Q> LineDirection = (b - a) / LineLength; + + // Project Vector to LineDirection to get the distance of point from a + T Distance = dot(Vector, LineDirection); + + if(Distance <= T(0)) return a; + if(Distance >= LineLength) return b; + return a + LineDirection * Distance; + } + +}//namespace glm diff --git a/include/glm/glm/gtx/color_encoding.hpp b/include/glm/glm/gtx/color_encoding.hpp new file mode 100644 index 00000000..96ded2a2 --- /dev/null +++ b/include/glm/glm/gtx/color_encoding.hpp @@ -0,0 +1,54 @@ +/// @ref gtx_color_encoding +/// @file glm/gtx/color_encoding.hpp +/// +/// @see core (dependence) +/// @see gtx_color_encoding (dependence) +/// +/// @defgroup gtx_color_encoding GLM_GTX_color_encoding +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../vec3.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTC_color_encoding is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTC_color_encoding extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_encoding + /// @{ + + /// Convert a linear sRGB color to D65 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB); + + /// Convert a linear sRGB color to D50 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB); + + /// Convert a D65 YUV color to linear sRGB. + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ); + + /// Convert a D65 YUV color to D50 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ); + + /// @} +} //namespace glm + +#include "color_encoding.inl" diff --git a/include/glm/glm/gtx/color_encoding.inl b/include/glm/glm/gtx/color_encoding.inl new file mode 100644 index 00000000..e50fa3ef --- /dev/null +++ b/include/glm/glm/gtx/color_encoding.inl @@ -0,0 +1,45 @@ +/// @ref gtx_color_encoding + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB) + { + vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f); + vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f); + vec<3, T, Q> const O(0.490f, 0.01f, 0.99f); + + return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB) + { + vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); + vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); + vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); + + return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ) + { + vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f); + vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f); + vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f); + + return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ) + { + vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); + vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); + vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); + + return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; + } + +}//namespace glm diff --git a/include/glm/glm/gtx/color_space.hpp b/include/glm/glm/gtx/color_space.hpp new file mode 100644 index 00000000..a6343921 --- /dev/null +++ b/include/glm/glm/gtx/color_space.hpp @@ -0,0 +1,72 @@ +/// @ref gtx_color_space +/// @file glm/gtx/color_space.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_color_space GLM_GTX_color_space +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Related to RGB to HSV conversions and operations. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_color_space extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_space + /// @{ + + /// Converts a color from HSV color space to its color in RGB color space. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> rgbColor( + vec<3, T, Q> const& hsvValue); + + /// Converts a color from RGB color space to its color in HSV color space. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> hsvColor( + vec<3, T, Q> const& rgbValue); + + /// Build a saturation matrix. + /// @see gtx_color_space + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation( + T const s); + + /// Modify the saturation of a color. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> saturation( + T const s, + vec<3, T, Q> const& color); + + /// Modify the saturation of a color. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<4, T, Q> saturation( + T const s, + vec<4, T, Q> const& color); + + /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. + /// @see gtx_color_space + template + GLM_FUNC_DECL T luminosity( + vec<3, T, Q> const& color); + + /// @} +}//namespace glm + +#include "color_space.inl" diff --git a/include/glm/glm/gtx/color_space.inl b/include/glm/glm/gtx/color_space.inl new file mode 100644 index 00000000..f698afe1 --- /dev/null +++ b/include/glm/glm/gtx/color_space.inl @@ -0,0 +1,141 @@ +/// @ref gtx_color_space + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgbColor(const vec<3, T, Q>& hsvColor) + { + vec<3, T, Q> hsv = hsvColor; + vec<3, T, Q> rgbColor; + + if(hsv.y == static_cast(0)) + // achromatic (grey) + rgbColor = vec<3, T, Q>(hsv.z); + else + { + T sector = floor(hsv.x * (T(1) / T(60))); + T frac = (hsv.x * (T(1) / T(60))) - sector; + // factorial part of h + T o = hsv.z * (T(1) - hsv.y); + T p = hsv.z * (T(1) - hsv.y * frac); + T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); + + switch(int(sector)) + { + default: + case 0: + rgbColor.r = hsv.z; + rgbColor.g = q; + rgbColor.b = o; + break; + case 1: + rgbColor.r = p; + rgbColor.g = hsv.z; + rgbColor.b = o; + break; + case 2: + rgbColor.r = o; + rgbColor.g = hsv.z; + rgbColor.b = q; + break; + case 3: + rgbColor.r = o; + rgbColor.g = p; + rgbColor.b = hsv.z; + break; + case 4: + rgbColor.r = q; + rgbColor.g = o; + rgbColor.b = hsv.z; + break; + case 5: + rgbColor.r = hsv.z; + rgbColor.g = o; + rgbColor.b = p; + break; + } + } + + return rgbColor; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor) + { + vec<3, T, Q> hsv = rgbColor; + float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); + float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); + float Delta = Max - Min; + + hsv.z = Max; + + if(Max != static_cast(0)) + { + hsv.y = Delta / hsv.z; + T h = static_cast(0); + + if(rgbColor.r == Max) + // between yellow & magenta + h = static_cast(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; + else if(rgbColor.g == Max) + // between cyan & yellow + h = static_cast(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; + else + // between magenta & cyan + h = static_cast(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta; + + if(h < T(0)) + hsv.x = h + T(360); + else + hsv.x = h; + } + else + { + // If r = g = b = 0 then s = 0, h is undefined + hsv.y = static_cast(0); + hsv.x = static_cast(0); + } + + return hsv; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> saturation(T const s) + { + vec<3, T, defaultp> rgbw = vec<3, T, defaultp>(T(0.2126), T(0.7152), T(0.0722)); + + vec<3, T, defaultp> const col((T(1) - s) * rgbw); + + mat<4, 4, T, defaultp> result(T(1)); + result[0][0] = col.x + s; + result[0][1] = col.x; + result[0][2] = col.x; + result[1][0] = col.y; + result[1][1] = col.y + s; + result[1][2] = col.y; + result[2][0] = col.z; + result[2][1] = col.z; + result[2][2] = col.z + s; + + return result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> saturation(const T s, const vec<3, T, Q>& color) + { + return vec<3, T, Q>(saturation(s) * vec<4, T, Q>(color, T(0))); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> saturation(const T s, const vec<4, T, Q>& color) + { + return saturation(s) * color; + } + + template + GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, Q>& color) + { + const vec<3, T, Q> tmp = vec<3, T, Q>(0.33, 0.59, 0.11); + return dot(color, tmp); + } +}//namespace glm diff --git a/include/glm/glm/gtx/color_space_YCoCg.hpp b/include/glm/glm/gtx/color_space_YCoCg.hpp new file mode 100644 index 00000000..dd2b7716 --- /dev/null +++ b/include/glm/glm/gtx/color_space_YCoCg.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_color_space_YCoCg +/// @file glm/gtx/color_space_YCoCg.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// RGB to YCoCg conversions and operations + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_space_YCoCg + /// @{ + + /// Convert a color from RGB color space to YCoCg color space. + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg( + vec<3, T, Q> const& rgbColor); + + /// Convert a color from YCoCg color space to RGB color space. + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb( + vec<3, T, Q> const& YCoCgColor); + + /// Convert a color from RGB color space to YCoCgR color space. + /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR( + vec<3, T, Q> const& rgbColor); + + /// Convert a color from YCoCgR color space to RGB color space. + /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb( + vec<3, T, Q> const& YCoCgColor); + + /// @} +}//namespace glm + +#include "color_space_YCoCg.inl" diff --git a/include/glm/glm/gtx/color_space_YCoCg.inl b/include/glm/glm/gtx/color_space_YCoCg.inl new file mode 100644 index 00000000..83ba857c --- /dev/null +++ b/include/glm/glm/gtx/color_space_YCoCg.inl @@ -0,0 +1,107 @@ +/// @ref gtx_color_space_YCoCg + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCg + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4); + result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2); + result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4); + return result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCg2rgb + ( + vec<3, T, Q> const& YCoCgColor + ) + { + vec<3, T, Q> result; + result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; + result.g = YCoCgColor.x + YCoCgColor.z; + result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; + return result; + } + + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.x/*Y */ = rgbColor.g * static_cast(0.5) + (rgbColor.r + rgbColor.b) * static_cast(0.25); + result.y/*Co*/ = rgbColor.r - rgbColor.b; + result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) * static_cast(0.5); + return result; + } + + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + vec<3, T, Q> result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z * static_cast(0.5)); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y * static_cast(0.5)); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.y/*Co*/ = rgbColor.r - rgbColor.b; + T tmp = rgbColor.b + (result.y >> 1); + result.z/*Cg*/ = rgbColor.g - tmp; + result.x/*Y */ = tmp + (result.z >> 1); + return result; + } + + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + vec<3, T, Q> result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y >> 1); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); + } +}//namespace glm diff --git a/include/glm/glm/gtx/common.hpp b/include/glm/glm/gtx/common.hpp new file mode 100644 index 00000000..254ada2d --- /dev/null +++ b/include/glm/glm/gtx/common.hpp @@ -0,0 +1,76 @@ +/// @ref gtx_common +/// @file glm/gtx/common.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_common GLM_GTX_common +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Provide functions to increase the compatibility with Cg and HLSL languages + +#pragma once + +// Dependencies: +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../gtc/vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_common is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_common extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_common + /// @{ + + /// Returns true if x is a denormalized number + /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. + /// This format is less precise but can represent values closer to zero. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL isnan man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const& x); + + /// Similar to 'mod' but with a different rounding and integer support. + /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' + /// + /// @see GLSL mod vs HLSL fmod + /// @see GLSL mod man page + template + GLM_FUNC_DECL vec fmod(vec const& v); + + /// Returns whether vector components values are within an interval. A open interval excludes its endpoints, and is denoted with square brackets. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_relational + template + GLM_FUNC_DECL vec openBounded(vec const& Value, vec const& Min, vec const& Max); + + /// Returns whether vector components values are within an interval. A closed interval includes its endpoints, and is denoted with square brackets. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_relational + template + GLM_FUNC_DECL vec closeBounded(vec const& Value, vec const& Min, vec const& Max); + + /// @} +}//namespace glm + +#include "common.inl" diff --git a/include/glm/glm/gtx/common.inl b/include/glm/glm/gtx/common.inl new file mode 100644 index 00000000..4ad2126d --- /dev/null +++ b/include/glm/glm/gtx/common.inl @@ -0,0 +1,125 @@ +/// @ref gtx_common + +#include +#include "../gtc/epsilon.hpp" +#include "../gtc/constants.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::fmod, a, b); + } + }; + + template + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + return a % b; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool isdenormal(T const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::fpclassify(x) == FP_SUBNORMAL; +# else + return epsilonNotEqual(x, static_cast(0), epsilon()) && std::fabs(x) < std::numeric_limits::min(); +# endif + } + + template + GLM_FUNC_QUALIFIER typename vec<1, T, Q>::bool_type isdenormal + ( + vec<1, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<1, T, Q>::bool_type( + isdenormal(x.x)); + } + + template + GLM_FUNC_QUALIFIER typename vec<2, T, Q>::bool_type isdenormal + ( + vec<2, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<2, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y)); + } + + template + GLM_FUNC_QUALIFIER typename vec<3, T, Q>::bool_type isdenormal + ( + vec<3, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<3, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y), + isdenormal(x.z)); + } + + template + GLM_FUNC_QUALIFIER typename vec<4, T, Q>::bool_type isdenormal + ( + vec<4, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<4, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y), + isdenormal(x.z), + isdenormal(x.w)); + } + + // fmod + template + GLM_FUNC_QUALIFIER genType fmod(genType x, genType y) + { + return fmod(vec<1, genType>(x), y).x; + } + + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, T y) + { + return detail::compute_fmod::is_iec559>::call(x, vec(y)); + } + + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, vec const& y) + { + return detail::compute_fmod::is_iec559>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER vec openBounded(vec const& Value, vec const& Min, vec const& Max) + { + return greaterThan(Value, Min) && lessThan(Value, Max); + } + + template + GLM_FUNC_QUALIFIER vec closeBounded(vec const& Value, vec const& Min, vec const& Max) + { + return greaterThanEqual(Value, Min) && lessThanEqual(Value, Max); + } +}//namespace glm diff --git a/include/glm/glm/gtx/compatibility.hpp b/include/glm/glm/gtx/compatibility.hpp new file mode 100644 index 00000000..f1b00a6b --- /dev/null +++ b/include/glm/glm/gtx/compatibility.hpp @@ -0,0 +1,133 @@ +/// @ref gtx_compatibility +/// @file glm/gtx/compatibility.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_compatibility GLM_GTX_compatibility +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Provide functions to increase the compatibility with Cg and HLSL languages + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_compatibility is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_compatibility extension included") +# endif +#endif + +#if GLM_COMPILER & GLM_COMPILER_VC +# include +#elif GLM_COMPILER & GLM_COMPILER_GCC +# include +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# undef isfinite +# endif +#endif//GLM_COMPILER + +namespace glm +{ + /// @addtogroup gtx_compatibility + /// @{ + + template GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, const vec<2, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + + template GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + + typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, bool, highp> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, bool, highp> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) + + typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, bool, highp> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, bool, highp> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, bool, highp> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, bool, highp> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, bool, highp> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, bool, highp> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, bool, highp> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, bool, highp> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, bool, highp> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, int, highp> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, int, highp> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, int, highp> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, int, highp> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, int, highp> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, int, highp> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, int, highp> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, int, highp> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, int, highp> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, int, highp> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, int, highp> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, int, highp> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1; //!< \brief single-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, float, highp> float2; //!< \brief single-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, float, highp> float3; //!< \brief single-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, float, highp> float4; //!< \brief single-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1x1; //!< \brief single-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, float, highp> float2x2; //!< \brief single-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, float, highp> float2x3; //!< \brief single-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, float, highp> float2x4; //!< \brief single-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, float, highp> float3x2; //!< \brief single-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, float, highp> float3x3; //!< \brief single-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, float, highp> float3x4; //!< \brief single-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, float, highp> float4x2; //!< \brief single-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, float, highp> float4x3; //!< \brief single-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, float, highp> float4x4; //!< \brief single-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1; //!< \brief double-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, double, highp> double2; //!< \brief double-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, double, highp> double3; //!< \brief double-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, double, highp> double4; //!< \brief double-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1x1; //!< \brief double-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, double, highp> double2x2; //!< \brief double-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, double, highp> double2x3; //!< \brief double-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, double, highp> double2x4; //!< \brief double-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, double, highp> double3x2; //!< \brief double-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, double, highp> double3x3; //!< \brief double-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, double, highp> double3x4; //!< \brief double-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, double, highp> double4x2; //!< \brief double-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, double, highp> double4x3; //!< \brief double-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, double, highp> double4x4; //!< \brief double-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + /// @} +}//namespace glm + +#include "compatibility.inl" diff --git a/include/glm/glm/gtx/compatibility.inl b/include/glm/glm/gtx/compatibility.inl new file mode 100644 index 00000000..1d49496b --- /dev/null +++ b/include/glm/glm/gtx/compatibility.inl @@ -0,0 +1,62 @@ +#include + +namespace glm +{ + // isfinite + template + GLM_FUNC_QUALIFIER bool isfinite( + genType const& x) + { +# if GLM_HAS_CXX11_STL + return std::isfinite(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_VC + return _finite(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID + return _isfinite(x) != 0; +# else + if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) + return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; + else + return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; +# endif + } + + template + GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite( + vec<1, T, Q> const& x) + { + return vec<1, bool, Q>( + isfinite(x.x)); + } + + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite( + vec<2, T, Q> const& x) + { + return vec<2, bool, Q>( + isfinite(x.x), + isfinite(x.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite( + vec<3, T, Q> const& x) + { + return vec<3, bool, Q>( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite( + vec<4, T, Q> const& x) + { + return vec<4, bool, Q>( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z), + isfinite(x.w)); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/component_wise.hpp b/include/glm/glm/gtx/component_wise.hpp new file mode 100644 index 00000000..34a2b0a3 --- /dev/null +++ b/include/glm/glm/gtx/component_wise.hpp @@ -0,0 +1,69 @@ +/// @ref gtx_component_wise +/// @file glm/gtx/component_wise.hpp +/// @date 2007-05-21 / 2011-06-07 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/// +/// @defgroup gtx_component_wise GLM_GTX_component_wise +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Operations between components of a type + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_component_wise is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_component_wise extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_component_wise + /// @{ + + /// Convert an integer vector to a normalized float vector. + /// If the parameter value type is already a floating qualifier type, the value is passed through. + /// @see gtx_component_wise + template + GLM_FUNC_DECL vec compNormalize(vec const& v); + + /// Convert a normalized float vector to an integer vector. + /// If the parameter value type is already a floating qualifier type, the value is passed through. + /// @see gtx_component_wise + template + GLM_FUNC_DECL vec compScale(vec const& v); + + /// Add all vector components together. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compAdd(genType const& v); + + /// Multiply all vector components together. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMul(genType const& v); + + /// Find the minimum value between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMin(genType const& v); + + /// Find the maximum value between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMax(genType const& v); + + /// @} +}//namespace glm + +#include "component_wise.inl" diff --git a/include/glm/glm/gtx/component_wise.inl b/include/glm/glm/gtx/component_wise.inl new file mode 100644 index 00000000..cbbc7d41 --- /dev/null +++ b/include/glm/glm/gtx/component_wise.inl @@ -0,0 +1,127 @@ +/// @ref gtx_component_wise + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_compNormalize + {}; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + floatType const Min = static_cast(std::numeric_limits::min()); + floatType const Max = static_cast(std::numeric_limits::max()); + return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); + } + }; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return vec(v) / static_cast(std::numeric_limits::max()); + } + }; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return v; + } + }; + + template + struct compute_compScale + {}; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + floatType const Max = static_cast(std::numeric_limits::max()) + static_cast(0.5); + vec const Scaled(v * Max); + vec const Result(Scaled - static_cast(0.5)); + return Result; + } + }; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return vec(vec(v) * static_cast(std::numeric_limits::max())); + } + }; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return v; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER vec compNormalize(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter"); + + return detail::compute_compNormalize::is_integer, std::numeric_limits::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER vec compScale(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter"); + + return detail::compute_compScale::is_integer, std::numeric_limits::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER T compAdd(vec const& v) + { + T Result(0); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result += v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMul(vec const& v) + { + T Result(1); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result *= v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMin(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = min(Result, v[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMax(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = max(Result, v[i]); + return Result; + } +}//namespace glm diff --git a/include/glm/glm/gtx/dual_quaternion.hpp b/include/glm/glm/gtx/dual_quaternion.hpp new file mode 100644 index 00000000..6a51ab7d --- /dev/null +++ b/include/glm/glm/gtx/dual_quaternion.hpp @@ -0,0 +1,274 @@ +/// @ref gtx_dual_quaternion +/// @file glm/gtx/dual_quaternion.hpp +/// @author Maksim Vorobiev (msomeone@gmail.com) +/// +/// @see core (dependence) +/// @see gtc_constants (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_dual_quaternion GLM_GTX_dual_quaternion +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines a templated dual-quaternion type and several dual-quaternion operations. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_dual_quaternion extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_dual_quaternion + /// @{ + + template + struct tdualquat + { + // -- Implementation detail -- + + typedef T value_type; + typedef qua part_type; + + // -- Data -- + + qua real, dual; + + // -- Component accesses -- + + typedef length_t length_type; + /// Return the count of components of a dual quaternion + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} + + GLM_FUNC_DECL part_type & operator[](length_type i); + GLM_FUNC_DECL part_type const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& orientation, vec<3, T, Q> const& translation); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real, qua const& dual); + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat const& q); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<2, 4, T, Q> const& holder_mat); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<3, 4, T, Q> const& aug_mat); + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; + + template + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); + template + GLM_FUNC_DECL tdualquat & operator*=(U s); + template + GLM_FUNC_DECL tdualquat & operator/=(U s); + }; + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator-(tdualquat const& q); + + // -- Binary operators -- + + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q, tdualquat const& p); + + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, tdualquat const& p); + + template + GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q); + + template + GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, T const& s); + + template + GLM_FUNC_DECL tdualquat operator*(T const& s, tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator/(tdualquat const& q, T const& s); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tdualquat const& q1, tdualquat const& q2); + + template + GLM_FUNC_DECL bool operator!=(tdualquat const& q1, tdualquat const& q2); + + /// Creates an identity dual quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dual_quat_identity(); + + /// Returns the normalized quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat normalize(tdualquat const& q); + + /// Returns the linear interpolation of two dual quaternion. + /// + /// @see gtc_dual_quaternion + template + GLM_FUNC_DECL tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a); + + /// Returns the q inverse. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat inverse(tdualquat const& q); + + /// Converts a quaternion to a 2 * 4 matrix. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x); + + /// Converts a quaternion to a 3 * 4 matrix. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x); + + /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<2, 4, T, Q> const& x); + + /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<3, 4, T, Q> const& x); + + + /// Dual-quaternion of low single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_dualquat; + + /// Dual-quaternion of medium single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_dualquat; + + /// Dual-quaternion of high single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_dualquat; + + + /// Dual-quaternion of low single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_fdualquat; + + /// Dual-quaternion of medium single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_fdualquat; + + /// Dual-quaternion of high single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_fdualquat; + + + /// Dual-quaternion of low double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_ddualquat; + + /// Dual-quaternion of medium double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_ddualquat; + + /// Dual-quaternion of high double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_ddualquat; + + +#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + /// Dual-quaternion of floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_fdualquat dualquat; + + /// Dual-quaternion of single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_fdualquat fdualquat; +#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef highp_fdualquat dualquat; + typedef highp_fdualquat fdualquat; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef mediump_fdualquat dualquat; + typedef mediump_fdualquat fdualquat; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) + typedef lowp_fdualquat dualquat; + typedef lowp_fdualquat fdualquat; +#else +# error "GLM error: multiple default precision requested for single-precision floating-point types" +#endif + + +#if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + /// Dual-quaternion of default double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_ddualquat ddualquat; +#elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef highp_ddualquat ddualquat; +#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef mediump_ddualquat ddualquat; +#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef lowp_ddualquat ddualquat; +#else +# error "GLM error: Multiple default precision requested for double-precision floating-point types" +#endif + + /// @} +} //namespace glm + +#include "dual_quaternion.inl" diff --git a/include/glm/glm/gtx/dual_quaternion.inl b/include/glm/glm/gtx/dual_quaternion.inl new file mode 100644 index 00000000..fad07ea8 --- /dev/null +++ b/include/glm/glm/gtx/dual_quaternion.inl @@ -0,0 +1,352 @@ +/// @ref gtx_dual_quaternion + +#include "../geometric.hpp" +#include + +namespace glm +{ + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } + + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type const& tdualquat::operator[](typename tdualquat::length_type i) const + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE + : real(qua()) + , dual(qua(0, 0, 0, 0)) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + : real(d.real) + , dual(d.dual) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + : real(d.real) + , dual(d.dual) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r) + : real(r), dual(qua(0, 0, 0, 0)) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& q, vec<3, T, Q> const& p) + : real(q), dual( + T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), + T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), + T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), + T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r, qua const& d) + : real(r), dual(d) + {} + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& q) + : real(q.real) + , dual(q.dual) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<2, 4, T, Q> const& m) + { + *this = dualquat_cast(m); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<3, 4, T, Q> const& m) + { + *this = dualquat_cast(m); + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + { + this->real = q.real; + this->dual = q.dual; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + { + this->real = q.real; + this->dual = q.dual; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) + { + this->real *= static_cast(s); + this->dual *= static_cast(s); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) + { + this->real /= static_cast(s); + this->dual /= static_cast(s); + return *this; + } + + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q) + { + return q; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const& q) + { + return tdualquat(-q.real, -q.dual); + } + + // -- Binary operators -- + + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q, tdualquat const& p) + { + return tdualquat(q.real + p.real,q.dual + p.dual); + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& p, tdualquat const& o) + { + return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v) + { + vec<3, T, Q> const real_v3(q.real.x,q.real.y,q.real.z); + vec<3, T, Q> const dual_v3(q.dual.x,q.dual.y,q.dual.z); + return (cross(real_v3, cross(real_v3,v) + v * q.real.w + dual_v3) + dual_v3 * q.real.w - real_v3 * q.dual.w) * T(2) + v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& q, T const& s) + { + return tdualquat(q.real * s, q.dual * s); + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(T const& s, tdualquat const& q) + { + return q * s; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator/(tdualquat const& q, T const& s) + { + return tdualquat(q.real / s, q.dual / s); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tdualquat const& q1, tdualquat const& q2) + { + return (q1.real == q2.real) && (q1.dual == q2.dual); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tdualquat const& q1, tdualquat const& q2) + { + return (q1.real != q2.real) || (q1.dual != q2.dual); + } + + // -- Operations -- + + template + GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() + { + return tdualquat( + qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), + qua(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); + } + + template + GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const& q) + { + return q / length(q.real); + } + + template + GLM_FUNC_QUALIFIER tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a) + { + // Dual Quaternion Linear blend aka DLB: + // Lerp is only defined in [0, 1] + assert(a >= static_cast(0)); + assert(a <= static_cast(1)); + T const k = dot(x.real,y.real) < static_cast(0) ? -a : a; + T const one(1); + return tdualquat(x * (one - a) + y * k); + } + + template + GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) + { + const glm::qua real = conjugate(q.real); + const glm::qua dual = conjugate(q.dual); + return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x) + { + return mat<2, 4, T, Q>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x) + { + qua r = x.real / length2(x.real); + + qua const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); + r *= static_cast(2); + + T const xy = r.x * x.real.y; + T const xz = r.x * x.real.z; + T const yz = r.y * x.real.z; + T const wx = r.w * x.real.x; + T const wy = r.w * x.real.y; + T const wz = r.w * x.real.z; + + vec<4, T, Q> const a( + rr.w + rr.x - rr.y - rr.z, + xy - wz, + xz + wy, + -(x.dual.w * r.x - x.dual.x * r.w + x.dual.y * r.z - x.dual.z * r.y)); + + vec<4, T, Q> const b( + xy + wz, + rr.w + rr.y - rr.x - rr.z, + yz - wx, + -(x.dual.w * r.y - x.dual.x * r.z - x.dual.y * r.w + x.dual.z * r.x)); + + vec<4, T, Q> const c( + xz - wy, + yz + wx, + rr.w + rr.z - rr.x - rr.y, + -(x.dual.w * r.z + x.dual.x * r.y - x.dual.y * r.x - x.dual.z * r.w)); + + return mat<3, 4, T, Q>(a, b, c); + } + + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) + { + return tdualquat( + qua( x[0].w, x[0].x, x[0].y, x[0].z ), + qua( x[1].w, x[1].x, x[1].y, x[1].z )); + } + + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, Q> const& x) + { + qua real; + + T const trace = x[0].x + x[1].y + x[2].z; + if(trace > static_cast(0)) + { + T const r = sqrt(T(1) + trace); + T const invr = static_cast(0.5) / r; + real.w = static_cast(0.5) * r; + real.x = (x[2].y - x[1].z) * invr; + real.y = (x[0].z - x[2].x) * invr; + real.z = (x[1].x - x[0].y) * invr; + } + else if(x[0].x > x[1].y && x[0].x > x[2].z) + { + T const r = sqrt(T(1) + x[0].x - x[1].y - x[2].z); + T const invr = static_cast(0.5) / r; + real.x = static_cast(0.5)*r; + real.y = (x[1].x + x[0].y) * invr; + real.z = (x[0].z + x[2].x) * invr; + real.w = (x[2].y - x[1].z) * invr; + } + else if(x[1].y > x[2].z) + { + T const r = sqrt(T(1) + x[1].y - x[0].x - x[2].z); + T const invr = static_cast(0.5) / r; + real.x = (x[1].x + x[0].y) * invr; + real.y = static_cast(0.5) * r; + real.z = (x[2].y + x[1].z) * invr; + real.w = (x[0].z - x[2].x) * invr; + } + else + { + T const r = sqrt(T(1) + x[2].z - x[0].x - x[1].y); + T const invr = static_cast(0.5) / r; + real.x = (x[0].z + x[2].x) * invr; + real.y = (x[2].y + x[1].z) * invr; + real.z = static_cast(0.5) * r; + real.w = (x[1].x - x[0].y) * invr; + } + + qua dual; + dual.x = static_cast(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); + dual.y = static_cast(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); + dual.z = static_cast(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); + dual.w = -static_cast(0.5) * ( x[0].w * real.x + x[1].w * real.y + x[2].w * real.z); + return tdualquat(real, dual); + } +}//namespace glm diff --git a/include/glm/glm/gtx/easing.hpp b/include/glm/glm/gtx/easing.hpp new file mode 100644 index 00000000..57f3d61b --- /dev/null +++ b/include/glm/glm/gtx/easing.hpp @@ -0,0 +1,219 @@ +/// @ref gtx_easing +/// @file glm/gtx/easing.hpp +/// @author Robert Chisholm +/// +/// @see core (dependence) +/// +/// @defgroup gtx_easing GLM_GTX_easing +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Easing functions for animations and transitons +/// All functions take a parameter x in the range [0.0,1.0] +/// +/// Based on the AHEasing project of Warren Moore (https://github.com/warrenm/AHEasing) + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_easing extension included") +# endif +#endif + +namespace glm{ + /// @addtogroup gtx_easing + /// @{ + + /// Modelled after the line y = x + /// @see gtx_easing + template + GLM_FUNC_DECL genType linearInterpolation(genType const & a); + + /// Modelled after the parabola y = x^2 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseIn(genType const & a); + + /// Modelled after the parabola y = -x^2 + 2x + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseOut(genType const & a); + + /// Modelled after the piecewise quadratic + /// y = (1/2)((2x)^2) ; [0, 0.5) + /// y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseInOut(genType const & a); + + /// Modelled after the cubic y = x^3 + template + GLM_FUNC_DECL genType cubicEaseIn(genType const & a); + + /// Modelled after the cubic y = (x - 1)^3 + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType cubicEaseOut(genType const & a); + + /// Modelled after the piecewise cubic + /// y = (1/2)((2x)^3) ; [0, 0.5) + /// y = (1/2)((2x-2)^3 + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType cubicEaseInOut(genType const & a); + + /// Modelled after the quartic x^4 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseIn(genType const & a); + + /// Modelled after the quartic y = 1 - (x - 1)^4 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseOut(genType const & a); + + /// Modelled after the piecewise quartic + /// y = (1/2)((2x)^4) ; [0, 0.5) + /// y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseInOut(genType const & a); + + /// Modelled after the quintic y = x^5 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseIn(genType const & a); + + /// Modelled after the quintic y = (x - 1)^5 + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseOut(genType const & a); + + /// Modelled after the piecewise quintic + /// y = (1/2)((2x)^5) ; [0, 0.5) + /// y = (1/2)((2x-2)^5 + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseInOut(genType const & a); + + /// Modelled after quarter-cycle of sine wave + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseIn(genType const & a); + + /// Modelled after quarter-cycle of sine wave (different phase) + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseOut(genType const & a); + + /// Modelled after half sine wave + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseInOut(genType const & a); + + /// Modelled after shifted quadrant IV of unit circle + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseIn(genType const & a); + + /// Modelled after shifted quadrant II of unit circle + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseOut(genType const & a); + + /// Modelled after the piecewise circular function + /// y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) + /// y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseInOut(genType const & a); + + /// Modelled after the exponential function y = 2^(10(x - 1)) + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseIn(genType const & a); + + /// Modelled after the exponential function y = -2^(-10x) + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseOut(genType const & a); + + /// Modelled after the piecewise exponential + /// y = (1/2)2^(10(2x - 1)) ; [0,0.5) + /// y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseInOut(genType const & a); + + /// Modelled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1)) + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseIn(genType const & a); + + /// Modelled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseOut(genType const & a); + + /// Modelled after the piecewise exponentially-damped sine wave: + /// y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) + /// y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseInOut(genType const & a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseIn(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseOut(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseInOut(genType const& a); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseInOut(genType const& a, genType const& o); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseIn(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseOut(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseInOut(genType const& a); + + /// @} +}//namespace glm + +#include "easing.inl" diff --git a/include/glm/glm/gtx/easing.inl b/include/glm/glm/gtx/easing.inl new file mode 100644 index 00000000..4b7d05b7 --- /dev/null +++ b/include/glm/glm/gtx/easing.inl @@ -0,0 +1,436 @@ +/// @ref gtx_easing + +#include + +namespace glm{ + + template + GLM_FUNC_QUALIFIER genType linearInterpolation(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a; + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a; + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return -(a * (a - static_cast(2))); + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(2) * a * a; + } + else + { + return (-static_cast(2) * a * a) + (4 * a) - one(); + } + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = a - one(); + return f * f * f + one(); + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if (a < static_cast(0.5)) + { + return static_cast(4) * a * a * a; + } + else + { + genType const f = ((static_cast(2) * a) - static_cast(2)); + return static_cast(0.5) * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = (a - one()); + return f * f * f * (one() - a) + one(); + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(8) * a * a * a * a; + } + else + { + genType const f = (a - one()); + return -static_cast(8) * f * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = (a - one()); + return f * f * f * f * f + one(); + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(16) * a * a * a * a * a; + } + else + { + genType const f = ((static_cast(2) * a) - static_cast(2)); + return static_cast(0.5) * f * f * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType sineEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sin((a - one()) * half_pi()) + one(); + } + + template + GLM_FUNC_QUALIFIER genType sineEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sin(a * half_pi()); + } + + template + GLM_FUNC_QUALIFIER genType sineEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return static_cast(0.5) * (one() - cos(a * pi())); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return one() - sqrt(one() - (a * a)); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sqrt((static_cast(2) - a) * a); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(0.5) * (one() - std::sqrt(one() - static_cast(4) * (a * a))); + } + else + { + return static_cast(0.5) * (std::sqrt(-((static_cast(2) * a) - static_cast(3)) * ((static_cast(2) * a) - one())) + one()); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a <= zero()) + return a; + else + { + genType const Complementary = a - one(); + genType const Two = static_cast(2); + + return glm::pow(Two, Complementary * static_cast(10)); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a >= one()) + return a; + else + { + return one() - glm::pow(static_cast(2), -static_cast(10) * a); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + return static_cast(0.5) * glm::pow(static_cast(2), (static_cast(20) * a) - static_cast(10)); + else + return -static_cast(0.5) * glm::pow(static_cast(2), (-static_cast(20) * a) + static_cast(10)) + one(); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return std::sin(static_cast(13) * half_pi() * a) * glm::pow(static_cast(2), static_cast(10) * (a - one())); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return std::sin(-static_cast(13) * half_pi() * (a + one())) * glm::pow(static_cast(2), -static_cast(10) * a) + one(); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + return static_cast(0.5) * std::sin(static_cast(13) * half_pi() * (static_cast(2) * a)) * glm::pow(static_cast(2), static_cast(10) * ((static_cast(2) * a) - one())); + else + return static_cast(0.5) * (std::sin(-static_cast(13) * half_pi() * ((static_cast(2) * a - one()) + one())) * glm::pow(static_cast(2), -static_cast(10) * (static_cast(2) * a - one())) + static_cast(2)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType z = ((o + one()) * a) - o; + return (a * a * z); + } + + template + GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType n = a - one(); + genType z = ((o + one()) * n) + o; + return (n * n * z) + one(); + } + + template + GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType s = o * static_cast(1.525); + genType x = static_cast(0.5); + genType n = a / static_cast(0.5); + + if (n < static_cast(1)) + { + genType z = ((s + static_cast(1)) * n) - s; + genType m = n * n * z; + return x * m; + } + else + { + n -= static_cast(2); + genType z = ((s + static_cast(1)) * n) + s; + genType m = (n*n*z) + static_cast(2); + return x * m; + } + } + + template + GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a) + { + return backEaseIn(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a) + { + return backEaseOut(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a) + { + return backEaseInOut(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(4.0 / 11.0)) + { + return (static_cast(121) * a * a) / static_cast(16); + } + else if(a < static_cast(8.0 / 11.0)) + { + return (static_cast(363.0 / 40.0) * a * a) - (static_cast(99.0 / 10.0) * a) + static_cast(17.0 / 5.0); + } + else if(a < static_cast(9.0 / 10.0)) + { + return (static_cast(4356.0 / 361.0) * a * a) - (static_cast(35442.0 / 1805.0) * a) + static_cast(16061.0 / 1805.0); + } + else + { + return (static_cast(54.0 / 5.0) * a * a) - (static_cast(513.0 / 25.0) * a) + static_cast(268.0 / 25.0); + } + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return one() - bounceEaseOut(one() - a); + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(0.5) * (one() - bounceEaseOut(a * static_cast(2))); + } + else + { + return static_cast(0.5) * bounceEaseOut(a * static_cast(2) - one()) + static_cast(0.5); + } + } + +}//namespace glm diff --git a/include/glm/glm/gtx/euler_angles.hpp b/include/glm/glm/gtx/euler_angles.hpp new file mode 100644 index 00000000..27236973 --- /dev/null +++ b/include/glm/glm/gtx/euler_angles.hpp @@ -0,0 +1,335 @@ +/// @ref gtx_euler_angles +/// @file glm/gtx/euler_angles.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_euler_angles GLM_GTX_euler_angles +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build matrices from Euler angles. +/// +/// Extraction of Euler angles from rotation matrix. +/// Based on the original paper 2014 Mike Day - Extracting Euler Angles from a Rotation Matrix. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_euler_angles is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_euler_angles extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_euler_angles + /// @{ + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleX( + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleY( + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZ( + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about X-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleX( + T const & angleX, T const & angularVelocityX); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Y-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleY( + T const & angleY, T const & angularVelocityY); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Z-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleZ( + T const & angleZ, T const & angularVelocityZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXY( + T const& angleX, + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYX( + T const& angleY, + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZ( + T const& angleX, + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZX( + T const& angle, + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZ( + T const& angleY, + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZY( + T const& angleZ, + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYZ( + T const& t1, + T const& t2, + T const& t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXZ( + T const& yaw, + T const& pitch, + T const& roll); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> yawPitchRoll( + T const& yaw, + T const& pitch, + T const& roll); + + /// Creates a 2D 2 * 2 rotation matrix from an euler angle. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> orientate2(T const& angle); + + /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> orientate3(T const& angle); + + /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<3, 3, T, Q> orientate3(vec<3, T, Q> const& angles); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientate4(vec<3, T, Q> const& angles); + + /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// @} +}//namespace glm + +#include "euler_angles.inl" diff --git a/include/glm/glm/gtx/euler_angles.inl b/include/glm/glm/gtx/euler_angles.inl new file mode 100644 index 00000000..68c50124 --- /dev/null +++ b/include/glm/glm/gtx/euler_angles.inl @@ -0,0 +1,899 @@ +/// @ref gtx_euler_angles + +#include "compatibility.hpp" // glm::atan2 + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleX + ( + T const& angleX + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + + return mat<4, 4, T, defaultp>( + T(1), T(0), T(0), T(0), + T(0), cosX, sinX, T(0), + T(0),-sinX, cosX, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleY + ( + T const& angleY + ) + { + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, T(0), -sinY, T(0), + T(0), T(1), T(0), T(0), + sinY, T(0), cosY, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZ + ( + T const& angleZ + ) + { + T cosZ = glm::cos(angleZ); + T sinZ = glm::sin(angleZ); + + return mat<4, 4, T, defaultp>( + cosZ, sinZ, T(0), T(0), + -sinZ, cosZ, T(0), T(0), + T(0), T(0), T(1), T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleX + ( + T const & angleX, + T const & angularVelocityX + ) + { + T cosX = glm::cos(angleX) * angularVelocityX; + T sinX = glm::sin(angleX) * angularVelocityX; + + return mat<4, 4, T, defaultp>( + T(0), T(0), T(0), T(0), + T(0),-sinX, cosX, T(0), + T(0),-cosX,-sinX, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleY + ( + T const & angleY, + T const & angularVelocityY + ) + { + T cosY = glm::cos(angleY) * angularVelocityY; + T sinY = glm::sin(angleY) * angularVelocityY; + + return mat<4, 4, T, defaultp>( + -sinY, T(0), -cosY, T(0), + T(0), T(0), T(0), T(0), + cosY, T(0), -sinY, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleZ + ( + T const & angleZ, + T const & angularVelocityZ + ) + { + T cosZ = glm::cos(angleZ) * angularVelocityZ; + T sinZ = glm::sin(angleZ) * angularVelocityZ; + + return mat<4, 4, T, defaultp>( + -sinZ, cosZ, T(0), T(0), + -cosZ, -sinZ, T(0), T(0), + T(0), T(0), T(0), T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXY + ( + T const& angleX, + T const& angleY + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, -sinX * -sinY, cosX * -sinY, T(0), + T(0), cosX, sinX, T(0), + sinY, -sinX * cosY, cosX * cosY, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYX + ( + T const& angleY, + T const& angleX + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, 0, -sinY, T(0), + sinY * sinX, cosX, cosY * sinX, T(0), + sinY * cosX, -sinX, cosY * cosX, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZ + ( + T const& angleX, + T const& angleZ + ) + { + return eulerAngleX(angleX) * eulerAngleZ(angleZ); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZX + ( + T const& angleZ, + T const& angleX + ) + { + return eulerAngleZ(angleZ) * eulerAngleX(angleX); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZ + ( + T const& angleY, + T const& angleZ + ) + { + return eulerAngleY(angleY) * eulerAngleZ(angleZ); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZY + ( + T const& angleZ, + T const& angleY + ) + { + return eulerAngleZ(angleZ) * eulerAngleY(angleY); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYZ + ( + T const& t1, + T const& t2, + T const& t3 + ) + { + T c1 = glm::cos(-t1); + T c2 = glm::cos(-t2); + T c3 = glm::cos(-t3); + T s1 = glm::sin(-t1); + T s2 = glm::sin(-t2); + T s3 = glm::sin(-t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2 * c3; + Result[0][1] =-c1 * s3 + s1 * s2 * c3; + Result[0][2] = s1 * s3 + c1 * s2 * c3; + Result[0][3] = static_cast(0); + Result[1][0] = c2 * s3; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] =-s1 * c3 + c1 * s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] =-s2; + Result[2][1] = s1 * c2; + Result[2][2] = c1 * c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXZ + ( + T const& yaw, + T const& pitch, + T const& roll + ) + { + T tmp_ch = glm::cos(yaw); + T tmp_sh = glm::sin(yaw); + T tmp_cp = glm::cos(pitch); + T tmp_sp = glm::sin(pitch); + T tmp_cb = glm::cos(roll); + T tmp_sb = glm::sin(roll); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = static_cast(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = static_cast(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = c1 * s2; + Result[0][2] = s1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s2; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c1 * s3 + c2 * c3 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = s2 * s3; + Result[2][1] =-c3 * s1 - c1 * c2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = s1 * s2; + Result[0][2] =-c1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] = s2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = c3 * s1 + c1 * c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s2; + Result[2][1] =-c1 * s3 - c2 * c3 * s1; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = s2* s3; + Result[0][2] =-c3 * s1 - c1 * c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s2; + Result[1][1] = c2; + Result[1][2] = c1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c2 * c3 * s1; + Result[2][1] =-c3 * s2; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c3 * s2; + Result[0][2] =-c1 * s3 - c2 * c3 * s1; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s2; + Result[1][1] = c2; + Result[1][2] = s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * c2 * s3; + Result[2][1] = s2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c1 * s3 + c2 * c3 * s1; + Result[0][2] =-c3 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s1 - c1 * c2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s2; + Result[2][1] = s1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = c3 * s1 + c1 * c2 * s3; + Result[0][2] = s2 *s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s3 - c2 * c3 * s1; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c3 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s2; + Result[2][1] =-c1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2 * c3; + Result[0][1] = s1 * s3 + c1 * c3 * s2; + Result[0][2] = c3 * s1 * s2 - c1 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-s2; + Result[1][1] = c1 * c2; + Result[1][2] = c2 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = c2 * s3; + Result[2][1] = c1 * s2 * s3 - c3 * s1; + Result[2][2] = c1 * c3 + s1 * s2 *s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = s2; + Result[0][2] =-c2 * s1; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s3 - c1 * c3 * s2; + Result[1][1] = c2 * c3; + Result[1][2] = c1 * s3 + c3 * s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * s2 * s3; + Result[2][1] =-c2 * s3; + Result[2][2] = c1 * c3 - s1 * s2 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = c2 * s1; + Result[0][2] =-s2; + Result[0][3] = static_cast(0); + Result[1][0] = c1 * s2 * s3 - c3 * s1; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] = c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s3 + c1 * c3 * s2; + Result[2][1] = c3 * s1 * s2 - c1 * s3; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - s1 * s2 * s3; + Result[0][1] = c3 * s1 + c1 * s2 * s3; + Result[0][2] =-c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c2 * s1; + Result[1][1] = c1 * c2; + Result[1][2] = s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c3 * s1 * s2; + Result[2][1] = s1 * s3 - c1 * c3 * s2; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> yawPitchRoll + ( + T const& yaw, + T const& pitch, + T const& roll + ) + { + T tmp_ch = glm::cos(yaw); + T tmp_sh = glm::sin(yaw); + T tmp_cp = glm::cos(pitch); + T tmp_sp = glm::sin(pitch); + T tmp_cb = glm::cos(roll); + T tmp_sb = glm::sin(roll); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = static_cast(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = static_cast(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> orientate2 + ( + T const& angle + ) + { + T c = glm::cos(angle); + T s = glm::sin(angle); + + mat<2, 2, T, defaultp> Result; + Result[0][0] = c; + Result[0][1] = s; + Result[1][0] = -s; + Result[1][1] = c; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> orientate3 + ( + T const& angle + ) + { + T c = glm::cos(angle); + T s = glm::sin(angle); + + mat<3, 3, T, defaultp> Result; + Result[0][0] = c; + Result[0][1] = s; + Result[0][2] = 0.0f; + Result[1][0] = -s; + Result[1][1] = c; + Result[1][2] = 0.0f; + Result[2][0] = 0.0f; + Result[2][1] = 0.0f; + Result[2][2] = 1.0f; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orientate3 + ( + vec<3, T, Q> const& angles + ) + { + return mat<3, 3, T, Q>(yawPitchRoll(angles.z, angles.x, angles.y)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientate4 + ( + vec<3, T, Q> const& angles + ) + { + return yawPitchRoll(angles.z, angles.x, angles.y); + } + + template + GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][1], M[2][2]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); + T T2 = glm::atan2(-M[2][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); + t1 = -T1; + t2 = -T2; + t3 = -T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], M[2][2]); + T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]); + T T2 = glm::atan2(-M[2][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][2], M[0][1]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], -M[0][2]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][0], M[1][2]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], -M[1][0]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][1], M[2][0]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], -M[2][1]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], M[1][1]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(-M[1][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[0][2], M[0][0]); + T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(M[0][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], M[0][0]); + T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(-M[0][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[1][0], M[1][1]); + T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(M[1][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } +}//namespace glm diff --git a/include/glm/glm/gtx/extend.hpp b/include/glm/glm/gtx/extend.hpp new file mode 100644 index 00000000..28b7c5c0 --- /dev/null +++ b/include/glm/glm/gtx/extend.hpp @@ -0,0 +1,42 @@ +/// @ref gtx_extend +/// @file glm/gtx/extend.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_extend GLM_GTX_extend +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extend a position from a source to a position at a defined length. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extend extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_extend + /// @{ + + /// Extends of Length the Origin position using the (Source - Origin) direction. + /// @see gtx_extend + template + GLM_FUNC_DECL genType extend( + genType const& Origin, + genType const& Source, + typename genType::value_type const Length); + + /// @} +}//namespace glm + +#include "extend.inl" diff --git a/include/glm/glm/gtx/extend.inl b/include/glm/glm/gtx/extend.inl new file mode 100644 index 00000000..32128eb2 --- /dev/null +++ b/include/glm/glm/gtx/extend.inl @@ -0,0 +1,48 @@ +/// @ref gtx_extend + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType extend + ( + genType const& Origin, + genType const& Source, + genType const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> extend + ( + vec<2, T, Q> const& Origin, + vec<2, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> extend + ( + vec<3, T, Q> const& Origin, + vec<3, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> extend + ( + vec<4, T, Q> const& Origin, + vec<4, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } +}//namespace glm diff --git a/include/glm/glm/gtx/extended_min_max.hpp b/include/glm/glm/gtx/extended_min_max.hpp new file mode 100644 index 00000000..025eda29 --- /dev/null +++ b/include/glm/glm/gtx/extended_min_max.hpp @@ -0,0 +1,137 @@ +/// @ref gtx_extended_min_max +/// @file glm/gtx/extended_min_max.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_extended_min_max GLM_GTX_extented_min_max +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Min and max functions for 3 to 4 parameters. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/vector_common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extented_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extented_min_max extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_extended_min_max + /// @{ + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T min( + T const& x, + T const& y, + T const& z); + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + typename C::T const& y, + typename C::T const& z); + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + C const& y, + C const& z); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T min( + T const& x, + T const& y, + T const& z, + T const& w); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + C const& y, + C const& z, + C const& w); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T max( + T const& x, + T const& y, + T const& z); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + typename C::T const& y, + typename C::T const& z); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + C const& y, + C const& z); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T max( + T const& x, + T const& y, + T const& z, + T const& w); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + C const& y, + C const& z, + C const& w); + + /// @} +}//namespace glm + +#include "extended_min_max.inl" diff --git a/include/glm/glm/gtx/extended_min_max.inl b/include/glm/glm/gtx/extended_min_max.inl new file mode 100644 index 00000000..de5998fa --- /dev/null +++ b/include/glm/glm/gtx/extended_min_max.inl @@ -0,0 +1,138 @@ +/// @ref gtx_extended_min_max + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T min( + T const& x, + T const& y, + T const& z) + { + return glm::min(glm::min(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + typename C::T const& y, + typename C::T const& z + ) + { + return glm::min(glm::min(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + C const& y, + C const& z + ) + { + return glm::min(glm::min(x, y), z); + } + + template + GLM_FUNC_QUALIFIER T min + ( + T const& x, + T const& y, + T const& z, + T const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + C const& y, + C const& z, + C const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template + GLM_FUNC_QUALIFIER T max( + T const& x, + T const& y, + T const& z) + { + return glm::max(glm::max(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + typename C::T const& y, + typename C::T const& z + ) + { + return glm::max(glm::max(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + C const& y, + C const& z + ) + { + return glm::max(glm::max(x, y), z); + } + + template + GLM_FUNC_QUALIFIER T max + ( + T const& x, + T const& y, + T const& z, + T const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + C const& y, + C const& z, + C const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/exterior_product.hpp b/include/glm/glm/gtx/exterior_product.hpp new file mode 100644 index 00000000..5522df78 --- /dev/null +++ b/include/glm/glm/gtx/exterior_product.hpp @@ -0,0 +1,45 @@ +/// @ref gtx_exterior_product +/// @file glm/gtx/exterior_product.hpp +/// +/// @see core (dependence) +/// @see gtx_exterior_product (dependence) +/// +/// @defgroup gtx_exterior_product GLM_GTX_exterior_product +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_exterior_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_exterior_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_exterior_product + /// @{ + + /// Returns the cross product of x and y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see Exterior product + template + GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); + + /// @} +} //namespace glm + +#include "exterior_product.inl" diff --git a/include/glm/glm/gtx/exterior_product.inl b/include/glm/glm/gtx/exterior_product.inl new file mode 100644 index 00000000..93661fd3 --- /dev/null +++ b/include/glm/glm/gtx/exterior_product.inl @@ -0,0 +1,26 @@ +/// @ref gtx_exterior_product + +#include + +namespace glm { +namespace detail +{ + template + struct compute_cross_vec2 + { + GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + + return v.x * u.y - u.x * v.y; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) + { + return detail::compute_cross_vec2::value>::call(x, y); + } +}//namespace glm + diff --git a/include/glm/glm/gtx/fast_exponential.hpp b/include/glm/glm/gtx/fast_exponential.hpp new file mode 100644 index 00000000..6fb72865 --- /dev/null +++ b/include/glm/glm/gtx/fast_exponential.hpp @@ -0,0 +1,95 @@ +/// @ref gtx_fast_exponential +/// @file glm/gtx/fast_exponential.hpp +/// +/// @see core (dependence) +/// @see gtx_half_float (dependence) +/// +/// @defgroup gtx_fast_exponential GLM_GTX_fast_exponential +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of exponential based functions. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_exponential extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_exponential + /// @{ + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL genType fastPow(genType x, genType y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastPow(vec const& x, vec const& y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastPow(vec const& x); + + /// Faster than the common exp function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastExp(T x); + + /// Faster than the common exp function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastExp(vec const& x); + + /// Faster than the common log function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastLog(T x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastLog(vec const& x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastExp2(T x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastExp2(vec const& x); + + /// Faster than the common log2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastLog2(T x); + + /// Faster than the common log2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastLog2(vec const& x); + + /// @} +}//namespace glm + +#include "fast_exponential.inl" diff --git a/include/glm/glm/gtx/fast_exponential.inl b/include/glm/glm/gtx/fast_exponential.inl new file mode 100644 index 00000000..f139e505 --- /dev/null +++ b/include/glm/glm/gtx/fast_exponential.inl @@ -0,0 +1,136 @@ +/// @ref gtx_fast_exponential + +namespace glm +{ + // fastPow: + template + GLM_FUNC_QUALIFIER genType fastPow(genType x, genType y) + { + return exp(y * log(x)); + } + + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + { + return exp(y * log(x)); + } + + template + GLM_FUNC_QUALIFIER T fastPow(T x, int y) + { + T f = static_cast(1); + for(int i = 0; i < y; ++i) + f *= x; + return f; + } + + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = x.length(); i < n; ++i) + Result[i] = fastPow(x[i], y[i]); + return Result; + } + + // fastExp + // Note: This function provides accurate results only for value between -1 and 1, else avoid it. + template + GLM_FUNC_QUALIFIER T fastExp(T x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + T x2 = x * x; + T x3 = x2 * x; + T x4 = x3 * x; + T x5 = x4 * x; + return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); + } + /* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance + GLM_FUNC_QUALIFIER float fastExp(float x) + { + const float e = 2.718281828f; + const float IntegerPart = floor(x); + const float FloatPart = x - IntegerPart; + float z = 1.f; + + for(int i = 0; i < int(IntegerPart); ++i) + z *= e; + + const float x2 = FloatPart * FloatPart; + const float x3 = x2 * FloatPart; + const float x4 = x3 * FloatPart; + const float x5 = x4 * FloatPart; + return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); + } + + // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers + GLM_FUNC_QUALIFIER float fastExp(float x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + float x2 = x * x; + float x3 = x2 * x; + float x4 = x3 * x; + float x5 = x4 * x; + float x6 = x5 * x; + float x7 = x6 * x; + float x8 = x7 * x; + return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; + } + */ + + template + GLM_FUNC_QUALIFIER vec fastExp(vec const& x) + { + return detail::functor1::call(fastExp, x); + } + + // fastLog + template + GLM_FUNC_QUALIFIER genType fastLog(genType x) + { + return std::log(x); + } + + /* Slower than the VC7.1 function... + GLM_FUNC_QUALIFIER float fastLog(float x) + { + float y1 = (x - 1.0f) / (x + 1.0f); + float y2 = y1 * y1; + return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); + } + */ + + template + GLM_FUNC_QUALIFIER vec fastLog(vec const& x) + { + return detail::functor1::call(fastLog, x); + } + + //fastExp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType fastExp2(genType x) + { + return fastExp(0.69314718055994530941723212145818f * x); + } + + template + GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) + { + return detail::functor1::call(fastExp2, x); + } + + // fastLog2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType fastLog2(genType x) + { + return fastLog(x) / 0.69314718055994530941723212145818f; + } + + template + GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) + { + return detail::functor1::call(fastLog2, x); + } +}//namespace glm diff --git a/include/glm/glm/gtx/fast_square_root.hpp b/include/glm/glm/gtx/fast_square_root.hpp new file mode 100644 index 00000000..9fb3f2fc --- /dev/null +++ b/include/glm/glm/gtx/fast_square_root.hpp @@ -0,0 +1,92 @@ +/// @ref gtx_fast_square_root +/// @file glm/gtx/fast_square_root.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_fast_square_root GLM_GTX_fast_square_root +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of square root based functions. +/// - Sqrt optimisation based on Newton's method, +/// www.gamedev.net/community/forums/topic.asp?topic id=139956 + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../exponential.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_square_root is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_square_root extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_square_root + /// @{ + + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastSqrt(genType x); + + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastSqrt(vec const& x); + + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastInverseSqrt(genType x); + + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastInverseSqrt(vec const& x); + + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastLength(genType x); + + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL T fastLength(vec const& x); + + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastDistance(genType x, genType y); + + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL T fastDistance(vec const& x, vec const& y); + + /// Faster than the common normalize function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastNormalize(genType const& x); + + /// @} +}// namespace glm + +#include "fast_square_root.inl" diff --git a/include/glm/glm/gtx/fast_square_root.inl b/include/glm/glm/gtx/fast_square_root.inl new file mode 100644 index 00000000..4e6c6de9 --- /dev/null +++ b/include/glm/glm/gtx/fast_square_root.inl @@ -0,0 +1,75 @@ +/// @ref gtx_fast_square_root + +namespace glm +{ + // fastSqrt + template + GLM_FUNC_QUALIFIER genType fastSqrt(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastSqrt' only accept floating-point input"); + + return genType(1) / fastInverseSqrt(x); + } + + template + GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) + { + return detail::functor1::call(fastSqrt, x); + } + + // fastInversesqrt + template + GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) + { + return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec fastInverseSqrt(vec const& x) + { + return detail::compute_inversesqrt::value>::call(x); + } + + // fastLength + template + GLM_FUNC_QUALIFIER genType fastLength(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + + return abs(x); + } + + template + GLM_FUNC_QUALIFIER T fastLength(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + + return fastSqrt(dot(x, x)); + } + + // fastDistance + template + GLM_FUNC_QUALIFIER genType fastDistance(genType x, genType y) + { + return fastLength(y - x); + } + + template + GLM_FUNC_QUALIFIER T fastDistance(vec const& x, vec const& y) + { + return fastLength(y - x); + } + + // fastNormalize + template + GLM_FUNC_QUALIFIER genType fastNormalize(genType x) + { + return x > genType(0) ? genType(1) : -genType(1); + } + + template + GLM_FUNC_QUALIFIER vec fastNormalize(vec const& x) + { + return x * fastInverseSqrt(dot(x, x)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/fast_trigonometry.hpp b/include/glm/glm/gtx/fast_trigonometry.hpp new file mode 100644 index 00000000..2650d6e4 --- /dev/null +++ b/include/glm/glm/gtx/fast_trigonometry.hpp @@ -0,0 +1,79 @@ +/// @ref gtx_fast_trigonometry +/// @file glm/gtx/fast_trigonometry.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of trigonometric functions. + +#pragma once + +// Dependency: +#include "../gtc/constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_trigonometry + /// @{ + + /// Wrap an angle to [0 2pi[ + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T wrapAngle(T angle); + + /// Faster than the common sin function but less accurate. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastSin(T angle); + + /// Faster than the common cos function but less accurate. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastCos(T angle); + + /// Faster than the common tan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastTan(T angle); + + /// Faster than the common asin function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAsin(T angle); + + /// Faster than the common acos function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAcos(T angle); + + /// Faster than the common atan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAtan(T y, T x); + + /// Faster than the common atan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAtan(T angle); + + /// @} +}//namespace glm + +#include "fast_trigonometry.inl" diff --git a/include/glm/glm/gtx/fast_trigonometry.inl b/include/glm/glm/gtx/fast_trigonometry.inl new file mode 100644 index 00000000..1a710cbc --- /dev/null +++ b/include/glm/glm/gtx/fast_trigonometry.inl @@ -0,0 +1,142 @@ +/// @ref gtx_fast_trigonometry + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER vec taylorCos(vec const& x) + { + return static_cast(1) + - (x * x) * (1.f / 2.f) + + ((x * x) * (x * x)) * (1.f / 24.f) + - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f) + + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f); + } + + template + GLM_FUNC_QUALIFIER T cos_52s(T x) + { + T const xx(x * x); + return (T(0.9999932946) + xx * (T(-0.4999124376) + xx * (T(0.0414877472) + xx * T(-0.0012712095)))); + } + + template + GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) + { + return detail::functor1::call(cos_52s, x); + } +}//namespace detail + + // wrapAngle + template + GLM_FUNC_QUALIFIER T wrapAngle(T angle) + { + return abs(mod(angle, two_pi())); + } + + template + GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) + { + return detail::functor1::call(wrapAngle, x); + } + + // cos + template + GLM_FUNC_QUALIFIER T fastCos(T x) + { + T const angle(wrapAngle(x)); + + if(angle < half_pi()) + return detail::cos_52s(angle); + if(angle < pi()) + return -detail::cos_52s(pi() - angle); + if(angle < (T(3) * half_pi())) + return -detail::cos_52s(angle - pi()); + + return detail::cos_52s(two_pi() - angle); + } + + template + GLM_FUNC_QUALIFIER vec fastCos(vec const& x) + { + return detail::functor1::call(fastCos, x); + } + + // sin + template + GLM_FUNC_QUALIFIER T fastSin(T x) + { + return fastCos(half_pi() - x); + } + + template + GLM_FUNC_QUALIFIER vec fastSin(vec const& x) + { + return detail::functor1::call(fastSin, x); + } + + // tan + template + GLM_FUNC_QUALIFIER T fastTan(T x) + { + return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); + } + + template + GLM_FUNC_QUALIFIER vec fastTan(vec const& x) + { + return detail::functor1::call(fastTan, x); + } + + // asin + template + GLM_FUNC_QUALIFIER T fastAsin(T x) + { + return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); + } + + template + GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) + { + return detail::functor1::call(fastAsin, x); + } + + // acos + template + GLM_FUNC_QUALIFIER T fastAcos(T x) + { + return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) + } + + template + GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) + { + return detail::functor1::call(fastAcos, x); + } + + // atan + template + GLM_FUNC_QUALIFIER T fastAtan(T y, T x) + { + T sgn = sign(y) * sign(x); + return abs(fastAtan(y / x)) * sgn; + } + + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) + { + return detail::functor2::call(fastAtan, y, x); + } + + template + GLM_FUNC_QUALIFIER T fastAtan(T x) + { + return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); + } + + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) + { + return detail::functor1::call(fastAtan, x); + } +}//namespace glm diff --git a/include/glm/glm/gtx/float_notmalize.inl b/include/glm/glm/gtx/float_notmalize.inl new file mode 100644 index 00000000..8cdbc5aa --- /dev/null +++ b/include/glm/glm/gtx/float_notmalize.inl @@ -0,0 +1,13 @@ +/// @ref gtx_float_normalize + +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) + { + return vec(v) / static_cast(std::numeric_limits::max()); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/functions.hpp b/include/glm/glm/gtx/functions.hpp new file mode 100644 index 00000000..9f4166c4 --- /dev/null +++ b/include/glm/glm/gtx/functions.hpp @@ -0,0 +1,56 @@ +/// @ref gtx_functions +/// @file glm/gtx/functions.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_functions GLM_GTX_functions +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// List of useful common functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/type_vec2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_functions is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_functions extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_functions + /// @{ + + /// 1D gauss function + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL T gauss( + T x, + T ExpectedValue, + T StandardDeviation); + + /// 2D gauss function + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL T gauss( + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation); + + /// @} +}//namespace glm + +#include "functions.inl" + diff --git a/include/glm/glm/gtx/functions.inl b/include/glm/glm/gtx/functions.inl new file mode 100644 index 00000000..29cbb20b --- /dev/null +++ b/include/glm/glm/gtx/functions.inl @@ -0,0 +1,30 @@ +/// @ref gtx_functions + +#include "../exponential.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T gauss + ( + T x, + T ExpectedValue, + T StandardDeviation + ) + { + return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); + } + + template + GLM_FUNC_QUALIFIER T gauss + ( + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation + ) + { + vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); + return exp(-(Squared.x + Squared.y)); + } +}//namespace glm + diff --git a/include/glm/glm/gtx/gradient_paint.hpp b/include/glm/glm/gtx/gradient_paint.hpp new file mode 100644 index 00000000..6f85bf48 --- /dev/null +++ b/include/glm/glm/gtx/gradient_paint.hpp @@ -0,0 +1,53 @@ +/// @ref gtx_gradient_paint +/// @file glm/gtx/gradient_paint.hpp +/// +/// @see core (dependence) +/// @see gtx_optimum_pow (dependence) +/// +/// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions that return the color of procedural gradient for specific coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_gradient_paint extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_gradient_paint + /// @{ + + /// Return a color from a radial gradient. + /// @see - gtx_gradient_paint + template + GLM_FUNC_DECL T radialGradient( + vec<2, T, Q> const& Center, + T const& Radius, + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position); + + /// Return a color from a linear gradient. + /// @see - gtx_gradient_paint + template + GLM_FUNC_DECL T linearGradient( + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position); + + /// @} +}// namespace glm + +#include "gradient_paint.inl" diff --git a/include/glm/glm/gtx/gradient_paint.inl b/include/glm/glm/gtx/gradient_paint.inl new file mode 100644 index 00000000..4c495e62 --- /dev/null +++ b/include/glm/glm/gtx/gradient_paint.inl @@ -0,0 +1,36 @@ +/// @ref gtx_gradient_paint + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T radialGradient + ( + vec<2, T, Q> const& Center, + T const& Radius, + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position + ) + { + vec<2, T, Q> F = Focal - Center; + vec<2, T, Q> D = Position - Focal; + T Radius2 = pow2(Radius); + T Fx2 = pow2(F.x); + T Fy2 = pow2(F.y); + + T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); + T Denominator = Radius2 - (Fx2 + Fy2); + return Numerator / Denominator; + } + + template + GLM_FUNC_QUALIFIER T linearGradient + ( + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position + ) + { + vec<2, T, Q> Dist = Point1 - Point0; + return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); + } +}//namespace glm diff --git a/include/glm/glm/gtx/handed_coordinate_space.hpp b/include/glm/glm/gtx/handed_coordinate_space.hpp new file mode 100644 index 00000000..3c859689 --- /dev/null +++ b/include/glm/glm/gtx/handed_coordinate_space.hpp @@ -0,0 +1,50 @@ +/// @ref gtx_handed_coordinate_space +/// @file glm/gtx/handed_coordinate_space.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// To know if a set of three basis vectors defines a right or left-handed coordinate system. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_handed_coordinate_space + /// @{ + + //! Return if a trihedron right handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + GLM_FUNC_DECL bool rightHanded( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); + + //! Return if a trihedron left handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + GLM_FUNC_DECL bool leftHanded( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); + + /// @} +}// namespace glm + +#include "handed_coordinate_space.inl" diff --git a/include/glm/glm/gtx/handed_coordinate_space.inl b/include/glm/glm/gtx/handed_coordinate_space.inl new file mode 100644 index 00000000..e43c17bd --- /dev/null +++ b/include/glm/glm/gtx/handed_coordinate_space.inl @@ -0,0 +1,26 @@ +/// @ref gtx_handed_coordinate_space + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool rightHanded + ( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal + ) + { + return dot(cross(normal, tangent), binormal) > T(0); + } + + template + GLM_FUNC_QUALIFIER bool leftHanded + ( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal + ) + { + return dot(cross(normal, tangent), binormal) < T(0); + } +}//namespace glm diff --git a/include/glm/glm/gtx/hash.hpp b/include/glm/glm/gtx/hash.hpp new file mode 100644 index 00000000..05dae9f4 --- /dev/null +++ b/include/glm/glm/gtx/hash.hpp @@ -0,0 +1,142 @@ +/// @ref gtx_hash +/// @file glm/gtx/hash.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_hash GLM_GTX_hash +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add std::hash support for glm types + +#pragma once + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_hash is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_hash extension included") +# endif +#endif + +#include + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../gtc/vec1.hpp" + +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" + +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" + +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" + +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" + +#if !GLM_HAS_CXX11_STL +# error "GLM_GTX_hash requires C++11 standard library support" +#endif + +namespace std +{ + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const; + }; + + template + struct hash> + { + GLM_FUNC_DECL size_t operator()(glm::qua const& q) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const; + }; +} // namespace std + +#include "hash.inl" diff --git a/include/glm/glm/gtx/hash.inl b/include/glm/glm/gtx/hash.inl new file mode 100644 index 00000000..ff71ca9f --- /dev/null +++ b/include/glm/glm/gtx/hash.inl @@ -0,0 +1,184 @@ +/// @ref gtx_hash +/// +/// @see core (dependence) +/// +/// @defgroup gtx_hash GLM_GTX_hash +/// @ingroup gtx +/// +/// @brief Add std::hash support for glm types +/// +/// need to be included to use the features of this extension. + +namespace glm { +namespace detail +{ + GLM_INLINE void hash_combine(size_t &seed, size_t hash) + { + hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= hash; + } +}} + +namespace std +{ + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, Q> const& v) const + { + hash hasher; + return hasher(v.x); + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, Q> const& v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, Q> const& v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, Q> const& v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + glm::detail::hash_combine(seed, hasher(v.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::qua const& q) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(q.x)); + glm::detail::hash_combine(seed, hasher(q.y)); + glm::detail::hash_combine(seed, hasher(q.z)); + glm::detail::hash_combine(seed, hasher(q.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(q.real)); + glm::detail::hash_combine(seed, hasher(q.dual)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 3, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 4, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 2, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 2, T,Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 3, T,Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, Q> const& m) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } +} diff --git a/include/glm/glm/gtx/integer.hpp b/include/glm/glm/gtx/integer.hpp new file mode 100644 index 00000000..d0b4c61a --- /dev/null +++ b/include/glm/glm/gtx/integer.hpp @@ -0,0 +1,76 @@ +/// @ref gtx_integer +/// @file glm/gtx/integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_integer GLM_GTX_integer +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add support for integer for core functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/integer.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_integer extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_integer + /// @{ + + //! Returns x raised to the y power. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int pow(int x, uint y); + + //! Returns the positive square root of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int sqrt(int x); + + //! Returns the floor log2 of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int mod(int x, int y); + + //! Return the factorial value of a number (!12 max, integer only) + //! From GLM_GTX_integer extension. + template + GLM_FUNC_DECL genType factorial(genType const& x); + + //! 32bit signed integer. + //! From GLM_GTX_integer extension. + typedef signed int sint; + + //! Returns x raised to the y power. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint pow(uint x, uint y); + + //! Returns the positive square root of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint sqrt(uint x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint mod(uint x, uint y); + + //! Returns the number of leading zeros. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint nlz(uint x); + + /// @} +}//namespace glm + +#include "integer.inl" diff --git a/include/glm/glm/gtx/integer.inl b/include/glm/glm/gtx/integer.inl new file mode 100644 index 00000000..956366b2 --- /dev/null +++ b/include/glm/glm/gtx/integer.inl @@ -0,0 +1,185 @@ +/// @ref gtx_integer + +namespace glm +{ + // pow + GLM_FUNC_QUALIFIER int pow(int x, uint y) + { + if(y == 0) + return x >= 0 ? 1 : -1; + + int result = x; + for(uint i = 1; i < y; ++i) + result *= x; + return result; + } + + // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 + GLM_FUNC_QUALIFIER int sqrt(int x) + { + if(x <= 1) return x; + + int NextTrial = x >> 1; + int CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; + } + +// Henry Gordon Dietz: http://aggregate.org/MAGIC/ +namespace detail +{ + GLM_FUNC_QUALIFIER unsigned int ones32(unsigned int x) + { + /* 32-bit recursive reduction using SWAR... + but first step is mapping 2-bit values + into sum of 2 1-bit values in sneaky way + */ + x -= ((x >> 1) & 0x55555555); + x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); + x = (((x >> 4) + x) & 0x0f0f0f0f); + x += (x >> 8); + x += (x >> 16); + return(x & 0x0000003f); + } +}//namespace detail + + // Henry Gordon Dietz: http://aggregate.org/MAGIC/ +/* + GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x) + { + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + + return _detail::ones32(x) >> 1; + } +*/ + // mod + GLM_FUNC_QUALIFIER int mod(int x, int y) + { + return ((x % y) + y) % y; + } + + // factorial (!12 max, integer only) + template + GLM_FUNC_QUALIFIER genType factorial(genType const& x) + { + genType Temp = x; + genType Result; + for(Result = 1; Temp > 1; --Temp) + Result *= Temp; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> factorial( + vec<2, T, Q> const& x) + { + return vec<2, T, Q>( + factorial(x.x), + factorial(x.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> factorial( + vec<3, T, Q> const& x) + { + return vec<3, T, Q>( + factorial(x.x), + factorial(x.y), + factorial(x.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> factorial( + vec<4, T, Q> const& x) + { + return vec<4, T, Q>( + factorial(x.x), + factorial(x.y), + factorial(x.z), + factorial(x.w)); + } + + GLM_FUNC_QUALIFIER uint pow(uint x, uint y) + { + if (y == 0) + return 1u; + + uint result = x; + for(uint i = 1; i < y; ++i) + result *= x; + return result; + } + + GLM_FUNC_QUALIFIER uint sqrt(uint x) + { + if(x <= 1) return x; + + uint NextTrial = x >> 1; + uint CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; + } + + GLM_FUNC_QUALIFIER uint mod(uint x, uint y) + { + return x - y * (x / y); + } + +#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) + + GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) + { + return 31u - findMSB(x); + } + +#else + + // Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt + GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) + { + int y, m, n; + + y = -int(x >> 16); // If left half of x is 0, + m = (y >> 16) & 16; // set n = 16. If left half + n = 16 - m; // is nonzero, set n = 0 and + x = x >> m; // shift x right 16. + // Now x is of the form 0000xxxx. + y = x - 0x100; // If positions 8-15 are 0, + m = (y >> 16) & 8; // add 8 to n and shift x left 8. + n = n + m; + x = x << m; + + y = x - 0x1000; // If positions 12-15 are 0, + m = (y >> 16) & 4; // add 4 to n and shift x left 4. + n = n + m; + x = x << m; + + y = x - 0x4000; // If positions 14-15 are 0, + m = (y >> 16) & 2; // add 2 to n and shift x left 2. + n = n + m; + x = x << m; + + y = x >> 14; // Set y = 0, 1, 2, or 3. + m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. + return unsigned(n + 2 - m); + } + +#endif//(GLM_COMPILER) + +}//namespace glm diff --git a/include/glm/glm/gtx/intersect.hpp b/include/glm/glm/gtx/intersect.hpp new file mode 100644 index 00000000..3c78f2b8 --- /dev/null +++ b/include/glm/glm/gtx/intersect.hpp @@ -0,0 +1,92 @@ +/// @ref gtx_intersect +/// @file glm/gtx/intersect.hpp +/// +/// @see core (dependence) +/// @see gtx_closest_point (dependence) +/// +/// @defgroup gtx_intersect GLM_GTX_intersect +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add intersection functions + +#pragma once + +// Dependency: +#include +#include +#include "../glm.hpp" +#include "../geometric.hpp" +#include "../gtx/closest_point.hpp" +#include "../gtx/vector_query.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_closest_point extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_intersect + /// @{ + + //! Compute the intersection of a ray and a plane. + //! Ray direction and plane normal must be unit length. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRayPlane( + genType const& orig, genType const& dir, + genType const& planeOrig, genType const& planeNormal, + typename genType::value_type & intersectionDistance); + + //! Compute the intersection of a ray and a triangle. + /// Based om Tomas Möller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/ + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRayTriangle( + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, vec<3, T, Q> const& v2, + vec<2, T, Q>& baryPosition, T& distance); + + //! Compute the intersection of a line and a triangle. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectLineTriangle( + genType const& orig, genType const& dir, + genType const& vert0, genType const& vert1, genType const& vert2, + genType & position); + + //! Compute the intersection distance of a ray and a sphere. + //! The ray direction vector is unit length. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRaySphere( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, typename genType::value_type const sphereRadiusSquered, + typename genType::value_type & intersectionDistance); + + //! Compute the intersection of a ray and a sphere. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRaySphere( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadius, + genType & intersectionPosition, genType & intersectionNormal); + + //! Compute the intersection of a line and a sphere. + //! From GLM_GTX_intersect extension + template + GLM_FUNC_DECL bool intersectLineSphere( + genType const& point0, genType const& point1, + genType const& sphereCenter, typename genType::value_type sphereRadius, + genType & intersectionPosition1, genType & intersectionNormal1, + genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType()); + + /// @} +}//namespace glm + +#include "intersect.inl" diff --git a/include/glm/glm/gtx/intersect.inl b/include/glm/glm/gtx/intersect.inl new file mode 100644 index 00000000..54ecb4d9 --- /dev/null +++ b/include/glm/glm/gtx/intersect.inl @@ -0,0 +1,200 @@ +/// @ref gtx_intersect + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool intersectRayPlane + ( + genType const& orig, genType const& dir, + genType const& planeOrig, genType const& planeNormal, + typename genType::value_type & intersectionDistance + ) + { + typename genType::value_type d = glm::dot(dir, planeNormal); + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + if(glm::abs(d) > Epsilon) // if dir and planeNormal are not perpendicular + { + typename genType::value_type const tmp_intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; + if (tmp_intersectionDistance > static_cast(0)) { // allow only intersections + intersectionDistance = tmp_intersectionDistance; + return true; + } + } + + return false; + } + + template + GLM_FUNC_QUALIFIER bool intersectRayTriangle + ( + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& vert0, vec<3, T, Q> const& vert1, vec<3, T, Q> const& vert2, + vec<2, T, Q>& baryPosition, T& distance + ) + { + // find vectors for two edges sharing vert0 + vec<3, T, Q> const edge1 = vert1 - vert0; + vec<3, T, Q> const edge2 = vert2 - vert0; + + // begin calculating determinant - also used to calculate U parameter + vec<3, T, Q> const p = glm::cross(dir, edge2); + + // if determinant is near zero, ray lies in plane of triangle + T const det = glm::dot(edge1, p); + + vec<3, T, Q> Perpendicular(0); + + if(det > std::numeric_limits::epsilon()) + { + // calculate distance from vert0 to ray origin + vec<3, T, Q> const dist = orig - vert0; + + // calculate U parameter and test bounds + baryPosition.x = glm::dot(dist, p); + if(baryPosition.x < static_cast(0) || baryPosition.x > det) + return false; + + // prepare to test V parameter + Perpendicular = glm::cross(dist, edge1); + + // calculate V parameter and test bounds + baryPosition.y = glm::dot(dir, Perpendicular); + if((baryPosition.y < static_cast(0)) || ((baryPosition.x + baryPosition.y) > det)) + return false; + } + else if(det < -std::numeric_limits::epsilon()) + { + // calculate distance from vert0 to ray origin + vec<3, T, Q> const dist = orig - vert0; + + // calculate U parameter and test bounds + baryPosition.x = glm::dot(dist, p); + if((baryPosition.x > static_cast(0)) || (baryPosition.x < det)) + return false; + + // prepare to test V parameter + Perpendicular = glm::cross(dist, edge1); + + // calculate V parameter and test bounds + baryPosition.y = glm::dot(dir, Perpendicular); + if((baryPosition.y > static_cast(0)) || (baryPosition.x + baryPosition.y < det)) + return false; + } + else + return false; // ray is parallel to the plane of the triangle + + T inv_det = static_cast(1) / det; + + // calculate distance, ray intersects triangle + distance = glm::dot(edge2, Perpendicular) * inv_det; + baryPosition *= inv_det; + + return true; + } + + template + GLM_FUNC_QUALIFIER bool intersectLineTriangle + ( + genType const& orig, genType const& dir, + genType const& vert0, genType const& vert1, genType const& vert2, + genType & position + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + genType edge1 = vert1 - vert0; + genType edge2 = vert2 - vert0; + + genType Perpendicular = cross(dir, edge2); + + float det = dot(edge1, Perpendicular); + + if (det > -Epsilon && det < Epsilon) + return false; + typename genType::value_type inv_det = typename genType::value_type(1) / det; + + genType Tengant = orig - vert0; + + position.y = dot(Tengant, Perpendicular) * inv_det; + if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) + return false; + + genType Cotengant = cross(Tengant, edge1); + + position.z = dot(dir, Cotengant) * inv_det; + if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) + return false; + + position.x = dot(edge2, Cotengant) * inv_det; + + return true; + } + + template + GLM_FUNC_QUALIFIER bool intersectRaySphere + ( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadiusSquered, + typename genType::value_type & intersectionDistance + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + genType diff = sphereCenter - rayStarting; + typename genType::value_type t0 = dot(diff, rayNormalizedDirection); + typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; + if( dSquared > sphereRadiusSquered ) + { + return false; + } + typename genType::value_type t1 = sqrt( sphereRadiusSquered - dSquared ); + intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1; + return intersectionDistance > Epsilon; + } + + template + GLM_FUNC_QUALIFIER bool intersectRaySphere + ( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadius, + genType & intersectionPosition, genType & intersectionNormal + ) + { + typename genType::value_type distance; + if( intersectRaySphere( rayStarting, rayNormalizedDirection, sphereCenter, sphereRadius * sphereRadius, distance ) ) + { + intersectionPosition = rayStarting + rayNormalizedDirection * distance; + intersectionNormal = (intersectionPosition - sphereCenter) / sphereRadius; + return true; + } + return false; + } + + template + GLM_FUNC_QUALIFIER bool intersectLineSphere + ( + genType const& point0, genType const& point1, + genType const& sphereCenter, typename genType::value_type sphereRadius, + genType & intersectionPoint1, genType & intersectionNormal1, + genType & intersectionPoint2, genType & intersectionNormal2 + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + genType dir = normalize(point1 - point0); + genType diff = sphereCenter - point0; + typename genType::value_type t0 = dot(diff, dir); + typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; + if( dSquared > sphereRadius * sphereRadius ) + { + return false; + } + typename genType::value_type t1 = sqrt( sphereRadius * sphereRadius - dSquared ); + if( t0 < t1 + Epsilon ) + t1 = -t1; + intersectionPoint1 = point0 + dir * (t0 - t1); + intersectionNormal1 = (intersectionPoint1 - sphereCenter) / sphereRadius; + intersectionPoint2 = point0 + dir * (t0 + t1); + intersectionNormal2 = (intersectionPoint2 - sphereCenter) / sphereRadius; + return true; + } +}//namespace glm diff --git a/include/glm/glm/gtx/io.hpp b/include/glm/glm/gtx/io.hpp new file mode 100644 index 00000000..8d974f00 --- /dev/null +++ b/include/glm/glm/gtx/io.hpp @@ -0,0 +1,201 @@ +/// @ref gtx_io +/// @file glm/gtx/io.hpp +/// @author Jan P Springer (regnirpsj@gmail.com) +/// +/// @see core (dependence) +/// @see gtc_matrix_access (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_io GLM_GTX_io +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// std::[w]ostream support for glm types +/// +/// std::[w]ostream support for glm types + qualifier/width/etc. manipulators +/// based on howard hinnant's std::chrono io proposal +/// [http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html] + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_io is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_io extension included") +# endif +#endif + +#include // std::basic_ostream<> (fwd) +#include // std::locale, std::locale::facet, std::locale::id +#include // std::pair<> + +namespace glm +{ + /// @addtogroup gtx_io + /// @{ + + namespace io + { + enum order_type { column_major, row_major}; + + template + class format_punct : public std::locale::facet + { + typedef CTy char_type; + + public: + + static std::locale::id id; + + bool formatted; + unsigned precision; + unsigned width; + char_type separator; + char_type delim_left; + char_type delim_right; + char_type space; + char_type newline; + order_type order; + + GLM_FUNC_DECL explicit format_punct(size_t a = 0); + GLM_FUNC_DECL explicit format_punct(format_punct const&); + }; + + template > + class basic_state_saver { + + public: + + GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios&); + GLM_FUNC_DECL ~basic_state_saver(); + + private: + + typedef ::std::basic_ios state_type; + typedef typename state_type::char_type char_type; + typedef ::std::ios_base::fmtflags flags_type; + typedef ::std::streamsize streamsize_type; + typedef ::std::locale const locale_type; + + state_type& state_; + flags_type flags_; + streamsize_type precision_; + streamsize_type width_; + char_type fill_; + locale_type locale_; + + GLM_FUNC_DECL basic_state_saver& operator=(basic_state_saver const&); + }; + + typedef basic_state_saver state_saver; + typedef basic_state_saver wstate_saver; + + template > + class basic_format_saver + { + public: + + GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios&); + GLM_FUNC_DECL ~basic_format_saver(); + + private: + + basic_state_saver const bss_; + + GLM_FUNC_DECL basic_format_saver& operator=(basic_format_saver const&); + }; + + typedef basic_format_saver format_saver; + typedef basic_format_saver wformat_saver; + + struct precision + { + unsigned value; + + GLM_FUNC_DECL explicit precision(unsigned); + }; + + struct width + { + unsigned value; + + GLM_FUNC_DECL explicit width(unsigned); + }; + + template + struct delimeter + { + CTy value[3]; + + GLM_FUNC_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); + }; + + struct order + { + order_type value; + + GLM_FUNC_DECL explicit order(order_type); + }; + + // functions, inlined (inline) + + template + FTy const& get_facet(std::basic_ios&); + template + std::basic_ios& formatted(std::basic_ios&); + template + std::basic_ios& unformattet(std::basic_ios&); + + template + std::basic_ostream& operator<<(std::basic_ostream&, precision const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, width const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, delimeter const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, order const&); + }//namespace io + + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, qua const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); + + template + GLM_FUNC_DECL std::basic_ostream & operator<<(std::basic_ostream &, + std::pair const, mat<4, 4, T, Q> const> const&); + + /// @} +}//namespace glm + +#include "io.inl" diff --git a/include/glm/glm/gtx/io.inl b/include/glm/glm/gtx/io.inl new file mode 100644 index 00000000..a3a1bb6c --- /dev/null +++ b/include/glm/glm/gtx/io.inl @@ -0,0 +1,440 @@ +/// @ref gtx_io +/// @author Jan P Springer (regnirpsj@gmail.com) + +#include // std::fixed, std::setfill<>, std::setprecision, std::right, std::setw +#include // std::basic_ostream<> +#include "../gtc/matrix_access.hpp" // glm::col, glm::row +#include "../gtx/type_trait.hpp" // glm::type<> + +namespace glm{ +namespace io +{ + template + GLM_FUNC_QUALIFIER format_punct::format_punct(size_t a) + : std::locale::facet(a) + , formatted(true) + , precision(3) + , width(1 + 4 + 1 + precision) + , separator(',') + , delim_left('[') + , delim_right(']') + , space(' ') + , newline('\n') + , order(column_major) + {} + + template + GLM_FUNC_QUALIFIER format_punct::format_punct(format_punct const& a) + : std::locale::facet(0) + , formatted(a.formatted) + , precision(a.precision) + , width(a.width) + , separator(a.separator) + , delim_left(a.delim_left) + , delim_right(a.delim_right) + , space(a.space) + , newline(a.newline) + , order(a.order) + {} + + template std::locale::id format_punct::id; + + template + GLM_FUNC_QUALIFIER basic_state_saver::basic_state_saver(std::basic_ios& a) + : state_(a) + , flags_(a.flags()) + , precision_(a.precision()) + , width_(a.width()) + , fill_(a.fill()) + , locale_(a.getloc()) + {} + + template + GLM_FUNC_QUALIFIER basic_state_saver::~basic_state_saver() + { + state_.imbue(locale_); + state_.fill(fill_); + state_.width(width_); + state_.precision(precision_); + state_.flags(flags_); + } + + template + GLM_FUNC_QUALIFIER basic_format_saver::basic_format_saver(std::basic_ios& a) + : bss_(a) + { + a.imbue(std::locale(a.getloc(), new format_punct(get_facet >(a)))); + } + + template + GLM_FUNC_QUALIFIER + basic_format_saver::~basic_format_saver() + {} + + GLM_FUNC_QUALIFIER precision::precision(unsigned a) + : value(a) + {} + + GLM_FUNC_QUALIFIER width::width(unsigned a) + : value(a) + {} + + template + GLM_FUNC_QUALIFIER delimeter::delimeter(CTy a, CTy b, CTy c) + : value() + { + value[0] = a; + value[1] = b; + value[2] = c; + } + + GLM_FUNC_QUALIFIER order::order(order_type a) + : value(a) + {} + + template + GLM_FUNC_QUALIFIER FTy const& get_facet(std::basic_ios& ios) + { + if(!std::has_facet(ios.getloc())) + ios.imbue(std::locale(ios.getloc(), new FTy)); + + return std::use_facet(ios.getloc()); + } + + template + GLM_FUNC_QUALIFIER std::basic_ios& formatted(std::basic_ios& ios) + { + const_cast&>(get_facet >(ios)).formatted = true; + return ios; + } + + template + GLM_FUNC_QUALIFIER std::basic_ios& unformatted(std::basic_ios& ios) + { + const_cast&>(get_facet >(ios)).formatted = false; + return ios; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, precision const& a) + { + const_cast&>(get_facet >(os)).precision = a.value; + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, width const& a) + { + const_cast&>(get_facet >(os)).width = a.value; + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, delimeter const& a) + { + format_punct & fmt(const_cast&>(get_facet >(os))); + + fmt.delim_left = a.value[0]; + fmt.delim_right = a.value[1]; + fmt.separator = a.value[2]; + + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, order const& a) + { + const_cast&>(get_facet >(os)).order = a.value; + return os; + } +} // namespace io + +namespace detail +{ + template + GLM_FUNC_QUALIFIER std::basic_ostream& + print_vector_on(std::basic_ostream& os, V const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + + length_t const& components(type::components); + + if(fmt.formatted) + { + io::basic_state_saver const bss(os); + + os << std::fixed << std::right << std::setprecision(fmt.precision) << std::setfill(fmt.space) << fmt.delim_left; + + for(length_t i(0); i < components; ++i) + { + os << std::setw(fmt.width) << a[i]; + if(components-1 != i) + os << fmt.separator; + } + + os << fmt.delim_right; + } + else + { + for(length_t i(0); i < components; ++i) + { + os << a[i]; + + if(components-1 != i) + os << fmt.space; + } + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, qua const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<1, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<2, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<3, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<4, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + +namespace detail +{ + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_on(std::basic_ostream& os, M const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); + + if(fmt.formatted) + { + os << fmt.newline << fmt.delim_left; + + switch(fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < rows; ++i) + { + if (0 != i) + os << fmt.space; + + os << row(a, i); + + if(rows-1 != i) + os << fmt.newline; + } + } + break; + + case io::row_major: + { + for(length_t i(0); i < cols; ++i) + { + if(0 != i) + os << fmt.space; + + os << column(a, i); + + if(cols-1 != i) + os << fmt.newline; + } + } + break; + } + + os << fmt.delim_right; + } + else + { + switch (fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < cols; ++i) + { + os << column(a, i); + + if(cols - 1 != i) + os << fmt.space; + } + } + break; + + case io::row_major: + { + for (length_t i(0); i < rows; ++i) + { + os << row(a, i); + + if (rows-1 != i) + os << fmt.space; + } + } + break; + } + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<3, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + +namespace detail +{ + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_pair_on(std::basic_ostream& os, std::pair const, M const> const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + M const& ml(a.first); + M const& mr(a.second); + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); + + if(fmt.formatted) + { + os << fmt.newline << fmt.delim_left; + + switch(fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < rows; ++i) + { + if(0 != i) + os << fmt.space; + + os << row(ml, i) << ((rows-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << row(mr, i); + + if(rows-1 != i) + os << fmt.newline; + } + } + break; + case io::row_major: + { + for(length_t i(0); i < cols; ++i) + { + if(0 != i) + os << fmt.space; + + os << column(ml, i) << ((cols-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << column(mr, i); + + if(cols-1 != i) + os << fmt.newline; + } + } + break; + } + + os << fmt.delim_right; + } + else + { + os << ml << fmt.space << mr; + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<( + std::basic_ostream & os, + std::pair const, + mat<4, 4, T, Q> const> const& a) + { + return detail::print_matrix_pair_on(os, a); + } +}//namespace glm diff --git a/include/glm/glm/gtx/log_base.hpp b/include/glm/glm/gtx/log_base.hpp new file mode 100644 index 00000000..ba28c9d7 --- /dev/null +++ b/include/glm/glm/gtx/log_base.hpp @@ -0,0 +1,48 @@ +/// @ref gtx_log_base +/// @file glm/gtx/log_base.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_log_base GLM_GTX_log_base +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Logarithm for any base. base can be a vector or a scalar. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_log_base extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_log_base + /// @{ + + /// Logarithm for any base. + /// From GLM_GTX_log_base. + template + GLM_FUNC_DECL genType log( + genType const& x, + genType const& base); + + /// Logarithm for any base. + /// From GLM_GTX_log_base. + template + GLM_FUNC_DECL vec sign( + vec const& x, + vec const& base); + + /// @} +}//namespace glm + +#include "log_base.inl" diff --git a/include/glm/glm/gtx/log_base.inl b/include/glm/glm/gtx/log_base.inl new file mode 100644 index 00000000..4bbb8e89 --- /dev/null +++ b/include/glm/glm/gtx/log_base.inl @@ -0,0 +1,16 @@ +/// @ref gtx_log_base + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) + { + return glm::log(x) / glm::log(base); + } + + template + GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) + { + return glm::log(x) / glm::log(base); + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_cross_product.hpp b/include/glm/glm/gtx/matrix_cross_product.hpp new file mode 100644 index 00000000..1e585f9a --- /dev/null +++ b/include/glm/glm/gtx/matrix_cross_product.hpp @@ -0,0 +1,47 @@ +/// @ref gtx_matrix_cross_product +/// @file glm/gtx/matrix_cross_product.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build cross product matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_cross_product + /// @{ + + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> matrixCross3( + vec<3, T, Q> const& x); + + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> matrixCross4( + vec<3, T, Q> const& x); + + /// @} +}//namespace glm + +#include "matrix_cross_product.inl" diff --git a/include/glm/glm/gtx/matrix_cross_product.inl b/include/glm/glm/gtx/matrix_cross_product.inl new file mode 100644 index 00000000..3a153977 --- /dev/null +++ b/include/glm/glm/gtx/matrix_cross_product.inl @@ -0,0 +1,37 @@ +/// @ref gtx_matrix_cross_product + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 + ( + vec<3, T, Q> const& x + ) + { + mat<3, 3, T, Q> Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 + ( + vec<3, T, Q> const& x + ) + { + mat<4, 4, T, Q> Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_decompose.hpp b/include/glm/glm/gtx/matrix_decompose.hpp new file mode 100644 index 00000000..acd7a7f0 --- /dev/null +++ b/include/glm/glm/gtx/matrix_decompose.hpp @@ -0,0 +1,46 @@ +/// @ref gtx_matrix_decompose +/// @file glm/gtx/matrix_decompose.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Decomposes a model matrix to translations, rotation and scale components + +#pragma once + +// Dependencies +#include "../mat4x4.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../geometric.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtc/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_decompose extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_decompose + /// @{ + + /// Decomposes a model matrix to translations, rotation and scale components + /// @see gtx_matrix_decompose + template + GLM_FUNC_DECL bool decompose( + mat<4, 4, T, Q> const& modelMatrix, + vec<3, T, Q> & scale, qua & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); + + /// @} +}//namespace glm + +#include "matrix_decompose.inl" diff --git a/include/glm/glm/gtx/matrix_decompose.inl b/include/glm/glm/gtx/matrix_decompose.inl new file mode 100644 index 00000000..694f5eca --- /dev/null +++ b/include/glm/glm/gtx/matrix_decompose.inl @@ -0,0 +1,186 @@ +/// @ref gtx_matrix_decompose + +#include "../gtc/constants.hpp" +#include "../gtc/epsilon.hpp" + +namespace glm{ +namespace detail +{ + /// Make a linear combination of two vectors and return the result. + // result = (a * ascl) + (b * bscl) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> combine( + vec<3, T, Q> const& a, + vec<3, T, Q> const& b, + T ascl, T bscl) + { + return (a * ascl) + (b * bscl); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> scale(vec<3, T, Q> const& v, T desiredLength) + { + return v * desiredLength / length(v); + } +}//namespace detail + + // Matrix decompose + // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp + // Decomposes the mode matrix to translations,rotation scale components + + template + GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, qua & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) + { + mat<4, 4, T, Q> LocalMatrix(ModelMatrix); + + // Normalize the matrix. + if(epsilonEqual(LocalMatrix[3][3], static_cast(0), epsilon())) + return false; + + for(length_t i = 0; i < 4; ++i) + for(length_t j = 0; j < 4; ++j) + LocalMatrix[i][j] /= LocalMatrix[3][3]; + + // perspectiveMatrix is used to solve for perspective, but it also provides + // an easy way to test for singularity of the upper 3x3 component. + mat<4, 4, T, Q> PerspectiveMatrix(LocalMatrix); + + for(length_t i = 0; i < 3; i++) + PerspectiveMatrix[i][3] = static_cast(0); + PerspectiveMatrix[3][3] = static_cast(1); + + /// TODO: Fixme! + if(epsilonEqual(determinant(PerspectiveMatrix), static_cast(0), epsilon())) + return false; + + // First, isolate perspective. This is the messiest. + if( + epsilonNotEqual(LocalMatrix[0][3], static_cast(0), epsilon()) || + epsilonNotEqual(LocalMatrix[1][3], static_cast(0), epsilon()) || + epsilonNotEqual(LocalMatrix[2][3], static_cast(0), epsilon())) + { + // rightHandSide is the right hand side of the equation. + vec<4, T, Q> RightHandSide; + RightHandSide[0] = LocalMatrix[0][3]; + RightHandSide[1] = LocalMatrix[1][3]; + RightHandSide[2] = LocalMatrix[2][3]; + RightHandSide[3] = LocalMatrix[3][3]; + + // Solve the equation by inverting PerspectiveMatrix and multiplying + // rightHandSide by the inverse. (This is the easiest way, not + // necessarily the best.) + mat<4, 4, T, Q> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); + mat<4, 4, T, Q> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); + + Perspective = TransposedInversePerspectiveMatrix * RightHandSide; + // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); + + // Clear the perspective partition + LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = static_cast(0); + LocalMatrix[3][3] = static_cast(1); + } + else + { + // No perspective. + Perspective = vec<4, T, Q>(0, 0, 0, 1); + } + + // Next take care of translation (easy). + Translation = vec<3, T, Q>(LocalMatrix[3]); + LocalMatrix[3] = vec<4, T, Q>(0, 0, 0, LocalMatrix[3].w); + + vec<3, T, Q> Row[3], Pdum3; + + // Now get scale and shear. + for(length_t i = 0; i < 3; ++i) + for(length_t j = 0; j < 3; ++j) + Row[i][j] = LocalMatrix[i][j]; + + // Compute X scale factor and normalize first row. + Scale.x = length(Row[0]);// v3Length(Row[0]); + + Row[0] = detail::scale(Row[0], static_cast(1)); + + // Compute XY shear factor and make 2nd row orthogonal to 1st. + Skew.z = dot(Row[0], Row[1]); + Row[1] = detail::combine(Row[1], Row[0], static_cast(1), -Skew.z); + + // Now, compute Y scale and normalize 2nd row. + Scale.y = length(Row[1]); + Row[1] = detail::scale(Row[1], static_cast(1)); + Skew.z /= Scale.y; + + // Compute XZ and YZ shears, orthogonalize 3rd row. + Skew.y = glm::dot(Row[0], Row[2]); + Row[2] = detail::combine(Row[2], Row[0], static_cast(1), -Skew.y); + Skew.x = glm::dot(Row[1], Row[2]); + Row[2] = detail::combine(Row[2], Row[1], static_cast(1), -Skew.x); + + // Next, get Z scale and normalize 3rd row. + Scale.z = length(Row[2]); + Row[2] = detail::scale(Row[2], static_cast(1)); + Skew.y /= Scale.z; + Skew.x /= Scale.z; + + // At this point, the matrix (in rows[]) is orthonormal. + // Check for a coordinate system flip. If the determinant + // is -1, then negate the matrix and the scaling factors. + Pdum3 = cross(Row[1], Row[2]); // v3Cross(row[1], row[2], Pdum3); + if(dot(Row[0], Pdum3) < 0) + { + for(length_t i = 0; i < 3; i++) + { + Scale[i] *= static_cast(-1); + Row[i] *= static_cast(-1); + } + } + + // Now, get the rotations out, as described in the gem. + + // FIXME - Add the ability to return either quaternions (which are + // easier to recompose with) or Euler angles (rx, ry, rz), which + // are easier for authors to deal with. The latter will only be useful + // when we fix https://bugs.webkit.org/show_bug.cgi?id=23799, so I + // will leave the Euler angle code here for now. + + // ret.rotateY = asin(-Row[0][2]); + // if (cos(ret.rotateY) != 0) { + // ret.rotateX = atan2(Row[1][2], Row[2][2]); + // ret.rotateZ = atan2(Row[0][1], Row[0][0]); + // } else { + // ret.rotateX = atan2(-Row[2][0], Row[1][1]); + // ret.rotateZ = 0; + // } + + int i, j, k = 0; + T root, trace = Row[0].x + Row[1].y + Row[2].z; + if(trace > static_cast(0)) + { + root = sqrt(trace + static_cast(1.0)); + Orientation.w = static_cast(0.5) * root; + root = static_cast(0.5) / root; + Orientation.x = root * (Row[1].z - Row[2].y); + Orientation.y = root * (Row[2].x - Row[0].z); + Orientation.z = root * (Row[0].y - Row[1].x); + } // End if > 0 + else + { + static int Next[3] = {1, 2, 0}; + i = 0; + if(Row[1].y > Row[0].x) i = 1; + if(Row[2].z > Row[i][i]) i = 2; + j = Next[i]; + k = Next[j]; + + root = sqrt(Row[i][i] - Row[j][j] - Row[k][k] + static_cast(1.0)); + + Orientation[i] = static_cast(0.5) * root; + root = static_cast(0.5) / root; + Orientation[j] = root * (Row[i][j] + Row[j][i]); + Orientation[k] = root * (Row[i][k] + Row[k][i]); + Orientation.w = root * (Row[j][k] - Row[k][j]); + } // End if <= 0 + + return true; + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_factorisation.hpp b/include/glm/glm/gtx/matrix_factorisation.hpp new file mode 100644 index 00000000..5a975d60 --- /dev/null +++ b/include/glm/glm/gtx/matrix_factorisation.hpp @@ -0,0 +1,69 @@ +/// @ref gtx_matrix_factorisation +/// @file glm/gtx/matrix_factorisation.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_factorisation GLM_GTX_matrix_factorisation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions to factor matrices in various forms + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_factorisation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_factorisation extension included") +# endif +#endif + +/* +Suggestions: + - Move helper functions flipud and fliplr to another file: They may be helpful in more general circumstances. + - Implement other types of matrix factorisation, such as: QL and LQ, L(D)U, eigendecompositions, etc... +*/ + +namespace glm +{ + /// @addtogroup gtx_matrix_factorisation + /// @{ + + /// Flips the matrix rows up and down. + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL mat flipud(mat const& in); + + /// Flips the matrix columns right and left. + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL mat fliplr(mat const& in); + + /// Performs QR factorisation of a matrix. + /// Returns 2 matrices, q and r, such that the columns of q are orthonormal and span the same subspace than those of the input matrix, r is an upper triangular matrix, and q*r=in. + /// Given an n-by-m input matrix, q has dimensions min(n,m)-by-m, and r has dimensions n-by-min(n,m). + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); + + /// Performs RQ factorisation of a matrix. + /// Returns 2 matrices, r and q, such that r is an upper triangular matrix, the rows of q are orthonormal and span the same subspace than those of the input matrix, and r*q=in. + /// Note that in the context of RQ factorisation, the diagonal is seen as starting in the lower-right corner of the matrix, instead of the usual upper-left. + /// Given an n-by-m input matrix, r has dimensions min(n,m)-by-m, and q has dimensions n-by-min(n,m). + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); + + /// @} +} + +#include "matrix_factorisation.inl" diff --git a/include/glm/glm/gtx/matrix_factorisation.inl b/include/glm/glm/gtx/matrix_factorisation.inl new file mode 100644 index 00000000..c479b8ad --- /dev/null +++ b/include/glm/glm/gtx/matrix_factorisation.inl @@ -0,0 +1,84 @@ +/// @ref gtx_matrix_factorisation + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat flipud(mat const& in) + { + mat tin = transpose(in); + tin = fliplr(tin); + mat out = transpose(tin); + + return out; + } + + template + GLM_FUNC_QUALIFIER mat fliplr(mat const& in) + { + mat out; + for (length_t i = 0; i < C; i++) + { + out[i] = in[(C - i) - 1]; + } + + return out; + } + + template + GLM_FUNC_QUALIFIER void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r) + { + // Uses modified Gram-Schmidt method + // Source: https://en.wikipedia.org/wiki/Gram�Schmidt_process + // And https://en.wikipedia.org/wiki/QR_decomposition + + //For all the linearly independs columns of the input... + // (there can be no more linearly independents columns than there are rows.) + for (length_t i = 0; i < (C < R ? C : R); i++) + { + //Copy in Q the input's i-th column. + q[i] = in[i]; + + //j = [0,i[ + // Make that column orthogonal to all the previous ones by substracting to it the non-orthogonal projection of all the previous columns. + // Also: Fill the zero elements of R + for (length_t j = 0; j < i; j++) + { + q[i] -= dot(q[i], q[j])*q[j]; + r[j][i] = 0; + } + + //Now, Q i-th column is orthogonal to all the previous columns. Normalize it. + q[i] = normalize(q[i]); + + //j = [i,C[ + //Finally, compute the corresponding coefficients of R by computing the projection of the resulting column on the other columns of the input. + for (length_t j = i; j < C; j++) + { + r[j][i] = dot(in[j], q[i]); + } + } + } + + template + GLM_FUNC_QUALIFIER void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q) + { + // From https://en.wikipedia.org/wiki/QR_decomposition: + // The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices. + // QR decomposition is Gram�Schmidt orthogonalization of columns of A, started from the first column. + // RQ decomposition is Gram�Schmidt orthogonalization of rows of A, started from the last row. + + mat tin = transpose(in); + tin = fliplr(tin); + + mat tr; + mat<(C < R ? C : R), C, T, Q> tq; + qr_decompose(tin, tq, tr); + + tr = fliplr(tr); + r = transpose(tr); + r = fliplr(r); + + tq = fliplr(tq); + q = transpose(tq); + } +} //namespace glm diff --git a/include/glm/glm/gtx/matrix_interpolation.hpp b/include/glm/glm/gtx/matrix_interpolation.hpp new file mode 100644 index 00000000..7d5ad4cd --- /dev/null +++ b/include/glm/glm/gtx/matrix_interpolation.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_matrix_interpolation +/// @file glm/gtx/matrix_interpolation.hpp +/// @author Ghenadii Ursachi (the.asteroth@gmail.com) +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Allows to directly interpolate two matrices. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_interpolation + /// @{ + + /// Get the axis and angle of the rotation from a matrix. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL void axisAngle( + mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle); + + /// Build a matrix from axis and angle. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix( + vec<3, T, Q> const& Axis, T const Angle); + + /// Extracts the rotation part of a matrix. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation( + mat<4, 4, T, Q> const& Mat); + + /// Build a interpolation of 4 * 4 matrixes. + /// From GLM_GTX_matrix_interpolation extension. + /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. + template + GLM_FUNC_DECL mat<4, 4, T, Q> interpolate( + mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta); + + /// @} +}//namespace glm + +#include "matrix_interpolation.inl" diff --git a/include/glm/glm/gtx/matrix_interpolation.inl b/include/glm/glm/gtx/matrix_interpolation.inl new file mode 100644 index 00000000..de40b7d7 --- /dev/null +++ b/include/glm/glm/gtx/matrix_interpolation.inl @@ -0,0 +1,129 @@ +/// @ref gtx_matrix_interpolation + +#include "../gtc/constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& m, vec<3, T, Q> & axis, T& angle) + { + T epsilon = static_cast(0.01); + T epsilon2 = static_cast(0.1); + + if((abs(m[1][0] - m[0][1]) < epsilon) && (abs(m[2][0] - m[0][2]) < epsilon) && (abs(m[2][1] - m[1][2]) < epsilon)) + { + if ((abs(m[1][0] + m[0][1]) < epsilon2) && (abs(m[2][0] + m[0][2]) < epsilon2) && (abs(m[2][1] + m[1][2]) < epsilon2) && (abs(m[0][0] + m[1][1] + m[2][2] - static_cast(3.0)) < epsilon2)) + { + angle = static_cast(0.0); + axis.x = static_cast(1.0); + axis.y = static_cast(0.0); + axis.z = static_cast(0.0); + return; + } + angle = static_cast(3.1415926535897932384626433832795); + T xx = (m[0][0] + static_cast(1.0)) * static_cast(0.5); + T yy = (m[1][1] + static_cast(1.0)) * static_cast(0.5); + T zz = (m[2][2] + static_cast(1.0)) * static_cast(0.5); + T xy = (m[1][0] + m[0][1]) * static_cast(0.25); + T xz = (m[2][0] + m[0][2]) * static_cast(0.25); + T yz = (m[2][1] + m[1][2]) * static_cast(0.25); + if((xx > yy) && (xx > zz)) + { + if(xx < epsilon) + { + axis.x = static_cast(0.0); + axis.y = static_cast(0.7071); + axis.z = static_cast(0.7071); + } + else + { + axis.x = sqrt(xx); + axis.y = xy / axis.x; + axis.z = xz / axis.x; + } + } + else if (yy > zz) + { + if(yy < epsilon) + { + axis.x = static_cast(0.7071); + axis.y = static_cast(0.0); + axis.z = static_cast(0.7071); + } + else + { + axis.y = sqrt(yy); + axis.x = xy / axis.y; + axis.z = yz / axis.y; + } + } + else + { + if (zz < epsilon) + { + axis.x = static_cast(0.7071); + axis.y = static_cast(0.7071); + axis.z = static_cast(0.0); + } + else + { + axis.z = sqrt(zz); + axis.x = xz / axis.z; + axis.y = yz / axis.z; + } + } + return; + } + T s = sqrt((m[2][1] - m[1][2]) * (m[2][1] - m[1][2]) + (m[2][0] - m[0][2]) * (m[2][0] - m[0][2]) + (m[1][0] - m[0][1]) * (m[1][0] - m[0][1])); + if (glm::abs(s) < T(0.001)) + s = static_cast(1); + T const angleCos = (m[0][0] + m[1][1] + m[2][2] - static_cast(1)) * static_cast(0.5); + if(angleCos - static_cast(1) < epsilon) + angle = pi() * static_cast(0.25); + else + angle = acos(angleCos); + axis.x = (m[1][2] - m[2][1]) / s; + axis.y = (m[2][0] - m[0][2]) / s; + axis.z = (m[0][1] - m[1][0]) / s; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> axisAngleMatrix(vec<3, T, Q> const& axis, T const angle) + { + T c = cos(angle); + T s = sin(angle); + T t = static_cast(1) - c; + vec<3, T, Q> n = normalize(axis); + + return mat<4, 4, T, Q>( + t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, static_cast(0.0), + t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, static_cast(0.0), + t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, static_cast(0.0), + static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> extractMatrixRotation(mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0][0], m[0][1], m[0][2], static_cast(0.0), + m[1][0], m[1][1], m[1][2], static_cast(0.0), + m[2][0], m[2][1], m[2][2], static_cast(0.0), + static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> interpolate(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const delta) + { + mat<4, 4, T, Q> m1rot = extractMatrixRotation(m1); + mat<4, 4, T, Q> dltRotation = m2 * transpose(m1rot); + vec<3, T, Q> dltAxis; + T dltAngle; + axisAngle(dltRotation, dltAxis, dltAngle); + mat<4, 4, T, Q> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; + out[3][0] = m1[3][0] + delta * (m2[3][0] - m1[3][0]); + out[3][1] = m1[3][1] + delta * (m2[3][1] - m1[3][1]); + out[3][2] = m1[3][2] + delta * (m2[3][2] - m1[3][2]); + return out; + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_major_storage.hpp b/include/glm/glm/gtx/matrix_major_storage.hpp new file mode 100644 index 00000000..8c6bc22d --- /dev/null +++ b/include/glm/glm/gtx/matrix_major_storage.hpp @@ -0,0 +1,119 @@ +/// @ref gtx_matrix_major_storage +/// @file glm/gtx/matrix_major_storage.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build matrices with specific matrix order, row or column + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_major_storage is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_major_storage + /// @{ + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + mat<2, 2, T, Q> const& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + mat<3, 3, T, Q> const& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + mat<4, 4, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + mat<2, 2, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + mat<3, 3, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + mat<4, 4, T, Q> const& m); + + /// @} +}//namespace glm + +#include "matrix_major_storage.inl" diff --git a/include/glm/glm/gtx/matrix_major_storage.inl b/include/glm/glm/gtx/matrix_major_storage.inl new file mode 100644 index 00000000..279dd343 --- /dev/null +++ b/include/glm/glm/gtx/matrix_major_storage.inl @@ -0,0 +1,166 @@ +/// @ref gtx_matrix_major_storage + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2 + ( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2 + ) + { + mat<2, 2, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2( + const mat<2, 2, T, Q>& m) + { + mat<2, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) + { + mat<3, 3, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const mat<3, 3, T, Q>& m) + { + mat<3, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) + { + mat<4, 4, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[3][0] = v1.w; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[3][1] = v2.w; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + Result[3][2] = v3.w; + Result[0][3] = v4.x; + Result[1][3] = v4.y; + Result[2][3] = v4.z; + Result[3][3] = v4.w; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const mat<4, 4, T, Q>& m) + { + mat<4, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + Result[3][3] = m[3][3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const vec<2, T, Q>& v1, + const vec<2, T, Q>& v2) + { + return mat<2, 2, T, Q>(v1, v2); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const mat<2, 2, T, Q>& m) + { + return mat<2, 2, T, Q>(m); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) + { + return mat<3, 3, T, Q>(v1, v2, v3); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const mat<3, 3, T, Q>& m) + { + return mat<3, 3, T, Q>(m); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) + { + return mat<4, 4, T, Q>(v1, v2, v3, v4); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const mat<4, 4, T, Q>& m) + { + return mat<4, 4, T, Q>(m); + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_operation.hpp b/include/glm/glm/gtx/matrix_operation.hpp new file mode 100644 index 00000000..de6ff1f8 --- /dev/null +++ b/include/glm/glm/gtx/matrix_operation.hpp @@ -0,0 +1,103 @@ +/// @ref gtx_matrix_operation +/// @file glm/gtx/matrix_operation.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build diagonal matrices from vectors. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_operation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_operation extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_operation + /// @{ + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4( + vec<4, T, Q> const& v); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m); + + /// @} +}//namespace glm + +#include "matrix_operation.inl" diff --git a/include/glm/glm/gtx/matrix_operation.inl b/include/glm/glm/gtx/matrix_operation.inl new file mode 100644 index 00000000..9de83f82 --- /dev/null +++ b/include/glm/glm/gtx/matrix_operation.inl @@ -0,0 +1,176 @@ +/// @ref gtx_matrix_operation + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> diagonal2x2 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> diagonal2x3 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> diagonal2x4 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> diagonal3x2 + ( + vec<2, T, Q> const& v + ) + { + mat<3, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> diagonal3x3 + ( + vec<3, T, Q> const& v + ) + { + mat<3, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> diagonal3x4 + ( + vec<3, T, Q> const& v + ) + { + mat<3, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> diagonal4x4 + ( + vec<4, T, Q> const& v + ) + { + mat<4, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + Result[3][3] = v[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> diagonal4x3 + ( + vec<3, T, Q> const& v + ) + { + mat<4, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> diagonal4x2 + ( + vec<2, T, Q> const& v + ) + { + mat<4, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + +m[1][1], -m[1][0], + -m[0][1], +m[0][0]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m) + { + T const m00 = determinant(mat<2, 2, T, Q>(m[1][1], m[2][1], m[1][2], m[2][2])); + T const m01 = determinant(mat<2, 2, T, Q>(m[0][1], m[2][1], m[0][2], m[2][2])); + T const m02 = determinant(mat<2, 2, T, Q>(m[0][1], m[1][1], m[0][2], m[1][2])); + + T const m10 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][2], m[2][2])); + T const m11 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][2], m[2][2])); + T const m12 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][2], m[1][2])); + + T const m20 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][1], m[2][1])); + T const m21 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][1], m[2][1])); + T const m22 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][1], m[1][1])); + + return mat<3, 3, T, Q>( + +m00, -m01, +m02, + -m10, +m11, -m12, + +m20, -m21, +m22); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m) + { + T const m00 = determinant(mat<3, 3, T, Q>(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m01 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m02 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m03 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m10 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m11 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m12 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m13 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m20 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3])); + T const m21 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3])); + T const m22 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3])); + T const m23 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2])); + + T const m30 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3])); + T const m31 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3])); + T const m32 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3])); + T const m33 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2])); + + return mat<4, 4, T, Q>( + +m00, -m01, +m02, -m03, + -m10, +m11, -m12, +m13, + +m20, -m21, +m22, -m23, + -m30, +m31, -m32, +m33); + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_query.hpp b/include/glm/glm/gtx/matrix_query.hpp new file mode 100644 index 00000000..8011b2b1 --- /dev/null +++ b/include/glm/glm/gtx/matrix_query.hpp @@ -0,0 +1,77 @@ +/// @ref gtx_matrix_query +/// @file glm/gtx/matrix_query.hpp +/// +/// @see core (dependence) +/// @see gtx_vector_query (dependence) +/// +/// @defgroup gtx_matrix_query GLM_GTX_matrix_query +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Query to evaluate matrix properties + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/vector_query.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_query extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_query + /// @{ + + /// Return whether a matrix a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is an identity matrix. + /// From GLM_GTX_matrix_query extension. + template class matType> + GLM_FUNC_DECL bool isIdentity(matType const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is an orthonormalized matrix. + /// From GLM_GTX_matrix_query extension. + template class matType> + GLM_FUNC_DECL bool isOrthogonal(matType const& m, T const& epsilon); + + /// @} +}//namespace glm + +#include "matrix_query.inl" diff --git a/include/glm/glm/gtx/matrix_query.inl b/include/glm/glm/gtx/matrix_query.inl new file mode 100644 index 00000000..77bd2310 --- /dev/null +++ b/include/glm/glm/gtx/matrix_query.inl @@ -0,0 +1,113 @@ +/// @ref gtx_matrix_query + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m[0].length() ; ++i) + { + for(length_t j = 0; result && j < i ; ++j) + result = abs(m[i][j]) <= epsilon; + if(result) + result = abs(m[i][i] - 1) <= epsilon; + for(length_t j = i + 1; result && j < m.length(); ++j) + result = abs(m[i][j]) <= epsilon; + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<2, 2, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<3, 3, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<4, 4, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) + { + bool result = true; + for(length_t i(0); result && i < m.length() - 1; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) + result = areOrthogonal(m[i], m[j], epsilon); + + if(result) + { + mat tmp = transpose(m); + for(length_t i(0); result && i < m.length() - 1 ; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) + result = areOrthogonal(tmp[i], tmp[j], epsilon); + } + return result; + } +}//namespace glm diff --git a/include/glm/glm/gtx/matrix_transform_2d.hpp b/include/glm/glm/gtx/matrix_transform_2d.hpp new file mode 100644 index 00000000..5f9c5402 --- /dev/null +++ b/include/glm/glm/gtx/matrix_transform_2d.hpp @@ -0,0 +1,81 @@ +/// @ref gtx_matrix_transform_2d +/// @file glm/gtx/matrix_transform_2d.hpp +/// @author Miguel Ángel Pérez Martínez +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_transform_2d GLM_GTX_matrix_transform_2d +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines functions that generate common 2d transformation matrices. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../vec2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_transform_2d is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_transform_2d + /// @{ + + /// Builds a translation 3 * 3 matrix created from a vector of 2 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a translation vector. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); + + /// Builds a rotation 3 * 3 matrix created from an angle. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param angle Rotation angle expressed in radians. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, + T angle); + + /// Builds a scale 3 * 3 matrix created from a vector of 2 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a scale vector. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); + + /// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param y Shear factor. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, + T y); + + /// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param x Shear factor. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, + T x); + + /// @} +}//namespace glm + +#include "matrix_transform_2d.inl" diff --git a/include/glm/glm/gtx/matrix_transform_2d.inl b/include/glm/glm/gtx/matrix_transform_2d.inl new file mode 100644 index 00000000..a68d24dc --- /dev/null +++ b/include/glm/glm/gtx/matrix_transform_2d.inl @@ -0,0 +1,68 @@ +/// @ref gtx_matrix_transform_2d +/// @author Miguel Ángel Pérez Martínez + +#include "../trigonometric.hpp" + +namespace glm +{ + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) + { + mat<3, 3, T, Q> Result(m); + Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; + return Result; + } + + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, + T angle) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + mat<3, 3, T, Q> Result; + Result[0] = m[0] * c + m[1] * s; + Result[1] = m[0] * -s + m[1] * c; + Result[2] = m[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) + { + mat<3, 3, T, Q> Result; + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, + T y) + { + mat<3, 3, T, Q> Result(1); + Result[0][1] = y; + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, + T x) + { + mat<3, 3, T, Q> Result(1); + Result[1][0] = x; + return m * Result; + } + +}//namespace glm diff --git a/include/glm/glm/gtx/mixed_product.hpp b/include/glm/glm/gtx/mixed_product.hpp new file mode 100644 index 00000000..b242e357 --- /dev/null +++ b/include/glm/glm/gtx/mixed_product.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_mixed_product +/// @file glm/gtx/mixed_product.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_mixed_product GLM_GTX_mixed_producte +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Mixed product of 3 vectors. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_mixed_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_mixed_product + /// @{ + + /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) + template + GLM_FUNC_DECL T mixedProduct( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + /// @} +}// namespace glm + +#include "mixed_product.inl" diff --git a/include/glm/glm/gtx/mixed_product.inl b/include/glm/glm/gtx/mixed_product.inl new file mode 100644 index 00000000..e5cdbdb4 --- /dev/null +++ b/include/glm/glm/gtx/mixed_product.inl @@ -0,0 +1,15 @@ +/// @ref gtx_mixed_product + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T mixedProduct + ( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3 + ) + { + return dot(cross(v1, v2), v3); + } +}//namespace glm diff --git a/include/glm/glm/gtx/norm.hpp b/include/glm/glm/gtx/norm.hpp new file mode 100644 index 00000000..dfaebb7a --- /dev/null +++ b/include/glm/glm/gtx/norm.hpp @@ -0,0 +1,88 @@ +/// @ref gtx_norm +/// @file glm/gtx/norm.hpp +/// +/// @see core (dependence) +/// @see gtx_quaternion (dependence) +/// @see gtx_component_wise (dependence) +/// +/// @defgroup gtx_norm GLM_GTX_norm +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Various ways to compute vector norms. + +#pragma once + +// Dependency: +#include "../geometric.hpp" +#include "../gtx/quaternion.hpp" +#include "../gtx/component_wise.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_norm is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_norm extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_norm + /// @{ + + /// Returns the squared length of x. + /// From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T length2(vec const& x); + + /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). + /// From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T distance2(vec const& p0, vec const& p1); + + //! Returns the L1 norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the L1 norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& v); + + //! Returns the L2 norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the L2 norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x); + + //! Returns the L norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth); + + //! Returns the L norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth); + + //! Returns the LMax norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the LMax norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x); + + /// @} +}//namespace glm + +#include "norm.inl" diff --git a/include/glm/glm/gtx/norm.inl b/include/glm/glm/gtx/norm.inl new file mode 100644 index 00000000..6db561b3 --- /dev/null +++ b/include/glm/glm/gtx/norm.inl @@ -0,0 +1,95 @@ +/// @ref gtx_norm + +#include "../detail/qualifier.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_length2 + { + GLM_FUNC_QUALIFIER static T call(vec const& v) + { + return dot(v, v); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER genType length2(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + return x * x; + } + + template + GLM_FUNC_QUALIFIER T length2(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + return detail::compute_length2::value>::call(v); + } + + template + GLM_FUNC_QUALIFIER T distance2(T p0, T p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + return length2(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + return length2(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); + } + + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& v) + { + return abs(v.x) + abs(v.y) + abs(v.z); + } + + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b + ) + { + return length(b - a); + } + + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& v) + { + return length(v); + } + + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth) + { + return pow(pow(abs(y.x - x.x), T(Depth)) + pow(abs(y.y - x.y), T(Depth)) + pow(abs(y.z - x.z), T(Depth)), T(1) / T(Depth)); + } + + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& v, unsigned int Depth) + { + return pow(pow(abs(v.x), T(Depth)) + pow(abs(v.y), T(Depth)) + pow(abs(v.z), T(Depth)), T(1) / T(Depth)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return compMax(abs(b - a)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& v) + { + return compMax(abs(v)); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/normal.hpp b/include/glm/glm/gtx/normal.hpp new file mode 100644 index 00000000..068682f7 --- /dev/null +++ b/include/glm/glm/gtx/normal.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_normal +/// @file glm/gtx/normal.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_normal GLM_GTX_normal +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Compute the normal of a triangle. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_normal extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_normal + /// @{ + + /// Computes triangle normal from triangle points. + /// + /// @see gtx_normal + template + GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); + + /// @} +}//namespace glm + +#include "normal.inl" diff --git a/include/glm/glm/gtx/normal.inl b/include/glm/glm/gtx/normal.inl new file mode 100644 index 00000000..74f9fc99 --- /dev/null +++ b/include/glm/glm/gtx/normal.inl @@ -0,0 +1,15 @@ +/// @ref gtx_normal + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal + ( + vec<3, T, Q> const& p1, + vec<3, T, Q> const& p2, + vec<3, T, Q> const& p3 + ) + { + return normalize(cross(p1 - p2, p1 - p3)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/normalize_dot.hpp b/include/glm/glm/gtx/normalize_dot.hpp new file mode 100644 index 00000000..51958023 --- /dev/null +++ b/include/glm/glm/gtx/normalize_dot.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_normalize_dot +/// @file glm/gtx/normalize_dot.hpp +/// +/// @see core (dependence) +/// @see gtx_fast_square_root (dependence) +/// +/// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Dot product of vectors that need to be normalize with a single square root. + +#pragma once + +// Dependency: +#include "../gtx/fast_square_root.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_normalize_dot is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_normalize_dot extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_normalize_dot + /// @{ + + /// Normalize parameters and returns the dot product of x and y. + /// It's faster that dot(normalize(x), normalize(y)). + /// + /// @see gtx_normalize_dot extension. + template + GLM_FUNC_DECL T normalizeDot(vec const& x, vec const& y); + + /// Normalize parameters and returns the dot product of x and y. + /// Faster that dot(fastNormalize(x), fastNormalize(y)). + /// + /// @see gtx_normalize_dot extension. + template + GLM_FUNC_DECL T fastNormalizeDot(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "normalize_dot.inl" diff --git a/include/glm/glm/gtx/normalize_dot.inl b/include/glm/glm/gtx/normalize_dot.inl new file mode 100644 index 00000000..7bcd9a53 --- /dev/null +++ b/include/glm/glm/gtx/normalize_dot.inl @@ -0,0 +1,16 @@ +/// @ref gtx_normalize_dot + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) + { + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); + } + + template + GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) + { + return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/number_precision.hpp b/include/glm/glm/gtx/number_precision.hpp new file mode 100644 index 00000000..3a606bda --- /dev/null +++ b/include/glm/glm/gtx/number_precision.hpp @@ -0,0 +1,61 @@ +/// @ref gtx_number_precision +/// @file glm/gtx/number_precision.hpp +/// +/// @see core (dependence) +/// @see gtc_type_precision (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_number_precision GLM_GTX_number_precision +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defined size types. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_number_precision is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_number_precision extension included") +# endif +#endif + +namespace glm{ +namespace gtx +{ + ///////////////////////////// + // Unsigned int vector types + + /// @addtogroup gtx_number_precision + /// @{ + + typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float vector types + + typedef f32 f32vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float matrix types + + typedef f32 f32mat1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f32 f32mat1x1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1x1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + + /// @} +}//namespace gtx +}//namespace glm + +#include "number_precision.inl" diff --git a/include/glm/glm/gtx/number_precision.inl b/include/glm/glm/gtx/number_precision.inl new file mode 100644 index 00000000..b39d71c3 --- /dev/null +++ b/include/glm/glm/gtx/number_precision.inl @@ -0,0 +1,6 @@ +/// @ref gtx_number_precision + +namespace glm +{ + +} diff --git a/include/glm/glm/gtx/optimum_pow.hpp b/include/glm/glm/gtx/optimum_pow.hpp new file mode 100644 index 00000000..9284a474 --- /dev/null +++ b/include/glm/glm/gtx/optimum_pow.hpp @@ -0,0 +1,54 @@ +/// @ref gtx_optimum_pow +/// @file glm/gtx/optimum_pow.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Integer exponentiation of power functions. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_optimum_pow is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_optimum_pow extension included") +# endif +#endif + +namespace glm{ +namespace gtx +{ + /// @addtogroup gtx_optimum_pow + /// @{ + + /// Returns x raised to the power of 2. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow2(genType const& x); + + /// Returns x raised to the power of 3. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow3(genType const& x); + + /// Returns x raised to the power of 4. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow4(genType const& x); + + /// @} +}//namespace gtx +}//namespace glm + +#include "optimum_pow.inl" diff --git a/include/glm/glm/gtx/optimum_pow.inl b/include/glm/glm/gtx/optimum_pow.inl new file mode 100644 index 00000000..a26c19c1 --- /dev/null +++ b/include/glm/glm/gtx/optimum_pow.inl @@ -0,0 +1,22 @@ +/// @ref gtx_optimum_pow + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType pow2(genType const& x) + { + return x * x; + } + + template + GLM_FUNC_QUALIFIER genType pow3(genType const& x) + { + return x * x * x; + } + + template + GLM_FUNC_QUALIFIER genType pow4(genType const& x) + { + return (x * x) * (x * x); + } +}//namespace glm diff --git a/include/glm/glm/gtx/orthonormalize.hpp b/include/glm/glm/gtx/orthonormalize.hpp new file mode 100644 index 00000000..3e004fb0 --- /dev/null +++ b/include/glm/glm/gtx/orthonormalize.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_orthonormalize +/// @file glm/gtx/orthonormalize.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Orthonormalize matrices. + +#pragma once + +// Dependency: +#include "../vec3.hpp" +#include "../mat3x3.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_orthonormalize is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_orthonormalize extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_orthonormalize + /// @{ + + /// Returns the orthonormalized matrix of m. + /// + /// @see gtx_orthonormalize + template + GLM_FUNC_DECL mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m); + + /// Orthonormalizes x according y. + /// + /// @see gtx_orthonormalize + template + GLM_FUNC_DECL vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + /// @} +}//namespace glm + +#include "orthonormalize.inl" diff --git a/include/glm/glm/gtx/orthonormalize.inl b/include/glm/glm/gtx/orthonormalize.inl new file mode 100644 index 00000000..cb553ba6 --- /dev/null +++ b/include/glm/glm/gtx/orthonormalize.inl @@ -0,0 +1,29 @@ +/// @ref gtx_orthonormalize + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) + { + mat<3, 3, T, Q> r = m; + + r[0] = normalize(r[0]); + + T d0 = dot(r[0], r[1]); + r[1] -= r[0] * d0; + r[1] = normalize(r[1]); + + T d1 = dot(r[1], r[2]); + d0 = dot(r[0], r[2]); + r[2] -= r[0] * d0 + r[1] * d1; + r[2] = normalize(r[2]); + + return r; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + return normalize(x - y * dot(y, x)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/perpendicular.hpp b/include/glm/glm/gtx/perpendicular.hpp new file mode 100644 index 00000000..72b77b6e --- /dev/null +++ b/include/glm/glm/gtx/perpendicular.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_perpendicular +/// @file glm/gtx/perpendicular.hpp +/// +/// @see core (dependence) +/// @see gtx_projection (dependence) +/// +/// @defgroup gtx_perpendicular GLM_GTX_perpendicular +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Perpendicular of a vector from other one + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/projection.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_perpendicular extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_perpendicular + /// @{ + + //! Projects x a perpendicular axis of Normal. + //! From GLM_GTX_perpendicular extension. + template + GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); + + /// @} +}//namespace glm + +#include "perpendicular.inl" diff --git a/include/glm/glm/gtx/perpendicular.inl b/include/glm/glm/gtx/perpendicular.inl new file mode 100644 index 00000000..1e72f334 --- /dev/null +++ b/include/glm/glm/gtx/perpendicular.inl @@ -0,0 +1,10 @@ +/// @ref gtx_perpendicular + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) + { + return x - proj(x, Normal); + } +}//namespace glm diff --git a/include/glm/glm/gtx/polar_coordinates.hpp b/include/glm/glm/gtx/polar_coordinates.hpp new file mode 100644 index 00000000..76beb82b --- /dev/null +++ b/include/glm/glm/gtx/polar_coordinates.hpp @@ -0,0 +1,48 @@ +/// @ref gtx_polar_coordinates +/// @file glm/gtx/polar_coordinates.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Conversion from Euclidean space to polar space and revert. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_polar_coordinates is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_polar_coordinates extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_polar_coordinates + /// @{ + + /// Convert Euclidean to Polar coordinates, x is the latitude, y the longitude and z the xz distance. + /// + /// @see gtx_polar_coordinates + template + GLM_FUNC_DECL vec<3, T, Q> polar( + vec<3, T, Q> const& euclidean); + + /// Convert Polar to Euclidean coordinates. + /// + /// @see gtx_polar_coordinates + template + GLM_FUNC_DECL vec<3, T, Q> euclidean( + vec<2, T, Q> const& polar); + + /// @} +}//namespace glm + +#include "polar_coordinates.inl" diff --git a/include/glm/glm/gtx/polar_coordinates.inl b/include/glm/glm/gtx/polar_coordinates.inl new file mode 100644 index 00000000..371c8ddd --- /dev/null +++ b/include/glm/glm/gtx/polar_coordinates.inl @@ -0,0 +1,36 @@ +/// @ref gtx_polar_coordinates + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> polar + ( + vec<3, T, Q> const& euclidean + ) + { + T const Length(length(euclidean)); + vec<3, T, Q> const tmp(euclidean / Length); + T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); + + return vec<3, T, Q>( + asin(tmp.y), // latitude + atan(tmp.x, tmp.z), // longitude + xz_dist); // xz distance + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean + ( + vec<2, T, Q> const& polar + ) + { + T const latitude(polar.x); + T const longitude(polar.y); + + return vec<3, T, Q>( + cos(latitude) * sin(longitude), + sin(latitude), + cos(latitude) * cos(longitude)); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/projection.hpp b/include/glm/glm/gtx/projection.hpp new file mode 100644 index 00000000..678f3ad5 --- /dev/null +++ b/include/glm/glm/gtx/projection.hpp @@ -0,0 +1,43 @@ +/// @ref gtx_projection +/// @file glm/gtx/projection.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_projection GLM_GTX_projection +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Projection of a vector to other one + +#pragma once + +// Dependency: +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_projection extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_projection + /// @{ + + /// Projects x on Normal. + /// + /// @param[in] x A vector to project + /// @param[in] Normal A normal that doesn't need to be of unit length. + /// + /// @see gtx_projection + template + GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); + + /// @} +}//namespace glm + +#include "projection.inl" diff --git a/include/glm/glm/gtx/projection.inl b/include/glm/glm/gtx/projection.inl new file mode 100644 index 00000000..f23f884f --- /dev/null +++ b/include/glm/glm/gtx/projection.inl @@ -0,0 +1,10 @@ +/// @ref gtx_projection + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) + { + return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; + } +}//namespace glm diff --git a/include/glm/glm/gtx/quaternion.hpp b/include/glm/glm/gtx/quaternion.hpp new file mode 100644 index 00000000..5c2b5ad0 --- /dev/null +++ b/include/glm/glm/gtx/quaternion.hpp @@ -0,0 +1,174 @@ +/// @ref gtx_quaternion +/// @file glm/gtx/quaternion.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_quaternion GLM_GTX_quaternion +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extented quaternion types and functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/quaternion.hpp" +#include "../ext/quaternion_exponential.hpp" +#include "../gtx/norm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_quaternion extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_quaternion + /// @{ + + /// Create an identity quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL GLM_CONSTEXPR qua quat_identity(); + + /// Compute a cross product between a quaternion and a vector. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> cross( + qua const& q, + vec<3, T, Q> const& v); + + //! Compute a cross product between a vector and a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> cross( + vec<3, T, Q> const& v, + qua const& q); + + //! Compute a point on a path according squad equation. + //! q1 and q2 are control points; s1 and s2 are intermediate control points. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua squad( + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, + T const& h); + + //! Returns an intermediate control point for squad interpolation. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua intermediate( + qua const& prev, + qua const& curr, + qua const& next); + + //! Returns quarternion square root. + /// + /// @see gtx_quaternion + //template + //qua sqrt( + // qua const& q); + + //! Rotates a 3 components vector by a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + qua const& q, + vec<3, T, Q> const& v); + + /// Rotates a 4 components vector by a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + qua const& q, + vec<4, T, Q> const& v); + + /// Extract the real component of a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL T extractRealComponent( + qua const& q); + + /// Converts a quaternion to a 3 * 3 matrix. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL mat<3, 3, T, Q> toMat3( + qua const& x){return mat3_cast(x);} + + /// Converts a quaternion to a 4 * 4 matrix. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL mat<4, 4, T, Q> toMat4( + qua const& x){return mat4_cast(x);} + + /// Converts a 3 * 3 matrix to a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua toQuat( + mat<3, 3, T, Q> const& x){return quat_cast(x);} + + /// Converts a 4 * 4 matrix to a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua toQuat( + mat<4, 4, T, Q> const& x){return quat_cast(x);} + + /// Quaternion interpolation using the rotation short path. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua shortMix( + qua const& x, + qua const& y, + T const& a); + + /// Quaternion normalized linear interpolation. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua fastMix( + qua const& x, + qua const& y, + T const& a); + + /// Compute the rotation between two vectors. + /// @param orig vector, needs to be normalized + /// @param dest vector, needs to be normalized + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua rotation( + vec<3, T, Q> const& orig, + vec<3, T, Q> const& dest); + + /// Returns the squared length of x. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL GLM_CONSTEXPR T length2(qua const& q); + + /// @} +}//namespace glm + +#include "quaternion.inl" diff --git a/include/glm/glm/gtx/quaternion.inl b/include/glm/glm/gtx/quaternion.inl new file mode 100644 index 00000000..d125bccc --- /dev/null +++ b/include/glm/glm/gtx/quaternion.inl @@ -0,0 +1,159 @@ +/// @ref gtx_quaternion + +#include +#include "../gtc/constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua quat_identity() + { + return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, qua const& q) + { + return inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(qua const& q, vec<3, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER qua squad + ( + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, + T const& h) + { + return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast(2) * (static_cast(1) - h) * h); + } + + template + GLM_FUNC_QUALIFIER qua intermediate + ( + qua const& prev, + qua const& curr, + qua const& next + ) + { + qua invQuat = inverse(curr); + return exp((log(next * invQuat) + log(prev * invQuat)) / static_cast(-4)) * curr; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(qua const& q, vec<3, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(qua const& q, vec<4, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER T extractRealComponent(qua const& q) + { + T w = static_cast(1) - q.x * q.x - q.y * q.y - q.z * q.z; + if(w < T(0)) + return T(0); + else + return -sqrt(w); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T length2(qua const& q) + { + return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; + } + + template + GLM_FUNC_QUALIFIER qua shortMix(qua const& x, qua const& y, T const& a) + { + if(a <= static_cast(0)) return x; + if(a >= static_cast(1)) return y; + + T fCos = dot(x, y); + qua y2(y); //BUG!!! qua y2; + if(fCos < static_cast(0)) + { + y2 = -y; + fCos = -fCos; + } + + //if(fCos > 1.0f) // problem + T k0, k1; + if(fCos > (static_cast(1) - epsilon())) + { + k0 = static_cast(1) - a; + k1 = static_cast(0) + a; //BUG!!! 1.0f + a; + } + else + { + T fSin = sqrt(T(1) - fCos * fCos); + T fAngle = atan(fSin, fCos); + T fOneOverSin = static_cast(1) / fSin; + k0 = sin((static_cast(1) - a) * fAngle) * fOneOverSin; + k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; + } + + return qua( + k0 * x.w + k1 * y2.w, + k0 * x.x + k1 * y2.x, + k0 * x.y + k1 * y2.y, + k0 * x.z + k1 * y2.z); + } + + template + GLM_FUNC_QUALIFIER qua fastMix(qua const& x, qua const& y, T const& a) + { + return glm::normalize(x * (static_cast(1) - a) + (y * a)); + } + + template + GLM_FUNC_QUALIFIER qua rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) + { + T cosTheta = dot(orig, dest); + vec<3, T, Q> rotationAxis; + + if(cosTheta >= static_cast(1) - epsilon()) { + // orig and dest point in the same direction + return quat_identity(); + } + + if(cosTheta < static_cast(-1) + epsilon()) + { + // special case when vectors in opposite directions : + // there is no "ideal" rotation axis + // So guess one; any will do as long as it's perpendicular to start + // This implementation favors a rotation around the Up axis (Y), + // since it's often what you want to do. + rotationAxis = cross(vec<3, T, Q>(0, 0, 1), orig); + if(length2(rotationAxis) < epsilon()) // bad luck, they were parallel, try again! + rotationAxis = cross(vec<3, T, Q>(1, 0, 0), orig); + + rotationAxis = normalize(rotationAxis); + return angleAxis(pi(), rotationAxis); + } + + // Implementation from Stan Melax's Game Programming Gems 1 article + rotationAxis = cross(orig, dest); + + T s = sqrt((T(1) + cosTheta) * static_cast(2)); + T invs = static_cast(1) / s; + + return qua( + s * static_cast(0.5f), + rotationAxis.x * invs, + rotationAxis.y * invs, + rotationAxis.z * invs); + } +}//namespace glm diff --git a/include/glm/glm/gtx/range.hpp b/include/glm/glm/gtx/range.hpp new file mode 100644 index 00000000..93bcb9a6 --- /dev/null +++ b/include/glm/glm/gtx/range.hpp @@ -0,0 +1,98 @@ +/// @ref gtx_range +/// @file glm/gtx/range.hpp +/// @author Joshua Moerman +/// +/// @defgroup gtx_range GLM_GTX_range +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines begin and end for vectors and matrices. Useful for range-based for loop. +/// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_range is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_range extension included") +# endif +#endif + +#include "../gtc/type_ptr.hpp" +#include "../gtc/vec1.hpp" + +namespace glm +{ + /// @addtogroup gtx_range + /// @{ + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4100) // unreferenced formal parameter +# endif + + template + inline length_t components(vec<1, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<2, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<3, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<4, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(genType const& m) + { + return m.length() * m[0].length(); + } + + template + inline typename genType::value_type const * begin(genType const& v) + { + return value_ptr(v); + } + + template + inline typename genType::value_type const * end(genType const& v) + { + return begin(v) + components(v); + } + + template + inline typename genType::value_type * begin(genType& v) + { + return value_ptr(v); + } + + template + inline typename genType::value_type * end(genType& v) + { + return begin(v) + components(v); + } + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + + /// @} +}//namespace glm diff --git a/include/glm/glm/gtx/raw_data.hpp b/include/glm/glm/gtx/raw_data.hpp new file mode 100644 index 00000000..86cbe77d --- /dev/null +++ b/include/glm/glm/gtx/raw_data.hpp @@ -0,0 +1,51 @@ +/// @ref gtx_raw_data +/// @file glm/gtx/raw_data.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_raw_data GLM_GTX_raw_data +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Projection of a vector to other one + +#pragma once + +// Dependencies +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_raw_data is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_raw_data extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_raw_data + /// @{ + + //! Type for byte numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint8 byte; + + //! Type for word numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint16 word; + + //! Type for dword numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint32 dword; + + //! Type for qword numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint64 qword; + + /// @} +}// namespace glm + +#include "raw_data.inl" diff --git a/include/glm/glm/gtx/raw_data.inl b/include/glm/glm/gtx/raw_data.inl new file mode 100644 index 00000000..c740317d --- /dev/null +++ b/include/glm/glm/gtx/raw_data.inl @@ -0,0 +1,2 @@ +/// @ref gtx_raw_data + diff --git a/include/glm/glm/gtx/rotate_normalized_axis.hpp b/include/glm/glm/gtx/rotate_normalized_axis.hpp new file mode 100644 index 00000000..2103ca08 --- /dev/null +++ b/include/glm/glm/gtx/rotate_normalized_axis.hpp @@ -0,0 +1,68 @@ +/// @ref gtx_rotate_normalized_axis +/// @file glm/gtx/rotate_normalized_axis.hpp +/// +/// @see core (dependence) +/// @see gtc_matrix_transform +/// @see gtc_quaternion +/// +/// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Quaternions and matrices rotations around normalized axis. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/epsilon.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_rotate_normalized_axis is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_rotate_normalized_axis + /// @{ + + /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. + /// + /// @param m Input matrix multiplied by this rotation matrix. + /// @param angle Rotation angle expressed in radians. + /// @param axis Rotation axis, must be normalized. + /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. + /// + /// @see gtx_rotate_normalized_axis + /// @see - rotate(T angle, T x, T y, T z) + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotateNormalizedAxis( + mat<4, 4, T, Q> const& m, + T const& angle, + vec<3, T, Q> const& axis); + + /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. + /// + /// @param q Source orientation + /// @param angle Angle expressed in radians. + /// @param axis Normalized axis of the rotation, must be normalized. + /// + /// @see gtx_rotate_normalized_axis + template + GLM_FUNC_DECL qua rotateNormalizedAxis( + qua const& q, + T const& angle, + vec<3, T, Q> const& axis); + + /// @} +}//namespace glm + +#include "rotate_normalized_axis.inl" diff --git a/include/glm/glm/gtx/rotate_normalized_axis.inl b/include/glm/glm/gtx/rotate_normalized_axis.inl new file mode 100644 index 00000000..b2e9278c --- /dev/null +++ b/include/glm/glm/gtx/rotate_normalized_axis.inl @@ -0,0 +1,58 @@ +/// @ref gtx_rotate_normalized_axis + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotateNormalizedAxis + ( + mat<4, 4, T, Q> const& m, + T const& angle, + vec<3, T, Q> const& v + ) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + vec<3, T, Q> const axis(v); + + vec<3, T, Q> const temp((static_cast(1) - c) * axis); + + mat<4, 4, T, Q> Rotate; + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER qua rotateNormalizedAxis + ( + qua const& q, + T const& angle, + vec<3, T, Q> const& v + ) + { + vec<3, T, Q> const Tmp(v); + + T const AngleRad(angle); + T const Sin = sin(AngleRad * T(0.5)); + + return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/rotate_vector.hpp b/include/glm/glm/gtx/rotate_vector.hpp new file mode 100644 index 00000000..dcd5b95a --- /dev/null +++ b/include/glm/glm/gtx/rotate_vector.hpp @@ -0,0 +1,123 @@ +/// @ref gtx_rotate_vector +/// @file glm/gtx/rotate_vector.hpp +/// +/// @see core (dependence) +/// @see gtx_transform (dependence) +/// +/// @defgroup gtx_rotate_vector GLM_GTX_rotate_vector +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Function to directly rotate a vector + +#pragma once + +// Dependency: +#include "../gtx/transform.hpp" +#include "../gtc/epsilon.hpp" +#include "../ext/vector_relational.hpp" +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_rotate_vector extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_rotate_vector + /// @{ + + /// Returns Spherical interpolation between two vectors + /// + /// @param x A first vector + /// @param y A second vector + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @see gtx_rotate_vector + template + GLM_FUNC_DECL vec<3, T, Q> slerp( + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, + T const& a); + + //! Rotate a two dimensional vector. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<2, T, Q> rotate( + vec<2, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + vec<3, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal); + + //! Rotate a four dimensional vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + vec<4, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal); + + //! Rotate a three dimensional vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateX( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around the Y axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateY( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around the Z axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateZ( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateX( + vec<4, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the Y axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateY( + vec<4, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the Z axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateZ( + vec<4, T, Q> const& v, + T const& angle); + + //! Build a rotation matrix from a normal and a up vector. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientation( + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up); + + /// @} +}//namespace glm + +#include "rotate_vector.inl" diff --git a/include/glm/glm/gtx/rotate_vector.inl b/include/glm/glm/gtx/rotate_vector.inl new file mode 100644 index 00000000..f8136e76 --- /dev/null +++ b/include/glm/glm/gtx/rotate_vector.inl @@ -0,0 +1,187 @@ +/// @ref gtx_rotate_vector + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> slerp + ( + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, + T const& a + ) + { + // get cosine of angle between vectors (-1 -> 1) + T CosAlpha = dot(x, y); + // get angle (0 -> pi) + T Alpha = acos(CosAlpha); + // get sine of angle between vectors (0 -> 1) + T SinAlpha = sin(Alpha); + // this breaks down when SinAlpha = 0, i.e. Alpha = 0 or pi + T t1 = sin((static_cast(1) - a) * Alpha) / SinAlpha; + T t2 = sin(a * Alpha) / SinAlpha; + + // interpolate src vectors + return x * t1 + y * t2; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> rotate + ( + vec<2, T, Q> const& v, + T const& angle + ) + { + vec<2, T, Q> Result; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate + ( + vec<3, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal + ) + { + return mat<3, 3, T, Q>(glm::rotate(angle, normal)) * v; + } + /* + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateGTX( + const vec<3, T, Q>& x, + T angle, + const vec<3, T, Q>& normal) + { + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; + } + */ + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate + ( + vec<4, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal + ) + { + return rotate(angle, normal) * v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateX + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result(v); + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateY + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateZ + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateX + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateY + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateZ + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientation + ( + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up + ) + { + if(all(equal(Normal, Up, epsilon()))) + return mat<4, 4, T, Q>(static_cast(1)); + + vec<3, T, Q> RotationAxis = cross(Up, Normal); + T Angle = acos(dot(Normal, Up)); + + return rotate(Angle, RotationAxis); + } +}//namespace glm diff --git a/include/glm/glm/gtx/scalar_multiplication.hpp b/include/glm/glm/gtx/scalar_multiplication.hpp new file mode 100644 index 00000000..496ba193 --- /dev/null +++ b/include/glm/glm/gtx/scalar_multiplication.hpp @@ -0,0 +1,75 @@ +/// @ref gtx +/// @file glm/gtx/scalar_multiplication.hpp +/// @author Joshua Moerman +/// +/// Include to use the features of this extension. +/// +/// Enables scalar multiplication for all types +/// +/// Since GLSL is very strict about types, the following (often used) combinations do not work: +/// double * vec4 +/// int * vec4 +/// vec4 / int +/// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_scalar_multiplication is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_scalar_multiplication extension included") +# endif +#endif + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../mat2x2.hpp" +#include + +namespace glm +{ + template + using return_type_scalar_multiplication = typename std::enable_if< + !std::is_same::value // T may not be a float + && std::is_arithmetic::value, Vec // But it may be an int or double (no vec3 or mat3, ...) + >::type; + +#define GLM_IMPLEMENT_SCAL_MULT(Vec) \ + template \ + return_type_scalar_multiplication \ + operator*(T const& s, Vec rh){ \ + return rh *= static_cast(s); \ + } \ + \ + template \ + return_type_scalar_multiplication \ + operator*(Vec lh, T const& s){ \ + return lh *= static_cast(s); \ + } \ + \ + template \ + return_type_scalar_multiplication \ + operator/(Vec lh, T const& s){ \ + return lh *= 1.0f / static_cast(s); \ + } + +GLM_IMPLEMENT_SCAL_MULT(vec2) +GLM_IMPLEMENT_SCAL_MULT(vec3) +GLM_IMPLEMENT_SCAL_MULT(vec4) + +GLM_IMPLEMENT_SCAL_MULT(mat2) +GLM_IMPLEMENT_SCAL_MULT(mat2x3) +GLM_IMPLEMENT_SCAL_MULT(mat2x4) +GLM_IMPLEMENT_SCAL_MULT(mat3x2) +GLM_IMPLEMENT_SCAL_MULT(mat3) +GLM_IMPLEMENT_SCAL_MULT(mat3x4) +GLM_IMPLEMENT_SCAL_MULT(mat4x2) +GLM_IMPLEMENT_SCAL_MULT(mat4x3) +GLM_IMPLEMENT_SCAL_MULT(mat4) + +#undef GLM_IMPLEMENT_SCAL_MULT +} // namespace glm diff --git a/include/glm/glm/gtx/scalar_relational.hpp b/include/glm/glm/gtx/scalar_relational.hpp new file mode 100644 index 00000000..8be9c57b --- /dev/null +++ b/include/glm/glm/gtx/scalar_relational.hpp @@ -0,0 +1,36 @@ +/// @ref gtx_scalar_relational +/// @file glm/gtx/scalar_relational.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extend a position from a source to a position at a defined length. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extend extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_scalar_relational + /// @{ + + + + /// @} +}//namespace glm + +#include "scalar_relational.inl" diff --git a/include/glm/glm/gtx/scalar_relational.inl b/include/glm/glm/gtx/scalar_relational.inl new file mode 100644 index 00000000..c2a121cf --- /dev/null +++ b/include/glm/glm/gtx/scalar_relational.inl @@ -0,0 +1,88 @@ +/// @ref gtx_scalar_relational + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool lessThan + ( + T const& x, + T const& y + ) + { + return x < y; + } + + template + GLM_FUNC_QUALIFIER bool lessThanEqual + ( + T const& x, + T const& y + ) + { + return x <= y; + } + + template + GLM_FUNC_QUALIFIER bool greaterThan + ( + T const& x, + T const& y + ) + { + return x > y; + } + + template + GLM_FUNC_QUALIFIER bool greaterThanEqual + ( + T const& x, + T const& y + ) + { + return x >= y; + } + + template + GLM_FUNC_QUALIFIER bool equal + ( + T const& x, + T const& y + ) + { + return detail::compute_equal::is_iec559>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER bool notEqual + ( + T const& x, + T const& y + ) + { + return !detail::compute_equal::is_iec559>::call(x, y); + } + + GLM_FUNC_QUALIFIER bool any + ( + bool const& x + ) + { + return x; + } + + GLM_FUNC_QUALIFIER bool all + ( + bool const& x + ) + { + return x; + } + + GLM_FUNC_QUALIFIER bool not_ + ( + bool const& x + ) + { + return !x; + } +}//namespace glm diff --git a/include/glm/glm/gtx/spline.hpp b/include/glm/glm/gtx/spline.hpp new file mode 100644 index 00000000..731c979e --- /dev/null +++ b/include/glm/glm/gtx/spline.hpp @@ -0,0 +1,65 @@ +/// @ref gtx_spline +/// @file glm/gtx/spline.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_spline GLM_GTX_spline +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Spline functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_spline is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_spline extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_spline + /// @{ + + /// Return a point from a catmull rom curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType catmullRom( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s); + + /// Return a point from a hermite curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType hermite( + genType const& v1, + genType const& t1, + genType const& v2, + genType const& t2, + typename genType::value_type const& s); + + /// Return a point from a cubic curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType cubic( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s); + + /// @} +}//namespace glm + +#include "spline.inl" diff --git a/include/glm/glm/gtx/spline.inl b/include/glm/glm/gtx/spline.inl new file mode 100644 index 00000000..c3fd0565 --- /dev/null +++ b/include/glm/glm/gtx/spline.inl @@ -0,0 +1,60 @@ +/// @ref gtx_spline + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType catmullRom + ( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s + ) + { + typename genType::value_type s2 = pow2(s); + typename genType::value_type s3 = pow3(s); + + typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; + typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); + typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; + typename genType::value_type f4 = s3 - s2; + + return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); + + } + + template + GLM_FUNC_QUALIFIER genType hermite + ( + genType const& v1, + genType const& t1, + genType const& v2, + genType const& t2, + typename genType::value_type const& s + ) + { + typename genType::value_type s2 = pow2(s); + typename genType::value_type s3 = pow3(s); + + typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); + typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; + typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; + typename genType::value_type f4 = s3 - s2; + + return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; + } + + template + GLM_FUNC_QUALIFIER genType cubic + ( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s + ) + { + return ((v1 * s + v2) * s + v3) * s + v4; + } +}//namespace glm diff --git a/include/glm/glm/gtx/std_based_type.hpp b/include/glm/glm/gtx/std_based_type.hpp new file mode 100644 index 00000000..cd3be8cb --- /dev/null +++ b/include/glm/glm/gtx/std_based_type.hpp @@ -0,0 +1,68 @@ +/// @ref gtx_std_based_type +/// @file glm/gtx/std_based_type.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_std_based_type GLM_GTX_std_based_type +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Adds vector types based on STL value types. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_std_based_type is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_std_based_type extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_std_based_type + /// @{ + + /// Vector type based of one std::size_t component. + /// @see GLM_GTX_std_based_type + typedef vec<1, std::size_t, defaultp> size1; + + /// Vector type based of two std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<2, std::size_t, defaultp> size2; + + /// Vector type based of three std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<3, std::size_t, defaultp> size3; + + /// Vector type based of four std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<4, std::size_t, defaultp> size4; + + /// Vector type based of one std::size_t component. + /// @see GLM_GTX_std_based_type + typedef vec<1, std::size_t, defaultp> size1_t; + + /// Vector type based of two std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<2, std::size_t, defaultp> size2_t; + + /// Vector type based of three std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<3, std::size_t, defaultp> size3_t; + + /// Vector type based of four std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<4, std::size_t, defaultp> size4_t; + + /// @} +}//namespace glm + +#include "std_based_type.inl" diff --git a/include/glm/glm/gtx/std_based_type.inl b/include/glm/glm/gtx/std_based_type.inl new file mode 100644 index 00000000..9c34bdb6 --- /dev/null +++ b/include/glm/glm/gtx/std_based_type.inl @@ -0,0 +1,6 @@ +/// @ref gtx_std_based_type + +namespace glm +{ + +} diff --git a/include/glm/glm/gtx/string_cast.hpp b/include/glm/glm/gtx/string_cast.hpp new file mode 100644 index 00000000..27846bf8 --- /dev/null +++ b/include/glm/glm/gtx/string_cast.hpp @@ -0,0 +1,52 @@ +/// @ref gtx_string_cast +/// @file glm/gtx/string_cast.hpp +/// +/// @see core (dependence) +/// @see gtx_integer (dependence) +/// @see gtx_quaternion (dependence) +/// +/// @defgroup gtx_string_cast GLM_GTX_string_cast +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Setup strings for GLM type values +/// +/// This extension is not supported with CUDA + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" +#include +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_string_cast extension included") +# endif +#endif + +#if(GLM_COMPILER & GLM_COMPILER_CUDA) +# error "GLM_GTX_string_cast is not supported on CUDA compiler" +#endif + +namespace glm +{ + /// @addtogroup gtx_string_cast + /// @{ + + /// Create a string from a GLM vector or matrix typed variable. + /// @see gtx_string_cast extension. + template + GLM_FUNC_DECL std::string to_string(genType const& x); + + /// @} +}//namespace glm + +#include "string_cast.inl" diff --git a/include/glm/glm/gtx/string_cast.inl b/include/glm/glm/gtx/string_cast.inl new file mode 100644 index 00000000..f67751d4 --- /dev/null +++ b/include/glm/glm/gtx/string_cast.inl @@ -0,0 +1,492 @@ +/// @ref gtx_string_cast + +#include +#include + +namespace glm{ +namespace detail +{ + template + struct cast + { + typedef T value_type; + }; + + template <> + struct cast + { + typedef double value_type; + }; + + GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) + { + std::size_t const STRING_BUFFER(4096); + char text[STRING_BUFFER]; + va_list list; + + if(msg == GLM_NULLPTR) + return std::string(); + + va_start(list, msg); +# if (GLM_COMPILER & GLM_COMPILER_VC) + vsprintf_s(text, STRING_BUFFER, msg, list); +# else// + std::vsprintf(text, msg, list); +# endif// + va_end(list); + + return std::string(text); + } + + static const char* LabelTrue = "true"; + static const char* LabelFalse = "false"; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%d";} + }; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%f";} + }; + +# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + template<> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} + }; + + template<> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} + }; +# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + + template + struct prefix{}; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "d";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "b";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u8";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i8";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u16";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i16";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u64";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i64";} + }; + + template + struct compute_to_string + {}; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<1, bool, Q> const& x) + { + return detail::format("bvec1(%s)", + x[0] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<2, bool, Q> const& x) + { + return detail::format("bvec2(%s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<3, bool, Q> const& x) + { + return detail::format("bvec3(%s, %s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse, + x[2] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<4, bool, Q> const& x) + { + return detail::format("bvec4(%s, %s, %s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse, + x[2] ? detail::LabelTrue : detail::LabelFalse, + x[3] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<1, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec1(%s)", + PrefixStr, + LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec2(%s, %s)", + PrefixStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec3(%s, %s, %s)", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1]), + static_cast::value_type>(x[2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec4(%s, %s, %s, %s)", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1]), + static_cast::value_type>(x[2]), + static_cast::value_type>(x[3])); + } + }; + + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x2((%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x3((%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x4((%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x2((%s, %s), (%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x2((%s, %s), (%s, %s), (%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2]), static_cast::value_type>(x[3][3])); + } + }; + + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(qua const& q) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%squat(%s, {%s, %s, %s})", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(q.w), + static_cast::value_type>(q.x), + static_cast::value_type>(q.y), + static_cast::value_type>(q.z)); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(tdualquat const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%sdualquat((%s, {%s, %s, %s}), (%s, {%s, %s, %s}))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x.real.w), + static_cast::value_type>(x.real.x), + static_cast::value_type>(x.real.y), + static_cast::value_type>(x.real.z), + static_cast::value_type>(x.dual.w), + static_cast::value_type>(x.dual.x), + static_cast::value_type>(x.dual.y), + static_cast::value_type>(x.dual.z)); + } + }; + +}//namespace detail + +template +GLM_FUNC_QUALIFIER std::string to_string(matType const& x) +{ + return detail::compute_to_string::call(x); +} + +}//namespace glm diff --git a/include/glm/glm/gtx/texture.hpp b/include/glm/glm/gtx/texture.hpp new file mode 100644 index 00000000..20585e68 --- /dev/null +++ b/include/glm/glm/gtx/texture.hpp @@ -0,0 +1,46 @@ +/// @ref gtx_texture +/// @file glm/gtx/texture.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_texture GLM_GTX_texture +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Wrapping mode of texture coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/integer.hpp" +#include "../gtx/component_wise.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_texture is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_texture extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_texture + /// @{ + + /// Compute the number of mipmaps levels necessary to create a mipmap complete texture + /// + /// @param Extent Extent of the texture base level mipmap + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + template + T levels(vec const& Extent); + + /// @} +}// namespace glm + +#include "texture.inl" + diff --git a/include/glm/glm/gtx/texture.inl b/include/glm/glm/gtx/texture.inl new file mode 100644 index 00000000..593c8261 --- /dev/null +++ b/include/glm/glm/gtx/texture.inl @@ -0,0 +1,17 @@ +/// @ref gtx_texture + +namespace glm +{ + template + inline T levels(vec const& Extent) + { + return glm::log2(compMax(Extent)) + static_cast(1); + } + + template + inline T levels(T Extent) + { + return vec<1, T, defaultp>(Extent).x; + } +}//namespace glm + diff --git a/include/glm/glm/gtx/transform.hpp b/include/glm/glm/gtx/transform.hpp new file mode 100644 index 00000000..0279fc8b --- /dev/null +++ b/include/glm/glm/gtx/transform.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_transform +/// @file glm/gtx/transform.hpp +/// +/// @see core (dependence) +/// @see gtc_matrix_transform (dependence) +/// @see gtx_transform +/// @see gtx_transform2 +/// +/// @defgroup gtx_transform GLM_GTX_transform +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add transformation matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_transform is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_transform extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_transform + /// @{ + + /// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + vec<3, T, Q> const& v); + + /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + T angle, + vec<3, T, Q> const& v); + + /// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + vec<3, T, Q> const& v); + + /// @} +}// namespace glm + +#include "transform.inl" diff --git a/include/glm/glm/gtx/transform.inl b/include/glm/glm/gtx/transform.inl new file mode 100644 index 00000000..48ee6801 --- /dev/null +++ b/include/glm/glm/gtx/transform.inl @@ -0,0 +1,23 @@ +/// @ref gtx_transform + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) + { + return translate(mat<4, 4, T, Q>(static_cast(1)), v); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) + { + return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) + { + return scale(mat<4, 4, T, Q>(static_cast(1)), v); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/transform2.hpp b/include/glm/glm/gtx/transform2.hpp new file mode 100644 index 00000000..0d8ba9d9 --- /dev/null +++ b/include/glm/glm/gtx/transform2.hpp @@ -0,0 +1,89 @@ +/// @ref gtx_transform2 +/// @file glm/gtx/transform2.hpp +/// +/// @see core (dependence) +/// @see gtx_transform (dependence) +/// +/// @defgroup gtx_transform2 GLM_GTX_transform2 +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add extra transformation matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_transform2 extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_transform2 + /// @{ + + //! Transforms a matrix with a shearing on X axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T y); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T x); + + //! Transforms a matrix with a shearing on X axis + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T y, T z); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T x, T z); + + //! Transforms a matrix with a shearing on Z axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T x, T y); + + //template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(const mat<4, 4, T, Q> & m, shearPlane, planePoint, angle) + // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 + // - dot(PointOnPlane, normal) * OnPlaneVector 1 + + // Reflect functions seem to don't work + //template mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //template mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> proj2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal); + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> proj3D(mat<4, 4, T, Q> const & m, vec<3, T, Q> const& normal); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(T scale, T bias); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias); + + /// @} +}// namespace glm + +#include "transform2.inl" diff --git a/include/glm/glm/gtx/transform2.inl b/include/glm/glm/gtx/transform2.inl new file mode 100644 index 00000000..2b53198b --- /dev/null +++ b/include/glm/glm/gtx/transform2.inl @@ -0,0 +1,125 @@ +/// @ref gtx_transform2 + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T s) + { + mat<3, 3, T, Q> r(1); + r[1][0] = s; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T s) + { + mat<3, 3, T, Q> r(1); + r[0][1] = s; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[0][1] = s; + r[0][2] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[1][0] = s; + r[1][2] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[2][0] = s; + r[2][1] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal) + { + mat<3, 3, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; + r[0][1] = -static_cast(2) * normal.x * normal.y; + r[1][0] = -static_cast(2) * normal.x * normal.y; + r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal) + { + mat<4, 4, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; + r[0][1] = -static_cast(2) * normal.x * normal.y; + r[0][2] = -static_cast(2) * normal.x * normal.z; + + r[1][0] = -static_cast(2) * normal.x * normal.y; + r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; + r[1][2] = -static_cast(2) * normal.y * normal.z; + + r[2][0] = -static_cast(2) * normal.x * normal.z; + r[2][1] = -static_cast(2) * normal.y * normal.z; + r[2][2] = static_cast(1) - static_cast(2) * normal.z * normal.z; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> proj2D( + const mat<3, 3, T, Q>& m, + const vec<3, T, Q>& normal) + { + mat<3, 3, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[1][0] = - normal.x * normal.y; + r[1][1] = static_cast(1) - normal.y * normal.y; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> proj3D( + const mat<4, 4, T, Q>& m, + const vec<3, T, Q>& normal) + { + mat<4, 4, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[0][2] = - normal.x * normal.z; + r[1][0] = - normal.x * normal.y; + r[1][1] = static_cast(1) - normal.y * normal.y; + r[1][2] = - normal.y * normal.z; + r[2][0] = - normal.x * normal.z; + r[2][1] = - normal.y * normal.z; + r[2][2] = static_cast(1) - normal.z * normal.z; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(T scale, T bias) + { + mat<4, 4, T, Q> result; + result[3] = vec<4, T, Q>(vec<3, T, Q>(bias), static_cast(1)); + result[0][0] = scale; + result[1][1] = scale; + result[2][2] = scale; + return result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias) + { + return m * scaleBias(scale, bias); + } +}//namespace glm + diff --git a/include/glm/glm/gtx/type_aligned.hpp b/include/glm/glm/gtx/type_aligned.hpp new file mode 100644 index 00000000..2ae522c1 --- /dev/null +++ b/include/glm/glm/gtx/type_aligned.hpp @@ -0,0 +1,982 @@ +/// @ref gtx_type_aligned +/// @file glm/gtx/type_aligned.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_type_aligned GLM_GTX_type_aligned +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines aligned types. + +#pragma once + +// Dependency: +#include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_type_aligned extension included") +# endif +#endif + +namespace glm +{ + /////////////////////////// + // Signed int vector types + + /// @addtogroup gtx_type_aligned + /// @{ + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8); + + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8); + + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8); + + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec1, aligned_ivec1, 4); + + /// Default qualifier 32 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec2, aligned_ivec2, 8); + + /// Default qualifier 32 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec3, aligned_ivec3, 16); + + /// Default qualifier 32 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec4, aligned_ivec4, 16); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec1, aligned_i8vec1, 1); + + /// Default qualifier 8 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec2, aligned_i8vec2, 2); + + /// Default qualifier 8 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec3, aligned_i8vec3, 4); + + /// Default qualifier 8 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec4, aligned_i8vec4, 4); + + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec1, aligned_i16vec1, 2); + + /// Default qualifier 16 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec2, aligned_i16vec2, 4); + + /// Default qualifier 16 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec3, aligned_i16vec3, 8); + + /// Default qualifier 16 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec4, aligned_i16vec4, 8); + + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec1, aligned_i32vec1, 4); + + /// Default qualifier 32 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec2, aligned_i32vec2, 8); + + /// Default qualifier 32 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec3, aligned_i32vec3, 16); + + /// Default qualifier 32 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec4, aligned_i32vec4, 16); + + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec1, aligned_i64vec1, 8); + + /// Default qualifier 64 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec2, aligned_i64vec2, 16); + + /// Default qualifier 64 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec3, aligned_i64vec3, 32); + + /// Default qualifier 64 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec4, aligned_i64vec4, 32); + + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8); + + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8); + + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8); + + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4); + + /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec2, aligned_uvec2, 8); + + /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec3, aligned_uvec3, 16); + + /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec4, aligned_uvec4, 16); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec1, aligned_u8vec1, 1); + + /// Default qualifier 8 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec2, aligned_u8vec2, 2); + + /// Default qualifier 8 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec3, aligned_u8vec3, 4); + + /// Default qualifier 8 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec4, aligned_u8vec4, 4); + + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec1, aligned_u16vec1, 2); + + /// Default qualifier 16 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec2, aligned_u16vec2, 4); + + /// Default qualifier 16 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec3, aligned_u16vec3, 8); + + /// Default qualifier 16 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec4, aligned_u16vec4, 8); + + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec1, aligned_u32vec1, 4); + + /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec2, aligned_u32vec2, 8); + + /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec3, aligned_u32vec3, 16); + + /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec4, aligned_u32vec4, 16); + + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec1, aligned_u64vec1, 8); + + /// Default qualifier 64 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec2, aligned_u64vec2, 16); + + /// Default qualifier 64 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec3, aligned_u64vec3, 32); + + /// Default qualifier 64 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec4, aligned_u64vec4, 32); + + + ////////////////////// + // Float vector types + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32, aligned_float32, 4); + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32_t, aligned_float32_t, 4); + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32, aligned_f32, 4); + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64, aligned_float64, 8); + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64_t, aligned_float64_t, 8); + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64, aligned_f64, 8); + +# endif//GLM_FORCE_SINGLE_ONLY + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec1, aligned_vec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec2, aligned_vec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec3, aligned_vec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec4, aligned_vec4, 16); + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec1, aligned_fvec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec2, aligned_fvec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec3, aligned_fvec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec4, aligned_fvec4, 16); + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec1, aligned_f32vec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec2, aligned_f32vec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec3, aligned_f32vec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec4, aligned_f32vec4, 16); + + + /// Double-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec1, aligned_dvec1, 8); + + /// Double-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec2, aligned_dvec2, 16); + + /// Double-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec3, aligned_dvec3, 32); + + /// Double-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec4, aligned_dvec4, 32); + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec1, aligned_f64vec1, 8); + + /// Double-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec2, aligned_f64vec2, 16); + + /// Double-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec3, aligned_f64vec3, 32); + + /// Double-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec4, aligned_f64vec4, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + ////////////////////// + // Float matrix types + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1 mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat2, aligned_mat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat3, aligned_mat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat4, aligned_mat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat2x2, aligned_mat2x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat3x3, aligned_mat3x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat4x4, aligned_mat4x4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 fmat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f32 fmat1x1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2x2, 16); + + /// Single-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x3, aligned_fmat2x3, 16); + + /// Single-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x4, aligned_fmat2x4, 16); + + /// Single-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x2, aligned_fmat3x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3x3, 16); + + /// Single-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x4, aligned_fmat3x4, 16); + + /// Single-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x2, aligned_fmat4x2, 16); + + /// Single-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x3, aligned_fmat4x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4x4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 f32mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f32 f32mat1x1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2x2, 16); + + /// Single-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x3, aligned_f32mat2x3, 16); + + /// Single-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x4, aligned_f32mat2x4, 16); + + /// Single-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x2, aligned_f32mat3x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3x3, 16); + + /// Single-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x4, aligned_f32mat3x4, 16); + + /// Single-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x2, aligned_f32mat4x2, 16); + + /// Single-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x3, aligned_f32mat4x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4x4, 16); + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 f64mat1; + + /// Double-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2, 32); + + /// Double-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3, 32); + + /// Double-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4, 32); + + + /// Double-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f64 f64mat1x1; + + /// Double-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2x2, 32); + + /// Double-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x3, aligned_f64mat2x3, 32); + + /// Double-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x4, aligned_f64mat2x4, 32); + + /// Double-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x2, aligned_f64mat3x2, 32); + + /// Double-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3x3, 32); + + /// Double-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x4, aligned_f64mat3x4, 32); + + /// Double-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x2, aligned_f64mat4x2, 32); + + /// Double-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x3, aligned_f64mat4x3, 32); + + /// Double-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4x4, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + + ////////////////////////// + // Quaternion types + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(quat, aligned_quat, 16); + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(quat, aligned_fquat, 16); + + /// Double-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dquat, aligned_dquat, 32); + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32quat, aligned_f32quat, 16); + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + /// @} +}//namespace glm + +#include "type_aligned.inl" diff --git a/include/glm/glm/gtx/type_aligned.inl b/include/glm/glm/gtx/type_aligned.inl new file mode 100644 index 00000000..54c1b818 --- /dev/null +++ b/include/glm/glm/gtx/type_aligned.inl @@ -0,0 +1,6 @@ +/// @ref gtc_type_aligned + +namespace glm +{ + +} diff --git a/include/glm/glm/gtx/type_trait.hpp b/include/glm/glm/gtx/type_trait.hpp new file mode 100644 index 00000000..56685c8c --- /dev/null +++ b/include/glm/glm/gtx/type_trait.hpp @@ -0,0 +1,85 @@ +/// @ref gtx_type_trait +/// @file glm/gtx/type_trait.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_type_trait GLM_GTX_type_trait +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines traits for each type. + +#pragma once + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_type_trait extension included") +# endif +#endif + +// Dependency: +#include "../detail/qualifier.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" + +namespace glm +{ + /// @addtogroup gtx_type_trait + /// @{ + + template + struct type + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = false; + static length_t const components = 0; + static length_t const cols = 0; + static length_t const rows = 0; + }; + + template + struct type > + { + static bool const is_vec = true; + static bool const is_mat = false; + static bool const is_quat = false; + static length_t const components = L; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = true; + static bool const is_quat = false; + static length_t const components = C; + static length_t const cols = C; + static length_t const rows = R; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = true; + static length_t const components = 4; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = true; + static length_t const components = 8; + }; + + /// @} +}//namespace glm + +#include "type_trait.inl" diff --git a/include/glm/glm/gtx/type_trait.inl b/include/glm/glm/gtx/type_trait.inl new file mode 100644 index 00000000..045de959 --- /dev/null +++ b/include/glm/glm/gtx/type_trait.inl @@ -0,0 +1,61 @@ +/// @ref gtx_type_trait + +namespace glm +{ + template + bool const type::is_vec; + template + bool const type::is_mat; + template + bool const type::is_quat; + template + length_t const type::components; + template + length_t const type::cols; + template + length_t const type::rows; + + // vec + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + + // mat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + template + length_t const type >::cols; + template + length_t const type >::rows; + + // tquat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + + // tdualquat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; +}//namespace glm diff --git a/include/glm/glm/gtx/vec_swizzle.hpp b/include/glm/glm/gtx/vec_swizzle.hpp new file mode 100644 index 00000000..1c49abcb --- /dev/null +++ b/include/glm/glm/gtx/vec_swizzle.hpp @@ -0,0 +1,2782 @@ +/// @ref gtx_vec_swizzle +/// @file glm/gtx/vec_swizzle.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_vec_swizzle GLM_GTX_vec_swizzle +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions to perform swizzle operation. + +#pragma once + +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vec_swizzle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vec_swizzle extension included") +# endif +#endif + +namespace glm { + // xx + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + // xy + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + // xz + template + GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.z); + } + + // xw + template + GLM_INLINE glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.w); + } + + // yx + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + // yy + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + // yz + template + GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.z); + } + + // yw + template + GLM_INLINE glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.w); + } + + // zx + template + GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.x); + } + + // zy + template + GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.y); + } + + // zz + template + GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.z); + } + + // zw + template + GLM_INLINE glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.w); + } + + // wx + template + GLM_INLINE glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.x); + } + + // wy + template + GLM_INLINE glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.y); + } + + // wz + template + GLM_INLINE glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.z); + } + + // ww + template + GLM_INLINE glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.w); + } + + // xxx + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + // xxy + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + // xxz + template + GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.z); + } + + // xxw + template + GLM_INLINE glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.w); + } + + // xyx + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + // xyy + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + // xyz + template + GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.z); + } + + // xyw + template + GLM_INLINE glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.w); + } + + // xzx + template + GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.x); + } + + // xzy + template + GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.y); + } + + // xzz + template + GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.z); + } + + // xzw + template + GLM_INLINE glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.w); + } + + // xwx + template + GLM_INLINE glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.x); + } + + // xwy + template + GLM_INLINE glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.y); + } + + // xwz + template + GLM_INLINE glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.z); + } + + // xww + template + GLM_INLINE glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.w); + } + + // yxx + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + // yxy + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + // yxz + template + GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.z); + } + + // yxw + template + GLM_INLINE glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.w); + } + + // yyx + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + // yyy + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + // yyz + template + GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.z); + } + + // yyw + template + GLM_INLINE glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.w); + } + + // yzx + template + GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.x); + } + + // yzy + template + GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.y); + } + + // yzz + template + GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.z); + } + + // yzw + template + GLM_INLINE glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.w); + } + + // ywx + template + GLM_INLINE glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.x); + } + + // ywy + template + GLM_INLINE glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.y); + } + + // ywz + template + GLM_INLINE glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.z); + } + + // yww + template + GLM_INLINE glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.w); + } + + // zxx + template + GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.x); + } + + // zxy + template + GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.y); + } + + // zxz + template + GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.z); + } + + // zxw + template + GLM_INLINE glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.w); + } + + // zyx + template + GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.x); + } + + // zyy + template + GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.y); + } + + // zyz + template + GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.z); + } + + // zyw + template + GLM_INLINE glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.w); + } + + // zzx + template + GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.x); + } + + // zzy + template + GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.y); + } + + // zzz + template + GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.z); + } + + // zzw + template + GLM_INLINE glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.w); + } + + // zwx + template + GLM_INLINE glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.x); + } + + // zwy + template + GLM_INLINE glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.y); + } + + // zwz + template + GLM_INLINE glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.z); + } + + // zww + template + GLM_INLINE glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.w); + } + + // wxx + template + GLM_INLINE glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.x); + } + + // wxy + template + GLM_INLINE glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.y); + } + + // wxz + template + GLM_INLINE glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.z); + } + + // wxw + template + GLM_INLINE glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.w); + } + + // wyx + template + GLM_INLINE glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.x); + } + + // wyy + template + GLM_INLINE glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.y); + } + + // wyz + template + GLM_INLINE glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.z); + } + + // wyw + template + GLM_INLINE glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.w); + } + + // wzx + template + GLM_INLINE glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.x); + } + + // wzy + template + GLM_INLINE glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.y); + } + + // wzz + template + GLM_INLINE glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.z); + } + + // wzw + template + GLM_INLINE glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.w); + } + + // wwx + template + GLM_INLINE glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.x); + } + + // wwy + template + GLM_INLINE glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.y); + } + + // wwz + template + GLM_INLINE glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.z); + } + + // www + template + GLM_INLINE glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.w); + } + + // xxxx + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + // xxxy + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + // xxxz + template + GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); + } + + // xxxw + template + GLM_INLINE glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.w); + } + + // xxyx + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + // xxyy + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + // xxyz + template + GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); + } + + // xxyw + template + GLM_INLINE glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.w); + } + + // xxzx + template + GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); + } + + // xxzy + template + GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); + } + + // xxzz + template + GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); + } + + // xxzw + template + GLM_INLINE glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.w); + } + + // xxwx + template + GLM_INLINE glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.x); + } + + // xxwy + template + GLM_INLINE glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.y); + } + + // xxwz + template + GLM_INLINE glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.z); + } + + // xxww + template + GLM_INLINE glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.w); + } + + // xyxx + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + // xyxy + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + // xyxz + template + GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); + } + + // xyxw + template + GLM_INLINE glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.w); + } + + // xyyx + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + // xyyy + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + // xyyz + template + GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); + } + + // xyyw + template + GLM_INLINE glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.w); + } + + // xyzx + template + GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); + } + + // xyzy + template + GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); + } + + // xyzz + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); + } + + // xyzw + template + GLM_INLINE glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.w); + } + + // xywx + template + GLM_INLINE glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.x); + } + + // xywy + template + GLM_INLINE glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.y); + } + + // xywz + template + GLM_INLINE glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.z); + } + + // xyww + template + GLM_INLINE glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.w); + } + + // xzxx + template + GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); + } + + // xzxy + template + GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); + } + + // xzxz + template + GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); + } + + // xzxw + template + GLM_INLINE glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.w); + } + + // xzyx + template + GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); + } + + // xzyy + template + GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); + } + + // xzyz + template + GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); + } + + // xzyw + template + GLM_INLINE glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.w); + } + + // xzzx + template + GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); + } + + // xzzy + template + GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); + } + + // xzzz + template + GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); + } + + // xzzw + template + GLM_INLINE glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.w); + } + + // xzwx + template + GLM_INLINE glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.x); + } + + // xzwy + template + GLM_INLINE glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.y); + } + + // xzwz + template + GLM_INLINE glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.z); + } + + // xzww + template + GLM_INLINE glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.w); + } + + // xwxx + template + GLM_INLINE glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.x); + } + + // xwxy + template + GLM_INLINE glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.y); + } + + // xwxz + template + GLM_INLINE glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.z); + } + + // xwxw + template + GLM_INLINE glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.w); + } + + // xwyx + template + GLM_INLINE glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.x); + } + + // xwyy + template + GLM_INLINE glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.y); + } + + // xwyz + template + GLM_INLINE glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.z); + } + + // xwyw + template + GLM_INLINE glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.w); + } + + // xwzx + template + GLM_INLINE glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.x); + } + + // xwzy + template + GLM_INLINE glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.y); + } + + // xwzz + template + GLM_INLINE glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.z); + } + + // xwzw + template + GLM_INLINE glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.w); + } + + // xwwx + template + GLM_INLINE glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.x); + } + + // xwwy + template + GLM_INLINE glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.y); + } + + // xwwz + template + GLM_INLINE glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.z); + } + + // xwww + template + GLM_INLINE glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.w); + } + + // yxxx + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + // yxxy + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + // yxxz + template + GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); + } + + // yxxw + template + GLM_INLINE glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.w); + } + + // yxyx + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + // yxyy + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + // yxyz + template + GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); + } + + // yxyw + template + GLM_INLINE glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.w); + } + + // yxzx + template + GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); + } + + // yxzy + template + GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); + } + + // yxzz + template + GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); + } + + // yxzw + template + GLM_INLINE glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.w); + } + + // yxwx + template + GLM_INLINE glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.x); + } + + // yxwy + template + GLM_INLINE glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.y); + } + + // yxwz + template + GLM_INLINE glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.z); + } + + // yxww + template + GLM_INLINE glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.w); + } + + // yyxx + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + // yyxy + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + // yyxz + template + GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); + } + + // yyxw + template + GLM_INLINE glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.w); + } + + // yyyx + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + // yyyy + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + // yyyz + template + GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); + } + + // yyyw + template + GLM_INLINE glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.w); + } + + // yyzx + template + GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); + } + + // yyzy + template + GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); + } + + // yyzz + template + GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); + } + + // yyzw + template + GLM_INLINE glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.w); + } + + // yywx + template + GLM_INLINE glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.x); + } + + // yywy + template + GLM_INLINE glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.y); + } + + // yywz + template + GLM_INLINE glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.z); + } + + // yyww + template + GLM_INLINE glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.w); + } + + // yzxx + template + GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); + } + + // yzxy + template + GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); + } + + // yzxz + template + GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); + } + + // yzxw + template + GLM_INLINE glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.w); + } + + // yzyx + template + GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); + } + + // yzyy + template + GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); + } + + // yzyz + template + GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); + } + + // yzyw + template + GLM_INLINE glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.w); + } + + // yzzx + template + GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); + } + + // yzzy + template + GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); + } + + // yzzz + template + GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); + } + + // yzzw + template + GLM_INLINE glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.w); + } + + // yzwx + template + GLM_INLINE glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.x); + } + + // yzwy + template + GLM_INLINE glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.y); + } + + // yzwz + template + GLM_INLINE glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.z); + } + + // yzww + template + GLM_INLINE glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.w); + } + + // ywxx + template + GLM_INLINE glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.x); + } + + // ywxy + template + GLM_INLINE glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.y); + } + + // ywxz + template + GLM_INLINE glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.z); + } + + // ywxw + template + GLM_INLINE glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.w); + } + + // ywyx + template + GLM_INLINE glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.x); + } + + // ywyy + template + GLM_INLINE glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.y); + } + + // ywyz + template + GLM_INLINE glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.z); + } + + // ywyw + template + GLM_INLINE glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.w); + } + + // ywzx + template + GLM_INLINE glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.x); + } + + // ywzy + template + GLM_INLINE glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.y); + } + + // ywzz + template + GLM_INLINE glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.z); + } + + // ywzw + template + GLM_INLINE glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.w); + } + + // ywwx + template + GLM_INLINE glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.x); + } + + // ywwy + template + GLM_INLINE glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.y); + } + + // ywwz + template + GLM_INLINE glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.z); + } + + // ywww + template + GLM_INLINE glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.w); + } + + // zxxx + template + GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); + } + + // zxxy + template + GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); + } + + // zxxz + template + GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); + } + + // zxxw + template + GLM_INLINE glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.w); + } + + // zxyx + template + GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); + } + + // zxyy + template + GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); + } + + // zxyz + template + GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); + } + + // zxyw + template + GLM_INLINE glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.w); + } + + // zxzx + template + GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); + } + + // zxzy + template + GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); + } + + // zxzz + template + GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); + } + + // zxzw + template + GLM_INLINE glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.w); + } + + // zxwx + template + GLM_INLINE glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.x); + } + + // zxwy + template + GLM_INLINE glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.y); + } + + // zxwz + template + GLM_INLINE glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.z); + } + + // zxww + template + GLM_INLINE glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.w); + } + + // zyxx + template + GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); + } + + // zyxy + template + GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); + } + + // zyxz + template + GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); + } + + // zyxw + template + GLM_INLINE glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.w); + } + + // zyyx + template + GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); + } + + // zyyy + template + GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); + } + + // zyyz + template + GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); + } + + // zyyw + template + GLM_INLINE glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.w); + } + + // zyzx + template + GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); + } + + // zyzy + template + GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); + } + + // zyzz + template + GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); + } + + // zyzw + template + GLM_INLINE glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.w); + } + + // zywx + template + GLM_INLINE glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.x); + } + + // zywy + template + GLM_INLINE glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.y); + } + + // zywz + template + GLM_INLINE glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.z); + } + + // zyww + template + GLM_INLINE glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.w); + } + + // zzxx + template + GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); + } + + // zzxy + template + GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); + } + + // zzxz + template + GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); + } + + // zzxw + template + GLM_INLINE glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.w); + } + + // zzyx + template + GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); + } + + // zzyy + template + GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); + } + + // zzyz + template + GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); + } + + // zzyw + template + GLM_INLINE glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.w); + } + + // zzzx + template + GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); + } + + // zzzy + template + GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); + } + + // zzzz + template + GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); + } + + // zzzw + template + GLM_INLINE glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.w); + } + + // zzwx + template + GLM_INLINE glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.x); + } + + // zzwy + template + GLM_INLINE glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.y); + } + + // zzwz + template + GLM_INLINE glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.z); + } + + // zzww + template + GLM_INLINE glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.w); + } + + // zwxx + template + GLM_INLINE glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.x); + } + + // zwxy + template + GLM_INLINE glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.y); + } + + // zwxz + template + GLM_INLINE glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.z); + } + + // zwxw + template + GLM_INLINE glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.w); + } + + // zwyx + template + GLM_INLINE glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.x); + } + + // zwyy + template + GLM_INLINE glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.y); + } + + // zwyz + template + GLM_INLINE glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.z); + } + + // zwyw + template + GLM_INLINE glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.w); + } + + // zwzx + template + GLM_INLINE glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.x); + } + + // zwzy + template + GLM_INLINE glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.y); + } + + // zwzz + template + GLM_INLINE glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.z); + } + + // zwzw + template + GLM_INLINE glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.w); + } + + // zwwx + template + GLM_INLINE glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.x); + } + + // zwwy + template + GLM_INLINE glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.y); + } + + // zwwz + template + GLM_INLINE glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.z); + } + + // zwww + template + GLM_INLINE glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.w); + } + + // wxxx + template + GLM_INLINE glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.x); + } + + // wxxy + template + GLM_INLINE glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.y); + } + + // wxxz + template + GLM_INLINE glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.z); + } + + // wxxw + template + GLM_INLINE glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.w); + } + + // wxyx + template + GLM_INLINE glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.x); + } + + // wxyy + template + GLM_INLINE glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.y); + } + + // wxyz + template + GLM_INLINE glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.z); + } + + // wxyw + template + GLM_INLINE glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.w); + } + + // wxzx + template + GLM_INLINE glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.x); + } + + // wxzy + template + GLM_INLINE glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.y); + } + + // wxzz + template + GLM_INLINE glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.z); + } + + // wxzw + template + GLM_INLINE glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.w); + } + + // wxwx + template + GLM_INLINE glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.x); + } + + // wxwy + template + GLM_INLINE glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.y); + } + + // wxwz + template + GLM_INLINE glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.z); + } + + // wxww + template + GLM_INLINE glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.w); + } + + // wyxx + template + GLM_INLINE glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.x); + } + + // wyxy + template + GLM_INLINE glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.y); + } + + // wyxz + template + GLM_INLINE glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.z); + } + + // wyxw + template + GLM_INLINE glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.w); + } + + // wyyx + template + GLM_INLINE glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.x); + } + + // wyyy + template + GLM_INLINE glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.y); + } + + // wyyz + template + GLM_INLINE glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.z); + } + + // wyyw + template + GLM_INLINE glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.w); + } + + // wyzx + template + GLM_INLINE glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.x); + } + + // wyzy + template + GLM_INLINE glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.y); + } + + // wyzz + template + GLM_INLINE glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.z); + } + + // wyzw + template + GLM_INLINE glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.w); + } + + // wywx + template + GLM_INLINE glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.x); + } + + // wywy + template + GLM_INLINE glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.y); + } + + // wywz + template + GLM_INLINE glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.z); + } + + // wyww + template + GLM_INLINE glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.w); + } + + // wzxx + template + GLM_INLINE glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.x); + } + + // wzxy + template + GLM_INLINE glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.y); + } + + // wzxz + template + GLM_INLINE glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.z); + } + + // wzxw + template + GLM_INLINE glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.w); + } + + // wzyx + template + GLM_INLINE glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.x); + } + + // wzyy + template + GLM_INLINE glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.y); + } + + // wzyz + template + GLM_INLINE glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.z); + } + + // wzyw + template + GLM_INLINE glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.w); + } + + // wzzx + template + GLM_INLINE glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.x); + } + + // wzzy + template + GLM_INLINE glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.y); + } + + // wzzz + template + GLM_INLINE glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.z); + } + + // wzzw + template + GLM_INLINE glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.w); + } + + // wzwx + template + GLM_INLINE glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.x); + } + + // wzwy + template + GLM_INLINE glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.y); + } + + // wzwz + template + GLM_INLINE glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.z); + } + + // wzww + template + GLM_INLINE glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.w); + } + + // wwxx + template + GLM_INLINE glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.x); + } + + // wwxy + template + GLM_INLINE glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.y); + } + + // wwxz + template + GLM_INLINE glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.z); + } + + // wwxw + template + GLM_INLINE glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.w); + } + + // wwyx + template + GLM_INLINE glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.x); + } + + // wwyy + template + GLM_INLINE glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.y); + } + + // wwyz + template + GLM_INLINE glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.z); + } + + // wwyw + template + GLM_INLINE glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.w); + } + + // wwzx + template + GLM_INLINE glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.x); + } + + // wwzy + template + GLM_INLINE glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.y); + } + + // wwzz + template + GLM_INLINE glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.z); + } + + // wwzw + template + GLM_INLINE glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.w); + } + + // wwwx + template + GLM_INLINE glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.x); + } + + // wwwy + template + GLM_INLINE glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.y); + } + + // wwwz + template + GLM_INLINE glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.z); + } + + // wwww + template + GLM_INLINE glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.w); + } + +} diff --git a/include/glm/glm/gtx/vector_angle.hpp b/include/glm/glm/gtx/vector_angle.hpp new file mode 100644 index 00000000..9ae43712 --- /dev/null +++ b/include/glm/glm/gtx/vector_angle.hpp @@ -0,0 +1,57 @@ +/// @ref gtx_vector_angle +/// @file glm/gtx/vector_angle.hpp +/// +/// @see core (dependence) +/// @see gtx_quaternion (dependence) +/// @see gtx_epsilon (dependence) +/// +/// @defgroup gtx_vector_angle GLM_GTX_vector_angle +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Compute angle between vectors + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/epsilon.hpp" +#include "../gtx/quaternion.hpp" +#include "../gtx/rotate_vector.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vector_angle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vector_angle extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_vector_angle + /// @{ + + //! Returns the absolute angle between two vectors. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T angle(vec const& x, vec const& y); + + //! Returns the oriented angle between two 2d vectors. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y); + + //! Returns the oriented angle between two 3d vectors based from a reference axis. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref); + + /// @} +}// namespace glm + +#include "vector_angle.inl" diff --git a/include/glm/glm/gtx/vector_angle.inl b/include/glm/glm/gtx/vector_angle.inl new file mode 100644 index 00000000..a1f957a5 --- /dev/null +++ b/include/glm/glm/gtx/vector_angle.inl @@ -0,0 +1,44 @@ +/// @ref gtx_vector_angle + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType angle + ( + genType const& x, + genType const& y + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); + return acos(clamp(dot(x, y), genType(-1), genType(1))); + } + + template + GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); + return acos(clamp(dot(x, y), T(-1), T(1))); + } + + //! \todo epsilon is hard coded to 0.01 + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); + + if(all(epsilonEqual(y, glm::rotate(x, Angle), T(0.0001)))) + return Angle; + else + return -Angle; + } + + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + + T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); + return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); + } +}//namespace glm diff --git a/include/glm/glm/gtx/vector_query.hpp b/include/glm/glm/gtx/vector_query.hpp new file mode 100644 index 00000000..77c7b974 --- /dev/null +++ b/include/glm/glm/gtx/vector_query.hpp @@ -0,0 +1,66 @@ +/// @ref gtx_vector_query +/// @file glm/gtx/vector_query.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_vector_query GLM_GTX_vector_query +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Query informations of vector types + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vector_query extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_vector_query + /// @{ + + //! Check whether two vectors are collinears. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areCollinear(vec const& v0, vec const& v1, T const& epsilon); + + //! Check whether two vectors are orthogonals. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon); + + //! Check whether a vector is normalized. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool isNormalized(vec const& v, T const& epsilon); + + //! Check whether a vector is null. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool isNull(vec const& v, T const& epsilon); + + //! Check whether a each component of a vector is null. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL vec isCompNull(vec const& v, T const& epsilon); + + //! Check whether two vectors are orthonormal. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon); + + /// @} +}// namespace glm + +#include "vector_query.inl" diff --git a/include/glm/glm/gtx/vector_query.inl b/include/glm/glm/gtx/vector_query.inl new file mode 100644 index 00000000..d1a5c9be --- /dev/null +++ b/include/glm/glm/gtx/vector_query.inl @@ -0,0 +1,154 @@ +/// @ref gtx_vector_query + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_areCollinear{}; + + template + struct compute_areCollinear<2, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<2, T, Q> const& v0, vec<2, T, Q> const& v1, T const& epsilon) + { + return length(cross(vec<3, T, Q>(v0, static_cast(0)), vec<3, T, Q>(v1, static_cast(0)))) < epsilon; + } + }; + + template + struct compute_areCollinear<3, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, T const& epsilon) + { + return length(cross(v0, v1)) < epsilon; + } + }; + + template + struct compute_areCollinear<4, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v0, vec<4, T, Q> const& v1, T const& epsilon) + { + return length(cross(vec<3, T, Q>(v0), vec<3, T, Q>(v1))) < epsilon; + } + }; + + template + struct compute_isCompNull{}; + + template + struct compute_isCompNull<2, T, Q> + { + GLM_FUNC_QUALIFIER static vec<2, bool, Q> call(vec<2, T, Q> const& v, T const& epsilon) + { + return vec<2, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon)); + } + }; + + template + struct compute_isCompNull<3, T, Q> + { + GLM_FUNC_QUALIFIER static vec<3, bool, Q> call(vec<3, T, Q> const& v, T const& epsilon) + { + return vec<3, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon), + (abs(v.z) < epsilon)); + } + }; + + template + struct compute_isCompNull<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, bool, Q> call(vec<4, T, Q> const& v, T const& epsilon) + { + return vec<4, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon), + (abs(v.z) < epsilon), + (abs(v.w) < epsilon)); + } + }; + +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool areCollinear(vec const& v0, vec const& v1, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areCollinear' only accept floating-point inputs"); + + return detail::compute_areCollinear::call(v0, v1, epsilon); + } + + template + GLM_FUNC_QUALIFIER bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areOrthogonal' only accept floating-point inputs"); + + return abs(dot(v0, v1)) <= max( + static_cast(1), + length(v0)) * max(static_cast(1), length(v1)) * epsilon; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNormalized' only accept floating-point inputs"); + + return abs(length(v) - static_cast(1)) <= static_cast(2) * epsilon; + } + + template + GLM_FUNC_QUALIFIER bool isNull(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNull' only accept floating-point inputs"); + + return length(v) <= epsilon; + } + + template + GLM_FUNC_QUALIFIER vec isCompNull(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isCompNull' only accept floating-point inputs"); + + return detail::compute_isCompNull::call(v, epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isCompNull(vec<2, T, Q> const& v, T const& epsilon) + { + return vec<2, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isCompNull(vec<3, T, Q> const& v, T const& epsilon) + { + return vec<3, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isCompNull(vec<4, T, Q> const& v, T const& epsilon) + { + return vec<4, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon, + abs(v.w) < epsilon); + } + + template + GLM_FUNC_QUALIFIER bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon) + { + return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); + } + +}//namespace glm diff --git a/include/glm/glm/gtx/wrap.hpp b/include/glm/glm/gtx/wrap.hpp new file mode 100644 index 00000000..ad4eb3fc --- /dev/null +++ b/include/glm/glm/gtx/wrap.hpp @@ -0,0 +1,37 @@ +/// @ref gtx_wrap +/// @file glm/gtx/wrap.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_wrap GLM_GTX_wrap +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Wrapping mode of texture coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" +#include "../gtc/vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_wrap is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_wrap extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_wrap + /// @{ + + /// @} +}// namespace glm + +#include "wrap.inl" diff --git a/include/glm/glm/gtx/wrap.inl b/include/glm/glm/gtx/wrap.inl new file mode 100644 index 00000000..4be3b4c3 --- /dev/null +++ b/include/glm/glm/gtx/wrap.inl @@ -0,0 +1,6 @@ +/// @ref gtx_wrap + +namespace glm +{ + +}//namespace glm diff --git a/include/glm/glm/integer.hpp b/include/glm/glm/integer.hpp new file mode 100644 index 00000000..8817db3f --- /dev/null +++ b/include/glm/glm/integer.hpp @@ -0,0 +1,212 @@ +/// @ref core +/// @file glm/integer.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.8 Integer Functions +/// +/// @defgroup core_func_integer Integer functions +/// @ingroup core +/// +/// Provides GLSL functions on integer types +/// +/// These all operate component-wise. The description is per component. +/// The notation [a, b] means the set of bits from bit-number a through bit-number +/// b, inclusive. The lowest-order bit is bit 0. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/qualifier.hpp" +#include "common.hpp" +#include "vector_relational.hpp" + +namespace glm +{ + /// @addtogroup core_func_integer + /// @{ + + /// Adds 32-bit unsigned integer x and y, returning the sum + /// modulo pow(2, 32). The value carry is set to 0 if the sum was + /// less than pow(2, 32), or to 1 otherwise. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL uaddCarry man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec uaddCarry( + vec const& x, + vec const& y, + vec & carry); + + /// Subtracts the 32-bit unsigned integer y from x, returning + /// the difference if non-negative, or pow(2, 32) plus the difference + /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL usubBorrow man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec usubBorrow( + vec const& x, + vec const& y, + vec & borrow); + + /// Multiplies 32-bit integers x and y, producing a 64-bit + /// result. The 32 least-significant bits are returned in lsb. + /// The 32 most-significant bits are returned in msb. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL umulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL void umulExtended( + vec const& x, + vec const& y, + vec & msb, + vec & lsb); + + /// Multiplies 32-bit integers x and y, producing a 64-bit + /// result. The 32 least-significant bits are returned in lsb. + /// The 32 most-significant bits are returned in msb. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL imulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL void imulExtended( + vec const& x, + vec const& y, + vec & msb, + vec & lsb); + + /// Extracts bits [offset, offset + bits - 1] from value, + /// returning them in the least significant bits of the result. + /// For unsigned data types, the most significant bits of the + /// result will be set to zero. For signed data types, the + /// most significant bits will be set to the value of bit offset + base - 1. + /// + /// If bits is zero, the result will be zero. The result will be + /// undefined if offset or bits is negative, or if the sum of + /// offset and bits is greater than the number of bits used + /// to store the operand. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL bitfieldExtract man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldExtract( + vec const& Value, + int Offset, + int Bits); + + /// Returns the insertion the bits least-significant bits of insert into base. + /// + /// The result will have bits [offset, offset + bits - 1] taken + /// from bits [0, bits - 1] of insert, and all other bits taken + /// directly from the corresponding bits of base. If bits is + /// zero, the result will simply be base. The result will be + /// undefined if offset or bits is negative, or if the sum of + /// offset and bits is greater than the number of bits used to + /// store the operand. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitfieldInsert man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldInsert( + vec const& Base, + vec const& Insert, + int Offset, + int Bits); + + /// Returns the reversal of the bits of value. + /// The bit numbered n of the result will be taken from bit (bits - 1) - n of value, + /// where bits is the total number of bits used to represent value. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitfieldReverse man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldReverse(vec const& v); + + /// Returns the number of bits set to 1 in the binary representation of value. + /// + /// @tparam genType Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitCount man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int bitCount(genType v); + + /// Returns the number of bits set to 1 in the binary representation of value. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitCount man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitCount(vec const& v); + + /// Returns the bit number of the least significant bit set to + /// 1 in the binary representation of value. + /// If value is zero, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see GLSL findLSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int findLSB(genIUType x); + + /// Returns the bit number of the least significant bit set to + /// 1 in the binary representation of value. + /// If value is zero, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL findLSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec findLSB(vec const& v); + + /// Returns the bit number of the most significant bit in the binary representation of value. + /// For positive integers, the result will be the bit number of the most significant bit set to 1. + /// For negative integers, the result will be the bit number of the most significant + /// bit set to 0. For a value of zero or negative one, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see GLSL findMSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int findMSB(genIUType x); + + /// Returns the bit number of the most significant bit in the binary representation of value. + /// For positive integers, the result will be the bit number of the most significant bit set to 1. + /// For negative integers, the result will be the bit number of the most significant + /// bit set to 0. For a value of zero or negative one, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL findMSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec findMSB(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_integer.inl" diff --git a/include/glm/glm/mat2x2.hpp b/include/glm/glm/mat2x2.hpp new file mode 100644 index 00000000..96bec96b --- /dev/null +++ b/include/glm/glm/mat2x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x2.hpp + +#pragma once +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" + diff --git a/include/glm/glm/mat2x3.hpp b/include/glm/glm/mat2x3.hpp new file mode 100644 index 00000000..d68dc25e --- /dev/null +++ b/include/glm/glm/mat2x3.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x3.hpp + +#pragma once +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" + diff --git a/include/glm/glm/mat2x4.hpp b/include/glm/glm/mat2x4.hpp new file mode 100644 index 00000000..b04b7387 --- /dev/null +++ b/include/glm/glm/mat2x4.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x4.hpp + +#pragma once +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" + diff --git a/include/glm/glm/mat3x2.hpp b/include/glm/glm/mat3x2.hpp new file mode 100644 index 00000000..c8531537 --- /dev/null +++ b/include/glm/glm/mat3x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat3x2.hpp + +#pragma once +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" + diff --git a/include/glm/glm/mat3x3.hpp b/include/glm/glm/mat3x3.hpp new file mode 100644 index 00000000..fd4fa31c --- /dev/null +++ b/include/glm/glm/mat3x3.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat3x3.hpp + +#pragma once +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" diff --git a/include/glm/glm/mat3x4.hpp b/include/glm/glm/mat3x4.hpp new file mode 100644 index 00000000..6342bf5b --- /dev/null +++ b/include/glm/glm/mat3x4.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat3x4.hpp + +#pragma once +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" diff --git a/include/glm/glm/mat4x2.hpp b/include/glm/glm/mat4x2.hpp new file mode 100644 index 00000000..e013e46b --- /dev/null +++ b/include/glm/glm/mat4x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat4x2.hpp + +#pragma once +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" + diff --git a/include/glm/glm/mat4x3.hpp b/include/glm/glm/mat4x3.hpp new file mode 100644 index 00000000..205725ab --- /dev/null +++ b/include/glm/glm/mat4x3.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat4x3.hpp + +#pragma once +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" diff --git a/include/glm/glm/mat4x4.hpp b/include/glm/glm/mat4x4.hpp new file mode 100644 index 00000000..3515f7f3 --- /dev/null +++ b/include/glm/glm/mat4x4.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat4x4.hpp + +#pragma once +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" + diff --git a/include/glm/glm/matrix.hpp b/include/glm/glm/matrix.hpp new file mode 100644 index 00000000..6badf538 --- /dev/null +++ b/include/glm/glm/matrix.hpp @@ -0,0 +1,161 @@ +/// @ref core +/// @file glm/matrix.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions +/// +/// @defgroup core_func_matrix Matrix functions +/// @ingroup core +/// +/// Provides GLSL matrix functions. +/// +/// Include to use these core features. + +#pragma once + +// Dependencies +#include "detail/qualifier.hpp" +#include "detail/setup.hpp" +#include "vec2.hpp" +#include "vec3.hpp" +#include "vec4.hpp" +#include "mat2x2.hpp" +#include "mat2x3.hpp" +#include "mat2x4.hpp" +#include "mat3x2.hpp" +#include "mat3x3.hpp" +#include "mat3x4.hpp" +#include "mat4x2.hpp" +#include "mat4x3.hpp" +#include "mat4x4.hpp" + +namespace glm { +namespace detail +{ + template + struct outerProduct_trait{}; + + template + struct outerProduct_trait<2, 2, T, Q> + { + typedef mat<2, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 3, T, Q> + { + typedef mat<3, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 4, T, Q> + { + typedef mat<4, 2, T, Q> type; + }; + + template + struct outerProduct_trait<3, 2, T, Q> + { + typedef mat<2, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 3, T, Q> + { + typedef mat<3, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 4, T, Q> + { + typedef mat<4, 3, T, Q> type; + }; + + template + struct outerProduct_trait<4, 2, T, Q> + { + typedef mat<2, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 3, T, Q> + { + typedef mat<3, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 4, T, Q> + { + typedef mat<4, 4, T, Q> type; + }; +}//namespace detail + + /// @addtogroup core_func_matrix + /// @{ + + /// Multiply matrix x by matrix y component-wise, i.e., + /// result[i][j] is the scalar product of x[i][j] and y[i][j]. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL matrixCompMult man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); + + /// Treats the first parameter c as a column vector + /// and the second parameter r as a row vector + /// and does a linear algebraic matrix multiply c * r. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL outerProduct man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); + + /// Returns the transposed matrix of x + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL transpose man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); + + /// Return the determinant of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL T determinant(mat const& m); + + /// Return the inverse of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL inverse man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat inverse(mat const& m); + + /// @} +}//namespace glm + +#include "detail/func_matrix.inl" diff --git a/include/glm/glm/packing.hpp b/include/glm/glm/packing.hpp new file mode 100644 index 00000000..ca83ac1d --- /dev/null +++ b/include/glm/glm/packing.hpp @@ -0,0 +1,173 @@ +/// @ref core +/// @file glm/packing.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions +/// @see gtc_packing +/// +/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions +/// @ingroup core +/// +/// Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types. +/// +/// These functions do not operate component-wise, rather as described in each case. +/// +/// Include to use these core features. + +#pragma once + +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float4.hpp" + +namespace glm +{ + /// @addtogroup core_func_packing + /// @{ + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packUnorm2x16(vec2 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packSnorm2x16(vec2 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packUnorm4x8(vec4 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packSnorm4x8(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm2x16: f / 65535.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm2x16: clamp(f / 32767.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); + + /// Returns a double-qualifier value obtained by packing the components of v into a 64-bit value. + /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. + /// Otherwise, the bit- level representation of v is preserved. + /// The first vector component specifies the 32 least significant bits; + /// the second component specifies the 32 most significant bits. + /// + /// @see GLSL packDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL double packDouble2x32(uvec2 const& v); + + /// Returns a two-component unsigned integer vector representation of v. + /// The bit-level representation of v is preserved. + /// The first component of the vector contains the 32 least significant bits of the double; + /// the second component consists the 32 most significant bits. + /// + /// @see GLSL unpackDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); + + /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing these two 16- bit integers into a 32-bit unsigned integer. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the second component specifies the 16 most-significant bits. + /// + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packHalf2x16(vec2 const& v); + + /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, + /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, + /// and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the second component is obtained from the 16 most-significant bits of v. + /// + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackHalf2x16(uint v); + + /// @} +}//namespace glm + +#include "detail/func_packing.inl" diff --git a/include/glm/glm/simd/common.h b/include/glm/glm/simd/common.h new file mode 100644 index 00000000..9b017cb4 --- /dev/null +++ b/include/glm/glm/simd/common.h @@ -0,0 +1,240 @@ +/// @ref simd +/// @file glm/simd/common.h + +#pragma once + +#include "platform.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_add(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_add_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_add(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_add_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sub(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_sub_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sub(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_sub_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_mul(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_mul_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_mul(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_mul_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_div_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_div(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_div_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div_lowp(glm_f32vec4 a, glm_f32vec4 b) +{ + return glm_vec4_mul(a, _mm_rcp_ps(b)); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 a) +{ +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + return _mm_permute_ps(a, _MM_SHUFFLE(3, 2, 1, 0)); +# else + return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0)); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) +{ +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) + return _mm_fmadd_ss(a, b, c); +# else + return _mm_add_ss(_mm_mul_ss(a, b), c); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) +{ +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) + return _mm_fmadd_ps(a, b, c); +# else + return glm_vec4_add(glm_vec4_mul(a, b), c); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) +{ + return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); +} + +GLM_FUNC_QUALIFIER glm_ivec4 glm_ivec4_abs(glm_ivec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSSE3_BIT + return _mm_sign_epi32(x, x); +# else + glm_ivec4 const sgn0 = _mm_srai_epi32(x, 31); + glm_ivec4 const inv0 = _mm_xor_si128(x, sgn0); + glm_ivec4 const sub0 = _mm_sub_epi32(inv0, sgn0); + return sub0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sign(glm_vec4 x) +{ + glm_vec4 const zro0 = _mm_setzero_ps(); + glm_vec4 const cmp0 = _mm_cmplt_ps(x, zro0); + glm_vec4 const cmp1 = _mm_cmpgt_ps(x, zro0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(-1.0f)); + glm_vec4 const and1 = _mm_and_ps(cmp1, _mm_set1_ps(1.0f)); + glm_vec4 const or0 = _mm_or_ps(and0, and1); + return or0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_round(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_round_ps(x, _MM_FROUND_TO_NEAREST_INT); +# else + glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); + glm_vec4 const and0 = _mm_and_ps(sgn0, x); + glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); + glm_vec4 const add0 = glm_vec4_add(x, or0); + glm_vec4 const sub0 = glm_vec4_sub(add0, or0); + return sub0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_floor(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_floor_ps(x); +# else + glm_vec4 const rnd0 = glm_vec4_round(x); + glm_vec4 const cmp0 = _mm_cmplt_ps(x, rnd0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); + glm_vec4 const sub0 = glm_vec4_sub(rnd0, and0); + return sub0; +# endif +} + +/* trunc TODO +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_trunc(glm_vec4 x) +{ + return glm_vec4(); +} +*/ + +//roundEven +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_roundEven(glm_vec4 x) +{ + glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); + glm_vec4 const and0 = _mm_and_ps(sgn0, x); + glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); + glm_vec4 const add0 = glm_vec4_add(x, or0); + glm_vec4 const sub0 = glm_vec4_sub(add0, or0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_ceil(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_ceil_ps(x); +# else + glm_vec4 const rnd0 = glm_vec4_round(x); + glm_vec4 const cmp0 = _mm_cmpgt_ps(x, rnd0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); + glm_vec4 const add0 = glm_vec4_add(rnd0, and0); + return add0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fract(glm_vec4 x) +{ + glm_vec4 const flr0 = glm_vec4_floor(x); + glm_vec4 const sub0 = glm_vec4_sub(x, flr0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mod(glm_vec4 x, glm_vec4 y) +{ + glm_vec4 const div0 = glm_vec4_div(x, y); + glm_vec4 const flr0 = glm_vec4_floor(div0); + glm_vec4 const mul0 = glm_vec4_mul(y, flr0); + glm_vec4 const sub0 = glm_vec4_sub(x, mul0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_clamp(glm_vec4 v, glm_vec4 minVal, glm_vec4 maxVal) +{ + glm_vec4 const min0 = _mm_min_ps(v, maxVal); + glm_vec4 const max0 = _mm_max_ps(min0, minVal); + return max0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mix(glm_vec4 v1, glm_vec4 v2, glm_vec4 a) +{ + glm_vec4 const sub0 = glm_vec4_sub(_mm_set1_ps(1.0f), a); + glm_vec4 const mul0 = glm_vec4_mul(v1, sub0); + glm_vec4 const mad0 = glm_vec4_fma(v2, a, mul0); + return mad0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_step(glm_vec4 edge, glm_vec4 x) +{ + glm_vec4 const cmp = _mm_cmple_ps(x, edge); + return _mm_movemask_ps(cmp) == 0 ? _mm_set1_ps(1.0f) : _mm_setzero_ps(); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_smoothstep(glm_vec4 edge0, glm_vec4 edge1, glm_vec4 x) +{ + glm_vec4 const sub0 = glm_vec4_sub(x, edge0); + glm_vec4 const sub1 = glm_vec4_sub(edge1, edge0); + glm_vec4 const div0 = glm_vec4_sub(sub0, sub1); + glm_vec4 const clp0 = glm_vec4_clamp(div0, _mm_setzero_ps(), _mm_set1_ps(1.0f)); + glm_vec4 const mul0 = glm_vec4_mul(_mm_set1_ps(2.0f), clp0); + glm_vec4 const sub2 = glm_vec4_sub(_mm_set1_ps(3.0f), mul0); + glm_vec4 const mul1 = glm_vec4_mul(clp0, clp0); + glm_vec4 const mul2 = glm_vec4_mul(mul1, sub2); + return mul2; +} + +// Agner Fog method +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_nan(glm_vec4 x) +{ + glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer + glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit + glm_ivec4 const t3 = _mm_set1_epi32(int(0xFF000000)); // exponent mask + glm_ivec4 const t4 = _mm_and_si128(t2, t3); // exponent + glm_ivec4 const t5 = _mm_andnot_si128(t3, t2); // fraction + glm_ivec4 const Equal = _mm_cmpeq_epi32(t3, t4); + glm_ivec4 const Nequal = _mm_cmpeq_epi32(t5, _mm_setzero_si128()); + glm_ivec4 const And = _mm_and_si128(Equal, Nequal); + return _mm_castsi128_ps(And); // exponent = all 1s and fraction != 0 +} + +// Agner Fog method +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_inf(glm_vec4 x) +{ + glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer + glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit + return _mm_castsi128_ps(_mm_cmpeq_epi32(t2, _mm_set1_epi32(int(0xFF000000)))); // exponent is all 1s, fraction is 0 +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/exponential.h b/include/glm/glm/simd/exponential.h new file mode 100644 index 00000000..bc351d01 --- /dev/null +++ b/include/glm/glm/simd/exponential.h @@ -0,0 +1,20 @@ +/// @ref simd +/// @file glm/simd/experimental.h + +#pragma once + +#include "platform.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ss(_mm_rsqrt_ss(x), x); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ps(_mm_rsqrt_ps(x), x); +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/geometric.h b/include/glm/glm/simd/geometric.h new file mode 100644 index 00000000..07d7cbcc --- /dev/null +++ b/include/glm/glm/simd/geometric.h @@ -0,0 +1,124 @@ +/// @ref simd +/// @file glm/simd/geometric.h + +#pragma once + +#include "common.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_DECL glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2); +GLM_FUNC_DECL glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2); + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_length(glm_vec4 x) +{ + glm_vec4 const dot0 = glm_vec4_dot(x, x); + glm_vec4 const sqt0 = _mm_sqrt_ps(dot0); + return sqt0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_distance(glm_vec4 p0, glm_vec4 p1) +{ + glm_vec4 const sub0 = _mm_sub_ps(p0, p1); + glm_vec4 const len0 = glm_vec4_length(sub0); + return len0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2) +{ +# if GLM_ARCH & GLM_ARCH_AVX_BIT + return _mm_dp_ps(v1, v2, 0xff); +# elif GLM_ARCH & GLM_ARCH_SSE3_BIT + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const hadd0 = _mm_hadd_ps(mul0, mul0); + glm_vec4 const hadd1 = _mm_hadd_ps(hadd0, hadd0); + return hadd1; +# else + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); + glm_vec4 const add0 = _mm_add_ps(mul0, swp0); + glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); + glm_vec4 const add1 = _mm_add_ps(add0, swp1); + return add1; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2) +{ +# if GLM_ARCH & GLM_ARCH_AVX_BIT + return _mm_dp_ps(v1, v2, 0xff); +# elif GLM_ARCH & GLM_ARCH_SSE3_BIT + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const had0 = _mm_hadd_ps(mul0, mul0); + glm_vec4 const had1 = _mm_hadd_ps(had0, had0); + return had1; +# else + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const mov0 = _mm_movehl_ps(mul0, mul0); + glm_vec4 const add0 = _mm_add_ps(mov0, mul0); + glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, 1); + glm_vec4 const add1 = _mm_add_ss(add0, swp1); + return add1; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_cross(glm_vec4 v1, glm_vec4 v2) +{ + glm_vec4 const swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); + glm_vec4 const swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); + glm_vec4 const swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); + glm_vec4 const swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); + glm_vec4 const mul0 = _mm_mul_ps(swp0, swp3); + glm_vec4 const mul1 = _mm_mul_ps(swp1, swp2); + glm_vec4 const sub0 = _mm_sub_ps(mul0, mul1); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_normalize(glm_vec4 v) +{ + glm_vec4 const dot0 = glm_vec4_dot(v, v); + glm_vec4 const isr0 = _mm_rsqrt_ps(dot0); + glm_vec4 const mul0 = _mm_mul_ps(v, isr0); + return mul0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_faceforward(glm_vec4 N, glm_vec4 I, glm_vec4 Nref) +{ + glm_vec4 const dot0 = glm_vec4_dot(Nref, I); + glm_vec4 const sgn0 = glm_vec4_sign(dot0); + glm_vec4 const mul0 = _mm_mul_ps(sgn0, _mm_set1_ps(-1.0f)); + glm_vec4 const mul1 = _mm_mul_ps(N, mul0); + return mul1; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_reflect(glm_vec4 I, glm_vec4 N) +{ + glm_vec4 const dot0 = glm_vec4_dot(N, I); + glm_vec4 const mul0 = _mm_mul_ps(N, dot0); + glm_vec4 const mul1 = _mm_mul_ps(mul0, _mm_set1_ps(2.0f)); + glm_vec4 const sub0 = _mm_sub_ps(I, mul1); + return sub0; +} + +GLM_FUNC_QUALIFIER __m128 glm_vec4_refract(glm_vec4 I, glm_vec4 N, glm_vec4 eta) +{ + glm_vec4 const dot0 = glm_vec4_dot(N, I); + glm_vec4 const mul0 = _mm_mul_ps(eta, eta); + glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0); + glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul0); + glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1); + glm_vec4 const mul2 = _mm_mul_ps(sub0, sub1); + + if(_mm_movemask_ps(_mm_cmplt_ss(mul2, _mm_set1_ps(0.0f))) == 0) + return _mm_set1_ps(0.0f); + + glm_vec4 const sqt0 = _mm_sqrt_ps(mul2); + glm_vec4 const mad0 = glm_vec4_fma(eta, dot0, sqt0); + glm_vec4 const mul4 = _mm_mul_ps(mad0, N); + glm_vec4 const mul5 = _mm_mul_ps(eta, I); + glm_vec4 const sub2 = _mm_sub_ps(mul5, mul4); + + return sub2; +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/integer.h b/include/glm/glm/simd/integer.h new file mode 100644 index 00000000..93814183 --- /dev/null +++ b/include/glm/glm/simd/integer.h @@ -0,0 +1,115 @@ +/// @ref simd +/// @file glm/simd/integer.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave(glm_uvec4 x) +{ + glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); + glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); + glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); + glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); + + glm_uvec4 Reg1; + glm_uvec4 Reg2; + + // REG1 = x; + // REG2 = y; + //Reg1 = _mm_unpacklo_epi64(x, y); + Reg1 = x; + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + return Reg1; +} + +GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y) +{ + glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); + glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); + glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); + glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); + + glm_uvec4 Reg1; + glm_uvec4 Reg2; + + // REG1 = x; + // REG2 = y; + Reg1 = _mm_unpacklo_epi64(x, y); + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + return Reg1; +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/matrix.h b/include/glm/glm/simd/matrix.h new file mode 100644 index 00000000..b6c42ea4 --- /dev/null +++ b/include/glm/glm/simd/matrix.h @@ -0,0 +1,1028 @@ +/// @ref simd +/// @file glm/simd/matrix.h + +#pragma once + +#include "geometric.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER void glm_mat4_matrixCompMult(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_mul_ps(in1[0], in2[0]); + out[1] = _mm_mul_ps(in1[1], in2[1]); + out[2] = _mm_mul_ps(in1[2], in2[2]); + out[3] = _mm_mul_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER void glm_mat4_add(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_add_ps(in1[0], in2[0]); + out[1] = _mm_add_ps(in1[1], in2[1]); + out[2] = _mm_add_ps(in1[2], in2[2]); + out[3] = _mm_add_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER void glm_mat4_sub(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_sub_ps(in1[0], in2[0]); + out[1] = _mm_sub_ps(in1[1], in2[1]); + out[2] = _mm_sub_ps(in1[2], in2[2]); + out[3] = _mm_sub_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_mul_vec4(glm_vec4 const m[4], glm_vec4 v) +{ + __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(m[0], v0); + __m128 m1 = _mm_mul_ps(m[1], v1); + __m128 m2 = _mm_mul_ps(m[2], v2); + __m128 m3 = _mm_mul_ps(m[3], v3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + return a2; +} + +GLM_FUNC_QUALIFIER __m128 glm_vec4_mul_mat4(glm_vec4 v, glm_vec4 const m[4]) +{ + __m128 i0 = m[0]; + __m128 i1 = m[1]; + __m128 i2 = m[2]; + __m128 i3 = m[3]; + + __m128 m0 = _mm_mul_ps(v, i0); + __m128 m1 = _mm_mul_ps(v, i1); + __m128 m2 = _mm_mul_ps(v, i2); + __m128 m3 = _mm_mul_ps(v, i3); + + __m128 u0 = _mm_unpacklo_ps(m0, m1); + __m128 u1 = _mm_unpackhi_ps(m0, m1); + __m128 a0 = _mm_add_ps(u0, u1); + + __m128 u2 = _mm_unpacklo_ps(m2, m3); + __m128 u3 = _mm_unpackhi_ps(m2, m3); + __m128 a1 = _mm_add_ps(u2, u3); + + __m128 f0 = _mm_movelh_ps(a0, a1); + __m128 f1 = _mm_movehl_ps(a1, a0); + __m128 f2 = _mm_add_ps(f0, f1); + + return f2; +} + +GLM_FUNC_QUALIFIER void glm_mat4_mul(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + { + __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[0] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[1] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[2] = a2; + } + + { + //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) + __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[3] = a2; + } +} + +GLM_FUNC_QUALIFIER void glm_mat4_transpose(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); + __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); + __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); + __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); + + out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); + out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); + out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); + out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_highp(glm_vec4 const in[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + return Det0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_lowp(glm_vec4 const m[4]) +{ + // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128( + + //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + // First 2 columns + __m128 Swp2A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 1, 1, 2))); + __m128 Swp3A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(3, 2, 3, 3))); + __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); + + // Second 2 columns + __m128 Swp2B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(3, 2, 3, 3))); + __m128 Swp3B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(0, 1, 1, 2))); + __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); + + // Columns subtraction + __m128 SubE = _mm_sub_ps(MulA, MulB); + + // Last 2 rows + __m128 Swp2C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 0, 1, 2))); + __m128 Swp3C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(1, 2, 0, 0))); + __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); + __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); + + //vec<4, T, Q> DetCof( + // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + __m128 SubFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubE), _MM_SHUFFLE(2, 1, 0, 0))); + __m128 SwpFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(0, 0, 0, 1))); + __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); + + __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); + __m128 SubFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpB), _MM_SHUFFLE(3, 1, 1, 0)));//SubF[0], SubE[3], SubE[3], SubE[1]; + __m128 SwpFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(1, 1, 2, 2))); + __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); + + __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); + + __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); + __m128 SubFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpC), _MM_SHUFFLE(3, 3, 2, 0))); + __m128 SwpFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(2, 3, 3, 3))); + __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); + + __m128 AddRes = _mm_add_ps(SubRes, MulFacC); + __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); + + //return m[0][0] * DetCof[0] + // + m[0][1] * DetCof[1] + // + m[0][2] * DetCof[2] + // + m[0][3] * DetCof[3]; + + return glm_vec4_dot(m[0], DetCof); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant(glm_vec4 const m[4]) +{ + // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(add) + + //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + // First 2 columns + __m128 Swp2A = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 1, 1, 2)); + __m128 Swp3A = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(3, 2, 3, 3)); + __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); + + // Second 2 columns + __m128 Swp2B = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(3, 2, 3, 3)); + __m128 Swp3B = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(0, 1, 1, 2)); + __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); + + // Columns subtraction + __m128 SubE = _mm_sub_ps(MulA, MulB); + + // Last 2 rows + __m128 Swp2C = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 0, 1, 2)); + __m128 Swp3C = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(1, 2, 0, 0)); + __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); + __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); + + //vec<4, T, Q> DetCof( + // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + __m128 SubFacA = _mm_shuffle_ps(SubE, SubE, _MM_SHUFFLE(2, 1, 0, 0)); + __m128 SwpFacA = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(0, 0, 0, 1)); + __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); + + __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); + __m128 SubFacB = _mm_shuffle_ps(SubTmpB, SubTmpB, _MM_SHUFFLE(3, 1, 1, 0));//SubF[0], SubE[3], SubE[3], SubE[1]; + __m128 SwpFacB = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(1, 1, 2, 2)); + __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); + + __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); + + __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); + __m128 SubFacC = _mm_shuffle_ps(SubTmpC, SubTmpC, _MM_SHUFFLE(3, 3, 2, 0)); + __m128 SwpFacC = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(2, 3, 3, 3)); + __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); + + __m128 AddRes = _mm_add_ps(SubRes, MulFacC); + __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); + + //return m[0][0] * DetCof[0] + // + m[0][1] * DetCof[1] + // + m[0][2] * DetCof[2] + // + m[0][3] * DetCof[3]; + + return glm_vec4_dot(m[0], DetCof); +} + +GLM_FUNC_QUALIFIER void glm_mat4_inverse(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + __m128 Rcp0 = _mm_div_ps(_mm_set1_ps(1.0f), Det0); + //__m128 Rcp0 = _mm_rcp_ps(Det0); + + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} + +GLM_FUNC_QUALIFIER void glm_mat4_inverse_lowp(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + __m128 Rcp0 = _mm_rcp_ps(Det0); + //__m128 Rcp0 = _mm_div_ps(one, Det0); + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} +/* +GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) +{ + float a = glm::radians(Angle); + float c = cos(a); + float s = sin(a); + + glm::vec4 AxisA(v[0], v[1], v[2], float(0)); + __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); + __m128 AxisC = detail::sse_nrm_ps(AxisB); + + __m128 Cos0 = _mm_set_ss(c); + __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Sin0 = _mm_set_ss(s); + __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); + + // vec<3, T, Q> temp = (valType(1) - c) * axis; + __m128 Temp0 = _mm_sub_ps(one, CosA); + __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); + + //Rotate[0][0] = c + temp[0] * axis[0]; + //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); + __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); + __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); + __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); + __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); + __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); + __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); + + //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + //Rotate[1][1] = c + temp[1] * axis[1]; + //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); + __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); + __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); + __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); + __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); + __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); + __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); + + //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + //Rotate[2][2] = c + temp[2] * axis[2]; + __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); + __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); + __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); + __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); + __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); + __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); + __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); + + __m128 Result[4]; + Result[0] = TmpA4; + Result[1] = TmpB4; + Result[2] = TmpC4; + Result[3] = _mm_set_ps(1, 0, 0, 0); + + //mat<4, 4, valType> Result; + //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + //Result[3] = m[3]; + //return Result; + sse_mul_ps(in, Result, out); +} +*/ +GLM_FUNC_QUALIFIER void glm_mat4_outerProduct(__m128 const& c, __m128 const& r, __m128 out[4]) +{ + out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); + out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); + out[2] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(2, 2, 2, 2))); + out[3] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(3, 3, 3, 3))); +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/neon.h b/include/glm/glm/simd/neon.h new file mode 100644 index 00000000..6c38b06c --- /dev/null +++ b/include/glm/glm/simd/neon.h @@ -0,0 +1,155 @@ +/// @ref simd_neon +/// @file glm/simd/neon.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +#include + +namespace glm { + namespace neon { + static float32x4_t dupq_lane(float32x4_t vsrc, int lane) { + switch(lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdupq_laneq_f32(vsrc, 0); + case 1: return vdupq_laneq_f32(vsrc, 1); + case 2: return vdupq_laneq_f32(vsrc, 2); + case 3: return vdupq_laneq_f32(vsrc, 3); +#else + case 0: return vdupq_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdupq_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdupq_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdupq_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } + + static float32x2_t dup_lane(float32x4_t vsrc, int lane) { + switch(lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdup_laneq_f32(vsrc, 0); + case 1: return vdup_laneq_f32(vsrc, 1); + case 2: return vdup_laneq_f32(vsrc, 2); + case 3: return vdup_laneq_f32(vsrc, 3); +#else + case 0: return vdup_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdup_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdup_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdup_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + assert(!"Unreachable code executed!"); + return vdup_n_f32(0.0f); + } + + static float32x4_t copy_lane(float32x4_t vdst, int dlane, float32x4_t vsrc, int slane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(dlane) { + case 0: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 0, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 0, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 0, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 0, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 1: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 1, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 1, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 1, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 1, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 2: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 2, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 2, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 2, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 2, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 3: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 3, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 3, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 3, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 3, vsrc, 3); + } + assert(!"Unreachable code executed!"); + } +#else + + float l; + switch(slane) { + case 0: l = vgetq_lane_f32(vsrc, 0); break; + case 1: l = vgetq_lane_f32(vsrc, 1); break; + case 2: l = vgetq_lane_f32(vsrc, 2); break; + case 3: l = vgetq_lane_f32(vsrc, 3); break; + default: + assert(!"Unreachable code executed!"); + } + switch(dlane) { + case 0: return vsetq_lane_f32(l, vdst, 0); + case 1: return vsetq_lane_f32(l, vdst, 1); + case 2: return vsetq_lane_f32(l, vdst, 2); + case 3: return vsetq_lane_f32(l, vdst, 3); + } +#endif + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } + + static float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(lane) { + case 0: return vmulq_laneq_f32(v, vlane, 0); break; + case 1: return vmulq_laneq_f32(v, vlane, 1); break; + case 2: return vmulq_laneq_f32(v, vlane, 2); break; + case 3: return vmulq_laneq_f32(v, vlane, 3); break; + default: + assert(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); +#else + return vmulq_f32(v, dupq_lane(vlane, lane)); +#endif + } + + static float32x4_t madd_lane(float32x4_t acc, float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT +#ifdef GLM_CONFIG_FORCE_FMA +# define FMADD_LANE(acc, x, y, L) do { asm volatile ("fmla %0.4s, %1.4s, %2.4s" : "+w"(acc) : "w"(x), "w"(dup_lane(y, L))); } while(0) +#else +# define FMADD_LANE(acc, x, y, L) do { acc = vmlaq_laneq_f32(acc, x, y, L); } while(0) +#endif + + switch(lane) { + case 0: + FMADD_LANE(acc, v, vlane, 0); + return acc; + case 1: + FMADD_LANE(acc, v, vlane, 1); + return acc; + case 2: + FMADD_LANE(acc, v, vlane, 2); + return acc; + case 3: + FMADD_LANE(acc, v, vlane, 3); + return acc; + default: + assert(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); +# undef FMADD_LANE +#else + return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); +#endif + } + } //namespace neon +} // namespace glm +#endif // GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/include/glm/glm/simd/packing.h b/include/glm/glm/simd/packing.h new file mode 100644 index 00000000..609163eb --- /dev/null +++ b/include/glm/glm/simd/packing.h @@ -0,0 +1,8 @@ +/// @ref simd +/// @file glm/simd/packing.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/simd/platform.h b/include/glm/glm/simd/platform.h new file mode 100644 index 00000000..ad25cc15 --- /dev/null +++ b/include/glm/glm/simd/platform.h @@ -0,0 +1,398 @@ +#pragma once + +/////////////////////////////////////////////////////////////////////////////////// +// Platform + +#define GLM_PLATFORM_UNKNOWN 0x00000000 +#define GLM_PLATFORM_WINDOWS 0x00010000 +#define GLM_PLATFORM_LINUX 0x00020000 +#define GLM_PLATFORM_APPLE 0x00040000 +//#define GLM_PLATFORM_IOS 0x00080000 +#define GLM_PLATFORM_ANDROID 0x00100000 +#define GLM_PLATFORM_CHROME_NACL 0x00200000 +#define GLM_PLATFORM_UNIX 0x00400000 +#define GLM_PLATFORM_QNXNTO 0x00800000 +#define GLM_PLATFORM_WINCE 0x01000000 +#define GLM_PLATFORM_CYGWIN 0x02000000 + +#ifdef GLM_FORCE_PLATFORM_UNKNOWN +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#elif defined(__CYGWIN__) +# define GLM_PLATFORM GLM_PLATFORM_CYGWIN +#elif defined(__QNXNTO__) +# define GLM_PLATFORM GLM_PLATFORM_QNXNTO +#elif defined(__APPLE__) +# define GLM_PLATFORM GLM_PLATFORM_APPLE +#elif defined(WINCE) +# define GLM_PLATFORM GLM_PLATFORM_WINCE +#elif defined(_WIN32) +# define GLM_PLATFORM GLM_PLATFORM_WINDOWS +#elif defined(__native_client__) +# define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL +#elif defined(__ANDROID__) +# define GLM_PLATFORM GLM_PLATFORM_ANDROID +#elif defined(__linux) +# define GLM_PLATFORM GLM_PLATFORM_LINUX +#elif defined(__unix) +# define GLM_PLATFORM GLM_PLATFORM_UNIX +#else +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#endif// + +/////////////////////////////////////////////////////////////////////////////////// +// Compiler + +#define GLM_COMPILER_UNKNOWN 0x00000000 + +// Intel +#define GLM_COMPILER_INTEL 0x00100000 +#define GLM_COMPILER_INTEL14 0x00100040 +#define GLM_COMPILER_INTEL15 0x00100050 +#define GLM_COMPILER_INTEL16 0x00100060 +#define GLM_COMPILER_INTEL17 0x00100070 + +// Visual C++ defines +#define GLM_COMPILER_VC 0x01000000 +#define GLM_COMPILER_VC12 0x01000001 +#define GLM_COMPILER_VC14 0x01000002 +#define GLM_COMPILER_VC15 0x01000003 +#define GLM_COMPILER_VC15_3 0x01000004 +#define GLM_COMPILER_VC15_5 0x01000005 +#define GLM_COMPILER_VC15_6 0x01000006 +#define GLM_COMPILER_VC15_7 0x01000007 +#define GLM_COMPILER_VC15_8 0x01000008 +#define GLM_COMPILER_VC15_9 0x01000009 +#define GLM_COMPILER_VC16 0x0100000A + +// GCC defines +#define GLM_COMPILER_GCC 0x02000000 +#define GLM_COMPILER_GCC46 0x020000D0 +#define GLM_COMPILER_GCC47 0x020000E0 +#define GLM_COMPILER_GCC48 0x020000F0 +#define GLM_COMPILER_GCC49 0x02000100 +#define GLM_COMPILER_GCC5 0x02000200 +#define GLM_COMPILER_GCC6 0x02000300 +#define GLM_COMPILER_GCC7 0x02000400 +#define GLM_COMPILER_GCC8 0x02000500 + +// CUDA +#define GLM_COMPILER_CUDA 0x10000000 +#define GLM_COMPILER_CUDA75 0x10000001 +#define GLM_COMPILER_CUDA80 0x10000002 +#define GLM_COMPILER_CUDA90 0x10000004 + +// SYCL +#define GLM_COMPILER_SYCL 0x00300000 + +// Clang +#define GLM_COMPILER_CLANG 0x20000000 +#define GLM_COMPILER_CLANG34 0x20000050 +#define GLM_COMPILER_CLANG35 0x20000060 +#define GLM_COMPILER_CLANG36 0x20000070 +#define GLM_COMPILER_CLANG37 0x20000080 +#define GLM_COMPILER_CLANG38 0x20000090 +#define GLM_COMPILER_CLANG39 0x200000A0 +#define GLM_COMPILER_CLANG40 0x200000B0 +#define GLM_COMPILER_CLANG41 0x200000C0 +#define GLM_COMPILER_CLANG42 0x200000D0 + +// Build model +#define GLM_MODEL_32 0x00000010 +#define GLM_MODEL_64 0x00000020 + +// Force generic C++ compiler +#ifdef GLM_FORCE_COMPILER_UNKNOWN +# define GLM_COMPILER GLM_COMPILER_UNKNOWN + +#elif defined(__INTEL_COMPILER) +# if __INTEL_COMPILER >= 1700 +# define GLM_COMPILER GLM_COMPILER_INTEL17 +# elif __INTEL_COMPILER >= 1600 +# define GLM_COMPILER GLM_COMPILER_INTEL16 +# elif __INTEL_COMPILER >= 1500 +# define GLM_COMPILER GLM_COMPILER_INTEL15 +# elif __INTEL_COMPILER >= 1400 +# define GLM_COMPILER GLM_COMPILER_INTEL14 +# elif __INTEL_COMPILER < 1400 +# error "GLM requires ICC 2013 SP1 or newer" +# endif + +// CUDA +#elif defined(__CUDACC__) +# if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) +# include // make sure version is defined since nvcc does not define it itself! +# endif +# if CUDA_VERSION >= 8000 +# define GLM_COMPILER GLM_COMPILER_CUDA80 +# elif CUDA_VERSION >= 7500 +# define GLM_COMPILER GLM_COMPILER_CUDA75 +# elif CUDA_VERSION >= 7000 +# define GLM_COMPILER GLM_COMPILER_CUDA70 +# elif CUDA_VERSION < 7000 +# error "GLM requires CUDA 7.0 or higher" +# endif + +// SYCL +#elif defined(__SYCL_DEVICE_ONLY__) +# define GLM_COMPILER GLM_COMPILER_SYCL + +// Clang +#elif defined(__clang__) +# if defined(__apple_build_version__) +# if (__clang_major__ < 6) +# error "GLM requires Clang 3.4 / Apple Clang 6.0 or higher" +# elif __clang_major__ == 6 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_CLANG35 +# elif __clang_major__ == 6 && __clang_minor__ >= 1 +# define GLM_COMPILER GLM_COMPILER_CLANG36 +# elif __clang_major__ >= 7 +# define GLM_COMPILER GLM_COMPILER_CLANG37 +# endif +# else +# if ((__clang_major__ == 3) && (__clang_minor__ < 4)) || (__clang_major__ < 3) +# error "GLM requires Clang 3.4 or higher" +# elif __clang_major__ == 3 && __clang_minor__ == 4 +# define GLM_COMPILER GLM_COMPILER_CLANG34 +# elif __clang_major__ == 3 && __clang_minor__ == 5 +# define GLM_COMPILER GLM_COMPILER_CLANG35 +# elif __clang_major__ == 3 && __clang_minor__ == 6 +# define GLM_COMPILER GLM_COMPILER_CLANG36 +# elif __clang_major__ == 3 && __clang_minor__ == 7 +# define GLM_COMPILER GLM_COMPILER_CLANG37 +# elif __clang_major__ == 3 && __clang_minor__ == 8 +# define GLM_COMPILER GLM_COMPILER_CLANG38 +# elif __clang_major__ == 3 && __clang_minor__ >= 9 +# define GLM_COMPILER GLM_COMPILER_CLANG39 +# elif __clang_major__ == 4 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_CLANG40 +# elif __clang_major__ == 4 && __clang_minor__ == 1 +# define GLM_COMPILER GLM_COMPILER_CLANG41 +# elif __clang_major__ == 4 && __clang_minor__ >= 2 +# define GLM_COMPILER GLM_COMPILER_CLANG42 +# elif __clang_major__ >= 4 +# define GLM_COMPILER GLM_COMPILER_CLANG42 +# endif +# endif + +// Visual C++ +#elif defined(_MSC_VER) +# if _MSC_VER >= 1920 +# define GLM_COMPILER GLM_COMPILER_VC16 +# elif _MSC_VER >= 1916 +# define GLM_COMPILER GLM_COMPILER_VC15_9 +# elif _MSC_VER >= 1915 +# define GLM_COMPILER GLM_COMPILER_VC15_8 +# elif _MSC_VER >= 1914 +# define GLM_COMPILER GLM_COMPILER_VC15_7 +# elif _MSC_VER >= 1913 +# define GLM_COMPILER GLM_COMPILER_VC15_6 +# elif _MSC_VER >= 1912 +# define GLM_COMPILER GLM_COMPILER_VC15_5 +# elif _MSC_VER >= 1911 +# define GLM_COMPILER GLM_COMPILER_VC15_3 +# elif _MSC_VER >= 1910 +# define GLM_COMPILER GLM_COMPILER_VC15 +# elif _MSC_VER >= 1900 +# define GLM_COMPILER GLM_COMPILER_VC14 +# elif _MSC_VER >= 1800 +# define GLM_COMPILER GLM_COMPILER_VC12 +# elif _MSC_VER < 1800 +# error "GLM requires Visual C++ 12 - 2013 or higher" +# endif//_MSC_VER + +// G++ +#elif defined(__GNUC__) || defined(__MINGW32__) +# if __GNUC__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC8 +# elif __GNUC__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC7 +# elif __GNUC__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC6 +# elif __GNUC__ >= 5 +# define GLM_COMPILER GLM_COMPILER_GCC5 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +# define GLM_COMPILER GLM_COMPILER_GCC49 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC48 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC47 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC46 +# elif ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)) || (__GNUC__ < 4) +# error "GLM requires GCC 4.6 or higher" +# endif + +#else +# define GLM_COMPILER GLM_COMPILER_UNKNOWN +#endif + +#ifndef GLM_COMPILER +# error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message." +#endif//GLM_COMPILER + +/////////////////////////////////////////////////////////////////////////////////// +// Instruction sets + +// User defines: GLM_FORCE_PURE GLM_FORCE_INTRINSICS GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 + +#define GLM_ARCH_MIPS_BIT (0x10000000) +#define GLM_ARCH_PPC_BIT (0x20000000) +#define GLM_ARCH_ARM_BIT (0x40000000) +#define GLM_ARCH_ARMV8_BIT (0x01000000) +#define GLM_ARCH_X86_BIT (0x80000000) + +#define GLM_ARCH_SIMD_BIT (0x00001000) + +#define GLM_ARCH_NEON_BIT (0x00000001) +#define GLM_ARCH_SSE_BIT (0x00000002) +#define GLM_ARCH_SSE2_BIT (0x00000004) +#define GLM_ARCH_SSE3_BIT (0x00000008) +#define GLM_ARCH_SSSE3_BIT (0x00000010) +#define GLM_ARCH_SSE41_BIT (0x00000020) +#define GLM_ARCH_SSE42_BIT (0x00000040) +#define GLM_ARCH_AVX_BIT (0x00000080) +#define GLM_ARCH_AVX2_BIT (0x00000100) + +#define GLM_ARCH_UNKNOWN (0) +#define GLM_ARCH_X86 (GLM_ARCH_X86_BIT) +#define GLM_ARCH_SSE (GLM_ARCH_SSE_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_X86) +#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_SSE) +#define GLM_ARCH_SSE3 (GLM_ARCH_SSE3_BIT | GLM_ARCH_SSE2) +#define GLM_ARCH_SSSE3 (GLM_ARCH_SSSE3_BIT | GLM_ARCH_SSE3) +#define GLM_ARCH_SSE41 (GLM_ARCH_SSE41_BIT | GLM_ARCH_SSSE3) +#define GLM_ARCH_SSE42 (GLM_ARCH_SSE42_BIT | GLM_ARCH_SSE41) +#define GLM_ARCH_AVX (GLM_ARCH_AVX_BIT | GLM_ARCH_SSE42) +#define GLM_ARCH_AVX2 (GLM_ARCH_AVX2_BIT | GLM_ARCH_AVX) +#define GLM_ARCH_ARM (GLM_ARCH_ARM_BIT) +#define GLM_ARCH_ARMV8 (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM | GLM_ARCH_ARMV8_BIT) +#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM) +#define GLM_ARCH_MIPS (GLM_ARCH_MIPS_BIT) +#define GLM_ARCH_PPC (GLM_ARCH_PPC_BIT) + +#if defined(GLM_FORCE_ARCH_UNKNOWN) || defined(GLM_FORCE_PURE) +# define GLM_ARCH GLM_ARCH_UNKNOWN +#elif defined(GLM_FORCE_NEON) +# if __ARM_ARCH >= 8 +# define GLM_ARCH (GLM_ARCH_ARMV8) +# else +# define GLM_ARCH (GLM_ARCH_NEON) +# endif +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_AVX2) +# define GLM_ARCH (GLM_ARCH_AVX2) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_AVX) +# define GLM_ARCH (GLM_ARCH_AVX) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE42) +# define GLM_ARCH (GLM_ARCH_SSE42) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE41) +# define GLM_ARCH (GLM_ARCH_SSE41) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSSE3) +# define GLM_ARCH (GLM_ARCH_SSSE3) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE3) +# define GLM_ARCH (GLM_ARCH_SSE3) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE2) +# define GLM_ARCH (GLM_ARCH_SSE2) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE) +# define GLM_ARCH (GLM_ARCH_SSE) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_INTRINSICS) && !defined(GLM_FORCE_XYZW_ONLY) +# if defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX) +# elif defined(__SSE4_2__) +# define GLM_ARCH (GLM_ARCH_SSE42) +# elif defined(__SSE4_1__) +# define GLM_ARCH (GLM_ARCH_SSE41) +# elif defined(__SSSE3__) +# define GLM_ARCH (GLM_ARCH_SSSE3) +# elif defined(__SSE3__) +# define GLM_ARCH (GLM_ARCH_SSE3) +# elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP) +# define GLM_ARCH (GLM_ARCH_SSE2) +# elif defined(__i386__) +# define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) +# define GLM_ARCH (GLM_ARCH_ARMV8) +# elif defined(__ARM_NEON) +# define GLM_ARCH (GLM_ARCH_ARM | GLM_ARCH_NEON) +# elif defined(__arm__ ) || defined(_M_ARM) +# define GLM_ARCH (GLM_ARCH_ARM) +# elif defined(__mips__ ) +# define GLM_ARCH (GLM_ARCH_MIPS) +# elif defined(__powerpc__ ) || defined(_M_PPC) +# define GLM_ARCH (GLM_ARCH_PPC) +# else +# define GLM_ARCH (GLM_ARCH_UNKNOWN) +# endif +#else +# if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(__i386__) +# define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__arm__) || defined(_M_ARM) +# define GLM_ARCH (GLM_ARCH_ARM) +# elif defined(__powerpc__) || defined(_M_PPC) +# define GLM_ARCH (GLM_ARCH_PPC) +# elif defined(__mips__) +# define GLM_ARCH (GLM_ARCH_MIPS) +# else +# define GLM_ARCH (GLM_ARCH_UNKNOWN) +# endif +#endif + +#if GLM_ARCH & GLM_ARCH_AVX2_BIT +# include +#elif GLM_ARCH & GLM_ARCH_AVX_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE42_BIT +# if GLM_COMPILER & GLM_COMPILER_CLANG +# include +# endif +# include +#elif GLM_ARCH & GLM_ARCH_SSE41_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSSE3_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE3_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE2_BIT +# include +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +# include "neon.h" +#endif//GLM_ARCH + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + typedef __m128 glm_f32vec4; + typedef __m128i glm_i32vec4; + typedef __m128i glm_u32vec4; + typedef __m128d glm_f64vec2; + typedef __m128i glm_i64vec2; + typedef __m128i glm_u64vec2; + + typedef glm_f32vec4 glm_vec4; + typedef glm_i32vec4 glm_ivec4; + typedef glm_u32vec4 glm_uvec4; + typedef glm_f64vec2 glm_dvec2; +#endif + +#if GLM_ARCH & GLM_ARCH_AVX_BIT + typedef __m256d glm_f64vec4; + typedef glm_f64vec4 glm_dvec4; +#endif + +#if GLM_ARCH & GLM_ARCH_AVX2_BIT + typedef __m256i glm_i64vec4; + typedef __m256i glm_u64vec4; +#endif + +#if GLM_ARCH & GLM_ARCH_NEON_BIT + typedef float32x4_t glm_f32vec4; + typedef int32x4_t glm_i32vec4; + typedef uint32x4_t glm_u32vec4; +#endif diff --git a/include/glm/glm/simd/trigonometric.h b/include/glm/glm/simd/trigonometric.h new file mode 100644 index 00000000..739b796e --- /dev/null +++ b/include/glm/glm/simd/trigonometric.h @@ -0,0 +1,9 @@ +/// @ref simd +/// @file glm/simd/trigonometric.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/include/glm/glm/simd/vector_relational.h b/include/glm/glm/simd/vector_relational.h new file mode 100644 index 00000000..f7385e97 --- /dev/null +++ b/include/glm/glm/simd/vector_relational.h @@ -0,0 +1,8 @@ +/// @ref simd +/// @file glm/simd/vector_relational.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/include/glm/glm/trigonometric.hpp b/include/glm/glm/trigonometric.hpp new file mode 100644 index 00000000..fcf07f89 --- /dev/null +++ b/include/glm/glm/trigonometric.hpp @@ -0,0 +1,210 @@ +/// @ref core +/// @file glm/trigonometric.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions +/// +/// @defgroup core_func_trigonometric Angle and Trigonometry Functions +/// @ingroup core +/// +/// Function parameters specified as angle are assumed to be in units of radians. +/// In no case will any of these functions result in a divide by zero error. If +/// the divisor of a ratio is 0, then results will be undefined. +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. +/// +/// @see ext_vector_trigonometric + +#pragma once + +#include "detail/setup.hpp" +#include "detail/qualifier.hpp" + +namespace glm +{ + /// @addtogroup core_func_trigonometric + /// @{ + + /// Converts degrees to radians and returns the result. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL radians man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); + + /// Converts radians to degrees and returns the result. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL degrees man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); + + /// The standard trigonometric sine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec sin(vec const& angle); + + /// The standard trigonometric cosine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL cos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec cos(vec const& angle); + + /// The standard trigonometric tangent function. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL tan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec tan(vec const& angle); + + /// Arc sine. Returns an angle whose sine is x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// Results are undefined if |x| > 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL asin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec asin(vec const& x); + + /// Arc cosine. Returns an angle whose sine is x. + /// The range of values returned by this function is [0, PI]. + /// Results are undefined if |x| > 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL acos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec acos(vec const& x); + + /// Arc tangent. Returns an angle whose tangent is y/x. + /// The signs of x and y are used to determine what + /// quadrant the angle is in. The range of values returned + /// by this function is [-PI, PI]. Results are undefined + /// if x and y are both 0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atan(vec const& y, vec const& x); + + /// Arc tangent. Returns an angle whose tangent is y_over_x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atan(vec const& y_over_x); + + /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec sinh(vec const& angle); + + /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL cosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec cosh(vec const& angle); + + /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL tanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec tanh(vec const& angle); + + /// Arc hyperbolic sine; returns the inverse of sinh. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL asinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec asinh(vec const& x); + + /// Arc hyperbolic cosine; returns the non-negative inverse + /// of cosh. Results are undefined if x < 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL acosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec acosh(vec const& x); + + /// Arc hyperbolic tangent; returns the inverse of tanh. + /// Results are undefined if abs(x) >= 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atanh(vec const& x); + + /// @} +}//namespace glm + +#include "detail/func_trigonometric.inl" diff --git a/include/glm/glm/vec2.hpp b/include/glm/glm/vec2.hpp new file mode 100644 index 00000000..cd4e0708 --- /dev/null +++ b/include/glm/glm/vec2.hpp @@ -0,0 +1,14 @@ +/// @ref core +/// @file glm/vec2.hpp + +#pragma once +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" diff --git a/include/glm/glm/vec3.hpp b/include/glm/glm/vec3.hpp new file mode 100644 index 00000000..f5a927db --- /dev/null +++ b/include/glm/glm/vec3.hpp @@ -0,0 +1,14 @@ +/// @ref core +/// @file glm/vec3.hpp + +#pragma once +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" diff --git a/include/glm/glm/vec4.hpp b/include/glm/glm/vec4.hpp new file mode 100644 index 00000000..c6ea9f1f --- /dev/null +++ b/include/glm/glm/vec4.hpp @@ -0,0 +1,15 @@ +/// @ref core +/// @file glm/vec4.hpp + +#pragma once +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" + diff --git a/include/glm/glm/vector_relational.hpp b/include/glm/glm/vector_relational.hpp new file mode 100644 index 00000000..a0fe17eb --- /dev/null +++ b/include/glm/glm/vector_relational.hpp @@ -0,0 +1,121 @@ +/// @ref core +/// @file glm/vector_relational.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions +/// +/// @defgroup core_func_vector_relational Vector Relational Functions +/// @ingroup core +/// +/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to +/// operate on scalars and produce scalar Boolean results. For vector results, +/// use the following built-in functions. +/// +/// In all cases, the sizes of all the input and return vectors for any particular +/// call must match. +/// +/// Include to use these core features. +/// +/// @see ext_vector_relational + +#pragma once + +#include "detail/qualifier.hpp" +#include "detail/setup.hpp" + +namespace glm +{ + /// @addtogroup core_func_vector_relational + /// @{ + + /// Returns the component-wise comparison result of x < y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL lessThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x <= y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL lessThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x > y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL greaterThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x >= y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL greaterThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point, integer or bool scalar type. + /// + /// @see GLSL equal man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point, integer or bool scalar type. + /// + /// @see GLSL notEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y); + + /// Returns true if any component of x is true. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL any man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR bool any(vec const& v); + + /// Returns true if all components of x are true. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL all man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR bool all(vec const& v); + + /// Returns the component-wise logical complement of x. + /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL not man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec not_(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_vector_relational.inl" diff --git a/include/glm/manual.md b/include/glm/manual.md new file mode 100644 index 00000000..a7f6956f --- /dev/null +++ b/include/glm/manual.md @@ -0,0 +1,2411 @@ +![Alt](./doc/manual/logo-mini.png "GLM Logo") + +# GLM 0.9.9 Manual + +![Alt](./doc/manual/g-truc.png "G-Truc Logo") + +--- +
    + +## Table of Contents ++ [0. Licenses](#section0) ++ [1. Getting started](#section1) ++ [1.1. Using global headers](#section1_1) ++ [1.2. Using separated headers](#section1_2) ++ [1.3. Using extension headers](#section1_3) ++ [1.4. Dependencies](#section1_4) ++ [1.5. Finding GLM with CMake](#section1_5) ++ [2. Preprocessor configurations](#section2) ++ [2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration](#section2_1) ++ [2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform](#section2_2) ++ [2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler](#section2_3) ++ [2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture](#section2_4) ++ [2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard](#section2_5) ++ [2.6. GLM\_FORCE\_CXX**: C++ language detection](#section2_6) ++ [2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions](#section2_7) ++ [2.8. GLM\_FORCE\_INLINE: Force inline](#section2_8) ++ [2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types](#section2_9) ++ [2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default](#section2_10) ++ [2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations](#section2_11) ++ [2.12. GLM\_FORCE\_PRECISION\_**: Default precision](#section2_12) ++ [2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types](#section2_13) ++ [2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators](#section2_14) ++ [2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components](#section2_15) ++ [2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system](#section2_16) ++ [2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1](#section2_17) ++ [2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size type](#section2_18) ++ [2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction](#section2_19) ++ [2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions](#section2_20) ++ [2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w](#section2_21) ++ [3. Stable extensions](#section3) ++ [3.1. Scalar types](#section3_1) ++ [3.2. Scalar functions](#section3_2) ++ [3.3. Vector types](#section3_3) ++ [3.4. Vector types with precision qualifiers](#section3_4) ++ [3.5. Vector functions](#section3_5) ++ [3.6. Matrix types](#section3_6) ++ [3.7. Matrix types with precision qualifiers](#section3_7) ++ [3.8. Matrix functions](#section3_8) ++ [3.9. Quaternion types](#section3_9) ++ [3.10. Quaternion types with precision qualifiers](#section3_10) ++ [3.11. Quaternion functions](#section3_11) ++ [4. Recommended extensions](#section4) ++ [4.1. GLM_GTC_bitfield](#section4_1) ++ [4.2. GLM_GTC_color_space](#section4_2) ++ [4.3. GLM_GTC_constants](#section4_3) ++ [4.4. GLM_GTC_epsilon](#section4_4) ++ [4.5. GLM_GTC_integer](#section4_5) ++ [4.6. GLM_GTC_matrix_access](#section4_6) ++ [4.7. GLM_GTC_matrix_integer](#section4_7) ++ [4.8. GLM_GTC_matrix_inverse](#section4_8) ++ [4.9. GLM_GTC_matrix_transform](#section4_9) ++ [4.10. GLM_GTC_noise](#section4_10) ++ [4.11. GLM_GTC_packing](#section4_11) ++ [4.12. GLM_GTC_quaternion](#section4_12) ++ [4.13. GLM_GTC_random](#section4_13) ++ [4.14. GLM_GTC_reciprocal](#section4_14) ++ [4.15. GLM_GTC_round](#section4_15) ++ [4.16. GLM_GTC_type_alignment](#section4_16) ++ [4.17. GLM_GTC_type_precision](#section4_17) ++ [4.18. GLM_GTC_type_ptr](#section4_18) ++ [4.19. GLM_GTC_ulp](#section4_19) ++ [4.20. GLM_GTC_vec1](#section4_20) ++ [5. OpenGL interoperability](#section5) ++ [5.1. GLM Replacements for deprecated OpenGL functions](#section5_1) ++ [5.2. GLM Replacements for GLU functions](#section5_2) ++ [6. Known issues](#section6) ++ [6.1. Not function](#section6_1) ++ [6.2. Precision qualifiers support](#section6_2) ++ [7. FAQ](#section7) ++ [7.1 Why GLM follows GLSL specification and conventions?](#section7_1) ++ [7.2. Does GLM run GLSL programs?](#section7_2) ++ [7.3. Does a GLSL compiler build GLM codes?](#section7_3) ++ [7.4. Should I use ‘GTX’ extensions?](#section7_4) ++ [7.5. Where can I ask my questions?](#section7_5) ++ [7.6. Where can I find the documentation of extensions?](#section7_6) ++ [7.7. Should I use 'using namespace glm;'?](#section7_7) ++ [7.8. Is GLM fast?](#section7_8) ++ [7.9. When I build with Visual C++ with /w4 warning level, I have warnings...](#section7_9) ++ [7.10. Why some GLM functions can crash because of division by zero?](#section7_10) ++ [7.11. What unit for angles us used in GLM?](#section7_11) ++ [7.12. Windows headers cause build errors...](#section7_12) ++ [7.13. Constant expressions support](#section7_13) ++ [8. Code samples](#section8) ++ [8.1. Compute a triangle normal](#section8_1) ++ [8.2. Matrix transform](#section8_2) ++ [8.3. Vector types](#section8_3) ++ [8.4. Lighting](#section8_4) ++ [9. Contributing to GLM](#section9) ++ [9.1. Submitting bug reports](#section9_1) ++ [9.2. Contributing to GLM with pull request](#section9_2) ++ [9.3. Coding style](#section9_3) ++ [10. References](#section10) ++ [10.1. OpenGL specifications](#section10_1) ++ [10.2. External links](#section10_2) ++ [10.3. Projects using GLM](#section10_3) ++ [10.4. Tutorials using GLM](#section10_4) ++ [10.5. Equivalent for other languages](#section10_5) ++ [10.6. Alternatives to GLM](#section10_6) ++ [10.7. Acknowledgements](#section10_7) + +--- +
    + +## Licenses + +### The Happy Bunny License (Modified MIT License) + +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +Restrictions: By making use of the Software for military purposes, you +choose to make a Bunny unhappy. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +![](./doc/manual/frontpage1.png) + +### The MIT License + +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +![](./doc/manual/frontpage2.png) + +--- +
    + +## 1. Getting started +### 1.1. Using global headers + +GLM is a header-only library, and thus does not need to be compiled. We can use GLM's implementation of GLSL's mathematics functionality by including the `` header: + +```cpp +#include +``` + +To extend the feature set supported by GLM and keeping the library as close to GLSL as possible, new features are implemented as extensions that can be included thought a separated header: +```cpp +// Include all GLM core / GLSL features +#include // vec2, vec3, mat4, radians + +// Include all GLM extensions +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +*Note: Including `` and `` is convenient but pull a lot of code which will significantly increase build time, particularly if these files are included in all source files. We may prefer to use the approaches describe in the two following sections to keep the project build fast.* + +### 1.2. Using separated headers + +GLM relies on C++ templates heavily, and may significantly increase compilation times for projects that use it. Hence, user projects could only include the features they actually use. Following is the list of all the core features, based on GLSL specification, headers: +```cpp +#include // vec2, bvec2, dvec2, ivec2 and uvec2 +#include // vec3, bvec3, dvec3, ivec3 and uvec3 +#include // vec4, bvec4, dvec4, ivec4 and uvec4 +#include // mat2, dmat2 +#include // mat2x3, dmat2x3 +#include // mat2x4, dmat2x4 +#include // mat3x2, dmat3x2 +#include // mat3, dmat3 +#include // mat3x4, dmat2 +#include // mat4x2, dmat4x2 +#include // mat4x3, dmat4x3 +#include // mat4, dmat4 +#include // all the GLSL common functions: abs, min, mix, isnan, fma, etc. +#include // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. +#include // all the GLSL geometry functions: dot, cross, reflect, etc. +#include // all the GLSL integer functions: findMSB, bitfieldExtract, etc. +#include // all the GLSL matrix functions: transpose, inverse, etc. +#include // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. +#include // all the GLSL trigonometric functions: radians, cos, asin, etc. +#include // all the GLSL vector relational functions: equal, less, etc. +``` + +The following is a code sample using separated core headers and an extension: +```cpp +// Include GLM core features +#include // vec2 +#include // vec3 +#include // mat4 +#include //radians + +// Include GLM extension +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +### 1.3. Using extension headers + +Using GLM through split headers to minimize the project build time: +```cpp +// Include GLM vector extensions: +#include // vec2 +#include // vec3 +#include // radians + +// Include GLM matrix extensions: +#include // mat4 +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +### 1.4. Dependencies + +GLM does not depend on external libraries or headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. + +### 1.5. Finding GLM with CMake + +GLM packages a `glmConfig.cmake` and `glmConfig-version.cmake` in the root of the repository and the release archives. To find GLM with CMake you can pass `-Dglm_DIR=/cmake/glm/` when running CMake. You can then either add `${GLM_INCLUDE_DIRS}` to your target's include directories, or link against the imported `glm::glm` target. + +--- +
    + +## 2. Preprocessor configurations + +### 2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration + +When included, GLM will first automatically detect the compiler used, the C++ standard supported, the compiler arguments used to configure itself matching the build environment. + +For example, if the compiler arguments request AVX code generation, GLM will rely on its code path providing AVX optimizations when available. + +We can change GLM configuration using specific C++ preprocessor defines that must be declared before including any GLM headers. + +Using `GLM_FORCE_MESSAGES`, GLM will report the configuration as part of the build log. + +```cpp +#define GLM_FORCE_MESSAGES // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) +#include +``` + +Example of configuration log generated by `GLM_FORCE_MESSAGES`: +```cpp +GLM: version 0.9.9.1 +GLM: C++ 17 with extensions +GLM: Clang compiler detected +GLM: x86 64 bits with AVX instruction set build target +GLM: Linux platform detected +GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. +GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. +GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. +GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. +GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. +``` + +The following subsections describe each configurations and defines. + +### 2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform + +`GLM_FORCE_PLATFORM_UNKNOWN` prevents GLM from detecting the build platform. + +### 2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler + +`GLM_FORCE_COMPILER_UNKNOWN` prevents GLM from detecting the C++ compiler. + +### 2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture + +`GLM_FORCE_ARCH_UNKNOWN` prevents GLM from detecting the build target architecture. + +### 2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard + +`GLM_FORCE_CSS_UNKNOWN` prevents GLM from detecting the C++ compiler standard support. + +### 2.6. GLM\_FORCE\_CXX**: C++ language detection + +GLM will automatically take advantage of compilers’ language extensions when enabled. To increase cross platform compatibility and to avoid compiler extensions, a programmer can define `GLM_FORCE_CXX98` before +any inclusion of `` to restrict the language feature set C++98: + +```cpp +#define GLM_FORCE_CXX98 +#include +``` + +For C++11, C++14, and C++17 equivalent defines are available: +* `GLM_FORCE_CXX11` +* `GLM_FORCE_CXX14` +* `GLM_FORCE_CXX17` + +```cpp +#define GLM_FORCE_CXX11 +#include + +// If the compiler doesn’t support C++11, compiler errors will happen. +``` + +`GLM_FORCE_CXX17` overrides `GLM_FORCE_CXX14`; `GLM_FORCE_CXX14` overrides `GLM_FORCE_CXX11`; and `GLM_FORCE_CXX11` overrides `GLM_FORCE_CXX98` defines. + +### 2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions + +GLSL supports implicit conversions of vector and matrix types. For example, an ivec4 can be implicitly converted into `vec4`. + +Often, this behaviour is not desirable but following the spirit of the library, this is the default behavior in GLM. However, GLM 0.9.6 introduced the define `GLM_FORCE_EXPLICIT_CTOR` to require explicit conversion for GLM types. + +```cpp +#include + +void foo() +{ + glm::ivec4 a; + ... + + glm::vec4 b(a); // Explicit conversion, OK + glm::vec4 c = a; // Implicit conversion, OK + ... +} +``` + +With `GLM_FORCE_EXPLICIT_CTOR` define, implicit conversions are not allowed: + +```cpp +#define GLM_FORCE_EXPLICIT_CTOR +#include + +void foo() +{ + glm::ivec4 a; + { + glm::vec4 b(a); // Explicit conversion, OK + glm::vec4 c = a; // Implicit conversion, ERROR + ... +} +``` + +### 2.8. GLM\_FORCE\_INLINE: Force inline + +To push further the software performance, a programmer can define `GLM_FORCE_INLINE` before any inclusion of `` to force the compiler to inline GLM code. + +```cpp +#define GLM_FORCE_INLINE +#include +``` + +### 2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types + +Every object type has the property called alignment requirement, which is an integer value (of type `std::size_t`, always a power of 2) representing the number of bytes between successive addresses at which objects of this type can be allocated. The alignment requirement of a type can be queried with alignof or `std::alignment_of`. The pointer alignment function `std::align` can be used to obtain a suitably-aligned pointer within some buffer, and `std::aligned_storage` can be used to obtain suitably-aligned storage. + +Each object type imposes its alignment requirement on every object of that type; stricter alignment (with larger alignment requirement) can be requested using C++11 `alignas`. + +In order to satisfy alignment requirements of all non-static members of a class, padding may be inserted after some of its members. + +GLM supports both packed and aligned types. Packed types allow filling data structure without inserting extra padding. Aligned GLM types align addresses based on the size of the value type of a GLM type. + +```cpp +#define GLM_FORCE_ALIGNED_GENTYPES +#include +#include + +typedef glm::aligned_vec4 vec4a; +typedef glm::packed_vec4 vec4p; +``` + +### 2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default + +GLM allows using aligned types by default for vector types using `GLM_FORCE_DEFAULT_ALIGNED_GENTYPES`: + +```cpp +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#include + +struct MyStruct +{ + glm::vec4 a; + float b; + glm::vec3 c; +}; + +void foo() +{ + printf("MyStruct requires memory padding: %d bytes\n", sizeof(MyStruct)); +} + +>>> MyStruct requires memory padding: 48 bytes +``` + +```cpp +#include + +struct MyStruct +{ + glm::vec4 a; + float b; + glm::vec3 c; +}; + +void foo() +{ + printf("MyStruct is tightly packed: %d bytes\n", sizeof(MyStruct)); +} + +>>> MyStruct is tightly packed: 32 bytes +``` + +*Note: GLM SIMD optimizations require the use of aligned types* + +### 2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations + +GLM provides some SIMD optimizations based on [compiler intrinsics](https://msdn.microsoft.com/en-us/library/26td21ds.aspx). +These optimizations will be automatically thanks to compiler arguments when `GLM_FORCE_INTRINSICS` is defined before including GLM files. +For example, if a program is compiled with Visual Studio using `/arch:AVX`, GLM will detect this argument and generate code using AVX instructions automatically when available. + +It’s possible to avoid the instruction set detection by forcing the use of a specific instruction set with one of the fallowing define: +`GLM_FORCE_SSE2`, `GLM_FORCE_SSE3`, `GLM_FORCE_SSSE3`, `GLM_FORCE_SSE41`, `GLM_FORCE_SSE42`, `GLM_FORCE_AVX`, `GLM_FORCE_AVX2` or `GLM_FORCE_AVX512`. + +The use of intrinsic functions by GLM implementation can be avoided using the define `GLM_FORCE_PURE` before any inclusion of GLM headers. This can be particularly useful if we want to rely on C++14 `constexpr`. + +```cpp +#define GLM_FORCE_PURE +#include + +static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for compile time tests"); + +// GLM code will be compiled using pure C++ code without any intrinsics +``` + +```cpp +#define GLM_FORCE_SIMD_AVX2 +#include + +// If the compiler doesn’t support AVX2 instrinsics, compiler errors will happen. +``` + +Additionally, GLM provides a low level SIMD API in glm/simd directory for users who are really interested in writing fast algorithms. + +### 2.12. GLM\_FORCE\_PRECISION\_**: Default precision + +C++ does not provide a way to implement GLSL default precision selection (as defined in GLSL 4.10 specification section 4.5.3) with GLSL-like syntax. + +```glsl +precision mediump int; +precision highp float; +``` + +To use the default precision functionality, GLM provides some defines that need to added before any include of `glm.hpp`: + +```cpp +#define GLM_FORCE_PRECISION_MEDIUMP_INT +#define GLM_FORCE_PRECISION_HIGHP_FLOAT +#include +``` + +Available defines for floating point types (`glm::vec\*`, `glm::mat\*`): + +* `GLM_FORCE_PRECISION_LOWP_FLOAT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_FLOAT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_FLOAT`: High precision (default) + +Available defines for floating point types (`glm::dvec\*`, `glm::dmat\*`): + +* `GLM_FORCE_PRECISION_LOWP_DOUBLE`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_DOUBLE`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_DOUBLE`: High precision (default) + +Available defines for signed integer types (`glm::ivec\*`): + +* `GLM_FORCE_PRECISION_LOWP_INT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_INT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_INT`: High precision (default) + +Available defines for unsigned integer types (`glm::uvec\*`): + +* `GLM_FORCE_PRECISION_LOWP_UINT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_UINT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_UINT`: High precision (default) + +### 2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types + +Some platforms (Dreamcast) doesn't support double precision floating point values. To compile on such platforms, GCC has the `--m4-single-only` build argument. When defining `GLM_FORCE_SINGLE_ONLY` before including GLM headers, GLM releases the requirement of double precision floating point values support. Effectivement, all the float64 types are no longer defined and double behaves like float. + +### 2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators + +Shader languages like GLSL often feature so-called swizzle expressions, which may be used to freely select and arrange a vector's components. For example, `variable.x`, `variable.xzy` and `variable.zxyy` respectively form a scalar, a 3D vector and a 4D vector. The result of a swizzle expression in GLSL can be either an R-value or an L-value. Swizzle expressions can be written with characters from exactly one of `xyzw` (usually for positions), `rgba` (usually for colors), and `stpq` (usually for texture coordinates). + +```glsl +vec4 A; +vec2 B; + +B.yx = A.wy; +B = A.xx; +vec3 C = A.bgr; +vec3 D = B.rsz; // Invalid, won't compile +``` + +GLM supports some of this functionality. Swizzling can be enabled by defining `GLM_FORCE_SWIZZLE`. + +*Note: Enabling swizzle expressions will massively increase the size of your binaries and the time it takes to compile them!* + +GLM has two levels of swizzling support described in the following subsections. + +#### 2.14.1. Swizzle functions for standard C++ 98 + +When compiling GLM as C++98, R-value swizzle expressions are simulated through member functions of each vector type. + +```cpp +#define GLM_FORCE_SWIZZLE // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) +#include + +void foo() +{ + glm::vec4 const ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); + glm::vec3 const ColorBGR = ColorRGBA.bgr(); + + glm::vec3 const PositionA = glm::vec3(1.0f, 0.5f, 0.0f); + glm::vec3 const PositionB = PositionXYZ.xyz() * 2.0f; + + glm::vec2 const TexcoordST = glm::vec2(1.0f, 0.5f); + glm::vec4 const TexcoordSTPQ = TexcoordST.stst(); +} +``` + +Swizzle operators return a **copy** of the component values, and thus *can't* be used as L-values to change a vector's values. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +void foo() +{ + glm::vec3 const A = glm::vec3(1.0f, 0.5f, 0.0f); + + // No compiler error, but A is not modified. + // An anonymous copy is being modified (and then discarded). + A.bgr() = glm::vec3(2.0f, 1.5f, 1.0f); // A is not modified! +} +``` + +#### 2.14.2. Swizzle operations for C++ 98 with language extensions + +Visual C++, GCC and Clang support, as a _non-standard language extension_, anonymous `struct`s as `union` members. This permits a powerful swizzling implementation that both allows L-value swizzle expressions and GLSL-like syntax. To use this feature, the language extension must be enabled by a supporting compiler and `GLM_FORCE_SWIZZLE` must be `#define`d. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +// Only guaranteed to work with Visual C++! +// Some compilers that support Microsoft extensions may compile this. +void foo() +{ + glm::vec4 ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); + + // l-value: + glm::vec4 ColorBGRA = ColorRGBA.bgra; + + // r-value: + ColorRGBA.bgra = ColorRGBA; + + // Both l-value and r-value + ColorRGBA.bgra = ColorRGBA.rgba; +} +``` + +This version returns implementation-specific objects that _implicitly convert_ to their respective vector types. As a consequence of this design, these extra types **can't be directly used** as C++ function arguments; they must be converted through constructors or `operator()`. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +using namespace glm; + +void foo() +{ + vec4 Color = vec4(1.0f, 0.5f, 0.0f, 1.0f); + + // Generates compiler errors. Color.rgba is not a vector type. + vec4 ClampedA = clamp(Color.rgba, 0.f, 1.f); // ERROR + + // Explicit conversion through a constructor + vec4 ClampedB = clamp(vec4(Color.rgba), 0.f, 1.f); // OK + + // Explicit conversion through operator() + vec4 ClampedC = clamp(Color.rgba(), 0.f, 1.f); // OK +} +``` + +*Note: The implementation has a caveat: Swizzle operator types must be different on both size of the equal operator or the operation will fail. There is no known fix for this issue to date* + +### 2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components + +Following GLSL specifications, GLM supports three sets of components to access vector types member: x, y, z, w; r, g, b, a; and s, t, p, q. +Also, this is making vector component very expressive in the code, it may make debugging vector types a little cubersom as the debuggers will typically display three time the values for each compoenents due to the existence of the three sets. + +To simplify vector types, GLM allows exposing only x, y, z and w components thanks to `GLM_FORCE_XYZW_ONLY` define. + +### 2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system + +By default, OpenGL is using a right handed coordinate system. However, others APIs such as Direct3D have done different choice and relies on the left handed coordinate system. + +GLM allows switching the coordinate system to left handed by defining `GLM_FORCE_LEFT_HANDED`. + +### 2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1 + +By default, OpenGL is using a -1 to 1 clip space in Z-axis. However, others APIs such as Direct3D relies on a clip space between 0 to 1 in Z-axis. + +GLM allows switching the clip space in Z-axis to 0 to 1 by defining `GLM_FORCE_DEPTH_ZERO_TO_ONE`. + +### 2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size + +GLSL supports the member function .length() for all vector and matrix types. + +```cpp +#include + +void foo(vec4 const& v) +{ + int Length = v.length(); + ... +} +``` + +This function returns an `int` however this function typically interacts with STL `size_t` based code. GLM provides `GLM_FORCE_SIZE_T_LENGTH` pre-processor configuration so that member functions `length()` return a `size_t`. + +Additionally, GLM defines the type `glm::length_t` to identify `length()` returned type, independently from `GLM_FORCE_SIZE_T_LENGTH`. + +```cpp +#define GLM_FORCE_SIZE_T_LENGTH +#include + +void foo(vec4 const& v) +{ + glm::length_t Length = v.length(); + ... +} +``` + +### 2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction + +GLSL has restrictions on types supported by certain functions that may appear excessive. +By default, GLM follows the GLSL specification as accurately as possible however it's possible to relax these rules using `GLM_FORCE_UNRESTRICTED_GENTYPE` define. + +```cpp +#include + +float average(float const A, float const B) +{ + return glm::mix(A, B, 0.5f); // By default glm::mix only supports floating-point types +} +``` + +By defining GLM\_FORCE\_UNRESTRICTED\_GENTYPE, we allow using integer types: + +```cpp +#define GLM_FORCE_UNRESTRICTED_GENTYPE +#include + +int average(int const A, int const B) +{ + return glm::mix(A, B, 0.5f); // integers are ok thanks to GLM_FORCE_UNRESTRICTED_GENTYPE +} +``` + +### 2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions + +When using /W4 on Visual C++ or -Wpedantic on GCC, for example, the compilers will generate warnings for using C++ language extensions (/Za with Visual C++) such as anonymous struct. +GLM relies on anonymous structs for swizzle operators and aligned vector types. To silent those warnings define `GLM_FORCE_SILENT_WARNINGS` before including GLM headers. + + +### 2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w + +By default GLM store quaternion components with the x, y, z, w order. `GLM_FORCE_QUAT_DATA_WXYZ` allows switching the quaternion data storage to the w, x, y, z order. + +--- +
    + +## 3. Stable extensions + +### 3.1. Scalar types + +#### 3.1.1. GLM_EXT_scalar_int_sized + +This extension exposes sized and signed integer types. + +Include `` to use these features. + +#### 3.1.2. GLM_EXT_scalar_uint_sized + +This extension exposes sized and unsigned integer types. + +```cpp +#include + +glm::uint64 pack(glm::uint32 A, glm::uint16 B, glm::uint8 C, glm::uint8 D) +{ + glm::uint64 ShiftA = 0; + glm::uint64 ShiftB = sizeof(glm::uint32) * 8; + glm::uint64 ShiftC = (sizeof(glm::uint32) + sizeof(glm::uint16)) * 8; + glm::uint64 ShiftD = (sizeof(glm::uint32) + sizeof(glm::uint16) + sizeof(glm::uint8)) * 8; + return (glm::uint64(A) << ShiftA) | (glm::uint64(B) << ShiftB) | (glm::uint64(C) << ShiftC) | (glm::uint64(D) << ShiftD); +} +``` + +Include `` to use these features. + +### 3.2. Scalar functions + +#### 3.2.1. GLM_EXT_scalar_common + +This extension exposes support for `min` and `max` functions taking more than two scalar arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. + +```cpp +#include + +float positiveMax(float const a, float const b) +{ + return glm::fmax(a, b, 0.0f); +} +``` + +Include `` to use these features. + +#### 3.2.2. GLM_EXT_scalar_relational + +This extension exposes `equal` and `notEqual` scalar variants which takes an epsilon argument. + +```cpp +#include + +bool epsilonEqual(float const a, float const b) +{ + float const CustomEpsilon = 0.0001f; + return glm::equal(a, b, CustomEpsilon); +} +``` + +Include `` to use these features. + +#### 3.2.3. GLM_EXT_scalar_constants + +This extension exposes useful constants such as `epsilon` and `pi`. + +```cpp +#include + +float circumference(float const Diameter) +{ + return glm::pi() * Diameter; +} +``` + +```cpp +#include // abs +#include // epsilon + +bool equalULP1(float const a, float const b) +{ + return glm::abs(a - b) <= glm::epsilon(); +} +``` + +Include `` to use these features. + +#### 3.2.4. GLM_EXT_scalar_ulp + +This extension exposes function that measure of accuracy in numeric calculations. + +```cpp +#include + +bool test_ulp(float x) +{ + float const a = glm::next_float(x); // return a float a ULP away from the float argument. + return float_distance(a, x) == 1; // check both float are a single ULP away. +} +``` + +Include `` to use these features. + +### 3.3. Vector types + +#### 3.3.1. GLM_EXT_vector_float1 + +This extension exposes single-precision floating point vector with 1 component: `vec1`. + +Include `` to use these features. + +#### 3.3.2. GLM_EXT_vector_float2 + +This extension exposes single-precision floating point vector with 2 components: `vec2`. + +Include `` to use these features. + +#### 3.3.3. GLM_EXT_vector_float3 + +This extension exposes single-precision floating point vector with 3 components: `vec3`. + +Include `` to use these features. + +#### 3.3.4. GLM_EXT_vector_float4 + +This extension exposes single-precision floating point vector with 4 components: `vec4`. + +Include `` to use these features. + +#### 3.3.5. GLM_EXT_vector_double1 + +This extension exposes double-precision floating point vector with 1 component: `dvec1`. + +Include `` to use these features. + +#### 3.3.6. GLM_EXT_vector_double2 + +This extension exposes double-precision floating point vector with 2 components: `dvec2`. + +Include `` to use these features. + +#### 3.3.7. GLM_EXT_vector_double3 + +This extension exposes double-precision floating point vector with 3 components: `dvec3`. + +Include `` to use these features. + +#### 3.3.8. GLM_EXT_vector_double4 + +This extension exposes double-precision floating point vector with 4 components: `dvec4`. + +Include `` to use these features. + +#### 3.3.9. GLM_EXT_vector_int1 + +This extension exposes signed integer vector with 1 component: `ivec1`. + +Include `` to use these features. + +#### 3.3.10. GLM_EXT_vector_int2 + +This extension exposes signed integer vector with 2 components: `ivec2`. + +Include `` to use these features. + +#### 3.3.11. GLM_EXT_vector_int3 + +This extension exposes signed integer vector with 3 components: `ivec3`. + +Include `` to use these features. + +#### 3.3.12. GLM_EXT_vector_int4 + +This extension exposes signed integer vector with 4 components: `ivec4`. + +Include `` to use these features. + +#### 3.3.13. GLM_EXT_vector_int1 + +This extension exposes unsigned integer vector with 1 component: `uvec1`. + +Include `` to use these features. + +#### 3.3.14. GLM_EXT_vector_uint2 + +This extension exposes unsigned integer vector with 2 components: `uvec2`. + +Include `` to use these features. + +#### 3.3.15. GLM_EXT_vector_uint3 + +This extension exposes unsigned integer vector with 3 components: `uvec3`. + +Include `` to use these features. + +#### 3.3.16. GLM_EXT_vector_uint4 + +This extension exposes unsigned integer vector with 4 components: `uvec4`. + +Include `` to use these features. + +#### 3.3.17. GLM_EXT_vector_bool1 + +This extension exposes boolean vector with 1 component: `bvec1`. + +Include `` to use these features. + +#### 3.3.18. GLM_EXT_vector_bool2 + +This extension exposes boolean vector with 2 components: `bvec2`. + +Include `` to use these features. + +#### 3.3.19. GLM_EXT_vector_bool3 + +This extension exposes boolean vector with 3 components: `bvec3`. + +Include `` to use these features. + +#### 3.3.20. GLM_EXT_vector_bool4 + +This extension exposes boolean vector with 4 components: `bvec4`. + +Include `` to use these features. + +### 3.4. Vector types with precision qualifiers + +#### 3.4.1. GLM_EXT_vector_float1_precision + +This extension exposes single-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_vec1`, `mediump_vec1` and `highp_vec1`. + +Include `` to use these features. + +#### 3.4.2. GLM_EXT_vector_float2_precision + +This extension exposes single-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_vec2`, `mediump_vec2` and `highp_vec2`. + +Include `` to use these features. + +#### 3.4.3. GLM_EXT_vector_float3_precision + +This extension exposes single-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_vec3`, `mediump_vec3` and `highp_vec3`. + +Include `` to use these features. + +#### 3.4.4. GLM_EXT_vector_float4_precision + +This extension exposes single-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_vec4`, `mediump_vec4` and `highp_vec4`. + +Include `` to use these features. + +#### 3.4.5. GLM_EXT_vector_double1_precision + +This extension exposes double-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_dvec1`, `mediump_dvec1` and `highp_dvec1`. + +Include `` to use these features. + +#### 3.4.6. GLM_EXT_vector_double2_precision + +This extension exposes double-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_dvec2`, `mediump_dvec2` and `highp_dvec2`. + +Include `` to use these features. + +#### 3.4.7. GLM_EXT_vector_double3_precision + +This extension exposes double-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_dvec3`, `mediump_dvec3` and `highp_dvec3`. + +Include `` to use these features. + +#### 3.4.8. GLM_EXT_vector_double4_precision + +This extension exposes double-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_dvec4`, `mediump_dvec4` and `highp_dvec4`. + +Include `` to use these features. + +### 3.5. Vector functions + +#### 3.5.1. GLM_EXT_vector_common + +This extension exposes support for `min` and `max` functions taking more than two vector arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. + +```cpp +#include // vec2 +#include // fmax + +float positiveMax(float const a, float const b) +{ + return glm::fmax(a, b, 0.0f); +} +``` + +Include `` to use these features. + +#### 3.5.2. GLM_EXT_vector_relational + +This extension exposes `equal` and `notEqual` vector variants which takes an epsilon argument. + +```cpp +#include // vec2 +#include // equal, all + +bool epsilonEqual(glm::vec2 const& A, glm::vec2 const& B) +{ + float const CustomEpsilon = 0.0001f; + return glm::all(glm::equal(A, B, CustomEpsilon)); +} +``` + +Include `` to use these features. + +#### 3.5.3. GLM_EXT_vector_ulp + +This extension exposes function that measure of accuracy in numeric calculations. + +```cpp +#include +#include +#include + +bool test_ulp(glm::vec4 const& x) +{ + glm::vec4 const a = glm::next_float(x); // return a float a ULP away from the float argument. + return glm::all(float_distance(a, x) == glm::ivec4(1)); // check both float are a single ULP away. +} +``` + +Include `` to use these features. + +### 3.6. Matrix types + +#### 3.6.1. GLM_EXT_matrix_float2x2 + +This extension exposes single-precision floating point vector with 2 columns by 2 rows: `mat2x2`. + +Include `` to use these features. + +#### 3.6.2. GLM_EXT_matrix_float2x3 + +This extension exposes single-precision floating point vector with 2 columns by 3 rows: `mat2x3`. + +Include `` to use these features. + +#### 3.6.3. GLM_EXT_matrix_float2x4 + +This extension exposes single-precision floating point vector with 2 columns by 4 rows: `mat2x4`. + +Include `` to use these features. + +#### 3.6.4. GLM_EXT_matrix_float3x2 + +This extension exposes single-precision floating point vector with 3 columns by 2 rows: `mat3x2`. + +Include `` to use these features. + +#### 3.6.5. GLM_EXT_matrix_float3x3 + +This extension exposes single-precision floating point vector with 3 columns by 3 rows: `mat3x3`. + +Include `` to use these features. + +#### 3.6.6. GLM_EXT_matrix_float3x4 + +This extension exposes single-precision floating point vector with 3 columns by 4 rows: `mat3x4`. + +Include `` to use these features. + +#### 3.6.7. GLM_EXT_matrix_float4x2 + +This extension exposes single-precision floating point vector with 4 columns by 2 rows: `mat4x2`. + +Include `` to use these features. + +#### 3.6.8. GLM_EXT_matrix_float4x3 + +This extension exposes single-precision floating point vector with 4 columns by 3 rows: `mat4x3`. + +Include `` to use these features. + +#### 3.6.9. GLM_EXT_matrix_float4x4 + +This extension exposes single-precision floating point vector with 4 columns by 4 rows: `mat4x4`. + +Include `` to use these features. + +#### 3.6.10. GLM_EXT_matrix_double2x2 + +This extension exposes double-precision floating point vector with 2 columns by 2 rows: `dmat2x2`. + +Include `` to use these features. + +#### 3.6.11. GLM_EXT_matrix_double2x3 + +This extension exposes double-precision floating point vector with 2 columns by 3 rows: `dmat2x3`. + +Include `` to use these features. + +#### 3.6.12. GLM_EXT_matrix_double2x4 + +This extension exposes double-precision floating point vector with 2 columns by 4 rows: `dmat2x4`. + +Include `` to use these features. + +#### 3.6.13. GLM_EXT_matrix_double3x2 + +This extension exposes double-precision floating point vector with 3 columns by 2 rows: `dmat3x2`. + +Include `` to use these features. + +#### 3.6.14. GLM_EXT_matrix_double3x3 + +This extension exposes double-precision floating point vector with 3 columns by 3 rows: `dmat3x3`. + +Include `` to use these features. + +#### 3.6.15. GLM_EXT_matrix_double3x4 + +This extension exposes double-precision floating point vector with 3 columns by 4 rows: `dmat3x4`. + +Include `` to use these features. + +#### 3.6.16. GLM_EXT_matrix_double4x2 + +This extension exposes double-precision floating point vector with 4 columns by 2 rows: `dmat4x2`. + +Include `` to use these features. + +#### 3.6.17. GLM_EXT_matrix_double4x3 + +This extension exposes double-precision floating point vector with 4 columns by 3 rows: `dmat4x3`. + +Include `` to use these features. + +#### 3.6.18. GLM_EXT_matrix_double4x4 + +This extension exposes double-precision floating point vector with 4 columns by 4 rows: `dmat4x4`. + +Include `` to use these features. + +### 3.7. Matrix types with precision qualifiers + +#### 3.7.1. GLM_EXT_matrix_float2x2_precision + +This extension exposes single-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_mat2x2`, `mediump_mat2x2` and `highp_mat2x2`. + +Include `` to use these features. + +#### 3.7.2. GLM_EXT_matrix_float2x3_precision + +This extension exposes single-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_mat2x3`, `mediump_mat2x3` and `highp_mat2x3`. + +Include `` to use these features. + +#### 3.7.3. GLM_EXT_matrix_float2x4_precision + +This extension exposes single-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_mat2x4`, `mediump_mat2x4` and `highp_mat2x4`. + +Include `` to use these features. + +#### 3.7.4. GLM_EXT_matrix_float3x2_precision + +This extension exposes single-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_mat3x2`, `mediump_mat3x2` and `highp_mat3x2`. + +Include `` to use these features. + +#### 3.7.5. GLM_EXT_matrix_float3x3_precision + +This extension exposes single-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_mat3x3`, `mediump_mat3x3` and `highp_mat3x3`. + +Include `` to use these features. + +#### 3.7.6. GLM_EXT_matrix_float3x4_precision + +This extension exposes single-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_mat3x4`, `mediump_mat3x4` and `highp_mat3x4`. + +Include `` to use these features. + +#### 3.7.7. GLM_EXT_matrix_float4x2_precision + +This extension exposes single-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_mat4x2`, `mediump_mat4x2` and `highp_mat4x2`. + +Include `` to use these features. + +#### 3.7.8. GLM_EXT_matrix_float4x3_precision + +This extension exposes single-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_mat4x3`, `mediump_mat4x3` and `highp_mat4x3`. + +Include `` to use these features. + +#### 3.7.9. GLM_EXT_matrix_float4x4_precision + +This extension exposes single-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_mat4x4`, `mediump_mat4x4` and `highp_mat4x4`. + +Include `` to use these features. + +#### 3.7.10. GLM_EXT_matrix_double2x2_precision + +This extension exposes double-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_dmat2x2`, `mediump_dmat2x2` and `highp_dmat2x2`. + +Include `` to use these features. + +#### 3.7.11. GLM_EXT_matrix_double2x3_precision + +This extension exposes double-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_dmat2x3`, `mediump_dmat2x3` and `highp_dmat2x3`. + +Include `` to use these features. + +#### 3.7.12. GLM_EXT_matrix_double2x4_precision + +This extension exposes double-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_dmat2x4`, `mediump_dmat2x4` and `highp_dmat2x4`. + +Include `` to use these features. + +#### 3.7.13. GLM_EXT_matrix_double3x2_precision + +This extension exposes double-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_dmat3x2`, `mediump_dmat3x2` and `highp_dmat3x2`. + +Include `` to use these features. + +#### 3.7.14. GLM_EXT_matrix_double3x3_precision + +This extension exposes double-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_dmat3x3`, `mediump_dmat3x3` and `highp_dmat3x3`. + +Include `` to use these features. + +#### 3.7.15. GLM_EXT_matrix_double3x4_precision + +This extension exposes double-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_dmat3x4`, `mediump_dmat3x4` and `highp_dmat3x4`. + +Include `` to use these features. + +#### 3.7.16. GLM_EXT_matrix_double4x2_precision + +This extension exposes double-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_dmat4x2`, `mediump_dmat4x2` and `highp_dmat4x2`. + +Include `` to use these features. + +#### 3.7.17. GLM_EXT_matrix_double4x3_precision + +This extension exposes double-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_dmat4x3`, `mediump_dmat4x3` and `highp_dmat4x3`. + +Include `` to use these features. + +#### 3.7.18. GLM_EXT_matrix_double4x4_precision + +This extension exposes double-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_dmat4x4`, `mediump_dmat4x4` and `highp_dmat4x4`. + +Include `` to use these features. + +### 3.8. Matrix functions + +#### 3.8.1. GLM_EXT_matrix_relational + +This extension exposes `equal` and `notEqual` matrix variants which takes an optional epsilon argument. + +```cpp +#include // bvec4 +#include // mat4 +#include // equal, all + +bool epsilonEqual(glm::mat4 const& A, glm::mat4 const& B) +{ + float const CustomEpsilon = 0.0001f; + glm::bvec4 const ColumnEqual = glm::equal(A, B, CustomEpsilon); // Evaluation per column + return glm::all(ColumnEqual); +} +``` + +Include `` to use these features. + +#### 3.8.2. GLM_EXT_matrix_transform + +This extension exposes matrix transformation functions: `translate`, `rotate` and `scale`. + +```cpp +#include // vec2 +#include // vec3 +#include // mat4x4 +#include // translate, rotate, scale, identity + +glm::mat4 computeModelViewMatrix(float Translate, glm::vec2 const & Rotate) +{ + glm::mat4 View = glm::translate(glm::identity(), glm::vec3(0.0f, 0.0f, -Translate)); + View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::identity(), glm::vec3(0.5f)); + return View * Model; +} +``` + +Include `` to use these features. + +#### 3.8.3. GLM_EXT_matrix_clip_space + +This extension exposes functions to transform scenes into the clip space. + +```cpp +#include // mat4x4 +#include // perspective +#include // radians + +glm::mat4 computeProjection(float Width, float Height) +{ + return glm::perspective(glm::radians(45.0f), Width / Height, 0.1f, 100.f); +} +``` + +Include `` to use these features. + +#### 3.8.4. GLM_EXT_matrix_projection + +This extension exposes functions to map object coordinates into window coordinates and reverse + +Include `` to use these features. + +### 3.9. Quaternion types + +#### 3.9.1. GLM_EXT_quaternion_float + +This extension exposes single-precision floating point quaternion: `quat`. + +Include `` to use these features. + +#### 3.9.2. GLM_EXT_quaternion_double + +This extension exposes double-precision floating point quaternion: `dquat`. + +Include `` to use these features. + +### 3.10. Quaternion types with precision qualifiers + +#### 3.10.1. GLM_EXT_quaternion_float_precision + +This extension exposes single-precision floating point quaternion using various precision in term of ULPs: `lowp_quat`, `mediump_quat` and `highp_quat`. + +Include `` to use these features. + +#### 3.10.2. GLM_EXT_quaternion_double_precision + +This extension exposes double-precision floating point quaternion using various precision in term of ULPs: `lowp_dquat`, `mediump_dquat` and `highp_dquat`. + +Include `` to use these features. + +### 3.11. Quaternion functions + +#### 3.11.1. GLM_EXT_quaternion_common + +This extension exposes common quaternion functions such as `slerp`, `conjugate` and `inverse`. + +Include `` to use these features. + +#### 3.11.2. GLM_EXT_quaternion_geometric + +This extension exposes geometric quaternion functions such as `length`, `normalize`, `dot` and `cross`. + +Include `` to use these features. + +#### 3.11.3. GLM_EXT_quaternion_trigonometric + +This extension exposes trigonometric quaternion functions such as `angle` and `axis`. + +Include `` to use these features. + +#### 3.11.4. GLM_EXT_quaternion_exponential + +This extensions expose exponential functions for quaternions such as `exp`, `log`, `pow` and `sqrt`. + +Include `` to use these features. + +#### 3.11.5. GLM_EXT_quaternion_relational + +This extension exposes relational functions to compare quaternions. + +Include `` to use these features. + +#### 3.11.6. GLM_EXT_quaternion_transform + +This extension exposes functions to transform objects. + +Include `` to use these features. + +--- +
    + +## 4. Recommended extensions + +GLM extends the core GLSL feature set with extensions. These extensions include: quaternion, transformation, spline, matrix inverse, color spaces, etc. + +To include an extension, we only need to include the dedicated header file. Once included, the features are added to the GLM namespace. + +```cpp +#include +#include + +int foo() +{ + glm::vec4 Position = glm::vec4(glm:: vec3(0.0f), 1.0f); + glm::mat4 Model = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); + + glm::vec4 Transformed = Model * Position; + ... + + return 0; +} +``` + +When an extension is included, all the dependent core functionalities and extensions will be included as well. + +### 4.1. GLM_GTC_bitfield + +Fast bitfield operations on scalar and vector variables. + +`` need to be included to use these features. + +### 4.2. GLM_GTC_color_space + +Conversion between linear RGB and sRGB color spaces. + +`` need to be included to use these features. + +### 4.3. GLM_GTC_constants + +Provide a list of built-in constants. + +`` need to be included to use these features. + +### 4.4. GLM\_GTC\_epsilon + +Approximate equality comparisons for floating-point numbers, possibly with a user-defined epsilon. + +`` need to be included to use these features. + +### 4.5. GLM\_GTC\_integer + +Integer variants of core GLM functions. + +`` need to be included to use these features. + +### 4.6. GLM\_GTC\_matrix\_access + +Functions to conveniently access the individual rows or columns of a matrix. + +`` need to be included to use these features. + +### 4.7. GLM\_GTC\_matrix\_integer + +Integer matrix types similar to the core floating-point matrices. Some operations (such as inverse and determinant) are not supported. + +`` need to be included to use these features. + +### 4.8. GLM\_GTC\_matrix\_inverse + +Additional matrix inverse functions. + +`` need to be included to use these features. + +### 4.9. GLM\_GTC\_matrix\_transform + +Matrix transformation functions that follow the OpenGL fixed-function conventions. + +For example, the `lookAt` function generates a transformation matrix that projects world coordinates into eye coordinates suitable for projection matrices (e.g. `perspective`, `ortho`). See the OpenGL compatibility specifications for more information about the layout of these generated matrices. + +The matrices generated by this extension use standard OpenGL fixed-function conventions. For example, the `lookAt` function generates a transform from world space into the specific eye space that the +projective matrix functions (`perspective`, `ortho`, etc) are designed to expect. The OpenGL compatibility specifications define the particular layout of this eye space. + +`` need to be included to use these features. + +### 4.10. GLM\_GTC\_noise + +Define 2D, 3D and 4D procedural noise functions. + +<`glm/gtc/noise.hpp>` need to be included to use these features. + +![](/doc/manual/noise-simplex1.jpg) + +Figure 4.10.1: glm::simplex(glm::vec2(x / 16.f, y / 16.f)); + +![](/doc/manual/noise-simplex2.jpg) + +Figure 4.10.2: glm::simplex(glm::vec3(x / 16.f, y / 16.f, 0.5f)); + +![](/doc/manual/noise-simplex3.jpg) + +Figure 4.10.3: glm::simplex(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f)); + +![](/doc/manual/noise-perlin1.jpg) + +Figure 4.10.4: glm::perlin(glm::vec2(x / 16.f, y / 16.f)); + +![](/doc/manual/noise-perlin2.jpg) + +Figure 4.10.5: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f)); + +![](/doc/manual/noise-perlin3.jpg) + +Figure 4.10.6: glm::perlin(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f))); + +![](/doc/manual/noise-perlin4.png) + +Figure 4.10.7: glm::perlin(glm::vec2(x / 16.f, y / 16.f), glm::vec2(2.0f)); + +![](/doc/manual/noise-perlin5.png) + +Figure 4.10.8: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f), glm::vec3(2.0f)); + +![](/doc/manual/noise-perlin6.png) + +Figure 4.10.9: glm::perlin(glm::vec4(x / 16.f, y / 16.f, glm::vec2(0.5f)), glm::vec4(2.0f)); + +### 4.11. GLM\_GTC\_packing + +Convert scalar and vector types to and from packed formats, saving space at the cost of precision. However, packing a value into a format that it was previously unpacked from is guaranteed to be lossless. + +`` need to be included to use these features. + +### 4.12. GLM\_GTC\_quaternion + +Quaternions and operations upon thereof. + +`` need to be included to use these features. + +### 4.13. GLM\_GTC\_random + +Probability distributions in up to four dimensions. + +`` need to be included to use these features. + +![](/doc/manual/random-linearrand.png) + +Figure 4.13.1: glm::vec4(glm::linearRand(glm::vec2(-1), glm::vec2(1)), 0, 1); + +![](/doc/manual/random-circularrand.png) + +Figure 4.13.2: glm::vec4(glm::circularRand(1.0f), 0, 1); + +![](/doc/manual/random-sphericalrand.png) + +Figure 4.13.3: glm::vec4(glm::sphericalRand(1.0f), 1); + +![](/doc/manual/random-diskrand.png) + +Figure 4.13.4: glm::vec4(glm::diskRand(1.0f), 0, 1); + +![](/doc/manual/random-ballrand.png) + +Figure 4.13.5: glm::vec4(glm::ballRand(1.0f), 1); + +![](/doc/manual/random-gaussrand.png) + +Figure 4.13.6: glm::vec4(glm::gaussRand(glm::vec3(0), glm::vec3(1)), 1); + +### 4.14. GLM\_GTC\_reciprocal + +Reciprocal trigonometric functions (e.g. secant, cosecant, tangent). + +`` need to be included to use the features of this extension. + +### 4.15. GLM\_GTC\_round + +Various rounding operations and common special cases thereof. + +`` need to be included to use the features of this extension. + +### 4.16. GLM\_GTC\_type\_aligned + +Aligned vector types. + +`` need to be included to use the features of this extension. + +### 4.17. GLM\_GTC\_type\_precision + +Vector and matrix types with defined precisions, e.g. `i8vec4`, which is a 4D vector of signed 8-bit integers. + +`` need to be included to use the features of this extension. + +### 4.18. GLM\_GTC\_type\_ptr + +Facilitate interactions between pointers to basic types (e.g. `float*`) and GLM types (e.g. `mat4`). + +This extension defines an overloaded function, `glm::value_ptr`, which returns a pointer to the memory layout of any GLM vector or matrix (`vec3`, `mat4`, etc.). Matrix types store their values in column-major order. This is useful for uploading data to matrices or for copying data to buffer objects. + +```cpp +// GLM_GTC_type_ptr provides a safe solution: +#include +#include + +void foo() +{ + glm::vec4 v(0.0f); + glm::mat4 m(1.0f); + ... + glVertex3fv(glm::value_ptr(v)) + glLoadMatrixfv(glm::value_ptr(m)); +} + +// Another solution, this one inspired by the STL: +#include + +void foo() +{ + glm::vec4 v(0.0f); + glm::mat4 m(1.0f); + ... + glVertex3fv(&v[0]); + glLoadMatrixfv(&m[0][0]); +} +``` + +*Note: It would be possible to implement [`glVertex3fv`](http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml)(glm::vec3(0)) in C++ with the appropriate cast operator that would result as an +implicit cast in this example. However cast operators may produce programs running with unexpected behaviours without build error or any form of notification. * + +`` need to be included to use these features. + +### 4.19. GLM\_GTC\_ulp + +Measure a function's accuracy given a reference implementation of it. This extension works on floating-point data and provides results in [ULP](http://ljk.imag.fr/membres/Carine.Lucas/TPScilab/JMMuller/ulp-toms.pdf). + +`` need to be included to use these features. + +### 4.20. GLM\_GTC\_vec1 + +Add \*vec1 types. + +`` need to be included to use these features. + +--- +
    + +## 5. OpenGL interoperability + +### 5.1. GLM replacements for deprecated OpenGL functions + +OpenGL 3.1 specification has deprecated some features that have been removed from OpenGL 3.2 core profile specification. GLM provides some replacement functions. + +[***glRotate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml) + +```cpp +glm::mat4 glm::rotate(glm::mat4 const& m, float angle, glm::vec3 const& axis); +glm::dmat4 glm::rotate(glm::dmat4 const& m, double angle, glm::dvec3 const& axis); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glScale{f, d}:***](http://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml) + +```cpp +glm::mat4 glm::scale(glm::mat4 const& m, glm::vec3 const& factors); +glm::dmat4 glm::scale(glm::dmat4 const& m, glm::dvec3 const& factors); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glTranslate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml) + +```cpp +glm::mat4 glm::translate(glm::mat4 const& m, glm::vec3 const& translation); +glm::dmat4 glm::translate(glm::dmat4 const& m, glm::dvec3 const& translation); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glLoadIdentity:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadIdentity.xml) + +```cpp +glm::mat4(1.0) or glm::mat4(); +glm::dmat4(1.0) or glm::dmat4(); +``` + +From GLM core library: `` + +[***glMultMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml) + +```cpp +glm::mat4() * glm::mat4(); +glm::dmat4() * glm::dmat4(); +``` + +From GLM core library: `` + +[***glLoadTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadTransposeMatrix.xml) + +```cpp +glm::transpose(glm::mat4()); +glm::transpose(glm::dmat4()); +``` + +From GLM core library: `` + +[***glMultTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultTransposeMatrix.xml) + +```cpp +glm::mat4() * glm::transpose(glm::mat4()); +glm::dmat4() * glm::transpose(glm::dmat4()); +``` + +From GLM core library: `` + +[***glFrustum:***](http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml) + +```cpp +glm::mat4 glm::frustum(float left, float right, float bottom, float top, float zNear, float zFar); +glm::dmat4 glm::frustum(double left, double right, double bottom, double top, double zNear, double zFar); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***glOrtho:***](https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml) + +```cpp +glm::mat4 glm::ortho(float left, float right, float bottom, float top, float zNear, float zFar); +glm::dmat4 glm::ortho(double left, double right, double bottom, double top, double zNear, double zFar); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +### 5.2. GLM replacements for GLU functions + +[***gluLookAt:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml) + +```cpp +glm::mat4 glm::lookAt(glm::vec3 const& eye, glm::vec3 const& center, glm::vec3 const& up); +glm::dmat4 glm::lookAt(glm::dvec3 const& eye, glm::dvec3 const& center, glm::dvec3 const& up); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluOrtho2D:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluOrtho2D.xml) + +```cpp +glm::mat4 glm::ortho(float left, float right, float bottom, float top); +glm::dmat4 glm::ortho(double left, double right, double bottom, double top); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluPerspective:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml) + +```cpp +glm::mat4 perspective(float fovy, float aspect, float zNear, float zFar); +glm::dmat4 perspective(double fovy, double aspect, double zNear, double zFar); +``` + +Note that in GLM, fovy is expressed in radians, not degrees. + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluPickMatrix:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPickMatrix.xml) + +```cpp +glm::mat4 pickMatrix(glm::vec2 const& center, glm::vec2 const& delta, glm::ivec4 const& viewport); +glm::dmat4 pickMatrix(glm::dvec2 const& center, glm::dvec2 const& delta, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluProject:***](http://www.opengl.org/sdk/docs/man2/xhtml/gluProject.xml) + +```cpp +glm::vec3 project(glm::vec3 const& obj, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); +glm::dvec3 project(glm::dvec3 const& obj, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluUnProject:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluUnProject.xml) + +```cpp +glm::vec3 unProject(glm::vec3 const& win, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); +glm::dvec3 unProject(glm::dvec3 const& win, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +--- +
    + +## 6. Known issues + +This section reports GLSL features that GLM can't accurately emulate due to language restrictions. + +### 6.1. not function + +The GLSL function 'not' is a keyword in C++. To prevent name collisions and ensure a consistent API, the name `not\_` (note the underscore) is used instead. + +### 6.2. Precision qualifiers support + +GLM supports GLSL precision qualifiers through prefixes instead of qualifiers. For example, GLM exposes \verb|lowp_vec4|, \verb|mediump_vec4| and \verb|highp_vec4| as variations of \verb|vec4|. + +Similarly to GLSL, GLM precision qualifiers are used to trade precision of operations in term of [ULPs](http://en.wikipedia.org/wiki/Unit_in_the_last_place) for better performance. By default, all the types use high precision. + +```cpp +// Using precision qualifier in GLSL: + +ivec3 foo(in vec4 v) +{ + highp vec4 a = v; + mediump vec4 b = a; + lowp ivec3 c = ivec3(b); + return c; +} + +// Using precision qualifier in GLM: + +#include + +ivec3 foo(const vec4 & v) +{ + highp_vec4 a = v; + medium_vec4 b = a; + lowp_ivec3 c = glm::ivec3(b); + return c; +} +``` + +--- +
    + +## 7. FAQ + +### 7.1 Why GLM follows GLSL specification and conventions? + +Following GLSL conventions is a really strict policy of GLM. It has been designed following the idea that everyone does its own math library with his own conventions. The idea is that brilliant developers (the OpenGL ARB) worked together and agreed to make GLSL. Following GLSL conventions +is a way to find consensus. Moreover, basically when a developer knows GLSL, he knows GLM. + +### 7.2. Does GLM run GLSL program? + +No, GLM is a C++ implementation of a subset of GLSL. + +### 7.3. Does a GLSL compiler build GLM codes? + +No, this is not what GLM attends to do. + +### 7.4. Should I use ‘GTX’ extensions? + +GTX extensions are qualified to be experimental extensions. In GLM this means that these extensions might change from version to version without any restriction. In practice, it doesn’t really change except time to +time. GTC extensions are stabled, tested and perfectly reliable in time. Many GTX extensions extend GTC extensions and provide a way to explore features and implementations and APIs and then are promoted to GTC +extensions. This is fairly the way OpenGL features are developed; through extensions. + +Stating with GLM 0.9.9, to use experimental extensions, an application must define GLM_ENABLE_EXPERIMENTAL. + +### 7.5. Where can I ask my questions? + +A good place is [stackoverflow](http://stackoverflow.com/search?q=GLM) using the GLM tag. + +### 7.6. Where can I find the documentation of extensions? + +The Doxygen generated documentation includes a complete list of all extensions available. Explore this [*API documentation*](http://glm.g-truc.net/html/index.html) to get a complete +view of all GLM capabilities! + +### 7.7. Should I use ‘using namespace glm;’? + +NO! Chances are that if using namespace glm; is called, especially in a header file, name collisions will happen as GLM is based on GLSL which uses common tokens for types and functions. Avoiding using namespace +glm; will a higher compatibility with third party library and SDKs. + +### 7.8. Is GLM fast? + +GLM is mainly designed to be convenient and that's why it is written against the GLSL specification. + +Following the Pareto principle where 20% of the code consumes 80% of the execution time, GLM operates perfectly on the 80% of the code that consumes 20% of the performances. Furthermore, thanks to the lowp, +mediump and highp qualifiers, GLM provides approximations which trade precision for performance. Finally, GLM can automatically produce SIMD optimized code for functions of its implementation. + +However, on performance critical code paths, we should expect that dedicated algorithms should be written to reach peak performance. + +### 7.9. When I build with Visual C++ with /W4 warning level, I have warnings... + +You should not have any warnings even in `/W4` mode. However, if you expect such level for your code, then you should ask for the same level to the compiler by at least disabling the Visual C++ language extensions +(`/Za`) which generates warnings when used. If these extensions are enabled, then GLM will take advantage of them and the compiler will generate warnings. + +### 7.10. Why some GLM functions can crash because of division by zero? + +GLM functions crashing is the result of a domain error. Such behavior follows the precedent set by C and C++'s standard library. For example, it’s a domain error to pass a null vector (all zeroes) to glm::normalize function, or to pass a negative number into std::sqrt. + +### 7.11. What unit for angles is used in GLM? + +GLSL is using radians but GLU is using degrees to express angles. This has caused GLM to use inconsistent units for angles. Starting with GLM 0.9.6, all GLM functions are using radians. For more information, follow +the [link](http://www.g-truc.net/post-0693.html#menu). + +### 7.12. Windows headers cause build errors... + +Some Windows headers define min and max as macros which may cause compatibility with third party libraries such as GLM. +It is highly recommended to [`define NOMINMAX`](http://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c) before including Windows headers to workaround this issue. +To workaround the incompatibility with these macros, GLM will systematically undef these macros if they are defined. + +### 7.13. Constant expressions support + +GLM has some C++ constant expressions support. However, GLM automatically detects the use of SIMD instruction sets through compiler arguments to populate its implementation with SIMD intrinsics. +Unfortunately, GCC and Clang doesn't support SIMD instrinsics as constant expressions. To allow constant expressions on all vectors and matrices types, define `GLM_FORCE_PURE` before including GLM headers. + +--- +
    + +## 8. Code samples + +This series of samples only shows various GLM features without consideration of any sort. + +### 8.1. Compute a triangle normal + +```cpp +#include // vec3 normalize cross + +glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) +{ + return glm::normalize(glm::cross(c - a, b - a)); +} + +// A much faster but less accurate alternative: +#include // vec3 cross +#include // fastNormalize + +glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) +{ + return glm::fastNormalize(glm::cross(c - a, b - a)); +} +``` + +### 8.2. Matrix transform + +```cpp +#include // vec3, vec4, ivec4, mat4 +#include // translate, rotate, scale, perspective +#include // value_ptr + +void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& Rotate) +{ + glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 ViewTranslate = glm::translate( + glm::mat4(1.0f), Translate); + glm::mat4 ViewRotateX = glm::rotate( + ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + glm::mat4 View = glm::rotate(ViewRotateX, + Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale( + glm::mat4(1.0f), glm::vec3(0.5f)); + glm::mat4 MVP = Projection * View * Model; + glUniformMatrix4fv(Location, 1, GL_FALSE, glm::value_ptr(MVP)); +} +``` + +### 8.3. Vector types + +```cpp +#include // vec2 +#include // hvec2, i8vec2, i32vec2 + +std::size_t const VertexCount = 4; + +// Float quad geometry +std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); +glm::vec2 const PositionDataF32[VertexCount] = +{ + glm::vec2(-1.0f,-1.0f), + glm::vec2( 1.0f,-1.0f), + glm::vec2( 1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f) +}; + +// Half-float quad geometry +std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::hvec2); +glm::hvec2 const PositionDataF16[VertexCount] = +{ + glm::hvec2(-1.0f, -1.0f), + glm::hvec2( 1.0f, -1.0f), + glm::hvec2( 1.0f, 1.0f), + glm::hvec2(-1.0f, 1.0f) +}; + +// 8 bits signed integer quad geometry +std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); +glm::i8vec2 const PositionDataI8[VertexCount] = +{ + glm::i8vec2(-1,-1), + glm::i8vec2( 1,-1), + glm::i8vec2( 1, 1), + glm::i8vec2(-1, 1) +}; + +// 32 bits signed integer quad geometry +std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); +glm::i32vec2 const PositionDataI32[VertexCount] = +{ + glm::i32vec2(-1,-1), + glm::i32vec2( 1,-1), + glm::i32vec2( 1, 1), + glm::i32vec2(-1, 1) +}; +``` + +### 8.4. Lighting + +```cpp +#include // vec3 normalize reflect dot pow +#include // ballRand + +// vecRand3, generate a random and equiprobable normalized vec3 +glm::vec3 lighting(intersection const& Intersection, material const& Material, light const& Light, glm::vec3 const& View) +{ + glm::vec3 Color = glm::vec3(0.0f); + glm::vec3 LightVertor = glm::normalize( + Light.position() - Intersection.globalPosition() + + glm::ballRand(0.0f, Light.inaccuracy()); + + if(!shadow(Intersection.globalPosition(), Light.position(), LightVertor)) + { + float Diffuse = glm::dot(Intersection.normal(), LightVector); + if(Diffuse <= 0.0f) + return Color; + + if(Material.isDiffuse()) + Color += Light.color() * Material.diffuse() * Diffuse; + + if(Material.isSpecular()) + { + glm::vec3 Reflect = glm::reflect(-LightVector, Intersection.normal()); + float Dot = glm::dot(Reflect, View); + float Base = Dot > 0.0f ? Dot : 0.0f; + float Specular = glm::pow(Base, Material.exponent()); + Color += Material.specular() \* Specular; + } + } + + return Color; +} +``` + +--- +
    + +## 9. Contributing to GLM + +### 9.1. Submitting bug reports + +Bug should be reported on Github using the [issue page](https://github.com/g-truc/glm/issues). + +A minimal code to reproduce the issue will help. + +Additional, bugs can be configuration specific. We can report the configuration by defining `GLM_FORCE_MESSAGES` before including GLM headers then build and copy paste the build messages GLM will output. + +```cpp +#define GLM_FORCE_MESSAGES +#include +``` + +An example of build messages generated by GLM: +``` +GLM: 0.9.9.1 +GLM: C++ 17 with extensions +GLM: GCC compiler detected" +GLM: x86 64 bits with AVX instruction set build target +GLM: Linux platform detected +GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. +GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. +GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. +GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. +GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. +``` + +### 9.2. Contributing to GLM with pull request + +This tutorial will show us how to successfully contribute a bug-fix to GLM using GitHub's Pull Request workflow. + +We will be typing git commands in the Terminal. Mac and Linux users may have git pre-installed. You can download git from [here](http://git-scm.com/downloads). + +The tutorial assumes you have some basic understanding of git concepts - repositories, branches, commits, etc. Explaining it all from scratch is beyond the scope of this tutorial. Some good links to learn git basics are: [Link 1](http://git-scm.com/book/en/Getting-Started-Git-Basics), [Link 2](https://www.atlassian.com/git/tutorial/git-basics) + +#### Step 1: Setup our GLM Fork + +We will make our changes in our own copy of the GLM sitory. On the GLM GitHub repo and we press the Fork button. +We need to download a copy of our fork to our local machine. In the terminal, type: + +``` +>>> git clone +``` + +This will clone our fork repository into the current folder. + +We can find our repository git url on the Github reposotory page. The url looks like this: `https://github.com//.git` + +#### Step 2: Synchronizing our fork + +We can use the following command to add `upstream` (original project repository) as a remote repository so that we can fetch the latest GLM commits into our branch and keep our forked copy is synchronized. + +``` +>>> git remote add upstream https://github.com/processing/processing.git +``` + +To synchronize our fork to the latest commit in the GLM repository, we can use the following command: + +``` +>>> git fetch upstream +``` + +Then, we can merge the remote master branch to our current branch: + +``` +>>> git merge upstream/master +``` + +Now our local copy of our fork has been synchronized. However, the fork's copy is not updated on GitHub's servers yet. To do that, use: + +``` +>>> git push origin master +``` + +#### Step 3: Modifying our GLM Fork + +Our fork is now setup and we are ready to modify GLM to fix a bug. + +It's a good practice to make changes in our fork in a separate branch than the master branch because we can submit only one pull request per branch. + +Before creating a new branch, it's best to synchronize our fork and then create a new branch from the latest master branch. + +If we are not on the master branch, we should switch to it using: +``` +>>> git checkout master +``` + +To create a new branch called `bugifx`, we use: +``` +git branch bugfix +``` + +Once the code changes for the fix is done, we need to commit the changes: +``` +>>> git commit -m "Resolve the issue that caused problem with a specific fix #432" +``` + +The commit message should be as specific as possible and finished by the bug number in the [GLM GitHub issue page](https://github.com/g-truc/glm/issues) + +Finally, we need to push our changes in our branch to our GitHub fork using: +``` +>>> git push origin bugfix +``` + +Some things to keep in mind for a pull request: +* Keep it minimal: Try to make the minimum required changes to fix the issue. If we have added any debugging code, we should remove it. +* A fix at a time: The pull request should deal with one issue at a time only, unless two issue are so interlinked they must be fixed together. +* Write a test: GLM is largely unit tests. Unit tests are in `glm/test` directory. We should also add tests for the fixes we provide to ensure future regression doesn't happen. +* No whitespace changes: Avoid unnecessary formatting or whitespace changes in other parts of the code. Be careful with auto-format options in the code editor which can cause wide scale formatting changes. +* Follow [GLM Code Style](#section9_3) for consistency. +* Tests passes: Make sure GLM build and tests don't fail because of the changes. + +#### Step 4: Submitting a Pull Request + +We need to submit a pull request from the `bugfix` branch to GLM's master branch. + +On the fork github page, we can click on the *Pull Request* button. Then we can describe our pull request. Finally we press *Send Pull Request*. + +Please be patient and give them some time to go through it. + +The pull request review may suggest additional changes. So we can make those changes in our branch, and push those changes to our fork repository. Our pull request will always include the latest changes in our branch on GitHub, so we don't need to resubmit the pull request. + +Once your changes have been accepted, a project maintainer will merge our pull request. + +We are grateful to the users for their time and effort in contributing fixes. + +### 9.3. Coding style + +#### Indentation + +Always tabs. Never spaces. + +#### Spacing + +No space after if. Use if(blah) not if (blah). Example if/else block: + +```cpp +if(blah) +{ + // yes like this +} +else +{ + // something besides +} +``` + +Single line if blocks: +```cpp +if(blah) + // yes like this +else + // something besides +``` + +No spaces inside parens: +```cpp +if (blah) // No +if( blah ) // No +if ( blah ) // No +if(blah) // Yes +``` + +Use spaces before/after commas: +```cpp +someFunction(apple,bear,cat); // No +someFunction(apple, bear, cat); // Yes +``` + +Use spaces before/after use of `+, -, *, /, %, >>, <<, |, &, ^, ||, &&` operators: +```cpp +vec4 v = a + b; +``` + +#### Blank lines + +One blank line after the function blocks. + +#### Comments + +Always one space after the // in single line comments + +One space before // at the end of a line (that has code as well) + +Try to use // comments inside functions, to make it easier to remove a whole block via /* */ + +#### Cases + +```cpp +#define GLM_MY_DEFINE 76 + +class myClass +{}; + +myClass const MyClass; + +namespace glm{ // glm namespace is for public code +namespace detail // glm::detail namespace is for implementation detail +{ + float myFunction(vec2 const& V) + { + return V.x + V.y; + } + + float myFunction(vec2 const* const V) + { + return V->x + V->y; + } +}//namespace detail +}//namespace glm +``` + +--- +
    + +## 10. References + +### 10.1. OpenGL specifications + +* OpenGL 4.3 core specification +* [GLSL 4.30 specification](http://www.opengl.org/registry/doc/GLSLangSpec.4.30.7.diff.pdf) +![](media/image21.png){width="2.859722222222222in" height="1.6083333333333334in"}- [*GLU 1.3 specification*](http://www.opengl.org/documentation/specs/glu/glu1_3.pdf) + +### 10.2. External links + +* [GLM on stackoverflow](http://stackoverflow.com/search?q=GLM) + +### 10.3. Projects using GLM + +***[Leo’s Fortune](http://www.leosfortune.com/)*** + +Leo’s Fortune is a platform adventure game where you hunt down the cunning and mysterious thief that stole your gold. Available on PS4, Xbox One, PC, Mac, iOS and Android. + +Beautifully hand-crafted levels bring the story of Leo to life in this epic adventure. + +“I just returned home to find all my gold has been stolen! For some devious purpose, the thief has dropped pieces of my gold like breadcrumbs through the woods.” + +“Despite this pickle of a trap, I am left with no choice but to follow the trail.” + +“Whatever lies ahead, I must recover my fortune.” -Leopold + +![](/doc/manual/references-leosfortune.jpeg) + +![](/doc/manual/references-leosfortune2.jpg) + +[***OpenGL 4.0 Shading Language Cookbook***](http://www.packtpub.com/opengl-4-0-shading-language-cookbook/book?tag=rk/opengl4-abr1/0811) + +A set of recipes that demonstrates a wide of techniques for producing high-quality, real-time 3D graphics with GLSL 4.0, such as: + +* Using GLSL 4.0 to implement lighting and shading techniques. +* Using the new features of GLSL 4.0 including tessellation and geometry shaders. +* Using textures in GLSL as part of a wide variety of techniques from basic texture mapping to deferred shading. + +Simple, easy-to-follow examples with GLSL source code are provided, as well as a basic description of the theory behind each technique. + +![](/doc/manual/references-glsl4book.jpg) + +[***Outerra***](http://outerra.com/) + +A 3D planetary engine for seamless planet rendering from space down to the surface. Can use arbitrary resolution of elevation data, refining it to centimetre resolution using fractal algorithms. + +![](/doc/manual/references-outerra1.jpg) + +![](/doc/manual/references-outerra2.jpg) + +![](/doc/manual/references-outerra3.jpg) + +![](/doc/manual/references-outerra4.jpg) + +[***Falcor***](https://github.com/NVIDIA/Falcor) + +Real-time rendering research framework by NVIDIA. + +[***Cinder***](https://libcinder.org/) + +Cinder is a free and open source library for professional-quality creative coding in C++. + +Cinder is a C++ library for programming with aesthetic intent - the sort of development often called creative coding. This includes domains like graphics, audio, video, and computational geometry. Cinder is cross-platform, with official support for OS X, Windows, iOS, and WinRT. + +Cinder is production-proven, powerful enough to be the primary tool for professionals, but still suitable for learning and experimentation. Cinder is released under the [2-Clause BSD License](http://opensource.org/licenses/BSD-2-Clause). + +![](/doc/manual/references-cinder.png) + +[***opencloth***](http://code.google.com/p/opencloth/) + +A collection of source codes implementing cloth simulation algorithms in OpenGL. + +Simple, easy-to-follow examples with GLSL source code, as well as a basic description of the theory behind each technique. + +![](/doc/manual/references-opencloth1.png) + +![](/doc/manual/references-opencloth3.png) + +[***LibreOffice***](https://www.libreoffice.org/) + +LibreOffice includes several applications that make it the most powerful Free and Open Source office suite on the market. + +[***Are you using GLM in a project?***](mailto:glm@g-truc.net) + +### 10.4. Tutorials using GLM + +* [Sascha Willems' Vulkan examples](https://github.com/SaschaWillems/Vulkan), Examples and demos for the new Vulkan API +* [VKTS](https://github.com/McNopper/Vulkan) Vulkan examples using VulKan ToolS (VKTS) +* [*The OpenGL Samples Pack*](http://www.g-truc.net/project-0026.html#menu), samples that show how to set up all the different new features +* [*Learning Modern 3D Graphics programming*](http://www.arcsynthesis.org/gltut/), a great OpenGL tutorial using GLM by Jason L. McKesson +* [*Morten Nobel-Jørgensen’s*](http://blog.nobel-joergensen.com/2011/04/02/glm-brilliant-math-library-for-opengl/) review and use an [*OpenGL renderer*](https://github.com/mortennobel/RenderE) +* [*Swiftless’ OpenGL tutorial*](http://www.swiftless.com/opengltuts.html) using GLM by Donald Urquhart +* [*Rastergrid*](http://rastergrid.com/blog/), many technical articles with companion programs using GLM by Daniel Rákos\ +* [*OpenGL Tutorial*](http://www.opengl-tutorial.org), tutorials for OpenGL 3.1 and later +* [*OpenGL Programming on Wikibooks*](http://en.wikibooks.org/wiki/OpenGL_Programming): For beginners who are discovering OpenGL. +* [*3D Game Engine Programming*](http://3dgep.com/): Learning the latest 3D Game Engine Programming techniques. +* [Game Tutorials](http://www.gametutorials.com/opengl-4-matrices-and-glm/), graphics and game programming. +* [open.gl](https://open.gl/), OpenGL tutorial +* [c-jump](http://www.c-jump.com/bcc/common/Talk3/Math/GLM/GLM.html), GLM tutorial +* [Learn OpenGL](http://learnopengl.com/), OpenGL tutorial +* [***Are you using GLM in a tutorial?***](mailto:glm@g-truc.net) + +### 10.5. Equivalent for other languages + +* [*cglm*](https://github.com/recp/cglm): OpenGL Mathematics (glm) for C. +* [*GlmSharp*](https://github.com/Philip-Trettner/GlmSharp): Open-source semi-generated GLM-flavored math library for .NET/C\#. +* [glm-js](https://github.com/humbletim/glm-js): JavaScript adaptation of the OpenGL Mathematics (GLM) C++ library interfaces +* [JVM OpenGL Mathematics (GLM)](https://github.com/kotlin-graphics/glm): written in Kotlin, Java compatible +* [JGLM](https://github.com/jroyalty/jglm) - Java OpenGL Mathematics Library +* [SwiftGL Math Library](https://github.com/SwiftGL/Math/blob/master/Sources/glm.swift) GLM for Swift +* [glm-go](https://github.com/jbowtie/glm-go): Simple linear algebra library similar in spirit to GLM +* [openll](https://github.com/Polkm/openll): Lua bindings for OpenGL, GLM, GLFW, OpenAL, SOIL and PhysicsFS +* [glm-rs](https://github.com/dche/glm-rs): GLSL mathematics for Rust programming language +* [glmpython](https://github.com/Queatz/glmpython): GLM math library for Python + +### 10.6. Alternatives to GLM + +* [*CML*](http://cmldev.net/): The CML (Configurable Math Library) is a free C++ math library for games and graphics. +* [*Eigen*](http://eigen.tuxfamily.org/): A more heavy weight math library for general linear algebra in C++. +* [*glhlib*](http://glhlib.sourceforge.net/): A much more than glu C library. +* Are you using or developing an alternative library to GLM? + +### 10.7. Acknowledgements + +GLM is developed and maintained by [*Christophe Riccio*](http://www.g-truc.net) but many contributors have made this project what it is. + +Special thanks to: +* Ashima Arts and Stefan Gustavson for their work on [*webgl-noise*](https://github.com/ashima/webgl-noise) which has been used for GLM noises implementation. +* [*Arthur Winters*](http://athile.net/library/wiki/index.php?title=Athile_Technologies) for the C++11 and Visual C++ swizzle operators implementation and tests. +* Joshua Smith and Christoph Schied for the discussions and the experiments around the swizzle operators implementation issues. +* Guillaume Chevallereau for providing and maintaining the [*nightlight build system*](http://my.cdash.org/index.php?project=GLM). +* Ghenadii Ursachi for GLM\_GTX\_matrix\_interpolation implementation. +* Mathieu Roumillac for providing some implementation ideas. +* [*Grant James*](http://www.zeuscmd.com/) for the implementation of all combination of none-squared matrix products. +* Jesse Talavera-Greenberg for his work on the manual amount other things. +* All the GLM users that have report bugs and hence help GLM to become a great library! diff --git a/include/glm/readme.md b/include/glm/readme.md new file mode 100644 index 00000000..611c2576 --- /dev/null +++ b/include/glm/readme.md @@ -0,0 +1,1209 @@ +![glm](/doc/manual/logo-mini.png) + +[OpenGL Mathematics](http://glm.g-truc.net/) (*GLM*) is a header only C++ mathematics library for graphics software based on the [OpenGL Shading Language (GLSL) specifications](https://www.opengl.org/registry/doc/GLSLangSpec.4.50.diff.pdf). + +*GLM* provides classes and functions designed and implemented with the same naming conventions and functionality than *GLSL* so that anyone who knows *GLSL*, can use *GLM* as well in C++. + +This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc... + +This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library. + +*GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers: +- [Apple Clang 6.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher +- [GCC](http://gcc.gnu.org/) 4.7 and higher +- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher +- [LLVM](http://llvm.org/) 3.4 and higher +- [Visual C++](http://www.visualstudio.com/) 2013 and higher +- [CUDA](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental) +- [SYCL](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested). +- Any C++11 compiler + +For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). +The source code and the documentation are licensed under either the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0). + +Thanks for contributing to the project by [submitting issues](https://github.com/g-truc/glm/issues) for bug reports and feature requests. Any feedback is welcome at [glm@g-truc.net](mailto://glm@g-truc.net). + +```cpp +#include // glm::vec3 +#include // glm::vec4 +#include // glm::mat4 +#include // glm::translate, glm::rotate, glm::scale +#include // glm::perspective +#include // glm::pi + +glm::mat4 camera(float Translate, glm::vec2 const& Rotate) +{ + glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + return Projection * View * Model; +} +``` + +## [Lastest release](https://github.com/g-truc/glm/releases/latest) + +## Project Health + +| Service | System | Compiler | Status | +| ------- | ------ | -------- | ------ | +| [Travis CI](https://travis-ci.org/g-truc/glm)| MacOSX, Linux 64 bits | Clang 3.6, Clang 5.0, GCC 4.9, GCC 7.3 | [![Travis CI](https://travis-ci.org/g-truc/glm.svg?branch=master)](https://travis-ci.org/g-truc/glm) +| [AppVeyor](https://ci.appveyor.com/project/Groovounet/glm)| Windows 32 and 64 | Visual Studio 2013, Visual Studio 2015, Visual Studio 2017 | [![AppVeyor](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/Groovounet/glm) + +## Release notes + +### [GLM 0.9.9.8](https://github.com/g-truc/glm/releases/tag/0.9.9.8) - 2020-04-13 +#### Features: +- Added GLM_EXT_vector_intX* and GLM_EXT_vector_uintX* extensions +- Added GLM_EXT_matrix_intX* and GLM_EXT_matrix_uintX* extensions + +#### Improvements: +- Added clamp, repeat, mirrorClamp and mirrorRepeat function to GLM_EXT_scalar_commond and GLM_EXT_vector_commond extensions with tests + +#### Fixes: +- Fixed unnecessary warnings from matrix_projection.inl #995 +- Fixed quaternion slerp overload which interpolates with extra spins #996 +- Fixed for glm::length using arch64 #992 +- Fixed singularity check for quatLookAt #770 + +### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05 +#### Improvements: +- Improved Neon support with more functions optimized #950 +- Added CMake GLM interface #963 +- Added fma implementation based on std::fma #969 +- Added missing quat constexpr #955 +- Added GLM_FORCE_QUAT_DATA_WXYZ to store quat data as w,x,y,z instead of x,y,z,w #983 + +#### Fixes: +- Fixed equal ULP variation when using negative sign #965 +- Fixed for intersection ray/plane and added related tests #953 +- Fixed ARM 64bit detection #949 +- Fixed GLM_EXT_matrix_clip_space warnings #980 +- Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986 +- Fixed EXT_matrix_clip_space perspectiveFov + +### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08 +#### Features: +- Added Neon support #945 +- Added SYCL support #914 +- Added EXT_scalar_integer extension with power of two and multiple scalar functions +- Added EXT_vector_integer extension with power of two and multiple vector functions + +#### Improvements: +- Added Visual C++ 2019 detection +- Added Visual C++ 2017 15.8 and 15.9 detection +- Added missing genType check for bitCount and bitfieldReverse #893 + +#### Fixes: +- Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921 +- Fixed hash hashes qua instead of tquat #919 +- Fixed .natvis as structs renamed #915 +- Fixed ldexp and frexp declaration #895 +- Fixed missing const to quaternion conversion operators #890 +- Fixed EXT_scalar_ulp and EXT_vector_ulp API coding style +- Fixed quaternion componant order: w, {x, y, z} #916 +- Fixed GLM_HAS_CXX11_STL broken on Clang with Linux #926 +- Fixed Clang or GCC build due to wrong GLM_HAS_IF_CONSTEXPR definition #907 +- Fixed CUDA 9 build #910 + +#### Deprecation: + - Removed CMake install and uninstall scripts + +### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01 +#### Fixes: +- Fixed build errors when defining GLM_ENABLE_EXPERIMENTAL #884 #883 +- Fixed 'if constexpr' warning #887 +- Fixed missing declarations for frexp and ldexp #886 + +### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19 +#### Features: +- Added mix implementation for matrices in EXT_matrix_common #842 +- Added BUILD_SHARED_LIBS and BUILD_STATIC_LIBS build options #871 + +#### Improvements: +- Added GLM_FORCE_INTRINSICS to enable SIMD instruction code path. By default, it's disabled allowing constexpr support by default. #865 +- Optimized inverseTransform #867 + +#### Fixes: +- Fixed in mat4x3 conversion #829 +- Fixed constexpr issue on GCC #832 #865 +- Fixed mix implementation to improve GLSL conformance #866 +- Fixed int8 being defined as unsigned char with some compiler #839 +- Fixed vec1 include #856 +- Ignore .vscode #848 + +### [GLM 0.9.9.3](https://github.com/g-truc/glm/releases/tag/0.9.9.3) - 2018-10-31 +#### Features: +- Added equal and notEqual overload with max ULPs parameters for scalar numbers #121 +- Added GLM_FORCE_SILENT_WARNINGS to silent GLM warnings when using language extensions but using W4 or Wpedantic warnings #814 #775 +- Added adjugate functions to GTX_matrix_operation #151 +- Added GLM_FORCE_ALIGNED_GENTYPES to enable aligned types and SIMD instruction are not enabled. This disable constexpr #816 + +#### Improvements: +- Added constant time ULP distance between float #121 +- Added GLM_FORCE_SILENT_WARNINGS to suppress GLM warnings #822 + +#### Fixes: +- Fixed simplex noise build with double #734 +- Fixed bitfieldInsert according to GLSL spec #818 +- Fixed refract for negative 'k' #808 + +### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14 +#### Fixes: +- Fixed GLM_FORCE_CXX** section in the manual +- Fixed default initialization with vector and quaternion types using GLM_FORCE_CTOR_INIT #812 + +### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03 +#### Features: +- Added bitfieldDeinterleave to GTC_bitfield +- Added missing equal and notEqual with epsilon for quaternion types to GTC_quaternion +- Added EXT_matrix_relational: equal and notEqual with epsilon for matrix types +- Added missing aligned matrix types to GTC_type_aligned +- Added C++17 detection +- Added Visual C++ language standard version detection +- Added PDF manual build from markdown + +#### Improvements: +- Added a section to the manual for contributing to GLM +- Refactor manual, lists all configuration defines +- Added missing vec1 based constructors +- Redesigned constexpr support which excludes both SIMD and constexpr #783 +- Added detection of Visual C++ 2017 toolsets +- Added identity functions #765 +- Splitted headers into EXT extensions to improve compilation time #670 +- Added separated performance tests +- Clarified refract valid range of the indices of refraction, between -1 and 1 inclusively #806 + +#### Fixes: +- Fixed SIMD detection on Clang and GCC +- Fixed build problems due to printf and std::clock_t #778 +- Fixed int mod +- Anonymous unions require C++ language extensions +- Fixed ortho #790 +- Fixed Visual C++ 2013 warnings in vector relational code #782 +- Fixed ICC build errors with constexpr #704 +- Fixed defaulted operator= and constructors #791 +- Fixed invalid conversion from int scalar with vec4 constructor when using SSE instruction +- Fixed infinite loop in random functions when using negative radius values using an assert #739 + +### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22 +#### Features: +- Added RGBM encoding in GTC_packing #420 +- Added GTX_color_encoding extension +- Added GTX_vec_swizzle, faster compile time swizzling then swizzle operator #558 +- Added GTX_exterior_product with a vec2 cross implementation #621 +- Added GTX_matrix_factorisation to factor matrices in various forms #654 +- Added [GLM_ENABLE_EXPERIMENTAL](manual.md#section7_4) to enable experimental features. +- Added packing functions for integer vectors #639 +- Added conan packaging configuration #643 #641 +- Added quatLookAt to GTX_quaternion #659 +- Added fmin, fmax and fclamp to GTX_extended_min_max #372 +- Added EXT_vector_relational: extend equal and notEqual to take an epsilon argument +- Added EXT_vector_relational: openBounded and closeBounded +- Added EXT_vec1: *vec1 types +- Added GTX_texture: levels function +- Added spearate functions to use both nagative one and zero near clip plans #680 +- Added GLM_FORCE_SINGLE_ONLY to use GLM on platforms that don't support double #627 +- Added GTX_easing for interpolation functions #761 + +#### Improvements: +- No more default initialization of vector, matrix and quaternion types +- Added lowp variant of GTC_color_space convertLinearToSRGB #419 +- Replaced the manual by a markdown version #458 +- Improved API documentation #668 +- Optimized GTC_packing implementation +- Optimized GTC_noise functions +- Optimized GTC_color_space HSV to RGB conversions +- Optimised GTX_color_space_YCoCg YCoCgR conversions +- Optimized GTX_matrix_interpolation axisAngle function +- Added FAQ 12: Windows headers cause build errors... #557 +- Removed GCC shadow warnings #595 +- Added error for including of different versions of GLM #619 +- Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619 +- Reduced warnings when using very strict compilation flags #646 +- length() member functions are constexpr #657 +- Added support of -Weverything with Clang #646 +- Improved exponential function test coverage +- Enabled warnings as error with Clang unit tests +- Conan package is an external repository: https://github.com/bincrafters/conan-glm +- Clarify quat_cast documentation, applying on pure rotation matrices #759 + +#### Fixes: +- Removed doxygen references to GTC_half_float which was removed in 0.9.4 +- Fixed glm::decompose #448 +- Fixed intersectRayTriangle #6 +- Fixed dual quaternion != operator #629 +- Fixed usused variable warning in GTX_spline #618 +- Fixed references to GLM_FORCE_RADIANS which was removed #642 +- Fixed glm::fastInverseSqrt to use fast inverse square #640 +- Fixed axisAngle NaN #638 +- Fixed integer pow from GTX_integer with null exponent #658 +- Fixed quat normalize build error #656 +- Fixed Visual C++ 2017.2 warning regarding __has_feature definision #655 +- Fixed documentation warnings +- Fixed GLM_HAS_OPENMP when OpenMP is not enabled +- Fixed Better follow GLSL min and max specification #372 +- Fixed quaternion constructor from two vectors special cases #469 +- Fixed glm::to_string on quaternions wrong components order #681 +- Fixed acsch #698 +- Fixed isnan on CUDA #727 + +#### Deprecation: +- Requires Visual Studio 2013, GCC 4.7, Clang 3.4, Cuda 7, ICC 2013 or a C++11 compiler +- Removed GLM_GTX_simd_vec4 extension +- Removed GLM_GTX_simd_mat4 extension +- Removed GLM_GTX_simd_quat extension +- Removed GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead +- Removed GLM_MESSAGES, use GLM_FORCE_MESSAGES instead +- Removed GLM_DEPTH_ZERO_TO_ONE, use GLM_FORCE_DEPTH_ZERO_TO_ONE instead +- Removed GLM_LEFT_HANDED, use GLM_FORCE_LEFT_HANDED instead +- Removed GLM_FORCE_NO_CTOR_INIT +- Removed glm::uninitialize + +--- +### [GLM 0.9.8.5](https://github.com/g-truc/glm/releases/tag/0.9.8.5) - 2017-08-16 +#### Features: +- Added Conan package support #647 + +#### Fixes: +- Fixed Clang version detection from source #608 +- Fixed packF3x9_E1x5 exponent packing #614 +- Fixed build error min and max specializations with integer #616 +- Fixed simd_mat4 build error #652 + +--- +### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22 +#### Fixes: +- Fixed GTC_packing test failing on GCC x86 due to denorms #212 #577 +- Fixed POPCNT optimization build in Clang #512 +- Fixed intersectRayPlane returns true in parallel case #578 +- Fixed GCC 6.2 compiler warnings #580 +- Fixed GTX_matrix_decompose decompose #582 #448 +- Fixed GCC 4.5 and older build #566 +- Fixed Visual C++ internal error when declaring a global vec type with siwzzle expression enabled #594 +- Fixed GLM_FORCE_CXX11 with Clang and libstlc++ which wasn't using C++11 STL features. #604 + +--- +### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12 +#### Improvements: +- Broader support of GLM_FORCE_UNRESTRICTED_GENTYPE #378 + +#### Fixes: +- Fixed Android build error with C++11 compiler but C++98 STL #284 #564 +- Fixed GTX_transform2 shear* functions #403 +- Fixed interaction between GLM_FORCE_UNRESTRICTED_GENTYPE and ortho function #568 +- Fixed bitCount with AVX on 32 bit builds #567 +- Fixed CMake find_package with version specification #572 #573 + +--- +### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01 +#### Improvements: +- Added Visual C++ 15 detection +- Added Clang 4.0 detection +- Added warning messages when using GLM_FORCE_CXX** but the compiler + is known to not fully support the requested C++ version #555 +- Refactored GLM_COMPILER_VC values +- Made quat, vec, mat type component length() static #565 + +#### Fixes: +- Fixed Visual C++ constexpr build error #555, #556 + +--- +### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25 +#### Improvements: +- Optimized quaternion log function #554 + +#### Fixes: +- Fixed GCC warning filtering, replaced -pedantic by -Wpedantic +- Fixed SIMD faceforward bug. #549 +- Fixed GCC 4.8 with C++11 compilation option #550 +- Fixed Visual Studio aligned type W4 warning #548 +- Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552 + +--- +### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 2016-09-11 +#### Features: +- Added right and left handed projection and clip control support #447 #415 #119 +- Added compNormalize and compScale functions to GTX_component_wise +- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 +- Added (un)packHalf to GTC_packing +- Added (un)packUnorm and (un)packSnorm to GTC_packing +- Added 16bit pack and unpack to GTC_packing +- Added 8bit pack and unpack to GTC_packing +- Added missing bvec* && and || operators +- Added iround and uround to GTC_integer, fast round on positive values +- Added raw SIMD API +- Added 'aligned' qualifiers +- Added GTC_type_aligned with aligned *vec* types +- Added GTC_functions extension +- Added quaternion version of isnan and isinf #521 +- Added lowestBitValue to GTX_bit #536 +- Added GLM_FORCE_UNRESTRICTED_GENTYPE allowing non basic genType #543 + +#### Improvements: +- Improved SIMD and swizzle operators interactions with GCC and Clang #474 +- Improved GTC_random linearRand documentation +- Improved GTC_reciprocal documentation +- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 +- Improved OpenMP support detection for Clang, GCC, ICC and VC +- Improved GTX_wrap for SIMD friendliness +- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493 +- Added NEON instruction set detection +- Added MIPS CPUs detection +- Added PowerPC CPUs detection +- Use Cuda built-in function for abs function implementation with Cuda compiler +- Factorized GLM_COMPILER_LLVM and GLM_COMPILER_APPLE_CLANG into GLM_COMPILER_CLANG +- No more warnings for use of long long +- Added more information to build messages + +#### Fixes: +- Fixed GTX_extended_min_max filename typo #386 +- Fixed intersectRayTriangle to not do any unintentional backface culling +- Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed sign with signed integer function on non-x86 architecture +- Fixed strict aliasing warnings #473 +- Fixed missing vec1 overload to length2 and distance2 functions #431 +- Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible +- Fixed quaterion to mat3 cast function mat3_cast from GTC_quaternion #542 +- Fixed GTX_io for Cuda #547 #546 + +#### Deprecation: +- Removed GLM_FORCE_SIZE_FUNC define +- Deprecated GLM_GTX_simd_vec4 extension +- Deprecated GLM_GTX_simd_mat4 extension +- Deprecated GLM_GTX_simd_quat extension +- Deprecated GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead +- Deprecated GLM_MESSAGES, use GLM_FORCE_MESSAGES instead + +--- +### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16 +#### Improvements: +- Added pkg-config file #509 +- Updated list of compiler versions detected +- Improved C++ 11 STL detection #523 + +#### Fixes: +- Fixed STL for C++11 detection on ICC #510 +- Fixed missing vec1 overload to length2 and distance2 functions #431 +- Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed scalar reciprocal functions (GTC_reciprocal) #520 + +--- +### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24 +#### Improvements: +- Added Visual C++ Clang toolset detection + +#### Fixes: +- Fixed uaddCarry warning #497 +- Fixed roundPowerOfTwo and floorPowerOfTwo #503 +- Fixed Visual C++ SIMD instruction set automatic detection in 64 bits +- Fixed to_string when used with GLM_FORCE_INLINE #506 +- Fixed GLM_FORCE_INLINE with binary vec4 operators +- Fixed GTX_extended_min_max filename typo #386 +- Fixed intersectRayTriangle to not do any unintentional backface culling + +--- +### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19 +#### Fixes: +- Fixed asinh and atanh warning with C++98 STL #484 +- Fixed polar coordinates function latitude #485 +- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 +- Fixed eulerAngles precision error, returns NaN #451 +- Fixed undefined reference errors #489 +- Fixed missing GLM_PLATFORM_CYGWIN declaration #495 +- Fixed various undefined reference errors #490 + +--- +### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 +#### Improvements: +- Added AVX512 detection + +#### Fixes: +- Fixed CMake policy warning +- Fixed GCC 6.0 detection #477 +- Fixed Clang build on Windows #479 +- Fixed 64 bits constants warnings on GCC #463 + +--- +### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 +#### Fixes: +- Fixed GTC_round floorMultiple/ceilMultiple #412 +- Fixed GTC_packing unpackUnorm3x10_1x2 #414 +- Fixed GTC_matrix_inverse affineInverse #192 +- Fixed ICC on Linux build errors #449 +- Fixed ldexp and frexp compilation errors +- Fixed "Declaration shadows a field" warning #468 +- Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468 +- Fixed various 'X is not defined' warnings #468 +- Fixed missing unary + operator #435 +- Fixed Cygwin build errors when using C++11 #405 + +--- +### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 +#### Improvements: +- Improved constexpr for constant functions coverage #198 +- Added to_string for quat and dual_quat in GTX_string_cast #375 +- Improved overall execution time of unit tests #396 + +#### Fixes: +- Fixed strict alignment warnings #235 #370 +- Fixed link errors on compilers not supported default function #377 +- Fixed compilation warnings in vec4 +- Fixed non-identity quaternions for equal vectors #234 +- Fixed excessive GTX_fast_trigonometry execution time #396 +- Fixed Visual Studio 2015 'hides class member' warnings #394 +- Fixed builtin bitscan never being used #392 +- Removed unused func_noise.* files #398 + +--- +### [GLM 0.9.7.0](https://github.com/g-truc/glm/releases/tag/0.9.7.0) - 2015-08-02 +#### Features: +- Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions +- Added 'fmod' overload to GTX_common with tests #308 +- Left handed perspective and lookAt functions #314 +- Added functions eulerAngleXYZ and extractEulerAngleXYZ #311 +- Added to perform std::hash on GLM types #320 #367 +- Added for texcoord wrapping +- Added static components and precision members to all vector and quat types #350 +- Added .gitignore #349 +- Added support of defaulted functions to GLM types, to use them in unions #366 + +#### Improvements: +- Changed usage of __has_include to support Intel compiler #307 +- Specialized integer implementation of YCoCg-R #310 +- Don't show status message in 'FindGLM' if 'QUIET' option is set. #317 +- Added master branch continuous integration service on Linux 64 #332 +- Clarified manual regarding angle unit in GLM, added FAQ 11 #326 +- Updated list of compiler versions + +#### Fixes: +- Fixed default precision for quat and dual_quat type #312 +- Fixed (u)int64 MSB/LSB handling on BE archs #306 +- Fixed multi-line comment warning in g++. #315 +- Fixed specifier removal by 'std::make_pair<>' #333 +- Fixed perspective fovy argument documentation #327 +- Removed -m64 causing build issues on Linux 32 #331 +- Fixed isfinite with C++98 compilers #343 +- Fixed Intel compiler build error on Linux #354 +- Fixed use of libstdc++ with Clang #351 +- Fixed quaternion pow #346 +- Fixed decompose warnings #373 +- Fixed matrix conversions #371 + +#### Deprecation: +- Removed integer specification for 'mod' in GTC_integer #308 +- Removed GTX_multiple, replaced by GTC_round + +--- +### [GLM 0.9.6.3](https://github.com/g-truc/glm/releases/tag/0.9.6.3) - 2015-02-15 +- Fixed Android doesn't have C++ 11 STL #284 + +--- +### [GLM 0.9.6.2](https://github.com/g-truc/glm/releases/tag/0.9.6.2) - 2015-02-15 +#### Features: +- Added display of GLM version with other GLM_MESSAGES +- Added ARM instruction set detection + +#### Improvements: +- Removed assert for perspective with zFar < zNear #298 +- Added Visual Studio natvis support for vec1, quat and dualqual types +- Cleaned up C++11 feature detections +- Clarify GLM licensing + +#### Fixes: +- Fixed faceforward build #289 +- Fixed conflict with Xlib #define True 1 #293 +- Fixed decompose function VS2010 templating issues #294 +- Fixed mat4x3 = mat2x3 * mat4x2 operator #297 +- Fixed warnings in F2x11_1x10 packing function in GTC_packing #295 +- Fixed Visual Studio natvis support for vec4 #288 +- Fixed GTC_packing *pack*norm*x* build and added tests #292 +- Disabled GTX_scalar_multiplication for GCC, failing to build tests #242 +- Fixed Visual C++ 2015 constexpr errors: Disabled only partial support +- Fixed functions not inlined with Clang #302 +- Fixed memory corruption (undefined behaviour) #303 + +--- +### [GLM 0.9.6.1](https://github.com/g-truc/glm/releases/tag/0.9.6.1) - 2014-12-10 +#### Features: +- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags +- Added C++14 detection + +#### Improvements: +- Clean up GLM_MESSAGES compilation log to report only detected capabilities + +#### Fixes: +- Fixed scalar uaddCarry build error with Cuda #276 +- Fixed C++11 explicit conversion operators detection #282 +- Fixed missing explicit conversion when using integer log2 with *vec1 types +- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler +- Fixed Android build issue, STL C++11 is not supported by the NDK #284 +- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10 +- Fixed Visual C++ 32 bit build #283 +- Fixed GLM_FORCE_SIZE_FUNC pragma message +- Fixed C++98 only build +- Fixed conflict between GTX_compatibility and GTC_quaternion #286 +- Fixed C++ language restriction using GLM_FORCE_CXX** + +--- +### [GLM 0.9.6.0](https://github.com/g-truc/glm/releases/tag/0.9.6.0) - 2014-11-30 +#### Features: +- Exposed template vector and matrix types in 'glm' namespace #239, #244 +- Added GTX_scalar_multiplication for C++ 11 compiler only #242 +- Added GTX_range for C++ 11 compiler only #240 +- Added closestPointOnLine function for tvec2 to GTX_closest_point #238 +- Added GTC_vec1 extension, *vec1 support to *vec* types +- Updated GTX_associated_min_max with vec1 support +- Added support of precision and integers to linearRand #230 +- Added Integer types support to GTX_string_cast #249 +- Added vec3 slerp #237 +- Added GTX_common with isdenomal #223 +- Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245 +- Added GLM_FORCE_NO_CTOR_INIT +- Added 'uninitialize' to explicitly not initialize a GLM type +- Added GTC_bitfield extension, promoted GTX_bit +- Added GTC_integer extension, promoted GTX_bit and GTX_integer +- Added GTC_round extension, promoted GTX_bit +- Added GLM_FORCE_EXPLICIT_CTOR to require explicit type conversions #269 +- Added GTX_type_aligned for aligned vector, matrix and quaternion types + +#### Improvements: +- Rely on C++11 to implement isinf and isnan +- Removed GLM_FORCE_CUDA, Cuda is implicitly detected +- Separated Apple Clang and LLVM compiler detection +- Used pragma once +- Undetected C++ compiler automatically compile with GLM_FORCE_CXX98 and + GLM_FORCE_PURE +- Added not function (from GLSL specification) on VC12 +- Optimized bitfieldReverse and bitCount functions +- Optimized findLSB and findMSB functions. +- Optimized matrix-vector multiple performance with Cuda #257, #258 +- Reduced integer type redifinitions #233 +- Rewrited of GTX_fast_trigonometry #264 #265 +- Made types trivially copyable #263 +- Removed in GLM tests +- Used std features within GLM without redeclaring +- Optimized cot function #272 +- Optimized sign function #272 +- Added explicit cast from quat to mat3 and mat4 #275 + +#### Fixes: +- Fixed std::nextafter not supported with C++11 on Android #217 +- Fixed missing value_type for dual quaternion +- Fixed return type of dual quaternion length +- Fixed infinite loop in isfinite function with GCC #221 +- Fixed Visual Studio 14 compiler warnings +- Fixed implicit conversion from another tvec2 type to another tvec2 #241 +- Fixed lack of consistency of quat and dualquat constructors +- Fixed uaddCarray #253 +- Fixed float comparison warnings #270 + +#### Deprecation: +- Requires Visual Studio 2010, GCC 4.2, Apple Clang 4.0, LLVM 3.0, Cuda 4, ICC 2013 or a C++98 compiler +- Removed degrees for function parameters +- Removed GLM_FORCE_RADIANS, active by default +- Removed VC 2005 / 8 and 2008 / 9 support +- Removed GCC 3.4 to 4.3 support +- Removed LLVM GCC support +- Removed LLVM 2.6 to 3.1 support +- Removed CUDA 3.0 to 3.2 support + +--- +### [GLM 0.9.5.4 - 2014-06-21](https://github.com/g-truc/glm/releases/tag/0.9.5.4) +- Fixed non-utf8 character #196 +- Added FindGLM install for CMake #189 +- Fixed GTX_color_space - saturation #195 +- Fixed glm::isinf and glm::isnan for with Android NDK 9d #191 +- Fixed builtin GLM_ARCH_SSE4 #204 +- Optimized Quaternion vector rotation #205 +- Fixed missing doxygen @endcond tag #211 +- Fixed instruction set detection with Clang #158 +- Fixed orientate3 function #207 +- Fixed lerp when cosTheta is close to 1 in quaternion slerp #210 +- Added GTX_io for io with #144 +- Fixed fastDistance ambiguity #215 +- Fixed tweakedInfinitePerspective #208 and added user-defined epsilon to + tweakedInfinitePerspective +- Fixed std::copy and std::vector with GLM types #214 +- Fixed strict aliasing issues #212, #152 +- Fixed std::nextafter not supported with C++11 on Android #213 +- Fixed corner cases in exp and log functions for quaternions #199 + +--- +### GLM 0.9.5.3 - 2014-04-02 +- Added instruction set auto detection with Visual C++ using _M_IX86_FP - /arch + compiler argument +- Fixed GTX_raw_data code dependency +- Fixed GCC instruction set detection +- Added GLM_GTX_matrix_transform_2d extension (#178, #176) +- Fixed CUDA issues (#169, #168, #183, #182) +- Added support for all extensions but GTX_string_cast to CUDA +- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152) +- Fixed missing bitfieldInterleave definisions +- Fixed usubBorrow (#171) +- Fixed eulerAngle*** not consistent for right-handed coordinate system (#173) +- Added full tests for eulerAngle*** functions (#173) +- Added workaround for a CUDA compiler bug (#186, #185) + +--- +### GLM 0.9.5.2 - 2014-02-08 +- Fixed initializer list ambiguity (#159, #160) +- Fixed warnings with the Android NDK 9c +- Fixed non power of two matrix products +- Fixed mix function link error +- Fixed SSE code included in GLM tests on "pure" platforms +- Fixed undefined reference to fastInverseSqrt (#161) +- Fixed GLM_FORCE_RADIANS with build error (#165) +- Fix dot product clamp range for vector angle functions. (#163) +- Tentative fix for strict aliasing warning in GCC 4.8.1 / Android NDK 9c (#152) +- Fixed GLM_GTC_constants description brief (#162) + +--- +### GLM 0.9.5.1 - 2014-01-11 +- Fixed angle and orientedAngle that sometimes return NaN values (#145) +- Deprecated degrees for function parameters and display a message +- Added possible static_cast conversion of GLM types (#72) +- Fixed error 'inverse' is not a member of 'glm' from glm::unProject (#146) +- Fixed mismatch between some declarations and definitions +- Fixed inverse link error when using namespace glm; (#147) +- Optimized matrix inverse and division code (#149) +- Added intersectRayPlane function (#153) +- Fixed outerProduct return type (#155) + +--- +### GLM 0.9.5.0 - 2013-12-25 +- Added forward declarations (glm/fwd.hpp) for faster compilations +- Added per feature headers +- Minimized GLM internal dependencies +- Improved Intel Compiler detection +- Added bitfieldInterleave and _mm_bit_interleave_si128 functions +- Added GTX_scalar_relational +- Added GTX_dual_quaternion +- Added rotation function to GTX_quaternion (#22) +- Added precision variation of each type +- Added quaternion comparison functions +- Fixed GTX_multiple for negative value +- Removed GTX_ocl_type extension +- Fixed post increment and decrement operators +- Fixed perspective with zNear == 0 (#71) +- Removed l-value swizzle operators +- Cleaned up compiler detection code for unsupported compilers +- Replaced C cast by C++ casts +- Fixed .length() that should return a int and not a size_t +- Added GLM_FORCE_SIZE_T_LENGTH and glm::length_t +- Removed unnecessary conversions +- Optimized packing and unpacking functions +- Removed the normalization of the up argument of lookAt function (#114) +- Added low precision specializations of inversesqrt +- Fixed ldexp and frexp implementations +- Increased assert coverage +- Increased static_assert coverage +- Replaced GLM traits by STL traits when possible +- Allowed including individual core feature +- Increased unit tests completness +- Added creating of a quaternion from two vectors +- Added C++11 initializer lists +- Fixed umulExtended and imulExtended implementations for vector types (#76) +- Fixed CUDA coverage for GTC extensions +- Added GTX_io extension +- Improved GLM messages enabled when defining GLM_MESSAGES +- Hidden matrix _inverse function implementation detail into private section + +--- +### [GLM 0.9.4.6](https://github.com/g-truc/glm/releases/tag/0.9.4.6) - 2013-09-20 +- Fixed detection to select the last known compiler if newer version #106 +- Fixed is_int and is_uint code duplication with GCC and C++11 #107 +- Fixed test suite build while using Clang in C++11 mode +- Added c++1y mode support in CMake test suite +- Removed ms extension mode to CMake when no using Visual C++ +- Added pedantic mode to CMake test suite for Clang and GCC +- Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows + for ICC +- Added compilation errors for unsupported compiler versions +- Fixed glm::orientation with GLM_FORCE_RADIANS defined #112 +- Fixed const ref issue on assignment operator taking a scalar parameter #116 +- Fixed glm::eulerAngleY implementation #117 + +--- +### GLM 0.9.4.5 - 2013-08-12 +- Fixed CUDA support +- Fixed inclusion of intrinsics in "pure" mode #92 +- Fixed language detection on GCC when the C++0x mode isn't enabled #95 +- Fixed issue #97: register is deprecated in C++11 +- Fixed issue #96: CUDA issues +- Added Windows CE detection #92 +- Added missing value_ptr for quaternions #99 + +--- +### GLM 0.9.4.4 - 2013-05-29 +- Fixed slerp when costheta is close to 1 #65 +- Fixed mat4x2 value_type constructor #70 +- Fixed glm.natvis for Visual C++ 12 #82 +- Added assert in inversesqrt to detect division by zero #61 +- Fixed missing swizzle operators #86 +- Fixed CUDA warnings #86 +- Fixed GLM natvis for VC11 #82 +- Fixed GLM_GTX_multiple with negative values #79 +- Fixed glm::perspective when zNear is zero #71 + +--- +### GLM 0.9.4.3 - 2013-03-20 +- Detected qualifier for Clang +- Fixed C++11 mode for GCC, couldn't be enabled without MS extensions +- Fixed squad, intermediate and exp quaternion functions +- Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3 +- Clarify the license applying on the manual +- Added a docx copy of the manual +- Fixed GLM_GTX_matrix_interpolation +- Fixed isnan and isinf on Android with Clang +- Autodetected C++ version using __cplusplus value +- Fixed mix for bool and bvec* third parameter + +--- +### GLM 0.9.4.2 - 2013-02-14 +- Fixed compAdd from GTX_component_wise +- Fixed SIMD support for Intel compiler on Windows +- Fixed isnan and isinf for CUDA compiler +- Fixed GLM_FORCE_RADIANS on glm::perspective +- Fixed GCC warnings +- Fixed packDouble2x32 on Xcode +- Fixed mix for vec4 SSE implementation +- Fixed 0x2013 dash character in comments that cause issue in Windows + Japanese mode +- Fixed documentation warnings +- Fixed CUDA warnings + +--- +### GLM 0.9.4.1 - 2012-12-22 +- Improved half support: -0.0 case and implicit conversions +- Fixed Intel Composer Compiler support on Linux +- Fixed interaction between quaternion and euler angles +- Fixed GTC_constants build +- Fixed GTX_multiple +- Fixed quat slerp using mix function when cosTheta close to 1 +- Improved fvec4SIMD and fmat4x4SIMD implementations +- Fixed assert messages +- Added slerp and lerp quaternion functions and tests + +--- +### GLM 0.9.4.0 - 2012-11-18 +- Added Intel Composer Compiler support +- Promoted GTC_espilon extension +- Promoted GTC_ulp extension +- Removed GLM website from the source repository +- Added GLM_FORCE_RADIANS so that all functions takes radians for arguments +- Fixed detection of Clang and LLVM GCC on MacOS X +- Added debugger visualizers for Visual C++ 2012 +- Requires Visual Studio 2005, GCC 4.2, Clang 2.6, Cuda 3, ICC 2013 or a C++98 compiler + +--- +### [GLM 0.9.3.4](https://github.com/g-truc/glm/releases/tag/0.9.3.4) - 2012-06-30 +- Added SSE4 and AVX2 detection. +- Removed VIRTREV_xstream and the incompatibility generated with GCC +- Fixed C++11 compiler option for GCC +- Removed MS language extension option for GCC (not fonctionnal) +- Fixed bitfieldExtract for vector types +- Fixed warnings +- Fixed SSE includes + +--- +### GLM 0.9.3.3 - 2012-05-10 +- Fixed isinf and isnan +- Improved compatibility with Intel compiler +- Added CMake test build options: SIMD, C++11, fast math and MS land ext +- Fixed SIMD mat4 test on GCC +- Fixed perspectiveFov implementation +- Fixed matrixCompMult for none-square matrices +- Fixed namespace issue on stream operators +- Fixed various warnings +- Added VC11 support + +--- +### GLM 0.9.3.2 - 2012-03-15 +- Fixed doxygen documentation +- Fixed Clang version detection +- Fixed simd mat4 /= operator + +--- +### GLM 0.9.3.1 - 2012-01-25 +- Fixed platform detection +- Fixed warnings +- Removed detail code from Doxygen doc + +--- +### GLM 0.9.3.0 - 2012-01-09 +- Added CPP Check project +- Fixed conflict with Windows headers +- Fixed isinf implementation +- Fixed Boost conflict +- Fixed warnings + +--- +### GLM 0.9.3.B - 2011-12-12 +- Added support for Chrone Native Client +- Added epsilon constant +- Removed value_size function from vector types +- Fixed roundEven on GCC +- Improved API documentation +- Fixed modf implementation +- Fixed step function accuracy +- Fixed outerProduct + +--- +### GLM 0.9.3.A - 2011-11-11 +- Improved doxygen documentation +- Added new swizzle operators for C++11 compilers +- Added new swizzle operators declared as functions +- Added GLSL 4.20 length for vector and matrix types +- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions +- Promoted GLM_GTC_random extension: linear, gaussian and various random number +generation distribution +- Added GLM_GTX_constants: provides useful constants +- Added extension versioning +- Removed many unused namespaces +- Fixed half based type contructors +- Added GLSL core noise functions + +--- +### [GLM 0.9.2.7](https://github.com/g-truc/glm/releases/tag/0.9.2.7) - 2011-10-24 +- Added more swizzling constructors +- Added missing none-squared matrix products + +--- +### [GLM 0.9.2.6](https://github.com/g-truc/glm/releases/tag/0.9.2.6) - 2011-10-01 +- Fixed half based type build on old GCC +- Fixed /W4 warnings on Visual C++ +- Fixed some missing l-value swizzle operators + +--- +### GLM 0.9.2.5 - 2011-09-20 +- Fixed floatBitToXint functions +- Fixed pack and unpack functions +- Fixed round functions + +--- +### GLM 0.9.2.4 - 2011-09-03 +- Fixed extensions bugs + +--- +### GLM 0.9.2.3 - 2011-06-08 +- Fixed build issues + +--- +### GLM 0.9.2.2 - 2011-06-02 +- Expend matrix constructors flexibility +- Improved quaternion implementation +- Fixed many warnings across platforms and compilers + +--- +### GLM 0.9.2.1 - 2011-05-24 +- Automatically detect CUDA support +- Improved compiler detection +- Fixed errors and warnings in VC with C++ extensions disabled +- Fixed and tested GLM_GTX_vector_angle +- Fixed and tested GLM_GTX_rotate_vector + +--- +### GLM 0.9.2.0 - 2011-05-09 +- Added CUDA support +- Added CTest test suite +- Added GLM_GTX_ulp extension +- Added GLM_GTX_noise extension +- Added GLM_GTX_matrix_interpolation extension +- Updated quaternion slerp interpolation + +--- +### [GLM 0.9.1.3](https://github.com/g-truc/glm/releases/tag/0.9.1.3) - 2011-05-07 +- Fixed bugs + +--- +### GLM 0.9.1.2 - 2011-04-15 +- Fixed bugs + +--- +### GLM 0.9.1.1 - 2011-03-17 +- Fixed bugs + +--- +### GLM 0.9.1.0 - 2011-03-03 +- Fixed bugs + +--- +### GLM 0.9.1.B - 2011-02-13 +- Updated API documentation +- Improved SIMD implementation +- Fixed Linux build + +--- +### [GLM 0.9.0.8](https://github.com/g-truc/glm/releases/tag/0.9.0.8) - 2011-02-13 +- Added quaternion product operator. +- Clarify that GLM is a header only library. + +--- +### GLM 0.9.1.A - 2011-01-31 +- Added SIMD support +- Added new swizzle functions +- Improved static assert error message with C++0x static_assert +- New setup system +- Reduced branching +- Fixed trunc implementation + +--- +### [GLM 0.9.0.7](https://github.com/g-truc/glm/releases/tag/0.9.0.7) - 2011-01-30 +- Added GLSL 4.10 packing functions +- Added == and != operators for every types. + +--- +### GLM 0.9.0.6 - 2010-12-21 +- Many matrices bugs fixed + +--- +### GLM 0.9.0.5 - 2010-11-01 +- Improved Clang support +- Fixed bugs + +--- +### GLM 0.9.0.4 - 2010-10-04 +- Added autoexp for GLM +- Fixed bugs + +--- +### GLM 0.9.0.3 - 2010-08-26 +- Fixed non-squared matrix operators + +--- +### GLM 0.9.0.2 - 2010-07-08 +- Added GLM_GTX_int_10_10_10_2 +- Fixed bugs + +--- +### GLM 0.9.0.1 - 2010-06-21 +- Fixed extensions errors + +--- +### GLM 0.9.0.0 - 2010-05-25 +- Objective-C support +- Fixed warnings +- Updated documentation + +--- +### GLM 0.9.B.2 - 2010-04-30 +- Git transition +- Removed experimental code from releases +- Fixed bugs + +--- +### GLM 0.9.B.1 - 2010-04-03 +- Based on GLSL 4.00 specification +- Added the new core functions +- Added some implicit conversion support + +--- +### GLM 0.9.A.2 - 2010-02-20 +- Improved some possible errors messages +- Improved declarations and definitions match + +--- +### GLM 0.9.A.1 - 2010-02-09 +- Removed deprecated features +- Internal redesign + +--- +### GLM 0.8.4.4 final - 2010-01-25 +- Fixed warnings + +--- +### GLM 0.8.4.3 final - 2009-11-16 +- Fixed Half float arithmetic +- Fixed setup defines + +--- +### GLM 0.8.4.2 final - 2009-10-19 +- Fixed Half float adds + +--- +### GLM 0.8.4.1 final - 2009-10-05 +- Updated documentation +- Fixed MacOS X build + +--- +### GLM 0.8.4.0 final - 2009-09-16 +- Added GCC 4.4 and VC2010 support +- Added matrix optimizations + +--- +### GLM 0.8.3.5 final - 2009-08-11 +- Fixed bugs + +--- +### GLM 0.8.3.4 final - 2009-08-10 +- Updated GLM according GLSL 1.5 spec +- Fixed bugs + +--- +### GLM 0.8.3.3 final - 2009-06-25 +- Fixed bugs + +--- +### GLM 0.8.3.2 final - 2009-06-04 +- Added GLM_GTC_quaternion +- Added GLM_GTC_type_precision + +--- +### GLM 0.8.3.1 final - 2009-05-21 +- Fixed old extension system. + +--- +### GLM 0.8.3.0 final - 2009-05-06 +- Added stable extensions. +- Added new extension system. + +--- +### GLM 0.8.2.3 final - 2009-04-01 +- Fixed bugs. + +--- +### GLM 0.8.2.2 final - 2009-02-24 +- Fixed bugs. + +--- +### GLM 0.8.2.1 final - 2009-02-13 +- Fixed bugs. + +--- +### GLM 0.8.2 final - 2009-01-21 +- Fixed bugs. + +--- +### GLM 0.8.1 final - 2008-10-30 +- Fixed bugs. + +--- +### GLM 0.8.0 final - 2008-10-23 +- New method to use extension. + +--- +### GLM 0.8.0 beta3 - 2008-10-10 +- Added CMake support for GLM tests. + +--- +### GLM 0.8.0 beta2 - 2008-10-04 +- Improved half scalars and vectors support. + +--- +### GLM 0.8.0 beta1 - 2008-09-26 +- Improved GLSL conformance +- Added GLSL 1.30 support +- Improved API documentation + +--- +### GLM 0.7.6 final - 2008-08-08 +- Improved C++ standard comformance +- Added Static assert for types checking + +--- +### GLM 0.7.5 final - 2008-07-05 +- Added build message system with Visual Studio +- Pedantic build with GCC + +--- +### GLM 0.7.4 final - 2008-06-01 +- Added external dependencies system. + +--- +### GLM 0.7.3 final - 2008-05-24 +- Fixed bugs +- Added new extension group + +--- +### GLM 0.7.2 final - 2008-04-27 +- Updated documentation +- Added preprocessor options + +--- +### GLM 0.7.1 final - 2008-03-24 +- Disabled half on GCC +- Fixed extensions + +--- +### GLM 0.7.0 final - 2008-03-22 +- Changed to MIT license +- Added new documentation + +--- +### GLM 0.6.4 - 2007-12-10 +- Fixed swizzle operators + +--- +### GLM 0.6.3 - 2007-11-05 +- Fixed type data accesses +- Fixed 3DSMax sdk conflict + +--- +### GLM 0.6.2 - 2007-10-08 +- Fixed extension + +--- +### GLM 0.6.1 - 2007-10-07 +- Fixed a namespace error +- Added extensions + +--- +### GLM 0.6.0 : 2007-09-16 +- Added new extension namespace mecanium +- Added Automatic compiler detection + +--- +### GLM 0.5.1 - 2007-02-19 +- Fixed swizzle operators + +--- +### GLM 0.5.0 - 2007-01-06 +- Upgrated to GLSL 1.2 +- Added swizzle operators +- Added setup settings + +--- +### GLM 0.4.1 - 2006-05-22 +- Added OpenGL examples + +--- +### GLM 0.4.0 - 2006-05-17 +- Added missing operators to vec* and mat* +- Added first GLSL 1.2 features +- Fixed windows.h before glm.h when windows.h required + +--- +### GLM 0.3.2 - 2006-04-21 +- Fixed texcoord components access. +- Fixed mat4 and imat4 division operators. + +--- +### GLM 0.3.1 - 2006-03-28 +- Added GCC 4.0 support under MacOS X. +- Added GCC 4.0 and 4.1 support under Linux. +- Added code optimisations. + +--- +### GLM 0.3 - 2006-02-19 +- Improved GLSL type conversion and construction compliance. +- Added experimental extensions. +- Added Doxygen Documentation. +- Added code optimisations. +- Fixed bugs. + +--- +### GLM 0.2 - 2005-05-05 +- Improve adaptative from GLSL. +- Add experimental extensions based on OpenGL extension process. +- Fixe bugs. + +--- +### GLM 0.1 - 2005-02-21 +- Add vec2, vec3, vec4 GLSL types +- Add ivec2, ivec3, ivec4 GLSL types +- Add bvec2, bvec3, bvec4 GLSL types +- Add mat2, mat3, mat4 GLSL types +- Add almost all functions + diff --git a/include/glm/util/autoexp.txt b/include/glm/util/autoexp.txt new file mode 100644 index 00000000..5a07bed5 --- /dev/null +++ b/include/glm/util/autoexp.txt @@ -0,0 +1,28 @@ +[Visualizer] + +glm::detail::tvec2<*>{ + preview ( + #(#($c.x,$c.y)) + ) + children ( + #([x]: $c.x,[y]: $c.y) + ) +} + +glm::detail::tvec3<*>{ + preview ( + #($e.x,$e.y,$e.z) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z) + ) +} + +glm::detail::tvec4<*>{ + preview ( + #($c.x,$c.y,$c.z,$c.w) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) + ) +} diff --git a/include/glm/util/autoexp.vc2010.dat b/include/glm/util/autoexp.vc2010.dat new file mode 100644 index 00000000..e28d31df --- /dev/null +++ b/include/glm/util/autoexp.vc2010.dat @@ -0,0 +1,3896 @@ +; AutoExp.Dat - templates for automatically expanding data +; Copyright(c) Microsoft Corporation. All Rights Reserved. +;--------------------------------------------------------------- +; +; While debugging, Data Tips and items in the Watch and Variable +; windows are automatically expanded to show their most important +; elements. The expansion follows the format given by the rules +; in this file. You can add rules for your types or change the +; predefined rules. +; +; For good examples, read the rules in this file. +; +; To find what the debugger considers the type of a variable to +; be, add it to the Watch window and look at the Type column. +; +; An AutoExpand rule is a line with the name of a type, an equals +; sign, and text with replaceable parts in angle brackets. The +; part in angle brackets names a member of the type and an +; optional Watch format specifier. +; +; AutoExpand rules use the following syntax. The equals sign (=), +; angle brackets (<>), and comma are taken literally. Square +; brackets ([]) indicate optional items. +; +; type=[text]... +; +; type Name of the type (may be followed by <*> for template +; types such as the ATL types listed below). +; +; text Any text.Usually the name of the member to display, +; or a shorthand name for the member. +; +; member Name of a member to display. +; +; format Watch format specifier. One of the following: +; +; Letter Description Sample Display +; ------ -------------------------- ------------ ------------- +; d,i Signed decimal integer 0xF000F065,d -268373915 +; u Unsigned decimal integer 0x0065,u 101 +; o Unsigned octal integer 0xF065,o 0170145 +; x,X Hexadecimal integer 61541,X 0X0000F065 +; l,h long or short prefix for 00406042,hx 0x0c22 +; d, i, u, o, x, X +; f Signed floating-point 3./2.,f 1.500000 +; e Signed scientific-notation 3./2.,e 1.500000e+000 +; g Shorter of e and f 3./2.,g 1.5 +; c Single character 0x0065,c 'e' +; s Zero-terminated string pVar,s "Hello world" +; su Unicode string pVar,su "Hello world" +; +; For details of other format specifiers see Help under: +; "format specifiers/watch variable" +; +; The special format <,t> specifies the name of the most-derived +; type of the object. This is especially useful with pointers or +; references to a base class. +; +; If there is no rule for a class, the base classes are checked for +; a matching rule. +; +; There are some special entries allowed in the AutoExpand section: +; $BUILTIN is used to display more complex types that need to do more +; than just show a member variable or two. +; $ADDIN allows external DLLs to be added to display even more complex +; types via the EE Add-in API. The first argument is the DLL name, the +; second argument is the name of the export from the DLL to use. For +; further information on this API see the sample called EEAddIn. +; +; WARNING: if hexadecimal mode is on in the watch window, all numbers here are +; evaluated in hex, e.g. 42 becomes 0x42 + +[AutoExpand] + +; from windef.h +tagPOINT =x= y= +tagRECT =top= bottom= left= right= + +; from winuser.h +tagMSG =msg= wp= lp= + +; intrinsics +__m64 = +__m128=$BUILTIN(M128) +__m128i=$BUILTIN(M128I) +__m128d=$BUILTIN(M128D) + +; from afxwin.h +CDC =hDC= attrib= +CPaintDC =<,t> hWnd= +CPoint =x= y= +CRect =top= bottom= left= right= +CSize =cx= cy= +CWnd =<,t> hWnd= +CWinApp =<,t> +CWinThread =<,t> h= proc= + +; from afxcoll.h +CPtrList =cnt= + +; from afxstat_.h +CProcessLocalObject =<,t> +CThreadLocalObject =<,t> + +; from afx.h +CArchiveException =cause= +CFile =hFile= name= +CFileException =cause= OS Error=m_lOsError +CMemFile =pos= size= +CObject =<,t> +CRuntimeClass = +CStdioFile =FILE*= name= +CTimeSpan =time= +CTime =time= + +; from afxcoll.h +CByteArray =count= +CStringList =count= +; same for all CXXXArray classes +; same for CXXXList +; same for CMapXXToXX + +; various string classes from MFC & ATL + +_com_error= +_bstr_t=m_wstr,su> (m_RefCount,u>) +_com_ptr_t<*>= +_LARGE_INTEGER= +_ULARGE_INTEGER= +ATL::CComPtr<*>=

    + +ATL::CComQIPtr<*>=

    + +tagVARIANT=$BUILTIN(VARIANT) +VARIANT=$BUILTIN(VARIANT) +_GUID=$BUILTIN(GUID) + +; see EEAddIn sample for how to use these +;_SYSTEMTIME=$ADDIN(EEAddIn.dll,AddIn_SystemTime) +;_FILETIME=$ADDIN(EEAddIn.dll,AddIn_FileTime) + +[Visualizer] +; This section contains visualizers for STL and ATL containers +; DO NOT MODIFY +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,s]) + stringview ([$e.m_pszData,sb]) +} +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT|ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,su]) + stringview ([$e.m_pszData,sub]) +} +ATL::CComBSTR{ + preview ([$e.m_str,su]) + stringview ([$e.m_str,sub]) +} + + +; Many visualizers use nested #()s. +; Why not use #(foo, bar) instead of #(#(foo), #(bar))? +; The former alphabetically sorts its fields, while the latter does not. + +;------------------------------------------------------------------------------ +; std::pair from +;------------------------------------------------------------------------------ +std::pair<*>{ + ; pair is previewed with "(, )". + preview ( + #( + "(", + $e.first, + ", ", + $e.second, + ")" + ) + ) + + ; We gloss over the fact that first and second are actually stored in _Pair_base. + children ( + #( + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::plus, etc. from +;------------------------------------------------------------------------------ +; STL functors are previewed with their names. +; They have no state, so they have no children. +std::plus<*>{ + preview ( "plus" ) + children ( #array(expr: 0, size: 0) ) +} +std::minus<*>{ + preview ( "minus" ) + children ( #array(expr: 0, size: 0) ) +} +std::multiplies<*>{ + preview ( "multiplies" ) + children ( #array(expr: 0, size: 0) ) +} +std::divides<*>{ + preview ( "divides" ) + children ( #array(expr: 0, size: 0) ) +} +std::modulus<*>{ + preview ( "modulus" ) + children ( #array(expr: 0, size: 0) ) +} +std::negate<*>{ + preview ( "negate" ) + children ( #array(expr: 0, size: 0) ) +} +std::equal_to<*>{ + preview ( "equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::not_equal_to<*>{ + preview ( "not_equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater<*>{ + preview ( "greater" ) + children ( #array(expr: 0, size: 0) ) +} +std::less<*>{ + preview ( "less" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater_equal<*>{ + preview ( "greater_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::less_equal<*>{ + preview ( "less_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_and<*>{ + preview ( "logical_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_or<*>{ + preview ( "logical_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_not<*>{ + preview ( "logical_not" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::not1() from +; std::not2() from +;------------------------------------------------------------------------------ +; STL negators are previewed with "not[12]()". +; They have a child with the fake name of [pred], so that the +; stored functor can be inspected. +std::unary_negate<*>{ + preview ( + #( + "not1(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} +std::binary_negate<*>{ + preview ( + #( + "not2(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} + +;------------------------------------------------------------------------------ +; std::bind1st() from +; std::bind2nd() from +;------------------------------------------------------------------------------ +; STL binders are previewed with "bind1st(, )" or "bind2nd(, )". +; We gloss over the fact that they derive from unary_function. +std::binder1st<*>{ + preview ( + #( + "bind1st(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} +std::binder2nd<*>{ + preview ( + #( + "bind2nd(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::ptr_fun() from +;------------------------------------------------------------------------------ +; STL function pointer adaptors are previewed with "ptr_fun()". +; Function pointers have no children, so the adaptors have no children. +std::pointer_to_unary_function<*>|std::pointer_to_binary_function<*>{ + preview ( + #( + "ptr_fun(", + $e._Pfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::mem_fun() from +; std::mem_fun_ref() from +;------------------------------------------------------------------------------ +; See ptr_fun(). +std::mem_fun_t<*>|std::mem_fun1_t<*>|std::const_mem_fun_t<*>|std::const_mem_fun1_t<*>{ + preview ( + #( + "mem_fun(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} +std::mem_fun_ref_t<*>|std::mem_fun1_ref_t<*>|std::const_mem_fun_ref_t<*>|std::const_mem_fun1_ref_t<*>{ + preview ( + #( + "mem_fun_ref(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::auto_ptr from +;------------------------------------------------------------------------------ +std::auto_ptr<*>{ + ; An empty auto_ptr is previewed with "empty". + ; Otherwise, it is previewed with "auto_ptr ". + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "auto_ptr ", + *$e._Myptr + ) + ) + ) + + ; An empty auto_ptr has no children. + ; Otherwise, it has a single child, its stored pointer, with a fake name of [ptr]. + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::basic_string from +;------------------------------------------------------------------------------ +; basic_string is previewed with its stored string. +; It has [size] and [capacity] children, followed by [0], [1], [2], etc. children +; displaying its stored characters. +; The ($e._Myres) < ($e._BUF_SIZE) test determines whether the Small String Optimization +; is in effect. +; NOTE: The parentheses in ($e._Myres) < ($e._BUF_SIZE) are necessary. +std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s] ) #else ( [$e._Bx._Ptr,s] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sb] ) #else ( [$e._Bx._Ptr,sb] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::basic_string|std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,su] ) #else ( [$e._Bx._Ptr,su] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sub] ) #else ( [$e._Bx._Ptr,sub] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,s] ) + stringview ( [$e._Ptr,sb] ) + children ( #([ptr] : $e._Ptr) ) +} +std::_String_iterator|std::_String_const_iterator|std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,su] ) + stringview ( [$e._Ptr,sub] ) + children ( #([ptr] : $e._Ptr) ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; Despite its packed representation, vector is visualized like vector. +std::vector{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : ($e._Myvec._Myend - $e._Myvec._Myfirst) * _VBITS), + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ) + ) + ) +} +std::_Vb_reference<*>|std::_Vb_iterator<*>|std::_Vb_const_iterator<*>{ + preview ( + (bool)((*$e._Myptr >> $e._Myoff) & 1) + ) + + children ( + #( + #([ptr] : $e._Myptr), + #([offset] : $e._Myoff) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; vector is previewed with "[]()". +; It has [size] and [capacity] children, followed by its elements. +; The other containers follow its example. +std::vector<*>{ + preview ( + #( + "[", + $e._Mylast - $e._Myfirst, + "](", + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mylast - $e._Myfirst), + #([capacity] : $e._Myend - $e._Myfirst), + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ) + ) + ) +} +std::_Vector_iterator<*>|std::_Vector_const_iterator<*>{ + preview ( + *$e._Ptr + ) + + children ( + #([ptr] : $e._Ptr) + ) +} + +;------------------------------------------------------------------------------ +; std::deque from +;------------------------------------------------------------------------------ +std::deque<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ) + ) + ) +} +std::_Deque_iterator<*,*>|std::_Deque_const_iterator<*,*>{ + preview ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] + ) + ) + + children ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + #array(expr: 0, size: 0) + ) #else ( + #( + #([index] : $e._Myoff - ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff), + #([ptr] : &((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] ) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::list from +;------------------------------------------------------------------------------ +std::list<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval + ) +} +std::_List_iterator<*>|std::_List_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::queue from +; std::stack from +;------------------------------------------------------------------------------ +std::queue<*>|std::stack<*>{ + preview ( $e.c ) + children ( #(c : $e.c) ) +} + +;------------------------------------------------------------------------------ +; std::priority_queue from +;------------------------------------------------------------------------------ +std::priority_queue<*>{ + preview ( $e.c ) + + children ( + #( + #(c [heap]: $e.c), + #(comp : $e.comp) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::map from +; std::multimap from +; std::set from +; std::multiset from +;------------------------------------------------------------------------------ +std::map<*>|std::multimap<*>|std::set<*>|std::multiset<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([comp] : $e.comp), + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval + ) + ) +} +std::_Tree_iterator<*>|std::_Tree_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::bitset from +;------------------------------------------------------------------------------ +std::bitset<*>{ + preview ( + #( + "[", + $e._EEN_BITS, + "](", + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ), + ")" + ) + ) + + children ( + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ) + ) +} +std::bitset<*>::reference{ + preview ( + [($e._Pbitset->_Array[$i / $e._Pbitset->_Bitsperword] >> ($e._Mypos % $e._Pbitset->_Bitsperword)) & 1,d] + ) + + children ( + #( + #([bitset] : $e._Pbitset), + #([pos] : $e._Mypos) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::reverse_iterator from +;------------------------------------------------------------------------------ +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff != 0) ( + (bool)((*$e.current._Myptr >> ($e.current._Myoff - 1)) & 1) + ) #else ( + (bool)(($e.current._Myptr[-1] >> (_VBITS - 1)) & 1) + ) + ) + ) + + children ( + #if ($e.current._Myoff != 0) ( + #( + #([to ptr] : $e.current._Myptr), + #([to offset] : $e.current._Myoff - 1), + #(current : $e.current) + ) + ) #else ( + #( + #([to ptr] : $e.current._Myptr - 1), + #([to offset] : _VBITS - 1), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] + ) + ) + ) + + children ( + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + #(current : $e.current) + ) #else ( + #( + #([to index] : ($e.current._Myoff - 1) - ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff), + #([to ptr] : &((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] ), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr->_Prev->_Myval + ) + ) + + children ( + #( + #([to] : &$e.current._Ptr->_Prev->_Myval), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._EEN_IDL == 0) ( + $e.current._Ptr[-1] + ) #else ( + #if ($e.current._Idx == 0) ( + "end" + ) #else ( + $e.current._Ptr[$e.current._Idx - 1] + ) + ) + ) + ) + + children ( + #if ($e.current._EEN_IDL == 0) ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) #else ( + #if ($e.current._Idx == 0) ( + #(current : $e.current) + ) #else ( + #( + #([to] : $e.current._Ptr + $e.current._Idx - 1), + #(current : $e.current) + ) + ) + ) + ) +} +std::reverse_iterator<*>{ + preview ( + #( + "reverse_iterator current ", + $e.current + ) + ) + + children ( + #(current : $e.current) + ) +} + +;------------------------------------------------------------------------------ +; std::complex from +;------------------------------------------------------------------------------ +std::complex<*>{ + preview ( + #if ($e._Val[1] == 0) ( + ; Purely real. + $e._Val[0] + ) #else ( + #if ($e._Val[0] == 0) ( + ; Purely imaginary. + #if ($e._Val[1] < 0) ( + #("-i*", -$e._Val[1]) + ) #else ( + #("i*", $e._Val[1]) + ) + ) #else ( + ; Mixed. + #if ($e._Val[1] < 0) ( + #($e._Val[0], "-i*", -$e._Val[1]) + ) #else ( + #($e._Val[0], "+i*", $e._Val[1]) + ) + ) + ) + ) + + children ( + #( + #(real : $e._Val[0]), + #(imag : $e._Val[1]) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::valarray from +;------------------------------------------------------------------------------ +std::valarray<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::reference_wrapper from +;------------------------------------------------------------------------------ +std::tr1::reference_wrapper<*>{ + preview ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; For ordinary T, reference_wrapper stores a T * _Callee._Ptr + ; which is non-null. Actual references are previewed with what they + ; refer to, so reference_wrapper is previewed with dereferencing its + ; stored pointer. + *$e._Callee._Ptr + ) #else ( + ; When T is a pointer to data member type, reference_wrapper + ; stores a T _Callee._Object directly. + $e._Callee._Object + ) + ) + + children ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; Actual references have the same children as what they refer to. + ; Unfortunately, there appears to be no way to imitate this exactly. + ; Therefore, we make reference_wrapper appear to have a single + ; child, its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Callee._Ptr) + ) #else ( + ; When T is a pointer to data member type, T has no children, + ; so we make reference_wrapper appear to have no children. + #array(expr: 0, size: 0) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::shared_ptr from +;------------------------------------------------------------------------------ +std::tr1::_Ref_count<*>{ + preview ( "default" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_del<*>{ + preview ( "custom deleter" ) + children ( #([deleter] : $e._Dtor) ) +} +std::tr1::_Ref_count_del_alloc<*>{ + preview ( "custom deleter, custom allocator" ) + children ( + #( + #([deleter] : $e._Dtor), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::_Ref_count_obj<*>{ + preview ( "make_shared" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_obj_alloc<*>{ + preview ( "allocate_shared" ) + children ( #([allocator] : $e._Myal) ) +} +std::tr1::shared_ptr<*>{ + preview ( + ; shared_ptr stores a T * _Ptr . + #if ($e._Ptr == 0) ( + ; A default-constructed shared_ptr has a null _Ptr and a null _Rep, + ; and is formally said to be empty. + ; A shared_ptr constructed from a null pointer has a null _Ptr + ; and a NON-null _Rep . It is formally said to own the null pointer. + ; We preview both with "empty". + "empty" + ) #else ( + ; Raw pointers are previewed with " ". + ; auto_ptr is previewed with "auto_ptr ". + ; Following these examples, shared_ptr is previewed with + ; "shared_ptr [N strong refs, M weak refs]". + #( + "shared_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ; Note: _Rep->_Uses counts how many shared_ptrs share ownership of the object, + ; so we directly display it as the strong reference count. + ; _Rep->_Weaks counts how many shared_ptrs and weak_ptrs share ownership of + ; the "representation object" (or "control block"). All of the shared_ptrs are + ; counted as a single owner. That is, _Weaks is initialized to 1, and when + ; _Uses falls to 0, _Weaks is decremented. This avoids incrementing and decrementing + ; _Weaks every time that a shared_ptr gains or loses ownership. Therefore, + ; _Weaks - 1 is the weak reference count, the number of weak_ptrs that are observing + ; the shared object. + ) + ) + + children ( + #if ($e._Ptr == 0) ( + ; We make empty shared_ptrs (and shared_ptrs that own + ; the null pointer) appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #( + ; We make shared_ptr appear to have two children: + + ; Its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Ptr), + + ; Its deleter and allocator, which may be default or custom. + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::weak_ptr from +;------------------------------------------------------------------------------ +std::tr1::weak_ptr<*>{ + preview ( + #if ($e._Ptr == 0) ( + "empty" + ) #elif ($e._Rep->_Uses == 0) ( + ; weak_ptr is just like shared_ptr, except that a weak_ptr can be expired. + #( + "expired [", + *$e._Rep, + "]" + ) + ) #else ( + #( + "weak_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #elif ($e._Rep->_Uses == 0) ( + ; When a weak_ptr is expired, we show its deleter and allocator. + ; The deleter has already been used, but the control block has not yet been deallocated. + #([deleter and allocator] : *$e._Rep) + ) #else ( + #( + #([ptr] : $e._Ptr), + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::mem_fn() from +;------------------------------------------------------------------------------ +; Note that when mem_fn() is given a data member pointer, it returns a _Call_wrapper<_Callable_pmd<*> > . +; Data member pointers themselves don't have useful previews, so we don't attempt to visualize this. +; When mem_fn() is given a member function pointer, it returns a _Mem_fn[N], which we can visualize. +std::tr1::_Mem_fn1<*>|std::tr1::_Mem_fn2<*>|std::tr1::_Mem_fn3<*>|std::tr1::_Mem_fn4<*>|std::tr1::_Mem_fn5<*>|std::tr1::_Mem_fn6<*>|std::tr1::_Mem_fn7<*>|std::tr1::_Mem_fn8<*>|std::tr1::_Mem_fn9<*>|std::tr1::_Mem_fn10<*>{ + preview ( + ; We preview the functor returned by mem_fn() with "mem_fn()". + #( + "mem_fn(", + $e._Callee._Object, + ")" + ) + ) + + children ( + ; Member function pointers have no children. + #array(expr: 0, size: 0) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::bind() from +;------------------------------------------------------------------------------ +; bind() placeholders are previewed with their names. +; They have no state, so they have no children. +std::tr1::_Ph<1>{ + preview ( "_1" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<2>{ + preview ( "_2" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<3>{ + preview ( "_3" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<4>{ + preview ( "_4" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<5>{ + preview ( "_5" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<6>{ + preview ( "_6" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<7>{ + preview ( "_7" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<8>{ + preview ( "_8" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<9>{ + preview ( "_9" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<10>{ + preview ( "_10" ) + children ( #array(expr: 0, size: 0) ) +} + +; The functor returned by bind(f, t1, t2) is previewed with "bind(f, t1, t2)". +; It has children with the fake names of [f], [t1], [t2], etc. +std::tr1::_Bind<*,*,std::tr1::_Bind0<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind0<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind1<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind1<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind2<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind2<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind3<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind3<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind4<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind4<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind5<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind5<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind6<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind6<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind7<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind7<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind8<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind8<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind9<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind9<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind10<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind10<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ", ", $e._Bx._Vx9, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8), + #([t10] : $e._Bx._Vx9) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::function from +;------------------------------------------------------------------------------ +std::tr1::_Impl_no_alloc0<*>|std::tr1::_Impl_no_alloc1<*>|std::tr1::_Impl_no_alloc2<*>|std::tr1::_Impl_no_alloc3<*>|std::tr1::_Impl_no_alloc4<*>|std::tr1::_Impl_no_alloc5<*>|std::tr1::_Impl_no_alloc6<*>|std::tr1::_Impl_no_alloc7<*>|std::tr1::_Impl_no_alloc8<*>|std::tr1::_Impl_no_alloc9<*>|std::tr1::_Impl_no_alloc10<*>{ + preview ( $e._Callee._Object ) + children ( #([functor] : $e._Callee._Object) ) +} +std::tr1::_Impl0<*>|std::tr1::_Impl1<*>|std::tr1::_Impl2<*>|std::tr1::_Impl3<*>|std::tr1::_Impl4<*>|std::tr1::_Impl5<*>|std::tr1::_Impl6<*>|std::tr1::_Impl7<*>|std::tr1::_Impl8<*>|std::tr1::_Impl9<*>|std::tr1::_Impl10<*>{ + preview ( $e._Callee._Object ) + children ( + #( + #([functor] : $e._Callee._Object), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::function<*>{ + preview ( + #if ($e._Impl == 0) ( + ; Detecting empty functions is trivial. + "empty" + ) #else ( + *$e._Impl + ) + ) + + children ( + #if ($e._Impl == 0) ( + ; We make empty functions appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #([functor and allocator] : *$e._Impl) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::tuple from +;------------------------------------------------------------------------------ +; tuple is visualized like pair, except that we have to give fake names to tuple's children. +std::tr1::tuple{ + preview ( + "()" + ) + + children ( + #array(expr: 0, size: 0) + ) +} +std::tr1::tuple<*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value + ) + ) +} +std::tr1::tuple<*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,*>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [9] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::array from +;------------------------------------------------------------------------------ +std::tr1::array<*>{ + preview ( + ; An actual array is previewed with its address. + ; array is previewed like vector. + #( + "[", + $e._EEN_SIZE, + "](", + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE), + ")" + ) + ) + + children ( + ; Just like an actual array. + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE) + ) +} +std::_Array_iterator<*>|std::_Array_const_iterator<*>{ + preview ( + #if ($e._EEN_IDL == 0) ( + *$e._Ptr + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; array iterators are represented by _Ptr + _Idx, + ; and they know how large their parent arrays are. Therefore, detecting + ; end iterators is trivial. + "end" + ) #else ( + ; Like vector iterators, array iterators are previewed with what they point to. + $e._Ptr[$e._Idx] + ) + ) + ) + + children ( + #if ($e._EEN_IDL == 0) ( + #([ptr] : $e._Ptr) + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; We make end iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; An array iterator is conceptually a pointer, so we make it appear to store one. + #([ptr] : $e._Ptr + $e._Idx) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; stdext::hash_map from +; stdext::hash_multimap from +; stdext::hash_set from +; stdext::hash_multiset from +;------------------------------------------------------------------------------ +stdext::hash_map<*>|stdext::hash_multimap<*>|stdext::hash_set<*>|stdext::hash_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::unordered_map from +; std::tr1::unordered_multimap from +; std::tr1::unordered_set from +; std::tr1::unordered_multiset from +;------------------------------------------------------------------------------ +std::hash<*>{ + preview ( "hash" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::unordered_map<*>|std::tr1::unordered_multimap<*>|std::tr1::unordered_set<*>|std::tr1::unordered_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([hash] : $e.comp._Hashobj), + #([equal] : $e.comp._Keyeqobj), + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::basic_regex from +;------------------------------------------------------------------------------ +std::tr1::basic_regex<*>{ + preview ( + #if ($e._Rep == 0) ( + ; Default construction creates an empty basic_regex. + "empty" + ) #elif ($e._EEN_VIS == 1) ( + ; By default, _ENHANCED_REGEX_VISUALIZER is defined to be 1 in debug and 0 in ship. + ; When it is 1, basic_regex stores the string from which it was constructed. + ; When it is 0, basic_regex stores only the resulting finite state machine. + $e._Visualization + ) #else ( + ; basic_regex contains many static const flags, which would be shown in the preview by default. + ; Its actual members are _Rep and _Traits. _Rep holds the finite state machine, so we + ; use it to preview basic_regex. (It does contain some human-readable information.) + *$e._Rep + ) + ) + + children ( + #if ($e._Rep == 0) ( + ; We make empty basic_regexes appear to have no children. + #array(expr: 0, size: 0) + ) #elif ($e._EEN_VIS == 1) ( + ; We want to hide those static const flags. + ; We also want to give _Visualization a fake name. + #( + #([str] : $e._Visualization), + #(_Rep : $e._Rep), + #(_Traits : $e._Traits) + ) + ) #else ( + ; We want to hide those static const flags. + #( + _Rep : $e._Rep, + _Traits : $e._Traits + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::sub_match from +;------------------------------------------------------------------------------ +std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match{ + preview ( + ; It would be nice if we could preview sub_match with its str(). + ; However, visualizers cannot handle strings represented by pointer pairs. + ; Therefore, our preview contains more limited information. + #if ($e.matched) ( + ; If this sub_match participated in a match, + ; we preview it with its length(). + $e.second - $e.first + ) #else ( + ; Otherwise, we preview it with its matched bool (i.e. "false"). + ; (Why not length() (i.e. "0")? It's meaningful to have + ; matched == true and length() == 0. + "false" + ) + ) + + children ( + #( + ; sub_match's three data members are public, but we list them here + ; (a) to display matched before first and second, and + ; (b) to gloss over the fact that sub_match derives from std::pair. + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} +std::tr1::sub_match >|std::tr1::sub_match >{ + preview ( + #if ($e.matched) ( + ; We visualize ssub_match and wssub_match just like csub_match and wcsub_match, + ; except that when determining the length(), we can't subtract iterators. + ; We have to subtract their stored pointers. + $e.second._Ptr - $e.first._Ptr + ) #else ( + "false" + ) + ) + + children ( + #( + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::match_results from +;------------------------------------------------------------------------------ +std::tr1::match_results<*>{ + preview ( + ; A match_results object is empty iff its vector _Matches is empty. + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + "empty" + ) #else ( + ; We preview a non-empty match_results object with its vector. + $e._Matches + ) + ) + + children ( + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + ; We make empty match_results appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; As match_results has operator[](), prefix(), and suffix() member functions, + ; we make it appear to directly contain [0], [1], [2], etc. elements, + ; as well as [prefix] and [suffix] elements. + #( + #array(expr: $e._Matches._Myfirst[$i], size: $e._Matches._Mylast - $e._Matches._Myfirst), + #([prefix] : $e._Prefix), + #([suffix] : $e._Suffix) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_iterator<*>{ + preview ( + #if ($e._MyRe == 0) ( + ; We represent end-of-sequence regex_iterators with null regex pointers. + "end" + ) #else ( + ; Dereferenceable regex_iterators return match_results when dereferenced, + ; so we'll preview them with that. + $e._MyVal + ) + ) + + children ( + #if ($e._MyRe == 0) ( + ; We make end-of-sequence regex_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([begin] : $e._Begin), + #([end] : $e._End), + #([pregex] : $e._MyRe), + #([flags] : $e._Flags), + #([match] : $e._MyVal) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_token_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_token_iterator<*>{ + preview ( + #if ($e._Res == 0) ( + ; We represent end-of-sequence regex_token_iterators with null result pointers. + "end" + ) #else ( + ; Dereferenceable regex_token_iterators return *result when dereferenced, + ; so we'll preview them with that. + *$e._Res + ) + ) + + children ( + #if ($e._Res == 0) ( + ; We make end-of-sequence regex_token_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_token_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([position] : $e._Pos), + #([result] : $e._Res), + #([suffix] : $e._Suffix), + #([N] : $e._Cur), + #([subs] : $e._Subs) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::identity, etc. from +;------------------------------------------------------------------------------ +std::identity<*>{ + preview ( "identity" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_and<*>{ + preview ( "bit_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_or<*>{ + preview ( "bit_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_xor<*>{ + preview ( "bit_xor" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::unique_ptr from +;------------------------------------------------------------------------------ +std::unique_ptr<*>{ + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "unique_ptr ", + *$e._Myptr + ) + ) + ) + + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::forward_list from +;------------------------------------------------------------------------------ +std::forward_list<*>{ + preview ( + #( + "(", + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval + ) +} +std::_Flist_iterator<*>|std::_Flist_const_iterator<*>{ + preview ( + #if ($e._Ptr == 0) ( + "end" + ) #else ( + $e._Ptr->_Myval + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : &$e._Ptr->_Myval) + ) + ) +} + + +;------------------------------------------------------------------------------ +; PROPVARIANT +;------------------------------------------------------------------------------ +; Visualizers for VT_VECTOR C arrays +tagCAC|tagCAUB|tagCAI|tagCAUI|tagCAL|tagCAUL|tagCAFLT|tagCADBL|tagCACY|tagCADATE|tagCABSTR|tagCABSTRBLOB|tagCABOOL|tagCASCODE|tagCAPROPVARIANT|tagCAH|tagCAUH|tagCALPSTR|tagCALPWSTR|tagCAFILETIME|tagCACLIPDATA|tagCACLSID{ + preview( + #( + "[", $e.cElems , "](", + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ), + ")" + ) + ) + children + ( + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ) + ) +} +; Visualizers for SAFE ARRAY +tagSAFEARRAY|SAFEARRAY{ + preview( + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + ; Switch on the variant type field - which is stored 4 bytes + ; before the beginning of the SAFEARRAY type + #switch( ((unsigned *)&($e))[-1] ) + #case 0x2 ; VT_I2 | VT_ARRAY + ( + #( + "safearray of I2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x3 ; VT_I4 | VT_ARRAY + ( + #( + "safearray of I4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x4 ; VT_R4 | VT_ARRAY + ( + #( + "safearray of R4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x5 ; VT_R8 | VT_ARRAY + ( + #( + "safearray of R8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x6 ; VT_CY | VT_ARRAY + ( + #( + "safearray of CY = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x7 ; VT_DATE | VT_ARRAY + ( + #( + "safearray of DATE = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x8 ; VT_BSTR | VT_ARRAY + ( + #( + "safearray of BSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xa ; VT_ERROR | VT_ARRAY + ( + #( + "safearray of ERROR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xb ; VT_BOOL | VT_ARRAY + ( + #( + "safearray of BOOL = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xc ; VT_VARIANT | VT_ARRAY + ( + #( + "safearray of VARIANT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x10 ; VT_I1 | VT_ARRAY + ( + #( + "safearray of I1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x11 ; VT_UI1 | VT_ARRAY + ( + #( + "safearray of UI1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x12 ; VT_UI2 | VT_ARRAY + ( + #( + "safearray of UI2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x13 ; VT_UI4 | VT_ARRAY + ( + #( + "safearray of UI4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x14 ; VT_I8 | VT_ARRAY + ( + #( + "safearray of I8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x15 ; VT_UI8 | VT_ARRAY + ( + #( + "safearray of UI8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x16 ; VT_INT | VT_ARRAY + ( + #( + "safearray of INT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x17 ; VT_UINT | VT_ARRAY + ( + #( + "safearray of UINT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1e ; VT_LPSTR | VT_ARRAY + ( + #( + "safearray of LPSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((char **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1f ; VT_LPWSTR | VT_ARRAY + ( + #( + "safearray of LPWSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x40 ; VT_FILETIME | VT_ARRAY + ( + #( + "safearray of FILETIME = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x47 ; VT_CLIPDATA | VT_ARRAY + ( + #( + "safearray of CLIPDATA = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x48 ; VT_CLSID | VT_ARRAY + ( + #( + "safearray of CLSID = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #("safearray of BSTR = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #("safearray of IUnknown* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #("safearray of IDispatch* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #("safearray of VARIANT = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + ) + children + ( + #( ;[actual members]: [$e,!], + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + #switch( ((unsigned *)&($e))[-1] ) ; for some reason the VT field is before the SAFEARRAY struct + #case 2 ; VT_I2|VT_ARRAY + ( + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 3 ; VT_I4|VT_ARRAY + ( + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 4 ; VT_R4|VT_ARRAY + ( + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 5 ; VT_R8|VT_ARRAY + ( + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x10 ; VT_I1|VT_ARRAY + ( + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x11 ; VT_UI1|VT_ARRAY + ( + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x12 ; VT_UI2|VT_ARRAY + ( + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x13 ; VT_UI4|VT_ARRAY + ( + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x14 ; VT_I8|VT_ARRAY + ( + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x15 ; VT_UI8|VT_ARRAY + ( + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1e ; VT_LPSTR|VT_ARRAY + ( + #array( + expr: ((char * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1f ; VT_LPWSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xc ; VT_VARIANT|VT_ARRAY + ( + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xb ; VT_BOOL|VT_ARRAY + ( + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xa ; VT_ERROR|VT_ARRAY + ( + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 6 ; VT_CY|VT_ARRAY + ( + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 7 ; VT_DATE|VT_ARRAY + ( + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x40 ; VT_FILETIME|VT_ARRAY + ( + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x48 ; VT_CLSID|VT_ARRAY + ( + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x47 ; VT_CF|VT_ARRAY + ( + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 8 ; VT_BSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x16 ; VT_INT|VT_ARRAY + ( + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x17 ; VT_UINT|VT_ARRAY + ( + #array( + expr: ((unsigned int*)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #default + ( + #([actual members]: [$e,!]) + ) + #except + ( + #([actual members]: [$e,!]) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + ) + ) +} +tagPROPVARIANT|tagVARIANT|PROPVARIANT|VARIANT{ + preview( + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0 ( #("Empty") ) ; VT_EMPTY + #case 1 ( #("NULL") ) ; VT_NULL + #case 2 ( #("I2 = ", $e.iVal) ) ; VT_I2 + #case 3 ( #("I4 = ", $e.lVal) ) ; VT_I4 + #case 4 ( #("R4 = ", $e.fltVal) ) ; VT_R4 + #case 5 ( #("R8 = ", $e.dblVal) ) ; VT_R8 + #case 6 ( #("CY = ", $e.cyVal) ) ; VT_CY + #case 7 ( #("DATE = ", $e.date) ) ; VT_DATE + #case 8 ( #("BSTR = ", $e.bstrVal) ) ; VT_BSTR + #case 9 ( #("DISPATCH = ", $e.pdispVal) ) ; VT_DISPATCH + #case 10 ( #("ERROR = ", $e.scode) ) ; VT_ERROR + #case 0xB ( #("BOOL = ", $e.boolVal) ) ; VT_BOOL + #case 0xC ( #("VARIANT ") ) ; VT_VARIANT + #case 0xD ( #("UNKNOWN = ", $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #("DECIMAL = ", $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #("I1 = ", $e.cVal) ) ; VT_I1 + #case 0x11 ( #("UI1 = ", $e.bVal) ) ; VT_UI1 + #case 0x12 ( #("UI2 = ", $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #("UI4 = ", $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #("I8 = ", *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #("UI8 = ", *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #("INT = ", $e.intVal) ) ; VT_INT + #case 0x17 ( #("UINT = ", $e.uintVal) ) ; VT_UINT + #case 0x18 ( #("VOID ") ) ; VT_VOID + #case 0x19 ( #("HRESULT ") ) ; VT_HRESULT + #case 0x1A ( #("PTR ") ) ; VT_PTR + #case 0x1B ( #("SAFEARRAY ") ) ; VT_SAFEARRAY + #case 0x1C ( #("CARRAY ") ) ; VT_CARRAY + #case 0x1D ( #("USERDEFINED ") ) ; VT_USERDEFINED + #case 0x1E ( #("LPSTR = ", $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #("LPWSTR = ", $e.pwszVal) ) ; VT_LPWSTR + #case 0x24 ( #("RECORD ") ) ; VT_RECORD + #case 0x26 ( #("UINT_PTR ") ) ; VT_UINT_PTR + #case 0x40 ( #("FILETIME = ", $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #("STREAM = ", $e.pStream) ) ; VT_STREAM + #case 0x43 ( #("STORAGE = ", $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #("STREAMED_OBJECT = ", $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #("STORED_OBJECT = ", $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #("BLOB_OBJECT = ", $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #("CF = ", $e.pclipdata) ) ; VT_CF + #case 0x48 ( #("CLSID = ", $e.puuid) ) ; VT_CLSID + #case 0x49 ( #("VERSIONED_STREAM = ", $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #("vector of I2 = ", $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #("vector of I4 = ", $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #("vector of R4 = ", $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #("vector of R8 = ", $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #("vector of I1 = ", $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #("vector of UI1 = ", $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #("vector of UI2 = ", $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #("vector of UI4 = ", $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #("vector of I8 = ", $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #("vector of UI8 = ", $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #("vector of LPSTR = ", $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #("vector of LPWSTR = ", $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #("vector of VARIANT ", $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #("vector of BOOL = ", $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #("vector of ERROR = ", $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #("vector of CY = ", $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #("vector of DATE = ", $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #("vector of FILETIME = ", $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #("vector of CLSID = ", $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #("vector of CF = ", $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #("vector of BSTR = ", $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #("byref of INT = ", $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #("byref of UINT = ", $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #("byref of I2 = ", $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #("byref of I4 = ", $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #("byref of R4 = ", $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #("byref of R8 = ", $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #("byref of I1 = ", $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #("byref of UI1 = ", $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #("byref of UI2 = ", $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #("byref of UI4 = ", $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #("byref of I8 = ", (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #("byref of UI8 = ", (unsigned __int64*)$e.pudblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #("byref of VARIANT ", $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #("byref of BOOL = ", $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #("byref of ERROR = ", $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #("byref of CY = ", $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #("byref of DATE = ", $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #("byref of BSTR = ", $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #("byref of DECIMAL = ", $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #("byref of UNKNOWN = ", $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #("byref of DISPATCH = ", $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #("byref of ARRAY = ", $e.pparray) ) ; VT_ARRAY|VT_BYREF + #default + ( + #if ($e.vt & 0x2000) ( $e.parray) + #else ( #("Unknown vt type = ", $e.vt)) + ) + ) + children( + #( + vt: $e.vt, + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x2 ( #(I2 : $e.iVal) ) ; VT_I2 + #case 0x3 ( #(I4 : $e.lVal) ) ; VT_I4 + #case 0x4 ( #(R4 : $e.fltVal) ) ; VT_R4 + #case 0x5 ( #(R8 : $e.dblVal) ) ; VT_R8 + #case 0x6 ( #(CY : $e.cyVal) ) ; VT_CY + #case 0x7 ( #(DATE : $e.date) ) ; VT_DATE + #case 0x8 ( #(BSTR : $e.bstrVal) ) ; VT_BSTR + #case 0x9 ( #(DISPATCH : $e.pdispVal) ) ; VT_DISPATCH + #case 0xA ( #(ERROR : $e.scode) ) ; VT_ERROR + #case 0xB ( #(BOOL : $e.boolVal) ) ; VT_BOOL + #case 0xD ( #(UNKNOWN : $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #(DECIMAL : $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #(I1 : $e.cVal) ) ; VT_I1 + #case 0x11 ( #(UI1 : $e.bVal) ) ; VT_UI1 + #case 0x12 ( #(UI2 : $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #(UI4 : $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #(I8 : *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #(UI8 : *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #(INT : $e.intVal) ) ; VT_INT + #case 0x17 ( #(UINT : $e.uintVal) ) ; VT_UINT + #case 0x1E ( #(LPSTR : $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #(LPWSTR : $e.pwszVal) ) ; VT_LPWSTR + #case 0x40 ( #(FILETIME : $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #(STREAM : $e.pStream) ) ; VT_STREAM + #case 0x43 ( #(STORAGE : $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #(STREAMED_OBJECT : $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #(STORED_OBJECT : $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #(BLOB_OBJECT : $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #(CF : $e.pclipdata) ) ; VT_CF + #case 0x48 ( #(CLSID : $e.puuid) ) ; VT_CLSID + #case 0x49 ( #(VERSIONED_STREAM : $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #(vector of I2 : $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #(vector of I4 : $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #(vector of R4 : $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #(vector of R8 : $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #(vector of I1 : $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #(vector of UI1 : $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #(vector of UI2 : $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #(vector of UI4 : $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #(vector of I8 : $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #(vector of UI8 : $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #(vector of LPSTR : $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #(vector of LPWSTR : $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #(vector of VARIANT : $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #(vector of BOOL : $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #(vector of ERROR : $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #(vector of CY : $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #(vector of DATE : $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #(vector of FILETIME : $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #(vector of CLSID : $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #(vector of CF : $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #(vector of BSTR : $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #(byref of INT : $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #(byref of UINT : $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #(byref of I2 : $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #(byref of I4 : $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #(byref of R4 : $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #(byref of R8 : $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #(byref of I1 : $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #(byref of UI1 : $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #(byref of UI2 : $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #(byref of UI4 : $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #(byref of I8 : (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #(byref of UI8 : (unsigned __int64*)$e.pdblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #(byref of VARIANT : $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #(byref of BOOL : $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #(byref of ERROR : $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #(byref of CY : $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #(byref of DATE : $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #(byref of BSTR : $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #(byref of DECIMAL : $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #(byref of UNKNOWN : $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #(byref of DISPATCH : $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #(byref of ARRAY : $e.pparray) ) ; VT_ARRAY|VT_BYREF + + ; the following are either empty or invalid vt values for a variant + ; #case 0 ( #(Empty :) ) ; VT_EMPTY + ; #case 0x1 ( #(NULL :) ) ; VT_NULL + ; #case 0xC ( #(VARIANT :) ) ; VT_VARIANT + ; #case 0x18 ( #(VOID :) ) ; VT_VOID + ; #case 0x19 ( #(HRESULT :) ) ; VT_HRESULT + ; #case 0x1A ( #(PTR :) ) ; VT_PTR + ; #case 0x1B ( #(SAFEARRAY :) ) ; VT_SAFEARRAY + ; #case 0x1C ( #(CARRAY :) ) ; VT_CARRAY + ; #case 0x1D ( #(USERDEFINED :) ) ; VT_USERDEFINED + ; #case 0x24 ( #(RECORD :) ) ; VT_RECORD + ; #case 0x26 ( #(UINT_PTR :) ) ; VT_UINT_PTR + #default + ( + #if ($e.vt & 0x2000 ) + ( #(safearray: $e.parray)) + #else + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + #except + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + ) +} + +; Visualizers for data structures in namespace Concurrency +;------------------------------------------------------------------------------ +; Concurrency::message from +;------------------------------------------------------------------------------ +Concurrency::message<*>{ + preview ( + #( + $e.payload + ) + ) + + children ( + #( + #(payload: $e.payload), + #([msg_id]: $e._M_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multi_link_registry from +;------------------------------------------------------------------------------ +Concurrency::multi_link_registry<*>{ + preview ( + #( + "[", + $e._M_vector._M_index, + "](", + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_vector._M_index), + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Queue from +;------------------------------------------------------------------------------ +Concurrency::details::_Queue<*>{ + preview ( + #( + "[", + $e._M_count, + "](", + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::unbounded_buffer from +;------------------------------------------------------------------------------ +Concurrency::unbounded_buffer<*>{ + preview ( + #( + $e._M_messageBuffer + ) + ) + + children ( + #( + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::overwrite_buffer from +;------------------------------------------------------------------------------ +Concurrency::overwrite_buffer<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(reserved_message: *($e._M_pReservedMessage)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::single_assignment from +;------------------------------------------------------------------------------ +Concurrency::single_assignment<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::call from +;------------------------------------------------------------------------------ +Concurrency::call<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(call_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::transformer from +;------------------------------------------------------------------------------ +Concurrency::transformer<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(transform_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::choice from +;------------------------------------------------------------------------------ +Concurrency::choice<*>{ + preview ( + #( + "[", + #if ($e._M_pSingleAssignment->_M_fIsInitialized) ("initialized") + #else ("not_initialized"), + "] ", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([input_count]: $e._M_pSingleAssignment->_M_connectedSources._M_links._M_vector._M_index), + #(index: $e._M_pSingleAssignment->_M_pMessage->payload), + #(source_tuple: $e._M_sourceTuple), + #(linked_sources: $e._M_pSingleAssignment->_M_connectedSources._M_links), + #(linked_targets: $e._M_pSingleAssignment->_M_connectedTargets), + #(reserving_target: *($e._M_pSingleAssignment->_M_pReservedFor)), + #(Scheduler: *($e._M_pScheduler)), + #(ScheduleGroup: *($e._M_pScheduleGroup)), + #([raw _M_pSourceChoices] : $e._M_pSourceChoices) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_MessageArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_MessageArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_SavedMessageIdArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_SavedMessageIdArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>{ + preview ( + #( + "[", + $e._M_messageArray._M_count - $e._M_messagesRemaining, + "/", + $e._M_messageArray._M_count, + "](", + #array( + expr: *($e._M_connectedSources._M_links._M_vector._M_array[$i]), + size: $e._M_connectedSources._M_links._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_messageArray._M_count - $e._M_messagesRemaining), + #(offer_IDs: $e._M_savedMessageIdArray), + #([input_count]: $e._M_messageArray._M_count), + #(input_values: $e._M_messageArray), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: $e._M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multitype_join from +;------------------------------------------------------------------------------ +Concurrency::multitype_join<*,*>{ + preview ( + #( + "[", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter, + "/", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index, + "]", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter), + #([input_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index), + #(source_tuple: $e._M_sourceTuple), + #(messages: $e._M_pJoinNode->_M_messageBuffer), + #(linked_sources: $e._M_pJoinNode->_M_connectedSources._M_links), + #(linked_target: $e._M_pJoinNode->_M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pJoinNode->_M_pReservedFor)), + #(Scheduler: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduleGroup)), + #([raw _M_pSourceJoins] : $e._M_pSourceJoins) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::timer from +;------------------------------------------------------------------------------ +Concurrency::timer<*>{ + preview ( + #( + $e._M_state + ) + ) + + children ( + #( + #(state: $e._M_state), + #(value: $e._M_value), + #(repeating: $e._M_fRepeating), + #(interval_ms: $e._M_ms), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::SchedulerBase from +; Concurrency::details::ThreadScheduler from +; Concurrency::details::UMSThreadScheduler from +;------------------------------------------------------------------------------ +Concurrency::details::SchedulerBase|Concurrency::details::ThreadScheduler|Concurrency::details::UMSThreadScheduler{ + preview ( + #( + "[", + $e.m_id, + "] ", + #if ($e.m_schedulerKind == 0) ("ThreadScheduler") + #else ("UmsScheduler"), + #if ($e.m_id == $e.s_pDefaultScheduler->m_id) (", default") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(SchedulerPolicy: $e.m_policy), + #(VirtualProcessorCount: $e.m_virtualProcessorCount), + #(ReferenceCount: $e.m_refCount), + #([isDefaultScheduler]: $e.m_id == $e.s_pDefaultScheduler->m_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ScheduleGroupBase from +; Concurrency::details::CacheLocalScheduleGroup from +; Concurrency::details::FairScheduleGroup from +;------------------------------------------------------------------------------ +Concurrency::details::ScheduleGroupBase|Concurrency::details::CacheLocalScheduleGroup|Concurrency::details::FairScheduleGroup{ + preview ( + #( + "[", + $e.m_id, + "]", + #if ($e.m_kind & 4) (" AnonymousScheduleGroup") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(Scheduler: *($e.m_pScheduler)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ContextBase from +; Concurrency::details::InternalContextBase from +; Concurrency::details::ThreadInternalContext from +; Concurrency::details::UMSThreadInternalContext from +;------------------------------------------------------------------------------ +Concurrency::details::ContextBase|Concurrency::details::InternalContextBase|Concurrency::details::ThreadInternalContext|Concurrency::details::UMSThreadInternalContext{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_blockedState == 0) ("not_concrt_blocked") + #elif ($e.m_blockedState == 1) ("concrt_blocked") + #elif ($e.m_blockedState == 2) ("ums_sync_blocked") + #elif ($e.m_blockedState == 4) ("ums_async_blocked") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ExternalContextBase from +;------------------------------------------------------------------------------ +Concurrency::details::ExternalContextBase{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_contextSwitchingFence == 1) ("concrt_blocked") + #else ("not_concrt_blocked") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::SchedulerPolicy from +;------------------------------------------------------------------------------ +Concurrency::SchedulerPolicy{ + preview ( + #( + $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind, + ", Min=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency, + ", Max=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency + ) + ) + + children ( + #( + #(SchedulerKind: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind), + #(MinConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency), + #(MaxConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency), + #(TargetOversubscriptionFactor: $e._M_pPolicyBag->_M_values._M_specificValues._M_targetOversubscriptionFactor), + #(LocalContextCacheSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_localContextCacheSize), + #(ContextStackSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextStackSize), + #(ContextPriority: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextPriority), + #(SchedulingProtocol: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulingProtocol), + #(DynamicProgressFeedback: $e._M_pPolicyBag->_M_values._M_specificValues._M_dynamicProgressFeedback) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::event from +;------------------------------------------------------------------------------ +Concurrency::event{ + preview ( + #( + #if ($e._M_pWaitChain == 1) ("set") + #else ("not_set") + ) + ) + + children ( + #( + #([is_set]: ($e._M_pWaitChain == 1)), + #([has_waiters]: (($e._M_pWaitChain != 0) && ($e._M_pWaitChain != 1))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section from +;------------------------------------------------------------------------------ +Concurrency::critical_section{ + preview ( + #( + #if ($e._M_pHead != 0) ("locked") + #else ("not_locked") + ) + ) + + children ( + #( + #([is_locked]: ($e._M_pHead != 0)), + #(OwningContext: *((Concurrency::Context*)($e._M_activeNode[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section::scoped_lock from +;------------------------------------------------------------------------------ +Concurrency::critical_section::scoped_lock{ + preview ( + #( + $e._M_critical_section + ) + ) + + children ( + #( + CriticalSection: $e._M_critical_section + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock{ + preview ( + #( + #if (($e._M_lockState < 8) && ($e._M_lockState & 2)) ("held_by_writer") + #elif ($e._M_lockState >= 8) ( + #( + "held_by_reader(s) [", + ($e._M_lockState / 8), + "]" + ) + ) + #else ("not_held") + ) + ) + + children ( + #( + #([is_reader_lock_held]: ($e._M_lockState >= 8)), + #([num_reader_lock_holders]: ($e._M_lockState / 8)), + #([is_writer_lock_held]: ($e._M_lockState < 8) && ($e._M_lockState & 2)), + #(OwningWriterContext: *((Concurrency::Context*)($e._M_activeWriter[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock::scoped_lock from +; Concurrency::reader_writer_lock::scoped_lock_read from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock::scoped_lock|Concurrency::reader_writer_lock::scoped_lock_read{ + preview ( + #( + $e._M_reader_writer_lock + ) + ) + + children ( + #( + ReaderWriterLock: $e._M_reader_writer_lock + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_TaskCollectionBase from +;------------------------------------------------------------------------------ +Concurrency::details::_TaskCollectionBase{ + preview ( + #( + #if ((((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_group from +; Concurrency::structured_task_group from +;------------------------------------------------------------------------------ +Concurrency::task_group|Concurrency::structured_task_group{ + preview ( + #( + #if ((((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_task_collection._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_handle from +;------------------------------------------------------------------------------ +Concurrency::task_handle<*>{ + preview ( + #( + $e._M_function + ) + ) + + children ( + #( + #(Function: $e._M_function), + #(RuntimeOwnsLifetime: $e._M_fRuntimeOwnsLifetime), + #(TaskCollection: *($e._M_pTaskCollection)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::combinable from +;------------------------------------------------------------------------------ +Concurrency::combinable<*>{ + preview( + #( + "(", + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + ")" + ) + ) + children( + #( + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + #(InitFunction : $e._M_fnInitialize) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_vector from +;------------------------------------------------------------------------------ +Concurrency::concurrent_vector<*,*>{ + preview( + #( + "[", + $e._My_early_size._M_value, + "](", + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ), + ")" + ) + ) + children( + #( + [size] : $e._My_early_size._M_value, + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Vector_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Vector_iterator,*>{ + preview( + #( + #if (($e._My_index >> 1) == 0) ((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index]) + #else ((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))]) + ) + ) + children( + #( + [ptr]: #if (($e._My_index >> 1) == 0) (&((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index])) + #else (&((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))])) + + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_queue from +;------------------------------------------------------------------------------ +Concurrency::concurrent_queue<*,*>{ + preview + ( + #( + "[", + $e._My_rep->_Tail_counter._M_value - $e._My_rep->_Head_counter._M_value, + "](", + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ), + ")" + ) + ) + children + ( + #( + #([unsafe_size]: $e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value), + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Concurrent_queue_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Concurrent_queue_iterator,*>{ + preview( + #( + *(($T1*)$e._My_item) + ) + ) + children( + #( + [ptr]: (($T1*)$e._My_item) + + ) + ) +} + +; This section lets you define your own errors for the HRESULT display. +; You need to list the error code in unsigned decimal, followed by the message. +; Changes will take effect the next time you redisplay the variable. + +[hresult] +;1234=my custom error code + +[Visualizer] + +glm::detail::tvec2<*>{ + preview ( + #(#($c.x,$c.y)) + ) + children ( + #([x]: $c.x,[y]: $c.y) + ) +} + +glm::detail::tvec3<*>{ + preview ( + #($e.x,$e.y,$e.z) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z) + ) +} + +glm::detail::tvec4<*>{ + preview ( + #($c.x,$c.y,$c.z,$c.w) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) + ) +} diff --git a/include/glm/util/glm.natvis b/include/glm/util/glm.natvis new file mode 100644 index 00000000..7687f8bb --- /dev/null +++ b/include/glm/util/glm.natvis @@ -0,0 +1,65 @@ + + + + + + + + + + + + + {x} + + x + + + + + {x}, {y} + + x + y + + + + + {x}, {y}, {z} + + x + y + z + + + + + {x}, {y}, {z}, {w} + + x + y + z + w + + + + + {x}, {y}, {z}, {w} + + x + y + z + w + + + + + (({real.x}, {real.y}, {real.z}), {real.w}), (({dual.x}, {dual.y}, {dual.z}), {dual.w}) + + real + dual + + + + + diff --git a/include/glm/util/usertype.dat b/include/glm/util/usertype.dat new file mode 100644 index 00000000..cb44de3f --- /dev/null +++ b/include/glm/util/usertype.dat @@ -0,0 +1,407 @@ +attribute +const +uniform +varying +break +continue +do +for +while +if +else +in +out +inout +float +int +void +bool +true +false +discard +return +mat2 +mat3 +mat4 +mat2x2 +mat3x3 +mat4x4 +mat2x3 +mat3x2 +mat2x4 +mat4x2 +mat3x4 +mat4x3 +vec2 +vec3 +vec4 +ivec2 +ivec3 +ivec4 +uvec2 +uvec3 +uvec4 +bvec2 +bvec3 +bvec4 +sampler1D +sampler2D +sampler3D +samplerCube +sampler1DShadow +sampler2DShadow +struct + +asm +class +union +enum +typedef +template +this +packed +goto +switch +default +inline +noinline +volatile +public +static +extern +external +interface +long +short +double +half +fixed +unsigned +input +output +sampler2DRect +sampler3DRect +sampler2DRectShadow +sizeof +cast +namespace +using + +layout +location +smooth +flat +noperspective +centroid +invariant +lowp +mediump +highp +precision +patch +sample +subroutine + +hvec2 +hvec3 +hvec4 +fvec2 +fvec3 +fvec4 +dvec2 +dvec3 +dvec4 + +on + +final +abstract +limited +access +self + +uchar +schar +uint +sint + +int8 +int16 +int32 +int64 + +sint8 +sint16 +sint32 +sint64 + +uint8 +uint16 +uint32 +uint64 + +float16 +float32 +float64 + +quat +hquat +fquat +dquat + +handle +handle8 +handle16 +handle32 +handle64 + +flag +flag8 +flag16 +flag32 +flag64 + +import +export + +hmat2 +hmat3 +hmat4 + +fmat2 +fmat3 +fmat4 + +dmat2 +dmat3 +dmat4 + +hmat2x3 +hmat3x2 +hmat2x4 +hmat4x2 +hmat3x4 +hmat4x3 + +fmat2x3 +fmat3x2 +fmat2x4 +fmat4x2 +fmat3x4 +fmat4x3 + +dmat2x3 +dmat3x2 +dmat2x4 +dmat4x2 +dmat3x4 +dmat4x3 + +null +pi +epsilon +infinite +self + +byte +word +dword +qword + +new_object +new_array +delete_object +delete_array + +int8 +int16 +int32 +int64 + +i8 +i16 +i32 +i64 + +i8vec2 +i8vec3 +i8vec4 + +i16vec2 +i16vec3 +i16vec4 + +i32vec2 +i32vec3 +i32vec4 + +i64vec2 +i64vec3 +i64vec4 + +uint8 +uint16 +uint32 +uint64 + +u8 +u16 +u32 +u64 + +u8vec2 +u8vec3 +u8vec4 + +u16vec2 +u16vec3 +u16vec4 + +u32vec2 +u32vec3 +u32vec4 + +u64vec2 +u64vec3 +u64vec4 + +float16 +float32 +float64 + +f16 +f32 +f64 + +f16vec2 +f16vec3 +f16vec4 + +f32vec2 +f32vec3 +f32vec4 + +f64vec2 +f64vec3 +f64vec4 + +f16mat2 +f16mat3 +f16mat4 + +f16mat2x3 +f16mat2x4 +f16mat3x2 +f16mat3x4 +f16mat4x2 +f16mat4x3 + +f32mat2 +f32mat3 +f32mat4 + +f32mat2x3 +f32mat2x4 +f32mat3x2 +f32mat3x4 +f32mat4x2 +f32mat4x3 + +f64mat2 +f64mat3 +f64mat4 + +f64mat2x3 +f64mat2x4 +f64mat3x2 +f64mat3x4 +f64mat4x2 +f64mat4x3 + +f16quat +f32quat +f64quat + +bool1 +bool2 +bool3 +bool4 + +bool1x1 +bool2x2 +bool3x3 +bool4x4 + +bool2x3 +bool2x4 +bool3x2 +bool3x4 +bool4x2 +bool4x3 + +int1 +int2 +int3 +int4 + +int1x1 +int2x2 +int3x3 +int4x4 + +int2x3 +int2x4 +int3x2 +int3x4 +int4x2 +int4x3 + +half1 +half2 +half3 +half4 + +half2x2 +half3x3 +half4x4 + +half2x3 +half2x4 +half3x2 +half3x4 +half4x2 +half4x3 + +float1 +float2 +float3 +float4 + +float1x1 +float2x2 +float3x3 +float4x4 + +float2x3 +float2x4 +float3x2 +float3x4 +float4x2 +float4x3 + +double1 +double2 +double3 +double4 + +double1x1 +double2x2 +double3x3 +double4x4 + +double2x3 +double2x4 +double3x2 +double3x4 +double4x2 +double4x3 From d4e2004d3ec0005b4de34e00dd3829f494241db1 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 20:17:20 +0200 Subject: [PATCH 161/419] =?UTF-8?q?Lambda=20hooks,=20integrate=20glm=20and?= =?UTF-8?q?=20bobViewHooks=C2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Horion.vcxproj | 4 ++- Horion/Module/Modules/TestModule.cpp | 1 + Horion/Module/Modules/TestModule.h | 2 ++ Memory/Hooks.cpp | 51 ++++++++++++++++++++++++---- Memory/Hooks.h | 6 ++-- 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index cf3252e4..76009d12 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -108,13 +108,15 @@ C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;D:\ProgrammeX\Dxx\Lib\x64;$(ProjectDir)minhook;$(LibraryPath) - D:\ProgrammeX\Dxx\Include;$(IncludePath) + D:\ProgrammeX\Dxx\Include;$(ProjectDir)include\glm;$(IncludePath) C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;$(ProjectDir)minhook;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)include\glm C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;$(ProjectDir)minhook;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)include\glm diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 9dc9e77a..5d54496b 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -3,6 +3,7 @@ #include "../../DrawUtils.h" TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { + registerFloatSetting("float1", &this->float1, 0, -10, 10); } TestModule::~TestModule() { diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 5a833477..1e11b6f4 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -5,6 +5,8 @@ class TestModule : public IModule { int delay = 0; public: + float float1 = 0; + TestModule(); ~TestModule(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index df708564..b5ec4ce1 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -2,6 +2,16 @@ #include "../SDK/Tag.h" +#include + +#include // mat4 +#include //radians + +#include // perspective, translate, rotate +#include +#include +#include + Hooks g_Hooks; bool isTicked = false; bool overrideStyledReturn = false; @@ -278,7 +288,34 @@ void Hooks::Init() { g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); - g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags,Hooks::LevelRendererPlayer__renderNameTags); + g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags, Hooks::LevelRendererPlayer__renderNameTags); + + static constexpr auto counterStart = __COUNTER__ + 1; + #define lambda_counter (__COUNTER__ - counterStart) + + void* levelRendererBobView = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B D9 0F 29 B4 24 ?? ?? ?? ?? 48 8B 89")); + + static auto bobViewHookF = [](__int64 _this, glm::mat4& matrix, float lerpT){ + static auto origFunc = g_Hooks.lambdaHooks.at(lambda_counter)->GetFastcall(); + + /*auto p = g_Data.getLocalPlayer(); + float degrees = fmodf(p->getPosOld()->lerp(p->getPos(), lerpT).x, 5) - 2.5f; + degrees *= 180 / 2.5f; + + auto pos = g_Data.getClientInstance()->levelRenderer->origin; + + glm::mat4 View = matrix; + + matrix = View; + //matrix = glm::rotate(matrix, glm::radians(degrees), glm::vec3(0, 0, 1));*/ + return origFunc(_this, matrix, lerpT); + }; + + std::shared_ptr bobViewHook = std::make_shared(levelRendererBobView, (decltype(&bobViewHookF.operator()))bobViewHookF); + + g_Hooks.lambdaHooks.push_back(bobViewHook); + + #undef lambda_counter } // clang-format on @@ -452,9 +489,9 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { // Rainbow color updates { Utils::ApplyRainbow(rcolors); // Increase Hue of rainbow color array - disabledRcolors[0] = min(1, rcolors[0] * 0.4f + 0.2f); - disabledRcolors[1] = min(1, rcolors[1] * 0.4f + 0.2f); - disabledRcolors[2] = min(1, rcolors[2] * 0.4f + 0.2f); + disabledRcolors[0] = std::min(1.f, rcolors[0] * 0.4f + 0.2f); + disabledRcolors[1] = std::min(1.f, rcolors[1] * 0.4f + 0.2f); + disabledRcolors[2] = std::min(1.f, rcolors[2] * 0.4f + 0.2f); disabledRcolors[3] = 1; } @@ -838,9 +875,9 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { vec2_t textPos = vec2_t(wid.x / 2.f - titleWidth / 2.f, wid.y / 9.f); vec2_t msgPos = vec2_t(wid.x / 2.f - msgWidth / 2.f, textPos.y + titleTextHeight + paddingVert); vec4_t rectPos = vec4_t( - centerPos.x - paddingHoriz - max(titleWidth, msgWidth) / 2, + centerPos.x - paddingHoriz - std::max(titleWidth, msgWidth) / 2, centerPos.y - paddingVert, - centerPos.x + paddingHoriz + max(titleWidth, msgWidth) / 2, + centerPos.x + paddingHoriz + std::max(titleWidth, msgWidth) / 2, centerPos.y + paddingVert * 2 + titleTextHeight + messageHeight * lines); DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), box->fadeVal); DrawUtils::drawRectangle(rectPos, rcolors, box->fadeVal, 2.f); @@ -1027,7 +1064,7 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) if (searchResults.size() > 1) { for (auto it = searchResults.begin()++; it != searchResults.end(); it++) { auto alias = it->cmdAlias; - maxReplaceLength = min(maxReplaceLength, alias.size()); + maxReplaceLength = std::min(maxReplaceLength, alias.size()); for (int i = 0; i < maxReplaceLength; i++) { if (alias[i] != firstResult.cmdAlias[i]) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index d3ebeacb..e5b0e565 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -65,8 +65,10 @@ class Hooks { private: bool shouldRender = true; char currentScreenName[100]; - + public: + std::vector> lambdaHooks; + static void Init(); static void Restore(); static void Enable(); @@ -221,4 +223,4 @@ class FuncHook { using Fn = TRet(__fastcall*)(TArgs...); return reinterpret_cast(funcReal); }; -}; +}; \ No newline at end of file From 7aee21bfacbbb626f6c61fe7bb64956fa89548c4 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 22 Oct 2020 23:25:56 +0200 Subject: [PATCH 162/419] Improve tesselator performance --- Horion/DrawUtils.cpp | 15 +++++++++------ Horion/DrawUtils.h | 2 +- SDK/CItem.cpp | 10 ++++++++++ SDK/CItem.h | 5 +++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 069d4956..89b32834 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -123,7 +123,7 @@ void DrawUtils::flush() { void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { - DrawUtils::tess__begin(tesselator, 3); + DrawUtils::tess__begin(tesselator, 3, 3); tess_vertex(tesselator, p1.x, p1.y, 0); tess_vertex(tesselator, p2.x, p2.y, 0); @@ -143,7 +143,7 @@ void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { modX *= lineWidth; modY *= lineWidth; - DrawUtils::tess__begin(tesselator, 3); + DrawUtils::tess__begin(tesselator, 3, 6); tess_vertex(tesselator, start.x + modX, start.y + modY, 0); tess_vertex(tesselator, start.x - modX, start.y - modY, 0); @@ -413,6 +413,8 @@ void DrawUtils::drawItem(C_ItemStack* item, vec2_t itemPos, float opacity, float C_BaseActorRenderContext baseActorRenderCtx(screenCtx, g_Data.getClientInstance(), g_Data.getClientInstance()->minecraftGame); C_ItemRenderer* renderer = baseActorRenderCtx.renderer; renderer->renderGuiItemNew(&baseActorRenderCtx, item, g_Data.getClientInstance()->minecraftGame, itemPos.x, itemPos.y, opacity, scale, isEnchanted); + + } void DrawUtils::drawKeystroke(char key, vec2_t pos) { @@ -442,7 +444,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); - DrawUtils::tess__begin(myTess, 4); + DrawUtils::tess__begin(myTess, 4, 2); auto start1 = start.sub(origin); auto end1 = end.sub(origin); @@ -452,7 +454,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { tess_end(game3dContext, myTess, entityFlatStaticMaterial); } -void DrawUtils::tess__begin(__int64 tesselator, int vertexFormat) { +void DrawUtils::tess__begin(__int64 tesselator, int vertexFormat, int numVerticesReserved) { if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); *(unsigned char*)(tesselator + 8) = vertexFormat; @@ -462,7 +464,8 @@ void DrawUtils::tess__begin(__int64 tesselator, int vertexFormat) { *(__int64*)(tesselator + 0x150) = *(__int64*)(tesselator + 0x148); if (!*(unsigned char*)tesselator) *(unsigned char*)(tesselator + 0xD0) = 1; - //Tessellator__initializeFormat(tesselator + 8, 0x66i64); + if (numVerticesReserved != 0) + Tessellator__initializeFormat(tesselator + 8, numVerticesReserved); } } void DrawUtils::setGameRenderContext(__int64 ctx) { @@ -500,7 +503,7 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); - DrawUtils::tess__begin(myTess, 5); + DrawUtils::tess__begin(myTess, 5, (int)points.size()); /* * 1: quads diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 35f2ff3e..301c0348 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -83,7 +83,7 @@ class DrawUtils { static void setGameRenderContext(__int64 ctx); static void flush(); static void setColor(float r, float g, float b, float a); // rgba, values from 0 to 1 - static inline void tess__begin(__int64 tesselator, int vertexFormat = 3); + static inline void tess__begin(__int64 tesselator, int vertexFormat = 3, int numVerticesReserved = 0); static C_Font* getFont(Fonts font); static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index e1d06ce8..98df2ee2 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -13,8 +13,18 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 20 0F 29 70 B8 48 8B 05 ?? ?? ?? ??")); + item->setShowPickUp(true); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } + +void C_ItemRenderer::renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRenderCtx, C_ItemStack* item, float x, float y, float opacity, float scale, bool isEnchanted, int mode) { + using renderGuiItemInChunk_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, __int64, C_ItemStack *, float, float, float, float, float, int); + static renderGuiItemInChunk_t renderGuiItem = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 58 ?? 0F 29 70 ?? 0F 29 78 ?? 44 0F 29 40 ?? 44 0F 29 48 ?? 44 0F 29 90 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B F1 45")); + //item->setShowPickUp(false); + + renderGuiItem(this, BaseActorRenderCtx, 2, item, x, y, 1, 1, scale, 0); +} + C_ItemStack::C_ItemStack(const C_ItemStack &src) { memset(this, 0x0, sizeof(C_ItemStack)); using ItemStackCopyConstructor_t = void(__fastcall *)(C_ItemStack &, C_ItemStack const &); diff --git a/SDK/CItem.h b/SDK/CItem.h index 11736e3d..cba0e9ae 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -30,6 +30,7 @@ class C_BaseActorRenderContext { class C_ItemRenderer { public: void renderGuiItemNew(C_BaseActorRenderContext* BaseActorRenderCtx, C_ItemStack* item, MinecraftGame* game, float x, float y, float opacity, float scale, bool isEnchanted); + void renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRenderCtx, C_ItemStack* item, float x, float y, float opacity, float scale, bool isEnchanted, int mode); }; class C_Item { @@ -318,6 +319,10 @@ class C_ItemStack { return (*this->item)->getAttackDamage() + 1.25f * sharpnessValue; } + void setShowPickUp(bool b) { + *(bool*)(reinterpret_cast<__int64>(this)+ 0x30) = b; + } + private: inline void setVtable(void); }; From 629f9aca5e4d6114f9abb3f8478769640af6be09 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 23 Oct 2020 16:59:00 +0200 Subject: [PATCH 163/419] Fix spider overshooting & improve bhop --- Horion/Module/Modules/Bhop.cpp | 35 ++---- Horion/Module/Modules/Spider.cpp | 155 ++++++++++++++++++++++++--- Horion/Module/Modules/Spider.h | 1 + Horion/Module/Modules/TestModule.cpp | 5 +- SDK/CBlockLegacy.h | 2 +- Utils/HMath.h | 17 +++ 6 files changed, 170 insertions(+), 45 deletions(-) diff --git a/Horion/Module/Modules/Bhop.cpp b/Horion/Module/Modules/Bhop.cpp index df03bf64..cafeadf8 100644 --- a/Horion/Module/Modules/Bhop.cpp +++ b/Horion/Module/Modules/Bhop.cpp @@ -21,38 +21,19 @@ void Bhop::onMove(C_MoveInputHandler* input) { if (player->isSneaking()) return; - float yaw = player->yaw; - - bool pressed = input->forward || input->backward || input->right || input->left; - - if (input->forward && input->backward) - return; + vec2_t moveVec2d = {input->forwardMovement, -input->sideMovement}; + bool pressed = moveVec2d.magnitude() > 0.01f; if (player->onGround && pressed) player->jumpFromGround(); - if (input->right) { - yaw += 90.f; - if (input->forward) - yaw -= 45.f; - else if (input->backward) - yaw += 45.f; - } - if (input->left) { - yaw -= 90.f; - if (input->forward) - yaw += 45.f; - else if (input->backward) - yaw -= 45.f; - } - - if (input->backward && !input->left && !input->right) - yaw += 180.f; - - float calcYaw = (yaw + 90) * (PI / 180); + float calcYaw = (player->yaw + 90) * (PI / 180); vec3_t moveVec; - moveVec.x = cos(calcYaw) * speed; + float c = cos(calcYaw); + float s = sin(calcYaw); + moveVec2d = {moveVec2d.x * c - moveVec2d.y * s, moveVec2d.x * s + moveVec2d.y * c}; + moveVec.x = moveVec2d.x * speed; moveVec.y = player->velocity.y; - moveVec.z = sin(calcYaw) * speed; + moveVec.z = moveVec2d.y * speed; if(pressed) player->lerpMotion(moveVec); } diff --git a/Horion/Module/Modules/Spider.cpp b/Horion/Module/Modules/Spider.cpp index 7e94750b..7db129a3 100644 --- a/Horion/Module/Modules/Spider.cpp +++ b/Horion/Module/Modules/Spider.cpp @@ -1,7 +1,8 @@ #include "Spider.h" -Spider::Spider() : IModule('Z', Category::MOVEMENT, "Climb walls") { - registerFloatSetting("Speed", &speed, speed, 0.1f, 1); +Spider::Spider() : IModule(0, Category::MOVEMENT, "Climb walls") { + registerFloatSetting("Speed", &speed, 0.6f, 0.1f, 1.f); + registerBoolSetting("Avoid Overshooting", &this->dontOvershoot, true); } Spider::~Spider() { @@ -21,25 +22,147 @@ void Spider::onMove(C_MoveInputHandler* input) { if (player->isSneaking()) return; + + std::vector sideBlocks; + sideBlocks.reserve(8); - if (!(input->forward || input->backward) || (input->forward && input->backward)) + vec2_t moveVec2d = {input->forwardMovement, -input->sideMovement}; + bool pressed = moveVec2d.magnitude() > 0.01f; + if (!pressed) return; - - static std::vector sideBlocks; - if (sideBlocks.empty()) { - sideBlocks.push_back(new vec3_ti(0, 0, -1)); - sideBlocks.push_back(new vec3_ti(0, 0, 1)); - sideBlocks.push_back(new vec3_ti(-1, 0, 0)); - sideBlocks.push_back(new vec3_ti(1, 0, 0)); + moveVec2d = moveVec2d.normalized(); + + float calcYaw = (player->yaw + 90) * (PI / 180); + vec3_t moveVec; + float c = cos(calcYaw); + float s = sin(calcYaw); + moveVec2d = {moveVec2d.x * c - moveVec2d.y * s, moveVec2d.x * s + moveVec2d.y * c}; + + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && z == 0) + continue; + + if (moveVec2d.dot(vec2_t(x, z).normalized()) < 0.6f) + continue; + sideBlocks.push_back(vec3_ti(x, 0, z)); + } } - for (auto current : sideBlocks) { - vec3_ti side = vec3_ti(player->currentPos.floor()).add(*current); - C_BlockLegacy* sideBlock = *(player->region->getBlock(side)->blockLegacy); - AABB fullBlock = AABB(side.toFloatVector(), side.add(1, 1, 1).toFloatVector()); // todo: idk why all blocks have no AABB - if (sideBlock->material->isBlockingMotion && fullBlock.intersects(player->aabb.expanded(0.25))) { - player->velocity.y = speed; + auto pPos = *player->getPos(); + pPos.y = player->aabb.lower.y; + auto pPosI = vec3_ti(pPos.floor()); + + auto isObstructed = [&](int yOff, AABB* obstructingBlock = nullptr, bool ignoreYcoll = false) { + for (const auto& current : sideBlocks) { + vec3_ti side = pPosI.add(0, yOff, 0).add(current); + if (side.y < 0 || side.y >= 256) + break; + auto block = player->region->getBlock(side); + if (block == nullptr || block->blockLegacy == nullptr) + continue; + C_BlockLegacy* blockLegacy = block->toLegacy(); + if (blockLegacy == nullptr) + continue; + AABB collisionVec; + if (!blockLegacy->getCollisionShape(&collisionVec, block, player->region, &side, player)) + continue; + bool intersects = ignoreYcoll ? collisionVec.intersectsXZ(player->aabb.expandedXZ(0.1f)) : collisionVec.intersects(player->aabb.expandedXZ(0.1f)); + + if (intersects) { + if (obstructingBlock != nullptr) + *obstructingBlock = collisionVec; + return true; + } + } + return false; + }; + + AABB lowerObsVec, upperObsVec; + bool upperObstructed = isObstructed(1, &upperObsVec); + + bool lowerObstructed = isObstructed(0, &lowerObsVec); + float targetSpeed = speed; + if (this->dontOvershoot && (lowerObstructed || upperObstructed)) { + + // simulate because im too lazy to do the math + const auto distanceError = [](float yVel, float distance) { + int t = 0; + constexpr int numIter = 60; + for (; t < numIter; t++) { + distance -= yVel; + yVel -= 0.08f; // gravity + yVel *= 0.98f; // drag + + if (yVel <= 0) + break; + } + return std::tuple(distance, yVel, t); + }; + + float getOver = lowerObstructed ? lowerObsVec.upper.y : upperObsVec.upper.y; + { + if (upperObstructed) + getOver = std::max(getOver, upperObsVec.upper.y); + // max dist that can be reached with our speed + + const int numIterations = (int)ceil(std::max(5.f, -std::get<0>(distanceError(speed, 0)) + 2)); + + bool lastObstructed = upperObstructed; + for (int iter = 2; iter < numIterations; iter++) { + if (isObstructed(iter, &upperObsVec, true)) { + getOver = std::max(getOver, upperObsVec.upper.y); + lastObstructed = true; + } else { + if (lastObstructed) + lastObstructed = false; + else + break; + } + } + } + + float targetDist = getOver - pPos.y + 0.02f; + if (targetDist <= 0) return; + + auto [curDist, curYVel, curT] = distanceError(player->velocity.y, targetDist); + + //this->clientMessageF("current trajectory error=%.3f t=%i vel=%.3f total=%.2f", curDist, curT, curYVel, targetDist); + if (curDist <= 0.01f) + return; // We will already get on top of the block + + if (player->velocity.y < speed) { + // do another simulation to determine whether we would overshoot on the next iteration + auto secondTrajectory = distanceError(speed, targetDist); + //this->clientMessageF("secondTrajectory: error=%.3f t=%i vel=%.2f", std::get<0>(secondTrajectory), std::get<2>(secondTrajectory), std::get<1>(secondTrajectory)); + if (std::get<0>(secondTrajectory) <= 0) {// we are overshooting if we give the player our target speed + + // use secant method to approximate perfect start speed + float error = curDist; + float startSpeed = player->velocity.y; + + float error2 = std::get<0>(secondTrajectory); + float startSpeed2 = speed; + int i = 0; + for (; i < 16; i++) { + if (error > -0.05f && error <= 0.001f) + break; // its better to slightly overshoot than to undershoot + + float newSpeed = (startSpeed2 * error - startSpeed * error2) / (error - error2); + startSpeed2 = startSpeed; + startSpeed = newSpeed; + + error2 = error; + error = std::get<0>(distanceError(newSpeed, targetDist)); + } + //this->clientMessageF("Secant method finished with error=%.3f speed=%.3f at t=%i", error, startSpeed, i); + targetSpeed = startSpeed; + } } } + if (upperObstructed || lowerObstructed) { + if (player->velocity.y < targetSpeed) + player->velocity.y = targetSpeed; + } } \ No newline at end of file diff --git a/Horion/Module/Modules/Spider.h b/Horion/Module/Modules/Spider.h index 095e0587..982f5734 100644 --- a/Horion/Module/Modules/Spider.h +++ b/Horion/Module/Modules/Spider.h @@ -3,6 +3,7 @@ class Spider : public IModule { private: float speed = 0.6f; + bool dontOvershoot = true; public: Spider(); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 5d54496b..8a9fa8f3 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -29,7 +29,10 @@ void TestModule::onTick(C_GameMode* gm) { if(std::find(lastPos.begin(), lastPos.end(), startNode) == lastPos.end()){ lastPos.push_back(startNode); }*/ - //logF("%.2f", gm->player->velocity.z); + //if (gm->player->velocity.y > 0) + + //logF("%.4f %.4f", gm->player->velocity.y, gm->player->aabb.lower.y); + } void TestModule::onMove(C_MoveInputHandler* hand){ diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 691a62c9..97558949 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -43,7 +43,7 @@ class C_BlockLegacy { private: char pad_0x0106[0xA]; //0x010E public: - AABB aabb; //0x0110 + AABB aabb; //0x0118 int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); diff --git a/Utils/HMath.h b/Utils/HMath.h index 789b7324..adfad597 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -67,6 +67,9 @@ struct vec2_t { return vec2_t(-y, x); } + float dot(float ox, float oy) const { return x * ox + y * oy; } + + float dot(const vec2_t &o) const { return x * o.x + y * o.y; } vec2_t normAngles() { @@ -147,6 +150,10 @@ struct vec3_t { return vec3_t(x - f, y - f, z - f); }; + vec3_t sub(float x1, float y1, float z1) { + return vec3_t(x - x1, y - y1, z - z1); + }; + vec3_t floor() { return vec3_t(floorf(x), floorf(y), floorf(z)); }; @@ -158,6 +165,7 @@ struct vec3_t { return vec3_t(x - o.x, y - o.y, z - o.z); } + float squaredlen() const { return x * x + y * y + z * z; } float squaredxzlen() const { return x * x + z * z; } @@ -527,11 +535,20 @@ struct AABB { return AABB(lower.sub(amount), upper.add(amount)); } + AABB expandedXZ(float amount) { + return AABB(lower.sub(amount, 0.f, amount), upper.add(amount, 0.f, amount)); + } + bool intersects(AABB aabb) { return aabb.upper.x > lower.x && upper.x > aabb.lower.x && aabb.upper.y > lower.y && upper.y > aabb.lower.y && aabb.upper.z > lower.z && upper.z > aabb.lower.z; } + + bool intersectsXZ(AABB aabb) { + return aabb.upper.x > lower.x && upper.x > aabb.lower.x && + aabb.upper.z > lower.z && upper.z > aabb.lower.z; + } }; /* From b28476b47f49059a1a83a9e0343af670ba875842 Mon Sep 17 00:00:00 2001 From: Operation-Ghost <48508820+Operation-Ghost@users.noreply.github.com> Date: Sat, 24 Oct 2020 01:50:31 +1000 Subject: [PATCH 164/419] add server side sneak to autoSneak --- Horion/Module/Modules/AutoSneak.cpp | 36 ++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index e4a158bc..cc5cb254 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -1,6 +1,7 @@ #include "AutoSneak.h" AutoSneak::AutoSneak() : IModule(0x0, Category::MOVEMENT, "Automatically sneak without holding the key") { + this->registerBoolSetting("silent", &this->doSilent, doSilent); } AutoSneak::~AutoSneak() { @@ -11,10 +12,39 @@ const char* AutoSneak::getModuleName() { } void AutoSneak::onTick(C_GameMode* gm) { - g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = true; + + if (!doSilent) + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = true; } void AutoSneak::onDisable() { - if (g_Data.getLocalPlayer() != nullptr) - g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = false; + C_PlayerActionPacket p; + p.action = 12; //stop crouch packet + + + + + if (g_Data.getLocalPlayer() != nullptr) { + + if (doSilent) + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); + + if (!doSilent) + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = false; + } +} + + +void AutoSneak::onSendPacket(C_Packet* packet) { + //wait i dont actually need this bit lol + +} + +void AutoSneak::onEnable() { + C_PlayerActionPacket p; + p.action = 11; //start crouch packet + + if (doSilent) + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); + } From c5e7fa9643566e15a565b20354e872637a1bfd9d Mon Sep 17 00:00:00 2001 From: Operation-Ghost <48508820+Operation-Ghost@users.noreply.github.com> Date: Sat, 24 Oct 2020 01:51:38 +1000 Subject: [PATCH 165/419] added server side sneak to autoSneak --- Horion/Module/Modules/AutoSneak.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Horion/Module/Modules/AutoSneak.h b/Horion/Module/Modules/AutoSneak.h index 8f14620a..3b3d2181 100644 --- a/Horion/Module/Modules/AutoSneak.h +++ b/Horion/Module/Modules/AutoSneak.h @@ -1,11 +1,17 @@ #pragma once #include "Module.h" class AutoSneak : public IModule { +private: + + public: + bool doSilent = false; AutoSneak(); ~AutoSneak(); virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; virtual void onDisable() override; + virtual void onSendPacket(C_Packet* packet) override; + virtual void onEnable() override; }; From 60b28b4a259426e2bf4a48ce078d0b89eb0e63dd Mon Sep 17 00:00:00 2001 From: Operation-Ghost <48508820+Operation-Ghost@users.noreply.github.com> Date: Sat, 24 Oct 2020 01:54:51 +1000 Subject: [PATCH 166/419] added autosneak packet stuff --- Memory/Hooks.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b5ec4ce1..1c021fa0 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1148,6 +1148,19 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe return; } } + + if (autosneakMod->isEnabled() && autosneakMod->doSilent && packet->isInstanceOf()) { + auto* pp = reinterpret_cast(packet); + if (g_Data.getLocalPlayer() != nullptr) + if (pp->action == 12) //dont let it uncrouch + return; + } + + + + + + moduleMgr->onSendPacket(packet); if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { From f5408b1c4327dc343a1e9459c2328f38b192a62c Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 23 Oct 2020 21:28:03 +0200 Subject: [PATCH 167/419] Scripting: Vec2, drawLine2d --- Horion.vcxproj | 2 + Horion/DrawUtils.cpp | 3 + Horion/DrawUtils.h | 1 + Horion/Scripting/Functions/DrawFunctions.cpp | 33 +- Horion/Scripting/Functions/DrawFunctions.h | 2 + .../Functions/LocalPlayerFunctions.cpp | 6 +- .../Scripting/Functions/Vector2Functions.cpp | 341 ++++++++++++++++++ Horion/Scripting/Functions/Vector2Functions.h | 22 ++ .../Scripting/Functions/Vector3Functions.cpp | 136 ++++++- Horion/Scripting/Functions/Vector3Functions.h | 6 +- Horion/Scripting/ScriptInstance.cpp | 18 +- Horion/Scripting/ScriptManager.cpp | 62 +++- Horion/Scripting/ScriptManager.h | 21 +- Utils/HMath.h | 23 +- Utils/Logger.cpp | 4 + Utils/Logger.h | 1 + 16 files changed, 649 insertions(+), 32 deletions(-) create mode 100644 Horion/Scripting/Functions/Vector2Functions.cpp create mode 100644 Horion/Scripting/Functions/Vector2Functions.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 76009d12..6f607906 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -383,6 +383,7 @@ + @@ -561,6 +562,7 @@ + diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 89b32834..0f96e325 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -497,6 +497,9 @@ void DrawUtils::setGameRenderContext(__int64 ctx) { float DrawUtils::getLerpTime() { return lerpT; } +vec3_t DrawUtils::getOrigin() { + return origin; +} void DrawUtils::drawLinestrip3d(const std::vector& points) { if(game3dContext == 0 || entityFlatStaticMaterial == 0) return; diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 301c0348..b6e79f4e 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -116,6 +116,7 @@ class DrawUtils { static void drawItem(C_ItemStack* item, vec2_t ItemPos, float opacity, float scale, bool isEnchanted); static void drawKeystroke(char key, vec2_t pos); static float getLerpTime(); + static vec3_t getOrigin(); static vec2_t worldToScreen(const vec3_t& world); }; diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 739aea8b..4f4d2b73 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -3,12 +3,12 @@ JsValueRef CALLBACK DrawFunctions::drawLine3d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { int argIndex = 1; - auto startOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + auto startOpt = Vector3Functions::getVec3FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); if (!startOpt.has_value()) { THROW(L"Invalid start vector!"); } // Note that &arguments[argIndex] might point to invalid memory here, but the function should abort because argumentCount - argIndex equals 0 - auto endOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + auto endOpt = Vector3Functions::getVec3FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); if (!endOpt.has_value()) { THROW(L"Invalid end vector!"); } @@ -45,7 +45,7 @@ JsValueRef CALLBACK DrawFunctions::drawLinestrip3d(JsValueRef callee, bool isCon pointList.reserve(arrayLength); for(int i = 0; i < arrayLength; i++){ auto val = chakra.arrayGet(arr, i); - auto valueOpt = Vector3Functions::getVecFromValue(val); + auto valueOpt = Vector3Functions::getVec3FromValue(val); if(!valueOpt.has_value()){ THROW(L"Points in array need to be of type \"Vec3\""); } @@ -97,19 +97,32 @@ JsValueRef CALLBACK DrawFunctions::setColor(JsValueRef callee, bool isConstructC JsValueRef CALLBACK DrawFunctions::drawLine2d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { int argIndex = 1; - auto startOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + auto startOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); if (!startOpt.has_value()) { THROW(L"Invalid start vector!"); } - if(startOpt->z != 0){ - THROW(L"Z component must be 0"); - } - // Note that &arguments[argIndex] might point to invalid memory here, but the function should abort because argumentCount - argIndex equals 0 - auto endOpt = Vector3Functions::getVecFromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + + auto endOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); if (!endOpt.has_value()) { THROW(L"Invalid end vector!"); } - DrawUtils::drawLine3d(*startOpt, *endOpt); + double lineWidth = 1; + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &lineWidth); + THROW_IF_ERROR(status, L"invalid line width"); + argIndex++; + } + DrawUtils::drawLine(*startOpt, *endOpt, (float)lineWidth); return chakra.trueValue(); +} + +JsValueRef CALLBACK DrawFunctions::getOrigin(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto origin = DrawUtils::getOrigin(); + return scriptMgr.prepareVector3(origin, reinterpret_cast(callbackState)); +} + +JsValueRef CALLBACK DrawFunctions::getWindowSize(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto windowSize = g_Data.getGuiData()->windowSize; + return scriptMgr.prepareVector2(windowSize, reinterpret_cast(callbackState)); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h index ac39b483..28fd2357 100644 --- a/Horion/Scripting/Functions/DrawFunctions.h +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -8,5 +8,7 @@ class DrawFunctions { DECL_FUN(setColor); DECL_FUN(drawLinestrip3d); DECL_FUN(drawLine2d); + + DECL_FUN(getWindowSize); DECL_FUN(getOrigin); }; diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 18be704d..72bf92e7 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -11,7 +11,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setPosition(JsValueRef callee, bool is if (ent == nullptr) { ENTITY_INVALID; } - auto vecOpt = Vector3Functions::getVecFromArguments(&arguments[1], argumentCount - 1); + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); if (!vecOpt.has_value()) { THROW(L"Invalid vector!"); } @@ -26,7 +26,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setVelocity(JsValueRef callee, bool is ENTITY_INVALID; } - auto vecOpt = Vector3Functions::getVecFromArguments(&arguments[1], argumentCount - 1); + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); if (!vecOpt.has_value()) { THROW(L"Invalid vector!"); } @@ -56,7 +56,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setViewAngles(JsValueRef callee, bool ENTITY_INVALID; } - auto vecOpt = Vector3Functions::getVecFromArguments(&arguments[1], argumentCount - 1); + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); if (!vecOpt.has_value()) { THROW(L"Invalid vector!"); } diff --git a/Horion/Scripting/Functions/Vector2Functions.cpp b/Horion/Scripting/Functions/Vector2Functions.cpp new file mode 100644 index 00000000..9136e998 --- /dev/null +++ b/Horion/Scripting/Functions/Vector2Functions.cpp @@ -0,0 +1,341 @@ +#include "Vector2Functions.h" + +std::optional Vector2Functions::getVec2FromValue(JsValueRef ref) { + JsValueType type; + auto err = chakra.JsGetValueType_(ref, &type); + if (type != JsObject || err != JsNoError) + return std::optional(); + + bool hasExternalData = false; + err = chakra.JsHasExternalData_(ref, &hasExternalData); + if (!hasExternalData || err != JsNoError) + return std::optional(); + + JVector2* vecInfo; + err = chakra.JsGetExternalData_(ref, reinterpret_cast(&vecInfo)); + if (vecInfo->dataType != Vector2DataType || err != JsNoError) + return std::optional(); + return std::optional(vecInfo->vec); +} + +std::optional Vector2Functions::getVec2FromArguments(JsValueRef* args, int argCount, int* nextArg) { + if (argCount <= 0) + return std::optional(); + + auto vec = Vector2Functions::getVec2FromValue(args[0]); + + if (vec.has_value()){ + if(nextArg) + *nextArg += 1; + return vec.value(); + } + + if (argCount < 2) + return std::optional(); + + bool isValid = true; + JsValueType type; + for (int i = 0; i < 2; i++) { + auto err = chakra.JsGetValueType_(args[i], &type); + if (err != JsNoError || type != JsNumber) { + isValid = false; + break; + } + } + + if (!isValid) + return std::optional(); + + double x, y; + int err = 0; + err |= (int)chakra.JsNumberToDouble_(args[0], &x); + err |= (int)chakra.JsNumberToDouble_(args[1], &y); + if ((JsErrorCode)err != JsNoError) + return std::optional(); + + if(nextArg) + *nextArg += 2; + + return std::optional(vec2_t((float)x, (float)y)); +} + +JsValueRef CALLBACK Vector2Functions::isValid(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + JsValueRef isValidBoolean; + chakra.JsBoolToBoolean_(vecOpt.has_value(), &isValidBoolean); + + return isValidBoolean; +} + +JsValueRef CALLBACK Vector2Functions::getX(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + chakra.throwTypeException(L"Vector is invalid!"); + return JS_INVALID_REFERENCE; + } + + return chakra.toNumber(vecOpt->x); +} + +JsValueRef CALLBACK Vector2Functions::getY(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + chakra.throwTypeException(L"Vector is invalid!"); + return JS_INVALID_REFERENCE; + } + + return chakra.toNumber(vecOpt->y); +} + +JsValueRef CALLBACK Vector2Functions::toString(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + chakra.throwTypeException(L"Vector is invalid!"); + return JS_INVALID_REFERENCE; + } + auto vec = vecOpt.value(); + + wchar_t name[80]; + int length = swprintf_s(name, L"Vec2(x=%.2f, y=%.2f)", vec.x, vec.y); + JsValueRef ref; + chakra.JsPointerToString_(name, length, &ref); + return ref; +} + +JsValueRef CALLBACK Vector2Functions::constructor(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + if (argumentCount != 3) { + chakra.throwTypeException(L"Vec2 constructor needs 2 parameters!"); + return JS_INVALID_REFERENCE; + } + + double x, y; + chakra.JsNumberToDouble_(arguments[1], &x); + chakra.JsNumberToDouble_(arguments[2], &y); + + return scriptMgr.prepareVector2(vec2_t((float)x, (float)y), reinterpret_cast(callbackState)); +} + +JsValueRef CALLBACK Vector2Functions::add(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch(argumentCount - 1){ + case 1: { + // either adding a Vec2 or a float to all 2 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if(type == JsNumber){ + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError){ + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector2(vecOpt->add((float)val), reinterpret_cast(callbackState)); + }else if(type == JsObject){ + auto oVec = Vector2Functions::getVec2FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector2(vecOpt->add(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 2: { + // adding with 2 individual floats + vec2_t oVec; + for(int i = 0; i < 2; i++){ + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if(type != JsNumber){ + THROW(L"Invalid argument supplied"); + } + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError){ + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector2(vecOpt->add(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} + +JsValueRef CALLBACK Vector2Functions::sub(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch(argumentCount - 1){ + case 1: { + // either subtracting a Vec2 or a float to all 2 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if(type == JsNumber){ + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError){ + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector2(vecOpt->sub((float)val), reinterpret_cast(callbackState)); + }else if(type == JsObject){ + auto oVec = Vector2Functions::getVec2FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector2(vecOpt->sub(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 2: { + // adding with 2 individual floats + vec2_t oVec; + for(int i = 0; i < 2; i++){ + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if(type != JsNumber){ + THROW(L"Invalid argument supplied"); + } + double val = 0; + if(chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError){ + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector2(vecOpt->sub(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} + +JsValueRef CALLBACK Vector2Functions::div(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch (argumentCount - 1) { + case 1: { + // either adding a Vec2 or a float to all 2 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if (type == JsNumber) { + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError) { + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector2(vecOpt->div((float)val), reinterpret_cast(callbackState)); + } else if (type == JsObject) { + auto oVec = Vector2Functions::getVec2FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector2(vecOpt->div(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 2: { + // adding with 2 individual floats + vec2_t oVec; + for (int i = 0; i < 2; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if (type != JsNumber) { + THROW(L"Invalid argument supplied"); + } + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError) { + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector2(vecOpt->div(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} + + +JsValueRef CALLBACK Vector2Functions::mul(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector2Functions::getVec2FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch (argumentCount - 1) { + case 1: { + // either adding a Vec2 or a float to all 2 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if (type == JsNumber) { + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError) { + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector2(vecOpt->mul((float)val), reinterpret_cast(callbackState)); + } else if (type == JsObject) { + auto oVec = Vector2Functions::getVec2FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector2(vecOpt->mul(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 2: { + // adding with 2 individual floats + vec2_t oVec; + for (int i = 0; i < 2; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if (type != JsNumber) { + THROW(L"Invalid argument supplied"); + } + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError) { + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector2(vecOpt->mul(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} \ No newline at end of file diff --git a/Horion/Scripting/Functions/Vector2Functions.h b/Horion/Scripting/Functions/Vector2Functions.h new file mode 100644 index 00000000..c8e4f53d --- /dev/null +++ b/Horion/Scripting/Functions/Vector2Functions.h @@ -0,0 +1,22 @@ +#pragma once + +#include "../../../Utils/HMath.h" +#include "../ScriptManager.h" +#include + +class Vector2Functions { +public: + static std::optional getVec2FromValue(JsValueRef); + static std::optional getVec2FromArguments(JsValueRef*, int argCount, int* nextArg = nullptr); + + DECL_FUN(isValid); + DECL_FUN(getX); + DECL_FUN(getY); + DECL_FUN(toString); + DECL_FUN(constructor); + + DECL_FUN(add); + DECL_FUN(sub); + DECL_FUN(div); + DECL_FUN(mul); +}; diff --git a/Horion/Scripting/Functions/Vector3Functions.cpp b/Horion/Scripting/Functions/Vector3Functions.cpp index 7237878a..518a519e 100644 --- a/Horion/Scripting/Functions/Vector3Functions.cpp +++ b/Horion/Scripting/Functions/Vector3Functions.cpp @@ -1,6 +1,6 @@ #include "Vector3Functions.h" -std::optional Vector3Functions::getVecFromValue(JsValueRef ref) { +std::optional Vector3Functions::getVec3FromValue(JsValueRef ref) { JsValueType type; auto err = chakra.JsGetValueType_(ref, &type); if (type != JsObject || err != JsNoError) @@ -18,11 +18,11 @@ std::optional Vector3Functions::getVecFromValue(JsValueRef ref) { return std::optional(vecInfo->vec); } -std::optional Vector3Functions::getVecFromArguments(JsValueRef* args, int argCount, int* nextArg) { +std::optional Vector3Functions::getVec3FromArguments(JsValueRef* args, int argCount, int* nextArg) { if (argCount <= 0) return std::optional(); - auto vec = Vector3Functions::getVecFromValue(args[0]); + auto vec = Vector3Functions::getVec3FromValue(args[0]); if (vec.has_value()){ if(nextArg) @@ -61,7 +61,7 @@ std::optional Vector3Functions::getVecFromArguments(JsValueRef* args, in } JsValueRef CALLBACK Vector3Functions::isValid(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); JsValueRef isValidBoolean; chakra.JsBoolToBoolean_(vecOpt.has_value(), &isValidBoolean); @@ -69,7 +69,7 @@ JsValueRef CALLBACK Vector3Functions::isValid(JsValueRef callee, bool isConstruc } JsValueRef CALLBACK Vector3Functions::getX(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { chakra.throwTypeException(L"Vector is invalid!"); return JS_INVALID_REFERENCE; @@ -79,7 +79,7 @@ JsValueRef CALLBACK Vector3Functions::getX(JsValueRef callee, bool isConstructCa } JsValueRef CALLBACK Vector3Functions::getY(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { chakra.throwTypeException(L"Vector is invalid!"); return JS_INVALID_REFERENCE; @@ -89,7 +89,7 @@ JsValueRef CALLBACK Vector3Functions::getY(JsValueRef callee, bool isConstructCa } JsValueRef CALLBACK Vector3Functions::getZ(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { chakra.throwTypeException(L"Vector is invalid!"); return JS_INVALID_REFERENCE; @@ -99,7 +99,7 @@ JsValueRef CALLBACK Vector3Functions::getZ(JsValueRef callee, bool isConstructCa } JsValueRef CALLBACK Vector3Functions::toString(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { chakra.throwTypeException(L"Vector is invalid!"); return JS_INVALID_REFERENCE; @@ -128,7 +128,7 @@ JsValueRef CALLBACK Vector3Functions::constructor(JsValueRef callee, bool isCons } JsValueRef CALLBACK Vector3Functions::add(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { THROW(L"Vector is invalid!"); } @@ -151,7 +151,7 @@ JsValueRef CALLBACK Vector3Functions::add(JsValueRef callee, bool isConstructCal return scriptMgr.prepareVector3(vecOpt->add((float)val), reinterpret_cast(callbackState)); }else if(type == JsObject){ - auto oVec = Vector3Functions::getVecFromValue(arguments[1]); + auto oVec = Vector3Functions::getVec3FromValue(arguments[1]); if (!oVec.has_value()) { THROW(L"Supplied Vector is invalid!"); } @@ -184,7 +184,7 @@ JsValueRef CALLBACK Vector3Functions::add(JsValueRef callee, bool isConstructCal } JsValueRef CALLBACK Vector3Functions::sub(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto vecOpt = Vector3Functions::getVecFromValue(arguments[0]); + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); if (!vecOpt.has_value()) { THROW(L"Vector is invalid!"); } @@ -207,7 +207,7 @@ JsValueRef CALLBACK Vector3Functions::sub(JsValueRef callee, bool isConstructCal return scriptMgr.prepareVector3(vecOpt->sub((float)val), reinterpret_cast(callbackState)); }else if(type == JsObject){ - auto oVec = Vector3Functions::getVecFromValue(arguments[1]); + auto oVec = Vector3Functions::getVec3FromValue(arguments[1]); if (!oVec.has_value()) { THROW(L"Supplied Vector is invalid!"); } @@ -236,5 +236,117 @@ JsValueRef CALLBACK Vector3Functions::sub(JsValueRef callee, bool isConstructCal } break; } + THROW(L"Invalid arguments"); +} + +JsValueRef CALLBACK Vector3Functions::div(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch (argumentCount - 1) { + case 1: { + // either adding a Vec3 or a float to all 3 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if (type == JsNumber) { + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError) { + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector3(vecOpt->div((float)val), reinterpret_cast(callbackState)); + } else if (type == JsObject) { + auto oVec = Vector3Functions::getVec3FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector3(vecOpt->div(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 3: { + // adding with 3 individual floats + vec3_t oVec; + for (int i = 0; i < 3; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if (type != JsNumber) { + THROW(L"Invalid argument supplied"); + } + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError) { + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector3(vecOpt->div(oVec), reinterpret_cast(callbackState)); + } break; + } + + THROW(L"Invalid arguments"); +} + +JsValueRef CALLBACK Vector3Functions::mul(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto vecOpt = Vector3Functions::getVec3FromValue(arguments[0]); + if (!vecOpt.has_value()) { + THROW(L"Vector is invalid!"); + } + + if (argumentCount < 2) { + THROW(L"At least 1 argument needed"); + } + + switch (argumentCount - 1) { + case 1: { + // either adding a Vec3 or a float to all 3 components + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if (type == JsNumber) { + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1], &val) != JsNoError) { + THROW(L"Argument 1 not a valid number"); + } + + return scriptMgr.prepareVector3(vecOpt->mul((float)val), reinterpret_cast(callbackState)); + } else if (type == JsObject) { + auto oVec = Vector3Functions::getVec3FromValue(arguments[1]); + if (!oVec.has_value()) { + THROW(L"Supplied Vector is invalid!"); + } + + return scriptMgr.prepareVector3(vecOpt->mul(*oVec), reinterpret_cast(callbackState)); + } + } break; + case 3: { + // adding with 3 individual floats + vec3_t oVec; + for (int i = 0; i < 3; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[1 + i], &type); + if (type != JsNumber) { + THROW(L"Invalid argument supplied"); + } + double val = 0; + if (chakra.JsNumberToDouble_(arguments[1 + i], &val) != JsNoError) { + THROW(L"Argument not a valid number"); + } + + oVec.floatArr[i] = (float)val; + } + + return scriptMgr.prepareVector3(vecOpt->mul(oVec), reinterpret_cast(callbackState)); + } break; + } + THROW(L"Invalid arguments"); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/Vector3Functions.h b/Horion/Scripting/Functions/Vector3Functions.h index 6071d2ac..72f9b281 100644 --- a/Horion/Scripting/Functions/Vector3Functions.h +++ b/Horion/Scripting/Functions/Vector3Functions.h @@ -6,8 +6,8 @@ class Vector3Functions { public: - static std::optional getVecFromValue(JsValueRef); - static std::optional getVecFromArguments(JsValueRef*, int argCount, int* nextArg = nullptr); + static std::optional getVec3FromValue(JsValueRef); + static std::optional getVec3FromArguments(JsValueRef*, int argCount, int* nextArg = nullptr); DECL_FUN(isValid); DECL_FUN(getX); @@ -18,4 +18,6 @@ class Vector3Functions { DECL_FUN(add); DECL_FUN(sub); + DECL_FUN(div); + DECL_FUN(mul); }; diff --git a/Horion/Scripting/ScriptInstance.cpp b/Horion/Scripting/ScriptInstance.cpp index feda5693..f2238540 100644 --- a/Horion/Scripting/ScriptInstance.cpp +++ b/Horion/Scripting/ScriptInstance.cpp @@ -80,9 +80,22 @@ void ScriptInstance::runSync() { std::wstring returnString = L"No result"; if (err != JsNoError || this->checkPrintError()) { - logF("Script run failed: %X", err); + +#define errLog(x, ...) (Logger::isActive() ? logF(x, __VA_ARGS__) : GameData::log(x, __VA_ARGS__)) + + switch (err) { + case JsErrorScriptCompile: + errLog("Script failed to compile (code: %X)", err); + break; + default: + errLog("Script run failed: %X", err); + break; + } + +#undef errLog + returnString = L"Error! " + std::to_wstring(err) + L", you may find a stack trace in the console"; - returnString = L"Error! " + std::to_wstring(err) + L", you can find a stack trace in the console"; + goto stopExecution; } returnString = chakra.valueToString(result); @@ -106,6 +119,7 @@ void ScriptInstance::runSync() { this->runPromises(); } +stopExecution: chakra.JsSetCurrentContext_(JS_INVALID_REFERENCE); chakra.JsDisposeRuntime_(this->runtimeHandle); this->runtimeHandle = JS_INVALID_RUNTIME_HANDLE; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 56766651..2c6ee80a 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -52,11 +52,35 @@ void ScriptManager::prepareVector3Prototype(JsValueRef global, ContextObjects* o chakra.defineFunction(obj->vec3Prototype, L"add", Vector3Functions::add, obj); chakra.defineFunction(obj->vec3Prototype, L"sub", Vector3Functions::sub, obj); + chakra.defineFunction(obj->vec3Prototype, L"div", Vector3Functions::div, obj); + chakra.defineFunction(obj->vec3Prototype, L"mul", Vector3Functions::mul, obj); auto con = chakra.defineFunction(global, L"Vec3", Vector3Functions::constructor, obj); chakra.addPropertyToObj(con, L"prototype", obj->vec3Prototype); } +void ScriptManager::prepareVector2Prototype(JsValueRef global, ContextObjects* obj) { + chakra.JsCreateObject_(&obj->vec2Prototype); + chakra.JsAddRef_(obj->vec2Prototype, 0); + + chakra.defineFunction(obj->vec2Prototype, L"isValid", Vector2Functions::isValid, obj); + + chakra.defineProp(obj->vec2Prototype, L"x", Vector2Functions::getX, 0); + chakra.defineProp(obj->vec2Prototype, L"y", Vector2Functions::getY, 0); + chakra.defineFunction(obj->vec2Prototype, L"getX", Vector2Functions::getX, obj); + chakra.defineFunction(obj->vec2Prototype, L"getY", Vector2Functions::getY, obj); + + chakra.defineFunction(obj->vec2Prototype, L"toString", Vector2Functions::toString, obj); + + chakra.defineFunction(obj->vec2Prototype, L"add", Vector2Functions::add, obj); + chakra.defineFunction(obj->vec2Prototype, L"sub", Vector2Functions::sub, obj); + chakra.defineFunction(obj->vec2Prototype, L"div", Vector2Functions::div, obj); + chakra.defineFunction(obj->vec2Prototype, L"mul", Vector2Functions::mul, obj); + + auto con = chakra.defineFunction(global, L"Vec2", Vector2Functions::constructor, obj); + chakra.addPropertyToObj(con, L"prototype", obj->vec2Prototype); +} + void ScriptManager::prepareEntityPrototype(JsValueRef proto, ContextObjects* objs) { chakra.defineFunction(proto, L"isValid", EntityFunctions::isValid, objs); chakra.defineFunction(proto, L"getPosition", EntityFunctions::getPosition, objs); @@ -114,9 +138,13 @@ void ScriptManager::prepareDrawFunctions(JsValueRef global, ContextObjects* objs chakra.JsCreateObject_(&objs->drawUtils); chakra.JsAddRef_(objs->drawUtils, 0); + chakra.defineFunction(objs->drawUtils, L"drawLine2d", DrawFunctions::drawLine2d, objs); chakra.defineFunction(objs->drawUtils, L"drawLine3d", DrawFunctions::drawLine3d, objs); chakra.defineFunction(objs->drawUtils, L"drawLinestrip3d", DrawFunctions::drawLinestrip3d, objs); chakra.defineFunction(objs->drawUtils, L"setColor", DrawFunctions::setColor, objs); + + chakra.defineFunction(objs->drawUtils, L"getOrigin", DrawFunctions::getOrigin, objs); + chakra.defineFunction(objs->drawUtils, L"getWindowSize", DrawFunctions::getWindowSize, objs); } void ScriptManager::prepareCommandManagerFunctions(JsValueRef global, ContextObjects* objs) { @@ -170,6 +198,7 @@ void ScriptManager::prepareContext(JsContextRef* ctx, ContextObjects* obj) { prepareGlobals(globalObject, obj); prepareHorionFunctions(globalObject, obj); prepareGameFunctions(globalObject, obj); + prepareVector2Prototype(globalObject, obj); prepareVector3Prototype(globalObject, obj); prepareLevelFunctions(globalObject, obj); @@ -203,6 +232,27 @@ JsValueRef ScriptManager::prepareVector3(vec3_t vec, ContextObjects* objs) { return obj; } +JsValueRef ScriptManager::prepareVector2(vec2_t vec, ContextObjects* objs) { + JsValueRef obj; + JVector2* data = new JVector2(vec); + auto err = chakra.JsCreateExternalObject_( + data, [](void* buf) { + delete buf; + }, + &obj); + + if (err != JsNoError) { + logF("prepareVector2 error: %X", err); + JsValueRef null; + chakra.JsGetNullValue_(&null); + return null; + } + + chakra.JsSetPrototype_(obj, objs->vec2Prototype); + + return obj; +} + JsValueRef ScriptManager::prepareModule(std::shared_ptr mod, ContextObjects* objs) { JsValueRef obj = 0; JModule* data = new JModule(mod); @@ -292,8 +342,18 @@ std::wstring ScriptManager::runScript(std::wstring script) { chakra.JsHasException_(&hasException); if (err != JsNoError || hasException) { - logF("Script run failed: %X", err); +#define errLog(x, ...) (Logger::isActive() ? logF(x, __VA_ARGS__) : GameData::log(x, __VA_ARGS__)) + + switch (err) { + case JsErrorScriptCompile: + errLog("Script failed to compile (code: %X)", err); + break; + default: + errLog("Script run failed: %X", err); + break; + } +#undef errLog returnString = L"Error! " + std::to_wstring(err) + L", you can find a stack trace in the console"; if (hasException) { diff --git a/Horion/Scripting/ScriptManager.h b/Horion/Scripting/ScriptManager.h index ef3413cd..15adf5ed 100644 --- a/Horion/Scripting/ScriptManager.h +++ b/Horion/Scripting/ScriptManager.h @@ -8,7 +8,8 @@ typedef enum _ExternalDataType { Invalid = 0, EntityDataType, Vector3DataType, - ModuleDataType + ModuleDataType, + Vector2DataType } ExternalDataType; struct ExternalDataStruct { @@ -36,6 +37,15 @@ struct JVector3 : ExternalDataStruct { } }; +struct JVector2 : ExternalDataStruct { + vec2_t vec; + + JVector2(vec2_t set) { + this->dataType = Vector2DataType; + this->vec = set; + } +}; + class IModule; struct JModule : ExternalDataStruct { @@ -63,9 +73,15 @@ extern ScriptManager scriptMgr; chok.throwTypeException(m); \ return JS_INVALID_REFERENCE +#define THROW_IF_ERROR(code, m) \ + if (code != JsNoError) { \ + THROW(m); \ + } + #include "Functions/GameFunctions.h" #include "Functions/EntityFunctions.h" #include "Functions/GlobalFunctions.h" +#include "Functions/Vector2Functions.h" #include "Functions/Vector3Functions.h" #include "Functions/LocalPlayerFunctions.h" #include "Functions/HorionFunctions.h" @@ -82,6 +98,7 @@ class JavascriptModule; struct ContextObjects { public: JsValueRef vec3Prototype = JS_INVALID_REFERENCE; + JsValueRef vec2Prototype = JS_INVALID_REFERENCE; JsValueRef entityPrototype = JS_INVALID_REFERENCE; JsValueRef localPlayerPrototype = JS_INVALID_REFERENCE; JsValueRef moduleManager = JS_INVALID_REFERENCE; @@ -101,6 +118,7 @@ class ScriptManager { void prepareGlobals(JsValueRef global, ContextObjects*); void prepareVector3Prototype(JsValueRef global, ContextObjects*); + void prepareVector2Prototype(JsValueRef global, ContextObjects*); void prepareEntityPrototype(JsValueRef proto, ContextObjects* objs); void prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects* objs); @@ -117,6 +135,7 @@ class ScriptManager { void prepareContext(JsContextRef* ctx, ContextObjects* obj); JsValueRef prepareEntity(__int64 runtimeId, ContextObjects* obj); JsValueRef prepareVector3(vec3_t vec, ContextObjects* obj); + JsValueRef prepareVector2(vec2_t vec, ContextObjects* obj); JsValueRef prepareModule(std::shared_ptr mod, ContextObjects* objs); JsValueRef prepareJsModule(std::shared_ptr mod, ContextObjects* objs); JsValueRef getLocalPlayer(ContextObjects* obs); diff --git a/Utils/HMath.h b/Utils/HMath.h index adfad597..80f0c604 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -13,7 +13,12 @@ inline float lerp(float a, float b, float t) { struct vec2_t { - float x, y; + union { + struct { + float x, y; + }; + float floatArr[2]; + }; vec2_t() { x = y = 0; } vec2_t(float a, float b) : x(a), y(b) {} vec2_t(int a, int b) : x((float)a), y((float)b) {} @@ -55,6 +60,9 @@ struct vec2_t { vec2_t add(const vec2_t &o) { return vec2_t(x + o.x, y + o.y); } + vec2_t add(float o) { + return vec2_t(x + o, y + o); + } vec2_t add(float ox, float oy) { return vec2_t(x + ox, y + oy); } @@ -131,6 +139,9 @@ struct vec3_t { bool operator!=(const vec3_t &o) const { return x != o.x || y != o.y || z != o.z; }; vec3_t operator-() const { return vec3_t(-x, -y, -z); }; + vec3_t mul(const vec3_t& o) { + return vec3_t(x * o.x, y * o.y, z * o.z); + }; vec3_t mul(float f) { return vec3_t(x * f, y * f, z * f); }; @@ -140,6 +151,12 @@ struct vec3_t { vec3_t div(float f) { return vec3_t(x / f, y / f, z / f); }; + vec3_t div(float x1, float y1, float z1) { + return vec3_t(x / x1, y / y1, z / z1); + }; + vec3_t div(const vec3_t& o) { + return vec3_t(x / o.x, y / o.y, z / o.z); + }; vec3_t add(float f) { return vec3_t(x + f, y + f, z + f); }; @@ -193,6 +210,10 @@ struct vec3_t { return ne; } + vec2_t flatten() const { + return vec2_t(x, y); + } + float sqrxy() const { return x * x + y * y; } float dot(const vec3_t &o) const { return x * o.x + y * o.y + z * o.z; } diff --git a/Utils/Logger.cpp b/Utils/Logger.cpp index 83a7db64..62ef6463 100644 --- a/Utils/Logger.cpp +++ b/Utils/Logger.cpp @@ -24,6 +24,10 @@ std::mutex injMutex; std::vector stringPrintVector = std::vector(); std::vector> stringSendToInjector; +bool Logger::isActive() { + return loggerActive && initializedLogger; +} + std::wstring Logger::GetRoamingFolderPath() { ComPtr appDataStatics; auto hr = RoGetActivationFactory(HStringReference(L"Windows.Storage.ApplicationData").Get(), __uuidof(appDataStatics), &appDataStatics); diff --git a/Utils/Logger.h b/Utils/Logger.h index b332a379..0f59dc43 100644 --- a/Utils/Logger.h +++ b/Utils/Logger.h @@ -33,6 +33,7 @@ struct TextForPrintBig { class Logger { public: + static bool isActive(); static std::wstring GetRoamingFolderPath(); static void WriteLogFileF(volatile char* fmt, ...); static void WriteBigLogFileF(size_t maxSize, const char* fmt, ...); From f9cecbfd2c5977fceb11911f0d2b4e65cacbc76f Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 23 Oct 2020 22:28:12 +0200 Subject: [PATCH 168/419] Draw Rectangle & Fill rectangle --- CMakeLists.txt | 1 + Horion.vcxproj | 5 ++- Horion/Command/CommandMgr.cpp | 4 +- Horion/DrawUtils.cpp | 19 +++++++- Horion/DrawUtils.h | 18 +++++--- Horion/Scripting/Functions/DrawFunctions.cpp | 46 ++++++++++++++++++++ Horion/Scripting/Functions/DrawFunctions.h | 2 + Horion/Scripting/ScriptManager.cpp | 8 +++- Utils/SkinUtil.cpp | 2 +- 9 files changed, 89 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 310edc4f..234a3535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") endif() add_compile_definitions(WIN32_LEAN_AND_MEAN) +add_compile_definitions(NOMINMAX) if(CMAKE_BUILD_TYPE MATCHES Release) elseif(CMAKE_BUILD_TYPE MATCHES BetaConf) diff --git a/Horion.vcxproj b/Horion.vcxproj index 6f607906..e2235351 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -172,7 +172,7 @@ false MultiThreadedDebugDLL /Zc:__cplusplus %(AdditionalOptions) - %(PreprocessorDefinitions) + NOMINMAX;%(PreprocessorDefinitions) OnlyExplicitInline @@ -190,6 +190,7 @@ /Zc:__cplusplus %(AdditionalOptions) AnySuitable false + _WINDLL;NOMINMAX;%(PreprocessorDefinitions) false @@ -201,7 +202,7 @@ true None /Zc:__cplusplus %(AdditionalOptions) - _BETA;%(PreprocessorDefinitions) + _BETA;NOMINMAX;%(PreprocessorDefinitions) AnySuitable false diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index e67987c3..65f1d416 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -71,8 +71,8 @@ void CommandMgr::execute(char* message) { pos = msgStr.find(" ", initialPos); } - args.push_back(msgStr.substr(initialPos, min(pos, msgStr.size()) - initialPos + 1)); - + args.push_back(msgStr.substr(initialPos, std::min(pos, msgStr.size()) - initialPos + 1)); + std::string cmd = args[0]; std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower); diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 0f96e325..ed1595e6 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -132,6 +132,18 @@ void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { tess_end(screenContext2d, tesselator, uiMaterial); } + +void DrawUtils::drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4) { + DrawUtils::tess__begin(tesselator, 1, 4); + + tess_vertex(tesselator, p1.x, p1.y, 0); + tess_vertex(tesselator, p2.x, p2.y, 0); + tess_vertex(tesselator, p3.x, p3.y, 0); + tess_vertex(tesselator, p4.x, p4.y, 0); + + tess_end(screenContext2d, tesselator, uiMaterial); +} + void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { float modX = 0 - (start.y - end.y); float modY = start.x - end.x; @@ -413,8 +425,7 @@ void DrawUtils::drawItem(C_ItemStack* item, vec2_t itemPos, float opacity, float C_BaseActorRenderContext baseActorRenderCtx(screenCtx, g_Data.getClientInstance(), g_Data.getClientInstance()->minecraftGame); C_ItemRenderer* renderer = baseActorRenderCtx.renderer; renderer->renderGuiItemNew(&baseActorRenderCtx, item, g_Data.getClientInstance()->minecraftGame, itemPos.x, itemPos.y, opacity, scale, isEnchanted); - - + } void DrawUtils::drawKeystroke(char key, vec2_t pos) { @@ -454,6 +465,10 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { tess_end(game3dContext, myTess, entityFlatStaticMaterial); } +void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { + DrawUtils::setColor(col.r, col.g, col.b, alpha); + DrawUtils::drawQuad({pos.x, pos.w}, {pos.z, pos.w}, {pos.z, pos.y}, {pos.x, pos.y}); +} void DrawUtils::tess__begin(__int64 tesselator, int vertexFormat, int numVerticesReserved) { if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index b6e79f4e..dacaf7c7 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -88,16 +88,20 @@ class DrawUtils { static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); static void drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3); + static void drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4); static void drawLine(vec2_t start, vec2_t end, float lineWidth); // rgba static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); - static inline void fillRectangle(vec4_t pos, const MC_Color col, float alpha) { - float posF[4]; // vec4_t(startX, startY, endX, endY); - posF[0] = pos.x; - posF[1] = pos.z; - posF[2] = pos.y; - posF[3] = pos.w; - renderCtx->fillRectangle(posF, reinterpret_cast(&col), alpha); + static void fillRectangle(vec4_t pos, const MC_Color col, float alpha); + static inline void fillRectangle(vec2_t start, vec2_t end) { + DrawUtils::drawQuad({start.x, end.y}, {end.x, end.y}, {end.x, start.y}, {start.x, start.y}); + } + static inline void drawRectangle(vec2_t start, vec2_t end, float lineWidth = 1.0f) { + lineWidth /= 2; + fillRectangle({start.x - lineWidth, start.y - lineWidth}, {end.x + lineWidth, start.y + lineWidth}); // TOP + fillRectangle({start.x - lineWidth, start.y}, {start.x + lineWidth, end.y}); // LEFT + fillRectangle({end.x - lineWidth, start.y}, {end.x + lineWidth, end.y}); // + fillRectangle({start.x - lineWidth, end.y - lineWidth}, {end.x + lineWidth, end.y + lineWidth}); } static inline void drawRectangle(vec4_t pos, MC_Color col, float alpha, float lineWidth = 1.0f) { lineWidth /= 2; diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 4f4d2b73..86e1d63a 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -117,6 +117,52 @@ JsValueRef CALLBACK DrawFunctions::drawLine2d(JsValueRef callee, bool isConstruc return chakra.trueValue(); } +JsValueRef CALLBACK DrawFunctions::drawRectangle2d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + auto startOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!startOpt.has_value()) { + THROW(L"Invalid start vector!"); + } + + auto endOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!endOpt.has_value()) { + THROW(L"Invalid end vector!"); + } + + + double lineWidth = 1; + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &lineWidth); + THROW_IF_ERROR(status, L"invalid line width"); + argIndex++; + } + + vec2_t lower = {std::min(startOpt->x, endOpt->x), std::min(startOpt->y, endOpt->y)}; + vec2_t upper = {std::max(startOpt->x, endOpt->x), std::max(startOpt->y, endOpt->y)}; + DrawUtils::drawRectangle(lower, upper, (float)lineWidth); + + return chakra.trueValue(); +} + +JsValueRef CALLBACK DrawFunctions::fillRectangle2d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + auto startOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!startOpt.has_value()) { + THROW(L"Invalid start vector!"); + } + + auto endOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!endOpt.has_value()) { + THROW(L"Invalid end vector!"); + } + + vec2_t lower = {std::min(startOpt->x, endOpt->x), std::min(startOpt->y, endOpt->y)}; + vec2_t upper = {std::max(startOpt->x, endOpt->x), std::max(startOpt->y, endOpt->y)}; + DrawUtils::fillRectangle(lower, upper); + + return chakra.trueValue(); +} + JsValueRef CALLBACK DrawFunctions::getOrigin(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto origin = DrawUtils::getOrigin(); return scriptMgr.prepareVector3(origin, reinterpret_cast(callbackState)); diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h index 28fd2357..5dd4b68d 100644 --- a/Horion/Scripting/Functions/DrawFunctions.h +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -8,6 +8,8 @@ class DrawFunctions { DECL_FUN(setColor); DECL_FUN(drawLinestrip3d); DECL_FUN(drawLine2d); + DECL_FUN(drawRectangle2d); + DECL_FUN(fillRectangle2d); DECL_FUN(getWindowSize); DECL_FUN(getOrigin); diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 2c6ee80a..1aa392ab 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -138,11 +138,15 @@ void ScriptManager::prepareDrawFunctions(JsValueRef global, ContextObjects* objs chakra.JsCreateObject_(&objs->drawUtils); chakra.JsAddRef_(objs->drawUtils, 0); + chakra.defineFunction(objs->drawUtils, L"setColor", DrawFunctions::setColor, objs); + chakra.defineFunction(objs->drawUtils, L"drawLine2d", DrawFunctions::drawLine2d, objs); + chakra.defineFunction(objs->drawUtils, L"drawRectangle2d", DrawFunctions::drawRectangle2d, objs); + chakra.defineFunction(objs->drawUtils, L"fillRectangle2d", DrawFunctions::fillRectangle2d, objs); + chakra.defineFunction(objs->drawUtils, L"drawLine3d", DrawFunctions::drawLine3d, objs); chakra.defineFunction(objs->drawUtils, L"drawLinestrip3d", DrawFunctions::drawLinestrip3d, objs); - chakra.defineFunction(objs->drawUtils, L"setColor", DrawFunctions::setColor, objs); - + chakra.defineFunction(objs->drawUtils, L"getOrigin", DrawFunctions::getOrigin, objs); chakra.defineFunction(objs->drawUtils, L"getWindowSize", DrawFunctions::getWindowSize, objs); } diff --git a/Utils/SkinUtil.cpp b/Utils/SkinUtil.cpp index 4c3574fe..cfb7a41f 100644 --- a/Utils/SkinUtil.cpp +++ b/Utils/SkinUtil.cpp @@ -117,7 +117,7 @@ MeshStructs::meshData SkinUtil::objToMesh(const char* str) { pos = line.find(" ", initialPos); } - args.push_back(line.substr(initialPos, min(pos, line.size()) - initialPos + 1)); + args.push_back(line.substr(initialPos, std::min(pos, line.size()) - initialPos + 1)); auto cmd = args[0].c_str(); From b183e862d3f1dc6843fd36c68b54fd273546f96d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 23 Oct 2020 22:52:04 +0200 Subject: [PATCH 169/419] Improve code quality --- Horion/Module/Modules/AutoSneak.cpp | 36 +++++++++++------------------ Horion/Module/Modules/AutoSneak.h | 1 - Memory/Hooks.cpp | 14 ++++------- 3 files changed, 19 insertions(+), 32 deletions(-) diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index cc5cb254..f1009144 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -18,33 +18,25 @@ void AutoSneak::onTick(C_GameMode* gm) { } void AutoSneak::onDisable() { - C_PlayerActionPacket p; - p.action = 12; //stop crouch packet - - - + if (g_Data.getLocalPlayer() == nullptr) + return; - if (g_Data.getLocalPlayer() != nullptr) { - - if (doSilent) - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); - - if (!doSilent) - g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = false; + if (!doSilent) { + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = false; + return; } -} - - -void AutoSneak::onSendPacket(C_Packet* packet) { - //wait i dont actually need this bit lol + C_PlayerActionPacket p; + p.action = 12; //stop crouch packet + p.entityRuntimeId = g_Data.getLocalPlayer()->entityRuntimeId; + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); } void AutoSneak::onEnable() { - C_PlayerActionPacket p; - p.action = 11; //start crouch packet - - if (doSilent) + if (doSilent) { + C_PlayerActionPacket p; + p.action = 11; //start crouch packet + p.entityRuntimeId = g_Data.getLocalPlayer()->entityRuntimeId; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&p); - + } } diff --git a/Horion/Module/Modules/AutoSneak.h b/Horion/Module/Modules/AutoSneak.h index 3b3d2181..bccd153b 100644 --- a/Horion/Module/Modules/AutoSneak.h +++ b/Horion/Module/Modules/AutoSneak.h @@ -12,6 +12,5 @@ class AutoSneak : public IModule { virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; virtual void onDisable() override; - virtual void onSendPacket(C_Packet* packet) override; virtual void onEnable() override; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1c021fa0..31b77f41 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1108,6 +1108,7 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packet* packet) { static auto oFunc = g_Hooks.LoopbackPacketSender_sendToServerHook->GetFastcall(); + static auto autoSneakMod = moduleMgr->getModule(); static auto freecamMod = moduleMgr->getModule(); static auto blinkMod = moduleMgr->getModule(); static auto noPacketMod = moduleMgr->getModule(); @@ -1149,18 +1150,13 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe } } - if (autosneakMod->isEnabled() && autosneakMod->doSilent && packet->isInstanceOf()) { + if (autoSneakMod->isEnabled() && g_Data.getLocalPlayer() != nullptr && autoSneakMod->doSilent && packet->isInstanceOf()) { auto* pp = reinterpret_cast(packet); - if (g_Data.getLocalPlayer() != nullptr) - if (pp->action == 12) //dont let it uncrouch - return; + + if (pp->action == 12 && pp->entityRuntimeId == g_Data.getLocalPlayer()->entityRuntimeId) + return; //dont send uncrouch } - - - - - moduleMgr->onSendPacket(packet); if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { From b900759dd0436d34e650c88b80190e8386e8b52c Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 00:08:51 +0200 Subject: [PATCH 170/419] Scripting: 2d text drawing --- CMakeLists.txt | 1 + Horion/DrawUtils.cpp | 8 ++ Horion/DrawUtils.h | 1 + Horion/Scripting/Functions/DrawFunctions.cpp | 91 ++++++++++++++++++++ Horion/Scripting/Functions/DrawFunctions.h | 4 + Horion/Scripting/ScriptManager.cpp | 3 + 6 files changed, 108 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 234a3535..35c44230 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ endif() include_directories(.) include_directories(include) +include_directories(include/glm/) link_directories(minhook) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index ed1595e6..8765c8e9 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -117,6 +117,14 @@ float DrawUtils::getTextWidth(std::string* textStr, float textSize, Fonts font) return ret; } +float DrawUtils::getFontHeight(float textSize, Fonts font) { + C_Font* fontPtr = getFont(font); + + float ret = fontPtr->getLineHeight() * textSize; + + return ret; +} + void DrawUtils::flush() { renderCtx->flushText(0); } diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index dacaf7c7..9f39a33f 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -86,6 +86,7 @@ class DrawUtils { static inline void tess__begin(__int64 tesselator, int vertexFormat = 3, int numVerticesReserved = 0); static C_Font* getFont(Fonts font); static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); + static float getFontHeight(float textSize = 1, Fonts font = Fonts::SMOOTH); static void drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3); static void drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4); diff --git a/Horion/Scripting/Functions/DrawFunctions.cpp b/Horion/Scripting/Functions/DrawFunctions.cpp index 86e1d63a..a3639c4e 100644 --- a/Horion/Scripting/Functions/DrawFunctions.cpp +++ b/Horion/Scripting/Functions/DrawFunctions.cpp @@ -163,6 +163,97 @@ JsValueRef CALLBACK DrawFunctions::fillRectangle2d(JsValueRef callee, bool isCon return chakra.trueValue(); } +JsValueRef CALLBACK DrawFunctions::drawText2d(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + + auto textOpt = chakra.tryGetStringFromArgs(arguments[argIndex], argumentCount - argIndex); + if (!textOpt.has_value()) { + THROW(L"Invalid text specified"); + } + argIndex++; + + auto posOpt = Vector2Functions::getVec2FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (!posOpt.has_value()) { + THROW(L"Invalid pos vector!"); + } + + MC_Color color(1,1,1,1); + double textSize = 1, alpha = 1; + + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &textSize); + THROW_IF_ERROR(status, L"invalid text size"); + argIndex++; + } + + auto colorOpt = Vector3Functions::getVec3FromArguments(&arguments[argIndex], argumentCount - argIndex, &argIndex); + if (colorOpt.has_value()) { + color.r = std::clamp(colorOpt->x, 0.f, 1.f); + color.g = std::clamp(colorOpt->y, 0.f, 1.f); + color.b = std::clamp(colorOpt->z, 0.f, 1.f); + + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &alpha); + THROW_IF_ERROR(status, L"invalid alpha value"); + argIndex++; + } + } + + char* coolBeanBuffer = new char[textOpt.value().size() + 1]; + sprintf_s(coolBeanBuffer, textOpt.value().size() + 1, "%S", textOpt.value().c_str()); + std::string textStr(coolBeanBuffer); + + DrawUtils::drawText(*posOpt, &textStr, color, (float)textSize, (float)alpha); + + delete[] coolBeanBuffer; + + return chakra.trueValue(); +} + +JsValueRef CALLBACK DrawFunctions::getTextWidth(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + + auto textOpt = chakra.tryGetStringFromArgs(arguments[argIndex], argumentCount - argIndex); + if (!textOpt.has_value()) { + THROW(L"Invalid text specified"); + } + argIndex++; + + double textSize = 1; + + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &textSize); + THROW_IF_ERROR(status, L"invalid text size"); + argIndex++; + } + + char* coolBeanBuffer = new char[textOpt.value().size() + 1]; + sprintf_s(coolBeanBuffer, textOpt.value().size() + 1, "%S", textOpt.value().c_str()); + std::string textStr(coolBeanBuffer); + + auto width = (double)DrawUtils::getTextWidth(&textStr, (float)textSize); + + delete[] coolBeanBuffer; + + return chakra.toNumber(width); +} + +JsValueRef CALLBACK DrawFunctions::getTextLineHeight(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + int argIndex = 1; + + double textSize = 1; + + if (argumentCount - argIndex >= 1) { + auto status = chakra.JsNumberToDouble_(arguments[argIndex], &textSize); + THROW_IF_ERROR(status, L"invalid text size"); + argIndex++; + } + + auto height = (double)DrawUtils::getFontHeight((float)textSize); + + return chakra.toNumber(height); +} + JsValueRef CALLBACK DrawFunctions::getOrigin(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto origin = DrawUtils::getOrigin(); return scriptMgr.prepareVector3(origin, reinterpret_cast(callbackState)); diff --git a/Horion/Scripting/Functions/DrawFunctions.h b/Horion/Scripting/Functions/DrawFunctions.h index 5dd4b68d..056b8bf0 100644 --- a/Horion/Scripting/Functions/DrawFunctions.h +++ b/Horion/Scripting/Functions/DrawFunctions.h @@ -11,6 +11,10 @@ class DrawFunctions { DECL_FUN(drawRectangle2d); DECL_FUN(fillRectangle2d); + DECL_FUN(drawText2d); + DECL_FUN(getTextWidth); + DECL_FUN(getTextLineHeight); + DECL_FUN(getWindowSize); DECL_FUN(getOrigin); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 1aa392ab..4afaef71 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -143,6 +143,9 @@ void ScriptManager::prepareDrawFunctions(JsValueRef global, ContextObjects* objs chakra.defineFunction(objs->drawUtils, L"drawLine2d", DrawFunctions::drawLine2d, objs); chakra.defineFunction(objs->drawUtils, L"drawRectangle2d", DrawFunctions::drawRectangle2d, objs); chakra.defineFunction(objs->drawUtils, L"fillRectangle2d", DrawFunctions::fillRectangle2d, objs); + chakra.defineFunction(objs->drawUtils, L"drawText2d", DrawFunctions::drawText2d, objs); + chakra.defineFunction(objs->drawUtils, L"getTextWidth", DrawFunctions::getTextWidth, objs); + chakra.defineFunction(objs->drawUtils, L"getTextLineHeight", DrawFunctions::getTextLineHeight, objs); chakra.defineFunction(objs->drawUtils, L"drawLine3d", DrawFunctions::drawLine3d, objs); chakra.defineFunction(objs->drawUtils, L"drawLinestrip3d", DrawFunctions::drawLinestrip3d, objs); From bcb093e084ef419ca78c76bb0689e7c71a7f5634 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 00:36:58 +0200 Subject: [PATCH 171/419] Fix #316 --- Memory/Hooks.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 31b77f41..7afce613 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -383,6 +383,14 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { *message = 0x0; // Remove command in textbox *textLength = 0x0; // text length return; + } else if (*message == '.') { + // maybe the user forgot his prefix, give him some helpful advice + static bool helpedUser = false; + if (!helpedUser) { + helpedUser = true; + g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%sYour Horion prefix is: \"%s%c%s\"", RED, YELLOW, cmdMgr->prefix, RED); + g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%sEnter \"%s%cprefix .%s\" to reset your prefix", RED, YELLOW, cmdMgr->prefix, RED); + } } } oSendMessage(_this); From fc406aaddd75900d472d8b4765fc460bac142221 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 01:47:25 +0200 Subject: [PATCH 172/419] Make waypoints work better across different dimensions --- Horion/Command/Commands/WaypointCommand.cpp | 7 +- Horion/Module/Modules/Compass.cpp | 9 +- Horion/Module/Modules/TestModule.cpp | 5 +- Horion/Module/Modules/Waypoints.cpp | 145 +++++++++++++------- Horion/Module/Modules/Waypoints.h | 18 ++- SDK/CEntity.h | 4 +- 6 files changed, 127 insertions(+), 61 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 89bea7ae..397c2339 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -32,7 +32,9 @@ bool WaypointCommand::execute(std::vector* args) { } else if (args->size() != 3) { return false; } - if (mod->add(name, pos)) { + int dimension; + player->getDimensionId(&dimension); + if (mod->add(name, pos, dimension)) { clientMessageF("%sSuccessfully added waypoint \"%s\"", GREEN, name.c_str()); if (!mod->isEnabled()) clientMessageF("%sEnable the waypoints module to see it ingame!", YELLOW); @@ -47,7 +49,8 @@ bool WaypointCommand::execute(std::vector* args) { } } else if (opt == "tp" || opt == "teleport") { if (auto wp = mod->getWaypoint(name)) { - vec3_t pos = wp.value(); + auto wpV = wp.value(); + auto pos = wpV.pos; player->setPos(pos); clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos.x, pos.y, pos.z); } else { diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 8c5d3a10..8344e90c 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -26,8 +26,13 @@ void Compass::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (showWaypoints) { auto waypoints = wpMod->getWaypoints(); - for (std::map::iterator it = waypoints->begin(); it != waypoints->end(); it++) { - int angle = (int)(player->getPos()->CalcAngle(it->second).y + 180.0f) % 360; + int curDim = 0; + player->getDimensionId(&curDim); + auto playerInterpPos = player->getPosOld()->lerp(player->getPos(), DrawUtils::getLerpTime()); + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { + if (it->second.dimension != curDim) + continue; + int angle = (int)round(playerInterpPos.CalcAngle(it->second.pos).y + 180.0f) % 360; if (angle < 0) angle += 360; extraPoints.insert(std::make_pair(angle, it->first)); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 8a9fa8f3..8d921f85 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -20,6 +20,7 @@ bool TestModule::isFlashMode() { std::vector lastPos; void TestModule::onEnable() { lastPos.clear(); + } void TestModule::onTick(C_GameMode* gm) { @@ -32,7 +33,9 @@ void TestModule::onTick(C_GameMode* gm) { //if (gm->player->velocity.y > 0) //logF("%.4f %.4f", gm->player->velocity.y, gm->player->aabb.lower.y); - + int dim = -5; + gm->player->getDimensionId(&dim); + logF("%i", dim); } void TestModule::onMove(C_MoveInputHandler* hand){ diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index fcc38caa..0851a8f5 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -4,6 +4,7 @@ Waypoints::Waypoints() : IModule(0x0, Category::VISUAL, "Shows holograms for user-defined coordinates") { registerFloatSetting("Size", &size, size, 0.3f, 1.6f); + registerBoolSetting("Interdimensional", &interdimensional, interdimensional); } Waypoints::~Waypoints() { @@ -15,68 +16,100 @@ const char* Waypoints::getModuleName() { void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); + if (localPlayer == nullptr || !GameData::canUseMoveKeys()) + return; + int currentDimension = -1; - if (localPlayer != nullptr && GameData::canUseMoveKeys()) { - for (auto it = waypoints->begin(); it != waypoints->end(); it++) { - vec3_t pos = it->second; - float dist = pos.dist(*g_Data.getLocalPlayer()->getPos()); + localPlayer->getDimensionId(¤tDimension); - constexpr bool useFloatingPoint = false; - constexpr bool fadeOutAtDistance = true; + for (auto it = waypoints->begin(); it != waypoints->end(); it++) { + vec3_t pos = it->second.pos; + int wpDimension = it->second.dimension; + if (!interdimensional && currentDimension != wpDimension) + continue; + if (currentDimension == 1 && wpDimension == 0) { + // we are in nether, wp in overworld + pos.x /= 8; + pos.z /= 8; + } else if (currentDimension == 0 && wpDimension == 1) { + // we are in overworld, wp in nether + pos.x *= 8; + pos.z *= 8; + } else if (currentDimension != wpDimension) + continue; + float dist = pos.dist(*g_Data.getLocalPlayer()->getPos()); + + constexpr bool useFloatingPoint = false; + constexpr bool fadeOutAtDistance = true; - std::string txt; - if (useFloatingPoint) { - std::ostringstream out; - out.precision(2); - out << it->first << " (" << std::fixed << dist << " m)"; - txt = out.str(); - } else { - txt = it->first + " (" + std::to_string(int(dist)) + "m)"; - } + std::string txt; + if (useFloatingPoint) { + std::ostringstream out; + out.precision(2); + out << it->first << " (" << std::fixed << dist << " m"; + txt = out.str(); + } else { + txt = it->first + " (" + std::to_string(int(dist)) + "m"; + } + if (currentDimension != wpDimension) { + if (wpDimension == 0) + txt = txt + ", overworld)"; + else if (wpDimension == 1) + txt = txt + ", nether)"; + }else + txt = txt + ")"; - float alpha = 1; + float alpha = 1; - if (fadeOutAtDistance && dist > 15) { + if (fadeOutAtDistance && dist > 15) { - vec2_t angle = localPlayer->currentPos.CalcAngle(pos); - float diff = angle.sub(localPlayer->viewAngles).normAngles().magnitude(); - if (dist > 30) { - float neededDiff = lerp(40, 15, std::min((dist - 30) / 300, 1.f)); - float minAlpha = lerp(0.6f, 0.3f, std::min((dist - 30) / 50, 1.f)); - if (diff < neededDiff) - alpha = 1.f; - else if (diff > neededDiff + 10) - alpha = minAlpha; - else - alpha = lerp(1.f, minAlpha, (diff - neededDiff) / 10); - } + vec2_t angle = localPlayer->currentPos.CalcAngle(pos); + float diff = angle.sub(localPlayer->viewAngles).normAngles().magnitude(); + if (dist > 30) { + float neededDiff = lerp(40, 15, std::min((dist - 30) / 300, 1.f)); + float minAlpha = lerp(0.6f, 0.3f, std::min((dist - 30) / 50, 1.f)); + if (diff < neededDiff) + alpha = 1.f; + else if (diff > neededDiff + 10) + alpha = minAlpha; + else + alpha = lerp(1.f, minAlpha, (diff - neededDiff) / 10); } + } - if (alpha < 0.01f) - continue; + if (alpha < 0.01f) + continue; - vec4_t rectPos; + vec4_t rectPos; - txt = Utils::sanitize(txt); + txt = Utils::sanitize(txt); - float textWidth = DrawUtils::getTextWidth(&txt, size); - float textHeight = DrawUtils::getFont(Fonts::RUNE)->getLineHeight() * size; + float textWidth = DrawUtils::getTextWidth(&txt, size) + 0.5f; + float textHeight = DrawUtils::getFont(Fonts::RUNE)->getLineHeight() * size; - vec2_t textPos = DrawUtils::worldToScreen(pos); - if (textPos.x != -1) { - textPos.y -= textHeight; - textPos.x -= textWidth / 2.f; - rectPos.x = textPos.x - 1.f * size; - rectPos.y = textPos.y - 1.f * size; - rectPos.z = textPos.x + textWidth + 1.f * size; - rectPos.w = textPos.y + textHeight + 2.f * size; + vec2_t textPos = DrawUtils::worldToScreen(pos); + if (textPos.x != -1) { + textPos.y -= textHeight; + textPos.x -= textWidth / 2.f; + rectPos.x = textPos.x - 1.f * size; + rectPos.y = textPos.y - 1.05f * size; + rectPos.z = textPos.x + textWidth + 1.f * size; + rectPos.w = textPos.y + textHeight + 2.f * size; - DrawUtils::fillRectangle(rectPos, MC_Color(0, 0, 0), alpha * 0.5f); - DrawUtils::drawText(textPos, &txt, MC_Color(255, 255, 255), size, alpha); + MC_Color color(0, 0, 0); + if (currentDimension == 0 && wpDimension == 1) { + color.r = 0.2f; } - DrawUtils::flush(); + if (currentDimension == 1 && wpDimension == 0) { + color.b = 0.2f; + } + + DrawUtils::fillRectangle(rectPos, color, alpha * 0.5f); + DrawUtils::drawText(textPos, &txt, MC_Color(255, 255, 255), size, alpha); } + DrawUtils::flush(); } + } using json = nlohmann::json; @@ -96,6 +129,7 @@ void Waypoints::onLoadConfig(void* confVoid) { for (json::iterator it = value.begin(); it != value.end(); ++it) { vec3_t _pos; + int dim = 0; auto val = it.value(); if (!val.contains("pos")) continue; @@ -108,7 +142,16 @@ void Waypoints::onLoadConfig(void* confVoid) { } else { continue; } - waypoints->emplace(it.key().c_str(), _pos); + if (val.contains("dim")) { + auto dimVal = val.at("dim"); + if (!dimVal.is_null() && dimVal.is_number_integer()) { + try { + dim = dimVal.get(); + } catch (std::exception e) { + } + } + } + waypoints->emplace(it.key().c_str(), WaypointInstance(_pos, dim)); } } } @@ -133,9 +176,11 @@ void Waypoints::onSaveConfig(void* confVoid) { for (auto it = waypoints->begin(); it != waypoints->end(); it++) { json subObj = {}; - subObj["pos"]["x"] = (float)it->second.x; - subObj["pos"]["y"] = (float)it->second.y; - subObj["pos"]["z"] = (float)it->second.z; + auto wp = it->second; + subObj["pos"]["x"] = (float)wp.pos.x; + subObj["pos"]["y"] = (float)wp.pos.y; + subObj["pos"]["z"] = (float)wp.pos.z; + subObj["dim"] = wp.dimension; myList.emplace(it->first.c_str(), subObj); } diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index ad320273..79a3fc01 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -6,14 +6,22 @@ #include "../../../Utils/Json.hpp" #include +struct WaypointInstance { + vec3_t pos; + int dimension; + + WaypointInstance(vec3_t pos, int dim) : pos(pos), dimension(dim){}; +}; + class Waypoints : public IModule { private: - std::shared_ptr> waypoints = std::make_shared>(); + std::shared_ptr> waypoints = std::make_shared>(); public: Waypoints(); ~Waypoints(); + bool interdimensional = true; float size = 0.6f; // Inherited via IModule @@ -22,13 +30,13 @@ class Waypoints : public IModule { virtual void onLoadConfig(void* confVoid) override; virtual void onSaveConfig(void* confVoid) override; - bool add(std::string text, vec3_t pos) { + bool add(std::string text, vec3_t pos, int dimension) { for (auto it = waypoints->begin(); it != waypoints->end(); it++) { if (text == it->first) { return false; } } - waypoints->emplace(text, pos); + waypoints->emplace(text, WaypointInstance(pos, dimension)); return true; } @@ -42,14 +50,14 @@ class Waypoints : public IModule { return false; } - std::optional getWaypoint(std::string name) { + std::optional getWaypoint(std::string name) { if (waypoints->find(name) == waypoints->end()) return {}; return waypoints->at(name); }; - std::shared_ptr> getWaypoints() { + std::shared_ptr> getWaypoints() { return waypoints; } }; \ No newline at end of file diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 66314ac0..d9554fff 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -365,9 +365,11 @@ class C_Entity { virtual __int64 handleInsidePortal(vec3_ti const &); virtual __int64 getPortalCooldown(void) const; virtual __int64 getPortalWaitTime(void) const; - virtual __int64 getDimensionId(void) const; public: + virtual int* getDimensionId(int* dimOut) const; + + virtual bool canChangeDimensions(void) const; private: From 24df1c339fcfb4058cf3f4ebe8a18ab943df94ab Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 02:05:05 +0200 Subject: [PATCH 173/419] added waypoint showcoords & .wp removeall --- Horion/Command/Commands/WaypointCommand.cpp | 24 +++++++++++++------ Horion/Module/Modules/Waypoints.cpp | 26 +++++++++++++++++---- Horion/Module/Modules/Waypoints.h | 1 + 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Horion/Command/Commands/WaypointCommand.cpp b/Horion/Command/Commands/WaypointCommand.cpp index 397c2339..24aceffe 100644 --- a/Horion/Command/Commands/WaypointCommand.cpp +++ b/Horion/Command/Commands/WaypointCommand.cpp @@ -1,6 +1,6 @@ #include "WaypointCommand.h" -WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " [x y z]") { +WaypointCommand::WaypointCommand() : IMCCommand("waypoint", "Manage Waypoints", " [x y z]") { registerAlias("wp"); } @@ -10,11 +10,21 @@ WaypointCommand::~WaypointCommand() { bool WaypointCommand::execute(std::vector* args) { C_LocalPlayer* player = g_Data.getLocalPlayer(); assertTrue(player != nullptr); - assertTrue(args->size() > 2); + assertTrue(args->size() >= 2); static auto mod = moduleMgr->getModule(); std::string opt = args->at(1); + + if (opt == "removeall") { + auto num = mod->getWaypoints()->size(); + mod->getWaypoints()->clear(); + clientMessageF("%sRemoved %i waypoints!", YELLOW, num); + return true; + } + + assertTrue(args->size() > 2); + std::string name = args->at(2); name = Utils::sanitize(name); if (name.size() <= 1 || name.size() > 30) { @@ -39,22 +49,22 @@ bool WaypointCommand::execute(std::vector* args) { if (!mod->isEnabled()) clientMessageF("%sEnable the waypoints module to see it ingame!", YELLOW); } else { - clientMessageF("%sWaypoint \"%s\" already exists", YELLOW, name.c_str()); + clientMessageF("%sWaypoint \"%s\" already exists", RED, name.c_str()); } } else if (opt == "remove") { if (mod->remove(name)) { - clientMessageF("%sRemoved waypoint \"%s\"", RED, name.c_str()); + clientMessageF("%sRemoved waypoint \"%s\"", YELLOW, name.c_str()); } else { - clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); + clientMessageF("%sUnknown waypoint \"%s\"", RED, name.c_str()); } - } else if (opt == "tp" || opt == "teleport") { + }else if (opt == "tp" || opt == "teleport") { if (auto wp = mod->getWaypoint(name)) { auto wpV = wp.value(); auto pos = wpV.pos; player->setPos(pos); clientMessageF("%sTeleported to waypoint \"%s\" (%.02f, %.02f, %.02f)", GREEN, name.c_str(), pos.x, pos.y, pos.z); } else { - clientMessageF("%sUnknown waypoint \"%s\"", YELLOW, name.c_str()); + clientMessageF("%sUnknown waypoint \"%s\"", RED, name.c_str()); } } else { return false; diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index 0851a8f5..5814f7a6 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -5,6 +5,7 @@ Waypoints::Waypoints() : IModule(0x0, Category::VISUAL, "Shows holograms for user-defined coordinates") { registerFloatSetting("Size", &size, size, 0.3f, 1.6f); registerBoolSetting("Interdimensional", &interdimensional, interdimensional); + registerBoolSetting("Show coordinates", &showCoordinates, showCoordinates); } Waypoints::~Waypoints() { @@ -89,23 +90,40 @@ void Waypoints::onPreRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t textPos = DrawUtils::worldToScreen(pos); if (textPos.x != -1) { + std::string coordText; textPos.y -= textHeight; textPos.x -= textWidth / 2.f; + + if (this->showCoordinates) { + std::ostringstream out; + out.precision(1); + out << "(" << std::fixed << pos.x << ", " << pos.y << ", " << pos.z << ")"; + coordText = out.str(); + textWidth = std::max(textWidth, DrawUtils::getTextWidth(&coordText, size * 0.75f) + 0.5f); + } + rectPos.x = textPos.x - 1.f * size; rectPos.y = textPos.y - 1.05f * size; rectPos.z = textPos.x + textWidth + 1.f * size; rectPos.w = textPos.y + textHeight + 2.f * size; + if (this->showCoordinates) + rectPos.w += textHeight * 0.75f + 1.f * size; + MC_Color color(0, 0, 0); - if (currentDimension == 0 && wpDimension == 1) { + if (currentDimension == 0 && wpDimension == 1) color.r = 0.2f; - } - if (currentDimension == 1 && wpDimension == 0) { + + if (currentDimension == 1 && wpDimension == 0) color.b = 0.2f; - } DrawUtils::fillRectangle(rectPos, color, alpha * 0.5f); DrawUtils::drawText(textPos, &txt, MC_Color(255, 255, 255), size, alpha); + if (this->showCoordinates) { + textPos.y += textHeight + 1.f * size; + + DrawUtils::drawText(textPos, &coordText, MC_Color(255, 255, 255), size * 0.75f, alpha); + } } DrawUtils::flush(); } diff --git a/Horion/Module/Modules/Waypoints.h b/Horion/Module/Modules/Waypoints.h index 79a3fc01..20644fed 100644 --- a/Horion/Module/Modules/Waypoints.h +++ b/Horion/Module/Modules/Waypoints.h @@ -22,6 +22,7 @@ class Waypoints : public IModule { ~Waypoints(); bool interdimensional = true; + bool showCoordinates = false; float size = 0.6f; // Inherited via IModule From 8abe74eeff429810bfca2240c355d866bc1e853f Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 13:33:48 +0200 Subject: [PATCH 174/419] Add airjump legacy mode (fixes #353) --- Horion/Module/Modules/AirJump.cpp | 5 +++++ Horion/Module/Modules/AirJump.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Horion/Module/Modules/AirJump.cpp b/Horion/Module/Modules/AirJump.cpp index 4902bed3..49adde17 100644 --- a/Horion/Module/Modules/AirJump.cpp +++ b/Horion/Module/Modules/AirJump.cpp @@ -1,6 +1,7 @@ #include "AirJump.h" AirJump::AirJump() : IModule('G', Category::MOVEMENT, "Jump even you're not on the ground") { + registerBoolSetting("Legacy", &legacyMode, legacyMode); } AirJump::~AirJump() { @@ -11,6 +12,10 @@ const char* AirJump::getModuleName() { } void AirJump::onTick(C_GameMode* gm) { + if (legacyMode) { + gm->player->onGround = true; + return; + } C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); if (input == nullptr) diff --git a/Horion/Module/Modules/AirJump.h b/Horion/Module/Modules/AirJump.h index 50531c6f..3d704ca0 100644 --- a/Horion/Module/Modules/AirJump.h +++ b/Horion/Module/Modules/AirJump.h @@ -4,6 +4,7 @@ class AirJump : public IModule { private: int hasJumped = 0; + bool legacyMode = false; public: AirJump(); From a313228eab74209663ef63e0bce102ab096fc589 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 13:39:10 +0200 Subject: [PATCH 175/419] Fix #352 --- Horion/Module/Modules/BowAimbot.cpp | 3 +-- Utils/HMath.h | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/BowAimbot.cpp b/Horion/Module/Modules/BowAimbot.cpp index 0f2337ed..4f853c15 100644 --- a/Horion/Module/Modules/BowAimbot.cpp +++ b/Horion/Module/Modules/BowAimbot.cpp @@ -52,8 +52,7 @@ void BowAimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { std::sort(targetList.begin(), targetList.end(), CompareTargetEnArray()); vec3_t origin = g_Data.getLocalPlayer()->eyePos0; // TODO: sort list C_Entity* entity = targetList[0]; - vec3_t pos = entity->eyePos0; - pos = {13.f, 8.5f, 21.5f}; + vec3_t pos = entity->aabb.centerPoint(); pos = pos.sub(origin); float yaw = (atan2f(pos.z, pos.x) * DEG_RAD) - 90; float len = pos.magnitudexz(); diff --git a/Utils/HMath.h b/Utils/HMath.h index 80f0c604..2aa5f318 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -560,6 +560,11 @@ struct AABB { return AABB(lower.sub(amount, 0.f, amount), upper.add(amount, 0.f, amount)); } + vec3_t centerPoint() { + vec3_t diff = upper.sub(lower); + return lower.add(diff.mul(0.5f)); + } + bool intersects(AABB aabb) { return aabb.upper.x > lower.x && upper.x > aabb.lower.x && aabb.upper.y > lower.y && upper.y > aabb.lower.y && From 01dcf3c85f5ec5c8ed2a8ec6b89b9b60958f6a23 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 13:44:57 +0200 Subject: [PATCH 176/419] Disable crasher when outside world --- Horion/Module/Modules/Crasher.cpp | 10 ++++++++++ Horion/Module/Modules/Crasher.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Crasher.cpp b/Horion/Module/Modules/Crasher.cpp index 0cf5fef7..a44d9bc3 100644 --- a/Horion/Module/Modules/Crasher.cpp +++ b/Horion/Module/Modules/Crasher.cpp @@ -10,6 +10,16 @@ const char* Crasher::getModuleName() { return ("Crasher"); } +void Crasher::onEnable() { + if (g_Data.getLocalPlayer() == nullptr) + this->setEnabled(false); +} + +void Crasher::onTick(C_GameMode* gm) { + if (g_Data.getLocalPlayer() == nullptr) + this->setEnabled(false); +} + void Crasher::onSendPacket(C_Packet* packet) { if (packet->isInstanceOf()) { PlayerAuthInputPacket* InputPacket = reinterpret_cast(packet); diff --git a/Horion/Module/Modules/Crasher.h b/Horion/Module/Modules/Crasher.h index eea5b223..75337986 100644 --- a/Horion/Module/Modules/Crasher.h +++ b/Horion/Module/Modules/Crasher.h @@ -1,5 +1,4 @@ #pragma once -#pragma once #include "Module.h" class Crasher : public IModule { public: @@ -9,4 +8,6 @@ class Crasher : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onSendPacket(C_Packet* packet) override; + virtual void onEnable() override; + virtual void onTick(C_GameMode* gm) override; }; From c7bf557dc9919c1601231d7f5a344422cc3473fb Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 24 Oct 2020 13:53:43 +0200 Subject: [PATCH 177/419] always clear bowaimbot target list --- Horion/Module/Modules/BowAimbot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/BowAimbot.cpp b/Horion/Module/Modules/BowAimbot.cpp index 4f853c15..ebfca91f 100644 --- a/Horion/Module/Modules/BowAimbot.cpp +++ b/Horion/Module/Modules/BowAimbot.cpp @@ -34,6 +34,8 @@ void findTargets(C_Entity* currentEntity, bool isRegularEntitie) { } void BowAimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { + targetList.clear(); + C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); if (localPlayer == nullptr) return; @@ -44,8 +46,6 @@ void BowAimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { if (!(GameData::isRightClickDown() && GameData::canUseMoveKeys())) // is aiming? return; - targetList.clear(); - g_Data.forEachEntity(findTargets); if (!targetList.empty()) { From ab325ed324df64d5623eae89799155b509343455 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sat, 24 Oct 2020 14:01:47 +0200 Subject: [PATCH 178/419] Help user load configs & delete a bunch of default keybinds --- Horion/Config/ConfigManager.cpp | 8 +++++++- Horion/Module/Modules/Aimbot.cpp | 2 +- Horion/Module/Modules/AirStuck.cpp | 2 +- Horion/Module/Modules/AirSwim.cpp | 2 +- Horion/Module/Modules/AntiBot.cpp | 2 +- Horion/Module/Modules/AntiVoid.cpp | 2 +- Horion/Module/Modules/AutoArmor.cpp | 2 +- Horion/Module/Modules/AutoClicker.cpp | 2 +- Horion/Module/Modules/AutoGapple.cpp | 2 +- Horion/Module/Modules/AutoSneak.cpp | 2 +- Horion/Module/Modules/AutoSprint.cpp | 2 +- Horion/Module/Modules/AutoTotem.cpp | 2 +- Horion/Module/Modules/Bhop.cpp | 2 +- Horion/Module/Modules/Blink.cpp | 2 +- Horion/Module/Modules/BowAimbot.cpp | 2 +- Horion/Module/Modules/ChestAura.cpp | 2 +- Horion/Module/Modules/ChestESP.cpp | 2 +- Horion/Module/Modules/ChestStealer.cpp | 2 +- Horion/Module/Modules/Compass.cpp | 2 +- Horion/Module/Modules/Crasher.cpp | 2 +- Horion/Module/Modules/Criticals.cpp | 2 +- Horion/Module/Modules/Derp.cpp | 2 +- Horion/Module/Modules/EditionFaker.cpp | 2 +- Horion/Module/Modules/ExtendedBlockReach.cpp | 2 +- Horion/Module/Modules/FastEast.cpp | 2 +- Horion/Module/Modules/FastLadder.cpp | 2 +- Horion/Module/Modules/Fly.cpp | 2 +- Horion/Module/Modules/FullBright.cpp | 2 +- Horion/Module/Modules/Glide.cpp | 2 +- Horion/Module/Modules/Godmode.cpp | 2 +- Horion/Module/Modules/HighJump.cpp | 2 +- Horion/Module/Modules/Hitbox.cpp | 2 +- Horion/Module/Modules/HudModule.cpp | 2 +- Horion/Module/Modules/InfiniteReach.cpp | 2 +- Horion/Module/Modules/InventoryCleaner.cpp | 2 +- Horion/Module/Modules/InventoryMove.cpp | 2 +- Horion/Module/Modules/NameTags.cpp | 2 +- Horion/Module/Modules/Nbt.cpp | 2 +- Horion/Module/Modules/NightMode.cpp | 2 +- Horion/Module/Modules/NoFriends.cpp | 2 +- Horion/Module/Modules/NoPaintingCrash.cpp | 2 +- Horion/Module/Modules/NoSlowDown.cpp | 2 +- Horion/Module/Modules/NoSwing.cpp | 2 +- Horion/Module/Modules/NoWeb.cpp | 2 +- Horion/Module/Modules/PacketLogger.cpp | 2 +- Horion/Module/Modules/Radar.cpp | 2 +- Horion/Module/Modules/RainbowSky.cpp | 2 +- Horion/Module/Modules/Reach.cpp | 2 +- Horion/Module/Modules/Spammer.cpp | 2 +- Horion/Module/Modules/StackableItem.cpp | 2 +- Horion/Module/Modules/Step.cpp | 2 +- Horion/Module/Modules/Teams.cpp | 2 +- Horion/Module/Modules/Teleport.cpp | 2 +- Horion/Module/Modules/TimeChanger.cpp | 2 +- Horion/Module/Modules/Timer.cpp | 2 +- Horion/Module/Modules/Tower.cpp | 2 +- Horion/Module/Modules/TriggerBot.cpp | 2 +- Horion/Module/Modules/Velocity.cpp | 2 +- Horion/Module/Modules/Waypoints.cpp | 2 +- 59 files changed, 65 insertions(+), 59 deletions(-) diff --git a/Horion/Config/ConfigManager.cpp b/Horion/Config/ConfigManager.cpp index f99d94e0..686ef43c 100644 --- a/Horion/Config/ConfigManager.cpp +++ b/Horion/Config/ConfigManager.cpp @@ -75,8 +75,14 @@ void ConfigManager::loadConfig(std::string name, bool create) { if (create) saveConfig(); - if (g_Data.getLocalPlayer() != nullptr) + if (g_Data.getLocalPlayer() != nullptr) { + static bool helpedUser = false; g_Data.getGuiData()->displayClientMessageF("[%sHorion%s] %sSuccessfully %s config %s%s%s!", GOLD, WHITE, GREEN, !configExists ? "created" : "loaded", GRAY, name.c_str(), GREEN); + if (!helpedUser && name != "default") { + helpedUser = true; + g_Data.getGuiData()->displayClientMessageF("[%sHorion%s] %sEnter \"%s%cconfig load default%s\" to load your old config!", GOLD, WHITE, YELLOW, WHITE, cmdMgr->prefix, YELLOW); + } + } } else { if (g_Data.getLocalPlayer() != nullptr) g_Data.getGuiData()->displayClientMessageF("[%sHorion%s] %sCould not load config %s%s%s!", GOLD, WHITE, RED, GRAY, name.c_str(), RED); diff --git a/Horion/Module/Modules/Aimbot.cpp b/Horion/Module/Modules/Aimbot.cpp index cdcfe5cf..c675703e 100644 --- a/Horion/Module/Modules/Aimbot.cpp +++ b/Horion/Module/Modules/Aimbot.cpp @@ -1,6 +1,6 @@ #include "Aimbot.h" -Aimbot::Aimbot() : IModule('M', Category::COMBAT, "Automatically aims at the nearest entity") { +Aimbot::Aimbot() : IModule(0, Category::COMBAT, "Automatically aims at the nearest entity") { this->registerFloatSetting("range", &this->range, this->range, 3.f, 8.f); this->registerBoolSetting("Require click", &this->click, this->click); this->registerBoolSetting("only swords/axes", &this->sword, this->sword); diff --git a/Horion/Module/Modules/AirStuck.cpp b/Horion/Module/Modules/AirStuck.cpp index ed5bed31..f6d1cc96 100644 --- a/Horion/Module/Modules/AirStuck.cpp +++ b/Horion/Module/Modules/AirStuck.cpp @@ -1,6 +1,6 @@ #include "AirStuck.h" -AirStuck::AirStuck() : IModule(0x0, Category::MOVEMENT, "Become stuck.") { +AirStuck::AirStuck() : IModule(0, Category::MOVEMENT, "Become stuck.") { } AirStuck::~AirStuck() { diff --git a/Horion/Module/Modules/AirSwim.cpp b/Horion/Module/Modules/AirSwim.cpp index 584d14b7..ef06ea86 100644 --- a/Horion/Module/Modules/AirSwim.cpp +++ b/Horion/Module/Modules/AirSwim.cpp @@ -1,6 +1,6 @@ #include "AirSwim.h" -AirSwim::AirSwim() : IModule(0x0, Category::MOVEMENT, "Swim even though your in air") { +AirSwim::AirSwim() : IModule(0, Category::MOVEMENT, "Swim even though your in air") { } AirSwim::~AirSwim() { diff --git a/Horion/Module/Modules/AntiBot.cpp b/Horion/Module/Modules/AntiBot.cpp index 584a804f..146692be 100644 --- a/Horion/Module/Modules/AntiBot.cpp +++ b/Horion/Module/Modules/AntiBot.cpp @@ -1,6 +1,6 @@ #include "AntiBot.h" -AntiBot::AntiBot() : IModule(0x0, Category::PLAYER, "Enable this module to filter bots!") { +AntiBot::AntiBot() : IModule(0, Category::PLAYER, "Enable this module to filter bots!") { registerBoolSetting("Hitbox Check", &this->hitboxCheck, this->hitboxCheck); //registerBoolSetting("Name Check", &this->nameCheck, this->nameCheck); registerBoolSetting("Invisible Check", &this->invisibleCheck, this->invisibleCheck); diff --git a/Horion/Module/Modules/AntiVoid.cpp b/Horion/Module/Modules/AntiVoid.cpp index 94e244d6..5b7dbf93 100644 --- a/Horion/Module/Modules/AntiVoid.cpp +++ b/Horion/Module/Modules/AntiVoid.cpp @@ -1,6 +1,6 @@ #include "AntiVoid.h" -AntiVoid::AntiVoid() : IModule(0x0, Category::MOVEMENT, "Automatically teleports you back up if you fall down more than X blocks") { +AntiVoid::AntiVoid() : IModule(0, Category::MOVEMENT, "Automatically teleports you back up if you fall down more than X blocks") { registerIntSetting("distance", &this->distance, this->distance, 1, 20); } diff --git a/Horion/Module/Modules/AutoArmor.cpp b/Horion/Module/Modules/AutoArmor.cpp index d2c2ef2f..feb47494 100644 --- a/Horion/Module/Modules/AutoArmor.cpp +++ b/Horion/Module/Modules/AutoArmor.cpp @@ -24,7 +24,7 @@ class ArmorStruct { int m_slot = 0; }; -AutoArmor::AutoArmor() : IModule(0x0, Category::PLAYER, "Automatically equips the best armor") { +AutoArmor::AutoArmor() : IModule(0, Category::PLAYER, "Automatically equips the best armor") { } AutoArmor::~AutoArmor() { diff --git a/Horion/Module/Modules/AutoClicker.cpp b/Horion/Module/Modules/AutoClicker.cpp index d569b04a..aade940c 100644 --- a/Horion/Module/Modules/AutoClicker.cpp +++ b/Horion/Module/Modules/AutoClicker.cpp @@ -1,6 +1,6 @@ #include "AutoClicker.h" -AutoClicker::AutoClicker() : IModule(0x0, Category::COMBAT, "A simple autoclicker, automatically clicks for you.") { +AutoClicker::AutoClicker() : IModule(0, Category::COMBAT, "A simple autoclicker, automatically clicks for you.") { this->registerBoolSetting("rightclick", &this->rightclick, rightclick); this->registerBoolSetting("only swords/axes", &this->sword, this->sword); this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); diff --git a/Horion/Module/Modules/AutoGapple.cpp b/Horion/Module/Modules/AutoGapple.cpp index d21a213d..e775f4f6 100644 --- a/Horion/Module/Modules/AutoGapple.cpp +++ b/Horion/Module/Modules/AutoGapple.cpp @@ -1,6 +1,6 @@ #include "AutoGapple.h" -AutoGapple::AutoGapple() : IModule(0x0, Category::MOVEMENT, "Auto eat gapples if you're low health") { +AutoGapple::AutoGapple() : IModule(0, Category::MOVEMENT, "Auto eat gapples if you're low health") { registerIntSetting("health", &this->health, 10, 1, 20); } diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index f1009144..983b8a60 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -1,6 +1,6 @@ #include "AutoSneak.h" -AutoSneak::AutoSneak() : IModule(0x0, Category::MOVEMENT, "Automatically sneak without holding the key") { +AutoSneak::AutoSneak() : IModule(0, Category::MOVEMENT, "Automatically sneak without holding the key") { this->registerBoolSetting("silent", &this->doSilent, doSilent); } diff --git a/Horion/Module/Modules/AutoSprint.cpp b/Horion/Module/Modules/AutoSprint.cpp index e46e7669..f21aeff9 100644 --- a/Horion/Module/Modules/AutoSprint.cpp +++ b/Horion/Module/Modules/AutoSprint.cpp @@ -1,6 +1,6 @@ #include "AutoSprint.h" -AutoSprint::AutoSprint() : IModule(0x0, Category::MOVEMENT, "Automatically sprint without holding the key") { +AutoSprint::AutoSprint() : IModule(0, Category::MOVEMENT, "Automatically sprint without holding the key") { registerBoolSetting("all directions", &this->alldirections, this->alldirections); } diff --git a/Horion/Module/Modules/AutoTotem.cpp b/Horion/Module/Modules/AutoTotem.cpp index 639d9823..a4ba9c5c 100644 --- a/Horion/Module/Modules/AutoTotem.cpp +++ b/Horion/Module/Modules/AutoTotem.cpp @@ -1,6 +1,6 @@ #include "AutoTotem.h" -AutoTotem::AutoTotem() : IModule(0x0, Category::PLAYER, "Automatically puts totems into your offhand") { +AutoTotem::AutoTotem() : IModule(0, Category::PLAYER, "Automatically puts totems into your offhand") { } AutoTotem::~AutoTotem() { diff --git a/Horion/Module/Modules/Bhop.cpp b/Horion/Module/Modules/Bhop.cpp index cafeadf8..41eb7c95 100644 --- a/Horion/Module/Modules/Bhop.cpp +++ b/Horion/Module/Modules/Bhop.cpp @@ -1,6 +1,6 @@ #include "Bhop.h" -Bhop::Bhop() : IModule(0x0, Category::MOVEMENT, "Hop around like a bunny!") { +Bhop::Bhop() : IModule(0, Category::MOVEMENT, "Hop around like a bunny!") { registerFloatSetting("Speed", &this->speed, this->speed, 0.1f, 0.8f); } diff --git a/Horion/Module/Modules/Blink.cpp b/Horion/Module/Modules/Blink.cpp index 16dec067..e758ba79 100644 --- a/Horion/Module/Modules/Blink.cpp +++ b/Horion/Module/Modules/Blink.cpp @@ -1,6 +1,6 @@ #include "Blink.h" -Blink::Blink() : IModule('L', Category::MISC, "Stops you from sending packets and then sends them in a bunch") { +Blink::Blink() : IModule(0, Category::MISC, "Stops you from sending packets and then sends them in a bunch") { } Blink::~Blink() { diff --git a/Horion/Module/Modules/BowAimbot.cpp b/Horion/Module/Modules/BowAimbot.cpp index 4f853c15..d67cc113 100644 --- a/Horion/Module/Modules/BowAimbot.cpp +++ b/Horion/Module/Modules/BowAimbot.cpp @@ -4,7 +4,7 @@ std::vector targetList; -BowAimbot::BowAimbot() : IModule(0x0, Category::COMBAT, "Aimbot, but for bows") { +BowAimbot::BowAimbot() : IModule(0, Category::COMBAT, "Aimbot, but for bows") { registerBoolSetting("silent", &this->silent, this->silent); } diff --git a/Horion/Module/Modules/ChestAura.cpp b/Horion/Module/Modules/ChestAura.cpp index b2084114..1dd44d82 100644 --- a/Horion/Module/Modules/ChestAura.cpp +++ b/Horion/Module/Modules/ChestAura.cpp @@ -1,6 +1,6 @@ #include "ChestAura.h" -ChestAura::ChestAura() : IModule(0x0, Category::PLAYER, "Aura for opening chests") { +ChestAura::ChestAura() : IModule(0, Category::PLAYER, "Aura for opening chests") { registerIntSetting("Range", &this->range, this->range, 1, 10); } diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/ChestESP.cpp index 4ecf77bd..f57251c6 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/ChestESP.cpp @@ -1,7 +1,7 @@ #include "ChestESP.h" #include "../../DrawUtils.h" -ChestESP::ChestESP() : IModule('H', Category::VISUAL, "ESP for chests") { +ChestESP::ChestESP() : IModule(0, Category::VISUAL, "ESP for chests") { } ChestESP::~ChestESP() { diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index 1adeb8da..f94b42e7 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -1,7 +1,7 @@ #include "ChestStealer.h" #include "../ModuleManager.h" -ChestStealer::ChestStealer() : IModule(0x0, Category::PLAYER, "Automatically takes all items out of a chest") { +ChestStealer::ChestStealer() : IModule(0, Category::PLAYER, "Automatically takes all items out of a chest") { registerIntSetting("Close Delay", &this->setDelay, this->setDelay, 0, 20); registerBoolSetting("enhanced", &this->enhanced, this->enhanced); } diff --git a/Horion/Module/Modules/Compass.cpp b/Horion/Module/Modules/Compass.cpp index 8344e90c..7c704c3b 100644 --- a/Horion/Module/Modules/Compass.cpp +++ b/Horion/Module/Modules/Compass.cpp @@ -2,7 +2,7 @@ #include "../ModuleManager.h" -Compass::Compass() : IModule(0x0, Category::VISUAL, "Compass") { +Compass::Compass() : IModule(0, Category::VISUAL, "Compass") { registerFloatSetting("Opacity", &opacity, opacity, 0.1f, 1); registerIntSetting("Range", &range, range, 45, 180); registerBoolSetting("Show Waypoints", &showWaypoints, showWaypoints); diff --git a/Horion/Module/Modules/Crasher.cpp b/Horion/Module/Modules/Crasher.cpp index a44d9bc3..1871b094 100644 --- a/Horion/Module/Modules/Crasher.cpp +++ b/Horion/Module/Modules/Crasher.cpp @@ -1,6 +1,6 @@ #include "Crasher.h" -Crasher::Crasher() : IModule(0x0, Category::MISC, "Crash Realms Servers") { +Crasher::Crasher() : IModule(0, Category::MISC, "Crash Realms Servers") { } Crasher::~Crasher() { diff --git a/Horion/Module/Modules/Criticals.cpp b/Horion/Module/Modules/Criticals.cpp index 012ae1be..39f8f10f 100644 --- a/Horion/Module/Modules/Criticals.cpp +++ b/Horion/Module/Modules/Criticals.cpp @@ -1,6 +1,6 @@ #include "Criticals.h" -Criticals::Criticals() : IModule(0x0, Category::COMBAT, "Each hit is a critical hit") { +Criticals::Criticals() : IModule(0, Category::COMBAT, "Each hit is a critical hit") { } Criticals::~Criticals() { diff --git a/Horion/Module/Modules/Derp.cpp b/Horion/Module/Modules/Derp.cpp index f8f572af..f671c8b7 100644 --- a/Horion/Module/Modules/Derp.cpp +++ b/Horion/Module/Modules/Derp.cpp @@ -1,6 +1,6 @@ #include "Derp.h" -Derp::Derp() : IModule(0x0, Category::MISC, "lol you stupid") { +Derp::Derp() : IModule(0, Category::MISC, "lol you stupid") { this->registerBoolSetting("ihaveastroke", &this->epicStroke, this->epicStroke); this->registerBoolSetting("packet mode", &this->packetMode, this->packetMode); } diff --git a/Horion/Module/Modules/EditionFaker.cpp b/Horion/Module/Modules/EditionFaker.cpp index 6039cf92..36988218 100644 --- a/Horion/Module/Modules/EditionFaker.cpp +++ b/Horion/Module/Modules/EditionFaker.cpp @@ -1,6 +1,6 @@ #include "EditionFaker.h" -EditionFaker::EditionFaker() : IModule('X', Category::MISC, "Fakes your device to android") { +EditionFaker::EditionFaker() : IModule(0, Category::MISC, "Fakes your device to android") { } EditionFaker::~EditionFaker() { diff --git a/Horion/Module/Modules/ExtendedBlockReach.cpp b/Horion/Module/Modules/ExtendedBlockReach.cpp index 67762492..20985e77 100644 --- a/Horion/Module/Modules/ExtendedBlockReach.cpp +++ b/Horion/Module/Modules/ExtendedBlockReach.cpp @@ -1,6 +1,6 @@ #include "ExtendedBlockReach.h" -ExtendedBlockReach::ExtendedBlockReach() : IModule(0x0, Category::PLAYER, "Exteneded reach for placing/breaking blocks") { +ExtendedBlockReach::ExtendedBlockReach() : IModule(0, Category::PLAYER, "Exteneded reach for placing/breaking blocks") { this->registerFloatSetting(std::string("reach"), &this->blockReach, this->blockReach, 7, 20); } diff --git a/Horion/Module/Modules/FastEast.cpp b/Horion/Module/Modules/FastEast.cpp index 298666cb..28638ece 100644 --- a/Horion/Module/Modules/FastEast.cpp +++ b/Horion/Module/Modules/FastEast.cpp @@ -1,6 +1,6 @@ #include "FastEat.h" -FastEat::FastEat() : IModule(0x0, Category::PLAYER, "Eat food almost instant") { +FastEat::FastEat() : IModule(0, Category::PLAYER, "Eat food almost instant") { } FastEat::~FastEat() { diff --git a/Horion/Module/Modules/FastLadder.cpp b/Horion/Module/Modules/FastLadder.cpp index 33c30eca..84b0b018 100644 --- a/Horion/Module/Modules/FastLadder.cpp +++ b/Horion/Module/Modules/FastLadder.cpp @@ -1,6 +1,6 @@ #include "FastLadder.h" -FastLadder::FastLadder() : IModule(0x0, Category::MOVEMENT, "Climb up ladders faster") { +FastLadder::FastLadder() : IModule(0, Category::MOVEMENT, "Climb up ladders faster") { } FastLadder::~FastLadder() { diff --git a/Horion/Module/Modules/Fly.cpp b/Horion/Module/Modules/Fly.cpp index 07b745bb..859267b3 100644 --- a/Horion/Module/Modules/Fly.cpp +++ b/Horion/Module/Modules/Fly.cpp @@ -1,6 +1,6 @@ #include "Fly.h" -Fly::Fly() : IModule(0x0, Category::MOVEMENT, "Enables fly like in creative mode") { +Fly::Fly() : IModule(0, Category::MOVEMENT, "Enables fly like in creative mode") { } Fly::~Fly() { diff --git a/Horion/Module/Modules/FullBright.cpp b/Horion/Module/Modules/FullBright.cpp index f04023ea..919f9fcf 100644 --- a/Horion/Module/Modules/FullBright.cpp +++ b/Horion/Module/Modules/FullBright.cpp @@ -1,6 +1,6 @@ #include "FullBright.h" -FullBright::FullBright() : IModule(0x0, Category::VISUAL, "Puts your gamma to max") { +FullBright::FullBright() : IModule(0, Category::VISUAL, "Puts your gamma to max") { } FullBright::~FullBright() { diff --git a/Horion/Module/Modules/Glide.cpp b/Horion/Module/Modules/Glide.cpp index d1b2c01c..badcca35 100644 --- a/Horion/Module/Modules/Glide.cpp +++ b/Horion/Module/Modules/Glide.cpp @@ -1,6 +1,6 @@ #include "Glide.h" -Glide::Glide() : IModule('U', Category::MOVEMENT, "Float down") { +Glide::Glide() : IModule(0, Category::MOVEMENT, "Float down") { this->registerFloatSetting("value", &this->glideMod, this->glideMod, -2, 1); } diff --git a/Horion/Module/Modules/Godmode.cpp b/Horion/Module/Modules/Godmode.cpp index 51586cac..6370aa3e 100644 --- a/Horion/Module/Modules/Godmode.cpp +++ b/Horion/Module/Modules/Godmode.cpp @@ -1,6 +1,6 @@ #include "Godmode.h" -Godmode::Godmode() : IModule(0x0, Category::MISC, "Regen health so fast you won't die") { +Godmode::Godmode() : IModule(0, Category::MISC, "Regen health so fast you won't die") { registerIntSetting("regen delay", &this->regendelay, this->regendelay, 1, 20); registerIntSetting("regen value", &this->regenvalue, this->regenvalue, 1, 20); } diff --git a/Horion/Module/Modules/HighJump.cpp b/Horion/Module/Modules/HighJump.cpp index c801e5cc..9479c1e5 100644 --- a/Horion/Module/Modules/HighJump.cpp +++ b/Horion/Module/Modules/HighJump.cpp @@ -1,6 +1,6 @@ #include "HighJump.h" -HighJump::HighJump() : IModule(0x0, Category::MOVEMENT, "Jump higher than ever before") { +HighJump::HighJump() : IModule(0, Category::MOVEMENT, "Jump higher than ever before") { registerFloatSetting("Jump Height", &this->jumpPower, 1, 0.5f, 5.f); } diff --git a/Horion/Module/Modules/Hitbox.cpp b/Horion/Module/Modules/Hitbox.cpp index e63394d8..19abfc3d 100644 --- a/Horion/Module/Modules/Hitbox.cpp +++ b/Horion/Module/Modules/Hitbox.cpp @@ -1,6 +1,6 @@ #include "Hitbox.h" -Hitbox::Hitbox() : IModule(0x0, Category::COMBAT, "Increase an entitys hitbox size") { +Hitbox::Hitbox() : IModule(0, Category::COMBAT, "Increase an entitys hitbox size") { this->registerFloatSetting("Height", &this->height, this->height, 1.8f, 10); this->registerFloatSetting("Width", &this->width, this->width, 0.6f, 10); } diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 063073ef..3977778c 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -2,7 +2,7 @@ #include "../../DrawUtils.h" #include "../../Scripting/ScriptManager.h" -HudModule::HudModule() : IModule(0x0, Category::VISUAL, "Displays ArrayList/TabGUI") { +HudModule::HudModule() : IModule(0, Category::VISUAL, "Displays ArrayList/TabGUI") { registerBoolSetting("TabGui", &this->tabgui, this->tabgui); registerBoolSetting("ArrayList", &this->arraylist, this->arraylist); registerBoolSetting("ClickToggle", &this->clickToggle, this->clickToggle); diff --git a/Horion/Module/Modules/InfiniteReach.cpp b/Horion/Module/Modules/InfiniteReach.cpp index 0d3efad8..27a2f5b3 100644 --- a/Horion/Module/Modules/InfiniteReach.cpp +++ b/Horion/Module/Modules/InfiniteReach.cpp @@ -1,6 +1,6 @@ #include "InfiniteReach.h" -InfiniteReach::InfiniteReach() : IModule(0x0, Category::COMBAT, "Killaura with infinite reach") { +InfiniteReach::InfiniteReach() : IModule(0, Category::COMBAT, "Killaura with infinite reach") { this->registerBoolSetting("multiaura", &this->isMulti, this->isMulti); this->registerFloatSetting("range", &this->range, this->range, 15, 100); this->registerIntSetting("delay", &this->delay, this->delay, 15, 20); diff --git a/Horion/Module/Modules/InventoryCleaner.cpp b/Horion/Module/Modules/InventoryCleaner.cpp index b4609bfc..cd3b4b55 100644 --- a/Horion/Module/Modules/InventoryCleaner.cpp +++ b/Horion/Module/Modules/InventoryCleaner.cpp @@ -2,7 +2,7 @@ #include "../ModuleManager.h" -InventoryCleaner::InventoryCleaner() : IModule(0x0, Category::PLAYER, "Automatically throws not needed stuff out of your inventory") { +InventoryCleaner::InventoryCleaner() : IModule(0, Category::PLAYER, "Automatically throws not needed stuff out of your inventory") { registerBoolSetting("Tools", &this->keepTools, this->keepTools); registerBoolSetting("Armor", &this->keepArmor, this->keepArmor); registerBoolSetting("Food", &this->keepFood, this->keepFood); diff --git a/Horion/Module/Modules/InventoryMove.cpp b/Horion/Module/Modules/InventoryMove.cpp index d0430432..eb0ebd19 100644 --- a/Horion/Module/Modules/InventoryMove.cpp +++ b/Horion/Module/Modules/InventoryMove.cpp @@ -1,6 +1,6 @@ #include "InventoryMove.h" -InventoryMove::InventoryMove() : IModule(0x0, Category::MOVEMENT, "Move even though you have your inventory open") { +InventoryMove::InventoryMove() : IModule(0, Category::MOVEMENT, "Move even though you have your inventory open") { } InventoryMove::~InventoryMove() { diff --git a/Horion/Module/Modules/NameTags.cpp b/Horion/Module/Modules/NameTags.cpp index 3fe11821..43cd7e73 100644 --- a/Horion/Module/Modules/NameTags.cpp +++ b/Horion/Module/Modules/NameTags.cpp @@ -3,7 +3,7 @@ #include "../../../Utils/Target.h" #include "../ModuleManager.h" -NameTags::NameTags() : IModule(0x0, Category::VISUAL, "Shows better nametags above players that can be seen from a lot more far aways") { +NameTags::NameTags() : IModule(0, Category::VISUAL, "Shows better nametags above players that can be seen from a lot more far aways") { this->registerBoolSetting("Display Armor", &this->displayArmor, this->displayArmor); } diff --git a/Horion/Module/Modules/Nbt.cpp b/Horion/Module/Modules/Nbt.cpp index a0075172..a43ca2a9 100644 --- a/Horion/Module/Modules/Nbt.cpp +++ b/Horion/Module/Modules/Nbt.cpp @@ -2,7 +2,7 @@ #include "../../../SDK/Tag.h" #include "../../../Utils/Utils.h" -Nbt::Nbt() : IModule(0x0, Category::PLAYER, "Print NBT tags, right click on mobs (Only works on local worlds!)") { +Nbt::Nbt() : IModule(0, Category::PLAYER, "Print NBT tags, right click on mobs (Only works on local worlds!)") { } Nbt::~Nbt() { diff --git a/Horion/Module/Modules/NightMode.cpp b/Horion/Module/Modules/NightMode.cpp index 58d64345..5d37a3f6 100644 --- a/Horion/Module/Modules/NightMode.cpp +++ b/Horion/Module/Modules/NightMode.cpp @@ -1,6 +1,6 @@ #include "NightMode.h" -NightMode::NightMode() : IModule(0x0, Category::VISUAL, "Darkens the environment") { +NightMode::NightMode() : IModule(0, Category::VISUAL, "Darkens the environment") { //registerFloatSetting("modifier", &this->modifier, this->modifier, 0.1f, 1.f); } diff --git a/Horion/Module/Modules/NoFriends.cpp b/Horion/Module/Modules/NoFriends.cpp index 2d4a4008..534de257 100644 --- a/Horion/Module/Modules/NoFriends.cpp +++ b/Horion/Module/Modules/NoFriends.cpp @@ -1,6 +1,6 @@ #include "NoFriends.h" -NoFriends::NoFriends() : IModule(0x0, Category::PLAYER, "Ignores friend list check") { +NoFriends::NoFriends() : IModule(0, Category::PLAYER, "Ignores friend list check") { } NoFriends::~NoFriends() { diff --git a/Horion/Module/Modules/NoPaintingCrash.cpp b/Horion/Module/Modules/NoPaintingCrash.cpp index 4f36765f..06499330 100644 --- a/Horion/Module/Modules/NoPaintingCrash.cpp +++ b/Horion/Module/Modules/NoPaintingCrash.cpp @@ -1,6 +1,6 @@ #include "NoPaintingCrash.h" -NoPaintingCrash::NoPaintingCrash() : IModule(0x0, Category::MISC, "Fix Painting crash when using mob spawner !") { +NoPaintingCrash::NoPaintingCrash() : IModule(0, Category::MISC, "Fix Painting crash when using mob spawner !") { } NoPaintingCrash::~NoPaintingCrash() { diff --git a/Horion/Module/Modules/NoSlowDown.cpp b/Horion/Module/Modules/NoSlowDown.cpp index 19a32f01..f3017554 100644 --- a/Horion/Module/Modules/NoSlowDown.cpp +++ b/Horion/Module/Modules/NoSlowDown.cpp @@ -5,7 +5,7 @@ #include "../../../Utils/Logger.h" #include "../../../Utils/Utils.h" -NoSlowDown::NoSlowDown() : IModule(0x0, Category::MOVEMENT, "Don't get slowed down when blocking or eating") { +NoSlowDown::NoSlowDown() : IModule(0, Category::MOVEMENT, "Don't get slowed down when blocking or eating") { } NoSlowDown::~NoSlowDown() { diff --git a/Horion/Module/Modules/NoSwing.cpp b/Horion/Module/Modules/NoSwing.cpp index 62f00599..7b054e76 100644 --- a/Horion/Module/Modules/NoSwing.cpp +++ b/Horion/Module/Modules/NoSwing.cpp @@ -1,6 +1,6 @@ #include "NoSwing.h" -NoSwing::NoSwing() : IModule(0x0, Category::PLAYER, "Disable arm swing animation for killaura, triggerbot, fucker etc.") { +NoSwing::NoSwing() : IModule(0, Category::PLAYER, "Disable arm swing animation for killaura, triggerbot, fucker etc.") { } NoSwing::~NoSwing() { diff --git a/Horion/Module/Modules/NoWeb.cpp b/Horion/Module/Modules/NoWeb.cpp index 3eb35518..880f5f81 100644 --- a/Horion/Module/Modules/NoWeb.cpp +++ b/Horion/Module/Modules/NoWeb.cpp @@ -1,6 +1,6 @@ #include "NoWeb.h" -NoWeb::NoWeb() : IModule(0x0, Category::MOVEMENT, "Ignore cobwebs slowdown") { +NoWeb::NoWeb() : IModule(0, Category::MOVEMENT, "Ignore cobwebs slowdown") { } NoWeb ::~NoWeb() { diff --git a/Horion/Module/Modules/PacketLogger.cpp b/Horion/Module/Modules/PacketLogger.cpp index 0de4b13e..3f1d4799 100644 --- a/Horion/Module/Modules/PacketLogger.cpp +++ b/Horion/Module/Modules/PacketLogger.cpp @@ -1,6 +1,6 @@ #include "PacketLogger.h" -PacketLogger::PacketLogger() : IModule(0x0, Category::MISC, "Logging Packets !") { +PacketLogger::PacketLogger() : IModule(0, Category::MISC, "Logging Packets !") { } PacketLogger::~PacketLogger() { diff --git a/Horion/Module/Modules/Radar.cpp b/Horion/Module/Modules/Radar.cpp index 7ff9607b..46ae99b0 100644 --- a/Horion/Module/Modules/Radar.cpp +++ b/Horion/Module/Modules/Radar.cpp @@ -14,7 +14,7 @@ bool grid = true; // it's the only one that could be. since everything else is accessed at renderEntity() float bgOpacity = 0.2f; -Radar::Radar() : IModule(0x0, Category::VISUAL, "Radar") { +Radar::Radar() : IModule(0, Category::VISUAL, "Radar") { registerBoolSetting("Show Grid", &grid, true); registerIntSetting("Size", &size, size, 50, 200); registerFloatSetting("Pixel Size", &pixelSize, pixelSize, 2, 4); diff --git a/Horion/Module/Modules/RainbowSky.cpp b/Horion/Module/Modules/RainbowSky.cpp index 66a03818..9c8210cd 100644 --- a/Horion/Module/Modules/RainbowSky.cpp +++ b/Horion/Module/Modules/RainbowSky.cpp @@ -1,6 +1,6 @@ #include "RainbowSky.h" -RainbowSky::RainbowSky() : IModule('N', Category::VISUAL, "Makes your sky look rainbow!") { +RainbowSky::RainbowSky() : IModule(0, Category::VISUAL, "Makes your sky look rainbow!") { } RainbowSky::~RainbowSky() { diff --git a/Horion/Module/Modules/Reach.cpp b/Horion/Module/Modules/Reach.cpp index c563af83..d39c8c99 100644 --- a/Horion/Module/Modules/Reach.cpp +++ b/Horion/Module/Modules/Reach.cpp @@ -4,7 +4,7 @@ #include "../../../Utils/Logger.h" #include "../../../Utils/Utils.h" -Reach::Reach() : IModule(0x0, Category::COMBAT, "Increases your reach") { +Reach::Reach() : IModule(0, Category::COMBAT, "Increases your reach") { this->registerFloatSetting("Reach Value", &this->reachValue, this->reachValue, 3.f, 7.f); } diff --git a/Horion/Module/Modules/Spammer.cpp b/Horion/Module/Modules/Spammer.cpp index 58518007..b357c392 100644 --- a/Horion/Module/Modules/Spammer.cpp +++ b/Horion/Module/Modules/Spammer.cpp @@ -1,7 +1,7 @@ #include "Spammer.h" #include "../../../Utils/Utils.h" -Spammer::Spammer() : IModule(0x0, Category::MISC, "Spams a message in a specified delay") { +Spammer::Spammer() : IModule(0, Category::MISC, "Spams a message in a specified delay") { registerIntSetting("delay", &this->delay, this->delay, 1, 10); registerBoolSetting("bypass", &this->bypass, this->bypass); } diff --git a/Horion/Module/Modules/StackableItem.cpp b/Horion/Module/Modules/StackableItem.cpp index e934483f..b3d98e70 100644 --- a/Horion/Module/Modules/StackableItem.cpp +++ b/Horion/Module/Modules/StackableItem.cpp @@ -1,6 +1,6 @@ #include "StackableItem.h" -StackableItem::StackableItem() : IModule(0x0, Category::PLAYER, "Stack items you normally wouldn't be able to stack (e. g. swords)") { +StackableItem::StackableItem() : IModule(0, Category::PLAYER, "Stack items you normally wouldn't be able to stack (e. g. swords)") { } StackableItem::~StackableItem() { diff --git a/Horion/Module/Modules/Step.cpp b/Horion/Module/Modules/Step.cpp index 4db13c02..5224c5c8 100644 --- a/Horion/Module/Modules/Step.cpp +++ b/Horion/Module/Modules/Step.cpp @@ -1,6 +1,6 @@ #include "Step.h" -Step::Step() : IModule('B', Category::MOVEMENT, "Increases your step height") { +Step::Step() : IModule(0, Category::MOVEMENT, "Increases your step height") { registerFloatSetting("height", &this->height, this->height, 1.f, 10.f); } diff --git a/Horion/Module/Modules/Teams.cpp b/Horion/Module/Modules/Teams.cpp index f69a4d81..c44c479a 100644 --- a/Horion/Module/Modules/Teams.cpp +++ b/Horion/Module/Modules/Teams.cpp @@ -1,6 +1,6 @@ #include "Teams.h" -Teams::Teams() : IModule(0x0, Category::COMBAT, "Don't attack team members!") { +Teams::Teams() : IModule(0, Category::COMBAT, "Don't attack team members!") { registerBoolSetting("is allied", &this->alliedCheck, this->alliedCheck); registerBoolSetting("same color", &this->colorCheck, this->colorCheck); } diff --git a/Horion/Module/Modules/Teleport.cpp b/Horion/Module/Modules/Teleport.cpp index 1fb60ac4..db6fbf8c 100644 --- a/Horion/Module/Modules/Teleport.cpp +++ b/Horion/Module/Modules/Teleport.cpp @@ -1,6 +1,6 @@ #include "Teleport.h" -Teleport::Teleport() : IModule(0x0, Category::MISC, "Click a block to teleport to it") { +Teleport::Teleport() : IModule(0, Category::MISC, "Click a block to teleport to it") { registerBoolSetting("Only Hand", &this->onlyHand, this->onlyHand); registerBoolSetting("Push", &this->bypass, this->bypass); } diff --git a/Horion/Module/Modules/TimeChanger.cpp b/Horion/Module/Modules/TimeChanger.cpp index 377123b3..523e1152 100644 --- a/Horion/Module/Modules/TimeChanger.cpp +++ b/Horion/Module/Modules/TimeChanger.cpp @@ -1,6 +1,6 @@ #include "TimeChanger.h" -TimeChanger::TimeChanger() : IModule(0x0, Category::VISUAL, "Changes the client-sided time.") { +TimeChanger::TimeChanger() : IModule(0, Category::VISUAL, "Changes the client-sided time.") { registerFloatSetting("modifier", &this->modifier, this->modifier, 0.1f, 1.f); } diff --git a/Horion/Module/Modules/Timer.cpp b/Horion/Module/Modules/Timer.cpp index 77c39bb9..8272d4bc 100644 --- a/Horion/Module/Modules/Timer.cpp +++ b/Horion/Module/Modules/Timer.cpp @@ -1,6 +1,6 @@ #include "Timer.h" -Timer::Timer() : IModule(0x0, Category::MISC, "Increase the ticks per second") { +Timer::Timer() : IModule(0, Category::MISC, "Increase the ticks per second") { this->registerIntSetting("ticks per second", &this->timer, this->timer, 0, 500); } diff --git a/Horion/Module/Modules/Tower.cpp b/Horion/Module/Modules/Tower.cpp index fc2f1d78..5c45c45c 100644 --- a/Horion/Module/Modules/Tower.cpp +++ b/Horion/Module/Modules/Tower.cpp @@ -2,7 +2,7 @@ #include "../../DrawUtils.h" -Tower::Tower() : IModule(0x0, Category::WORLD, "Like scaffold, but vertically and a lot faster") { +Tower::Tower() : IModule(0, Category::WORLD, "Like scaffold, but vertically and a lot faster") { registerFloatSetting("motion", &this->motion, this->motion, 0.3f, 1.f); } diff --git a/Horion/Module/Modules/TriggerBot.cpp b/Horion/Module/Modules/TriggerBot.cpp index 59b05abe..466583b7 100644 --- a/Horion/Module/Modules/TriggerBot.cpp +++ b/Horion/Module/Modules/TriggerBot.cpp @@ -2,7 +2,7 @@ #include "../../../Utils/Target.h" -TriggerBot::TriggerBot() : IModule('K', Category::COMBAT, "Attacks entities you're looking at") { +TriggerBot::TriggerBot() : IModule(0, Category::COMBAT, "Attacks entities you're looking at") { this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); } diff --git a/Horion/Module/Modules/Velocity.cpp b/Horion/Module/Modules/Velocity.cpp index 385c9d13..402e709b 100644 --- a/Horion/Module/Modules/Velocity.cpp +++ b/Horion/Module/Modules/Velocity.cpp @@ -1,6 +1,6 @@ #include "Velocity.h" -Velocity::Velocity() : IModule('J', Category::MOVEMENT, "Don't ever take knockback again") { +Velocity::Velocity() : IModule(0, Category::MOVEMENT, "Don't ever take knockback again") { this->registerFloatSetting("Linear Modifier", &this->xModifier, this->xModifier, 0.f, 1.f); this->registerFloatSetting("Height Modifier", &this->yModifier, this->yModifier, 0.f, 1.f); } diff --git a/Horion/Module/Modules/Waypoints.cpp b/Horion/Module/Modules/Waypoints.cpp index 5814f7a6..5ee34ba0 100644 --- a/Horion/Module/Modules/Waypoints.cpp +++ b/Horion/Module/Modules/Waypoints.cpp @@ -2,7 +2,7 @@ #include -Waypoints::Waypoints() : IModule(0x0, Category::VISUAL, "Shows holograms for user-defined coordinates") { +Waypoints::Waypoints() : IModule(0, Category::VISUAL, "Shows holograms for user-defined coordinates") { registerFloatSetting("Size", &size, size, 0.3f, 1.6f); registerBoolSetting("Interdimensional", &interdimensional, interdimensional); registerBoolSetting("Show coordinates", &showCoordinates, showCoordinates); From a8e7402e969655c0576fd9a8f47b31067a4e1075 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 24 Oct 2020 14:26:44 +0200 Subject: [PATCH 179/419] fix #292 --- Horion/Module/Modules/AutoClicker.cpp | 7 +++---- Horion/Module/Modules/AutoClicker.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Horion/Module/Modules/AutoClicker.cpp b/Horion/Module/Modules/AutoClicker.cpp index aade940c..a1cf5ac4 100644 --- a/Horion/Module/Modules/AutoClicker.cpp +++ b/Horion/Module/Modules/AutoClicker.cpp @@ -2,7 +2,7 @@ AutoClicker::AutoClicker() : IModule(0, Category::COMBAT, "A simple autoclicker, automatically clicks for you.") { this->registerBoolSetting("rightclick", &this->rightclick, rightclick); - this->registerBoolSetting("only swords/axes", &this->sword, this->sword); + this->registerBoolSetting("only weapons", &this->weapons, this->weapons); this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); this->registerBoolSetting("hold", &this->hold, this->hold); } @@ -21,9 +21,8 @@ void AutoClicker::onTick(C_GameMode* gm) { Odelay++; if (Odelay >= delay) { - auto selectedItemId = localPlayer->getSelectedItemId(); - if (sword && !(selectedItemId == 268 || selectedItemId == 267 || selectedItemId == 272 || selectedItemId == 276 || selectedItemId == 283 /*swords*/ - || selectedItemId == 271 || selectedItemId == 275 || selectedItemId == 279 || selectedItemId == 286 || selectedItemId == 258 /*axes*/)) + auto selectedItem = localPlayer->getSelectedItem(); + if (weapons && selectedItem->getAttackingDamageWithEnchants() < 1) return; g_Data.leftclickCount++; diff --git a/Horion/Module/Modules/AutoClicker.h b/Horion/Module/Modules/AutoClicker.h index 9320a08d..9f32306a 100644 --- a/Horion/Module/Modules/AutoClicker.h +++ b/Horion/Module/Modules/AutoClicker.h @@ -6,7 +6,7 @@ class AutoClicker : public IModule { private: int delay = 0; int Odelay = 0; - bool sword = true; + bool weapons = true; bool rightclick = false; bool hold = false; From 724cc7f472b3861360c259e205483436cf5a65c2 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 25 Oct 2020 13:02:51 +0100 Subject: [PATCH 180/419] bowaimbot "predict" and visualize --- Horion/Module/Modules/BowAimbot.cpp | 11 +++++++++++ Horion/Module/Modules/BowAimbot.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/Horion/Module/Modules/BowAimbot.cpp b/Horion/Module/Modules/BowAimbot.cpp index 163f16bd..c1cca5fe 100644 --- a/Horion/Module/Modules/BowAimbot.cpp +++ b/Horion/Module/Modules/BowAimbot.cpp @@ -1,11 +1,14 @@ #include "BowAimbot.h" #include "../../../Utils/Target.h" +#include "../../DrawUtils.h" std::vector targetList; BowAimbot::BowAimbot() : IModule(0, Category::COMBAT, "Aimbot, but for bows") { registerBoolSetting("silent", &this->silent, this->silent); + registerBoolSetting("predict", &this->predict, this->predict); + registerBoolSetting("visualize", &this->visualize, this->visualize); } BowAimbot::~BowAimbot() { @@ -53,6 +56,14 @@ void BowAimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec3_t origin = g_Data.getLocalPlayer()->eyePos0; // TODO: sort list C_Entity* entity = targetList[0]; vec3_t pos = entity->aabb.centerPoint(); + if (predict) { + vec3_t velocity = entity->getPos()->sub(*entity->getPosOld()); + velocity.x *= origin.dist(pos) / 2.f; + velocity.z *= origin.dist(pos) / 2.f; + pos = pos.add(velocity); + } + if(visualize) + DrawUtils::drawBox(pos.sub(0.5), pos.add(0.5), 0.3f, true); pos = pos.sub(origin); float yaw = (atan2f(pos.z, pos.x) * DEG_RAD) - 90; float len = pos.magnitudexz(); diff --git a/Horion/Module/Modules/BowAimbot.h b/Horion/Module/Modules/BowAimbot.h index 35ca94fa..378ce3e3 100644 --- a/Horion/Module/Modules/BowAimbot.h +++ b/Horion/Module/Modules/BowAimbot.h @@ -3,6 +3,8 @@ class BowAimbot : public IModule { private: bool silent = true; + bool predict = false; + bool visualize = false; vec2_t angle; public: From 6a0f48d26663c75cd187bcc8bdb1ff5063b65df7 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 25 Oct 2020 15:16:28 +0100 Subject: [PATCH 181/419] Tessellate blocks into the world (implemented Matrix stack, block tessellator, Materials) --- Horion.vcxproj | 2 + Horion/DrawUtils.cpp | 24 ++++--- Horion/DrawUtils.h | 5 +- Horion/Module/Modules/TestModule.cpp | 93 ++++++++++++++++++++-------- SDK/CBlockLegacy.h | 6 +- SDK/CClientInstance.cpp | 16 +++++ SDK/CClientInstance.h | 80 +++++++++++++++++++++++- SDK/CEntity.h | 2 +- SDK/Tessellator.cpp | 15 +++++ SDK/Tessellator.h | 22 +++++++ 10 files changed, 226 insertions(+), 39 deletions(-) create mode 100644 SDK/Tessellator.cpp create mode 100644 SDK/Tessellator.h diff --git a/Horion.vcxproj b/Horion.vcxproj index e2235351..313b28a0 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -401,6 +401,7 @@ + @@ -613,6 +614,7 @@ + diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 8765c8e9..cfed562f 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -8,14 +8,14 @@ struct MaterialPtr { char padding[0x138]; }; -using tess_vertex_t = void(__fastcall*)(__int64 _this, float v1, float v2, float v3); -using tess_end_t = void(__fastcall*)(__int64, __int64 tesselator, MaterialPtr*); +using tess_vertex_t = void(__fastcall*)(Tessellator* _this, float v1, float v2, float v3); +using tess_end_t = void(__fastcall*)(__int64, Tessellator* tesselator, MaterialPtr*); C_MinecraftUIRenderContext* renderCtx; C_GuiData* guiData; __int64 screenContext2d; __int64 game3dContext; -__int64 tesselator; +Tessellator* tesselator; float* colorHolder; std::shared_ptr refdef; vec2_t fov; @@ -56,7 +56,7 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { renderCtx = ctx; screenContext2d = reinterpret_cast<__int64*>(renderCtx)[2]; - tesselator = *reinterpret_cast<__int64*>(screenContext2d + 0xB0); + tesselator = *reinterpret_cast(screenContext2d + 0xB0); colorHolder = *reinterpret_cast(screenContext2d + 0x30); glmatrixf* badrefdef = g_Data.getClientInstance()->getRefDef(); @@ -107,6 +107,15 @@ C_Font* DrawUtils::getFont(Fonts font) { } } +Tessellator* DrawUtils::get3dTessellator() { + auto myTess = *reinterpret_cast(game3dContext + 0xB0); + return myTess; +} + +__int64 DrawUtils::get3dScreenContext() { + return game3dContext; +} + float DrawUtils::getTextWidth(std::string* textStr, float textSize, Fonts font) { TextHolder text(*textStr); @@ -461,7 +470,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { if(game3dContext == 0 || entityFlatStaticMaterial == 0) return; - auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); + auto myTess = DrawUtils::get3dTessellator(); DrawUtils::tess__begin(myTess, 4, 2); @@ -477,7 +486,8 @@ void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { DrawUtils::setColor(col.r, col.g, col.b, alpha); DrawUtils::drawQuad({pos.x, pos.w}, {pos.z, pos.w}, {pos.z, pos.y}, {pos.x, pos.y}); } -void DrawUtils::tess__begin(__int64 tesselator, int vertexFormat, int numVerticesReserved) { +void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVerticesReserved) { + __int64 tesselator = reinterpret_cast<__int64>(tess); if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); *(unsigned char*)(tesselator + 8) = vertexFormat; @@ -527,7 +537,7 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { if(game3dContext == 0 || entityFlatStaticMaterial == 0) return; - auto myTess = *reinterpret_cast<__int64*>(game3dContext + 0xB0); + auto myTess = DrawUtils::get3dTessellator(); DrawUtils::tess__begin(myTess, 5, (int)points.size()); diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 9f39a33f..6901fe0a 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -3,6 +3,7 @@ #include "../Memory/GameData.h" #include "../SDK/CClientInstance.h" #include "../SDK/CMinecraftUIRenderContext.h" +#include "../SDK/Tessellator.h" #include "../Utils/HMath.h" #include "../Utils/Target.h" #include "../Utils/Utils.h" @@ -83,8 +84,10 @@ class DrawUtils { static void setGameRenderContext(__int64 ctx); static void flush(); static void setColor(float r, float g, float b, float a); // rgba, values from 0 to 1 - static inline void tess__begin(__int64 tesselator, int vertexFormat = 3, int numVerticesReserved = 0); + static inline void tess__begin(Tessellator* tesselator, int vertexFormat = 3, int numVerticesReserved = 0); static C_Font* getFont(Fonts font); + static Tessellator* get3dTessellator(); + static __int64 get3dScreenContext(); static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); static float getFontHeight(float textSize = 1, Fonts font = Fonts::SMOOTH); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 8d921f85..3cc3459d 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,6 +1,15 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" #include "../../DrawUtils.h" +#include +#include +#include //radians +#include // perspective, translate, rotate +#include +#include +#include +#include +#include TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { registerFloatSetting("float1", &this->float1, 0, -10, 10); @@ -33,9 +42,7 @@ void TestModule::onTick(C_GameMode* gm) { //if (gm->player->velocity.y > 0) //logF("%.4f %.4f", gm->player->velocity.y, gm->player->aabb.lower.y); - int dim = -5; - gm->player->getDimensionId(&dim); - logF("%i", dim); + } void TestModule::onMove(C_MoveInputHandler* hand){ @@ -56,34 +63,68 @@ void TestModule::onDisable() { } float t = 0; void TestModule::onLevelRender() { - t++; - DrawUtils::setColor(1, 0.2f, 0.2f, 1); + DrawUtils::setColor(0.5f, 0.5f, 0.5f, 1); - vec3_t permutations[36]; - for(int i = 0; i < 36; i++){ - permutations[i] = {sinf((i * 10.f) / (180 / PI)), 0.f, cosf((i * 10.f) / (180 / PI))}; - } + auto blockTess = g_Data.getClientInstance()->levelRenderer->blockTessellator; + auto tess = DrawUtils::get3dTessellator(); + + vec3_ti pos(3, 3, 3); + auto block = g_Data.getLocalPlayer()->region->getBlock(pos); + + struct tex_t{ + __int64* atlas, *light; + } textures; + struct data_t { + __int64 one; + tex_t* two; + } data; + using renderMesh_t = __int64 (*)(__int64, __int64, mce::MaterialPtr*, data_t*); + static renderMesh_t renderMesh = reinterpret_cast(FindSignature("40 53 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F1 4D 8B E0 4C")); + + struct matStack { + std::deque stack; + bool isDirty; + + glm::mat4x4& push() { + const auto latestAndGreatest = this->stack.back(); + this->stack.push_back(latestAndGreatest); + return this->stack.back(); + } + + void pop() { + this->stack.pop_back(); + } + }; + + matStack* matStackPtr = reinterpret_cast(*reinterpret_cast<__int64*>(DrawUtils::get3dScreenContext() + 0x18i64) + 0x30i64); + + matStackPtr->isDirty = 1; + auto& newMat = matStackPtr->push(); + + auto origin = DrawUtils::getOrigin(); + auto temp = DrawUtils::getOrigin().add(pos.toFloatVector()).mul(-1); + + static float t = 0; + t+=3; + auto preRotTranslation = glm::translate(glm::mat4(1.f), glm::vec3(-0.5f, -0.5f, -0.5f)); + auto afterRotTranslation = glm::translate(glm::mat4(1.f), glm::vec3(0.5f, 0.5f, 0.5f)); + auto rotation = afterRotTranslation * glm::rotate(glm::mat4(1.f), glm::radians(t), glm::vec3(0, 1, 0)) * preRotTranslation; - const float coolAnim = 0.9f + 0.9f * sin((t / 60) * PI * 2); + auto translation = glm::translate(glm::mat4(1.f), glm::vec3(-origin.x, -origin.y, -origin.z)); + newMat = translation * rotation; - g_Data.forEachEntity([&](auto c, auto _){ - vec3_t* start = c->getPosOld(); - vec3_t* end = c->getPos(); + vec3_ti zer = {0, 0, 0}; + auto mesh = blockTess->getMeshForBlockInWorld(tess, block, zer); - auto te = DrawUtils::getLerpTime(); - vec3_t pos = start->lerp(end, te); + textures.atlas = g_Data.getClientInstance()->levelRenderer->atlasTexture.getClientTexture(); + textures.light = *reinterpret_cast<__int64**>(g_Data.getClientInstance()->getLightTexture() + 0x18); - auto yPos = pos.y; - yPos -= 1.62f; - yPos += coolAnim; + data.one = 2; + data.two = &textures; - std::vector posList; - posList.reserve(36); - for(auto& perm : permutations){ - vec3_t curPos(pos.x, yPos, pos.z); - posList.push_back(curPos.add(perm)); - } + static mce::MaterialPtr defaultMat("moving_block"); + renderMesh(mesh, DrawUtils::get3dScreenContext() + 0x10, &defaultMat, &data); - DrawUtils::drawLinestrip3d(posList); - }); + matStackPtr->isDirty = 1; + matStackPtr->pop(); } diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 97558949..635ccb55 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -52,9 +52,6 @@ class C_BlockLegacy { }; class C_Block { -private: - uintptr_t** vtable; - public: uint8_t data; // 0x8 @@ -65,6 +62,9 @@ class C_Block { C_BlockLegacy** blockLegacy; // 0x10 inline C_BlockLegacy* toLegacy() { return *blockLegacy; } + + virtual ~C_Block(); + virtual int getRenderLayer(); }; class CompoundTag; diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index 90d511dd..20f87135 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -41,3 +41,19 @@ void C_GuiData::displayClientMessageNoSendF(const char *fmt, ...) { displayClientMessageVA(fmt, arg, false); va_end(arg); } + +mce::MaterialPtr::MaterialPtr(const std::string &materialName) { + + using materialPtrConst_t = void(__fastcall*)(mce::MaterialPtr *, __int64, const HashedString&); + static materialPtrConst_t materialPtrConst = reinterpret_cast(FindSignature("48 89 4C 24 ?? 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 5C 24 ?? 48 89 74 24 ?? 4C 8B CA")); + + static __int64 renderGroupBase = 0; + if (renderGroupBase == 0){ + auto sig = FindSignature("48 8D 15 ?? ?? ?? ?? 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 48 8D 54 24 ?? 49 8D 8F") + 3; + auto off = *reinterpret_cast(sig); + renderGroupBase = sig + 4 + off; + } + + HashedString hashedStr(materialName); + materialPtrConst(this, renderGroupBase, hashedStr); +} diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 467c9557..fa6c6cd0 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -13,9 +13,85 @@ class Minecraft { float* timer; //0x00B0 }; +class Tessellator; +class C_Block; + +class BlockTessellator; +class ResourceLocation { +private: + char pad[0x28]; + __int64 hashCode; // 0x28 + char pad2[8]; +}; + +class HashedString { +private: + unsigned __int64 hash; + TextHolder text; // 0x0008 + +public: + HashedString(const std::string& text) { + this->text.setText(text); + + this->computeHash(); + } + + void computeHash() { + hash = 0xCBF29CE484222325i64; + if (this->text.getTextLength() <= 0) + return; + char* textP = this->text.getText(); + auto c = *textP; + + do { + hash = c ^ 0x100000001B3i64 * hash; + c = *++textP; + } while (*textP); + } + + unsigned __int64 getHash() { + return this->hash; + } +}; + +namespace mce { + class TextureGroup; + class TexturePtr { + private: + __int64* clientTexture; + char pad[0x8]; + ResourceLocation resourceLocation; // 0x10 + + public: + __int64* getClientTexture() { + return this->clientTexture; + } + }; + class MaterialPtr { + private: + std::shared_ptr materialPtr; + + public: + MaterialPtr(const std::string& materialName); + }; + } + + class LevelRenderer { private: - char pad_0x0000[0x870]; //0x0000 + char pad_0x0000[0x58]; //0x0000 +public: + mce::TextureGroup* textureGroup; // 0x0058 +private: + char pad_0x0060[0xE0]; //0x0060 +public: + mce::TexturePtr atlasTexture; // 0x140 +private: + char pad_0x0188[0x150]; //0x0188 +public: + BlockTessellator* blockTessellator; // 0x02D8 +private: + char pad_0x02F0[0x590]; //0x02E0 public: vec3_t origin; //0x0870 @@ -431,6 +507,8 @@ class C_ClientInstance { virtual C_CameraManager* getCameraManager(void) const; private: virtual __int64 sub_1400CCC08(void) const; + +public: virtual __int64 getLightTexture(void); public: diff --git a/SDK/CEntity.h b/SDK/CEntity.h index d9554fff..c0af5db7 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -310,7 +310,7 @@ class C_Entity { virtual __int64 feed(int); virtual __int64 handleEntityEvent(__int64, int); virtual __int64 getPickRadius(void); - virtual const struct HashedString* getActorRendererId(void); + virtual const class HashedString* getActorRendererId(void); virtual __int64 spawnAtLocation(int, int); virtual __int64 spawnAtLocation(int, int, float); virtual __int64 spawnAtLocation(__int64 const &, int); diff --git a/SDK/Tessellator.cpp b/SDK/Tessellator.cpp new file mode 100644 index 00000000..92de7f82 --- /dev/null +++ b/SDK/Tessellator.cpp @@ -0,0 +1,15 @@ +#include "Tessellator.h" + +#include "../Utils/Utils.h" +#include "CBlockLegacy.h" + +void Tessellator::addPostTransformOffset(float x, float y, float z) { + this->transformOffset = this->transformOffset.add(x, y, z); +} + +__int64 BlockTessellator::getMeshForBlockInWorld(Tessellator *t, C_Block *block, vec3_ti &pos) { + using BT_getMeshForBlockInWorld_t = __int64 (*)(BlockTessellator *, Tessellator *, C_Block *, vec3_ti &, int, __int64); + static BT_getMeshForBlockInWorld_t getMeshForBlock = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4D 8B F1 4D 8B F8 48")); + + return getMeshForBlock(this, t, block, pos, block->getRenderLayer(), 0); +} diff --git a/SDK/Tessellator.h b/SDK/Tessellator.h new file mode 100644 index 00000000..b6513c9d --- /dev/null +++ b/SDK/Tessellator.h @@ -0,0 +1,22 @@ +#pragma once + +#include "../Utils/HMath.h" + +class Tessellator { +private: + char pad_0000[0x128]; + vec3_t transformOffset; // 0x128 + +public: + void addPostTransformOffset(int x, int y, int z) { + addPostTransformOffset((float)x, (float)y, (float)z); + } + void addPostTransformOffset(float x, float y, float z); +}; + +class C_Block; + +class BlockTessellator { +public: + __int64 getMeshForBlockInWorld(Tessellator * t, C_Block * block, vec3_ti & pos); +}; \ No newline at end of file From 4dc5306bb494abe6bbbda36f70ac9e6f677a6c9a Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 25 Oct 2020 16:00:13 +0100 Subject: [PATCH 182/419] Refactor and cleanup --- Horion/Module/Modules/TestModule.cpp | 38 +++++++++++++--------------- SDK/CClientInstance.cpp | 14 ++++++++++ SDK/CClientInstance.h | 10 ++++++++ SDK/Tessellator.cpp | 5 ++-- SDK/Tessellator.h | 6 ++++- 5 files changed, 50 insertions(+), 23 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 3cc3459d..fea65ed7 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -2,6 +2,7 @@ #include "../../../Utils/Logger.h" #include "../../DrawUtils.h" #include +#include #include #include //radians #include // perspective, translate, rotate @@ -71,16 +72,7 @@ void TestModule::onLevelRender() { vec3_ti pos(3, 3, 3); auto block = g_Data.getLocalPlayer()->region->getBlock(pos); - struct tex_t{ - __int64* atlas, *light; - } textures; - struct data_t { - __int64 one; - tex_t* two; - } data; - using renderMesh_t = __int64 (*)(__int64, __int64, mce::MaterialPtr*, data_t*); - static renderMesh_t renderMesh = reinterpret_cast(FindSignature("40 53 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F1 4D 8B E0 4C")); - + struct matStack { std::deque stack; bool isDirty; @@ -115,16 +107,22 @@ void TestModule::onLevelRender() { vec3_ti zer = {0, 0, 0}; auto mesh = blockTess->getMeshForBlockInWorld(tess, block, zer); - - textures.atlas = g_Data.getClientInstance()->levelRenderer->atlasTexture.getClientTexture(); - textures.light = *reinterpret_cast<__int64**>(g_Data.getClientInstance()->getLightTexture() + 0x18); - - data.one = 2; - data.two = &textures; - - static mce::MaterialPtr defaultMat("moving_block"); - renderMesh(mesh, DrawUtils::get3dScreenContext() + 0x10, &defaultMat, &data); - + + static std::array mats = {{mce::MaterialPtr("moving_block_double_side"), + mce::MaterialPtr("moving_block_blend"), + mce::MaterialPtr("moving_block"), + mce::MaterialPtr("moving_block_alpha"), + mce::MaterialPtr("moving_block_alpha"), + mce::MaterialPtr("moving_block_seasons"), + mce::MaterialPtr("moving_block_alpha_seasons"), + mce::MaterialPtr("moving_block_alpha_single_side")}}; + + std::array<__int64*, 2> textures; + textures[0] = g_Data.getClientInstance()->levelRenderer->atlasTexture.getClientTexture(); + textures[1] = *reinterpret_cast<__int64**>(g_Data.getClientInstance()->getLightTexture() + 0x18); + + mesh->renderMesh(DrawUtils::get3dScreenContext(), &mats[block->getRenderLayer()], textures); + matStackPtr->isDirty = 1; matStackPtr->pop(); } diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index 20f87135..1f8119ad 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -57,3 +57,17 @@ mce::MaterialPtr::MaterialPtr(const std::string &materialName) { HashedString hashedStr(materialName); materialPtrConst(this, renderGroupBase, hashedStr); } + +void mce::Mesh::renderMesh(__int64 screenContext, mce::MaterialPtr *material, size_t numTextures, __int64 **textureArray) { + struct TextureData { + size_t numTextures; + __int64 **texturePtr; + } data; + using renderMesh_t = __int64 (*)(mce::Mesh*, __int64, mce::MaterialPtr *, TextureData *); + static renderMesh_t renderMesh = reinterpret_cast(FindSignature("40 53 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F1 4D 8B E0 4C")); + + data.numTextures = numTextures; + data.texturePtr = textureArray; + + renderMesh(this, screenContext + 0x10, material, &data); +} diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index fa6c6cd0..7166696d 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -56,6 +56,16 @@ class HashedString { namespace mce { class TextureGroup; + class MaterialPtr; + class Mesh { + public: + void renderMesh(__int64 screenContext, mce::MaterialPtr* material, size_t numTextures, __int64** textureArray); + + template + void renderMesh(__int64 screenContext, mce::MaterialPtr* material, std::array<__int64*, numTextures> textures) { + this->renderMesh(screenContext, material, numTextures, &textures[0]); + } + }; class TexturePtr { private: __int64* clientTexture; diff --git a/SDK/Tessellator.cpp b/SDK/Tessellator.cpp index 92de7f82..dcf7a3ae 100644 --- a/SDK/Tessellator.cpp +++ b/SDK/Tessellator.cpp @@ -2,13 +2,14 @@ #include "../Utils/Utils.h" #include "CBlockLegacy.h" +#include "CClientInstance.h" void Tessellator::addPostTransformOffset(float x, float y, float z) { this->transformOffset = this->transformOffset.add(x, y, z); } -__int64 BlockTessellator::getMeshForBlockInWorld(Tessellator *t, C_Block *block, vec3_ti &pos) { - using BT_getMeshForBlockInWorld_t = __int64 (*)(BlockTessellator *, Tessellator *, C_Block *, vec3_ti &, int, __int64); +mce::Mesh* BlockTessellator::getMeshForBlockInWorld(Tessellator *t, C_Block *block, vec3_ti &pos) { + using BT_getMeshForBlockInWorld_t = mce::Mesh* (*)(BlockTessellator *, Tessellator *, C_Block *, vec3_ti &, int, __int64); static BT_getMeshForBlockInWorld_t getMeshForBlock = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4D 8B F1 4D 8B F8 48")); return getMeshForBlock(this, t, block, pos, block->getRenderLayer(), 0); diff --git a/SDK/Tessellator.h b/SDK/Tessellator.h index b6513c9d..0d0e86be 100644 --- a/SDK/Tessellator.h +++ b/SDK/Tessellator.h @@ -16,7 +16,11 @@ class Tessellator { class C_Block; +namespace mce { +class Mesh; +} + class BlockTessellator { public: - __int64 getMeshForBlockInWorld(Tessellator * t, C_Block * block, vec3_ti & pos); + mce::Mesh* getMeshForBlockInWorld(Tessellator * t, C_Block * block, vec3_ti & pos); }; \ No newline at end of file From 59d53d7684ad3702d28cf1afde1159861102dfbd Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 25 Oct 2020 17:18:03 +0100 Subject: [PATCH 183/419] Implement Matrix Stack properly --- Horion.vcxproj | 2 ++ Horion/DrawUtils.cpp | 8 +++-- Horion/DrawUtils.h | 5 ++- Horion/Module/Modules/TestModule.cpp | 27 +++------------- SDK/CItem.cpp | 2 +- SDK/MatrixStack.cpp | 5 +++ SDK/MatrixStack.h | 46 ++++++++++++++++++++++++++++ 7 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 SDK/MatrixStack.cpp create mode 100644 SDK/MatrixStack.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 313b28a0..2c2effe3 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -400,6 +400,7 @@ + @@ -612,6 +613,7 @@ + diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index cfed562f..9d86208d 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -112,8 +112,12 @@ Tessellator* DrawUtils::get3dTessellator() { return myTess; } -__int64 DrawUtils::get3dScreenContext() { - return game3dContext; +__int64 DrawUtils::getScreenContext() { + return game3dContext == 0 ? screenContext2d : game3dContext; +} + +MatrixStack* DrawUtils::getMatrixStack() { + return reinterpret_cast(*reinterpret_cast<__int64*>(DrawUtils::getScreenContext() + 0x18i64) + 0x30i64); } float DrawUtils::getTextWidth(std::string* textStr, float textSize, Fonts font) { diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 6901fe0a..15284d40 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -78,6 +78,8 @@ enum VertexFormat { }; +class MatrixStack; + class DrawUtils { public: static void setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* guiData); @@ -87,7 +89,8 @@ class DrawUtils { static inline void tess__begin(Tessellator* tesselator, int vertexFormat = 3, int numVerticesReserved = 0); static C_Font* getFont(Fonts font); static Tessellator* get3dTessellator(); - static __int64 get3dScreenContext(); + static __int64 getScreenContext(); + static MatrixStack* getMatrixStack(); static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); static float getFontHeight(float textSize = 1, Fonts font = Fonts::SMOOTH); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index fea65ed7..01ef7eb7 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,6 +1,7 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" #include "../../DrawUtils.h" +#include "../../../SDK/MatrixStack.h" #include #include #include @@ -72,25 +73,8 @@ void TestModule::onLevelRender() { vec3_ti pos(3, 3, 3); auto block = g_Data.getLocalPlayer()->region->getBlock(pos); - - struct matStack { - std::deque stack; - bool isDirty; - - glm::mat4x4& push() { - const auto latestAndGreatest = this->stack.back(); - this->stack.push_back(latestAndGreatest); - return this->stack.back(); - } - - void pop() { - this->stack.pop_back(); - } - }; + MatrixStack* matStackPtr = DrawUtils::getMatrixStack(); - matStack* matStackPtr = reinterpret_cast(*reinterpret_cast<__int64*>(DrawUtils::get3dScreenContext() + 0x18i64) + 0x30i64); - - matStackPtr->isDirty = 1; auto& newMat = matStackPtr->push(); auto origin = DrawUtils::getOrigin(); @@ -103,7 +87,7 @@ void TestModule::onLevelRender() { auto rotation = afterRotTranslation * glm::rotate(glm::mat4(1.f), glm::radians(t), glm::vec3(0, 1, 0)) * preRotTranslation; auto translation = glm::translate(glm::mat4(1.f), glm::vec3(-origin.x, -origin.y, -origin.z)); - newMat = translation * rotation; + *newMat = translation * rotation; vec3_ti zer = {0, 0, 0}; auto mesh = blockTess->getMeshForBlockInWorld(tess, block, zer); @@ -121,8 +105,5 @@ void TestModule::onLevelRender() { textures[0] = g_Data.getClientInstance()->levelRenderer->atlasTexture.getClientTexture(); textures[1] = *reinterpret_cast<__int64**>(g_Data.getClientInstance()->getLightTexture() + 0x18); - mesh->renderMesh(DrawUtils::get3dScreenContext(), &mats[block->getRenderLayer()], textures); - - matStackPtr->isDirty = 1; - matStackPtr->pop(); + mesh->renderMesh(DrawUtils::getScreenContext(), &mats[block->getRenderLayer()], textures); } diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 98df2ee2..93763d27 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -13,7 +13,7 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 20 0F 29 70 B8 48 8B 05 ?? ?? ?? ??")); - item->setShowPickUp(true); + item->setShowPickUp(false); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } diff --git a/SDK/MatrixStack.cpp b/SDK/MatrixStack.cpp new file mode 100644 index 00000000..2a9cad1f --- /dev/null +++ b/SDK/MatrixStack.cpp @@ -0,0 +1,5 @@ +#include "MatrixStack.h" + +MatrixStackRef::~MatrixStackRef() { + this->stack->pop(); +} diff --git a/SDK/MatrixStack.h b/SDK/MatrixStack.h new file mode 100644 index 00000000..a2827ab5 --- /dev/null +++ b/SDK/MatrixStack.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +class MatrixStack; + +class MatrixStackRef { +private: + MatrixStack* stack; + glm::mat4x4& myPtr; + +public: + MatrixStackRef(MatrixStack* st, glm::mat4x4& top) : stack(st), myPtr(top){}; + ~MatrixStackRef(); + + auto& operator->() { + return myPtr; + } + auto& operator*() { + return myPtr; + } +}; + +class MatrixStack { +private: + std::deque stack; + bool isDirty; + +public: + MatrixStackRef push() { + this->isDirty = 1; + const auto latestAndGreatest = this->stack.back(); + this->stack.push_back(latestAndGreatest); + return MatrixStackRef(this, this->stack.back()); + } + + void pop() { + this->isDirty = 1; + this->stack.pop_back(); + } + + glm::mat4x4& top() { + return this->stack.back(); + } +}; \ No newline at end of file From 7b9b9250fc1d25f60b4341f07a6557a0a67a1d2d Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 25 Oct 2020 18:21:48 +0100 Subject: [PATCH 184/419] Fix message too long for buffer --- Horion/Scripting/Functions/GlobalFunctions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Horion/Scripting/Functions/GlobalFunctions.cpp b/Horion/Scripting/Functions/GlobalFunctions.cpp index 64c3a91a..e769b130 100644 --- a/Horion/Scripting/Functions/GlobalFunctions.cpp +++ b/Horion/Scripting/Functions/GlobalFunctions.cpp @@ -21,7 +21,8 @@ JsValueRef CALLBACK GlobalFunctions::log(JsValueRef callee, bool isConstructCall } #ifdef _DEBUG - logF("Script: %S", strstream.str().c_str()); + auto string = strstream.str(); + Logger::WriteBigLogFileF(string.size() + 11, "Script: %S", string.c_str()); #else auto obj = reinterpret_cast(callbackState); From 2c2c3e9e0734ff52c6d69daf788bd84d78cb7500 Mon Sep 17 00:00:00 2001 From: Mixu Date: Mon, 26 Oct 2020 17:41:49 +0200 Subject: [PATCH 185/419] Scripting: LocalPlayer getInventory and getInventorySlot functions --- .../Functions/LocalPlayerFunctions.cpp | 112 ++++++++++++++++++ .../Functions/LocalPlayerFunctions.h | 2 + Horion/Scripting/ScriptManager.cpp | 2 + 3 files changed, 116 insertions(+) diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 72bf92e7..5adf31ea 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -80,3 +80,115 @@ JsValueRef CALLBACK LocalPlayerFunctions::setIsOnGround(JsValueRef callee, bool ent->onGround = isOnGroundOptional.value(); return chakra.trueValue(); } + +JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + int slot; + const auto plr = reinterpret_cast(ent); + + Logger::SendToConsoleF("Start"); + + if (argumentCount < 2) { + THROW(L"Argument 1 missing"); + } + + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + + if (type != JsNumber) { + THROW(L"Argument 1 must be a number"); + } + if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { + THROW(L"Argument 1 not a valid number"); + } + if ( + !(slot >= 0 && slot <= 35) && + !(slot >= 100 && slot <= 103) && + !(slot == -106) + ) { + THROW(L"Argument 1 must be a valid slot id(0-35, 100-103, -106)"); + } + + JsValueRef item; + chakra.JsCreateObject_(&item); + + const auto stack = plr->getSupplies()->inventory->getItemStack(slot); + + const wchar_t* airName = L"air"; + + if (stack == nullptr || !stack->isValid()) { + JsValueRef itemName; + chakra.JsPointerToString_(airName, wcslen(airName), &itemName); + + chakra.addPropertyToObj(item, L"name", itemName); + chakra.addPropertyToObj(item, L"id", chakra.toNumber(0)); + chakra.addPropertyToObj(item, L"amount", chakra.toNumber(0)); + } else { + auto name = stack->getItem()->name.getText(); + JsValueRef itemName; + + std::wstring charName = Utils::stringToWstring(name); + + chakra.JsPointerToString_(charName.c_str(), wcslen(charName.c_str()), &itemName); + + chakra.addPropertyToObj(item, L"name", itemName); + chakra.addPropertyToObj(item, L"id", chakra.toNumber(stack->getItem()->itemId)); + chakra.addPropertyToObj(item, L"amount", chakra.toNumber(stack->count)); + } + + return item; +} + +JsValueRef CALLBACK LocalPlayerFunctions::getInventory(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + const auto plr = reinterpret_cast(ent); + + JsValueRef inventoryArr; + chakra.JsCreateArray_(35, &inventoryArr); + + const wchar_t* airName = L"air"; + + for (int i = 0; i < 36; i++) { + auto stack = plr->getSupplies()->inventory->getItemStack(i); + + if (stack == nullptr || !stack->isValid()) { + JsValueRef jsItem; + chakra.JsCreateObject_(&jsItem); + + JsValueRef itemName; + chakra.JsPointerToString_(airName, wcslen(airName), &itemName); + + chakra.addPropertyToObj(jsItem, L"name", itemName); + chakra.addPropertyToObj(jsItem, L"id", chakra.toNumber(0)); + chakra.addPropertyToObj(jsItem, L"amount", chakra.toNumber(0)); + + chakra.arraySet(inventoryArr, i, jsItem); + } else { + JsValueRef jsItem; + chakra.JsCreateObject_(&jsItem); + + auto name = stack->getItem()->name.getText(); + JsValueRef itemName; + + std::wstring charName = Utils::stringToWstring(name); + + chakra.JsPointerToString_(charName.c_str(), wcslen(charName.c_str()), &itemName); + + chakra.addPropertyToObj(jsItem, L"name", itemName); + chakra.addPropertyToObj(jsItem, L"id", chakra.toNumber(stack->getItem()->itemId)); + chakra.addPropertyToObj(jsItem, L"amount", chakra.toNumber(stack->count)); + + chakra.arraySet(inventoryArr, i, jsItem); + } + }; + + return inventoryArr; +} diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.h b/Horion/Scripting/Functions/LocalPlayerFunctions.h index 1792ad6b..a68a3796 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.h +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.h @@ -12,4 +12,6 @@ class LocalPlayerFunctions { DECL_FUN(toString); DECL_FUN(setViewAngles); DECL_FUN(setIsOnGround); + DECL_FUN(getInventory); + DECL_FUN(getInventorySlot); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 4afaef71..d9e71ad6 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -106,6 +106,8 @@ void ScriptManager::prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects chakra.defineFunction(proto, L"toString", LocalPlayerFunctions::toString, objs); chakra.defineFunction(proto, L"setViewAngles", LocalPlayerFunctions::setViewAngles, objs); chakra.defineFunction(proto, L"setIsOnGround", LocalPlayerFunctions::setIsOnGround, objs); + chakra.defineFunction(proto, L"getInventory", LocalPlayerFunctions::getInventory, objs); + chakra.defineFunction(proto, L"getInventorySlot", LocalPlayerFunctions::getInventorySlot, objs); } void ScriptManager::prepareGameFunctions(JsValueRef global, ContextObjects* objs) { From c20ca0459da7a8ab4f12d1feb50c0a5251486281 Mon Sep 17 00:00:00 2001 From: Mixu Date: Mon, 26 Oct 2020 22:35:56 +0200 Subject: [PATCH 186/419] Remove debug comments --- Horion/Scripting/Functions/LocalPlayerFunctions.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 5adf31ea..75e19071 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -90,8 +90,6 @@ JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bo int slot; const auto plr = reinterpret_cast(ent); - Logger::SendToConsoleF("Start"); - if (argumentCount < 2) { THROW(L"Argument 1 missing"); } From cee3fcf5a2aa389427c11fe39ce55dcadfffda34 Mon Sep 17 00:00:00 2001 From: justinbrick Date: Mon, 26 Oct 2020 18:37:01 -0400 Subject: [PATCH 187/419] Added Top Command Adds a top command which teleports the player to the nearest air pocket above them. If there is no ceiling above them it won't teleport. --- Horion.vcxproj | 2 ++ Horion/Command/CommandMgr.cpp | 1 + Horion/Command/CommandMgr.h | 1 + Horion/Command/Commands/TopCommand.cpp | 39 ++++++++++++++++++++++++++ Horion/Command/Commands/TopCommand.h | 9 ++++++ 5 files changed, 52 insertions(+) create mode 100644 Horion/Command/Commands/TopCommand.cpp create mode 100644 Horion/Command/Commands/TopCommand.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 2c2effe3..097b38c3 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -263,6 +263,7 @@ + @@ -444,6 +445,7 @@ + diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index 65f1d416..3778bdc4 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -41,6 +41,7 @@ void CommandMgr::initCommands() { commandList.push_back(new SetprefixCommand()); commandList.push_back(new NbtCommand()); commandList.push_back(new WaypointCommand()); + commandList.push_back(new TopCommand()); commandList.push_back(new CommandBlockExploitCommand()); commandList.push_back(new NameSpoofCommand()); diff --git a/Horion/Command/CommandMgr.h b/Horion/Command/CommandMgr.h index dc1ca31d..d9ca603b 100644 --- a/Horion/Command/CommandMgr.h +++ b/Horion/Command/CommandMgr.h @@ -23,6 +23,7 @@ #include "Commands/SpammerCommand.h" #include "Commands/TeleportCommand.h" #include "Commands/ToggleCommand.h" +#include "Commands/TopCommand.h" #include "Commands/UnbindCommand.h" #include "Commands/setoffhandCommand.h" #include "Commands/CommandBlockExploitCommand.h" diff --git a/Horion/Command/Commands/TopCommand.cpp b/Horion/Command/Commands/TopCommand.cpp new file mode 100644 index 00000000..349ad847 --- /dev/null +++ b/Horion/Command/Commands/TopCommand.cpp @@ -0,0 +1,39 @@ +#include "TopCommand.h" + +TopCommand::TopCommand() : IMCCommand("top", "Teleports to the nearest pocket of air above you - highly recommended against using this inside the Nether.", "") { +} + +TopCommand::~TopCommand() { +} + +bool TopCommand::execute(std::vector* args) { + assertTrue(g_Data.getLocalPlayer() != nullptr); + + C_LocalPlayer* player = g_Data.getLocalPlayer(); + vec3_t playerPos = player->eyePos0; + bool groundAbove = false; //Checking if ground above us. + vec3_t blockPos; + + for (int y(0); y < 256 - playerPos.y; ++y) { + if (player->region->getBlock(vec3_t{playerPos.x, playerPos.y + y, playerPos.z})->toLegacy()->blockId != 0) { + groundAbove = true; + blockPos = vec3_t{playerPos.x, playerPos.y + y, playerPos.z}; + break; + } + } + + if (groundAbove) { + for (int y(0); y < 256 - blockPos.y; ++y) { //This time we're going through loop again, but continuing where we left off to find open air pocket. + if ((player->region->getBlock(vec3_t{blockPos.x, blockPos.y + y, blockPos.z})->toLegacy()->blockId == 0) && (player->region->getBlock(vec3_t{blockPos.x, blockPos.y + y + 1, blockPos.z})->toLegacy()->blockId == 0)) { + player->setPos(vec3_t{blockPos.x, blockPos.y + y + 2, blockPos.z}); + clientMessageF("Whoosh!"); + return true; + } + } + clientMessageF("There is no open space above you!"); + return false; + } else { + clientMessageF("There are no blocks above you!"); + return false; + } +} \ No newline at end of file diff --git a/Horion/Command/Commands/TopCommand.h b/Horion/Command/Commands/TopCommand.h new file mode 100644 index 00000000..7735d1da --- /dev/null +++ b/Horion/Command/Commands/TopCommand.h @@ -0,0 +1,9 @@ +#pragma once +#include "ICommand.h" +class TopCommand : public IMCCommand { +public: + TopCommand(); + ~TopCommand(); + + virtual bool execute(std::vector* args) override; +}; \ No newline at end of file From 49b98053e4bd614f07cf0fb518dbffa1d5b658be Mon Sep 17 00:00:00 2001 From: justinbrick Date: Mon, 26 Oct 2020 18:56:24 -0400 Subject: [PATCH 188/419] Update TopCommand.cpp --- Horion/Command/Commands/TopCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/TopCommand.cpp b/Horion/Command/Commands/TopCommand.cpp index 349ad847..62ff887b 100644 --- a/Horion/Command/Commands/TopCommand.cpp +++ b/Horion/Command/Commands/TopCommand.cpp @@ -1,6 +1,6 @@ #include "TopCommand.h" -TopCommand::TopCommand() : IMCCommand("top", "Teleports to the nearest pocket of air above you - highly recommended against using this inside the Nether.", "") { +TopCommand::TopCommand() : IMCCommand("top", "Teleports to the nearest pocket of air above you - highly recommend against using this inside the Nether.", "") { } TopCommand::~TopCommand() { From 2c4fe515485c5111ad7620d226901a1a8d0afd09 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 1 Nov 2020 15:22:47 +0100 Subject: [PATCH 189/419] Fix up .top --- Horion/Command/Commands/TopCommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/TopCommand.cpp b/Horion/Command/Commands/TopCommand.cpp index 62ff887b..464073bd 100644 --- a/Horion/Command/Commands/TopCommand.cpp +++ b/Horion/Command/Commands/TopCommand.cpp @@ -25,15 +25,15 @@ bool TopCommand::execute(std::vector* args) { if (groundAbove) { for (int y(0); y < 256 - blockPos.y; ++y) { //This time we're going through loop again, but continuing where we left off to find open air pocket. if ((player->region->getBlock(vec3_t{blockPos.x, blockPos.y + y, blockPos.z})->toLegacy()->blockId == 0) && (player->region->getBlock(vec3_t{blockPos.x, blockPos.y + y + 1, blockPos.z})->toLegacy()->blockId == 0)) { - player->setPos(vec3_t{blockPos.x, blockPos.y + y + 2, blockPos.z}); + player->setPos(vec3_t{blockPos.x, blockPos.y + y + 1, blockPos.z}); clientMessageF("Whoosh!"); return true; } } clientMessageF("There is no open space above you!"); - return false; + return true; } else { clientMessageF("There are no blocks above you!"); - return false; + return true; } } \ No newline at end of file From 1de3f53b0746cb3f572bf3d5b53b6133064d8ea3 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 1 Nov 2020 18:07:22 +0100 Subject: [PATCH 190/419] break blocks properly --- Horion.vcxproj | 1 + Horion/Module/Modules/Nuker.h | 2 +- Horion/Module/Modules/PacketLogger.cpp | 5 +++++ Horion/Module/Modules/TestModule.cpp | 17 ++++++++++++++++- Memory/Hooks.cpp | 2 +- SDK/CEntity.h | 1 - SDK/CGameMode.cpp | 25 +++++++++++++++++++++++++ SDK/CGameMode.h | 8 +++++--- 8 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 SDK/CGameMode.cpp diff --git a/Horion.vcxproj b/Horion.vcxproj index 097b38c3..e458c8a9 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -395,6 +395,7 @@ + diff --git a/Horion/Module/Modules/Nuker.h b/Horion/Module/Modules/Nuker.h index 7b113fb3..b925777a 100644 --- a/Horion/Module/Modules/Nuker.h +++ b/Horion/Module/Modules/Nuker.h @@ -13,7 +13,7 @@ class Nuker : public IModule { ~Nuker(); inline bool isAutoMode() { return autodestroy; }; - inline int getNukerRadius() { return nukerRadius; }; + int getNukerRadius() { return nukerRadius; }; inline bool isVeinMiner() { return veinMiner; }; // Inherited via IModule diff --git a/Horion/Module/Modules/PacketLogger.cpp b/Horion/Module/Modules/PacketLogger.cpp index 3f1d4799..4f5e7873 100644 --- a/Horion/Module/Modules/PacketLogger.cpp +++ b/Horion/Module/Modules/PacketLogger.cpp @@ -11,5 +11,10 @@ const char* PacketLogger::getModuleName() { } void PacketLogger::onSendPacket(C_Packet* packet) { + if (packet->isInstanceOf()) { + auto pk = reinterpret_cast(packet); + g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s action=%i", packet->getName()->getText(), pk->action); + return; + } g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s", packet->getName()->getText()); } diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 01ef7eb7..47739602 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -43,7 +43,19 @@ void TestModule::onTick(C_GameMode* gm) { }*/ //if (gm->player->velocity.y > 0) - //logF("%.4f %.4f", gm->player->velocity.y, gm->player->aabb.lower.y); + auto ptr = g_Data.getClientInstance()->getPointerStruct(); + static int lastStat = 0; + if (ptr->entityPtr == nullptr && ptr->rayHitType == 0 && ptr->block.y > 0) { + bool isDestroyed = false; + gm->survivalDestroyBlockHack(ptr->block, ptr->blockSide, isDestroyed, lastStat == 0); + + + //logF("%i %i %i %i %i", ptr->block.x, ptr->block.y, ptr->block.z, isDestroyed, lastStat); + + lastStat++; + } else + lastStat = 0; + } @@ -58,6 +70,7 @@ void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { } void TestModule::onSendPacket(C_Packet* p) { + } void TestModule::onDisable() { @@ -65,6 +78,8 @@ void TestModule::onDisable() { } float t = 0; void TestModule::onLevelRender() { + if (true) + return; DrawUtils::setColor(0.5f, 0.5f, 0.5f, 1); auto blockTess = g_Data.getClientInstance()->levelRenderer->blockTessellator; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 7afce613..3a442061 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1226,7 +1226,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f if (nukerModule->isEnabled()) { vec3_ti tempPos; - const int range = nukerModule->getNukerRadius(); + int range = nukerModule->getNukerRadius(); const bool isVeinMiner = nukerModule->isVeinMiner(); const bool isAutoMode = nukerModule->isAutoMode(); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index c0af5db7..f6909e2c 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -733,7 +733,6 @@ class C_Player : public C_Entity { public: virtual void setPermissions(int); -private: virtual __int64 startDestroying(void); virtual __int64 stopDestroying(void); diff --git a/SDK/CGameMode.cpp b/SDK/CGameMode.cpp new file mode 100644 index 00000000..fcfd01ca --- /dev/null +++ b/SDK/CGameMode.cpp @@ -0,0 +1,25 @@ +#include "CGameMode.h" +#include "../Memory/GameData.h" + +void C_GameMode::survivalDestroyBlockHack(vec3_ti const &block, int face, bool &isDestroyedOut, bool isFirst) { + auto p = this->player; + p->swing(); + if (isFirst) + this->startDestroyBlock(block, face, isDestroyedOut); + else { + *reinterpret_cast(reinterpret_cast<__int64>(p) + 0x1c5a) = 1; + this->continueDestroyBlock(block, face, isDestroyedOut); + } + + p->startDestroying(); + + // prevents regular code from aborting block-break + *reinterpret_cast(reinterpret_cast<__int64>(p) + 0x1c5a) = 0; + + C_PlayerActionPacket action; + action.action = 18; + action.blockPosition = vec3_t(block.x, block.y, block.z); + action.face = face; + action.entityRuntimeId = p->entityRuntimeId; + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&action); +} diff --git a/SDK/CGameMode.h b/SDK/CGameMode.h index 3516f88c..75cb45fe 100644 --- a/SDK/CGameMode.h +++ b/SDK/CGameMode.h @@ -11,9 +11,9 @@ class C_GameMode { virtual __int64 destructorGameMode(); // Duplicate destructor public: - virtual __int64 startDestroyBlock(vec3_ti const &, unsigned char, bool &); + virtual __int64 startDestroyBlock(vec3_ti const & pos, unsigned char blockSide, bool & isDestroyedOut); virtual __int64 destroyBlock(vec3_ti *, unsigned char); - virtual __int64 continueDestroyBlock(vec3_ti const &, unsigned char, bool &); + virtual __int64 continueDestroyBlock(vec3_ti const &, unsigned char blockSide, bool & isDestroyedOut); virtual __int64 stopDestroyBlock(vec3_ti const &); virtual __int64 startBuildBlock(vec3_ti const &, unsigned char); virtual __int64 buildBlock(vec3_ti *, unsigned char); @@ -41,5 +41,7 @@ class C_GameMode { virtual __int64 registerUpsellScreenCallback(__int64); public: - C_Entity *player; + C_Player *player; + + void survivalDestroyBlockHack(vec3_ti const &block, int face, bool &isDestroyedOut, bool isFirst); }; From 7e40ab5dfc4230a6347f041e010e71f9163489cc Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Fri, 13 Nov 2020 19:07:36 +0100 Subject: [PATCH 191/419] Fast item lerp --- Horion.vcxproj | 2 + Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/VanillaPlus.cpp | 79 +++++++++++++++++++++++++++ Horion/Module/Modules/VanillaPlus.h | 15 +++++ 5 files changed, 98 insertions(+) create mode 100644 Horion/Module/Modules/VanillaPlus.cpp create mode 100644 Horion/Module/Modules/VanillaPlus.h diff --git a/Horion.vcxproj b/Horion.vcxproj index e458c8a9..0a233375 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -359,6 +359,7 @@ + @@ -542,6 +543,7 @@ + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 4e78d185..683207a1 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -100,6 +100,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Spider())); this->moduleList.push_back(std::shared_ptr(new Compass())); this->moduleList.push_back(std::shared_ptr(new Radar())); + this->moduleList.push_back(std::shared_ptr(new VanillaPlus())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 47fd2be9..4b397d70 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -93,6 +93,7 @@ #include "Modules/Spider.h" #include "Modules/Compass.h" #include "Modules/Radar.h" +#include "Modules/VanillaPlus.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/VanillaPlus.cpp b/Horion/Module/Modules/VanillaPlus.cpp new file mode 100644 index 00000000..d7b1d379 --- /dev/null +++ b/Horion/Module/Modules/VanillaPlus.cpp @@ -0,0 +1,79 @@ +#include "VanillaPlus.h" +#include "../../../Utils/Utils.h" +#include + +#include "../../../Utils/Logger.h" + +unsigned char flyingItemsPrevCodeBuf[26]; +unsigned char* flyingItemsFuncPtr = 0; + +bool lastFastFlyingItems = false; + +VanillaPlus::VanillaPlus() : IModule(0, Category::MISC, "Tweaks the minecraft experience") { + registerBoolSetting("Fast Item Lerp", &fastFlyingItems, true); +} + +const char* VanillaPlus::getModuleName() { + return "Vanilla+"; +} + +void VanillaPlus::onEnable() { + // flying items + { + if (flyingItemsFuncPtr == nullptr) + flyingItemsFuncPtr = reinterpret_cast(9 + FindSignature("48 3B D8 0F 84 F8 01 00 00")); + memcpy(flyingItemsPrevCodeBuf, flyingItemsFuncPtr, 26); + + DWORD oldProtect = 0; + if (!VirtualProtect(flyingItemsFuncPtr, 26, PAGE_EXECUTE_READWRITE, &oldProtect)) { +#ifdef _DEBUG + logF("couldnt unprotect memory send help"); + __debugbreak(); +#endif + } else { + auto code = std::initializer_list({0xB9, 0x00, 0x00, 0x00, 0x00, 0x66, 0x44, 0x0F, 0x6E, 0xC9, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x66, 0x44, 0x0F, 0x6E, 0xD9, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}); + std::copy(code.begin(), code.end(), flyingItemsFuncPtr); + *reinterpret_cast(&flyingItemsFuncPtr[1]) = 0.15f; + *reinterpret_cast(&flyingItemsFuncPtr[11]) = 1 / 0.15f; + VirtualProtect(flyingItemsFuncPtr, 26, oldProtect, &oldProtect); + } + } +} + + +void VanillaPlus::onTick(C_GameMode*) { + if (flyingItemsFuncPtr && lastFastFlyingItems != fastFlyingItems) { + DWORD oldProtect = 0; + if (!VirtualProtect(flyingItemsFuncPtr, 26, PAGE_EXECUTE_READWRITE, &oldProtect)) { +#ifdef _DEBUG + logF("couldnt unprotect memory send help"); + __debugbreak(); +#endif + } else { + float val = fastFlyingItems ? 0.025f : 0.15f; + *reinterpret_cast(&flyingItemsFuncPtr[1]) = val; + *reinterpret_cast(&flyingItemsFuncPtr[11]) = 1 / val; + VirtualProtect(flyingItemsFuncPtr, 26, oldProtect, &oldProtect); + } + + + lastFastFlyingItems = fastFlyingItems; + } +} + + +void VanillaPlus::onDisable() { + // flying items + if (flyingItemsFuncPtr) { + DWORD oldProtect = 0; + if (!VirtualProtect(flyingItemsFuncPtr, 26, PAGE_EXECUTE_READWRITE, &oldProtect)) { +#ifdef _DEBUG + logF("couldnt unprotect memory send help"); + __debugbreak(); +#endif + } else { + memcpy(flyingItemsFuncPtr, flyingItemsPrevCodeBuf, 26); + VirtualProtect(flyingItemsFuncPtr, 26, oldProtect, &oldProtect); + } + } +} diff --git a/Horion/Module/Modules/VanillaPlus.h b/Horion/Module/Modules/VanillaPlus.h new file mode 100644 index 00000000..7a069ca8 --- /dev/null +++ b/Horion/Module/Modules/VanillaPlus.h @@ -0,0 +1,15 @@ +#pragma once +#include "Module.h" +class VanillaPlus : public IModule { + +public: + bool fastFlyingItems = true; + + VanillaPlus(); + virtual ~VanillaPlus(){}; + + virtual const char* getModuleName() override; + virtual void onEnable() override; + virtual void onDisable() override; + virtual void onTick(C_GameMode*) override; +}; From 40729d1f96ccf879f79d04f5ba190607b5362767 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 00:19:25 +0200 Subject: [PATCH 192/419] Proper inventory class thing, getHeld, getArmor and getItems --- Horion.vcxproj | 2 + .../Functions/InventoryFunctions.cpp | 92 +++++++++++++++++++ .../Scripting/Functions/InventoryFunctions.h | 12 +++ .../Functions/LocalPlayerFunctions.cpp | 50 +--------- .../Functions/LocalPlayerFunctions.h | 3 +- Horion/Scripting/ScriptManager.cpp | 13 ++- Horion/Scripting/ScriptManager.h | 3 + 7 files changed, 126 insertions(+), 49 deletions(-) create mode 100644 Horion/Scripting/Functions/InventoryFunctions.cpp create mode 100644 Horion/Scripting/Functions/InventoryFunctions.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 0a233375..77781197 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -379,6 +379,7 @@ + @@ -563,6 +564,7 @@ + diff --git a/Horion/Scripting/Functions/InventoryFunctions.cpp b/Horion/Scripting/Functions/InventoryFunctions.cpp new file mode 100644 index 00000000..896cfa3d --- /dev/null +++ b/Horion/Scripting/Functions/InventoryFunctions.cpp @@ -0,0 +1,92 @@ +#include "InventoryFunctions.h" + +const wchar_t* airName = L"air"; + +JsValueRef createItem(C_ItemStack *stack) { + JsValueRef obj; + chakra.JsCreateObject_(&obj); + + if (stack == nullptr || !stack->isValid()) { + JsValueRef itemName; + chakra.JsPointerToString_(airName, wcslen(airName), &itemName); + + chakra.addPropertyToObj(obj, L"name", itemName); + chakra.addPropertyToObj(obj, L"id", chakra.toNumber(0)); + chakra.addPropertyToObj(obj, L"amount", chakra.toNumber(0)); + } else { + auto name = stack->getItem()->name.getText(); + JsValueRef itemName; + + std::wstring charName = Utils::stringToWstring(name); + + chakra.JsPointerToString_(charName.c_str(), charName.size(), &itemName); + + chakra.addPropertyToObj(obj, L"name", itemName); + chakra.addPropertyToObj(obj, L"id", chakra.toNumber(stack->getItem()->itemId)); + chakra.addPropertyToObj(obj, L"amount", chakra.toNumber(stack->count)); + } + + return obj; +} + +JsValueRef CALLBACK InventoryFunctions::getItems(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + JsValueRef inventoryArr; + chakra.JsCreateArray_(36, &inventoryArr); + + for (int i = 0; i < 36; i++) { + auto stack = plr->getSupplies()->inventory->getItemStack(i); + chakra.arraySet(inventoryArr, i, createItem(stack)); + }; + + return inventoryArr; +} + +JsValueRef CALLBACK InventoryFunctions::getArmor(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + JsValueRef armorArr; + chakra.JsCreateArray_(4, &armorArr); + + for (int i = 0; i < 4; i++) { + auto stack = plr->getArmor(i); + chakra.arraySet(armorArr, i, createItem(stack)); + }; + + return armorArr; +} + +JsValueRef CALLBACK InventoryFunctions::getHeld(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + const int currSlot = plr->getSupplies()->selectedHotbarSlot; + + auto stack = plr->getSupplies()->inventory->getItemStack(currSlot); + return createItem(stack); +} + +JsValueRef CALLBACK InventoryFunctions::isFull(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + return chakra.toBoolean(plr->getSupplies()->inventory->isFull()); +} \ No newline at end of file diff --git a/Horion/Scripting/Functions/InventoryFunctions.h b/Horion/Scripting/Functions/InventoryFunctions.h new file mode 100644 index 00000000..ceebb147 --- /dev/null +++ b/Horion/Scripting/Functions/InventoryFunctions.h @@ -0,0 +1,12 @@ +#pragma once + +#include "../ScriptManager.h" + +class InventoryFunctions { +public: + DECL_FUN(getItems); + DECL_FUN(getArmor); + DECL_FUN(getHeld); + + DECL_FUN(isFull); +}; diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 75e19071..191c43e1 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -81,7 +81,7 @@ JsValueRef CALLBACK LocalPlayerFunctions::setIsOnGround(JsValueRef callee, bool return chakra.trueValue(); } -JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { +/*JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto ent = EntityFunctions::getEntityFromValue(arguments[0]); if (ent == nullptr) { ENTITY_INVALID; @@ -139,54 +139,12 @@ JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bo } return item; -} +}*/ JsValueRef CALLBACK LocalPlayerFunctions::getInventory(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto ent = EntityFunctions::getEntityFromValue(arguments[0]); if (ent == nullptr) { ENTITY_INVALID; } - - const auto plr = reinterpret_cast(ent); - - JsValueRef inventoryArr; - chakra.JsCreateArray_(35, &inventoryArr); - - const wchar_t* airName = L"air"; - - for (int i = 0; i < 36; i++) { - auto stack = plr->getSupplies()->inventory->getItemStack(i); - - if (stack == nullptr || !stack->isValid()) { - JsValueRef jsItem; - chakra.JsCreateObject_(&jsItem); - - JsValueRef itemName; - chakra.JsPointerToString_(airName, wcslen(airName), &itemName); - - chakra.addPropertyToObj(jsItem, L"name", itemName); - chakra.addPropertyToObj(jsItem, L"id", chakra.toNumber(0)); - chakra.addPropertyToObj(jsItem, L"amount", chakra.toNumber(0)); - - chakra.arraySet(inventoryArr, i, jsItem); - } else { - JsValueRef jsItem; - chakra.JsCreateObject_(&jsItem); - - auto name = stack->getItem()->name.getText(); - JsValueRef itemName; - - std::wstring charName = Utils::stringToWstring(name); - - chakra.JsPointerToString_(charName.c_str(), wcslen(charName.c_str()), &itemName); - - chakra.addPropertyToObj(jsItem, L"name", itemName); - chakra.addPropertyToObj(jsItem, L"id", chakra.toNumber(stack->getItem()->itemId)); - chakra.addPropertyToObj(jsItem, L"amount", chakra.toNumber(stack->count)); - - chakra.arraySet(inventoryArr, i, jsItem); - } - }; - - return inventoryArr; -} + return reinterpret_cast(callbackState)->inventoryObject; +} \ No newline at end of file diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.h b/Horion/Scripting/Functions/LocalPlayerFunctions.h index a68a3796..c3fea497 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.h +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.h @@ -2,16 +2,15 @@ #include "../ScriptManager.h" #include "Vector3Functions.h" +#include "InventoryFunctions.h" class LocalPlayerFunctions { public: - DECL_FUN(setPosition); DECL_FUN(setVelocity); DECL_FUN(toString); DECL_FUN(setViewAngles); DECL_FUN(setIsOnGround); DECL_FUN(getInventory); - DECL_FUN(getInventorySlot); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index d9e71ad6..2c487d08 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -107,7 +107,14 @@ void ScriptManager::prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects chakra.defineFunction(proto, L"setViewAngles", LocalPlayerFunctions::setViewAngles, objs); chakra.defineFunction(proto, L"setIsOnGround", LocalPlayerFunctions::setIsOnGround, objs); chakra.defineFunction(proto, L"getInventory", LocalPlayerFunctions::getInventory, objs); - chakra.defineFunction(proto, L"getInventorySlot", LocalPlayerFunctions::getInventorySlot, objs); +} + +void ScriptManager::prepareInventoryFunctions(JsValueRef proto, ContextObjects* objs) { + chakra.defineFunction(proto, L"getItems", InventoryFunctions::getItems, objs); + chakra.defineFunction(proto, L"getArmor", InventoryFunctions::getArmor, objs); + chakra.defineFunction(proto, L"getHeld", InventoryFunctions::getHeld, objs); + + chakra.defineProp(proto, L"isFull", InventoryFunctions::isFull, 0); } void ScriptManager::prepareGameFunctions(JsValueRef global, ContextObjects* objs) { @@ -218,6 +225,10 @@ void ScriptManager::prepareContext(JsContextRef* ctx, ContextObjects* obj) { chakra.JsCreateObject_(&obj->localPlayerPrototype); chakra.JsAddRef_(obj->localPlayerPrototype, 0); prepareLocalPlayerPrototype(obj->localPlayerPrototype, obj); + + chakra.JsCreateObject_(&obj->inventoryObject); + chakra.JsAddRef_(obj->inventoryObject, 0); + prepareInventoryFunctions(obj->inventoryObject, obj); } JsValueRef ScriptManager::prepareVector3(vec3_t vec, ContextObjects* objs) { diff --git a/Horion/Scripting/ScriptManager.h b/Horion/Scripting/ScriptManager.h index 15adf5ed..073468c6 100644 --- a/Horion/Scripting/ScriptManager.h +++ b/Horion/Scripting/ScriptManager.h @@ -89,6 +89,7 @@ extern ScriptManager scriptMgr; #include "Functions/ModuleManagerFunctions.h" #include "Functions/LevelFunctions.h" #include "Functions/DrawFunctions.h" +#include "Functions/InventoryFunctions.h" #include "ScriptInstance.h" @@ -101,6 +102,7 @@ struct ContextObjects { JsValueRef vec2Prototype = JS_INVALID_REFERENCE; JsValueRef entityPrototype = JS_INVALID_REFERENCE; JsValueRef localPlayerPrototype = JS_INVALID_REFERENCE; + JsValueRef inventoryObject = JS_INVALID_REFERENCE; JsValueRef moduleManager = JS_INVALID_REFERENCE; JsValueRef commandManager = JS_INVALID_REFERENCE; JsValueRef drawUtils = JS_INVALID_REFERENCE; @@ -122,6 +124,7 @@ class ScriptManager { void prepareEntityPrototype(JsValueRef proto, ContextObjects* objs); void prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects* objs); + void prepareInventoryFunctions(JsValueRef proto, ContextObjects* objs); void prepareGameFunctions(JsValueRef global, ContextObjects* objs); void prepareHorionFunctions(JsValueRef global, ContextObjects* obj); void prepareDrawFunctions(JsValueRef global, ContextObjects* obj); From 0a017f07275810a1d28259ce2fa96ffdacb45782 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 00:21:10 +0200 Subject: [PATCH 193/419] Forget to remove commented stuff as usual --- .../Functions/LocalPlayerFunctions.cpp | 60 ------------------- 1 file changed, 60 deletions(-) diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 191c43e1..33ea0169 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -81,66 +81,6 @@ JsValueRef CALLBACK LocalPlayerFunctions::setIsOnGround(JsValueRef callee, bool return chakra.trueValue(); } -/*JsValueRef CALLBACK LocalPlayerFunctions::getInventorySlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { - auto ent = EntityFunctions::getEntityFromValue(arguments[0]); - if (ent == nullptr) { - ENTITY_INVALID; - } - - int slot; - const auto plr = reinterpret_cast(ent); - - if (argumentCount < 2) { - THROW(L"Argument 1 missing"); - } - - JsValueType type; - chakra.JsGetValueType_(arguments[1], &type); - - if (type != JsNumber) { - THROW(L"Argument 1 must be a number"); - } - if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { - THROW(L"Argument 1 not a valid number"); - } - if ( - !(slot >= 0 && slot <= 35) && - !(slot >= 100 && slot <= 103) && - !(slot == -106) - ) { - THROW(L"Argument 1 must be a valid slot id(0-35, 100-103, -106)"); - } - - JsValueRef item; - chakra.JsCreateObject_(&item); - - const auto stack = plr->getSupplies()->inventory->getItemStack(slot); - - const wchar_t* airName = L"air"; - - if (stack == nullptr || !stack->isValid()) { - JsValueRef itemName; - chakra.JsPointerToString_(airName, wcslen(airName), &itemName); - - chakra.addPropertyToObj(item, L"name", itemName); - chakra.addPropertyToObj(item, L"id", chakra.toNumber(0)); - chakra.addPropertyToObj(item, L"amount", chakra.toNumber(0)); - } else { - auto name = stack->getItem()->name.getText(); - JsValueRef itemName; - - std::wstring charName = Utils::stringToWstring(name); - - chakra.JsPointerToString_(charName.c_str(), wcslen(charName.c_str()), &itemName); - - chakra.addPropertyToObj(item, L"name", itemName); - chakra.addPropertyToObj(item, L"id", chakra.toNumber(stack->getItem()->itemId)); - chakra.addPropertyToObj(item, L"amount", chakra.toNumber(stack->count)); - } - - return item; -}*/ - JsValueRef CALLBACK LocalPlayerFunctions::getInventory(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { auto ent = EntityFunctions::getEntityFromValue(arguments[0]); if (ent == nullptr) { From 335c344c8033748b1e942b8946f743aec660c655 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 15 Nov 2020 00:51:23 +0100 Subject: [PATCH 194/419] Structure builder --- Horion.vcxproj | 2 + Horion/DrawUtils.cpp | 51 +++++ Horion/DrawUtils.h | 1 + Horion/Module/Modules/TestModule.cpp | 244 ++++++++++++++------ Utils/HMath.h | 1 - Utils/SkinUtil.cpp | 4 +- Utils/SkinUtil.h | 2 +- Utils/VoxelIntersector.cpp | 320 +++++++++++++++++++++++++++ Utils/VoxelIntersector.h | 21 ++ 9 files changed, 576 insertions(+), 70 deletions(-) create mode 100644 Utils/VoxelIntersector.cpp create mode 100644 Utils/VoxelIntersector.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 0a233375..344ebc1e 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -412,6 +412,7 @@ + @@ -633,6 +634,7 @@ + diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 9d86208d..7a3228a6 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -486,6 +486,57 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { tess_end(game3dContext, myTess, entityFlatStaticMaterial); } +void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { + if (game3dContext == 0 || entityFlatStaticMaterial == 0) + return; + + auto myTess = DrawUtils::get3dTessellator(); + + DrawUtils::tess__begin(myTess, 4, 12); + + vec3_t diff; + diff.x = upper.x - lower.x; + diff.y = upper.y - lower.y; + diff.z = upper.z - lower.z; + + lower = lower.sub(origin); + + vec3_t vertices[8]; + vertices[0] = vec3_t(lower.x, lower.y, lower.z); + vertices[1] = vec3_t(lower.x + diff.x, lower.y, lower.z); + vertices[2] = vec3_t(lower.x, lower.y, lower.z + diff.z); + vertices[3] = vec3_t(lower.x + diff.x, lower.y, lower.z + diff.z); + + vertices[4] = vec3_t(lower.x, lower.y + diff.y, lower.z); + vertices[5] = vec3_t(lower.x + diff.x, lower.y + diff.y, lower.z); + vertices[6] = vec3_t(lower.x, lower.y + diff.y, lower.z + diff.z); + vertices[7] = vec3_t(lower.x + diff.x, lower.y + diff.y, lower.z + diff.z); + + #define line(m, n) tess_vertex(myTess, m.x, m.y, m.z); \ + tess_vertex(myTess, n.x, n.y, n.z); + + #define li(m, n) line(vertices[m], vertices[n]); + + li(0, 1); + li(1, 3); + li(3, 2); + li(2, 0); + + li(4, 5); + li(5, 7); + li(7, 6); + li(6, 4); + + li(0, 4); + li(1, 5); + li(2, 6); + li(3, 7); + + #undef li + #undef line + + tess_end(game3dContext, myTess, entityFlatStaticMaterial); +} void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { DrawUtils::setColor(col.r, col.g, col.b, alpha); DrawUtils::drawQuad({pos.x, pos.w}, {pos.z, pos.w}, {pos.z, pos.y}, {pos.x, pos.y}); diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 15284d40..5f266ac2 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -99,6 +99,7 @@ class DrawUtils { static void drawLine(vec2_t start, vec2_t end, float lineWidth); // rgba static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); + static void drawBox3d(vec3_t lower, vec3_t upper); static void fillRectangle(vec4_t pos, const MC_Color col, float alpha); static inline void fillRectangle(vec2_t start, vec2_t end) { DrawUtils::drawQuad({start.x, end.y}, {end.x, end.y}, {end.x, start.y}, {start.x, start.y}); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 47739602..4d35b877 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,9 +1,11 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" +#include "../../../Utils/VoxelIntersector.h" #include "../../DrawUtils.h" #include "../../../SDK/MatrixStack.h" #include #include +#include #include #include //radians #include // perspective, translate, rotate @@ -12,6 +14,10 @@ #include #include #include +#include "../../../Utils/Json.hpp" + +using json = nlohmann::json; + TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { registerFloatSetting("float1", &this->float1, 0, -10, 10); @@ -28,97 +34,203 @@ bool TestModule::isFlashMode() { return false; } -std::vector lastPos; -void TestModule::onEnable() { - lastPos.clear(); - + + +__forceinline unsigned __int64 rotBy(int in, unsigned int by) { + auto mut = static_cast(in); + return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; } -void TestModule::onTick(C_GameMode* gm) { - /*auto pPos = gm->player->eyePos0; - vec3_ti startNode((int)floorf(pPos.x), (int)roundf(pPos.y - 1.62f), (int)floorf(pPos.z)); +size_t posToHash(const vec3_ti& pos) { + return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); +} - if(std::find(lastPos.begin(), lastPos.end(), startNode) == lastPos.end()){ - lastPos.push_back(startNode); - }*/ - //if (gm->player->velocity.y > 0) - - auto ptr = g_Data.getClientInstance()->getPointerStruct(); - static int lastStat = 0; - if (ptr->entityPtr == nullptr && ptr->rayHitType == 0 && ptr->block.y > 0) { - bool isDestroyed = false; - gm->survivalDestroyBlockHack(ptr->block, ptr->blockSide, isDestroyed, lastStat == 0); - +struct PosHasher { + size_t operator()(const vec3_ti& i) const { return posToHash(i); }; +}; - //logF("%i %i %i %i %i", ptr->block.x, ptr->block.y, ptr->block.z, isDestroyed, lastStat); +std::unordered_set renderPos(8); - lastStat++; - } else - lastStat = 0; +void loadFile(std::wstring filePath) { + std::string contents = Utils::readFileContents(filePath); + if (contents.size() == 0) + return; + + logF("Starting geometry import"); + auto mesh = SkinUtil::objToMesh(contents.c_str(), false); + logF("Mesh created (verts: %i, uvs: %i, normals: %i, faces: %i)", mesh.vertices.size(), mesh.uvs.size(), mesh.normals.size(), mesh.faces.size()); + auto posHasher2 = [](const vec3_ti& i) { return posToHash(i); }; + std::unordered_set newPoses(8); + int num = 0; + for (const auto& face : mesh.faces) { + + if (face.facesPresent != 3) + continue; + + const auto& v1 = mesh.vertices[face.indices[0].vertIndex]; + const auto& v2 = mesh.vertices[face.indices[1].vertIndex]; + const auto& v3 = mesh.vertices[face.indices[2].vertIndex]; + // intersect tris + Voxel::Triangle3 tri = {{v1[0], v1[1], v1[2]}, + {v2[0], v2[1], v2[2]}, + {v3[0], v3[1], v3[2]}}; + AABB bBox{}; + Voxel::getBoundingBox(bBox, tri); + bBox.lower.y = std::max(0.f, bBox.lower.y); + bBox.upper.y = std::min(255.f, bBox.upper.y); + + for (float x = floorf(bBox.lower.x); x < ceilf(bBox.upper.x); x++) { + for (float y = floorf(bBox.lower.y); y < ceilf(bBox.upper.y); y++) { + for (float z = floorf(bBox.lower.z); z < ceilf(bBox.upper.z); z++) { + vec3_t voxel(x, y, z); + if (!Voxel::intersects(voxel, tri)) + continue; + + newPoses.insert(vec3_ti((int)x, (int)y, (int)z)); + num++; + } + } + } + } + renderPos = newPoses; + logF("replaced renderPos with %i %i", renderPos.size(), num); } -void TestModule::onMove(C_MoveInputHandler* hand){ - +void TestModule::onEnable() { + renderPos.clear(); + + HorionDataPacket packet; + packet.cmd = CMD_FILECHOOSER; + auto tmp = std::shared_ptr(new unsigned char[300]); + packet.data.swap(tmp); + memset(packet.data.get(), 0, 300); + strcpy_s((char*)packet.data.get(), 200, "{\"title\": \"Select a 3d object\", \"filter\":\"Object Files (*.obj)|*.obj\"}"); + packet.dataArraySize = (int)strlen((char*)packet.data.get()); + packet.params[0] = g_Data.addInjectorResponseCallback([](std::shared_ptr pk) { + if (pk->params[0] != 1) { // Dialog Canceled, reset geo + auto box = g_Data.addInfoBox("File load", "No file loaded"); + box->closeTimer = 1; + return; + } + + wchar_t* jsonData = reinterpret_cast(pk->data.get()); + std::wstring jsonDataStr(jsonData); + + json parsed = json::parse(jsonDataStr); + if (parsed["path"].is_string()) { + auto box = g_Data.addInfoBox("Importing File", "Please wait..."); + std::thread gamer([parsed, box]() { + loadFile(Utils::stringToWstring(parsed["path"].get())); + box->fadeTarget = 0; + }); + gamer.detach(); + } + }); + + g_Data.sendPacketToInjector(packet); } -void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { - for(auto pos : lastPos){ - DrawUtils::drawBox(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector(), 1, false); +bool tryPlace(const vec3_ti& blockPos) { + C_Block* block = g_Data.getLocalPlayer()->region->getBlock(blockPos); + C_BlockLegacy* blockLegacy = block->toLegacy(); + if (blockLegacy->material->isReplaceable) { + + // Find neighbour + static std::vector checklist; + if (checklist.empty()) { + checklist.push_back(vec3_ti(0, -1, 0)); + checklist.push_back(vec3_ti(0, 1, 0)); + + checklist.push_back(vec3_ti(0, 0, -1)); + checklist.push_back(vec3_ti(0, 0, 1)); + + checklist.push_back(vec3_ti(-1, 0, 0)); + checklist.push_back(vec3_ti(1, 0, 0)); + } + + bool foundCandidate = false; + int i = 0; + for (const auto& current : checklist) { + + vec3_ti calc = blockPos.sub(current); + if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + // Found a solid block to click + g_Data.getCGameMode()->buildBlock(&calc, i); + + return true; + break; + } + i++; + } } + return false; } -void TestModule::onSendPacket(C_Packet* p) { +void TestModule::onTick(C_GameMode* gm) { + if (g_Data.getLocalPlayer() == nullptr) + return; + if (!g_Data.canUseMoveKeys()) + return; + if (renderPos.size() == 0) + return; -} + auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); + if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock())) // Block in hand? + return; -void TestModule::onDisable() { + int radius = 6; + int numBlocksPerTick = 6; + for (int x = -radius; x < radius; x++) { + for (int y = -radius; y < radius; y++) { + for (int z = -radius; z < radius; z++) { + auto pos = g_Data.getLocalPlayer()->eyePos0.add((float)x, (float)y, (float)z).floor(); + if (renderPos.count(pos) == 0) + continue; + if (tryPlace(pos) && --numBlocksPerTick == 0) + return; + } + } + } } -float t = 0; -void TestModule::onLevelRender() { - if (true) - return; - DrawUtils::setColor(0.5f, 0.5f, 0.5f, 1); - auto blockTess = g_Data.getClientInstance()->levelRenderer->blockTessellator; - auto tess = DrawUtils::get3dTessellator(); +void TestModule::onMove(C_MoveInputHandler* hand){ - vec3_ti pos(3, 3, 3); - auto block = g_Data.getLocalPlayer()->region->getBlock(pos); +} - MatrixStack* matStackPtr = DrawUtils::getMatrixStack(); +void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { + DrawUtils::setColor(0.3f, 0.3f, 0.7f, 1); + +} - auto& newMat = matStackPtr->push(); +void TestModule::onSendPacket(C_Packet* p) { - auto origin = DrawUtils::getOrigin(); - auto temp = DrawUtils::getOrigin().add(pos.toFloatVector()).mul(-1); +} - static float t = 0; - t+=3; - auto preRotTranslation = glm::translate(glm::mat4(1.f), glm::vec3(-0.5f, -0.5f, -0.5f)); - auto afterRotTranslation = glm::translate(glm::mat4(1.f), glm::vec3(0.5f, 0.5f, 0.5f)); - auto rotation = afterRotTranslation * glm::rotate(glm::mat4(1.f), glm::radians(t), glm::vec3(0, 1, 0)) * preRotTranslation; +void TestModule::onDisable() { - auto translation = glm::translate(glm::mat4(1.f), glm::vec3(-origin.x, -origin.y, -origin.z)); - *newMat = translation * rotation; +} +float t = 0; +void TestModule::onLevelRender() { - vec3_ti zer = {0, 0, 0}; - auto mesh = blockTess->getMeshForBlockInWorld(tess, block, zer); + DrawUtils::setColor(0.8f, 0.4f, 0.4f, 1); + int radius = 50; + + const auto origin = g_Data.getLocalPlayer()->eyePos0.floor(); + for (auto pos : renderPos) { + if (fabsf(pos.x - origin.x) > radius) + continue; + if (fabsf(pos.z - origin.z) > radius) + continue; + if (fabsf(pos.y - origin.y) > radius) + continue; + C_Block* block = g_Data.getLocalPlayer()->region->getBlock(pos); + C_BlockLegacy* blockLegacy = block->toLegacy(); + if (!blockLegacy->material->isReplaceable) + continue; + DrawUtils::drawBox3d(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector()); + } - static std::array mats = {{mce::MaterialPtr("moving_block_double_side"), - mce::MaterialPtr("moving_block_blend"), - mce::MaterialPtr("moving_block"), - mce::MaterialPtr("moving_block_alpha"), - mce::MaterialPtr("moving_block_alpha"), - mce::MaterialPtr("moving_block_seasons"), - mce::MaterialPtr("moving_block_alpha_seasons"), - mce::MaterialPtr("moving_block_alpha_single_side")}}; - - std::array<__int64*, 2> textures; - textures[0] = g_Data.getClientInstance()->levelRenderer->atlasTexture.getClientTexture(); - textures[1] = *reinterpret_cast<__int64**>(g_Data.getClientInstance()->getLightTexture() + 0x18); - - mesh->renderMesh(DrawUtils::getScreenContext(), &mats[block->getRenderLayer()], textures); } diff --git a/Utils/HMath.h b/Utils/HMath.h index 2aa5f318..3703b27e 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -182,7 +182,6 @@ struct vec3_t { return vec3_t(x - o.x, y - o.y, z - o.z); } - float squaredlen() const { return x * x + y * y + z * z; } float squaredxzlen() const { return x * x + z * z; } diff --git a/Utils/SkinUtil.cpp b/Utils/SkinUtil.cpp index cfb7a41f..cac8be72 100644 --- a/Utils/SkinUtil.cpp +++ b/Utils/SkinUtil.cpp @@ -80,7 +80,7 @@ std::string SkinUtil::modGeometry(const char* oldGeoStr, MeshStructs::meshData m } return geoMod.dump(); } -MeshStructs::meshData SkinUtil::objToMesh(const char* str) { +MeshStructs::meshData SkinUtil::objToMesh(const char* str, bool convertTrisToQuads) { std::istringstream f(str); std::string line; @@ -181,7 +181,7 @@ MeshStructs::meshData SkinUtil::objToMesh(const char* str) { face.indices[i - 1] = part; } - if (args.size() == 4) { // Convert triangles to quads + if (args.size() == 4 && convertTrisToQuads) { // Convert triangles to quads face.facesPresent++; face.indices[face.facesPresent - 1] = face.indices[face.facesPresent - 2]; } diff --git a/Utils/SkinUtil.h b/Utils/SkinUtil.h index 451a90a2..b5faefa3 100644 --- a/Utils/SkinUtil.h +++ b/Utils/SkinUtil.h @@ -40,5 +40,5 @@ class SkinUtil { public: static void importGeo(std::wstring filePath); static std::string modGeometry(const char* oldGeoStr, MeshStructs::meshData mesh); - static MeshStructs::meshData objToMesh(const char* str); + static MeshStructs::meshData objToMesh(const char* str, bool convertTrisToQuads = true); }; diff --git a/Utils/VoxelIntersector.cpp b/Utils/VoxelIntersector.cpp new file mode 100644 index 00000000..d7c5cee9 --- /dev/null +++ b/Utils/VoxelIntersector.cpp @@ -0,0 +1,320 @@ +#include "VoxelIntersector.h" + +#include + +/* this version of SIGN3 shows some numerical instability, and is improved + * by using the uncommented macro that follows, and a different test with it */ +#ifdef OLD_TEST +#define SIGN3(A) (((A).x < 0) ? 4 : 0 | ((A).y < 0) ? 2 : 0 | ((A).z < 0) ? 1 : 0) +#else +#define EPS 10e-5f +#define SIGN3(A) \ + ((((A).x < EPS) ? 4 : 0) | (((A).x > -EPS) ? 32 : 0) | (((A).y < EPS) ? 2 : 0) | (((A).y > -EPS) ? 16 : 0) | (((A).z < EPS) ? 1 : 0) | (((A).z > -EPS) ? 8 : 0)) +#endif + +#define CROSS(A, B, C) \ + { \ + (C).x = (A).y * (B).z - (A).z * (B).y; \ + (C).y = -(A).x * (B).z + (A).z * (B).x; \ + (C).z = (A).x * (B).y - (A).y * (B).x; \ + } +#define SUB(A, B, C) \ + { \ + (C).x = (A).x - (B).x; \ + (C).y = (A).y - (B).y; \ + (C).z = (A).z - (B).z; \ + } +#define LERP(A, B, C) ((B) + (A) * ((C) - (B))) +#define MIN3(a, b, c) ((((a) < (b)) && ((a) < (c))) ? (a) : (((b) < (c)) ? (b) : (c))) +#define MAX3(a, b, c) ((((a) > (b)) && ((a) > (c))) ? (a) : (((b) > (c)) ? (b) : (c))) +#define INSIDE 0 +#define OUTSIDE 1 + + +using namespace Voxel; + +/*___________________________________________________________________________*/ + +/* Which of the six face-plane(s) is point P outside of? */ + +long face_plane(Point3 p) { + long outcode; + + outcode = 0; + if (p.x > .5f) outcode |= 0x01; + if (p.x < -.5f) outcode |= 0x02; + if (p.y > .5f) outcode |= 0x04; + if (p.y < -.5f) outcode |= 0x08; + if (p.z > .5f) outcode |= 0x10; + if (p.z < -.5f) outcode |= 0x20; + return (outcode); +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/* Which of the twelve edge plane(s) is point P outside of? */ + +long bevel_2d(Point3 p) { + long outcode; + + outcode = 0; + if (p.x + p.y > 1.0f) outcode |= 0x001; + if (p.x - p.y > 1.0f) outcode |= 0x002; + if (-p.x + p.y > 1.0f) outcode |= 0x004; + if (-p.x - p.y > 1.0f) outcode |= 0x008; + if (p.x + p.z > 1.0f) outcode |= 0x010; + if (p.x - p.z > 1.0f) outcode |= 0x020; + if (-p.x + p.z > 1.0f) outcode |= 0x040; + if (-p.x - p.z > 1.0f) outcode |= 0x080; + if (p.y + p.z > 1.0f) outcode |= 0x100; + if (p.y - p.z > 1.0f) outcode |= 0x200; + if (-p.y + p.z > 1.0f) outcode |= 0x400; + if (-p.y - p.z > 1.0f) outcode |= 0x800; + return (outcode); +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/* Which of the eight corner plane(s) is point P outside of? */ + +long bevel_3d(Point3 p) { + long outcode; + + outcode = 0; + if ((p.x + p.y + p.z) > 1.5f) outcode |= 0x01; + if ((p.x + p.y - p.z) > 1.5f) outcode |= 0x02; + if ((p.x - p.y + p.z) > 1.5f) outcode |= 0x04; + if ((p.x - p.y - p.z) > 1.5f) outcode |= 0x08; + if ((-p.x + p.y + p.z) > 1.5f) outcode |= 0x10; + if ((-p.x + p.y - p.z) > 1.5f) outcode |= 0x20; + if ((-p.x - p.y + p.z) > 1.5f) outcode |= 0x40; + if ((-p.x - p.y - p.z) > 1.5f) outcode |= 0x80; + return (outcode); +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/* Test the point "alpha" of the way from P1 to P2 */ +/* See if it is on a face of the cube */ +/* Consider only faces in "mask" */ + +long check_point(Point3 p1, Point3 p2, float alpha, long mask) { + Point3 plane_point; + + plane_point.x = LERP(alpha, p1.x, p2.x); + plane_point.y = LERP(alpha, p1.y, p2.y); + plane_point.z = LERP(alpha, p1.z, p2.z); + return (face_plane(plane_point) & mask); +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/* Compute intersection of P1 --> P2 line segment with face planes */ +/* Then test intersection point to see if it is on cube face */ +/* Consider only face planes in "outcode_diff" */ +/* Note: Zero bits in "outcode_diff" means face line is outside of */ + +long check_line(Point3 p1, Point3 p2, long outcode_diff) { + if ((0x01 & outcode_diff) != 0) + if (check_point(p1, p2, (0.5f - p1.x) / (p2.x - p1.x), 0x3e) == INSIDE) return (INSIDE); + if ((0x02 & outcode_diff) != 0) + if (check_point(p1, p2, (-0.5f - p1.x) / (p2.x - p1.x), 0x3d) == INSIDE) return (INSIDE); + if ((0x04 & outcode_diff) != 0) + if (check_point(p1, p2, (0.5f - p1.y) / (p2.y - p1.y), 0x3b) == INSIDE) return (INSIDE); + if ((0x08 & outcode_diff) != 0) + if (check_point(p1, p2, (-0.5f - p1.y) / (p2.y - p1.y), 0x37) == INSIDE) return (INSIDE); + if ((0x10 & outcode_diff) != 0) + if (check_point(p1, p2, (0.5f - p1.z) / (p2.z - p1.z), 0x2f) == INSIDE) return (INSIDE); + if ((0x20 & outcode_diff) != 0) + if (check_point(p1, p2, (-0.5f - p1.z) / (p2.z - p1.z), 0x1f) == INSIDE) return (INSIDE); + return (OUTSIDE); +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/* Test if 3D point is inside 3D triangle */ + +long point_triangle_intersection(Point3 p, Triangle3 t) { + long sign12, sign23, sign31; + Point3 vect12, vect23, vect31, vect1h, vect2h, vect3h; + Point3 cross12_1p, cross23_2p, cross31_3p; + + /* First, a quick bounding-box test: */ + /* If P is outside triangle bbox, there cannot be an intersection. */ + + if (p.x > MAX3(t.v1.x, t.v2.x, t.v3.x)) return (OUTSIDE); + if (p.y > MAX3(t.v1.y, t.v2.y, t.v3.y)) return (OUTSIDE); + if (p.z > MAX3(t.v1.z, t.v2.z, t.v3.z)) return (OUTSIDE); + if (p.x < MIN3(t.v1.x, t.v2.x, t.v3.x)) return (OUTSIDE); + if (p.y < MIN3(t.v1.y, t.v2.y, t.v3.y)) return (OUTSIDE); + if (p.z < MIN3(t.v1.z, t.v2.z, t.v3.z)) return (OUTSIDE); + + /* For each triangle side, make a vector out of it by subtracting vertexes; */ + /* make another vector from one vertex to point P. */ + /* The crossproduct of these two vectors is orthogonal to both and the */ + /* signs of its X,Y,Z components indicate whether P was to the inside or */ + /* to the outside of this triangle side. */ + + SUB(t.v1, t.v2, vect12) + SUB(t.v1, p, vect1h); + CROSS(vect12, vect1h, cross12_1p) + sign12 = SIGN3(cross12_1p); /* Extract X,Y,Z signs as 0..7 or 0...63 integer */ + + SUB(t.v2, t.v3, vect23) + SUB(t.v2, p, vect2h); + CROSS(vect23, vect2h, cross23_2p) + sign23 = SIGN3(cross23_2p); + + SUB(t.v3, t.v1, vect31) + SUB(t.v3, p, vect3h); + CROSS(vect31, vect3h, cross31_3p) + sign31 = SIGN3(cross31_3p); + + /* If all three crossproduct vectors agree in their component signs, */ + /* then the point must be inside all three. */ + /* P cannot be OUTSIDE all three sides simultaneously. */ + + /* this is the old test; with the revised SIGN3() macro, the test + * needs to be revised. */ +#ifdef OLD_TEST + if ((sign12 == sign23) && (sign23 == sign31)) + return (INSIDE); + else + return (OUTSIDE); +#else + return ((sign12 & sign23 & sign31) == 0) ? OUTSIDE : INSIDE; +#endif +} + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */ + +/**********************************************/ +/* This is the main algorithm procedure. */ +/* Triangle t is compared with a unit cube, */ +/* centered on the origin. */ +/* It returns INSIDE (0) or OUTSIDE(1) if t */ +/* intersects or does not intersect the cube. */ +/**********************************************/ + +long t_c_intersection(Triangle3 t) { + long v1_test, v2_test, v3_test; + float d, denom; + Point3 vect12, vect13, norm; + Point3 hitpp, hitpn, hitnp, hitnn; + + /* First compare all three vertexes with all six face-planes */ + /* If any vertex is inside the cube, return immediately! */ + + if ((v1_test = face_plane(t.v1)) == INSIDE) return (INSIDE); + if ((v2_test = face_plane(t.v2)) == INSIDE) return (INSIDE); + if ((v3_test = face_plane(t.v3)) == INSIDE) return (INSIDE); + + /* If all three vertexes were outside of one or more face-planes, */ + /* return immediately with a trivial rejection! */ + + if ((v1_test & v2_test & v3_test) != 0) return (OUTSIDE); + + /* Now do the same trivial rejection test for the 12 edge planes */ + + v1_test |= bevel_2d(t.v1) << 8; + v2_test |= bevel_2d(t.v2) << 8; + v3_test |= bevel_2d(t.v3) << 8; + if ((v1_test & v2_test & v3_test) != 0) return (OUTSIDE); + + /* Now do the same trivial rejection test for the 8 corner planes */ + + v1_test |= bevel_3d(t.v1) << 24; + v2_test |= bevel_3d(t.v2) << 24; + v3_test |= bevel_3d(t.v3) << 24; + if ((v1_test & v2_test & v3_test) != 0) return (OUTSIDE); + + /* If vertex 1 and 2, as a pair, cannot be trivially rejected */ + /* by the above tests, then see if the v1-->v2 triangle edge */ + /* intersects the cube. Do the same for v1-->v3 and v2-->v3. */ + /* Pass to the intersection algorithm the "OR" of the outcode */ + /* bits, so that only those cube faces which are spanned by */ + /* each triangle edge need be tested. */ + + if ((v1_test & v2_test) == 0) + if (check_line(t.v1, t.v2, v1_test | v2_test) == INSIDE) return (INSIDE); + if ((v1_test & v3_test) == 0) + if (check_line(t.v1, t.v3, v1_test | v3_test) == INSIDE) return (INSIDE); + if ((v2_test & v3_test) == 0) + if (check_line(t.v2, t.v3, v2_test | v3_test) == INSIDE) return (INSIDE); + + /* By now, we know that the triangle is not off to any side, */ + /* and that its sides do not penetrate the cube. We must now */ + /* test for the cube intersecting the interior of the triangle. */ + /* We do this by looking for intersections between the cube */ + /* diagonals and the triangle...first finding the intersection */ + /* of the four diagonals with the plane of the triangle, and */ + /* then if that intersection is inside the cube, pursuing */ + /* whether the intersection point is inside the triangle itself. */ + + /* To find plane of the triangle, first perform crossproduct on */ + /* two triangle side vectors to compute the normal vector. */ + + SUB(t.v1, t.v2, vect12); + SUB(t.v1, t.v3, vect13); + CROSS(vect12, vect13, norm) + + /* The normal vector "norm" X,Y,Z components are the coefficients */ + /* of the triangles AX + BY + CZ + D = 0 plane equation. If we */ + /* solve the plane equation for X=Y=Z (a diagonal), we get */ + /* -D/(A+B+C) as a metric of the distance from cube center to the */ + /* diagonal/plane intersection. If this is between -0.5 and 0.5, */ + /* the intersection is inside the cube. If so, we continue by */ + /* doing a point/triangle intersection. */ + /* Do this for all four diagonals. */ + + d = norm.x * t.v1.x + norm.y * t.v1.y + norm.z * t.v1.z; + + /* if one of the diagonals is parallel to the plane, the other will intersect the plane */ + if (fabs(denom = (norm.x + norm.y + norm.z)) > EPS) + /* skip parallel diagonals to the plane; division by 0 can occur */ + { + hitpp.x = hitpp.y = hitpp.z = d / denom; + if (fabs(hitpp.x) <= 0.5) + if (point_triangle_intersection(hitpp, t) == INSIDE) return (INSIDE); + } + if (fabs(denom = (norm.x + norm.y - norm.z)) > EPS) { + hitpn.z = -(hitpn.x = hitpn.y = d / denom); + if (fabs(hitpn.x) <= 0.5) + if (point_triangle_intersection(hitpn, t) == INSIDE) return (INSIDE); + } + if (fabs(denom = (norm.x - norm.y + norm.z)) > EPS) { + hitnp.y = -(hitnp.x = hitnp.z = d / denom); + if (fabs(hitnp.x) <= 0.5) + if (point_triangle_intersection(hitnp, t) == INSIDE) return (INSIDE); + } + if (fabs(denom = (norm.x - norm.y - norm.z)) > EPS) { + hitnn.y = hitnn.z = -(hitnn.x = d / denom); + if (fabs(hitnn.x) <= 0.5) + if (point_triangle_intersection(hitnn, t) == INSIDE) return (INSIDE); + } + + /* No edge touched the cube; no cube diagonal touched the triangle. */ + /* We're done...there was no intersection. */ + + return (OUTSIDE); +} + +void Voxel::getBoundingBox(AABB& aabbOut, const Triangle3& t) { + aabbOut.upper = {MAX3(t.v1.x, t.v2.x, t.v3.x), + MAX3(t.v1.y, t.v2.y, t.v3.y), + MAX3(t.v1.z, t.v2.z, t.v3.z)}; + aabbOut.lower = {MIN3(t.v1.x, t.v2.x, t.v3.x), + MIN3(t.v1.y, t.v2.y, t.v3.y), + MIN3(t.v1.z, t.v2.z, t.v3.z)}; +} + +bool Voxel::intersects(const vec3_t& voxel, const Triangle3& triangle) { + // i hope this gets optimized + Triangle3 triMutated = { + {triangle.v1.x - voxel.x - 0.5f, triangle.v1.y - voxel.y - 0.5f, triangle.v1.z - voxel.z - 0.5f}, + {triangle.v2.x - voxel.x - 0.5f, triangle.v2.y - voxel.y - 0.5f, triangle.v2.z - voxel.z - 0.5f}, + {triangle.v3.x - voxel.x - 0.5f, triangle.v3.y - voxel.y - 0.5f, triangle.v3.z - voxel.z - 0.5f}}; + + + return t_c_intersection(triMutated) == INSIDE; +} diff --git a/Utils/VoxelIntersector.h b/Utils/VoxelIntersector.h new file mode 100644 index 00000000..1b0aea92 --- /dev/null +++ b/Utils/VoxelIntersector.h @@ -0,0 +1,21 @@ +#pragma once + +#include "HMath.h" + +namespace Voxel { + + typedef struct { + float x; + float y; + float z; + } Point3; + + typedef struct { + Point3 v1; /* Vertex1 */ + Point3 v2; /* Vertex2 */ + Point3 v3; /* Vertex3 */ + } Triangle3; + + void getBoundingBox(AABB& aabbOut, const Triangle3& tri); + bool intersects(const vec3_t& voxel, const Triangle3& triangle); +} \ No newline at end of file From 342bf506dc2f86478b699946f268cea9ad92100f Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 15 Nov 2020 16:43:06 +0100 Subject: [PATCH 195/419] Add inventory vtable --- Horion/Command/Commands/TestCommand.cpp | 5 ++++ SDK/CInventory.cpp | 8 +----- SDK/CInventory.h | 36 ++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index 3bfc34e8..f0dbf3d1 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -33,5 +33,10 @@ void showAimedBlockInfo() { bool TestCommand::execute(std::vector* args) { C_LocalPlayer* player = g_Data.getLocalPlayer(); + auto inv = player->getSupplies()->inventory; + logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); + + //inv->moveItem(1, 2); + return true; } diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index 37aeee8e..38cb8d7a 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -24,13 +24,7 @@ bool C_Inventory::isFull() { if (fullslots == 36) return true; return false; } -int C_Inventory::getFirstEmptySlot() { - for (int i = 0; i < 36; i++) { - if (this->getItemStack(i)->item == nullptr) - return i; - } - return -1; -} + void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8")); diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 5307f0f4..d13b84b3 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -2,6 +2,8 @@ #include "CItem.h" class C_ItemStack; +class C_Inventory; +class C_Player; class C_Inventory { private: @@ -9,7 +11,6 @@ class C_Inventory { public: bool isFull(); - int getFirstEmptySlot(); void dropSlot(int slot); // DROPS WHOLE INVENTORY doesnt work tho @@ -23,6 +24,39 @@ class C_Inventory { virtual bool hasRoomForItem(C_ItemStack*); virtual __int64 addItem(C_ItemStack*); virtual __int64 addItemToFirstEmptySlot(C_ItemStack*); + virtual __int64 setItem(int slot, const C_ItemStack&); + virtual __int64 setItemWithForceBalance(int, const C_ItemStack&, bool); + virtual __int64 removeItem(int, int); + virtual __int64 removeAllItems(); + virtual __int64 dropContents(C_BlockSource&, const vec3_t&, bool); + virtual __int64 getContainerSize(); + virtual __int64 getMaxStackSize(); + virtual __int64 startOpen(C_Player&); + virtual __int64 stopOpen(C_Player&); + virtual __int64 getSlotCopies(); + virtual __int64 getSlots(); + virtual __int64 getItemCount(const C_ItemStack&); + virtual __int64 findFirstSlotForItem(const C_ItemStack&); + virtual __int64 canPushInItem(); // BlockSource &,int,int,ItemInstance const& + virtual __int64 canPullOutItem(); // BlockSource &,int,int,ItemInstance const& + virtual __int64 setContainerChanged(int); + virtual __int64 setContainerMoved(); + virtual __int64 setCustomName(const TextHolder&); + virtual __int64 hasCustomName(); + virtual __int64 readAdditionalSaveData(); // CompoundTag const& + virtual __int64 addAdditionalSaveData(); // CompoundTag & + virtual __int64 createTransactionContext(); // std::function, std::function + virtual __int64 initializeContainerContents(C_BlockSource&); + virtual __int64 add(C_ItemStack&); + virtual __int64 canAdd(const C_ItemStack&); + virtual void unknown(); + virtual __int64 clearSlot(int); + virtual __int64 clearInventory(int); + virtual __int64 load(); // ListTag const&,SemVersion const&,Level & + virtual void unknown2(); + virtual __int64 getEmptySlotsCount(); + virtual int getFirstEmptySlot(); + virtual __int64 setContainerSize(); void moveItem(int from, int to); }; From 8283bea8026d6b24a2973e77a1a3c9006ad89426 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 15 Nov 2020 16:46:58 +0100 Subject: [PATCH 196/419] Add Inventory::swapSlots --- Horion/Command/Commands/TestCommand.cpp | 2 +- SDK/CInventory.cpp | 17 +++++++++++++++++ SDK/CInventory.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index f0dbf3d1..bed737f3 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -36,7 +36,7 @@ bool TestCommand::execute(std::vector* args) { auto inv = player->getSupplies()->inventory; logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); - //inv->moveItem(1, 2); + inv->swapSlots(1, 2); return true; } diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index 38cb8d7a..c3c6cb55 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -66,3 +66,20 @@ void C_Inventory::moveItem(int from, int to = -1) { *item1 = a; } } + +void C_Inventory::swapSlots(int from, int to) { + C_InventoryTransactionManager* manager = g_Data.getLocalPlayer()->getTransactionManager(); + + C_ItemStack* i1 = getItemStack(from); + C_ItemStack* i2 = getItemStack(to); + + C_InventoryAction first(from, i1, nullptr); + C_InventoryAction second(to, i2, i1); + C_InventoryAction third(from, nullptr, i2); + manager->addInventoryAction(first); + manager->addInventoryAction(second); + manager->addInventoryAction(third); + C_ItemStack a = *i2; + *i2 = *i1; + *i1 = a; +} diff --git a/SDK/CInventory.h b/SDK/CInventory.h index d13b84b3..2855e656 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -59,6 +59,7 @@ class C_Inventory { virtual __int64 setContainerSize(); void moveItem(int from, int to); + void swapSlots(int from, int to); }; class C_PlayerInventoryProxy { From c728a2e091ec0acd6ae0798676a7b3d810ffa436 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 20:48:14 +0200 Subject: [PATCH 197/419] InventoryFunctions: Add getSlot, setSelected, moveItem --- .../Functions/InventoryFunctions.cpp | 78 +++++++++++++++++++ .../Scripting/Functions/InventoryFunctions.h | 3 + Horion/Scripting/ScriptManager.cpp | 3 + 3 files changed, 84 insertions(+) diff --git a/Horion/Scripting/Functions/InventoryFunctions.cpp b/Horion/Scripting/Functions/InventoryFunctions.cpp index 896cfa3d..1da7261e 100644 --- a/Horion/Scripting/Functions/InventoryFunctions.cpp +++ b/Horion/Scripting/Functions/InventoryFunctions.cpp @@ -73,6 +73,55 @@ JsValueRef CALLBACK InventoryFunctions::getHeld(JsValueRef callee, bool isConstr THROW(L"Player not valid"); } + const auto plr = reinterpret_cast(ent); + + int slot; + + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 not a valid integer"); + } + if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { + THROW(L"Argument 1 not a valid integer"); + } + + auto stack = plr->getSupplies()->inventory->getItemStack(slot); + return createItem(stack); +} + +JsValueRef CALLBACK InventoryFunctions::setSelected(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + int slot; + + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 not a valid integer"); + } + if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { + THROW(L"Argument 1 not a valid integer"); + } + + slot = std::clamp(slot, 0, 8); + + plr->getSupplies()->selectedHotbarSlot = slot; + + return chakra.trueValue(); +} + +JsValueRef CALLBACK InventoryFunctions::getSlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + const auto plr = reinterpret_cast(ent); const int currSlot = plr->getSupplies()->selectedHotbarSlot; @@ -89,4 +138,33 @@ JsValueRef CALLBACK InventoryFunctions::isFull(JsValueRef callee, bool isConstru const auto plr = reinterpret_cast(ent); return chakra.toBoolean(plr->getSupplies()->inventory->isFull()); +} + +JsValueRef CALLBACK InventoryFunctions::moveItem(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + int slot[2]; + + for (int i = 0; i < 2; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[i + 1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 or 2 not valid integers"); + } + if (chakra.JsNumberToInt_(arguments[i + 1], &slot[i]) != JsNoError) { + THROW(L"Argument 1 or 2 not valid integers"); + } + } + + if (slot[0] < 0) slot[0] = 0; + if (slot[1] < 0) slot[1] = 0; + + plr->getSupplies()->inventory->swapSlots(slot[0], slot[1]); + + return chakra.trueValue(); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/InventoryFunctions.h b/Horion/Scripting/Functions/InventoryFunctions.h index ceebb147..0f919ebb 100644 --- a/Horion/Scripting/Functions/InventoryFunctions.h +++ b/Horion/Scripting/Functions/InventoryFunctions.h @@ -7,6 +7,9 @@ class InventoryFunctions { DECL_FUN(getItems); DECL_FUN(getArmor); DECL_FUN(getHeld); + DECL_FUN(getSlot); + DECL_FUN(moveItem); + DECL_FUN(setSelected); DECL_FUN(isFull); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 2c487d08..636694d6 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -113,6 +113,9 @@ void ScriptManager::prepareInventoryFunctions(JsValueRef proto, ContextObjects* chakra.defineFunction(proto, L"getItems", InventoryFunctions::getItems, objs); chakra.defineFunction(proto, L"getArmor", InventoryFunctions::getArmor, objs); chakra.defineFunction(proto, L"getHeld", InventoryFunctions::getHeld, objs); + chakra.defineFunction(proto, L"getSlot", InventoryFunctions::getSlot, objs); + chakra.defineFunction(proto, L"setSelected", InventoryFunctions::setSelected, objs); + chakra.defineFunction(proto, L"moveItem", InventoryFunctions::moveItem, objs); chakra.defineProp(proto, L"isFull", InventoryFunctions::isFull, 0); } From 87f7da3868e93d9312082656a8c22474bd211933 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 20:48:14 +0200 Subject: [PATCH 198/419] InventoryFunctions: Add getSlot, setSelected, moveItem getSlot(slot: number): Item setSelected(slot: number): boolean moveItem(slot1: number, slot2: number): boolean --- .../Functions/InventoryFunctions.cpp | 78 +++++++++++++++++++ .../Scripting/Functions/InventoryFunctions.h | 3 + Horion/Scripting/ScriptManager.cpp | 3 + 3 files changed, 84 insertions(+) diff --git a/Horion/Scripting/Functions/InventoryFunctions.cpp b/Horion/Scripting/Functions/InventoryFunctions.cpp index 896cfa3d..1da7261e 100644 --- a/Horion/Scripting/Functions/InventoryFunctions.cpp +++ b/Horion/Scripting/Functions/InventoryFunctions.cpp @@ -73,6 +73,55 @@ JsValueRef CALLBACK InventoryFunctions::getHeld(JsValueRef callee, bool isConstr THROW(L"Player not valid"); } + const auto plr = reinterpret_cast(ent); + + int slot; + + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 not a valid integer"); + } + if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { + THROW(L"Argument 1 not a valid integer"); + } + + auto stack = plr->getSupplies()->inventory->getItemStack(slot); + return createItem(stack); +} + +JsValueRef CALLBACK InventoryFunctions::setSelected(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + int slot; + + JsValueType type; + chakra.JsGetValueType_(arguments[1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 not a valid integer"); + } + if (chakra.JsNumberToInt_(arguments[1], &slot) != JsNoError) { + THROW(L"Argument 1 not a valid integer"); + } + + slot = std::clamp(slot, 0, 8); + + plr->getSupplies()->selectedHotbarSlot = slot; + + return chakra.trueValue(); +} + +JsValueRef CALLBACK InventoryFunctions::getSlot(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + const auto plr = reinterpret_cast(ent); const int currSlot = plr->getSupplies()->selectedHotbarSlot; @@ -89,4 +138,33 @@ JsValueRef CALLBACK InventoryFunctions::isFull(JsValueRef callee, bool isConstru const auto plr = reinterpret_cast(ent); return chakra.toBoolean(plr->getSupplies()->inventory->isFull()); +} + +JsValueRef CALLBACK InventoryFunctions::moveItem(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = g_Data.getLocalPlayer(); + if (ent == nullptr) { + THROW(L"Player not valid"); + } + + const auto plr = reinterpret_cast(ent); + + int slot[2]; + + for (int i = 0; i < 2; i++) { + JsValueType type; + chakra.JsGetValueType_(arguments[i + 1], &type); + if (type != JsNumber) { + THROW(L"Argument 1 or 2 not valid integers"); + } + if (chakra.JsNumberToInt_(arguments[i + 1], &slot[i]) != JsNoError) { + THROW(L"Argument 1 or 2 not valid integers"); + } + } + + if (slot[0] < 0) slot[0] = 0; + if (slot[1] < 0) slot[1] = 0; + + plr->getSupplies()->inventory->swapSlots(slot[0], slot[1]); + + return chakra.trueValue(); } \ No newline at end of file diff --git a/Horion/Scripting/Functions/InventoryFunctions.h b/Horion/Scripting/Functions/InventoryFunctions.h index ceebb147..0f919ebb 100644 --- a/Horion/Scripting/Functions/InventoryFunctions.h +++ b/Horion/Scripting/Functions/InventoryFunctions.h @@ -7,6 +7,9 @@ class InventoryFunctions { DECL_FUN(getItems); DECL_FUN(getArmor); DECL_FUN(getHeld); + DECL_FUN(getSlot); + DECL_FUN(moveItem); + DECL_FUN(setSelected); DECL_FUN(isFull); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 2c487d08..636694d6 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -113,6 +113,9 @@ void ScriptManager::prepareInventoryFunctions(JsValueRef proto, ContextObjects* chakra.defineFunction(proto, L"getItems", InventoryFunctions::getItems, objs); chakra.defineFunction(proto, L"getArmor", InventoryFunctions::getArmor, objs); chakra.defineFunction(proto, L"getHeld", InventoryFunctions::getHeld, objs); + chakra.defineFunction(proto, L"getSlot", InventoryFunctions::getSlot, objs); + chakra.defineFunction(proto, L"setSelected", InventoryFunctions::setSelected, objs); + chakra.defineFunction(proto, L"moveItem", InventoryFunctions::moveItem, objs); chakra.defineProp(proto, L"isFull", InventoryFunctions::isFull, 0); } From 2b35380e441ae2dd6e08b9e58c78a096297e6b65 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 21:43:36 +0200 Subject: [PATCH 199/419] Add block place + break functions --- .../Functions/LocalPlayerFunctions.cpp | 76 +++++++++++++++++++ .../Functions/LocalPlayerFunctions.h | 4 + Horion/Scripting/ScriptManager.cpp | 5 ++ 3 files changed, 85 insertions(+) diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp index 75e19071..d0d4155a 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.cpp +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.cpp @@ -190,3 +190,79 @@ JsValueRef CALLBACK LocalPlayerFunctions::getInventory(JsValueRef callee, bool i return inventoryArr; } + +JsValueRef CALLBACK LocalPlayerFunctions::breakBlock(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + const auto plr = reinterpret_cast(ent); + + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); + if (!vecOpt.has_value()) { + THROW(L"Invalid vector!"); + } + + vec3_ti pos = vecOpt.value(); + + g_Data.getCGameMode()->destroyBlock(&pos, 1); + return chakra.trueValue(); +} + +JsValueRef CALLBACK LocalPlayerFunctions::placeBlock(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + const auto plr = reinterpret_cast(ent); + + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); + if (!vecOpt.has_value()) { + THROW(L"Invalid vector!"); + } + + vec3_ti pos = vecOpt.value(); + + g_Data.getCGameMode()->buildBlock(&pos, 1); + return chakra.trueValue(); +} + +JsValueRef CALLBACK LocalPlayerFunctions::breakBlockRelativeToPlr(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + const auto plr = reinterpret_cast(ent); + + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); + if (!vecOpt.has_value()) { + THROW(L"Invalid vector!"); + } + + vec3_ti pos = vecOpt.value().add(*plr->getPos()); + + g_Data.getCGameMode()->destroyBlock(&pos, 1); + return chakra.trueValue(); +} + +JsValueRef CALLBACK LocalPlayerFunctions::placeBlockRelativeToPlr(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto ent = EntityFunctions::getEntityFromValue(arguments[0]); + if (ent == nullptr) { + ENTITY_INVALID; + } + + const auto plr = reinterpret_cast(ent); + + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); + if (!vecOpt.has_value()) { + THROW(L"Invalid vector!"); + } + + vec3_ti pos = vecOpt.value().add(*plr->getPos()); + + g_Data.getCGameMode()->buildBlock(&pos, 1); + return chakra.trueValue(); +} \ No newline at end of file diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.h b/Horion/Scripting/Functions/LocalPlayerFunctions.h index a68a3796..f0587018 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.h +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.h @@ -14,4 +14,8 @@ class LocalPlayerFunctions { DECL_FUN(setIsOnGround); DECL_FUN(getInventory); DECL_FUN(getInventorySlot); + DECL_FUN(breakBlock); + DECL_FUN(placeBlock); + DECL_FUN(breakBlockRelativeToPlr); + DECL_FUN(placeBlockRelativeToPlr); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index d9e71ad6..31ff5b16 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -108,6 +108,11 @@ void ScriptManager::prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects chakra.defineFunction(proto, L"setIsOnGround", LocalPlayerFunctions::setIsOnGround, objs); chakra.defineFunction(proto, L"getInventory", LocalPlayerFunctions::getInventory, objs); chakra.defineFunction(proto, L"getInventorySlot", LocalPlayerFunctions::getInventorySlot, objs); + + chakra.defineFunction(proto, L"placeBlock", LocalPlayerFunctions::placeBlock, objs); + chakra.defineFunction(proto, L"placeBlockRelative", LocalPlayerFunctions::placeBlockRelativeToPlr, objs); + chakra.defineFunction(proto, L"breakBlock", LocalPlayerFunctions::breakBlock, objs); + chakra.defineFunction(proto, L"breakBlockRelative", LocalPlayerFunctions::breakBlockRelativeToPlr, objs); } void ScriptManager::prepareGameFunctions(JsValueRef global, ContextObjects* objs) { From 75b3a0356472083e4614d87202a3e131cdaff122 Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 21:48:45 +0200 Subject: [PATCH 200/419] WIP getBlock function --- Horion/Scripting/Functions/LevelFunctions.cpp | 20 +++++++++++++++++++ Horion/Scripting/Functions/LevelFunctions.h | 1 + Horion/Scripting/ScriptManager.cpp | 1 + 3 files changed, 22 insertions(+) diff --git a/Horion/Scripting/Functions/LevelFunctions.cpp b/Horion/Scripting/Functions/LevelFunctions.cpp index 6c4ff175..aaca65a3 100644 --- a/Horion/Scripting/Functions/LevelFunctions.cpp +++ b/Horion/Scripting/Functions/LevelFunctions.cpp @@ -43,4 +43,24 @@ JsValueRef CALLBACK LevelFunctions::getAllTargetEntities(JsValueRef callee, bool } return jsList; +} + +JsValueRef CALLBACK LevelFunctions::getBlock(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { + auto plr = g_Data.getLocalPlayer(); + + if (plr == nullptr) { + THROW(L"Player not valid"); + } + + auto vecOpt = Vector3Functions::getVec3FromArguments(&arguments[1], argumentCount - 1); + if (!vecOpt.has_value()) { + THROW(L"Invalid vector!"); + } + + auto block = plr->region->getBlock(vecOpt.value())->toLegacy(); + auto blockName = Utils::stringToWstring(block->name.getText()); + + JsValueRef ref; + chakra.JsPointerToString_(blockName.c_str(), blockName.size(), &ref); + return ref; } \ No newline at end of file diff --git a/Horion/Scripting/Functions/LevelFunctions.h b/Horion/Scripting/Functions/LevelFunctions.h index 06cf0b5d..a01bc187 100644 --- a/Horion/Scripting/Functions/LevelFunctions.h +++ b/Horion/Scripting/Functions/LevelFunctions.h @@ -7,4 +7,5 @@ class LevelFunctions { DECL_FUN(isValid); DECL_FUN(getAllEntities); DECL_FUN(getAllTargetEntities); + DECL_FUN(getBlock); }; diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index d9e71ad6..f361ecd1 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -325,6 +325,7 @@ void ScriptManager::prepareLevelFunctions(JsValueRef global, ContextObjects* obj chakra.defineFunction(objs->levelObject, L"isValid", LevelFunctions::isValid, objs); chakra.defineFunction(objs->levelObject, L"getAllEntities", LevelFunctions::getAllEntities, objs); chakra.defineFunction(objs->levelObject, L"getAllTargetEntities", LevelFunctions::getAllTargetEntities, objs); + chakra.defineFunction(objs->levelObject, L"getBlock", LevelFunctions::getBlock, objs); } JsValueRef ScriptManager::getLocalPlayer(ContextObjects* obs) { From a7d7824213faf94e5822c9dc03327b08b7bcf7dd Mon Sep 17 00:00:00 2001 From: Mixu Date: Sun, 15 Nov 2020 22:02:40 +0200 Subject: [PATCH 201/419] Proper block object + function --- Horion/Scripting/Functions/LevelFunctions.cpp | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Horion/Scripting/Functions/LevelFunctions.cpp b/Horion/Scripting/Functions/LevelFunctions.cpp index aaca65a3..2a97197f 100644 --- a/Horion/Scripting/Functions/LevelFunctions.cpp +++ b/Horion/Scripting/Functions/LevelFunctions.cpp @@ -1,5 +1,28 @@ #include "LevelFunctions.h" +JsValueRef createBlock(C_BlockLegacy *block) { + JsValueRef ref; + chakra.JsCreateObject_(&ref); + + std::wstring blockName = Utils::stringToWstring(block->name.getText()); + + JsValueRef bName; + chakra.JsPointerToString_(blockName.c_str(), blockName.size(), &bName); + + std::wstring tileName = Utils::stringToWstring(block->tileName.getText()); + + JsValueRef tName; + chakra.JsPointerToString_(tileName.c_str(), tileName.size(), &tName); + + JsValueRef id = chakra.toNumber(block->blockId); + + chakra.addPropertyToObj(ref, L"name", bName); + chakra.addPropertyToObj(ref, L"tileName", tName); + chakra.addPropertyToObj(ref, L"blockId", id); + + return ref; +} + JsValueRef CALLBACK LevelFunctions::isValid(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) { return chakra.toBoolean(g_Data.isInGame() && g_Data.getLocalPlayer()->isAlive()); } @@ -58,9 +81,5 @@ JsValueRef CALLBACK LevelFunctions::getBlock(JsValueRef callee, bool isConstruct } auto block = plr->region->getBlock(vecOpt.value())->toLegacy(); - auto blockName = Utils::stringToWstring(block->name.getText()); - - JsValueRef ref; - chakra.JsPointerToString_(blockName.c_str(), blockName.size(), &ref); - return ref; + return createBlock(block); } \ No newline at end of file From 3c0b62388ba03c5977ddad8b7ef80645f5416020 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 15 Nov 2020 21:27:26 +0100 Subject: [PATCH 202/419] structure builder fix --- Horion/Module/Modules/TestModule.cpp | 5 ++++- Utils/SkinUtil.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 4d35b877..47a6eeba 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -65,8 +65,11 @@ void loadFile(std::wstring filePath) { int num = 0; for (const auto& face : mesh.faces) { - if (face.facesPresent != 3) + if (face.facesPresent != 3) { + //logF("wierd face %i", face.facesPresent); continue; + } + const auto& v1 = mesh.vertices[face.indices[0].vertIndex]; const auto& v2 = mesh.vertices[face.indices[1].vertIndex]; diff --git a/Utils/SkinUtil.cpp b/Utils/SkinUtil.cpp index cac8be72..1b874571 100644 --- a/Utils/SkinUtil.cpp +++ b/Utils/SkinUtil.cpp @@ -80,7 +80,7 @@ std::string SkinUtil::modGeometry(const char* oldGeoStr, MeshStructs::meshData m } return geoMod.dump(); } -MeshStructs::meshData SkinUtil::objToMesh(const char* str, bool convertTrisToQuads) { +MeshStructs::meshData SkinUtil::objToMesh(const char* str, bool doWierdMogangStuff) { std::istringstream f(str); std::string line; @@ -132,7 +132,10 @@ MeshStructs::meshData SkinUtil::objToMesh(const char* str, bool convertTrisToQua logF("Faulty vertex, 3 args expected: %s", line.c_str()); continue; } - vertices.push_back({-std::stof(args[1]), std::stof(args[2]), std::stof(args[3])}); + if (doWierdMogangStuff) // flip x axis + vertices.push_back({-std::stof(args[1]), std::stof(args[2]), std::stof(args[3])}); + else + vertices.push_back({std::stof(args[1]), std::stof(args[2]), std::stof(args[3])}); } else if (strcmp(cmd, "f") == 0) { // face if (args.size() != 5 && args.size() != 4) { logF("Faulty face, only quads or tris allowed: %i", args.size() - 1); @@ -181,7 +184,7 @@ MeshStructs::meshData SkinUtil::objToMesh(const char* str, bool convertTrisToQua face.indices[i - 1] = part; } - if (args.size() == 4 && convertTrisToQuads) { // Convert triangles to quads + if (args.size() == 4 && doWierdMogangStuff) { // Convert triangles to quads face.facesPresent++; face.indices[face.facesPresent - 1] = face.indices[face.facesPresent - 2]; } From bcf57cbeaa90c633efe2fbfbe154c6bf075af5c0 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 18 Nov 2020 16:10:16 +0100 Subject: [PATCH 203/419] test --- Horion/Module/Modules/TestModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 47a6eeba..c52b423c 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -183,8 +183,8 @@ void TestModule::onTick(C_GameMode* gm) { if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock())) // Block in hand? return; - int radius = 6; - int numBlocksPerTick = 6; + int radius = 4; + int numBlocksPerTick = 1; for (int x = -radius; x < radius; x++) { for (int y = -radius; y < radius; y++) { for (int z = -radius; z < radius; z++) { From 4c22f29e9060e31a9df0e85799af3559d33516f8 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 18 Nov 2020 16:46:08 +0100 Subject: [PATCH 204/419] yes --- Horion/DrawUtils.cpp | 19 +++++++++++++++---- Memory/GameData.cpp | 2 +- Utils/Utils.cpp | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 7a3228a6..c0daa9d6 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -27,12 +27,23 @@ C_TexturePtr* texturePtr = nullptr; static MaterialPtr* uiMaterial = nullptr; static MaterialPtr* entityFlatStaticMaterial = nullptr; -tess_vertex_t tess_vertex = reinterpret_cast(FindSignature("48 8B C4 48 89 78 ?? 55 48 8D 68")); -tess_end_t tess_end = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 49 8B F0 48 8B DA 48 8B F9")); -mce__VertexFormat__disableHalfFloats_t mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("48 83 EC 28 4C 8B C9 C7 81 ?? ?? ?? ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81")); -Tessellator__initializeFormat_t Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); +tess_vertex_t tess_vertex; +tess_end_t tess_end; +mce__VertexFormat__disableHalfFloats_t mce__VertexFormat__disableHalfFloats; +Tessellator__initializeFormat_t Tessellator__initializeFormat; + +bool hasInitializedSigs = false; +void initializeSigs() { + hasInitializedSigs = true; + tess_vertex = reinterpret_cast(FindSignature("48 8B C4 48 89 78 ?? 55 48 8D 68")); + tess_end = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 49 8B F0 48 8B DA 48 8B F9")); + mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("48 83 EC 28 4C 8B C9 C7 81 ?? ?? ?? ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81")); + Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); +} void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { + if (!hasInitializedSigs) + initializeSigs(); LARGE_INTEGER EndingTime, ElapsedMicroseconds; LARGE_INTEGER Frequency; QueryPerformanceFrequency(&Frequency); diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 7a3d14b6..3de7be74 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -28,7 +28,7 @@ void GameData::retrieveClientInstance() { void GameData::checkGameVersion() { static uintptr_t sigOffset = 0; if (sigOffset == 0) - sigOffset = FindSignature("48 8D 1D ?? ?? ?? ?? 8B 04 0A 39 05 ?? ?? ?? ?? 0F 8F ?? ?? ?? ?? 4C 8B CB 48 83 3D ?? ?? ?? ?? 10 4C 0F 43 0D ?? ?? ?? ??"); + sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 4C 8B CA 48 83 3D"); int offset = *reinterpret_cast((sigOffset + 3)); std::string ver = reinterpret_cast(sigOffset + offset + 7)->getText(); auto lastDot = ver.find_last_of("."); diff --git a/Utils/Utils.cpp b/Utils/Utils.cpp index 4d5bb8b1..9e555c63 100644 --- a/Utils/Utils.cpp +++ b/Utils/Utils.cpp @@ -189,7 +189,7 @@ uintptr_t Utils::FindSignatureModule(const char* szModule, const char* szSignatu // This will not get optimized away because we are in debug // Leave this in here to quickly find bad signatures in case of updates logF("Signature dead: %s", szSignature); - if (true) { + if (false) { const char* msgToTheOverwhelmedDebugger = "SIGNATURE NOT FOUND"; __debugbreak(); } From 5ca1094feb28833a24c3ad6cd0b787917fa2c301 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Mon, 23 Nov 2020 00:47:54 -0400 Subject: [PATCH 205/419] fix client instance ptr & renderText Hook --- Memory/GameData.cpp | 4 ++-- Memory/Hooks.cpp | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 3de7be74..3b83bc7c 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -10,14 +10,14 @@ void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; uintptr_t sigOffset = 0x0; if (clientInstanceOffset == 0x0) { - sigOffset = FindSignature("48 8B 1D ?? ?? ?? ?? 48 8B 3D ?? ?? ?? ?? 48 3B DF 74 23 66 90"); + sigOffset = FindSignature("48 8B 05 ? ? ? ? 48 85 C0 74 06 F0 4C 0F C1 78 ? 48 89 3D"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } } - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x380, 0x10})); + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x38})); #ifdef _DEBUG if (g_Data.clientInstance == 0) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3a442061..f55a1fa9 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -42,11 +42,11 @@ void Hooks::Init() { } // BlockLegacy::vtable - { + /*{ //uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 48 89 ?? 4C 39"); // BlockLegacy constructor intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 39 7A ? 75 1A 48 C7 45"); // BlockLegacy constructor int offset = *reinterpret_cast(sigOffset + 3); - uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + 7); if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { @@ -54,7 +54,7 @@ void Hooks::Init() { g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[16], Hooks::BlockLegacy_getLightEmission); } - } + }*/ // LocalPlayer::vtable { @@ -73,22 +73,22 @@ void Hooks::Init() { } // MoveInputHandler::vtable - { + /*{ uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 42 ?? 48 85 C0 74 04"); int offset = *reinterpret_cast(sigOffset + 3); - uintptr_t** moveInputVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + uintptr_t** moveInputVtable = reinterpret_cast(sigOffset + offset + 7); if (moveInputVtable == 0x0 || sigOffset == 0x0) logF("C_GameMode signature not working!!!"); else { g_Hooks.MoveInputHandler_tickHook = std::make_unique(moveInputVtable[1], Hooks::MoveInputHandler_tick); } - } + }*/ // PackAccessStrategy vtables for isTrusted - { + /*{ uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); int offset = *reinterpret_cast(sigOffset + 3); - uintptr_t** directoryPackVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + uintptr_t** directoryPackVtable = reinterpret_cast(sigOffset + offset + 7); { g_Hooks.DirectoryPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable[6], Hooks::DirectoryPackAccessStrategy__isTrusted); @@ -96,13 +96,13 @@ void Hooks::Init() { uintptr_t sigOffset2 = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 49 8D 57"); int offset2 = *reinterpret_cast(sigOffset2 + 3); - uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + /*length of instruction*/ 7); + uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + / 7); { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); - } + }*/ } // d3d11 @@ -191,7 +191,7 @@ void Hooks::Init() { void* _sendChatMessage = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? 00 00 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); - void* _renderText = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 89 54 24")); + void* _renderText = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 B8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); g_Hooks.RenderTextHook->enableHook(); @@ -220,7 +220,7 @@ void Hooks::Init() { g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); - g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); + //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); @@ -241,7 +241,7 @@ void Hooks::Init() { g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); - g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); + //g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); From 85c5f054ebf5cda67b620cb642528c8165b28ac6 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 6 Dec 2020 14:43:33 +0100 Subject: [PATCH 206/419] 1.16.100 initial support --- Horion/DrawUtils.cpp | 18 ++++++------ Horion/Module/Modules/HudModule.cpp | 4 +-- Memory/Hooks.cpp | 19 ++++++------- SDK/CClientInstance.cpp | 4 +-- SDK/CClientInstance.h | 44 +++++++++++++++-------------- SDK/CEntity.cpp | 12 +++----- SDK/CEntity.h | 2 ++ 7 files changed, 52 insertions(+), 51 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index c0daa9d6..fb299d1f 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -34,11 +34,12 @@ Tessellator__initializeFormat_t Tessellator__initializeFormat; bool hasInitializedSigs = false; void initializeSigs() { - hasInitializedSigs = true; - tess_vertex = reinterpret_cast(FindSignature("48 8B C4 48 89 78 ?? 55 48 8D 68")); + + tess_vertex = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 7C 24 ?? 55 48 8D ?? ?? ?? 48 81 EC ?? ?? ?? ?? 44 0F 29")); tess_end = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 49 8B F0 48 8B DA 48 8B F9")); - mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("48 83 EC 28 4C 8B C9 C7 81 ?? ?? ?? ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81 ?? ?? ?? ?? ?? C6 81")); + mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 C7 81 ?? ?? ?? ?? 00 00 00 00 C6 81 ?? ?? ?? ?? 00")); Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); + hasInitializedSigs = true; } void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { @@ -101,13 +102,13 @@ void DrawUtils::setColor(float r, float g, float b, float a) { C_Font* DrawUtils::getFont(Fonts font) { if (true) - return g_Data.getClientInstance()->N0000080D->getOldFont(); + return g_Data.getClientInstance()->minecraftGame->getOldFont(); switch (font) { case Fonts::SMOOTH: - return g_Data.getClientInstance()->N0000080D->getTheGoodFontThankYou(); + return g_Data.getClientInstance()->minecraftGame->getTheGoodFontThankYou(); break; case Fonts::UNICOD: - return g_Data.getClientInstance()->N0000080D->getTheBetterFontYes(); + return g_Data.getClientInstance()->minecraftGame->getTheBetterFontYes(); break; case Fonts::RUNE: return g_Data.getClientInstance()->_getRuneFont(); @@ -558,11 +559,12 @@ void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVertices mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); *(unsigned char*)(tesselator + 8) = vertexFormat; *(unsigned char*)(tesselator + 0x1B4) = 0; - *(unsigned short*)(tesselator + 0x1FC) = 1; + *(unsigned char*)(tesselator + 0x1FC) = 1; + *(unsigned char*)(tesselator + 0x1FD) = 0; *(unsigned int*)(tesselator + 0x16C) = 0; *(__int64*)(tesselator + 0x150) = *(__int64*)(tesselator + 0x148); if (!*(unsigned char*)tesselator) - *(unsigned char*)(tesselator + 0xD0) = 1; + *(unsigned char*)(tesselator + 0xC8) = 1; if (numVerticesReserved != 0) Tessellator__initializeFormat(tesselator + 8, numVerticesReserved); } diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 3977778c..1bb032b3 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -82,7 +82,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { float y = windowSize.y - 57.5f; for (int i = 0; i < 4; i++) { C_ItemStack* stack = player->getArmor(i); - if (stack->item != nullptr) { + if (stack->isValid()) { DrawUtils::drawItem(stack, vec2_t(x, y), opacity, scale, stack->isEnchanted()); x += scale * spacing; } @@ -90,7 +90,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); C_ItemStack* item = supplies->inventory->getItemStack(supplies->selectedHotbarSlot); //x += scale * spacing; - if (item->item != nullptr) + if (item->isValid()) DrawUtils::drawItem(item, vec2_t(x, y), opacity, scale, item->isEnchanted()); } } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index f55a1fa9..87203d3e 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -106,7 +106,7 @@ void Hooks::Init() { } // d3d11 - { + /*{ /*const auto hModDXGI = GetModuleHandle(L"DXGI.dll"); const auto hModD3D11 = GetModuleHandle(L"D3D11.dll"); @@ -166,12 +166,12 @@ void Hooks::Init() { if (pSwapChain) { logF("swap vtable: %llX", *pSwapChain); pSwapChain->Release(); - }*/ + }* uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 91 ?? ?? ?? ?? E8"); if (sigOffset != 0x0) { int startOffsetOffset = *reinterpret_cast((sigOffset + 3)); - uintptr_t startOffset = sigOffset + startOffsetOffset + /*length of instruction*/ 7; + uintptr_t startOffset = sigOffset + startOffsetOffset + /*length of instruction/ 7; size_t secondOffset = (size_t) *reinterpret_cast((sigOffset + 10)); auto swapChain = g_Data.getSlimMem()->ReadPtr<__int64>(startOffset, {0, secondOffset, 0x170}); auto vtable = *reinterpret_cast(swapChain); @@ -181,7 +181,7 @@ void Hooks::Init() { g_Hooks.swapchain__presentHook = std::make_unique(vtable[8], Hooks::swapChain__present); g_Hooks.swapchain__resizeBuffersHook = std::make_unique(vtable[13], Hooks::swapChain__ResizeBuffers); } - } + }*/ // Signatures { @@ -353,7 +353,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { static auto oSendMessage = g_Hooks.ChatScreenController_sendChatMessageHook->GetFastcall(); using addCommandToChatHistory_t = void(__fastcall*)(__int64, char*); - static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 83 79 ?? ?? 48 8B FA 48 8B D9 76 46 48 8B 41 ?? 48 89 74 24 ?? 33 F6")); + static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 48 83 EC ?? 48 8B D9 48 8B F2")); uintptr_t* textLength = reinterpret_cast(_this + 0xA80); if (*textLength) { @@ -365,7 +365,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { cmdMgr->execute(message); __int64 a1 = 0; - a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x968i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); + a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x988i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) @@ -374,9 +374,9 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { __int64 v16 = *v15; if (*(BYTE*)(_this + 0xA9A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x970))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x990))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x968))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x988))(v15); *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); *reinterpret_cast<__int64*>(_this + 0xA80) = 0i64; @@ -1008,8 +1008,7 @@ void Hooks::PleaseAutoComplete(__int64 a1, __int64 a2, TextHolder* text, int a4) if (syncShit == nullptr) { uintptr_t sigOffset = 0; // sig of function: (present 3 times in the exe) - //sigOffset = FindSignature("40 57 48 83 EC 40 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 74 24 ? 48 8B F2 48 8D 3D ? ? ? ? 48 8B CF"); - sigOffset = FindSignature("49 8B D6 E8 ?? ?? ?? ?? 48 8B 5D ?? 48 85") + 4; + sigOffset = FindSignature("48 8B D7 48 8B 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 9C") + 11; auto funcOffset = *reinterpret_cast(sigOffset); sigOffset += 4 + funcOffset; diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index 1f8119ad..e2003461 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -7,8 +7,8 @@ __int64 MinecraftGame::getServerEntries() { return Utils::CallVFunc<30, __int64>(this); } void C_GuiData::displayClientMessage(std::string *a2) { - using displayClientMessage = void(__thiscall*)(void*, TextHolder); // This signature actually exists 2 times but we got luck that our function is the first in memory - static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("4C 8B DC 48 ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 49 ?? ?? ?? ?? ?? ?? ?? 33 C0 49 89 43 D8 41 88 43 C8 49")); + using displayClientMessage = void(__thiscall*)(void*, TextHolder&); + static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ?? ?? ?? ?? 48 C7 40 ?? FE FF FF FF 48 89 58 18 48 8B DA 48 8B F9 66")); TextHolder text = TextHolder(*a2); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 7166696d..6fc4e308 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -138,17 +138,17 @@ struct C_FontRepository { class MinecraftGame { private: - char filler[0x140]; //0x0000 + char filler[0x128]; //0x0000 public: - C_FontRepository* fontRepository; //0x140 + C_FontRepository* fontRepository; //0x128 private: - char pad_0x148[0x8]; //0x148 + char pad_0x148[0x28]; //0x130 public: - C_FontRepository* fontRepository1; //0x150 + C_FontRepository* fontRepository1; //0x158 private: - char pad_0x128[0x108]; //0x148 + char pad_0x128[0x100]; //0x160 public: - bool canUseKeys; //0x250 + bool canUseKeys; //0x260 C_Font* getTheGoodFontThankYou() { return fontRepository->fontList->fontEntries[7].font; @@ -231,32 +231,30 @@ class C_ClientInstance { MinecraftGame* N0000080C; //0x00A0 public: MinecraftGame* N0000080D; //0x00A8 -private: - MinecraftGame* N0000080E; //0x00B0 public: - Minecraft* minecraft; //0x00B8 + Minecraft* minecraft; //0x00B0 private: - char pad_0x0068[0x8]; //0x00C0 + char pad_0x0068[0x8]; //0x00B8 public: - LevelRenderer* levelRenderer; //0x00C8 + LevelRenderer* levelRenderer; //0x00C0 private: - char pad_0x0078[0x8]; //0x00D0 + char pad_0x0078[0x8]; //0x00C8 public: - C_LoopbackPacketSender* loopbackPacketSender; //0x00D8 + C_LoopbackPacketSender* loopbackPacketSender; //0x00D0 private: - char pad_0x0088[0x18]; //0x00E0 + char pad_0x0088[0x18]; //0x00D8 public: - PtrToGameSettings1* ptr; //0x00F8 + PtrToGameSettings1* ptr; //0x00F0 private: - char pad_0x00B0[0x8]; //0x0100 + char pad_0x00B0[0x8]; //0x00F8 public: - HitDetectSystem* hitDetectSystem; //0x0108 + HitDetectSystem* hitDetectSystem; //0x0100 private: - char pad_0x00B8[0x30]; //0x0110 + char pad_0x00B8[0x30]; //0x0108 public: - C_LocalPlayer* localPlayer; //0x0140 + C_LocalPlayer* localPlayer; //0x0138 private: - char pad[0x380]; // 0x0148 + char pad[0x380]; // 0x0140 public: struct { char pad[0x238]; @@ -264,7 +262,7 @@ class C_ClientInstance { __int64 materialPtr; size_t refCount; } entityLineMaterial; - } *itemInHandRenderer; // 0x04C8 + } *itemInHandRenderer; // 0x04C0 private: virtual __int64 destructorClientInstance(); @@ -391,7 +389,11 @@ class C_ClientInstance { virtual __int64 onGuiScaleOffsetChanged(void); virtual __int64 onSafeZoneChanged(void); virtual __int64 quit(std::string const&, std::string const&); + +public: virtual __int64 getMinecraftGame(void) const; + +private: virtual __int64 getAutomationClient(void) const; virtual __int64 getScreenshotStreamer(void) const; virtual __int64 getEventing(void) const; diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index d11547ae..425136a1 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -11,14 +11,10 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { - static unsigned int offset = 0; - if (offset == 0) { - //offset = *reinterpret_cast(FindSignature("4C 8B 82 ?? ?? ?? ?? 48 8B B2") + 3); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - offset = *reinterpret_cast(FindSignature("48 8B 53 ? 48 8B F0 4C 8B 8A ? ? ? ? 41 80 B9 ? ? ? ? ? 75 18 49 8B 89 ? ? ? ? 41 8B 51 ? 4C 8B 01 41 FF 50") + 10); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies - else - offset = *reinterpret_cast(FindSignature("48 8B 51 ? 4C 8B 82 ? ? ? ? 48 8B B2 ? ? ? ? 41 80 B8 ? ? ? ? ? ") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies - } + static unsigned int offset = 0xBD0; + /*if (offset == 0) { + offset = *reinterpret_cast(FindSignature("48 8B 51 ?? 4C 8B 82 ?? ?? ?? ?? 48 8B B2 ?? ?? ?? ?? 41 80 B8") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies + }*/ return *reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } void C_LocalPlayer::unlockAchievments() { // MinecraftEventing::fireEventAwardAchievement diff --git a/SDK/CEntity.h b/SDK/CEntity.h index f6909e2c..03dda8ce 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -141,6 +141,7 @@ class C_Entity { public: virtual void setPos(vec3_t const &); + virtual vec3_t *getPredictedMovementValues(void) const; virtual vec3_t *getPos(void) const; virtual vec3_t *getPosOld(void) const; virtual vec3_t *getPosExtrapolated(float) const; @@ -151,6 +152,7 @@ class C_Entity { public: virtual void setRot(vec2_t const &); + virtual void move(class IActorMovementProxy &, vec3_t const &); virtual void move(vec3_t const &); virtual __int64 getInterpolatedRidingPosition(float) const; virtual __int64 getInterpolatedBodyRot(float) const; From e77d4c3ebe9bdf84894024b46c5857dba890db48 Mon Sep 17 00:00:00 2001 From: DespairScent <74109497+DespairScent@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:50:31 +0200 Subject: [PATCH 207/419] Fix PlayerActionPacket blockPosition type --- SDK/CPacket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CPacket.h b/SDK/CPacket.h index a7eaac62..13cbf40f 100644 --- a/SDK/CPacket.h +++ b/SDK/CPacket.h @@ -64,7 +64,7 @@ class C_PlayerActionPacket : public C_Packet { public: C_PlayerActionPacket(); char pad_0x8[0x20]; //0x8 - vec3_t blockPosition; // 0x28 + vec3_ti blockPosition; // 0x28 int face; // 0x34 int action; // 0x38 __int64 entityRuntimeId; // 0x40 From 9fabdd9de4fd88d806d95b410e72d8a474979ba2 Mon Sep 17 00:00:00 2001 From: DespairScent <74109497+DespairScent@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:52:24 +0200 Subject: [PATCH 208/419] Update type in usage --- SDK/CGameMode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CGameMode.cpp b/SDK/CGameMode.cpp index fcfd01ca..4b3a7190 100644 --- a/SDK/CGameMode.cpp +++ b/SDK/CGameMode.cpp @@ -18,7 +18,7 @@ void C_GameMode::survivalDestroyBlockHack(vec3_ti const &block, int face, bool & C_PlayerActionPacket action; action.action = 18; - action.blockPosition = vec3_t(block.x, block.y, block.z); + action.blockPosition = vec3_ti(block.x, block.y, block.z); action.face = face; action.entityRuntimeId = p->entityRuntimeId; g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&action); From bde5d88f7f35fe72ca3f423c18e329c6f40a29bb Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 13:46:58 +0100 Subject: [PATCH 209/419] Initial 1.16.200 support --- Horion/Loader.cpp | 2 +- Memory/GameData.cpp | 8 +++++--- Memory/Hooks.cpp | 45 +++++++++++++++-------------------------- SDK/CClientInstance.cpp | 3 ++- 4 files changed, 24 insertions(+), 34 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 65efe800..4f181e66 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -22,7 +22,7 @@ DWORD WINAPI keyThread(LPVOID lpParam) { throw std::exception("Clickmap not allocated"); bool* keyMapAddr = nullptr; - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 89 1C 81 48"); + uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 89 1C B9"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code keyMapAddr = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); // Offset is relative diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 3b83bc7c..583890ef 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -17,7 +17,8 @@ void GameData::retrieveClientInstance() { logF("clinet: %llX", clientInstanceOffset); } } - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x38})); + clientInstanceOffset = 0x03A30F18; + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x40})); #ifdef _DEBUG if (g_Data.clientInstance == 0) @@ -27,8 +28,9 @@ void GameData::retrieveClientInstance() { void GameData::checkGameVersion() { static uintptr_t sigOffset = 0; + // near string MinimumCompatibleClientVersion if (sigOffset == 0) - sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 4C 8B CA 48 83 3D"); + sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 48 3B CA 74 ?? 48 83 3D ?? ?? ?? ?? 10 48 0F 43 15 ?? ?? ?? ?? 4C 8B 05 ?? ?? ?? ?? E8 ?? ?? ?? ?? 49 8B C7"); int offset = *reinterpret_cast((sigOffset + 3)); std::string ver = reinterpret_cast(sigOffset + offset + 7)->getText(); auto lastDot = ver.find_last_of("."); @@ -53,7 +55,7 @@ bool GameData::canUseMoveKeys() { bool GameData::isKeyDown(int key) { static uintptr_t keyMapOffset = 0x0; if (keyMapOffset == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 89 1C 81 48"); + uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 89 1C B9"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code keyMapOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 87203d3e..5ee82121 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -25,7 +25,7 @@ void Hooks::Init() { { // GameMode::vtable { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 33 D2 48 C7 41 ??"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? C7 41 18 FF FF FF FF"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** gameModeVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (gameModeVtable == 0x0 || sigOffset == 0x0) @@ -58,7 +58,7 @@ void Hooks::Init() { // LocalPlayer::vtable { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 48 8B 89 ?? ?? ?? ?? 48 8B 01 ?? ?? ?? ?? ?? ?? 90 48 8B 08"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 07 48 8D 8F ?? ?? ?? ?? 48 8B 87"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** localPlayerVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (localPlayerVtable == 0x0 || sigOffset == 0x0) @@ -66,7 +66,7 @@ void Hooks::Init() { else { g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[61], Hooks::Actor_isInWater); - g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); + //g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder); } @@ -185,7 +185,7 @@ void Hooks::Init() { // Signatures { - void* surv_tick = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9 8B 41")); + void* surv_tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 56 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9 F3")); g_Hooks.SurvivalMode_tickHook = std::make_unique(surv_tick, Hooks::SurvivalMode_tick); void* _sendChatMessage = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? 00 00 48 8B D9 48 83 B9")); @@ -207,7 +207,7 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 8B 41 ?? 48 8B FA 48 89 6C 24 ?? 48 8B D9 4C 89 74 24 ?? 48 85 C0")); + void* chestTick = reinterpret_cast(FindSignature("48 89 5C 24 18 56 57 41 56 48 83 EC ?? 48 83 79")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); @@ -240,16 +240,17 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); + //void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); //g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); - void* jump = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 01 48 8B F9 0F 29 74 24")); + // Mob::_jumpFromGround + void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); - void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 8B C4 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 48 89 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F1 48 C7 85 ?? ?? ?? ?? ?? ?? ?? ?? 48 8D 95 ?? ?? ?? ?? 48 8B 89")); + void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 54 41 56 41 57 48 8D ?? 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F9 45 33 E4 4C")); g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D9 4D 8B F8")); @@ -272,15 +273,6 @@ void Hooks::Init() { g_Hooks.InventoryTransactionManager__addActionHook = std::make_unique(addAction, Hooks::InventoryTransactionManager__addAction); #endif - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 0F 29 70 ?? 48 8B 05")); - else - void* prepFeaturedServers = reinterpret_cast(FindSignature("48 8B C4 55 48 8D 68 98 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 10 48 89 78 18 0F 29 70 E8 48 8B 05 ? ? ? ? 48 33 C4")); - //g_Hooks.prepFeaturedServersHook = std::make_unique(prepFeaturedServers, Hooks::prepFeaturedServers); - - void* prepFeaturedServersFirstTime = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 C7 40 ?? FE FF FF FF 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA")); - //g_Hooks.prepFeaturedServersFirstTimeHook = std::make_unique(prepFeaturedServersFirstTime, Hooks::prepFeaturedServersFirstTime); - void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); @@ -316,6 +308,8 @@ void Hooks::Init() { g_Hooks.lambdaHooks.push_back(bobViewHook); #undef lambda_counter + + logF("Hooks initialized"); } // clang-format on @@ -328,6 +322,7 @@ void Hooks::Restore() { void Hooks::Enable() { MH_EnableHook(MH_ALL_HOOKS); + logF("Hooks enabled"); } void Hooks::GameMode_tick(C_GameMode* _this) { @@ -1178,17 +1173,9 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe float Hooks::LevelRendererPlayer_getFov(__int64 _this, float a2, bool a3) { static auto oGetFov = g_Hooks.LevelRendererPlayer_getFovHook->GetFastcall(); - static void* renderItemInHand = reinterpret_cast(FindSignature("0F 28 F0 F3 44 0F 10 3D ?? ?? ?? ?? F3 41 0F 59 F7")); - - static void* setupCamera = nullptr; + static void* renderItemInHand = reinterpret_cast(FindSignature("0F 28 C8 F3 0F 59 0D ?? ?? ?? ?? 41 0F 28 F9")); - if (!setupCamera) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - setupCamera = reinterpret_cast(FindSignature("0F 28 F8 F3 0F 59 3D ? ? ? ? 41 0F B6 4E ? 88 4C 24 ?? 44 0F B6 E1")); - else - setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ? ? ? ? 41 0F B6 4E ? 88 4C 24")); - } - + static void* setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ?? ?? ?? ?? 0F")); static auto zoomModule = moduleMgr->getModule(); @@ -1460,8 +1447,8 @@ void Hooks::Actor_ascendLadder(C_Entity* _this) { void Hooks::Actor_startSwimming(C_Entity* _this) { static auto oFunc = g_Hooks.Actor_startSwimmingHook->GetFastcall(); - static auto JesusModule = moduleMgr->getModule(); - if (JesusModule->isEnabled() && g_Data.getLocalPlayer() == _this) + static auto jesusModule = moduleMgr->getModule(); + if (jesusModule->isEnabled() && g_Data.getLocalPlayer() == _this) return; oFunc(_this); diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index e2003461..ba73d2f9 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -12,7 +12,8 @@ void C_GuiData::displayClientMessage(std::string *a2) { TextHolder text = TextHolder(*a2); - displayMessageFunc(this, text); + if (displayMessageFunc != nullptr) + displayMessageFunc(this, text); } void C_GuiData::displayClientMessageF(const char *fmt, ...) { va_list arg; From 1447ed82a2082338a66601880112fc58775af203 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 13:59:58 +0100 Subject: [PATCH 210/419] Fix accidental activation of all hooks --- Memory/Hooks.cpp | 9 +++++---- Memory/Hooks.h | 10 +++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 5ee82121..4d7dc54a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -34,9 +34,9 @@ void Hooks::Init() { g_Hooks.GameMode_startDestroyBlockHook = std::make_unique(gameModeVtable[1], Hooks::GameMode_startDestroyBlock); g_Hooks.GameMode_tickHook = std::make_unique(gameModeVtable[9], Hooks::GameMode_tick); - + g_Hooks.GameMode_getPickRangeHook = std::make_unique(gameModeVtable[10], Hooks::GameMode_getPickRange); - + g_Hooks.GameMode_attackHook = std::make_unique(gameModeVtable[14], Hooks::GameMode_attack); } } @@ -66,7 +66,7 @@ void Hooks::Init() { else { g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[61], Hooks::Actor_isInWater); - //g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); + g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder); } @@ -321,8 +321,9 @@ void Hooks::Restore() { } void Hooks::Enable() { - MH_EnableHook(MH_ALL_HOOKS); logF("Hooks enabled"); + MH_EnableHook(MH_ALL_HOOKS); + } void Hooks::GameMode_tick(C_GameMode* _this) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index e5b0e565..fcaa65bb 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -204,9 +204,13 @@ class FuncHook { }; void enableHook(bool enable = true) { - int ret = enable ? MH_EnableHook(funcPtr) : MH_DisableHook(funcPtr); - if (ret != MH_OK) - logF("MH_EnableHook = %i", ret); + if (funcPtr != nullptr) { + int ret = enable ? MH_EnableHook(funcPtr) : MH_DisableHook(funcPtr); + if (ret != MH_OK) + logF("MH_EnableHook = %i", ret); + }else + logF("enableHook() called with nullptr func!"); + } ~FuncHook() { From 49122cb347f5174910daae3baa5cb824e272d39f Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 15:08:50 +0100 Subject: [PATCH 211/419] Tesselator --- Horion/DrawUtils.cpp | 36 ++++++++++++++++++++---------------- Memory/GameData.cpp | 10 +++++----- Memory/Hooks.cpp | 2 +- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index fb299d1f..3119c562 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -9,7 +9,7 @@ struct MaterialPtr { }; using tess_vertex_t = void(__fastcall*)(Tessellator* _this, float v1, float v2, float v3); -using tess_end_t = void(__fastcall*)(__int64, Tessellator* tesselator, MaterialPtr*); +using meshHelper_renderImm_t = void(__fastcall*)(__int64, Tessellator* tesselator, MaterialPtr*); C_MinecraftUIRenderContext* renderCtx; C_GuiData* guiData; @@ -28,17 +28,17 @@ static MaterialPtr* uiMaterial = nullptr; static MaterialPtr* entityFlatStaticMaterial = nullptr; tess_vertex_t tess_vertex; -tess_end_t tess_end; -mce__VertexFormat__disableHalfFloats_t mce__VertexFormat__disableHalfFloats; -Tessellator__initializeFormat_t Tessellator__initializeFormat; +meshHelper_renderImm_t meshHelper_renderImm; +//mce__VertexFormat__disableHalfFloats_t mce__VertexFormat__disableHalfFloats; +//Tessellator__initializeFormat_t Tessellator__initializeFormat; bool hasInitializedSigs = false; void initializeSigs() { - tess_vertex = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 7C 24 ?? 55 48 8D ?? ?? ?? 48 81 EC ?? ?? ?? ?? 44 0F 29")); - tess_end = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 49 8B F0 48 8B DA 48 8B F9")); - mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 C7 81 ?? ?? ?? ?? 00 00 00 00 C6 81 ?? ?? ?? ?? 00")); - Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); + tess_vertex = reinterpret_cast(FindSignature("4C 8B DC 57 48 81 EC ?? ?? ?? ?? 41 0F")); + meshHelper_renderImm = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 49 8B F0 48 8B DA")); + //mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 C7 81 ?? ?? ?? ?? 00 00 00 00 C6 81 ?? ?? ?? ?? 00")); + //Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); hasInitializedSigs = true; } @@ -162,7 +162,7 @@ void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { tess_vertex(tesselator, p2.x, p2.y, 0); tess_vertex(tesselator, p3.x, p3.y, 0); - tess_end(screenContext2d, tesselator, uiMaterial); + meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } @@ -174,7 +174,7 @@ void DrawUtils::drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4) { tess_vertex(tesselator, p3.x, p3.y, 0); tess_vertex(tesselator, p4.x, p4.y, 0); - tess_end(screenContext2d, tesselator, uiMaterial); + meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { @@ -198,7 +198,7 @@ void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { tess_vertex(tesselator, end.x + modX, end.y + modY, 0); tess_vertex(tesselator, end.x - modX, end.y - modY, 0); - tess_end(screenContext2d, tesselator, uiMaterial); + meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } void DrawUtils::drawText(vec2_t pos, std::string* textStr, MC_Color color, float textSize, float alpha, Fonts font) { @@ -496,7 +496,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { tess_vertex(myTess, start1.x, start1.y, start1.z); tess_vertex(myTess, end1.x, end1.y, end1.z); - tess_end(game3dContext, myTess, entityFlatStaticMaterial); + meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { if (game3dContext == 0 || entityFlatStaticMaterial == 0) @@ -547,7 +547,7 @@ void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { #undef li #undef line - tess_end(game3dContext, myTess, entityFlatStaticMaterial); + meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { DrawUtils::setColor(col.r, col.g, col.b, alpha); @@ -555,7 +555,11 @@ void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { } void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVerticesReserved) { __int64 tesselator = reinterpret_cast<__int64>(tess); - if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { + + using tess_begin_t = void(__fastcall*)(Tessellator*, int, int); + static tess_begin_t tess_begin = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 45")); + tess_begin(tess, vertexFormat, numVerticesReserved); + /*if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); *(unsigned char*)(tesselator + 8) = vertexFormat; *(unsigned char*)(tesselator + 0x1B4) = 0; @@ -567,7 +571,7 @@ void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVertices *(unsigned char*)(tesselator + 0xC8) = 1; if (numVerticesReserved != 0) Tessellator__initializeFormat(tesselator + 8, numVerticesReserved); - } + }*/ } void DrawUtils::setGameRenderContext(__int64 ctx) { game3dContext = ctx; @@ -622,5 +626,5 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { tess_vertex(myTess, pD.x, pD.y, pD.z); } - tess_end(game3dContext, myTess, entityFlatStaticMaterial); + meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 583890ef..4b58c711 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -8,16 +8,16 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; - uintptr_t sigOffset = 0x0; + /*uintptr_t sigOffset = 0x0; if (clientInstanceOffset == 0x0) { - sigOffset = FindSignature("48 8B 05 ? ? ? ? 48 85 C0 74 06 F0 4C 0F C1 78 ? 48 89 3D"); + sigOffset = FindSignature("48 8B 05 ? ? ? ? 48 85 C0 74"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code - clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative + clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instructio/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } - } - clientInstanceOffset = 0x03A30F18; + }*/ + clientInstanceOffset = 0x03A30F18; // pointer scanned, can't find good signatures so it'll stay g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x40})); #ifdef _DEBUG diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 4d7dc54a..9c5b1660 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -191,7 +191,7 @@ void Hooks::Init() { void* _sendChatMessage = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? 00 00 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); - void* _renderText = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 B8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA")); + void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 70 ?? 0F 29 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B F2 48 89 54 24")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); g_Hooks.RenderTextHook->enableHook(); From 001b99988b3183a51515ac01937eb73ea4eb5280 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 16:30:36 +0100 Subject: [PATCH 212/419] Actor vtable & offsets --- Horion/DrawUtils.cpp | 1 + Horion/Module/Modules/Bhop.cpp | 2 +- Memory/GameData.cpp | 4 +- SDK/CEntity.h | 130 ++++++++++++++++++--------------- 4 files changed, 77 insertions(+), 60 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 3119c562..1e0b5372 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -625,6 +625,7 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { auto pD = p.sub(origin); tess_vertex(myTess, pD.x, pD.y, pD.z); } + meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } diff --git a/Horion/Module/Modules/Bhop.cpp b/Horion/Module/Modules/Bhop.cpp index 41eb7c95..78293b5a 100644 --- a/Horion/Module/Modules/Bhop.cpp +++ b/Horion/Module/Modules/Bhop.cpp @@ -17,7 +17,7 @@ void Bhop::onMove(C_MoveInputHandler* input) { if (player->isInLava() == 1 || player->isInWater() == 1) return; - + if (player->isSneaking()) return; diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 4b58c711..0e212021 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -180,11 +180,11 @@ void GameData::forEachEntity(std::function callback) { { // MultiplayerLevel::directTickEntities __int64 region = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->region); - __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x120i64); + __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x130i64); for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; // !isRemoved() && !isGlobal() - if (actor && !*(char*)(actor + 0x389) && !*(char*)(actor + 0x38A)) { + if (actor && !*(char*)(actor + 0x3C1) && !*(char*)(actor + 0x3C2)) { C_Entity* ent = reinterpret_cast(actor); if (std::find(tickedEntities.begin(), tickedEntities.end(), ent) == tickedEntities.end()) { callback(ent, false); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 03dda8ce..3dc03e09 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -27,12 +27,12 @@ class C_Entity { public: uintptr_t *ptrToPtrToEntList; //0x0008 private: - char pad_0010[0xF0]; //0x0010 + char pad_0010[0x110]; //0x0010 public: union { struct { - float pitch; //0x0100 - float yaw; //0x0104 + float pitch; //0x0120 + float yaw; //0x0124 }; vec2_t viewAngles; }; @@ -41,84 +41,84 @@ class C_Entity { float pitch2; float yaw2; }; - vec2_t viewAngles2; + vec2_t viewAngles2; // 0x128 }; private: - char pad_0100[0x10]; //0x0110 + char pad_0100[0x10]; //0x0130 public: - vec3_t eyePos0; //0x0120 + vec3_t eyePos0; //0x0140 private: - char pad_0x11C[0x70]; //0x12C + char pad_0x11C[0x70]; //0x14C public: - float fallDistance; //0x19C - bool onGround; //0x01A0 + float fallDistance; //0x1BC + bool onGround; //0x01C0 private: - char pad_0x179[0x5F]; //0x1A1 + char pad_0x179[0x5F]; //0x1C1 public: - float stepHeight; //0x200 + float stepHeight; //0x220 private: - char pad_0x228[0x10]; //0x204 + char pad_0x228[0x10]; //0x224 public: - float web; //0x0214 + float web; //0x0234 private: - char pad_0x23C[0x5]; //0x0218 + char pad_0x23C[0xD]; //0x0238 public: - bool didEnterWaterBool; //0x021D + bool didEnterWaterBool; //0x0245 private: - char pad_023E[0x4E]; //0x021E + char pad_023E[0x4E]; //0x0246 public: - int ticksAlive; //0x026C + int ticksAlive; //0x0294 private: - char pad_0290[0xB0]; //0x0270 + char pad_0290[0xB0]; //0x0298 public: - C_BlockSource *region; //0x320 + C_BlockSource *region; //0x348 private: - char pad_0x340[0x130]; //0x328 + char pad_0x340[0x148]; //0x350 public: - AABB aabb; //0x0458 - float width; //0x0474 - float height; //0x0478 - vec3_t currentPos; //0x047C - vec3_t oldPos; //0x0488 - vec3_t velocity; //0x0494 + AABB aabb; //0x0498 + float width; //0x04B4 + float height; //0x04B8 + vec3_t currentPos; //0x04BC + vec3_t oldPos; //0x04C8 + vec3_t velocity; //0x04D4 private: - char pad_0x0478[0x50]; //0x4A0 + char pad_0x0478[0x58]; //0x4E0 public: - __int64 entityRuntimeId; //0x4F0 + __int64 entityRuntimeId; //0x538 private: - char pad_0478[0x128]; //0x04F8 + char pad_0478[0x148]; //0x0540 public: - float bodyYaw; //0x0620 - float oldBodyYaw; //0x0624 - float yawUnused1; //0x0628 - float yawUnused2; //0x062C - int damageTime; //0x0630 + float bodyYaw; //0x0688 + float oldBodyYaw; //0x068C + float yawUnused1; //0x0690 + float yawUnused2; //0x0694 + int damageTime; //0x0698 private: - char pad_0824[0x88]; //0x0634 + char pad_0824[0x8C]; //0x069C public: - int timeSinceDeath; //0x06BC + int timeSinceDeath; //0x0728 private: - char pad_08B0[0x204]; //0x06C0 + char pad_08B0[0x200]; //0x072C public: - bool canFly; //0x08C4 + bool canFly; //0x092C private: - char pad_0x0A95[0x6B3]; //0x08C5 + char pad_0x0A95[0x6C3]; //0x092D public: - int16_t itemData; //0x0F78 - int16_t itemId; //0x0F7A + int16_t itemData; //0x0FF0 + int16_t itemId; //0x0FF2 private: - char pad_10CC[0x1FC]; //0x0F7C + char pad_10CC[0x1FC]; //0x0FF4 public: - C_InventoryTransactionManager transac; //0x1178 + C_InventoryTransactionManager transac; //0x11F0 private: - char pad_0x1324[0xAA4]; //0x11E0 + char pad_0x1324[0xAA4]; //0x1258 public: - int gamemode; //0x1C84 + int gamemode; //0x1CFC private: - char pad_1DA4[0x238]; //0x1C88 + char pad_1DA4[0x260]; //0x1D00 public: - TextHolder uuid; //0x1EC0 + TextHolder uuid; //0x1F60 public: virtual bool hasComponent(__int64 const &) const; @@ -166,7 +166,6 @@ class C_Entity { virtual bool isFireImmune(); virtual bool breaksFallingBlocks(void) const; virtual bool blockedByShield(__int64 const &, C_Entity &); - virtual void moveRelative(float, float, float, float); virtual void teleportTo(vec3_t const &, bool, int, int); virtual void tryTeleportTo(vec3_t const &, bool, bool, int, int); virtual void chorusFruitTeleport(vec3_t &); @@ -251,7 +250,6 @@ class C_Entity { virtual bool isFishable(void) const; virtual bool isSleeping(); virtual bool isPushable(void) const; - virtual bool isSneaking(void) const; virtual void setSneaking(bool); virtual bool isBlocking(void) const; virtual bool isDamageBlocked(__int64 const &) const; @@ -261,6 +259,12 @@ class C_Entity { virtual bool isCreativeModeAllowed(void); virtual bool isSurfaceMob(void) const; virtual bool isTargetable(void) const; + +private: + virtual bool unk1(void) const; + virtual bool unk2(void) const; + +public: virtual bool canAttack(C_Entity *, bool) const; virtual void setTarget(C_Entity *); @@ -332,7 +336,7 @@ class C_Entity { virtual __int64 getArmorColorInSlot(__int64, int) const; public: - virtual void setEquippedSlot(__int64, int, int); + virtual void getEquippedSlot(__int64); virtual void setEquippedSlot(__int64, __int64 const &); private: @@ -377,7 +381,7 @@ class C_Entity { private: virtual __int64 changeDimension(__int64, bool); virtual __int64 changeDimension(__int64 const &); - virtual __int64 getControllingC_Player(void) const; + virtual __int64 getControllingPlayer(void) const; virtual __int64 checkFallDamage(float, bool); public: @@ -487,6 +491,7 @@ class C_Entity { virtual __int64 kill(void); virtual __int64 die(__int64 const &); virtual __int64 shouldTick(void) const; + virtual __int64 createMovementProxy(void); virtual __int64 updateEntitySpecificMolangVariables(__int64 &); public: @@ -524,7 +529,6 @@ class C_Entity { public: virtual void setSleeping(bool); - virtual bool isSprinting(void) const; virtual void setSprinting(bool); private: @@ -543,11 +547,13 @@ class C_Entity { virtual __int64 hurtEffects(__int64 const &, int, bool, bool); virtual __int64 getMeleeWeaponDamageBonus(__int64 *); virtual __int64 getMeleeKnockbackBonus(void); + virtual __int64 travel(__int64, float, float, float); virtual __int64 travel(float, float, float); virtual __int64 applyFinalFriction(float, bool); virtual __int64 updateWalkAnim(void); + virtual __int64 aiStep(__int64); virtual __int64 aiStep(void); - virtual __int64 pushEntities(void); + virtual __int64 pushActors(void); virtual __int64 lookAt(C_Entity *, float, float); public: @@ -600,6 +606,8 @@ class C_Entity { virtual __int64 getArmorValue(void); virtual __int64 getArmorCoverPercentage(void) const; virtual __int64 hurtArmor(int); + virtual __int64 hurtArmor(int, __int64); + virtual __int64 hurtArmorSlot(int, __int64); virtual __int64 setDamagedArmor(); virtual __int64 idk3(); virtual __int64 sendArmor(void); @@ -611,8 +619,8 @@ class C_Entity { virtual __int64 getAllHand(void) const; virtual __int64 getAllEquipment(void) const; virtual __int64 getArmorTypeHash(void); - virtual __int64 dropEquipment(void); - virtual __int64 dropEquipment(__int64 const &, int); + virtual __int64 dropEquipmentOnDeath(void); + virtual __int64 dropEquipmentOnDeath(__int64 const &, int); virtual __int64 clearVanishEnchantedItems(void); virtual __int64 sendInventory(bool); virtual __int64 getDamageAfterMagicAbsorb(__int64 const &, int); @@ -636,9 +644,11 @@ class C_Entity { virtual __int64 ascendLadder(void); virtual __int64 ascendScaffolding(void); virtual __int64 descendScaffolding(void); + virtual __int64 dropContainer(void); virtual __int64 initBodyControl(void); public: + virtual __int64 jumpFromGround(__int64); virtual __int64 jumpFromGround(void); private: @@ -648,9 +658,7 @@ class C_Entity { virtual __int64 getDamageAfterEnchantReduction(__int64 const &, int); virtual __int64 getDamageAfterArmorAbsorb(__int64 const &, int); virtual __int64 dropBags(void); - virtual __int64 dropContainer(void); virtual __int64 tickDeath(void); - virtual __int64 _endJump(void); virtual __int64 updateGliding(void); virtual __int64 _allowAscendingScaffolding(void) const; virtual __int64 prepareRegion(__int64 &); @@ -685,6 +693,14 @@ class C_Entity { return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0xF60); } + bool isSneaking() { + return false; // TODO + } + + bool isSprinting() { + return false; // TODO + } + }; #pragma pack(pop) From 5a39fa3ba59880b99d60bf0e53cf7b153a7f22ad Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 17:31:47 +0100 Subject: [PATCH 213/419] Chat messages and for some reason we render 3x per frame --- Memory/Hooks.cpp | 32 +++++++++++++------------------- SDK/CClientInstance.cpp | 2 +- SDK/CUIScene.h | 4 ++-- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 9c5b1660..f075031a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -188,17 +188,17 @@ void Hooks::Init() { void* surv_tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 56 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9 F3")); g_Hooks.SurvivalMode_tickHook = std::make_unique(surv_tick, Hooks::SurvivalMode_tick); - void* _sendChatMessage = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? 00 00 48 8B D9 48 83 B9")); + void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC ?? 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 70 ?? 0F 29 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B F2 48 89 54 24")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); g_Hooks.RenderTextHook->enableHook(); - void* setupRender = reinterpret_cast(FindSignature("40 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8B F9 33 D2 ?? ?? ?? ?? ?? ?? 48 8D 4C 24 30 E8 ?? ?? ?? ?? 4C 8B CF 4C 8B C3 48 8B 57 ?? 48 8D 4C 24")); + void* setupRender = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B DA 48 8B F9 33 D2 41 B8")); g_Hooks.UIScene_setupAndRenderHook = std::make_unique(setupRender, Hooks::UIScene_setupAndRender); - void* render = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B DA 48 8B F9 B9 ?? ?? ?? ?? 65 48 8B 04 25 ?? ?? ?? ?? 48 8B 10 8B 04 11 39 05")); + void* render = reinterpret_cast(FindSignature("48 89 5C 24 18 56 57 41 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 41")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); @@ -348,22 +348,17 @@ void Hooks::SurvivalMode_tick(C_GameMode* _this) { void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { static auto oSendMessage = g_Hooks.ChatScreenController_sendChatMessageHook->GetFastcall(); - using addCommandToChatHistory_t = void(__fastcall*)(__int64, char*); - static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 48 83 EC ?? 48 8B D9 48 8B F2")); + using addCommandToChatHistory_t = void(__fastcall*)(uint8_t*, TextHolder*); + static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC ?? 48 8B 99 ?? ?? ?? ?? 48 8B F2 80")); - uintptr_t* textLength = reinterpret_cast(_this + 0xA80); - if (*textLength) { - char* message = reinterpret_cast(_this + 0xA70); - if (*reinterpret_cast<__int64*>(_this + 0xA88) >= 0x10) - message = *reinterpret_cast(message); + TextHolder* messageHolder = reinterpret_cast(_this + 0xA70); + if (messageHolder->getTextLength() > 0) { + char* message = messageHolder->getText(); if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - __int64 a1 = 0; - a1 = (*(__int64(__cdecl**)(__int64))(**(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64) + 0x988i64))(*(__int64*)(*(__int64*)(_this + 0xA58) + 0x20i64)); - - addCommandToChatHistory(a1, (char*)(_this + 0xA70)); // This will put the command in the chat history (Arrow up/down) + addCommandToChatHistory(_this, messageHolder); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; __int64* v15 = *(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64); @@ -375,9 +370,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x988))(v15); *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); - *reinterpret_cast<__int64*>(_this + 0xA80) = 0i64; - *message = 0x0; // Remove command in textbox - *textLength = 0x0; // text length + messageHolder->resetWithoutDelete(); return; } else if (*message == '.') { // maybe the user forgot his prefix, give him some helpful advice @@ -410,9 +403,10 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { TextHolder alloc = {}; uiscene->getScreenName(&alloc); - if (alloc.getTextLength() < 100) + if (alloc.getTextLength() < 100) { strcpy_s(g_Hooks.currentScreenName, alloc.getText()); - + } + if (!g_Hooks.shouldRender) { g_Hooks.shouldRender = alwaysRender || (strcmp(alloc.getText(), "start_screen") == 0 || (alloc.getTextLength() >= 11 && strncmp(alloc.getText(), "play_screen", 11)) == 0); } diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index ba73d2f9..57c30f99 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -8,7 +8,7 @@ __int64 MinecraftGame::getServerEntries() { } void C_GuiData::displayClientMessage(std::string *a2) { using displayClientMessage = void(__thiscall*)(void*, TextHolder&); - static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ?? ?? ?? ?? 48 C7 40 ?? FE FF FF FF 48 89 58 18 48 8B DA 48 8B F9 66")); + static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 4F ?? ?? ?? ?? 33 DB 48 89 5D ?? 88 5D")); TextHolder text = TextHolder(*a2); diff --git a/SDK/CUIScene.h b/SDK/CUIScene.h index 7726b6a4..3617cce1 100644 --- a/SDK/CUIScene.h +++ b/SDK/CUIScene.h @@ -159,10 +159,10 @@ class C_UIScene { public: bool isPlayScreen() { - return Utils::CallVFunc<52, bool>(this); +s return Utils::CallVFunc<55, bool>(this); } void getScreenName(TextHolder* txt) { - Utils::CallVFunc<64, void, TextHolder*>(this, txt); + Utils::CallVFunc<67, void, TextHolder*>(this, txt); } }; From b4d61e855bee7441b3b02f0d857c071778f57cd2 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Sun, 13 Dec 2020 18:14:38 +0100 Subject: [PATCH 214/419] "fix" getCamera, some scene stuff --- Memory/Hooks.cpp | 11 +++++------ SDK/CCamera.cpp | 5 +++-- SDK/CUIScene.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index f075031a..a43768b4 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -231,7 +231,7 @@ void Hooks::Init() { void* keyMouseFunc = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0F 29 74 24 70 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 E0 49 8B F8 48 8B F1 45 33 ED 41 8B DD 89 5D DC 49 8B C8 E8")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); - void* renderLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 20 FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); + void* renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 20 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 57 41 54 41 55 41 56 41 57 48 83 EC 60 44 ?? ?? ?? ?? ?? ?? ?? ?? 33 F6")); @@ -265,7 +265,7 @@ void Hooks::Init() { void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); - void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 58 ?? 0F 29 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49")); + void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D8 4C")); g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); #ifdef TEST_DEBUG @@ -1286,16 +1286,15 @@ __int64 Hooks::LevelRenderer_renderLevel(__int64 _this, __int64 a2, __int64 a3) static reloadShit_t reloadChunk = nullptr; if (!reloadChunk) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 ?? EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ?? 48 89 68 ?? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9")); - else - reloadChunk = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B F9 4C 8D B9 ? ? ? ? 49 8B CF")); + // RenderChunkCoordinator::rebuildAllRenderChunkGeometry + reloadChunk = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 6C 24 18 48 89 74 24 20 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B F9 48 8D A9")); } static auto xrayMod = moduleMgr->getModule(); static bool lastState = false; if (lastState != xrayMod->isEnabled()) { + // LevelRenderer::rebuildAllRenderChunkGeometry lastState = xrayMod->isEnabled(); unsigned long long* v5; // rdi unsigned long long* i; // rbx diff --git a/SDK/CCamera.cpp b/SDK/CCamera.cpp index 40bb21a1..aa500217 100644 --- a/SDK/CCamera.cpp +++ b/SDK/CCamera.cpp @@ -39,7 +39,8 @@ void C_Camera::getForwardVector(vec3_t* forward) { } C_Camera* C_CameraManager::getCameraOrDebugCamera() { - using camerManager_getCameraOrDebugCamera_t = C_Camera*(__fastcall*)(C_CameraManager*); + /*using camerManager_getCameraOrDebugCamera_t = C_Camera*(__fastcall*)(C_CameraManager*); static auto camerManager_getCameraOrDebugCamera = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 39 00 48 8B D9 74 ?? 48")); - return camerManager_getCameraOrDebugCamera(this); + return camerManager_getCameraOrDebugCamera(this);*/ + return reinterpret_cast(reinterpret_cast<__int64>(this) + 0x40); } diff --git a/SDK/CUIScene.h b/SDK/CUIScene.h index 3617cce1..8d3bd989 100644 --- a/SDK/CUIScene.h +++ b/SDK/CUIScene.h @@ -159,7 +159,7 @@ class C_UIScene { public: bool isPlayScreen() { -s return Utils::CallVFunc<55, bool>(this); + return Utils::CallVFunc<55, bool>(this); } void getScreenName(TextHolder* txt) { From 74c3a18063280639885a65d17f249a2407662ca7 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 23 Dec 2020 14:00:33 -0400 Subject: [PATCH 215/419] Initial 1.16.201 support --- Horion/Command/Commands/EnchantCommand.cpp | 4 +-- Horion/Module/Modules/Godmode.cpp | 4 +-- Horion/Module/Modules/NoFall.cpp | 4 +-- Memory/GameData.cpp | 4 +-- Memory/Hooks.cpp | 16 +++++------- SDK/CEntity.cpp | 4 +-- SDK/CInventory.h | 4 +-- SDK/CInventoryTransaction.cpp | 2 +- SDK/CItem.cpp | 30 ++++++++-------------- SDK/CItem.h | 2 +- SDK/CPacket.cpp | 22 ++++++++-------- SDK/CPacket.h | 4 +-- SDK/TextHolder.h | 1 + 13 files changed, 46 insertions(+), 55 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index caea8e1f..6c07b515 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -98,12 +98,12 @@ bool EnchantCommand::execute(std::vector* args) { using addEnchant_t = bool(__fastcall*)(void*, __int64); using saveEnchantsToUserData_t = void(__fastcall*)(C_ItemStack*, void*); - static getEnchantsFromUserData_t getEnchantsFromUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 54 41 56 41 57 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 0F 29 70 C8 4C 8B E2 4C 8B F9 48 89 54 24 ?? 33 F6")); + static getEnchantsFromUserData_t getEnchantsFromUserData = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 48 81 EC ? ? ? ? 48 8B F2 48 8B D9 48 89 54 24 ? 33 FF 89 7C 24 ? E8 ? ? ? ? 84 C0")); static addEnchant_t addEnchant = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 54 24 ?? 57 48 83 EC ?? 45 0F")); static saveEnchantsToUserData_t saveEnchantsToUserData = 0x0; if (!saveEnchantsToUserData) { - saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); + saveEnchantsToUserData = reinterpret_cast(FindSignature("48 89 5C 24 ? 56 57 41 56 48 81 EC ? ? ? ? 0F 29 B4 24 ? ? ? ? 48 8B FA 4C 8B C1 48 8B 41 08 48 85 C0")); } if (strcmp(args->at(1).c_str(), "all") == 0) { diff --git a/Horion/Module/Modules/Godmode.cpp b/Horion/Module/Modules/Godmode.cpp index 6370aa3e..c301e520 100644 --- a/Horion/Module/Modules/Godmode.cpp +++ b/Horion/Module/Modules/Godmode.cpp @@ -24,8 +24,8 @@ void Godmode::onSendPacket(C_Packet* p) { if (p->isInstanceOf()) { C_MovePlayerPacket* movePacket = reinterpret_cast(p); movePacket->onGround = true; - } else if (p->isInstanceOf()) { + } /*else if (p->isInstanceOf()) { C_ActorFallPacket* fallPacket = reinterpret_cast(p); fallPacket->fallDistance = 0.f; - } + }*/ } diff --git a/Horion/Module/Modules/NoFall.cpp b/Horion/Module/Modules/NoFall.cpp index 6aa2f6d3..b14ea639 100644 --- a/Horion/Module/Modules/NoFall.cpp +++ b/Horion/Module/Modules/NoFall.cpp @@ -15,9 +15,9 @@ void NoFall::onSendPacket(C_Packet* packet) { if (packet->isInstanceOf()) { C_MovePlayerPacket* movePacket = reinterpret_cast(packet); movePacket->onGround = true; - } else if (packet->isInstanceOf()) { + } /*else if (packet->isInstanceOf()) { C_ActorFallPacket* fallPacket = reinterpret_cast(packet); fallPacket->fallDistance = 0.f; - } + }*/ } } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 0e212021..f3f2d478 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -17,7 +17,7 @@ void GameData::retrieveClientInstance() { logF("clinet: %llX", clientInstanceOffset); } }*/ - clientInstanceOffset = 0x03A30F18; // pointer scanned, can't find good signatures so it'll stay + clientInstanceOffset = 0x03A30ED8; // pointer scanned, can't find good signatures so it'll stay g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x40})); #ifdef _DEBUG @@ -199,7 +199,7 @@ void GameData::forEachEntity(std::function callback) { C_EntityList* entList = g_Data.getEntityList(); if (entList == 0) { #ifdef _DEBUG - logF("EntityList broken btw"); + logF("EntityList broken btw yeeeeeeyt"); #endif } else { size_t listSize = entList->getListSize(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index a43768b4..ef7280e1 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -42,19 +42,17 @@ void Hooks::Init() { } // BlockLegacy::vtable - /*{ - //uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 48 89 ?? 4C 39"); // BlockLegacy constructor - intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 39 7A ? 75 1A 48 C7 45"); // BlockLegacy constructor + { + intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 8B 72 ? 48 B9"); // BlockLegacy constructor int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + 7); if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { - g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[125], Hooks::BlockLegacy_getRenderLayer); - - g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[16], Hooks::BlockLegacy_getLightEmission); + g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[168], Hooks::BlockLegacy_getRenderLayer); + g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[171], Hooks::BlockLegacy_getLightEmission); } - }*/ + } // LocalPlayer::vtable { @@ -64,7 +62,7 @@ void Hooks::Init() { if (localPlayerVtable == 0x0 || sigOffset == 0x0) logF("C_LocalPlayer signature not working!!!"); else { - g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[61], Hooks::Actor_isInWater); + g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[65], Hooks::Actor_isInWater); g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); @@ -220,7 +218,7 @@ void Hooks::Init() { g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); - //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); + g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index 425136a1..f3d1e503 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -6,12 +6,12 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { if (offset == 0) { // EnchantCommand::execute //offset = *reinterpret_cast(FindSignature("48 8D 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 90 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B ?? ?? ?? 8B") + 3); - offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ?") + 3); + offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8B 4D") + 3); } return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { - static unsigned int offset = 0xBD0; + static unsigned int offset = 0xBE8; /*if (offset == 0) { offset = *reinterpret_cast(FindSignature("48 8B 51 ?? 4C 8B 82 ?? ?? ?? ?? 48 8B B2 ?? ?? ?? ?? 41 80 B8") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies }*/ diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 2855e656..158bc8f1 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -49,11 +49,11 @@ class C_Inventory { virtual __int64 initializeContainerContents(C_BlockSource&); virtual __int64 add(C_ItemStack&); virtual __int64 canAdd(const C_ItemStack&); - virtual void unknown(); + //virtual void unknown(); virtual __int64 clearSlot(int); virtual __int64 clearInventory(int); virtual __int64 load(); // ListTag const&,SemVersion const&,Level & - virtual void unknown2(); + //virtual void unknown2(); virtual __int64 getEmptySlotsCount(); virtual int getFirstEmptySlot(); virtual __int64 setContainerSize(); diff --git a/SDK/CInventoryTransaction.cpp b/SDK/CInventoryTransaction.cpp index 9050470a..9462638d 100644 --- a/SDK/CInventoryTransaction.cpp +++ b/SDK/CInventoryTransaction.cpp @@ -3,7 +3,7 @@ void C_InventoryTransactionManager::addInventoryAction(const C_InventoryAction& action,bool idk) { using InventoryTransactionManager__addAction_t = void(__fastcall*)(C_InventoryTransactionManager*, C_InventoryAction const&,bool); //static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); - static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 45 0F B6 F8 4C 8B F2 48 8B F9 48 8B 01 48 8B 88 ? ? ? ?")); + static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC ? 45 0F B6 F8 48 8B EA 4C 8B F1 48 8B 01 48 8B 88 ? ? ? ? 48 85 C9")); if (InventoryTransactionManager__addAction != 0) InventoryTransactionManager__addAction(this, action,idk); } diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 93763d27..7195936f 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -12,14 +12,14 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); - static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 20 0F 29 70 B8 48 8B 05 ?? ?? ?? ??")); + static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("40 53 55 57 41 55 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B 40 ? 49 8B D8 48 8B EA 4C 8B E9 48 85 C0")); item->setShowPickUp(false); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } void C_ItemRenderer::renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRenderCtx, C_ItemStack* item, float x, float y, float opacity, float scale, bool isEnchanted, int mode) { using renderGuiItemInChunk_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, __int64, C_ItemStack *, float, float, float, float, float, int); - static renderGuiItemInChunk_t renderGuiItem = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 58 ?? 0F 29 70 ?? 0F 29 78 ?? 44 0F 29 40 ?? 44 0F 29 48 ?? 44 0F 29 90 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B F1 45")); + static renderGuiItemInChunk_t renderGuiItem = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 90 ? ? ? ? 44 0F 29 98 ? ? ? ? 44 0F 29 A0 ? ? ? ? 44 0F 29 A8 ? ? ? ? 48 8B 05 ? ? ? ?")); //item->setShowPickUp(false); renderGuiItem(this, BaseActorRenderCtx, 2, item, x, y, 1, 1, scale, 0); @@ -28,7 +28,7 @@ void C_ItemRenderer::renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRen C_ItemStack::C_ItemStack(const C_ItemStack &src) { memset(this, 0x0, sizeof(C_ItemStack)); using ItemStackCopyConstructor_t = void(__fastcall *)(C_ItemStack &, C_ItemStack const &); - static ItemStackCopyConstructor_t ItemStackCopyConstructor = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 8B FA 48 8B D9 48 89 48 ??")); + static ItemStackCopyConstructor_t ItemStackCopyConstructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 83 EC 40 4C 8B F2 48 8B F1 48 89 4C 24 ? 33 ED 89 6C 24 20 48 8D")); ItemStackCopyConstructor(*this, src); this->setVtable(); } @@ -42,38 +42,30 @@ C_ItemStack::C_ItemStack(const Tag &tag) { } void C_ItemStack::fromTag(const Tag &tag) { using ItemStackBase__loadItemF = void(__fastcall *)(C_ItemStack *, Tag const &); - static ItemStackBase__loadItemF fromTag = nullptr; - - if (!fromTag) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - fromTag = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); - else - fromTag = reinterpret_cast(FindSignature("40 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ?")); - } - + static ItemStackBase__loadItemF fromTag = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 37 48 8B DA 48 8B F9 48 89 4D 97 0F 57 C0 0F 11 45 A7 0F 11 45 B7 0F 11 45 C7 0F 11 45 D7 0F 11 45 E7 0F 11 45 F7 0F 11 45 07")); fromTag(this, tag); } void C_ItemStack::save(CompoundTag **tag) { using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **); - ItemStackBase__saveF save = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B F2 4C 8B F1 48 89 55")); + ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B FA 48 8B F1 48 89 55 F7 45 33 ED")); return save(this, tag); } void C_ItemStack::setUserData(std::unique_ptr tag) { using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); - setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8D 51 10 48 3B D3 74 20 48 8B 03 48 ?? ?? ?? ?? ?? ?? 48 8B 0A 48 89 02 48 85 C9 74 0B 48 8B 01 BA ?? ?? ?? ?? FF 10")); + setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B DA 48 8D 51 10 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); setUserData(this, std::move(tag)); } void C_ItemStack::reinit(C_BlockLegacy &legacy, int count) { this->setVtable(); - Utils::CallVFunc<1, void>(this, &legacy, count); + Utils::CallVFunc<2, void>(this, &legacy, count); } void C_ItemStack::reinit(C_Item &item, int count, int itemData) { this->setVtable(); - Utils::CallVFunc<2, void>(this, &item, count, itemData); + Utils::CallVFunc<3, void>(this, &item, count, itemData); } int C_ItemStack::getEnchantValue(int enchantId) { using getEnchantsLevel_t = int(__fastcall *)(int, C_ItemStack *); - static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8")); + static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8 ? ? ? ?")); return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { @@ -83,12 +75,12 @@ void C_ItemStack::setVtable(void) { } C_Item ***ItemRegistry::getItemFromId(void *ptr, int itemId) { using getItemFromId_t = C_Item ***(__fastcall *)(void *, int); - static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 66 85 D2 0F 84 ? ? ? ? 44 0F BF C2 48 B9 ? ? ? ? ? ? ? ? 44")); + static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 8D 42 ? 48 8B D9 66 83 F8 ? 0F 86 ? ? ? ? 44 0F BF C2 49 B9 ? ? ? ? ? ? ? ? 41 8B C0")); return getItemFromId(ptr, itemId); } C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder &text) { using ItemRegistry__lookupByName_t = C_Item ***(__fastcall *)(void *, void *, TextHolder &); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 4C 8B F9 48 89 4D ?? 45 33 ED 44 89 6C 24 ?? 4D 39 68")); + static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B EA 48 89 54 24 ? 48 89 4C 24 ? 48 89 4D")); return ItemRegistry__lookupByNameF(a1, a2, text); } diff --git a/SDK/CItem.h b/SDK/CItem.h index cba0e9ae..934e7281 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -22,7 +22,7 @@ class C_BaseActorRenderContext { public: C_ItemRenderer* renderer; //0x0058 private: - char pad_0x50[0x228]; //0x60 + char pad_0x50[0x238]; //0x60 public: C_BaseActorRenderContext(C_ScreenContext* ScreenCtx, C_ClientInstance* client, MinecraftGame* game); }; diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 69d337d2..3145c527 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -22,7 +22,7 @@ LevelSoundEventPacket::LevelSoundEventPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket() { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -36,7 +36,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused) { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -52,12 +52,12 @@ PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos this->yawUnused = yawUnused; this->entityRuntimeId = entityRuntimeId; } -C_ActorFallPacket::C_ActorFallPacket() { +/*C_ActorFallPacket::C_ActorFallPacket() { static uintptr_t** ActorFallPacketVtable = 0x0; if (ActorFallPacketVtable == 0x0) { uintptr_t sigOffset = FindSignature("48 8D ? ? ? ? ? 48 89 ? E7 48 89 45 0F F3 0F 11 75 ?"); int offset = *reinterpret_cast(sigOffset + 3); - ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + 7); #ifdef _DEBUG if (ActorFallPacketVtable == 0x0 || sigOffset == 0x0) __debugbreak(); @@ -65,11 +65,11 @@ C_ActorFallPacket::C_ActorFallPacket() { } memset(this, 0, sizeof(C_ActorFallPacket)); // Avoid overwriting vtable vTable = ActorFallPacketVtable; -} +}*/ C_MobEquipmentPacket::C_MobEquipmentPacket() { static uintptr_t** MobEquipmentPacketVtable = 0x0; if (MobEquipmentPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 89 51 ? 48 8D 59 ? 48 89 5C 24 ? 49 8B D0"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4D 90 48 89 45 B8 48 8D 97 ? ? ? ?"); int offset = *reinterpret_cast(sigOffset + 3); MobEquipmentPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -83,7 +83,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket() { C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& item, int hotbarSlot, int inventorySlot) { memset(this, 0x0, sizeof(C_MobEquipmentPacket)); using MobEquimentPacketConstructor_t = void(__fastcall*)(C_MobEquipmentPacket*, __int64, C_ItemStack&, int, int, char); - static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 ? 56 57 41 56 48 83 EC ? 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 41 8B F1 49 8B F8 4C 8B F1")); + static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 4C 24 ? 57 48 83 EC ? 41 8B D9 48 8B F9 C7 41 ? ? ? ? ? C7 41")); if (MobEquimentPacketConstructor != 0) MobEquimentPacketConstructor(this, entityRuntimeId, item, hotbarSlot, inventorySlot, 0); @@ -91,7 +91,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& C_InventoryTransactionPacket::C_InventoryTransactionPacket() { static uintptr_t** InventoryTransactionPacketVtable = 0x0; if (InventoryTransactionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 44 89 44 24 ? 0F 57 C0 66 0F 7F 44 24 ? 4C 89 84 24"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 54 24 ? 44 89 75"); int offset = *reinterpret_cast(sigOffset + 3); InventoryTransactionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -121,7 +121,7 @@ C_TextPacket::C_TextPacket() { C_MovePlayerPacket::C_MovePlayerPacket() { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -135,7 +135,7 @@ C_MovePlayerPacket::C_MovePlayerPacket() { C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -156,7 +156,7 @@ C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { C_PlayerActionPacket::C_PlayerActionPacket() { static uintptr_t** playerActionPacketVtable = 0x0; if (playerActionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 48 89 4C 24 ?? 48 89 54 24 ?? 48 89 54 24 ?? 40 0F B6 CF"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 48 89 74 24 ? 48 89 74 24 ? 8B CF 83 F1"); int offset = *reinterpret_cast(sigOffset + 3); playerActionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG diff --git a/SDK/CPacket.h b/SDK/CPacket.h index 13cbf40f..cf3521a6 100644 --- a/SDK/CPacket.h +++ b/SDK/CPacket.h @@ -50,7 +50,7 @@ class PlayerAuthInputPacket : public C_Packet { PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused); }; -class C_ActorFallPacket : public C_Packet { +/*class C_ActorFallPacket : public C_Packet { private: char pad_0x8[0x20]; //0x8 public: @@ -58,7 +58,7 @@ class C_ActorFallPacket : public C_Packet { __int64 runtimeId; // 0x28 float fallDistance; bool isInVoid; -}; +};*/ class C_PlayerActionPacket : public C_Packet { public: diff --git a/SDK/TextHolder.h b/SDK/TextHolder.h index 8fa051ab..070a8591 100644 --- a/SDK/TextHolder.h +++ b/SDK/TextHolder.h @@ -11,6 +11,7 @@ class TextHolder { size_t textLength; //0x0010 size_t alignedTextLength; //0x0018 + size_t idk; //0x0020 TextHolder() { memset(this, 0, sizeof(TextHolder)); From be7c545051fe4a887cce87fc63acf98cd0d2246f Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 23 Dec 2020 16:43:25 -0400 Subject: [PATCH 216/419] fix --- SDK/CBlockLegacy.h | 8 ++++++-- SDK/TextHolder.h | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 635ccb55..874f7bd9 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -31,9 +31,13 @@ class C_BlockLegacy { public: uintptr_t** Vtable; //0x0000 TextHolder tileName; // 0x0008 - TextHolder name; //0x0028 private: - char pad_0x0048[0x78]; //0x0048 + char idk[0x8]; //0x0028 +public: + TextHolder name; //0x0030 +private: + char idk1[0x8]; //0x0050 + char pad_0x0048[0x78]; //0x0058 public: C_Material* material; //0x00C0 private: diff --git a/SDK/TextHolder.h b/SDK/TextHolder.h index 070a8591..8fa051ab 100644 --- a/SDK/TextHolder.h +++ b/SDK/TextHolder.h @@ -11,7 +11,6 @@ class TextHolder { size_t textLength; //0x0010 size_t alignedTextLength; //0x0018 - size_t idk; //0x0020 TextHolder() { memset(this, 0, sizeof(TextHolder)); From 285febf58e7d593c7538a55dfc440db9154fda7c Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 27 Dec 2020 23:52:34 -0400 Subject: [PATCH 217/419] fix --- Memory/Hooks.cpp | 4 ++-- SDK/CClientInstance.h | 16 ++++++++++------ SDK/CEntityList.h | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index ef7280e1..2ce2675d 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -226,13 +226,13 @@ void Hooks::Init() { void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); - void* keyMouseFunc = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0F 29 74 24 70 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 E0 49 8B F8 48 8B F1 45 33 ED 41 8B DD 89 5D DC 49 8B C8 E8")); + void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC ? 0F 29 74 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 E0 49 8B F0 48 8B F9")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); void* renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 20 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); g_Hooks.LevelRenderer_renderLevelHook = std::make_unique(renderLevel, Hooks::LevelRenderer_renderLevel); - void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 57 41 54 41 55 41 56 41 57 48 83 EC 60 44 ?? ?? ?? ?? ?? ?? ?? ?? 33 F6")); + void* clickHook = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 48 89 68 ? 48 89 70 ? 57 41 54 41 55 41 56 41 57 48 83 EC ? 44 0F B7 BC 24 ? ? ? ? 48 8B D9")); g_Hooks.ClickFuncHook = std::make_unique(clickHook, Hooks::ClickFunc); void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 6fc4e308..84b1b764 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -101,9 +101,9 @@ class LevelRenderer { public: BlockTessellator* blockTessellator; // 0x02D8 private: - char pad_0x02F0[0x590]; //0x02E0 + char pad_0x02F0[0x5B0]; //0x02E0 public: - vec3_t origin; //0x0870 + vec3_t origin; //0x0890 __int64 getLevelRendererPlayer(){ return reinterpret_cast<__int64>(this) + 0x310; @@ -410,6 +410,7 @@ class C_ClientInstance { virtual __int64 getResourcePackManager(void) const; virtual __int64 getSkinRepository(void) const; virtual __int64 getSkinRepositoryClientInterface(void) const; + virtual __int64 sub_140630650(void) const; virtual __int64 sub_1400CA400(void) const; virtual __int64 getTextures(void) const; virtual __int64 getStoreCacheTextures(void) const; @@ -587,6 +588,7 @@ class C_ClientInstance { virtual __int64 getSceneFactory(void) const; virtual __int64 getClientSceneStack(void) const; virtual __int64 getClientSceneStack(void); + virtual __int64 sub_140634B30(void) const; virtual __int64 getMainSceneStack(void); virtual __int64 getMainSceneStack(void) const; virtual __int64 getCurrentSceneStack(void) const; @@ -604,6 +606,8 @@ class C_ClientInstance { virtual __int64 getScreenTelemetry(void) const; virtual __int64 getTopSceneType(void) const; virtual __int64 getMobEffectsLayout(void); + virtual __int64 newFunc2(__int64 a2, __int64 a3, char a4); + virtual __int64 newFunc3(__int64 a2, __int64 a3); virtual __int64 onMobEffectsChange(void); public: @@ -806,19 +810,19 @@ class C_ClientInstance { glmatrixf* getRefDef() { uintptr_t _this = reinterpret_cast(this); //logF("refderf %llX", _this + 0x258); - return reinterpret_cast(_this + 0x2E8); + return reinterpret_cast(_this + 0x2E0); }; vec2_t* getMousePos() { uintptr_t _this = reinterpret_cast(this); - return reinterpret_cast(_this + 0x450); + return reinterpret_cast(_this + 0x448); } vec2_t getFov() { uintptr_t _this = reinterpret_cast(this); vec2_t fov; - fov.x = *reinterpret_cast(_this + 0x650); - fov.y = *reinterpret_cast(_this + 0x664); + fov.x = *reinterpret_cast(_this + 0x658); + fov.y = *reinterpret_cast(_this + 0x66C); return fov; } diff --git a/SDK/CEntityList.h b/SDK/CEntityList.h index 640e1347..fe876648 100644 --- a/SDK/CEntityList.h +++ b/SDK/CEntityList.h @@ -5,11 +5,11 @@ class C_Entity; class C_EntityList { private: - char pad_0x0000[0x40]; //0x0000 + char pad_0x0000[0x50]; //0x0000 public: - uintptr_t firstEntity; //0x0040 - uintptr_t lastEntity; //0x0048 - uintptr_t endAddr; //0x0050 + uintptr_t firstEntity; //0x0050 + uintptr_t lastEntity; //0x0058 + uintptr_t endAddr; //0x0060 inline size_t getListSize() { return (lastEntity - firstEntity) / sizeof(uintptr_t); From f78573d68e2c7fa72d2dfadd31ba6895862fed84 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Mon, 28 Dec 2020 00:10:08 -0400 Subject: [PATCH 218/419] fix esp --- SDK/CClientInstance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 84b1b764..34f4bd38 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -101,7 +101,7 @@ class LevelRenderer { public: BlockTessellator* blockTessellator; // 0x02D8 private: - char pad_0x02F0[0x5B0]; //0x02E0 + char pad_0x02F0[0x5EC]; //0x02E0 public: vec3_t origin; //0x0890 From 70a2bbe0dca1074ebe20062c0f83d110aa9a0b51 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Mon, 28 Dec 2020 11:24:20 -0400 Subject: [PATCH 219/419] fix nbt --- SDK/CBlockLegacy.cpp | 2 +- SDK/Tag.cpp | 30 +++++++++++------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 3b52f4fb..f601669f 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -9,7 +9,7 @@ C_Block* C_BlockSource::getBlock(const vec3_ti& block) { } C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { using getBlockEntity_t = C_BlockActor*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 8B 02 48 8B DA C1 F8 ?? 89 44 24 ?? 8B 42 ?? 48 8D 54 24 ? C1 F8 04 89 44 24 ?? E8 ? ? ? ? 48 85 C0 74 31")); + static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 8B 02 48 8B DA C1 F8 ? 48 8B F1 89 44 24 ? 8B 42")); return getBlockEntity(this, block); } C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { diff --git a/SDK/Tag.cpp b/SDK/Tag.cpp index cee58a6f..f167c130 100644 --- a/SDK/Tag.cpp +++ b/SDK/Tag.cpp @@ -11,7 +11,7 @@ Int64Tag::Int64Tag(__int64 value) { static uintptr_t** Int64TagVtable = 0x0; if (Int64TagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 49 89 00 48 8B 41 ?? 49 89 40 ?? 48 8B 02 C6 40 ? ? C3"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 47 40 48 89 77 48 C6 47 68 04 48 8B CD E8 ? ? ? ?"); int offset = *reinterpret_cast(sigOffset + 3); Int64TagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (Int64TagVtable == 0x0 || sigOffset == 0x0) @@ -39,7 +39,7 @@ void Int64Tag::read(std::string& string) //throws MojangsonParseException IntTag::IntTag(int value) { static uintptr_t** IntTagVtable = 0x0; if (IntTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 49 89 00 8B 41 ?? 41 89 40 ?? 48 8B 02 C6 40 ?? ?? C3"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 10 89 48 08 48 89 03 48 8B C3 48 8B 5C 24 ?"); int offset = *reinterpret_cast(sigOffset + 3); IntTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (IntTagVtable == 0x0 || sigOffset == 0x0) @@ -61,7 +61,7 @@ void IntTag::read(std::string& string) //throws MojangsonParseException StringTag::StringTag(std::string value) { static uintptr_t** StringTagVtable = 0x0; if (StringTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("4C 8D 05 ? ? ? ? 4C 89 00 45 33 C0 4C 89 40 ?? 4C 89 40 ?? 0F 10 41 ?? 0F 11 40 ?? 0F 10 49 ?? 0F 11 48"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 03 0F 10 44 24 ? 0F 11 43 ? 0F 10 4C 24 ? 0F 11 4B"); int offset = *reinterpret_cast(sigOffset + 3); StringTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (StringTagVtable == 0x0 || sigOffset == 0x0) @@ -75,7 +75,7 @@ StringTag::StringTag(std::string value) { ShortTag::ShortTag(short value) { static uintptr_t** ShortTagVtable = 0x0; if (ShortTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 49 89 00 0F B7 41 ?? 66 41 89 40 ? 48 8B 02 C6 40 ? ? C3"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 10 66 89 48 ? 48 89 03 48 8B C3 48 8B 5C 24 ?"); int offset = *reinterpret_cast(sigOffset + 3); ShortTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (ShortTagVtable == 0x0 || sigOffset == 0x0) @@ -103,7 +103,7 @@ void ShortTag::read(std::string& string) //throws MojangsonParseException FloatTag::FloatTag(float value) { static uintptr_t** FloatTagVtable = 0x0; if (FloatTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 07 F3 0F 11 77 ? C6 47 ? ? 48 8B CE E8 ? ? ? ? 48 8D 47 ? 48 8B 4C 24 ? 48 33 CC"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 06 8B 47 08 89 46 08 48 8B 03 C6 40 28 05"); int offset = *reinterpret_cast(sigOffset + 3); FloatTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (FloatTagVtable == 0x0 || sigOffset == 0x0) @@ -131,7 +131,7 @@ void FloatTag::read(std::string& string) // MojangsonParseException DoubleTag::DoubleTag(double value) { static uintptr_t** DoubleTagVtable = 0x0; if (DoubleTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 49 89 00 48 8B 41 08 49 89 40 08 48 8B 02 C6 40 28 06 C3"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? F2 0F 11 40 ? 48 89 08 48 89 03 48 8B C3 48 8B 5C 24 ? 48 83 C4 30"); int offset = *reinterpret_cast(sigOffset + 3); DoubleTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (DoubleTagVtable == 0x0 || sigOffset == 0x0) @@ -158,7 +158,7 @@ void DoubleTag::read(std::string& string) //throws MojangsonParseException ByteTag::ByteTag(char value) { static uintptr_t** ByteTagVtable = 0x0; if (ByteTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 48 89 08 C6 40 ?? 00 48 89 03 48 8B C3 48 83 C4"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 10 88 48 ? 48 89 03 48 8B C3 48 8B 5C 24 ?"); int offset = *reinterpret_cast(sigOffset + 3); ByteTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (ByteTagVtable == 0x0 || sigOffset == 0x0) @@ -186,7 +186,7 @@ void ByteTag::read(std::string& string) //throws MojangsonParseException ListTag::ListTag() { static uintptr_t** ListTagVtable = 0x0; if (ListTagVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 45 00 4D 89 65 ?? 4D 89 65 ?? 4D 89 65 ?? 45 88 65 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 44 89 7C 24"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 08 33 C9 48 89 48 08 48 89 48 10 48 89 48 18 88 48 20 48 89 03"); int offset = *reinterpret_cast(sigOffset + 3); ListTagVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (ListTagVtable == 0x0 || sigOffset == 0x0) @@ -198,7 +198,7 @@ ListTag::ListTag() { } void ListTag::add(std::unique_ptr tag) { using ListTag__add_t = void(__fastcall*)(ListTag*, std::unique_ptr); - static ListTag__add_t func = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 48 8B 0A 48 8B 01 FF 50")); + static ListTag__add_t func = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC 30 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B FA 48 8B D9 48 89 54 24 ? 48 8B 0A 48 8B 01")); func(this, std::move(tag)); } void CompoundTag::write(std::stringstream& builder) { @@ -264,20 +264,12 @@ void CompoundTag::write(std::stringstream& builder) { CompoundTag::CompoundTag() { memset(this, 0, sizeof(CompoundTag)); using constructor_t = void(__fastcall*)(CompoundTag*); - static constructor_t func = reinterpret_cast(FindSignature("48 89 4C 24 ?? 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B F9 48 8D 05 ?? ?? ?? ?? 48 89 01 48 8D 59")); + static constructor_t func = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 4C 24 ? 57 48 83 EC ? 48 8B F9 48 8D 05 ? ? ? ? 48 89 01 48 8D 59 ? 48 89 5C 24 ? 33 C0 48 89 03 48 89 43")); func(this); } void CompoundTag::put(TextHolder& tag, std::unique_ptr value) { using CompoundTag__putF = void(__fastcall*)(CompoundTag*, TextHolder&, std::unique_ptr); - static CompoundTag__putF func = nullptr; - - if (!func) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - func = reinterpret_cast(FindSignature("4C 8B DC 55 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 49 89 5B ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B D8 48 8B FA 48 8B E9")); - else - func = reinterpret_cast(FindSignature("4C 8B DC 53 56 57 48 81 EC ? ? ? ? 49 C7 43 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 49 8B F8 48 8B DA")); - } - + static CompoundTag__putF func = reinterpret_cast(FindSignature("40 53 56 57 48 83 EC ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 49 8B F8 48 8B DA 48 89 54 24 ? 4C 89 44 24 ? 4D 8B")); func(this, tag, std::move(value)); } void Handler::handleWrite(Tag* value, std::stringstream& builder) { From 6b7f8e53d17b058a85671b6dad61115ffad050af Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Sat, 2 Jan 2021 10:50:12 -0800 Subject: [PATCH 220/419] Reach fix --- Horion/Module/Modules/Reach.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Horion/Module/Modules/Reach.cpp b/Horion/Module/Modules/Reach.cpp index d39c8c99..da589c51 100644 --- a/Horion/Module/Modules/Reach.cpp +++ b/Horion/Module/Modules/Reach.cpp @@ -25,10 +25,7 @@ void Reach::onEnable() { static uintptr_t sigOffset = 0x0; if (sigOffset == 0x0) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 0F 2F F8 76"); - else - sigOffset = FindSignature("F3 0F 10 05 ? ? ? ? 44 0F 2F E8 76 0B"); + sigOffset = FindSignature("F3 0F 10 05 ?? ?? ?? ?? 44 0F 2F E0 ??"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 4)); // Get Offset from code From 180182e384b3db2d9a60e9e499c3a0b8831fdf43 Mon Sep 17 00:00:00 2001 From: weedelbhoy1 <57690131+weedelbhoy1@users.noreply.github.com> Date: Sat, 2 Jan 2021 23:33:19 +0000 Subject: [PATCH 221/419] Fixed Command block exploit cause am yer da BadMan --- .../Command/Commands/CommandBlockExploitCommand.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 0155a7ed..20a7dc38 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -19,17 +19,20 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { os << " "; os << args->at(i); } + using ItemRegistry__lookupByName_t = C_Item***(__fastcall*)(void*, void*, TextHolder); + static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B EA 48 89 54 24 ? 48 89 4C 24 ? 48 89 4D")); void* ItemPtr = malloc(0x8); - C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, 325); - C_ItemStack* yot = new C_ItemStack(***cStack, 1, 5); + void* idk = malloc(0x0); + C_ItemStack* yot = new C_ItemStack(***ItemRegistry__lookupByNameF(ItemPtr, idk, std::string("beehive")), 1, 0); free(ItemPtr); + free(idk); int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); std::string cmd = os.str(); - std::string tag = "{ChestItems:[{Count:0b,Damage:0s,Name:\"\",Slot:0b}],Chested:0b,Color:0b,Color2:0b,Command:\"" + cmd + "\",CurrentTickCount:0,ExecuteOnFirstTick:1b,FallDistance:0f,Fire:0s,InventoryVersion:\"1.14.20\",Invulnerable:0b,IsAngry:0b,IsAutonomous:0b,IsBaby:0b,IsEating:0b,IsGliding:0b,IsGlobal:0b,IsIllagerCaptain:0b,IsOrphaned:0b,IsRoaring:0b,IsScared:0b,IsStunned:0b,IsSwimming:0b,IsTamed:0b,IsTrusting:0b,LastDimensionId:0,LastExecution:0l,LootDropped:0b,MarkVariant:0,Motion:[0f,0.1f,0f],OnGround:1b,OwnerNew:-1l,PortalCooldown:0,Pos:[0f,0f,0f],Rotation:[0f,0f],Saddled:0b,Sheared:0b,ShowBottom:0b,Sitting:0b,SkinID:0,Strength:0,StrengthMax:0,SuccessCount:1000,TickDelay:1,Ticking:1b,TrackOutput:1b,UniqueID:0l,Variant:0,Version:10,definitions:[\"+minecraft:command_block_minecart\",\"+minecraft:command_block_inactive\"],identifier:\"minecraft:command_block_minecart\",EntityType:100}"; + std::string tag = "{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}"; yot->setUserData(std::move(Mojangson::parseTag(tag))); g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); - clientMessageF("[%sHorion%s] %sPlace the bucket to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); + clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); return true; } From c72e42e3af9b266673b77b67f74a585e0e94a1f6 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 3 Jan 2021 21:45:26 -0400 Subject: [PATCH 222/419] cbe --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 20a7dc38..b1e90817 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -19,13 +19,7 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { os << " "; os << args->at(i); } - using ItemRegistry__lookupByName_t = C_Item***(__fastcall*)(void*, void*, TextHolder); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B EA 48 89 54 24 ? 48 89 4C 24 ? 48 89 4D")); - void* ItemPtr = malloc(0x8); - void* idk = malloc(0x0); - C_ItemStack* yot = new C_ItemStack(***ItemRegistry__lookupByNameF(ItemPtr, idk, std::string("beehive")), 1, 0); - free(ItemPtr); - free(idk); + C_ItemStack* yot = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); std::string cmd = os.str(); std::string tag = "{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}"; From 3626deffb22c7c567d9e4834dd75ec26f361c563 Mon Sep 17 00:00:00 2001 From: NotExisting <61290107+N0tExisting@users.noreply.github.com> Date: Mon, 4 Jan 2021 18:47:09 +0100 Subject: [PATCH 223/419] Now we got modes Boys --- Horion/Menu/ClickGui.cpp | 87 ++++++++++++++++++++++++++- Horion/Module/Modules/Module.cpp | 89 +++++++++++++++++++++++++++- Horion/Module/Modules/Module.h | 56 ++++++++++++++++- Horion/Module/Modules/TestModule.cpp | 9 ++- Horion/Module/Modules/TestModule.h | 3 + 5 files changed, 235 insertions(+), 9 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 87f7bc64..b7b9066a 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -38,8 +38,12 @@ static constexpr float paddingRight = 13.5f; static constexpr float crossSize = textHeight / 2.f; static constexpr float crossWidth = 0.3f; static constexpr float backgroundAlpha = 1; -static const MC_Color selectedModuleColor = MC_Color(28, 107, 201); -static const MC_Color moduleColor = MC_Color(13, 29, 48); +static const MC_Color selectedModuleColor = MC_Color(30, 110, 200); +static const MC_Color selectedSettingColor1 = MC_Color(20, 100, 195); +static const MC_Color selectedSettingColor2 = MC_Color(40, 120, 205); +static const MC_Color moduleColor = MC_Color(15, 30, 50); +static const MC_Color SettingColor1 = MC_Color(10, 25, 45); +static const MC_Color SettingColor2 = MC_Color(20, 35, 55); float currentYOffset = 0; float currentXOffset = 0; @@ -347,7 +351,84 @@ void ClickGui::renderCategory(Category category) { DrawUtils::drawText(textPos, &elTexto, isFocused ? MC_Color(1.0f, 1.0f, 1.0f) : MC_Color(0.8f, 0.8f, 0.8f), textSize); currentYOffset += textHeight + (textPadding * 2); } - } break; + break; + } + case ValueType::ENUM_T: { + // Text and background + { + char name[0x21]; + sprintf_s(name, 0x21, "%s:", setting->name); + // Convert first letter to uppercase for more friendlieness + if (name[0] != 0) + name[0] = toupper(name[0]); + + std::string elTexto = name; + rectPos.w = currentYOffset + textHeight + (textPadding * 2); + windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/ + crossSize); + DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); + DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); + GuiUtils::drawCrossLine(vec2_t( + currentXOffset + windowSize->x + paddingRight - (crossSize / 2) - 1.f, + currentYOffset + textPadding + (textHeight / 2)), + MC_Color(255, 255, 255), crossWidth, crossSize, !setting->minValue->_bool); + if (rectPos.contains(&mousePos) && shouldToggleRightClick && !ourWindow->isInAnimation) { + shouldToggleRightClick = false; + setting->minValue->_bool = !setting->minValue->_bool; + } + currentYOffset += textHeight + (textPadding * 2); + } + if (setting->minValue->_bool) { + int e = 0; + for (auto it = setting->maxValue->Enum->Entrys.begin(); + it != setting->maxValue->Enum->Entrys.end(); it++, e++) { + if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { + overflowing = true; + break; + } + bool isEven = e % 2 == 0; + rectPos.y = currentYOffset; + rectPos.w = currentYOffset + textHeight + (textPadding * 2); + EnumEntry i = *it._Ptr; + char name[0x21]; + sprintf_s(name, 0x21, " %s", i.GetName().c_str()); + // Convert first letter to uppercase for more friendlieness + if (name[0] != 0) + name[0] = toupper(name[0]); + std::string elTexto = name; + windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth( + &elTexto, textSize) + + 5); //because we add 5 to text padding + textPos.y = currentYOffset + textPadding; + vec4_t selectableSurface = vec4_t( + textPos.x + textPadding, + textPos.y + textPadding, + xEnd - textPadding, + textPos.y + textHeight - textPadding); + MC_Color col; + if (setting->value->_int == e || (selectableSurface.contains(&mousePos) && !ourWindow->isInAnimation)) { + if (isEven) + col = selectedSettingColor1; + else + col = selectedSettingColor2; + } else { + if (isEven) + col = SettingColor1; + else + col = SettingColor2; + } + DrawUtils::fillRectangle(rectPos, col, backgroundAlpha); + DrawUtils::drawText(textPos, &elTexto, MC_Color(1.f, 1.f, 1.f)); + // logic + if (selectableSurface.contains(&mousePos) && + shouldToggleLeftClick && !ourWindow->isInAnimation) { + shouldToggleLeftClick = false; + setting->value->_int = e; + } + currentYOffset += textHeight + (textPadding * 2); + } + } + break; + } case ValueType::FLOAT_T: { // Text and background { diff --git a/Horion/Module/Modules/Module.cpp b/Horion/Module/Modules/Module.cpp index 304e3ab0..545f82f7 100644 --- a/Horion/Module/Modules/Module.cpp +++ b/Horion/Module/Modules/Module.cpp @@ -1,11 +1,59 @@ #include "Module.h" - #include "../../../Utils/Json.hpp" #include "../../../Utils/Logger.h" #include using json = nlohmann::json; +#pragma region EnumEntry +EnumEntry::EnumEntry(const std::string _name, const unsigned char value) { + name = _name; + val = value; +} +std::string EnumEntry::GetName() { + return name; +} +unsigned char EnumEntry::GetValue() { + return val; +} +#pragma endregion +#pragma region SettingEnum +SettingEnum::SettingEnum(std::vector entr, IModule* mod) { + Entrys = entr; + owner = mod; + std::sort(Entrys.begin(), Entrys.end(), [](EnumEntry rhs, EnumEntry lhs) { + return rhs.GetValue() < lhs.GetValue(); + }); +} +SettingEnum::SettingEnum(IModule* mod) { + owner = mod; +} + +AddResult SettingEnum::addEntry(EnumEntry entr) { + auto etr = new EnumEntry(entr); + bool SameVal = false; + for (auto it = this->Entrys.begin(); it != this->Entrys.end(); it++) { + SameVal |= it->GetValue() == etr->GetValue(); + } + if (!SameVal) { + Entrys.push_back(*etr); + std::sort(Entrys.begin(), Entrys.end(), [](EnumEntry rhs, EnumEntry lhs) { + return rhs.GetValue() < lhs.GetValue(); + }); + } + return AddResult(SameVal, this); +} +EnumEntry* SettingEnum::GetEntry(int ind) { + return &Entrys.at(ind); +} +EnumEntry* SettingEnum::GetEntry() { + return GetEntry(selected); +} +int SettingEnum::GetCount() { + return (int)Entrys.size(); +} +#pragma endregion + IModule::IModule(int key, Category c, const char* tooltip) { this->keybind = key; this->category = c; @@ -77,6 +125,30 @@ void IModule::registerIntSetting(std::string name, int* intPtr, int defaultValue settings.push_back(setting); // Add to list } +void IModule::registerEnumSetting(std::string name, SettingEnum* ptr, int defaultValue) { + SettingEntry* setting = new SettingEntry(); + setting->valueType = ValueType::ENUM_T; + // Actual Value + setting->value = reinterpret_cast(&ptr->selected); + // Default Value + SettingValue* defaultVal = new SettingValue(); + defaultVal->_int = defaultValue; + setting->defaultValue = defaultVal; + // Min Value (is Extended) + SettingValue* minVal = new SettingValue(); + minVal->_bool = false; + setting->minValue = minVal; + // Max Value (The Enum) + SettingValue* maxVal = new SettingValue(); + maxVal->Enum = ptr; + setting->maxValue = maxVal; + // Name + strcpy_s(setting->name, 19, name.c_str()); + setting->value->_int = setting->defaultValue->_int; + // Add to list + settings.push_back(setting); +} + void IModule::registerBoolSetting(std::string name, bool* boolPtr, bool defaultValue) { SettingEntry* setting = new SettingEntry(); setting->valueType = ValueType::BOOL_T; @@ -178,6 +250,13 @@ void IModule::onLoadConfig(void* confVoid) { case ValueType::TEXT_T: sett->value->text = new std::string(value.get()); break; + case ValueType::ENUM_T: + try { + sett->value->_int = value.get(); + } catch (const std::exception& e) { + logF("Config Load Error(Enum) (%s): %s ", this->getRawModuleName(), e.what()); + } + break; } sett->makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt(); continue; @@ -221,6 +300,9 @@ void IModule::onSaveConfig(void* confVoid) { case ValueType::TEXT_T: obj.emplace(sett->name, *sett->value->text); break; + case ValueType::ENUM_T: + obj.emplace(sett->name, sett->value->_int); + break; } } @@ -282,7 +364,11 @@ void IModule::clientMessageF(const char* fmt, ...) { void SettingEntry::makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt() { switch (valueType) { + case ValueType::ENUM_T: + value->_int = std::max(0, std::min(maxValue->Enum->GetCount()-1, value->_int)); + break; case ValueType::TEXT_T: + break; case ValueType::BOOL_T: break; case ValueType::INT64_T: @@ -299,5 +385,6 @@ void SettingEntry::makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt() { break; default: logF("unrecognized value %i", valueType); + break; } } diff --git a/Horion/Module/Modules/Module.h b/Horion/Module/Modules/Module.h index 981a9c1d..219379fb 100644 --- a/Horion/Module/Modules/Module.h +++ b/Horion/Module/Modules/Module.h @@ -1,9 +1,10 @@ #pragma once - #include "../../../Memory/GameData.h" #include "../../FriendList/FriendList.h" -//#include "../../DrawUtils.h" #include "../../../Utils/keys.h" +//#include "../../DrawUtils.h" + +class IModule; enum class Category { COMBAT = 0, @@ -15,13 +16,60 @@ enum class Category { CUSTOM = 6 }; +struct EnumEntry { +private: + /*const */ std::string name; + /*const */ unsigned char val; + +public: + /// Use this however you want + void* ptr = nullptr; + EnumEntry(const std::string _name, const unsigned char value); + std::string GetName(); + unsigned char GetValue(); +}; + +struct AddResult; + +class SettingEnum { +private: + IModule* owner = nullptr; + +public: + std::vector Entrys; + int selected = -1; + + SettingEnum(std::vector entr, IModule* mod = nullptr); + SettingEnum(IModule* mod = nullptr); + //SettingEnum(); + AddResult addEntry(EnumEntry entr); + EnumEntry* GetEntry(int ind); + EnumEntry* GetEntry(); + int GetCount(); +}; + +struct AddResult { + union { + bool Succes; + SettingEnum* Enum; + }; + AddResult(bool succ, SettingEnum* e) { + Succes = succ; + Enum = e; + } + inline AddResult addEntry(EnumEntry entr) { + return Enum->addEntry(entr); + } +}; + enum class ValueType { FLOAT_T, DOUBLE_T, INT64_T, INT_T, BOOL_T, - TEXT_T + TEXT_T, + ENUM_T }; struct SettingValue { @@ -32,6 +80,7 @@ struct SettingValue { int _int; bool _bool; std::string* text; + SettingEnum* Enum; }; }; @@ -66,6 +115,7 @@ class IModule { void registerFloatSetting(std::string name, float* floatPtr, float defaultValue, float minValue, float maxValue); void registerIntSetting(std::string name, int* intpTr, int defaultValue, int minValue, int maxValue); + void registerEnumSetting(std::string name, SettingEnum* intPtr, int defaultValue); void registerBoolSetting(std::string name, bool* boolPtr, bool defaultValue); void clientMessageF(const char* fmt, ...); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index c52b423c..00ca7b0b 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -7,8 +7,8 @@ #include #include #include -#include //radians -#include // perspective, translate, rotate +#include //radians +#include // perspective, translate, rotate #include #include #include @@ -20,7 +20,12 @@ using json = nlohmann::json; TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { + enum1 = *(*new SettingEnum(this)).addEntry(EnumEntry("1", 1)).addEntry(EnumEntry("2", 2)) + .addEntry(EnumEntry("3", 3)).Enum; registerFloatSetting("float1", &this->float1, 0, -10, 10); + registerIntSetting("int1", &this->int1, 0, -10, 10); + registerEnumSetting("Enum1", &enum1, 0); + registerBoolSetting("bool1", &this->bool1, true); } TestModule::~TestModule() { diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 1e11b6f4..d3b28131 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -6,6 +6,9 @@ class TestModule : public IModule { public: float float1 = 0; + int int1 = 0; + bool bool1 = true; + SettingEnum enum1; TestModule(); ~TestModule(); From caef8d2b7d44d6b4f9154be10993da84ac1446d1 Mon Sep 17 00:00:00 2001 From: NotExisting <61290107+N0tExisting@users.noreply.github.com> Date: Mon, 4 Jan 2021 18:47:09 +0100 Subject: [PATCH 224/419] Now we got modes Boys --- Horion/Menu/ClickGui.cpp | 87 +++++++++++++++++++++++++- Horion/Module/Modules/Module.cpp | 91 +++++++++++++++++++++++++++- Horion/Module/Modules/Module.h | 56 ++++++++++++++++- Horion/Module/Modules/TestModule.cpp | 9 ++- Horion/Module/Modules/TestModule.h | 3 + 5 files changed, 236 insertions(+), 10 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 87f7bc64..b7b9066a 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -38,8 +38,12 @@ static constexpr float paddingRight = 13.5f; static constexpr float crossSize = textHeight / 2.f; static constexpr float crossWidth = 0.3f; static constexpr float backgroundAlpha = 1; -static const MC_Color selectedModuleColor = MC_Color(28, 107, 201); -static const MC_Color moduleColor = MC_Color(13, 29, 48); +static const MC_Color selectedModuleColor = MC_Color(30, 110, 200); +static const MC_Color selectedSettingColor1 = MC_Color(20, 100, 195); +static const MC_Color selectedSettingColor2 = MC_Color(40, 120, 205); +static const MC_Color moduleColor = MC_Color(15, 30, 50); +static const MC_Color SettingColor1 = MC_Color(10, 25, 45); +static const MC_Color SettingColor2 = MC_Color(20, 35, 55); float currentYOffset = 0; float currentXOffset = 0; @@ -347,7 +351,84 @@ void ClickGui::renderCategory(Category category) { DrawUtils::drawText(textPos, &elTexto, isFocused ? MC_Color(1.0f, 1.0f, 1.0f) : MC_Color(0.8f, 0.8f, 0.8f), textSize); currentYOffset += textHeight + (textPadding * 2); } - } break; + break; + } + case ValueType::ENUM_T: { + // Text and background + { + char name[0x21]; + sprintf_s(name, 0x21, "%s:", setting->name); + // Convert first letter to uppercase for more friendlieness + if (name[0] != 0) + name[0] = toupper(name[0]); + + std::string elTexto = name; + rectPos.w = currentYOffset + textHeight + (textPadding * 2); + windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/ + crossSize); + DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); + DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); + GuiUtils::drawCrossLine(vec2_t( + currentXOffset + windowSize->x + paddingRight - (crossSize / 2) - 1.f, + currentYOffset + textPadding + (textHeight / 2)), + MC_Color(255, 255, 255), crossWidth, crossSize, !setting->minValue->_bool); + if (rectPos.contains(&mousePos) && shouldToggleRightClick && !ourWindow->isInAnimation) { + shouldToggleRightClick = false; + setting->minValue->_bool = !setting->minValue->_bool; + } + currentYOffset += textHeight + (textPadding * 2); + } + if (setting->minValue->_bool) { + int e = 0; + for (auto it = setting->maxValue->Enum->Entrys.begin(); + it != setting->maxValue->Enum->Entrys.end(); it++, e++) { + if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { + overflowing = true; + break; + } + bool isEven = e % 2 == 0; + rectPos.y = currentYOffset; + rectPos.w = currentYOffset + textHeight + (textPadding * 2); + EnumEntry i = *it._Ptr; + char name[0x21]; + sprintf_s(name, 0x21, " %s", i.GetName().c_str()); + // Convert first letter to uppercase for more friendlieness + if (name[0] != 0) + name[0] = toupper(name[0]); + std::string elTexto = name; + windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth( + &elTexto, textSize) + + 5); //because we add 5 to text padding + textPos.y = currentYOffset + textPadding; + vec4_t selectableSurface = vec4_t( + textPos.x + textPadding, + textPos.y + textPadding, + xEnd - textPadding, + textPos.y + textHeight - textPadding); + MC_Color col; + if (setting->value->_int == e || (selectableSurface.contains(&mousePos) && !ourWindow->isInAnimation)) { + if (isEven) + col = selectedSettingColor1; + else + col = selectedSettingColor2; + } else { + if (isEven) + col = SettingColor1; + else + col = SettingColor2; + } + DrawUtils::fillRectangle(rectPos, col, backgroundAlpha); + DrawUtils::drawText(textPos, &elTexto, MC_Color(1.f, 1.f, 1.f)); + // logic + if (selectableSurface.contains(&mousePos) && + shouldToggleLeftClick && !ourWindow->isInAnimation) { + shouldToggleLeftClick = false; + setting->value->_int = e; + } + currentYOffset += textHeight + (textPadding * 2); + } + } + break; + } case ValueType::FLOAT_T: { // Text and background { diff --git a/Horion/Module/Modules/Module.cpp b/Horion/Module/Modules/Module.cpp index 304e3ab0..8ba99612 100644 --- a/Horion/Module/Modules/Module.cpp +++ b/Horion/Module/Modules/Module.cpp @@ -1,11 +1,59 @@ #include "Module.h" - #include "../../../Utils/Json.hpp" #include "../../../Utils/Logger.h" #include using json = nlohmann::json; +#pragma region EnumEntry +EnumEntry::EnumEntry(const std::string _name, const unsigned char value) { + name = _name; + val = value; +} +std::string EnumEntry::GetName() { + return name; +} +unsigned char EnumEntry::GetValue() { + return val; +} +#pragma endregion +#pragma region SettingEnum +SettingEnum::SettingEnum(std::vector entr, IModule* mod) { + Entrys = entr; + owner = mod; + std::sort(Entrys.begin(), Entrys.end(), [](EnumEntry rhs, EnumEntry lhs) { + return rhs.GetValue() < lhs.GetValue(); + }); +} +SettingEnum::SettingEnum(IModule* mod) { + owner = mod; +} + +AddResult SettingEnum::addEntry(EnumEntry entr) { + auto etr = new EnumEntry(entr); + bool SameVal = false; + for (auto it = this->Entrys.begin(); it != this->Entrys.end(); it++) { + SameVal |= it->GetValue() == etr->GetValue(); + } + if (!SameVal) { + Entrys.push_back(*etr); + std::sort(Entrys.begin(), Entrys.end(), [](EnumEntry rhs, EnumEntry lhs) { + return rhs.GetValue() < lhs.GetValue(); + }); + } + return AddResult(SameVal, this); +} +EnumEntry* SettingEnum::GetEntry(int ind) { + return &Entrys.at(ind); +} +EnumEntry* SettingEnum::GetEntry() { + return GetEntry(selected); +} +int SettingEnum::GetCount() { + return (int)Entrys.size(); +} +#pragma endregion + IModule::IModule(int key, Category c, const char* tooltip) { this->keybind = key; this->category = c; @@ -77,6 +125,30 @@ void IModule::registerIntSetting(std::string name, int* intPtr, int defaultValue settings.push_back(setting); // Add to list } +void IModule::registerEnumSetting(std::string name, SettingEnum* ptr, int defaultValue) { + SettingEntry* setting = new SettingEntry(); + setting->valueType = ValueType::ENUM_T; + // Actual Value + setting->value = reinterpret_cast(&ptr->selected); + // Default Value + SettingValue* defaultVal = new SettingValue(); + defaultVal->_int = defaultValue; + setting->defaultValue = defaultVal; + // Min Value (is Extended) + SettingValue* minVal = new SettingValue(); + minVal->_bool = false; + setting->minValue = minVal; + // Max Value (The Enum) + SettingValue* maxVal = new SettingValue(); + maxVal->Enum = ptr; + setting->maxValue = maxVal; + // Name + strcpy_s(setting->name, 19, name.c_str()); + setting->value->_int = setting->defaultValue->_int; + // Add to list + settings.push_back(setting); +} + void IModule::registerBoolSetting(std::string name, bool* boolPtr, bool defaultValue) { SettingEntry* setting = new SettingEntry(); setting->valueType = ValueType::BOOL_T; @@ -178,6 +250,13 @@ void IModule::onLoadConfig(void* confVoid) { case ValueType::TEXT_T: sett->value->text = new std::string(value.get()); break; + case ValueType::ENUM_T: + try { + sett->value->_int = value.get(); + } catch (const std::exception& e) { + logF("Config Load Error(Enum) (%s): %s ", this->getRawModuleName(), e.what()); + } + break; } sett->makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt(); continue; @@ -221,6 +300,9 @@ void IModule::onSaveConfig(void* confVoid) { case ValueType::TEXT_T: obj.emplace(sett->name, *sett->value->text); break; + case ValueType::ENUM_T: + obj.emplace(sett->name, sett->value->_int); + break; } } @@ -282,7 +364,9 @@ void IModule::clientMessageF(const char* fmt, ...) { void SettingEntry::makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt() { switch (valueType) { - case ValueType::TEXT_T: + case ValueType::ENUM_T: + value->_int = std::max(0, std::min(maxValue->Enum->GetCount()-1, value->_int)); + break; case ValueType::BOOL_T: break; case ValueType::INT64_T: @@ -297,7 +381,10 @@ void SettingEntry::makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt() { case ValueType::INT_T: value->_int = std::max(minValue->_int, std::min(maxValue->_int, value->_int)); break; + case ValueType::TEXT_T: + //break; default: logF("unrecognized value %i", valueType); + break; } } diff --git a/Horion/Module/Modules/Module.h b/Horion/Module/Modules/Module.h index 981a9c1d..219379fb 100644 --- a/Horion/Module/Modules/Module.h +++ b/Horion/Module/Modules/Module.h @@ -1,9 +1,10 @@ #pragma once - #include "../../../Memory/GameData.h" #include "../../FriendList/FriendList.h" -//#include "../../DrawUtils.h" #include "../../../Utils/keys.h" +//#include "../../DrawUtils.h" + +class IModule; enum class Category { COMBAT = 0, @@ -15,13 +16,60 @@ enum class Category { CUSTOM = 6 }; +struct EnumEntry { +private: + /*const */ std::string name; + /*const */ unsigned char val; + +public: + /// Use this however you want + void* ptr = nullptr; + EnumEntry(const std::string _name, const unsigned char value); + std::string GetName(); + unsigned char GetValue(); +}; + +struct AddResult; + +class SettingEnum { +private: + IModule* owner = nullptr; + +public: + std::vector Entrys; + int selected = -1; + + SettingEnum(std::vector entr, IModule* mod = nullptr); + SettingEnum(IModule* mod = nullptr); + //SettingEnum(); + AddResult addEntry(EnumEntry entr); + EnumEntry* GetEntry(int ind); + EnumEntry* GetEntry(); + int GetCount(); +}; + +struct AddResult { + union { + bool Succes; + SettingEnum* Enum; + }; + AddResult(bool succ, SettingEnum* e) { + Succes = succ; + Enum = e; + } + inline AddResult addEntry(EnumEntry entr) { + return Enum->addEntry(entr); + } +}; + enum class ValueType { FLOAT_T, DOUBLE_T, INT64_T, INT_T, BOOL_T, - TEXT_T + TEXT_T, + ENUM_T }; struct SettingValue { @@ -32,6 +80,7 @@ struct SettingValue { int _int; bool _bool; std::string* text; + SettingEnum* Enum; }; }; @@ -66,6 +115,7 @@ class IModule { void registerFloatSetting(std::string name, float* floatPtr, float defaultValue, float minValue, float maxValue); void registerIntSetting(std::string name, int* intpTr, int defaultValue, int minValue, int maxValue); + void registerEnumSetting(std::string name, SettingEnum* intPtr, int defaultValue); void registerBoolSetting(std::string name, bool* boolPtr, bool defaultValue); void clientMessageF(const char* fmt, ...); diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index c52b423c..00ca7b0b 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -7,8 +7,8 @@ #include #include #include -#include //radians -#include // perspective, translate, rotate +#include //radians +#include // perspective, translate, rotate #include #include #include @@ -20,7 +20,12 @@ using json = nlohmann::json; TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { + enum1 = *(*new SettingEnum(this)).addEntry(EnumEntry("1", 1)).addEntry(EnumEntry("2", 2)) + .addEntry(EnumEntry("3", 3)).Enum; registerFloatSetting("float1", &this->float1, 0, -10, 10); + registerIntSetting("int1", &this->int1, 0, -10, 10); + registerEnumSetting("Enum1", &enum1, 0); + registerBoolSetting("bool1", &this->bool1, true); } TestModule::~TestModule() { diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 1e11b6f4..d3b28131 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -6,6 +6,9 @@ class TestModule : public IModule { public: float float1 = 0; + int int1 = 0; + bool bool1 = true; + SettingEnum enum1; TestModule(); ~TestModule(); From 3a9d538afa2b4d4684359235ef68f782794c1ce7 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:10:32 -0400 Subject: [PATCH 225/419] fix inventoryMove , scaffold, tower , skin ,a --- Horion/Module/Modules/AntiVoid.cpp | 2 +- Horion/Module/Modules/Scaffold.cpp | 5 +++-- Horion/Module/Modules/TestModule.cpp | 2 +- Horion/Module/Modules/Tower.cpp | 4 ++-- Memory/Hooks.cpp | 18 +++++++++--------- SDK/CBlockLegacy.cpp | 2 +- SDK/CBlockLegacy.h | 6 +++--- SDK/CEntity.h | 3 ++- SDK/CItem.h | 2 +- 9 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Horion/Module/Modules/AntiVoid.cpp b/Horion/Module/Modules/AntiVoid.cpp index 5b7dbf93..7e0691b2 100644 --- a/Horion/Module/Modules/AntiVoid.cpp +++ b/Horion/Module/Modules/AntiVoid.cpp @@ -17,7 +17,7 @@ void AntiVoid::onTick(C_GameMode* gm) { blockBelow.y -= player->height; blockBelow.y -= 0.5f; - if ((*(player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && (*(player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) { + if (((player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && ((player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) { savepos = blockBelow; savepos.y += player->height; savepos.y += 0.5f; diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index 44eec4af..8d884d1b 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -17,7 +17,7 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) { blockBelow = blockBelow.floor(); C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); - C_BlockLegacy* blockLegacy = *(block->blockLegacy); + C_BlockLegacy* blockLegacy = (block->blockLegacy); if (blockLegacy->material->isReplaceable) { vec3_ti blok(blockBelow); @@ -38,7 +38,8 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) { int i = 0; for (auto current : checklist) { vec3_ti calc = blok.sub(*current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + bool Y = ((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable; + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click foundCandidate = true; blok = calc; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index c52b423c..938f1d87 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -158,7 +158,7 @@ bool tryPlace(const vec3_ti& blockPos) { for (const auto& current : checklist) { vec3_ti calc = blockPos.sub(current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click g_Data.getCGameMode()->buildBlock(&calc, i); diff --git a/Horion/Module/Modules/Tower.cpp b/Horion/Module/Modules/Tower.cpp index 5c45c45c..d02d95bd 100644 --- a/Horion/Module/Modules/Tower.cpp +++ b/Horion/Module/Modules/Tower.cpp @@ -24,7 +24,7 @@ bool Tower::tryTower(vec3_t blockBelow) { DrawUtils::drawBox(blockBelow, vec3_t(blockBelow).add(1), 0.4f); C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); - C_BlockLegacy* blockLegacy = *(block->blockLegacy); + C_BlockLegacy* blockLegacy = (block->blockLegacy); if (blockLegacy->material->isReplaceable) { vec3_ti blok(blockBelow); @@ -44,7 +44,7 @@ bool Tower::tryTower(vec3_t blockBelow) { int i = 0; for (auto current : checklist) { vec3_ti calc = blok.sub(*current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click foundCandidate = true; blok = calc; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2ce2675d..e60df23b 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -71,8 +71,8 @@ void Hooks::Init() { } // MoveInputHandler::vtable - /*{ - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 42 ?? 48 85 C0 74 04"); + { + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 49 89 48 ? 49 89 80 ? ? ? ? 49 89 80 ? ? ? ? 48 39 87 ? ? ? ? 74 20 48 8B 8F"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** moveInputVtable = reinterpret_cast(sigOffset + offset + 7); if (moveInputVtable == 0x0 || sigOffset == 0x0) @@ -80,10 +80,10 @@ void Hooks::Init() { else { g_Hooks.MoveInputHandler_tickHook = std::make_unique(moveInputVtable[1], Hooks::MoveInputHandler_tick); } - }*/ + } // PackAccessStrategy vtables for isTrusted - /*{ + { uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** directoryPackVtable = reinterpret_cast(sigOffset + offset + 7); @@ -94,13 +94,13 @@ void Hooks::Init() { uintptr_t sigOffset2 = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 49 8D 57"); int offset2 = *reinterpret_cast(sigOffset2 + 3); - uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + / 7); + uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + 7); { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); - }*/ + } } // d3d11 @@ -257,7 +257,7 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 85 ? ? ? ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); + void* _getSkinPack = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B E2 48 8B F1")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); @@ -1210,7 +1210,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f const bool isAutoMode = nukerModule->isAutoMode(); C_BlockSource* region = g_Data.getLocalPlayer()->region; - int selectedBlockId = (*(region->getBlock(*a2)->blockLegacy))->blockId; + int selectedBlockId = ((region->getBlock(*a2)->blockLegacy))->blockId; uint8_t selectedBlockData = region->getBlock(*a2)->data; if (!isAutoMode) { @@ -1223,7 +1223,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f if (tempPos.y > 0) { C_Block* blok = region->getBlock(tempPos); uint8_t data = blok->data; - int id = (*(blok->blockLegacy))->blockId; + int id = ((blok->blockLegacy))->blockId; if (id != 0 && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData))) _this->destroyBlock(&tempPos, face); } diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index f601669f..ce26440a 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -4,7 +4,7 @@ #include "../Utils/Utils.h" C_Block* C_BlockSource::getBlock(const vec3_ti& block) { using getBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getBlock_t getBlock = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B DA 8B 52 ?? 85 D2")); + static getBlock_t getBlock = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ? 48 8B F9 48 8B DA 8B 4A")); return getBlock(this, block); } C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 874f7bd9..b32d4c0f 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -37,7 +37,7 @@ class C_BlockLegacy { TextHolder name; //0x0030 private: char idk1[0x8]; //0x0050 - char pad_0x0048[0x78]; //0x0058 + char pad_0x0048[0x80]; //0x0058 public: C_Material* material; //0x00C0 private: @@ -63,9 +63,9 @@ class C_Block { char pad[0x7]; public: - C_BlockLegacy** blockLegacy; // 0x10 + C_BlockLegacy* blockLegacy; // 0x10 - inline C_BlockLegacy* toLegacy() { return *blockLegacy; } + inline C_BlockLegacy* toLegacy() { return blockLegacy; } virtual ~C_Block(); virtual int getRenderLayer(); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 3dc03e09..094dfaed 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -648,7 +648,7 @@ class C_Entity { virtual __int64 initBodyControl(void); public: - virtual __int64 jumpFromGround(__int64); + virtual __int64 jumpFromGround0(__int64); virtual __int64 jumpFromGround(void); private: @@ -664,6 +664,7 @@ class C_Entity { virtual __int64 prepareRegion(__int64 &); virtual __int64 destroyRegion(void); virtual __int64 suspendRegion(void); + virtual void resendAllChunks(void); virtual __int64 _fireWillChangeDimension(void); virtual __int64 _fireDimensionChanged(void); virtual __int64 changeDimensionWithCredits(__int64); diff --git a/SDK/CItem.h b/SDK/CItem.h index 934e7281..2a05b8ec 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -233,7 +233,7 @@ class C_Item { return false; } bool isBlock(void) { - auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x170); + auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1D0); return val != nullptr && *val != nullptr; } }; From f902db3e5313b4fad83b905603744b765a4f1c91 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:13:57 -0400 Subject: [PATCH 226/419] test --- Horion/Command/Commands/TestCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index bed737f3..09ab1689 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -31,7 +31,7 @@ void showAimedBlockInfo() { } bool TestCommand::execute(std::vector* args) { - C_LocalPlayer* player = g_Data.getLocalPlayer(); + C_LocalPlayer* player = g_Data.getLocalPlayer(); auto inv = player->getSupplies()->inventory; logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); From fe36c11e7fa63f8c98f8ceccc26e8521643cb500 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:15:05 -0400 Subject: [PATCH 227/419] test 2 --- Horion/Command/Commands/TestCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index 09ab1689..bed737f3 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -31,7 +31,7 @@ void showAimedBlockInfo() { } bool TestCommand::execute(std::vector* args) { - C_LocalPlayer* player = g_Data.getLocalPlayer(); + C_LocalPlayer* player = g_Data.getLocalPlayer(); auto inv = player->getSupplies()->inventory; logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); From bf80fffa5d15744ae70c7250ab7d3c01d197d4f0 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:16:59 -0400 Subject: [PATCH 228/419] bruh --- Horion/Command/Commands/TestCommand.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index bed737f3..3300d413 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -37,6 +37,5 @@ bool TestCommand::execute(std::vector* args) { logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); inv->swapSlots(1, 2); - return true; } From 61de048e74b7e6e743812a7240d6eb4fcfa142e6 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:18:26 -0400 Subject: [PATCH 229/419] final test --- Horion/Command/Commands/TestCommand.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index 3300d413..bed737f3 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -37,5 +37,6 @@ bool TestCommand::execute(std::vector* args) { logF("%i %i", inv->getFirstEmptySlot(), inv->getEmptySlotsCount()); inv->swapSlots(1, 2); + return true; } From fadad90b36a697e2d7bf78a7cdfe1b26d90992ed Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:20:44 -0400 Subject: [PATCH 230/419] yes --- SDK/CEntity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index f3d1e503..0e26ebc8 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -33,5 +33,4 @@ void C_LocalPlayer::setGameModeType(int gma) { //using setGameMode = void(__thiscall *)(void *, int); //static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); this->setC_PlayerGameType(gma); - //Game_Mode(this, gma); } From 062caf1a1eec8b986e80e88b24b622c99816be26 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:29:01 -0400 Subject: [PATCH 231/419] fix custom skin --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e60df23b..b4f6fed5 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -99,7 +99,7 @@ void Hooks::Init() { { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } - g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); + g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("48 89 5C 24 ? 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); } } From 66aeb3955c8050a66982f8dd42882640220645e0 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 10 Jan 2021 11:37:01 -0400 Subject: [PATCH 232/419] fix crash --- Memory/Hooks.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b4f6fed5..c00940b1 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1584,7 +1584,15 @@ __int64 Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { bool Hooks::DirectoryPackAccessStrategy__isTrusted(__int64 _this) { static auto func = g_Hooks.DirectoryPackAccessStrategy__isTrustedHook->GetFastcall(); - if (Utils::getRttiBaseClassName(reinterpret_cast(_this)) == "DirectoryPackAccessStrategy") + static uintptr_t** directoryPackAccessStrategyVtable = 0; + + if (!directoryPackAccessStrategyVtable) { + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); + int offset = *reinterpret_cast(sigOffset + 3); + directoryPackAccessStrategyVtable = reinterpret_cast(sigOffset + offset + 7); + } + + if (*reinterpret_cast(_this) == (uintptr_t)directoryPackAccessStrategyVtable) return true; return func(_this); From 3951ca6f48715cd4f36a6b5769facb33bda94e66 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 10 Jan 2021 12:12:37 -0400 Subject: [PATCH 233/419] fix .give crash --- Horion/Command/Commands/GiveCommand.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index 34a7e1ad..f4f1350e 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -27,26 +27,23 @@ bool GiveCommand::execute(std::vector* args) { auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); if (itemId == 0) { - void* ItemPtr = malloc(0x8); - void* idk = malloc(0x0); TextHolder tempText(args->at(1)); - C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, tempText); + std::unique_ptr ItemPtr = std::make_unique(); + std::unique_ptr buffer = std::make_unique(); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr.get(), buffer.get(), tempText); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; } yot = new C_ItemStack(***cStack, count, itemData); - free(ItemPtr); - free(idk); } else { - void* ItemPtr = malloc(0x8); - C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, itemId); + std::unique_ptr ItemPtr = std::make_unique(); + C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr.get(), itemId); if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) { clientMessageF("%sInvalid item ID!", RED); return true; } yot = new C_ItemStack(***cStack, count, itemData); - free(ItemPtr); } if (yot != nullptr) From 0ee3380b576b498631efdface4e0136e095995eb Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:15:42 -0600 Subject: [PATCH 234/419] fix compile error --- Horion/Module/Modules/Tornado.cpp | 26 ++++++++++++++++++++++++++ Horion/Module/Modules/Tornado1.h | 14 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Horion/Module/Modules/Tornado.cpp create mode 100644 Horion/Module/Modules/Tornado1.h diff --git a/Horion/Module/Modules/Tornado.cpp b/Horion/Module/Modules/Tornado.cpp new file mode 100644 index 00000000..70051495 --- /dev/null +++ b/Horion/Module/Modules/Tornado.cpp @@ -0,0 +1,26 @@ +#include "Tornado1.h" + +Tornado::Tornado() : IModule(0, Category::COMBAT, "Makes you small and damage entities you run into when you jump.") { + registerBoolSetting("Only While Jumping", &this->onlyjump, this->onlyjump); +} +Tornado::~Tornado() { +} + +const char* Tornado::getModuleName() { + return "Tornado"; +} + +void Tornado::onTick(C_GameMode* gm) { + auto player = g_Data.getLocalPlayer(); + bool onlyJump = this->onlyjump; + + if (onlyJump) { + if (player->isJumping()) { + player->setDamageNearbyMobs(true); + } else if (player->onGround) { + player->setDamageNearbyMobs(false); + } + } else if (!onlyJump) { + player->setDamageNearbyMobs(true); + } +} \ No newline at end of file diff --git a/Horion/Module/Modules/Tornado1.h b/Horion/Module/Modules/Tornado1.h new file mode 100644 index 00000000..b2b8976d --- /dev/null +++ b/Horion/Module/Modules/Tornado1.h @@ -0,0 +1,14 @@ +#pragma once +#include "Module.h" + +class Tornado : public IModule { +private: + bool onlyjump = true; + +public: + Tornado(); + ~Tornado(); + + virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; +}; \ No newline at end of file From dadb383e5add4ab2cecc2848d1e75883424ec713 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:18:10 -0600 Subject: [PATCH 235/419] fix compile error --- Horion/Module/ModuleManager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 4b397d70..f67f3e56 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -94,6 +94,7 @@ #include "Modules/Compass.h" #include "Modules/Radar.h" #include "Modules/VanillaPlus.h" +#include "Modules/Tornado1.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" From d4acdb11eb44e900009a7b0d58a328d548ee2fa2 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:18:50 -0600 Subject: [PATCH 236/419] Add files via upload --- Horion.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Horion.vcxproj b/Horion.vcxproj index 344ebc1e..36ca82b4 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -357,6 +357,7 @@ + @@ -542,6 +543,7 @@ + From fa8e31b73e1b0f8608aa5f41965732766d203305 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:28:50 -0600 Subject: [PATCH 237/419] Add files via upload --- Horion/Module/ModuleManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 683207a1..a0133f90 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -103,6 +103,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new VanillaPlus())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); + this->moduleList.push_back(std::shared_ptr(new Tornado())); #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); From 62a668cec4b7187859ec0ea402986359a810adce Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:29:40 -0600 Subject: [PATCH 238/419] Add files via upload --- Horion/Module/Modules/TestModule.cpp | 226 ++------------------------- Horion/Module/Modules/TestModule.h | 12 +- 2 files changed, 13 insertions(+), 225 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 938f1d87..4545c82b 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,26 +1,10 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" -#include "../../../Utils/VoxelIntersector.h" -#include "../../DrawUtils.h" -#include "../../../SDK/MatrixStack.h" -#include -#include -#include -#include -#include //radians -#include // perspective, translate, rotate -#include -#include -#include -#include -#include -#include "../../../Utils/Json.hpp" -using json = nlohmann::json; TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { - registerFloatSetting("float1", &this->float1, 0, -10, 10); + registerFloatSetting("PlayerSize", &this->playersize, this->playersize, 0, 10); } TestModule::~TestModule() { @@ -30,210 +14,18 @@ const char* TestModule::getModuleName() { return "TestModule"; } -bool TestModule::isFlashMode() { - return false; -} - - - -__forceinline unsigned __int64 rotBy(int in, unsigned int by) { - auto mut = static_cast(in); - return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; -} - -size_t posToHash(const vec3_ti& pos) { - return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); -} - -struct PosHasher { - size_t operator()(const vec3_ti& i) const { return posToHash(i); }; -}; - -std::unordered_set renderPos(8); - -void loadFile(std::wstring filePath) { - std::string contents = Utils::readFileContents(filePath); - if (contents.size() == 0) - return; - - logF("Starting geometry import"); - auto mesh = SkinUtil::objToMesh(contents.c_str(), false); - logF("Mesh created (verts: %i, uvs: %i, normals: %i, faces: %i)", mesh.vertices.size(), mesh.uvs.size(), mesh.normals.size(), mesh.faces.size()); - - auto posHasher2 = [](const vec3_ti& i) { return posToHash(i); }; - std::unordered_set newPoses(8); - int num = 0; - for (const auto& face : mesh.faces) { - - if (face.facesPresent != 3) { - //logF("wierd face %i", face.facesPresent); - continue; - } - - - const auto& v1 = mesh.vertices[face.indices[0].vertIndex]; - const auto& v2 = mesh.vertices[face.indices[1].vertIndex]; - const auto& v3 = mesh.vertices[face.indices[2].vertIndex]; - // intersect tris - Voxel::Triangle3 tri = {{v1[0], v1[1], v1[2]}, - {v2[0], v2[1], v2[2]}, - {v3[0], v3[1], v3[2]}}; - AABB bBox{}; - Voxel::getBoundingBox(bBox, tri); - bBox.lower.y = std::max(0.f, bBox.lower.y); - bBox.upper.y = std::min(255.f, bBox.upper.y); - - for (float x = floorf(bBox.lower.x); x < ceilf(bBox.upper.x); x++) { - for (float y = floorf(bBox.lower.y); y < ceilf(bBox.upper.y); y++) { - for (float z = floorf(bBox.lower.z); z < ceilf(bBox.upper.z); z++) { - vec3_t voxel(x, y, z); - if (!Voxel::intersects(voxel, tri)) - continue; - - newPoses.insert(vec3_ti((int)x, (int)y, (int)z)); - num++; - } - } - } - } - - renderPos = newPoses; - logF("replaced renderPos with %i %i", renderPos.size(), num); -} - -void TestModule::onEnable() { - renderPos.clear(); - - HorionDataPacket packet; - packet.cmd = CMD_FILECHOOSER; - auto tmp = std::shared_ptr(new unsigned char[300]); - packet.data.swap(tmp); - memset(packet.data.get(), 0, 300); - strcpy_s((char*)packet.data.get(), 200, "{\"title\": \"Select a 3d object\", \"filter\":\"Object Files (*.obj)|*.obj\"}"); - packet.dataArraySize = (int)strlen((char*)packet.data.get()); - packet.params[0] = g_Data.addInjectorResponseCallback([](std::shared_ptr pk) { - if (pk->params[0] != 1) { // Dialog Canceled, reset geo - auto box = g_Data.addInfoBox("File load", "No file loaded"); - box->closeTimer = 1; - return; - } - - wchar_t* jsonData = reinterpret_cast(pk->data.get()); - std::wstring jsonDataStr(jsonData); - - json parsed = json::parse(jsonDataStr); - if (parsed["path"].is_string()) { - auto box = g_Data.addInfoBox("Importing File", "Please wait..."); - std::thread gamer([parsed, box]() { - loadFile(Utils::stringToWstring(parsed["path"].get())); - box->fadeTarget = 0; - }); - gamer.detach(); - } - }); - - g_Data.sendPacketToInjector(packet); -} - -bool tryPlace(const vec3_ti& blockPos) { - C_Block* block = g_Data.getLocalPlayer()->region->getBlock(blockPos); - C_BlockLegacy* blockLegacy = block->toLegacy(); - if (blockLegacy->material->isReplaceable) { - - // Find neighbour - static std::vector checklist; - if (checklist.empty()) { - checklist.push_back(vec3_ti(0, -1, 0)); - checklist.push_back(vec3_ti(0, 1, 0)); - - checklist.push_back(vec3_ti(0, 0, -1)); - checklist.push_back(vec3_ti(0, 0, 1)); - - checklist.push_back(vec3_ti(-1, 0, 0)); - checklist.push_back(vec3_ti(1, 0, 0)); - } - - bool foundCandidate = false; - int i = 0; - for (const auto& current : checklist) { - - vec3_ti calc = blockPos.sub(current); - if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { - // Found a solid block to click - g_Data.getCGameMode()->buildBlock(&calc, i); - - return true; - break; - } - i++; - } - } - return false; -} - void TestModule::onTick(C_GameMode* gm) { - if (g_Data.getLocalPlayer() == nullptr) - return; - if (!g_Data.canUseMoveKeys()) - return; - if (renderPos.size() == 0) - return; - - auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock())) // Block in hand? - return; - - int radius = 4; - int numBlocksPerTick = 1; - for (int x = -radius; x < radius; x++) { - for (int y = -radius; y < radius; y++) { - for (int z = -radius; z < radius; z++) { - auto pos = g_Data.getLocalPlayer()->eyePos0.add((float)x, (float)y, (float)z).floor(); - if (renderPos.count(pos) == 0) - continue; - if (tryPlace(pos) && --numBlocksPerTick == 0) - return; - } - } - + if (this->active) { + g_Data.getLocalPlayer()->setSize(this->playersize / 2, this->playersize); } } -void TestModule::onMove(C_MoveInputHandler* hand){ - -} - -void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { - DrawUtils::setColor(0.3f, 0.3f, 0.7f, 1); - -} - -void TestModule::onSendPacket(C_Packet* p) { - +void TestModule::onEnable() { + this->ogsize = g_Data.getLocalPlayer()->height; + this->active = true; } void TestModule::onDisable() { - -} -float t = 0; -void TestModule::onLevelRender() { - - DrawUtils::setColor(0.8f, 0.4f, 0.4f, 1); - int radius = 50; - - const auto origin = g_Data.getLocalPlayer()->eyePos0.floor(); - for (auto pos : renderPos) { - if (fabsf(pos.x - origin.x) > radius) - continue; - if (fabsf(pos.z - origin.z) > radius) - continue; - if (fabsf(pos.y - origin.y) > radius) - continue; - C_Block* block = g_Data.getLocalPlayer()->region->getBlock(pos); - C_BlockLegacy* blockLegacy = block->toLegacy(); - if (!blockLegacy->material->isReplaceable) - continue; - DrawUtils::drawBox3d(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector()); - } - -} + this->active = false; + g_Data.getLocalPlayer()->setSize(this->ogsize / 2, this->ogsize); +} \ No newline at end of file diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 1e11b6f4..0fd0fc2f 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -2,22 +2,18 @@ #include "Module.h" class TestModule : public IModule { private: - int delay = 0; + float playersize = 1; + bool active = false; + float ogsize = 0; public: - float float1 = 0; - + TestModule(); ~TestModule(); // Inherited via IModule virtual const char* getModuleName() override; - virtual bool isFlashMode() override; virtual void onEnable() override; virtual void onTick(C_GameMode* gm) override; - virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; - virtual void onSendPacket(C_Packet* p) override; - virtual void onMove(C_MoveInputHandler* hand) override; virtual void onDisable() override; - void onLevelRender() override; }; From 26ec90fe413cb45403b9f79593689b082edb6252 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:51:37 -0600 Subject: [PATCH 239/419] add hitbox sizer --- Horion.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Horion.vcxproj b/Horion.vcxproj index 36ca82b4..986f1a4d 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -316,6 +316,7 @@ + @@ -502,6 +503,7 @@ + From 458907eac27f0dfff036c95ab22ce12392e07daf Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:52:07 -0600 Subject: [PATCH 240/419] add hitbox sizer --- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index a0133f90..9322743a 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -104,6 +104,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); this->moduleList.push_back(std::shared_ptr(new Tornado())); + this->moduleList.push_back(std::shared_ptr(new HitboxSize())); #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index f67f3e56..9beded51 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -95,6 +95,7 @@ #include "Modules/Radar.h" #include "Modules/VanillaPlus.h" #include "Modules/Tornado1.h" +#include "Modules/HitboxSize1.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" From 76cb9ba4c0d2f27f8cdb8a10284e79cfef1ee915 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Thu, 21 Jan 2021 23:52:44 -0600 Subject: [PATCH 241/419] add hitbox sizer --- Horion/Module/Modules/HitboxSize.cpp | 28 ++++++++++++++++++++++++++++ Horion/Module/Modules/HitboxSize1.h | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Horion/Module/Modules/HitboxSize.cpp create mode 100644 Horion/Module/Modules/HitboxSize1.h diff --git a/Horion/Module/Modules/HitboxSize.cpp b/Horion/Module/Modules/HitboxSize.cpp new file mode 100644 index 00000000..f5dfcc8e --- /dev/null +++ b/Horion/Module/Modules/HitboxSize.cpp @@ -0,0 +1,28 @@ +#include "HitboxSize1.h" + +HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holess.") { + registerFloatSetting("PlayerSize", &this->playersize, this->playersize, 0, 10); +} + +HitboxSize::~HitboxSize() { +} + +const char* HitboxSize::getModuleName() { + return "Hitbox Size"; +} + +void HitboxSize::onTick(C_GameMode* gm) { + if (this->active) { + g_Data.getLocalPlayer()->setSize(this->playersize / 2, this->playersize); + } +} + +void HitboxSize::onEnable() { + this->ogsize = g_Data.getLocalPlayer()->height; + this->active = true; +} + +void HitboxSize::onDisable() { + this->active = false; + g_Data.getLocalPlayer()->setSize(this->ogsize / 2, this->ogsize); +} \ No newline at end of file diff --git a/Horion/Module/Modules/HitboxSize1.h b/Horion/Module/Modules/HitboxSize1.h new file mode 100644 index 00000000..9f2f1282 --- /dev/null +++ b/Horion/Module/Modules/HitboxSize1.h @@ -0,0 +1,18 @@ +#pragma once +#include "Module.h" +class HitboxSize : public IModule { +private: + float playersize = 1; + bool active = false; + float ogsize = 0; + +public: + HitboxSize(); + ~HitboxSize(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onEnable() override; + virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; +}; \ No newline at end of file From dbfe66b526c1ba76825bb06f81959a0bfa9fa93c Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Fri, 22 Jan 2021 13:59:37 -0600 Subject: [PATCH 242/419] fix typo --- Horion/Module/Modules/HitboxSize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/HitboxSize.cpp b/Horion/Module/Modules/HitboxSize.cpp index f5dfcc8e..7f55d8b0 100644 --- a/Horion/Module/Modules/HitboxSize.cpp +++ b/Horion/Module/Modules/HitboxSize.cpp @@ -1,6 +1,6 @@ #include "HitboxSize1.h" -HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holess.") { +HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holes.") { registerFloatSetting("PlayerSize", &this->playersize, this->playersize, 0, 10); } @@ -25,4 +25,4 @@ void HitboxSize::onEnable() { void HitboxSize::onDisable() { this->active = false; g_Data.getLocalPlayer()->setSize(this->ogsize / 2, this->ogsize); -} \ No newline at end of file +} From f91595b87b926babb0b03198260baa4dfef5ab80 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Mon, 25 Jan 2021 11:56:50 -0600 Subject: [PATCH 243/419] made height and width separate settings --- Horion/Module/Modules/HitboxSize.cpp | 16 +++++++++------- Horion/Module/Modules/HitboxSize1.h | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Horion/Module/Modules/HitboxSize.cpp b/Horion/Module/Modules/HitboxSize.cpp index 7f55d8b0..a0e91efc 100644 --- a/Horion/Module/Modules/HitboxSize.cpp +++ b/Horion/Module/Modules/HitboxSize.cpp @@ -1,28 +1,30 @@ #include "HitboxSize1.h" -HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holes.") { - registerFloatSetting("PlayerSize", &this->playersize, this->playersize, 0, 10); +HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holess.") { + registerFloatSetting("Width", &this->width, this->height, 0, 10); + registerFloatSetting("Height", &this->height, this->height, 0, 10); } HitboxSize::~HitboxSize() { } const char* HitboxSize::getModuleName() { - return "Hitbox Size"; + return "Player Hitbox"; } void HitboxSize::onTick(C_GameMode* gm) { if (this->active) { - g_Data.getLocalPlayer()->setSize(this->playersize / 2, this->playersize); + g_Data.getLocalPlayer()->setSize(this->width, this->height); } } void HitboxSize::onEnable() { - this->ogsize = g_Data.getLocalPlayer()->height; + this->ogheight = g_Data.getLocalPlayer()->height; + this->ogwidth = g_Data.getLocalPlayer()->width; this->active = true; } void HitboxSize::onDisable() { this->active = false; - g_Data.getLocalPlayer()->setSize(this->ogsize / 2, this->ogsize); -} + g_Data.getLocalPlayer()->setSize(this->ogwidth, this->ogheight); +} \ No newline at end of file diff --git a/Horion/Module/Modules/HitboxSize1.h b/Horion/Module/Modules/HitboxSize1.h index 9f2f1282..7abb81a1 100644 --- a/Horion/Module/Modules/HitboxSize1.h +++ b/Horion/Module/Modules/HitboxSize1.h @@ -2,9 +2,11 @@ #include "Module.h" class HitboxSize : public IModule { private: - float playersize = 1; + float width = 0.5; + float height = 0.5; bool active = false; - float ogsize = 0; + float ogwidth; + float ogheight; public: HitboxSize(); From 05ef492db465b205856f6887f9862be05faf1605 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Mon, 25 Jan 2021 13:12:59 -0600 Subject: [PATCH 244/419] added auto staircase --- Horion.vcxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 986f1a4d..646dd9d7 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -287,6 +287,7 @@ + @@ -474,6 +475,7 @@ + @@ -503,7 +505,7 @@ - + @@ -545,7 +547,7 @@ - + From 500802107218c8b987007832b58ebc4a84f85f3c Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Mon, 25 Jan 2021 13:13:31 -0600 Subject: [PATCH 245/419] added auto staircase --- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 9322743a..3e0c55c7 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -105,6 +105,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); this->moduleList.push_back(std::shared_ptr(new Tornado())); this->moduleList.push_back(std::shared_ptr(new HitboxSize())); + this->moduleList.push_back(std::shared_ptr(new AutoStaircase())); #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 9beded51..9d4c53d0 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -96,6 +96,7 @@ #include "Modules/VanillaPlus.h" #include "Modules/Tornado1.h" #include "Modules/HitboxSize1.h" +#include "Modules/AutoStaircase1.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" From 7caed3ca9b6422b39beb3415a269e8c1f721649d Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Mon, 25 Jan 2021 13:14:02 -0600 Subject: [PATCH 246/419] Added auto staircase --- Horion/Module/Modules/AutoStaircase.cpp | 124 ++++++++++++++++++++++++ Horion/Module/Modules/AutoStaircase1.h | 17 ++++ 2 files changed, 141 insertions(+) create mode 100644 Horion/Module/Modules/AutoStaircase.cpp create mode 100644 Horion/Module/Modules/AutoStaircase1.h diff --git a/Horion/Module/Modules/AutoStaircase.cpp b/Horion/Module/Modules/AutoStaircase.cpp new file mode 100644 index 00000000..5d1a3f00 --- /dev/null +++ b/Horion/Module/Modules/AutoStaircase.cpp @@ -0,0 +1,124 @@ +#include "AutoStaircase1.h" + +AutoStaircase::AutoStaircase() : IModule(0, Category::WORLD, "Builds a staircase going down when you walk.") { +} + +AutoStaircase::~AutoStaircase() { +} + +const char* AutoStaircase::getModuleName() { + return "Auto Staircase"; +} + + +//This module is a modified version of scaffold, made to place a block 1 and 2 blocks below the player to create a staircase that decends when the player walks. + + +//from scaffold: + +bool AutoStaircase::tryScaffold(vec3_t blockBelow) { + blockBelow = blockBelow.floor(); + + C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); + C_BlockLegacy* blockLegacy = (block->blockLegacy); + if (blockLegacy->material->isReplaceable) { + vec3_ti blok(blockBelow); + + // Find neighbour + static std::vector checklist; + if (checklist.empty()) { + checklist.push_back(new vec3_ti(0, -1, 0)); + checklist.push_back(new vec3_ti(0, 1, 0)); + + checklist.push_back(new vec3_ti(0, 0, -1)); + checklist.push_back(new vec3_ti(0, 0, 1)); + + checklist.push_back(new vec3_ti(-1, 0, 0)); + checklist.push_back(new vec3_ti(1, 0, 0)); + } + + bool foundCandidate = false; + int i = 0; + for (auto current : checklist) { + vec3_ti calc = blok.sub(*current); + bool Y = ((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable; + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + // Found a solid block to click + foundCandidate = true; + blok = calc; + break; + } + i++; + } + if (foundCandidate) { + if (spoof) findBlock(); + g_Data.getCGameMode()->buildBlock(&blok, i); + + return true; + } + } + return false; +} +//from scaffold: +bool AutoStaircase::findBlock() { + __int64 id = *g_Data.getLocalPlayer()->getUniqueId(); + C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); + C_Inventory* inv = supplies->inventory; + for (int n = 0; n < 9; n++) { + C_ItemStack* stack = inv->getItemStack(n); + if (stack->item != nullptr) { + if ((*stack->item)->isBlock() && (*stack->item)->itemId != 0) { + C_MobEquipmentPacket a(id, *stack, n, n); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); + return true; + } + } + } + C_MobEquipmentPacket a(id, *g_Data.getLocalPlayer()->getSelectedItem(), supplies->selectedHotbarSlot, supplies->selectedHotbarSlot); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); + return false; +} + +void AutoStaircase::onTick(C_GameMode* gm) { + + //from scaffold: + if (g_Data.getLocalPlayer() == nullptr) + return; + if (!g_Data.canUseMoveKeys()) + return; + + auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); + if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock()) && !spoof) // Block in hand? + return; + + vec3_t blockBelow = g_Data.getLocalPlayer()->eyePos0; // Block 1 block below the player + blockBelow.y -= g_Data.getLocalPlayer()->height; + blockBelow.y -= 1.5f; + vec3_t blockBelowBelow = g_Data.getLocalPlayer()->eyePos0; // Block 2 blocks below the player + blockBelowBelow.y -= g_Data.getLocalPlayer()->height; + blockBelowBelow.y -= 2.0f; + + // Adjustment by velocity + float speed = g_Data.getLocalPlayer()->velocity.magnitudexz(); + vec3_t vel = g_Data.getLocalPlayer()->velocity; + vel = vel.normalize(); // Only use values from 0 - 1 + + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { + if (speed > 0.05f) { // Are we actually walking? + blockBelow.z -= vel.z * 0.4f; + blockBelowBelow.z -= vel.z * 0.4f; + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { + blockBelow.x -= vel.x * 0.4f; + blockBelowBelow.x -= vel.x * 0.4f; + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow) && g_Data.getLocalPlayer()->isSprinting()) { + blockBelow.z += vel.z; + blockBelow.x += vel.x; + blockBelowBelow.z += vel.z; + blockBelowBelow.x += vel.x; + tryScaffold(blockBelow); + tryScaffold(blockBelowBelow); + } + } + } + } +} \ No newline at end of file diff --git a/Horion/Module/Modules/AutoStaircase1.h b/Horion/Module/Modules/AutoStaircase1.h new file mode 100644 index 00000000..e6be51da --- /dev/null +++ b/Horion/Module/Modules/AutoStaircase1.h @@ -0,0 +1,17 @@ +#pragma once +#include "Module.h" +class AutoStaircase : public IModule { +private: + //from scaffold: + bool spoof = false; + +public: + AutoStaircase(); + ~AutoStaircase(); + bool findBlock(); + bool tryScaffold(vec3_t blockBelow); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; +}; \ No newline at end of file From 144d0dbaad70ae045cbc4a9863899ddc533308d2 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Mon, 25 Jan 2021 13:48:30 -0600 Subject: [PATCH 247/419] revert test module to original --- Horion/Module/Modules/TestModule.cpp | 226 +++++++++++++++++++++++++-- Horion/Module/Modules/TestModule.h | 12 +- 2 files changed, 225 insertions(+), 13 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 4545c82b..938f1d87 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -1,10 +1,26 @@ #include "TestModule.h" #include "../../../Utils/Logger.h" +#include "../../../Utils/VoxelIntersector.h" +#include "../../DrawUtils.h" +#include "../../../SDK/MatrixStack.h" +#include +#include +#include +#include +#include //radians +#include // perspective, translate, rotate +#include +#include +#include +#include +#include +#include "../../../Utils/Json.hpp" +using json = nlohmann::json; TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { - registerFloatSetting("PlayerSize", &this->playersize, this->playersize, 0, 10); + registerFloatSetting("float1", &this->float1, 0, -10, 10); } TestModule::~TestModule() { @@ -14,18 +30,210 @@ const char* TestModule::getModuleName() { return "TestModule"; } -void TestModule::onTick(C_GameMode* gm) { - if (this->active) { - g_Data.getLocalPlayer()->setSize(this->playersize / 2, this->playersize); +bool TestModule::isFlashMode() { + return false; +} + + + +__forceinline unsigned __int64 rotBy(int in, unsigned int by) { + auto mut = static_cast(in); + return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; +} + +size_t posToHash(const vec3_ti& pos) { + return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); +} + +struct PosHasher { + size_t operator()(const vec3_ti& i) const { return posToHash(i); }; +}; + +std::unordered_set renderPos(8); + +void loadFile(std::wstring filePath) { + std::string contents = Utils::readFileContents(filePath); + if (contents.size() == 0) + return; + + logF("Starting geometry import"); + auto mesh = SkinUtil::objToMesh(contents.c_str(), false); + logF("Mesh created (verts: %i, uvs: %i, normals: %i, faces: %i)", mesh.vertices.size(), mesh.uvs.size(), mesh.normals.size(), mesh.faces.size()); + + auto posHasher2 = [](const vec3_ti& i) { return posToHash(i); }; + std::unordered_set newPoses(8); + int num = 0; + for (const auto& face : mesh.faces) { + + if (face.facesPresent != 3) { + //logF("wierd face %i", face.facesPresent); + continue; + } + + + const auto& v1 = mesh.vertices[face.indices[0].vertIndex]; + const auto& v2 = mesh.vertices[face.indices[1].vertIndex]; + const auto& v3 = mesh.vertices[face.indices[2].vertIndex]; + // intersect tris + Voxel::Triangle3 tri = {{v1[0], v1[1], v1[2]}, + {v2[0], v2[1], v2[2]}, + {v3[0], v3[1], v3[2]}}; + AABB bBox{}; + Voxel::getBoundingBox(bBox, tri); + bBox.lower.y = std::max(0.f, bBox.lower.y); + bBox.upper.y = std::min(255.f, bBox.upper.y); + + for (float x = floorf(bBox.lower.x); x < ceilf(bBox.upper.x); x++) { + for (float y = floorf(bBox.lower.y); y < ceilf(bBox.upper.y); y++) { + for (float z = floorf(bBox.lower.z); z < ceilf(bBox.upper.z); z++) { + vec3_t voxel(x, y, z); + if (!Voxel::intersects(voxel, tri)) + continue; + + newPoses.insert(vec3_ti((int)x, (int)y, (int)z)); + num++; + } + } + } } + + renderPos = newPoses; + logF("replaced renderPos with %i %i", renderPos.size(), num); } void TestModule::onEnable() { - this->ogsize = g_Data.getLocalPlayer()->height; - this->active = true; + renderPos.clear(); + + HorionDataPacket packet; + packet.cmd = CMD_FILECHOOSER; + auto tmp = std::shared_ptr(new unsigned char[300]); + packet.data.swap(tmp); + memset(packet.data.get(), 0, 300); + strcpy_s((char*)packet.data.get(), 200, "{\"title\": \"Select a 3d object\", \"filter\":\"Object Files (*.obj)|*.obj\"}"); + packet.dataArraySize = (int)strlen((char*)packet.data.get()); + packet.params[0] = g_Data.addInjectorResponseCallback([](std::shared_ptr pk) { + if (pk->params[0] != 1) { // Dialog Canceled, reset geo + auto box = g_Data.addInfoBox("File load", "No file loaded"); + box->closeTimer = 1; + return; + } + + wchar_t* jsonData = reinterpret_cast(pk->data.get()); + std::wstring jsonDataStr(jsonData); + + json parsed = json::parse(jsonDataStr); + if (parsed["path"].is_string()) { + auto box = g_Data.addInfoBox("Importing File", "Please wait..."); + std::thread gamer([parsed, box]() { + loadFile(Utils::stringToWstring(parsed["path"].get())); + box->fadeTarget = 0; + }); + gamer.detach(); + } + }); + + g_Data.sendPacketToInjector(packet); +} + +bool tryPlace(const vec3_ti& blockPos) { + C_Block* block = g_Data.getLocalPlayer()->region->getBlock(blockPos); + C_BlockLegacy* blockLegacy = block->toLegacy(); + if (blockLegacy->material->isReplaceable) { + + // Find neighbour + static std::vector checklist; + if (checklist.empty()) { + checklist.push_back(vec3_ti(0, -1, 0)); + checklist.push_back(vec3_ti(0, 1, 0)); + + checklist.push_back(vec3_ti(0, 0, -1)); + checklist.push_back(vec3_ti(0, 0, 1)); + + checklist.push_back(vec3_ti(-1, 0, 0)); + checklist.push_back(vec3_ti(1, 0, 0)); + } + + bool foundCandidate = false; + int i = 0; + for (const auto& current : checklist) { + + vec3_ti calc = blockPos.sub(current); + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + // Found a solid block to click + g_Data.getCGameMode()->buildBlock(&calc, i); + + return true; + break; + } + i++; + } + } + return false; +} + +void TestModule::onTick(C_GameMode* gm) { + if (g_Data.getLocalPlayer() == nullptr) + return; + if (!g_Data.canUseMoveKeys()) + return; + if (renderPos.size() == 0) + return; + + auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); + if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock())) // Block in hand? + return; + + int radius = 4; + int numBlocksPerTick = 1; + for (int x = -radius; x < radius; x++) { + for (int y = -radius; y < radius; y++) { + for (int z = -radius; z < radius; z++) { + auto pos = g_Data.getLocalPlayer()->eyePos0.add((float)x, (float)y, (float)z).floor(); + if (renderPos.count(pos) == 0) + continue; + if (tryPlace(pos) && --numBlocksPerTick == 0) + return; + } + } + + } +} + +void TestModule::onMove(C_MoveInputHandler* hand){ + +} + +void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { + DrawUtils::setColor(0.3f, 0.3f, 0.7f, 1); + +} + +void TestModule::onSendPacket(C_Packet* p) { + } void TestModule::onDisable() { - this->active = false; - g_Data.getLocalPlayer()->setSize(this->ogsize / 2, this->ogsize); -} \ No newline at end of file + +} +float t = 0; +void TestModule::onLevelRender() { + + DrawUtils::setColor(0.8f, 0.4f, 0.4f, 1); + int radius = 50; + + const auto origin = g_Data.getLocalPlayer()->eyePos0.floor(); + for (auto pos : renderPos) { + if (fabsf(pos.x - origin.x) > radius) + continue; + if (fabsf(pos.z - origin.z) > radius) + continue; + if (fabsf(pos.y - origin.y) > radius) + continue; + C_Block* block = g_Data.getLocalPlayer()->region->getBlock(pos); + C_BlockLegacy* blockLegacy = block->toLegacy(); + if (!blockLegacy->material->isReplaceable) + continue; + DrawUtils::drawBox3d(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector()); + } + +} diff --git a/Horion/Module/Modules/TestModule.h b/Horion/Module/Modules/TestModule.h index 0fd0fc2f..1e11b6f4 100644 --- a/Horion/Module/Modules/TestModule.h +++ b/Horion/Module/Modules/TestModule.h @@ -2,18 +2,22 @@ #include "Module.h" class TestModule : public IModule { private: - float playersize = 1; - bool active = false; - float ogsize = 0; + int delay = 0; public: - + float float1 = 0; + TestModule(); ~TestModule(); // Inherited via IModule virtual const char* getModuleName() override; + virtual bool isFlashMode() override; virtual void onEnable() override; virtual void onTick(C_GameMode* gm) override; + virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onSendPacket(C_Packet* p) override; + virtual void onMove(C_MoveInputHandler* hand) override; virtual void onDisable() override; + void onLevelRender() override; }; From 2de92ce8a8b9e80c2b3e4f25e1cdf957d8151f74 Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:36:34 -0800 Subject: [PATCH 248/419] Fix fullbright With permission from the Helix Dev Team, I am using their signature. --- Memory/Hooks.cpp | 56 +++++++----------------------------------------- Memory/Hooks.h | 2 +- 2 files changed, 9 insertions(+), 49 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index c00940b1..2ddb1e0d 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -238,8 +238,8 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - //void* fullbright = reinterpret_cast(FindSignature("40 57 48 83 EC ?? 48 C7 44 24 ?? ? ?? ? ?? 48 89 5C 24 ?? 48 89 74 24 ?? 48 8B 05 ?? ? ?? ? 48 33 C4 48 89 44 24 ?? 33 C0 48 89 44 24 ?? 48 89 44 24 ?? 48 8B 01 48 8D 54 24 ?? FF 90")); - //g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); + void* fullbright = reinterpret_cast(FindSignature("48 83 EC 28 80 B9 ?? ?? ?? ?? 00 48 8D 54 24 30 74 36 41 B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 10 48 85 D2 74 3C 48 8B 8A ?? ?? ?? ?? 48 85 C9 74 0A E8 ?? ?? ?? ?? 48 83 C4 28 C3")); + g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); // Mob::_jumpFromGround void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); @@ -1346,54 +1346,14 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { return oFunc(a1); } -__int64 Hooks::GetGamma(__int64 a1) { - static auto oFunc = g_Hooks.GetGammaHook->GetFastcall<__int64, __int64>(); - +float Hooks::GetGamma(uintptr_t* a1) { static auto fullBrightModule = moduleMgr->getModule(); + if (fullBrightModule->isEnabled()) + return 25.f; - struct Option { - void* vtable; - char filler[0x20]; // 0x008 - TextHolder internalName; // 0x0028 - TextHolder friendlyName; // 0x0048 // only exists when the value is present in the options - int optionId; // 0x68 - char filler2[0xC]; // 0x6C - TextHolder nameInConfigFile; // 0x78 - char filler3[0x50]; // 0x098 - union { - struct { - float min; - float max; - float value; - float defaultValue; - } _float; - bool _bool; - } value; - }; - - static Option* gfx_gamma = 0; - if (gfx_gamma == 0) { - __int64 v6 = oFunc(a1); // Calls to ClientInstance, returns options ptr - - static int numOptions = (*reinterpret_cast(FindSignature("49 8D B6 ?? ?? ?? ?? 48 3B FE") + 3) - 16) / 8; - - //logF("%llX", v6); - //logF("Num Options: %i", numOptions); - - for (int i = 0; i < numOptions; i++) { - Option* ptr = *reinterpret_cast(v6 + 0x10 + i * 8); - //if (ptr) - // logF("%llX %s %s", v6 + 0x10 + i * 8, ptr->internalName.getText(), ptr->friendlyName.getText()); - if (ptr && strcmp(ptr->internalName.getText(), "gfx_gamma") == 0) { - gfx_gamma = ptr; - //logF("%llX %s %s %llX", v6 + 0x10 + i * 8, ptr->internalName.getText(), ptr->friendlyName.getText(), &ptr->value); - } - } - } - if (gfx_gamma) - fullBrightModule->gammaPtr = &gfx_gamma->value._float.value; - - return oFunc(a1); + //Get the normal gamma value + float* gamer = (float*)*(a1 + 0x27); + return *(gamer + 0x7A); } bool Hooks::Actor_isInWater(C_Entity* _this) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index fcaa65bb..177b1a62 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -98,7 +98,7 @@ class Hooks { static void ClickFunc(__int64 a1, char a2, char a3, __int16 a4, __int16 a5, __int16 a6, __int16 a7, char a8); static __int64 MoveInputHandler_tick(C_MoveInputHandler* _this, C_Entity* a2); static __int64 ChestScreenController_tick(C_ChestScreenController* _this); - static __int64 GetGamma(__int64 a1); + static float GetGamma(uintptr_t* a1); static bool Actor_isInWater(C_Entity* _this); static void JumpPower(C_Entity* _this, float a2); static __int64 MinecraftGame_onAppSuspended(__int64 _this); From 312dd437b11b3e1fa0804822142ee7a5087a036d Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 26 Jan 2021 17:46:36 -0500 Subject: [PATCH 249/419] Dupe --- Horion/Command/Commands/DupeCommand.cpp | 46 +++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index 0d74d37a..1e102ebc 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -1,12 +1,54 @@ #include "DupeCommand.h" -DupeCommand::DupeCommand() : IMCCommand("dupe", "Duplicates the item in hand", "") { +DupeCommand::DupeCommand() : IMCCommand("dupe", "Duplicates the item in hand", " ") { } DupeCommand::~DupeCommand() { } bool DupeCommand::execute(std::vector* args) { + C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); + C_Inventory* inv = supplies->inventory; + auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); + + int selectedSlot = supplies->selectedHotbarSlot; + C_ItemStack* item = inv->getItemStack(selectedSlot); + + int count = item->count; + bool isGive = true; + + if (args->size() > 1) + item->count = assertInt(args->at(1)); + if (args->size() > 2) + isGive = static_cast(assertInt(args->at(2))); + + if (isGive) { + int slot = inv->getFirstEmptySlot(); + + C_InventoryAction* firstAction = nullptr; + C_InventoryAction* secondAction = nullptr; + + firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); + secondAction = new C_InventoryAction(slot, nullptr, item); + + transactionManager->addInventoryAction(*firstAction); + transactionManager->addInventoryAction(*secondAction); + + inv->addItemToFirstEmptySlot(item); + } else + g_Data.getLocalPlayer()->setOffhandSlot(item); + + if (args->size() > 1) + item->count = count; + + clientMessageF("%sSuccessfully duplicated the item!", GREEN); + return true; +} + + + +//Outdated Nukit Dupe +/*bool DupeCommand::execute(std::vector* args) { C_LocalPlayer* player = g_Data.getLocalPlayer(); auto supplies = g_Data.getLocalPlayer()->getSupplies(); @@ -56,4 +98,4 @@ bool DupeCommand::execute(std::vector* args) { g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); clientMessageF("%sSuccessfully duplicated item! (%i times)", GREEN, numActions / 2); return true; -} +}*/ \ No newline at end of file From a2dce97b774ca3e1dd0cecb3e29832b3ddc9d84d Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 26 Jan 2021 17:47:32 -0500 Subject: [PATCH 250/419] raknet fix also fixes enchant on realms --- SDK/CRakNetInstance.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SDK/CRakNetInstance.h b/SDK/CRakNetInstance.h index b65989d1..7e0fbf1b 100644 --- a/SDK/CRakNetInstance.h +++ b/SDK/CRakNetInstance.h @@ -1,12 +1,13 @@ #pragma once class C_RakNetInstance { -private: - char pad_0x0008[0x368]; //0x0000 + char pad_0000[856]; //0x0000 public: - TextHolder serverIp; //0x370 + TextHolder numericalIp; //0x0360 + TextHolder serverIp; //0x0380 + uint32_t serverPort; //0x03A0 -private: + private: virtual ~C_RakNetInstance(); virtual __int64 onAppResumed(void); virtual __int64 onAppSuspended(void); @@ -39,4 +40,9 @@ class C_RakNetInstance { virtual __int64 getIPv4Port(void) const; virtual __int64 getIPv6Port(void) const; virtual __int64 getGUID(void) const; -}; + +public: + bool isonaServer() { return !(serverIp.textLength == 0); } + +}; //Size: 0x0848 + From 1fdc648acad29e451eebc1dad8dc373375567d4e Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 26 Jan 2021 17:48:12 -0500 Subject: [PATCH 251/419] yes --- Horion/Command/Commands/ServerCommand.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Horion/Command/Commands/ServerCommand.cpp b/Horion/Command/Commands/ServerCommand.cpp index 900eac30..94d4ca72 100644 --- a/Horion/Command/Commands/ServerCommand.cpp +++ b/Horion/Command/Commands/ServerCommand.cpp @@ -9,8 +9,9 @@ ServerCommand::~ServerCommand() { bool ServerCommand::execute(std::vector* args) { assertTrue(g_Data.getLocalPlayer() != nullptr); - if (!(g_Data.getRakNetInstance()->serverIp.getTextLength() < 1)) - clientMessageF("You're currently playing on:\nIP: %s\nPort: %s", g_Data.getRakNetInstance()->serverIp.getText(), std::to_string(g_Data.getRakNetInstance()->getPort()).c_str()); + + if (g_Data.getRakNetInstance()->isonaServer()) + clientMessageF("You're currently playing on:\nIP: %s\nPort: %s", g_Data.getRakNetInstance()->serverIp.getText(), std::to_string(g_Data.getRakNetInstance()->serverPort).c_str()); else clientMessageF("%sYou're not playing on a server.", RED); return true; From 22ab9f1020c63e4b4037c2116999b606419a281f Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:38:18 -0600 Subject: [PATCH 252/419] Update Tornado.cpp --- Horion/Module/Modules/Tornado.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Tornado.cpp b/Horion/Module/Modules/Tornado.cpp index 70051495..77297467 100644 --- a/Horion/Module/Modules/Tornado.cpp +++ b/Horion/Module/Modules/Tornado.cpp @@ -20,7 +20,7 @@ void Tornado::onTick(C_GameMode* gm) { } else if (player->onGround) { player->setDamageNearbyMobs(false); } - } else if (!onlyJump) { + } else { player->setDamageNearbyMobs(true); } -} \ No newline at end of file +} From 1f5a9d69a45b2ee5a2da8fe4415daf71961c61a7 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:50:10 -0600 Subject: [PATCH 253/419] Update Horion.vcxproj --- Horion.vcxproj | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 646dd9d7..ba33925c 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -287,7 +287,6 @@ - @@ -317,7 +316,6 @@ - @@ -359,7 +357,6 @@ - @@ -475,7 +472,6 @@ - @@ -505,7 +501,6 @@ - @@ -547,7 +542,6 @@ - @@ -655,4 +649,4 @@ - \ No newline at end of file + From 30423dedab6cfab126a1e0b90d36f7543531d598 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:52:30 -0600 Subject: [PATCH 254/419] Update ModuleManager.h --- Horion/Module/ModuleManager.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 9d4c53d0..4b397d70 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -94,9 +94,6 @@ #include "Modules/Compass.h" #include "Modules/Radar.h" #include "Modules/VanillaPlus.h" -#include "Modules/Tornado1.h" -#include "Modules/HitboxSize1.h" -#include "Modules/AutoStaircase1.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" From 03ab39d608a71f344d94a5f429ccacd44de96c61 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:52:46 -0600 Subject: [PATCH 255/419] Update ModuleManager.cpp --- Horion/Module/ModuleManager.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 3e0c55c7..683207a1 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -103,9 +103,6 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new VanillaPlus())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); - this->moduleList.push_back(std::shared_ptr(new Tornado())); - this->moduleList.push_back(std::shared_ptr(new HitboxSize())); - this->moduleList.push_back(std::shared_ptr(new AutoStaircase())); #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); From 4f4e31f2e6ad3fda3057c401ea099655179169bb Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:52:57 -0600 Subject: [PATCH 256/419] Delete AutoStaircase1.h --- Horion/Module/Modules/AutoStaircase1.h | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 Horion/Module/Modules/AutoStaircase1.h diff --git a/Horion/Module/Modules/AutoStaircase1.h b/Horion/Module/Modules/AutoStaircase1.h deleted file mode 100644 index e6be51da..00000000 --- a/Horion/Module/Modules/AutoStaircase1.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "Module.h" -class AutoStaircase : public IModule { -private: - //from scaffold: - bool spoof = false; - -public: - AutoStaircase(); - ~AutoStaircase(); - bool findBlock(); - bool tryScaffold(vec3_t blockBelow); - - // Inherited via IModule - virtual const char* getModuleName() override; - virtual void onTick(C_GameMode* gm) override; -}; \ No newline at end of file From c0ee45df1b632a98be983c3a292ee58c814ca1d7 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:53:21 -0600 Subject: [PATCH 257/419] Delete AutoStaircase.cpp --- Horion/Module/Modules/AutoStaircase.cpp | 124 ------------------------ 1 file changed, 124 deletions(-) delete mode 100644 Horion/Module/Modules/AutoStaircase.cpp diff --git a/Horion/Module/Modules/AutoStaircase.cpp b/Horion/Module/Modules/AutoStaircase.cpp deleted file mode 100644 index 5d1a3f00..00000000 --- a/Horion/Module/Modules/AutoStaircase.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include "AutoStaircase1.h" - -AutoStaircase::AutoStaircase() : IModule(0, Category::WORLD, "Builds a staircase going down when you walk.") { -} - -AutoStaircase::~AutoStaircase() { -} - -const char* AutoStaircase::getModuleName() { - return "Auto Staircase"; -} - - -//This module is a modified version of scaffold, made to place a block 1 and 2 blocks below the player to create a staircase that decends when the player walks. - - -//from scaffold: - -bool AutoStaircase::tryScaffold(vec3_t blockBelow) { - blockBelow = blockBelow.floor(); - - C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); - C_BlockLegacy* blockLegacy = (block->blockLegacy); - if (blockLegacy->material->isReplaceable) { - vec3_ti blok(blockBelow); - - // Find neighbour - static std::vector checklist; - if (checklist.empty()) { - checklist.push_back(new vec3_ti(0, -1, 0)); - checklist.push_back(new vec3_ti(0, 1, 0)); - - checklist.push_back(new vec3_ti(0, 0, -1)); - checklist.push_back(new vec3_ti(0, 0, 1)); - - checklist.push_back(new vec3_ti(-1, 0, 0)); - checklist.push_back(new vec3_ti(1, 0, 0)); - } - - bool foundCandidate = false; - int i = 0; - for (auto current : checklist) { - vec3_ti calc = blok.sub(*current); - bool Y = ((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable; - if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { - // Found a solid block to click - foundCandidate = true; - blok = calc; - break; - } - i++; - } - if (foundCandidate) { - if (spoof) findBlock(); - g_Data.getCGameMode()->buildBlock(&blok, i); - - return true; - } - } - return false; -} -//from scaffold: -bool AutoStaircase::findBlock() { - __int64 id = *g_Data.getLocalPlayer()->getUniqueId(); - C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); - C_Inventory* inv = supplies->inventory; - for (int n = 0; n < 9; n++) { - C_ItemStack* stack = inv->getItemStack(n); - if (stack->item != nullptr) { - if ((*stack->item)->isBlock() && (*stack->item)->itemId != 0) { - C_MobEquipmentPacket a(id, *stack, n, n); - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); - return true; - } - } - } - C_MobEquipmentPacket a(id, *g_Data.getLocalPlayer()->getSelectedItem(), supplies->selectedHotbarSlot, supplies->selectedHotbarSlot); - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); - return false; -} - -void AutoStaircase::onTick(C_GameMode* gm) { - - //from scaffold: - if (g_Data.getLocalPlayer() == nullptr) - return; - if (!g_Data.canUseMoveKeys()) - return; - - auto selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock()) && !spoof) // Block in hand? - return; - - vec3_t blockBelow = g_Data.getLocalPlayer()->eyePos0; // Block 1 block below the player - blockBelow.y -= g_Data.getLocalPlayer()->height; - blockBelow.y -= 1.5f; - vec3_t blockBelowBelow = g_Data.getLocalPlayer()->eyePos0; // Block 2 blocks below the player - blockBelowBelow.y -= g_Data.getLocalPlayer()->height; - blockBelowBelow.y -= 2.0f; - - // Adjustment by velocity - float speed = g_Data.getLocalPlayer()->velocity.magnitudexz(); - vec3_t vel = g_Data.getLocalPlayer()->velocity; - vel = vel.normalize(); // Only use values from 0 - 1 - - if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { - if (speed > 0.05f) { // Are we actually walking? - blockBelow.z -= vel.z * 0.4f; - blockBelowBelow.z -= vel.z * 0.4f; - if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { - blockBelow.x -= vel.x * 0.4f; - blockBelowBelow.x -= vel.x * 0.4f; - if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow) && g_Data.getLocalPlayer()->isSprinting()) { - blockBelow.z += vel.z; - blockBelow.x += vel.x; - blockBelowBelow.z += vel.z; - blockBelowBelow.x += vel.x; - tryScaffold(blockBelow); - tryScaffold(blockBelowBelow); - } - } - } - } -} \ No newline at end of file From f46f3cc45c6a20172c631e687e53c76b16ef20bd Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:54:45 -0600 Subject: [PATCH 258/419] Delete Tornado.cpp --- Horion/Module/Modules/Tornado.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 Horion/Module/Modules/Tornado.cpp diff --git a/Horion/Module/Modules/Tornado.cpp b/Horion/Module/Modules/Tornado.cpp deleted file mode 100644 index 77297467..00000000 --- a/Horion/Module/Modules/Tornado.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "Tornado1.h" - -Tornado::Tornado() : IModule(0, Category::COMBAT, "Makes you small and damage entities you run into when you jump.") { - registerBoolSetting("Only While Jumping", &this->onlyjump, this->onlyjump); -} -Tornado::~Tornado() { -} - -const char* Tornado::getModuleName() { - return "Tornado"; -} - -void Tornado::onTick(C_GameMode* gm) { - auto player = g_Data.getLocalPlayer(); - bool onlyJump = this->onlyjump; - - if (onlyJump) { - if (player->isJumping()) { - player->setDamageNearbyMobs(true); - } else if (player->onGround) { - player->setDamageNearbyMobs(false); - } - } else { - player->setDamageNearbyMobs(true); - } -} From d2fd29b48cdda6ce0727222d5cf50d78eb32dbcc Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:54:55 -0600 Subject: [PATCH 259/419] Delete Tornado1.h --- Horion/Module/Modules/Tornado1.h | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Horion/Module/Modules/Tornado1.h diff --git a/Horion/Module/Modules/Tornado1.h b/Horion/Module/Modules/Tornado1.h deleted file mode 100644 index b2b8976d..00000000 --- a/Horion/Module/Modules/Tornado1.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#include "Module.h" - -class Tornado : public IModule { -private: - bool onlyjump = true; - -public: - Tornado(); - ~Tornado(); - - virtual const char* getModuleName() override; - virtual void onTick(C_GameMode* gm) override; -}; \ No newline at end of file From cd1169453de3b332a0be7383b6f841b38e9fc881 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:55:34 -0600 Subject: [PATCH 260/419] Delete HitboxSize.cpp --- Horion/Module/Modules/HitboxSize.cpp | 30 ---------------------------- 1 file changed, 30 deletions(-) delete mode 100644 Horion/Module/Modules/HitboxSize.cpp diff --git a/Horion/Module/Modules/HitboxSize.cpp b/Horion/Module/Modules/HitboxSize.cpp deleted file mode 100644 index a0e91efc..00000000 --- a/Horion/Module/Modules/HitboxSize.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "HitboxSize1.h" - -HitboxSize::HitboxSize() : IModule(0, Category::PLAYER, "Modifies your hitbox size so you can fit in very tiny holess.") { - registerFloatSetting("Width", &this->width, this->height, 0, 10); - registerFloatSetting("Height", &this->height, this->height, 0, 10); -} - -HitboxSize::~HitboxSize() { -} - -const char* HitboxSize::getModuleName() { - return "Player Hitbox"; -} - -void HitboxSize::onTick(C_GameMode* gm) { - if (this->active) { - g_Data.getLocalPlayer()->setSize(this->width, this->height); - } -} - -void HitboxSize::onEnable() { - this->ogheight = g_Data.getLocalPlayer()->height; - this->ogwidth = g_Data.getLocalPlayer()->width; - this->active = true; -} - -void HitboxSize::onDisable() { - this->active = false; - g_Data.getLocalPlayer()->setSize(this->ogwidth, this->ogheight); -} \ No newline at end of file From 520fcb4c5efb1d7556cb167bd8dee9fb895f2b04 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:55:44 -0600 Subject: [PATCH 261/419] Delete HitboxSize1.h --- Horion/Module/Modules/HitboxSize1.h | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 Horion/Module/Modules/HitboxSize1.h diff --git a/Horion/Module/Modules/HitboxSize1.h b/Horion/Module/Modules/HitboxSize1.h deleted file mode 100644 index 7abb81a1..00000000 --- a/Horion/Module/Modules/HitboxSize1.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "Module.h" -class HitboxSize : public IModule { -private: - float width = 0.5; - float height = 0.5; - bool active = false; - float ogwidth; - float ogheight; - -public: - HitboxSize(); - ~HitboxSize(); - - // Inherited via IModule - virtual const char* getModuleName() override; - virtual void onEnable() override; - virtual void onTick(C_GameMode* gm) override; - virtual void onDisable() override; -}; \ No newline at end of file From e52ffd28fa4b84e27282933ab71356cc0e2837f6 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Wed, 27 Jan 2021 20:15:25 -0600 Subject: [PATCH 262/419] added staircase mode to scaffold --- Horion/Module/Modules/Scaffold.cpp | 58 +++++++++++++++++++++++------- Horion/Module/Modules/Scaffold.h | 1 + 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index 8d884d1b..852d6f4a 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -4,6 +4,7 @@ Scaffold::Scaffold() : IModule(VK_NUMPAD1, Category::WORLD, "Automatically build blocks beneath you") { registerBoolSetting("Spoof", &this->spoof, this->spoof); + registerBoolSetting("Staircase Mode", &this->staircaseMode, this->staircaseMode); } Scaffold::~Scaffold() { @@ -86,24 +87,57 @@ void Scaffold::onTick(C_GameMode* gm) { if ((selectedItem == nullptr || selectedItem->count == 0 || selectedItem->item == nullptr || !selectedItem->getItem()->isBlock()) && !spoof) // Block in hand? return; - vec3_t blockBelow = g_Data.getLocalPlayer()->eyePos0; // Block below the player - blockBelow.y -= g_Data.getLocalPlayer()->height; - blockBelow.y -= 0.5f; // Adjustment by velocity float speed = g_Data.getLocalPlayer()->velocity.magnitudexz(); vec3_t vel = g_Data.getLocalPlayer()->velocity; vel = vel.normalize(); // Only use values from 0 - 1 - if (!tryScaffold(blockBelow)) { - if (speed > 0.05f) { // Are we actually walking? - blockBelow.z -= vel.z * 0.4f; - if (!tryScaffold(blockBelow)) { - blockBelow.x -= vel.x * 0.4f; - if (!tryScaffold(blockBelow) && g_Data.getLocalPlayer()->isSprinting()) { - blockBelow.z += vel.z; - blockBelow.x += vel.x; - tryScaffold(blockBelow); + + + + if (this->staircaseMode) { + vec3_t blockBelow = g_Data.getLocalPlayer()->eyePos0; // Block 1 block below the player + blockBelow.y -= g_Data.getLocalPlayer()->height; + blockBelow.y -= 1.5f; + + vec3_t blockBelowBelow = g_Data.getLocalPlayer()->eyePos0; // Block 2 blocks below the player + blockBelowBelow.y -= g_Data.getLocalPlayer()->height; + blockBelowBelow.y -= 2.0f; + + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { + if (speed > 0.05f) { // Are we actually walking? + blockBelow.z -= vel.z * 0.4f; + blockBelowBelow.z -= vel.z * 0.4f; + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow)) { + blockBelow.x -= vel.x * 0.4f; + blockBelowBelow.x -= vel.x * 0.4f; + if (!tryScaffold(blockBelow) && !tryScaffold(blockBelowBelow) && g_Data.getLocalPlayer()->isSprinting()) { + blockBelow.z += vel.z; + blockBelow.x += vel.x; + blockBelowBelow.z += vel.z; + blockBelowBelow.x += vel.x; + tryScaffold(blockBelow); + tryScaffold(blockBelowBelow); + } + } + } + } + } else { + vec3_t blockBelow = g_Data.getLocalPlayer()->eyePos0; // Block below the player + blockBelow.y -= g_Data.getLocalPlayer()->height; + blockBelow.y -= 0.5f; + + if (!tryScaffold(blockBelow)) { + if (speed > 0.05f) { // Are we actually walking? + blockBelow.z -= vel.z * 0.4f; + if (!tryScaffold(blockBelow)) { + blockBelow.x -= vel.x * 0.4f; + if (!tryScaffold(blockBelow) && g_Data.getLocalPlayer()->isSprinting()) { + blockBelow.z += vel.z; + blockBelow.x += vel.x; + tryScaffold(blockBelow); + } } } } diff --git a/Horion/Module/Modules/Scaffold.h b/Horion/Module/Modules/Scaffold.h index 1b18c1e5..57866bf3 100644 --- a/Horion/Module/Modules/Scaffold.h +++ b/Horion/Module/Modules/Scaffold.h @@ -3,6 +3,7 @@ class Scaffold : public IModule { private: bool spoof = false; + bool staircaseMode = false; bool tryScaffold(vec3_t blockBelow); bool findBlock(); From 8046040106a67d22f2061aca3ab09f77cb6195a3 Mon Sep 17 00:00:00 2001 From: Not Existing <61290107+N0tExisting@users.noreply.github.com> Date: Thu, 11 Feb 2021 22:28:04 +0100 Subject: [PATCH 263/419] Better crystal aura (#4366) untested code * Added Better CrystalAura * Last Minute Fix Why do i always forget this * Improved Crystal Aura * Added Preview & stuff * Fix fixed crash when exiting worlds fixed usage of wrong constructor(hopefuly) --- Horion/Module/Modules/CrystalAura.cpp | 204 ++++++++++++++++++++++---- Horion/Module/Modules/CrystalAura.h | 23 ++- 2 files changed, 194 insertions(+), 33 deletions(-) diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index ba65adb8..ea0e0e55 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -1,60 +1,204 @@ #include "CrystalAura.h" CrystalAura::CrystalAura() : IModule(VK_NUMPAD0, Category::COMBAT, "Destroys nearby Crystals") { - registerIntSetting("range", &range, range, 1, 10); - registerBoolSetting("autoplace", &autoplace, autoplace); + registerIntSetting("Range", &this->range, this->range, 1, 10); + registerIntSetting("Crystal range", &this->cRange, this->cRange, 1, 15); + registerIntSetting("Place range", &this->eRange, this->eRange, 1, 5); + registerIntSetting("Player range", &this->pRange, this->pRange, 1, 10); + registerBoolSetting("Auto select", &this->AutoSelect, this->AutoSelect); + registerBoolSetting("Autoplace", &this->autoplace, this->autoplace); + registerBoolSetting("Enhance place", &this->pEnhanced, this->pEnhanced); + registerBoolSetting("Enhance destroy", &this->dEnhanced, this->dEnhanced); + registerBoolSetting("preview", &this->Preview, this->Preview); + delay = 0; } - CrystalAura::~CrystalAura() { } - const char* CrystalAura::getModuleName() { return ("CrystalAura"); } +static std::vector targetList; + void CrystalAura::onEnable() { + targetList.clear(); this->delay = 0; } -void CrystalAura::onTick(C_GameMode* gm) { - - this->delay++; - if (this->delay >= 5) { - this->delay = 0; +bool CfindEntity(C_Entity* curEnt, bool isRegularEntity) { + if (curEnt == nullptr) return false; + if (curEnt == g_Data.getLocalPlayer()) return false; // Skip Local player + if (!curEnt->isAlive()) return false; + if (!g_Data.getLocalPlayer()->isAlive()) return false; + if (curEnt->getEntityTypeId() == 71) return false; // endcrystal + if (curEnt->getEntityTypeId() == 66) return false; // falling block + if (curEnt->getEntityTypeId() == 64) return false; // item + if (curEnt->getEntityTypeId() == 69) return false; // xp orb + if (!Target::isValidTarget(curEnt)) return false; + + float dist = (*curEnt->getPos()).dist(*g_Data.getLocalPlayer()->getPos()); + if (dist <= moduleMgr->getModule()->pRange) { + targetList.push_back(curEnt); + return true; + } + return false; +} - if (autoplace) { - vec3_t* pos = gm->player->getPos(); - for (int x = (int)pos->x - range; x < pos->x + range; x++) { - for (int z = (int)pos->z - range; z < pos->z + range; z++) { - for (int y = (int)pos->y - range; y < pos->y + range; y++) { - vec3_ti blockPos = vec3_ti(x, y, z); - vec3_ti upperBlockPos = vec3_ti(x, y + 1, z); - C_Block* block = gm->player->region->getBlock(blockPos); - C_Block* upperBlock = gm->player->region->getBlock(upperBlockPos); - if (block != nullptr) { - int blockId = block->toLegacy()->blockId; - int upperBlockId = upperBlock->toLegacy()->blockId; - if ((blockId == 49 || blockId == 7) && upperBlockId == 0) { - gm->buildBlock(&blockPos, 0); - } +bool space = true; +vec3_t _pos; +bool CanPlaceC(vec3_ti* pos) { + space = true; + _pos = pos->toVec3t(); + g_Data.forEachEntity([](C_Entity* ent, bool b) { + if (!space) + return; + if (ent->aabb.intersects(AABB(_pos, _pos.add(1.f)))) + space = false; + }); + return space; +} + +void CrystalAura::CPlace(C_GameMode* gm, vec3_t* pos) { + if (!pEnhanced) { +#pragma warning(push) +#pragma warning(disable : 4244) + vec3_ti blockPos = vec3_ti(pos->x, pos->y, pos->z); + vec3_ti upperBlockPos = vec3_ti(pos->x, pos->y + 1, pos->z); +#pragma warning(pop) + C_Block* block = gm->player->region->getBlock(blockPos); + C_Block* upperBlock = gm->player->region->getBlock(upperBlockPos); + gm->buildBlock(&blockPos, g_Data.getClientInstance()->getPointerStruct()->blockSide); + return; + } + vec3_ti bestPos; + bool ValidPos = false; + for (int x = (int)pos->x - eRange; x < pos->x + eRange; x++) { + for (int z = (int)pos->z - eRange; z < pos->z + eRange; z++) { + for (int y = (int)pos->y - eRange; y < pos->y + eRange; y++) { + vec3_ti blockPos = vec3_ti(x, y, z); + vec3_ti upperBlockPos = vec3_ti(x, y + 1, z); + C_Block* block = gm->player->region->getBlock(blockPos); + C_Block* upperBlock = gm->player->region->getBlock(upperBlockPos); + if (block != nullptr) { + int blockId = block->toLegacy()->blockId; + int upperBlockId = upperBlock->toLegacy()->blockId; + if ((blockId == 49 || blockId == 7) && upperBlockId == 0 && CanPlaceC(&blockPos)) { //Check for awailable block + if (!ValidPos) { + ValidPos = true; + bestPos = blockPos; + } else if (blockPos.toVec3t().dist(*pos) < bestPos.toVec3t().dist(*pos)) { + bestPos = blockPos; } } } } } + } + if (ValidPos) + gm->buildBlock(&bestPos, 0); +} - g_Data.forEachEntity([](C_Entity* ent, bool b) { - int id = ent->getEntityTypeId(); - int range = moduleMgr->getModule()->range; - if (id == 71 && g_Data.getLocalPlayer()->getPos()->dist(*ent->getPos()) <= range) { +void CrystalAura::DestroyC(C_Entity* ent, int range) { + if (g_Data.getLocalPlayer()->getPos()->dist(*ent->getPos()) < range && !dEnhanced) { + g_Data.getCGameMode()->attack(ent); + if (!moduleMgr->getModule()->isEnabled()) + g_Data.getLocalPlayer()->swingArm(); + } else if (dEnhanced) { + for (auto& i : targetList) + if (ent->getPos()->dist(*i->getPos()) < range) { g_Data.getCGameMode()->attack(ent); - if (!moduleMgr->getModule()->isEnabled()) + if (!moduleMgr->getModule()->isEnabled()) g_Data.getLocalPlayer()->swingArm(); + return; } + } +} + +bool shouldChange = false; +void CrystalAura::onTick(C_GameMode* gm) { + if (shouldChange) { + shouldChange = false; + } + this->delay++; + if (supplies == nullptr) + supplies = g_Data.getLocalPlayer()->getSupplies(); + if (inv == nullptr) + inv = supplies->inventory; + targetList.clear(); + g_Data.forEachEntity(CfindEntity); + if (this->delay == 0) { + // place block around players? + return; + } + if (this->delay == 1 && AutoSelect) { + prevSlot = supplies->selectedHotbarSlot; + FinishSelect = true; + for (int n = 0; n < 9; n++) { + C_ItemStack* stack = inv->getItemStack(n); + if (stack->item != nullptr) { + if (stack->getItem()->itemId == 0x1aa) { + supplies->selectedHotbarSlot = n; + return; + } + } + } + return; + } + if (this->delay == 2) { + if (autoplace && g_Data.getLocalPlayer()->getSelectedItemId() == 0x1aa) { //endcrystal + if (pEnhanced) + for (auto& i : targetList) + CPlace(gm, i->getPos()); + else { + auto ptr = g_Data.getClientInstance()->getPointerStruct(); + if (ptr->entityPtr == nullptr && ptr->rayHitType == 0) + CPlace(gm, &ptr->block.toFloatVector()); + } + } + return; + } + if (this->delay == 3 && FinishSelect) { + supplies->selectedHotbarSlot = prevSlot; + FinishSelect = false; + return; + } + if (this->delay == 4) { + g_Data.forEachEntity([](C_Entity* ent, bool b) { + if (ent->getEntityTypeId() != 71) + return; + int range; + if (moduleMgr->getModule()->dEnhanced) + range = moduleMgr->getModule()->cRange; + else + range = moduleMgr->getModule()->range; + moduleMgr->getModule()->DestroyC(ent, range); }); + return; + } + if (this->delay >= 5) { + this->delay = 0; + return; } } +void CrystalAura::onPreRender(C_MinecraftUIRenderContext* renderCtx) { + if (!Preview || (!pEnhanced && autoplace) || + g_Data.getClientInstance() == nullptr || + g_Data.getPtrLocalPlayer() == nullptr || + g_Data.getLocalPlayer() == nullptr) + return; + + auto ptr = g_Data.getClientInstance()->getPointerStruct(); + if (ptr != nullptr) + if (ptr->entityPtr == nullptr && ptr->rayHitType == 0) + if (g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 49 || + g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 7) { + DrawUtils::setColor(.75f, .25f, .5f, 1.f); + DrawUtils::drawBox(ptr->block.toVec3t().add(0.f, 1.5f, 0.f), + ptr->block.add(1).toVec3t().add(0.f, 1.5f, 0.f), .3f); + } +} + void CrystalAura::onDisable() { this->delay = 0; -} +} \ No newline at end of file diff --git a/Horion/Module/Modules/CrystalAura.h b/Horion/Module/Modules/CrystalAura.h index f44c85b8..ca49607f 100644 --- a/Horion/Module/Modules/CrystalAura.h +++ b/Horion/Module/Modules/CrystalAura.h @@ -1,11 +1,21 @@ #pragma once -#include "Module.h" +#include "../../../Utils/Target.h" #include "../ModuleManager.h" +#include "Module.h" class CrystalAura : public IModule { private: + int prevSlot; int delay = 0; + int eRange = 3; bool autoplace = true; + bool pEnhanced = true; + bool dEnhanced = true; + bool Preview = true; + bool AutoSelect = true; + bool FinishSelect = false; + C_PlayerInventoryProxy* supplies = nullptr; + C_Inventory* inv = nullptr; public: CrystalAura(); @@ -14,7 +24,14 @@ class CrystalAura : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; + virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; virtual void onEnable() override; virtual void onDisable() override; - int range = 5; -}; + + int cRange = 10; + int pRange = 5; + int range = 10; + + void CPlace(C_GameMode* gm, vec3_t* pos); + void DestroyC(C_Entity* ent, int range); +}; \ No newline at end of file From ede41d4f9d9dff19a954edd4ac6dbab11aecabd2 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 11 Feb 2021 22:32:44 +0100 Subject: [PATCH 264/419] Implement Fullbright suggested by N0tExisting --- Horion/Module/Modules/FullBright.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/FullBright.cpp b/Horion/Module/Modules/FullBright.cpp index 919f9fcf..9883b826 100644 --- a/Horion/Module/Modules/FullBright.cpp +++ b/Horion/Module/Modules/FullBright.cpp @@ -6,6 +6,8 @@ FullBright::FullBright() : IModule(0, Category::VISUAL, "Puts your gamma to max" FullBright::~FullBright() { } +float originalGamma = -1; + const char* FullBright::getModuleName() { return "Fullbright"; } @@ -16,11 +18,18 @@ void FullBright::onTick(C_GameMode* gm) { } void FullBright::onEnable() { - if (gammaPtr != nullptr) + if (gammaPtr != nullptr) { + originalGamma = *gammaPtr; *gammaPtr = 10; + } } void FullBright::onDisable() { - if (gammaPtr != nullptr) - *gammaPtr = 0.5f; + if (gammaPtr != nullptr) { + if (originalGamma >= 0 && originalGamma <= 1) + *gammaPtr = originalGamma; + else + *gammaPtr = 0.5f; + } + } From c0642fd54f4d73cd8676b00bbf06f5c816f96611 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Thu, 11 Feb 2021 22:37:47 +0100 Subject: [PATCH 265/419] Properly fix build error --- Horion/Scripting/Functions/LocalPlayerFunctions.h | 1 - Horion/Scripting/ScriptManager.cpp | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Horion/Scripting/Functions/LocalPlayerFunctions.h b/Horion/Scripting/Functions/LocalPlayerFunctions.h index 99e62b67..acd2f5ca 100644 --- a/Horion/Scripting/Functions/LocalPlayerFunctions.h +++ b/Horion/Scripting/Functions/LocalPlayerFunctions.h @@ -13,7 +13,6 @@ class LocalPlayerFunctions { DECL_FUN(setViewAngles); DECL_FUN(setIsOnGround); DECL_FUN(getInventory); - DECL_FUN(getInventorySlot); DECL_FUN(breakBlock); DECL_FUN(placeBlock); DECL_FUN(breakBlockRelativeToPlr); diff --git a/Horion/Scripting/ScriptManager.cpp b/Horion/Scripting/ScriptManager.cpp index 22608f61..c76cc6a1 100644 --- a/Horion/Scripting/ScriptManager.cpp +++ b/Horion/Scripting/ScriptManager.cpp @@ -107,6 +107,11 @@ void ScriptManager::prepareLocalPlayerPrototype(JsValueRef proto, ContextObjects chakra.defineFunction(proto, L"setViewAngles", LocalPlayerFunctions::setViewAngles, objs); chakra.defineFunction(proto, L"setIsOnGround", LocalPlayerFunctions::setIsOnGround, objs); chakra.defineFunction(proto, L"getInventory", LocalPlayerFunctions::getInventory, objs); + + chakra.defineFunction(proto, L"placeBlock", LocalPlayerFunctions::placeBlock, objs); + chakra.defineFunction(proto, L"placeBlockRelative", LocalPlayerFunctions::placeBlockRelativeToPlr, objs); + chakra.defineFunction(proto, L"breakBlock", LocalPlayerFunctions::breakBlock, objs); + chakra.defineFunction(proto, L"breakBlockRelative", LocalPlayerFunctions::breakBlockRelativeToPlr, objs); } void ScriptManager::prepareInventoryFunctions(JsValueRef proto, ContextObjects* objs) { @@ -118,12 +123,6 @@ void ScriptManager::prepareInventoryFunctions(JsValueRef proto, ContextObjects* chakra.defineFunction(proto, L"moveItem", InventoryFunctions::moveItem, objs); chakra.defineProp(proto, L"isFull", InventoryFunctions::isFull, 0); - chakra.defineFunction(proto, L"getInventorySlot", LocalPlayerFunctions::getInventorySlot, objs); - - chakra.defineFunction(proto, L"placeBlock", LocalPlayerFunctions::placeBlock, objs); - chakra.defineFunction(proto, L"placeBlockRelative", LocalPlayerFunctions::placeBlockRelativeToPlr, objs); - chakra.defineFunction(proto, L"breakBlock", LocalPlayerFunctions::breakBlock, objs); - chakra.defineFunction(proto, L"breakBlockRelative", LocalPlayerFunctions::breakBlockRelativeToPlr, objs); } void ScriptManager::prepareGameFunctions(JsValueRef global, ContextObjects* objs) { From b5a0838bd4f7fc4d328ceb986098b870a5e4ee40 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:40:08 -0500 Subject: [PATCH 266/419] add twerk (#476) --- CMakeLists.txt | 2 +- Horion.vcxproj | 2 ++ Horion/Module/ModuleManager.cpp | 2 +- Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/Twerk.cpp | 29 +++++++++++++++++++++++++++++ Horion/Module/Modules/Twerk.h | 15 +++++++++++++++ 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 Horion/Module/Modules/Twerk.cpp create mode 100644 Horion/Module/Modules/Twerk.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 35c44230..3d663ed6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,4 +345,4 @@ add_library(Horion SHARED Utils/Utils.cpp Utils/Utils.h Utils/xorstr.h - resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h) + resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h "Horion/Module/Modules/Twerk.cpp" "Horion/Module/Modules/Twerk.h") diff --git a/Horion.vcxproj b/Horion.vcxproj index c3e7246e..72621c36 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -359,6 +359,7 @@ + @@ -545,6 +546,7 @@ + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 683207a1..0aa4699d 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -101,7 +101,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Compass())); this->moduleList.push_back(std::shared_ptr(new Radar())); this->moduleList.push_back(std::shared_ptr(new VanillaPlus())); - + this->moduleList.push_back(std::shared_ptr(new Twerk())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); #ifdef _DEBUG diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 4b397d70..a4e6af27 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -94,6 +94,7 @@ #include "Modules/Compass.h" #include "Modules/Radar.h" #include "Modules/VanillaPlus.h" +#include "Modules/Twerk.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/Twerk.cpp b/Horion/Module/Modules/Twerk.cpp new file mode 100644 index 00000000..4586ec9c --- /dev/null +++ b/Horion/Module/Modules/Twerk.cpp @@ -0,0 +1,29 @@ +#include "Twerk.h" + +Twerk::Twerk() : IModule(0x0, Category::MOVEMENT, "Crouch Spam") { + registerFloatSetting("delay", &this->delay, this->delay, 0.05, 10); +} + +Twerk::~Twerk() { +} + +const char* Twerk::getModuleName() { + return ("Twerk"); +} + +void Twerk::onTick(C_GameMode* gm) { + Odelay++; + if (Odelay > delay * 20) { + C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); + if (gm->player->isSneaking()) { + isSneaking = false; + } + else { + if (!gm->player->isSneaking()) { + isSneaking = true; + } + } + g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = isSneaking; + Odelay = 0; + } +} \ No newline at end of file diff --git a/Horion/Module/Modules/Twerk.h b/Horion/Module/Modules/Twerk.h new file mode 100644 index 00000000..5dab3b6c --- /dev/null +++ b/Horion/Module/Modules/Twerk.h @@ -0,0 +1,15 @@ +#pragma once +#include "Module.h" +class Twerk : public IModule { +public: + Twerk(); + ~Twerk(); + +private: + bool isSneaking = false; + int Odelay = 0; + float delay = 1; + inline float& getDelay() { return delay; }; + virtual const char* getModuleName() override; + void onTick(C_GameMode* gm); +}; From 9f864cb7b4a0c6fb7af5e12dd26351520efe0a6b Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 17 Feb 2021 00:18:13 -0500 Subject: [PATCH 267/419] fix --- Horion/Module/Modules/AutoClicker.cpp | 18 ++++++++--- Horion/Module/Modules/AutoClicker.h | 1 + Horion/Module/Modules/AutoTotem.cpp | 2 +- Horion/Module/Modules/CrystalAura.cpp | 6 ++-- Memory/Hooks.cpp | 4 +-- SDK/CBlockLegacy.h | 23 ++++++-------- SDK/CEntity.h | 44 +++++++++++++-------------- SDK/CItem.h | 27 +++++++++++++++- 8 files changed, 77 insertions(+), 48 deletions(-) diff --git a/Horion/Module/Modules/AutoClicker.cpp b/Horion/Module/Modules/AutoClicker.cpp index a1cf5ac4..96af912b 100644 --- a/Horion/Module/Modules/AutoClicker.cpp +++ b/Horion/Module/Modules/AutoClicker.cpp @@ -3,6 +3,7 @@ AutoClicker::AutoClicker() : IModule(0, Category::COMBAT, "A simple autoclicker, automatically clicks for you.") { this->registerBoolSetting("rightclick", &this->rightclick, rightclick); this->registerBoolSetting("only weapons", &this->weapons, this->weapons); + this->registerBoolSetting("break blocks", &this->breakBlocks, this->breakBlocks); this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); this->registerBoolSetting("hold", &this->hold, this->hold); } @@ -17,7 +18,7 @@ const char* AutoClicker::getModuleName() { void AutoClicker::onTick(C_GameMode* gm) { if ((GameData::isLeftClickDown() || !hold) && GameData::canUseMoveKeys()) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); - C_Entity* target = g_Data.getClientInstance()->getPointerStruct()->entityPtr; + PointingStruct* pointing = g_Data.getClientInstance()->getPointerStruct(); Odelay++; if (Odelay >= delay) { @@ -27,11 +28,18 @@ void AutoClicker::onTick(C_GameMode* gm) { g_Data.leftclickCount++; - if(!moduleMgr->getModule()->isEnabled()) + if (!moduleMgr->getModule()->isEnabled()) localPlayer->swingArm(); - if (target != 0) - gm->attack(target); + if (pointing->entityPtr != 0) + gm->attack(pointing->entityPtr); + else if (breakBlocks) { + bool isDestroyed = false; + gm->startDestroyBlock(pointing->block, pointing->blockSide, isDestroyed); + gm->stopDestroyBlock(pointing->block); + if (isDestroyed && localPlayer->region->getBlock(pointing->block)->blockLegacy->blockId != 0) + gm->destroyBlock(&pointing->block, 0); + } Odelay = 0; } } @@ -47,4 +55,4 @@ void AutoClicker::onTick(C_GameMode* gm) { } } } -} +} \ No newline at end of file diff --git a/Horion/Module/Modules/AutoClicker.h b/Horion/Module/Modules/AutoClicker.h index 9f32306a..0864102e 100644 --- a/Horion/Module/Modules/AutoClicker.h +++ b/Horion/Module/Modules/AutoClicker.h @@ -7,6 +7,7 @@ class AutoClicker : public IModule { int delay = 0; int Odelay = 0; bool weapons = true; + bool breakBlocks = true; bool rightclick = false; bool hold = false; diff --git a/Horion/Module/Modules/AutoTotem.cpp b/Horion/Module/Modules/AutoTotem.cpp index a4ba9c5c..a5627a73 100644 --- a/Horion/Module/Modules/AutoTotem.cpp +++ b/Horion/Module/Modules/AutoTotem.cpp @@ -18,7 +18,7 @@ void AutoTotem::onTick(C_GameMode* gm) { if (current->item == NULL) { for (int i = 0; i < 36; i++) { C_ItemStack* totem = inv->getItemStack(i); - if (totem->item != NULL && (*totem->item)->itemId == 450) { + if (totem->item != NULL && (*totem->item)->itemId == 558) { C_InventoryAction first(i, totem, nullptr); C_InventoryAction second(37, nullptr, totem); g_Data.getLocalPlayer()->setOffhandSlot(totem); diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index ea0e0e55..47c86a1b 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -130,13 +130,15 @@ void CrystalAura::onTick(C_GameMode* gm) { // place block around players? return; } + if (this->delay == 1 && AutoSelect) { prevSlot = supplies->selectedHotbarSlot; FinishSelect = true; for (int n = 0; n < 9; n++) { C_ItemStack* stack = inv->getItemStack(n); if (stack->item != nullptr) { - if (stack->getItem()->itemId == 0x1aa) { + if (stack->getItem()->itemId == 615) { + if (prevSlot != n) supplies->selectedHotbarSlot = n; return; } @@ -145,7 +147,7 @@ void CrystalAura::onTick(C_GameMode* gm) { return; } if (this->delay == 2) { - if (autoplace && g_Data.getLocalPlayer()->getSelectedItemId() == 0x1aa) { //endcrystal + if (autoplace && g_Data.getLocalPlayer()->getSelectedItemId() == 615) { //endcrystal if (pEnhanced) for (auto& i : targetList) CPlace(gm, i->getPos()); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2ddb1e0d..7f87dfd2 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1223,8 +1223,8 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f if (tempPos.y > 0) { C_Block* blok = region->getBlock(tempPos); uint8_t data = blok->data; - int id = ((blok->blockLegacy))->blockId; - if (id != 0 && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData))) + int id = blok->blockLegacy->blockId; + if (blok->blockLegacy->material->isSolid == true && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData))) _this->destroyBlock(&tempPos, face); } } diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index b32d4c0f..aaf8a4ae 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -13,7 +13,7 @@ class C_Material { bool isReplaceable; bool isLiquid; // 0x0008 private: - //char pad2[0x3]; // 0x009 + char pad2[0x3]; // 0x009 public: float translucency; // 0x00C bool isBlockingMotion; @@ -29,25 +29,20 @@ class C_BlockSource; class C_BlockLegacy { public: - uintptr_t** Vtable; //0x0000 - TextHolder tileName; // 0x0008 + uintptr_t** Vtable; //0x0000 + class TextHolder tileName; //0x0008 private: - char idk[0x8]; //0x0028 + char pad_0028[8]; //0x0028 public: - TextHolder name; //0x0030 + class TextHolder name; //0x0030 private: - char idk1[0x8]; //0x0050 - char pad_0x0048[0x80]; //0x0058 + char pad_0050[136]; //0x0050 public: - C_Material* material; //0x00C0 + class C_Material* material; //0x00D8 private: - char pad_0x00C0[0x44]; //0x00C8 + char pad_00E0[104]; //0x00E0 public: - short blockId; // 0x010C -private: - char pad_0x0106[0xA]; //0x010E -public: - AABB aabb; //0x0118 + int64_t blockId; //0x0148 int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 094dfaed..52f3924f 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -11,7 +11,7 @@ class C_GameMode; class PointingStruct { private: - char pad_0x0000[0x8E0]; //0x0000 + char pad_0x0000[0x938]; //0x0000 public: int rayHitType; //0x08E0 int blockSide; //0x08E4 @@ -38,10 +38,10 @@ class C_Entity { }; union { struct { - float pitch2; - float yaw2; + float pitch2; + float yaw2; }; - vec2_t viewAngles2; // 0x128 + vec2_t viewAngles2; // 0x128 }; private: @@ -51,12 +51,12 @@ class C_Entity { private: char pad_0x11C[0x70]; //0x14C public: - float fallDistance; //0x1BC - bool onGround; //0x01C0 + float fallDistance; //0x1BC + bool onGround; //0x01C0 private: char pad_0x179[0x5F]; //0x1C1 public: - float stepHeight; //0x220 + float stepHeight; //0x220 private: char pad_0x228[0x10]; //0x224 public: @@ -76,7 +76,7 @@ class C_Entity { private: char pad_0x340[0x148]; //0x350 public: - AABB aabb; //0x0498 + AABB aabb; //0x0498 float width; //0x04B4 float height; //0x04B8 vec3_t currentPos; //0x04BC @@ -105,8 +105,8 @@ class C_Entity { private: char pad_0x0A95[0x6C3]; //0x092D public: - int16_t itemData; //0x0FF0 - int16_t itemId; //0x0FF2 + int16_t itemData; //0x0FF0 + int16_t itemId; //0x0FF2 private: char pad_10CC[0x1FC]; //0x0FF4 public: @@ -316,7 +316,7 @@ class C_Entity { virtual __int64 feed(int); virtual __int64 handleEntityEvent(__int64, int); virtual __int64 getPickRadius(void); - virtual const class HashedString* getActorRendererId(void); + virtual const class HashedString *getActorRendererId(void); virtual __int64 spawnAtLocation(int, int); virtual __int64 spawnAtLocation(int, int, float); virtual __int64 spawnAtLocation(__int64 const &, int); @@ -373,8 +373,7 @@ class C_Entity { virtual __int64 getPortalWaitTime(void) const; public: - virtual int* getDimensionId(int* dimOut) const; - + virtual int *getDimensionId(int *dimOut) const; virtual bool canChangeDimensions(void) const; @@ -496,7 +495,7 @@ class C_Entity { public: virtual bool shouldTryMakeStepSound(void) const; - + private: virtual __int64 getNextStep(float) const; virtual __int64 idk(); @@ -690,18 +689,17 @@ class C_Entity { return result; } - int getTicksUsingItem(){ - return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0xF60); + int getTicksUsingItem() { + return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0xF60); } bool isSneaking() { - return false; // TODO + return false; // TODO } bool isSprinting() { - return false; // TODO + return false; // TODO } - }; #pragma pack(pop) @@ -710,7 +708,8 @@ class C_ServerPlayer; class C_Player : public C_Entity { public: - C_PlayerInventoryProxy *getSupplies();; + C_PlayerInventoryProxy *getSupplies(); + ; C_ItemStack *getSelectedItem() { auto supplies = this->getSupplies(); @@ -758,7 +757,7 @@ class C_Player : public C_Entity { public: virtual bool returnFalse0() const; virtual bool returnFalse1() const; - + virtual __int64 openTrading(__int64 const &, bool); public: @@ -856,7 +855,6 @@ class C_ServerPlayer : public C_Player { class C_LocalPlayer : public C_Player { public: - void unlockAchievments(); void swingArm() { @@ -872,4 +870,4 @@ class C_LocalPlayer : public C_Player { }*/ void applyTurnDelta(vec2_t *viewAngleDelta); void setGameModeType(int gma); -}; +}; \ No newline at end of file diff --git a/SDK/CItem.h b/SDK/CItem.h index 2a05b8ec..09eaf8de 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -34,6 +34,31 @@ class C_ItemRenderer { }; class C_Item { + + +private: + char pad_0028[136]; //0x0028 +public: + int16_t maxStackSize; //0x0090 + int16_t itemId; //0x0092 +private: + char pad_0094[4]; //0x0094 +public: + TextHolder tileName; //0x0098 +private: + char pad_00B8[8]; //0x00B8 +public: + TextHolder name; //0x00C0 +private: + char pad_00E0[8]; //0x00E0 +public: + TextHolder isFrom; //0x00E8 +private: + char pad_0108[80]; //0x0108 +public: + int16_t duration; //0x0158 + +/* private: char pad_0x0008[0x62]; //0x8 public: @@ -46,7 +71,7 @@ class C_Item { private: char pad_0x0B8[0x4C]; //0xB0 public: - int duration; //0xFC + int duration; //0xFC*/ private: virtual __int64 destructor(); virtual __int64 tearDown(void); From bec3af30eb99cff438a6f91eb8ca1dc71c8bc3b8 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 17 Feb 2021 01:17:45 -0500 Subject: [PATCH 268/419] Click Fix --- Horion/ImmediateGui.cpp | 8 ++++---- Horion/Loader.cpp | 19 ------------------- Horion/Menu/ClickGui.cpp | 15 ++++++++------- Memory/Hooks.cpp | 19 ++++++++++++++++--- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Horion/ImmediateGui.cpp b/Horion/ImmediateGui.cpp index 9ac57cfd..ad83e017 100644 --- a/Horion/ImmediateGui.cpp +++ b/Horion/ImmediateGui.cpp @@ -54,11 +54,11 @@ void ButtonInfo::draw(vec2_t mousePos, const char* label) { void ImmediateGui::onMouseClickUpdate(int key, bool isDown) { switch (key) { - case 0: // Left Click - this->leftMb.nextIsDown = isDown; + case 1: // Left Click + this->leftMb.nextIsDown = true; break; - case 1: // Right Click - this->rightMb.nextIsDown = isDown; + case 2: // Right Click + this->rightMb.nextIsDown = true; break; } } diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 4f181e66..d3c6bbcc 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -52,25 +52,6 @@ DWORD WINAPI keyThread(LPVOID lpParam) { } } - if (*hidController != nullptr) { - for (uintptr_t key = 0; key < 5; key++) { - bool newKey = (*hidController)->clickMap[key]; - bool* oldKey = reinterpret_cast(clickMap + key); - if (newKey != *oldKey) { - ClickGui::onMouseClickUpdate((int)key, newKey); - HImGui.onMouseClickUpdate((int)key, newKey); - if (newKey) { - if ((int)key == 0) - g_Data.leftclickCount++; - else if ((int)key == 1) - g_Data.rightclickCount++; - } - } - } - - memcpy(reinterpret_cast(clickMap), &(*hidController)->leftClickDown, 5); - } - memcpy_s(keyMap, 0xFF * 4, keyMapAddr, 0xFF * 4); Sleep(2); diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 87f7bc64..6144d3e2 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -703,23 +703,24 @@ void ClickGui::init() { initialised = true; } void ClickGui::onMouseClickUpdate(int key, bool isDown) { switch (key) { - case 0: // Left Click + case 1: // Left Click isLeftClickDown = isDown; - shouldToggleLeftClick = isDown; + if (isDown) + shouldToggleLeftClick = true; break; - case 1: // Right Click + case 2: // Right Click isRightClickDown = isDown; - shouldToggleRightClick = isDown; + if (isDown) + shouldToggleRightClick = true; break; } } void ClickGui::onWheelScroll(bool direction) { - if (!direction) { + if (!direction) scrollingDirection++; - } else { + else scrollingDirection--; - } } void ClickGui::onKeyUpdate(int key, bool isDown) { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 7f87dfd2..613f28fb 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1315,11 +1315,24 @@ void Hooks::ClickFunc(__int64 a1, char mouseButton, char isDown, __int16 mouseX, static auto oFunc = g_Hooks.ClickFuncHook->GetFastcall(); static auto clickGuiModule = moduleMgr->getModule(); + //MouseButtons + //0 = mouse move + //1 = left click + //2 = right click + //3 = middle click + //4 = scroll (isDown: 120 (SCROLL UP) and -120 (SCROLL DOWN)) + + ClickGui::onMouseClickUpdate((int)mouseButton, isDown); + HImGui.onMouseClickUpdate((int)mouseButton, isDown); + + if (isDown) + if (mouseButton == 1) + g_Data.leftclickCount++; + else if (mouseButton == 2) + g_Data.rightclickCount++; + if (clickGuiModule->isEnabled()) { if (mouseButton == 4) { - // mouseButton = 4 (WHEEL) - // isDown = -120 (SCROLL DOWN) - // isDown = 120 (SCROLL UP) ClickGui::onWheelScroll(isDown > 0); } if (mouseButton != 0) // Mouse click event From d4fd48573f3ed99e4c219bbdae6de7c81a545479 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 17 Feb 2021 14:02:53 +0100 Subject: [PATCH 269/419] Properly implement Enum settings --- Horion/Menu/ClickGui.cpp | 28 +++++++++++----------- Horion/Module/Modules/Module.cpp | 35 +++++++++++++++------------- Horion/Module/Modules/Module.h | 21 ++++------------- Horion/Module/Modules/TestModule.cpp | 9 +++---- 4 files changed, 43 insertions(+), 50 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index b7b9066a..d7778e49 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -356,8 +356,8 @@ void ClickGui::renderCategory(Category category) { case ValueType::ENUM_T: { // Text and background { - char name[0x21]; - sprintf_s(name, 0x21, "%s:", setting->name); + char name[0x22]; + sprintf_s(name, "%s:", setting->name); // Convert first letter to uppercase for more friendlieness if (name[0] != 0) name[0] = toupper(name[0]); @@ -379,8 +379,9 @@ void ClickGui::renderCategory(Category category) { } if (setting->minValue->_bool) { int e = 0; - for (auto it = setting->maxValue->Enum->Entrys.begin(); - it != setting->maxValue->Enum->Entrys.end(); it++, e++) { + auto enumData = reinterpret_cast(setting->extraData); + for (auto it = enumData->Entrys.begin(); + it != enumData->Entrys.end(); it++, e++) { if ((currentYOffset - ourWindow->pos.y) > cutoffHeight) { overflowing = true; break; @@ -400,10 +401,10 @@ void ClickGui::renderCategory(Category category) { 5); //because we add 5 to text padding textPos.y = currentYOffset + textPadding; vec4_t selectableSurface = vec4_t( - textPos.x + textPadding, - textPos.y + textPadding, - xEnd - textPadding, - textPos.y + textHeight - textPadding); + textPos.x, + rectPos.y, + xEnd, + rectPos.w); MC_Color col; if (setting->value->_int == e || (selectableSurface.contains(&mousePos) && !ourWindow->isInAnimation)) { if (isEven) @@ -416,7 +417,8 @@ void ClickGui::renderCategory(Category category) { else col = SettingColor2; } - DrawUtils::fillRectangle(rectPos, col, backgroundAlpha); + DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); + DrawUtils::fillRectangle(selectableSurface, col, backgroundAlpha); DrawUtils::drawText(textPos, &elTexto, MC_Color(1.f, 1.f, 1.f)); // logic if (selectableSurface.contains(&mousePos) && @@ -433,8 +435,8 @@ void ClickGui::renderCategory(Category category) { // Text and background { // Convert first letter to uppercase for more friendlieness - char name[0x21]; - sprintf_s(name, 0x21, "%s:", setting->name); + char name[0x22]; + sprintf_s(name, "%s:", setting->name); if (name[0] != 0) name[0] = toupper(name[0]); @@ -529,8 +531,8 @@ void ClickGui::renderCategory(Category category) { // Text and background { // Convert first letter to uppercase for more friendlieness - char name[0x21]; - sprintf_s(name, 0x21, "%s:", setting->name); + char name[0x22]; + sprintf_s(name, "%s:", setting->name); if (name[0] != 0) name[0] = toupper(name[0]); diff --git a/Horion/Module/Modules/Module.cpp b/Horion/Module/Modules/Module.cpp index 8ba99612..c722052a 100644 --- a/Horion/Module/Modules/Module.cpp +++ b/Horion/Module/Modules/Module.cpp @@ -29,24 +29,24 @@ SettingEnum::SettingEnum(IModule* mod) { owner = mod; } -AddResult SettingEnum::addEntry(EnumEntry entr) { - auto etr = new EnumEntry(entr); +SettingEnum& SettingEnum::addEntry(EnumEntry entr) { + auto etr = EnumEntry(entr); bool SameVal = false; for (auto it = this->Entrys.begin(); it != this->Entrys.end(); it++) { - SameVal |= it->GetValue() == etr->GetValue(); + SameVal |= it->GetValue() == etr.GetValue(); } if (!SameVal) { - Entrys.push_back(*etr); + Entrys.push_back(etr); std::sort(Entrys.begin(), Entrys.end(), [](EnumEntry rhs, EnumEntry lhs) { return rhs.GetValue() < lhs.GetValue(); }); } - return AddResult(SameVal, this); + return *this; } -EnumEntry* SettingEnum::GetEntry(int ind) { - return &Entrys.at(ind); +EnumEntry& SettingEnum::GetEntry(int ind) { + return Entrys.at(ind); } -EnumEntry* SettingEnum::GetEntry() { +EnumEntry& SettingEnum::GetSelectedEntry() { return GetEntry(selected); } int SettingEnum::GetCount() { @@ -128,24 +128,27 @@ void IModule::registerIntSetting(std::string name, int* intPtr, int defaultValue void IModule::registerEnumSetting(std::string name, SettingEnum* ptr, int defaultValue) { SettingEntry* setting = new SettingEntry(); setting->valueType = ValueType::ENUM_T; + if (defaultValue < 0 || defaultValue >= ptr->GetCount()) + defaultValue = 0; + // Actual Value setting->value = reinterpret_cast(&ptr->selected); + setting->value->_int = defaultValue; + // Default Value SettingValue* defaultVal = new SettingValue(); defaultVal->_int = defaultValue; setting->defaultValue = defaultVal; + // Min Value (is Extended) SettingValue* minVal = new SettingValue(); minVal->_bool = false; setting->minValue = minVal; - // Max Value (The Enum) - SettingValue* maxVal = new SettingValue(); - maxVal->Enum = ptr; - setting->maxValue = maxVal; - // Name + + // Enum data + setting->extraData = ptr; + strcpy_s(setting->name, 19, name.c_str()); - setting->value->_int = setting->defaultValue->_int; - // Add to list settings.push_back(setting); } @@ -365,7 +368,7 @@ void IModule::clientMessageF(const char* fmt, ...) { void SettingEntry::makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt() { switch (valueType) { case ValueType::ENUM_T: - value->_int = std::max(0, std::min(maxValue->Enum->GetCount()-1, value->_int)); + value->_int = std::max(0, std::min(reinterpret_cast(extraData)->GetCount()-1, value->_int)); break; case ValueType::BOOL_T: break; diff --git a/Horion/Module/Modules/Module.h b/Horion/Module/Modules/Module.h index 219379fb..b34b8079 100644 --- a/Horion/Module/Modules/Module.h +++ b/Horion/Module/Modules/Module.h @@ -42,26 +42,12 @@ class SettingEnum { SettingEnum(std::vector entr, IModule* mod = nullptr); SettingEnum(IModule* mod = nullptr); //SettingEnum(); - AddResult addEntry(EnumEntry entr); - EnumEntry* GetEntry(int ind); - EnumEntry* GetEntry(); + SettingEnum& addEntry(EnumEntry entr); + EnumEntry& GetEntry(int ind); + EnumEntry& GetSelectedEntry(); int GetCount(); }; -struct AddResult { - union { - bool Succes; - SettingEnum* Enum; - }; - AddResult(bool succ, SettingEnum* e) { - Succes = succ; - Enum = e; - } - inline AddResult addEntry(EnumEntry entr) { - return Enum->addEntry(entr); - } -}; - enum class ValueType { FLOAT_T, DOUBLE_T, @@ -91,6 +77,7 @@ struct SettingEntry { SettingValue* defaultValue = nullptr; SettingValue* minValue = nullptr; SettingValue* maxValue = nullptr; + void* extraData; // Only used by enum for now // ClickGui Data bool isDragging = false; // This is incredibly hacky and i wanted to avoid this as much as possible but i want to get this clickgui done diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 00ca7b0b..6aa7b69f 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -20,8 +20,11 @@ using json = nlohmann::json; TestModule::TestModule() : IModule(0, Category::MISC, "For testing purposes") { - enum1 = *(*new SettingEnum(this)).addEntry(EnumEntry("1", 1)).addEntry(EnumEntry("2", 2)) - .addEntry(EnumEntry("3", 3)).Enum; + enum1 = SettingEnum(this) + .addEntry(EnumEntry("1", 1)) + .addEntry(EnumEntry("2", 2)) + .addEntry(EnumEntry("3", 3)); + registerFloatSetting("float1", &this->float1, 0, -10, 10); registerIntSetting("int1", &this->int1, 0, -10, 10); registerEnumSetting("Enum1", &enum1, 0); @@ -39,8 +42,6 @@ bool TestModule::isFlashMode() { return false; } - - __forceinline unsigned __int64 rotBy(int in, unsigned int by) { auto mut = static_cast(in); return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; From 2a590d783bf25e57664fd2c3ed01a96e39335de7 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 17 Feb 2021 14:07:55 +0100 Subject: [PATCH 270/419] fix warning --- Horion/Module/Modules/Twerk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Twerk.cpp b/Horion/Module/Modules/Twerk.cpp index 4586ec9c..5fe8653b 100644 --- a/Horion/Module/Modules/Twerk.cpp +++ b/Horion/Module/Modules/Twerk.cpp @@ -1,7 +1,7 @@ #include "Twerk.h" Twerk::Twerk() : IModule(0x0, Category::MOVEMENT, "Crouch Spam") { - registerFloatSetting("delay", &this->delay, this->delay, 0.05, 10); + registerFloatSetting("delay", &this->delay, this->delay, 0.05f, 10); } Twerk::~Twerk() { From 18df8643dfcb35a21ec0b77ffe539c43cd810820 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 17 Feb 2021 14:24:39 +0100 Subject: [PATCH 271/419] Remove Injector dependency --- Horion/Loader.cpp | 4 ++-- Memory/Hooks.cpp | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index d3c6bbcc..cb138457 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -333,13 +333,13 @@ DWORD WINAPI start(LPVOID lpParam) { CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)keyThread, lpParam, NULL, &keyThreadId); // Checking Keypresses logF("KeyT: %i", keyThreadId); - logF("Waiting for injector"); + /*logF("Waiting for injector"); while (!g_Data.isInjectorConnectionActive()) { Sleep(10); if (!isRunning) ExitThread(0); } - logF("Injector found"); + logF("Injector found");*/ cmdMgr->initCommands(); logF("Initialized command manager (1/3)"); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 613f28fb..9688973c 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -427,15 +427,20 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { QueryPerformanceFrequency(&frequency); QueryPerformanceCounter(&start); } - if (!g_Data.isInjectorConnectionActive()) { + static bool hasSentWarning = false; + if (!g_Data.isInjectorConnectionActive() && !hasSentWarning) { + __int64 retval = oText(a1, renderCtx); LARGE_INTEGER end, elapsed; QueryPerformanceCounter(&end); elapsed.QuadPart = end.QuadPart - start.QuadPart; float elapsedFlot = (float)elapsed.QuadPart / frequency.QuadPart; - if (elapsedFlot > 1.5f) { - vec2_t windowSize = dat->windowSize; + if (elapsedFlot > 1.5f && !hasSentWarning) { + hasSentWarning = true; + auto box = g_Data.addInfoBox("Warning", "Your injector doesn't seem to connect to Horion correctly. \nYou can ignore this, but some features may not work as expected."); + box->closeTimer = 5; + /*vec2_t windowSize = dat->windowSize; DrawUtils::fillRectangle(vec4_t(0, 0, windowSize.x, windowSize.y), MC_Color(0.2f, 0.2f, 0.2f), 0.8f); @@ -447,10 +452,11 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { text = "Uninject by holding down CTRL + L"; DrawUtils::drawText(vec2_t(windowSize.x / 2 - DrawUtils::getTextWidth(&text, 0.7f) / 2, windowSize.y * 0.8f), &text, MC_Color(), 0.7f); - DrawUtils::flush(); + DrawUtils::flush();*/ } - return retval; + if(!hasSentWarning) // Wait for injector, it might connect in time + return retval; } else wasConnectedBefore = true; } @@ -506,7 +512,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { }*/ // Draw Custom Geo Button - if (g_Data.allowWIPFeatures()) { + if (g_Data.allowWIPFeatures() && g_Data.isInjectorConnectionActive()) { if (HImGui.Button("Load Script Folder", vec2_t(wid.x * (0.765f - 0.5f), wid.y * 0.92f), true)) { HorionDataPacket packet; packet.cmd = CMD_FOLDERCHOOSER; @@ -1210,7 +1216,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f const bool isAutoMode = nukerModule->isAutoMode(); C_BlockSource* region = g_Data.getLocalPlayer()->region; - int selectedBlockId = ((region->getBlock(*a2)->blockLegacy))->blockId; + auto selectedBlockId = ((region->getBlock(*a2)->blockLegacy))->blockId; uint8_t selectedBlockData = region->getBlock(*a2)->data; if (!isAutoMode) { @@ -1223,7 +1229,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f if (tempPos.y > 0) { C_Block* blok = region->getBlock(tempPos); uint8_t data = blok->data; - int id = blok->blockLegacy->blockId; + auto id = blok->blockLegacy->blockId; if (blok->blockLegacy->material->isSolid == true && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData))) _this->destroyBlock(&tempPos, face); } From 2d8c3f4a0ca4bf9208f119ab9a41c736402d4bbf Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 17 Feb 2021 14:27:18 +0100 Subject: [PATCH 272/419] fix warning --- Horion/Scripting/Functions/LevelFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Scripting/Functions/LevelFunctions.cpp b/Horion/Scripting/Functions/LevelFunctions.cpp index 2a97197f..532cc095 100644 --- a/Horion/Scripting/Functions/LevelFunctions.cpp +++ b/Horion/Scripting/Functions/LevelFunctions.cpp @@ -14,7 +14,7 @@ JsValueRef createBlock(C_BlockLegacy *block) { JsValueRef tName; chakra.JsPointerToString_(tileName.c_str(), tileName.size(), &tName); - JsValueRef id = chakra.toNumber(block->blockId); + JsValueRef id = chakra.toNumber((double)block->blockId); chakra.addPropertyToObj(ref, L"name", bName); chakra.addPropertyToObj(ref, L"tileName", tName); From f6fc9b0d8a9383b4860b5466dbac17e7dc1b9be4 Mon Sep 17 00:00:00 2001 From: godgamer029 Date: Wed, 17 Feb 2021 14:36:00 +0100 Subject: [PATCH 273/419] Fix some minor bugs --- Horion/Loader.cpp | 2 +- Memory/Hooks.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index cb138457..6a95a8c9 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -400,7 +400,7 @@ BOOL __stdcall DllMain(HMODULE hModule, if (g_Data.getLocalPlayer() != nullptr) { C_GuiData* guiData = g_Data.getClientInstance()->getGuiData(); if (guiData != nullptr && !GameData::shouldHide()) - guiData->displayClientMessageF("%sUninjected!", RED); + guiData->displayClientMessageF("%sEjected!", RED); } break; } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 9688973c..06d82a1a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -438,7 +438,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { float elapsedFlot = (float)elapsed.QuadPart / frequency.QuadPart; if (elapsedFlot > 1.5f && !hasSentWarning) { hasSentWarning = true; - auto box = g_Data.addInfoBox("Warning", "Your injector doesn't seem to connect to Horion correctly. \nYou can ignore this, but some features may not work as expected."); + auto box = g_Data.addInfoBox("Warning", "Your injector doesn't seem to connect to Horion correctly.\nYou can ignore this, but some features may not work as expected."); box->closeTimer = 5; /*vec2_t windowSize = dat->windowSize; @@ -861,9 +861,9 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { std::string substring = box->message; while (lines < 5) { auto brea = substring.find("\n"); - if (brea == std::string::npos) + if (brea == std::string::npos || brea + 1 >= substring.size()) break; - substring = substring.substr(brea); + substring = substring.substr(brea + 1); lines++; } if (box->message.size() == 0) From 1c71da8f4497ac25353b29495991df404ee7beaa Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Fri, 26 Feb 2021 16:33:09 -0600 Subject: [PATCH 274/419] Add files via upload --- Horion/Module/ModuleManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 0aa4699d..58f32823 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -84,7 +84,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Timer())); this->moduleList.push_back(std::shared_ptr(new NightMode())); this->moduleList.push_back(std::shared_ptr(new NoSwing())); - this->moduleList.push_back(std::shared_ptr(new CubeGlide())); + //this->moduleList.push_back(std::shared_ptr(new CubeGlide())); this->moduleList.push_back(std::shared_ptr(new AirStuck())); this->moduleList.push_back(std::shared_ptr(new Zoom())); this->moduleList.push_back(std::shared_ptr(new Teams())); From 13d7d43bd88c01fb4ec476fed8b711f002d949d3 Mon Sep 17 00:00:00 2001 From: grajkogj <67935829+grajkogj@users.noreply.github.com> Date: Fri, 26 Feb 2021 16:34:19 -0600 Subject: [PATCH 275/419] made CubeGlide a mode of fly --- Horion/Module/Modules/Fly.cpp | 71 +++++++++++++++++++++++++++++++++-- Horion/Module/Modules/Fly.h | 8 ++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/Fly.cpp b/Horion/Module/Modules/Fly.cpp index 859267b3..3cea59b8 100644 --- a/Horion/Module/Modules/Fly.cpp +++ b/Horion/Module/Modules/Fly.cpp @@ -1,22 +1,87 @@ #include "Fly.h" Fly::Fly() : IModule(0, Category::MOVEMENT, "Enables fly like in creative mode") { + mode = (*new SettingEnum(this)).addEntry(EnumEntry("Fly", 1)).addEntry(EnumEntry("CubeGlide", 2)); + registerEnumSetting("Mode", &mode, 0); + registerFloatSetting("CubeGlide Speed", &this->speed, this->speed, 1.f, 3.f); } Fly::~Fly() { } + + const char* Fly::getModuleName() { return ("Fly"); } +bool Fly::isFlashMode() { + switch (mode.selected) { + case 0: + return false; + break; + case 1: + return true; + break; + } +} + +void Fly::onEnable() { + if (mode.selected == 1) { + g_Data.getLocalPlayer()->setPos((*g_Data.getLocalPlayer()->getPos()).add(vec3_t(0, 1, 0))); + } +} + + void Fly::onTick(C_GameMode* gm) { gm->player->canFly = true; + switch (mode.selected) { + case 0: + gm->player->canFly = true; + break; + case 1: + float calcYaw = (gm->player->yaw + 90) * (PI / 180); + + gameTick++; + + vec3_t pos = *g_Data.getLocalPlayer()->getPos(); + pos.y += 1.3f; + C_MovePlayerPacket a(g_Data.getLocalPlayer(), pos); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a); + pos.y -= 1.3f; + C_MovePlayerPacket a2(g_Data.getLocalPlayer(), pos); + g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&a2); + + vec3_t moveVec; + moveVec.x = cos(calcYaw) * speed; + moveVec.z = sin(calcYaw) * speed; + + gm->player->lerpMotion(moveVec); + + if (gameTick >= 5) { + gameTick = 0; + float yaw = gm->player->yaw * (PI / 180); + float length = 4.f; + + float x = -sin(yaw) * length; + float z = cos(yaw) * length; + + gm->player->setPos(pos.add(vec3_t(x, 0.5f, z))); + } + break; + } + } void Fly::onDisable() { - if (g_Data.getLocalPlayer() != nullptr) - if (g_Data.getLocalPlayer()->gamemode != 1) - g_Data.getLocalPlayer()->canFly = false; + switch (mode.selected) { + case 0: + if (g_Data.getLocalPlayer() != nullptr) + if (g_Data.getLocalPlayer()->gamemode != 1) + g_Data.getLocalPlayer()->canFly = false; + break; + case 1: + g_Data.getLocalPlayer()->velocity = vec3_t(0, 0, 0); + } } diff --git a/Horion/Module/Modules/Fly.h b/Horion/Module/Modules/Fly.h index 85be77c3..f27fad60 100644 --- a/Horion/Module/Modules/Fly.h +++ b/Horion/Module/Modules/Fly.h @@ -1,11 +1,19 @@ #pragma once #include "Module.h" class Fly : public IModule { +private: + float speed = 1.5f; + int gameTick = 0; + public: Fly(); ~Fly(); + SettingEnum mode; + // Inherited via IModule + virtual bool isFlashMode() override; + virtual void onEnable() override; virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; virtual void onDisable() override; From 5b3ac32390f2eedff8cd6707cb4cbd1daa07bc7a Mon Sep 17 00:00:00 2001 From: ZAWADl Date: Tue, 9 Mar 2021 14:48:15 +0100 Subject: [PATCH 276/419] Update Discord Invite link (#4384) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d9f99c0..40b273fb 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ If you want to contribute to this project, feel free to fork this repository and submit a pull request. **As of 09/01/20, this project is under no active development by the horion team anymore. We will still review PRs.** -[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/pS3pKkQ) +[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/WPe3WeNtgv) [![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horionbeta.club/injector "Download the injector") ![Total Injections](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) From 3ea78ca6d14bc29a5e40aad10c540befbf89b3f6 Mon Sep 17 00:00:00 2001 From: Operation-Ghost <48508820+Operation-Ghost@users.noreply.github.com> Date: Tue, 23 Mar 2021 23:59:52 +1000 Subject: [PATCH 277/419] (1.16.201) Fixed SilentSneak crash (#4388) yea lol i forgot about this when i contributed it --- Horion/Module/Modules/AutoSneak.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Horion/Module/Modules/AutoSneak.cpp b/Horion/Module/Modules/AutoSneak.cpp index 983b8a60..c711b528 100644 --- a/Horion/Module/Modules/AutoSneak.cpp +++ b/Horion/Module/Modules/AutoSneak.cpp @@ -33,6 +33,9 @@ void AutoSneak::onDisable() { } void AutoSneak::onEnable() { + if (g_Data.getLocalPlayer() == nullptr) + return; //fixed crash + if (doSilent) { C_PlayerActionPacket p; p.action = 11; //start crouch packet From 0e84fb874db4796eff0cd362a791da20f5d7f22a Mon Sep 17 00:00:00 2001 From: Imrglop Date: Sun, 4 Apr 2021 10:22:29 -0400 Subject: [PATCH 278/419] (1.16.210) Update client instance --- Memory/GameData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index f3f2d478..bb210800 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -17,8 +17,8 @@ void GameData::retrieveClientInstance() { logF("clinet: %llX", clientInstanceOffset); } }*/ - clientInstanceOffset = 0x03A30ED8; // pointer scanned, can't find good signatures so it'll stay - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x40})); + clientInstanceOffset = 0x03B53828; // pointer scanned, can't find good signatures so it'll stay + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x50, 0x0})); #ifdef _DEBUG if (g_Data.clientInstance == 0) From 2b067565013d0031d532576e5f70886b8416c3cc Mon Sep 17 00:00:00 2001 From: Imrglop Date: Sun, 18 Apr 2021 10:21:55 -0400 Subject: [PATCH 279/419] Start on some 1.16.220 fixes --- Memory/GameData.cpp | 13 ++++++------- Memory/Hooks.cpp | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index bb210800..d1835986 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -8,18 +8,17 @@ GameData g_Data; void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; - /*uintptr_t sigOffset = 0x0; + uintptr_t sigOffset = 0x0; if (clientInstanceOffset == 0x0) { - sigOffset = FindSignature("48 8B 05 ? ? ? ? 48 85 C0 74"); + sigOffset = FindSignature("48 8B 15 ? ? ? ? 4C 8B 02 4C 89 06 40 84 FF 74 ? 48 8B CD E8 ? ? ? ? 48 8B C6 48 8B 4C 24 ? 48 33 CC E8 ? ? ? ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 8B 74 24 ? 48 83 C4 ? 5F C3 B9 ? ? ? ? E8 ? ? ? ? CC E8 ? ? ? ? CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24 ? 56"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code - clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instructio/ 7; // Offset is relative + clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative logF("clinet: %llX", clientInstanceOffset); } - }*/ - clientInstanceOffset = 0x03B53828; // pointer scanned, can't find good signatures so it'll stay - g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x50, 0x0})); - + } + /*clientInstanceOffset = 0x03CD5058*/; // pointer scanned, can't find good signatures so it'll stay + g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x50})); #ifdef _DEBUG if (g_Data.clientInstance == 0) throw std::exception("Client Instance is 0"); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 06d82a1a..f8de3e11 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -25,7 +25,7 @@ void Hooks::Init() { { // GameMode::vtable { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? C7 41 18 FF FF FF FF"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 8B D9 48 89 01 8B FA 48 8B 89 ? ? ? ? 48 85 C9 74 ? 48 8B 01 BA ? ? ? ? FF 10 48 8B 8B"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** gameModeVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); if (gameModeVtable == 0x0 || sigOffset == 0x0) @@ -186,7 +186,7 @@ void Hooks::Init() { void* surv_tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 56 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9 F3")); g_Hooks.SurvivalMode_tickHook = std::make_unique(surv_tick, Hooks::SurvivalMode_tick); - void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC ?? 48 8B D9 48 83 B9")); + void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 70 ?? 0F 29 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B F2 48 89 54 24")); From f1a585a16ac12b8f84a39e81864ad5af3448b015 Mon Sep 17 00:00:00 2001 From: Imrglop Date: Tue, 20 Apr 2021 11:18:34 -0400 Subject: [PATCH 280/419] (1.16.220) update more signatures --- Horion/DrawUtils.cpp | 3 ++- Memory/GameData.cpp | 2 +- Memory/Hooks.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 1e0b5372..4f961135 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -54,7 +54,8 @@ void DrawUtils::setCtx(C_MinecraftUIRenderContext* ctx, C_GuiData* gui) { ElapsedMicroseconds.QuadPart *= 1000000; int ticksPerSecond = 20; if(g_Data.getClientInstance()->minecraft) - ticksPerSecond = (int)*g_Data.getClientInstance()->minecraft->timer; + if (g_Data.getClientInstance()->minecraft->timer != nullptr) + ticksPerSecond = (int)*g_Data.getClientInstance()->minecraft->timer; if(ticksPerSecond < 1) ticksPerSecond = 1; ElapsedMicroseconds.QuadPart /= Frequency.QuadPart / ticksPerSecond; diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index d1835986..ae89a705 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -17,7 +17,7 @@ void GameData::retrieveClientInstance() { logF("clinet: %llX", clientInstanceOffset); } } - /*clientInstanceOffset = 0x03CD5058*/; // pointer scanned, can't find good signatures so it'll stay + // clientInstanceOffset = 0x03CD5058; // pointer scanned, can't find good signatures so it'll stay g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x50})); #ifdef _DEBUG if (g_Data.clientInstance == 0) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index f8de3e11..b5af4f5f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -205,7 +205,7 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - void* chestTick = reinterpret_cast(FindSignature("48 89 5C 24 18 56 57 41 56 48 83 EC ?? 48 83 79")); + void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ? 48 83 79")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); @@ -226,7 +226,7 @@ void Hooks::Init() { void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); - void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC ? 0F 29 74 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 E0 49 8B F0 48 8B F9")); + void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5c 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8b ec 48 81 ec ? ? ? ? 0f 29 74 24 ? 0f 29 7c 24 ? 48 8b 05 ? ? ? ? 48 33 c4 48 89 45 ? 49 8b f0")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); void* renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 20 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); @@ -238,7 +238,7 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = reinterpret_cast(FindSignature("48 83 EC 28 80 B9 ?? ?? ?? ?? 00 48 8D 54 24 30 74 36 41 B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 10 48 85 D2 74 3C 48 8B 8A ?? ?? ?? ?? 48 85 C9 74 0A E8 ?? ?? ?? ?? 48 83 C4 28 C3")); + void* fullbright = reinterpret_cast(FindSignature("48 83 EC ? 80 B9 ? ? ? ? ? 48 8D 54 24 ? 74 ? 41 B8 ? ? ? ? E8 ? ? ? ? 48 8B 10 48 85 D2 74 ? 48 8B 42 ? 48 8B 88 ? ? ? ? 48 85 C9 74 ? E8 ? ? ? ? 48 83 C4 ? C3 F3 0F 10 42")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); // Mob::_jumpFromGround From ffcd88d19da2bb9693c3b161cceb853b54722ce0 Mon Sep 17 00:00:00 2001 From: Imrglop Date: Tue, 20 Apr 2021 11:33:35 -0400 Subject: [PATCH 281/419] Fix signature --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b5af4f5f..d405120f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -226,7 +226,7 @@ void Hooks::Init() { void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); - void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5c 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8b ec 48 81 ec ? ? ? ? 0f 29 74 24 ? 0f 29 7c 24 ? 48 8b 05 ? ? ? ? 48 33 c4 48 89 45 ? 49 8b f0")); + void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 81 EC ? ? ? ? 0F 29 74 24 ? 0F 29 7C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F0")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); void* renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 20 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 49 8B F8 48 8B DA")); From b8a8776456c5671e14122cca033ac1e57d925c59 Mon Sep 17 00:00:00 2001 From: Imrglop Date: Wed, 21 Apr 2021 22:27:27 -0400 Subject: [PATCH 282/419] (1.16.220) update a few more --- Horion/DrawUtils.cpp | 2 +- Memory/Hooks.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 4f961135..e30e5228 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -35,7 +35,7 @@ meshHelper_renderImm_t meshHelper_renderImm; bool hasInitializedSigs = false; void initializeSigs() { - tess_vertex = reinterpret_cast(FindSignature("4C 8B DC 57 48 81 EC ?? ?? ?? ?? 41 0F")); + tess_vertex = reinterpret_cast(FindSignature("40 57 48 83 EC ? 0F 29 74 24 ? 0F 29 7C 24")); meshHelper_renderImm = reinterpret_cast(FindSignature("40 53 56 57 48 81 EC ?? ?? ?? ?? 49 8B F0 48 8B DA")); //mce__VertexFormat__disableHalfFloats = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B D9 C7 81 ?? ?? ?? ?? 00 00 00 00 C6 81 ?? ?? ?? ?? 00")); //Tessellator__initializeFormat = reinterpret_cast(FindSignature("48 89 74 24 ?? 57 48 83 EC 20 4C 8B 41 ?? 48 8B FA 4C 2B 41 ?? 48 8B F1 48 83 C1 08 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 49 F7 E8 48 D1 FA 48 8B C2 48 C1 E8 3F 48 03 D0 48 3B FA")); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index d405120f..3367c63f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -245,7 +245,7 @@ void Hooks::Init() { void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); - void* onAppSuspended = reinterpret_cast(FindSignature("48 8B C4 55 48 8B EC 48 83 EC ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 89 78 ? 48 8B F1 E8 ? ? ? ? 48 8B D8 48 8B C8")); + void* onAppSuspended = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8B EC 48 83 EC ? 48 8B F1 E8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 54 41 56 41 57 48 8D ?? 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F9 45 33 E4 4C")); @@ -260,7 +260,7 @@ void Hooks::Init() { void* _getSkinPack = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B E2 48 8B F1")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); - void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); + void* _toStyledString = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 49 8B D8 48 8B F9")); g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D8 4C")); @@ -277,7 +277,7 @@ void Hooks::Init() { void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 80 B9 ? ? ? ? ? 48 8B D9 75 5E")); g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); - void* renderNameTags = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 44 0F 29 48 ? 48 8B 05 ? ? ? ? 48 33 C4")); + void* renderNameTags = reinterpret_cast(FindSignature("4C 8B DC 49 89 5B ? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 41 0F 29 73 ? 41 0F 29 7B ? 45 0F 29 43 ? 48 8B 05")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags, Hooks::LevelRendererPlayer__renderNameTags); static constexpr auto counterStart = __COUNTER__ + 1; From dbeea1ebfb65dc5161ff5cc15e0c6c7d08a1d56c Mon Sep 17 00:00:00 2001 From: szeroki <36236750+Seyz123@users.noreply.github.com> Date: Mon, 26 Apr 2021 20:05:08 +0200 Subject: [PATCH 283/419] Reach fix --- Horion/Module/Modules/Reach.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Reach.cpp b/Horion/Module/Modules/Reach.cpp index da589c51..cde7b849 100644 --- a/Horion/Module/Modules/Reach.cpp +++ b/Horion/Module/Modules/Reach.cpp @@ -25,7 +25,7 @@ void Reach::onEnable() { static uintptr_t sigOffset = 0x0; if (sigOffset == 0x0) { - sigOffset = FindSignature("F3 0F 10 05 ?? ?? ?? ?? 44 0F 2F E0 ??"); + sigOffset = FindSignature("F3 0F 59 ? ? ? ? ? 80 BE"); if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 4)); // Get Offset from code From 14cc13d09eff86cde84d8aaffa887913fd3f5190 Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Mon, 26 Apr 2021 12:45:11 -0700 Subject: [PATCH 284/419] Fix MinecraftGame field offsets I'm not entirely sure how well this works on 1.16.221 but I know it works with 1.16.210 and 220 --- SDK/CClientInstance.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 34f4bd38..62fc27b2 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -138,28 +138,25 @@ struct C_FontRepository { class MinecraftGame { private: - char filler[0x128]; //0x0000 + char filler[256]; //0x0000 public: - C_FontRepository* fontRepository; //0x128 + C_FontRepository* fontRepository; //0xF8 private: - char pad_0x148[0x28]; //0x130 + char pad_0x128[0x1F0]; //0x100 public: - C_FontRepository* fontRepository1; //0x158 -private: - char pad_0x128[0x100]; //0x160 -public: - bool canUseKeys; //0x260 + bool canUseKeys; //0x2F0 + // 0x2F0 C_Font* getTheGoodFontThankYou() { return fontRepository->fontList->fontEntries[7].font; }; C_Font* getOldFont() { - return fontRepository1->fontList->fontEntries[7].font; + return fontRepository->fontList->fontEntries[7].font; }; C_Font* getTheBetterFontYes() { - return fontRepository->fontList->fontEntries[0].font; + return fontRepository->fontList->fontEntries[3].font; } const bool canUseKeybinds() { From a34f5f165684082808217f7f072d0963da7e251f Mon Sep 17 00:00:00 2001 From: Imrglop Date: Fri, 7 May 2021 19:40:54 -0400 Subject: [PATCH 285/419] fix Player::getSupplies yes --- SDK/CEntity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index 0e26ebc8..739773e1 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -11,7 +11,7 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { - static unsigned int offset = 0xBE8; + static unsigned int offset = 0xBE0; /*if (offset == 0) { offset = *reinterpret_cast(FindSignature("48 8B 51 ?? 4C 8B 82 ?? ?? ?? ?? 48 8B B2 ?? ?? ?? ?? 41 80 B8") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies }*/ From c64ee6fb50e5c676855ee21977713f2d5c8930c6 Mon Sep 17 00:00:00 2001 From: NotFamous <61636799+Hackerboi69420@users.noreply.github.com> Date: Thu, 1 Jul 2021 12:03:09 +0000 Subject: [PATCH 286/419] fix typo --- Horion/Module/Modules/JavascriptModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/JavascriptModule.cpp b/Horion/Module/Modules/JavascriptModule.cpp index 8e90d849..1982753b 100644 --- a/Horion/Module/Modules/JavascriptModule.cpp +++ b/Horion/Module/Modules/JavascriptModule.cpp @@ -4,7 +4,7 @@ JavascriptModule::JavascriptModule() : IModule(0, Category::CUSTOM, "") { } JavascriptModule::~JavascriptModule() { - logF("deleted java moduel %s", this->getModuleName()); + logF("deleted java module %s", this->getModuleName()); } void JavascriptModule::setBackingScript(std::shared_ptr mod) { From dc55f71684eeb24cfd695e93c9e82bd8e1b7e90a Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 8 Jul 2021 20:39:10 -0400 Subject: [PATCH 287/419] fix .give & other things --- Horion/Command/Commands/GiveCommand.cpp | 12 ++++++-- Horion/Module/Modules/HudModule.cpp | 3 +- Horion/Module/Modules/PacketLogger.cpp | 10 +++++-- Memory/Hooks.cpp | 20 +++++++------ SDK/CClientInstance.cpp | 2 +- SDK/CClientInstance.h | 8 +++++ SDK/CEntity.cpp | 4 +-- SDK/CInventory.h | 1 + SDK/CInventoryTransaction.cpp | 2 +- SDK/CInventoryTransaction.h | 40 +++++++++++++++++++++++-- SDK/CItem.cpp | 6 ++++ SDK/CItem.h | 13 +++++++- 12 files changed, 100 insertions(+), 21 deletions(-) diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index f4f1350e..e1fca480 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -58,16 +58,24 @@ bool GiveCommand::execute(std::vector* args) { } } + ItemDescriptor* desc = nullptr; + desc = new ItemDescriptor((*yot->item)->itemId, itemData); + C_InventoryAction* firstAction = nullptr; C_InventoryAction* secondAction = nullptr; - firstAction = new C_InventoryAction(0, yot, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, yot); + + firstAction = new C_InventoryAction(0, desc,nullptr,yot, nullptr,count, 507, 99999); + secondAction = new C_InventoryAction(slot, nullptr, desc,nullptr, yot,count); + + //firstAction = new C_InventoryAction(0,yot, nullptr, 507, 99999); + //secondAction = new C_InventoryAction(slot, nullptr, yot); transactionManager->addInventoryAction(*firstAction); transactionManager->addInventoryAction(*secondAction); delete firstAction; delete secondAction; + delete desc; inv->addItemToFirstEmptySlot(yot); diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 1bb032b3..9c9af98e 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -73,6 +73,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { } } { // ArmorHUD + /* if (!(g_Data.getLocalPlayer() == nullptr || !this->displayArmor || !GameData::canUseMoveKeys())) { static float constexpr scale = 1.f; static float constexpr opacity = 0.25f; @@ -92,7 +93,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { //x += scale * spacing; if (item->isValid()) DrawUtils::drawItem(item, vec2_t(x, y), opacity, scale, item->isEnchanted()); - } + }*/ } { // Keystrokes if (!(g_Data.getLocalPlayer() == nullptr || !this->keystrokes || !GameData::canUseMoveKeys())) { diff --git a/Horion/Module/Modules/PacketLogger.cpp b/Horion/Module/Modules/PacketLogger.cpp index 4f5e7873..874c0c61 100644 --- a/Horion/Module/Modules/PacketLogger.cpp +++ b/Horion/Module/Modules/PacketLogger.cpp @@ -11,10 +11,16 @@ const char* PacketLogger::getModuleName() { } void PacketLogger::onSendPacket(C_Packet* packet) { - if (packet->isInstanceOf()) { + /* if (packet->isInstanceOf()) { auto pk = reinterpret_cast(packet); g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s action=%i", packet->getName()->getText(), pk->action); return; + }*/ +#ifdef _DEBUG + + if (strcmp(packet->getName()->getText(), "PlayerAuthInputPacket") != 0) { + g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s", packet->getName()->getText()); } - g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s", packet->getName()->getText()); +#endif // DEBUG + } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3367c63f..fc65aac4 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -62,11 +62,11 @@ void Hooks::Init() { if (localPlayerVtable == 0x0 || sigOffset == 0x0) logF("C_LocalPlayer signature not working!!!"); else { - g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[65], Hooks::Actor_isInWater); + /*g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[65], Hooks::Actor_isInWater); g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); - g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder); + g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder);*/ } } @@ -189,7 +189,7 @@ void Hooks::Init() { void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); - void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 70 ?? 0F 29 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B F2 48 89 54 24")); + void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA 48 89 54 24 ? 4C 8B E9")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); g_Hooks.RenderTextHook->enableHook(); @@ -349,7 +349,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { using addCommandToChatHistory_t = void(__fastcall*)(uint8_t*, TextHolder*); static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC ?? 48 8B 99 ?? ?? ?? ?? 48 8B F2 80")); - TextHolder* messageHolder = reinterpret_cast(_this + 0xA70); + TextHolder* messageHolder = reinterpret_cast(_this + 0xA98); if (messageHolder->getTextLength() > 0) { char* message = messageHolder->getText(); @@ -359,14 +359,14 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { addCommandToChatHistory(_this, messageHolder); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; - __int64* v15 = *(__int64**)(*(__int64*)(_this + 0xA58) + 0x20i64); + __int64* v15 = *(__int64**)(*(__int64*)(_this + 0xA80) + 0x20i64); __int64 v16 = *v15; if (*(BYTE*)(_this + 0xA9A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x990))(v15); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x9B8))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x988))(v15); - *(DWORD*)(_this + 0xA94) = *(DWORD*)(v17 + 0x20); + v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x9B0))(v15); + *(DWORD*)(_this + 0xABC) = *(DWORD*)(v17 + 0x20); messageHolder->resetWithoutDelete(); return; @@ -415,7 +415,9 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { static auto oText = g_Hooks.RenderTextHook->GetFastcall<__int64, __int64, C_MinecraftUIRenderContext*>(); - C_GuiData* dat = g_Data.getClientInstance()->getGuiData(); + + C_ClientInstance* op = g_Data.getClientInstance(); + C_GuiData* dat = op->getGuiData(); DrawUtils::setCtx(renderCtx, dat); diff --git a/SDK/CClientInstance.cpp b/SDK/CClientInstance.cpp index 57c30f99..dd230839 100644 --- a/SDK/CClientInstance.cpp +++ b/SDK/CClientInstance.cpp @@ -8,7 +8,7 @@ __int64 MinecraftGame::getServerEntries() { } void C_GuiData::displayClientMessage(std::string *a2) { using displayClientMessage = void(__thiscall*)(void*, TextHolder&); - static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 4F ?? ?? ?? ?? 33 DB 48 89 5D ?? 88 5D")); + static displayClientMessage displayMessageFunc = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 54 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 30 4C 8B F1")); TextHolder text = TextHolder(*a2); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 62fc27b2..eb79f599 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -408,6 +408,8 @@ class C_ClientInstance { virtual __int64 getSkinRepository(void) const; virtual __int64 getSkinRepositoryClientInterface(void) const; virtual __int64 sub_140630650(void) const; + virtual void test0(); + virtual void test1(); virtual __int64 sub_1400CA400(void) const; virtual __int64 getTextures(void) const; virtual __int64 getStoreCacheTextures(void) const; @@ -422,6 +424,7 @@ class C_ClientInstance { virtual bool isAdhocEnabled(void) const; private: + virtual char sub_1406A1620(void) const; virtual __int64 linkToOffer(std::string const&, bool, std::string const&, __int64); virtual __int64 linkToAllOffers(std::string const&, std::string const&, bool, std::string const&, bool); virtual __int64 navigateToBrazeScreen(std::string const&, std::string const&, std::string const&, std::string const&, std::string const&, std::string const&, std::string const&); @@ -482,6 +485,7 @@ class C_ClientInstance { virtual bool isShowingDeathScreen(void) const; virtual bool isScreenReplaceable(void) const; virtual bool isInGame(void) const; + virtual bool sub_14070D6F0(void) const; virtual bool isInRealm(void); private: @@ -679,6 +683,10 @@ class C_ClientInstance { virtual void setSuspendInput(bool); virtual void setDisableInput(bool); +private: + virtual void subFunction(void) const; + +public: virtual void grabMouse(void); virtual void releaseMouse(void); virtual void refocusMouse(void); diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index 739773e1..e3863a74 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -6,12 +6,12 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { if (offset == 0) { // EnchantCommand::execute //offset = *reinterpret_cast(FindSignature("48 8D 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 90 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B ?? ?? ?? 8B") + 3); - offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8B 4D") + 3); + offset = *reinterpret_cast(FindSignature("48 8D 8F ? ? ? ? E8 ? ? ? ? 90 48 8D 4D ? E8 ? ? ? ? 48 8B 8D ? ? ? ? 8B 81 ? ? ? ?") + 3); } return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { - static unsigned int offset = 0xBE0; + static unsigned int offset = 0xC88; /*if (offset == 0) { offset = *reinterpret_cast(FindSignature("48 8B 51 ?? 4C 8B 82 ?? ?? ?? ?? 48 8B B2 ?? ?? ?? ?? 41 80 B8") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies }*/ diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 158bc8f1..9d1e0c3f 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -47,6 +47,7 @@ class C_Inventory { virtual __int64 addAdditionalSaveData(); // CompoundTag & virtual __int64 createTransactionContext(); // std::function, std::function virtual __int64 initializeContainerContents(C_BlockSource&); + virtual char isEmpty(); virtual __int64 add(C_ItemStack&); virtual __int64 canAdd(const C_ItemStack&); //virtual void unknown(); diff --git a/SDK/CInventoryTransaction.cpp b/SDK/CInventoryTransaction.cpp index 9462638d..58510db2 100644 --- a/SDK/CInventoryTransaction.cpp +++ b/SDK/CInventoryTransaction.cpp @@ -3,7 +3,7 @@ void C_InventoryTransactionManager::addInventoryAction(const C_InventoryAction& action,bool idk) { using InventoryTransactionManager__addAction_t = void(__fastcall*)(C_InventoryTransactionManager*, C_InventoryAction const&,bool); //static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); - static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC ? 45 0F B6 F8 48 8B EA 4C 8B F1 48 8B 01 48 8B 88 ? ? ? ? 48 85 C9")); + static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC 30 45 0F B6 F8 4C 8B F2 48 8B F1 48 8B 01 48 8B 88 ? ? ? ? 48 85 C9")); if (InventoryTransactionManager__addAction != 0) InventoryTransactionManager__addAction(this, action,idk); } diff --git a/SDK/CInventoryTransaction.h b/SDK/CInventoryTransaction.h index 9cf770d1..0669faf6 100644 --- a/SDK/CInventoryTransaction.h +++ b/SDK/CInventoryTransaction.h @@ -17,6 +17,31 @@ class C_InventoryAction { this->type = type; } + C_InventoryAction(int slot,ItemDescriptor* source ,ItemDescriptor* target ,C_ItemStack* sourceItem, C_ItemStack* targetItem, int count, int sourceType = 0, int type = 0) { + memset(this, 0x0, sizeof(C_InventoryAction)); + this->slot = slot; + + if (source != nullptr) { + this->sourceItemDescriptor = *source; + this->s_count = count; + } + + if (target != nullptr) { + this->targetItemDescriptor = *target; + this->t_count = count; + } + + + if (sourceItem != nullptr) + this->sourceItem = *sourceItem; + if (targetItem != nullptr) + this->targetItem = *targetItem; + + + this->sourceType = sourceType; + this->type = type; + } + public: int type; //0x0 // named sourceType in nukkit int sourceType; //0x4 // sometimes windowId @@ -24,8 +49,19 @@ class C_InventoryAction { int unknown; //0x8 public: int slot; //0xC - C_ItemStack sourceItem; //0x10 - C_ItemStack targetItem; //0x98 + ItemDescriptor sourceItemDescriptor; //0x10 + int s_count; //0x58 +private: + char pad_0x0058[0x34];//0x005C +public: + ItemDescriptor targetItemDescriptor; //0x90 + int t_count; //0xD8 + +private: + char pad_0x00DC[0x34]; //0x00DC +public: + C_ItemStack sourceItem; //0x110 + C_ItemStack targetItem; //0x1A0 }; class C_InventoryTransaction { diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 7195936f..b9324944 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -84,3 +84,9 @@ C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder &text) { static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B EA 48 89 54 24 ? 48 89 4C 24 ? 48 89 4D")); return ItemRegistry__lookupByNameF(a1, a2, text); } + +ItemDescriptor::ItemDescriptor(int id, int16_t itemData) { + using ItemDescriptor__ItemDescriptor_t = ItemDescriptor*(__fastcall *)(ItemDescriptor*,int,int16_t); + static ItemDescriptor__ItemDescriptor_t func = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 48 83 EC ? 33 ED 48 8B D9 48 89 29 41 8B F8 48 89 69 ? 8B F2 48 89 69 ? 66 89 69 ? C6 41")); + func(this, id, itemData); +} diff --git a/SDK/CItem.h b/SDK/CItem.h index 09eaf8de..11565322 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -37,7 +37,7 @@ class C_Item { private: - char pad_0028[136]; //0x0028 + char pad_0008[0x70]; //0x0008 public: int16_t maxStackSize; //0x0090 int16_t itemId; //0x0092 @@ -263,6 +263,17 @@ class C_Item { } }; + +class ItemDescriptor { +private: + char pad_0x0[0x48]; //0x0000 +public: + ItemDescriptor() { + memset(this, 0x0, sizeof(ItemDescriptor)); + } + ItemDescriptor(int id, int16_t itemData); +}; + class C_ItemStack { private: uintptr_t** vTable; //0x0000 From 6cfdbef4cbb4ee3cea2e885cd75ad287c2baa8d8 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Thu, 8 Jul 2021 20:42:44 -0400 Subject: [PATCH 288/419] . --- Memory/Hooks.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index fc65aac4..17f82e4d 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -416,8 +416,7 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { static auto oText = g_Hooks.RenderTextHook->GetFastcall<__int64, __int64, C_MinecraftUIRenderContext*>(); - C_ClientInstance* op = g_Data.getClientInstance(); - C_GuiData* dat = op->getGuiData(); + C_GuiData* dat = g_Data.getClientInstance()->getGuiData(); DrawUtils::setCtx(renderCtx, dat); From ec3fa1909f8525a8dc6bc0e3394b31dc54ebdbfd Mon Sep 17 00:00:00 2001 From: szeroki <36236750+Seyz123@users.noreply.github.com> Date: Fri, 9 Jul 2021 19:20:05 +0200 Subject: [PATCH 289/419] Update lerpMotion, ascendLadder, isInWater, isImmobile signatures --- Memory/Hooks.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 17f82e4d..4abc8ffa 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -208,8 +208,14 @@ void Hooks::Init() { void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ? 48 83 79")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); - void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ?? 04 ?? ?? 8B 42 04 89 81 ?? ?? ?? ?? 8B 42 08 89 81 ?? ?? ?? ?? C3")); + void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); + + void* ascendLadder = reinterpret_cast(FindSignature("C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81")); + g_Hooks.Actor_ascendLadderHook = std::make_unique(ascendLadder, Hooks::Actor_ascendLadder); + + void* isInWater = reinterpret_cast(FindSignature("0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24")); + g_Hooks.Actor_isInWaterHook = std::make_unique(isInWater, Hooks::Actor_isInWater); void* getGameEdition = reinterpret_cast(FindSignature("8B 91 ?? ?? ?? ?? 85 D2 74 1C 83 EA 01")); g_Hooks.AppPlatform_getGameEditionHook = std::make_unique(getGameEdition, Hooks::AppPlatform_getGameEdition); @@ -274,7 +280,7 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 80 B9 ? ? ? ? ? 48 8B D9 75 5E")); + void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 E8 ? ? ? ? 84 C0 75 ? 48 8B 03 48 8B CB")); g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); void* renderNameTags = reinterpret_cast(FindSignature("4C 8B DC 49 89 5B ? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 41 0F 29 73 ? 41 0F 29 7B ? 45 0F 29 43 ? 48 8B 05")); From 82b1fd1414a10bfced5869de5eea2946d888cffb Mon Sep 17 00:00:00 2001 From: yeeterlol <81702700+yeeterlol@users.noreply.github.com> Date: Tue, 3 Aug 2021 08:40:26 -0700 Subject: [PATCH 290/419] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40b273fb..f9a0b086 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you want to contribute to this project, feel free to fork this repository and **As of 09/01/20, this project is under no active development by the horion team anymore. We will still review PRs.** [![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/WPe3WeNtgv) -[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horionbeta.club/injector "Download the injector") +[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://github.com/horionclient/Horion-Releases/releases/download/3.2.5/HorionInjector_Release.zip "Download the injector") ![Total Injections](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) [![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) From 8b31568cb5094fbf58ec0072f8442a3ebf52c304 Mon Sep 17 00:00:00 2001 From: godgamer029 <> Date: Sun, 15 Aug 2021 23:28:24 +0200 Subject: [PATCH 291/419] Fix warnings --- Horion/Command/Commands/TestCommand.cpp | 4 ++-- Horion/Module/Modules/CrystalAura.cpp | 4 ++-- Horion/Module/Modules/Fly.cpp | 1 + Horion/Module/Modules/Fucker.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Horion/Command/Commands/TestCommand.cpp b/Horion/Command/Commands/TestCommand.cpp index bed737f3..88b5491a 100644 --- a/Horion/Command/Commands/TestCommand.cpp +++ b/Horion/Command/Commands/TestCommand.cpp @@ -22,11 +22,11 @@ void listEnts(C_Entity* ent, bool isValid) { void showAimedBlockInfo() { PointingStruct* pointingStruct = g_Data.getClientInstance()->getPointerStruct(); C_Block* block = g_Data.getLocalPlayer()->region->getBlock(pointingStruct->block); - int id = block->toLegacy()->blockId; + auto id = block->toLegacy()->blockId; char* name = block->toLegacy()->name.getText(); logF("---------------"); logF("Block Name: %s", name); - logF("Block ID: %d", id); + logF("Block ID: %lld", id); logF("---------------"); } diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index 47c86a1b..62a9ea6e 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -80,8 +80,8 @@ void CrystalAura::CPlace(C_GameMode* gm, vec3_t* pos) { C_Block* block = gm->player->region->getBlock(blockPos); C_Block* upperBlock = gm->player->region->getBlock(upperBlockPos); if (block != nullptr) { - int blockId = block->toLegacy()->blockId; - int upperBlockId = upperBlock->toLegacy()->blockId; + auto blockId = block->toLegacy()->blockId; + auto upperBlockId = upperBlock->toLegacy()->blockId; if ((blockId == 49 || blockId == 7) && upperBlockId == 0 && CanPlaceC(&blockPos)) { //Check for awailable block if (!ValidPos) { ValidPos = true; diff --git a/Horion/Module/Modules/Fly.cpp b/Horion/Module/Modules/Fly.cpp index 3cea59b8..3edec2a0 100644 --- a/Horion/Module/Modules/Fly.cpp +++ b/Horion/Module/Modules/Fly.cpp @@ -24,6 +24,7 @@ bool Fly::isFlashMode() { return true; break; } + return false; } void Fly::onEnable() { diff --git a/Horion/Module/Modules/Fucker.cpp b/Horion/Module/Modules/Fucker.cpp index 84e2871c..5a75ded1 100644 --- a/Horion/Module/Modules/Fucker.cpp +++ b/Horion/Module/Modules/Fucker.cpp @@ -24,7 +24,7 @@ void Fucker::onTick(C_GameMode* gm) { for (int y = (int)pos->y - range; y < pos->y + range; y++) { vec3_ti blockPos = vec3_ti(x, y, z); bool destroy = false; - int id = gm->player->region->getBlock(blockPos)->toLegacy()->blockId; + auto id = gm->player->region->getBlock(blockPos)->toLegacy()->blockId; if (id == 26 && this->beds) destroy = true; // Beds if (id == 122 && this->eggs) destroy = true; // Dragon Eggs From ec768c2bfdfcf0e3360f863fbabf792313191deb Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 15 Aug 2021 23:36:45 +0200 Subject: [PATCH 292/419] Remove version crap --- Horion/Loader.cpp | 1 - Horion/Module/Modules/NoSlowDown.cpp | 17 +++-------------- Horion/path/JoePathFinder.cpp | 5 +---- Memory/GameData.cpp | 17 ----------------- Memory/GameData.h | 10 ---------- Memory/Hooks.cpp | 5 +---- SDK/CBlockLegacy.cpp | 5 +---- 7 files changed, 6 insertions(+), 54 deletions(-) diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 6a95a8c9..f9136462 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -323,7 +323,6 @@ DWORD WINAPI start(LPVOID lpParam) { gameModule = mem.GetModule(L"Minecraft.Windows.exe"); // Get Module for Base Address MH_Initialize(); - g_Data.checkGameVersion(); GameData::initGameData(gameModule, &mem, (HMODULE)lpParam); Target::init(g_Data.getPtrLocalPlayer()); diff --git a/Horion/Module/Modules/NoSlowDown.cpp b/Horion/Module/Modules/NoSlowDown.cpp index f3017554..5b40af4d 100644 --- a/Horion/Module/Modules/NoSlowDown.cpp +++ b/Horion/Module/Modules/NoSlowDown.cpp @@ -18,11 +18,7 @@ const char* NoSlowDown::getModuleName() { void NoSlowDown::onEnable() { if (opcode == 0 || opcode1 == 0) { opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?")); - - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); - else - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); } DWORD oldProtect = 0; @@ -58,11 +54,7 @@ void NoSlowDown::onEnable() { void NoSlowDown::onDisable() { if (opcode == 0 || opcode1 == 0) { opcode = reinterpret_cast(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?")); - - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 47 ? F3 0F 10 05")); - else - opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); + opcode1 = reinterpret_cast(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?")); } DWORD oldProtect = 0; @@ -91,10 +83,7 @@ void NoSlowDown::onDisable() { opcode1[1] = 0x0F; opcode1[2] = 0x11; - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - opcode1[3] = 0x47; - else - opcode1[3] = 0x46; + opcode1[3] = 0x46; opcode1[4] = 0x0C; //opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C}; diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 399cce09..cbb94f10 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -87,10 +87,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo static uintptr_t** witherRoseVtable = nullptr; if (witherRoseVtable == nullptr) { uintptr_t sigOffset = 0; - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 48 B9"); - else - sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9"); + sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9"); int offset = *reinterpret_cast(sigOffset + 3); witherRoseVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index ae89a705..d7883ca4 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -25,23 +25,6 @@ void GameData::retrieveClientInstance() { #endif } -void GameData::checkGameVersion() { - static uintptr_t sigOffset = 0; - // near string MinimumCompatibleClientVersion - if (sigOffset == 0) - sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 48 3B CA 74 ?? 48 83 3D ?? ?? ?? ?? 10 48 0F 43 15 ?? ?? ?? ?? 4C 8B 05 ?? ?? ?? ?? E8 ?? ?? ?? ?? 49 8B C7"); - int offset = *reinterpret_cast((sigOffset + 3)); - std::string ver = reinterpret_cast(sigOffset + offset + 7)->getText(); - auto lastDot = ver.find_last_of("."); - if (lastDot == std::string::npos || lastDot >= ver.size() - 1) { - this->version = static_cast(0); - return; - } - - int num = std::stoi(ver.substr(lastDot + 1)); - this->version = static_cast(num); -} - bool GameData::canUseMoveKeys() { MinecraftGame* mc = g_Data.clientInstance->minecraftGame; if (mc == nullptr) { diff --git a/Memory/GameData.h b/Memory/GameData.h index af60fbf7..af49d2e3 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -28,13 +28,6 @@ enum DATAPACKET_CMD : int { CMD_LOG }; -enum GAMEVERSION : int { - g_1_16_0 = 0, - g_1_16_1 = 1, - g_1_16_10 = 10, - g_1_16_20 = 20 -}; - struct HorionDataPacket { DATAPACKET_CMD cmd; int params[5] = {0}; @@ -102,7 +95,6 @@ class GameData { AccountInformation accountInformation = AccountInformation::asGuest(); static void retrieveClientInstance(); TextHolder* fakeName; - GAMEVERSION version; public: NetworkedData networkedData; @@ -124,7 +116,6 @@ class GameData { static void setHIDController(C_HIDController* Hid); static void setRakNetInstance(C_RakNetInstance* raknet); static void log(const char* fmt, ...); - void checkGameVersion(); float fov = 0.f; int fps = 0; int frameCount = 0; @@ -260,7 +251,6 @@ class GameData { int getFPS() { return fps; }; int getLeftCPS() { return cpsLeft; }; int getRightCPS() { return cpsRight; }; - GAMEVERSION getVersion() { return version; }; }; extern GameData g_Data; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 4abc8ffa..81a12cf7 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -975,10 +975,7 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { static void* networkSender = nullptr; if (!networkSender) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - networkSender = reinterpret_cast(6 + FindSignature("FF 90 ?? ?? ?? ?? 4C 8D 9C 24 ?? ?? ?? ?? 49 8B 5B 18 49 8B 73 28 49 8B E3 5F C3")); - else - networkSender = reinterpret_cast(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76")); + networkSender = reinterpret_cast(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76")); } if (networkSender == _ReturnAddress()) { diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index ce26440a..6f88b868 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -29,10 +29,7 @@ void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*); static liquid_getFlow_t liquid_getDepth = nullptr; if(liquid_getDepth == nullptr){ - if(g_Data.getVersion() == GAMEVERSION::g_1_16_0) - liquid_getDepth = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 4C 24")); - else - liquid_getDepth = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C")); + liquid_getDepth = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C")); } liquid_getDepth(this, flowOut, reg, pos); } From 4ce2e124fa1b293140c97d8e63ae8b7aee436fd5 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 00:43:57 +0200 Subject: [PATCH 293/419] incomplete changes --- Horion/Module/Modules/Jetpack.cpp | 5 ++++- Memory/GameData.cpp | 4 +++- Memory/Hooks.cpp | 33 ++++++++++++------------------- Memory/Hooks.h | 6 ++---- SDK/CEntity.h | 13 +++++++----- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/Horion/Module/Modules/Jetpack.cpp b/Horion/Module/Modules/Jetpack.cpp index 04e76469..0c3a69b1 100644 --- a/Horion/Module/Modules/Jetpack.cpp +++ b/Horion/Module/Modules/Jetpack.cpp @@ -1,4 +1,5 @@ #include "Jetpack.h" +#include "../../../Utils/Logger.h" Jetpack::Jetpack() : IModule('F', Category::MOVEMENT, "Fly around like you had a Jetpack!") { registerFloatSetting("speed", &this->speedMod, 1, 0.2f, 3.f); @@ -17,6 +18,7 @@ const char* Jetpack::getModuleName() { } void Jetpack::onTick(C_GameMode* gm) { + logF("hello"); float calcYaw = (gm->player->yaw + 90) * (PI / 180); float calcPitch = (gm->player->pitch) * -(PI / 180); @@ -25,7 +27,8 @@ void Jetpack::onTick(C_GameMode* gm) { moveVec.x = cos(calcYaw) * cos(calcPitch) * speedMod; moveVec.y = sin(calcPitch) * speedMod; moveVec.z = sin(calcYaw) * cos(calcPitch) * speedMod; - + + __debugbreak(); gm->player->lerpMotion(moveVec); } else { delay++; diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index d7883ca4..359df092 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -92,6 +92,7 @@ void GameData::hide() { } void GameData::updateGameData(C_GameMode* gameMode) { + retrieveClientInstance(); g_Data.localPlayer = g_Data.getLocalPlayer(); @@ -101,10 +102,11 @@ void GameData::updateGameData(C_GameMode* gameMode) { if (g_Data.localPlayer != nullptr) { C_GuiData* guiData = g_Data.clientInstance->getGuiData(); - + if (guiData != nullptr) { { + logF("we out hjere"); auto vecLock = Logger::GetTextToPrintLock(); auto* stringPrintVector = Logger::GetTextToPrint(); #ifdef _DEBUG diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 81a12cf7..835a7716 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -33,8 +33,6 @@ void Hooks::Init() { else { g_Hooks.GameMode_startDestroyBlockHook = std::make_unique(gameModeVtable[1], Hooks::GameMode_startDestroyBlock); - g_Hooks.GameMode_tickHook = std::make_unique(gameModeVtable[9], Hooks::GameMode_tick); - g_Hooks.GameMode_getPickRangeHook = std::make_unique(gameModeVtable[10], Hooks::GameMode_getPickRange); g_Hooks.GameMode_attackHook = std::make_unique(gameModeVtable[14], Hooks::GameMode_attack); @@ -183,8 +181,8 @@ void Hooks::Init() { // Signatures { - void* surv_tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 56 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9 F3")); - g_Hooks.SurvivalMode_tickHook = std::make_unique(surv_tick, Hooks::SurvivalMode_tick); + void* player_tickworld = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 89 55 ?? 48 8B F9")); + g_Hooks.Player_tickWorldHook = std::make_unique(player_tickworld, Hooks::Player_tickWorld); void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 48 83 B9")); g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); @@ -330,23 +328,18 @@ void Hooks::Enable() { } -void Hooks::GameMode_tick(C_GameMode* _this) { - static auto oTick = g_Hooks.GameMode_tickHook->GetFastcall(); - oTick(_this); - - GameData::updateGameData(_this); - if (_this->player == g_Data.getLocalPlayer() && _this->player != nullptr) { - moduleMgr->onTick(_this); - } -} - -void Hooks::SurvivalMode_tick(C_GameMode* _this) { - static auto oTick = g_Hooks.SurvivalMode_tickHook->GetFastcall(); - oTick(_this); - GameData::updateGameData(_this); - if (_this->player == g_Data.getLocalPlayer() && _this->player != nullptr) { - moduleMgr->onTick(_this); +void* Hooks::Player_tickWorld(C_Player* _this, __int64 unk) { + static auto oTick = g_Hooks.Player_tickWorldHook->GetFastcall(); + auto o = oTick(_this, unk); + + if (_this == g_Data.getLocalPlayer()){ + // scuffed + // TODO: refactor all modules to not use GameMode + C_GameMode* gm = *reinterpret_cast(reinterpret_cast<__int64>(_this) + 4656); + GameData::updateGameData(gm); + moduleMgr->onTick(gm); } + return o; } void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 177b1a62..be88e119 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -74,8 +74,7 @@ class Hooks { static void Enable(); private: - static void GameMode_tick(C_GameMode* _this); - static void SurvivalMode_tick(C_GameMode* _this); + static void* Player_tickWorld(C_Player* _this, __int64); static void ChatScreenController_sendChatMessage(uint8_t* _this); static __int64 UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext); static __int64 UIScene_render(C_UIScene* uiscene, __int64 screencontext); @@ -125,8 +124,7 @@ class Hooks { static void InventoryTransactionManager__addAction(C_InventoryTransactionManager*, C_InventoryAction &); static void LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2,TextHolder* name, __int64 a4); - std::unique_ptr GameMode_tickHook; - std::unique_ptr SurvivalMode_tickHook; + std::unique_ptr Player_tickWorldHook; std::unique_ptr ChatScreenController_sendChatMessageHook; std::unique_ptr UIScene_setupAndRenderHook; std::unique_ptr UIScene_renderHook; diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 52f3924f..554e42fd 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -27,7 +27,7 @@ class C_Entity { public: uintptr_t *ptrToPtrToEntList; //0x0008 private: - char pad_0010[0x110]; //0x0010 + char pad_0010[0x130]; //0x0010 public: union { struct { @@ -141,8 +141,9 @@ class C_Entity { public: virtual void setPos(vec3_t const &); + virtual bool filler(); virtual vec3_t *getPredictedMovementValues(void) const; - virtual vec3_t *getPos(void) const; + virtual vec3_t *getPos(void) const; // getStateVectorComponent virtual vec3_t *getPosOld(void) const; virtual vec3_t *getPosExtrapolated(float) const; @@ -162,7 +163,8 @@ class C_Entity { virtual __int64 getInterpolatedWalkAnimSpeed(float) const; virtual __int64 getWorldPosition(); virtual void checkBlockCollisions(AABB const &); - virtual void checkBlockCollisions(void); + virtual void updateEntityInside(); + virtual void updateEntityInside(AABB const &); virtual bool isFireImmune(); virtual bool breaksFallingBlocks(void) const; virtual bool blockedByShield(__int64 const &, C_Entity &); @@ -218,13 +220,13 @@ class C_Entity { virtual bool isInWater(void) const; virtual bool hasEnteredWater(void) const; virtual bool isImmersedInWater(void) const; - virtual bool isInWaterOrRain(void) const; virtual bool isInLava(void) const; virtual bool isUnderLiquid(__int64) const; virtual bool isOverWater(void) const; private: - virtual __int64 makeStuckInBlock(float); + virtual __int64 setBlockMovementSlowdownMultiplier(vec3_t const&); + virtual __int64 resetBlockMovementSlowdownMultiplier(); virtual __int64 getCameraOffset(void) const; virtual __int64 getShadowHeightOffs(void); virtual __int64 getShadowRadius(void) const; @@ -265,6 +267,7 @@ class C_Entity { virtual bool unk2(void) const; public: + virtual bool isAffectedByWaterBottle(void) const; virtual bool canAttack(C_Entity *, bool) const; virtual void setTarget(C_Entity *); From b7dbdce4f0d3c85cf3e0997b5526f640d07b3e47 Mon Sep 17 00:00:00 2001 From: Intoprelised <78622918+Intoprelised@users.noreply.github.com> Date: Sun, 15 Aug 2021 18:44:15 -0400 Subject: [PATCH 294/419] Added SoulSpeed to enchant command (#4412) i added soulspeed to enchant command idk why it wasnt there before --- Horion/Command/Commands/EnchantCommand.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index 6c07b515..dc0372ef 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -36,6 +36,7 @@ EnchantCommand::EnchantCommand() : IMCCommand("enchant", "Enchants items", " Date: Mon, 16 Aug 2021 05:41:56 -0400 Subject: [PATCH 295/419] Fix GameMode (#4414) * update ontick and actor * fix gamemode being scuffed * Fix how did this even compile --- Horion/Module/Modules/Jetpack.cpp | 7 +-- Memory/GameData.cpp | 14 ++--- Memory/Hooks.cpp | 94 +++++++++++++------------------ Memory/Hooks.h | 28 ++++----- SDK/CEntity.h | 6 +- 5 files changed, 66 insertions(+), 83 deletions(-) diff --git a/Horion/Module/Modules/Jetpack.cpp b/Horion/Module/Modules/Jetpack.cpp index 0c3a69b1..056d555b 100644 --- a/Horion/Module/Modules/Jetpack.cpp +++ b/Horion/Module/Modules/Jetpack.cpp @@ -1,4 +1,5 @@ #include "Jetpack.h" + #include "../../../Utils/Logger.h" Jetpack::Jetpack() : IModule('F', Category::MOVEMENT, "Fly around like you had a Jetpack!") { @@ -18,7 +19,6 @@ const char* Jetpack::getModuleName() { } void Jetpack::onTick(C_GameMode* gm) { - logF("hello"); float calcYaw = (gm->player->yaw + 90) * (PI / 180); float calcPitch = (gm->player->pitch) * -(PI / 180); @@ -27,8 +27,7 @@ void Jetpack::onTick(C_GameMode* gm) { moveVec.x = cos(calcYaw) * cos(calcPitch) * speedMod; moveVec.y = sin(calcPitch) * speedMod; moveVec.z = sin(calcYaw) * cos(calcPitch) * speedMod; - - __debugbreak(); + gm->player->lerpMotion(moveVec); } else { delay++; @@ -59,4 +58,4 @@ void Jetpack::onTick(C_GameMode* gm) { delay = 0; } } -} +} \ No newline at end of file diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 359df092..a76e6ff5 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -1,6 +1,7 @@ #include "GameData.h" #include + #include "../Utils/Logger.h" #include "../Utils/Utils.h" @@ -92,7 +93,6 @@ void GameData::hide() { } void GameData::updateGameData(C_GameMode* gameMode) { - retrieveClientInstance(); g_Data.localPlayer = g_Data.getLocalPlayer(); @@ -102,11 +102,9 @@ void GameData::updateGameData(C_GameMode* gameMode) { if (g_Data.localPlayer != nullptr) { C_GuiData* guiData = g_Data.clientInstance->getGuiData(); - - + if (guiData != nullptr) { { - logF("we out hjere"); auto vecLock = Logger::GetTextToPrintLock(); auto* stringPrintVector = Logger::GetTextToPrint(); #ifdef _DEBUG @@ -114,7 +112,7 @@ void GameData::updateGameData(C_GameMode* gameMode) { std::vector::iterator it; for (it = stringPrintVector->begin(); it != stringPrintVector->end(); ++it) { numPrinted++; - if(numPrinted > 20){ + if (numPrinted > 20) { break; } @@ -133,7 +131,7 @@ void GameData::updateGameData(C_GameMode* gameMode) { std::vector::iterator it; for (it = stringPrintVector.begin(); it != stringPrintVector.end(); ++it) { numPrinted++; - if(numPrinted > 20){ + if (numPrinted > 20) { break; } @@ -223,7 +221,7 @@ void GameData::initGameData(const SlimUtils::SlimModule* gameModule, SlimUtils:: logF("base: %llX", g_Data.getModule()->ptrBase); logF("clientInstance %llX", g_Data.clientInstance); logF("localPlayer %llX", g_Data.getLocalPlayer()); - if (g_Data.clientInstance != nullptr){ + if (g_Data.clientInstance != nullptr) { logF("minecraftGame: %llX", g_Data.clientInstance->minecraftGame); logF("levelRenderer: %llX", g_Data.clientInstance->levelRenderer); } @@ -257,4 +255,4 @@ void GameData::log(const char* fmt, ...) { std::string msg(message); g_Data.textPrintList.push_back(msg); va_end(arg); -} +} \ No newline at end of file diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 835a7716..85216d71 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1,16 +1,14 @@ #include "Hooks.h" -#include "../SDK/Tag.h" - #include - +#include +#include +#include // perspective, translate, rotate +#include #include // mat4 #include //radians -#include // perspective, translate, rotate -#include -#include -#include +#include "../SDK/Tag.h" Hooks g_Hooks; bool isTicked = false; @@ -34,7 +32,7 @@ void Hooks::Init() { g_Hooks.GameMode_startDestroyBlockHook = std::make_unique(gameModeVtable[1], Hooks::GameMode_startDestroyBlock); g_Hooks.GameMode_getPickRangeHook = std::make_unique(gameModeVtable[10], Hooks::GameMode_getPickRange); - + g_Hooks.GameMode_attackHook = std::make_unique(gameModeVtable[14], Hooks::GameMode_attack); } } @@ -85,7 +83,7 @@ void Hooks::Init() { uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** directoryPackVtable = reinterpret_cast(sigOffset + offset + 7); - + { g_Hooks.DirectoryPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable[6], Hooks::DirectoryPackAccessStrategy__isTrusted); } @@ -93,11 +91,11 @@ void Hooks::Init() { uintptr_t sigOffset2 = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 49 8D 57"); int offset2 = *reinterpret_cast(sigOffset2 + 3); uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + 7); - + { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } - g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("48 89 5C 24 ? 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); + g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("48 89 5C 24 ? 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); } } @@ -112,7 +110,6 @@ void Hooks::Init() { D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_11_0 }; - DXGI_SWAP_CHAIN_DESC sd; { ZeroMemory(&sd, sizeof(sd)); @@ -130,7 +127,7 @@ void Hooks::Init() { sd.Windowed = TRUE; sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; } - + IDXGISwapChain* pSwapChain; const auto hr11 = static_castRelease(); }* - + uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 91 ?? ?? ?? ?? E8"); if (sigOffset != 0x0) { int startOffsetOffset = *reinterpret_cast((sigOffset + 3)); - uintptr_t startOffset = sigOffset + startOffsetOffset + /*length of instruction/ 7; + uintptr_t startOffset = sigOffset + startOffsetOffset + /*length of instruction/ 7; size_t secondOffset = (size_t) *reinterpret_cast((sigOffset + 10)); auto swapChain = g_Data.getSlimMem()->ReadPtr<__int64>(startOffset, {0, secondOffset, 0x170}); auto vtable = *reinterpret_cast(swapChain); @@ -208,10 +205,10 @@ void Hooks::Init() { void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); - + void* ascendLadder = reinterpret_cast(FindSignature("C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81")); g_Hooks.Actor_ascendLadderHook = std::make_unique(ascendLadder, Hooks::Actor_ascendLadder); - + void* isInWater = reinterpret_cast(FindSignature("0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24")); g_Hooks.Actor_isInWaterHook = std::make_unique(isInWater, Hooks::Actor_isInWater); @@ -263,10 +260,10 @@ void Hooks::Init() { void* _getSkinPack = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B E2 48 8B F1")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); - + void* _toStyledString = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 49 8B D8 48 8B F9")); g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); - + void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D8 4C")); g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); @@ -274,7 +271,7 @@ void Hooks::Init() { void* addAction = reinterpret_cast(FindSignature("40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 45 0F B6 F8 4C 8B F2 48 8B F9 48 8B 01 48 8B 88 ? ? ? ?")); g_Hooks.InventoryTransactionManager__addActionHook = std::make_unique(addAction, Hooks::InventoryTransactionManager__addAction); #endif - + void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); @@ -283,28 +280,28 @@ void Hooks::Init() { void* renderNameTags = reinterpret_cast(FindSignature("4C 8B DC 49 89 5B ? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 41 0F 29 73 ? 41 0F 29 7B ? 45 0F 29 43 ? 48 8B 05")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags, Hooks::LevelRendererPlayer__renderNameTags); - + static constexpr auto counterStart = __COUNTER__ + 1; #define lambda_counter (__COUNTER__ - counterStart) - + void* levelRendererBobView = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B D9 0F 29 B4 24 ?? ?? ?? ?? 48 8B 89")); static auto bobViewHookF = [](__int64 _this, glm::mat4& matrix, float lerpT){ static auto origFunc = g_Hooks.lambdaHooks.at(lambda_counter)->GetFastcall(); - + /*auto p = g_Data.getLocalPlayer(); float degrees = fmodf(p->getPosOld()->lerp(p->getPos(), lerpT).x, 5) - 2.5f; degrees *= 180 / 2.5f; auto pos = g_Data.getClientInstance()->levelRenderer->origin; - + glm::mat4 View = matrix; - + matrix = View; //matrix = glm::rotate(matrix, glm::radians(degrees), glm::vec3(0, 0, 1));*/ return origFunc(_this, matrix, lerpT); }; - + std::shared_ptr bobViewHook = std::make_shared(levelRendererBobView, (decltype(&bobViewHookF.operator()))bobViewHookF); g_Hooks.lambdaHooks.push_back(bobViewHook); @@ -325,17 +322,15 @@ void Hooks::Restore() { void Hooks::Enable() { logF("Hooks enabled"); MH_EnableHook(MH_ALL_HOOKS); - } void* Hooks::Player_tickWorld(C_Player* _this, __int64 unk) { static auto oTick = g_Hooks.Player_tickWorldHook->GetFastcall(); auto o = oTick(_this, unk); - - if (_this == g_Data.getLocalPlayer()){ - // scuffed + + if (_this == g_Data.getLocalPlayer()) { // TODO: refactor all modules to not use GameMode - C_GameMode* gm = *reinterpret_cast(reinterpret_cast<__int64>(_this) + 4656); + C_GameMode* gm = *reinterpret_cast(reinterpret_cast<__int64>(_this) + 4840); GameData::updateGameData(gm); moduleMgr->onTick(gm); } @@ -403,7 +398,7 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { if (alloc.getTextLength() < 100) { strcpy_s(g_Hooks.currentScreenName, alloc.getText()); } - + if (!g_Hooks.shouldRender) { g_Hooks.shouldRender = alwaysRender || (strcmp(alloc.getText(), "start_screen") == 0 || (alloc.getTextLength() >= 11 && strncmp(alloc.getText(), "play_screen", 11)) == 0); } @@ -429,7 +424,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { } static bool hasSentWarning = false; if (!g_Data.isInjectorConnectionActive() && !hasSentWarning) { - __int64 retval = oText(a1, renderCtx); LARGE_INTEGER end, elapsed; @@ -455,7 +449,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { DrawUtils::flush();*/ } - if(!hasSentWarning) // Wait for injector, it might connect in time + if (!hasSentWarning) // Wait for injector, it might connect in time return retval; } else wasConnectedBefore = true; @@ -623,7 +617,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { g_Data.sendPacketToInjector(packet); } } - } else { shouldRenderTabGui = hudModule->tabgui && hudModule->isEnabled(); shouldRenderArrayList = hudModule->arraylist && hudModule->isEnabled(); @@ -684,7 +677,6 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { // Draw ArrayList if (moduleMgr->isInitialized() && shouldRenderArrayList) { - // Parameters float textSize = hudModule->scale; float textPadding = 1.0f * textSize; @@ -970,12 +962,12 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { if (!networkSender) { networkSender = reinterpret_cast(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76")); } - + if (networkSender == _ReturnAddress()) { motVec = _this->velocity.lerp(motVec, noKnockbackmod->xModifier, noKnockbackmod->yModifier, noKnockbackmod->xModifier); } } - + oLerp(_this, motVec); } @@ -1150,11 +1142,11 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe if (autoSneakMod->isEnabled() && g_Data.getLocalPlayer() != nullptr && autoSneakMod->doSilent && packet->isInstanceOf()) { auto* pp = reinterpret_cast(packet); - - if (pp->action == 12 && pp->entityRuntimeId == g_Data.getLocalPlayer()->entityRuntimeId) - return; //dont send uncrouch + + if (pp->action == 12 && pp->entityRuntimeId == g_Data.getLocalPlayer()->entityRuntimeId) + return; //dont send uncrouch } - + moduleMgr->onSendPacket(packet); if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { @@ -1357,7 +1349,7 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { static auto oFunc = g_Hooks.ChestScreenController_tickHook->GetFastcall<__int64, C_ChestScreenController*>(); static auto chestStealerMod = moduleMgr->getModule(); - if(chestStealerMod->isEnabled()) chestStealerMod->chestScreenController_tick(a1); + if (chestStealerMod->isEnabled()) chestStealerMod->chestScreenController_tick(a1); return oFunc(a1); } @@ -1554,7 +1546,7 @@ __int64 Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { if (NoPaintingCrashMod->isEnabled()) return 0; - return Func(_this,a2,a3); + return Func(_this, a2, a3); } bool Hooks::DirectoryPackAccessStrategy__isTrusted(__int64 _this) { @@ -1567,7 +1559,7 @@ bool Hooks::DirectoryPackAccessStrategy__isTrusted(__int64 _this) { int offset = *reinterpret_cast(sigOffset + 3); directoryPackAccessStrategyVtable = reinterpret_cast(sigOffset + offset + 7); } - + if (*reinterpret_cast(_this) == (uintptr_t)directoryPackAccessStrategyVtable) return true; @@ -1742,7 +1734,6 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT _D3DVECTOR4 color; }; - static bool init = false; static ID3D11Device* device; static ID3D11DeviceContext* context; @@ -1766,7 +1757,6 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT {"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0} }; - bufferDesc.Usage = D3D11_USAGE_DYNAMIC; bufferDesc.ByteWidth = 50 * sizeof(VertexType); @@ -1869,7 +1859,6 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT result = device->CreateBuffer(&indexBufferDesc, &indexData, &indexBuffer); if (FAILED(result)) { logF("CreateBuffer2 %llX", result); - } } @@ -1877,7 +1866,7 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT } /* - + ImGui_ImplDX11_NewFrame(); ImGui_ImplWin32_NewFrame(); @@ -1889,7 +1878,6 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT ImGui::NewFrame(); - ImGui::Begin("bean"); ImGui::Text("Hello"); @@ -1931,7 +1919,7 @@ HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT context->IASetIndexBuffer(indexBuffer, DXGI_FORMAT_R32_UINT, 0); context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); context->IASetInputLayout(m_pInputLayout); - + context->DrawIndexed(3, 0, 0); #endif @@ -1967,7 +1955,6 @@ __int64 Hooks::Cube__compile(__int64 a1, __int64 a2) { auto it = *reinterpret_cast<__int64*>(a1 + 0x30); auto boi = it + 0x1C; while (it != end) { // loop through PolygonQuad - if (it != boi + 0x34) { auto iter2 = boi - 0xC; do { @@ -1975,7 +1962,6 @@ __int64 Hooks::Cube__compile(__int64 a1, __int64 a2) { float* floatyBoi = reinterpret_cast(iter2 - 16); logF("%.1f %.1f %.1f", floatyBoi[0], floatyBoi[1], floatyBoi[2]); iter2 += 0x14; - } while (iter2 - 0x10 != boi + 0x34); } boi += 0x50; @@ -2074,4 +2060,4 @@ void Hooks::LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2, TextHold } return func(a1, a2, a3, a4); -} +} \ No newline at end of file diff --git a/Memory/Hooks.h b/Memory/Hooks.h index be88e119..4da29c2f 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -12,6 +12,7 @@ #include "../Horion/Menu/TabGui.h" #include "../Horion/Module/ModuleManager.h" #include "../SDK/CBlockLegacy.h" +#include "../SDK/CCamera.h" #include "../SDK/CChestBlockActor.h" #include "../SDK/CGameMode.h" #include "../SDK/CMinecraftUIRenderContext.h" @@ -19,19 +20,19 @@ #include "../SDK/CRakNetInstance.h" #include "../SDK/CUIScene.h" #include "../SDK/TextHolder.h" -#include "../SDK/CCamera.h" -#include "../Utils/TextFormat.h" #include "../Utils/SkinUtil.h" +#include "../Utils/TextFormat.h" #include "../resource.h" #include "GameData.h" #include "MinHook.h" //#include "../Horion/Game/Game.h" -#include -#include -#include #include #include +#include +#include + +#include #include "../include/d3dx11async.h" @@ -42,12 +43,12 @@ struct CoolSkinData { TextHolder unknown; TextHolder unknown2; TextHolder skinResourcePatch; // 0x040 - TextHolder geometryName; // 0x060 "geometry.humanoid.custom" + TextHolder geometryName; // 0x060 "geometry.humanoid.custom" unsigned char gap2[0x40]; // 0x080 void* startAnimatedFrames; // 0x0C0 void* endAnimatedFrames; // 0x0C8 - unsigned char gap3[0x8]; // 0x0D0 - TextHolder geometryData; // 0x0D8 + unsigned char gap3[0x8]; // 0x0D0 + TextHolder geometryData; // 0x0D8 TextHolder skinAnimationData; // 0x0F8 unsigned char gap4[0x20]; // 0x118 bool isPremiumSkin; // 0x138 @@ -65,7 +66,7 @@ class Hooks { private: bool shouldRender = true; char currentScreenName[100]; - + public: std::vector> lambdaHooks; @@ -117,12 +118,12 @@ class Hooks { static __int64 prepFeaturedServersFirstTime(__int64 a1, __int64 a2); static HRESULT swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT flags); static __int64 InGamePlayScreen___renderLevel(__int64 playScreen, __int64 a2, __int64 a3); - static HRESULT swapChain__ResizeBuffers(IDXGISwapChain* chain, UINT bufferCount, UINT Width, UINT Height,DXGI_FORMAT Newformat,UINT SwapChainFlags); + static HRESULT swapChain__ResizeBuffers(IDXGISwapChain* chain, UINT bufferCount, UINT Width, UINT Height, DXGI_FORMAT Newformat, UINT SwapChainFlags); static __int64 Cube__compile(__int64 a1, __int64 a2); static void LocalPlayer__updateFromCamera(__int64 a1, C_Camera* a2); static bool Mob__isImmobile(C_Entity*); - static void InventoryTransactionManager__addAction(C_InventoryTransactionManager*, C_InventoryAction &); - static void LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2,TextHolder* name, __int64 a4); + static void InventoryTransactionManager__addAction(C_InventoryTransactionManager*, C_InventoryAction&); + static void LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2, TextHolder* name, __int64 a4); std::unique_ptr Player_tickWorldHook; std::unique_ptr ChatScreenController_sendChatMessageHook; @@ -206,9 +207,8 @@ class FuncHook { int ret = enable ? MH_EnableHook(funcPtr) : MH_DisableHook(funcPtr); if (ret != MH_OK) logF("MH_EnableHook = %i", ret); - }else + } else logF("enableHook() called with nullptr func!"); - } ~FuncHook() { diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 554e42fd..26671600 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -141,9 +141,9 @@ class C_Entity { public: virtual void setPos(vec3_t const &); - virtual bool filler(); + virtual bool filler(); virtual vec3_t *getPredictedMovementValues(void) const; - virtual vec3_t *getPos(void) const; // getStateVectorComponent + virtual vec3_t *getPos(void) const; // getStateVectorComponent virtual vec3_t *getPosOld(void) const; virtual vec3_t *getPosExtrapolated(float) const; @@ -225,7 +225,7 @@ class C_Entity { virtual bool isOverWater(void) const; private: - virtual __int64 setBlockMovementSlowdownMultiplier(vec3_t const&); + virtual __int64 setBlockMovementSlowdownMultiplier(vec3_t const &); virtual __int64 resetBlockMovementSlowdownMultiplier(); virtual __int64 getCameraOffset(void) const; virtual __int64 getShadowHeightOffs(void); From c3e95e54451e72311a0e37be341023d4a0f4450c Mon Sep 17 00:00:00 2001 From: Intoprelised <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 16 Aug 2021 05:43:11 -0400 Subject: [PATCH 296/419] Added intensity slider to fullbright (#4413) * Added SoulSpeed to enchant command i added soulspeed to enchant command idk why it wasnt there before * Added Intensity slider to fullbright * Change default intensity to previous intensity Co-authored-by: GodGamer029 <43895351+GodGamer029@users.noreply.github.com> --- Horion/Module/Modules/FullBright.cpp | 1 + Horion/Module/Modules/FullBright.h | 1 + Memory/Hooks.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/FullBright.cpp b/Horion/Module/Modules/FullBright.cpp index 9883b826..4091771f 100644 --- a/Horion/Module/Modules/FullBright.cpp +++ b/Horion/Module/Modules/FullBright.cpp @@ -1,6 +1,7 @@ #include "FullBright.h" FullBright::FullBright() : IModule(0, Category::VISUAL, "Puts your gamma to max") { + registerFloatSetting("Intensity", &this->intensity, this->intensity, -100.f, 10.f); } FullBright::~FullBright() { diff --git a/Horion/Module/Modules/FullBright.h b/Horion/Module/Modules/FullBright.h index f9e48718..d3a86f7e 100644 --- a/Horion/Module/Modules/FullBright.h +++ b/Horion/Module/Modules/FullBright.h @@ -2,6 +2,7 @@ #include "Module.h" class FullBright : public IModule { public: + float intensity = 25.f; float* gammaPtr = nullptr; FullBright(); ~FullBright(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 85216d71..43eab3af 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1357,7 +1357,7 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { float Hooks::GetGamma(uintptr_t* a1) { static auto fullBrightModule = moduleMgr->getModule(); if (fullBrightModule->isEnabled()) - return 25.f; + return fullBrightModule->intensity; //Get the normal gamma value float* gamer = (float*)*(a1 + 0x27); From 98633bd961f011d0bd9315bb04c1eba514e5783d Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 12:05:20 +0200 Subject: [PATCH 297/419] Fail to fix command history --- Memory/Hooks.cpp | 20 +++++++++++++++----- SDK/TextHolder.h | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 43eab3af..8434fe85 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -343,6 +343,13 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { using addCommandToChatHistory_t = void(__fastcall*)(uint8_t*, TextHolder*); static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC ?? 48 8B 99 ?? ?? ?? ?? 48 8B F2 80")); + using updateTextbox_t = void(__fastcall*)(__int64, TextHolder*); + static updateTextbox_t updateTextbox = reinterpret_cast(0); + if (updateTextbox == nullptr) { + auto sig = FindSignature("E8 ? ? ? ? 48 8D 8B ? ? ? ? 0F 57 C0"); + updateTextbox = reinterpret_cast(sig + 5 + *reinterpret_cast(sig + 1)); + } + TextHolder* messageHolder = reinterpret_cast(_this + 0xA98); if (messageHolder->getTextLength() > 0) { char* message = messageHolder->getText(); @@ -353,16 +360,19 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { addCommandToChatHistory(_this, messageHolder); // This will put the command in the chat history (Arrow up/down) __int64 v17 = 0; - __int64* v15 = *(__int64**)(*(__int64*)(_this + 0xA80) + 0x20i64); - __int64 v16 = *v15; + C_ClientInstance* v15 = g_Data.getClientInstance(); + __int64 vtable = *reinterpret_cast<__int64*>(v15); - if (*(BYTE*)(_this + 0xA9A)) - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x9B8))(v15); + if (*(BYTE*)(_this + 0xA9A)) // isDevConsole + v17 = (*(__int64(__cdecl**)(C_ClientInstance*))(vtable + 0x9B8))(v15); else - v17 = (*(__int64(__cdecl**)(__int64*))(v16 + 0x9B0))(v15); + v17 = (*(__int64(__cdecl**)(C_ClientInstance*))(vtable + 0x9B0))(v15); *(DWORD*)(_this + 0xABC) = *(DWORD*)(v17 + 0x20); messageHolder->resetWithoutDelete(); + // MinecraftScreenModel::updateTextBoxText + updateTextbox(0, messageHolder); + return; } else if (*message == '.') { // maybe the user forgot his prefix, give him some helpful advice diff --git a/SDK/TextHolder.h b/SDK/TextHolder.h index 8fa051ab..3976d5d8 100644 --- a/SDK/TextHolder.h +++ b/SDK/TextHolder.h @@ -183,7 +183,8 @@ class TextHolder { } void resetWithoutDelete() { - memset(this, 0, sizeof(TextHolder)); + *getText() = 0; + textLength = 0; } }; From d7324984397fe501cba6620fafd81db036fe43ca Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 12:53:48 +0200 Subject: [PATCH 298/419] Fix joe pathfinding, execution still bugged --- Horion/path/JoePathFinder.cpp | 3 ++- Memory/Hooks.cpp | 8 +++++--- SDK/CBlockLegacy.cpp | 3 ++- SDK/CClientInstance.h | 4 ++-- Utils/Utils.h | 5 +++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index cbb94f10..3698ab6f 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -70,7 +70,8 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo return true; // contact damage based - { + // TODO: refactor this to use tile names and cache vtables + if(false){ // there is a function called dealsContactDamage but it takes in so many parameters + plant growth that its not useful anymore static uintptr_t** cactusBlockVtable = nullptr; if (cactusBlockVtable == nullptr) { diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 8434fe85..001749ab 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -45,8 +45,8 @@ void Hooks::Init() { if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { - g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[168], Hooks::BlockLegacy_getRenderLayer); - g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[171], Hooks::BlockLegacy_getLightEmission); + g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[180], Hooks::BlockLegacy_getRenderLayer); + g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[183], Hooks::BlockLegacy_getLightEmission); } } @@ -402,9 +402,10 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { bool alwaysRender = moduleMgr->isInitialized() && moduleMgr->getModule()->alwaysShow; - TextHolder alloc = {}; + TextHolder alloc{}; uiscene->getScreenName(&alloc); + if (alloc.getTextLength() < 100) { strcpy_s(g_Hooks.currentScreenName, alloc.getText()); } @@ -412,6 +413,7 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { if (!g_Hooks.shouldRender) { g_Hooks.shouldRender = alwaysRender || (strcmp(alloc.getText(), "start_screen") == 0 || (alloc.getTextLength() >= 11 && strncmp(alloc.getText(), "play_screen", 11)) == 0); } + alloc.alignedTextLength = 0; alloc.resetWithoutDelete(); return oRender(uiscene, screencontext); diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 6f88b868..b8961374 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -2,6 +2,7 @@ #include "../Memory/GameData.h" #include "../Utils/Utils.h" +#include "../Utils/Logger.h" C_Block* C_BlockSource::getBlock(const vec3_ti& block) { using getBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); static getBlock_t getBlock = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ? 48 8B F9 48 8B DA 8B 4A")); @@ -14,7 +15,7 @@ C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { } C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { using getLiquidBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getLiquidBlock_t getLiquidBlock = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC ?? 83 7A ?? 00 48 8B DA 48 8B F9 7C")); + static getLiquidBlock_t getLiquidBlock = Utils::FuncFromSigOffset(FindSignature("E8 ? ? ? ? 48 8B C8 48 8B 47 ? "), 1); return getLiquidBlock(this, block); } bool C_BlockLegacy::getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor) { diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index eb79f599..13928e65 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -251,7 +251,7 @@ class C_ClientInstance { public: C_LocalPlayer* localPlayer; //0x0138 private: - char pad[0x380]; // 0x0140 + char pad[0x388]; // 0x0140 public: struct { char pad[0x238]; @@ -259,7 +259,7 @@ class C_ClientInstance { __int64 materialPtr; size_t refCount; } entityLineMaterial; - } *itemInHandRenderer; // 0x04C0 + } *itemInHandRenderer; // 0x04C8 private: virtual __int64 destructorClientInstance(); diff --git a/Utils/Utils.h b/Utils/Utils.h index 0bedc03f..6af165bf 100644 --- a/Utils/Utils.h +++ b/Utils/Utils.h @@ -340,6 +340,11 @@ class Utils { return (*static_cast(thisptr))[IIdx](thisptr, argList...); } + template < typename ret> + static inline auto FuncFromSigOffset(uintptr_t sig, int offset) -> ret { + return reinterpret_cast(sig + offset + 4 + *reinterpret_cast(sig + offset)); + } + // https://stackoverflow.com/a/34571089 static std::string base64_encode(const std::string& in) { std::string out; From 9596eba490941333a799bbf8a85a33b6dd27bd83 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 13:34:07 +0200 Subject: [PATCH 299/419] Fixed some more crashes, jumping still bugged and sometimes crashes --- Horion/Module/Modules/FollowPathModule.cpp | 2 +- Horion/path/JoeMovementController.cpp | 6 +++--- Memory/Hooks.cpp | 2 -- SDK/CBlockLegacy.cpp | 8 +++----- SDK/CMoveInputHandler.h | 7 +++---- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Horion/Module/Modules/FollowPathModule.cpp b/Horion/Module/Modules/FollowPathModule.cpp index 26e2be40..b3d23ec5 100644 --- a/Horion/Module/Modules/FollowPathModule.cpp +++ b/Horion/Module/Modules/FollowPathModule.cpp @@ -99,7 +99,7 @@ void FollowPathModule::onMove(C_MoveInputHandler *handler) { }else if(!pathFinder){ this->setEnabled(false); }else if(g_Data.getLocalPlayer()->isInWater()){ - handler->autoJumpInWater = true; + handler->isJumping = true; } }else{ this->clientMessageF("%sDone!", GREEN); diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 71716287..46f605c7 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -89,7 +89,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move break; }else if(inWater){ if(pPos.y < end.y || player->velocity.y < 0.12f) - movementHandler->autoJumpInWater = 1; + movementHandler->isJumping = 1; } }else{ dComp = 10; @@ -156,14 +156,14 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move } if(pPos.y + 0.1f < end.y) - movementHandler->autoJumpInWater = 1; + movementHandler->isJumping = 1; else if(pPos.y > end.y) movementHandler->isSneakDown = 1; }else{ if(player->isInWater()) - movementHandler->autoJumpInWater = 1; + movementHandler->isJumping = 1; tangent.y = 0; tangent = tangent.normalize(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 001749ab..1745dc94 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -405,7 +405,6 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { TextHolder alloc{}; uiscene->getScreenName(&alloc); - if (alloc.getTextLength() < 100) { strcpy_s(g_Hooks.currentScreenName, alloc.getText()); } @@ -414,7 +413,6 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { g_Hooks.shouldRender = alwaysRender || (strcmp(alloc.getText(), "start_screen") == 0 || (alloc.getTextLength() >= 11 && strncmp(alloc.getText(), "play_screen", 11)) == 0); } alloc.alignedTextLength = 0; - alloc.resetWithoutDelete(); return oRender(uiscene, screencontext); } diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index b8961374..609ad6a6 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -15,7 +15,7 @@ C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { } C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { using getLiquidBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getLiquidBlock_t getLiquidBlock = Utils::FuncFromSigOffset(FindSignature("E8 ? ? ? ? 48 8B C8 48 8B 47 ? "), 1); + static getLiquidBlock_t getLiquidBlock = Utils::FuncFromSigOffset(FindSignature("E8 ? ? ? ? 48 8B C8 48 8B 47 ?"), 1); return getLiquidBlock(this, block); } bool C_BlockLegacy::getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor) { @@ -28,10 +28,8 @@ int C_BlockLegacy::liquidGetDepth(C_BlockSource* reg, const vec3_ti* pos) { } void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec3_ti* pos) { using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*); - static liquid_getFlow_t liquid_getDepth = nullptr; - if(liquid_getDepth == nullptr){ - liquid_getDepth = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C")); - } + static liquid_getFlow_t liquid_getDepth = Utils::FuncFromSigOffset(FindSignature("E8 ? ? ? ? 48 8B 4C 24 ? F3 0F 10 01"), 1); + liquid_getDepth(this, flowOut, reg, pos); } bool C_BlockLegacy::hasWater(C_BlockSource* reg, const vec3_ti& pos) { diff --git a/SDK/CMoveInputHandler.h b/SDK/CMoveInputHandler.h index fa1b6ba5..3b081cb4 100644 --- a/SDK/CMoveInputHandler.h +++ b/SDK/CMoveInputHandler.h @@ -11,12 +11,11 @@ class C_MoveInputHandler { public: unsigned char isSneakDown; //0x0049 private: - char pad_0x004A[0x5]; //0x004A + char pad_0x004A[0x11]; //0x004A public: - unsigned char isJumping; //0x004F - unsigned char autoJumpInWater; //0x0050 + unsigned char isJumping; //0x005B private: - char pad_0x0051[0xE]; //0x0051 + char pad_0x0051[0x3]; //0x005C public: bool forward; //0x005F bool backward; //0x0060 From fad9fb964443317af242938dbdb3278fbbc99330 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 14:08:53 +0200 Subject: [PATCH 300/419] Fix jumping --- Horion/Module/Modules/TestModule.cpp | 12 ++++++------ SDK/CMoveInputHandler.h | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index 5ba7ba57..d5040bcc 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -108,7 +108,7 @@ void loadFile(std::wstring filePath) { } void TestModule::onEnable() { - renderPos.clear(); + /* renderPos.clear(); HorionDataPacket packet; packet.cmd = CMD_FILECHOOSER; @@ -138,7 +138,7 @@ void TestModule::onEnable() { } }); - g_Data.sendPacketToInjector(packet); + g_Data.sendPacketToInjector(packet);*/ } bool tryPlace(const vec3_ti& blockPos) { @@ -178,7 +178,7 @@ bool tryPlace(const vec3_ti& blockPos) { } void TestModule::onTick(C_GameMode* gm) { - if (g_Data.getLocalPlayer() == nullptr) + /* if (g_Data.getLocalPlayer() == nullptr) return; if (!g_Data.canUseMoveKeys()) return; @@ -202,11 +202,10 @@ void TestModule::onTick(C_GameMode* gm) { } } - } + }*/ } void TestModule::onMove(C_MoveInputHandler* hand){ - } void TestModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { @@ -224,6 +223,7 @@ void TestModule::onDisable() { float t = 0; void TestModule::onLevelRender() { + /* DrawUtils::setColor(0.8f, 0.4f, 0.4f, 1); int radius = 50; @@ -240,6 +240,6 @@ void TestModule::onLevelRender() { if (!blockLegacy->material->isReplaceable) continue; DrawUtils::drawBox3d(pos.toFloatVector(), pos.add(1, 1, 1).toFloatVector()); - } + }*/ } diff --git a/SDK/CMoveInputHandler.h b/SDK/CMoveInputHandler.h index 3b081cb4..521fc50f 100644 --- a/SDK/CMoveInputHandler.h +++ b/SDK/CMoveInputHandler.h @@ -11,11 +11,13 @@ class C_MoveInputHandler { public: unsigned char isSneakDown; //0x0049 private: - char pad_0x004A[0x11]; //0x004A + char pad_0x004A[0x5]; //0x004A public: - unsigned char isJumping; //0x005B + unsigned char isJumping; //0x004F + unsigned char autoJumpInWater; // 50 + private: - char pad_0x0051[0x3]; //0x005C + char pad_0x0051[0xE]; //0x0051 public: bool forward; //0x005F bool backward; //0x0060 From 125af1a6bcab9823ebd93a94414b2f71fa00fd2d Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 14:19:33 +0200 Subject: [PATCH 301/419] Fix joe rendering (thanks to @Onix86 on discord) --- Horion/Module/Modules/TestModule.cpp | 1 + SDK/CClientInstance.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index d5040bcc..e6fea25e 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -178,6 +178,7 @@ bool tryPlace(const vec3_ti& blockPos) { } void TestModule::onTick(C_GameMode* gm) { + /* if (g_Data.getLocalPlayer() == nullptr) return; if (!g_Data.canUseMoveKeys()) diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 13928e65..65329f22 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -101,7 +101,7 @@ class LevelRenderer { public: BlockTessellator* blockTessellator; // 0x02D8 private: - char pad_0x02F0[0x5EC]; //0x02E0 + char pad_0x02F0[0x568]; //0x02E0 public: vec3_t origin; //0x0890 @@ -826,8 +826,8 @@ class C_ClientInstance { vec2_t getFov() { uintptr_t _this = reinterpret_cast(this); vec2_t fov; - fov.x = *reinterpret_cast(_this + 0x658); - fov.y = *reinterpret_cast(_this + 0x66C); + fov.x = *reinterpret_cast(_this + 0x660); + fov.y = *reinterpret_cast(_this + 0x674); return fov; } From fcb3b79ac66c16a24954763e4be930a1078bbf5f Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 15:36:24 +0200 Subject: [PATCH 302/419] Fix Joe by running it on the main thread --- Horion/Module/Modules/FollowPathModule.cpp | 54 ++++++++++++---------- Horion/Module/Modules/NoWeb.cpp | 2 +- Horion/Module/Modules/TestModule.cpp | 11 +++++ Horion/path/JoeMovementController.cpp | 7 +-- Horion/path/JoePathFinder.cpp | 6 ++- Memory/Hooks.cpp | 2 +- SDK/CBlockLegacy.cpp | 6 +-- SDK/CBlockLegacy.h | 1 - SDK/CEntity.h | 21 ++++++--- 9 files changed, 66 insertions(+), 44 deletions(-) diff --git a/Horion/Module/Modules/FollowPathModule.cpp b/Horion/Module/Modules/FollowPathModule.cpp index b3d23ec5..9a797dc9 100644 --- a/Horion/Module/Modules/FollowPathModule.cpp +++ b/Horion/Module/Modules/FollowPathModule.cpp @@ -15,7 +15,7 @@ void FollowPathModule::startSearch(vec3_ti startNode, C_BlockSource* region, flo } this->pathFinder = std::make_shared(startNode, region, this->goal); this->pathFinder->pathSearchTimeout = searchTimeout; - std::thread([this, callback](){ + //std::thread([this, callback](){ auto ref = this->pathFinder; // so it won't get deleted when followpathmodule is disabled auto tempPath = this->pathFinder->findPath(); this->pathFinder.reset(); @@ -24,9 +24,11 @@ void FollowPathModule::startSearch(vec3_ti startNode, C_BlockSource* region, flo return; } callback(true, tempPath); - }).detach(); + //}).detach(); } + +bool shouldStartSearch = false; void FollowPathModule::onEnable() { if(!g_Data.isInGame() || !g_Data.getLocalPlayer()->isAlive()){ setEnabled(false); @@ -38,24 +40,44 @@ void FollowPathModule::onEnable() { setEnabled(false); return; } + shouldStartSearch = true; +} + +void FollowPathModule::onDisable() { + shouldStartSearch = false; + if(this->pathFinder) + this->pathFinder->terminateSearch = true; + this->engageDelay = -1; + + this->pathFinder.reset(); + this->path.reset(); + this->nextPath.reset(); + this->movementController.reset(); + this->goal.reset(); +} + +void FollowPathModule::onTick(C_GameMode *mode) { + if (!shouldStartSearch) + return; + shouldStartSearch = false; auto player = g_Data.getLocalPlayer(); auto pPos = player->eyePos0; vec3_ti startNode((int)floorf(pPos.x), (int)roundf(pPos.y - 1.62f), (int)floorf(pPos.z)); - this->startSearch(startNode, player->region, 3, [&](bool succeeded, JoePath tempPath){ - if(!succeeded){ + this->startSearch(startNode, player->region, 0.5f, [&](bool succeeded, JoePath tempPath) { + if (!succeeded) { + this->clientMessageF("%sCould not find a path!", RED); this->path.reset(); this->movementController.reset(); this->setEnabled(false); - this->clientMessageF("%sCould not find a path!", RED); this->engageDelay = -1; return; } this->clientMessageF("%sFound %s path!", tempPath.isIncomplete1() ? YELLOW : GREEN, tempPath.isIncomplete1() ? "incomplete" : "complete"); - if(tempPath.isIncomplete1()){ + if (tempPath.isIncomplete1()) { tempPath.cutoff(0.9f); } this->engageDelay = 10; @@ -65,22 +87,6 @@ void FollowPathModule::onEnable() { }); } -void FollowPathModule::onDisable() { - if(this->pathFinder) - this->pathFinder->terminateSearch = true; - this->engageDelay = -1; - - this->pathFinder.reset(); - this->path.reset(); - this->nextPath.reset(); - this->movementController.reset(); - this->goal.reset(); -} - -void FollowPathModule::onTick(C_GameMode *mode) { - -} - void FollowPathModule::onMove(C_MoveInputHandler *handler) { if(this->movementController){ this->movementController->step(g_Data.getLocalPlayer(), g_Data.getClientInstance()->getMoveTurnInput()); @@ -158,8 +164,8 @@ void FollowPathModule::onLevelRender() { if(this->movementController && this->path){ this->path->draw(this->movementController->getCurrentPathSegment()); - }else if(this->pathFinder){ + } /* else if (this->pathFinder) { JoePath localPath = this->pathFinder->getCurrentPath(); localPath.draw(-1); // copy so we avoid drawing while its being updated by the pathfinder - } + }*/ } diff --git a/Horion/Module/Modules/NoWeb.cpp b/Horion/Module/Modules/NoWeb.cpp index 880f5f81..6242b7a1 100644 --- a/Horion/Module/Modules/NoWeb.cpp +++ b/Horion/Module/Modules/NoWeb.cpp @@ -11,5 +11,5 @@ const char* NoWeb::getModuleName() { } void NoWeb::onTick(C_GameMode* gm) { - gm->player->web = 0.f; + gm->player->slowdownFactor = {0, 0, 0}; } diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index e6fea25e..cc56104a 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -15,6 +15,10 @@ #include #include #include "../../../Utils/Json.hpp" +#include "../../path/JoePathFinder.h" +#include "../../path/JoeMovementController.h" +#include "../../path/goals/JoeGoal.h" +#include "../../path/goals/JoeGoalXZ.h" using json = nlohmann::json; @@ -179,6 +183,13 @@ bool tryPlace(const vec3_ti& blockPos) { void TestModule::onTick(C_GameMode* gm) { + auto player = g_Data.getLocalPlayer(); + auto pPos = player->eyePos0; + vec3_ti startNode((int)floorf(pPos.x), (int)roundf(pPos.y - 1.62f), (int)floorf(pPos.z)); + auto pathFinder = std::make_shared(startNode, player->region, std::make_unique(vec3_ti(143, 0, -41))); + pathFinder->pathSearchTimeout = 1; + pathFinder->findPath(); + /* if (g_Data.getLocalPlayer() == nullptr) return; if (!g_Data.canUseMoveKeys()) diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 46f605c7..fdd58f7c 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -58,14 +58,15 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move tangent = tangent.normalize(); auto crossTangent = tangent.cross({0, 1, 0}); - if((player->getTicksUsingItem() > 0 || fabsf(player->velocity.dot(crossTangent)) > 0.1f) && fabsf(pPos.y - end.y) > 0.1f){ + if((player->getTicksUsingItem() > 0 || fabsf(player->velocity.dot(crossTangent)) > 0.02f) && fabsf(pPos.y - end.y) > 0.1f){ walkTarget = start; goto WALK; } - if(pPos.y - end.y > -0.01f) + if (pPos.y - end.y > -0.01f) { goto WALK; - + } + auto lastPossibleJumpTarget = start.add(tangent.mul(0.25f)); walkTarget = start.add(tangent); // This is not actually on a block anymore, but if we make this smaller the movement controller will stop moving at the jump target diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 3698ab6f..1782492e 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -134,6 +134,8 @@ __forceinline bool canStandOn(const vec3_ti& pos, C_BlockSource* reg, bool inWat if(validWater) return true; + if (true) + return true; AABB aabb; if(!standOn->getCollisionShape(&aabb, block, reg, &pos, nullptr)) @@ -381,7 +383,7 @@ std::vector findEdges(std::unordered_map& allNodes if(isInWater){ // check if the block is a flowing block auto block = reg->getBlock(newPos)->toLegacy(); - if(block->material->isLiquid){ + if (block->material->isLiquid) { vec3_t flow{}; block->liquidGetFlow(&flow, reg, &newPos); if(!flow.iszero()){ @@ -483,7 +485,7 @@ JoePath JoePathFinder::findPath() { auto edges = findEdges(allNodes, cur, this->region, curRef); // cur gets invalidated here cur = allNodes.at(curRef.hash); numEdges += (int)edges.size(); - for(auto edge : edges){ + for(const auto& edge : edges){ auto& edgeEndNode = allNodes.at(edge.endNode.hash); //logF("(%i %i %i) %i -> (%i %i %i)", cur.pos.x, cur.pos.y, cur.pos.z, edge.type, edgeEndNode.pos.x, edgeEndNode.pos.y, edgeEndNode.pos.z); if(edgeEndNode.isClosed) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1745dc94..60ca40c7 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -371,7 +371,7 @@ void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { messageHolder->resetWithoutDelete(); // MinecraftScreenModel::updateTextBoxText - updateTextbox(0, messageHolder); + //updateTextbox(0, messageHolder); return; } else if (*message == '.') { diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index 609ad6a6..fef97713 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -21,11 +21,6 @@ C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { bool C_BlockLegacy::getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor) { return Utils::CallVFunc<5, bool, AABB*, C_Block*, C_BlockSource*, const vec3_ti*, C_Entity*>(this, collShapeOut, block, blockSource, pos, actor); } -int C_BlockLegacy::liquidGetDepth(C_BlockSource* reg, const vec3_ti* pos) { - using liquid_getDepth_t = int(__fastcall*)(C_BlockLegacy*, C_BlockSource*, const vec3_ti*); - static liquid_getDepth_t liquid_getDepth = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B C2 48 8B D9 48 8B C8 49 8B D0 E8 ?? ?? ?? ?? 48 8B 8B")); - return liquid_getDepth(this, reg, pos); -} void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec3_ti* pos) { using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*); static liquid_getFlow_t liquid_getDepth = Utils::FuncFromSigOffset(FindSignature("E8 ? ? ? ? 48 8B 4C 24 ? F3 0F 10 01"), 1); @@ -37,6 +32,7 @@ bool C_BlockLegacy::hasWater(C_BlockSource* reg, const vec3_ti& pos) { return !this->material->isSuperHot; } + auto liquidBlock = reg->getLiquidBlock(pos)->toLegacy(); return this != liquidBlock && liquidBlock->material->isLiquid && !liquidBlock->material->isSuperHot; } diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index aaf8a4ae..76229072 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -44,7 +44,6 @@ class C_BlockLegacy { public: int64_t blockId; //0x0148 - int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); bool getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor); bool hasWater(C_BlockSource*, const vec3_ti& pos); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 26671600..c8e66c17 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -60,21 +60,22 @@ class C_Entity { private: char pad_0x228[0x10]; //0x224 public: - float web; //0x0234 + vec3_t slowdownFactor; + private: - char pad_0x23C[0xD]; //0x0238 + char pad_0x23C[0x5]; //0x0238 public: bool didEnterWaterBool; //0x0245 private: - char pad_023E[0x4E]; //0x0246 + char pad_023E[0x4A]; //0x0246 public: int ticksAlive; //0x0294 private: - char pad_0290[0xB0]; //0x0298 + char pad_0290[0xB4]; //0x0298 public: C_BlockSource *region; //0x348 private: - char pad_0x340[0x148]; //0x350 + char pad_0x340[0x160]; //0x350 public: AABB aabb; //0x0498 float width; //0x04B4 @@ -87,7 +88,7 @@ class C_Entity { public: __int64 entityRuntimeId; //0x538 private: - char pad_0478[0x148]; //0x0540 + char pad_0478[0x1A8]; //0x0540 public: float bodyYaw; //0x0688 float oldBodyYaw; //0x068C @@ -99,7 +100,13 @@ class C_Entity { public: int timeSinceDeath; //0x0728 private: - char pad_08B0[0x200]; //0x072C + char pad_08B0[0x15C]; //0x072C +public: + TextHolder playerName; + +private: + char pad_08B8[0x8C]; + public: bool canFly; //0x092C private: From 0a8977c6d5d85cf4c6c4c798d796cf5eafb08bac Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 15:49:33 +0200 Subject: [PATCH 303/419] =?UTF-8?q?=C2=B4Fix=20joe=20contact=20damage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Horion/path/JoePathFinder.cpp | 56 ++++++++++++----------------------- SDK/CBlockLegacy.cpp | 1 - 2 files changed, 19 insertions(+), 38 deletions(-) diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 1782492e..38d34a50 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -70,46 +70,28 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo return true; // contact damage based - // TODO: refactor this to use tile names and cache vtables - if(false){ + { // there is a function called dealsContactDamage but it takes in so many parameters + plant growth that its not useful anymore - static uintptr_t** cactusBlockVtable = nullptr; - if (cactusBlockVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 41 88 9E ?? ?? ?? ?? 41 C6"); - int offset = *reinterpret_cast(sigOffset + 3); - cactusBlockVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); - } - static uintptr_t** cobwebVtable = nullptr; - if (cobwebVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 C6 86 ?? 00 00 00 00 0F B6 05 ?? ?? ?? ?? 88 86 ?? ?? ?? ?? C6 86 ?? ?? ?? ?? ?? C7 86 ?? ?? ?? ?? ?? ?? ?? ?? 48"); - int offset = *reinterpret_cast(sigOffset + 3); - cobwebVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); - } - static uintptr_t** witherRoseVtable = nullptr; - if (witherRoseVtable == nullptr) { - uintptr_t sigOffset = 0; - sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9"); - int offset = *reinterpret_cast(sigOffset + 3); - witherRoseVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); - } - static uintptr_t** magmaBlockVtable = nullptr; - if (magmaBlockVtable == nullptr) { - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 41 88 9E ?? ?? ?? ?? 41 88 9E ?? ?? ?? ?? 41"); - int offset = *reinterpret_cast(sigOffset + 3); - magmaBlockVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); - } + static std::set knownVtableSet; + static std::vector dangerousTiles{"sweet_berry_bush", "magma", "wither_rose", "cactus", "web"}; - if(obs1->Vtable == cactusBlockVtable) - return true; - if(obs1->Vtable == cobwebVtable) - return true; - if(obs1->Vtable == witherRoseVtable) - return true; - if(obs1->Vtable == magmaBlockVtable) - return true; - // there should be a sweet berry vtable here as well but the vtable was really aids so i resorted to block names - if(obs1->tileName.getTextLength() > 20 && strcmp(obs1->tileName.getText() + 5 /*cutoff tile. prefix*/, "sweet_berry_bush") == 0) + for (uintptr_t** vtable : knownVtableSet) + if (obs1->Vtable == vtable) + return true; + + + if (obs1->tileName.getTextLength() < 6) + return false; + + for (int i = 0; i < dangerousTiles.size(); i++){ + const char* tile = dangerousTiles[i]; + if (strcmp(obs1->tileName.getText() + 5 /*cutoff tile. prefix*/, tile) != 0) + continue; + + knownVtableSet.insert(obs1->Vtable); + dangerousTiles.erase(dangerousTiles.begin() + i); return true; + } } return false; } diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index fef97713..dd0c2ff9 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -32,7 +32,6 @@ bool C_BlockLegacy::hasWater(C_BlockSource* reg, const vec3_ti& pos) { return !this->material->isSuperHot; } - auto liquidBlock = reg->getLiquidBlock(pos)->toLegacy(); return this != liquidBlock && liquidBlock->material->isLiquid && !liquidBlock->material->isSuperHot; } From a6b000e73fa72006f0c0c50e883d2cab213389f4 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 16:21:00 +0200 Subject: [PATCH 304/419] Don't run into lava like an idiot --- Horion/path/JoeMovementController.cpp | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index fdd58f7c..20cbf759 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -42,7 +42,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move auto walkTarget = end; bool enableNextSegmentSmoothing = true; - float dComp = 4; + float dComp = 1; vec3_t addedDiff{0, 0, 0}; // we should probably make seperate classes for each segment type at some point, but im just doing it here for now for faster prototyping @@ -93,9 +93,17 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move movementHandler->isJumping = 1; } }else{ - dComp = 10; - enableNextSegmentSmoothing = false; + dComp = 4; + enableNextSegmentSmoothing = false; } + if (start.sub(end).magnitudexz() < 1.1f) { + // hug the wall on drop + auto tangent = end.sub(start); + tangent.y = 0; + walkTarget = start.add(tangent.mul(0.5f + player->width * 0.5f + 0.1f)); + walkTarget.y = end.y; + } + goto WALK; } break; case PARKOUR_JUMP_SINGLE: { @@ -141,7 +149,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move tangent.y = 0; tangent = tangent.normalize(); walkTarget = end.sub(tangent.mul(0.4f)); - dComp = 5; + dComp = 3; goto WALK; } } break; @@ -202,30 +210,31 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move auto pPosD = pPos; // p - if(!player->onGround && dComp < 8){ - dComp = 8; + if(!player->onGround && dComp < 4){ + dComp = 4; } - pPosD.add(player->velocity.mul(dComp, 0, dComp)); // d + pPosD = pPosD.add(player->velocity.mul(dComp, 0, dComp)); // d if(player->onGround && end.y < start.y && fabsf(start.y - pPosD.y) < 0.1f && player->getTicksUsingItem() > 0 && end.sub(start).magnitudexz() > 1.5f){ // drop with a gap + // player is using item, walk back to start pos walkTarget = start; } vec3_t diff3d = walkTarget.sub(pPosD); vec2_t diff2d = {diff3d.x, diff3d.z}; float diffMag = diff2d.magnitude(); - if(enableNextSegmentSmoothing && hasNextSeg && diffMag < 0.15f && fabsf(end.y - pPosD.y) < (player->isInWater() ? 0.5f : 0.1f)){ // Start taking the next segment into account when we're very close to our destination + if(enableNextSegmentSmoothing && hasNextSeg && diffMag < 0.2f && fabsf(end.y - pPosD.y) < (player->isInWater() ? 0.5f : 0.1f)){ // Start taking the next segment into account when we're very close to our destination auto tangent = nextSegEnd.sub(end).normalize(); - diff3d = end.add(tangent.mul(0.2f)).sub(pPosD); + diff3d = end.add(tangent.mul(0.3f)).sub(pPosD); diff2d = {diff3d.x, diff3d.z}; diffMag = diff2d.magnitude(); } diff2d = diff2d.div(fmaxf(0.15f, diffMag)); addedDiff.y = 0; - if(!addedDiff.iszero()){ + if(!addedDiff.iszero()){ // water flow diff2d = diff2d.add(addedDiff.x, addedDiff.z); diff2d = diff2d.div(fmaxf(1, diff2d.magnitude())); } From 995f7c7ccaac38893d8e2974a46e84746aaa4a36 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 16:27:05 +0200 Subject: [PATCH 305/419] Quicker pathing --- Horion/path/JoeMovementController.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Horion/path/JoeMovementController.cpp b/Horion/path/JoeMovementController.cpp index 20cbf759..deda623c 100644 --- a/Horion/path/JoeMovementController.cpp +++ b/Horion/path/JoeMovementController.cpp @@ -42,7 +42,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move auto walkTarget = end; bool enableNextSegmentSmoothing = true; - float dComp = 1; + float dComp = 0.5f; vec3_t addedDiff{0, 0, 0}; // we should probably make seperate classes for each segment type at some point, but im just doing it here for now for faster prototyping @@ -85,6 +85,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move case DROP: { bool inWater = player->isInWater(); if(player->onGround || inWater){ + dComp = 1; if(fabsf(pPos.y - end.y) < (inWater ? 0.2f : 0.1f) && pPos.sub(end).magnitudexz() < 0.5f && player->velocity.y > -0.1f){// Check for end condition this->stateInfo.nextSegment(); break; @@ -93,16 +94,15 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move movementHandler->isJumping = 1; } }else{ - dComp = 4; - enableNextSegmentSmoothing = false; + dComp = 3; } - if (start.sub(end).magnitudexz() < 1.1f) { + /* if (start.sub(end).magnitudexz() < 1.1f) { // hug the wall on drop auto tangent = end.sub(start); tangent.y = 0; walkTarget = start.add(tangent.mul(0.5f + player->width * 0.5f + 0.1f)); walkTarget.y = end.y; - } + }*/ goto WALK; } break; @@ -149,7 +149,7 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move tangent.y = 0; tangent = tangent.normalize(); walkTarget = end.sub(tangent.mul(0.4f)); - dComp = 3; + dComp = 2; goto WALK; } } break; @@ -210,8 +210,8 @@ void JoeMovementController::step(C_LocalPlayer *player, C_MoveInputHandler *move auto pPosD = pPos; // p - if(!player->onGround && dComp < 4){ - dComp = 4; + if(!player->onGround && dComp < 2){ + dComp = 2; } pPosD = pPosD.add(player->velocity.mul(dComp, 0, dComp)); // d From 4057bf8627095d20165dc7753a93fa971580bfc8 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Mon, 16 Aug 2021 16:50:08 +0200 Subject: [PATCH 306/419] Fix --- Horion/Module/Modules/FollowPathModule.cpp | 2 +- Memory/GameData.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/FollowPathModule.cpp b/Horion/Module/Modules/FollowPathModule.cpp index 9a797dc9..44a52b13 100644 --- a/Horion/Module/Modules/FollowPathModule.cpp +++ b/Horion/Module/Modules/FollowPathModule.cpp @@ -134,7 +134,7 @@ void FollowPathModule::onMove(C_MoveInputHandler *handler) { this->clientMessageF("%sCalculating next path...", YELLOW); - float timeForSearch = std::clamp(timeSpent - 0.5f, 5.f, 10.f); + float timeForSearch = std::clamp(timeSpent - 0.5f, 1.f, 3.f); auto lastSeg = curPath->getSegment(curPath->getNumSegments() - 1); this->nextPath.reset(); this->startSearch(lastSeg.getEnd(), g_Data.getLocalPlayer()->region, timeForSearch, [&](bool succeeded, JoePath tempPath){ diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index a76e6ff5..b7bccec6 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -162,11 +162,11 @@ void GameData::forEachEntity(std::function callback) { { // MultiplayerLevel::directTickEntities __int64 region = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->region); - __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x130i64); + __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x148i64); for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; // !isRemoved() && !isGlobal() - if (actor && !*(char*)(actor + 0x3C1) && !*(char*)(actor + 0x3C2)) { + if (actor && !*(char*)(actor + 0x3E1) && !*(char*)(actor + 0x3E2)) { C_Entity* ent = reinterpret_cast(actor); if (std::find(tickedEntities.begin(), tickedEntities.end(), ent) == tickedEntities.end()) { callback(ent, false); From 7b71dcac0834242309008747c3d66a3e75374f19 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:32:24 -0800 Subject: [PATCH 307/419] Update Freecam.cpp --- Horion/Module/Modules/Freecam.cpp | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index f413dfb3..de21a043 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -1,6 +1,7 @@ #include "Freecam.h" Freecam::Freecam() : IModule('V', Category::MISC, "Move your cam without moving the player") { + registerFloatSetting("Speed", &this->speed, this->speed, 0.50f, 1.25f); } Freecam::~Freecam() { @@ -11,9 +12,8 @@ const char* Freecam::getModuleName() { } void Freecam::onTick(C_GameMode* gm) { - gm->player->aabb.upper.y = gm->player->aabb.lower.y; - gm->player->canFly = true; gm->player->fallDistance = 0.f; + gm->player->velocity = vec3_t(0, 0, 0); } void Freecam::onEnable() { @@ -22,10 +22,37 @@ void Freecam::onEnable() { } } +void Freecam::onMove(C_MoveInputHandler* input) { + auto player = g_Data.getLocalPlayer(); + if (player == nullptr) return; + + vec2_t moveVec2d = { input->forwardMovement, -input->sideMovement }; + bool pressed = moveVec2d.magnitude() > 0.01f; + + float calcYaw = (player->yaw + 90) * (PI / 180); + vec3_t moveVec; + float c = cos(calcYaw); + float s = sin(calcYaw); + moveVec2d = { moveVec2d.x * c - moveVec2d.y * s, moveVec2d.x * s + moveVec2d.y * c }; + moveVec.x = moveVec2d.x * speed; + moveVec.y = player->velocity.y; + moveVec.z = moveVec2d.y * speed; + if (pressed) player->lerpMotion(moveVec); + C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); + if (input->isJumping) { + player->velocity.y += 0.50f; + *g_Data.getClientInstance()->minecraft->timer = 20.f; + } + if (input->isSneakDown) { + player->velocity.y -= 0.50f; + *g_Data.getClientInstance()->minecraft->timer = 20.f; + } +} + void Freecam::onDisable() { if (g_Data.getLocalPlayer() != nullptr) { g_Data.getLocalPlayer()->setPos(oldPos); if (g_Data.getLocalPlayer()->gamemode != 1) - g_Data.getLocalPlayer()->canFly = false; + *g_Data.getClientInstance()->minecraft->timer = 20.f; } } From c0fc3aa3365ff217b82225598f599e9f8a32f102 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:32:42 -0800 Subject: [PATCH 308/419] Update Freecam.h --- Horion/Module/Modules/Freecam.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Horion/Module/Modules/Freecam.h b/Horion/Module/Modules/Freecam.h index c19f39f2..11a0c899 100644 --- a/Horion/Module/Modules/Freecam.h +++ b/Horion/Module/Modules/Freecam.h @@ -3,6 +3,7 @@ class Freecam : public IModule { private: vec3_t oldPos; + float speed = 0.325f; public: Freecam(); @@ -11,6 +12,7 @@ class Freecam : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; + virtual void onMove(C_MoveInputHandler* input) override; virtual void onEnable() override; virtual void onDisable() override; }; From 8546520eecb5353f1559bd6010debdd51dde0b70 Mon Sep 17 00:00:00 2001 From: Packet <86270028+PacketDeveloper@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:25:54 -0600 Subject: [PATCH 309/419] Update FullBright.cpp (#4417) --- Horion/Module/Modules/FullBright.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/FullBright.cpp b/Horion/Module/Modules/FullBright.cpp index 4091771f..12eb7f28 100644 --- a/Horion/Module/Modules/FullBright.cpp +++ b/Horion/Module/Modules/FullBright.cpp @@ -1,7 +1,7 @@ #include "FullBright.h" FullBright::FullBright() : IModule(0, Category::VISUAL, "Puts your gamma to max") { - registerFloatSetting("Intensity", &this->intensity, this->intensity, -100.f, 10.f); + registerFloatSetting("Intensity", &this->intensity, this->intensity, -100.f, 25.f); } FullBright::~FullBright() { From 9e72bf78c99da881e31e2dce6ecf1108437f98c0 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 10:36:43 -0800 Subject: [PATCH 310/419] Update Freecam.cpp --- Horion/Module/Modules/Freecam.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index de21a043..84b14ff1 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -41,11 +41,11 @@ void Freecam::onMove(C_MoveInputHandler* input) { C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); if (input->isJumping) { player->velocity.y += 0.50f; - *g_Data.getClientInstance()->minecraft->timer = 20.f; + } if (input->isSneakDown) { player->velocity.y -= 0.50f; - *g_Data.getClientInstance()->minecraft->timer = 20.f; + } } @@ -53,6 +53,6 @@ void Freecam::onDisable() { if (g_Data.getLocalPlayer() != nullptr) { g_Data.getLocalPlayer()->setPos(oldPos); if (g_Data.getLocalPlayer()->gamemode != 1) - *g_Data.getClientInstance()->minecraft->timer = 20.f; + } } From 9840e95835abe0866a33ce24c030c51bfbf61319 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 10:44:21 -0800 Subject: [PATCH 311/419] Update Freecam.cpp --- Horion/Module/Modules/Freecam.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index 84b14ff1..629f35c3 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -26,6 +26,8 @@ void Freecam::onMove(C_MoveInputHandler* input) { auto player = g_Data.getLocalPlayer(); if (player == nullptr) return; + + vec2_t moveVec2d = { input->forwardMovement, -input->sideMovement }; bool pressed = moveVec2d.magnitude() > 0.01f; @@ -53,6 +55,6 @@ void Freecam::onDisable() { if (g_Data.getLocalPlayer() != nullptr) { g_Data.getLocalPlayer()->setPos(oldPos); if (g_Data.getLocalPlayer()->gamemode != 1) - + *g_Data.getClientInstance()->minecraft->timer = 20.f; } } From 84728e3d761f2a220cbbaa125e50318e1fc2ecf3 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:02:04 -0800 Subject: [PATCH 312/419] Update Freecam.cpp --- Horion/Module/Modules/Freecam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index 629f35c3..de841f80 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -54,7 +54,7 @@ void Freecam::onMove(C_MoveInputHandler* input) { void Freecam::onDisable() { if (g_Data.getLocalPlayer() != nullptr) { g_Data.getLocalPlayer()->setPos(oldPos); - if (g_Data.getLocalPlayer()->gamemode != 1) + *g_Data.getClientInstance()->minecraft->timer = 20.f; } } From ef3ac74df1a22768154d4eedb4dc7201419414a3 Mon Sep 17 00:00:00 2001 From: rxversed <70835203+rxversedcode@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:02:16 -0800 Subject: [PATCH 313/419] Update Freecam.cpp --- Horion/Module/Modules/Freecam.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index de841f80..9f26348b 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -54,7 +54,6 @@ void Freecam::onMove(C_MoveInputHandler* input) { void Freecam::onDisable() { if (g_Data.getLocalPlayer() != nullptr) { g_Data.getLocalPlayer()->setPos(oldPos); - - *g_Data.getClientInstance()->minecraft->timer = 20.f; + *g_Data.getClientInstance()->minecraft->timer = 20.f; } } From e45d74185a322a3348f76ae06ca2df482988e6af Mon Sep 17 00:00:00 2001 From: NRGJobro <85864573+NRGJobro@users.noreply.github.com> Date: Mon, 16 Aug 2021 18:29:05 -0400 Subject: [PATCH 314/419] Fixed .dupe 0o0o0o0o0o0o0o --- Horion/Command/Commands/DupeCommand.cpp | 57 ------------------------- 1 file changed, 57 deletions(-) diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index 1e102ebc..f13b9336 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -29,10 +29,8 @@ bool DupeCommand::execute(std::vector* args) { C_InventoryAction* secondAction = nullptr; firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, item); transactionManager->addInventoryAction(*firstAction); - transactionManager->addInventoryAction(*secondAction); inv->addItemToFirstEmptySlot(item); } else @@ -44,58 +42,3 @@ bool DupeCommand::execute(std::vector* args) { clientMessageF("%sSuccessfully duplicated the item!", GREEN); return true; } - - - -//Outdated Nukit Dupe -/*bool DupeCommand::execute(std::vector* args) { - C_LocalPlayer* player = g_Data.getLocalPlayer(); - - auto supplies = g_Data.getLocalPlayer()->getSupplies(); - auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - - C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - - auto slot = supplies->selectedHotbarSlot; - - C_InventoryAction actions[36 * 2]; - int numActions = 0; - for(int i = 0; i < 36; i++){ - if(i == slot) - continue; - auto itemInSlot = supplies->inventory->getItemStack(i); - - if(itemInSlot == nullptr || !itemInSlot->isValid() || itemInSlot->getItem()->itemId == 0) - { - actions[numActions] = C_InventoryAction(slot, selectedItem, nullptr, 0, 0); - actions[numActions + 1] = C_InventoryAction(i, nullptr, selectedItem, 0, 0); - - numActions += 2; - } - } - - C_InventoryTransactionPacket pk; - pk.complexTransaction = new C_ComplexInventoryTransaction(); - pk.complexTransaction->actionType = 0; - - struct temp { - __int64 next; - char pad[0x18]; - C_InventoryAction* start; - C_InventoryAction* end; - }; - - temp coolBean{}; - coolBean.start = &actions[0]; - coolBean.end = &actions[numActions]; - - auto ptrBean = &coolBean; - - coolBean.next = reinterpret_cast<__int64>(&ptrBean); - - pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); - pk.numTransactions = 1; - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully duplicated item! (%i times)", GREEN, numActions / 2); - return true; -}*/ \ No newline at end of file From b05170ecabae76d38306c596e95ccedd96e3ae11 Mon Sep 17 00:00:00 2001 From: NRGJobro <85864573+NRGJobro@users.noreply.github.com> Date: Mon, 16 Aug 2021 18:37:25 -0400 Subject: [PATCH 315/419] Fixed .dupe 0o0o0o0o0o0o0o (#4422) --- Horion/Command/Commands/DupeCommand.cpp | 57 ------------------------- 1 file changed, 57 deletions(-) diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index 1e102ebc..f13b9336 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -29,10 +29,8 @@ bool DupeCommand::execute(std::vector* args) { C_InventoryAction* secondAction = nullptr; firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, item); transactionManager->addInventoryAction(*firstAction); - transactionManager->addInventoryAction(*secondAction); inv->addItemToFirstEmptySlot(item); } else @@ -44,58 +42,3 @@ bool DupeCommand::execute(std::vector* args) { clientMessageF("%sSuccessfully duplicated the item!", GREEN); return true; } - - - -//Outdated Nukit Dupe -/*bool DupeCommand::execute(std::vector* args) { - C_LocalPlayer* player = g_Data.getLocalPlayer(); - - auto supplies = g_Data.getLocalPlayer()->getSupplies(); - auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - - C_ItemStack* selectedItem = g_Data.getLocalPlayer()->getSelectedItem(); - - auto slot = supplies->selectedHotbarSlot; - - C_InventoryAction actions[36 * 2]; - int numActions = 0; - for(int i = 0; i < 36; i++){ - if(i == slot) - continue; - auto itemInSlot = supplies->inventory->getItemStack(i); - - if(itemInSlot == nullptr || !itemInSlot->isValid() || itemInSlot->getItem()->itemId == 0) - { - actions[numActions] = C_InventoryAction(slot, selectedItem, nullptr, 0, 0); - actions[numActions + 1] = C_InventoryAction(i, nullptr, selectedItem, 0, 0); - - numActions += 2; - } - } - - C_InventoryTransactionPacket pk; - pk.complexTransaction = new C_ComplexInventoryTransaction(); - pk.complexTransaction->actionType = 0; - - struct temp { - __int64 next; - char pad[0x18]; - C_InventoryAction* start; - C_InventoryAction* end; - }; - - temp coolBean{}; - coolBean.start = &actions[0]; - coolBean.end = &actions[numActions]; - - auto ptrBean = &coolBean; - - coolBean.next = reinterpret_cast<__int64>(&ptrBean); - - pk.complexTransaction->transac.ptr = reinterpret_cast<__int64>(&ptrBean); - pk.numTransactions = 1; - g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&pk); - clientMessageF("%sSuccessfully duplicated item! (%i times)", GREEN, numActions / 2); - return true; -}*/ \ No newline at end of file From cc2c02a00384eb2765954b6a0521a30ffbfe6ccc Mon Sep 17 00:00:00 2001 From: NRGJobro <85864573+NRGJobro@users.noreply.github.com> Date: Mon, 16 Aug 2021 19:13:36 -0400 Subject: [PATCH 316/419] Fixed .setoffhand command :) --- Horion/Command/Commands/setoffhandCommand.cpp | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/Horion/Command/Commands/setoffhandCommand.cpp b/Horion/Command/Commands/setoffhandCommand.cpp index a5eba5e6..cd261b33 100644 --- a/Horion/Command/Commands/setoffhandCommand.cpp +++ b/Horion/Command/Commands/setoffhandCommand.cpp @@ -1,9 +1,9 @@ #include "setoffhandCommand.h" + +#include "../../../SDK/Tag.h" #include "../../../Utils/Utils.h" -#include -#include -setoffhandCommand::setoffhandCommand() : IMCCommand("setoffhand", "Puts any item into offhand", " ") { +setoffhandCommand::setoffhandCommand() : IMCCommand("setoffhand", "spawn items in ur offhand", " ") { registerAlias("soh"); } @@ -27,34 +27,51 @@ bool setoffhandCommand::execute(std::vector* args) { C_Inventory* inv = g_Data.getLocalPlayer()->getSupplies()->inventory; C_ItemStack* yot = nullptr; auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - + if (itemId == 0) { - void* ItemPtr = malloc(0x8); - void* idk = malloc(0x0); TextHolder tempText(args->at(1)); - C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, tempText); + std::unique_ptr ItemPtr = std::make_unique(); + std::unique_ptr buffer = std::make_unique(); + C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr.get(), buffer.get(), tempText); if (*cStack == nullptr) { clientMessageF("%sInvalid item name!", RED); return true; } yot = new C_ItemStack(***cStack, count, itemData); - free(ItemPtr); - free(idk); } else { - void* ItemPtr = malloc(0x8); - C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, itemId); - if (**cStack == NULL) { + std::unique_ptr ItemPtr = std::make_unique(); + C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr.get(), itemId); + if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) { clientMessageF("%sInvalid item ID!", RED); return true; } yot = new C_ItemStack(***cStack, count, itemData); - free(ItemPtr); } if (yot != nullptr) yot->count = count; + if (args->size() > 4) { + std::string tag = Utils::getClipboardText(); + if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { + yot->setUserData(std::move(Mojangson::parseTag(tag))); + } + } + + ItemDescriptor* desc = nullptr; + desc = new ItemDescriptor((*yot->item)->itemId, itemData); + + C_InventoryAction* firstAction = nullptr; + C_InventoryAction* secondAction = nullptr; + + firstAction = new C_InventoryAction(0, desc, nullptr, yot, nullptr, count, 507, 99999); + + transactionManager->addInventoryAction(*firstAction); + + delete firstAction; + delete desc; g_Data.getLocalPlayer()->setOffhandSlot(yot); - clientMessageF("%sSet item as offhand!", BLUE); + + clientMessageF("%sSuccessfully set item to offhand!", GREEN); return true; } From 1766a96de1578b318973dbb00dd8355950087bb8 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 16 Aug 2021 19:34:03 -0400 Subject: [PATCH 317/419] fix chestesp --- Horion/Module/Modules/ChestESP.cpp | 21 +++++++++++++++++++-- Memory/Hooks.cpp | 2 +- SDK/CChestBlockActor.h | 10 +++++----- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/ChestESP.cpp index f57251c6..12a87dc7 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/ChestESP.cpp @@ -14,11 +14,28 @@ const char* ChestESP::getModuleName() { void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (!g_Data.isInGame() || !GameData::canUseMoveKeys() || g_Data.getLocalPlayer() == nullptr) return; - //if (listSize < 1000 && listSize > 1) { + auto ourListLock = std::scoped_lock(this->listLock); for (auto iter = bufferedChestList.begin(); iter != bufferedChestList.end(); ++iter) { - DrawUtils::setColor(1.f, 0.3f, 0.3f, 0.6f); + auto storageID = g_Data.getLocalPlayer()->region->getBlock((*iter)->upper)->blockLegacy->blockId; + float math = (float)fmax(0.3f, (float)fmin(1.f, 15)); + DrawUtils::setColor(1.f, 1.f, 1.f, math); + + vec3_t blockPos = (*iter)->lower; + if (blockPos.x < 0) + blockPos.x -= 1; + if (blockPos.z < 0) + blockPos.z -= 1; + storageID = g_Data.getLocalPlayer()->region->getBlock(blockPos)->toLegacy()->blockId; + + auto mathVect = vec3_t((*iter)->upper.floor().add(vec3_t(1.f, 1.f, 1.f)).sub((*iter)->upper)); + mathVect.y = floor(mathVect.y); + + if (storageID == 54) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Normal Chest + if (storageID == 146) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Trapped Chest + if (storageID == 130) DrawUtils::setColor(0.435294f, 0.215686f, 0.631372f, math); // Ender Chest + DrawUtils::drawBox((*iter)->lower, (*iter)->upper, (float)fmax(0.2f, 1 / (float)fmax(1, g_Data.getLocalPlayer()->eyePos0.dist((*iter)->lower))), true); // Fancy math to give an illusion of good esp } } diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 60ca40c7..06223e83 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -200,7 +200,7 @@ void Hooks::Init() { void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ? 48 83 79")); + void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); diff --git a/SDK/CChestBlockActor.h b/SDK/CChestBlockActor.h index a460e0e2..57cc7658 100644 --- a/SDK/CChestBlockActor.h +++ b/SDK/CChestBlockActor.h @@ -18,26 +18,26 @@ class C_ChestBlockActor { AABB aabb; bool isPaired() { - return *reinterpret_cast<__int64*>(reinterpret_cast<__int64>(this) + 0x220) != 0; + return *reinterpret_cast<__int64*>(reinterpret_cast<__int64>(this) + 0x228) != 0; //ptr to paired chest block actor } vec3_ti* getPairedPos() { - return reinterpret_cast(reinterpret_cast<__int64>(this) + 0x228); + return reinterpret_cast(reinterpret_cast<__int64>(this) + 0x230); } bool isMainSubchest() { - return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0x214) & 1; + return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0x204) & 1; //in paired chest, is it the main one } AABB getFullAABB() { if (!isPaired()) { if (isBarrelBlock() || isShulkerBlock()) return AABB(this->posI.toVec3t(), this->posI.toVec3t().add(1)); - return AABB(this->posI.toVec3t().add(0.0625, 0, 0.0625), this->posI.toVec3t().add(1 - 0.0625, 1 - 1.f/8, 1 - 0.0625)); + return AABB(this->posI.toVec3t().add(0.0625, 0, 0.0625), this->posI.toVec3t().add(1 - 0.0625, 1 - 1.f / 8, 1 - 0.0625)); } vec3_ti first = this->posI; vec3_ti second = *getPairedPos(); - + if (first.x > second.x || first.z > second.z) std::swap(first, second); From 39b014588372b031a44150c0b2d3c561cfe336f8 Mon Sep 17 00:00:00 2001 From: TheSynx <87203897+Synx173@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:26:08 -0400 Subject: [PATCH 318/419] fix stuff (#4427) --- Memory/GameData.cpp | 2 +- Memory/Hooks.cpp | 4 ++-- SDK/CEntity.h | 9 +++++++-- SDK/CItem.h | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index b7bccec6..203b44bd 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -162,7 +162,7 @@ void GameData::forEachEntity(std::function callback) { { // MultiplayerLevel::directTickEntities __int64 region = reinterpret_cast<__int64>(g_Data.getLocalPlayer()->region); - __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x148i64); + __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x138i64); for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; // !isRemoved() && !isGlobal() diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 06223e83..0dcb442e 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -252,10 +252,10 @@ void Hooks::Init() { void* RakNetInstance__tick = reinterpret_cast(FindSignature("48 89 5C 24 10 48 89 74 24 18 55 57 41 54 41 56 41 57 48 8D ?? 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B F9 45 33 E4 4C")); g_Hooks.RakNetInstance_tickHook = std::make_unique(RakNetInstance__tick, Hooks::RakNetInstance_tick); - void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D9 4D 8B F8")); + void* ConnectionRequest__create = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4D 8B E1 4D 8B F8 48 89 55")); g_Hooks.ConnectionRequest_createHook = std::make_unique(ConnectionRequest__create, Hooks::ConnectionRequest_create); - void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); + void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F0 4C 89 45 ?? 4C 8B E2 4C 8B E9")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); void* _getSkinPack = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B E2 48 8B F1")); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index c8e66c17..1ac31332 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -376,6 +376,11 @@ class C_Entity { public: virtual void setOnFire(int); + virtual __int64 extinguishFire(void); + virtual __int64 thawFreezeEffect(void); + virtual bool canFreeze(void); + virtual bool isWearingLeatherArmor(void); + private: virtual __int64 getHandleWaterAABB(void) const; virtual __int64 handleInsidePortal(vec3_ti const &); @@ -390,7 +395,7 @@ class C_Entity { private: virtual __int64 changeDimension(__int64, bool); virtual __int64 changeDimension(__int64 const &); - virtual __int64 getControllingPlayer(void) const; + virtual __int64 getControllingPlayer(void) const; // getSourceUniqueID2 virtual __int64 checkFallDamage(float, bool); public: @@ -437,8 +442,8 @@ class C_Entity { virtual __int64 getDeathTime(void) const; virtual __int64 heal(int); virtual bool isInvertedHealAndHarm(void) const; - virtual bool canBeAffected(int) const; virtual bool canBeAffected(__int64 const &) const; + virtual bool canBeAffected(int) const; virtual bool canBeAffectedByArrow(__int64 const &) const; private: diff --git a/SDK/CItem.h b/SDK/CItem.h index 11565322..2448d6bb 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -258,7 +258,7 @@ class C_Item { return false; } bool isBlock(void) { - auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1D0); + auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1A0); return val != nullptr && *val != nullptr; } }; From e69d485fdb0aae275fa5375e10b5950dbbf71f77 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 18 Aug 2021 01:21:08 +0200 Subject: [PATCH 319/419] capitalize --- Horion/Command/Commands/setoffhandCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/setoffhandCommand.cpp b/Horion/Command/Commands/setoffhandCommand.cpp index cd261b33..7678e4bf 100644 --- a/Horion/Command/Commands/setoffhandCommand.cpp +++ b/Horion/Command/Commands/setoffhandCommand.cpp @@ -3,7 +3,7 @@ #include "../../../SDK/Tag.h" #include "../../../Utils/Utils.h" -setoffhandCommand::setoffhandCommand() : IMCCommand("setoffhand", "spawn items in ur offhand", " ") { +setoffhandCommand::setoffhandCommand() : IMCCommand("setoffhand", "Spawn items in ur offhand", " ") { registerAlias("soh"); } From 6b4fab4f437a0fd23d6ed1dba5c749c8aa523263 Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:44:04 -0700 Subject: [PATCH 320/419] Fix chat hook --- Memory/Hooks.cpp | 36 +++++------------------------------- Memory/Hooks.h | 4 ++-- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 0dcb442e..c1de63e1 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -181,8 +181,8 @@ void Hooks::Init() { void* player_tickworld = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 89 55 ?? 48 8B F9")); g_Hooks.Player_tickWorldHook = std::make_unique(player_tickworld, Hooks::Player_tickWorld); - void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 48 83 B9")); - g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ChatScreenController_sendChatMessage); + void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B EA 4C 8B F9 48 8B 49")); + g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ClientInstanceScreenModel_sendChatMessage); void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA 48 89 54 24 ? 4C 8B E9")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); @@ -337,42 +337,16 @@ void* Hooks::Player_tickWorld(C_Player* _this, __int64 unk) { return o; } -void Hooks::ChatScreenController_sendChatMessage(uint8_t* _this) { +void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* text) { static auto oSendMessage = g_Hooks.ChatScreenController_sendChatMessageHook->GetFastcall(); - using addCommandToChatHistory_t = void(__fastcall*)(uint8_t*, TextHolder*); - static addCommandToChatHistory_t addCommandToChatHistory = reinterpret_cast(FindSignature("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC ?? 48 8B 99 ?? ?? ?? ?? 48 8B F2 80")); - using updateTextbox_t = void(__fastcall*)(__int64, TextHolder*); - static updateTextbox_t updateTextbox = reinterpret_cast(0); - if (updateTextbox == nullptr) { - auto sig = FindSignature("E8 ? ? ? ? 48 8D 8B ? ? ? ? 0F 57 C0"); - updateTextbox = reinterpret_cast(sig + 5 + *reinterpret_cast(sig + 1)); - } - - TextHolder* messageHolder = reinterpret_cast(_this + 0xA98); - if (messageHolder->getTextLength() > 0) { - char* message = messageHolder->getText(); + if (text->getTextLength() > 0) { + char* message = text->getText(); if (*message == cmdMgr->prefix) { cmdMgr->execute(message); - addCommandToChatHistory(_this, messageHolder); // This will put the command in the chat history (Arrow up/down) - - __int64 v17 = 0; - C_ClientInstance* v15 = g_Data.getClientInstance(); - __int64 vtable = *reinterpret_cast<__int64*>(v15); - - if (*(BYTE*)(_this + 0xA9A)) // isDevConsole - v17 = (*(__int64(__cdecl**)(C_ClientInstance*))(vtable + 0x9B8))(v15); - else - v17 = (*(__int64(__cdecl**)(C_ClientInstance*))(vtable + 0x9B0))(v15); - *(DWORD*)(_this + 0xABC) = *(DWORD*)(v17 + 0x20); - - messageHolder->resetWithoutDelete(); - // MinecraftScreenModel::updateTextBoxText - //updateTextbox(0, messageHolder); - return; } else if (*message == '.') { // maybe the user forgot his prefix, give him some helpful advice diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 4da29c2f..fc2b5d28 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -76,7 +76,7 @@ class Hooks { private: static void* Player_tickWorld(C_Player* _this, __int64); - static void ChatScreenController_sendChatMessage(uint8_t* _this); + static void ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* text); static __int64 UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext); static __int64 UIScene_render(C_UIScene* uiscene, __int64 screencontext); static __int64 RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx); @@ -126,7 +126,7 @@ class Hooks { static void LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2, TextHolder* name, __int64 a4); std::unique_ptr Player_tickWorldHook; - std::unique_ptr ChatScreenController_sendChatMessageHook; + std::unique_ptr ClientInstanceScreenModel_sendChatMessageHook; std::unique_ptr UIScene_setupAndRenderHook; std::unique_ptr UIScene_renderHook; std::unique_ptr RenderTextHook; From 7b8aeaa8df8d55d728e252fbb7cb27925a2c57f2 Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:50:06 -0700 Subject: [PATCH 321/419] Yikes --- Memory/Hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index c1de63e1..75ab0bf6 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -182,7 +182,7 @@ void Hooks::Init() { g_Hooks.Player_tickWorldHook = std::make_unique(player_tickworld, Hooks::Player_tickWorld); void* _sendChatMessage = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B EA 4C 8B F9 48 8B 49")); - g_Hooks.ChatScreenController_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ClientInstanceScreenModel_sendChatMessage); + g_Hooks.ClientInstanceScreenModel_sendChatMessageHook = std::make_unique(_sendChatMessage, Hooks::ClientInstanceScreenModel_sendChatMessage); void* _renderText = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B FA 48 89 54 24 ? 4C 8B E9")); g_Hooks.RenderTextHook = std::make_unique(_renderText, Hooks::RenderText); @@ -338,7 +338,7 @@ void* Hooks::Player_tickWorld(C_Player* _this, __int64 unk) { } void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* text) { - static auto oSendMessage = g_Hooks.ChatScreenController_sendChatMessageHook->GetFastcall(); + static auto oSendMessage = g_Hooks.ClientInstanceScreenModel_sendChatMessageHook->GetFastcall(); if (text->getTextLength() > 0) { From 234b6aa366802f21c6611d3c977347c2ebf753ba Mon Sep 17 00:00:00 2001 From: brampedgex <70824773+brampedgex@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:38:31 -0700 Subject: [PATCH 322/419] wtf --- Memory/Hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 75ab0bf6..3bd62448 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -358,7 +358,7 @@ void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* t } } } - oSendMessage(_this); + oSendMessage(_this, text); } __int64 Hooks::UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext) { @@ -2044,4 +2044,4 @@ void Hooks::LevelRendererPlayer__renderNameTags(__int64 a1, __int64 a2, TextHold } return func(a1, a2, a3, a4); -} \ No newline at end of file +} From bb723730387f9c13dc77a11132d61047a68e0a73 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 18 Aug 2021 13:47:09 -0400 Subject: [PATCH 323/419] Add viewmodel, improve xray(#4426) --- Horion.vcxproj | 2 + Horion/Command/Commands/EnchantCommand.cpp | 15 ++-- Horion/DrawUtils.cpp | 10 ++- Horion/Module/ModuleManager.cpp | 1 + Horion/Module/ModuleManager.h | 1 + Horion/Module/Modules/NameTags.cpp | 41 +++++----- Horion/Module/Modules/NameTags.h | 7 ++ Horion/Module/Modules/ViewModel.cpp | 40 ++++++++++ Horion/Module/Modules/ViewModel.h | 27 +++++++ Horion/Module/Modules/Xray.cpp | 21 ++++- Horion/Module/Modules/Xray.h | 6 ++ Memory/Hooks.cpp | 92 ++++++++++++++++------ SDK/CBlockLegacy.h | 5 +- SDK/CItem.cpp | 4 +- 14 files changed, 215 insertions(+), 57 deletions(-) create mode 100644 Horion/Module/Modules/ViewModel.cpp create mode 100644 Horion/Module/Modules/ViewModel.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 72621c36..4a4025a3 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -361,6 +361,7 @@ + @@ -548,6 +549,7 @@ + diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index dc0372ef..2af59c41 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -81,13 +81,16 @@ bool EnchantCommand::execute(std::vector* args) { C_InventoryAction* firstAction = nullptr; C_InventoryAction* secondAction = nullptr; + ItemDescriptor* desc = nullptr; + desc = new ItemDescriptor((*item->item)->itemId, 0); + if (isAuto) { { - firstAction = new C_InventoryAction(supplies->selectedHotbarSlot, item, nullptr); + firstAction = new C_InventoryAction(supplies->selectedHotbarSlot, desc, nullptr, item, nullptr, item->count); if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0) - secondAction = new C_InventoryAction(0, nullptr, item, 32766, 100); + secondAction = new C_InventoryAction(0, nullptr, desc, nullptr, item, item->count, 32766, 100); else - secondAction = new C_InventoryAction(0, nullptr, item, 507, 99999); + secondAction = new C_InventoryAction(0, nullptr, desc, nullptr, item, item->count, 507, 99999); manager->addInventoryAction(*firstAction); manager->addInventoryAction(*secondAction); delete firstAction; @@ -159,10 +162,10 @@ bool EnchantCommand::execute(std::vector* args) { if (isAuto) { if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0) - firstAction = new C_InventoryAction(0, item, nullptr, 32766, 100); + firstAction = new C_InventoryAction(0, desc, nullptr, item, nullptr, item->count, 32766, 100); else - firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - secondAction = new C_InventoryAction(supplies->selectedHotbarSlot, nullptr, item); + firstAction = new C_InventoryAction(0, desc, nullptr, item, nullptr, item->count, 507, 99999); + secondAction = new C_InventoryAction(supplies->selectedHotbarSlot, nullptr, desc, nullptr, item, item->count); manager->addInventoryAction(*firstAction); manager->addInventoryAction(*secondAction); delete firstAction; diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index e30e5228..3bcfbc64 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -372,13 +372,16 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo rectPos.w = textPos.y + textHeight + 2.f * textSize; vec4_t subRectPos = rectPos; subRectPos.y = subRectPos.w - 1.f * textSize; - fillRectangle(rectPos, MC_Color(13, 29, 48), 0.8f); - fillRectangle(subRectPos, MC_Color(28, 107, 201), 0.9f); + static auto nametagsMod = moduleMgr->getModule(); + fillRectangle(rectPos, MC_Color(13, 29, 48), nametagsMod->opacity); + if (nametagsMod->underline) { + fillRectangle(subRectPos, MC_Color(30, 110, 20), 0.9f); + } drawText(textPos, &text, MC_Color(255, 255, 255), textSize); static auto nameTagsMod = moduleMgr->getModule(); - if (ent->getEntityTypeId() == 63 && nameTagsMod->displayArmor) { // is player, show armor + if (ent->getEntityTypeId() == 319 && nameTagsMod->displayArmor) { // is player, show armor auto* player = reinterpret_cast(ent); float scale = textSize * 0.6f; float spacing = scale + 15.f; @@ -399,7 +402,6 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo DrawUtils::drawItem(stack, vec2_t(rectPos.z - 1.f - 15.f * scale, y), 1.f, scale, stack->isEnchanted()); } } - } } } diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 58f32823..4f107857 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -101,6 +101,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Compass())); this->moduleList.push_back(std::shared_ptr(new Radar())); this->moduleList.push_back(std::shared_ptr(new VanillaPlus())); + this->moduleList.push_back(std::shared_ptr(new ViewModel())); this->moduleList.push_back(std::shared_ptr(new Twerk())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index a4e6af27..7e149148 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -94,6 +94,7 @@ #include "Modules/Compass.h" #include "Modules/Radar.h" #include "Modules/VanillaPlus.h" +#include "Modules/ViewModel.h" #include "Modules/Twerk.h" #ifdef _DEBUG diff --git a/Horion/Module/Modules/NameTags.cpp b/Horion/Module/Modules/NameTags.cpp index 43cd7e73..294e3309 100644 --- a/Horion/Module/Modules/NameTags.cpp +++ b/Horion/Module/Modules/NameTags.cpp @@ -3,8 +3,10 @@ #include "../../../Utils/Target.h" #include "../ModuleManager.h" -NameTags::NameTags() : IModule(0, Category::VISUAL, "Shows better nametags above players that can be seen from a lot more far aways") { - this->registerBoolSetting("Display Armor", &this->displayArmor, this->displayArmor); +NameTags::NameTags() : IModule(0, Category::VISUAL, "Shows betterar aways") { + this->registerBoolSetting("Underline", &this->underline, this->underline); + this->registerBoolSetting("Armor", &this->displayArmor, this->displayArmor); + this->registerFloatSetting("Opacity", &this->opacity, this->opacity, 0.f, 1.f); } NameTags::~NameTags() { @@ -14,7 +16,7 @@ const char* NameTags::getModuleName() { return ("NameTags"); } -void drawNameTags(C_Entity* ent, bool isRegularEntitie) { +void drawNameTags(C_Entity* ent, bool) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); static auto nameTagsMod = moduleMgr->getModule(); @@ -29,26 +31,27 @@ void drawNameTags(C_Entity* ent, bool isRegularEntitie) { DrawUtils::drawNameTags(ent, fmax(0.6f, 3.f / dist)); DrawUtils::flush(); } - } } void NameTags::onPreRender(C_MinecraftUIRenderContext* renderCtx) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); + if (localPlayer == nullptr || !GameData::canUseMoveKeys()) return; - if (nameTags.size() > 100) - nameTags.clear(); - - if (localPlayer != nullptr && GameData::canUseMoveKeys()) { - std::vector temp; - for (int i = 0; i < g_Data.getEntityList()->getListSize(); i++) - temp.push_back(g_Data.getEntityList()->get(i)); - std::sort(temp.begin(), temp.end(), [localPlayer](const C_Entity* lhs, const C_Entity* rhs) { - return localPlayer->getPos()->dist(*lhs->getPos()) > localPlayer->getPos()->dist(*rhs->getPos()); - }); - for (C_Entity* ent : temp) - drawNameTags(ent, true); - } else { - nameTags.clear(); - } + if (ingameNametagSetting) + if (!gotPrevSetting) { + lastSetting = *ingameNametagSetting; + gotPrevSetting = true; + *ingameNametagSetting = false; + } else + *ingameNametagSetting = false; //disable other ppl's nametags + + g_Data.forEachEntity(drawNameTags); } + +void NameTags::onDisable() { + if (ingameNametagSetting && gotPrevSetting) { + *ingameNametagSetting = lastSetting; + gotPrevSetting = false; + } +} \ No newline at end of file diff --git a/Horion/Module/Modules/NameTags.h b/Horion/Module/Modules/NameTags.h index f06a9dd2..979d6a22 100644 --- a/Horion/Module/Modules/NameTags.h +++ b/Horion/Module/Modules/NameTags.h @@ -6,10 +6,17 @@ class NameTags : public IModule { public: std::set nameTags; bool displayArmor = true; + bool underline = true; + float opacity = 0.2f; NameTags(); ~NameTags(); + bool* ingameNametagSetting = nullptr; + bool lastSetting = true; + bool gotPrevSetting = false; + // Inherited via IModule virtual const char* getModuleName() override; virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override; + virtual void onDisable() override; }; diff --git a/Horion/Module/Modules/ViewModel.cpp b/Horion/Module/Modules/ViewModel.cpp new file mode 100644 index 00000000..a76d5c5f --- /dev/null +++ b/Horion/Module/Modules/ViewModel.cpp @@ -0,0 +1,40 @@ +#include "ViewModel.h" + + +ViewModel::ViewModel() : IModule(0, Category::VISUAL, "Custom item view model") { + this->registerBoolSetting("Reset", &this->Reset, this->Reset); + this->registerBoolSetting("Translate", &this->doTranslate, this->doTranslate); + this->registerBoolSetting("Scale", &this->doScale, this->doScale); + + this->registerFloatSetting("TranslateX", &this->xTrans, 0.f, -2.f, 2.f); + this->registerFloatSetting("TranslateY", &this->yTrans, 0.f, -2.f, 2.f); + this->registerFloatSetting("TranslateZ", &this->zTrans, 0.f, -2.f, 2.f); + + this->registerFloatSetting("ScaleX", &this->xMod, 1.f, 0.f, 2.f); + this->registerFloatSetting("ScaleY", &this->yMod, 1.f, 0.f, 2.f); + this->registerFloatSetting("ScaleZ", &this->zMod, 1.f, 0.f, 2.f); +} + +ViewModel::~ViewModel() { +} + +const char* ViewModel::getModuleName() { + return "ViewModel"; +} + +void ViewModel::onTick(C_GameMode* gm) { + if (g_Data.getLocalPlayer() == nullptr) + return; + + if (Reset) { + xTrans = 0.f; + yTrans = 0.f; + zTrans = 0.f; + + xMod = 1.f; + yMod = 1.f; + zMod = 1.f; + Reset = false; + } +} + diff --git a/Horion/Module/Modules/ViewModel.h b/Horion/Module/Modules/ViewModel.h new file mode 100644 index 00000000..b8b107b7 --- /dev/null +++ b/Horion/Module/Modules/ViewModel.h @@ -0,0 +1,27 @@ +#pragma once +#include "Module.h" +class ViewModel : public IModule { +private: + int delay = 0; + +public: + bool Reset = false; + bool doTranslate = true; + bool doScale = true; + + float float1 = 0; + float xMod = 1.f; + float yMod = 1.f; + float zMod = 1.f; + + float xTrans = 0.f; + float yTrans = 0.f; + float zTrans = 0.f; + + ViewModel(); + ~ViewModel(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; +}; diff --git a/Horion/Module/Modules/Xray.cpp b/Horion/Module/Modules/Xray.cpp index 199e2f9f..d3e94783 100644 --- a/Horion/Module/Modules/Xray.cpp +++ b/Horion/Module/Modules/Xray.cpp @@ -1,11 +1,28 @@ #include "Xray.h" -Xray::Xray() : IModule(VK_NUMPAD6, Category::VISUAL, "X-Ray view!") { +Xray::Xray() : IModule(0, Category::VISUAL, "Allows you to see certain blocks easier") { } Xray::~Xray() { } const char* Xray::getModuleName() { - return ("X-Ray"); + return ("Xray"); } + +void Xray::onTick(C_GameMode* gm) { + if (smoothLightningSetting != nullptr) { + if (!gotSmoothInfo) { + gotSmoothInfo = true; + wasSmooth = *smoothLightningSetting; + } + *smoothLightningSetting = 0; + } +} + +void Xray::onDisable() { + if (smoothLightningSetting != nullptr && gotSmoothInfo) { + *smoothLightningSetting = wasSmooth; + } + gotSmoothInfo = false; +} \ No newline at end of file diff --git a/Horion/Module/Modules/Xray.h b/Horion/Module/Modules/Xray.h index ea8b8139..3bbe14f6 100644 --- a/Horion/Module/Modules/Xray.h +++ b/Horion/Module/Modules/Xray.h @@ -2,9 +2,15 @@ #include "Module.h" class Xray : public IModule { public: + bool* smoothLightningSetting = nullptr; + bool gotSmoothInfo = false; + bool wasSmooth = false; + Xray(); ~Xray(); // Inherited via IModule virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 75ab0bf6..180beb6f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -36,17 +36,16 @@ void Hooks::Init() { g_Hooks.GameMode_attackHook = std::make_unique(gameModeVtable[14], Hooks::GameMode_attack); } } - + // BlockLegacy::vtable { intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 8B 72 ? 48 B9"); // BlockLegacy constructor int offset = *reinterpret_cast(sigOffset + 3); - uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + 7); + uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + 7); if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[180], Hooks::BlockLegacy_getRenderLayer); - g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[183], Hooks::BlockLegacy_getLightEmission); } } @@ -221,7 +220,7 @@ void Hooks::Init() { uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); - void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); + void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 0F 29 7C 24 ?? 44")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); @@ -239,7 +238,7 @@ void Hooks::Init() { void* chestScreenControllerTick = reinterpret_cast(FindSignature("48 89 5C 24 08 57 48 83 EC 20 48 8B F9 E8 ?? ?? ?? ?? 48 8B 17 48 8B CF 8B D8 FF 92 ?? ?? ?? ?? 84 C0 74 31")); g_Hooks.ChestScreenController_tickHook = std::make_unique(chestScreenControllerTick, Hooks::ChestScreenController_tick); - void* fullbright = reinterpret_cast(FindSignature("48 83 EC ? 80 B9 ? ? ? ? ? 48 8D 54 24 ? 74 ? 41 B8 ? ? ? ? E8 ? ? ? ? 48 8B 10 48 85 D2 74 ? 48 8B 42 ? 48 8B 88 ? ? ? ? 48 85 C9 74 ? E8 ? ? ? ? 48 83 C4 ? C3 F3 0F 10 42")); + void* fullbright = reinterpret_cast(FindSignature("48 83 EC ?? 80 B9 ?? ?? ?? ?? ?? 48 8D 54 24 ?? 48 8B 01 74 35 41 B8 0D 01 00 00")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); // Mob::_jumpFromGround @@ -288,25 +287,34 @@ void Hooks::Init() { static auto bobViewHookF = [](__int64 _this, glm::mat4& matrix, float lerpT){ static auto origFunc = g_Hooks.lambdaHooks.at(lambda_counter)->GetFastcall(); - - /*auto p = g_Data.getLocalPlayer(); + + static auto testMod = moduleMgr->getModule(); + auto p = g_Data.getLocalPlayer(); float degrees = fmodf(p->getPosOld()->lerp(p->getPos(), lerpT).x, 5) - 2.5f; degrees *= 180 / 2.5f; auto pos = g_Data.getClientInstance()->levelRenderer->origin; - + glm::mat4 View = matrix; - + matrix = View; - //matrix = glm::rotate(matrix, glm::radians(degrees), glm::vec3(0, 0, 1));*/ + if (testMod->isEnabled()) { + if (testMod->doTranslate) + matrix = glm::translate(matrix, glm::vec3(testMod->xTrans, testMod->yTrans, testMod->zTrans)); + + if (testMod->doScale) + matrix = glm::scale(matrix, glm::vec3(testMod->xMod, testMod->yMod, testMod->zMod)); + } return origFunc(_this, matrix, lerpT); }; - + std::shared_ptr bobViewHook = std::make_shared(levelRendererBobView, (decltype(&bobViewHookF.operator()))bobViewHookF); g_Hooks.lambdaHooks.push_back(bobViewHook); #undef lambda_counter + + logF("Hooks initialized"); } @@ -1145,9 +1153,9 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe float Hooks::LevelRendererPlayer_getFov(__int64 _this, float a2, bool a3) { static auto oGetFov = g_Hooks.LevelRendererPlayer_getFovHook->GetFastcall(); - static void* renderItemInHand = reinterpret_cast(FindSignature("0F 28 C8 F3 0F 59 0D ?? ?? ?? ?? 41 0F 28 F9")); + static void* renderItemInHand = reinterpret_cast(FindSignature("F3 0F 59 05 ?? ?? ?? ?? 45 0F 28 C2 F3")); - static void* setupCamera = reinterpret_cast(FindSignature("44 0F 28 D8 F3 44 0F 59 1D ?? ?? ?? ?? 0F")); + static void* setupCamera = reinterpret_cast(FindSignature("0F 28 F8 F3 0F 59 3D ?? ?? ?? ?? F3 0F 11 7C 24 24 F3 0F 10 87")); static auto zoomModule = moduleMgr->getModule(); @@ -1238,9 +1246,17 @@ int Hooks::BlockLegacy_getRenderLayer(C_BlockLegacy* a1) { if (strcmp(text, "lava") != NULL) if (strcmp(text, "water") != NULL) if (strcmp(text, "portal") != NULL) - if (strcmp(text, "ancient_debris") != NULL) - if (strcmp(text, "command_block") != NULL) - return 10; + if (strcmp(text, "amethyst_block") != NULL) + if (strcmp(text, "ancient_debris") != NULL) + if (strcmp(text, "command_block") != NULL) + if (strcmp(text, "repeating_command_block") != NULL) + if (strcmp(text, "chain_command_block") != NULL) + if (strcmp(text, "structure_block") != NULL) + if (strcmp(text, "deny") != NULL) + if (strcmp(text, "allow") != NULL) + if (strcmp(text, "bedrock") != NULL) + if (strcmp(text, "border_block") != NULL) + return 10; } return oFunc(a1); } @@ -1339,13 +1355,45 @@ __int64 Hooks::ChestScreenController_tick(C_ChestScreenController* a1) { } float Hooks::GetGamma(uintptr_t* a1) { - static auto fullBrightModule = moduleMgr->getModule(); - if (fullBrightModule->isEnabled()) - return fullBrightModule->intensity; + static auto fullbright = moduleMgr->getModule(); + static auto xrayMod = moduleMgr->getModule(); + static auto nametagmod = moduleMgr->getModule(); + + uintptr_t** list = (uintptr_t**)a1; + + char obtainedSettings = 0; + bool hadIt = false; + for (uint16_t i = 3; i < 450; i++) { + if (list[i] == nullptr) continue; + uintptr_t* info = *(uintptr_t**)((uintptr_t)list[i] + 8); + if (info == nullptr) continue; + + TextHolder* translateName = (TextHolder*)((uintptr_t)info + 0x1D8); + TextHolder* settingname = (TextHolder*)((uintptr_t)info + 0x188); + + if (!strcmp(translateName->getText(), "options.smoothlighting")) { + if (hadIt) continue; + bool* smoothlightning = (bool*)((uintptr_t)list[i] + 16); + xrayMod->smoothLightningSetting = smoothlightning; + obtainedSettings++; + hadIt = true; + } else if (!strcmp(settingname->getText(), "gfx_ingame_player_names")) { + bool* ingamePlayerName = (bool*)((uintptr_t)list[i] + 16); + nametagmod->ingameNametagSetting = ingamePlayerName; + obtainedSettings++; + } + + if (obtainedSettings == 2) break; + } + + if (xrayMod->isEnabled()) + return 25.f; + + if (fullbright->isEnabled()) + return fullbright->intensity; - //Get the normal gamma value - float* gamer = (float*)*(a1 + 0x27); - return *(gamer + 0x7A); + static auto ofunc = g_Hooks.GetGammaHook->GetFastcall(); + return ofunc(a1); } bool Hooks::Actor_isInWater(C_Entity* _this) { diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 76229072..0c76fada 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -40,10 +40,11 @@ class C_BlockLegacy { public: class C_Material* material; //0x00D8 private: - char pad_00E0[104]; //0x00E0 + char pad_00E0[108]; //0x00E0 public: - int64_t blockId; //0x0148 + short blockId; //0x014C + int liquidGetDepth(C_BlockSource*, const vec3_ti* pos); void liquidGetFlow(vec3_t* flowOut, C_BlockSource*, const vec3_ti* pos); bool getCollisionShape(AABB* collShapeOut, C_Block* block, C_BlockSource* blockSource, const vec3_ti* pos, C_Entity* actor); bool hasWater(C_BlockSource*, const vec3_ti& pos); diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index b9324944..c744f5be 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -47,12 +47,12 @@ void C_ItemStack::fromTag(const Tag &tag) { } void C_ItemStack::save(CompoundTag **tag) { using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **); - ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B FA 48 8B F1 48 89 55 F7 45 33 ED")); + ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC 90 ?? ?? ?? 48 8B F2 48 8B F9 48 89 55 17 4C 8B 79")); return save(this, tag); } void C_ItemStack::setUserData(std::unique_ptr tag) { using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); - setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B DA 48 8D 51 10 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); + setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B DA 48 8D 51 20 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); setUserData(this, std::move(tag)); } void C_ItemStack::reinit(C_BlockLegacy &legacy, int count) { From 60b1b3061ee4602dd4ebca7535dcd10a78be2306 Mon Sep 17 00:00:00 2001 From: thesynx <87203897+Synx173@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:32:54 -0400 Subject: [PATCH 324/419] fix vanillatweaks not sure why the sig had no wildcards but ok --- Horion/Module/Modules/VanillaPlus.cpp | 2 +- SDK/CPacket.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/VanillaPlus.cpp b/Horion/Module/Modules/VanillaPlus.cpp index d7b1d379..74f391ae 100644 --- a/Horion/Module/Modules/VanillaPlus.cpp +++ b/Horion/Module/Modules/VanillaPlus.cpp @@ -21,7 +21,7 @@ void VanillaPlus::onEnable() { // flying items { if (flyingItemsFuncPtr == nullptr) - flyingItemsFuncPtr = reinterpret_cast(9 + FindSignature("48 3B D8 0F 84 F8 01 00 00")); + flyingItemsFuncPtr = reinterpret_cast(10 + FindSignature("48 3B 5E ?? 0F 84 ?? ?? ?? ?? 4C 8D 25")); memcpy(flyingItemsPrevCodeBuf, flyingItemsFuncPtr, 26); DWORD oldProtect = 0; diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 3145c527..e6843ee8 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -22,7 +22,7 @@ LevelSoundEventPacket::LevelSoundEventPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket() { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 F2 0F 10 42 ?? F2 0F 11 41 ?? F2 0F 10 42"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -36,7 +36,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused) { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 01 F2 0F 10 42 ?? F2 0F 11 41 ?? F2 0F 10 42"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG From 4d339ba5e8d7ed55b18b3c0c6b746b69c9da0227 Mon Sep 17 00:00:00 2001 From: thesynx <87203897+Synx173@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:41:50 -0400 Subject: [PATCH 325/419] fix freecam being troll bruh moment --- Horion/Module/Modules/Freecam.cpp | 46 +++++++++++++++---------------- Horion/Module/Modules/Freecam.h | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Horion/Module/Modules/Freecam.cpp b/Horion/Module/Modules/Freecam.cpp index 9f26348b..3df10835 100644 --- a/Horion/Module/Modules/Freecam.cpp +++ b/Horion/Module/Modules/Freecam.cpp @@ -14,46 +14,46 @@ const char* Freecam::getModuleName() { void Freecam::onTick(C_GameMode* gm) { gm->player->fallDistance = 0.f; gm->player->velocity = vec3_t(0, 0, 0); + gm->player->aabb.upper = gm->player->aabb.lower; } void Freecam::onEnable() { if (g_Data.getLocalPlayer() != nullptr) { oldPos = *g_Data.getLocalPlayer()->getPos(); + oldOffset = g_Data.getLocalPlayer()->aabb.upper.sub(g_Data.getLocalPlayer()->aabb.lower); } } void Freecam::onMove(C_MoveInputHandler* input) { - auto player = g_Data.getLocalPlayer(); - if (player == nullptr) return; - - - - vec2_t moveVec2d = { input->forwardMovement, -input->sideMovement }; - bool pressed = moveVec2d.magnitude() > 0.01f; - - float calcYaw = (player->yaw + 90) * (PI / 180); - vec3_t moveVec; - float c = cos(calcYaw); - float s = sin(calcYaw); - moveVec2d = { moveVec2d.x * c - moveVec2d.y * s, moveVec2d.x * s + moveVec2d.y * c }; - moveVec.x = moveVec2d.x * speed; - moveVec.y = player->velocity.y; - moveVec.z = moveVec2d.y * speed; - if (pressed) player->lerpMotion(moveVec); - C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); + auto player = g_Data.getLocalPlayer(); + if (player == nullptr) return; + + vec2_t moveVec2d = {input->forwardMovement, -input->sideMovement}; + bool pressed = moveVec2d.magnitude() > 0.01f; + + float calcYaw = (player->yaw + 90) * (PI / 180); + vec3_t moveVec; + float c = cos(calcYaw); + float s = sin(calcYaw); + moveVec2d = {moveVec2d.x * c - moveVec2d.y * s, moveVec2d.x * s + moveVec2d.y * c}; + moveVec.x = moveVec2d.x * speed; + moveVec.y = player->velocity.y; + moveVec.z = moveVec2d.y * speed; + if (pressed) player->lerpMotion(moveVec); + C_MovePlayerPacket p(g_Data.getLocalPlayer(), *g_Data.getLocalPlayer()->getPos()); if (input->isJumping) { player->velocity.y += 0.50f; - } if (input->isSneakDown) { player->velocity.y -= 0.50f; - } } void Freecam::onDisable() { - if (g_Data.getLocalPlayer() != nullptr) { - g_Data.getLocalPlayer()->setPos(oldPos); + auto plr = g_Data.getLocalPlayer(); + if (plr) { + plr->setPos(oldPos); *g_Data.getClientInstance()->minecraft->timer = 20.f; + plr->aabb.upper = plr->aabb.lower.add(oldOffset); } -} +} \ No newline at end of file diff --git a/Horion/Module/Modules/Freecam.h b/Horion/Module/Modules/Freecam.h index 11a0c899..1c0ba02b 100644 --- a/Horion/Module/Modules/Freecam.h +++ b/Horion/Module/Modules/Freecam.h @@ -3,8 +3,8 @@ class Freecam : public IModule { private: vec3_t oldPos; + vec3_t oldOffset = {}; float speed = 0.325f; - public: Freecam(); ~Freecam(); From f1dd8f2551c979e29d6d951f8b3652d5c22ddf7f Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:54:24 -0400 Subject: [PATCH 326/419] Stuff v2 (#4431) * Fix time changer and update id's * Update PlayerAuthInputPacket * Update Killaura.cpp * Update TeleportCommand.cpp * Update CPacket.cpp * entity stuff * getBlockEntity thank you JayRSky * Update CItem.cpp --- Horion/Command/Commands/TeleportCommand.cpp | 2 +- Horion/Module/Modules/Killaura.cpp | 2 +- Memory/Hooks.cpp | 2 +- SDK/CBlockLegacy.cpp | 2 +- SDK/CEntity.cpp | 16 ++++++++++++++++ SDK/CEntity.h | 18 +++++++++++------- SDK/CItem.cpp | 2 +- SDK/CPacket.cpp | 8 ++++---- Utils/Target.cpp | 4 ++-- 9 files changed, 38 insertions(+), 18 deletions(-) diff --git a/Horion/Command/Commands/TeleportCommand.cpp b/Horion/Command/Commands/TeleportCommand.cpp index f03bdaa6..443ac49e 100644 --- a/Horion/Command/Commands/TeleportCommand.cpp +++ b/Horion/Command/Commands/TeleportCommand.cpp @@ -14,7 +14,7 @@ bool TeleportCommand::execute(std::vector* args) { vec3_t pos; pos.x = assertFloat(args->at(1)); - pos.y = assertFloat(args->at(2)); + pos.y = assertFloat(args->at(2)) + 1; pos.z = assertFloat(args->at(3)); g_Data.getLocalPlayer()->setPos(pos); diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index f3e459a7..c7ca45a3 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -38,7 +38,7 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { return; if (killauraMod->isMobAura) { - if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 63) + if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 319) return; if(currentEntity->width <= 0.01f || currentEntity->height <= 0.01f) // Don't hit this pesky antibot on 2b2e.org return; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 180beb6f..0cffabc3 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -196,7 +196,7 @@ void Hooks::Init() { void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); - void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); + void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05 F7 EA")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48")); diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index dd0c2ff9..d5fdeea2 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -10,7 +10,7 @@ C_Block* C_BlockSource::getBlock(const vec3_ti& block) { } C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { using getBlockEntity_t = C_BlockActor*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 8B 02 48 8B DA C1 F8 ? 48 8B F1 89 44 24 ? 8B 42")); + static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("40 55 56 57 48 83 EC ?? 8B 02")); return getBlockEntity(this, block); } C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index e3863a74..e1c94cf0 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -34,3 +34,19 @@ void C_LocalPlayer::setGameModeType(int gma) { //static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); this->setC_PlayerGameType(gma); } + +bool PointingStruct::hasEntity() { + return rayHitType == 1; +} + +C_Entity *PointingStruct::getEntity() { + if (rayHitType != 1) return nullptr; + C_Entity *retval = nullptr; + g_Data.forEachEntity([this, &retval](C_Entity *ent, bool b) { + if (*(__int64 *)((__int64)ent + 0x10) == GamingEntityFinder) { + retval = ent; + return; + } + }); + return retval; +} diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 1ac31332..d9f2fa1e 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -11,13 +11,17 @@ class C_GameMode; class PointingStruct { private: - char pad_0x0000[0x938]; //0x0000 -public: - int rayHitType; //0x08E0 - int blockSide; //0x08E4 - vec3_ti block; //0x08E8 - vec3_t rayHitVec; //0x08F4 - C_Entity *entityPtr; //0x0900 + char pad_0x0000[0x980]; //0x0000 +public: + int rayHitType; //0x08E0 + int blockSide; //0x08E4 + vec3_ti block; //0x08E8 + vec3_t rayHitVec; //0x08F4 + C_Entity *entityPtr; //0x0900 + C_Entity *entityPtr2; //0x0908 + uint64_t GamingEntityFinder; //0x0910 + bool hasEntity(); //to not go trough the entity list twice + C_Entity *getEntity(); //returns the entity that the player is looking at }; class C_Player; diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index c744f5be..2498ad65 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -52,7 +52,7 @@ void C_ItemStack::save(CompoundTag **tag) { } void C_ItemStack::setUserData(std::unique_ptr tag) { using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); - setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B DA 48 8D 51 20 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); + setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B DA 48 8D 51 50 48 3B D3 74 1F 48 8B 03 48 C7 03 ?? ?? ?? ??")); setUserData(this, std::move(tag)); } void C_ItemStack::reinit(C_BlockLegacy &legacy, int count) { diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 3145c527..43f5da1d 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -22,7 +22,7 @@ LevelSoundEventPacket::LevelSoundEventPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket() { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 25 ?? ?? ?? 48 89 45 97 48 89 7D 9F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -36,7 +36,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused) { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 25 ?? ?? ?? 48 89 45 97 48 89 7D 9F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -121,7 +121,7 @@ C_TextPacket::C_TextPacket() { C_MovePlayerPacket::C_MovePlayerPacket() { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 70 ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -135,7 +135,7 @@ C_MovePlayerPacket::C_MovePlayerPacket() { C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 70 ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG diff --git a/Utils/Target.cpp b/Utils/Target.cpp index 4dd34d81..743d1eb5 100644 --- a/Utils/Target.cpp +++ b/Utils/Target.cpp @@ -24,10 +24,10 @@ bool Target::isValidTarget(C_Entity* ent) { if (!ent->isAlive()) return false; - if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 63 && antibot->isEntityIdCheckEnabled()) + if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 319 && antibot->isEntityIdCheckEnabled()) return false; - if (ent->getEntityTypeId() == 63) { + if (ent->getEntityTypeId() == 319) { if (teams->isColorCheckEnabled()) { std::string targetName = ent->getNameTag()->getText(); std::string localName = g_Data.getLocalPlayer()->getNameTag()->getText(); From 4307e661f5d56c3526cd971184ceda06975d7821 Mon Sep 17 00:00:00 2001 From: Intoprelised <78622918+Intoprelised@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:56:22 -0400 Subject: [PATCH 327/419] Fix signature (#4433) * Fix signature * added wildcards * Made .Cbe put the item into your hand just not the nbt --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index b1e90817..07f066f3 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -25,7 +25,7 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { std::string tag = "{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}"; yot->setUserData(std::move(Mojangson::parseTag(tag))); g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); - g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); + //g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); return true; From d153833b2cea7dadadcac091df279ed1af6dd4aa Mon Sep 17 00:00:00 2001 From: NRGJobro <85864573+NRGJobro@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:56:43 -0400 Subject: [PATCH 328/419] Fixed The Dupe Command Again (#4434) Fixed the offhand option in dupe. (didn't do anything before) --- Horion/Command/Commands/DupeCommand.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Horion/Command/Commands/DupeCommand.cpp b/Horion/Command/Commands/DupeCommand.cpp index f13b9336..9e040451 100644 --- a/Horion/Command/Commands/DupeCommand.cpp +++ b/Horion/Command/Commands/DupeCommand.cpp @@ -1,6 +1,7 @@ #include "DupeCommand.h" DupeCommand::DupeCommand() : IMCCommand("dupe", "Duplicates the item in hand", " ") { + registerAlias("d"); } DupeCommand::~DupeCommand() { @@ -8,37 +9,30 @@ DupeCommand::~DupeCommand() { bool DupeCommand::execute(std::vector* args) { C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); - C_Inventory* inv = supplies->inventory; auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); - + C_Inventory* inv = supplies->inventory; int selectedSlot = supplies->selectedHotbarSlot; C_ItemStack* item = inv->getItemStack(selectedSlot); - int count = item->count; bool isGive = true; - if (args->size() > 1) item->count = assertInt(args->at(1)); if (args->size() > 2) isGive = static_cast(assertInt(args->at(2))); - if (isGive) { - int slot = inv->getFirstEmptySlot(); - C_InventoryAction* firstAction = nullptr; C_InventoryAction* secondAction = nullptr; - firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); - transactionManager->addInventoryAction(*firstAction); - inv->addItemToFirstEmptySlot(item); - } else + } else { + C_InventoryAction* pp = nullptr; + pp = new C_InventoryAction(0, item, nullptr, 507, 99999); + transactionManager->addInventoryAction(*pp); g_Data.getLocalPlayer()->setOffhandSlot(item); - + } if (args->size() > 1) item->count = count; - - clientMessageF("%sSuccessfully duplicated the item!", GREEN); + clientMessageF("%sSuccessfully duplicated the item!", GREEN); return true; } From 13f102545242fb56bf72236d64a643502b15c091 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Thu, 19 Aug 2021 14:51:03 -0400 Subject: [PATCH 329/419] localPlayerUpdateFromCam sig --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 0cffabc3..a14205a8 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -271,7 +271,7 @@ void Hooks::Init() { g_Hooks.InventoryTransactionManager__addActionHook = std::make_unique(addAction, Hooks::InventoryTransactionManager__addAction); #endif - void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 80 BA")); + void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 80 ?? ?? ?? ?? ?? 00 48 8B FA 48 8B D9")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 E8 ? ? ? ? 84 C0 75 ? 48 8B 03 48 8B CB")); From b2c88dd5761b2851d2dfccf82342b7e0242c21af Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 19 Aug 2021 21:45:21 +0200 Subject: [PATCH 330/419] make it compile --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3bd62448..e989d5d4 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -338,7 +338,7 @@ void* Hooks::Player_tickWorld(C_Player* _this, __int64 unk) { } void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* text) { - static auto oSendMessage = g_Hooks.ClientInstanceScreenModel_sendChatMessageHook->GetFastcall(); + static auto oSendMessage = g_Hooks.ClientInstanceScreenModel_sendChatMessageHook->GetFastcall(); if (text->getTextLength() > 0) { From 96e5095e78f7e8ceddadcfba074533fd4119fac2 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 19 Aug 2021 22:19:56 +0200 Subject: [PATCH 331/419] make noswing actual noswing --- Horion/Module/Modules/AutoClicker.cpp | 3 +-- Horion/Module/Modules/CrystalAura.cpp | 6 ++---- Horion/Module/Modules/Fucker.cpp | 6 ++---- Horion/Module/Modules/InfiniteReach.cpp | 3 +-- Horion/Module/Modules/NoSwing.cpp | 2 +- Horion/Module/Modules/TriggerBot.cpp | 3 +-- Memory/Hooks.cpp | 8 ++++++++ Memory/Hooks.h | 2 ++ 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Horion/Module/Modules/AutoClicker.cpp b/Horion/Module/Modules/AutoClicker.cpp index 96af912b..3c4b0871 100644 --- a/Horion/Module/Modules/AutoClicker.cpp +++ b/Horion/Module/Modules/AutoClicker.cpp @@ -28,8 +28,7 @@ void AutoClicker::onTick(C_GameMode* gm) { g_Data.leftclickCount++; - if (!moduleMgr->getModule()->isEnabled()) - localPlayer->swingArm(); + localPlayer->swingArm(); if (pointing->entityPtr != 0) gm->attack(pointing->entityPtr); diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index 62a9ea6e..62d84cb8 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -101,14 +101,12 @@ void CrystalAura::CPlace(C_GameMode* gm, vec3_t* pos) { void CrystalAura::DestroyC(C_Entity* ent, int range) { if (g_Data.getLocalPlayer()->getPos()->dist(*ent->getPos()) < range && !dEnhanced) { g_Data.getCGameMode()->attack(ent); - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swingArm(); + g_Data.getLocalPlayer()->swingArm(); } else if (dEnhanced) { for (auto& i : targetList) if (ent->getPos()->dist(*i->getPos()) < range) { g_Data.getCGameMode()->attack(ent); - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swingArm(); + g_Data.getLocalPlayer()->swingArm(); return; } } diff --git a/Horion/Module/Modules/Fucker.cpp b/Horion/Module/Modules/Fucker.cpp index 5a75ded1..41468b11 100644 --- a/Horion/Module/Modules/Fucker.cpp +++ b/Horion/Module/Modules/Fucker.cpp @@ -34,8 +34,7 @@ void Fucker::onTick(C_GameMode* gm) { if (destroy) { gm->destroyBlock(&blockPos, 0); - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swingArm(); + g_Data.getLocalPlayer()->swingArm(); return; } } @@ -48,8 +47,7 @@ void Fucker::onTick(C_GameMode* gm) { int id = ent->getEntityTypeId(); if (name.find("Treasure") != std::string::npos && g_Data.getLocalPlayer()->getPos()->dist(*ent->getPos()) <= 5) { g_Data.getCGameMode()->attack(ent); - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swingArm(); + g_Data.getLocalPlayer()->swingArm(); } }); } diff --git a/Horion/Module/Modules/InfiniteReach.cpp b/Horion/Module/Modules/InfiniteReach.cpp index 27a2f5b3..87e2cbe4 100644 --- a/Horion/Module/Modules/InfiniteReach.cpp +++ b/Horion/Module/Modules/InfiniteReach.cpp @@ -49,8 +49,7 @@ void InfiniteReach::onTick(C_GameMode* gm) { Odelay++; if (targetList0.size() > 0 && Odelay >= delay) { - if (!moduleMgr->getModule()->isEnabled()) - g_Data.getLocalPlayer()->swingArm(); + g_Data.getLocalPlayer()->swingArm(); float calcYaw = (gm->player->yaw + 90) * (PI / 180); float calcPitch = (gm->player->pitch) * -(PI / 180); diff --git a/Horion/Module/Modules/NoSwing.cpp b/Horion/Module/Modules/NoSwing.cpp index 7b054e76..49ee4368 100644 --- a/Horion/Module/Modules/NoSwing.cpp +++ b/Horion/Module/Modules/NoSwing.cpp @@ -1,6 +1,6 @@ #include "NoSwing.h" -NoSwing::NoSwing() : IModule(0, Category::PLAYER, "Disable arm swing animation for killaura, triggerbot, fucker etc.") { +NoSwing::NoSwing() : IModule(0, Category::PLAYER, "Disable arm swing animation") { } NoSwing::~NoSwing() { diff --git a/Horion/Module/Modules/TriggerBot.cpp b/Horion/Module/Modules/TriggerBot.cpp index 466583b7..2cdace6f 100644 --- a/Horion/Module/Modules/TriggerBot.cpp +++ b/Horion/Module/Modules/TriggerBot.cpp @@ -21,8 +21,7 @@ void TriggerBot::onTick(C_GameMode* gm) { if (!Target::isValidTarget(target)) return; - if (!moduleMgr->getModule()->isEnabled()) - localPlayer->swingArm(); + localPlayer->swingArm(); gm->attack(target); Odelay = 0; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 992c8553..cc95f706 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -62,6 +62,8 @@ void Hooks::Init() { g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder);*/ + + g_Hooks.Actor_swingHook = std::make_unique(localPlayerVtable[214], Hooks::Actor_swing); } } @@ -1436,6 +1438,12 @@ void Hooks::Actor_ascendLadder(C_Entity* _this) { return oFunc(_this); } +void Hooks::Actor_swing(C_Entity* _this) { + static auto oFunc = g_Hooks.Actor_swingHook->GetFastcall(); + static auto noSwingMod = moduleMgr->getModule(); + if(!noSwingMod->isEnabled()) return oFunc(_this); +} + void Hooks::Actor_startSwimming(C_Entity* _this) { static auto oFunc = g_Hooks.Actor_startSwimmingHook->GetFastcall(); diff --git a/Memory/Hooks.h b/Memory/Hooks.h index fc2b5d28..793a5878 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -103,6 +103,7 @@ class Hooks { static void JumpPower(C_Entity* _this, float a2); static __int64 MinecraftGame_onAppSuspended(__int64 _this); static void Actor_ascendLadder(C_Entity* _this); + static void Actor_swing(C_Entity* _this); static void Actor_startSwimming(C_Entity* _this); static void RakNetInstance_tick(C_RakNetInstance* _this, __int64 a2, __int64 a3); static float GameMode_getPickRange(C_GameMode* _this, __int64 a2, char a3); @@ -153,6 +154,7 @@ class Hooks { std::unique_ptr JumpPowerHook; std::unique_ptr MinecraftGame_onAppSuspendedHook; std::unique_ptr Actor_ascendLadderHook; + std::unique_ptr Actor_swingHook; std::unique_ptr Actor_startSwimmingHook; std::unique_ptr RakNetInstance_tickHook; std::unique_ptr GameMode_getPickRangeHook; From 44273235cb4a979a1b4024f832bf2c951f7aad03 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 19 Aug 2021 22:55:53 +0200 Subject: [PATCH 332/419] Create msbuild.yml --- .github/workflows/msbuild.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/msbuild.yml diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml new file mode 100644 index 00000000..29b6aceb --- /dev/null +++ b/.github/workflows/msbuild.yml @@ -0,0 +1,32 @@ +name: MSBuild + +on: [push] + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + + # Configuration type to build. + # You can convert this to a build matrix if you need coverage of multiple configuration types. + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + BUILD_CONFIGURATION: Release + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Build + working-directory: ${{env.GITHUB_WORKSPACE}} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} From 24fb4494205ce3c90b24ac9142b2fad3ce5fa86b Mon Sep 17 00:00:00 2001 From: Packet <86270028+PacketDeveloper@users.noreply.github.com> Date: Thu, 19 Aug 2021 20:14:43 -0600 Subject: [PATCH 333/419] make killaura not attack xp orbs --- Horion/Module/Modules/Killaura.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index c7ca45a3..fbcde227 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -37,6 +37,9 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { if(!currentEntity->isAlive()) return; + if (currentEntity->getEntityTypeId() == 69) // XP + return; + if (killauraMod->isMobAura) { if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 319) return; From 0eedeab5c72ce9e130e82c09bc0ac313e49568b8 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 09:03:40 -0400 Subject: [PATCH 334/419] Entity stuff dont know why nametags doesnt work and killaura does not attack players --- Horion/Command/Commands/NbtCommand.cpp | 4 +-- Horion/Module/Modules/AutoClicker.cpp | 4 +-- Horion/Module/Modules/CrystalAura.cpp | 4 +-- Horion/Module/Modules/MidClick.cpp | 2 +- Horion/Module/Modules/Nbt.cpp | 4 +-- Horion/Module/Modules/TriggerBot.cpp | 2 +- Memory/GameData.cpp | 44 ++++++++++---------------- SDK/CEntity.h | 4 ++- SDK/CEntityList.h | 2 +- 9 files changed, 31 insertions(+), 39 deletions(-) diff --git a/Horion/Command/Commands/NbtCommand.cpp b/Horion/Command/Commands/NbtCommand.cpp index 5f306583..058cb112 100644 --- a/Horion/Command/Commands/NbtCommand.cpp +++ b/Horion/Command/Commands/NbtCommand.cpp @@ -35,12 +35,12 @@ bool NbtCommand::execute(std::vector* args) { boy->write(build); delete boy; } else { - if (pointingStruct->entityPtr != nullptr) { + if (pointingStruct->getEntity() != nullptr) { if (g_Data.getRakNetInstance()->serverIp.getTextLength() >= 1) { clientMessageF("%sNBT tags for mobs only works in local world!", RED); return true; } - pointingStruct->entityPtr->save(tag.get()); + pointingStruct->getEntity()->save(tag.get()); tag->write(build); } else if (blockActor != nullptr) { blockActor->save(tag.get()); diff --git a/Horion/Module/Modules/AutoClicker.cpp b/Horion/Module/Modules/AutoClicker.cpp index 3c4b0871..e57d4beb 100644 --- a/Horion/Module/Modules/AutoClicker.cpp +++ b/Horion/Module/Modules/AutoClicker.cpp @@ -30,8 +30,8 @@ void AutoClicker::onTick(C_GameMode* gm) { localPlayer->swingArm(); - if (pointing->entityPtr != 0) - gm->attack(pointing->entityPtr); + if (pointing->hasEntity() != 0) + gm->attack(pointing->getEntity()); else if (breakBlocks) { bool isDestroyed = false; gm->startDestroyBlock(pointing->block, pointing->blockSide, isDestroyed); diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index 62d84cb8..924ff825 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -151,7 +151,7 @@ void CrystalAura::onTick(C_GameMode* gm) { CPlace(gm, i->getPos()); else { auto ptr = g_Data.getClientInstance()->getPointerStruct(); - if (ptr->entityPtr == nullptr && ptr->rayHitType == 0) + if (ptr->getEntity() == nullptr && ptr->rayHitType == 0) CPlace(gm, &ptr->block.toFloatVector()); } } @@ -190,7 +190,7 @@ void CrystalAura::onPreRender(C_MinecraftUIRenderContext* renderCtx) { auto ptr = g_Data.getClientInstance()->getPointerStruct(); if (ptr != nullptr) - if (ptr->entityPtr == nullptr && ptr->rayHitType == 0) + if (ptr->getEntity() == nullptr && ptr->rayHitType == 0) if (g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 49 || g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 7) { DrawUtils::setColor(.75f, .25f, .5f, 1.f); diff --git a/Horion/Module/Modules/MidClick.cpp b/Horion/Module/Modules/MidClick.cpp index 8e16337d..a6db565f 100644 --- a/Horion/Module/Modules/MidClick.cpp +++ b/Horion/Module/Modules/MidClick.cpp @@ -11,7 +11,7 @@ const char* MidClick::getModuleName() { } void MidClick::onTick(C_GameMode* gm) { - C_Entity* entity = g_Data.getClientInstance()->getPointerStruct()->entityPtr; + C_Entity* entity = g_Data.getClientInstance()->getPointerStruct()->getEntity(); if (entity == nullptr) return; diff --git a/Horion/Module/Modules/Nbt.cpp b/Horion/Module/Modules/Nbt.cpp index a43ca2a9..be4f5706 100644 --- a/Horion/Module/Modules/Nbt.cpp +++ b/Horion/Module/Modules/Nbt.cpp @@ -19,12 +19,12 @@ void Nbt::onTick(C_GameMode* gm) { PointingStruct* pointingStruct = g_Data.getClientInstance()->getPointerStruct(); if (GameData::isRightClickDown()) { // && Utils::getClipboardText() != this->lastCopy) { - if (pointingStruct->entityPtr != nullptr) { + if (pointingStruct->getEntity() != nullptr) { if (!(g_Data.getRakNetInstance()->serverIp.getTextLength() < 1)) return; std::unique_ptr tag = std::make_unique(); - pointingStruct->entityPtr->save(tag.get()); + pointingStruct->getEntity()->save(tag.get()); std::stringstream build; tag->write(build); auto str = build.str(); diff --git a/Horion/Module/Modules/TriggerBot.cpp b/Horion/Module/Modules/TriggerBot.cpp index 2cdace6f..3f874b6a 100644 --- a/Horion/Module/Modules/TriggerBot.cpp +++ b/Horion/Module/Modules/TriggerBot.cpp @@ -14,7 +14,7 @@ const char* TriggerBot::getModuleName() { } void TriggerBot::onTick(C_GameMode* gm) { C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); - C_Entity* target = g_Data.getClientInstance()->getPointerStruct()->entityPtr; + C_Entity* target = g_Data.getClientInstance()->getPointerStruct()->getEntity(); Odelay++; if (target != 0 && Odelay >= delay) { diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 203b44bd..c7558d4d 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -157,7 +157,21 @@ void GameData::setRakNetInstance(C_RakNetInstance* raknet) { } void GameData::forEachEntity(std::function callback) { - std::vector tickedEntities; + //Player EntityList + C_EntityList* entityList = (C_EntityList*)g_Data.getClientInstance()->getPointerStruct(); + uintptr_t start = ((uintptr_t)entityList + 0x70); + uintptr_t stop = ((uintptr_t)entityList + 0x78); + start = *(uintptr_t*)start; + stop = *(uintptr_t*)stop; + //logF("size: %i", (stop - start) / sizeof(uintptr_t*)); + + while (start < stop) { + C_Entity* ent = *(C_Entity**)start; + if (ent != nullptr) + callback(ent, false); + start += 8; + } + // New EntityList { // MultiplayerLevel::directTickEntities @@ -166,33 +180,9 @@ void GameData::forEachEntity(std::function callback) { for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; // !isRemoved() && !isGlobal() - if (actor && !*(char*)(actor + 0x3E1) && !*(char*)(actor + 0x3E2)) { + if (actor && !*(char*)(actor + 993) && !*(char*)(actor + 994)) { C_Entity* ent = reinterpret_cast(actor); - if (std::find(tickedEntities.begin(), tickedEntities.end(), ent) == tickedEntities.end()) { - callback(ent, false); - tickedEntities.push_back(ent); - } - } - } - } - - // Regular EntityList - { - C_EntityList* entList = g_Data.getEntityList(); - if (entList == 0) { -#ifdef _DEBUG - logF("EntityList broken btw yeeeeeeyt"); -#endif - } else { - size_t listSize = entList->getListSize(); - if (listSize < 5000 && listSize > 0) { - for (size_t i = 0; i < listSize; i++) { - C_Entity* current = entList->get(i); - if (std::find(tickedEntities.begin(), tickedEntities.end(), current) == tickedEntities.end()) { - callback(current, true); - tickedEntities.push_back(current); - } - } + callback(ent, false); } } } diff --git a/SDK/CEntity.h b/SDK/CEntity.h index d9f2fa1e..f2cb48c4 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -10,16 +10,18 @@ class C_GameMode; class PointingStruct { -private: char pad_0x0000[0x980]; //0x0000 public: int rayHitType; //0x08E0 int blockSide; //0x08E4 vec3_ti block; //0x08E8 vec3_t rayHitVec; //0x08F4 +private: C_Entity *entityPtr; //0x0900 C_Entity *entityPtr2; //0x0908 uint64_t GamingEntityFinder; //0x0910 + +public: bool hasEntity(); //to not go trough the entity list twice C_Entity *getEntity(); //returns the entity that the player is looking at }; diff --git a/SDK/CEntityList.h b/SDK/CEntityList.h index fe876648..d0497a0e 100644 --- a/SDK/CEntityList.h +++ b/SDK/CEntityList.h @@ -5,7 +5,7 @@ class C_Entity; class C_EntityList { private: - char pad_0x0000[0x50]; //0x0000 + char pad_0x0000[0x70]; //0x0000 public: uintptr_t firstEntity; //0x0050 uintptr_t lastEntity; //0x0058 From 391bea841ae25bb7c505ba37e163aab94f3300f0 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 11:54:21 -0400 Subject: [PATCH 335/419] BaseActorRenderContext_constructor --- SDK/CItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 2498ad65..b3c974c6 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -7,7 +7,7 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C_ClientInstance *client, MinecraftGame *game) { memset(this, 0, sizeof(C_BaseActorRenderContext)); using BaseActorRenderContext_t = __int64(__fastcall *)(C_BaseActorRenderContext *, C_ScreenContext *, C_ClientInstance *, MinecraftGame *); - static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8D 05 ? ? ? ? 33 F6 48 89 01 49 8B D8 48 89 71 ? 48 8B F9 8B 42")); + static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 8B EA 48 89 01 48 8B F9 48 8B 71 ?? 48 8B 59 30 48")); BaseActorRenderContext_constructor(this, ScreenCtx, client, game); } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { From 5ae55ec23c3076e3e0f2e734ced6698cf03d15ad Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 12:18:37 -0400 Subject: [PATCH 336/419] playerActionPacketVtable --- SDK/CPacket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 2b17bb9c..1b3fbe08 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -156,7 +156,7 @@ C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { C_PlayerActionPacket::C_PlayerActionPacket() { static uintptr_t** playerActionPacketVtable = 0x0; if (playerActionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 48 89 74 24 ? 48 89 74 24 ? 8B CF 83 F1"); + uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 48 89 4C 24 30 F3 0F 11 44 24 60 F3"); int offset = *reinterpret_cast(sigOffset + 3); playerActionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG From 6256cc1b1b3f2ab8333e48e025f091e5bafffbf0 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 15:08:39 -0400 Subject: [PATCH 337/419] oops --- Horion/DrawUtils.cpp | 2 +- Horion/Module/Modules/Killaura.cpp | 2 +- Utils/Target.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 3bcfbc64..292f2732 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -381,7 +381,7 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo static auto nameTagsMod = moduleMgr->getModule(); - if (ent->getEntityTypeId() == 319 && nameTagsMod->displayArmor) { // is player, show armor + if (ent->getEntityTypeId() == 63 && nameTagsMod->displayArmor) { // is player, show armor auto* player = reinterpret_cast(ent); float scale = textSize * 0.6f; float spacing = scale + 15.f; diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index c7ca45a3..f3e459a7 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -38,7 +38,7 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { return; if (killauraMod->isMobAura) { - if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 319) + if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 63) return; if(currentEntity->width <= 0.01f || currentEntity->height <= 0.01f) // Don't hit this pesky antibot on 2b2e.org return; diff --git a/Utils/Target.cpp b/Utils/Target.cpp index 743d1eb5..4dd34d81 100644 --- a/Utils/Target.cpp +++ b/Utils/Target.cpp @@ -24,10 +24,10 @@ bool Target::isValidTarget(C_Entity* ent) { if (!ent->isAlive()) return false; - if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 319 && antibot->isEntityIdCheckEnabled()) + if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 63 && antibot->isEntityIdCheckEnabled()) return false; - if (ent->getEntityTypeId() == 319) { + if (ent->getEntityTypeId() == 63) { if (teams->isColorCheckEnabled()) { std::string targetName = ent->getNameTag()->getText(); std::string localName = g_Data.getLocalPlayer()->getNameTag()->getText(); From d549557a9a705d26777b72dcdc66898de44374d6 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 20 Aug 2021 21:59:29 +0200 Subject: [PATCH 338/419] make github actions trigger on pr --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 29b6aceb..9dacfd68 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -1,6 +1,6 @@ name: MSBuild -on: [push] +on: [push, pull_request] env: # Path to the solution file relative to the root of the project. From 97086470cca84388ab0118833ed92cce72916a3f Mon Sep 17 00:00:00 2001 From: Intoprelised <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:28:32 -0400 Subject: [PATCH 339/419] Capitalize --- Horion.vcxproj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 4a4025a3..753a0944 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -257,7 +257,7 @@ - + @@ -359,9 +359,9 @@ - + - + @@ -445,7 +445,7 @@ - + @@ -547,9 +547,9 @@ - + - + @@ -655,4 +655,4 @@ - + \ No newline at end of file From 4c31bb01a0d4be07026e938b3a70d347ffd2f8a4 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 20 Aug 2021 20:07:29 -0400 Subject: [PATCH 340/419] Capitalize v2 --- .../Commands/{setoffhandCommand.cpp => SetOffhandCommand.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Horion/Command/Commands/{setoffhandCommand.cpp => SetOffhandCommand.cpp} (100%) diff --git a/Horion/Command/Commands/setoffhandCommand.cpp b/Horion/Command/Commands/SetOffhandCommand.cpp similarity index 100% rename from Horion/Command/Commands/setoffhandCommand.cpp rename to Horion/Command/Commands/SetOffhandCommand.cpp From 197fb122afeb2cc35a77f38deec98e29f51dbd00 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 20 Aug 2021 20:08:05 -0400 Subject: [PATCH 341/419] Capitalize v3 --- .../Command/Commands/{setoffhandCommand.h => Set0ffhandCommand.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Horion/Command/Commands/{setoffhandCommand.h => Set0ffhandCommand.h} (100%) diff --git a/Horion/Command/Commands/setoffhandCommand.h b/Horion/Command/Commands/Set0ffhandCommand.h similarity index 100% rename from Horion/Command/Commands/setoffhandCommand.h rename to Horion/Command/Commands/Set0ffhandCommand.h From cd06b4e3415f65ada6fec5e12e467c6bc02e09c0 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 20 Aug 2021 20:51:38 -0400 Subject: [PATCH 342/419] oop --- .../Command/Commands/{Set0ffhandCommand.h => SetOffhandCommand.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Horion/Command/Commands/{Set0ffhandCommand.h => SetOffhandCommand.h} (100%) diff --git a/Horion/Command/Commands/Set0ffhandCommand.h b/Horion/Command/Commands/SetOffhandCommand.h similarity index 100% rename from Horion/Command/Commands/Set0ffhandCommand.h rename to Horion/Command/Commands/SetOffhandCommand.h From 3192be921d052364ebebc7b9a60476603483d0fb Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 22:10:41 -0400 Subject: [PATCH 343/419] isWeapon bool added --- Horion/Module/Modules/Aimbot.cpp | 4 +++- SDK/CItem.h | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Aimbot.cpp b/Horion/Module/Modules/Aimbot.cpp index c675703e..d3bffb4b 100644 --- a/Horion/Module/Modules/Aimbot.cpp +++ b/Horion/Module/Modules/Aimbot.cpp @@ -63,7 +63,9 @@ void Aimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { appl.x = -appl.x; if ((appl.x < verticalrange && appl.x > -verticalrange) && (appl.y < horizontalrange && appl.y > -horizontalrange) && GameData::canUseMoveKeys()) { auto selectedItemId = localPlayer->getSelectedItemId(); - if (sword && !(selectedItemId == 268 || selectedItemId == 267 || selectedItemId == 272 || selectedItemId == 276 || selectedItemId == 283 /*swords*/ || selectedItemId == 271 || selectedItemId == 275 || selectedItemId == 279 || selectedItemId == 286 || selectedItemId == 258 /*axes*/)) + C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); + C_ItemStack* item = supplies->inventory->getItemStack(supplies->selectedHotbarSlot); + if (sword && !(item->getItem()->isWeapon())) return; if (click && !g_Data.isLeftClickDown()) diff --git a/SDK/CItem.h b/SDK/CItem.h index 2448d6bb..0fa41480 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -257,6 +257,21 @@ class C_Item { if (itemId == 450) return true; return false; } + bool isWeapon(void) { + if (itemId == 268) return true; //Wooden Sword + if (itemId == 272) return true; //Stone Sword + if (itemId == 283) return true; //Gold Sword + if (itemId == 267) return true; //Iron Sword + if (itemId == 276) return true; //Diamond Sword + if (itemId == 743) return true; //Netherite Sword + if (itemId == 271) return true; //Wooden Axe + if (itemId == 275) return true; //Stone Axe + if (itemId == 286) return true; //Gold Axe + if (itemId == 258) return true; //Iron Axe + if (itemId == 279) return true; //Diamond Axe + if (itemId == 746) return true; //Netherite Axe + return false; + } bool isBlock(void) { auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1A0); return val != nullptr && *val != nullptr; From c949184633327701f80a520b49ad8c6f0775bcc0 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 20 Aug 2021 22:13:07 -0400 Subject: [PATCH 344/419] Update CItem.h --- SDK/CItem.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SDK/CItem.h b/SDK/CItem.h index 0fa41480..835f3644 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -264,12 +264,12 @@ class C_Item { if (itemId == 267) return true; //Iron Sword if (itemId == 276) return true; //Diamond Sword if (itemId == 743) return true; //Netherite Sword - if (itemId == 271) return true; //Wooden Axe - if (itemId == 275) return true; //Stone Axe - if (itemId == 286) return true; //Gold Axe - if (itemId == 258) return true; //Iron Axe - if (itemId == 279) return true; //Diamond Axe - if (itemId == 746) return true; //Netherite Axe + if (itemId == 271) return true; //Wooden Axe + if (itemId == 275) return true; //Stone Axe + if (itemId == 286) return true; //Gold Axe + if (itemId == 258) return true; //Iron Axe + if (itemId == 279) return true; //Diamond Axe + if (itemId == 746) return true; //Netherite Axe return false; } bool isBlock(void) { From c77f7f3f9c00125e16d3f0ebc94d12e10f3a55de Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 21 Aug 2021 08:07:47 -0400 Subject: [PATCH 345/419] forgot 1 line --- Horion/Module/Modules/Aimbot.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Horion/Module/Modules/Aimbot.cpp b/Horion/Module/Modules/Aimbot.cpp index d3bffb4b..7d6f505e 100644 --- a/Horion/Module/Modules/Aimbot.cpp +++ b/Horion/Module/Modules/Aimbot.cpp @@ -62,7 +62,6 @@ void Aimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t appl = angle.sub(localPlayer->viewAngles).normAngles(); appl.x = -appl.x; if ((appl.x < verticalrange && appl.x > -verticalrange) && (appl.y < horizontalrange && appl.y > -horizontalrange) && GameData::canUseMoveKeys()) { - auto selectedItemId = localPlayer->getSelectedItemId(); C_PlayerInventoryProxy* supplies = g_Data.getLocalPlayer()->getSupplies(); C_ItemStack* item = supplies->inventory->getItemStack(supplies->selectedHotbarSlot); if (sword && !(item->getItem()->isWeapon())) From 63456382b41bcf51b97c8961abb790910013cd4d Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sat, 21 Aug 2021 09:39:48 -0400 Subject: [PATCH 346/419] fix cbe --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 07f066f3..2979679d 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -22,9 +22,9 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { C_ItemStack* yot = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); std::string cmd = os.str(); - std::string tag = "{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}"; - yot->setUserData(std::move(Mojangson::parseTag(tag))); - g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999)); + std::string tag = "{Count:1b,Damage:15s,Name:\"minecraft:beehive\",tag:{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}}"; + yot->fromTag(*Mojangson::parseTag(tag)); + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, yot, nullptr, 1, 507, 99999)); //g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); From 5995f38d1f45fce80c854d4cf2e53065462e78e5 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:15:29 -0400 Subject: [PATCH 347/419] capitalize v69 --- Horion/Command/Commands/SetOffhandCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/SetOffhandCommand.cpp b/Horion/Command/Commands/SetOffhandCommand.cpp index 7678e4bf..eba779eb 100644 --- a/Horion/Command/Commands/SetOffhandCommand.cpp +++ b/Horion/Command/Commands/SetOffhandCommand.cpp @@ -1,4 +1,4 @@ -#include "setoffhandCommand.h" +#include "SetOffhandCommand.h" #include "../../../SDK/Tag.h" #include "../../../Utils/Utils.h" From fc69d9b2202554a21e1d081feabfb58236aab75b Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:26:45 -0400 Subject: [PATCH 348/419] oops v3 --- Horion/Command/Commands/SetOffhandCommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/SetOffhandCommand.cpp b/Horion/Command/Commands/SetOffhandCommand.cpp index eba779eb..87a0cb84 100644 --- a/Horion/Command/Commands/SetOffhandCommand.cpp +++ b/Horion/Command/Commands/SetOffhandCommand.cpp @@ -3,14 +3,14 @@ #include "../../../SDK/Tag.h" #include "../../../Utils/Utils.h" -setoffhandCommand::setoffhandCommand() : IMCCommand("setoffhand", "Spawn items in ur offhand", " ") { +SetOffhandCommand::SetOffhandCommand() : IMCCommand("setoffhand", "Spawn items in ur offhand", " ") { registerAlias("soh"); } -setoffhandCommand::~setoffhandCommand() { +SetOffhandCommand::~SetOffhandCommand() { } -bool setoffhandCommand::execute(std::vector* args) { +bool SetOffhandCommand::execute(std::vector* args) { assertTrue(args->size() > 2); int itemId = 0; From 4dac79dfcd56ff7491693c78d6ad0a7f2758c9d5 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:27:07 -0400 Subject: [PATCH 349/419] oopppppppppppppps --- Horion/Command/Commands/SetOffhandCommand.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/SetOffhandCommand.h b/Horion/Command/Commands/SetOffhandCommand.h index a5f19ae9..c46ac804 100644 --- a/Horion/Command/Commands/SetOffhandCommand.h +++ b/Horion/Command/Commands/SetOffhandCommand.h @@ -4,10 +4,10 @@ #include "ICommand.h" -class setoffhandCommand : public IMCCommand { +class SetOffhandCommand : public IMCCommand { public: - setoffhandCommand(); - ~setoffhandCommand(); + SetOffhandCommand(); + ~SetOffhandCommand(); // Inherited via IMCCommand virtual bool execute(std::vector* args) override; From 2f48293112455b30d86badec72d62ece9148d191 Mon Sep 17 00:00:00 2001 From: Intoprelised <78622918+Intoprelised@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:42:41 -0400 Subject: [PATCH 350/419] Fix build error --- Horion/Command/CommandMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index 3778bdc4..be8f2ff9 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -31,7 +31,7 @@ void CommandMgr::initCommands() { commandList.push_back(new GiveCommand()); commandList.push_back(new BruhCommand()); commandList.push_back(new ServerCommand()); - commandList.push_back(new setoffhandCommand()); + commandList.push_back(new SetOffhandCommand()); commandList.push_back(new CoordsCommand()); commandList.push_back(new SayCommand()); commandList.push_back(new SpammerCommand()); From 5c19fdac7e34a239648afa211447a5c52217a664 Mon Sep 17 00:00:00 2001 From: Spyynz <58036893+Spyynz@users.noreply.github.com> Date: Sat, 21 Aug 2021 14:26:49 -0400 Subject: [PATCH 351/419] make readme spyynz approved --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f9a0b086..2c70e08c 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@


    -**Horion** is a minecraft bedrock edition utility mod designed to enhance a users gameplay. We do not take responsibility. +**Horion** is a Minecraft: Bedrock Edition utility mod designed to enhance gameplay. We do not take responsibility in anything done with this utility mod. If you want to contribute to this project, feel free to fork this repository and submit a pull request. -**As of 09/01/20, this project is under no active development by the horion team anymore. We will still review PRs.** +**As of 09/01/20, this project is not under active development by the Horion team anymore. We will still review pull requests.** [![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/WPe3WeNtgv) [![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://github.com/horionclient/Horion-Releases/releases/download/3.2.5/HorionInjector_Release.zip "Download the injector") @@ -14,11 +14,11 @@ If you want to contribute to this project, feel free to fork this repository and [![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) ## Contributing -To contribute, simply **fork the repository**, edit the things you want to and **submit a pull request**. +To contribute, simply **fork the repository**, edit the code, and **submit a pull request**. We will then check your pull request and accept/deny it. If you are clueless about what you could start with, [we collected some issues for you](https://github.com/horionclient/Horion/contribute). More Information on setting everything up can be found in the **[wiki](https://github.com/horionclient/Horion/wiki "wiki")**! -If you need any help with understanding our code, join the official discord server +If you need any help with understanding our code, join the [official Discord server](https://discord.gg/2ZEdqKr4zh) ## Licensing This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From 0385052d56c326e59533db56dba88f394df3ada4 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 2021 01:11:52 +0200 Subject: [PATCH 352/419] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c70e08c..19aa0d9f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you want to contribute to this project, feel free to fork this repository and **As of 09/01/20, this project is not under active development by the Horion team anymore. We will still review pull requests.** [![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/WPe3WeNtgv) -[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://github.com/horionclient/Horion-Releases/releases/download/3.2.5/HorionInjector_Release.zip "Download the injector") +[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/bin/HorionInjector.exe "Download the injector") ![Total Injections](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) [![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) @@ -18,7 +18,7 @@ To contribute, simply **fork the repository**, edit the code, and **submit a pul We will then check your pull request and accept/deny it. If you are clueless about what you could start with, [we collected some issues for you](https://github.com/horionclient/Horion/contribute). More Information on setting everything up can be found in the **[wiki](https://github.com/horionclient/Horion/wiki "wiki")**! -If you need any help with understanding our code, join the [official Discord server](https://discord.gg/2ZEdqKr4zh) +If you need any help with understanding our code, join the [official Discord server](https://discord.gg/WPe3WeNtgv) ## Licensing This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From 6702373187d03304c6b82ef6e7ed5b71ecdd8e0e Mon Sep 17 00:00:00 2001 From: thesynx <87203897+Synx173@users.noreply.github.com> Date: Sat, 21 Aug 2021 23:17:57 -0400 Subject: [PATCH 353/419] update actor,mob vtable to 1.17.11 gaming --- SDK/CEntity.h | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index f2cb48c4..6fefa4bd 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -401,7 +401,7 @@ class C_Entity { private: virtual __int64 changeDimension(__int64, bool); virtual __int64 changeDimension(__int64 const &); - virtual __int64 getControllingPlayer(void) const; // getSourceUniqueID2 + virtual __int64 getControllingPlayer(void) const; // getSourceUniqueID2 virtual __int64 checkFallDamage(float, bool); public: @@ -507,11 +507,15 @@ class C_Entity { virtual __int64 renderDebugServerState(__int64 const &); virtual __int64 reloadLootTable(void); virtual __int64 reloadLootTable(__int64 const *); - virtual __int64 getDeletionDelayTimeSeconds(void) const; + virtual __int64 getLootTable(void) const; + virtual __int64 filler_2(void) const; + virtual __int64 filler_3(void) const; virtual __int64 kill(void); virtual __int64 die(__int64 const &); virtual __int64 shouldTick(void) const; virtual __int64 createMovementProxy(void); + virtual __int64 getMovementProxy(void); + virtual __int64 getNextStep(float); virtual __int64 updateEntitySpecificMolangVariables(__int64 &); public: @@ -519,10 +523,10 @@ class C_Entity { private: virtual __int64 getNextStep(float) const; - virtual __int64 idk(); virtual __int64 outOfWorld(void); virtual __int64 _hurt(__int64 const &, int, bool, bool); virtual __int64 markHurt(void); + virtual __int64 _getAnimationComponent(std::shared_ptr<__int64> &, __int64); virtual __int64 readAdditionalSaveData(__int64 const &, __int64 &); virtual __int64 addAdditionalSaveData(__int64 &); virtual __int64 _playStepSound(vec3_ti const &, __int64 const &); @@ -538,11 +542,12 @@ class C_Entity { private: virtual __int64 spawnTrailBubbles(void); virtual __int64 updateInsideBlock(void); - virtual __int64 getLootTable(void); - virtual __int64 getDefaultLootTable(void); virtual __int64 _removeRider(__int64 const &, bool, bool); - virtual __int64 onSizeUpdated(void); + virtual __int64 _onSizeUpdated(void); virtual __int64 _doAutoAttackOnTouch(C_Entity &); + + // Mob only functions + virtual __int64 knockback(C_Entity *, int, float, float, float, float, float); virtual __int64 resolveDeathLoot(int, __int64 const &); virtual __int64 spawnAnim(void); @@ -554,6 +559,8 @@ class C_Entity { private: virtual __int64 playAmbientSound(void); virtual __int64 getAmbientSound(void); + virtual __int64 getHurtSound(void); + virtual __int64 getDeathSound(void); virtual __int64 getAmbientSoundPostponeTicks(void); virtual __int64 getAmbientSoundPostponeTicksRange(void); virtual __int64 getItemInHandIcon(__int64 const &, int); @@ -663,7 +670,9 @@ class C_Entity { virtual void unknown(void) const; virtual __int64 ascendLadder(void); virtual __int64 ascendScaffolding(void); + virtual __int64 ascendScaffolding2(void); virtual __int64 descendScaffolding(void); + virtual __int64 canAscendCurrentBlockByJumping(void); virtual __int64 dropContainer(void); virtual __int64 initBodyControl(void); @@ -681,14 +690,6 @@ class C_Entity { virtual __int64 tickDeath(void); virtual __int64 updateGliding(void); virtual __int64 _allowAscendingScaffolding(void) const; - virtual __int64 prepareRegion(__int64 &); - virtual __int64 destroyRegion(void); - virtual __int64 suspendRegion(void); - virtual void resendAllChunks(void); - virtual __int64 _fireWillChangeDimension(void); - virtual __int64 _fireDimensionChanged(void); - virtual __int64 changeDimensionWithCredits(__int64); - virtual __int64 tickWorld(__int64 const &); public: C_InventoryTransactionManager *getTransactionManager(); @@ -747,6 +748,15 @@ class C_Player : public C_Entity { } private: + virtual __int64 prepareRegion(__int64 &); + virtual __int64 destroyRegion(void); + virtual __int64 suspendRegion(void); + virtual void resendAllChunks(void); + virtual __int64 _fireWillChangeDimension(void); + virtual __int64 _fireDimensionChanged(void); + virtual __int64 changeDimensionWithCredits(__int64); + virtual __int64 tickWorld(__int64 const &); + virtual __int64 frameUpdate(__int64 &); virtual __int64 getTickingOffsets(void) const; virtual __int64 moveView(void); From 6471065d182c611023a74584e707101f53ec926b Mon Sep 17 00:00:00 2001 From: thesynx <87203897+Synx173@users.noreply.github.com> Date: Sat, 21 Aug 2021 23:35:10 -0400 Subject: [PATCH 354/419] update player table gaming --- SDK/CEntity.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 6fefa4bd..31770862 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -820,7 +820,6 @@ class C_Player : public C_Entity { virtual bool returnFalse_5() const; public: - virtual bool returnFalse_6() const; virtual bool isHostingC_Player(void) const; virtual bool isLoading(void) const; virtual bool isC_PlayerInitialized(void) const; @@ -832,6 +831,7 @@ class C_Player : public C_Entity { public: virtual void setC_PlayerGameType(int); + virtual __int64 initHUDContainerManager(void); virtual __int64 _crit(C_Entity *); private: @@ -856,7 +856,7 @@ class C_Player : public C_Entity { public: virtual void setFieldOfViewModifier(float); - virtual bool isPositionRelevant(__int64, int, vec3_ti const &); + virtual bool isPositionRelevant(__int64, int, vec3_ti const &); // is2DPositionRelevant((__int64, BlockPos&); virtual bool isEntityRelevant(C_Entity const &); virtual bool isTeacher(void) const; From 73e703bfb560281328f90e0558b2c340e6fb6393 Mon Sep 17 00:00:00 2001 From: thesynx <87203897+Synx173@users.noreply.github.com> Date: Sat, 21 Aug 2021 23:59:12 -0400 Subject: [PATCH 355/419] update stuff that i missed gaming --- Horion/Module/Modules/AutoSprint.cpp | 6 +++--- SDK/CEntity.h | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Horion/Module/Modules/AutoSprint.cpp b/Horion/Module/Modules/AutoSprint.cpp index f21aeff9..ca1d5183 100644 --- a/Horion/Module/Modules/AutoSprint.cpp +++ b/Horion/Module/Modules/AutoSprint.cpp @@ -14,7 +14,7 @@ const char* AutoSprint::getModuleName() { void AutoSprint::onTick(C_GameMode* gm) { if (!gm->player->isSprinting() && gm->player->velocity.magnitudexz() > 0.01f) { C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); - if(alldirections || GameData::isKeyDown(*input->forwardKey)) - gm->player->setSprinting(true); + if (alldirections || GameData::isKeyDown(*input->forwardKey)) + gm->player->setSprinting(true); } -} +} \ No newline at end of file diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 31770862..56803b42 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -133,9 +133,6 @@ class C_Entity { public: TextHolder uuid; //0x1F60 -public: - virtual bool hasComponent(__int64 const &) const; - private: virtual __int64 reloadHardcoded(__int64, __int64 const &); virtual __int64 reloadHardcodedClient(__int64, __int64 const &); @@ -143,6 +140,7 @@ class C_Entity { virtual __int64 reloadComponents(__int64, __int64 const &); virtual __int64 _serverInitItemStackIds(); virtual __int64 _doInitialMove(); + virtual bool hasComponent(__int64 const &) const; private: virtual void destructor(); @@ -441,6 +439,7 @@ class C_Entity { private: virtual __int64 buildDebugInfo(std::string &) const; virtual __int64 getCommandPermissionLevel(void) const; + virtual bool isClientSide(void); virtual __int64 getMutableAttribute(__int64 const &); public: @@ -515,14 +514,14 @@ class C_Entity { virtual __int64 shouldTick(void) const; virtual __int64 createMovementProxy(void); virtual __int64 getMovementProxy(void); - virtual __int64 getNextStep(float); + virtual __int64 getNextStep(float) const; virtual __int64 updateEntitySpecificMolangVariables(__int64 &); public: virtual bool shouldTryMakeStepSound(void) const; private: - virtual __int64 getNextStep(float) const; + virtual bool canMakeStepSound(void) const; virtual __int64 outOfWorld(void); virtual __int64 _hurt(__int64 const &, int, bool, bool); virtual __int64 markHurt(void); From 6e2a7ab9d193400eefb180268261b27c0df28fc9 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 2021 14:16:09 +0200 Subject: [PATCH 356/419] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 19aa0d9f..4bd1b4b8 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,8 @@ If you want to contribute to this project, feel free to fork this repository and submit a pull request. **As of 09/01/20, this project is not under active development by the Horion team anymore. We will still review pull requests.** -[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/WPe3WeNtgv) -[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/bin/HorionInjector.exe "Download the injector") -![Total Injections](https://img.shields.io/github/downloads/Horionclient/Horion-Releases/total?label=Total%20Injections&style=for-the-badge) +[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://horion.download/discord) +[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/injector "Download the injector") [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) [![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) @@ -18,7 +17,7 @@ To contribute, simply **fork the repository**, edit the code, and **submit a pul We will then check your pull request and accept/deny it. If you are clueless about what you could start with, [we collected some issues for you](https://github.com/horionclient/Horion/contribute). More Information on setting everything up can be found in the **[wiki](https://github.com/horionclient/Horion/wiki "wiki")**! -If you need any help with understanding our code, join the [official Discord server](https://discord.gg/WPe3WeNtgv) +If you need any help with understanding our code, join the [official Discord server](https://horion.download/discord) ## Licensing This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From f1c5223ea3a142750183fe11346529df4e060c9f Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 2021 16:00:23 +0200 Subject: [PATCH 357/419] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..3defdfcb --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '37 9 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 4ed9bb524eed9bd23c6d21b5dbefab1a69777da9 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:03:35 +0200 Subject: [PATCH 358/419] Improve ClickGui Color Theme --- Horion/DrawUtils.cpp | 8 +- Horion/DrawUtils.h | 8 +- Horion/Menu/ClickGui.cpp | 191 +++++++++++++++++--------------- SDK/CMinecraftUIRenderContext.h | 2 +- Utils/Utils.h | 5 + 5 files changed, 120 insertions(+), 94 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 292f2732..f2f8a2de 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -202,7 +202,7 @@ void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } -void DrawUtils::drawText(vec2_t pos, std::string* textStr, MC_Color color, float textSize, float alpha, Fonts font) { +void DrawUtils::drawText(vec2_t pos, std::string* textStr, const MC_Color& color, float textSize, float alpha, Fonts font) { TextHolder text(*textStr); C_Font* fontPtr = getFont(font); static uintptr_t caretMeasureData = 0xFFFFFFFF; @@ -552,7 +552,7 @@ void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } -void DrawUtils::fillRectangle(vec4_t pos, const MC_Color col, float alpha) { +void DrawUtils::fillRectangle(vec4_t pos, const MC_Color& col, float alpha) { DrawUtils::setColor(col.r, col.g, col.b, alpha); DrawUtils::drawQuad({pos.x, pos.w}, {pos.z, pos.w}, {pos.z, pos.y}, {pos.x, pos.y}); } @@ -632,3 +632,7 @@ void DrawUtils::drawLinestrip3d(const std::vector& points) { meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } + +MC_Color MC_Color::lerp(const MC_Color& o, float t) const { + return MC_Color(Utils::lerp(r, o.r, t), Utils::lerp(g, o.g, t), Utils::lerp(b, o.b, t), Utils::lerp(a, o.a, t)); +} diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 5f266ac2..3b787871 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -72,6 +72,8 @@ struct MC_Color { this->a = a; this->shouldDelete = shouldDelete; }; + + MC_Color lerp(const MC_Color& o, float t) const; }; enum VertexFormat { @@ -100,7 +102,7 @@ class DrawUtils { static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); static void drawBox3d(vec3_t lower, vec3_t upper); - static void fillRectangle(vec4_t pos, const MC_Color col, float alpha); + static void fillRectangle(vec4_t pos, const MC_Color& col, float alpha); static inline void fillRectangle(vec2_t start, vec2_t end) { DrawUtils::drawQuad({start.x, end.y}, {end.x, end.y}, {end.x, start.y}, {start.x, start.y}); } @@ -111,7 +113,7 @@ class DrawUtils { fillRectangle({end.x - lineWidth, start.y}, {end.x + lineWidth, end.y}); // fillRectangle({start.x - lineWidth, end.y - lineWidth}, {end.x + lineWidth, end.y + lineWidth}); } - static inline void drawRectangle(vec4_t pos, MC_Color col, float alpha, float lineWidth = 1.0f) { + static inline void drawRectangle(vec4_t pos, const MC_Color& col, float alpha, float lineWidth = 1.0f) { lineWidth /= 2; fillRectangle(vec4_t(pos.x - lineWidth, pos.y - lineWidth, pos.z + lineWidth, pos.y + lineWidth), col, alpha); // TOP fillRectangle(vec4_t(pos.x - lineWidth, pos.y, pos.x + lineWidth, pos.w), col, alpha); // LEFT @@ -120,7 +122,7 @@ class DrawUtils { } static void drawImage(std::string filePath, vec2_t& ImagePos, vec2_t& ImageDimension, vec2_t& idk); - static void drawText(vec2_t pos, std::string* text, MC_Color color, float textSize = 1, float alpha = 1, Fonts font = Fonts::SMOOTH); + static void drawText(vec2_t pos, std::string* text, const MC_Color& color, float textSize = 1, float alpha = 1, Fonts font = Fonts::SMOOTH); static void drawBox(vec3_t lower, vec3_t upper, float lineWidth, bool outline = false); static void drawEntityBox(C_Entity* ent, float lineWidth); static void draw2D(C_Entity* ent, float lineWidth); diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 80555b05..3ad4781a 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -30,18 +30,23 @@ vec2_t dragStart = vec2_t(); unsigned int focusedElement = -1; bool isFocused = false; -static constexpr float textPadding = 1.0f; +static constexpr float textPaddingX = 2.0f; +static constexpr float textPaddingY = 1.0f; static constexpr float textSize = 1.0f; static constexpr float textHeight = textSize * 10.0f; static constexpr float categoryMargin = 0.5f; static constexpr float paddingRight = 13.5f; static constexpr float crossSize = textHeight / 2.f; -static constexpr float crossWidth = 0.3f; +static constexpr float crossWidth = 0.2f; static constexpr float backgroundAlpha = 1; -static const MC_Color selectedModuleColor = MC_Color(30, 110, 200); + +static const MC_Color whiteColor = MC_Color(1.f, 1.f, 1.f, 1.f); +static const MC_Color moduleColor = MC_Color(0x12, 0x12, 0x12); // background +static const MC_Color selectedModuleColor = moduleColor.lerp(whiteColor, 0.08f); // 30, 110, 200 +static const MC_Color enabledModuleColor = moduleColor.lerp(whiteColor, 0.04f); +static const MC_Color brightModuleBlendColor = moduleColor.lerp(whiteColor, 0.2f); // tooltip border & category divider static const MC_Color selectedSettingColor1 = MC_Color(20, 100, 195); static const MC_Color selectedSettingColor2 = MC_Color(40, 120, 205); -static const MC_Color moduleColor = MC_Color(15, 30, 50); static const MC_Color SettingColor1 = MC_Color(10, 25, 45); static const MC_Color SettingColor2 = MC_Color(20, 35, 55); @@ -106,16 +111,16 @@ void ClickGui::renderTooltip(std::string* text) { vec2_t currentTooltipPos = vec2_t(5.f, windowSize.y - 15.f); float textWidth = DrawUtils::getTextWidth(text, textSize); vec2_t textPos = vec2_t( - currentTooltipPos.x + textPadding, + currentTooltipPos.x + textPaddingX, currentTooltipPos.y); vec4_t rectPos = vec4_t( currentTooltipPos.x - 2.f, currentTooltipPos.y - 2.f, - currentTooltipPos.x + (textPadding * 2) + textWidth + 2.f, + currentTooltipPos.x + (textPaddingX * 2) + textWidth + 2.f, currentTooltipPos.y + textHeight + 2.f); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.0f); - DrawUtils::drawRectangle(rectPos, MC_Color(255, 255, 255), 1.f, 0.5f); - DrawUtils::drawText(textPos, text, MC_Color(255, 255, 255), textSize); + DrawUtils::fillRectangle(rectPos, moduleColor, 1.0f); + DrawUtils::drawRectangle(rectPos, brightModuleBlendColor, 1.f, 0.5f); + DrawUtils::drawText(textPos, text, whiteColor, textSize); } void ClickGui::renderCategory(Category category) { @@ -200,11 +205,11 @@ void ClickGui::renderCategory(Category category) { } } - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); // Loop through Modules to display em if (ourWindow->isExtended || ourWindow->isInAnimation) { if (ourWindow->isInAnimation) { - currentYOffset -= ourWindow->animation * moduleList.size() * (textHeight + (textPadding * 2)); + currentYOffset -= ourWindow->animation * moduleList.size() * (textHeight + (textPaddingY * 2)); } bool overflowing = false; @@ -214,7 +219,7 @@ void ClickGui::renderCategory(Category category) { moduleIndex++; if (moduleIndex < ourWindow->yOffset) continue; - float probableYOffset = (moduleIndex - ourWindow->yOffset) * (textHeight + (textPadding * 2)); + float probableYOffset = (moduleIndex - ourWindow->yOffset) * (textHeight + (textPaddingY * 2)); if (ourWindow->isInAnimation) { // Estimate, we don't know about module settings yet if (probableYOffset > cutoffHeight) { @@ -229,13 +234,13 @@ void ClickGui::renderCategory(Category category) { std::string textStr = mod->getModuleName(); vec2_t textPos = vec2_t( - currentXOffset + textPadding, - currentYOffset + textPadding); + currentXOffset + textPaddingX, + currentYOffset + textPaddingY); vec4_t rectPos = vec4_t( currentXOffset, currentYOffset, xEnd, - currentYOffset + textHeight + (textPadding * 2)); + currentYOffset + textHeight + (textPaddingY * 2)); bool allowRender = currentYOffset >= categoryHeaderYOffset; @@ -252,13 +257,13 @@ void ClickGui::renderCategory(Category category) { shouldToggleLeftClick = false; } } else { - DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); + DrawUtils::fillRectangle(rectPos, mod->isEnabled() ? enabledModuleColor : moduleColor, backgroundAlpha); } } // Text if (allowRender) - DrawUtils::drawText(textPos, &textStr, mod->isEnabled() ? MC_Color(255, 255, 255) : MC_Color(200, 200, 200), textSize); + DrawUtils::drawText(textPos, &textStr, mod->isEnabled() ? whiteColor : MC_Color(200, 200, 200), textSize); // Settings { @@ -272,10 +277,10 @@ void ClickGui::renderCategory(Category category) { GuiUtils::drawCrossLine(vec2_t( currentXOffset + windowSize->x + paddingRight - (crossSize / 2) - 1.f, - currentYOffset + textPadding + (textHeight / 2)), - MC_Color(255, 255, 255), crossWidth, crossSize, !clickMod->isExtended); + currentYOffset + textPaddingY + (textHeight / 2)), + whiteColor, crossWidth, crossSize, !clickMod->isExtended); - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); if (clickMod->isExtended) { float startYOffset = currentYOffset; @@ -284,8 +289,8 @@ void ClickGui::renderCategory(Category category) { continue; vec2_t textPos = vec2_t( - currentXOffset + textPadding + 5, - currentYOffset + textPadding); + currentXOffset + textPaddingX + 5, + currentYOffset + textPaddingY); // Incomplete, because we dont know the endY yet vec4_t rectPos = vec4_t( @@ -301,13 +306,14 @@ void ClickGui::renderCategory(Category category) { switch (setting->valueType) { case ValueType::BOOL_T: { - rectPos.w = currentYOffset + textHeight + (textPadding * 2); + rectPos.w = currentYOffset + textHeight + (textPaddingY * 2); + // Background of bool setting DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); vec4_t selectableSurface = vec4_t( - textPos.x + textPadding, - textPos.y + textPadding, - xEnd - textPadding, - textPos.y + textHeight - textPadding); + textPos.x + textPaddingX, + textPos.y + textPaddingY, + xEnd - textPaddingX, + textPos.y + textHeight - textPaddingY); bool isFocused = selectableSurface.contains(&mousePos); // Logic @@ -319,25 +325,26 @@ void ClickGui::renderCategory(Category category) { } // Checkbox { + float boxHeight = textHeight - textPaddingY * 2; vec4_t boxPos = vec4_t( - textPos.x + textPadding, - textPos.y + textPadding, - textPos.x + textHeight - textPadding, - textPos.y + textHeight - textPadding); + textPos.x + textPaddingX, + textPos.y + textPaddingY, + textPos.x + textPaddingX + boxHeight, + textPos.y + textPaddingY + boxHeight); - DrawUtils::drawRectangle(boxPos, MC_Color(255, 255, 255), isFocused ? 1 : 0.8f, 0.5f); + DrawUtils::drawRectangle(boxPos, whiteColor, isFocused ? 1 : 0.8f, 0.5f); if (setting->value->_bool) { DrawUtils::setColor(28, 107, 201, 1); - boxPos.x += textPadding; - boxPos.y += textPadding; - boxPos.z -= textPadding; - boxPos.w -= textPadding; + boxPos.x += 1; + boxPos.y += 1; + boxPos.z -= 1; + boxPos.w -= 1; DrawUtils::drawLine(vec2_t(boxPos.x, boxPos.y), vec2_t(boxPos.z, boxPos.w), 0.5f); DrawUtils::drawLine(vec2_t(boxPos.z, boxPos.y), vec2_t(boxPos.x, boxPos.w), 0.5f); } } - textPos.x += textHeight + (textPadding * 2); + textPos.x += textHeight + (textPaddingX * 2); // Text { // Convert first letter to uppercase for more friendlieness @@ -348,8 +355,8 @@ void ClickGui::renderCategory(Category category) { std::string elTexto = name; windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 10 /* because we add 10 to text padding + checkbox*/); - DrawUtils::drawText(textPos, &elTexto, isFocused ? MC_Color(1.0f, 1.0f, 1.0f) : MC_Color(0.8f, 0.8f, 0.8f), textSize); - currentYOffset += textHeight + (textPadding * 2); + DrawUtils::drawText(textPos, &elTexto, isFocused ? whiteColor : MC_Color(0.8f, 0.8f, 0.8f), textSize); + currentYOffset += textHeight + (textPaddingY * 2); } break; } @@ -363,19 +370,26 @@ void ClickGui::renderCategory(Category category) { name[0] = toupper(name[0]); std::string elTexto = name; - rectPos.w = currentYOffset + textHeight + (textPadding * 2); + rectPos.w = currentYOffset + textHeight + (textPaddingY * 2); windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/ + crossSize); - DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); - DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); + // Background of enum setting + + if (rectPos.contains(&mousePos)) { + DrawUtils::fillRectangle(rectPos, selectedModuleColor, backgroundAlpha); + if (shouldToggleRightClick && !ourWindow->isInAnimation) { + shouldToggleRightClick = false; + setting->minValue->_bool = !setting->minValue->_bool; + } + }else + DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); + + DrawUtils::drawText(textPos, &elTexto, whiteColor, textSize); GuiUtils::drawCrossLine(vec2_t( currentXOffset + windowSize->x + paddingRight - (crossSize / 2) - 1.f, - currentYOffset + textPadding + (textHeight / 2)), - MC_Color(255, 255, 255), crossWidth, crossSize, !setting->minValue->_bool); - if (rectPos.contains(&mousePos) && shouldToggleRightClick && !ourWindow->isInAnimation) { - shouldToggleRightClick = false; - setting->minValue->_bool = !setting->minValue->_bool; - } - currentYOffset += textHeight + (textPadding * 2); + currentYOffset + textPaddingY + (textHeight / 2)), + whiteColor, crossWidth, crossSize, !setting->minValue->_bool); + + currentYOffset += textHeight + (textPaddingY * 2); } if (setting->minValue->_bool) { int e = 0; @@ -388,7 +402,7 @@ void ClickGui::renderCategory(Category category) { } bool isEven = e % 2 == 0; rectPos.y = currentYOffset; - rectPos.w = currentYOffset + textHeight + (textPadding * 2); + rectPos.w = currentYOffset + textHeight + (textPaddingY * 2); EnumEntry i = *it._Ptr; char name[0x21]; sprintf_s(name, 0x21, " %s", i.GetName().c_str()); @@ -399,7 +413,7 @@ void ClickGui::renderCategory(Category category) { windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth( &elTexto, textSize) + 5); //because we add 5 to text padding - textPos.y = currentYOffset + textPadding; + textPos.y = currentYOffset + textPaddingY; vec4_t selectableSurface = vec4_t( textPos.x, rectPos.y, @@ -417,16 +431,17 @@ void ClickGui::renderCategory(Category category) { else col = SettingColor2; } + // Background of individual enum DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); DrawUtils::fillRectangle(selectableSurface, col, backgroundAlpha); - DrawUtils::drawText(textPos, &elTexto, MC_Color(1.f, 1.f, 1.f)); + DrawUtils::drawText(textPos, &elTexto, whiteColor); // logic if (selectableSurface.contains(&mousePos) && shouldToggleLeftClick && !ourWindow->isInAnimation) { shouldToggleLeftClick = false; setting->value->_int = e; } - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); } } break; @@ -442,8 +457,8 @@ void ClickGui::renderCategory(Category category) { std::string elTexto = name; windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/); - DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); - currentYOffset += textPadding + textHeight; + DrawUtils::drawText(textPos, &elTexto, whiteColor, textSize); + currentYOffset += textPaddingY + textHeight; rectPos.w = currentYOffset; DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); } @@ -455,20 +470,20 @@ void ClickGui::renderCategory(Category category) { // Slider { vec4_t rect = vec4_t( - currentXOffset + textPadding + 5, - currentYOffset + textPadding, - xEnd - textPadding, - currentYOffset - textPadding + textHeight); + currentXOffset + textPaddingX + 5, + currentYOffset + textPaddingY, + xEnd - textPaddingX, + currentYOffset - textPaddingY + textHeight); // Visuals & Logic { rectPos.y = currentYOffset; - rectPos.w += textHeight + (textPadding * 2); + rectPos.w += textHeight + (textPaddingY * 2); // Background const bool areWeFocused = rect.contains(&mousePos); DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); // Background - DrawUtils::drawRectangle(rect, MC_Color(1.0f, 1.0f, 1.0f), 1.f, backgroundAlpha); // Slider background + DrawUtils::drawRectangle(rect, whiteColor, 1.f, backgroundAlpha); // Slider background const float minValue = setting->minValue->_float; const float maxValue = setting->maxValue->_float - minValue; @@ -476,7 +491,7 @@ void ClickGui::renderCategory(Category category) { if (value > maxValue) value = maxValue; value /= maxValue; // Value is now in range 0 - 1 - const float endXlol = (xEnd - textPadding) - (currentXOffset + textPadding + 5); + const float endXlol = (xEnd - textPaddingX) - (currentXOffset + textPaddingX + 5); value *= endXlol; // Value is now pixel diff between start of bar and end of progress // Draw Int @@ -490,7 +505,7 @@ void ClickGui::renderCategory(Category category) { std::string text = str; mid.x -= DrawUtils::getTextWidth(&text, textSize) / 2; - DrawUtils::drawText(mid, &text, MC_Color(255, 255, 255), textSize); + DrawUtils::drawText(mid, &text, whiteColor, textSize); } // Draw Progress @@ -522,7 +537,7 @@ void ClickGui::renderCategory(Category category) { setting->makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt(); } } - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); } } break; case ValueType::INT_T: { @@ -538,8 +553,8 @@ void ClickGui::renderCategory(Category category) { std::string elTexto = name; windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/); - DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); - currentYOffset += textPadding + textHeight; + DrawUtils::drawText(textPos, &elTexto, whiteColor, textSize); + currentYOffset += textPaddingY + textHeight; rectPos.w = currentYOffset; DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); } @@ -550,20 +565,20 @@ void ClickGui::renderCategory(Category category) { // Slider { vec4_t rect = vec4_t( - currentXOffset + textPadding + 5, - currentYOffset + textPadding, - xEnd - textPadding, - currentYOffset - textPadding + textHeight); + currentXOffset + textPaddingX + 5, + currentYOffset + textPaddingY, + xEnd - textPaddingX, + currentYOffset - textPaddingY + textHeight); // Visuals & Logic { rectPos.y = currentYOffset; - rectPos.w += textHeight + (textPadding * 2); + rectPos.w += textHeight + (textPaddingY * 2); // Background const bool areWeFocused = rect.contains(&mousePos); DrawUtils::fillRectangle(rectPos, moduleColor, backgroundAlpha); // Background - DrawUtils::drawRectangle(rect, MC_Color(1.0f, 1.0f, 1.0f), 1.f, backgroundAlpha); // Slider background + DrawUtils::drawRectangle(rect, whiteColor, 1.f, backgroundAlpha); // Slider background const float minValue = (float)setting->minValue->_int; const float maxValue = (float)setting->maxValue->_int - minValue; @@ -571,7 +586,7 @@ void ClickGui::renderCategory(Category category) { if (value > maxValue) value = maxValue; value /= maxValue; // Value is now in range 0 - 1 - const float endXlol = (xEnd - textPadding) - (currentXOffset + textPadding + 5); + const float endXlol = (xEnd - textPaddingX) - (currentXOffset + textPaddingX + 5); value *= endXlol; // Value is now pixel diff between start of bar and end of progress // Draw Int @@ -585,7 +600,7 @@ void ClickGui::renderCategory(Category category) { std::string text = str; mid.x -= DrawUtils::getTextWidth(&text, textSize) / 2; - DrawUtils::drawText(mid, &text, MC_Color(255, 255, 255), textSize); + DrawUtils::drawText(mid, &text, whiteColor, textSize); } // Draw Progress @@ -617,7 +632,7 @@ void ClickGui::renderCategory(Category category) { setting->makeSureTheValueIsAGoodBoiAndTheUserHasntScrewedWithIt(); } } - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); } } break; default: { @@ -627,21 +642,21 @@ void ClickGui::renderCategory(Category category) { // Adjust window size if our text is too t h i c c windowSize->x = fmax(windowSize->x, DrawUtils::getTextWidth(&elTexto, textSize) + 5 /* because we add 5 to text padding*/); - DrawUtils::drawText(textPos, &elTexto, MC_Color(1.0f, 1.0f, 1.0f), textSize); - currentYOffset += textHeight + (textPadding * 2); + DrawUtils::drawText(textPos, &elTexto, whiteColor, textSize); + currentYOffset += textHeight + (textPaddingY * 2); } break; } } float endYOffset = currentYOffset; if (endYOffset - startYOffset > textHeight + 1 || overflowing) { - startYOffset += textPadding; - endYOffset -= textPadding; + startYOffset += textPaddingY; + endYOffset -= textPaddingY; DrawUtils::setColor(1, 1, 1, 1); DrawUtils::drawLine(vec2_t(currentXOffset + 2, startYOffset), vec2_t(currentXOffset + 2, endYOffset), 0.5f); } } } else - currentYOffset += textHeight + (textPadding * 2); + currentYOffset += textHeight + (textPaddingY * 2); } } @@ -667,13 +682,13 @@ void ClickGui::renderCategory(Category category) { // Draw Category Header { vec2_t textPos = vec2_t( - currentXOffset + textPadding, - categoryHeaderYOffset + textPadding); + currentXOffset + textPaddingX, + categoryHeaderYOffset + textPaddingY); vec4_t rectPos = vec4_t( currentXOffset - categoryMargin, categoryHeaderYOffset - categoryMargin, currentXOffset + windowSize->x + paddingRight + categoryMargin, - categoryHeaderYOffset + textHeight + (textPadding * 2)); + categoryHeaderYOffset + textHeight + (textPaddingY * 2)); // Extend Logic { @@ -711,19 +726,19 @@ void ClickGui::renderCategory(Category category) { } } - // Draw component + // Draw category component { // Draw Text std::string textStr = categoryName; - DrawUtils::drawText(textPos, &textStr, MC_Color(255, 255, 255), textSize); + DrawUtils::drawText(textPos, &textStr, whiteColor, textSize); DrawUtils::fillRectangle(rectPos, moduleColor, 1.f); - DrawUtils::fillRectangle(vec4_t(rectPos.x, rectPos.w - 1, rectPos.z, rectPos.w), selectedModuleColor, 1 - ourWindow->animation); + DrawUtils::fillRectangle(vec4_t(rectPos.x, rectPos.w - 1, rectPos.z, rectPos.w), brightModuleBlendColor, 1 - ourWindow->animation); // Draw Dash GuiUtils::drawCrossLine(vec2_t( currentXOffset + windowSize->x + paddingRight - (crossSize / 2) - 1.f, - categoryHeaderYOffset + textPadding + (textHeight / 2)), - MC_Color(255, 255, 255), crossWidth, crossSize, !ourWindow->isExtended); + categoryHeaderYOffset + textPaddingY + (textHeight / 2)), + whiteColor, crossWidth, crossSize, !ourWindow->isExtended); } } diff --git a/SDK/CMinecraftUIRenderContext.h b/SDK/CMinecraftUIRenderContext.h index b67b94eb..b3ba0d28 100644 --- a/SDK/CMinecraftUIRenderContext.h +++ b/SDK/CMinecraftUIRenderContext.h @@ -57,7 +57,7 @@ class C_MinecraftUIRenderContext { virtual float getTextAlpha(); virtual void setTextAlpha(float alpha); virtual __int64 drawDebugText(const float* pos, TextHolder* text, float* color, float alpha, unsigned int textAlignment, const float* textMeasureData, const void* caretMeasureData); - virtual __int64 drawText(C_Font* font, const float* pos, TextHolder* text, float* color, float alpha, unsigned int textAlignment, const TextMeasureData* textMeasureData, const uintptr_t* caretMeasureData); + virtual __int64 drawText(C_Font* font, const float* pos, TextHolder* text, const float* color, float alpha, unsigned int textAlignment, const TextMeasureData* textMeasureData, const uintptr_t* caretMeasureData); virtual void flushText(float timeSinceLastFlush); // time used for ticking the obfuscated text virtual __int64 drawImage(C_TexturePtr* texturePtr, vec2_t& ImagePos, vec2_t& ImageDimension,__int64& a4,vec2_t& idk); // didnt bother putting in the parameters virtual __int64 drawNinesliceNOTIMPLEMENTED(); diff --git a/Utils/Utils.h b/Utils/Utils.h index 6af165bf..926850ba 100644 --- a/Utils/Utils.h +++ b/Utils/Utils.h @@ -229,6 +229,11 @@ static inline void ImSwap(T& a, T& b) { class Utils { public: + template + static inline auto lerp(type a, type b, float t) -> type { + return a + t * (b - a); + }; + static inline unsigned int getCrcHash(const char* str, int seed = 0) { static unsigned int crc32_lut[256] = {0}; if (!crc32_lut[1]) { From 87f5ee043806ddfb5ea7693f4dea2d21238467ad Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:17:02 +0200 Subject: [PATCH 359/419] Improve render performance by using pass-by-reference --- Horion/DrawUtils.cpp | 54 ++++++++++++++++---------------------------- Horion/DrawUtils.h | 24 ++++++++++---------- 2 files changed, 32 insertions(+), 46 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index f2f8a2de..a69728f1 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -155,7 +155,7 @@ void DrawUtils::flush() { renderCtx->flushText(0); } -void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { +void DrawUtils::drawTriangle(const vec2_t& p1, const vec2_t& p2, const vec2_t& p3) { DrawUtils::tess__begin(tesselator, 3, 3); @@ -167,7 +167,7 @@ void DrawUtils::drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3) { } -void DrawUtils::drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4) { +void DrawUtils::drawQuad(const vec2_t& p1, const vec2_t& p2, const vec2_t& p3, const vec2_t& p4) { DrawUtils::tess__begin(tesselator, 1, 4); tess_vertex(tesselator, p1.x, p1.y, 0); @@ -178,7 +178,7 @@ void DrawUtils::drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4) { meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } -void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { +void DrawUtils::drawLine(const vec2_t& start, const vec2_t& end, float lineWidth) { float modX = 0 - (start.y - end.y); float modY = start.x - end.x; @@ -202,17 +202,16 @@ void DrawUtils::drawLine(vec2_t start, vec2_t end, float lineWidth) { meshHelper_renderImm(screenContext2d, tesselator, uiMaterial); } -void DrawUtils::drawText(vec2_t pos, std::string* textStr, const MC_Color& color, float textSize, float alpha, Fonts font) { +void DrawUtils::drawText(const vec2_t& pos, std::string* textStr, const MC_Color& color, float textSize, float alpha, Fonts font) { TextHolder text(*textStr); C_Font* fontPtr = getFont(font); static uintptr_t caretMeasureData = 0xFFFFFFFF; - pos.y -= 1; float posF[4]; // vec4_t(startX, startY, endX, endY); posF[0] = pos.x; posF[1] = pos.x + 1000; - posF[2] = pos.y; + posF[2] = pos.y - 1; posF[3] = pos.y + 1000; TextMeasureData textMeasure{}; @@ -222,7 +221,7 @@ void DrawUtils::drawText(vec2_t pos, std::string* textStr, const MC_Color& color renderCtx->drawText(fontPtr, posF, &text, color.arr, alpha, 0, &textMeasure, &caretMeasureData); } -void DrawUtils::drawBox(vec3_t lower, vec3_t upper, float lineWidth, bool outline) { +void DrawUtils::drawBox(const vec3_t& lower, const vec3_t& upper, float lineWidth, bool outline) { vec3_t diff; diff.x = upper.x - lower.x; @@ -455,7 +454,7 @@ void DrawUtils::draw2D(C_Entity* ent, float lineWidth) { } } -void DrawUtils::drawItem(C_ItemStack* item, vec2_t itemPos, float opacity, float scale, bool isEnchanted) { +void DrawUtils::drawItem(C_ItemStack* item, const vec2_t& itemPos, float opacity, float scale, bool isEnchanted) { __int64 scnCtx = reinterpret_cast<__int64*>(renderCtx)[2]; auto* screenCtx = reinterpret_cast(scnCtx); C_BaseActorRenderContext baseActorRenderCtx(screenCtx, g_Data.getClientInstance(), g_Data.getClientInstance()->minecraftGame); @@ -464,7 +463,7 @@ void DrawUtils::drawItem(C_ItemStack* item, vec2_t itemPos, float opacity, float } -void DrawUtils::drawKeystroke(char key, vec2_t pos) { +void DrawUtils::drawKeystroke(char key, const vec2_t& pos) { std::string keyString = Utils::getKeybindName(key); C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); if (key == *input->spaceBarKey) keyString = "-"; @@ -501,7 +500,7 @@ void DrawUtils::drawLine3d(const vec3_t& start, const vec3_t& end) { meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } -void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { +void DrawUtils::drawBox3d(const vec3_t& lower, const vec3_t& upper) { if (game3dContext == 0 || entityFlatStaticMaterial == 0) return; @@ -514,18 +513,18 @@ void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { diff.y = upper.y - lower.y; diff.z = upper.z - lower.z; - lower = lower.sub(origin); + auto newLower = lower.sub(origin); vec3_t vertices[8]; - vertices[0] = vec3_t(lower.x, lower.y, lower.z); - vertices[1] = vec3_t(lower.x + diff.x, lower.y, lower.z); - vertices[2] = vec3_t(lower.x, lower.y, lower.z + diff.z); - vertices[3] = vec3_t(lower.x + diff.x, lower.y, lower.z + diff.z); + vertices[0] = vec3_t(newLower.x, newLower.y, newLower.z); + vertices[1] = vec3_t(newLower.x + diff.x, newLower.y, newLower.z); + vertices[2] = vec3_t(newLower.x, newLower.y, newLower.z + diff.z); + vertices[3] = vec3_t(newLower.x + diff.x, newLower.y, newLower.z + diff.z); - vertices[4] = vec3_t(lower.x, lower.y + diff.y, lower.z); - vertices[5] = vec3_t(lower.x + diff.x, lower.y + diff.y, lower.z); - vertices[6] = vec3_t(lower.x, lower.y + diff.y, lower.z + diff.z); - vertices[7] = vec3_t(lower.x + diff.x, lower.y + diff.y, lower.z + diff.z); + vertices[4] = vec3_t(newLower.x, newLower.y + diff.y, newLower.z); + vertices[5] = vec3_t(newLower.x + diff.x, newLower.y + diff.y, newLower.z); + vertices[6] = vec3_t(newLower.x, newLower.y + diff.y, newLower.z + diff.z); + vertices[7] = vec3_t(newLower.x + diff.x, newLower.y + diff.y, newLower.z + diff.z); #define line(m, n) tess_vertex(myTess, m.x, m.y, m.z); \ tess_vertex(myTess, n.x, n.y, n.z); @@ -552,29 +551,16 @@ void DrawUtils::drawBox3d(vec3_t lower, vec3_t upper) { meshHelper_renderImm(game3dContext, myTess, entityFlatStaticMaterial); } -void DrawUtils::fillRectangle(vec4_t pos, const MC_Color& col, float alpha) { +void DrawUtils::fillRectangle(const vec4_t& pos, const MC_Color& col, float alpha) { DrawUtils::setColor(col.r, col.g, col.b, alpha); DrawUtils::drawQuad({pos.x, pos.w}, {pos.z, pos.w}, {pos.z, pos.y}, {pos.x, pos.y}); } -void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVerticesReserved) { +inline void DrawUtils::tess__begin(Tessellator* tess, int vertexFormat, int numVerticesReserved) { __int64 tesselator = reinterpret_cast<__int64>(tess); using tess_begin_t = void(__fastcall*)(Tessellator*, int, int); static tess_begin_t tess_begin = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 48 83 EC ?? 80 B9 ?? ?? ?? ?? 00 45")); tess_begin(tess, vertexFormat, numVerticesReserved); - /*if (!*(unsigned char*)(tesselator + 0x1FC) && !*(unsigned char*)(tesselator + 0x1B5)) { - mce__VertexFormat__disableHalfFloats(tesselator, 0, 0); - *(unsigned char*)(tesselator + 8) = vertexFormat; - *(unsigned char*)(tesselator + 0x1B4) = 0; - *(unsigned char*)(tesselator + 0x1FC) = 1; - *(unsigned char*)(tesselator + 0x1FD) = 0; - *(unsigned int*)(tesselator + 0x16C) = 0; - *(__int64*)(tesselator + 0x150) = *(__int64*)(tesselator + 0x148); - if (!*(unsigned char*)tesselator) - *(unsigned char*)(tesselator + 0xC8) = 1; - if (numVerticesReserved != 0) - Tessellator__initializeFormat(tesselator + 8, numVerticesReserved); - }*/ } void DrawUtils::setGameRenderContext(__int64 ctx) { game3dContext = ctx; diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 3b787871..5389e44a 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -96,24 +96,24 @@ class DrawUtils { static float getTextWidth(std::string* textStr, float textSize = 1, Fonts font = Fonts::SMOOTH); static float getFontHeight(float textSize = 1, Fonts font = Fonts::SMOOTH); - static void drawTriangle(vec2_t p1, vec2_t p2, vec2_t p3); - static void drawQuad(vec2_t p1, vec2_t p2, vec2_t p3, vec2_t p4); - static void drawLine(vec2_t start, vec2_t end, float lineWidth); // rgba + static void drawTriangle(const vec2_t& p1, const vec2_t& p2, const vec2_t& p3); + static void drawQuad(const vec2_t& p1, const vec2_t& p2, const vec2_t& p3, const vec2_t& p4); + static void drawLine(const vec2_t& start, const vec2_t& end, float lineWidth); // rgba static void drawLinestrip3d(const std::vector& points); static void drawLine3d(const vec3_t& start, const vec3_t& end); - static void drawBox3d(vec3_t lower, vec3_t upper); - static void fillRectangle(vec4_t pos, const MC_Color& col, float alpha); - static inline void fillRectangle(vec2_t start, vec2_t end) { + static void drawBox3d(const vec3_t& lower, const vec3_t& upper); + static void fillRectangle(const vec4_t& pos, const MC_Color& col, float alpha); + static inline void fillRectangle(const vec2_t& start, const vec2_t& end) { DrawUtils::drawQuad({start.x, end.y}, {end.x, end.y}, {end.x, start.y}, {start.x, start.y}); } - static inline void drawRectangle(vec2_t start, vec2_t end, float lineWidth = 1.0f) { + static inline void drawRectangle(const vec2_t& start, const vec2_t& end, float lineWidth = 1.0f) { lineWidth /= 2; fillRectangle({start.x - lineWidth, start.y - lineWidth}, {end.x + lineWidth, start.y + lineWidth}); // TOP fillRectangle({start.x - lineWidth, start.y}, {start.x + lineWidth, end.y}); // LEFT fillRectangle({end.x - lineWidth, start.y}, {end.x + lineWidth, end.y}); // fillRectangle({start.x - lineWidth, end.y - lineWidth}, {end.x + lineWidth, end.y + lineWidth}); } - static inline void drawRectangle(vec4_t pos, const MC_Color& col, float alpha, float lineWidth = 1.0f) { + static inline void drawRectangle(const vec4_t& pos, const MC_Color& col, float alpha, float lineWidth = 1.0f) { lineWidth /= 2; fillRectangle(vec4_t(pos.x - lineWidth, pos.y - lineWidth, pos.z + lineWidth, pos.y + lineWidth), col, alpha); // TOP fillRectangle(vec4_t(pos.x - lineWidth, pos.y, pos.x + lineWidth, pos.w), col, alpha); // LEFT @@ -122,13 +122,13 @@ class DrawUtils { } static void drawImage(std::string filePath, vec2_t& ImagePos, vec2_t& ImageDimension, vec2_t& idk); - static void drawText(vec2_t pos, std::string* text, const MC_Color& color, float textSize = 1, float alpha = 1, Fonts font = Fonts::SMOOTH); - static void drawBox(vec3_t lower, vec3_t upper, float lineWidth, bool outline = false); + static void drawText(const vec2_t& pos, std::string* text, const MC_Color& color, float textSize = 1, float alpha = 1, Fonts font = Fonts::SMOOTH); + static void drawBox(const vec3_t& lower, const vec3_t& upper, float lineWidth, bool outline = false); static void drawEntityBox(C_Entity* ent, float lineWidth); static void draw2D(C_Entity* ent, float lineWidth); static void drawNameTags(C_Entity* ent, float textSize, bool drawHealth = false, bool useUnicodeFont = false); - static void drawItem(C_ItemStack* item, vec2_t ItemPos, float opacity, float scale, bool isEnchanted); - static void drawKeystroke(char key, vec2_t pos); + static void drawItem(C_ItemStack* item, const vec2_t& ItemPos, float opacity, float scale, bool isEnchanted); + static void drawKeystroke(char key, const vec2_t& pos); static float getLerpTime(); static vec3_t getOrigin(); From 6d9d4d7e1c707bd62733f7c0887cc2603d2f63d9 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:25:08 +0200 Subject: [PATCH 360/419] Fix gui being rendered multiple times --- Memory/Hooks.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2f66e045..28f118a7 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -373,8 +373,8 @@ void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* t __int64 Hooks::UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext) { static auto oSetup = g_Hooks.UIScene_setupAndRenderHook->GetFastcall<__int64, C_UIScene*, __int64>(); - - g_Hooks.shouldRender = uiscene->isPlayScreen(); + g_Hooks.shouldRender = false; + //g_Hooks.shouldRender = uiscene->isPlayScreen(); return oSetup(uiscene, screencontext); } @@ -382,9 +382,8 @@ __int64 Hooks::UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext) __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { static auto oRender = g_Hooks.UIScene_renderHook->GetFastcall<__int64, C_UIScene*, __int64>(); - g_Hooks.shouldRender = uiscene->isPlayScreen(); - - bool alwaysRender = moduleMgr->isInitialized() && moduleMgr->getModule()->alwaysShow; + //g_Hooks.shouldRender = uiscene->isPlayScreen(); + g_Hooks.shouldRender = false; TextHolder alloc{}; uiscene->getScreenName(&alloc); @@ -392,9 +391,9 @@ __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { if (alloc.getTextLength() < 100) { strcpy_s(g_Hooks.currentScreenName, alloc.getText()); } - + if (!g_Hooks.shouldRender) { - g_Hooks.shouldRender = alwaysRender || (strcmp(alloc.getText(), "start_screen") == 0 || (alloc.getTextLength() >= 11 && strncmp(alloc.getText(), "play_screen", 11)) == 0); + g_Hooks.shouldRender = (strcmp(alloc.getText(), "start_screen") == 0 || strcmp(alloc.getText(), "hud_screen") == 0); } alloc.alignedTextLength = 0; From a92745322351830ac5ac23aff4ead5ba339fd724 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:25:48 +0200 Subject: [PATCH 361/419] Cleanup --- Memory/Hooks.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 28f118a7..1e509310 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -374,15 +374,13 @@ void Hooks::ClientInstanceScreenModel_sendChatMessage(void* _this, TextHolder* t __int64 Hooks::UIScene_setupAndRender(C_UIScene* uiscene, __int64 screencontext) { static auto oSetup = g_Hooks.UIScene_setupAndRenderHook->GetFastcall<__int64, C_UIScene*, __int64>(); g_Hooks.shouldRender = false; - //g_Hooks.shouldRender = uiscene->isPlayScreen(); - + return oSetup(uiscene, screencontext); } __int64 Hooks::UIScene_render(C_UIScene* uiscene, __int64 screencontext) { static auto oRender = g_Hooks.UIScene_renderHook->GetFastcall<__int64, C_UIScene*, __int64>(); - //g_Hooks.shouldRender = uiscene->isPlayScreen(); g_Hooks.shouldRender = false; TextHolder alloc{}; From f10b30604041dce42458e253a5fc173914b4a0d5 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:32:17 +0200 Subject: [PATCH 362/419] Check for duplicate entites between lists Dramatically improves performance of ESP --- Memory/GameData.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index c7558d4d..a93b26b3 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -163,12 +163,16 @@ void GameData::forEachEntity(std::function callback) { uintptr_t stop = ((uintptr_t)entityList + 0x78); start = *(uintptr_t*)start; stop = *(uintptr_t*)stop; - //logF("size: %i", (stop - start) / sizeof(uintptr_t*)); + std::set knownEnts; + while (start < stop) { C_Entity* ent = *(C_Entity**)start; - if (ent != nullptr) + if (ent != nullptr && knownEnts.count(ent) == 0) { callback(ent, false); + knownEnts.insert(ent); + } + start += 8; } @@ -179,10 +183,11 @@ void GameData::forEachEntity(std::function callback) { __int64* entityIdMap = *(__int64**)(*(__int64*)(region + 0x20) + 0x138i64); for (__int64* i = (__int64*)*entityIdMap; i != entityIdMap; i = (__int64*)*i) { __int64 actor = i[3]; + C_Entity* ent = reinterpret_cast(actor); // !isRemoved() && !isGlobal() - if (actor && !*(char*)(actor + 993) && !*(char*)(actor + 994)) { - C_Entity* ent = reinterpret_cast(actor); + if (actor && !*(char*)(actor + 993) && !*(char*)(actor + 994) && knownEnts.count(ent) == 0) { callback(ent, false); + knownEnts.insert(ent); } } } From 9556bdb8cee4e6b5f195571794d071dc902a6050 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 2021 22:36:25 +0200 Subject: [PATCH 363/419] Delete codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 71 --------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3defdfcb..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '37 9 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 From 21e76c126e04f1ce5995b7c79a5ce8758294b29a Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 2021 22:36:42 +0200 Subject: [PATCH 364/419] Update msbuild.yml --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 9dacfd68..9ca14033 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -1,6 +1,6 @@ name: MSBuild -on: [push, pull_request] +on: [pull_request] env: # Path to the solution file relative to the root of the project. From 226e6bd616df7269ae4db7bb20f6c558daca194f Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 22:49:43 +0200 Subject: [PATCH 365/419] Improve Performance of Target::isValidTarget --- Horion/FriendList/FriendList.cpp | 12 +++----- Horion/FriendList/FriendList.h | 10 +++++-- Horion/Module/Modules/AntiBot.h | 12 ++++---- Horion/Module/Modules/ESP.cpp | 48 +++++++++++++++++--------------- Memory/GameData.h | 11 +------- Utils/Target.cpp | 39 +++++++++++++++----------- 6 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Horion/FriendList/FriendList.cpp b/Horion/FriendList/FriendList.cpp index 2fde8216..3ea32890 100644 --- a/Horion/FriendList/FriendList.cpp +++ b/Horion/FriendList/FriendList.cpp @@ -8,19 +8,16 @@ FriendList::FriendList() { FriendList::~FriendList() { } -void FriendList::addPlayerToList(std::string Name) { - g_friend.List.push_back(Name); +void FriendList::addPlayerToList(const std::string& name) { + g_friend.List.push_back(name); } std::vector FriendList::getList() { return g_friend.List; } -bool FriendList::findPlayer(std::string name) { - //std::transform(name.begin(), name.end(), name.begin(), ::tolower); +bool FriendList::findPlayer(const std::string& name) { for (std::vector::iterator it = g_friend.List.begin(); it != g_friend.List.end(); ++it) { - //std::string copy = *it; - //std::transform(copy.begin(), copy.end(), copy.begin(), ::tolower); if (it->find(name) != std::string::npos) { return true; } @@ -28,12 +25,11 @@ bool FriendList::findPlayer(std::string name) { return false; } -bool FriendList::removePlayer(std::string& g) { +bool FriendList::removePlayer(const std::string& g) { for (std::vector::iterator it = g_friend.List.begin(); it != g_friend.List.end(); ++it) { std::string copy = *it; std::transform(copy.begin(), copy.end(), copy.begin(), ::tolower); if (copy.find(g) != std::string::npos) { - g = *it; g_friend.List.erase(it); return true; } diff --git a/Horion/FriendList/FriendList.h b/Horion/FriendList/FriendList.h index fa4a4b91..8d7710ff 100644 --- a/Horion/FriendList/FriendList.h +++ b/Horion/FriendList/FriendList.h @@ -17,9 +17,13 @@ class FriendList { ~FriendList(); static std::vector getList(); - static bool findPlayer(std::string Name); - static void addPlayerToList(std::string name); - static bool removePlayer(std::string& g); + static bool findPlayer(const std::string& name); + static bool findPlayer(const char* name) { + std::string local(name); + return findPlayer(local); + } + static void addPlayerToList(const std::string& name); + static bool removePlayer(const std::string& g); }; extern FriendList g_friend; diff --git a/Horion/Module/Modules/AntiBot.h b/Horion/Module/Modules/AntiBot.h index 53f99a8d..ec4c4eca 100644 --- a/Horion/Module/Modules/AntiBot.h +++ b/Horion/Module/Modules/AntiBot.h @@ -13,22 +13,22 @@ class AntiBot : public IModule { AntiBot(); ~AntiBot(); - bool isHitboxCheckEnabled() { + inline bool isHitboxCheckEnabled() { return hitboxCheck && this->isEnabled(); } - bool isNameCheckEnabled() { + inline bool isNameCheckEnabled() { return false && this->isEnabled(); } - bool isInvisibleCheckEnabled() { + inline bool isInvisibleCheckEnabled() { return invisibleCheck && this->isEnabled(); } - bool isEntityIdCheckEnabled() { + inline bool isEntityIdCheckEnabled() { return entityIdCheck && this->isEnabled(); } - bool isOtherCheckEnabled() { + inline bool isOtherCheckEnabled() { return otherCheck && this->isEnabled(); } - bool isExtraCheckEnabled() { + inline bool isExtraCheckEnabled() { return this->extraCheck && this->isEnabled(); } diff --git a/Horion/Module/Modules/ESP.cpp b/Horion/Module/Modules/ESP.cpp index a621a7f9..256f4257 100644 --- a/Horion/Module/Modules/ESP.cpp +++ b/Horion/Module/Modules/ESP.cpp @@ -21,33 +21,35 @@ void doRenderStuff(C_Entity* ent, bool isRegularEntitie) { static auto espMod = moduleMgr->getModule(); C_LocalPlayer* localPlayer = g_Data.getLocalPlayer(); - if (ent != localPlayer) { - if (ent->timeSinceDeath > 0) + if (ent == localPlayer) + return; + if (ent->timeSinceDeath > 0) + return; + static auto noFriendsModule = moduleMgr->getModule(); + if (!noFriendsModule->isEnabled() && FriendList::findPlayer(ent->getNameTag()->getText())) { + DrawUtils::setColor(0.1f, 0.9f, 0.1f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + } else if (Target::isValidTarget(ent)) { + if (espMod->doRainbow) + DrawUtils::setColor(rcolors[0], rcolors[1], rcolors[2], (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + else + DrawUtils::setColor(0.9f, 0.9f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + } else if (espMod->isMobEsp) { + if (ent->getNameTag()->getTextLength() <= 1 && ent->getEntityTypeId() == 63) return; - if (FriendList::findPlayer(ent->getNameTag()->getText()) && !moduleMgr->getModule()->isEnabled()) { - DrawUtils::setColor(0.1f, 0.9f, 0.1f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); - } else if (Target::isValidTarget(ent)) { - if (espMod->doRainbow) - DrawUtils::setColor(rcolors[0], rcolors[1], rcolors[2], (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); - else - DrawUtils::setColor(0.9f, 0.9f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); - } else if (espMod->isMobEsp) { - if (ent->getNameTag()->getTextLength() <= 1 && ent->getEntityTypeId() == 63) - return; - if (ent->isInvisible()) - return; + if (ent->isInvisible()) + return; - if (!g_Data.getLocalPlayer()->canAttack(ent, false)) - return; - DrawUtils::setColor(0.2f, 0.2f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); - } else + if (!localPlayer->canAttack(ent, false)) return; - if (espMod->is2d) - DrawUtils::draw2D(ent, (float)fmax(0.4f, 1 / (float)fmax(1, (*localPlayer->getPos()).dist(*ent->getPos()) * 3.f))); - else - DrawUtils::drawEntityBox(ent, (float)fmax(0.2f, 1 / (float)fmax(1, (*localPlayer->getPos()).dist(*ent->getPos())))); - } + DrawUtils::setColor(0.2f, 0.2f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + } else + return; + if (espMod->is2d) + DrawUtils::draw2D(ent, (float)fmax(0.4f, 1 / (float)fmax(1, localPlayer->getPos()->dist(*ent->getPos()) * 3.f))); + else + DrawUtils::drawEntityBox(ent, (float)fmax(0.2f, 1 / (float)fmax(1, localPlayer->getPos()->dist(*ent->getPos())))); + } diff --git a/Memory/GameData.h b/Memory/GameData.h index af49d2e3..c8556f45 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -210,18 +210,9 @@ class GameData { inline C_ClientInstance* getClientInstance() { return clientInstance; }; inline C_GuiData* getGuiData() { return clientInstance->getGuiData(); }; inline C_LocalPlayer* getLocalPlayer() { - /*#ifdef _BETA - unsigned int converted = networkedData.localPlayerOffset ^ networkedData.xorKey; - if (networkedData.localPlayerOffset < 0x110 || converted < 0x125 || converted > 0x191 || networkedData.dataSet == false) - localPlayer = nullptr; - else - localPlayer = *reinterpret_cast(reinterpret_cast<__int64>(clientInstance) + converted); - #else*/ localPlayer = clientInstance->localPlayer; - - //#endif - + if (localPlayer == nullptr) gameMode = nullptr; return localPlayer; diff --git a/Utils/Target.cpp b/Utils/Target.cpp index 4dd34d81..cf1a8ba8 100644 --- a/Utils/Target.cpp +++ b/Utils/Target.cpp @@ -11,56 +11,61 @@ void Target::init(C_LocalPlayer** cl) { } bool Target::isValidTarget(C_Entity* ent) { - if (ent == NULL) + if (ent == nullptr) return false; - if (ent == g_Data.getLocalPlayer()) + auto localPlayer = g_Data.getLocalPlayer(); + + if (ent == localPlayer) return false; static auto antibot = moduleMgr->getModule(); static auto hitboxMod = moduleMgr->getModule(); static auto teams = moduleMgr->getModule(); + static auto noFriends = moduleMgr->getModule(); if (!ent->isAlive()) return false; - if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 63 && antibot->isEntityIdCheckEnabled()) + auto entityTypeId = ent->getEntityTypeId(); + + if (antibot->isEntityIdCheckEnabled() && entityTypeId <= 122 && entityTypeId != 63) return false; - if (ent->getEntityTypeId() == 63) { + if (entityTypeId == 63) { if (teams->isColorCheckEnabled()) { - std::string targetName = ent->getNameTag()->getText(); - std::string localName = g_Data.getLocalPlayer()->getNameTag()->getText(); - if (targetName.length() > 2 && localName.length() > 2) { - targetName = std::regex_replace(targetName, std::regex("\\§r"), ""); - localName = std::regex_replace(localName, std::regex("\\§r"), ""); - if (targetName.at(0) == localName.at(0)) return false; + auto targetName = ent->getNameTag(); + auto localName = localPlayer->getNameTag(); + if (targetName->getTextLength() > 2 && localName->getTextLength() > 2) { + auto colorTargetName = std::regex_replace(targetName->getText(), std::regex("\\§r"), ""); + auto colorLocalName = std::regex_replace(localName->getText(), std::regex("\\§r"), ""); + if (colorTargetName.at(0) == colorLocalName.at(0)) + return false; } } if (teams->isAlliedCheckEnabled()) { - C_LocalPlayer* p = g_Data.getLocalPlayer(); - if (p->isAlliedTo(ent)) return false; + if (localPlayer->isAlliedTo(ent)) return false; } } // Temporarily removed from gui, tons of false negatives - if (!Target::containsOnlyASCII(ent->getNameTag()->getText()) && antibot->isNameCheckEnabled()) + if (antibot->isNameCheckEnabled() && !Target::containsOnlyASCII(ent->getNameTag()->getText())) return false; - if (FriendList::findPlayer(ent->getNameTag()->getText()) && !moduleMgr->getModule()->isEnabled()) + if (!noFriends->isEnabled() && FriendList::findPlayer(ent->getNameTag()->getText())) return false; - if (ent->isInvisible() && antibot->isInvisibleCheckEnabled()) + if (antibot->isInvisibleCheckEnabled() && ent->isInvisible() ) return false; - if ((ent->isSilent() || ent->isImmobile() || ent->getNameTag()->getTextLength() < 1 || std::string(ent->getNameTag()->getText()).find(std::string("\n")) != std::string::npos) && antibot->isOtherCheckEnabled()) + if (antibot->isOtherCheckEnabled() && (ent->isSilent() || ent->isImmobile() || ent->getNameTag()->getTextLength() < 1 || std::string(ent->getNameTag()->getText()).find(std::string("\n")) != std::string::npos)) return false; if (!hitboxMod->isEnabled() && antibot->isHitboxCheckEnabled()) if ((ent->height < 1.5f || ent->width < 0.49f || ent->height > 2.1f || ent->width > 0.9f)) return false; - if (!(*localPlayer)->canAttack(ent, false)) + if (!localPlayer->canAttack(ent, false)) return false; if (antibot->isExtraCheckEnabled() && !ent->canShowNameTag()) From cb636b579c27388c59c44705549263a4f9407573 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 23:45:05 +0200 Subject: [PATCH 366/419] Significantly improve performance near Endzone spawn --- Horion/DrawUtils.cpp | 1 - Horion/Module/Modules/ChestESP.cpp | 21 ++++++++------------- Horion/Module/Modules/ChestESP.h | 2 +- Horion/Module/Modules/NameTags.h | 1 + Horion/path/JoePathFinder.cpp | 1 + Memory/GameData.cpp | 14 ++++++++------ Memory/GameData.h | 10 +++++++--- Memory/Hooks.cpp | 15 ++++++++------- Utils/HMath.h | 26 +++++++++++++------------- Utils/Utils.cpp | 4 ++++ Utils/Utils.h | 10 ++++++++++ 11 files changed, 61 insertions(+), 44 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index a69728f1..487b0088 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -228,7 +228,6 @@ void DrawUtils::drawBox(const vec3_t& lower, const vec3_t& upper, float lineWidt diff.y = upper.y - lower.y; diff.z = upper.z - lower.z; - vec3_t vertices[8]; vertices[0] = vec3_t(lower.x, lower.y, lower.z); vertices[1] = vec3_t(lower.x + diff.x, lower.y, lower.z); diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/ChestESP.cpp index 12a87dc7..7f8c4575 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/ChestESP.cpp @@ -17,41 +17,36 @@ void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { auto ourListLock = std::scoped_lock(this->listLock); - for (auto iter = bufferedChestList.begin(); iter != bufferedChestList.end(); ++iter) { - auto storageID = g_Data.getLocalPlayer()->region->getBlock((*iter)->upper)->blockLegacy->blockId; + for (const auto& chest : bufferedChestList) { + auto storageID = g_Data.getLocalPlayer()->region->getBlock(chest.upper)->blockLegacy->blockId; float math = (float)fmax(0.3f, (float)fmin(1.f, 15)); DrawUtils::setColor(1.f, 1.f, 1.f, math); - vec3_t blockPos = (*iter)->lower; + vec3_t blockPos = chest.lower; if (blockPos.x < 0) blockPos.x -= 1; if (blockPos.z < 0) blockPos.z -= 1; storageID = g_Data.getLocalPlayer()->region->getBlock(blockPos)->toLegacy()->blockId; - auto mathVect = vec3_t((*iter)->upper.floor().add(vec3_t(1.f, 1.f, 1.f)).sub((*iter)->upper)); + auto mathVect = vec3_t(chest.upper.floor().add(vec3_t(1.f, 1.f, 1.f)).sub(chest.upper)); mathVect.y = floor(mathVect.y); if (storageID == 54) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Normal Chest if (storageID == 146) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Trapped Chest if (storageID == 130) DrawUtils::setColor(0.435294f, 0.215686f, 0.631372f, math); // Ender Chest - DrawUtils::drawBox((*iter)->lower, (*iter)->upper, (float)fmax(0.2f, 1 / (float)fmax(1, g_Data.getLocalPlayer()->eyePos0.dist((*iter)->lower))), true); // Fancy math to give an illusion of good esp + DrawUtils::drawBox(chest.lower, chest.upper, (float)fmax(0.2f, 1 / (float)fmax(1, g_Data.getLocalPlayer()->eyePos0.dist(chest.lower))), true); // Fancy math to give an illusion of good esp } } void ChestESP::onTick(C_GameMode* gm) { - /*tickTimeout++; - if (tickTimeout > 60) { - tickTimeout = 0; - g_Data.clearChestList(); - }*/ // Swap list auto listLock = g_Data.lockChestList(); - auto* chestList = g_Data.getChestList(); + auto& chestList = g_Data.getChestList(); auto ourListLock = std::scoped_lock(this->listLock); this->bufferedChestList.clear(); - this->bufferedChestList.insert(this->bufferedChestList.end(), chestList->begin(), chestList->end()); - chestList->clear(); + this->bufferedChestList.insert(this->bufferedChestList.end(), chestList.begin(), chestList.end()); + chestList.clear(); } diff --git a/Horion/Module/Modules/ChestESP.h b/Horion/Module/Modules/ChestESP.h index ce1d7e95..1c644911 100644 --- a/Horion/Module/Modules/ChestESP.h +++ b/Horion/Module/Modules/ChestESP.h @@ -5,7 +5,7 @@ class ChestESP : public IModule { private: int tickTimeout = 0; - std::vector> bufferedChestList; + std::vector bufferedChestList; std::mutex listLock; public: diff --git a/Horion/Module/Modules/NameTags.h b/Horion/Module/Modules/NameTags.h index 979d6a22..a487e884 100644 --- a/Horion/Module/Modules/NameTags.h +++ b/Horion/Module/Modules/NameTags.h @@ -1,6 +1,7 @@ #pragma once #include "Module.h" +#include class NameTags : public IModule { public: diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 38d34a50..10d7c034 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -8,6 +8,7 @@ #include #include #include "../../Memory/GameData.h" +#include JoePathFinder::JoePathFinder(vec3_ti start, C_BlockSource* reg, std::shared_ptr goal) : startPos(start), region(reg), goal(goal) { } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index a93b26b3..da2234f5 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -1,12 +1,16 @@ #include "GameData.h" #include - +#include #include "../Utils/Logger.h" #include "../Utils/Utils.h" GameData g_Data; +size_t AABBHasher::operator()(const AABB& i) const { + return Utils::posToHash(i.lower); +} + void GameData::retrieveClientInstance() { static uintptr_t clientInstanceOffset = 0x0; uintptr_t sigOffset = 0x0; @@ -198,12 +202,10 @@ void GameData::addChestToList(C_ChestBlockActor* chest) { return; AABB chestAabb = chest->getFullAABB(); std::lock_guard listGuard(g_Data.chestListMutex); - for (auto it = g_Data.chestList.begin(); it != g_Data.chestList.end(); ++it) - if (**it == chestAabb) - return; + if (g_Data.chestList.count(chestAabb) > 0) + return; - auto toAdd = std::make_shared(chestAabb); - g_Data.chestList.push_back(toAdd); + g_Data.chestList.insert(chestAabb); } void GameData::initGameData(const SlimUtils::SlimModule* gameModule, SlimUtils::SlimMem* slimMem, void* hDllInst) { diff --git a/Memory/GameData.h b/Memory/GameData.h index c8556f45..ea57dc15 100644 --- a/Memory/GameData.h +++ b/Memory/GameData.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -63,6 +63,10 @@ struct InfoBoxData { struct SkinData; +struct AABBHasher { + size_t operator()(const AABB& i) const; +}; + class GameData { private: C_ClientInstance* clientInstance = nullptr; @@ -72,7 +76,7 @@ class GameData { C_HIDController* hidController = nullptr; C_RakNetInstance* raknetInstance = nullptr; void* hDllInst = 0; - std::vector> chestList; + std::unordered_set chestList; std::vector textPrintList; std::mutex textPrintLock; std::mutex chestListMutex; @@ -233,7 +237,7 @@ class GameData { C_EntityList* getEntityList() { return entityList; }; C_HIDController** getHIDController() { return &hidController; }; C_RakNetInstance* getRakNetInstance() { return raknetInstance; }; - std::vector>* getChestList() { return &chestList; }; + std::unordered_set& getChestList() { return chestList; }; auto lockChestList() { return std::lock_guard(this->chestListMutex); } void setFakeName(TextHolder* name) { fakeName = name; }; TextHolder* getFakeName() { return fakeName; }; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 1e509310..057bc1f6 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -194,16 +194,17 @@ void Hooks::Init() { void* render = reinterpret_cast(FindSignature("48 89 5C 24 18 56 57 41 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 41")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); - + + void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); - + void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05 F7 EA")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); - + void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); - + void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); @@ -212,7 +213,7 @@ void Hooks::Init() { void* isInWater = reinterpret_cast(FindSignature("0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24")); g_Hooks.Actor_isInWaterHook = std::make_unique(isInWater, Hooks::Actor_isInWater); - + void* getGameEdition = reinterpret_cast(FindSignature("8B 91 ?? ?? ?? ?? 85 D2 74 1C 83 EA 01")); g_Hooks.AppPlatform_getGameEditionHook = std::make_unique(getGameEdition, Hooks::AppPlatform_getGameEdition); @@ -227,7 +228,7 @@ void Hooks::Init() { void* tick_entityList = reinterpret_cast(FindSignature("48 89 ?? ?? ?? 57 48 83 EC ?? 48 8B ?? E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B D8 ?? ?? ?? ?? ?? ?? 48 99")); g_Hooks.MultiLevelPlayer_tickHook = std::make_unique(tick_entityList, Hooks::MultiLevelPlayer_tick); - + void* keyMouseFunc = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 81 EC ? ? ? ? 0F 29 74 24 ? 0F 29 7C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F0")); g_Hooks.HIDController_keyMouseHook = std::make_unique(keyMouseFunc, Hooks::HIDController_keyMouse); @@ -281,7 +282,7 @@ void Hooks::Init() { void* renderNameTags = reinterpret_cast(FindSignature("4C 8B DC 49 89 5B ? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 41 0F 29 73 ? 41 0F 29 7B ? 45 0F 29 43 ? 48 8B 05")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags, Hooks::LevelRendererPlayer__renderNameTags); - + static constexpr auto counterStart = __COUNTER__ + 1; #define lambda_counter (__COUNTER__ - counterStart) diff --git a/Utils/HMath.h b/Utils/HMath.h index 3703b27e..17f2ae09 100644 --- a/Utils/HMath.h +++ b/Utils/HMath.h @@ -135,43 +135,43 @@ struct vec3_t { bool iszero() const { return x == 0 && y == 0 && z == 0; } - bool operator==(const vec3_t &o) const { return x == o.x && y == o.y && z == o.z; }; + inline bool operator==(const vec3_t &o) const { return x == o.x && y == o.y && z == o.z; }; bool operator!=(const vec3_t &o) const { return x != o.x || y != o.y || z != o.z; }; vec3_t operator-() const { return vec3_t(-x, -y, -z); }; - vec3_t mul(const vec3_t& o) { + vec3_t mul(const vec3_t &o) const { return vec3_t(x * o.x, y * o.y, z * o.z); }; - vec3_t mul(float f) { + vec3_t mul(float f) const { return vec3_t(x * f, y * f, z * f); }; - vec3_t mul(float x1, float y1, float z1) { + vec3_t mul(float x1, float y1, float z1) const { return vec3_t(x * x1, y * y1, z * z1); }; - vec3_t div(float f) { + vec3_t div(float f) const { return vec3_t(x / f, y / f, z / f); }; - vec3_t div(float x1, float y1, float z1) { + vec3_t div(float x1, float y1, float z1) const { return vec3_t(x / x1, y / y1, z / z1); }; - vec3_t div(const vec3_t& o) { + vec3_t div(const vec3_t &o) const { return vec3_t(x / o.x, y / o.y, z / o.z); }; - vec3_t add(float f) { + vec3_t add(float f) const { return vec3_t(x + f, y + f, z + f); }; - vec3_t add(float x1, float y1, float z1) { + vec3_t add(float x1, float y1, float z1) const { return vec3_t(x + x1, y + y1, z + z1); }; - vec3_t sub(float f) { + vec3_t sub(float f) const { return vec3_t(x - f, y - f, z - f); }; - vec3_t sub(float x1, float y1, float z1) { + vec3_t sub(float x1, float y1, float z1) const { return vec3_t(x - x1, y - y1, z - z1); }; - vec3_t floor() { + vec3_t floor() const { return vec3_t(floorf(x), floorf(y), floorf(z)); }; @@ -542,7 +542,7 @@ struct AABB { this->upper = {lower.x + width, lower.y + height, lower.z + width}; } - bool operator==(const AABB &rhs) const { + inline bool operator==(const AABB &rhs) const { return lower == rhs.lower && upper == rhs.upper; } diff --git a/Utils/Utils.cpp b/Utils/Utils.cpp index 9e555c63..65b1185b 100644 --- a/Utils/Utils.cpp +++ b/Utils/Utils.cpp @@ -7,6 +7,7 @@ #include "Logger.h" #include #include +#include "HMath.h" void Utils::ApplySystemTime(std::stringstream* ss) { using namespace std::chrono; @@ -105,6 +106,9 @@ std::string Utils::getRttiBaseClassName(void* ptr) { return std::string("invalid"); } +size_t Utils::posToHash(const vec3_ti& pos) { + return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); +} std::string Utils::getClipboardText() { if (!OpenClipboard(nullptr)) { return ""; diff --git a/Utils/Utils.h b/Utils/Utils.h index 926850ba..73209c34 100644 --- a/Utils/Utils.h +++ b/Utils/Utils.h @@ -227,8 +227,18 @@ static inline void ImSwap(T& a, T& b) { #define FindSignature(szSignature) Utils::FindSignatureModule("Minecraft.Windows.exe", szSignature) #endif +struct vec3_ti; + class Utils { public: + + static __forceinline unsigned __int64 rotBy(int in, unsigned int by) { + auto mut = static_cast(in); + return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; + } + + static size_t posToHash(const vec3_ti& pos); + template static inline auto lerp(type a, type b, float t) -> type { return a + t * (b - a); From be9ac9cb6c1d93a41f9cd82705be7c3f4f37e9c2 Mon Sep 17 00:00:00 2001 From: godgamer029 <-> Date: Sun, 22 Aug 2021 23:49:23 +0200 Subject: [PATCH 367/419] Only collect chests when chest esp is enabled --- Memory/Hooks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 057bc1f6..ca6536a5 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -937,7 +937,8 @@ float Hooks::Dimension_getSunIntensity(__int64 a1, float a2, vec3_t* a3, float a void Hooks::ChestBlockActor_tick(C_ChestBlockActor* _this, void* a) { static auto oTick = g_Hooks.ChestBlockActor_tickHook->GetFastcall(); oTick(_this, a); - if (_this != nullptr) + static auto* chestEspMod = moduleMgr->getModule(); + if (_this != nullptr && chestEspMod->isEnabled()) GameData::addChestToList(_this); } From 68ae2cc39e5e2477b664ead34a3f981ad2db2ac6 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 23 Aug 2021 12:22:46 -0400 Subject: [PATCH 368/419] Fix Fullbright (#4452) -100 no longer is needed --- Horion/Module/Modules/FullBright.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/FullBright.cpp b/Horion/Module/Modules/FullBright.cpp index 12eb7f28..bc6a0f82 100644 --- a/Horion/Module/Modules/FullBright.cpp +++ b/Horion/Module/Modules/FullBright.cpp @@ -1,7 +1,7 @@ #include "FullBright.h" FullBright::FullBright() : IModule(0, Category::VISUAL, "Puts your gamma to max") { - registerFloatSetting("Intensity", &this->intensity, this->intensity, -100.f, 25.f); + registerFloatSetting("Intensity", &this->intensity, this->intensity, -25.f, 25.f); } FullBright::~FullBright() { From 64df2cf07291c01d710b9d1dee23f3d94806ab0c Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 23 Aug 2021 19:41:00 +0200 Subject: [PATCH 369/419] add xp command --- Horion.vcxproj | 2 ++ Horion/Command/Commands/XpCommand.cpp | 28 +++++++++++++++++++++++++++ Horion/Command/Commands/XpCommand.h | 11 +++++++++++ SDK/CEntity.h | 4 ++-- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Horion/Command/Commands/XpCommand.cpp create mode 100644 Horion/Command/Commands/XpCommand.h diff --git a/Horion.vcxproj b/Horion.vcxproj index 753a0944..bbabbf8f 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -266,6 +266,7 @@ + @@ -454,6 +455,7 @@ + diff --git a/Horion/Command/Commands/XpCommand.cpp b/Horion/Command/Commands/XpCommand.cpp new file mode 100644 index 00000000..bc73f833 --- /dev/null +++ b/Horion/Command/Commands/XpCommand.cpp @@ -0,0 +1,28 @@ +#include "XpCommand.h" + +XpCommand::XpCommand() : IMCCommand("xp", "Add experience to your player", "xp L") { +} + +XpCommand::~XpCommand() { +} + +bool XpCommand::execute(std::vector* args) { + auto player = g_Data.getLocalPlayer(); + if (!player) return false; + + std::string amount = args->at(1); + std::transform(amount.begin(), amount.end(), amount.begin(), tolower); + const bool levels = amount.substr(amount.length() - 1) == "l"; + if (levels) amount = amount.substr(0, amount.length() - 1); + try { + int xp = std::stoi(amount); + if (levels) + player->addLevels(xp); + else + player->addExperience(xp); + clientMessageF("%sAdded %i experience %s", GREEN, xp, levels ? "levels" : "points"); + } catch (std::invalid_argument&) { + clientMessageF("%sInvalid amount of experience!", RED); + } + return true; +} diff --git a/Horion/Command/Commands/XpCommand.h b/Horion/Command/Commands/XpCommand.h new file mode 100644 index 00000000..cfdf7aed --- /dev/null +++ b/Horion/Command/Commands/XpCommand.h @@ -0,0 +1,11 @@ +#pragma once + +#include "ICommand.h" + +class XpCommand : public IMCCommand { +public: + XpCommand(); + ~XpCommand(); + + bool execute(std::vector* args) override; +}; diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 56803b42..1653eecf 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -841,10 +841,10 @@ class C_Player : public C_Entity { private: virtual __int64 sendEventPacket(__int64 &) const; - virtual __int64 addExperience(int); - virtual __int64 addLevels(int); public: + virtual void addExperience(int); + virtual void addLevels(int); virtual void setContainerData(__int64 &, int, int); private: From 1895c2f3249f8fdc57483196d0c70a052b741440 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:59:03 -0400 Subject: [PATCH 370/419] Fix freelook / localPlayerTurn --- SDK/CEntity.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 1653eecf..32cf0a8c 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -6,6 +6,7 @@ #include "CInventory.h" #include "CInventoryTransaction.h" #include "TextHolder.h" +#include "../Utils/Utils.h" class C_GameMode; @@ -893,11 +894,11 @@ class C_LocalPlayer : public C_Player { //swingFunc(this); this->swing(); } - /*void localPlayerTurn(vec2_t* viewAngles) { + void localPlayerTurn(vec2_t* viewAngles) { using Turn = void(__thiscall*)(void*, vec2_t*); - static Turn TurnFunc = reinterpret_cast(FindSignature("4C 8B DC 55 57 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 45 ?? ?? ?? ?? ?? ?? ?? 48 8B 05 D6 D4 A5 01 48 33 C4 48 89 45 ?? 49 89 5B ?? 48 8B F9 ?? ?? ?? ?? ?? ?? ?? 48 8B DA 4D 89 73 E8 41 0F 29 73 D8 41 0F 29 7B C8 48 8B 01 FF 90 ?? ?? ?? ?? F2 0F 10 03")); + static Turn TurnFunc = reinterpret_cast(FindSignature("48 8B 58 68 48 ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 89 ?? ?? ?? ?? ?? ?? ?? 48 8B 03 48 8B CB FF 50 08 90 48 85 DB ?? 09 48 8B ?? 48 8B CB ?? ?? ?? ?? ?? ?? ?? 48 8B D3 48 8B CE E8 0D BB 1D FF 90 48 85 DB 74 09 48 8B 03 48 8B ?? ?? ?? ?? 48 83 C7 10")); TurnFunc(this, viewAngles); - }*/ + } void applyTurnDelta(vec2_t *viewAngleDelta); void setGameModeType(int gma); }; \ No newline at end of file From be85c95e7f3db525991f5898948b0330daf32fd6 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 23 Aug 2021 14:45:55 -0400 Subject: [PATCH 371/419] Update Freelook.cpp --- Horion/Module/Modules/Freelook.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Freelook.cpp b/Horion/Module/Modules/Freelook.cpp index ad772210..01550d49 100644 --- a/Horion/Module/Modules/Freelook.cpp +++ b/Horion/Module/Modules/Freelook.cpp @@ -32,8 +32,10 @@ void Freelook::onDisable() { initialViewAngles.y += 180; initialViewAngles = initialViewAngles.normAngles(); - }else + } else { mouseEnd = this->lastCameraAngle; + mouseEnd.y += 180; + } }else if(!g_Data.isInGame()){ this->resetViewTick = -1; this->redirectMouse = false; From 271c57e7b5cfa081a7738abbcd2401d7852fe099 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 23 Aug 2021 17:40:42 -0400 Subject: [PATCH 372/419] Update the rest of the client to match clickgui theme --- Horion/DrawUtils.cpp | 4 ++-- Horion/ImmediateGui.cpp | 2 +- Horion/Menu/ClickGui.cpp | 4 ++-- Horion/Menu/TabGui.cpp | 8 ++++---- Horion/Module/Modules/HudModule.cpp | 6 +++--- Memory/Hooks.cpp | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 487b0088..81873b93 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -371,7 +371,7 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo vec4_t subRectPos = rectPos; subRectPos.y = subRectPos.w - 1.f * textSize; static auto nametagsMod = moduleMgr->getModule(); - fillRectangle(rectPos, MC_Color(13, 29, 48), nametagsMod->opacity); + fillRectangle(rectPos, MC_Color(12, 12, 12), nametagsMod->opacity); if (nametagsMod->underline) { fillRectangle(subRectPos, MC_Color(30, 110, 20), 0.9f); } @@ -474,7 +474,7 @@ void DrawUtils::drawKeystroke(char key, const vec2_t& pos) { vec2_t textPos( (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); - fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(28, 50, 77) : MC_Color(13, 29, 48), 1.f); + fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); } diff --git a/Horion/ImmediateGui.cpp b/Horion/ImmediateGui.cpp index ad83e017..7165e39f 100644 --- a/Horion/ImmediateGui.cpp +++ b/Horion/ImmediateGui.cpp @@ -47,7 +47,7 @@ void ButtonInfo::draw(vec2_t mousePos, const char* label) { DrawUtils::fillRectangle(surface, MC_Color(28, 50, 77), 1); this->canClickB = true; } else { - DrawUtils::fillRectangle(surface, MC_Color(13, 29, 48), 1); + DrawUtils::fillRectangle(surface, MC_Color(12, 12, 12), 1); this->canClickB = false; } } diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 3ad4781a..3fcef6bf 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -511,7 +511,7 @@ void ClickGui::renderCategory(Category category) { // Draw Progress { rect.z = rect.x + value; - DrawUtils::fillRectangle(rect, MC_Color(28, 107, 201), (areWeFocused || setting->isDragging) ? 1.f : 0.8f); + DrawUtils::fillRectangle(rect, MC_Color(85, 85, 85), (areWeFocused || setting->isDragging) ? 1.f : 0.8f); } // Drag Logic @@ -606,7 +606,7 @@ void ClickGui::renderCategory(Category category) { // Draw Progress { rect.z = rect.x + value; - DrawUtils::fillRectangle(rect, MC_Color(28, 107, 201), (areWeFocused || setting->isDragging) ? 1.f : 0.8f); + DrawUtils::fillRectangle(rect, MC_Color(85, 85, 85), (areWeFocused || setting->isDragging) ? 1.f : 0.8f); } // Drag Logic diff --git a/Horion/Menu/TabGui.cpp b/Horion/Menu/TabGui.cpp index a9cb6e3a..3f0d8786 100644 --- a/Horion/Menu/TabGui.cpp +++ b/Horion/Menu/TabGui.cpp @@ -100,7 +100,7 @@ void TabGui::renderLevel() { if (selected[renderedLevel].selectedItemId == i && level >= renderedLevel) { // We are selected if (renderedLevel == level) { // Are we actually in the menu we are drawing right now? // We are selected in the current menu - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); static bool lastVal = toggleCurrentSelection; if (toggleCurrentSelection) { @@ -114,11 +114,11 @@ void TabGui::renderLevel() { label.mod->setEnabled(false); lastVal = toggleCurrentSelection; } else { // selected, but not what the user is interacting with - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); } //selectedYOffset = yOffset; } else { // We are not selected - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); } std::string tempLabel(label.text); @@ -143,7 +143,7 @@ void TabGui::renderLevel() { selected[renderedLevel].rollback(); } else selected[renderedLevel].rollin(); - DrawUtils::fillRectangle(selectedPos, MC_Color(28, 107, 201), alphaVal); + DrawUtils::fillRectangle(selectedPos, MC_Color(85, 85, 85), alphaVal); } // Cleanup diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index 9c9af98e..c6d0f933 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -38,7 +38,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { std::string fpsText = "FPS: " + std::to_string(g_Data.getFPS()); vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 15.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); DrawUtils::drawText(textPos, &fpsText, MC_Color(200, 200, 200), scale); startY += f; @@ -49,7 +49,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { std::string cpsText = "CPS: " + std::to_string(g_Data.getLeftCPS()) + " - " + std::to_string(g_Data.getRightCPS()); vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 15.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); DrawUtils::drawText(textPos, &cpsText, MC_Color(200, 200, 200), scale); startY += f; @@ -64,7 +64,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { std::string coordsZ = "Z: " + std::to_string((int)floorf(pos->z)); vec4_t rectPos = vec4_t(2.5f, startY + 5.f * scale, len, startY + 35.f * scale); vec2_t textPos = vec2_t(rectPos.x + 1.5f, rectPos.y + 1.f); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); DrawUtils::drawText(textPos, &coordsX, MC_Color(200, 200, 200), scale); textPos.y += f; DrawUtils::drawText(textPos, &coordsY, MC_Color(200, 200, 200), scale); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index ca6536a5..f8d94057 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -661,10 +661,10 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { windowSize.x - margin + borderPadding, windowSize.y - margin); - DrawUtils::drawRectangle(rect, MC_Color(13, 29, 48), 1.f, 2.f); - DrawUtils::fillRectangle(rect, MC_Color(rcolors), 1.f); - DrawUtils::drawText(vec2_t(rect.x + borderPadding, rect.y), &name, MC_Color(6, 15, 24), nameTextSize); - DrawUtils::drawText(vec2_t(rect.x + borderPadding + nameLength, rect.w - 7), &version, MC_Color(0, 0, 0), versionTextSize); + DrawUtils::drawRectangle(rect, MC_Color(rcolors), 1.f, 2.f); + DrawUtils::fillRectangle(rect, MC_Color(12, 12, 12), 1.f); + DrawUtils::drawText(vec2_t(rect.x + borderPadding, rect.y), &name, MC_Color(rcolors), nameTextSize); + DrawUtils::drawText(vec2_t(rect.x + borderPadding + nameLength, rect.w - 7), &version, MC_Color(rcolors), versionTextSize); } // Draw ArrayList @@ -790,7 +790,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { currColor[0] += 1.f / a * c; Utils::ColorConvertHSVtoRGB(currColor[0], currColor[1], currColor[2], currColor[0], currColor[1], currColor[2]); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), 1.f); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), 1.f); DrawUtils::fillRectangle(leftRect, MC_Color(currColor), 1.f); if (!GameData::canUseMoveKeys() && rectPos.contains(&mousePos) && hudModule->clickToggle) { vec4_t selectedRect = rectPos; @@ -865,7 +865,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { centerPos.y - paddingVert, centerPos.x + paddingHoriz + std::max(titleWidth, msgWidth) / 2, centerPos.y + paddingVert * 2 + titleTextHeight + messageHeight * lines); - DrawUtils::fillRectangle(rectPos, MC_Color(13, 29, 48), box->fadeVal); + DrawUtils::fillRectangle(rectPos, MC_Color(12, 12, 12), box->fadeVal); DrawUtils::drawRectangle(rectPos, rcolors, box->fadeVal, 2.f); DrawUtils::drawText(textPos, &box->title, MC_Color(), titleTextSize, box->fadeVal); DrawUtils::drawText(msgPos, &box->message, MC_Color(), messageTextSize, box->fadeVal); From 6382d81e100fe00c1af740e20a92044e11bba230 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Tue, 24 Aug 2021 12:26:29 -0400 Subject: [PATCH 373/419] Add Speed Slider to Fastladder (#4460) --- Horion/Module/Modules/FastLadder.cpp | 1 + Horion/Module/Modules/FastLadder.h | 2 ++ Memory/Hooks.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/FastLadder.cpp b/Horion/Module/Modules/FastLadder.cpp index 84b0b018..ee850787 100644 --- a/Horion/Module/Modules/FastLadder.cpp +++ b/Horion/Module/Modules/FastLadder.cpp @@ -1,6 +1,7 @@ #include "FastLadder.h" FastLadder::FastLadder() : IModule(0, Category::MOVEMENT, "Climb up ladders faster") { + registerFloatSetting("Speed", &this->speed, this->speed, 0.1f, 1.0f); } FastLadder::~FastLadder() { diff --git a/Horion/Module/Modules/FastLadder.h b/Horion/Module/Modules/FastLadder.h index 00d1194c..3d2849e3 100644 --- a/Horion/Module/Modules/FastLadder.h +++ b/Horion/Module/Modules/FastLadder.h @@ -2,6 +2,8 @@ #include "Module.h" class FastLadder : public IModule { public: + float speed = 0.6f; + FastLadder(); ~FastLadder(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index f8d94057..e9a665aa 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1431,7 +1431,7 @@ void Hooks::Actor_ascendLadder(C_Entity* _this) { static auto fastLadderModule = moduleMgr->getModule(); if (fastLadderModule->isEnabled() && g_Data.getLocalPlayer() == _this) { - _this->velocity.y = 0.6f; + _this->velocity.y = fastLadderModule->speed; return; } return oFunc(_this); From 751c63b785004bb624275feb5e68fef04aac3cd4 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 24 Aug 2021 12:57:07 -0400 Subject: [PATCH 374/419] Add LMB & RMB to Keystrokes (#4457) --- Horion/DrawUtils.cpp | 16 ------ Horion/DrawUtils.h | 1 - Horion/Module/Modules/HudModule.cpp | 86 +++++++++++++++++++++++++++-- Horion/Module/Modules/HudModule.h | 3 + 4 files changed, 84 insertions(+), 22 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 81873b93..07690442 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -462,22 +462,6 @@ void DrawUtils::drawItem(C_ItemStack* item, const vec2_t& itemPos, float opacity } -void DrawUtils::drawKeystroke(char key, const vec2_t& pos) { - std::string keyString = Utils::getKeybindName(key); - C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); - if (key == *input->spaceBarKey) keyString = "-"; - vec4_t rectPos( - pos.x, - pos.y, - pos.x + ((key == *input->spaceBarKey) ? 64.f : 20.f), - pos.y + 20.f); - vec2_t textPos( - (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), - rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); - fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); - drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); -} - vec2_t DrawUtils::worldToScreen(const vec3_t& world) { vec2_t ret{-1, -1}; refdef->OWorldToScreen(origin, world, ret, fov, screenSize); diff --git a/Horion/DrawUtils.h b/Horion/DrawUtils.h index 5389e44a..7b6d2069 100644 --- a/Horion/DrawUtils.h +++ b/Horion/DrawUtils.h @@ -128,7 +128,6 @@ class DrawUtils { static void draw2D(C_Entity* ent, float lineWidth); static void drawNameTags(C_Entity* ent, float textSize, bool drawHealth = false, bool useUnicodeFont = false); static void drawItem(C_ItemStack* item, const vec2_t& ItemPos, float opacity, float scale, bool isEnchanted); - static void drawKeystroke(char key, const vec2_t& pos); static float getLerpTime(); static vec3_t getOrigin(); diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index c6d0f933..da5a3284 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -24,6 +24,80 @@ const char* HudModule::getModuleName() { return ("HUD"); } +void HudModule::drawKeystroke(char key, const vec2_t& pos) { + std::string keyString = Utils::getKeybindName(key); + C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); + if (key == *input->forwardKey) { + vec4_t rectPos( + pos.x, + pos.y, + pos.x + 20.f, + pos.y + 20.f); + vec2_t textPos( + (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f) + 0.2, + rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); + + DrawUtils::fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); + DrawUtils::drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); + } + if (key == *input->spaceBarKey) { + if (key == *input->spaceBarKey) keyString = "-"; + vec4_t rectPos( + pos.x, + pos.y, + pos.x + 64.f, + pos.y + 15.f); + vec2_t textPos( + (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), + rectPos.y + 7.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); + + DrawUtils::fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); + DrawUtils::drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); + } else { + vec4_t rectPos( + pos.x, + pos.y, + pos.x + ((key == *input->spaceBarKey) ? 64.f : 20.f), + pos.y + ((key == *input->spaceBarKey) ? 15.f : 20.f)); + vec2_t textPos( + (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), + rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); + + DrawUtils::fillRectangle(rectPos, GameData::isKeyDown(key) ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); + DrawUtils::drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); + } +} + +void HudModule::drawLeftMouseKeystroke(vec2_t pos) { + std::string keyString; + keyString = "LMB"; + vec4_t rectPos( + pos.x, + pos.y + 2, + pos.x + 31.f, + pos.y + 22.f); + DrawUtils::fillRectangle(rectPos, GameData::GameData::isLeftClickDown() ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); + vec2_t textPos( + (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), + rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); + DrawUtils::drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); +} + +void HudModule::drawRightMouseKeystroke(vec2_t pos) { + std::string keyString; + keyString = "RMB"; + vec4_t rectPos( + pos.x, + pos.y + 2, + pos.x + 31.f, + pos.y + 22.f); + DrawUtils::fillRectangle(rectPos, GameData::GameData::isRightClickDown() ? MC_Color(85, 85, 85) : MC_Color(12, 12, 12), 1.f); + vec2_t textPos( + (rectPos.x + (rectPos.z - rectPos.x) / 2) - (DrawUtils::getTextWidth(&keyString) / 2.f), + rectPos.y + 10.f - DrawUtils::getFont(Fonts::SMOOTH)->getLineHeight() / 2.f); + DrawUtils::drawText(textPos, &keyString, MC_Color(255, 255, 255), 1.f, 1.f); +} + void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { vec2_t windowSize = g_Data.getClientInstance()->getGuiData()->windowSize; @@ -98,11 +172,13 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { { // Keystrokes if (!(g_Data.getLocalPlayer() == nullptr || !this->keystrokes || !GameData::canUseMoveKeys())) { C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); - DrawUtils::drawKeystroke(*input->forwardKey, vec2_t(32.f, windowSize.y - 74)); - DrawUtils::drawKeystroke(*input->leftKey, vec2_t(10.f, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->backKey, vec2_t(32.f, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->rightKey, vec2_t(54.f, windowSize.y - 52)); - DrawUtils::drawKeystroke(*input->spaceBarKey, vec2_t(10.f, windowSize.y - 30)); + HudModule::drawKeystroke(*input->forwardKey, vec2_t(32.f, windowSize.y - 84)); + HudModule::drawKeystroke(*input->leftKey, vec2_t(10.f, windowSize.y - 62)); + HudModule::drawKeystroke(*input->backKey, vec2_t(32.f, windowSize.y - 62)); + HudModule::drawKeystroke(*input->rightKey, vec2_t(54.f, windowSize.y - 62)); + HudModule::drawKeystroke(*input->spaceBarKey, vec2_t(10.f, windowSize.y - 40)); + HudModule::drawLeftMouseKeystroke(vec2_t(10.f, windowSize.y - 25)); + HudModule::drawRightMouseKeystroke(vec2_t(43.f, windowSize.y - 25)); } } } \ No newline at end of file diff --git a/Horion/Module/Modules/HudModule.h b/Horion/Module/Modules/HudModule.h index e3016989..a63c26e9 100644 --- a/Horion/Module/Modules/HudModule.h +++ b/Horion/Module/Modules/HudModule.h @@ -23,4 +23,7 @@ class HudModule : public IModule { // Inherited via IModule virtual const char* getModuleName() override; virtual void onPostRender(C_MinecraftUIRenderContext* renderCtx) override; + static void drawKeystroke(char key, const vec2_t& pos); + static void drawLeftMouseKeystroke(vec2_t pos); + static void drawRightMouseKeystroke(vec2_t pos); }; From 1095fb75a374c6dcb3cded0cd2a0456248084bc4 Mon Sep 17 00:00:00 2001 From: GodGamer029 <43895351+GodGamer029@users.noreply.github.com> Date: Tue, 24 Aug 2021 20:16:13 +0200 Subject: [PATCH 375/419] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bd1b4b8..bd45e455 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/injector "Download the injector")

    @@ -5,10 +6,9 @@ **Horion** is a Minecraft: Bedrock Edition utility mod designed to enhance gameplay. We do not take responsibility in anything done with this utility mod. If you want to contribute to this project, feel free to fork this repository and submit a pull request. -**As of 09/01/20, this project is not under active development by the Horion team anymore. We will still review pull requests.** [![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://horion.download/discord) -[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/injector "Download the injector") + [![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) [![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) From 24795d0294c0d4a44d480df609e1bae2d189b9fd Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 24 Aug 2021 18:35:48 -0400 Subject: [PATCH 376/419] Fix NoHurtCam 180 flip bug --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index e9a665aa..167d1fbc 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -2044,7 +2044,7 @@ void Hooks::LocalPlayer__updateFromCamera(__int64 a1, C_Camera* camera) { rot = rot.normAngles(); } - camera->setOrientationDeg(rot.x, rot.y, 0); + camera->setOrientationDeg(rot.x, rot.y + 180, 0); } func(a1, camera); From 0890ff230f02fc0aa8e20f6ce0f57528c7f694db Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Tue, 24 Aug 2021 19:48:57 -0400 Subject: [PATCH 377/419] Random sigs --- Memory/Hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 167d1fbc..3fe6fe52 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -217,7 +217,7 @@ void Hooks::Init() { void* getGameEdition = reinterpret_cast(FindSignature("8B 91 ?? ?? ?? ?? 85 D2 74 1C 83 EA 01")); g_Hooks.AppPlatform_getGameEditionHook = std::make_unique(getGameEdition, Hooks::AppPlatform_getGameEdition); - void* autoComplete = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 41 8B F9")); + void* autoComplete = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? FE FF FF FF 48 89 58 ?? 48 89 70 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 8B F9")); g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); @@ -266,7 +266,7 @@ void Hooks::Init() { void* _toStyledString = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 49 8B D8 48 8B F9")); g_Hooks.toStyledStringHook = std::make_unique(_toStyledString, Hooks::toStyledString); - void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B D8 4C")); + void* InGamePlayScreen___renderLevel = reinterpret_cast(FindSignature("48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 41 8B D8 4C")); g_Hooks.InGamePlayScreen___renderLevelHook = std::make_unique(InGamePlayScreen___renderLevel, Hooks::InGamePlayScreen___renderLevel); #ifdef TEST_DEBUG From 5da7438807248596055938d1cf319a9bb4122f6e Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 25 Aug 2021 08:51:22 -0400 Subject: [PATCH 378/419] Fix auto totem --- Horion/Module/Modules/AutoTotem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Horion/Module/Modules/AutoTotem.cpp b/Horion/Module/Modules/AutoTotem.cpp index a5627a73..9f97414a 100644 --- a/Horion/Module/Modules/AutoTotem.cpp +++ b/Horion/Module/Modules/AutoTotem.cpp @@ -18,9 +18,11 @@ void AutoTotem::onTick(C_GameMode* gm) { if (current->item == NULL) { for (int i = 0; i < 36; i++) { C_ItemStack* totem = inv->getItemStack(i); - if (totem->item != NULL && (*totem->item)->itemId == 558) { - C_InventoryAction first(i, totem, nullptr); - C_InventoryAction second(37, nullptr, totem); + if (totem->item != NULL && (*totem->item)->itemId == 568) { + ItemDescriptor* desc = nullptr; + desc = new ItemDescriptor((*totem->item)->itemId, 0); + C_InventoryAction first(i, desc, nullptr, totem, nullptr, 1); + C_InventoryAction second(37, nullptr, desc, nullptr, totem, 1); g_Data.getLocalPlayer()->setOffhandSlot(totem); manager->addInventoryAction(first); manager->addInventoryAction(second); From 24513007e419b031e58d6695e64d3413f341973c Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 25 Aug 2021 09:13:59 -0400 Subject: [PATCH 379/419] Update BowAimbot.cpp --- Horion/Module/Modules/BowAimbot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/BowAimbot.cpp b/Horion/Module/Modules/BowAimbot.cpp index c1cca5fe..f94d76ef 100644 --- a/Horion/Module/Modules/BowAimbot.cpp +++ b/Horion/Module/Modules/BowAimbot.cpp @@ -43,7 +43,7 @@ void BowAimbot::onPostRender(C_MinecraftUIRenderContext* renderCtx) { if (localPlayer == nullptr) return; - if (localPlayer->getSelectedItemId() != 261) // Bow in hand? + if (localPlayer->getSelectedItemId() != 300) // Bow in hand? return; if (!(GameData::isRightClickDown() && GameData::canUseMoveKeys())) // is aiming? From d0bd49e3b4645c96ac2fdcee609d172bef71e1bb Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 25 Aug 2021 13:56:55 -0400 Subject: [PATCH 380/419] Crystal aura id fix --- Horion/Command/CommandMgr.cpp | 1 + Horion/Module/Modules/CrystalAura.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index be8f2ff9..d42f7613 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -48,6 +48,7 @@ void CommandMgr::initCommands() { commandList.push_back(new ExecuteCommand()); commandList.push_back(new ScriptCommand()); commandList.push_back(new PathCommand()); + commandList.push_back(new XpCommand()); #ifdef _DEBUG commandList.push_back(new TestCommand()); diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index 924ff825..067a8407 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -135,7 +135,7 @@ void CrystalAura::onTick(C_GameMode* gm) { for (int n = 0; n < 9; n++) { C_ItemStack* stack = inv->getItemStack(n); if (stack->item != nullptr) { - if (stack->getItem()->itemId == 615) { + if (stack->getItem()->itemId == 629) { if (prevSlot != n) supplies->selectedHotbarSlot = n; return; @@ -145,7 +145,7 @@ void CrystalAura::onTick(C_GameMode* gm) { return; } if (this->delay == 2) { - if (autoplace && g_Data.getLocalPlayer()->getSelectedItemId() == 615) { //endcrystal + if (autoplace && g_Data.getLocalPlayer()->getSelectedItemId() == 629) { //endcrystal if (pEnhanced) for (auto& i : targetList) CPlace(gm, i->getPos()); From 164ca17a91d1441bf4f932a162057160d2a8e9fc Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Wed, 25 Aug 2021 14:13:00 -0400 Subject: [PATCH 381/419] Update CommandMgr.cpp --- Horion/Command/CommandMgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index d42f7613..be8f2ff9 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -48,7 +48,6 @@ void CommandMgr::initCommands() { commandList.push_back(new ExecuteCommand()); commandList.push_back(new ScriptCommand()); commandList.push_back(new PathCommand()); - commandList.push_back(new XpCommand()); #ifdef _DEBUG commandList.push_back(new TestCommand()); From 13cbdea2690ef584fcd0fd72dc255cb5894cbbcd Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Wed, 25 Aug 2021 16:49:16 -0400 Subject: [PATCH 382/419] it only makes sense, Update NamespoofCommand.cpp for the retards: namespoof = ns fakename = fn --- Horion/Command/Commands/NameSpoofCommand.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Horion/Command/Commands/NameSpoofCommand.cpp b/Horion/Command/Commands/NameSpoofCommand.cpp index c71733de..df7cf9d4 100644 --- a/Horion/Command/Commands/NameSpoofCommand.cpp +++ b/Horion/Command/Commands/NameSpoofCommand.cpp @@ -3,6 +3,7 @@ NameSpoofCommand::NameSpoofCommand() : IMCCommand("namespoof", "Spoof your name on realms/bds", " ") { registerAlias("ns"); registerAlias("fakename"); + registerAlias("fn"); } NameSpoofCommand::~NameSpoofCommand() { From 0a715d814a550368b1a33b17d4f1dd664f3c9b28 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Thu, 26 Aug 2021 13:20:30 -0400 Subject: [PATCH 383/419] Fix entity vtable --- Horion/Command/CommandMgr.cpp | 2 +- Horion/Command/CommandMgr.h | 2 +- SDK/CEntity.h | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index be8f2ff9..cc2379af 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -42,7 +42,7 @@ void CommandMgr::initCommands() { commandList.push_back(new NbtCommand()); commandList.push_back(new WaypointCommand()); commandList.push_back(new TopCommand()); - + commandList.push_back(new XpCommand()); commandList.push_back(new CommandBlockExploitCommand()); commandList.push_back(new NameSpoofCommand()); commandList.push_back(new ExecuteCommand()); diff --git a/Horion/Command/CommandMgr.h b/Horion/Command/CommandMgr.h index d9ca603b..280002e0 100644 --- a/Horion/Command/CommandMgr.h +++ b/Horion/Command/CommandMgr.h @@ -33,7 +33,7 @@ #include "Commands/NbtCommand.h" #include "Commands/ExecuteCommand.h" #include "Commands/WaypointCommand.h" - +#include"Commands/XpCommand.h" #include "Commands/ScriptCommand.h" #include "Commands/PathCommand.h" diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 32cf0a8c..0eec807b 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -669,10 +669,8 @@ class C_Entity { private: virtual void unknown(void) const; virtual __int64 ascendLadder(void); - virtual __int64 ascendScaffolding(void); - virtual __int64 ascendScaffolding2(void); - virtual __int64 descendScaffolding(void); - virtual __int64 canAscendCurrentBlockByJumping(void); + virtual __int64 ascendBlockByJumping(void); // 0x161 + virtual __int64 descendBlockByCrouching(void); // 0x162 virtual __int64 dropContainer(void); virtual __int64 initBodyControl(void); From 8c17b0033dbba602b78ea6e887b010fb5b691a6f Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 27 Aug 2021 00:23:04 +0200 Subject: [PATCH 384/419] make itemData and NBT optional in .give usage --- Horion/Command/Commands/GiveCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index e1fca480..9612f8c9 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -2,7 +2,7 @@ #include "../../../Utils/Utils.h" #include "../../../SDK/Tag.h" -GiveCommand::GiveCommand() : IMCCommand("give", "spawn items", " ") { +GiveCommand::GiveCommand() : IMCCommand("give", "spawn items", " [itemData] [NBT]") { } GiveCommand::~GiveCommand() { From ffac4654582a938ad31d37a459222111033c0e11 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 27 Aug 2021 07:59:06 -0400 Subject: [PATCH 385/419] Item vtable (#4470) * Update CItem.h * Update CLoopbackPacketSender.h --- SDK/CItem.h | 289 +++++++++++++++++------------------- SDK/CLoopbackPacketSender.h | 2 + 2 files changed, 136 insertions(+), 155 deletions(-) diff --git a/SDK/CItem.h b/SDK/CItem.h index 835f3644..d3e0b217 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -73,163 +73,161 @@ class C_Item { public: int duration; //0xFC*/ private: - virtual __int64 destructor(); - virtual __int64 tearDown(void); - virtual __int64 getMaxUseDuration(__int64 const*) const; - virtual __int64 getMaxUseDuration(C_ItemStack const*) const; - + virtual __int64 destructor(); // 0x0 + virtual __int64 initServer(int &); // 0x1 + virtual __int64 tearDown(void); // 0x2 + virtual __int64 getMaxUseDuration(__int64 const *) const; // 0x3 + virtual __int64 getMaxUseDuration(C_ItemStack const *); // 0x4 public: - virtual bool isExperimental(__int64 const*) const; - virtual bool returnFalse(); - virtual void setMaxStackSize(unsigned char); - virtual void setCategory(int); - virtual void setStackedByData(bool); - virtual void setMaxDamage(int); - virtual void setHandEquipped(void); - virtual void setUseAnimation(int); - virtual void setMaxUseDuration(int); - virtual void setRequiresWorldBuilder(bool); - virtual void setExplodable(bool); - virtual void setFireResistant(bool); - virtual void setIsGlint(bool); - virtual void setShouldDespawn(bool); - + virtual bool isMusicDisk(void); // 0x5 private: - virtual __int64 getC_BlockShape(void) const; - -public: - virtual bool canBeDepleted(void) const; - virtual bool canDestroySpecial(C_Block const&) const; - + virtual __int64 executeEvent(C_ItemStack &, std::string, char const &, int &); // 0x6 + virtual __int64 isComponentBased(void); // 0x7 +public: + virtual bool isArmor(void); // 0x8 + virtual bool isBlockPlanterItem(void); // 0x9 + virtual bool isBucket(void); // 0xA + virtual bool isCamera(void); // 0xB + virtual bool isCandle(void); // 0xC + virtual bool isDamageable(void); // 0xD + virtual bool isDyeable(void); // 0xE + virtual bool isDye(void); // 0xF private: - virtual __int64 get__int64DataForAuxValue(int) const; - -public: - virtual bool isStackedByData(void) const; - -public: - virtual __int64 getMaxDamage(void) const; - virtual int getAttackDamage(void) const; - + virtual __int64 getItemColor(void); // 0x10 public: - virtual bool isHandEquipped(void) const; - virtual bool isArmor(void) const; - virtual bool isDye(void) const; - virtual bool isFertilizer(int) const; - virtual bool isGlint(C_ItemStack const&) const; - virtual bool isThrowable(void) const; - virtual bool isPattern(void) const; - + virtual bool isFertilizer(void); // 0x11 + virtual bool isFood(void); // 0x12 + virtual bool isThrowable(void); // 0x13 + virtual bool isUseable(void); // 0x14 private: - virtual __int64 showsDurabilityInCreative(void) const; - -public: - virtual bool isWearableThroughLootTable(C_ItemStack const&) const; - virtual bool canDestroyInCreative(void) const; - virtual bool isDestructive(int) const; - virtual bool isLiquidClipItem(int) const; - + virtual __int64 getCamera(void); // 0x15 + virtual __int64 getFood(void); // 0x16 + virtual __int64 getFuel(void); // 0x17 +public: + virtual __int64 setMaxStackSize(int); // 0x18 + virtual __int64 setStackedByData(bool); // 0x19 + virtual __int64 setMaxDamage(int); // 0x1A + virtual __int64 setHandEquipped(void); // 0x1B + virtual __int64 setUseAnimation(int); // 0x1C + virtual __int64 setMaxUseDuration(int); // 0x1D + virtual __int64 setRequiresWorldBuilder(bool); // 0x1E + virtual __int64 setExplodable(bool); // 0x1F + virtual __int64 setFireResistant(bool); // 0x20 + virtual __int64 setIsGlint(bool); // 0x21 + virtual __int64 setShouldDespawn(bool); // 0x22 private: - virtual bool requiresInteract(); - virtual __int64 appendFormattedHovertext(C_ItemStack const&, __int64&, std::string&, bool) const; - + virtual __int64 getC_BlockShape(void) const; // 0x23 public: - virtual bool isValidRepairItem(C_ItemStack const&, C_ItemStack const&) const; - -public: - virtual __int64 getEnchantSlot(void) const; - virtual __int64 getEnchantValue(void) const; - virtual int getArmorValue(void) const; - + virtual bool canBeDepleted(void) const; // 0x24 + virtual bool canDestroySpecial(C_Block const &) const; // 0x25 +private: + virtual __int64 getLevelDataForAuxValue(int); // 0x26 +public: + virtual bool isStackedByData(void); // 0x27 + virtual __int64 getMaxDamage(void); // 0x28 + virtual __int64 getAttackDamage(void); // 0x29 + virtual bool isHandEquipped(void); // 0x2A + virtual bool isGlint(C_ItemStack const &); // 0x2B + virtual bool isPattern(void); // 0x2C +private: + virtual __int64 getPatternIndex(void); // 0x2D public: - virtual bool isComplex(void) const; - virtual bool isValidAuxValue(int) const; - + virtual bool showsDurabilityInCreative(void); // 0x2E + virtual bool isWearableThroughLootTable(CompoundTag const *); // 0x2F + virtual bool canDestroyInCreative(void); // 0x30 + virtual bool isDestructive(int); // 0x31 +private: + virtual bool isLiquidClipItem(int); // 0x32 + virtual bool shouldInteractionWithBlockBypassLiquid(C_Block const &); // 0x33 + virtual bool requiresInteract(void); // 0x34 + virtual __int64 appendFormattedHovertext(C_ItemStack const &, __int64 &, std::string &, bool) const; // 0x35 public: - virtual __int64 getDamageChance(int) const; - virtual __int64 uniqueAuxValues(void) const; - + virtual bool isValidRepairItem(C_ItemStack const &, C_ItemStack const &) const; // 0x36 public: - virtual bool isMultiColorTinted(C_ItemStack const&) const; - + virtual __int64 getEnchantSlot(void); // 0x37 + virtual __int64 getEnchantValue(void); // 0x38 + virtual __int64 getArmorValue(void); // 0x39 private: - virtual __int64 getColor(C_ItemStack const&) const; - virtual __int64 getBaseColor(C_ItemStack const&) const; - virtual __int64 getSecondaryColor(C_ItemStack const&) const; - virtual __int64 saveAdditionalData(C_ItemStack const&, __int64&) const; - virtual __int64 readAdditionalData(C_ItemStack&, __int64 const&)const; - - virtual bool isTintable(void)const; - virtual __int64 buildIdAux(short, const CompoundTag*); - virtual __int64 buildDescriptor(short, const CompoundTag*); - virtual __int64 use(C_ItemStack&, C_Entity&) const; - virtual __int64 dispense(C_BlockSource&, __int64&, int, vec3_t const&, unsigned char) const; - virtual __int64 useTimeDepleted(C_ItemStack&, __int64*, C_Entity*) const; - virtual __int64 releaseUsing(C_ItemStack&, C_Entity*, int) const; - virtual __int64 getDestroySpeed(C_ItemStack const&, C_Block const&) const; - virtual __int64 hurtEnemy(__int64&, __int64*, __int64*) const; - virtual __int64 hurtEnemy(C_ItemStack&, __int64*, __int64*) const; - virtual __int64 mineC_Block(__int64&, C_Block const&, int, int, int, C_Entity*) const; - virtual __int64 mineC_Block(C_ItemStack&, C_Block const&, int, int, int, C_Entity*) const; - virtual __int64 buildDescriptionId(C_ItemStack const&) const; - virtual __int64 buildEffectDescriptionName(C_ItemStack const&) const; - virtual __int64 buildCategoryDescriptionName(C_ItemStack const&) const; - virtual __int64 readUserData(C_ItemStack&, __int64&, __int64&) const; - virtual __int64 writeUserData(C_ItemStack const&, __int64&) const; - + virtual bool isComplex(void); // 0x3A + virtual bool isValidAuxValue(int); // 0x3B public: - virtual int getMaxStackSize(void* itemDescriptor) const; - + virtual __int64 getDamageChance(int); // 0x3C + virtual __int64 getViewDamping(void); // 0x3D + virtual __int64 uniqueAuxValues(void); // 0x3E private: - virtual __int64 inventoryTick(C_ItemStack&, __int64&, C_Entity&, int, bool) const; - //virtual __int64 refreshedInContainer(C_ItemStack&, __int64&)const; - virtual __int64 refreshedInContainer(__int64&, __int64&) const; - virtual __int64 getCooldownType(void) const; - virtual __int64 getCooldownTime(void) const; - virtual __int64 fixupOnLoad(__int64&) const; - virtual __int64 fixupOnLoad(C_ItemStack&) const; - //virtual __int64 getDamageValue(C_ItemStack const&) const; - virtual __int64 getDamageValue(__int64 const&) const; - + virtual __int64 isActorPlacerItem(void); // 0x3F public: - virtual void setDamageValue(C_ItemStack&, short) const; - //virtual void setDamageValue(__int64&, short) const; - + virtual bool isMultiColorTinted(C_ItemStack const &) const; // 0x40 private: - virtual __int64 getInHandUpdateType(C_Entity const&, __int64 const&, __int64 const&, bool, bool) const; - virtual __int64 getInHandUpdateType(C_Entity const&, C_ItemStack const&, C_ItemStack const&, bool, bool) const; - + virtual __int64 getColor(CompoundTag const *, C_ItemStack const &); // 0x41 + virtual __int64 hasCustomColor(C_ItemStack const &); // 0x42 + virtual __int64 hasCustomColor(CompoundTag const *); // 0x43 + virtual __int64 clearColor(C_ItemStack &); // 0x44 + virtual __int64 clearColor(CompoundTag *); // 0x45 + virtual __int64 setColor(C_ItemStack &, int const &); // 0x46 + virtual __int64 getBaseColor(C_ItemStack const &); // 0x47 + virtual __int64 getSecondaryColor(C_ItemStack const &); // 0x48 + virtual __int64 getActorIdentifier(C_ItemStack const &); // 0x49 + virtual __int64 saveAdditionalData(C_ItemStack const &, CompoundTag &); // 0x4A + virtual __int64 readAdditionalData(C_ItemStack &, CompoundTag const &); // 0x4B + virtual __int64 buildIdAux(short, const CompoundTag *); // 0x4C + virtual __int64 use(C_ItemStack &, C_Entity &); // 0x4D + virtual __int64 dispense(C_Block &, __int64 &, int, vec3_t const &, char); // 0x4E + virtual __int64 useTimeDepleted(C_ItemStack &, __int64 *, C_Entity *); // 0x4F + virtual __int64 releaseUsing(C_ItemStack &, C_Entity *, int); // 0x50 + virtual __int64 getDestroySpeed(C_ItemStack const &, C_Block const &); // 0x51 + virtual __int64 hurtActor(C_ItemStack &, C_Entity &, C_Entity &); // 0x52 + virtual __int64 hitActor(C_ItemStack &, C_Entity &, C_Entity &); // 0x53 + virtual __int64 hitBlock(C_ItemStack &, C_Block const &, vec3_t const &, C_Entity &); // 0x54 + virtual __int64 mineBlock(__int64 &&, C_Block const &, int, int, int, C_Entity *); // 0x55 + virtual __int64 mineBlock(C_ItemStack &, C_Block const &, int, int, int, C_Entity *); // 0x56 + virtual __int64 buildDescriptionName(C_ItemStack const &); // 0x57 + virtual __int64 buildDescriptionId(C_ItemStack const &) const; // 0x58 + virtual __int64 buildEffectDescriptionName(C_ItemStack const &); // 0x59 + virtual __int64 buildCategoryDescriptionName(void); // 0x5A + virtual __int64 readUserData(C_ItemStack &, __int64 &, __int64 &) const; // 0x5B + virtual __int64 writeUserData(C_ItemStack const &, __int64 &) const; // 0x5C +public: + virtual int getMaxStackSize(void *itemDescriptor) const; // 0x5D +private: + virtual __int64 inventoryTick(C_ItemStack &, __int64 &, C_Entity &, int, bool) const; // 0x5E + virtual __int64 refreshedInContainer(C_ItemStack &, __int64 &) const; // 0x5F + virtual __int64 getCooldownType(void); // 0x60 + virtual __int64 getCooldownTime(void); // 0x61 + virtual __int64 fixupCommon(C_ItemStack &); // 0x62 + virtual __int64 fixupCommon(C_ItemStack &, __int64 &&); // 0x63 + virtual __int64 getDamageValue(C_ItemStack const &) const; // 0x64 +public: + virtual __int64 setDamageValue(C_ItemStack &, short); // 0x65 +private: + virtual __int64 getInHandUpdateType(C_Entity const &, __int64 const &, __int64 const &, bool, bool) const; // 0x66 + virtual __int64 getInHandUpdateType(C_Entity const &, C_ItemStack const &, C_ItemStack const &, bool, bool) const; // 0x67 + virtual __int64 validFishInteraction(int); // 0x68 public: - //virtual bool isSameItem(__int64 const&, __int64 const&) const; - virtual bool isSameItem(C_ItemStack const&, C_ItemStack const&) const; - + virtual bool isSameItem(C_ItemStack const &, C_ItemStack const &) const; // 0x69 private: - virtual __int64 getInteractText(C_Entity const&) const; - virtual __int64 getAnimationFrameFor(__int64*, bool, C_ItemStack const*, bool) const; - + virtual __int64 initClient(__int64 &); // 0x6A + virtual __int64 getInteractText(C_Entity const &); // 0x6B + virtual __int64 getAnimationFrameFor(C_Entity *, bool, C_ItemStack const *, bool); // 0x6C public: - virtual bool isEmissive(int) const; - + virtual bool isEmissive(int); // 0x6D + virtual __int64 getLightEmission(int); // 0x6E private: - virtual __int64 getIcon(int, int, bool) const; - virtual __int64 getIconYOffset(void) const; - + virtual __int64 getIcon(int, int, bool) const; // 0x6F + virtual __int64 getIconYOffset(void) const; // 0x70 public: - virtual void setIcon(std::string const&, int); - virtual void setIcon(__int64 const&); - virtual void setIconAtlas(__int64 const&); - virtual bool canBeCharged(void) const; - + virtual void setIcon(std::string const &, int); // 0x71 + virtual void setIcon(__int64 const &); // 0x72 + virtual void setIconAtlas(__int64 const &); // 0x73 + virtual bool canBeCharged(void) const; // 0x74 private: - virtual __int64 playSoundIncrementally(__int64 const&, __int64&) const; - virtual __int64 playSoundIncrementally(C_ItemStack const&, __int64&) const; - virtual __int64 getAuxValuesDescription(void) const; - virtual __int64 _checkUseOnPermissions(C_Entity&, __int64&, unsigned char const&, vec3_ti const&) const; - virtual __int64 _checkUseOnPermissions(C_Entity&, C_ItemStack&, unsigned char const&, vec3_ti const&) const; - virtual __int64 _calculatePlacePos(__int64&, C_Entity&, unsigned char&, vec3_ti&) const; - virtual __int64 _calculatePlacePos(C_ItemStack&, C_Entity&, unsigned char&, vec3_ti&) const; - virtual __int64 _useOn(__int64&, C_Entity&, vec3_ti, unsigned char, float, float, float) const; - virtual __int64 _useOn(C_ItemStack&, C_Entity&, vec3_ti, unsigned char, float, float, float) const; + virtual __int64 playSoundIncrementally(__int64 const &, __int64 &) const; // 0x75 + virtual __int64 playSoundIncrementally(C_ItemStack const &, __int64 &) const; // 0x76 + virtual __int64 getFurnaceBurnIntervalMultipler(C_ItemStack const &); // 0x77 + virtual __int64 getFurnaceXPmultiplier(C_ItemStack const &); // 0x78 + virtual __int64 getAuxValuesDescription(void); // 0x79 + virtual __int64 _checkUseOnPermissions(C_Entity &, C_ItemStack &, unsigned char const &, vec3_ti const &) const; // 0x7A + virtual __int64 _calculatePlacePos(C_ItemStack &, C_Entity &, unsigned char &, vec3_ti &) const; // 0x7B public: bool isTool(void) { @@ -238,25 +236,6 @@ class C_Item { if (itemId == 259) return true; // Flint n Steel return false; } - bool isFood(void) { - if (itemId == 322 || itemId == 466) return true; // Golden Apple - if (itemId == 260) return true; // Apple - if (itemId == 282) return true; // Mushroom Stew - if (itemId == 297) return true; // Bread - if (itemId == 319 || itemId == 320) return true; // Porkchop - if (itemId == 349 || itemId == 350 || itemId == 460 || itemId == 461 || itemId == 462 || itemId == 463) return true; // Fish - if (itemId == 357) return true; // Cookie - if (itemId == 360) return true; // Melon - if (itemId == 363 || itemId == 364) return true; // Beef - if (itemId == 365 || itemId == 366) return true; // Chicken - if (itemId == 391) return true; // Carrot - if (itemId == 392 || itemId == 393) return true; // Potato - if (itemId == 400) return true; // Pumpkin Pie - if (itemId == 411 || itemId == 412 || itemId == 413) return true; // Rabbit thing - if (itemId == 423 || itemId == 424) return true; // Mutton - if (itemId == 450) return true; - return false; - } bool isWeapon(void) { if (itemId == 268) return true; //Wooden Sword if (itemId == 272) return true; //Stone Sword diff --git a/SDK/CLoopbackPacketSender.h b/SDK/CLoopbackPacketSender.h index 92caa710..d203ede9 100644 --- a/SDK/CLoopbackPacketSender.h +++ b/SDK/CLoopbackPacketSender.h @@ -5,9 +5,11 @@ class C_LoopbackPacketSender { public: virtual ~C_LoopbackPacketSender(); + //Duplicate contructor virtual __int64 send(C_Packet* packet); virtual __int64 sendToServer(C_Packet* packet); virtual __int64 sendToClient(const void* networkIdentifier, const C_Packet* packet, int a4); + virtual __int64 sendToClients(const void* networkIdentifier, const C_Packet* packet); virtual __int64 sendBroadcast(const C_Packet* packet); virtual __int64 sendBroadcast(const void* networkIdentifier, int a3, const C_Packet* packet); virtual __int64 flush(void* networkIdentifier, int a3); From 09f28870b30b4264fc76cb4c8a149bbd3a0e01a3 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 27 Aug 2021 09:29:30 -0400 Subject: [PATCH 386/419] Update Colors in NameTags an ClickGui-Settings (#4469) --- Horion/DrawUtils.cpp | 2 +- Horion/ImmediateGui.cpp | 2 +- Horion/Menu/ClickGui.cpp | 12 ++++++------ SDK/CEntity.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Horion/DrawUtils.cpp b/Horion/DrawUtils.cpp index 07690442..d7b0af05 100644 --- a/Horion/DrawUtils.cpp +++ b/Horion/DrawUtils.cpp @@ -373,7 +373,7 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo static auto nametagsMod = moduleMgr->getModule(); fillRectangle(rectPos, MC_Color(12, 12, 12), nametagsMod->opacity); if (nametagsMod->underline) { - fillRectangle(subRectPos, MC_Color(30, 110, 20), 0.9f); + fillRectangle(subRectPos, MC_Color(85, 85, 85), 0.9f); } drawText(textPos, &text, MC_Color(255, 255, 255), textSize); diff --git a/Horion/ImmediateGui.cpp b/Horion/ImmediateGui.cpp index 7165e39f..c0192b55 100644 --- a/Horion/ImmediateGui.cpp +++ b/Horion/ImmediateGui.cpp @@ -44,7 +44,7 @@ void ButtonInfo::draw(vec2_t mousePos, const char* label) { DrawUtils::drawText(textPos, &str, MC_Color()); if (isInSelectableSurface(mousePos)) { // Mouse hovering over us - DrawUtils::fillRectangle(surface, MC_Color(28, 50, 77), 1); + DrawUtils::fillRectangle(surface, MC_Color(85, 85, 85), 1); this->canClickB = true; } else { DrawUtils::fillRectangle(surface, MC_Color(12, 12, 12), 1); diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 3fcef6bf..2578fd9c 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -45,10 +45,10 @@ static const MC_Color moduleColor = MC_Color(0x12, 0x12, 0x12); // background static const MC_Color selectedModuleColor = moduleColor.lerp(whiteColor, 0.08f); // 30, 110, 200 static const MC_Color enabledModuleColor = moduleColor.lerp(whiteColor, 0.04f); static const MC_Color brightModuleBlendColor = moduleColor.lerp(whiteColor, 0.2f); // tooltip border & category divider -static const MC_Color selectedSettingColor1 = MC_Color(20, 100, 195); -static const MC_Color selectedSettingColor2 = MC_Color(40, 120, 205); -static const MC_Color SettingColor1 = MC_Color(10, 25, 45); -static const MC_Color SettingColor2 = MC_Color(20, 35, 55); +static const MC_Color selectedSettingColor1 = MC_Color(85, 85, 85); +static const MC_Color selectedSettingColor2 = MC_Color(85, 85, 85); +static const MC_Color SettingColor1 = MC_Color(12, 12, 12); +static const MC_Color SettingColor2 = MC_Color(12, 12, 12); float currentYOffset = 0; float currentXOffset = 0; @@ -335,7 +335,7 @@ void ClickGui::renderCategory(Category category) { DrawUtils::drawRectangle(boxPos, whiteColor, isFocused ? 1 : 0.8f, 0.5f); if (setting->value->_bool) { - DrawUtils::setColor(28, 107, 201, 1); + DrawUtils::setColor(85, 85, 85, 1); boxPos.x += 1; boxPos.y += 1; boxPos.z -= 1; @@ -776,7 +776,7 @@ void ClickGui::render() { 0, g_Data.getClientInstance()->getGuiData()->widthGame, g_Data.getClientInstance()->getGuiData()->heightGame), - MC_Color(33, 34, 48), 0.2f); + MC_Color(12, 12, 12), 0.2f); } // Render all categorys diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 0eec807b..835a6817 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -667,7 +667,7 @@ class C_Entity { virtual bool canExistWhenDisallowMob(void) const; private: - virtual void unknown(void) const; + virtual __int64 useNewAi(void); virtual __int64 ascendLadder(void); virtual __int64 ascendBlockByJumping(void); // 0x161 virtual __int64 descendBlockByCrouching(void); // 0x162 @@ -764,8 +764,8 @@ class C_Player : public C_Entity { private: virtual __int64 checkMovementStats(vec3_t const &); - virtual __int64 unknown20(void) const; - virtual __int64 unknown21(void) const; + virtual __int64 getCurrentStructureFeature(void); + virtual __int64 isAutoJumpEnabled(void); virtual __int64 respawn(void); virtual __int64 resetRot(void); virtual __int64 resetPos(bool); From 86dbcbe733485f9717cfac57660e806084870938 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 27 Aug 2021 09:30:13 -0400 Subject: [PATCH 387/419] Fix Timer and Packet structures (#4471) * Update CItem.h * Update CLoopbackPacketSender.h * Update packet and timer offsets --- Horion/Module/Modules/Spammer.h | 2 +- SDK/CClientInstance.h | 2 +- SDK/CPacket.h | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Horion/Module/Modules/Spammer.h b/Horion/Module/Modules/Spammer.h index b731a0cd..3ec82a53 100644 --- a/Horion/Module/Modules/Spammer.h +++ b/Horion/Module/Modules/Spammer.h @@ -6,7 +6,7 @@ class Spammer : public IModule { int Odelay = 0; bool bypass = true; int delay = 2; - std::string message = "Horion - the best minecraft bedrock utility mod - horionbeta.club"; + std::string message = "Horion - the best minecraft bedrock utility mod - horion.download"; public: Spammer(); diff --git a/SDK/CClientInstance.h b/SDK/CClientInstance.h index 65329f22..dc7cdcc0 100644 --- a/SDK/CClientInstance.h +++ b/SDK/CClientInstance.h @@ -8,7 +8,7 @@ class Minecraft { private: - char pad_0x0000[0xB0]; //0x0000 + char pad_0x0000[0xD0]; //0x0000 public: float* timer; //0x00B0 }; diff --git a/SDK/CPacket.h b/SDK/CPacket.h index cf3521a6..41ee35ef 100644 --- a/SDK/CPacket.h +++ b/SDK/CPacket.h @@ -63,7 +63,7 @@ class PlayerAuthInputPacket : public C_Packet { class C_PlayerActionPacket : public C_Packet { public: C_PlayerActionPacket(); - char pad_0x8[0x20]; //0x8 + char pad_0x8[0x28]; //0x8 vec3_ti blockPosition; // 0x28 int face; // 0x34 int action; // 0x38 @@ -77,7 +77,7 @@ class C_MobEquipmentPacket : public C_Packet { C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& item, int hotbarSlot, int inventorySlot); private: - char pad_0x8[0x20]; //0x0 + char pad_0x8[0x28]; //0x0 public: __int64 entityRuntimeId; //0x28 C_ItemStack item; //0x30 @@ -100,7 +100,7 @@ class C_InventoryTransactionPacket : public C_Packet { } private: - char pad_0x8[0x20]; //0x8 + char pad_0x8[0x28]; //0x8 public: int unknown = 0;//0x28 __int64* unknownStart = 0; //0x30 @@ -114,7 +114,7 @@ class C_TextPacket : public C_Packet { public: C_TextPacket(); - unsigned char gap0[0x20]; + unsigned char gap0[0x28]; unsigned __int8 messageType; // 0x28 unsigned char gap[7]; @@ -138,7 +138,7 @@ __declspec(align(8)) class C_MovePlayerPacket : public C_Packet { //uintptr_t** vTable; // 0x0 private: - char filler[0x20]; // 0x8 + char filler[0x28]; // 0x8 public: __int64 entityRuntimeID; //0x28 vec3_t Position; //0x30 From 0718e27cd072b3767269b96efe44641fca65bc82 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 27 Aug 2021 20:45:30 -0400 Subject: [PATCH 388/419] =?UTF-8?q?Fix=20Velocity=20Signature=20?= =?UTF-8?q?=F0=9F=98=8E=20(#4478)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Memory/Hooks.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3fe6fe52..38f58608 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -951,10 +951,8 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) { static auto noKnockbackmod = moduleMgr->getModule(); if (noKnockbackmod->isEnabled()) { static void* networkSender = nullptr; - - if (!networkSender) { - networkSender = reinterpret_cast(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76")); - } + if (!networkSender) + networkSender = reinterpret_cast(9 + FindSignature("48 8B CB FF ?? ?? ?? ?? 00 C6 47 ?? 01 48 8B 5C 24")); if (networkSender == _ReturnAddress()) { motVec = _this->velocity.lerp(motVec, noKnockbackmod->xModifier, noKnockbackmod->yModifier, noKnockbackmod->xModifier); From 49b14c7c33a2d372e7ee8962a888434bb956be1b Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 27 Aug 2021 20:46:45 -0400 Subject: [PATCH 389/419] Fix Inventory Cleaner, Update ContainerScreenController vtable (#4473) --- SDK/CInventory.cpp | 4 ++-- SDK/CInventory.h | 53 +++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index c3c6cb55..fe37cce2 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -4,7 +4,7 @@ void C_Inventory::dropSlot(int slot) { // FillingContainer::dropSlot using drop_t = void(__fastcall*)(C_Inventory*, int, char); - static drop_t func = reinterpret_cast(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 55 56 57 41 54 41 55 41 56 41 57 48")); + static drop_t func = reinterpret_cast(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 48 89 5C 24 ?? 55")); if (func != 0) func(this, slot, 0); } @@ -27,7 +27,7 @@ bool C_Inventory::isFull() { void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); - static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8")); + static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 07 4D 8B F9 4D 8B E8")); TextHolder txt = TextHolder(name); diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 9d1e0c3f..1727bc70 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -75,17 +75,16 @@ class C_PlayerInventoryProxy { }; class C_ContainerScreenController { -public: - void handleAutoPlace(uintptr_t a1, std::string name, int slot); - private: virtual __int64 destructor(); virtual __int64 tick(void); virtual __int64 handleEvent(__int64&); - virtual __int64 sub_140321330(void) const; + virtual __int64 getRoute(void); + virtual __int64 setScreenState(__int64, std::string const&); virtual __int64 onOpen(void); virtual __int64 onTerminate(void); virtual __int64 onInit(void); + virtual __int64 onDelete(void); public: virtual bool canExit(void); @@ -95,6 +94,8 @@ class C_ContainerScreenController { virtual __int64 areControllerTabsEnabled(void); virtual __int64 onCreation(void); virtual __int64 logCreationTime(std::string const&, double, double, unsigned char); + virtual __int64 unknown1(); + virtual __int64 unknown2(); public: virtual __int64 onLeave(void); @@ -108,32 +109,28 @@ class C_ContainerScreenController { virtual __int64 onDictationEvent(std::string const&); public: - virtual void setAssociatedvec3_ti(vec3_ti const&); + virtual void setAssociatedBlockPos(vec3_ti const&); virtual void setAssociatedEntityUniqueID(__int64); virtual void setSuspendInput(bool); private: - virtual __int64 getCallbackInterval(void) const; - -public: - virtual void setViewCommand(__int64); - -private: + virtual __int64 getCallbackInterval(void); virtual __int64 onRender(void); virtual __int64 addStaticScreenVars(__int64&); - virtual __int64 getAdditionalScreenInfo(void) const; - virtual __int64 getTelemetryOverride(void) const; + virtual __int64 getAdditionalScreenInfo(void); + virtual __int64 getTelemetryOverride(void); virtual __int64 addEventProperties(__int64) const; - virtual __int64 getSceneType(void) const; - virtual __int64 getScreenVersion(void) const; - virtual __int64 screenHandlesGamepadMenuButton(void) const; + virtual __int64 getSceneType(void); + virtual __int64 getScreenVersion(void); + virtual __int64 screenHandlesGamepadMenuButton(void); virtual __int64 getProxy(void); virtual __int64 onEntered(void); - virtual __int64 getNameId(std::string const&) const; - virtual __int64 _isStillValid(void) const; - virtual __int64 _getGamepadHelperVisible(void) const; - virtual __int64 _getMixedHelperVisible(void) const; - virtual __int64 _getKeyboardHelperVisible(void) const; + virtual __int64 getNameId(std::string const&); + virtual __int64 _doesScreenHaveExitBehavior(void); + virtual __int64 _isStillValid(void); + virtual __int64 _getGamepadHelperVisible(void); + virtual __int64 _getMixedHelperVisible(void); + virtual __int64 _getKeyboardHelperVisible(void); virtual __int64 _getButtonADescription(void); virtual __int64 _getButtonBDescription(void); virtual __int64 _getButtonXDescription(void); @@ -144,18 +141,22 @@ class C_ContainerScreenController { virtual __int64 _handlePlaceAll(std::string const&, int); virtual __int64 _handlePlaceOne(std::string const&, int); virtual __int64 _handleSelectSlot(std::string const&, int); - virtual __int64 _getSelectedItem(void) const; + virtual __int64 _getSelectedSlotInfo(void); virtual C_ItemStack* _getItemStack(TextHolder, int) const; private: - virtual __int64 _getVisualItemStack(std::string const&, int) const; + virtual __int64 _getVisualItemStack(std::string const&, int); + virtual __int64 _getTakeableItemStackBase(std::string const&, int); virtual __int64 _onContainerSlotHovered(std::string const&, int); virtual __int64 _onContainerSlotSelected(std::string const&, int); virtual __int64 _onContainerSlotPressed(std::string const&, int); - virtual __int64 _shouldSwap(std::string const&, int, std::string const&, int) const; - virtual __int64 _getCollectionName(__int64*) const; - virtual __int64 _canSplit(std::string const&, int) const; + virtual __int64 _shouldSwap(std::string const&, int, std::string const&, int); + virtual __int64 _getCollectionName(__int64*); + virtual __int64 _canSplit(std::string const&, int); virtual __int64 _sendFlyingItem(__int64 const&, std::string const&, int, std::string const&, int); + +public: + void handleAutoPlace(uintptr_t a1, std::string name, int slot); }; class C_CraftingScreenController : public C_ContainerScreenController { From fc112c552bc2ed23ac5d88b119bec5cac09c6f3e Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 27 Aug 2021 20:47:48 -0400 Subject: [PATCH 390/419] Speed is better (#4475) --- Horion/Module/Modules/Speed.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Horion/Module/Modules/Speed.cpp b/Horion/Module/Modules/Speed.cpp index 6c129a57..29e51c80 100644 --- a/Horion/Module/Modules/Speed.cpp +++ b/Horion/Module/Modules/Speed.cpp @@ -16,12 +16,6 @@ void Speed::onTick(C_GameMode* gm) { float* speedAdr = reinterpret_cast(g_Data.getLocalPlayer()->getSpeed() + 0x84); *speedAdr = speed; - - if (localPlayer->onGround == true && GameData::canUseMoveKeys() && localPlayer->velocity.squaredxzlen() > 0.001f) { - localPlayer->velocity.x *= 1.39f; - localPlayer->velocity.z *= 1.39f; - localPlayer->velocity.y = 0.035f; - } } void Speed::onEnable() { From c0dbcb8375bcd4c81dab484446450f3556b2fae9 Mon Sep 17 00:00:00 2001 From: weedelbhoy1 <57690131+weedelbhoy1@users.noreply.github.com> Date: Sat, 28 Aug 2021 01:54:33 +0100 Subject: [PATCH 391/419] fix Click Gui clicking issue, fix ClickTP and updated AntiBot to include 1.16-1.17 mobs (#4463) Co-authored-by: richard --- Horion/Menu/ClickGui.cpp | 2 ++ Horion/Module/Modules/Teleport.cpp | 5 +++-- Memory/Hooks.cpp | 4 ++-- SDK/CItem.h | 30 +++++++++++++++--------------- Utils/Target.cpp | 2 +- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Horion/Menu/ClickGui.cpp b/Horion/Menu/ClickGui.cpp index 2578fd9c..0b6ff988 100644 --- a/Horion/Menu/ClickGui.cpp +++ b/Horion/Menu/ClickGui.cpp @@ -800,6 +800,8 @@ void ClickGui::render() { void ClickGui::init() { initialised = true; } void ClickGui::onMouseClickUpdate(int key, bool isDown) { + static auto clickGuiMod = moduleMgr->getModule(); + if (clickGuiMod->isEnabled() && g_Data.isInGame()) switch (key) { case 1: // Left Click isLeftClickDown = isDown; diff --git a/Horion/Module/Modules/Teleport.cpp b/Horion/Module/Modules/Teleport.cpp index db6fbf8c..3eea8f65 100644 --- a/Horion/Module/Modules/Teleport.cpp +++ b/Horion/Module/Modules/Teleport.cpp @@ -35,8 +35,9 @@ void Teleport::onTick(C_GameMode* gm) { } if (!GameData::isRightClickDown()) hasClicked = false; - - if (shouldTP && gm->player->isSneaking()) { + + C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput(); + if (shouldTP && GameData::isKeyDown(*input->sneakKey)) { tpPos.y += (gm->player->getPos()->y - gm->player->getAABB()->lower.y) + 1; // eye height + 1 if (bypass) { /*int dist = (int)gm->player->getPos()->dist(tpPos); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 38f58608..8f09c3ce 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1140,12 +1140,12 @@ void Hooks::LoopbackPacketSender_sendToServer(C_LoopbackPacketSender* a, C_Packe moduleMgr->onSendPacket(packet); - if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { + /*if (strcmp(packet->getName()->getText(), "EmotePacket") == 0) { auto varInt = reinterpret_cast<__int64*>(reinterpret_cast<__int64>(packet) + 0x28); auto text = reinterpret_cast(reinterpret_cast<__int64>(packet) + 0x30); auto bet = reinterpret_cast(reinterpret_cast<__int64>(packet) + 0x50); logF("emote %llX %s %i", *varInt, text->getText(), *bet); - } + } fix emote crashing*/ oFunc(a, packet); } diff --git a/SDK/CItem.h b/SDK/CItem.h index d3e0b217..fbd92e27 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -232,23 +232,23 @@ class C_Item { public: bool isTool(void) { if (getAttackDamage() > 0) return true; // Does Attack Damage - if (itemId == 261 || itemId == 262) return true; // Bow - if (itemId == 259) return true; // Flint n Steel + if (itemId == 300 || itemId == 301) return true; // Bow + if (itemId == 299) return true; // Flint n Steel return false; } bool isWeapon(void) { - if (itemId == 268) return true; //Wooden Sword - if (itemId == 272) return true; //Stone Sword - if (itemId == 283) return true; //Gold Sword - if (itemId == 267) return true; //Iron Sword - if (itemId == 276) return true; //Diamond Sword - if (itemId == 743) return true; //Netherite Sword - if (itemId == 271) return true; //Wooden Axe - if (itemId == 275) return true; //Stone Axe - if (itemId == 286) return true; //Gold Axe - if (itemId == 258) return true; //Iron Axe - if (itemId == 279) return true; //Diamond Axe - if (itemId == 746) return true; //Netherite Axe + if (itemId == 308) return true; //Wooden Sword + if (itemId == 312) return true; //Stone Sword + if (itemId == 322) return true; //Gold Sword + if (itemId == 307) return true; //Iron Sword + if (itemId == 316) return true; //Diamond Sword + if (itemId == 602) return true; //Netherite Sword + if (itemId == 311) return true; //Wooden Axe + if (itemId == 315) return true; //Stone Axe + if (itemId == 325) return true; //Gold Axe + if (itemId == 298) return true; //Iron Axe + if (itemId == 319) return true; //Diamond Axe + if (itemId == 605) return true; //Netherite Axe return false; } bool isBlock(void) { @@ -382,4 +382,4 @@ class ItemRegistry { public: static C_Item*** getItemFromId(void* ptr, int itemId); static C_Item*** lookUpByName(void*, void*, TextHolder&); -}; \ No newline at end of file +}; diff --git a/Utils/Target.cpp b/Utils/Target.cpp index cf1a8ba8..ad0772a6 100644 --- a/Utils/Target.cpp +++ b/Utils/Target.cpp @@ -29,7 +29,7 @@ bool Target::isValidTarget(C_Entity* ent) { auto entityTypeId = ent->getEntityTypeId(); - if (antibot->isEntityIdCheckEnabled() && entityTypeId <= 122 && entityTypeId != 63) + if (antibot->isEntityIdCheckEnabled() && entityTypeId <= 130 && entityTypeId != 63) return false; if (entityTypeId == 63) { From 8df45a0b4976e12dc8a2ba197fc9ad18fb5362d6 Mon Sep 17 00:00:00 2001 From: H3 <67812277+HELLLO1073@users.noreply.github.com> Date: Sat, 28 Aug 2021 21:32:44 +1000 Subject: [PATCH 392/419] Better CommandBlockExploit (#4480) * MovingBlock * refactor Co-authored-by: richard --- .../Commands/CommandBlockExploitCommand.cpp | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 2979679d..ec2953fb 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -2,9 +2,8 @@ #include "../../../SDK/Tag.h" #include "../../Module/ModuleManager.h" -#include -CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", "") { +CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", " ") { registerAlias("cbe"); } @@ -13,20 +12,33 @@ CommandBlockExploitCommand::~CommandBlockExploitCommand() { bool CommandBlockExploitCommand::execute(std::vector* args) { assertTrue(args->size() > 2); + std::ostringstream os; - for (int i = 1; i < args->size(); i++) { - if (i > 1) + for (int i = 2; i < args->size(); i++) { + if (i > 2) os << " "; os << args->at(i); } - C_ItemStack* yot = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); - int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot(); std::string cmd = os.str(); - std::string tag = "{Count:1b,Damage:15s,Name:\"minecraft:beehive\",tag:{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}}"; - yot->fromTag(*Mojangson::parseTag(tag)); - g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, yot, nullptr, 1, 507, 99999)); - //g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot)); - g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot); - clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN); + + std::string type = args->at(1); + std::transform(type.begin(), type.end(), type.begin(), tolower); + + C_ItemStack* item; + if (type == "beehive" || type == "bh") { + item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:beehive",tag:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",Persistent:1b,Ticking:1b,TicksLeftToStay:1}}]}})"; + item->fromTag(*Mojangson::parseTag(tag)); + } + else if (type == "movingblock" || type == "mb") { + item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("movingblock")), 1, 0); + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingBlock",tag:{movingBlock:{name:"minecraft:leaves",states:{}}movingEntity:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",ExecuteOnFirstTick:1b,TickDelay:0,Ticking:1b,definitions:["+minecraft:boat"]}TicksLeftToStay:0}],ShouldSpawnBees:0b,id:"Beehive",isMovable:1b}ench:[{id:-1s,lvl:1s}],RepairCost:0,display:{Name:"",Lore:[")" + cmd + R"("]}}})"; + item->fromTag(*Mojangson::parseTag(tag)); + } + + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, item, nullptr, 1, 507, 99999)); + g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(item); + + clientMessageF("%sPlace the item down to execute the command!", GREEN); return true; } From f9c4edaec17213932c3d446d2f505920468661f5 Mon Sep 17 00:00:00 2001 From: weedelbhoy1 <57690131+weedelbhoy1@users.noreply.github.com> Date: Sun, 29 Aug 2021 17:34:50 +0100 Subject: [PATCH 393/419] Updated CBE (#4483) --- .../Commands/CommandBlockExploitCommand.cpp | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index ec2953fb..6e391986 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -3,7 +3,7 @@ #include "../../../SDK/Tag.h" #include "../../Module/ModuleManager.h" -CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", " ") { +CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", " ") { registerAlias("cbe"); } @@ -25,14 +25,34 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { std::transform(type.begin(), type.end(), type.begin(), tolower); C_ItemStack* item; + if (type == "beehive" || type == "bh") { item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); - std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:beehive",tag:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",Persistent:1b,Ticking:1b,TicksLeftToStay:1}}]}})"; + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:beehive",tag:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",Persistent:1b,Ticking:1b,TicksLeftToStay:0}}],ench:[{id:28s,lvl:1s}],display:{Lore:[")" + cmd + R"("],Name:"§g§lBeehive Command"}})"; item->fromTag(*Mojangson::parseTag(tag)); } + + else if (type == "beenest" || type == "bn") { + item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("movingblock")), 1, 0); + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:bee_nest",tag:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",Persistent:1b,Ticking:1b,TicksLeftToStay:0}}],ench:[{id:28s,lvl:1s}],display:{Lore:[")" + cmd + R"("],Name:"§g§lBeeNest Command"}})"; + item->fromTag(*Mojangson::parseTag(tag)); + } + else if (type == "movingblock" || type == "mb") { + item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("beehive")), 1, 0); + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingblock",tag:{movingEntity:{id:"Beehive",Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",Persistent:1b,Ticking:1b,TicksLeftToStay:0}}]},pistonPosX:0,movingBlock:{name:"minecraft:bee_nest"},pistonPosY:0,pistonPosZ:0,ench:[{id:28s,lvl:1s}],display:{Name:"§g§lMovingBlock BeeNest Command",Lore:[")" + cmd + R"("]}}})"; + item->fromTag(*Mojangson::parseTag(tag)); + } + + else if (type == "spoof" || type == "sp") { + item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("movingblock")), 1, 0); + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingblock",tag:{movingEntity:{id:"Beehive",Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",definitions:["+minecraft:bee"],identifier:"minecraft:command_block_minecart",Persistent:1b,Ticking:1b,TicksLeftToStay:1}}]},pistonPosX:0,movingBlock:{name:"minecraft:bee_nest"},pistonPosY:0,pistonPosZ:0,ench:[{id:28s,lvl:1s}],display:{Name:"§g§lSpoofed BeeNest Command",Lore:[")" + cmd + R"("]}}})"; + item->fromTag(*Mojangson::parseTag(tag)); + } + + else if (type == "invisible" || type == "invis") { item = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique().get(), std::make_unique().get(), TextHolder("movingblock")), 1, 0); - std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingBlock",tag:{movingBlock:{name:"minecraft:leaves",states:{}}movingEntity:{Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",ExecuteOnFirstTick:1b,TickDelay:0,Ticking:1b,definitions:["+minecraft:boat"]}TicksLeftToStay:0}],ShouldSpawnBees:0b,id:"Beehive",isMovable:1b}ench:[{id:-1s,lvl:1s}],RepairCost:0,display:{Name:"",Lore:[")" + cmd + R"("]}}})"; + std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingblock",tag:{movingEntity:{id:"Beehive",Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",definitions:["+minecraft:moving_block"],identifier:"minecraft:command_block_minecart",Persistent:1b,Ticking:1b,TicksLeftToStay:1}}]},pistonPosX:0,movingBlock:{name:"minecraft:air"},pistonPosY:0,pistonPosZ:0,ench:[{id:28s,lvl:1s}],display:{Name:"§g§lInvisible Beehive Command",Lore:[")" + cmd + R"("]}}})"; item->fromTag(*Mojangson::parseTag(tag)); } From 4012d554190e64cf031ced2632a4eac7ab16922c Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:35:15 -0400 Subject: [PATCH 394/419] Fix High Jump (#4486) --- Memory/Hooks.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 8f09c3ce..42c92410 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -64,6 +64,8 @@ void Hooks::Init() { g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder);*/ g_Hooks.Actor_swingHook = std::make_unique(localPlayerVtable[214], Hooks::Actor_swing); + + g_Hooks.JumpPowerHook = std::make_unique(localPlayerVtable[357], Hooks::JumpPower); } } @@ -245,8 +247,8 @@ void Hooks::Init() { g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); // Mob::_jumpFromGround - void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); - g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); + /*void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); + g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower);*/ void* onAppSuspended = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8B EC 48 83 EC ? 48 8B F1 E8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); From a5af93ec3e77d24aa37b3dafd2bb39bb2f4eab7a Mon Sep 17 00:00:00 2001 From: TheSynx <87203897+Synx173@users.noreply.github.com> Date: Sun, 29 Aug 2021 14:48:51 -0400 Subject: [PATCH 395/419] Fix rotation bug (#4489) --- SDK/CEntity.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 835a6817..ad12599a 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -34,7 +34,7 @@ class C_Entity { public: uintptr_t *ptrToPtrToEntList; //0x0008 private: - char pad_0010[0x130]; //0x0010 + char pad_0010[0x138]; //0x0010 public: union { struct { @@ -52,7 +52,7 @@ class C_Entity { }; private: - char pad_0100[0x10]; //0x0130 + char pad_0100[0x8]; //0x0130 public: vec3_t eyePos0; //0x0140 private: From 8d5389913a187f64493347c9ebf7a50bdae7e6df Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Sun, 29 Aug 2021 14:49:28 -0400 Subject: [PATCH 396/419] Make a few hooks use vtable and remove dx11 stuff (#4487) --- Horion.vcxproj | 4 - Memory/Hooks.cpp | 356 +---------- Memory/Hooks.h | 6 - include/d3dx11.h | 68 -- include/d3dx11async.h | 160 ----- include/d3dx11core.h | 135 ---- include/d3dx11effect.h | 1342 ---------------------------------------- 7 files changed, 21 insertions(+), 2050 deletions(-) delete mode 100644 include/d3dx11.h delete mode 100644 include/d3dx11async.h delete mode 100644 include/d3dx11core.h delete mode 100644 include/d3dx11effect.h diff --git a/Horion.vcxproj b/Horion.vcxproj index bbabbf8f..56bf0353 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -586,10 +586,6 @@ - - - - diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 42c92410..5a929b37 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -57,11 +57,15 @@ void Hooks::Init() { if (localPlayerVtable == 0x0 || sigOffset == 0x0) logF("C_LocalPlayer signature not working!!!"); else { - /*g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[65], Hooks::Actor_isInWater); + g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[196], Hooks::Actor_startSwimming); - g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); + g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[351], Hooks::Actor_ascendLadder); - g_Hooks.Actor_ascendLadderHook = std::make_unique(localPlayerVtable[333], Hooks::Actor_ascendLadder);*/ + g_Hooks.Actor_lerpMotionHook = std::make_unique(localPlayerVtable[40], Hooks::Actor_lerpMotion); + + g_Hooks.Mob__isImmobileHook = std::make_unique(localPlayerVtable[88], Hooks::Mob__isImmobile); + + g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[67], Hooks::Actor_isInWater); g_Hooks.Actor_swingHook = std::make_unique(localPlayerVtable[214], Hooks::Actor_swing); @@ -102,85 +106,25 @@ void Hooks::Init() { } } - // d3d11 - /*{ - /*const auto hModDXGI = GetModuleHandle(L"DXGI.dll"); - const auto hModD3D11 = GetModuleHandle(L"D3D11.dll"); + // Signatures + { + // vtables better than sigs - const auto hD3D11CreateDeviceAndSwapChain = static_cast(GetProcAddress(hModD3D11, "D3D11CreateDeviceAndSwapChain")); + /*void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); + g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); - const D3D_FEATURE_LEVEL featureLevelArray[3] = { - D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_11_0 - }; + void* ascendLadder = reinterpret_cast(FindSignature("C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81")); + g_Hooks.Actor_ascendLadderHook = std::make_unique(ascendLadder, Hooks::Actor_ascendLadder); - DXGI_SWAP_CHAIN_DESC sd; - { - ZeroMemory(&sd, sizeof(sd)); - sd.BufferCount = 2; - sd.BufferDesc.Width = 0; - sd.BufferDesc.Height = 0; - sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - sd.BufferDesc.RefreshRate.Numerator = 60; - sd.BufferDesc.RefreshRate.Denominator = 1; - sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; - sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - sd.OutputWindow = (HWND)0x780f84; // insert window found from process hacker here - sd.SampleDesc.Count = 1; - sd.SampleDesc.Quality = 0; - sd.Windowed = TRUE; - sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; - } + void* isInWater = reinterpret_cast(FindSignature("0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24")); + g_Hooks.Actor_isInWaterHook = std::make_unique(isInWater, Hooks::Actor_isInWater); - IDXGISwapChain* pSwapChain; - - const auto hr11 = static_cast(hD3D11CreateDeviceAndSwapChain)( - nullptr, - D3D_DRIVER_TYPE_HARDWARE, - nullptr, - 0, - featureLevelArray, - 1, - D3D11_SDK_VERSION, - &sd, - &pSwapChain, - 0, - 0, - 0); - - if (pSwapChain) { - logF("swap vtable: %llX", *pSwapChain); - pSwapChain->Release(); - }* - - uintptr_t sigOffset = FindSignature("48 8B 0D ?? ?? ?? ?? 48 8B 91 ?? ?? ?? ?? E8"); - if (sigOffset != 0x0) { - int startOffsetOffset = *reinterpret_cast((sigOffset + 3)); - uintptr_t startOffset = sigOffset + startOffsetOffset + /*length of instruction/ 7; - size_t secondOffset = (size_t) *reinterpret_cast((sigOffset + 10)); - auto swapChain = g_Data.getSlimMem()->ReadPtr<__int64>(startOffset, {0, secondOffset, 0x170}); - auto vtable = *reinterpret_cast(swapChain); - - //logF(" %llX",vtable[8]); - - g_Hooks.swapchain__presentHook = std::make_unique(vtable[8], Hooks::swapChain__present); - g_Hooks.swapchain__resizeBuffersHook = std::make_unique(vtable[13], Hooks::swapChain__ResizeBuffers); - } - }*/ + void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); + g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower); + + void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 E8 ? ? ? ? 84 C0 75 ? 48 8B 03 48 8B CB")); + g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile);*/ - // Signatures - { void* player_tickworld = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 0F 29 B4 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 48 89 55 ?? 48 8B F9")); g_Hooks.Player_tickWorldHook = std::make_unique(player_tickworld, Hooks::Player_tickWorld); @@ -197,7 +141,6 @@ void Hooks::Init() { void* render = reinterpret_cast(FindSignature("48 89 5C 24 18 56 57 41 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 41")); g_Hooks.UIScene_renderHook = std::make_unique(render, Hooks::UIScene_render); - void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); @@ -207,15 +150,6 @@ void Hooks::Init() { void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48")); g_Hooks.ChestBlockActor_tickHook = std::make_unique(chestTick, Hooks::ChestBlockActor_tick); - void* lerpFunc = reinterpret_cast(FindSignature("8B 02 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? 8B 42 ? 89 81 ? ? ? ? C3 CC CC CC CC CC 48 89 5C 24")); - g_Hooks.Actor_lerpMotionHook = std::make_unique(lerpFunc, Hooks::Actor_lerpMotion); - - void* ascendLadder = reinterpret_cast(FindSignature("C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81 ? ? ? ? ? ? ? ? C3 CC CC CC CC CC C7 81")); - g_Hooks.Actor_ascendLadderHook = std::make_unique(ascendLadder, Hooks::Actor_ascendLadder); - - void* isInWater = reinterpret_cast(FindSignature("0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 0F B6 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 6C 24")); - g_Hooks.Actor_isInWaterHook = std::make_unique(isInWater, Hooks::Actor_isInWater); - void* getGameEdition = reinterpret_cast(FindSignature("8B 91 ?? ?? ?? ?? 85 D2 74 1C 83 EA 01")); g_Hooks.AppPlatform_getGameEditionHook = std::make_unique(getGameEdition, Hooks::AppPlatform_getGameEdition); @@ -246,10 +180,6 @@ void Hooks::Init() { void* fullbright = reinterpret_cast(FindSignature("48 83 EC ?? 80 B9 ?? ?? ?? ?? ?? 48 8D 54 24 ?? 48 8B 01 74 35 41 B8 0D 01 00 00")); g_Hooks.GetGammaHook = std::make_unique(fullbright, Hooks::GetGamma); - // Mob::_jumpFromGround - /*void* jump = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 48 8B 19 48 8D")); - g_Hooks.JumpPowerHook = std::make_unique(jump, Hooks::JumpPower);*/ - void* onAppSuspended = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8B EC 48 83 EC ? 48 8B F1 E8")); g_Hooks.MinecraftGame_onAppSuspendedHook = std::make_unique(onAppSuspended, Hooks::MinecraftGame_onAppSuspended); @@ -279,9 +209,6 @@ void Hooks::Init() { void* localPlayerUpdateFromCam = reinterpret_cast(FindSignature("48 89 5C 24 10 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 80 ?? ?? ?? ?? ?? 00 48 8B FA 48 8B D9")); g_Hooks.LocalPlayer__updateFromCameraHook = std::make_unique(localPlayerUpdateFromCam, Hooks::LocalPlayer__updateFromCamera); - void* MobIsImmobile = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 E8 ? ? ? ? 84 C0 75 ? 48 8B 03 48 8B CB")); - g_Hooks.Mob__isImmobileHook = std::make_unique(MobIsImmobile, Hooks::Mob__isImmobile); - void* renderNameTags = reinterpret_cast(FindSignature("4C 8B DC 49 89 5B ? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 41 0F 29 73 ? 41 0F 29 7B ? 45 0F 29 43 ? 48 8B 05")); g_Hooks.LevelRendererPlayer__renderNameTagsHook = std::make_unique(renderNameTags, Hooks::LevelRendererPlayer__renderNameTags); @@ -1743,247 +1670,6 @@ __int64 Hooks::prepFeaturedServersFirstTime(__int64 a1, __int64 a2) { return ret; } -HRESULT Hooks::swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT flags) { - static auto func = g_Hooks.swapchain__presentHook->GetFastcall(); - -#if 0 - -#ifndef _D3DVECTOR - typedef struct _D3DVECTOR3 { - float x; - float y; - float z; - - _D3DVECTOR3(float x1, float y1, float z1) : x(x1), y(y1), z(z1) {} - _D3DVECTOR3() {} - } D3DVECTOR3; - - typedef struct _D3DVECTOR4 { - float x; - float y; - float z; - float w; - - _D3DVECTOR4(float x1, float y1, float z1, float w1) : x(x1), y(y1), z(z1), w(w1) {} - _D3DVECTOR4() {} - } D3DVECTOR4; -#endif - struct VertexType { - _D3DVECTOR4 position; - _D3DVECTOR4 color; - }; - - static bool init = false; - static ID3D11Device* device; - static ID3D11DeviceContext* context; - static ID3D11Buffer *vertexBuffer, *indexBuffer; - static ID3D11InputLayout* m_pInputLayout; - static ID3D11VertexShader* m_vertexShader; - static VertexType *vertices; - - if (!init) { - DXGI_SWAP_CHAIN_DESC desc; - chain->GetDesc(&desc); - - chain->GetDevice(__uuidof(ID3D11Device), (void**)&device); - - device->GetImmediateContext(&context); - - D3D11_BUFFER_DESC bufferDesc; - - D3D11_INPUT_ELEMENT_DESC lineRectLayout[] = - { - {"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, - {"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0} - }; - - bufferDesc.Usage = D3D11_USAGE_DYNAMIC; - bufferDesc.ByteWidth = 50 * sizeof(VertexType); - bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - bufferDesc.MiscFlags = 0; - - char* shader = - "struct VS_INPUT \ - { \ - float4 vPosition : POSITION; \ - float4 color : COLOR; \ - }; \ - \ - struct VS_OUTPUT { \ - float4 vPosition : SV_POSITION; \ - float4 vColor : COLOR; \ - }; \ - VS_OUTPUT VSMain(VS_INPUT Input) { \ - VS_OUTPUT Output; \ - \ - Output.vPosition = Input.vPosition;\ - Output.vColor = Input.color; \ - return Output; \ - } \ - "; - - UINT flags = D3DCOMPILE_ENABLE_STRICTNESS; - ID3DBlob* shaderBlob = nullptr; - ID3DBlob* errorBlob = nullptr; - auto res = D3DCompile(shader, strlen(shader), 0, 0, 0, "VSMain", "vs_4_0_level_9_1", flags, 0, &shaderBlob, &errorBlob); - logF("result: %llX", res); - if (!FAILED(res)) { - // Create the vertex shader from the buffer. - res = device->CreateVertexShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), NULL, &m_vertexShader); - logF("vresult: %llX", res); - if (!FAILED(res)) { - res = device->CreateInputLayout(lineRectLayout, 2, shaderBlob->GetBufferPointer(), - shaderBlob->GetBufferSize(), &m_pInputLayout); - logF("vresult3 : %llX", res); - } - } - - { - unsigned long* indices = new unsigned long[5]; - D3D11_BUFFER_DESC vertexBufferDesc, indexBufferDesc; - D3D11_SUBRESOURCE_DATA vertexData, indexData; - - //create the vertex array - vertices = new VertexType[3]; - - float left = 10 / (float)600, right = 500 / (float)60, top = 50 / (float)60, bottom = 500 / (float)60; - - //load the vertex array with data - vertices[0].position = D3DVECTOR4(left, top, 0, 1); - vertices[0].color = D3DVECTOR4(0.0f, 1.0f, 0.0f, 1.0f); - vertices[1].position = D3DVECTOR4(right, top, 0, 1); - vertices[1].color = D3DVECTOR4(0.0f, 1.0f, 0.0f, 1.0f); - vertices[2].position = D3DVECTOR4(right, bottom, 0, 1); - vertices[2].color = D3DVECTOR4(0.0f, 1.0f, 0.0f, 1.0f); - //create the index array - indices = new unsigned long[3]; - //load the index array with data - for (int i = 0; i < 3; i++) - indices[i] = i; - - HRESULT result; - - //set up the description of the dynamic vertex buffer - vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC; //enables recreation and movement of vertices - vertexBufferDesc.ByteWidth = sizeof(VertexType) * 3 ; - vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; //couples with dynamic - vertexBufferDesc.MiscFlags = 0; - vertexBufferDesc.StructureByteStride = 0; - //give the subresource structure a pointer to the vertex data - vertexData.pSysMem = vertices; - vertexData.SysMemPitch = 0; - vertexData.SysMemSlicePitch = 0; - - //now create the vertex buffer - result = device->CreateBuffer(&vertexBufferDesc, &vertexData, &vertexBuffer); - if (FAILED(result)) { - logF("CreateBuffer %llX", result); - } - - //set up the description of the static index buffer - indexBufferDesc.Usage = D3D11_USAGE_DEFAULT; - indexBufferDesc.ByteWidth = sizeof(unsigned long) * 3; - indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER; - indexBufferDesc.CPUAccessFlags = 0; - indexBufferDesc.MiscFlags = 0; - indexBufferDesc.StructureByteStride = 0; - //give the subresource structure a pointer to the index data - indexData.pSysMem = indices; - indexData.SysMemPitch = 0; - indexData.SysMemSlicePitch = 0; - - //create the index buffer - result = device->CreateBuffer(&indexBufferDesc, &indexData, &indexBuffer); - if (FAILED(result)) { - logF("CreateBuffer2 %llX", result); - } - } - - init = true; - } - - /* - - ImGui_ImplDX11_NewFrame(); - ImGui_ImplWin32_NewFrame(); - - ImGuiIO& io = ImGui::GetIO(); - C_GuiData* dat = g_Data.getClientInstance()->getGuiData(); - if (dat) { - io.DisplaySize = ImVec2(dat->windowSizeReal.x, dat->windowSizeReal.y); - } - - ImGui::NewFrame(); - - ImGui::Begin("bean"); - - ImGui::Text("Hello"); - ImGui::Button("World!"); - - ImGui::End(); - - ImGui::Begin("wat"); - - ImGui::Text("Hello"); - ImGui::Button("World!"); - - ImGui::End(); - - ImGui::EndFrame(); - ImGui::Render(); - ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());*/ - - unsigned int stride = sizeof(VertexType); - unsigned int offset = 0; - - //lock the vertex buffer so it can be written to - D3D11_MAPPED_SUBRESOURCE mappedResource; - auto result = context->Map(vertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); - if (FAILED(result)) { - return false; - } - - auto verticesPtr = (VertexType*)mappedResource.pData; - - //copy the data into the vertex buffer - memcpy(verticesPtr, (void*)vertices, (sizeof(VertexType) * 3)); - - context->Unmap(vertexBuffer, 0); - - context->VSSetShader(m_vertexShader, 0, 0); - context->PSSetShader(0, 0, 0); - context->IASetVertexBuffers(0, 1, &vertexBuffer, &stride, &offset); - context->IASetIndexBuffer(indexBuffer, DXGI_FORMAT_R32_UINT, 0); - context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - context->IASetInputLayout(m_pInputLayout); - - context->DrawIndexed(3, 0, 0); -#endif - - //#define TEST_DIRECTX - -#ifdef TEST_DIRECTX - if (!GameWnd.isInitialized()) - GameWnd.Init(chain, g_Data.getDllModule()); - else - GameWnd.Render(); - -#endif // DEBUG - return func(chain, syncInterval, flags); -} - -HRESULT Hooks::swapChain__ResizeBuffers(IDXGISwapChain* chain, UINT bufferCount, UINT Width, UINT Height, DXGI_FORMAT Newformat, UINT SwapChainFlags) { - auto func = g_Hooks.swapchain__resizeBuffersHook->GetFastcall(); - -#ifdef TEST_DIRECTX - GameWnd.OnWindowSizeChanged(static_cast(Width), static_cast(Height)); -#endif - HRESULT ret = func(chain, bufferCount, Width, Height, Newformat, SwapChainFlags); - - return ret; -} __int64 Hooks::Cube__compile(__int64 a1, __int64 a2) { auto func = g_Hooks.cube__compileHook->GetFastcall<__int64, __int64, __int64>(); diff --git a/Memory/Hooks.h b/Memory/Hooks.h index 793a5878..87332c9f 100644 --- a/Memory/Hooks.h +++ b/Memory/Hooks.h @@ -34,8 +34,6 @@ #include -#include "../include/d3dx11async.h" - class VMTHook; class FuncHook; @@ -117,9 +115,7 @@ class Hooks { static GamerTextHolder* toStyledString(__int64 strIn, GamerTextHolder* strOut); static __int64 prepFeaturedServers(__int64 a1); static __int64 prepFeaturedServersFirstTime(__int64 a1, __int64 a2); - static HRESULT swapChain__present(IDXGISwapChain* chain, UINT syncInterval, UINT flags); static __int64 InGamePlayScreen___renderLevel(__int64 playScreen, __int64 a2, __int64 a3); - static HRESULT swapChain__ResizeBuffers(IDXGISwapChain* chain, UINT bufferCount, UINT Width, UINT Height, DXGI_FORMAT Newformat, UINT SwapChainFlags); static __int64 Cube__compile(__int64 a1, __int64 a2); static void LocalPlayer__updateFromCamera(__int64 a1, C_Camera* a2); static bool Mob__isImmobile(C_Entity*); @@ -169,9 +165,7 @@ class Hooks { std::unique_ptr toStyledStringHook; std::unique_ptr prepFeaturedServersHook; std::unique_ptr prepFeaturedServersFirstTimeHook; - std::unique_ptr swapchain__presentHook; std::unique_ptr InGamePlayScreen___renderLevelHook; - std::unique_ptr swapchain__resizeBuffersHook; std::unique_ptr cube__compileHook; std::unique_ptr LocalPlayer__updateFromCameraHook; std::unique_ptr Mob__isImmobileHook; diff --git a/include/d3dx11.h b/include/d3dx11.h deleted file mode 100644 index db88faeb..00000000 --- a/include/d3dx11.h +++ /dev/null @@ -1,68 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx11.h -// Content: D3DX11 utility library -// -////////////////////////////////////////////////////////////////////////////// - -#ifdef __D3DX11_INTERNAL__ -#error Incorrect D3DX11 header used -#endif - -#ifndef __D3DX11_H__ -#define __D3DX11_H__ - -// Defines -#include -#include - -#ifdef ALLOW_THROWING_NEW -#include -#endif - -#define D3DX11_DEFAULT ((UINT)-1) -#define D3DX11_FROM_FILE ((UINT)-3) -#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT)-3) - -#ifndef D3DX11INLINE -#ifdef _MSC_VER -#if (_MSC_VER >= 1200) -#define D3DX11INLINE __forceinline -#else -#define D3DX11INLINE __inline -#endif -#else -#ifdef __cplusplus -#define D3DX11INLINE inline -#else -#define D3DX11INLINE -#endif -#endif -#endif - -// Includes -#include "d3d11.h" -//#include "d3dx11.h" -#include "d3dx11async.h" -#include "d3dx11core.h" -//#include "d3dx11tex.h" - -// Errors -#define _FACDD 0x876 -#define MAKE_DDHRESULT(code) MAKE_HRESULT(1, _FACDD, code) - -enum _D3DX11_ERR { - D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), - D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), - D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), - D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), - D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), - D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), - D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), - D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), - D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), -}; - -#endif //__D3DX11_H__ diff --git a/include/d3dx11async.h b/include/d3dx11async.h deleted file mode 100644 index ae751c55..00000000 --- a/include/d3dx11async.h +++ /dev/null @@ -1,160 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// File: D3DX11Async.h -// Content: D3DX11 Asynchronous Shader loaders / compilers -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX11ASYNC_H__ -#define __D3DX11ASYNC_H__ - -#include "d3dx11.h" - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//---------------------------------------------------------------------------- -// D3DX11Compile: -// ------------------ -// Compiles an effect or shader. -// -// Parameters: -// pSrcFile -// Source file name. -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module. -// pSrcData -// Pointer to source code. -// SrcDataLen -// Size of source code, in bytes. -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when compiling -// from file, and will error when compiling from resource or memory. -// pFunctionName -// Name of the entrypoint function where execution should begin. -// pProfile -// Instruction set to be used when generating code. Currently supported -// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", -// "vs_3_sw", "vs_4_0", "vs_4_1", -// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", -// "ps_3_sw", "ps_4_0", "ps_4_1", -// "gs_4_0", "gs_4_1", -// "tx_1_0", -// "fx_4_0", "fx_4_1" -// Note that this entrypoint does not compile fx_2_0 targets, for that -// you need to use the D3DX9 function. -// Flags1 -// See D3D10_SHADER_xxx flags. -// Flags2 -// See D3D10_EFFECT_xxx flags. -// ppShader -// Returns a buffer containing the created shader. This buffer contains -// the compiled shader code, as well as any embedded debug and symbol -// table info. (See D3D10GetShaderConstantTable) -// ppErrorMsgs -// Returns a buffer containing a listing of errors and warnings that were -// encountered during the compile. If you are running in a debugger, -// these are the same messages you will see in your debug output. -// pHResult -// Pointer to a memory location to receive the return value upon completion. -// Maybe NULL if not needed. -// If pPump != NULL, pHResult must be a valid memory location until the -// the asynchronous execution completes. -//---------------------------------------------------------------------------- - -HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, - LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, - LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -#ifdef UNICODE -#define D3DX11CompileFromFile D3DX11CompileFromFileW -#else -#define D3DX11CompileFromFile D3DX11CompileFromFileA -#endif - -HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -#ifdef UNICODE -#define D3DX11CompileFromResource D3DX11CompileFromResourceW -#else -#define D3DX11CompileFromResource D3DX11CompileFromResourceA -#endif - -HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, - LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, - LPD3D10INCLUDE pInclude, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); - -#ifdef UNICODE -#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW -#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW -#else -#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA -#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA -#endif - -//---------------------------------------------------------------------------- -// Async processors -//---------------------------------------------------------------------------- - -HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, - LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, - ID3D10Blob** ppCompiledShader, ID3D10Blob** ppErrorBuffer, ID3DX11DataProcessor** ppProcessor); - -HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, - ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorBuffer, ID3DX11DataProcessor** ppProcessor); - -//---------------------------------------------------------------------------- -// D3DX11 Asynchronous texture I/O (advanced mode) -//---------------------------------------------------------------------------- - -HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader** ppDataLoader); -HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader** ppDataLoader); -HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader** ppDataLoader); -HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader** ppDataLoader); -HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader** ppDataLoader); - -#ifdef UNICODE -#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW -#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW -#else -#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA -#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA -#endif -/* -HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device* pDevice, D3DX11_IMAGE_LOAD_INFO* pLoadInfo, ID3DX11DataProcessor** ppDataProcessor); -HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO* pImageInfo, ID3DX11DataProcessor** ppDataProcessor); -HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device* pDevice, D3DX11_IMAGE_LOAD_INFO* pLoadInfo, ID3DX11DataProcessor** ppDataProcessor); -*/ -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX11ASYNC_H__ diff --git a/include/d3dx11core.h b/include/d3dx11core.h deleted file mode 100644 index cfd7b91d..00000000 --- a/include/d3dx11core.h +++ /dev/null @@ -1,135 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx11core.h -// Content: D3DX11 core types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx11.h" - -#ifndef __D3DX11CORE_H__ -#define __D3DX11CORE_H__ - -// Current name of the DLL shipped in the same SDK as this header. - -#define D3DX11_DLL_W L"d3dx11_43.dll" -#define D3DX11_DLL_A "d3dx11_43.dll" - -#ifdef UNICODE -#define D3DX11_DLL D3DX11_DLL_W -#else -#define D3DX11_DLL D3DX11_DLL_A -#endif - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -/////////////////////////////////////////////////////////////////////////// -// D3DX11_SDK_VERSION: -// ----------------- -// This identifier is passed to D3DX11CheckVersion in order to ensure that an -// application was built against the correct header files and lib files. -// This number is incremented whenever a header (or other) change would -// require applications to be rebuilt. If the version doesn't match, -// D3DX11CreateVersion will return FALSE. (The number itself has no meaning.) -/////////////////////////////////////////////////////////////////////////// - -#define D3DX11_SDK_VERSION 43 - -#ifdef D3D_DIAG_DLL -BOOL WINAPI D3DX11DebugMute(BOOL Mute); -#endif -HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion); - -#ifdef __cplusplus -} -#endif //__cplusplus - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11ThreadPump: -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DX11DataLoader - -DECLARE_INTERFACE(ID3DX11DataLoader) { - STDMETHOD(Load) - (THIS) PURE; - STDMETHOD(Decompress) - (THIS_ void **ppData, SIZE_T *pcBytes) PURE; - STDMETHOD(Destroy) - (THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE ID3DX11DataProcessor - -DECLARE_INTERFACE(ID3DX11DataProcessor) { - STDMETHOD(Process) - (THIS_ void *pData, SIZE_T cBytes) PURE; - STDMETHOD(CreateDeviceObject) - (THIS_ void **ppDataObject) PURE; - STDMETHOD(Destroy) - (THIS) PURE; -}; - -// {C93FECFA-6967-478a-ABBC-402D90621FCB} -DEFINE_GUID(IID_ID3DX11ThreadPump, - 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); - -#undef INTERFACE -#define INTERFACE ID3DX11ThreadPump - -DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown) { - // IUnknown - STDMETHOD(QueryInterface) - (THIS_ REFIID iid, LPVOID * ppv) PURE; - STDMETHOD_(ULONG, AddRef) - (THIS) PURE; - STDMETHOD_(ULONG, Release) - (THIS) PURE; - - // ID3DX11ThreadPump - STDMETHOD(AddWorkItem) - (THIS_ ID3DX11DataLoader * pDataLoader, ID3DX11DataProcessor * pDataProcessor, HRESULT * pHResult, void **ppDeviceObject) PURE; - STDMETHOD_(UINT, GetWorkItemCount) - (THIS) PURE; - - STDMETHOD(WaitForAllItems) - (THIS) PURE; - STDMETHOD(ProcessDeviceWorkItems) - (THIS_ UINT iWorkItemCount); - - STDMETHOD(PurgeAllItems) - (THIS) PURE; - STDMETHOD(GetQueueStatus) - (THIS_ UINT * pIoQueue, UINT * pProcessQueue, UINT * pDeviceQueue) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump); - -HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext); - -#ifdef __cplusplus -} -#endif //__cplusplus - -/////////////////////////////////////////////////////////////////////////// - -#define _FACD3D 0x876 -#define MAKE_D3DHRESULT(code) MAKE_HRESULT(1, _FACD3D, code) -#define MAKE_D3DSTATUS(code) MAKE_HRESULT(0, _FACD3D, code) - -#ifndef D3DERR_INVALIDCALL -#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) -#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) -#endif - -#endif //__D3DX11CORE_H__ diff --git a/include/d3dx11effect.h b/include/d3dx11effect.h deleted file mode 100644 index 178d9693..00000000 --- a/include/d3dx11effect.h +++ /dev/null @@ -1,1342 +0,0 @@ -//-------------------------------------------------------------------------------------- -// File: D3DX11Effect.h -// -// Direct3D 11 Effect Types & APIs Header -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/p/?LinkId=271568 -//-------------------------------------------------------------------------------------- - -#pragma once - -#define D3DX11_EFFECTS_VERSION 1126 - -#if defined(_XBOX_ONE) && defined(_TITLE) -#include -#define NO_D3D11_DEBUG_NAME -#else -#include -#include -#endif - -#pragma comment(lib, "d3dcompiler.lib") -#pragma comment(lib, "dxguid.lib") - -#include - -////////////////////////////////////////////////////////////////////////////// -// File contents: -// -// 1) Stateblock enums, structs, interfaces, flat APIs -// 2) Effect enums, structs, interfaces, flat APIs -////////////////////////////////////////////////////////////////////////////// - -#ifndef D3DX11_BYTES_FROM_BITS -#define D3DX11_BYTES_FROM_BITS(x) (((x) + 7) / 8) -#endif // D3DX11_BYTES_FROM_BITS - -#ifndef D3DERR_INVALIDCALL -#define D3DERR_INVALIDCALL MAKE_HRESULT(1, 0x876, 2156) -#endif - -struct D3DX11_STATE_BLOCK_MASK { - uint8_t VS; - uint8_t VSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t VSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t VSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t VSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - - uint8_t HS; - uint8_t HSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t HSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t HSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t HSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - - uint8_t DS; - uint8_t DSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t DSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t DSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t DSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - - uint8_t GS; - uint8_t GSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t GSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t GSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t GSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - - uint8_t PS; - uint8_t PSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t PSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t PSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t PSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - uint8_t PSUnorderedAccessViews; - - uint8_t CS; - uint8_t CSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)]; - uint8_t CSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t CSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; - uint8_t CSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)]; - uint8_t CSUnorderedAccessViews; - - uint8_t IAVertexBuffers[D3DX11_BYTES_FROM_BITS(D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)]; - uint8_t IAIndexBuffer; - uint8_t IAInputLayout; - uint8_t IAPrimitiveTopology; - - uint8_t OMRenderTargets; - uint8_t OMDepthStencilState; - uint8_t OMBlendState; - - uint8_t RSViewports; - uint8_t RSScissorRects; - uint8_t RSRasterizerState; - - uint8_t SOBuffers; - - uint8_t Predication; -}; - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT flags: -// ------------------------------------- -// -// These flags are passed in when creating an effect, and affect -// the runtime effect behavior: -// -// (Currently none) -// -// -// These flags are set by the effect runtime: -// -// D3DX11_EFFECT_OPTIMIZED -// This effect has been optimized. Reflection functions that rely on -// names/semantics/strings should fail. This is set when Optimize() is -// called, but CEffect::IsOptimized() should be used to test for this. -// -// D3DX11_EFFECT_CLONE -// This effect is a clone of another effect. Single CBs will never be -// updated when internal variable values are changed. -// This flag is not set when the D3DX11_EFFECT_CLONE_FORCE_NONSINGLE flag -// is used in cloning. -// -//---------------------------------------------------------------------------- - -#define D3DX11_EFFECT_OPTIMIZED (1 << 21) -#define D3DX11_EFFECT_CLONE (1 << 22) - -// Mask of valid D3DCOMPILE_EFFECT flags for D3DX11CreateEffect* -#define D3DX11_EFFECT_RUNTIME_VALID_FLAGS (0) - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_VARIABLE flags: -// ---------------------------- -// -// These flags describe an effect variable (global or annotation), -// and are returned in D3DX11_EFFECT_VARIABLE_DESC::Flags. -// -// D3DX11_EFFECT_VARIABLE_ANNOTATION -// Indicates that this is an annotation on a technique, pass, or global -// variable. Otherwise, this is a global variable. Annotations cannot -// be shared. -// -// D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT -// Indicates that the variable has been explicitly bound using the -// register keyword. -//---------------------------------------------------------------------------- - -#define D3DX11_EFFECT_VARIABLE_ANNOTATION (1 << 1) -#define D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT (1 << 2) - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_CLONE flags: -// ---------------------------- -// -// These flags modify the effect cloning process and are passed into Clone. -// -// D3DX11_EFFECT_CLONE_FORCE_NONSINGLE -// Ignore all "single" qualifiers on cbuffers. All cbuffers will have their -// own ID3D11Buffer's created in the cloned effect. -//---------------------------------------------------------------------------- - -#define D3DX11_EFFECT_CLONE_FORCE_NONSINGLE (1 << 0) - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectType ////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_TYPE_DESC: -// -// Retrieved by ID3DX11EffectType::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_EFFECT_TYPE_DESC { - LPCSTR TypeName; // Name of the type - // (e.g. "float4" or "MyStruct") - - D3D_SHADER_VARIABLE_CLASS Class; // (e.g. scalar, vector, object, etc.) - D3D_SHADER_VARIABLE_TYPE Type; // (e.g. float, texture, vertexshader, etc.) - - uint32_t Elements; // Number of elements in this type - // (0 if not an array) - uint32_t Members; // Number of members - // (0 if not a structure) - uint32_t Rows; // Number of rows in this type - // (0 if not a numeric primitive) - uint32_t Columns; // Number of columns in this type - // (0 if not a numeric primitive) - - uint32_t PackedSize; // Number of bytes required to represent - // this data type, when tightly packed - uint32_t UnpackedSize; // Number of bytes occupied by this data - // type, when laid out in a constant buffer - uint32_t Stride; // Number of bytes to seek between elements, - // when laid out in a constant buffer -}; - -typedef interface ID3DX11EffectType ID3DX11EffectType; -typedef interface ID3DX11EffectType *LPD3D11EFFECTTYPE; - -// {4250D721-D5E5-491F-B62B-587C43186285} -DEFINE_GUID(IID_ID3DX11EffectType, - 0x4250d721, 0xd5e5, 0x491f, 0xb6, 0x2b, 0x58, 0x7c, 0x43, 0x18, 0x62, 0x85); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectType - -DECLARE_INTERFACE_(ID3DX11EffectType, IUnknown) { - // IUnknown - - // ID3DX11EffectType - STDMETHOD_(bool, IsValid) - (THIS) PURE; - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_EFFECT_TYPE_DESC * pDesc) PURE; - STDMETHOD_(ID3DX11EffectType *, GetMemberTypeByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectType *, GetMemberTypeByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - STDMETHOD_(ID3DX11EffectType *, GetMemberTypeBySemantic) - (THIS_ _In_z_ LPCSTR Semantic) PURE; - STDMETHOD_(LPCSTR, GetMemberName) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(LPCSTR, GetMemberSemantic) - (THIS_ _In_ uint32_t Index) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectVariable ////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_VARIABLE_DESC: -// -// Retrieved by ID3DX11EffectVariable::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_EFFECT_VARIABLE_DESC { - LPCSTR Name; // Name of this variable, annotation, - // or structure member - LPCSTR Semantic; // Semantic string of this variable - // or structure member (nullptr for - // annotations or if not present) - - uint32_t Flags; // D3DX11_EFFECT_VARIABLE_* flags - uint32_t Annotations; // Number of annotations on this variable - // (always 0 for annotations) - - uint32_t BufferOffset; // Offset into containing cbuffer or tbuffer - // (always 0 for annotations or variables - // not in constant buffers) - - uint32_t ExplicitBindPoint; // Used if the variable has been explicitly bound - // using the register keyword. Check Flags for - // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT; -}; - -typedef interface ID3DX11EffectVariable ID3DX11EffectVariable; -typedef interface ID3DX11EffectVariable *LPD3D11EFFECTVARIABLE; - -// {036A777D-B56E-4B25-B313-CC3DDAB71873} -DEFINE_GUID(IID_ID3DX11EffectVariable, - 0x036a777d, 0xb56e, 0x4b25, 0xb3, 0x13, 0xcc, 0x3d, 0xda, 0xb7, 0x18, 0x73); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectVariable - -// Forward defines -typedef interface ID3DX11EffectScalarVariable ID3DX11EffectScalarVariable; -typedef interface ID3DX11EffectVectorVariable ID3DX11EffectVectorVariable; -typedef interface ID3DX11EffectMatrixVariable ID3DX11EffectMatrixVariable; -typedef interface ID3DX11EffectStringVariable ID3DX11EffectStringVariable; -typedef interface ID3DX11EffectClassInstanceVariable ID3DX11EffectClassInstanceVariable; -typedef interface ID3DX11EffectInterfaceVariable ID3DX11EffectInterfaceVariable; -typedef interface ID3DX11EffectShaderResourceVariable ID3DX11EffectShaderResourceVariable; -typedef interface ID3DX11EffectUnorderedAccessViewVariable ID3DX11EffectUnorderedAccessViewVariable; -typedef interface ID3DX11EffectRenderTargetViewVariable ID3DX11EffectRenderTargetViewVariable; -typedef interface ID3DX11EffectDepthStencilViewVariable ID3DX11EffectDepthStencilViewVariable; -typedef interface ID3DX11EffectConstantBuffer ID3DX11EffectConstantBuffer; -typedef interface ID3DX11EffectShaderVariable ID3DX11EffectShaderVariable; -typedef interface ID3DX11EffectBlendVariable ID3DX11EffectBlendVariable; -typedef interface ID3DX11EffectDepthStencilVariable ID3DX11EffectDepthStencilVariable; -typedef interface ID3DX11EffectRasterizerVariable ID3DX11EffectRasterizerVariable; -typedef interface ID3DX11EffectSamplerVariable ID3DX11EffectSamplerVariable; - -DECLARE_INTERFACE_(ID3DX11EffectVariable, IUnknown) { - // IUnknown - - // ID3DX11EffectVariable - STDMETHOD_(bool, IsValid) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectType *, GetType) - (THIS) PURE; - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_EFFECT_VARIABLE_DESC * pDesc) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetMemberByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetMemberByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetMemberBySemantic) - (THIS_ _In_z_ LPCSTR Semantic) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetElement) - (THIS_ _In_ uint32_t Index) PURE; - - STDMETHOD_(ID3DX11EffectConstantBuffer *, GetParentConstantBuffer) - (THIS) PURE; - - STDMETHOD_(ID3DX11EffectScalarVariable *, AsScalar) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectVectorVariable *, AsVector) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectMatrixVariable *, AsMatrix) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectStringVariable *, AsString) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectClassInstanceVariable *, AsClassInstance) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectInterfaceVariable *, AsInterface) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectShaderResourceVariable *, AsShaderResource) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectUnorderedAccessViewVariable *, AsUnorderedAccessView) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectRenderTargetViewVariable *, AsRenderTargetView) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectDepthStencilViewVariable *, AsDepthStencilView) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectConstantBuffer *, AsConstantBuffer) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectShaderVariable *, AsShader) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectBlendVariable *, AsBlend) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectDepthStencilVariable *, AsDepthStencil) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectRasterizerVariable *, AsRasterizer) - (THIS) PURE; - STDMETHOD_(ID3DX11EffectSamplerVariable *, AsSampler) - (THIS) PURE; - - STDMETHOD(SetRawValue) - (THIS_ _In_reads_bytes_(ByteCount) const void *pData, _In_ uint32_t ByteOffset, _In_ uint32_t ByteCount) PURE; - STDMETHOD(GetRawValue) - (THIS_ _Out_writes_bytes_(ByteCount) void *pData, _In_ uint32_t ByteOffset, _In_ uint32_t ByteCount) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectScalarVariable //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectScalarVariable ID3DX11EffectScalarVariable; -typedef interface ID3DX11EffectScalarVariable *LPD3D11EFFECTSCALARVARIABLE; - -// {921EF2E5-A65D-4E92-9FC6-4E9CC09A4ADE} -DEFINE_GUID(IID_ID3DX11EffectScalarVariable, - 0x921ef2e5, 0xa65d, 0x4e92, 0x9f, 0xc6, 0x4e, 0x9c, 0xc0, 0x9a, 0x4a, 0xde); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectScalarVariable - -DECLARE_INTERFACE_(ID3DX11EffectScalarVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectScalarVariable - STDMETHOD(SetFloat) - (THIS_ _In_ const float Value) PURE; - STDMETHOD(GetFloat) - (THIS_ _Out_ float *pValue) PURE; - - STDMETHOD(SetFloatArray) - (THIS_ _In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetFloatArray) - (THIS_ _Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - - STDMETHOD(SetInt) - (THIS_ _In_ const int Value) PURE; - STDMETHOD(GetInt) - (THIS_ _Out_ int *pValue) PURE; - - STDMETHOD(SetIntArray) - (THIS_ _In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetIntArray) - (THIS_ _Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - - STDMETHOD(SetBool) - (THIS_ _In_ const bool Value) PURE; - STDMETHOD(GetBool) - (THIS_ _Out_ bool *pValue) PURE; - - STDMETHOD(SetBoolArray) - (THIS_ _In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetBoolArray) - (THIS_ _Out_writes_(Count) bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectVectorVariable //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectVectorVariable ID3DX11EffectVectorVariable; -typedef interface ID3DX11EffectVectorVariable *LPD3D11EFFECTVECTORVARIABLE; - -// {5E785D4A-D87B-48D8-B6E6-0F8CA7E7467A} -DEFINE_GUID(IID_ID3DX11EffectVectorVariable, - 0x5e785d4a, 0xd87b, 0x48d8, 0xb6, 0xe6, 0x0f, 0x8c, 0xa7, 0xe7, 0x46, 0x7a); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectVectorVariable - -DECLARE_INTERFACE_(ID3DX11EffectVectorVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectVectorVariable - STDMETHOD(SetBoolVector) - (THIS_ _In_reads_(4) const bool *pData) PURE; - STDMETHOD(SetIntVector) - (THIS_ _In_reads_(4) const int *pData) PURE; - STDMETHOD(SetFloatVector) - (THIS_ _In_reads_(4) const float *pData) PURE; - - STDMETHOD(GetBoolVector) - (THIS_ _Out_writes_(4) bool *pData) PURE; - STDMETHOD(GetIntVector) - (THIS_ _Out_writes_(4) int *pData) PURE; - STDMETHOD(GetFloatVector) - (THIS_ _Out_writes_(4) float *pData) PURE; - - STDMETHOD(SetBoolVectorArray) - (THIS_ _In_reads_(Count * 4) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(SetIntVectorArray) - (THIS_ _In_reads_(Count * 4) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(SetFloatVectorArray) - (THIS_ _In_reads_(Count * 4) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - - STDMETHOD(GetBoolVectorArray) - (THIS_ _Out_writes_(Count * 4) bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetIntVectorArray) - (THIS_ _Out_writes_(Count * 4) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetFloatVectorArray) - (THIS_ _Out_writes_(Count * 4) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectMatrixVariable //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectMatrixVariable ID3DX11EffectMatrixVariable; -typedef interface ID3DX11EffectMatrixVariable *LPD3D11EFFECTMATRIXVARIABLE; - -// {E1096CF4-C027-419A-8D86-D29173DC803E} -DEFINE_GUID(IID_ID3DX11EffectMatrixVariable, - 0xe1096cf4, 0xc027, 0x419a, 0x8d, 0x86, 0xd2, 0x91, 0x73, 0xdc, 0x80, 0x3e); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectMatrixVariable - -DECLARE_INTERFACE_(ID3DX11EffectMatrixVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectMatrixVariable - STDMETHOD(SetMatrix) - (THIS_ _In_reads_(16) const float *pData) PURE; - STDMETHOD(GetMatrix) - (THIS_ _Out_writes_(16) float *pData) PURE; - - STDMETHOD(SetMatrixArray) - (THIS_ _In_reads_(Count * 16) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetMatrixArray) - (THIS_ _Out_writes_(Count * 16) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - - STDMETHOD(SetMatrixPointerArray) - (_In_reads_(Count * 16) const float **ppData, uint32_t Offset, uint32_t Count) PURE; - STDMETHOD(GetMatrixPointerArray) - (_Out_writes_(Count * 16) float **ppData, uint32_t Offset, uint32_t Count) PURE; - - STDMETHOD(SetMatrixTranspose) - (THIS_ _In_reads_(16) const float *pData) PURE; - STDMETHOD(GetMatrixTranspose) - (THIS_ _Out_writes_(16) float *pData) PURE; - - STDMETHOD(SetMatrixTransposeArray) - (THIS_ _In_reads_(Count * 16) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetMatrixTransposeArray) - (THIS_ _Out_writes_(Count * 16) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - - STDMETHOD(SetMatrixTransposePointerArray) - (_In_reads_(Count * 16) const float **ppData, uint32_t Offset, uint32_t Count) PURE; - STDMETHOD(GetMatrixTransposePointerArray) - (_Out_writes_(Count * 16) float **ppData, uint32_t Offset, uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectStringVariable //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectStringVariable ID3DX11EffectStringVariable; -typedef interface ID3DX11EffectStringVariable *LPD3D11EFFECTSTRINGVARIABLE; - -// {F355C818-01BE-4653-A7CC-60FFFEDDC76D} -DEFINE_GUID(IID_ID3DX11EffectStringVariable, - 0xf355c818, 0x01be, 0x4653, 0xa7, 0xcc, 0x60, 0xff, 0xfe, 0xdd, 0xc7, 0x6d); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectStringVariable - -DECLARE_INTERFACE_(ID3DX11EffectStringVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectStringVariable - STDMETHOD(GetString) - (THIS_ _Outptr_result_z_ LPCSTR * ppString) PURE; - STDMETHOD(GetStringArray) - (THIS_ _Out_writes_(Count) LPCSTR * ppStrings, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectClassInstanceVariable //////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectClassInstanceVariable ID3DX11EffectClassInstanceVariable; -typedef interface ID3DX11EffectClassInstanceVariable *LPD3D11EFFECTCLASSINSTANCEVARIABLE; - -// {926A8053-2A39-4DB4-9BDE-CF649ADEBDC1} -DEFINE_GUID(IID_ID3DX11EffectClassInstanceVariable, - 0x926a8053, 0x2a39, 0x4db4, 0x9b, 0xde, 0xcf, 0x64, 0x9a, 0xde, 0xbd, 0xc1); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectClassInstanceVariable - -DECLARE_INTERFACE_(ID3DX11EffectClassInstanceVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectClassInstanceVariable - STDMETHOD(GetClassInstance) - (_Outptr_ ID3D11ClassInstance * *ppClassInstance) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectInterfaceVariable //////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectInterfaceVariable ID3DX11EffectInterfaceVariable; -typedef interface ID3DX11EffectInterfaceVariable *LPD3D11EFFECTINTERFACEVARIABLE; - -// {516C8CD8-1C80-40A4-B19B-0688792F11A5} -DEFINE_GUID(IID_ID3DX11EffectInterfaceVariable, - 0x516c8cd8, 0x1c80, 0x40a4, 0xb1, 0x9b, 0x06, 0x88, 0x79, 0x2f, 0x11, 0xa5); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectInterfaceVariable - -DECLARE_INTERFACE_(ID3DX11EffectInterfaceVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectInterfaceVariable - STDMETHOD(SetClassInstance) - (_In_ ID3DX11EffectClassInstanceVariable * pEffectClassInstance) PURE; - STDMETHOD(GetClassInstance) - (_Outptr_ ID3DX11EffectClassInstanceVariable * *ppEffectClassInstance) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectShaderResourceVariable //////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectShaderResourceVariable ID3DX11EffectShaderResourceVariable; -typedef interface ID3DX11EffectShaderResourceVariable *LPD3D11EFFECTSHADERRESOURCEVARIABLE; - -// {350DB233-BBE0-485C-9BFE-C0026B844F89} -DEFINE_GUID(IID_ID3DX11EffectShaderResourceVariable, - 0x350db233, 0xbbe0, 0x485c, 0x9b, 0xfe, 0xc0, 0x02, 0x6b, 0x84, 0x4f, 0x89); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectShaderResourceVariable - -DECLARE_INTERFACE_(ID3DX11EffectShaderResourceVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectShaderResourceVariable - STDMETHOD(SetResource) - (THIS_ _In_ ID3D11ShaderResourceView * pResource) PURE; - STDMETHOD(GetResource) - (THIS_ _Outptr_ ID3D11ShaderResourceView * *ppResource) PURE; - - STDMETHOD(SetResourceArray) - (THIS_ _In_reads_(Count) ID3D11ShaderResourceView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetResourceArray) - (THIS_ _Out_writes_(Count) ID3D11ShaderResourceView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectUnorderedAccessViewVariable //////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectUnorderedAccessViewVariable ID3DX11EffectUnorderedAccessViewVariable; -typedef interface ID3DX11EffectUnorderedAccessViewVariable *LPD3D11EFFECTUNORDEREDACCESSVIEWVARIABLE; - -// {79B4AC8C-870A-47D2-B05A-8BD5CC3EE6C9} -DEFINE_GUID(IID_ID3DX11EffectUnorderedAccessViewVariable, - 0x79b4ac8c, 0x870a, 0x47d2, 0xb0, 0x5a, 0x8b, 0xd5, 0xcc, 0x3e, 0xe6, 0xc9); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectUnorderedAccessViewVariable - -DECLARE_INTERFACE_(ID3DX11EffectUnorderedAccessViewVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectUnorderedAccessViewVariable - STDMETHOD(SetUnorderedAccessView) - (THIS_ _In_ ID3D11UnorderedAccessView * pResource) PURE; - STDMETHOD(GetUnorderedAccessView) - (THIS_ _Outptr_ ID3D11UnorderedAccessView * *ppResource) PURE; - - STDMETHOD(SetUnorderedAccessViewArray) - (THIS_ _In_reads_(Count) ID3D11UnorderedAccessView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetUnorderedAccessViewArray) - (THIS_ _Out_writes_(Count) ID3D11UnorderedAccessView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectRenderTargetViewVariable ////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectRenderTargetViewVariable ID3DX11EffectRenderTargetViewVariable; -typedef interface ID3DX11EffectRenderTargetViewVariable *LPD3D11EFFECTRENDERTARGETVIEWVARIABLE; - -// {D5066909-F40C-43F8-9DB5-057C2A208552} -DEFINE_GUID(IID_ID3DX11EffectRenderTargetViewVariable, - 0xd5066909, 0xf40c, 0x43f8, 0x9d, 0xb5, 0x05, 0x7c, 0x2a, 0x20, 0x85, 0x52); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectRenderTargetViewVariable - -DECLARE_INTERFACE_(ID3DX11EffectRenderTargetViewVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectRenderTargetViewVariable - STDMETHOD(SetRenderTarget) - (THIS_ _In_ ID3D11RenderTargetView * pResource) PURE; - STDMETHOD(GetRenderTarget) - (THIS_ _Outptr_ ID3D11RenderTargetView * *ppResource) PURE; - - STDMETHOD(SetRenderTargetArray) - (THIS_ _In_reads_(Count) ID3D11RenderTargetView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetRenderTargetArray) - (THIS_ _Out_writes_(Count) ID3D11RenderTargetView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectDepthStencilViewVariable ////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectDepthStencilViewVariable ID3DX11EffectDepthStencilViewVariable; -typedef interface ID3DX11EffectDepthStencilViewVariable *LPD3D11EFFECTDEPTHSTENCILVIEWVARIABLE; - -// {33C648AC-2E9E-4A2E-9CD6-DE31ACC5B347} -DEFINE_GUID(IID_ID3DX11EffectDepthStencilViewVariable, - 0x33c648ac, 0x2e9e, 0x4a2e, 0x9c, 0xd6, 0xde, 0x31, 0xac, 0xc5, 0xb3, 0x47); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectDepthStencilViewVariable - -DECLARE_INTERFACE_(ID3DX11EffectDepthStencilViewVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectDepthStencilViewVariable - STDMETHOD(SetDepthStencil) - (THIS_ _In_ ID3D11DepthStencilView * pResource) PURE; - STDMETHOD(GetDepthStencil) - (THIS_ _Outptr_ ID3D11DepthStencilView * *ppResource) PURE; - - STDMETHOD(SetDepthStencilArray) - (THIS_ _In_reads_(Count) ID3D11DepthStencilView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(GetDepthStencilArray) - (THIS_ _Out_writes_(Count) ID3D11DepthStencilView * *ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectConstantBuffer //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectConstantBuffer ID3DX11EffectConstantBuffer; -typedef interface ID3DX11EffectConstantBuffer *LPD3D11EFFECTCONSTANTBUFFER; - -// {2CB6C733-82D2-4000-B3DA-6219D9A99BF2} -DEFINE_GUID(IID_ID3DX11EffectConstantBuffer, - 0x2cb6c733, 0x82d2, 0x4000, 0xb3, 0xda, 0x62, 0x19, 0xd9, 0xa9, 0x9b, 0xf2); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectConstantBuffer - -DECLARE_INTERFACE_(ID3DX11EffectConstantBuffer, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectConstantBuffer - STDMETHOD(SetConstantBuffer) - (THIS_ _In_ ID3D11Buffer * pConstantBuffer) PURE; - STDMETHOD(UndoSetConstantBuffer) - (THIS) PURE; - STDMETHOD(GetConstantBuffer) - (THIS_ _Outptr_ ID3D11Buffer * *ppConstantBuffer) PURE; - - STDMETHOD(SetTextureBuffer) - (THIS_ _In_ ID3D11ShaderResourceView * pTextureBuffer) PURE; - STDMETHOD(UndoSetTextureBuffer) - (THIS) PURE; - STDMETHOD(GetTextureBuffer) - (THIS_ _Outptr_ ID3D11ShaderResourceView * *ppTextureBuffer) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectShaderVariable //////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_SHADER_DESC: -// -// Retrieved by ID3DX11EffectShaderVariable::GetShaderDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_EFFECT_SHADER_DESC { - const uint8_t *pInputSignature; // Passed into CreateInputLayout, - // valid on VS and GS only - - bool IsInline; // Is this an anonymous shader variable - // resulting from an inline shader assignment? - - // -- The following fields are not valid after Optimize() -- - const uint8_t *pBytecode; // Shader bytecode - uint32_t BytecodeLength; - - LPCSTR SODecls[D3D11_SO_STREAM_COUNT]; // Stream out declaration string (for GS with SO) - uint32_t RasterizedStream; - - uint32_t NumInputSignatureEntries; // Number of entries in the input signature - uint32_t NumOutputSignatureEntries; // Number of entries in the output signature - uint32_t NumPatchConstantSignatureEntries; // Number of entries in the patch constant signature -}; - -typedef interface ID3DX11EffectShaderVariable ID3DX11EffectShaderVariable; -typedef interface ID3DX11EffectShaderVariable *LPD3D11EFFECTSHADERVARIABLE; - -// {7508B344-020A-4EC7-9118-62CDD36C88D7} -DEFINE_GUID(IID_ID3DX11EffectShaderVariable, - 0x7508b344, 0x020a, 0x4ec7, 0x91, 0x18, 0x62, 0xcd, 0xd3, 0x6c, 0x88, 0xd7); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectShaderVariable - -DECLARE_INTERFACE_(ID3DX11EffectShaderVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectShaderVariable - STDMETHOD(GetShaderDesc) - (THIS_ _In_ uint32_t ShaderIndex, _Out_ D3DX11_EFFECT_SHADER_DESC * pDesc) PURE; - - STDMETHOD(GetVertexShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11VertexShader * *ppVS) PURE; - STDMETHOD(GetGeometryShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11GeometryShader * *ppGS) PURE; - STDMETHOD(GetPixelShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11PixelShader * *ppPS) PURE; - STDMETHOD(GetHullShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11HullShader * *ppHS) PURE; - STDMETHOD(GetDomainShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11DomainShader * *ppDS) PURE; - STDMETHOD(GetComputeShader) - (THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11ComputeShader * *ppCS) PURE; - - STDMETHOD(GetInputSignatureElementDesc) - (THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC * pDesc) PURE; - STDMETHOD(GetOutputSignatureElementDesc) - (THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC * pDesc) PURE; - STDMETHOD(GetPatchConstantSignatureElementDesc) - (THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC * pDesc) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectBlendVariable ///////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectBlendVariable ID3DX11EffectBlendVariable; -typedef interface ID3DX11EffectBlendVariable *LPD3D11EFFECTBLENDVARIABLE; - -// {D664F4D7-3B81-4805-B277-C1DF58C39F53} -DEFINE_GUID(IID_ID3DX11EffectBlendVariable, - 0xd664f4d7, 0x3b81, 0x4805, 0xb2, 0x77, 0xc1, 0xdf, 0x58, 0xc3, 0x9f, 0x53); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectBlendVariable - -DECLARE_INTERFACE_(ID3DX11EffectBlendVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectBlendVariable - STDMETHOD(GetBlendState) - (THIS_ _In_ uint32_t Index, _Outptr_ ID3D11BlendState * *ppState) PURE; - STDMETHOD(SetBlendState) - (THIS_ _In_ uint32_t Index, _In_ ID3D11BlendState * pState) PURE; - STDMETHOD(UndoSetBlendState) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD(GetBackingStore) - (THIS_ _In_ uint32_t Index, _Out_ D3D11_BLEND_DESC * pDesc) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectDepthStencilVariable ////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectDepthStencilVariable ID3DX11EffectDepthStencilVariable; -typedef interface ID3DX11EffectDepthStencilVariable *LPD3D11EFFECTDEPTHSTENCILVARIABLE; - -// {69B5751B-61A5-48E5-BD41-D93988111563} -DEFINE_GUID(IID_ID3DX11EffectDepthStencilVariable, - 0x69b5751b, 0x61a5, 0x48e5, 0xbd, 0x41, 0xd9, 0x39, 0x88, 0x11, 0x15, 0x63); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectDepthStencilVariable - -DECLARE_INTERFACE_(ID3DX11EffectDepthStencilVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectDepthStencilVariable - STDMETHOD(GetDepthStencilState) - (THIS_ _In_ uint32_t Index, _Outptr_ ID3D11DepthStencilState * *ppState) PURE; - STDMETHOD(SetDepthStencilState) - (THIS_ _In_ uint32_t Index, _In_ ID3D11DepthStencilState * pState) PURE; - STDMETHOD(UndoSetDepthStencilState) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD(GetBackingStore) - (THIS_ _In_ uint32_t Index, _Out_ D3D11_DEPTH_STENCIL_DESC * pDesc) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectRasterizerVariable //////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectRasterizerVariable ID3DX11EffectRasterizerVariable; -typedef interface ID3DX11EffectRasterizerVariable *LPD3D11EFFECTRASTERIZERVARIABLE; - -// {53A262F6-5F74-4151-A132-E3DD19A62C9D} -DEFINE_GUID(IID_ID3DX11EffectRasterizerVariable, - 0x53a262f6, 0x5f74, 0x4151, 0xa1, 0x32, 0xe3, 0xdd, 0x19, 0xa6, 0x2c, 0x9d); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectRasterizerVariable - -DECLARE_INTERFACE_(ID3DX11EffectRasterizerVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectRasterizerVariable - STDMETHOD(GetRasterizerState) - (THIS_ _In_ uint32_t Index, _Outptr_ ID3D11RasterizerState * *ppState) PURE; - STDMETHOD(SetRasterizerState) - (THIS_ _In_ uint32_t Index, _In_ ID3D11RasterizerState * pState) PURE; - STDMETHOD(UndoSetRasterizerState) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD(GetBackingStore) - (THIS_ _In_ uint32_t Index, _Out_ D3D11_RASTERIZER_DESC * pDesc) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectSamplerVariable /////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DX11EffectSamplerVariable ID3DX11EffectSamplerVariable; -typedef interface ID3DX11EffectSamplerVariable *LPD3D11EFFECTSAMPLERVARIABLE; - -// {C6402E55-1095-4D95-8931-F92660513DD9} -DEFINE_GUID(IID_ID3DX11EffectSamplerVariable, - 0xc6402e55, 0x1095, 0x4d95, 0x89, 0x31, 0xf9, 0x26, 0x60, 0x51, 0x3d, 0xd9); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectSamplerVariable - -DECLARE_INTERFACE_(ID3DX11EffectSamplerVariable, ID3DX11EffectVariable) { - // IUnknown - // ID3DX11EffectVariable - - // ID3DX11EffectSamplerVariable - STDMETHOD(GetSampler) - (THIS_ _In_ uint32_t Index, _Outptr_ ID3D11SamplerState * *ppSampler) PURE; - STDMETHOD(SetSampler) - (THIS_ _In_ uint32_t Index, _In_ ID3D11SamplerState * pSampler) PURE; - STDMETHOD(UndoSetSampler) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD(GetBackingStore) - (THIS_ _In_ uint32_t Index, _Out_ D3D11_SAMPLER_DESC * pDesc) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectPass ////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_PASS_DESC: -// -// Retrieved by ID3DX11EffectPass::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_PASS_DESC { - LPCSTR Name; // Name of this pass (nullptr if not anonymous) - uint32_t Annotations; // Number of annotations on this pass - - uint8_t *pIAInputSignature; // Signature from VS or GS (if there is no VS) - // or nullptr if neither exists - size_t IAInputSignatureSize; // Singature size in bytes - - uint32_t StencilRef; // Specified in SetDepthStencilState() - uint32_t SampleMask; // Specified in SetBlendState() - FLOAT BlendFactor[4]; // Specified in SetBlendState() -}; - -//---------------------------------------------------------------------------- -// D3DX11_PASS_SHADER_DESC: -// -// Retrieved by ID3DX11EffectPass::Get**ShaderDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_PASS_SHADER_DESC { - ID3DX11EffectShaderVariable *pShaderVariable; // The variable that this shader came from. - // If this is an inline shader assignment, - // the returned interface will be an - // anonymous shader variable, which is - // not retrievable any other way. It's - // name in the variable description will - // be "$Anonymous". - // If there is no assignment of this type in - // the pass block, pShaderVariable != nullptr, - // but pShaderVariable->IsValid() == false. - - uint32_t ShaderIndex; // The element of pShaderVariable (if an array) - // or 0 if not applicable -}; - -typedef interface ID3DX11EffectPass ID3DX11EffectPass; -typedef interface ID3DX11EffectPass *LPD3D11EFFECTPASS; - -// {3437CEC4-4AC1-4D87-8916-F4BD5A41380C} -DEFINE_GUID(IID_ID3DX11EffectPass, - 0x3437cec4, 0x4ac1, 0x4d87, 0x89, 0x16, 0xf4, 0xbd, 0x5a, 0x41, 0x38, 0x0c); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectPass - -DECLARE_INTERFACE_(ID3DX11EffectPass, IUnknown) { - // IUnknown - - // ID3DX11EffectPass - STDMETHOD_(bool, IsValid) - (THIS) PURE; - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_PASS_DESC * pDesc) PURE; - - STDMETHOD(GetVertexShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - STDMETHOD(GetGeometryShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - STDMETHOD(GetPixelShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - STDMETHOD(GetHullShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - STDMETHOD(GetDomainShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - STDMETHOD(GetComputeShaderDesc) - (THIS_ _Out_ D3DX11_PASS_SHADER_DESC * pDesc) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD(Apply) - (THIS_ _In_ uint32_t Flags, _In_ ID3D11DeviceContext * pContext) PURE; - - STDMETHOD(ComputeStateBlockMask) - (THIS_ _Inout_ D3DX11_STATE_BLOCK_MASK * pStateBlockMask) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectTechnique ///////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_TECHNIQUE_DESC: -// -// Retrieved by ID3DX11EffectTechnique::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_TECHNIQUE_DESC { - LPCSTR Name; // Name of this technique (nullptr if not anonymous) - uint32_t Passes; // Number of passes contained within - uint32_t Annotations; // Number of annotations on this technique -}; - -typedef interface ID3DX11EffectTechnique ID3DX11EffectTechnique; -typedef interface ID3DX11EffectTechnique *LPD3D11EFFECTTECHNIQUE; - -// {51198831-1F1D-4F47-BD76-41CB0835B1DE} -DEFINE_GUID(IID_ID3DX11EffectTechnique, - 0x51198831, 0x1f1d, 0x4f47, 0xbd, 0x76, 0x41, 0xcb, 0x08, 0x35, 0xb1, 0xde); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectTechnique - -DECLARE_INTERFACE_(ID3DX11EffectTechnique, IUnknown) { - // IUnknown - - // ID3DX11EffectTechnique - STDMETHOD_(bool, IsValid) - (THIS) PURE; - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_TECHNIQUE_DESC * pDesc) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3DX11EffectPass *, GetPassByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectPass *, GetPassByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD(ComputeStateBlockMask) - (THIS_ _Inout_ D3DX11_STATE_BLOCK_MASK * pStateBlockMask) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11EffectTechnique ///////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_GROUP_DESC: -// -// Retrieved by ID3DX11EffectTechnique::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_GROUP_DESC { - LPCSTR Name; // Name of this group (only nullptr if global) - uint32_t Techniques; // Number of techniques contained within - uint32_t Annotations; // Number of annotations on this group -}; - -typedef interface ID3DX11EffectGroup ID3DX11EffectGroup; -typedef interface ID3DX11EffectGroup *LPD3D11EFFECTGROUP; - -// {03074acf-97de-485f-b201-cb775264afd6} -DEFINE_GUID(IID_ID3DX11EffectGroup, - 0x03074acf, 0x97de, 0x485f, 0xb2, 0x01, 0xcb, 0x77, 0x52, 0x64, 0xaf, 0xd6); - -#undef INTERFACE -#define INTERFACE ID3DX11EffectGroup - -DECLARE_INTERFACE_(ID3DX11EffectGroup, IUnknown) { - // IUnknown - - // ID3DX11EffectGroup - STDMETHOD_(bool, IsValid) - (THIS) PURE; - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_GROUP_DESC * pDesc) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetAnnotationByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3DX11EffectTechnique *, GetTechniqueByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectTechnique *, GetTechniqueByName) - (THIS_ _In_z_ LPCSTR Name) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DX11Effect ////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DX11_EFFECT_DESC: -// -// Retrieved by ID3DX11Effect::GetDesc() -//---------------------------------------------------------------------------- - -struct D3DX11_EFFECT_DESC { - uint32_t ConstantBuffers; // Number of constant buffers in this effect - uint32_t GlobalVariables; // Number of global variables in this effect - uint32_t InterfaceVariables; // Number of global interfaces in this effect - uint32_t Techniques; // Number of techniques in this effect - uint32_t Groups; // Number of groups in this effect -}; - -typedef interface ID3DX11Effect ID3DX11Effect; -typedef interface ID3DX11Effect *LPD3D11EFFECT; - -// {FA61CA24-E4BA-4262-9DB8-B132E8CAE319} -DEFINE_GUID(IID_ID3DX11Effect, - 0xfa61ca24, 0xe4ba, 0x4262, 0x9d, 0xb8, 0xb1, 0x32, 0xe8, 0xca, 0xe3, 0x19); - -#undef INTERFACE -#define INTERFACE ID3DX11Effect - -DECLARE_INTERFACE_(ID3DX11Effect, IUnknown) { - // IUnknown - - // ID3DX11Effect - STDMETHOD_(bool, IsValid) - (THIS) PURE; - - STDMETHOD(GetDevice) - (THIS_ _Outptr_ ID3D11Device * *ppDevice) PURE; - - STDMETHOD(GetDesc) - (THIS_ _Out_ D3DX11_EFFECT_DESC * pDesc) PURE; - - STDMETHOD_(ID3DX11EffectConstantBuffer *, GetConstantBufferByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectConstantBuffer *, GetConstantBufferByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3DX11EffectVariable *, GetVariableByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetVariableByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - STDMETHOD_(ID3DX11EffectVariable *, GetVariableBySemantic) - (THIS_ _In_z_ LPCSTR Semantic) PURE; - - STDMETHOD_(ID3DX11EffectGroup *, GetGroupByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectGroup *, GetGroupByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3DX11EffectTechnique *, GetTechniqueByIndex) - (THIS_ _In_ uint32_t Index) PURE; - STDMETHOD_(ID3DX11EffectTechnique *, GetTechniqueByName) - (THIS_ _In_z_ LPCSTR Name) PURE; - - STDMETHOD_(ID3D11ClassLinkage *, GetClassLinkage) - (THIS) PURE; - - STDMETHOD(CloneEffect) - (THIS_ _In_ uint32_t Flags, _Outptr_ ID3DX11Effect * *ppClonedEffect) PURE; - STDMETHOD(Optimize) - (THIS) PURE; - STDMETHOD_(bool, IsOptimized) - (THIS) PURE; -}; - - ////////////////////////////////////////////////////////////////////////////// - // APIs ////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//---------------------------------------------------------------------------- -// D3DX11CreateEffectFromMemory -// -// Creates an effect instance from a compiled effect in memory -// -// Parameters: -// -// [in] -// -// pData -// Blob of compiled effect data -// DataLength -// Length of the data blob -// FXFlags -// Flags pertaining to Effect creation -// pDevice -// Pointer to the D3D11 device on which to create Effect resources -// srcName [optional] -// ASCII string to use for debug object naming -// -// [out] -// -// ppEffect -// Address of the newly created Effect interface -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI D3DX11CreateEffectFromMemory(_In_reads_bytes_(DataLength) LPCVOID pData, - _In_ SIZE_T DataLength, - _In_ UINT FXFlags, - _In_ ID3D11Device *pDevice, - _Outptr_ ID3DX11Effect **ppEffect, - _In_opt_z_ LPCSTR srcName = nullptr); - -//---------------------------------------------------------------------------- -// D3DX11CreateEffectFromFile -// -// Creates an effect instance from a compiled effect data file -// -// Parameters: -// -// [in] -// -// pFileName -// Compiled effect file -// FXFlags -// Flags pertaining to Effect creation -// pDevice -// Pointer to the D3D11 device on which to create Effect resources -// -// [out] -// -// ppEffect -// Address of the newly created Effect interface -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI D3DX11CreateEffectFromFile(_In_z_ LPCWSTR pFileName, - _In_ UINT FXFlags, - _In_ ID3D11Device *pDevice, - _Outptr_ ID3DX11Effect **ppEffect); - -//---------------------------------------------------------------------------- -// D3DX11CompileEffectFromMemory -// -// Complies an effect shader source file in memory and then creates an effect instance -// -// Parameters: -// -// [in] -// -// pData -// Pointer to FX shader as an ASCII string -// DataLength -// Length of the FX shader ASCII string -// srcName [optional] -// ASCII string to use for debug object naming -// pDefines [optional] -// A NULL-terminated array of shader macros -// pInclude [optional] -// A pointer to an include interface -// HLSLFlags -// HLSL compile options (see D3DCOMPILE flags) -// FXFlags -// Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags) -// pDevice -// Pointer to the D3D11 device on which to create Effect resources -// -// [out] -// -// ppEffect -// Address of the newly created Effect interface -// -//---------------------------------------------------------------------------- - -HRESULT D3DX11CompileEffectFromMemory(_In_reads_bytes_(DataLength) LPCVOID pData, - _In_ SIZE_T DataLength, - _In_opt_z_ LPCSTR srcName, - _In_opt_ const D3D_SHADER_MACRO *pDefines, - _In_opt_ ID3DInclude *pInclude, - _In_ UINT HLSLFlags, - _In_ UINT FXFlags, - _In_ ID3D11Device *pDevice, - _Out_ ID3DX11Effect **ppEffect, - _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors); - -//---------------------------------------------------------------------------- -// D3DX11CompileEffectFromFile -// -// Complies an effect shader source file and then creates an effect instance -// -// Parameters: -// -// [in] -// -// pFileName -// FX shader source file -// pDefines [optional] -// A NULL-terminated array of shader macros -// pInclude [optional] -// A pointer to an include interface -// HLSLFlags -// HLSL compile options (see D3DCOMPILE flags) -// FXFlags -// Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags) -// pDevice -// Pointer to the D3D11 device on which to create Effect resources -// -// [out] -// -// ppEffect -// Address of the newly created Effect interface -// -//---------------------------------------------------------------------------- - -HRESULT D3DX11CompileEffectFromFile(_In_z_ LPCWSTR pFileName, - _In_opt_ const D3D_SHADER_MACRO *pDefines, - _In_opt_ ID3DInclude *pInclude, - _In_ UINT HLSLFlags, - _In_ UINT FXFlags, - _In_ ID3D11Device *pDevice, - _Out_ ID3DX11Effect **ppEffect, - _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors); - -//---------------------------------------------------------------------------- -// D3DX11DebugMute -// -// Controls the output of diagnostic information in DEBUG builds. No effect -// in RELEASE builds. -// -// Returns the previous state so you can do temporary suppression like: -// -// bool oldmute = D3DX11DebugMute(true); -// ... -// D3DX11DebugMute(oldmute); -// -//---------------------------------------------------------------------------- - -bool D3DX11DebugMute(bool mute); - -#ifdef __cplusplus -} -#endif //__cplusplus \ No newline at end of file From 7930677e893eba4a86fda27b51d0191c64af1472 Mon Sep 17 00:00:00 2001 From: OldGreggo5081 <73301294+OldGreggo5081@users.noreply.github.com> Date: Sun, 29 Aug 2021 19:50:25 +0100 Subject: [PATCH 397/419] Fucker eats cake (#4477) --- Horion/Module/Modules/Fucker.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/Fucker.cpp b/Horion/Module/Modules/Fucker.cpp index 41468b11..47247669 100644 --- a/Horion/Module/Modules/Fucker.cpp +++ b/Horion/Module/Modules/Fucker.cpp @@ -1,6 +1,6 @@ #include "Fucker.h" -Fucker::Fucker() : IModule(VK_NUMPAD9, Category::MISC, "Destroys beds around you") { +Fucker::Fucker() : IModule(VK_NUMPAD9, Category::MISC, "Destroys certain blocks around you") { registerIntSetting("Range", &this->range, this->range, 1, 10); registerBoolSetting("Beds", &this->beds, this->beds); registerBoolSetting("Eggs", &this->eggs, this->eggs); @@ -24,11 +24,12 @@ void Fucker::onTick(C_GameMode* gm) { for (int y = (int)pos->y - range; y < pos->y + range; y++) { vec3_ti blockPos = vec3_ti(x, y, z); bool destroy = false; + bool eat = false; auto id = gm->player->region->getBlock(blockPos)->toLegacy()->blockId; if (id == 26 && this->beds) destroy = true; // Beds if (id == 122 && this->eggs) destroy = true; // Dragon Eggs - if (id == 92 && this->cakes) destroy = true; // Cakes + if (id == 92 && this->cakes) eat = true; // Cakes if (id == 54 && this->chests) destroy = true; // Chests if (id == 458 && this->barrels) destroy = true; // Barrels @@ -37,6 +38,12 @@ void Fucker::onTick(C_GameMode* gm) { g_Data.getLocalPlayer()->swingArm(); return; } + + if (eat) { + gm->buildBlock(&blockPos, 0); + g_Data.getLocalPlayer()->swingArm(); + return; + } } } } From d595804cb7615ed356377da4457389c7f26f163e Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Sun, 29 Aug 2021 16:40:05 -0400 Subject: [PATCH 398/419] Undo broken/bad changes (#4492) --- SDK/CEntity.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index ad12599a..531d72f1 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -34,7 +34,7 @@ class C_Entity { public: uintptr_t *ptrToPtrToEntList; //0x0008 private: - char pad_0010[0x138]; //0x0010 + char pad_0010[0x130]; //0x0010 public: union { struct { @@ -52,7 +52,7 @@ class C_Entity { }; private: - char pad_0100[0x8]; //0x0130 + char pad_0100[0x10]; //0x0130 public: vec3_t eyePos0; //0x0140 private: @@ -899,4 +899,4 @@ class C_LocalPlayer : public C_Player { } void applyTurnDelta(vec2_t *viewAngleDelta); void setGameModeType(int gma); -}; \ No newline at end of file +}; From 3e741edade875e5da49c3be46ed42a94b5677d04 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 5 Sep 2021 00:06:17 +0200 Subject: [PATCH 399/419] comment out injector warning --- Memory/Hooks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 5a929b37..3007665a 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -335,6 +335,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { DrawUtils::setCtx(renderCtx, dat); + /* { static bool wasConnectedBefore = false; static LARGE_INTEGER start; @@ -375,6 +376,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { } else wasConnectedBefore = true; } + */ if (GameData::shouldHide() || !g_Hooks.shouldRender || !moduleMgr->isInitialized()) return oText(a1, renderCtx); From bcb9e6acce15b36d601dcb3a207dc425ab9c226c Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 5 Sep 2021 00:14:08 +0200 Subject: [PATCH 400/419] epic fail --- Memory/Hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 3007665a..47252e35 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -356,7 +356,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { hasSentWarning = true; auto box = g_Data.addInfoBox("Warning", "Your injector doesn't seem to connect to Horion correctly.\nYou can ignore this, but some features may not work as expected."); box->closeTimer = 5; - /*vec2_t windowSize = dat->windowSize; + vec2_t windowSize = dat->windowSize; DrawUtils::fillRectangle(vec4_t(0, 0, windowSize.x, windowSize.y), MC_Color(0.2f, 0.2f, 0.2f), 0.8f); @@ -368,7 +368,7 @@ __int64 Hooks::RenderText(__int64 a1, C_MinecraftUIRenderContext* renderCtx) { text = "Uninject by holding down CTRL + L"; DrawUtils::drawText(vec2_t(windowSize.x / 2 - DrawUtils::getTextWidth(&text, 0.7f) / 2, windowSize.y * 0.8f), &text, MC_Color(), 0.7f); - DrawUtils::flush();*/ + DrawUtils::flush(); } if (!hasSentWarning) // Wait for injector, it might connect in time From 4551019843d4caaa67be21a2ede44d4930de554a Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 6 Sep 2021 08:34:59 -0400 Subject: [PATCH 401/419] Fix .nbt save command, Chest Stealer and Item Rendering (#4500) --- Horion/Module/Modules/ChestStealer.cpp | 2 +- Horion/Module/Modules/HudModule.cpp | 4 ++-- SDK/CInventory.cpp | 2 +- SDK/CInventory.h | 4 +++- SDK/CItem.cpp | 6 +++--- SDK/CItem.h | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Horion/Module/Modules/ChestStealer.cpp b/Horion/Module/Modules/ChestStealer.cpp index f94b42e7..d00282b8 100644 --- a/Horion/Module/Modules/ChestStealer.cpp +++ b/Horion/Module/Modules/ChestStealer.cpp @@ -30,7 +30,7 @@ void ChestStealer::chestScreenController_tick(C_ChestScreenController* c) { } else { delay++; if (delay > setDelay) { - c->leaveScreen(); + c->tryExit(); delay = 0; } } diff --git a/Horion/Module/Modules/HudModule.cpp b/Horion/Module/Modules/HudModule.cpp index da5a3284..4607419d 100644 --- a/Horion/Module/Modules/HudModule.cpp +++ b/Horion/Module/Modules/HudModule.cpp @@ -147,7 +147,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { } } { // ArmorHUD - /* + if (!(g_Data.getLocalPlayer() == nullptr || !this->displayArmor || !GameData::canUseMoveKeys())) { static float constexpr scale = 1.f; static float constexpr opacity = 0.25f; @@ -167,7 +167,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) { //x += scale * spacing; if (item->isValid()) DrawUtils::drawItem(item, vec2_t(x, y), opacity, scale, item->isEnchanted()); - }*/ + } } { // Keystrokes if (!(g_Data.getLocalPlayer() == nullptr || !this->keystrokes || !GameData::canUseMoveKeys())) { diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index fe37cce2..26c8f97c 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -27,7 +27,7 @@ bool C_Inventory::isFull() { void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); - static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 07 4D 8B F9 4D 8B E8")); + static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 30 ?? ?? ?? ?? ?? C4 48 89 45 ?? 45 8B E1 49 8B F0 44 8B EA 89 54 24 30 4C 8B F1")); TextHolder txt = TextHolder(name); diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 1727bc70..63f1a28b 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -74,6 +74,7 @@ class C_PlayerInventoryProxy { C_Inventory* inventory; //0x00B0 }; +//Im not sure exactly where these unknown's go but the funcs we use work. class C_ContainerScreenController { private: virtual __int64 destructor(); @@ -85,6 +86,7 @@ class C_ContainerScreenController { virtual __int64 onTerminate(void); virtual __int64 onInit(void); virtual __int64 onDelete(void); + virtual __int64 unknown1(); public: virtual bool canExit(void); @@ -94,8 +96,8 @@ class C_ContainerScreenController { virtual __int64 areControllerTabsEnabled(void); virtual __int64 onCreation(void); virtual __int64 logCreationTime(std::string const&, double, double, unsigned char); - virtual __int64 unknown1(); virtual __int64 unknown2(); + virtual __int64 unknown3(); public: virtual __int64 onLeave(void); diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index b3c974c6..747195d0 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -7,12 +7,12 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C_ClientInstance *client, MinecraftGame *game) { memset(this, 0, sizeof(C_BaseActorRenderContext)); using BaseActorRenderContext_t = __int64(__fastcall *)(C_BaseActorRenderContext *, C_ScreenContext *, C_ClientInstance *, MinecraftGame *); - static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 8B EA 48 89 01 48 8B F9 48 8B 71 ?? 48 8B 59 30 48")); + static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 74 24 ?? 48 89 4C 24 08 57 48 83 EC ?? ?? ?? ?? 48 8B F9 48 8D 05 ?? ?? ?? ?? 48 89 ?? 33 F6 48 89 71 08")); BaseActorRenderContext_constructor(this, ScreenCtx, client, game); } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); - static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("40 53 55 57 41 55 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B 40 ? 49 8B D8 48 8B EA 4C 8B E9 48 85 C0")); + static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 48 89 58 20 55 56 57 41 54 41 55 41 56 41 57 48 81 EC 00 01 00 00 0F 29 70 B8 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ??")); item->setShowPickUp(false); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } @@ -47,7 +47,7 @@ void C_ItemStack::fromTag(const Tag &tag) { } void C_ItemStack::save(CompoundTag **tag) { using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **); - ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC 90 ?? ?? ?? 48 8B F2 48 8B F9 48 89 55 17 4C 8B 79")); + ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ?? 55 56 57 41 56 41 57 48 8D 6C 24 C9 48 81 EC ?? ?? ?? ?? 48 8B FA 48 8B F1 48 89 55 0F 45 33 ?? 44 89 7D 97 33 C0")); return save(this, tag); } void C_ItemStack::setUserData(std::unique_ptr tag) { diff --git a/SDK/CItem.h b/SDK/CItem.h index fbd92e27..28902485 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -18,7 +18,7 @@ class MinecraftGame; class C_BaseActorRenderContext { private: - char pad_0x0[0x58]; //0x0000 + char pad_0x0[0x60]; //0x0000 public: C_ItemRenderer* renderer; //0x0058 private: @@ -359,7 +359,7 @@ class C_ItemStack { class C_ArmorItem : public C_Item { private: - char pad_0x108[0xB8]; //0x100 + char pad_0x108[0x228 - sizeof(C_Item)]; //0x100 public: int ArmorSlot; //0x1B8 From e26ba044d4406a4ea5df4b848b559a3d573f344d Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 6 Sep 2021 08:44:29 -0400 Subject: [PATCH 402/419] Renamed InfiniteReach to InfiniteAura (#4498) --- Horion.vcxproj | 4 ++-- Horion/Module/ModuleManager.cpp | 2 +- Horion/Module/ModuleManager.h | 2 +- .../{InfiniteReach.cpp => InfiniteAura.cpp} | 14 +++++++------- .../Modules/{InfiniteReach.h => InfiniteAura.h} | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) rename Horion/Module/Modules/{InfiniteReach.cpp => InfiniteAura.cpp} (89%) rename Horion/Module/Modules/{InfiniteReach.h => InfiniteAura.h} (78%) diff --git a/Horion.vcxproj b/Horion.vcxproj index 56bf0353..456d44eb 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -319,7 +319,7 @@ - + @@ -508,7 +508,7 @@ - + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 4f107857..3a60ac1f 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -48,7 +48,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Fucker())); this->moduleList.push_back(std::shared_ptr(new NoSlowDown())); this->moduleList.push_back(std::shared_ptr(new AutoTotem())); - this->moduleList.push_back(std::shared_ptr(new InfiniteReach())); + this->moduleList.push_back(std::shared_ptr(new InfiniteAura())); this->moduleList.push_back(std::shared_ptr(new ClickGuiMod())); this->moduleList.push_back(std::shared_ptr(new ChestStealer())); this->moduleList.push_back(std::shared_ptr(new Fly())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index 7e149148..cb0dd203 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -45,7 +45,7 @@ #include "Modules/Hitbox.h" #include "Modules/HudModule.h" #include "Modules/ExtendedBlockReach.h" -#include "Modules/InfiniteReach.h" +#include "Modules/InfiniteAura.h" #include "Modules/InstaBreak.h" #include "Modules/InventoryCleaner.h" #include "Modules/InventoryMove.h" diff --git a/Horion/Module/Modules/InfiniteReach.cpp b/Horion/Module/Modules/InfiniteAura.cpp similarity index 89% rename from Horion/Module/Modules/InfiniteReach.cpp rename to Horion/Module/Modules/InfiniteAura.cpp index 87e2cbe4..2a982b15 100644 --- a/Horion/Module/Modules/InfiniteReach.cpp +++ b/Horion/Module/Modules/InfiniteAura.cpp @@ -1,22 +1,22 @@ -#include "InfiniteReach.h" +#include "InfiniteAura.h" -InfiniteReach::InfiniteReach() : IModule(0, Category::COMBAT, "Killaura with infinite reach") { +InfiniteAura::InfiniteAura() : IModule(0, Category::COMBAT, "Killaura with infinite reach") { this->registerBoolSetting("multiaura", &this->isMulti, this->isMulti); this->registerFloatSetting("range", &this->range, this->range, 15, 100); this->registerIntSetting("delay", &this->delay, this->delay, 15, 20); } -InfiniteReach::~InfiniteReach() { +InfiniteAura::~InfiniteAura() { } -const char* InfiniteReach::getModuleName() { +const char* InfiniteAura::getModuleName() { return ("InfiniteAura"); } static std::vector targetList0; void findEntities(C_Entity* currentEntity, bool isRegularEntitie) { - static auto infiniteReachMod = moduleMgr->getModule(); + static auto infiniteAuraMod = moduleMgr->getModule(); if (currentEntity == g_Data.getLocalPlayer()) // Skip Local player return; @@ -35,12 +35,12 @@ void findEntities(C_Entity* currentEntity, bool isRegularEntitie) { float dist = (*currentEntity->getPos()).dist(*g_Data.getLocalPlayer()->getPos()); - if (dist < infiniteReachMod->range) { + if (dist < infiniteAuraMod->range) { targetList0.push_back(currentEntity); } } -void InfiniteReach::onTick(C_GameMode* gm) { +void InfiniteAura::onTick(C_GameMode* gm) { //Loop through all our players and retrieve their information targetList0.clear(); diff --git a/Horion/Module/Modules/InfiniteReach.h b/Horion/Module/Modules/InfiniteAura.h similarity index 78% rename from Horion/Module/Modules/InfiniteReach.h rename to Horion/Module/Modules/InfiniteAura.h index fb0ddffc..5658023a 100644 --- a/Horion/Module/Modules/InfiniteReach.h +++ b/Horion/Module/Modules/InfiniteAura.h @@ -3,7 +3,7 @@ #include "Module.h" #include "../ModuleManager.h" -class InfiniteReach : public IModule { +class InfiniteAura : public IModule { private: int delay = 15; int Odelay = 0; @@ -11,8 +11,8 @@ class InfiniteReach : public IModule { public: float range = 15; - InfiniteReach(); - ~InfiniteReach(); + InfiniteAura(); + ~InfiniteAura(); // Inherited via IModule virtual const char* getModuleName() override; virtual void onTick(C_GameMode* gm) override; From edf255c9241372c5e31c94f1e2438cb8937fca9e Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 6 Sep 2021 16:30:57 +0200 Subject: [PATCH 403/419] improve readme --- README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bd45e455..f1febcb0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ -[![Download the injector](https://img.shields.io/badge/download-injector-brightgreen?style=for-the-badge "Download the injector")](https://horion.download/injector "Download the injector") -

    - -

    -
    - -**Horion** is a Minecraft: Bedrock Edition utility mod designed to enhance gameplay. We do not take responsibility in anything done with this utility mod. +
    +
    +

    + Horion +

    +
    +

    + Download Injector + Discord server + Build Status + License +

    +

    + Horion is a Minecraft: Bedrock Edition utility mod designed to enhance gameplay. We do not take responsibility in anything done with this utility mod. If you want to contribute to this project, feel free to fork this repository and submit a pull request. - -[![Discord](https://img.shields.io/discord/732833913705201736?label=chat&logo=discord&logoColor=white&style=for-the-badge)](https://horion.download/discord) - -[![Build Status](https://img.shields.io/azure-devops/build/horionclient/Horion/2?label=dev%20release&style=for-the-badge)](https://dev.azure.com/horionclient/Horion/_build/latest?definitionId=2&branchName=master) -[![License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc/4.0/) +

    +
    ## Contributing To contribute, simply **fork the repository**, edit the code, and **submit a pull request**. From 5a45558ebda70d468f918e6857721a5db71002c8 Mon Sep 17 00:00:00 2001 From: GodGamer029 <43895351+GodGamer029@users.noreply.github.com> Date: Mon, 6 Sep 2021 18:45:33 +0200 Subject: [PATCH 404/419] Add files via upload --- .github/conce.png | Bin 0 -> 26112 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/conce.png diff --git a/.github/conce.png b/.github/conce.png new file mode 100644 index 0000000000000000000000000000000000000000..f313a674449d42e9e5456100a3f78252922447bc GIT binary patch literal 26112 zcmZs?by$>L*Ec-srKm^?C`brHmvkwJ48oAo4T5xsbgATk5<^LjjC6O0A_7B7H%Lo& z4Eb)n?)SN$_xQd))MM6h?zLC^R_wL6h*yfzcy}r8LLd-4xC~4M0=a1ofn1NfeH~DW zAL<=}f37*JNWXv-_B>hvKmIY7P>_H?N+NL2jBbM8cN}E2ogonXA6I{_wb^HzKp>{E zaF~ReyTQiP_o#{bVa`d)&QHs6k~>{SLf5i>_tCuTR3%9MCc4w2j{ogWvZ0E71w%-T z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x{-&nlC&Q`WKN5! z(KMtZctnTehYME2LnG)oQM3`NieO3|;Dp$k(DRfoFAE-*y$x;w;M;Fb3KNDfDwS(a z9zKt^chnX^8^%4td&Tl;aJ)qo_&bXK4V}-lpq;MOF~n@(C^!QsdS@Prrd(cVjUjnJ z{21xi%>c>dzHr%Y4?mCjfowq@b1{RqA?(3Cc>A_{SFa;gf(9SDDu#BI2uuGRV}bx1bPa1ayrtQ(4(dvUpwW?4a1leEMA+j23_+M9F8nBv{zv{I{a;Ox zEDno}yTx&Y@DyD|HqpUn<|dWnGpF&QredVXEgTXBM7S@&3XSglh{pnUp3ga+Y8=C{ z4==UpDDSt}&>CwyYZRpyTUVk<`l`j@BZghpBol~u`)Ijpa*Y9Ryj2#aU4o+`^hUY0 zT{7Hupssxb?e*#J+YZF+Qt}hch9a@H!8=prd-O0r!Y~`VRsJ<ufQjVlh0=`=_uC`v{@%jdA7|EVR zFOozs42Qvbwl)8M5oV`pL~V+&z&YjCb>^5bCT}6n+M`bhXS~T pCM_2AI8o3NtUFu7USDKy%E&}#u$+Y+!8;`fiJ*(mKW+Q_{{fcc)NlX* literal 0 HcmV?d00001 From bad0128a6efb94dd63b15781af2cf0f9ece6a099 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Tue, 7 Sep 2021 12:58:47 -0400 Subject: [PATCH 405/419] Add Ender-Chests to ChestAura (#4502) --- Horion/Module/Modules/ChestAura.cpp | 8 ++++++-- Horion/Module/Modules/ChestAura.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Horion/Module/Modules/ChestAura.cpp b/Horion/Module/Modules/ChestAura.cpp index 1dd44d82..5b356787 100644 --- a/Horion/Module/Modules/ChestAura.cpp +++ b/Horion/Module/Modules/ChestAura.cpp @@ -2,6 +2,7 @@ ChestAura::ChestAura() : IModule(0, Category::PLAYER, "Aura for opening chests") { registerIntSetting("Range", &this->range, this->range, 1, 10); + registerBoolSetting("EnderChests", &this->enderchests, this->enderchests); } ChestAura::~ChestAura() { @@ -22,13 +23,16 @@ void ChestAura::onTick(C_GameMode* gm) { vec3_ti pos = vec3_ti(x, y, z); C_Block* block = gm->player->region->getBlock(pos); if (block != nullptr && g_Data.canUseMoveKeys()) { - if (block->toLegacy()->blockId == 54) { + auto id = gm->player->region->getBlock(pos)->toLegacy()->blockId; + bool open = false; + if (id == 54) open = true; // Chests + if (id == 130 && enderchests) open = true; // EnderCheats + if (open) if (!(std::find(chestlist.begin(), chestlist.end(), pos) != chestlist.end())) { gm->buildBlock(&pos, 0); chestlist.push_back(pos); return; } - } } } } diff --git a/Horion/Module/Modules/ChestAura.h b/Horion/Module/Modules/ChestAura.h index 4593798b..2ec53f6f 100644 --- a/Horion/Module/Modules/ChestAura.h +++ b/Horion/Module/Modules/ChestAura.h @@ -5,6 +5,7 @@ class ChestAura : public IModule { private: int range = 3; + bool enderchests = false; public: C_MoveInputHandler* inputHandler = nullptr; From c90528917fee8264c731609113a59b366389adcb Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Wed, 8 Sep 2021 13:14:32 -0400 Subject: [PATCH 406/419] Adjust ChestESP color for trapped chests (#4503) --- Horion/Module/Modules/ChestESP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/ChestESP.cpp index 7f8c4575..a8e8123c 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/ChestESP.cpp @@ -33,7 +33,7 @@ void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { mathVect.y = floor(mathVect.y); if (storageID == 54) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Normal Chest - if (storageID == 146) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Trapped Chest + if (storageID == 146) DrawUtils::setColor(.92f, .14f, .14f, math); // Trapped Chest if (storageID == 130) DrawUtils::setColor(0.435294f, 0.215686f, 0.631372f, math); // Ender Chest DrawUtils::drawBox(chest.lower, chest.upper, (float)fmax(0.2f, 1 / (float)fmax(1, g_Data.getLocalPlayer()->eyePos0.dist(chest.lower))), true); // Fancy math to give an illusion of good esp From ad69b1c440fc3e6adaa480b1e8d0747afdc77985 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:41:03 -0400 Subject: [PATCH 407/419] Fix code error (#4509) --- Memory/Hooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 47252e35..10820c0d 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -79,7 +79,7 @@ void Hooks::Init() { int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** moveInputVtable = reinterpret_cast(sigOffset + offset + 7); if (moveInputVtable == 0x0 || sigOffset == 0x0) - logF("C_GameMode signature not working!!!"); + logF("C_MoveInputHandler signature not working!!!"); else { g_Hooks.MoveInputHandler_tickHook = std::make_unique(moveInputVtable[1], Hooks::MoveInputHandler_tick); } From 29ec16c1c5cf1e1bd6531b705c26ec74e86c4602 Mon Sep 17 00:00:00 2001 From: MrDiamond64 <49098391+MrDiamond64@users.noreply.github.com> Date: Sat, 11 Sep 2021 15:45:54 -0600 Subject: [PATCH 408/419] fixed crash with cbe (#4512) --- Horion/Command/Commands/CommandBlockExploitCommand.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Horion/Command/Commands/CommandBlockExploitCommand.cpp b/Horion/Command/Commands/CommandBlockExploitCommand.cpp index 6e391986..68703a33 100644 --- a/Horion/Command/Commands/CommandBlockExploitCommand.cpp +++ b/Horion/Command/Commands/CommandBlockExploitCommand.cpp @@ -55,6 +55,8 @@ bool CommandBlockExploitCommand::execute(std::vector* args) { std::string tag = R"({Count:1b,Damage:0s,Name:"minecraft:movingblock",tag:{movingEntity:{id:"Beehive",Occupants:[{ActorIdentifier:"minecraft:command_block_minecart<>",SaveData:{Command:")" + cmd + R"(",definitions:["+minecraft:moving_block"],identifier:"minecraft:command_block_minecart",Persistent:1b,Ticking:1b,TicksLeftToStay:1}}]},pistonPosX:0,movingBlock:{name:"minecraft:air"},pistonPosY:0,pistonPosZ:0,ench:[{id:28s,lvl:1s}],display:{Name:"§g§lInvisible Beehive Command",Lore:[")" + cmd + R"("]}}})"; item->fromTag(*Mojangson::parseTag(tag)); } + + else return false; g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, item, nullptr, 1, 507, 99999)); g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(item); From 10a1a113bb6c08653769d3b3f7c132cdc6fc5180 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Thu, 23 Sep 2021 10:24:36 -0400 Subject: [PATCH 409/419] Horion (#4529) From 5b037ad62ef9e1bdda9acf9e167d3634eb3956a6 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:14:37 -0400 Subject: [PATCH 410/419] Refactor ChestESP to StorageESP (#4514) * StorageESP * Update and rename ChestESP.h to StorageESP.h * Update and rename ChestESP.cpp to StorageESP.cpp * Update ModuleManager.cpp * Finish StorageESP * fix build error * Update Horion.vcxproj --- Horion.vcxproj | 4 ++-- Horion/Module/ModuleManager.cpp | 2 +- Horion/Module/ModuleManager.h | 2 +- .../Modules/{ChestESP.cpp => StorageESP.cpp} | 17 ++++++++++------- .../Module/Modules/{ChestESP.h => StorageESP.h} | 6 +++--- Memory/Hooks.cpp | 4 ++-- 6 files changed, 19 insertions(+), 16 deletions(-) rename Horion/Module/Modules/{ChestESP.cpp => StorageESP.cpp} (72%) rename Horion/Module/Modules/{ChestESP.h => StorageESP.h} (83%) diff --git a/Horion.vcxproj b/Horion.vcxproj index 456d44eb..09bb9816 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -294,7 +294,7 @@ - + @@ -653,4 +653,4 @@ - \ No newline at end of file + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 3a60ac1f..4d845e15 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -25,7 +25,7 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new Jetpack())); this->moduleList.push_back(std::shared_ptr(new Aimbot())); this->moduleList.push_back(std::shared_ptr(new TriggerBot())); - this->moduleList.push_back(std::shared_ptr(new ChestESP())); + this->moduleList.push_back(std::shared_ptr(new StorageESP())); this->moduleList.push_back(std::shared_ptr(new Velocity())); this->moduleList.push_back(std::shared_ptr(new RainbowSky())); this->moduleList.push_back(std::shared_ptr(new AirJump())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index cb0dd203..5c8310af 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -25,7 +25,7 @@ #include "Modules/BowAimbot.h" #include "Modules/AntiVoid.h" #include "Modules/ChestAura.h" -#include "Modules/ChestESP.h" +#include "Modules/StorageESP.h" #include "Modules/ChestStealer.h" #include "Modules/ClickGuiMod.h" #include "Modules/Teleport.h" diff --git a/Horion/Module/Modules/ChestESP.cpp b/Horion/Module/Modules/StorageESP.cpp similarity index 72% rename from Horion/Module/Modules/ChestESP.cpp rename to Horion/Module/Modules/StorageESP.cpp index a8e8123c..572fa995 100644 --- a/Horion/Module/Modules/ChestESP.cpp +++ b/Horion/Module/Modules/StorageESP.cpp @@ -1,17 +1,17 @@ -#include "ChestESP.h" +#include "StorageESP.h" #include "../../DrawUtils.h" -ChestESP::ChestESP() : IModule(0, Category::VISUAL, "ESP for chests") { +StorageESP::StorageESP() : IModule(0, Category::VISUAL, "ESP for storage blocks") { } -ChestESP::~ChestESP() { +StorageESP::~StorageESP() { } -const char* ChestESP::getModuleName() { - return ("ChestESP"); +const char* StorageESP::getModuleName() { + return ("StorageESP"); } -void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { +void StorageESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (!g_Data.isInGame() || !GameData::canUseMoveKeys() || g_Data.getLocalPlayer() == nullptr) return; @@ -35,12 +35,15 @@ void ChestESP::onPreRender(C_MinecraftUIRenderContext* renderCtx) { if (storageID == 54) DrawUtils::setColor(1.f, 1.f, 1.f, math); // Normal Chest if (storageID == 146) DrawUtils::setColor(.92f, .14f, .14f, math); // Trapped Chest if (storageID == 130) DrawUtils::setColor(0.435294f, 0.215686f, 0.631372f, math); // Ender Chest + if (storageID == 458) DrawUtils::setColor(0.62, 0.31, 0.04, math); // Barrel + if (storageID == 205) DrawUtils::setColor(.49f, .17f, .95f, math); // Undyed Shulker Box + if (storageID == 218) DrawUtils::setColor(.08f, .91f, .99f, math); // Shulker Box DrawUtils::drawBox(chest.lower, chest.upper, (float)fmax(0.2f, 1 / (float)fmax(1, g_Data.getLocalPlayer()->eyePos0.dist(chest.lower))), true); // Fancy math to give an illusion of good esp } } -void ChestESP::onTick(C_GameMode* gm) { +void StorageESP::onTick(C_GameMode* gm) { // Swap list auto listLock = g_Data.lockChestList(); auto& chestList = g_Data.getChestList(); diff --git a/Horion/Module/Modules/ChestESP.h b/Horion/Module/Modules/StorageESP.h similarity index 83% rename from Horion/Module/Modules/ChestESP.h rename to Horion/Module/Modules/StorageESP.h index 1c644911..0393f306 100644 --- a/Horion/Module/Modules/ChestESP.h +++ b/Horion/Module/Modules/StorageESP.h @@ -2,15 +2,15 @@ #include "Module.h" -class ChestESP : public IModule { +class StorageESP : public IModule { private: int tickTimeout = 0; std::vector bufferedChestList; std::mutex listLock; public: - ChestESP(); - ~ChestESP(); + StorageESP(); + ~StorageESP(); // Inherited via IModule virtual const char* getModuleName() override; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 10820c0d..a32d7936 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -868,8 +868,8 @@ float Hooks::Dimension_getSunIntensity(__int64 a1, float a2, vec3_t* a3, float a void Hooks::ChestBlockActor_tick(C_ChestBlockActor* _this, void* a) { static auto oTick = g_Hooks.ChestBlockActor_tickHook->GetFastcall(); oTick(_this, a); - static auto* chestEspMod = moduleMgr->getModule(); - if (_this != nullptr && chestEspMod->isEnabled()) + static auto* storageEspMod = moduleMgr->getModule(); + if (_this != nullptr && storageEspMod->isEnabled()) GameData::addChestToList(_this); } From e50cec58f162ad044a31da8fc1479c59fa55a1b0 Mon Sep 17 00:00:00 2001 From: MrDiamond64 <49098391+MrDiamond64@users.noreply.github.com> Date: Mon, 4 Oct 2021 07:17:14 -0600 Subject: [PATCH 411/419] Make Killaura ignore arrows (#4515) * killaura no longer attacks arrows * doesnt attack NPC's now * move --- Horion/Module/Modules/Killaura.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index a829629d..17b6bdf0 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -47,6 +47,10 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { return; if(currentEntity->getEntityTypeId() == 64) // item return; + if (currentEntity->getEntityTypeId() == 80) // Arrows + return; + if (currentEntity->getEntityTypeId() == 51) // NPC + return; } else { if (!Target::isValidTarget(currentEntity)) return; From a0999280895e48f7db0790bf99b5063b3016a4f2 Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:17:51 -0400 Subject: [PATCH 412/419] Wtf borion clien (#4518) --- SDK/CEntity.h | 14 +++++--------- SDK/CItem.cpp | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 531d72f1..d956c5ce 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -153,7 +153,7 @@ class C_Entity { public: virtual void setPos(vec3_t const &); - virtual bool filler(); + virtual bool isRuntimePredictedMovementEnabled(void); virtual vec3_t *getPredictedMovementValues(void) const; virtual vec3_t *getPos(void) const; // getStateVectorComponent virtual vec3_t *getPosOld(void) const; @@ -273,12 +273,8 @@ class C_Entity { virtual bool isCreativeModeAllowed(void); virtual bool isSurfaceMob(void) const; virtual bool isTargetable(void) const; - -private: - virtual bool unk1(void) const; - virtual bool unk2(void) const; - -public: + virtual bool isLocalPlayer(void); + virtual bool isPlayer(void); virtual bool isAffectedByWaterBottle(void) const; virtual bool canAttack(C_Entity *, bool) const; virtual void setTarget(C_Entity *); @@ -508,8 +504,8 @@ class C_Entity { virtual __int64 reloadLootTable(void); virtual __int64 reloadLootTable(__int64 const *); virtual __int64 getLootTable(void) const; - virtual __int64 filler_2(void) const; - virtual __int64 filler_3(void) const; + virtual __int64 getDefaultLootTable(void); + virtual __int64 getDeletionDelayTimeSeconds(void); virtual __int64 kill(void); virtual __int64 die(__int64 const &); virtual __int64 shouldTick(void) const; diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 747195d0..16aa0099 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -52,7 +52,7 @@ void C_ItemStack::save(CompoundTag **tag) { } void C_ItemStack::setUserData(std::unique_ptr tag) { using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); - setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B DA 48 8D 51 50 48 3B D3 74 1F 48 8B 03 48 C7 03 ?? ?? ?? ??")); + setUserData_t setUserData = reinterpret_cast(FindSignature("48 89 5C 24 18 55 56 57 48 81 EC ? ? ? ? 48 8B 05 8A ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 48 8B FA")); setUserData(this, std::move(tag)); } void C_ItemStack::reinit(C_BlockLegacy &legacy, int count) { From c3f258b3c6ed20bc91d7781395d26f3f4304f01f Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:19:06 -0400 Subject: [PATCH 413/419] MobESP can now be rainbow (#4517) --- Horion/Module/Modules/ESP.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Horion/Module/Modules/ESP.cpp b/Horion/Module/Modules/ESP.cpp index 256f4257..e5ad7ddb 100644 --- a/Horion/Module/Modules/ESP.cpp +++ b/Horion/Module/Modules/ESP.cpp @@ -42,7 +42,10 @@ void doRenderStuff(C_Entity* ent, bool isRegularEntitie) { if (!localPlayer->canAttack(ent, false)) return; - DrawUtils::setColor(0.2f, 0.2f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + if (espMod->doRainbow) + DrawUtils::setColor(rcolors[0], rcolors[1], rcolors[2], (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); + else + DrawUtils::setColor(0.9f, 0.9f, 0.9f, (float)fmax(0.1f, (float)fmin(1.f, 15 / (ent->damageTime + 1)))); } else return; if (espMod->is2d) From b36345aa45c34ce380a65f19ae6d6ea74f29e388 Mon Sep 17 00:00:00 2001 From: NRGJobro <85864573+NRGJobro@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:20:45 -0400 Subject: [PATCH 414/419] Fixed .give nbt support. ex: .give dirt 1 0 1 (#4522) * Fixed .give nbt support. ex: .give dirt 1 0 1 * Fixed .give nbt support. ex: .give dirt 1 0 1 Fixed .give nbt support. ex: .give dirt 1 0 1. Credits to theclashingfritz for the multiple stack support pull. * Fixed .give nbt support. ex: .give dirt 1 0 1 Fixed .give nbt support. ex: .give dirt 1 0 1. Credits to theclashingfritz for the multiple stack support pull. --- Horion/Command/Commands/GiveCommand.cpp | 191 ++++++++++++++++++------ Horion/Command/Commands/GiveCommand.h | 6 +- 2 files changed, 154 insertions(+), 43 deletions(-) diff --git a/Horion/Command/Commands/GiveCommand.cpp b/Horion/Command/Commands/GiveCommand.cpp index 9612f8c9..cbeae788 100644 --- a/Horion/Command/Commands/GiveCommand.cpp +++ b/Horion/Command/Commands/GiveCommand.cpp @@ -1,6 +1,7 @@ #include "GiveCommand.h" -#include "../../../Utils/Utils.h" + #include "../../../SDK/Tag.h" +#include "../../../Utils/Utils.h" GiveCommand::GiveCommand() : IMCCommand("give", "spawn items", " [itemData] [NBT]") { } @@ -8,77 +9,183 @@ GiveCommand::GiveCommand() : IMCCommand("give", "spawn items", " * args) { +bool GiveCommand::execute(std::vector *args) { assertTrue(args->size() > 2); int itemId = 0; - char count = static_cast(assertInt(args->at(2))); + uint32_t fullCount = static_cast(assertInt(args->at(2))); + unsigned int stackCount = fullCount / 64; // Get the amount of stacks we have. + char count = fullCount % 64; // Get the amount we have left. char itemData = 0; - if (args->size() > 3) + if (args->size() > 3) { itemData = static_cast(assertInt(args->at(3))); + } try { itemId = std::stoi(args->at(1)); - } catch (const std::invalid_argument&) { + } catch (const std::invalid_argument &) { } - C_Inventory* inv = g_Data.getLocalPlayer()->getSupplies()->inventory; - C_ItemStack* yot = nullptr; - auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); + //clientMessageF("%sDEBUG:%s Will give %d stacks!", RED, GREEN, stackCount); + //clientMessageF("%sDEBUG:%s Will give %d as a remainder!", RED, GREEN, count); - if (itemId == 0) { - TextHolder tempText(args->at(1)); - std::unique_ptr ItemPtr = std::make_unique(); - std::unique_ptr buffer = std::make_unique(); - C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr.get(), buffer.get(), tempText); - if (*cStack == nullptr) { - clientMessageF("%sInvalid item name!", RED); - return true; + // Give us all the stacks of the items we want. + for (unsigned int i = 0; i < stackCount; i++) { + //clientMessageF("%sDEBUG:%s Giving stack %d of items!", RED, GREEN, i + 1); + std::string tag; + bool success = false; + + if (args->size() > 4) { + std::string tag = Utils::getClipboardText(); } - yot = new C_ItemStack(***cStack, count, itemData); - } else { - std::unique_ptr ItemPtr = std::make_unique(); - C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr.get(), itemId); - if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) { - clientMessageF("%sInvalid item ID!", RED); - return true; + if (itemId == 0) { + TextHolder tempText(args->at(1)); + success = giveItem(64, tempText, itemData, tag); + } else { + success = giveItem(64, itemId, itemData, tag); } - yot = new C_ItemStack(***cStack, count, itemData); + // If one of these fail. Then something went wrong. + // Return to prevent a possible spam of error messages. + if (!success) return true; } - if (yot != nullptr) - yot->count = count; - - int slot = inv->getFirstEmptySlot(); + // Now give us our remainder. + if (count >= 1) { + //clientMessageF("%sDEBUG:%s Giving remaining %d items!", RED, GREEN, count); + std::string tag; + bool success = false; + if (args->size() > 4) { + std::string tag = Utils::getClipboardText(); + } + if (itemId == 0) { + TextHolder tempText(args->at(1)); + success = giveItem(count, tempText, itemData, tag); + } else { + success = giveItem(count, itemId, itemData, tag); + } + if (!success) return true; + } + C_Inventory *inv = g_Data.getLocalPlayer()->getSupplies()->inventory; + C_ItemStack *item = g_Data.getLocalPlayer()->getSelectedItem(); if (args->size() > 4) { - std::string tag = Utils::getClipboardText(); + std::string tag; + tag = Utils::getClipboardText(); + if (args->size() > 4) { + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, item, nullptr, 1, 507, 99999)); + } + if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { - yot->setUserData(std::move(Mojangson::parseTag(tag))); + if (args->size() > 4) { + item->setUserData(std::move(Mojangson::parseTag(tag))); + } + } else { + clientMessageF("%sInvalid NBT tag!", RED); + return true; } + + if (args->size() > 4) { + g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, nullptr, nullptr, item, nullptr, 1, 507, 99999)); + } + clientMessageF("%s%s", GREEN, "Successfully loaded mojangson !"); + } + if (args->size() > 4) { + C_InventoryAction *firstAction = nullptr; + auto transactionMan = g_Data.getLocalPlayer()->getTransactionManager(); + firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999); + transactionMan->addInventoryAction(*firstAction); + inv->addItemToFirstEmptySlot(item); + } + + clientMessageF("%sSuccessfully gave items!", GREEN); + return true; +} + +bool GiveCommand::giveItem(uint8_t count, int itemId, uint8_t itemData, std::string &tag) { + C_Inventory *inv = g_Data.getLocalPlayer()->getSupplies()->inventory; + C_ItemStack *itemStack = nullptr; + auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); + + std::unique_ptr ItemPtr = std::make_unique(); + C_Item ***cStack = ItemRegistry::getItemFromId(ItemPtr.get(), itemId); + if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) { + clientMessageF("%sInvalid item ID!", RED); + return false; } + itemStack = new C_ItemStack(***cStack, count, itemData); - ItemDescriptor* desc = nullptr; - desc = new ItemDescriptor((*yot->item)->itemId, itemData); + if (itemStack != nullptr) { + itemStack->count = count; + } - C_InventoryAction* firstAction = nullptr; - C_InventoryAction* secondAction = nullptr; + int slot = inv->getFirstEmptySlot(); - firstAction = new C_InventoryAction(0, desc,nullptr,yot, nullptr,count, 507, 99999); - secondAction = new C_InventoryAction(slot, nullptr, desc,nullptr, yot,count); + if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { + //itemStack->setUserData(std::move(Mojangson::parseTag(tag))); + itemStack->fromTag(*Mojangson::parseTag(tag)); + } - //firstAction = new C_InventoryAction(0,yot, nullptr, 507, 99999); - //secondAction = new C_InventoryAction(slot, nullptr, yot); + ItemDescriptor *desc = new ItemDescriptor((*itemStack->item)->itemId, itemData); + + // If we add the second action, Only one stack will come through for some reason. + // Otherwise all stacks will come through but will be buggy till dropped or + // till the world is saved then reloaded. + + C_InventoryAction *firstAction = new C_InventoryAction(slot, desc, nullptr, itemStack, nullptr, count, 507, 99999); + //C_InventoryAction *secondAction = new C_InventoryAction(slot, nullptr, desc, nullptr, itemStack, count); transactionManager->addInventoryAction(*firstAction); - transactionManager->addInventoryAction(*secondAction); + //transactionManager->addInventoryAction(*secondAction); delete firstAction; - delete secondAction; + //delete secondAction; delete desc; - inv->addItemToFirstEmptySlot(yot); + inv->addItemToFirstEmptySlot(itemStack); + return true; +} + +bool GiveCommand::giveItem(uint8_t count, TextHolder &text, uint8_t itemData, std::string &tag) { + C_Inventory *inv = g_Data.getLocalPlayer()->getSupplies()->inventory; + C_ItemStack *itemStack = nullptr; + auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager(); + + std::unique_ptr ItemPtr = std::make_unique(); + std::unique_ptr buffer = std::make_unique(); + C_Item ***cStack = ItemRegistry::lookUpByName(ItemPtr.get(), buffer.get(), text); + if (*cStack == nullptr) { + clientMessageF("%sInvalid item name!", RED); + return false; + } + itemStack = new C_ItemStack(***cStack, count, itemData); + + if (itemStack != nullptr) { + itemStack->count = count; + } + + int slot = inv->getFirstEmptySlot(); + + if (tag.size() > 1 && tag.front() == MojangsonToken::COMPOUND_START.getSymbol() && tag.back() == MojangsonToken::COMPOUND_END.getSymbol()) { + //itemStack->setUserData(std::move(Mojangson::parseTag(tag))); + itemStack->fromTag(*Mojangson::parseTag(tag)); + } + + ItemDescriptor *desc = new ItemDescriptor((*itemStack->item)->itemId, itemData); + + // If we add the second action, Only one stack will come through for some reason. + // Otherwise all stacks will come through but will be buggy till dropped or + // till the world is saved then reloaded. + + C_InventoryAction *firstAction = new C_InventoryAction(slot, desc, nullptr, itemStack, nullptr, count, 507, 99999); + //C_InventoryAction *secondAction = new C_InventoryAction(slot, nullptr, desc, nullptr, itemStack, count); + + transactionManager->addInventoryAction(*firstAction); + //transactionManager->addInventoryAction(*secondAction); + + delete firstAction; + //delete secondAction; + delete desc; - clientMessageF("%sSuccessfully given item!", GREEN); + inv->addItemToFirstEmptySlot(itemStack); return true; } diff --git a/Horion/Command/Commands/GiveCommand.h b/Horion/Command/Commands/GiveCommand.h index f9cf9fd8..b0caf84f 100644 --- a/Horion/Command/Commands/GiveCommand.h +++ b/Horion/Command/Commands/GiveCommand.h @@ -6,5 +6,9 @@ class GiveCommand : public IMCCommand { ~GiveCommand(); // Inherited via IMCCommand - virtual bool execute(std::vector* args) override; + virtual bool execute(std::vector *args) override; + +private: + bool giveItem(uint8_t count, int itemId, uint8_t itemData, std::string &tag); + bool giveItem(uint8_t count, TextHolder &text, uint8_t itemData, std::string &tag); }; From d051dab325787a4f3b76399a9f096d514d3b8f28 Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:22:11 -0400 Subject: [PATCH 415/419] Capitalize vIdk anymore (#4525) * Capitalize vIdk anymore * de fix --- Horion.vcxproj | 4 ++-- Horion/Command/CommandMgr.cpp | 2 +- Horion/Command/CommandMgr.h | 2 +- .../{SetprefixCommand.cpp => SetPrefixCommand.cpp} | 8 ++++---- .../Commands/{SetprefixCommand.h => SetPrefixCommand.h} | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) rename Horion/Command/Commands/{SetprefixCommand.cpp => SetPrefixCommand.cpp} (61%) rename Horion/Command/Commands/{SetprefixCommand.h => SetPrefixCommand.h} (64%) diff --git a/Horion.vcxproj b/Horion.vcxproj index 09bb9816..10008cb4 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -258,7 +258,7 @@ - + @@ -447,7 +447,7 @@ - + diff --git a/Horion/Command/CommandMgr.cpp b/Horion/Command/CommandMgr.cpp index cc2379af..a96f189f 100644 --- a/Horion/Command/CommandMgr.cpp +++ b/Horion/Command/CommandMgr.cpp @@ -38,7 +38,7 @@ void CommandMgr::initCommands() { commandList.push_back(new DupeCommand()); commandList.push_back(new DamageCommand()); commandList.push_back(new ConfigCommand()); - commandList.push_back(new SetprefixCommand()); + commandList.push_back(new SetPrefixCommand()); commandList.push_back(new NbtCommand()); commandList.push_back(new WaypointCommand()); commandList.push_back(new TopCommand()); diff --git a/Horion/Command/CommandMgr.h b/Horion/Command/CommandMgr.h index 280002e0..cb16b2f1 100644 --- a/Horion/Command/CommandMgr.h +++ b/Horion/Command/CommandMgr.h @@ -29,7 +29,7 @@ #include "Commands/CommandBlockExploitCommand.h" #include "Commands/ConfigCommand.h" #include "Commands/NameSpoofCommand.h" -#include "Commands/SetprefixCommand.h" +#include "Commands/SetPrefixCommand.h" #include "Commands/NbtCommand.h" #include "Commands/ExecuteCommand.h" #include "Commands/WaypointCommand.h" diff --git a/Horion/Command/Commands/SetprefixCommand.cpp b/Horion/Command/Commands/SetPrefixCommand.cpp similarity index 61% rename from Horion/Command/Commands/SetprefixCommand.cpp rename to Horion/Command/Commands/SetPrefixCommand.cpp index 4f4596b3..b7292a0a 100644 --- a/Horion/Command/Commands/SetprefixCommand.cpp +++ b/Horion/Command/Commands/SetPrefixCommand.cpp @@ -1,13 +1,13 @@ -#include "SetprefixCommand.h" +#include "SetPrefixCommand.h" -SetprefixCommand::SetprefixCommand() : IMCCommand("setprefix", "Set the prefix for horion commands", "") { +SetPrefixCommand::SetPrefixCommand() : IMCCommand("setprefix", "Set the prefix for horion commands", "") { registerAlias("prefix"); } -SetprefixCommand::~SetprefixCommand() { +SetPrefixCommand::~SetPrefixCommand() { } -bool SetprefixCommand::execute(std::vector* args) { +bool SetPrefixCommand::execute(std::vector* args) { assertTrue(args->size() > 1); assertTrue(args->at(1).length() == 1); char prefix = args->at(1).at(0); diff --git a/Horion/Command/Commands/SetprefixCommand.h b/Horion/Command/Commands/SetPrefixCommand.h similarity index 64% rename from Horion/Command/Commands/SetprefixCommand.h rename to Horion/Command/Commands/SetPrefixCommand.h index b9faf457..87cc9d68 100644 --- a/Horion/Command/Commands/SetprefixCommand.h +++ b/Horion/Command/Commands/SetPrefixCommand.h @@ -2,11 +2,11 @@ #include "../CommandMgr.h" #include "ICommand.h" -class SetprefixCommand : public IMCCommand { +class SetPrefixCommand : public IMCCommand { public: - SetprefixCommand(); - ~SetprefixCommand(); + SetPrefixCommand(); + ~SetPrefixCommand(); // Inherited via IMCCommand virtual bool execute(std::vector* args) override; -}; +}; \ No newline at end of file From 88bf4158096f6d5defbaf2687894c45f192d49dd Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 22 Oct 2021 08:11:29 -0400 Subject: [PATCH 416/419] Added Decent Rotations (#4535) * Added Decent Rotations * Add 0delay back in Co-authored-by: GodGamer029 <43895351+GodGamer029@users.noreply.github.com> --- Horion/Module/Modules/Killaura.cpp | 5 +++++ Horion/Module/Modules/Killaura.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index 17b6bdf0..3cf341d4 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -7,6 +7,7 @@ Killaura::Killaura() : IModule('P', Category::COMBAT, "Attacks entities around y this->registerIntSetting("delay", &this->delay, this->delay, 0, 20); this->registerBoolSetting("hurttime", &this->hurttime, this->hurttime); this->registerBoolSetting("AutoWeapon", &this->autoweapon, this->autoweapon); + this->registerBoolSetting("Rotations", &this->rotations, this->rotations); this->registerBoolSetting("Silent Rotations", &this->silent, this->silent); } @@ -112,6 +113,10 @@ void Killaura::onTick(C_GameMode* gm) { g_Data.getCGameMode()->attack(targetList[0]); } } + if (rotations) { + vec2_t angle = g_Data.getLocalPlayer()->getPos()->CalcAngle(*targetList[0]->getPos()); + gm->player->setRot(angle); + } Odelay = 0; } } diff --git a/Horion/Module/Modules/Killaura.h b/Horion/Module/Modules/Killaura.h index 2cf203ea..c4d1a398 100644 --- a/Horion/Module/Modules/Killaura.h +++ b/Horion/Module/Modules/Killaura.h @@ -12,6 +12,7 @@ class Killaura : public IModule bool autoweapon = false; void findWeapon(); bool silent = true; + bool rotations = false; public: bool isMobAura = false; From 7b65ee59a561c3fae2b03c7fa8a020bb9bd8f489 Mon Sep 17 00:00:00 2001 From: MrDiamond64 <49098391+MrDiamond64@users.noreply.github.com> Date: Fri, 22 Oct 2021 06:11:52 -0600 Subject: [PATCH 417/419] Swing Arm before attacking (#4532) --- Horion/Module/Modules/Fucker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Horion/Module/Modules/Fucker.cpp b/Horion/Module/Modules/Fucker.cpp index 47247669..8435a011 100644 --- a/Horion/Module/Modules/Fucker.cpp +++ b/Horion/Module/Modules/Fucker.cpp @@ -53,8 +53,8 @@ void Fucker::onTick(C_GameMode* gm) { std::string name = ent->getNameTag()->getText(); int id = ent->getEntityTypeId(); if (name.find("Treasure") != std::string::npos && g_Data.getLocalPlayer()->getPos()->dist(*ent->getPos()) <= 5) { - g_Data.getCGameMode()->attack(ent); g_Data.getLocalPlayer()->swingArm(); + g_Data.getCGameMode()->attack(ent); } }); } From cdc96a3d565b589dfd827aa191a1274260813a17 Mon Sep 17 00:00:00 2001 From: MrDiamond64 <49098391+MrDiamond64@users.noreply.github.com> Date: Fri, 22 Oct 2021 06:13:00 -0600 Subject: [PATCH 418/419] Add customizable spammer bypass length (#4528) * added customizable spammer bypass lenghts * added customizable spammer bypass lenghts --- Horion/Command/Commands/SpammerCommand.cpp | 13 +++++++++++-- Horion/Module/Modules/Spammer.cpp | 3 ++- Horion/Module/Modules/Spammer.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Horion/Command/Commands/SpammerCommand.cpp b/Horion/Command/Commands/SpammerCommand.cpp index 88bf011a..1724a481 100644 --- a/Horion/Command/Commands/SpammerCommand.cpp +++ b/Horion/Command/Commands/SpammerCommand.cpp @@ -2,7 +2,7 @@ #include "../../Module/ModuleManager.h" -SpammerCommand::SpammerCommand() : IMCCommand("spammer", "Edit spammer delay/text", " ") { +SpammerCommand::SpammerCommand() : IMCCommand("spammer", "Edit spammer delay/text", " ") { registerAlias("spam"); } @@ -43,6 +43,15 @@ bool SpammerCommand::execute(std::vector* args) { spamMod->getBypass() = state; clientMessageF("%sBypass set to %s%s%s!", GREEN, GRAY, state ? "true" : "false", GREEN); return true; + } else if (option == "length") { + int length = assertInt(args->at(2)); + if (length < 1) { + clientMessageF("%sLength needs to be 1 or more!", RED); + return true; + } else { + spamMod->getLength() = length; + return true; + } } else if (option == "manual") { int times = assertInt(args->at(2)); std::ostringstream os; @@ -54,7 +63,7 @@ bool SpammerCommand::execute(std::vector* args) { std::string text = os.str().substr(1); for (int i = 0; i < times; i++) { C_TextPacket textPacket; - textPacket.message.setText(text + (spamMod->getBypass() ? (" | " + Utils::randomString(8)) : "")); + textPacket.message.setText(text + (spamMod->getBypass() ? (" | " + Utils::randomString(spamMod->getLength())) : "")); textPacket.sourceName = *g_Data.getLocalPlayer()->getNameTag(); textPacket.xboxUserId = TextHolder(std::to_string(g_Data.getLocalPlayer()->getUserId())); g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&textPacket); diff --git a/Horion/Module/Modules/Spammer.cpp b/Horion/Module/Modules/Spammer.cpp index b357c392..36bd4bec 100644 --- a/Horion/Module/Modules/Spammer.cpp +++ b/Horion/Module/Modules/Spammer.cpp @@ -3,6 +3,7 @@ Spammer::Spammer() : IModule(0, Category::MISC, "Spams a message in a specified delay") { registerIntSetting("delay", &this->delay, this->delay, 1, 10); + registerIntSetting("length", &this->length, this->length, 1, 60); registerBoolSetting("bypass", &this->bypass, this->bypass); } @@ -17,7 +18,7 @@ void Spammer::onTick(C_GameMode* gm) { Odelay++; if (Odelay > delay * 20) { C_TextPacket textPacket; - textPacket.message.setText(bypass ? (message + " | " + Utils::randomString(8)) : message); + textPacket.message.setText(bypass ? (message + " | " + Utils::randomString(length)) : message); textPacket.sourceName.setText(g_Data.getLocalPlayer()->getNameTag()->getText()); textPacket.xboxUserId = std::to_string(g_Data.getLocalPlayer()->getUserId()); g_Data.getClientInstance()->loopbackPacketSender->sendToServer(&textPacket); diff --git a/Horion/Module/Modules/Spammer.h b/Horion/Module/Modules/Spammer.h index 3ec82a53..7f2f4b95 100644 --- a/Horion/Module/Modules/Spammer.h +++ b/Horion/Module/Modules/Spammer.h @@ -6,6 +6,7 @@ class Spammer : public IModule { int Odelay = 0; bool bypass = true; int delay = 2; + int length = 8; std::string message = "Horion - the best minecraft bedrock utility mod - horion.download"; public: @@ -14,6 +15,7 @@ class Spammer : public IModule { inline std::string& getMessage() { return message; }; inline int& getDelay() { return delay; }; + inline int& getLength() { return length; }; inline bool& getBypass() { return bypass; }; // Inherited via IModule From b0fd52380d941494ecfb6193191b70154016a8ac Mon Sep 17 00:00:00 2001 From: Intop <78622918+Intoprelised@users.noreply.github.com> Date: Fri, 19 Nov 2021 18:22:51 -0500 Subject: [PATCH 419/419] Fix Spelling (#4541) --- Memory/GameData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index da2234f5..8fb223c3 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -19,7 +19,7 @@ void GameData::retrieveClientInstance() { if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative - logF("clinet: %llX", clientInstanceOffset); + logF("client: %llX", clientInstanceOffset); } } // clientInstanceOffset = 0x03CD5058; // pointer scanned, can't find good signatures so it'll stay @@ -252,4 +252,4 @@ void GameData::log(const char* fmt, ...) { std::string msg(message); g_Data.textPrintList.push_back(msg); va_end(arg); -} \ No newline at end of file +}