From a2c012ead49488c32444833e9f8dd94b35c4fbdc Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 25 Mar 2020 02:05:09 -0500 Subject: [PATCH] [nostalgia][core][sdl] Fix bug in loading 8 bpp ng files --- src/nostalgia/core/sdl/gfx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index 4c3e20b1..fc301754 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -113,7 +113,7 @@ ox::Error loadTileSheet(Context *ctx, auto surface = SDL_CreateRGBSurfaceWithFormat(0, width, height, 16, format); auto sdlPalette = createSDL_Palette(palette); SDL_SetSurfacePalette(surface, sdlPalette); - if (bytesPerTile == 1) { + if (bytesPerTile == 64) { SDL_memcpy(surface->pixels, tilesheet.tiles.data(), bytesPerTile * tiles); } else { for (std::size_t i = 0; i < tilesheet.tiles.size(); ++i) {