Skip to content

Commit 977be91

Browse files
author
ReimousTH
committed
MyPE & Particles & Spanverse API
1 parent 900a838 commit 977be91

37 files changed

+1556
-10
lines changed

MarathonRecomp/api/Marathon.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "Sonicteam/GameImp.h"
4242
#include "Sonicteam/GameMode.h"
4343
#include "Sonicteam/Globals.h"
44+
#include "Sonicteam/MyPE/CManageParticle.h"
4445
#include "Sonicteam/HUDButtonWindow.h"
4546
#include "Sonicteam/HUDCALLBACK.h"
4647
#include "Sonicteam/HUDLimitTime.h"
@@ -86,6 +87,7 @@
8687
#include "Sonicteam/ObjectVehicle.h"
8788
#include "Sonicteam/ObjectVehicleBike.h"
8889
#include "Sonicteam/Particles/Particle.h"
90+
#include "Sonicteam/Particles/ParticleManager.h"
8991
#include "Sonicteam/Particles/ParticleRef.h"
9092
#include "Sonicteam/PauseAdapter.h"
9193
#include "Sonicteam/PauseTask.h"
@@ -157,6 +159,7 @@
157159
#include "Sonicteam/SoX/Engine/Doc.h"
158160
#include "Sonicteam/SoX/Engine/DocMode.h"
159161
#include "Sonicteam/SoX/Engine/Task.h"
162+
#include "Sonicteam/SoX/Engine/RenderProcess.h"
160163
#include "Sonicteam/SoX/Graphics/Device.h"
161164
#include "Sonicteam/SoX/Graphics/Frame.h"
162165
#include "Sonicteam/SoX/Graphics/FrameGP.h"

MarathonRecomp/api/Sonicteam/DocMarathonImp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <Sonicteam/MyGraphicsDevice.h>
88
#include <Sonicteam/RaderMapManager.h>
99
#include <Sonicteam/RenderTargetContainer.h>
10+
#include <Sonicteam/Particles/ParticleManager.h>
1011
#include <stdx/vector.h>
1112

