This commit is contained in:
parent
9f51ca6e04
commit
536e4540cb
@ -8,6 +8,7 @@
|
||||
|
||||
#include "consts.hpp"
|
||||
#include "prefab.hpp"
|
||||
#include "worldobjectset.hpp"
|
||||
#include "worldstatic.hpp"
|
||||
|
||||
namespace jasper::world {
|
||||
|
@ -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()
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user