Skip to content

Commit f898dc9

Browse files
committed
Select Map | B Switch Zock State
1 parent 802ed8c commit f898dc9

22 files changed

Lines changed: 830 additions & 22 deletions

File tree

MarathonRecomp/api/Marathon.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Sonicteam/DocMarathonState.h"
2626
#include "Sonicteam/GameImp.h"
2727
#include "Sonicteam/GameMode.h"
28+
#include "Sonicteam/MyPhantom.h"
2829
#include "Sonicteam/Player/IDynamicLink.h"
2930
#include "Sonicteam/Player/IExportPostureRequestFlag.h"
3031
#include "Sonicteam/Player/IExportWeaponRequestFlag.h"
@@ -34,6 +35,8 @@
3435
#include "Sonicteam/Player/IScore.h"
3536
#include "Sonicteam/Player/IStepable.h"
3637
#include "Sonicteam/Player/IVariable.h"
38+
#include "Sonicteam/Player/IZock.h"
39+
#include "Sonicteam/Player/Zock.h"
3740
#include "Sonicteam/Player/Object.h"
3841
#include "Sonicteam/Player/Score.h"
3942
#include "Sonicteam/Player/SonicGauge.h"
@@ -54,16 +57,24 @@
5457
#include "Sonicteam/SoX/Engine/Doc.h"
5558
#include "Sonicteam/SoX/Engine/DocMode.h"
5659
#include "Sonicteam/SoX/Engine/Task.h"
60+
#include "Sonicteam/SoX/Input/Manager.h"
5761
#include "Sonicteam/SoX/MessageReceiver.h"
5862
#include "Sonicteam/SoX/Object.h"
59-
#include "Sonicteam/SoX/Physics/Havok/WorldHavok.h"
63+
#include "Sonicteam/SoX/Math/Vector.h"
64+
#include "Sonicteam/SoX/Physics/Havok/EntityHavok.h"
65+
#include "Sonicteam/SoX/Physics/Havok/EntityHavokImp.h"
66+
#include "Sonicteam/SoX/Physics/Havok/PhantomHavok.h"
6067
#include "Sonicteam/SoX/Physics/World.h"
61-
#include "Sonicteam/SoX/Input/Manager.h"
68+
#include "Sonicteam/SoX/Physics/Entity.h"
69+
#include "Sonicteam/SoX/Physics/Phantom.h"
6270
#include "Sonicteam/SoX/RefCountObject.h"
6371
#include "Sonicteam/System/CreateStatic.h"
6472
#include "Sonicteam/System/Singleton.h"
6573
#include "Sonicteam/TitleTask.h"
6674
#include "boost/smart_ptr/make_shared_object.h"
6775
#include "boost/smart_ptr/shared_ptr.h"
76+
#include "Physics/RigidBody.h"
77+
#include "Physics/Entity.h"
78+
#include "Physics/Shape.h"
6879
#include "stdx/string.h"
6980
#include "stdx/vector.h"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
#include <Physics/Shape.h>
4+
5+
namespace Phys
6+
{
7+
class Entity:public Shape
8+
{
9+
MARATHON_INSERT_PADDING(0x5C);
10+
};
11+
}
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Physics/Entity.h>
5+
6+
namespace Phys
7+
{
8+
class RigidBody:public Entity
9+
{
10+
};
11+
}
12+

