[nostalgia/core] Update pack transforms to use ModelTypeId_v

This commit is contained in:
Gary Talent 2024-04-10 00:03:16 -05:00
parent 7941a514ba
commit 9220271630

View File

@ -14,7 +14,7 @@
namespace nostalgia::core {
class KeelModule: public keel::Module {
static class: public keel::Module {
private:
NostalgiaPaletteToPaletteV1Converter m_nostalgiaPaletteToPaletteV1Converter;
PaletteV1ToPaletteV2Converter m_paletteV1ToPaletteV2Converter;
@ -62,11 +62,11 @@ class KeelModule: public keel::Module {
oxRequire(hdr, keel::readAssetHeader(buff));
auto const typeId = ox::buildTypeId(
hdr.clawHdr.typeName, hdr.clawHdr.typeVersion, hdr.clawHdr.typeParams);
if (typeId == ox::buildTypeId<TileSheetV1>() ||
typeId == ox::buildTypeId<TileSheetV2>() ||
typeId == ox::buildTypeId<TileSheetV3>() ||
typeId == ox::buildTypeId<TileSheetV4>()) {
oxReturnError(keel::convertBuffToBuff<core::CompactTileSheet>(
if (typeId == ox::ModelTypeId_v<TileSheetV1> ||
typeId == ox::ModelTypeId_v<TileSheetV2> ||
typeId == ox::ModelTypeId_v<TileSheetV3> ||
typeId == ox::ModelTypeId_v<TileSheetV4>) {
oxReturnError(keel::convertBuffToBuff<CompactTileSheet>(
ctx, buff, ox::ClawFormat::Metal).moveTo(buff));
}
return {};
@ -75,19 +75,18 @@ class KeelModule: public keel::Module {
oxRequire(hdr, keel::readAssetHeader(buff));
auto const typeId = ox::buildTypeId(
hdr.clawHdr.typeName, hdr.clawHdr.typeVersion, hdr.clawHdr.typeParams);
if (typeId == ox::buildTypeId<NostalgiaPalette>() ||
typeId == ox::buildTypeId<PaletteV1>()) {
oxReturnError(keel::convertBuffToBuff<core::Palette>(
if (typeId == ox::ModelTypeId_v<NostalgiaPalette> ||
typeId == ox::ModelTypeId_v<PaletteV1>) {
oxReturnError(keel::convertBuffToBuff<Palette>(
ctx, buff, ox::ClawFormat::Metal).moveTo(buff));
}
return {};
},
};
}
};
} mod;
static const KeelModule mod;
const keel::Module *keelModule() noexcept {
keel::Module const*keelModule() noexcept {
return &mod;
}