diff --git a/CommonLibF4/cmake/sourcelist.cmake b/CommonLibF4/cmake/sourcelist.cmake index 4a077061..5a86976c 100644 --- a/CommonLibF4/cmake/sourcelist.cmake +++ b/CommonLibF4/cmake/sourcelist.cmake @@ -156,6 +156,7 @@ set(SOURCES include/RE/Bethesda/BSTextureStreamer.h include/RE/Bethesda/BSThread.h include/RE/Bethesda/BSTimer.h + include/RE/Bethesda/BSUtilities.h include/RE/Bethesda/BSVisit.h include/RE/Bethesda/CELLJobs.h include/RE/Bethesda/CRC.h diff --git a/CommonLibF4/include/RE/Bethesda/BSUtilities.h b/CommonLibF4/include/RE/Bethesda/BSUtilities.h new file mode 100644 index 00000000..9c4781e2 --- /dev/null +++ b/CommonLibF4/include/RE/Bethesda/BSUtilities.h @@ -0,0 +1,32 @@ +#pragma once + +#include "RE/Bethesda/BSFixedString.h" + +namespace RE +{ + class NiAVObject; +} + +namespace RE::BSUtilities +{ + inline std::uint16_t ConvertFloatToHalf(float a_value) + { + using func_t = decltype(&ConvertFloatToHalf); + static REL::Relocation func{ REL::ID(2212098) }; + return func(a_value); + } + + inline float ConvertHalfToFloat(std::uint16_t a_value) + { + using func_t = decltype(&ConvertHalfToFloat); + static REL::Relocation func{ REL::ID(2195843) }; + return func(a_value); + } + + inline NiAVObject* GetObjectByName(NiAVObject* a_root, const BSFixedString& a_name, bool a_tryInternal, bool a_dontAttach) + { + using func_t = decltype(&GetObjectByName); + static REL::Relocation func{ REL::ID(843650) }; + return func(a_root, a_name, a_tryInternal, a_dontAttach); + } +} diff --git a/CommonLibF4/include/RE/Bethesda/Utilities.h b/CommonLibF4/include/RE/Bethesda/Utilities.h index 0be37ccf..254090fa 100644 --- a/CommonLibF4/include/RE/Bethesda/Utilities.h +++ b/CommonLibF4/include/RE/Bethesda/Utilities.h @@ -9,16 +9,6 @@ namespace RE { - namespace BSUtilities - { - inline NiAVObject* GetObjectByName(NiAVObject* a_root, const BSFixedString& a_name, bool a_tryInternal, bool a_dontAttach) - { - using func_t = decltype(&GetObjectByName); - REL::Relocation func{ REL::ID(843650) }; - return func(a_root, a_name, a_tryInternal, a_dontAttach); - } - } - namespace CombatUtilities { inline bool CalculateProjectileLOS( diff --git a/CommonLibF4/include/RE/Fallout.h b/CommonLibF4/include/RE/Fallout.h index 9f45708c..f7ef767b 100644 --- a/CommonLibF4/include/RE/Fallout.h +++ b/CommonLibF4/include/RE/Fallout.h @@ -152,6 +152,7 @@ #include "RE/Bethesda/BSTextureStreamer.h" #include "RE/Bethesda/BSThread.h" #include "RE/Bethesda/BSTimer.h" +#include "RE/Bethesda/BSUtilities.h" #include "RE/Bethesda/BSVisit.h" #include "RE/Bethesda/CELLJobs.h" #include "RE/Bethesda/CRC.h"