mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-03 18:06:02 -04:00
4df8ccc871
* 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
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
|
|
|
#include "JSystem/JAudio2/JAUStreamFileTable.h"
|
|
|
|
JAUStreamFileTable::JAUStreamFileTable() {
|
|
mData = NULL;
|
|
}
|
|
|
|
void JAUStreamFileTable::init(void const* data) {
|
|
const BinaryStreamFileTable* binaryTable = (const BinaryStreamFileTable*)data;
|
|
if (binaryTable == NULL) {
|
|
mData = NULL;
|
|
return;
|
|
}
|
|
if (binaryTable->mIdentifier[0] == 'b' && binaryTable->mIdentifier[1] == 's' && binaryTable->mIdentifier[2] == 'f' && binaryTable->mIdentifier[3] == 't') {
|
|
mData = binaryTable;
|
|
}
|
|
}
|
|
|
|
u32 JAUStreamFileTable::getNumFiles() const {
|
|
return mData->mNumFiles;
|
|
}
|
|
|
|
const char* JAUStreamFileTable::getFilePath(int index) const {
|
|
if (mData == NULL) {
|
|
return 0;
|
|
}
|
|
JUT_ASSERT(52, index >= 0);
|
|
JUT_ASSERT(53, index < getNumFiles());
|
|
char* data = (char*)mData;
|
|
return (char*)(data + *(int*)(data + 8 + (index * sizeof(s32))));
|
|
}
|
|
|
|
s32 JAUStreamDataMgr_StreamFileTable::getStreamFileEntry(JAISoundID soundId) {
|
|
const char* filePath = getFilePath(soundId.id_.info.waveID);
|
|
if (filePath == NULL) {
|
|
return -1;
|
|
}
|
|
return DVDConvertPathToEntrynum(filePath);
|
|
}
|