Prepare VAG loading

This commit is contained in:
2024-08-04 18:13:44 -05:00
parent 07327fd646
commit 10c394aeba
9 changed files with 69 additions and 15 deletions

View File

@@ -37,11 +37,17 @@ namespace JabyEngine {
}(file, buf_cfg, is_lz4);
switch(file.type) {
case CDFileType::SimpleTIM:
return FileProcessor::create(data_adr, file.payload.simple_tim);
case CDFileType::CopyTo:
return FileProcessor::create(data_adr, Nothing());
case CDFileType::SimpleTIM:
return FileProcessor::create(data_adr, file.payload.simple_tim);
#ifdef __SUPPORT_VAG__
case CDFileType::SonyVAG:
return FileProcessor::create(data_adr, file.payload.vag);
#endif //__SUPPORT_VAG__
default:
return FileProcessor::create_custom(data_adr, static_cast<CDFileType_t>(file.type) - static_cast<CDFileType_t>(CDFileType::Custom), file.payload);
}

View File

@@ -10,7 +10,7 @@ namespace JabyEngine {
}
State create(const uint32_t* data_adr, const Nothing& nothing) {
return State::from(NothingState(), reinterpret_cast<const uint8_t*>(data_adr), parse_nothing);
return State::from(NothingState(), data_adr, parse_nothing);
}
}
}

View File

@@ -139,7 +139,7 @@ namespace JabyEngine {
}
State create(const uint32_t* data_adr, const SimpleTIM& file) {
return State::from(SimpleTIMState(file), reinterpret_cast<const uint8_t*>(data_adr), parse_header);
return State::from(SimpleTIMState(file), data_adr, parse_header);
}
}
}

View File

@@ -0,0 +1,23 @@
#include <PSX/File/file_processor_helper.hpp>
#include <stdio.hpp>
#ifdef __SUPPORT_VAG__
namespace JabyEngine {
namespace FileProcessor {
struct VAGState {
static constexpr VAGState create() {
return VAGState{};
}
};
static Progress parse_header(State::Configuration& config, VAGState& state) {
printf("What am I supposed to do?!\n");
return Progress::Error;
}
State create(const uint32_t* data_adr, const VAG& file) {
return State::from(VAGState::create(), data_adr, parse_header);
}
}
}
#endif // __SUPPORT_VAG__