[nostalgia/core] Cleanup

This commit is contained in:
Gary Talent 2019-10-27 19:48:32 -05:00
parent 52c4744242
commit bae1908c3b

View File

@ -122,7 +122,7 @@ ox::Error loadTileSheet(Context *ctx,
return OxError(0); return OxError(0);
} }
void drawBackground(std::size_t bg) { void drawBackground(SDL_Texture *tex) {
//oxTrace("nostalgia::core::drawBackground") << "Drawing background"; //oxTrace("nostalgia::core::drawBackground") << "Drawing background";
SDL_Rect src = {}, dst = {}; SDL_Rect src = {}, dst = {};
src.x = 0; src.x = 0;
@ -132,7 +132,6 @@ void drawBackground(std::size_t bg) {
dst.y = 0; dst.y = 0;
dst.w = 64; dst.w = 64;
dst.h = 64; dst.h = 64;
const auto tex = bgTextures[bg];
if (tex) { if (tex) {
for (auto &m : bgTileMaps) { for (auto &m : bgTileMaps) {
for (auto t : m) { for (auto t : m) {
@ -148,10 +147,9 @@ void drawBackground(std::size_t bg) {
void draw() { void draw() {
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
drawBackground(0); for (auto tex : bgTextures) {
drawBackground(1); drawBackground(tex);
drawBackground(2); }
drawBackground(3);
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }