mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-08 11:47:03 -04:00
Reorganize library code into libs/ (#3119)
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAudio2/JASSimpleWaveBank.h"
|
||||
#include <stdint.h>
|
||||
|
||||
JASSimpleWaveBank::JASSimpleWaveBank() {
|
||||
mWaveTable = NULL;
|
||||
mWaveTableSize = 0;
|
||||
}
|
||||
|
||||
JASSimpleWaveBank::~JASSimpleWaveBank() {
|
||||
delete[] mWaveTable;
|
||||
}
|
||||
|
||||
void JASSimpleWaveBank::setWaveTableSize(u32 size, JKRHeap* heap) {
|
||||
delete[] mWaveTable;
|
||||
mWaveTable = new (heap, 0) TWaveHandle[size];
|
||||
JUT_ASSERT(29, mWaveTable != NULL);
|
||||
mWaveTableSize = size;
|
||||
}
|
||||
|
||||
JASWaveHandle* JASSimpleWaveBank::getWaveHandle(u32 no) const {
|
||||
if (no >= mWaveTableSize) {
|
||||
return NULL;
|
||||
}
|
||||
return &mWaveTable[no];
|
||||
}
|
||||
|
||||
void JASSimpleWaveBank::setWaveInfo(u32 no, JASWaveInfo const& waveInfo) {
|
||||
mWaveTable[no].mWaveInfo = waveInfo;
|
||||
mWaveTable[no].mWaveInfo.field_0x20 = &_48;
|
||||
mWaveTable[no].mHeap = &mHeap;
|
||||
}
|
||||
|
||||
JASWaveArc* JASSimpleWaveBank::getWaveArc(u32 no) {
|
||||
if (no != 0) {
|
||||
return NULL;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
int JASSimpleWaveBank::TWaveHandle::getWavePtr() const {
|
||||
void* base = mHeap->getBase();
|
||||
if (base == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return (intptr_t)base + mWaveInfo.field_0x08;
|
||||
}
|
||||
|
||||
JASSimpleWaveBank::TWaveHandle::TWaveHandle() {
|
||||
mHeap = NULL;
|
||||
}
|
||||
|
||||
const JASWaveInfo* JASSimpleWaveBank::TWaveHandle::getWaveInfo() const {
|
||||
return &mWaveInfo;
|
||||
}
|
||||
|
||||
u32 JASSimpleWaveBank::getArcCount() const {
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user