1213
namespace Sonicteam
@@ -22,7 +23,9 @@ namespace Sonicteam
2223
bool m_VFrame;
2324
MARATHON_INSERT_PADDING(4);
2425
xpointer<RenderTargetContainer> m_pRenderTargetContainer;
25-
MARATHON_INSERT_PADDING(0x187C);
26+
MARATHON_INSERT_PADDING(0x2A8);
27+
xpointer<Particles::ParticleManager> m_pParticleManager;
28+
MARATHON_INSERT_PADDING(0x15D0);
2629
xpointer<RaderMapManager> m_pRaderMapManager;
2730
MARATHON_INSERT_PADDING(0x542D0);
2831
be<uint32_t> m_PlayerControllerID[4];
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/GE1PE/RefCountObject.h>
5+
#include <stdx/map.h>
6+
#include <stdx/string.h>
7+
8+
namespace Sonicteam::GE1PE
9+
{
10+
//.peb
11+
12+
class ParticleEngine;
13+
14+
//no name left for type
15+
class EffectBankData
16+
{
17+
public:
18+
be<uint32_t> m_Field0; // 0x3E - no idea
19+
stdx::string m_DataName; // player_sonic
20+
//from .peb (raw converted since they released after)
21+
xpointer<void> m_Data1;
22+
xpointer<void> m_Data2;
23+
xpointer<void> m_Data3;
24+
stdx::map<stdx::string, be<uint32_t>> m_EffectDataIndices; //barrier_g = 0x23
25+
};
26+
MARATHON_ASSERT_OFFSETOF(EffectBankData, m_EffectDataIndices, 0x2C);
27+
MARATHON_ASSERT_SIZEOF(EffectBankData, 0x38);
28+
29+
class EffectBank : public RefCountObject
30+
{
31+
public:
32+
xpointer<ParticleEngine> m_pParticleEngine;
33+
be<uint32_t> m_FieldC; //index ?
34+
xpointer<EffectBankData> m_pEffectBankA;
35+
};
36+
MARATHON_ASSERT_SIZEOF(EffectBank, 0x14);
37+
}
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+
5+
namespace Sonicteam::GE1PE
6+
{
7+
class EmitterListener
8+
{
9+
xpointer<void> m_pVftable;
10+
};
11+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/LinkNode.h>
5+
6+
namespace Sonicteam::GE1PE
7+
{
8+
class ParticleEngine;
9+
class Particle;
10+
class Emitter;
11+
class Effect;
12+
13+
class Manager
14+
{
15+
public:
16+
struct Vftable
17+
{
18+
be<uint32_t> fpDestroy;
19+
};
20+
21+
xpointer<Vftable> m_pVftable;
22+
xpointer<ParticleEngine> m_pParticleEngine;
23+
SoX::LinkNode<Manager> m_lnManager;
24+
SoX::LinkNode<void> m_lnField14;
25+
SoX::LinkNode<Particle> m_lnParticle;
26+
SoX::LinkNode<void> m_lnField2C;
27+
SoX::LinkNode<void> m_lnField38;
28+
SoX::LinkNode<Emitter> m_lnEmitter;
29+
SoX::LinkNode<Effect> m_lnEffect;
30+
SoX::LinkNode<Effect> m_lnField5C;
31+
MARATHON_INSERT_PADDING(0x24);
32+
};
33+
MARATHON_ASSERT_OFFSETOF(Manager, m_pParticleEngine, 4);
34+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnManager, 8);
35+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField14, 0x14);
36+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnParticle, 0x20);
37+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField2C, 0x2C);
38+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField38, 0x38);
39+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnEmitter, 0x44);
40+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnEffect, 0x50);
41+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField5C, 0x5C);
42+
//size == 0x34 (but PE::MyPlugin no idea about this)
43+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/System/Singleton.h>
5+
#include <Sonicteam/System/CreateStatic.h>
6+
#include <Sonicteam/GE1PE/Plugin.h>
7+
#include <boost/smart_ptr/shared_ptr.h>
8+
#include <stdx/map.h>
9+
#include <stdx/string.h>
10+
#include <stdx/vector.h>
11+
#include <Sonicteam/SoX/LinkNode.h>
12+
13+
namespace Sonicteam::GE1PE
14+
{
15+
class EffectBank;
16+
class TextureBank;
17+
class Material;
18+
class Manager;
19+
20+
class ParticleEngine : public System::Singleton<ParticleEngine,0x82D3C4F4, System::CreateStatic<ParticleEngine,0x82642090>>
21+
{
22+
public:
23+
xpointer<void> m_pVftable;
24+
boost::shared_ptr<Plugin> m_spPlugin;
25+
stdx::map<stdx::string, be<uint32_t>> m_mEffectIndicies; // ev001 = index
26+
stdx::map<stdx::string, be<uint32_t>> m_mTextureIndicies; //vehicle_jet_grid = 0x9F;
27+
stdx::map<stdx::string, be<uint32_t>> m_MaterialIndicies; //addBN = 3; MeshTestShader ...
28+
stdx::vector<xpointer<EffectBank>> m_vpEffectBank;
29+
stdx::vector<xpointer<TextureBank>> m_vpTextureBank;
30+
stdx::vector<xpointer<TextureBank>> m_vpMaterialBank;
31+
SoX::LinkNode<Manager> m_lnManager;
32+
stdx::vector<void> m_vField6C;
33+
};
34+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpEffectBank, 0x30);
35+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpTextureBank, 0x40);
36+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpMaterialBank, 0x50);
37+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_lnManager, 0x60);
38+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vField6C, 0x6C);
39+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/Engine/Doc.h>
5+
6+
namespace Sonicteam::GE1PE
7+
{
8+
class Plugin
9+
{
10+
public:
11+
struct Vftable
12+
{
13+
be<uint32_t> fpDestroy;
14+
//....
15+
};
16+
17+
xpointer<Vftable> m_pVftable;
18+
xpointer<SoX::Engine::Doc> m_pDoc;
19+
};
20+
//size == 0x34 (but PE::MyPlugin no idea about this)
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
namespace Sonicteam::GE1PE
6+
{
7+
class RefCountObject
8+
{
9+
public:
10+
struct Vftable
11+
{
12+
be<uint32_t> fpDestroy;
13+
};
14+
15+
xpointer<Vftable> m_pVftable;
16+
be<uint32_t> m_ReferenceCount;
17+
18+
void* Destroy(uint32_t flag = 1)
19+
{
20+
return GuestToHostFunction<void*>(m_pVftable->fpDestroy, this, flag);
21+
}
22+
23+
void Release(uint32_t flag = 1)
24+
{
25+
m_ReferenceCount = m_ReferenceCount - 1;
26+
27+
if (!m_ReferenceCount.get())
28+
Destroy(flag);
29+
}
30+
31+
inline void AddReference()
32+
{
33+
m_ReferenceCount = m_ReferenceCount + 1;
34+
}
35+
};
36+
}

MarathonRecomp/api/Sonicteam/Globals.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#pragma once
22

33
#include <Marathon.inl>
4+
#include <stdx/list.h>
45

56
namespace Sonicteam
67
{
8+
class MyRenderProcess;
9+
710
enum Character : uint32_t
811
{
912
Character_Sonic,
@@ -21,10 +24,14 @@ namespace Sonicteam
2124
{
2225
static inline be<float>* ms_MainDisplayColours[9];
2326

27+
static inline stdx::list<MyRenderProcess>* ms_lMyRenderProcess;
28+
2429
static void Init()
2530
{
2631
for (int i = 0; i < 9; i++)
2732
ms_MainDisplayColours[i] = (be<float>*)MmGetHostAddress(0x82036BE4 + (i * 4));
33+
34+
ms_lMyRenderProcess = (stdx::list<MyRenderProcess>*)MmGetHostAddress(0x82D3C568);
2835
}
2936
};
3037
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
typedef xpointer<void> lua_State
6+
7+
namespace Sonicteam
8+
{
9+
10+
class LuaNode
11+
{
12+
public:
13+
struct Vftable
14+
{
15+
be<uint32_t> fpDestroy;
16+
};
17+
xpointer<Vftable> m_pVftable;
18+
lua_State m_pLuaState;
19+
};
20+
}

0 commit comments

Comments
 (0)