[nostalgia/core] Add ability to save tile sheets and store columns and rows in ng file

This commit is contained in:
2020-03-11 00:17:07 -05:00
parent 748fea3d43
commit bf00ff0e41
8 changed files with 197 additions and 51 deletions
+7 -2
View File
@@ -34,8 +34,11 @@ struct NostalgiaPalette {
};
struct NostalgiaGraphic {
static constexpr auto Fields = 4;
uint8_t bpp = 0;
static constexpr auto Fields = 6;
int8_t bpp = 0;
// rows and columns are really only used by TileSheetEditor
int rows = 1;
int columns = 1;
ox::FileAddress defaultPalette;
NostalgiaPalette pal;
ox::Vector<uint8_t> tiles;
@@ -52,6 +55,8 @@ template<typename T>
ox::Error model(T *io, NostalgiaGraphic *ng) {
io->setTypeInfo("nostalgia::core::NostalgiaGraphic", NostalgiaGraphic::Fields);
oxReturnError(io->field("bpp", &ng->bpp));
oxReturnError(io->field("rows", &ng->rows));
oxReturnError(io->field("columns", &ng->columns));
oxReturnError(io->field("defaultPalette", &ng->defaultPalette));
oxReturnError(io->field("pal", &ng->pal));
oxReturnError(io->field("tiles", &ng->tiles));