NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_SoundHeap.h
1#ifndef NW4R_SND_SOUND_HEAP_H
2#define NW4R_SND_SOUND_HEAP_H
3#include "nw4r/snd/snd_FrameHeap.h"
4#include "nw4r/snd/snd_SoundMemoryAllocatable.h"
5#include "nw4r/ut.h" // IWYU pragma: export
6#include <revolution/OS.h> // IWYU pragma: export
7
8
9namespace nw4r {
10namespace snd {
11
12class SoundHeap : public SoundMemoryAllocatable {
13public:
14 SoundHeap();
15 virtual ~SoundHeap(); // at 0x8
16
17 virtual void *Alloc(ulong size); // at 0xC
18
19 void *Alloc(ulong size, detail::FrameHeap::FreeCallback pCallback, void *pCallbackArg);
20
21 bool Create(void *pBase, ulong size);
22 void Destroy();
23
24 void Clear();
25
26 int SaveState();
27 void LoadState(int id);
28
29 bool IsValid() {
30 return mFrameHeap.IsValid();
31 }
32
33 int GetCurrentLevel() const {
35 return mFrameHeap.GetCurrentLevel();
36 }
37
38 ulong GetFreeSize() const {
40 return mFrameHeap.GetFreeSize();
41 }
42
43private:
44 static void DisposeCallbackFunc(void *pBuffer, ulong size, void *pCallbackArg);
45
46private:
47 mutable OSMutex mMutex; // at 0x0
48 detail::FrameHeap mFrameHeap; // at 0x1C
49};
50
51} // namespace snd
52} // namespace nw4r
53
54#endif