NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_PlayerHeap.h
1#ifndef NW4R_SND_PLAYER_HEAP_H
2#define NW4R_SND_PLAYER_HEAP_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include <types.h>
9
10#include "nw4r/snd/snd_SoundMemoryAllocatable.h"
11
12#include "nw4r/ut/ut_LinkList.h"
13
14/*******************************************************************************
15 * types
16 */
17
18// forward declarations
19namespace nw4r { namespace snd { namespace detail { class BasicSound; }}}
20namespace nw4r { namespace snd { class SoundPlayer; }}
21
22/*******************************************************************************
23 * classes and functions
24 */
25
26namespace nw4r { namespace snd { namespace detail
27{
28 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x26e9c
29 class PlayerHeap : public SoundMemoryAllocatable
30 {
31 // typedefs
32 public:
33 typedef ut::LinkList<PlayerHeap, 0x18> LinkList;
34
35 // methods
36 public:
37 // cdtors
38 PlayerHeap();
39 virtual ~PlayerHeap();
40
41 // virtual function ordering
42 // vtable SoundMemoryAllocatable
43 virtual void *Alloc(ulong size);
44
45 // methods
46 bool Create(void *startAddress, ulong size);
47 void Clear();
48 void Destroy();
49
50 ulong GetFreeSize() const;
51
52 void AttachSound(BasicSound *sound);
53 void DetachSound(BasicSound *sound);
54
55 void AttachSoundPlayer(SoundPlayer *player) { mPlayer = player; }
56
57 // members
58 private:
59 /* base SoundMemoryAllocatable */ // size 0x04, offset 0x00
60 BasicSound *mSound; // size 0x04, offset 0x04
61 SoundPlayer *mPlayer; // size 0x04, offset 0x08
62 void *mStartAddress; // size 0x04, offset 0x0c
63 void *mEndAddress; // size 0x04, offset 0x10
64 void *mAllocAddress; // size 0x04, offset 0x14
65 public:
66 ut::LinkListNode mLink; // size 0x08, offset 0x18
67 }; // size 0x20
68}}} // namespace nw4r::snd::detail
69
70#endif // NW4R_SND_PLAYER_HEAP_H