From fa2b8b7d4738e5ee098fc105adc60e10356dd410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 28 Sep 2026 03:39:31 +0200 Subject: Move code to the TUs that match link order and rename files Rename classes and files so that they sort where their code is linked, and move code that is linked inside another TU into that TU's file. | Old | New | TU start | |---|---|---| | ActorAreaInOutSendMessage | AreaInOutSendMessage | 0x710009fa64 | | AreaTagAction | AreaActionBase | 0x7100e21e64 | | sndResource.{h,cpp} | sndSound.{h,cpp} | | | Code | From | To | |---|---|---| | SoundMgr | sndMgr.h | sndSound.h | | PlayReport | PlayReportMgr.cpp | PlayReport.cpp | | PlayReport::addPlayTimes, addPosition | PlayReportMgr.cpp | ProductReporter.cpp | (AI assisted using Claude Fable 5.1 and Claude Opus 5.5) --- src/KingSystem/Sound/sndSound.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/KingSystem/Sound/sndSound.cpp (limited to 'src/KingSystem/Sound/sndSound.cpp') diff --git a/src/KingSystem/Sound/sndSound.cpp b/src/KingSystem/Sound/sndSound.cpp new file mode 100644 index 00000000..b9eb6422 --- /dev/null +++ b/src/KingSystem/Sound/sndSound.cpp @@ -0,0 +1,26 @@ +#include "KingSystem/Sound/sndSound.h" +#include +#include +#include + +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 \ No newline at end of file -- cgit v1.2.3