MarathonRecomp/api/Physics/Shape.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
namespace Phys
6+
{
7+
class Shape
8+
{
9+
public:
10+
xpointer<void> m_pVftable;
11+
MARATHON_INSERT_PADDING(0x34);
12+
be<uint32_t> m_CollisionFilter;
13+
MARATHON_INSERT_PADDING(0x34);
14+
};
15+
}
16+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/Physics/Havok/PhantomHavok.h>
5+
6+
namespace Sonicteam
7+
{
8+
class MyPhantom : public SoX::Physics::Havok::PhantomHavok
9+
{
10+
};
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/Player/IPlugIn.h>
5+
6+
7+
namespace Sonicteam::Player
8+
{
9+
class IZock : public IPlugIn {};
10+
}

MarathonRecomp/api/Sonicteam/Player/Object.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
#include <Marathon.h>
44
#include <Sonicteam/Player/State/Machine2.h>
5+
#include <boost/smart_ptr/shared_ptr.h>
6+
#include <Sonicteam/Player/IPlugIn.h>
7+
#include <stdx/vector.h>
58

69
namespace Sonicteam::Player
710
{
@@ -14,16 +17,23 @@ namespace Sonicteam::Player
1417
bool m_IsPlayer;
1518
bool m_IsPosture;
1619
bool m_IsAmigo;
17-
MARATHON_INSERT_PADDING(0x19);
20+
MARATHON_INSERT_PADDING(0x1);
21+
xpointer<Sonicteam::SoX::RefCountObject> m_RootFrame;
22+
MARATHON_INSERT_PADDING(0x14);
1823
boost::shared_ptr<State::Machine2> m_spStateMachine;
1924
MARATHON_INSERT_PADDING(0x10);
2025
be<uint32_t> m_SetupModuleIndexPrefix;
2126
be<uint32_t> m_SetupModuleIndexPostfix;
2227
boost::shared_ptr<IGauge> m_spGauge;
23-
MARATHON_INSERT_PADDING(0x204);
28+
MARATHON_INSERT_PADDING(0x8);
29+
stdx::vector<boost::shared_ptr<Sonicteam::Player::IPlugIn>> m_PlayerPlugins;
30+
MARATHON_INSERT_PADDING(0x1F4);
2431

2532
template <typename T>
2633
inline T* GetGauge();
34+
35+
template <typename T = Sonicteam::Player::IPlugIn>
36+
inline T* GetPlugin(const char* PluginName);
2737
};
2838
}
2939

MarathonRecomp/api/Sonicteam/Player/Object.inl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@ namespace Sonicteam::Player
55
{
66
return (T*)m_spGauge.get();
77
}
8+
9+
template<typename T>
10+
inline T* Sonicteam::Player::Object::GetPlugin(const char* PluginName)
11+
{
12+
for (stdx::vector<boost::shared_ptr<Sonicteam::Player::IPlugIn>>::iterator it = m_PlayerPlugins.begin(); it != m_PlayerPlugins.end(); it = it + 1)
13+
{
14+
if (it->get()->m_Name == PluginName)
15+
{
16+
return static_cast<T*>(it->get());
17+
}
18+
}
19+
return nullptr;
20+
}
821
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/Player/IZock.h>
5+
#include <Sonicteam/Player/IFlagCommunicator.h>
6+
#include <Sonicteam/Player/IStepable.h>
7+
#include <Sonicteam/Player/IDynamicLink.h>
8+
#include <Sonicteam/Player/IVariable.h>
9+
#include <Sonicteam/MyPhantom.h>
10+
11+
namespace Sonicteam::Player
12+
{
13+
class Zock : public IZock, public IFlagCommunicator, public IStepable, public IDynamicLink, public IVariable
14+
{
15+
public:
16+
MARATHON_INSERT_PADDING(0x8);
17+
xpointer<Sonicteam::MyPhantom> m_pPhantom;
18+
MARATHON_INSERT_PADDING(0x20);
19+
xpointer<Sonicteam::MyPhantom> m_pPhantomB;
20+
MARATHON_INSERT_PADDING(0x84);
21+
22+
};
23+
}

MarathonRecomp/api/Sonicteam/SoX/Input/Manager.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Sonicteam::SoX::Input
66
{
7+
78
enum KeyState
89
{
910
KeyState_DpadUp = 0x40,
@@ -20,13 +21,16 @@ namespace Sonicteam::SoX::Input
2021
KeyState_B = 0x2,
2122
KeyState_X = 0x8,
2223
KeyState_Y = 0x10,
24+
KeyState_LeftTrigger = 0x4000,
25+
KeyState_RightTrigger = 0x8000,
2326
};
2427

2528
struct PadState
2629
{
2730
be<uint32_t> LastButtons;
2831
be<uint32_t> InvertedLastButtons;
29-
MARATHON_INSERT_PADDING(8);
32+
be<uint32_t> PressedButtons;
33+
be<uint32_t> ReleasedButtons;
3034

3135
be<float> LeftStickHorizontal;
3236
be<float> LeftStickVertical;
@@ -37,6 +41,10 @@ namespace Sonicteam::SoX::Input
3741
be<float> RightStickVertical;
3842
be<short> RightStickHorizontalS16;
3943
be<short> RightStickVerticalS16;
44+
45+
bool IsDown(const KeyState in_Keys) const;
46+
bool IsPressed(const KeyState in_Keys) const;
47+
bool IsReleased(const KeyState in_Keys) const;
4048
};
4149

4250
class Manager
@@ -48,3 +56,5 @@ namespace Sonicteam::SoX::Input
4856
MARATHON_INSERT_PADDING(0x28);
4957
};
5058
}
59+
60+
#include "Manger.inl"

0 commit comments

Comments
 (0)