[nostalgia] Add external palettes to tilesheet system

This commit is contained in:
2019-10-22 19:23:14 -05:00
parent fbdb48a1ee
commit 92103bfc41
31 changed files with 802 additions and 105 deletions
+19
View File
@@ -0,0 +1,19 @@
add_library(
NostalgiaCore-SDL
core.cpp
gfx.cpp
)
target_link_libraries(
NostalgiaCore-SDL PUBLIC
SDL2::Main
OxFS
OxStd
)
install(
TARGETS
NostalgiaCore-SDL
DESTINATION
${NOSTALGIA_DIST_PLUGIN}
)
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright 2016 - 2019 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <SDL.h>
#include <nostalgia/core/core.hpp>
namespace nostalgia::core {
ox::Error run() {
for (auto running = true; running;) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_q) {
running = false;
}
break;
case SDL_QUIT: {
running = false;
break;
}
}
}
SDL_Delay(1);
}
return OxError(0);
}
}
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright 2016 - 2019 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <SDL.h>
#include "../gfx.hpp"
namespace nostalgia::core {
static SDL_Window *window = nullptr;
ox::Error initGfx(Context*) {
window = SDL_CreateWindow("nostalgia", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1024, 768, SDL_WINDOW_SHOWN);
return OxError(window == nullptr);
}
ox::Error initConsole(Context*) {
return OxError(1);
}
ox::Error loadTileSheet(Context*, ox::FileAddress) {
return OxError(1);
}
void puts(Context*, int, const char*) {
}
void setTile(Context*, int, int, int, uint8_t) {
}
}