From 57329624e3c3885d01260c9c5c9b9b95bff5ac4d Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Sat, 19 Oct 2024 06:32:22 -0500 Subject: [PATCH] feat: `TLS` --- CommonLibF4/include/RE/Bethesda/TLS.h | 18 ++++++++++++++++++ CommonLibF4/include/RE/Fallout.h | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 CommonLibF4/include/RE/Bethesda/TLS.h diff --git a/CommonLibF4/include/RE/Bethesda/TLS.h b/CommonLibF4/include/RE/Bethesda/TLS.h new file mode 100644 index 00000000..fc90e1ab --- /dev/null +++ b/CommonLibF4/include/RE/Bethesda/TLS.h @@ -0,0 +1,18 @@ +#pragma once + +#include "REX/W32/NT.h" + +namespace RE +{ + struct TLS + { + [[nodiscard]] static TLS* GetSingleton() + { + return *static_cast(REX::W32::NtCurrentTeb()->threadLocalStoragePointer); + } + + // members + std::byte pad000[0x830]; // 000 + bool consoleMode; // 830 + }; +} diff --git a/CommonLibF4/include/RE/Fallout.h b/CommonLibF4/include/RE/Fallout.h index 2cbac517..f156fb4a 100644 --- a/CommonLibF4/include/RE/Fallout.h +++ b/CommonLibF4/include/RE/Fallout.h @@ -211,6 +211,7 @@ #include "RE/Bethesda/Settings.h" #include "RE/Bethesda/Sky.h" #include "RE/Bethesda/SplineUtils.h" +#include "RE/Bethesda/TaskQueueInterface.h" #include "RE/Bethesda/TESBoundAnimObjects.h" #include "RE/Bethesda/TESBoundObjects.h" #include "RE/Bethesda/TESCamera.h" @@ -225,7 +226,7 @@ #include "RE/Bethesda/TESRace.h" #include "RE/Bethesda/TESWaterForm.h" #include "RE/Bethesda/TESWorldSpace.h" -#include "RE/Bethesda/TaskQueueInterface.h" +#include "RE/Bethesda/TLS.h" #include "RE/Bethesda/UI.h" #include "RE/Bethesda/UIMessage.h" #include "RE/Bethesda/UIMessageQueue.h"