[nostalgia] Add type registration to Module, fix FileAddress conversion in vectors for nost-pack

This commit is contained in:
2023-02-08 03:04:59 -06:00
parent dba31d2cd9
commit 3b05d4e16b
10 changed files with 129 additions and 39 deletions
+13 -1
View File
@@ -15,6 +15,17 @@ namespace nostalgia::core {
CoreModule CoreModule::mod;
ox::Vector<foundation::TypeDescGenerator> CoreModule::types() const noexcept {
return {
foundation::generateTypeDesc<TileSheetV1>,
foundation::generateTypeDesc<TileSheetV2>,
foundation::generateTypeDesc<TileSheet>,
foundation::generateTypeDesc<CompactTileSheet>,
foundation::generateTypeDesc<NostalgiaPalette>,
foundation::generateTypeDesc<Palette>,
};
}
ox::Vector<const foundation::BaseConverter*> CoreModule::converters() const noexcept {
return {
&nostalgiaPaletteToPaletteConverter,
@@ -33,7 +44,8 @@ ox::Vector<foundation::PackTransform> CoreModule::packTransforms() const noexcep
if (typeId == ox::buildTypeId<TileSheetV1>() ||
typeId == ox::buildTypeId<TileSheetV2>() ||
typeId == ox::buildTypeId<TileSheet>()) {
oxReturnError(foundation::convertBuffToBuff<core::CompactTileSheet>(ctx, *buff, ox::ClawFormat::Metal).moveTo(buff));
oxReturnError(foundation::convertBuffToBuff<core::CompactTileSheet>(
ctx, *buff, ox::ClawFormat::Metal).moveTo(buff));
}
return {};
},
+2
View File
@@ -20,6 +20,8 @@ class CoreModule: public foundation::Module {
public:
static CoreModule mod;
[[nodiscard]]
ox::Vector<foundation::TypeDescGenerator> types() const noexcept override;
[[nodiscard]]
ox::Vector<const foundation::BaseConverter*> converters() const noexcept override;
[[nodiscard]]
ox::Vector<foundation::PackTransform> packTransforms() const noexcept override;