Fix function prototypes and types

This commit is contained in:
David Chavez 2022-06-02 19:42:18 +02:00 committed by KiritoDev
parent 332f8f93fb
commit e1affbdf9a
6 changed files with 24 additions and 19 deletions

View File

@ -41,14 +41,14 @@ void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* write
writer->Write((uint32_t)(entry->loop.count));
writer->Write((uint32_t)entry->loop.states.size());
for (int i = 0; i < entry->loop.states.size(); i++)
for (size_t i = 0; i < entry->loop.states.size(); i++)
writer->Write((entry->loop.states[i]));
writer->Write((uint32_t)(entry->book.order));
writer->Write((uint32_t)(entry->book.npredictors));
writer->Write((uint32_t)entry->book.books.size());
for (int i = 0; i < entry->book.books.size(); i++)
for (size_t i = 0; i < entry->book.books.size(); i++)
writer->Write((entry->book.books[i]));
}
@ -118,7 +118,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
fntWriter.Write((uint32_t)audio->soundFontTable[i].instruments.size());
fntWriter.Write((uint32_t)audio->soundFontTable[i].soundEffects.size());
for (int k = 0; k < audio->soundFontTable[i].drums.size(); k++)
for (size_t k = 0; k < audio->soundFontTable[i].drums.size(); k++)
{
fntWriter.Write(audio->soundFontTable[i].drums[k].releaseRate);
fntWriter.Write(audio->soundFontTable[i].drums[k].pan);
@ -130,7 +130,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
fntWriter.Write(audio->soundFontTable[i].drums[k].tuning);
}
for (int k = 0; k < audio->soundFontTable[i].instruments.size(); k++)
for (size_t k = 0; k < audio->soundFontTable[i].instruments.size(); k++)
{
fntWriter.Write((uint8_t)audio->soundFontTable[i].instruments[k].isValidInstrument);
@ -146,7 +146,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
WriteSoundFontEntry(audio->soundFontTable[i].instruments[k].highNotesSound, audio->samples, &fntWriter);
}
for (int k = 0; k < audio->soundFontTable[i].soundEffects.size(); k++)
for (size_t k = 0; k < audio->soundFontTable[i].soundEffects.size(); k++)
{
WriteSoundFontEntry(audio->soundFontTable[i].soundEffects[k], audio->samples, &fntWriter);
}
@ -156,7 +156,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit
}
// Write Sequences
for (int i = 0; i < audio->sequences.size(); i++)
for (size_t i = 0; i < audio->sequences.size(); i++)
{
auto seq = audio->sequences[i];

View File

@ -12,7 +12,8 @@ LTO ?= 0
WARN := -Wall -Wextra -Werror \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-unused-variable
-Wno-unused-variable \
-Wno-error=multichar
CXXFLAGS := $(WARN) -std=c++17
@ -46,6 +47,7 @@ INC_DIRS := $(addprefix -I, \
../../libultraship/libultraship \
../../libultraship/libultraship/Lib/spdlog/include \
../../libultraship/libultraship/Lib/Fast3D/U64 \
../../StormLib/src \
)
# create build directories

View File

@ -13,26 +13,26 @@ namespace Ship
entry->unk_bit26 = reader->ReadByte();
entry->unk_bit25 = reader->ReadByte();
int dataSize = reader->ReadInt32();
uint32_t dataSize = reader->ReadInt32();
for (size_t i = 0; i < dataSize; i++)
for (uint32_t i = 0; i < dataSize; i++)
entry->data.push_back(reader->ReadUByte());
entry->loop.start = reader->ReadUInt32();
entry->loop.end = reader->ReadUInt32();
entry->loop.count = reader->ReadUInt32();
int loopStateCnt = reader->ReadUInt32();
uint32_t loopStateCnt = reader->ReadUInt32();
for (size_t i = 0; i < loopStateCnt; i++)
for (uint32_t i = 0; i < loopStateCnt; i++)
entry->loop.states.push_back(reader->ReadInt16());
entry->book.order = reader->ReadInt32();
entry->book.npredictors = reader->ReadInt32();
int bookSize = reader->ReadInt32();
uint32_t bookSize = reader->ReadInt32();
for (size_t i = 0; i < bookSize; i++)
for (uint32_t i = 0; i < bookSize; i++)
entry->book.books.push_back(reader->ReadInt16());
}

View File

@ -76,6 +76,9 @@ int AudioPlayer_GetDesiredBuffered(void);
void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
int Controller_ShouldRumble(size_t i);
char* ResourceMgr_LoadSeqByID(int seqID);
int ResourceMgr_GetSeqSizeByID(int seqID);
SoundFont* ResourceMgr_LoadAudioSoundFont(int fontIndex);
#endif
#endif

View File

@ -373,7 +373,7 @@ void AudioLoad_InitTable(AudioTable* table, uintptr_t romAddr, u16 unkMediumPara
SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) {
char pad[0x8];
s32 index;
SoundFontData* font;
SoundFontData* font = NULL;
s32 numFonts;
s32 fontId;
s32 i;
@ -575,7 +575,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
while (numFonts > 0) {
fontId = gAudioContext.sequenceFontTable[index++];
//if (gUseLegacySD)
if (gUseLegacySD)
AudioLoad_SyncLoadFont(fontId);
numFonts--;

View File

@ -440,11 +440,11 @@ void func_800DBE64(void) {
void func_800DBE6C(void) {
}
void AudioSynth_LoadFilter(Acmd* cmd, s32 flags, s32 countOrBuf, s32 addr) {
void AudioSynth_LoadFilter(Acmd* cmd, s32 flags, s32 countOrBuf, uintptr_t addr) {
aFilter(cmd, flags, countOrBuf, addr);
}
void AudioSynth_LoadFilterCount(Acmd* cmd, s32 count, s32 addr) {
void AudioSynth_LoadFilterCount(Acmd* cmd, s32 count, uintptr_t addr) {
aFilter(cmd, 2, count, addr);
}