This commit is contained in:
parent
73da8eaaec
commit
ff7357a6d9
@ -137,9 +137,11 @@ OX_MODEL_END()
|
||||
[[nodiscard]]
|
||||
constexpr bool valid(WorldStatic const&ws) noexcept {
|
||||
auto const tileCnt = static_cast<size_t>(ws.columns * ws.rows);
|
||||
return ox::all_of(ws.map.begin(), ws.map.end(), [tileCnt](BgLayer const&v) {
|
||||
return v.tiles.size() == tileCnt;
|
||||
});
|
||||
return
|
||||
!ws.objTileRefSets.empty() &&
|
||||
ox::all_of(ws.map.begin(), ws.map.end(), [tileCnt](BgLayer const&v) {
|
||||
return v.tiles.size() == tileCnt;
|
||||
});
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
@ -192,9 +194,9 @@ class WorldStaticLoader {
|
||||
TileStatic &dst,
|
||||
TileDoc const&src) noexcept;
|
||||
|
||||
private:
|
||||
void reset();
|
||||
|
||||
private:
|
||||
ox::Result<uint8_t> setupTileResrc(DocObjRef const&docObjRef) noexcept;
|
||||
|
||||
void deleteRefSet(uint8_t refIdx, DocObjRef const&oldObjRef) noexcept;
|
||||
|
@ -405,7 +405,6 @@ ox::Error WorldEditorImGui::handleDepUpdate(ox::StringViewCR, ox::UUID const&uui
|
||||
auto const depUpdated = ox::any_of(m_doc.objSets.begin(), m_doc.objSets.end(), objSetMatches)
|
||||
|| ox::any_of(m_dependencies.pairs().begin(), m_dependencies.pairs().end(), depMatches);
|
||||
if (depUpdated) {
|
||||
m_loader.reset();
|
||||
OX_RETURN_ERROR(m_loader.loadWorldStatic());
|
||||
OX_RETURN_ERROR(loadObjectSets());
|
||||
}
|
||||
@ -429,7 +428,6 @@ ox::Error WorldEditorImGui::loadObjectSets() noexcept {
|
||||
|
||||
ox::Error WorldEditorImGui::undoStackChanged(studio::UndoCommand const*cmd) {
|
||||
if (dynamic_cast<EditWorldSizeCommand const*>(cmd)) {
|
||||
m_loader.reset();
|
||||
OX_RETURN_ERROR(m_loader.loadWorldStatic());
|
||||
}
|
||||
OX_RETURN_ERROR(m_view.setupWorld());
|
||||
|
@ -56,7 +56,7 @@ ox::Error WorldStaticLoader::loadWorldStatic() noexcept {
|
||||
}
|
||||
}
|
||||
m_loaded = true;
|
||||
return {};
|
||||
return keel::ensureValid(m_worldStatic);
|
||||
}
|
||||
|
||||
ox::Error WorldStaticLoader::updateTile(
|
||||
|
Loading…
x
Reference in New Issue
Block a user