26 lines
883 B
C++
26 lines
883 B
C++
#include "custom_files.hpp"
|
|
#include <PSX/File/file_processor_helper.hpp>
|
|
#include <stdio.hpp>
|
|
|
|
namespace JabyEngine {
|
|
namespace FileProcessor {
|
|
struct JingleState {
|
|
uint32_t sfx_id;
|
|
};
|
|
|
|
static Progress parse_jingle(State::Configuration& config, JingleState& jingle) {
|
|
printf("Playing jingle: %i\n", jingle.sfx_id);
|
|
return Progress::Done;
|
|
}
|
|
|
|
State create_custom(const uint32_t* data_adr, const CDFileType_t& file_type, const CDFile::Payload& payload) {
|
|
switch(static_cast<FileType>(file_type)) {
|
|
case FileType::Jingle:
|
|
return State::from(JingleState{.sfx_id = payload.raw}, data_adr, parse_jingle);
|
|
|
|
default:
|
|
return FileProcessor::create(data_adr, Nothing());
|
|
}
|
|
}
|
|
}
|
|
} |