mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
This change was planned for a long time. This moves all REGISTER calls to a single translation unit, this is required as we currently added a very dirty workaround for not registering duplicates by checking if VFTable pointer was already present in the vector... Registering from single translation unit prevents duplicate instances that gets created if header is included by more cpp files. Reworking this reduced 100kb+ of compiled code. This commit also reworked the way functions/variables/constant gets logged with their addresses; the new code formats them on the fly, and allows for resize at any time. Formatting is no longer required by programmer. TODO: currently there are some compile errors for dedicated and client dll's. These will be resolved very soon as they need to be properly worked out still (server & client only stuff needs to be properly split). Use the 'main' (stable) branch for the time being if you need to compile these dll's.
106 lines
3.1 KiB
C++
106 lines
3.1 KiB
C++
#ifndef ANIMATION_H
|
|
#define ANIMATION_H
|
|
#include "mathlib/vector.h"
|
|
#include "public/studio.h"
|
|
#include "public/ihandleentity.h"
|
|
|
|
class CAnimationLayer
|
|
{
|
|
bool m_bSequenceFinished;
|
|
char gap_1[3];
|
|
int m_fFlags;
|
|
int m_layerIndex;
|
|
int m_modelIndex;
|
|
float m_flKillRate;
|
|
float m_flKillDelay;
|
|
char m_nActivity[4];
|
|
int m_nPriority;
|
|
float m_flLastEventCheck;
|
|
char gap_24[4];
|
|
IHandleEntity* m_animationLayerOwner; // !TODO: CBaseEntity/C_BaseEntity?
|
|
};
|
|
|
|
struct __declspec(align(8)) PredictedAnimEventData
|
|
{
|
|
char gap_0[8];
|
|
float m_predictedAnimEventTimes[8];
|
|
int m_predictedAnimEventIndices[8];
|
|
int m_predictedAnimEventCount;
|
|
int m_predictedAnimEventTarget;
|
|
int m_predictedAnimEventSequence;
|
|
int m_predictedAnimEventModel;
|
|
float m_predictedAnimEventsReadyToFireTime;
|
|
};
|
|
|
|
struct __declspec(align(8)) AnimRelativeData
|
|
{
|
|
char gap_0[8];
|
|
Vector3D m_animInitialPos;
|
|
Vector3D m_animInitialVel;
|
|
Quaternion m_animInitialRot;
|
|
Vector3D m_animInitialCorrectPos;
|
|
Quaternion m_animInitialCorrectRot;
|
|
Vector3D m_animEntityToRefOffset;
|
|
Quaternion m_animEntityToRefRotation;
|
|
float m_animBlendBeginTime;
|
|
float m_animBlendEndTime;
|
|
int m_animScriptSequence;
|
|
int m_animScriptModel;
|
|
bool m_animIgnoreParentRot;
|
|
char gap_79[3];
|
|
int m_animMotionMode;
|
|
bool m_safePushMode;
|
|
};
|
|
|
|
struct Player_AnimViewEntityData
|
|
{
|
|
char gap_0[8];
|
|
int animViewEntityHandle;
|
|
float animViewEntityAngleLerpInDuration;
|
|
float animViewEntityOriginLerpInDuration;
|
|
float animViewEntityLerpOutDuration;
|
|
bool animViewEntityStabilizePlayerEyeAngles;
|
|
char gap_19[3];
|
|
int animViewEntityThirdPersonCameraParity;
|
|
int animViewEntityThirdPersonCameraAttachment[6];
|
|
int animViewEntityNumThirdPersonCameraAttachments;
|
|
bool animViewEntityThirdPersonCameraVisibilityChecks;
|
|
bool animViewEntityDrawPlayer;
|
|
char gap_3e[2];
|
|
float fovTarget;
|
|
float fovSmoothTime;
|
|
int animViewEntityParity;
|
|
int lastAnimViewEntityParity;
|
|
int lastAnimViewEntityParityTick;
|
|
Vector3D animViewEntityCameraPosition;
|
|
Vector3D animViewEntityCameraAngles;
|
|
float animViewEntityBlendStartTime;
|
|
Vector3D animViewEntityBlendStartEyePosition;
|
|
Vector3D animViewEntityBlendStartEyeAngles;
|
|
};
|
|
|
|
|
|
inline CMemory p_CStudioHdr__LookupSequence;
|
|
inline auto v_CStudioHdr__LookupSequence = p_CStudioHdr__LookupSequence.RCast<int(*)(CStudioHdr* pStudio, const char* pszName)>();
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class VAnimation : public IDetour
|
|
{
|
|
virtual void GetAdr(void) const
|
|
{
|
|
LogFunAdr("CStudioHdr::LookupSequence", p_CStudioHdr__LookupSequence.GetPtr());
|
|
}
|
|
virtual void GetFun(void) const
|
|
{
|
|
p_CStudioHdr__LookupSequence = g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 48 8B D9 4C 8B C2 48 8B 89 ?? ?? ?? ??");
|
|
v_CStudioHdr__LookupSequence = p_CStudioHdr__LookupSequence.RCast<int(*)(CStudioHdr*, const char*)>(); /*40 53 48 83 EC 20 48 8B D9 4C 8B C2 48 8B 89 ?? ?? ?? ??*/
|
|
}
|
|
virtual void GetVar(void) const { }
|
|
virtual void GetCon(void) const { }
|
|
virtual void Attach(void) const;
|
|
virtual void Detach(void) const;
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#endif // ANIMATION_H
|