[nostalgia/scene] Add models for Doc types

This commit is contained in:
Gary Talent 2021-01-22 22:40:59 -06:00
parent 9db256699d
commit 17ead36d2f

View File

@ -8,6 +8,7 @@
#pragma once #pragma once
#include <ox/std/error.hpp>
#include <ox/std/types.hpp> #include <ox/std/types.hpp>
#include <ox/std/vector.hpp> #include <ox/std/vector.hpp>
@ -25,6 +26,14 @@ struct TileDoc {
}; };
template<typename T>
constexpr ox::Error model(T *io, TileDoc *obj) {
io->template setTypeInfo<TileDoc>();
oxReturnError(io->field("sheetIdx", &obj->sheetIdx));
oxReturnError(io->field("type", &obj->type));
return OxError(0);
}
struct SceneDoc { struct SceneDoc {
using TileMapRow = ox::Vector<TileDoc>; using TileMapRow = ox::Vector<TileDoc>;
@ -40,6 +49,13 @@ struct SceneDoc {
}; };
template<typename T>
constexpr ox::Error model(T *io, SceneDoc *obj) {
io->template setTypeInfo<SceneDoc>();
oxReturnError(io->field("tiles", &obj->tiles));
return OxError(0);
}
struct SceneInstance { struct SceneInstance {
uint16_t layers = 0; uint16_t layers = 0;