[nostalgia/core] Add support for drawing NostalgiaGraphics in SDL

This commit is contained in:
2019-10-27 16:24:01 -05:00
parent 79a1a6f896
commit 52c4744242
9 changed files with 181 additions and 22 deletions
+15 -3
View File
@@ -15,6 +15,11 @@
namespace nostalgia::core {
enum class TileSheetSpace {
Background,
Sprite
};
using Color = uint16_t;
struct NostalgiaPalette {
@@ -26,7 +31,7 @@ struct NostalgiaGraphic {
static constexpr auto Fields = 4;
uint8_t bpp = 0;
ox::FileAddress defaultPalette;
ox::Vector<Color> pal;
NostalgiaPalette pal;
ox::Vector<uint8_t> tiles;
};
@@ -47,9 +52,16 @@ ox::Error model(T *io, NostalgiaPalette *pal) {
return OxError(0);
}
ox::Error initGfx(Context *ctx);
[[nodiscard]] ox::Error initGfx(Context *ctx);
ox::Error initConsole(Context *ctx);
[[nodiscard]] ox::Error shutdownGfx();
[[nodiscard]] ox::Error initConsole(Context *ctx);
/**
* @param section describes which section of the selected TileSheetSpace to use (e.g. MEM_PALLETE_BG[section])
*/
[[nodiscard]] ox::Error loadTileSheet(Context *ctx, TileSheetSpace tss, int section, ox::FileAddress tilesheet, ox::FileAddress palette = nullptr);
ox::Error loadTileSheet(Context *ctx, ox::FileAddress file);