[nostalgia] Move pack transforms to modules
This commit is contained in:
@@ -2,14 +2,19 @@
|
||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ox/model/model.hpp>
|
||||
|
||||
#include <nostalgia/foundation/module.hpp>
|
||||
|
||||
#include "gfx.hpp"
|
||||
#include "typeconv.hpp"
|
||||
|
||||
#include "module.hpp"
|
||||
|
||||
namespace nostalgia::core {
|
||||
|
||||
CoreModule CoreModule::mod;
|
||||
|
||||
ox::Vector<foundation::BaseConverter*> CoreModule::converters() const noexcept {
|
||||
return {
|
||||
&nostalgiaPaletteToPaletteConverter,
|
||||
@@ -18,6 +23,19 @@ ox::Vector<foundation::BaseConverter*> CoreModule::converters() const noexcept {
|
||||
};
|
||||
}
|
||||
|
||||
CoreModule CoreModule::mod;
|
||||
ox::Vector<foundation::PackTransform> CoreModule::packTransforms() const noexcept {
|
||||
return {
|
||||
// convert tilesheets to CompactTileSheets
|
||||
[](foundation::Context *ctx, ox::Buffer *buff) -> ox::Error {
|
||||
oxRequire(hdr, ox::readClawHeader(*buff));
|
||||
const auto typeId = ox::buildTypeId(hdr.typeName, hdr.typeVersion);
|
||||
if (typeId == ox::buildTypeId<TileSheet>() ||
|
||||
typeId == ox::buildTypeId<NostalgiaGraphic>()) {
|
||||
oxReturnError(foundation::convertBuffToBuff<core::CompactTileSheet>(ctx, *buff, ox::ClawFormat::Metal).moveTo(buff));
|
||||
}
|
||||
return {};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user