/* * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #include #include #include "gfx.hpp" #include "typeconv.hpp" #include "module.hpp" namespace nostalgia::core { CoreModule CoreModule::mod; ox::Vector CoreModule::converters() const noexcept { return { &nostalgiaPaletteToPaletteConverter, &nostalgiaGraphicToTileSheetConverter, &tileSheetToCompactTileSheetConverter, }; } ox::Vector 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() || typeId == ox::buildTypeId()) { oxReturnError(foundation::convertBuffToBuff(ctx, *buff, ox::ClawFormat::Metal).moveTo(buff)); } return {}; }, }; } }