Skip to content
Merged
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
32 changes: 31 additions & 1 deletion MarathonRecomp/api/Marathon.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
#include "Sonicteam/MovieObjectWmv.h"
#include "Sonicteam/MovieTask.h"
#include "Sonicteam/MyGraphicsDevice.h"
#include "Sonicteam/MyPhantom.h"
#include "Sonicteam/MyTexture.h"
#include "Sonicteam/Player/IDynamicLink.h"
#include "Sonicteam/Player/IExportExternalFlag.h"
#include "Sonicteam/Player/IExportPostureRequestFlag.h"
#include "Sonicteam/Player/IExportWeaponRequestFlag.h"
#include "Sonicteam/Player/IFlagCommunicator.h"
Expand All @@ -44,7 +46,9 @@
#include "Sonicteam/Player/IScore.h"
#include "Sonicteam/Player/IStepable.h"
#include "Sonicteam/Player/IVariable.h"
#include "Sonicteam/Player/IZock.h"
#include "Sonicteam/Player/Object.h"
#include "Sonicteam/Player/RootFrame.h"
#include "Sonicteam/Player/Score.h"
#include "Sonicteam/Player/SonicGauge.h"
#include "Sonicteam/Player/State/CommonContext.h"
Expand All @@ -58,6 +62,7 @@
#include "Sonicteam/Player/State/Machine2.h"
#include "Sonicteam/Player/State/Object2.h"
#include "Sonicteam/Player/State/TailsContext.h"
#include "Sonicteam/Player/Zock.h"
#include "Sonicteam/SaveDataTask.h"
#include "Sonicteam/SaveDataTaskXENON.h"
#include "Sonicteam/SelectWindowTask.h"
Expand All @@ -67,24 +72,49 @@
#include "Sonicteam/SoX/Engine/Doc.h"
#include "Sonicteam/SoX/Engine/DocMode.h"
#include "Sonicteam/SoX/Engine/Task.h"
#include "Sonicteam/SoX/Graphics/Device.h"
#include "Sonicteam/SoX/Graphics/Frame.h"
#include "Sonicteam/SoX/Graphics/Technique.h"
#include "Sonicteam/SoX/Graphics/TechniqueFXL.h"
#include "Sonicteam/SoX/Graphics/Device.h"
#include "Sonicteam/SoX/Graphics/Xenon/DeviceXenon.h"
#include "Sonicteam/SoX/Graphics/Xenon/TextureXenon.h"
#include "Sonicteam/SoX/IResource.h"
#include "Sonicteam/SoX/Input/Manager.h"
#include "Sonicteam/SoX/Math/Matrix.h"
#include "Sonicteam/SoX/Math/Quaternion.h"
#include "Sonicteam/SoX/Math/Vector.h"
#include "Sonicteam/SoX/MessageReceiver.h"
#include "Sonicteam/SoX/Object.h"
#include "Sonicteam/SoX/Physics/Entity.h"
#include "Sonicteam/SoX/Physics/Havok/EntityHavok.h"
#include "Sonicteam/SoX/Physics/Havok/EntityHavokImp.h"
#include "Sonicteam/SoX/Physics/Havok/PhantomHavok.h"
#include "Sonicteam/SoX/Physics/Havok/WorldHavok.h"
#include "Sonicteam/SoX/Physics/Phantom.h"
#include "Sonicteam/SoX/Physics/PhantomListener.h"
#include "Sonicteam/SoX/Physics/Shape.h"
#include "Sonicteam/SoX/Physics/World.h"
#include "Sonicteam/SoX/RefCountObject.h"
#include "Sonicteam/SoX/RefSharedPointer.h"
#include "Sonicteam/StdImageFilters/BurnoutBlurFilter.h"
#include "Sonicteam/StdImageFilters/SingleTechniqueFilter.h"
#include "Sonicteam/System/CreateStatic.h"
#include "Sonicteam/System/Singleton.h"
#include "Sonicteam/TitleTask.h"
#include "boost/smart_ptr/make_shared_object.h"
#include "boost/smart_ptr/shared_ptr.h"
#include "hk330/hkArray.h"
#include "hk330/hkReferencedObject.h"
#include "hk330/hkpBroadPhaseHandle.h"
#include "hk330/hkpCdBody.h"
#include "hk330/hkpCollidable.h"
#include "hk330/hkpEntity.h"
#include "hk330/hkpLinkedCollidable.h"
#include "hk330/hkpProperty.h"
#include "hk330/hkpRigidBody.h"
#include "hk330/hkpShape.h"
#include "hk330/hkpTypedBroadPhaseHandle.h"
#include "hk330/hkpWorld.h"
#include "hk330/hkpWorldObject.h"
#include "stdx/string.h"
#include "stdx/vector.h"
9 changes: 8 additions & 1 deletion MarathonRecomp/api/Sonicteam/DocMarathonImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

#include <Marathon.inl>
#include <Sonicteam/SoX/Engine/Doc.h>
#include <Sonicteam/SoX/Input/Manager.h>
#include <boost/smart_ptr/shared_ptr.h>
#include <api/stdx/vector.h>

