[nostalgia] Collapse NostalgiaCore down to a single library and cleanup impl data access
This commit is contained in:
+12
-17
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <ox/std/types.hpp>
|
||||
#include <ox/model/def.hpp>
|
||||
#include <nostalgia/common/size.hpp>
|
||||
|
||||
#include "color.hpp"
|
||||
@@ -37,24 +38,18 @@ struct NostalgiaGraphic {
|
||||
ox::Vector<uint8_t> pixels;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, NostalgiaPalette *pal) noexcept {
|
||||
io->template setTypeInfo<NostalgiaPalette>();
|
||||
oxReturnError(io->field("colors", &pal->colors));
|
||||
return OxError(0);
|
||||
}
|
||||
oxModelBegin(NostalgiaPalette)
|
||||
oxModelField(colors)
|
||||
oxModelEnd()
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, NostalgiaGraphic *ng) noexcept {
|
||||
io->template setTypeInfo<NostalgiaGraphic>();
|
||||
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("pixels", &ng->pixels));
|
||||
return OxError(0);
|
||||
}
|
||||
oxModelBegin(NostalgiaGraphic)
|
||||
oxModelField(bpp)
|
||||
oxModelField(rows)
|
||||
oxModelField(columns)
|
||||
oxModelField(defaultPalette)
|
||||
oxModelField(pal)
|
||||
oxModelField(pixels)
|
||||
oxModelEnd()
|
||||
|
||||
struct Sprite {
|
||||
unsigned idx = 0;
|
||||
|
||||
Reference in New Issue
Block a user