From f247303369225b6c3b74be02834b17c0aefaf448 Mon Sep 17 00:00:00 2001 From: Mozz3d Date: Fri, 15 Nov 2024 09:20:48 -0500 Subject: [PATCH 01/11] Create animIAnimationBuffer.hpp --- .../Natives/animIAnimationBuffer.hpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp new file mode 100644 index 000000000..d84e9efb4 --- /dev/null +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include + +namespace RED4ext +{ +namespace anim +{ +struct IAnimationBuffer : ISerializable +{ + static constexpr const char* NAME = "animIAnimationBuffer"; + static constexpr const char* ALIAS = NAME; + + virtual bool Initialize() = 0; + virtual bool Load(); + virtual bool Unload(); + virtual bool IsReady(); + virtual bool HasInplaceCompressedBuffer(); + virtual bool sub_100() = 0; + virtual float GetDuration() = 0; + virtual float GetFPS() = 0; + virtual AnimDataAddress* GetDataAddress(); + virtual void GetSize(); + virtual void GetNumExtraJoints() = 0; + virtual void GetExtraData(); + virtual void sub_138(); + virtual bool HasFallbackFrames(); + virtual void sub_140(); + virtual void sub_148(); + virtual void CreateFallbackFrame(); + virtual void GatherInfo(); + virtual bool sub_168(); + virtual void sub_170(); + virtual bool sub_178(); + virtual void sub_180(); + +}; +RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30); +} // namespace anim +using animIAnimationBuffer = anim::IAnimationBuffer; +} // namespace RED4ext From 9a4468b1f411e20b14bf5879bcbfef3fb9fc4236 Mon Sep 17 00:00:00 2001 From: Mozz3d Date: Fri, 15 Nov 2024 13:28:54 -0500 Subject: [PATCH 02/11] Update IAnimationBuffer virtual functions --- .../Natives/animIAnimationBuffer-inl.hpp | 0 .../Natives/animIAnimationBuffer.hpp | 34 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp index d84e9efb4..2fba3cfd7 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -14,27 +14,27 @@ struct IAnimationBuffer : ISerializable static constexpr const char* ALIAS = NAME; virtual bool Initialize() = 0; - virtual bool Load(); - virtual bool Unload(); - virtual bool IsReady(); - virtual bool HasInplaceCompressedBuffer(); + virtual bool Load() const {} + virtual bool Unload() const {} + virtual bool IsReady() const { return true; } + virtual bool HasInplaceCompressedBuffer() const { return true; } virtual bool sub_100() = 0; virtual float GetDuration() = 0; virtual float GetFPS() = 0; - virtual AnimDataAddress* GetDataAddress(); - virtual void GetSize(); + virtual AnimDataAddress* GetDataAddress() const { return {}; } + virtual void GetSize() const {} virtual void GetNumExtraJoints() = 0; - virtual void GetExtraData(); - virtual void sub_138(); - virtual bool HasFallbackFrames(); - virtual void sub_140(); - virtual void sub_148(); - virtual void CreateFallbackFrame(); - virtual void GatherInfo(); - virtual bool sub_168(); - virtual void sub_170(); - virtual bool sub_178(); - virtual void sub_180(); + virtual void GetExtraData() const {} + virtual void sub_138() const {} + virtual bool HasFallbackFrames() const {} + virtual void sub_140() const {} + virtual void sub_148() const {} + virtual void CreateFallbackFrame() const {} + virtual void GatherInfo() const {} + virtual bool sub_168() const {} + virtual void sub_170() const {} + virtual bool sub_178() const {} + virtual void sub_180() const {} }; RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30); From 1b8e5ee6ce609191857189c45a92a5c65d3831fb Mon Sep 17 00:00:00 2001 From: Mozz3d Date: Fri, 15 Nov 2024 13:37:17 -0500 Subject: [PATCH 03/11] This probably isn't necessary --- include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp deleted file mode 100644 index e69de29bb..000000000 From b2fb951ac796eb337caaeee429f37b29f492bdc7 Mon Sep 17 00:00:00 2001 From: Mozz3d Date: Fri, 15 Nov 2024 13:42:15 -0500 Subject: [PATCH 04/11] Stub generated IAnimationBuffer --- .../Natives/Generated/anim/IAnimationBuffer.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/RED4ext/Scripting/Natives/Generated/anim/IAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/Generated/anim/IAnimationBuffer.hpp index 121baaf4e..7ed20d825 100644 --- a/include/RED4ext/Scripting/Natives/Generated/anim/IAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/Generated/anim/IAnimationBuffer.hpp @@ -4,6 +4,15 @@ // This file is generated from the Game's Reflection data +#include + +namespace RED4ext +{ +RED4EXT_ASSERT_SIZE(anim::IAnimationBuffer, 0x30); +using animIAnimationBuffer = anim::IAnimationBuffer; +} // namespace RED4ext + +/* #include #include #include @@ -22,5 +31,6 @@ RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30); } // namespace anim using animIAnimationBuffer = anim::IAnimationBuffer; } // namespace RED4ext +*/ // clang-format on From f54c627cdfc00a344376db5c0f5cf8d550620366 Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:51:19 -0500 Subject: [PATCH 05/11] Clang formatting upsets me --- include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp index 2fba3cfd7..16532020c 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -1,8 +1,8 @@ #pragma once -#include -#include #include +#include +#include namespace RED4ext { From 4a26535ef43cc42aa3e31bf404d46f370fee2992 Mon Sep 17 00:00:00 2001 From: Mozz3d Date: Tue, 19 Nov 2024 22:49:32 -0500 Subject: [PATCH 06/11] Added func defs for various IAnimationBuffer funcs --- .../Natives/animIAnimationBuffer-inl.hpp | 77 +++++++++++++++++++ .../Natives/animIAnimationBuffer.hpp | 40 +++++----- .../Natives/animIAnimationBuffer.cpp | 5 ++ 3 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp create mode 100644 src/Scripting/Natives/animIAnimationBuffer.cpp diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp new file mode 100644 index 000000000..3e3826d7c --- /dev/null +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp @@ -0,0 +1,77 @@ +#pragma once + +#ifdef RED4EXT_STATIC_LIB +#include +#endif + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::Load() +{ +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::Unload() +{ +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::IsReady() +{ + return true; +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasInplaceCompressedBuffer() +{ + return true; +} + +RED4EXT_INLINE AnimDataAddress* RED4ext::anim::IAnimationBuffer::GetDataAddress() +{ + return {}; +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GetSize() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GetExtraData() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_138() +{ +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasFallbackframes() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_140() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_148() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::CreateFallbackFrame() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GatherInfo() +{ +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::sub_168() +{ + return true; +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_170() +{ +} + +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::sub_178() +{ +} + +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_180() +{ +} \ No newline at end of file diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp index 2fba3cfd7..4d8c976b6 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -14,30 +14,34 @@ struct IAnimationBuffer : ISerializable static constexpr const char* ALIAS = NAME; virtual bool Initialize() = 0; - virtual bool Load() const {} - virtual bool Unload() const {} - virtual bool IsReady() const { return true; } - virtual bool HasInplaceCompressedBuffer() const { return true; } + virtual bool Load(); + virtual bool Unload(); + virtual bool IsReady(); + virtual bool HasInplaceCompressedBuffer(); virtual bool sub_100() = 0; virtual float GetDuration() = 0; virtual float GetFPS() = 0; - virtual AnimDataAddress* GetDataAddress() const { return {}; } - virtual void GetSize() const {} + virtual void* GetDataAddress(); + virtual void GetSize(); virtual void GetNumExtraJoints() = 0; - virtual void GetExtraData() const {} - virtual void sub_138() const {} - virtual bool HasFallbackFrames() const {} - virtual void sub_140() const {} - virtual void sub_148() const {} - virtual void CreateFallbackFrame() const {} - virtual void GatherInfo() const {} - virtual bool sub_168() const {} - virtual void sub_170() const {} - virtual bool sub_178() const {} - virtual void sub_180() const {} + virtual void GetExtraData(); + virtual void sub_138(); + virtual bool HasFallbackFrames(); + virtual void sub_140(); + virtual void sub_148(); + virtual void CreateFallbackFrame(); + virtual void GatherInfo(); + virtual bool sub_168(); + virtual void sub_170(); + virtual bool sub_178(); + virtual void sub_180(); }; RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30); } // namespace anim using animIAnimationBuffer = anim::IAnimationBuffer; } // namespace RED4ext + +#ifdef RED4EXT_HEADER_ONLY +#include +#endif \ No newline at end of file diff --git a/src/Scripting/Natives/animIAnimationBuffer.cpp b/src/Scripting/Natives/animIAnimationBuffer.cpp new file mode 100644 index 000000000..b57c9e1bf --- /dev/null +++ b/src/Scripting/Natives/animIAnimationBuffer.cpp @@ -0,0 +1,5 @@ +#ifndef RED4EXT_STATIC_LIB +#error Please define 'RED4EXT_STATIC_LIB' to compile this file. +#endif + +#include \ No newline at end of file From ef68ec0da811347ec280f0a808ef3976119369a3 Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Tue, 19 Nov 2024 22:58:52 -0500 Subject: [PATCH 07/11] Fix func defs mistake --- .../Scripting/Natives/animIAnimationBuffer-inl.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp index 3e3826d7c..e5f06650d 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp @@ -22,9 +22,10 @@ RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasInplaceCompressedBuffer( return true; } -RED4EXT_INLINE AnimDataAddress* RED4ext::anim::IAnimationBuffer::GetDataAddress() +//returns AnimDataAddress but need ctor +//maybe hook og func? +RED4EXT_INLINE void* RED4ext::anim::IAnimationBuffer::GetDataAddress() { - return {}; } RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GetSize() @@ -39,7 +40,7 @@ RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_138() { } -RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasFallbackframes() +RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasFallbackFrames() { } @@ -74,4 +75,4 @@ RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::sub_178() RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_180() { -} \ No newline at end of file +} From 03c3a141d7ba799491af848b72ce0feb9889a3fa Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:01:40 -0500 Subject: [PATCH 08/11] Clang is the sound of my head hitting the table --- .../RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp index e5f06650d..23490547e 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp @@ -22,8 +22,8 @@ RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasInplaceCompressedBuffer( return true; } -//returns AnimDataAddress but need ctor -//maybe hook og func? +// returns AnimDataAddress but need ctor +// maybe hook og func? RED4EXT_INLINE void* RED4ext::anim::IAnimationBuffer::GetDataAddress() { } From a0a6d25bfcd4877a5b1245762cc8fd47a6e86595 Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:05:14 -0500 Subject: [PATCH 09/11] Fix func returns --- .../RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp index 23490547e..afebfe554 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp @@ -6,10 +6,12 @@ RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::Load() { + return false; } RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::Unload() { + return false; } RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::IsReady() @@ -24,7 +26,7 @@ RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasInplaceCompressedBuffer( // returns AnimDataAddress but need ctor // maybe hook og func? -RED4EXT_INLINE void* RED4ext::anim::IAnimationBuffer::GetDataAddress() +RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GetDataAddress() { } @@ -42,6 +44,7 @@ RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_138() RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasFallbackFrames() { + return false; } RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_140() @@ -71,6 +74,7 @@ RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_170() RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::sub_178() { + return false; } RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_180() From 96018daec1a58662cf4bd0f7e9071b3322ea53cc Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:08:29 -0500 Subject: [PATCH 10/11] Fix return in animIAnimationBuffer.hpp --- include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp index 5bbf1f4f1..5dedbc3c7 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -21,7 +21,7 @@ struct IAnimationBuffer : ISerializable virtual bool sub_100() = 0; virtual float GetDuration() = 0; virtual float GetFPS() = 0; - virtual void* GetDataAddress(); + virtual void GetDataAddress(); virtual void GetSize(); virtual void GetNumExtraJoints() = 0; virtual void GetExtraData(); @@ -44,4 +44,4 @@ using animIAnimationBuffer = anim::IAnimationBuffer; #ifdef RED4EXT_HEADER_ONLY #include -#endif \ No newline at end of file +#endif From 0ef25e8a561e2b7654ad806dee42603cb147bd4a Mon Sep 17 00:00:00 2001 From: Mozz3d <163353426+Mozz3d@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:11:43 -0500 Subject: [PATCH 11/11] Clang again --- include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp index 5dedbc3c7..b8e2082f6 100644 --- a/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp +++ b/include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp @@ -35,7 +35,6 @@ struct IAnimationBuffer : ISerializable virtual void sub_170(); virtual bool sub_178(); virtual void sub_180(); - }; RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30); } // namespace anim