NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ef_memorymanagertmp.h
1#ifndef NW4R_EF_MEMORY_MANAGER_TMP_H
2#define NW4R_EF_MEMORY_MANAGER_TMP_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/ef/ef_effect.h>
6#include <nw4r/ef/ef_emitter.h>
7#include <nw4r/ef/ef_memorymanager.h>
8#include <nw4r/ef/ef_particle.h>
9#include <nw4r/ef/ef_particlemanager.h>
10
11#include <nw4r/ut.h>
12
13namespace nw4r {
14namespace ef {
15
16template <typename T> class MemoryManagerTmp {
17private:
18 T* mHead; // at 0x0
19 ut::List mFreeList; // at 0x4
20 ut::List mLeasedList; // at 0x10
21 int mStructSize; // at 0x1C
22
23public:
24 virtual void AssignObjectID(void* pObject);
25};
26
27class MemoryManager : public MemoryManagerBase {
28private:
29 struct MemInfo {
30 MemInfo* prev; // at 0x0
31 MemInfo* next; // at 0x4
32 MemInfo* chainPrev; // at 0x8
33 MemInfo* chainNext; // at 0xC
34 ulong size; // at 0x10
35 bool active; // at 0x14
36 u8 PADDING_0x15[3]; // at 0x15
37 };
38
39private:
40 int mMaxEffect; // at 0x4
41 MemoryManagerTmp<Effect>* mEffectOM; // at 0x8
42
43 int mMaxEmitter; // at 0xC
44 MemoryManagerTmp<Emitter>* mEmitterOM; // at 0x10
45
46 int mMaxParticleManager; // at 0x14
47 MemoryManagerTmp<ParticleManager>* mParticleManagerOM; // at 0x18
48
49 int mMaxParticle; // at 0x1C
50 MemoryManagerTmp<Particle>* mParticleOM; // at 0x20
51
52 void* mHeapStartAddr; // at 0x24
53 void* mHeapEndAddr; // at 0x28
54
55 MemInfo* mActiveMem; // at 0x2C
56 MemInfo* mFreeMem; // at 0x30
57 MemInfo* mFreeMemTail; // at 0x34
58 MemInfo* mAllChain; // at 0x38
59
60public:
61 // TODO: Crazy big implementation...
62
63 MemoryManager() {}
64 virtual ~MemoryManager() {} // at 0x8
65
66 virtual void GarbageCollection() = 0; // at 0xC
67
68 virtual Effect* AllocEffect() = 0; // at 0x10
69 virtual void FreeEffect(void* pObject) = 0; // at 0x14
70 virtual ulong GetNumAllocEffect() const = 0; // at 0x18
71 virtual ulong GetNumActiveEffect() const = 0; // at 0x1C
72 virtual ulong GetNumFreeEffect() const = 0; // at 0x20
73
74 virtual Emitter* AllocEmitter() = 0; // at 0x24
75 virtual void FreeEmitter(void* pObject) = 0; // at 0x28
76 virtual ulong GetNumAllocEmitter() const = 0; // at 0x2C
77 virtual ulong GetNumActiveEmitter() const = 0; // at 0x30
78 virtual ulong GetNumFreeEmitter() const = 0; // at 0x34
79
80 virtual ParticleManager* AllocParticleManager() = 0; // at 0x38
81 virtual void FreeParticleManager(void* pObject) = 0; // at 0x3C
82 virtual ulong GetNumAllocParticleManager() const = 0; // at 0x40
83 virtual ulong GetNumActiveParticleManager() const = 0; // at 0x44
84 virtual ulong GetNumFreeParticleManager() const = 0; // at 0x48
85
86 virtual Particle* AllocParticle() = 0; // at 0x4C
87 virtual void FreeParticle(void* pObject) = 0; // at 0x50
88 virtual ulong GetNumAllocParticle() const = 0; // at 0x54
89 virtual ulong GetNumActiveParticle() const = 0; // at 0x58
90 virtual ulong GetNumFreeParticle() const = 0; // at 0x5C
91
92 virtual void* AllocHeap(ulong size) = 0; // at 0x60
93};
94
95} // namespace ef
96} // namespace nw4r
97
98#endif