NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ef_effectsystem.h
1#ifndef NW4R_EF_EFFECT_SYSTEM_H
2#define NW4R_EF_EFFECT_SYSTEM_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/ef/ef_creationqueue.h>
6#include <nw4r/ef/ef_random.h>
7
8#include <nw4r/math.h>
9
10namespace nw4r {
11namespace ef {
12
13// Forward declarations
15class DrawOrderBase;
17class EmitFormBuilder;
18class ActivityList;
19
20class EffectSystem {
21private:
22 MemoryManagerBase* mMemoryManager; // at 0x0
23
24public:
25 DrawOrderBase* mDrawOrderFunc; // at 0x4
26 DrawStrategyBuilder* mDrawStrategyBuilder; // at 0x8
27 EmitFormBuilder* mEmitFormBuilder; // at 0xC
28 CreationQueue mCreationQueue; // at 0x10
29 ulong mMaxGroupID; // at 0x5014
30 ActivityList* mActivityList; // at 0x5018
31 Random mRandom; // at 0x501C
32 math::VEC3 mProcessCameraPos; // at 0x5020
33 math::MTX34 mProcessCameraMtx; // at 0x502C
34 f32 mProcessCameraFar; // at 0x505C
35 f32 mProcessCameraNear; // at 0x5060
36 bool mXFFlushSafe; // at 0x5064
37
38 static bool mDisplayVersion;
39 static EffectSystem instance;
40
41public:
42 static EffectSystem* GetInstance();
43
44 bool Initialize(ulong maxGroupID);
45 bool Closing(Effect* pEffect);
46
47 Effect* CreateEffect(const char* pName, ulong groupID, u16 calcRemain);
48 ulong RetireEffect(Effect* pEffect);
49
50 ulong RetireEffectAll(ulong groupID);
51 ulong RetireEmitterAll(ulong groupID);
52 ulong RetireParticleAll(ulong groupID);
53
54 void Calc(ulong groupID, bool onlyBillboard);
55 void Draw(const DrawInfo& rInfo, ulong groupID);
56
57 MemoryManagerBase* GetMemoryManager() const {
58 return mMemoryManager;
59 }
60 void SetMemoryManager(MemoryManagerBase* pManager, ulong maxGroupID) {
61 mMemoryManager = pManager;
62
63 if (mMemoryManager != NULL) {
64 Initialize(maxGroupID);
65 } else {
66 maxGroupID = 0;
67 mActivityList = NULL;
68 }
69 }
70
71 void SetXFFlushSafe(bool safe) {
72 mXFFlushSafe = safe;
73 }
74
75private:
76 EffectSystem();
77 ~EffectSystem();
78};
79
80} // namespace ef
81} // namespace nw4r
82
83#endif