Comment thread
ReimousTH marked this conversation as resolved.
namespace Sonicteam
{
class DocMarathonImp : public SoX::Engine::Doc
{
public:
MARATHON_INSERT_PADDING(0x74);
MARATHON_INSERT_PADDING(0x40);
stdx::vector<boost::shared_ptr<SoX::Input::Manager>> m_vspInputManager;
MARATHON_INSERT_PADDING(0x24);
bool m_VFrame;
MARATHON_INSERT_PADDING(0x55B58);
be<uint32_t> m_PlayerControllerID[4];
};
}
15 changes: 14 additions & 1 deletion MarathonRecomp/api/Sonicteam/GameImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <Marathon.inl>
#include <Sonicteam/SoX/Physics/World.h>
#include <Sonicteam/SoX/RefSharedPointer.h>
#include <Sonicteam/SoX/RefCountObject.h>

namespace Sonicteam
{
Expand Down Expand Up @@ -52,11 +54,22 @@ namespace Sonicteam
MARATHON_INSERT_PADDING(0x0C);
be<uint32_t> m_Field1180;
MARATHON_INSERT_PADDING(0x838);
xpointer<SoX::Physics::World> m_pPhysicsWorld;
SoX::RefSharedPointer<SoX::Physics::World> m_spPhysicsWorld;
xpointer<void> m_pMyCollisionFilter;

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

int32_t PlayerActorIDToIndex(int32_t actorId) const
{
for (int i = 0; i < 4; i++)
{
if (m_PlayerData[i].ActorID == actorId)
return i;
}

return -1;
Comment thread
ReimousTH marked this conversation as resolved.
}
};
}

Expand Down
2 changes: 1 addition & 1 deletion MarathonRecomp/api/Sonicteam/GameImp.inl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Sonicteam
template <typename T>
inline T* GameImp::GetPhysicsWorld()
{
return (T*)m_pPhysicsWorld.get();
return (T*)m_spPhysicsWorld.get();
}
}
9 changes: 9 additions & 0 deletions MarathonRecomp/api/Sonicteam/MyPhantom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/SoX/Physics/Havok/PhantomHavok.h>

namespace Sonicteam
{
class MyPhantom : public SoX::Physics::Havok::PhantomHavok {};
}
12 changes: 12 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/IExportExternalFlag.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <Marathon.inl>

namespace Sonicteam::Player
{
class IExportExternalFlag
{
public:
xpointer<void> m_pVftable;
};
}
9 changes: 9 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/IZock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/Player/IPlugIn.h>

namespace Sonicteam::Player
{
class IZock : public IPlugIn {};
}
27 changes: 23 additions & 4 deletions MarathonRecomp/api/Sonicteam/Player/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

#include <Marathon.h>
#include <Sonicteam/Player/State/Machine2.h>
#include <boost/smart_ptr/shared_ptr.h>
#include <Sonicteam/Player/IPlugIn.h>
#include <stdx/vector.h>
#include <Sonicteam/SoX/RefCountObject.h>
#include <Sonicteam/SoX/RefSharedPointer.h>
#include <Sonicteam/Player/RootFrame.h>

namespace Sonicteam::Player
{
Expand All @@ -10,16 +16,29 @@ namespace Sonicteam::Player
public:
stdx::string m_PlayerLua;
stdx::string m_PlayerPackage;
MARATHON_INSERT_PADDING(0x8);
MARATHON_INSERT_PADDING(8);
be<uint32_t> m_PlayerIndex;
MARATHON_INSERT_PADDING(0x48);
MARATHON_INSERT_PADDING(0x2C);
bool m_IsPlayer;
bool m_IsPosture;
bool m_IsAmigo;
MARATHON_INSERT_PADDING(1);
SoX::RefSharedPointer<RootFrame> m_spRootFrame;
MARATHON_INSERT_PADDING(0x14);
boost::shared_ptr<State::Machine2> m_spStateMachine;
MARATHON_INSERT_PADDING(0x18);
MARATHON_INSERT_PADDING(0x10);
be<uint32_t> m_SetupModuleIndexPrefix;
be<uint32_t> m_SetupModuleIndexPostfix;
boost::shared_ptr<IGauge> m_spGauge;
MARATHON_INSERT_PADDING(0x204);
MARATHON_INSERT_PADDING(8);
stdx::vector<boost::shared_ptr<IPlugIn>> m_vspPlayerPlugins;
MARATHON_INSERT_PADDING(0x1F4);

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

template <typename T = IPlugIn>
inline T* GetPlugin(const char* pluginName);
};
}

Expand Down
12 changes: 12 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/Object.inl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@ namespace Sonicteam::Player
{
return (T*)m_spGauge.get();
}

template<typename T>
inline T* Object::GetPlugin(const char* pluginName)
{
for (auto& spPlugin : m_vspPlayerPlugins)
{
if (spPlugin->m_Name == pluginName)
return static_cast<T*>(spPlugin.get());
}

return nullptr;
}
}
22 changes: 22 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/RootFrame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/Player/IPlugIn.h>
#include <Sonicteam/SoX/Graphics/Frame.h>
#include <Sonicteam/SoX/Math/Matrix.h>
#include <Sonicteam/SoX/Math/Vector.h>

