[nostalgia] Add support for asset UUID headers

This commit is contained in:
2023-02-12 00:02:41 -06:00
parent 2b821b73ff
commit 1b7b6e306e
14 changed files with 144 additions and 31 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ void setBgCbb(Context *ctx, unsigned bgIdx, unsigned cbb) noexcept;
/**
* @param section describes which section of the selected TileSheetSpace to use (e.g. MEM_PALLETE_BG[section])
*/
ox::Error loadBgTileSheet(Context *ctx, unsigned cbb, const ox::FileAddress &tilesheet,
const ox::FileAddress &palette = nullptr) noexcept;
ox::Error loadBgTileSheet(Context *ctx, unsigned cbb, const ox::FileAddress &tilesheetAddr,
const ox::FileAddress &paletteAddr = nullptr) noexcept;
ox::Error loadSpriteTileSheet(Context *ctx,
const ox::FileAddress &tilesheetAddr,
+3 -2
View File
@@ -4,6 +4,7 @@
#include <ox/model/model.hpp>
#include <nostalgia/foundation/asset.hpp>
#include <nostalgia/foundation/module.hpp>
#include "gfx.hpp"
@@ -39,8 +40,8 @@ ox::Vector<foundation::PackTransform> CoreModule::packTransforms() const noexcep
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, hdr.typeParams);
oxRequire(hdr, foundation::readAssetHeader(*buff));
const auto typeId = ox::buildTypeId(hdr.clawHdr.typeName, hdr.clawHdr.typeVersion, hdr.clawHdr.typeParams);
if (typeId == ox::buildTypeId<TileSheetV1>() ||
typeId == ox::buildTypeId<TileSheetV2>() ||
typeId == ox::buildTypeId<TileSheet>()) {