Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoded several IAnimationBuffer virtual functions #157

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

// This file is generated from the Game's Reflection data

#include <RED4ext/Scripting/Natives/animIAnimationBuffer.hpp>

namespace RED4ext
{
RED4EXT_ASSERT_SIZE(anim::IAnimationBuffer, 0x30);
using animIAnimationBuffer = anim::IAnimationBuffer;
} // namespace RED4ext

/*
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/ISerializable.hpp>
Expand All @@ -22,5 +31,6 @@ RED4EXT_ASSERT_SIZE(IAnimationBuffer, 0x30);
} // namespace anim
using animIAnimationBuffer = anim::IAnimationBuffer;
} // namespace RED4ext
*/

// clang-format on
82 changes: 82 additions & 0 deletions include/RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#pragma once

#ifdef RED4EXT_STATIC_LIB
#include <RED4ext/Scripting/Natives/animIAnimationBuffer.hpp>
#endif

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()
{
return true;
}

RED4EXT_INLINE bool RED4ext::anim::IAnimationBuffer::HasInplaceCompressedBuffer()
{
return true;
}

// returns AnimDataAddress but need ctor
// maybe hook og func?
RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::GetDataAddress()
{
}

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()
{
return false;
}

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()
{
return false;
}

RED4EXT_INLINE void RED4ext::anim::IAnimationBuffer::sub_180()
{
}
46 changes: 46 additions & 0 deletions include/RED4ext/Scripting/Natives/animIAnimationBuffer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pragma once

#include <RED4ext/Common.hpp>
#include <RED4ext/ISerializable.hpp>
#include <RED4ext/Scripting/Natives/Generated/anim/AnimDataAddress.hpp>

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();
Copy link
Owner

@WopsS WopsS Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the the rest of the class is virtual, why do you need to define these methods then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about defining the methods in general for IAnimationBuffer? Or the specific implementations?

If it's the latter case those are methods I found to have some level of base implementation, which I assumed could be relevant. But in hindsight it seems unnecessary

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mozz3d can you remove these implementations?

virtual bool Unload();
virtual bool IsReady();
virtual bool HasInplaceCompressedBuffer();
virtual bool sub_100() = 0;
virtual float GetDuration() = 0;
virtual float GetFPS() = 0;
virtual void 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

#ifdef RED4EXT_HEADER_ONLY
#include <RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp>
#endif
5 changes: 5 additions & 0 deletions src/Scripting/Natives/animIAnimationBuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef RED4EXT_STATIC_LIB
#error Please define 'RED4EXT_STATIC_LIB' to compile this file.
#endif

#include <RED4ext/Scripting/Natives/animIAnimationBuffer-inl.hpp>