Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MarathonRecomp/api/Marathon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "Sonicteam/Player/IExportWeaponRequestFlag.h"
#include "Sonicteam/Player/IFlagCommunicator.h"
#include "Sonicteam/Player/IGauge.h"
#include "Sonicteam/Player/INotification.h"
#include "Sonicteam/Player/IPlugIn.h"
#include "Sonicteam/Player/IScore.h"
#include "Sonicteam/Player/IStepable.h"
Expand All @@ -46,7 +47,9 @@
#include "Sonicteam/Player/State/IMachine.h"
#include "Sonicteam/Player/State/Machine2.h"
#include "Sonicteam/Player/State/Object2.h"
#include "Sonicteam/Player/State/SonicContext.h"
#include "Sonicteam/Player/State/TailsContext.h"
#include "Sonicteam/Player/Weapon/SonicWeapons.h"
#include "Sonicteam/SoX/AI/StateMachine.h"
#include "Sonicteam/SoX/Component.h"
#include "Sonicteam/SoX/Engine/Doc.h"
Expand All @@ -58,3 +61,4 @@
#include "boost/smart_ptr/make_shared_object.h"
#include "boost/smart_ptr/shared_ptr.h"
#include "stdx/string.h"
#include "stdx/vector.h"
2 changes: 1 addition & 1 deletion MarathonRecomp/api/Sonicteam/GameImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Sonicteam
{
be<uint32_t> ActorID;
be<uint32_t> RingCount;
MARATHON_INSERT_PADDING(4);
be<uint32_t> TownRingCount;
be<uint32_t> LifeCount;
be<uint32_t> ScoreCount;
be<float> AliveTime;
Expand Down
12 changes: 12 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/INotification.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <Marathon.inl>

namespace Sonicteam::Player
{
class INotification
{
public:
xpointer<void> m_pVftable;
};
}
69 changes: 64 additions & 5 deletions MarathonRecomp/api/Sonicteam/Player/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,82 @@

#include <Marathon.h>
#include <Sonicteam/Player/State/Machine2.h>
#include <stdx/vector.h>
#include <Sonicteam/Player/IPlugIn.h>


namespace Sonicteam::Player
{
class Object : public Actor
//xbox vector
//pull/74 SoX::Math::Vector4, replace _vector,XMVECTOR to SoX::Math::Vector4 -
struct _vector
{
union
{
struct
{
be<float> x, y, z, w;
};

be<float> _f[4];
};
_vector(float x = 0.0f, float y = 0.0f, float z = 0.0f, float w = 0.0f): x(x), y(y), z(z), w(w)
{
}
};

typedef _vector XMVECTOR;

#pragma pack(push, 1)
class __declspec(align(1)) Object : public Actor
{
struct ObjectPlayerUpgrade {
uint32_t global_flag;
uint32_t equip_flag;
};

public:
MARATHON_INSERT_PADDING(0x40);
stdx::string m_PlayerLUA;
stdx::string m_PlayerPKG;
be<uint32_t> m_CameramanActorID;
xpointer<uint32_t> m_Cameraman;
be<uint32_t> m_PlayerIndex;
MARATHON_INSERT_PADDING(0x48);
be<uint32_t> m_PlayerControllerIndex;
XMVECTOR m_SpawnRotation;
XMVECTOR m_SpawnPosition;
be<uint32_t> m_SpawnRing;
xpointer<uint32_t> m_SpawnSource; // REF_TYPE(RefCountObject)
uint8_t m_IsPlayer;
uint8_t m_IsPosture;
uint8_t m_IsAI;
MARATHON_INSERT_PADDING(1);
xpointer<uint32_t> m_RootFrame; // REF_TYPE(RefCountObject)
xpointer<uint32_t> m_PackageBinary; // REF_TYPE(RefCountObject)
boost::shared_ptr<uint32_t> m_PlayerModel;
boost::shared_ptr<uint32_t> m_PlayerPosture;
boost::shared_ptr<State::Machine2> m_spStateMachine;
MARATHON_INSERT_PADDING(0x18);
boost::shared_ptr<uint32_t> m_PlayerGravity;
boost::shared_ptr<uint32_t> m_PlayerImpulse;
be<uint32_t> m_LastSetupModule;
be<uint32_t> m_NextSetupModule;
boost::shared_ptr<IGauge> m_spGauge;
MARATHON_INSERT_PADDING(0x204);
MARATHON_INSERT_PADDING(0x8);
stdx::vector<boost::shared_ptr<Sonicteam::Player::IPlugIn>> m_PlayerPlugins;
MARATHON_INSERT_PADDING(0x58);
be<float> m_PlayerDelta;
MARATHON_INSERT_PADDING(0x48);
stdx::vector<ObjectPlayerUpgrade> m_PlayerUpgrade;
stdx::string m_PlayerName;
MARATHON_INSERT_PADDING(0x134);

template <typename T>
inline T* GetGauge();

template <typename T = Sonicteam::Player::IPlugIn>
inline T* GetPlugin(const char* v_name);

};
#pragma pack(pop)
}

#include <Sonicteam/Player/Object.inl>
14 changes: 14 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/Object.inl
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#include "Object.h"
namespace Sonicteam::Player
{
template <typename T>
inline T* Object::GetGauge()
{
return (T*)m_spGauge.get();
}

template<typename T>
inline T* Sonicteam::Player::Object::GetPlugin(const char* v_name)
{
for (stdx::vector<boost::shared_ptr<Sonicteam::Player::IPlugIn>>::iterator it = m_PlayerPlugins.begin(); it != m_PlayerPlugins.end(); it = it + 1)
{
if (it->get()->m_Name == v_name)
{
return static_cast<T*>(it->get());
}
}
return nullptr;
}
}
1 change: 1 addition & 0 deletions MarathonRecomp/api/Sonicteam/Player/Score.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Marathon.inl>


namespace Sonicteam::Player
{
class Score : public IScore, public IVariable, public IStepable
Expand Down
11 changes: 10 additions & 1 deletion MarathonRecomp/api/Sonicteam/Player/SonicGauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ namespace Sonicteam::Player
be<uint32_t> m_Flags;
be<uint32_t> m_GroundedFlags;
be<float> m_Maximum;
MARATHON_INSERT_PADDING(0x28);
be<float> m_Green;
be<float> m_Red;
be<float> m_Blue;
be<float> m_White;
be<float> m_Sky;
be<float> m_Yellow;
be<float> m_Purple;
be<float> m_Super;
be<float> m_Heal;
be<float> m_HealDelay;
};
}
29 changes: 27 additions & 2 deletions MarathonRecomp/api/Sonicteam/Player/State/CommonContext.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/Player/State/ICommonContext.h>
#include <Sonicteam/Player/IExportPostureRequestFlag.h>
Expand All @@ -8,10 +7,36 @@

