mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-25 12:31:30 +00:00
Whoops: broke sprite transparency and flipping!
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
f4c8496882
commit
26e99f6934
@ -143,18 +143,19 @@ void EightBit::GameBoy::Display::renderTile(
|
|||||||
|
|
||||||
for (int cx = 0; cx < 8; ++cx) {
|
for (int cx = 0; cx < 8; ++cx) {
|
||||||
|
|
||||||
uint8_t y = drawY + cy + offsetY;
|
uint8_t y = drawY + (flipY ? 7 - cy : cy) + offsetY;
|
||||||
if (y >= RasterHeight)
|
if (y >= RasterHeight)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
uint8_t x = drawX + cx + offsetX;
|
uint8_t x = drawX + (flipX ? 7 - cx : cx) + offsetX;
|
||||||
if (x >= RasterWidth)
|
if (x >= RasterWidth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
auto outputPixel = y * RasterWidth + x;
|
auto outputPixel = y * RasterWidth + x;
|
||||||
|
|
||||||
auto colour = palette[definition.get()[cy * 8 + cx]];
|
auto colour = definition.get()[cy * 8 + cx];
|
||||||
m_pixels[outputPixel] = m_colours->getColour(colour);
|
if (!allowTransparencies || (allowTransparencies && (colour > 0)))
|
||||||
|
m_pixels[outputPixel] = m_colours->getColour(palette[colour]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user