mirror of
https://github.com/zeldaret/botw
synced 2026-06-08 04:07:15 -04:00
ksys/snd: Add SoundResource
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
target_sources(uking PRIVATE
|
||||
sndInfoData.cpp
|
||||
sndInfoData.h
|
||||
sndResource.cpp
|
||||
sndResource.h
|
||||
)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "KingSystem/Sound/sndResource.h"
|
||||
#include <heap/seadDisposer.h>
|
||||
#include <heap/seadExpHeap.h>
|
||||
#include <heap/seadFrameHeap.h>
|
||||
|
||||
namespace ksys::snd {
|
||||
|
||||
SEAD_SINGLETON_DISPOSER_IMPL(SoundResource)
|
||||
|
||||
SoundResource::~SoundResource() {
|
||||
mSoundResourceHeap->destroy();
|
||||
_30->destroy();
|
||||
if (mSoundDebugHeap)
|
||||
mSoundDebugHeap->destroy();
|
||||
}
|
||||
|
||||
void SoundResource::init(sead::Heap* heap, sead::Heap* debug_heap, bool extra_large) {
|
||||
mSoundResourceHeap =
|
||||
sead::FrameHeap::create(extra_large ? 0x9583000 : 0x6383000, "SoundResource", heap, 0x1000,
|
||||
sead::FrameHeap::cHeapDirection_Forward, false);
|
||||
if (debug_heap)
|
||||
mSoundDebugHeap = sead::ExpHeap::create(0x1E00000u, "SoundDebug", debug_heap, 0x1000,
|
||||
sead::ExpHeap::cHeapDirection_Forward, false);
|
||||
}
|
||||
|
||||
} // namespace ksys::snd
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
namespace ksys::snd {
|
||||
|
||||
// FIXME: incomplete
|
||||
class SoundResource {
|
||||
SEAD_SINGLETON_DISPOSER(SoundResource)
|
||||
SoundResource() = default;
|
||||
virtual ~SoundResource();
|
||||
|
||||
public:
|
||||
void init(sead::Heap* heap, sead::Heap* debug_heap, bool extra_large);
|
||||
sead::Heap* getSoundDebugHeap() const { return mSoundDebugHeap; }
|
||||
|
||||
private:
|
||||
sead::Heap* mSoundResourceHeap;
|
||||
void* _30;
|
||||
sead::Heap* mSoundDebugHeap;
|
||||
sead::Heap* mSoundResourceHeap = nullptr;
|
||||
sead::Heap* _30 = nullptr; // TODO find out what this does
|
||||
sead::Heap* mSoundDebugHeap = nullptr;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(SoundResource, 0x40);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user