namespace Sonicteam::Player
{
class RootFrame : public SoX::Graphics::Frame, public IPlugIn
{
public:
SoX::Math::Matrix4x4 m_Transform70;
SoX::Math::Matrix4x4 m_TransformB0;
SoX::Math::Vector m_PositionF0;
SoX::Math::Vector m_Position100;
SoX::Math::Vector m_Impulse;
MARATHON_INSERT_PADDING(0x30);
be<uint64_t> m_ExternalFlag;
};
}
30 changes: 30 additions & 0 deletions MarathonRecomp/api/Sonicteam/Player/Zock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/Player/IZock.h>
#include <Sonicteam/Player/IFlagCommunicator.h>
#include <Sonicteam/Player/IStepable.h>
#include <Sonicteam/Player/IDynamicLink.h>
#include <Sonicteam/Player/IVariable.h>
#include <Sonicteam/MyPhantom.h>
#include <Sonicteam/SoX/Physics/World.h>
#include <Sonicteam/SoX/RefCountObject.h>
#include <Sonicteam/SoX/RefSharedPointer.h>
#include <Sonicteam/Player/RootFrame.h>
#include <Sonicteam/SoX/Physics/PhantomListener.h>

namespace Sonicteam::Player
{
class Zock : public IZock, public IFlagCommunicator, public IStepable, public IDynamicLink, public IVariable
{
public:
SoX::RefSharedPointer<SoX::Physics::World> m_spWorld;
SoX::RefSharedPointer<SoX::Physics::World> m_spRootFrame;
SoX::RefSharedPointer<MyPhantom> m_spPhantomA;
MARATHON_INSERT_PADDING(0x20);
SoX::RefSharedPointer<MyPhantom> m_spPhantomB;
MARATHON_INSERT_PADDING(0x40);
SoX::RefSharedPointer<SoX::Physics::PhantomListener> m_spPhantomListener;
MARATHON_INSERT_PADDING(0x3C);
};
}
15 changes: 15 additions & 0 deletions MarathonRecomp/api/Sonicteam/SoX/Graphics/Frame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <Marathon.inl>

#include <Sonicteam/SoX/RefCountObject.h>

namespace Sonicteam::SoX::Graphics
{
class Frame : public SoX::RefCountObject
{
public:
MARATHON_INSERT_PADDING(0x18); // SimpleNode
MARATHON_INSERT_PADDING(0x2C);
};
}
59 changes: 59 additions & 0 deletions MarathonRecomp/api/Sonicteam/SoX/Input/Manager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#pragma once

#include <Marathon.inl>

namespace Sonicteam::SoX::Input
{
enum KeyState
{
KeyState_DpadUp = 0x40,
KeyState_DpadDown = 0x80,
KeyState_DpadLeft = 0x100,
KeyState_DpadRight = 0x200,
KeyState_Start = 0x400,
KeyState_Select = 0x800,
KeyState_LeftStick = 0x10000,
KeyState_RightStick = 0x20000,
KeyState_LeftBumper = 0x1000,
KeyState_RightBumper = 0x2000,
KeyState_A = 0x1,
KeyState_B = 0x2,
KeyState_X = 0x8,
KeyState_Y = 0x10,
KeyState_LeftTrigger = 0x4000,
KeyState_RightTrigger = 0x8000,
};

struct PadState
{
be<uint32_t> LastButtons;
be<uint32_t> InvertedLastButtons;
be<uint32_t> PressedButtons;
be<uint32_t> ReleasedButtons;

be<float> LeftStickHorizontal;
be<float> LeftStickVertical;
be<short> LeftStickHorizontalS16;
be<short> LeftStickVerticalS16;

be<float> RightStickHorizontal;
be<float> RightStickVertical;
be<short> RightStickHorizontalS16;
be<short> RightStickVerticalS16;

bool IsDown(const KeyState in_Keys) const;
bool IsPressed(const KeyState in_Keys) const;
bool IsReleased(const KeyState in_Keys) const;
};

class Manager
{
public:
be<uint32_t> m_ControllerID;
MARATHON_INSERT_PADDING(0xC);
PadState m_PadState;
MARATHON_INSERT_PADDING(0x28);
};
}

#include "Manager.inl"
17 changes: 17 additions & 0 deletions MarathonRecomp/api/Sonicteam/SoX/Input/Manager.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Sonicteam::SoX::Input
{
inline bool PadState::IsDown(const KeyState in_Keys) const
{
return (LastButtons & in_Keys) == in_Keys;
}

inline bool PadState::IsPressed(const KeyState in_Keys) const
{
return (PressedButtons & in_Keys) == in_Keys;
}

inline bool PadState::IsReleased(const KeyState in_Keys) const
{
return (ReleasedButtons & in_Keys) == in_Keys;
}
}
Loading
Loading