[nostalgia/core] Make invalid palette lookups return 0 instead of garbage memory

This commit is contained in:
2022-07-30 14:47:44 -05:00
parent c8dc14dd8e
commit 29fd9b8c4f
2 changed files with 8 additions and 1 deletions
@@ -93,7 +93,7 @@ void TileSheetPixels::setBufferObjects(const geo::Vec2 &paneSize) noexcept {
m_bufferSet.elements.resize(pixels * VertexEboLength);
// set pixels
subSheet->walkPixels(m_model->img().bpp, [&](std::size_t i, uint8_t p) {
auto color = pal->colors[p];
auto color = pal->color(p);
const auto pt = idxToPt(static_cast<int>(i), subSheet->columns);
const auto fx = static_cast<float>(pt.x);
const auto fy = static_cast<float>(pt.y);