[jasper] Fix build
All checks were successful
Build / build (push) Successful in 2m19s

This commit is contained in:
Gary Talent 2023-12-29 00:39:57 -06:00
parent 9f51ca6e04
commit 536e4540cb
4 changed files with 45 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include "consts.hpp"
#include "prefab.hpp"
#include "worldobjectset.hpp"
#include "worldstatic.hpp"
namespace jasper::world {

View File

@ -0,0 +1,41 @@
/*
* Copyright 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <nostalgia/core/context.hpp>
#include "consts.hpp"
#include "prefab.hpp"
#include "worldstatic.hpp"
namespace jasper::world {
namespace ncore = nostalgia::core;
struct WorldObject {
static constexpr auto TypeName = "net.drinkingtea.nostalgia.world.WorldObject";
static constexpr auto TypeVersion = 1;
static constexpr auto Preloadable = true;
ox::FileAddress tilesheet;
ncore::SubSheetId subSheetId;
};
oxModelBegin(WorldObject)
oxModelField(tilesheet)
oxModelField(subsheetId)
oxModelEnd()
struct WorldObjectSet {
static constexpr auto TypeName = "net.drinkingtea.nostalgia.world.WorldObjectSet";
static constexpr auto TypeVersion = 1;
static constexpr auto Preloadable = true;
ox::Vector<WorldObject> objects;
};
oxModelBegin(WorldObjectSet)
oxModelField(objects)
oxModelEnd()
}

View File

@ -44,7 +44,7 @@ struct TileDoc {
if (subsheetId > -1) {
return subsheetId;
}
return ts.getIdFor(subsheetPath);
return getIdFor(ts, subsheetPath);
}
[[nodiscard]]
@ -52,7 +52,7 @@ struct TileDoc {
ncore::TileSheet const&ts) const noexcept {
// prefer the already present path
if (!subsheetPath.len()) {
return ts.getNameFor(subsheetId);
return getNameFor(ts, subsheetId);
}
return ox::StringView(subsheetPath);
}

View File

@ -56,7 +56,7 @@ ox::Error WorldDocToWorldStaticConverter::convert(
auto dstTile = dstLayer.tile(tileIdx);
dstTile.tileType = srcTile.type;
oxRequire(path, srcTile.getSubsheetPath(*ts));
oxRequire(mapIdx, ts->getTileOffset(path));
oxRequire(mapIdx, getTileOffset(*ts, path));
dstTile.tileMapIdx = static_cast<uint16_t>(mapIdx);
setLayerAttachments(layerIdx, srcTile, dstTile);
++tileIdx;