[nostalgia] Add type registration to Module, fix FileAddress conversion in vectors for nost-pack
This commit is contained in:
@@ -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 {};
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user