namespace Sonicteam::Player::State
{



class CommonContext : public ICommonContext, public IExportPostureRequestFlag, public IExportWeaponRequestFlag
{
public:
MARATHON_INSERT_PADDING(0x90);

//(Gordon Ramsay)
enum PostureEnum:uint32_t
{
CC_GROUND = 0x1, // detects Ground
CC_WALLBRUSHING = 0x8, // detects brushing against a wall
CC_HEADONWALL = 0x10, // detects head-on wall collision (will always be enabled w/ 2^3)
CC_RAILGRIND = 0x40, // Rail grinding
CC_BEFOREFALL = 0x100, // seems like Neutral or Pre-Fall? The moment before transitioning from the Jump to Fall animation
CC_FALL = 0x200, // FALL
CC_WATERLCOL = 0x800, // Water collision (making you slide down an incline)? 2^8(CC_BEFOREFALL) is often set with this
CC_LIGHTDASHIN = 0x4000, // Light Dashing (2 ^ 14)
CC_QUICKROTATE = 0x8000, // is moving the control stick in a non-forward direction (usually only active for a frame since the character instantly rotates)
CC_TENTATIVE = 0x10000, // is Tentative collision
CC_WATERSLIDE = 0x20000, // Water sliding (2^17)
CC_GRASS = 0x100000, // grass 2^20
CC_DIRTCLAY = 0x200000, // dirt/clay (2^21)
CC_STONE = 0x400000, // stone (2^22)
CC_SHORELINE = 0x1000000, // shoreline? sand? Uncertain (2^24)
};

MARATHON_INSERT_PADDING(0x2C);
be<uint32_t> m_PostureFlags;
MARATHON_INSERT_PADDING(0x60);
xpointer<Score> m_pScore;
MARATHON_INSERT_PADDING(0x104);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@

namespace Sonicteam::Player::State
{
class ContextSpeedAndJump {};
class ContextSpeedAndJump
{
be<float> base_speed_z;
be<float> gimmick_speed_z;
be<float> base_speed_y;
be<float> gimmick_speed_y;
};
}
10 changes: 8 additions & 2 deletions MarathonRecomp/api/Sonicteam/Player/State/ICommonContext.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/Player/State/ContextSpeedAndJump.h>
#include <Sonicteam/Player/State/ICommonContextIF.h>
Expand All @@ -10,6 +9,13 @@ namespace Sonicteam::Player::State
class ICommonContext : public IContext, public ICommonContextIF, public ContextSpeedAndJump
{
public:
MARATHON_INSERT_PADDING(0x60);
be<uint32_t> m_CurrentAnimation;
be<float> m_LockInputTime;
be<uint32_t> m_LastVelocityZ;
be<uint32_t> m_LastVelocityY;
be<uint32_t> m_LastLockInputTime;
be<uint32_t> m_Input;
MARATHON_INSERT_PADDING(0x38);
};

}
1 change: 1 addition & 0 deletions MarathonRecomp/api/Sonicteam/Player/State/Machine2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <Sonicteam/Player/State/IContext.h>
#include <Sonicteam/Player/State/IMachine.h>
#include <Sonicteam/SoX/AI/StateMachine.h>
#include <Sonicteam/Player/State/IContext.h>

namespace Sonicteam::Player::State
{
Expand Down
60 changes: 60 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/State/SonicContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#pragma once
#include <Marathon.inl>
#include <Sonicteam/Player/State/CommonContext.h>
#include <Sonicteam/Player/SonicGauge.h>
#include <boost/smart_ptr/shared_ptr.h>


namespace Sonicteam::Player::State
{
class SonicContext : public CommonContext
{
public:
//Sprite
enum GemsS:uint32_t
{
SGreen = 1,
SRed,
SBlue,
SWhite,
SSky,
SYellow,
SPurple,
SSuper
};

enum Gems:uint32_t
{
Blue = 1,
Red,
Green,
Purple,
Sky,
White,
Yellow,
Super
};

be<GemsS> m_CurrentGemSprite;
boost::shared_ptr<Sonicteam::Player::SonicGauge> m_Gauge;
uint8_t m_HomingLockOn;
uint8_t m_DisablePlayerMovement;
uint8_t m_AntigravityHitBox;
uint8_t m_23F;
uint8_t m_BoundAttackHitBox;
uint8_t m_241;
uint8_t m_Shrink;
uint8_t m_ThunderGuard;
uint8_t m_Tornado;
uint8_t m_FPS;
uint8_t m_ThrowGem;
uint8_t m_SlowTime;
uint8_t m_MachAura;
uint8_t m_GemsEnabled;
uint8_t m_24A;
uint8_t m_24B;
be<uint32_t> m_HomingFlip;
be<Gems> m_CurrentGem;
MARATHON_INSERT_PADDING(0x58);
};
}
38 changes: 38 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/Weapon/SonicWeapons.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once
#include <Marathon.inl>
#include <Sonicteam/Player/IPlugIn.h>
#include <Sonicteam/Player/IFlagCommunicator.h>
#include <Sonicteam/Player/IStepable.h>
#include <Sonicteam/Player/IDynamicLink.h>
#include <Sonicteam/Player/IVariable.h>
#include <Sonicteam/Player/INotification.h>
#include <Sonicteam/SoX/Engine/Task.h>




namespace Sonicteam::Player::Weapon
{
template <typename Type>
struct LinkSoxNode
{
xpointer<LinkSoxNode<Type>> m_Prev;
xpointer<LinkSoxNode<Type>> m_Next;
Type* m_This;
};

template <typename Type>
struct EntityContainer
{
xpointer<Type> Entity;
LinkSoxNode<Type> m_Link;
};

class SonicWeapons : public IPlugIn, public IFlagCommunicator, public IStepable, public IDynamicLink, public IVariable, public INotification
{
public:
MARATHON_INSERT_PADDING(0x4C);
EntityContainer<Sonicteam::SoX::Engine::Task> m_GunDrive;
MARATHON_INSERT_PADDING(0x24);
};
}
Loading
Loading