mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-24 06:29:42 +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) {
|
||||
|
||||
uint8_t y = drawY + cy + offsetY;
|
||||
uint8_t y = drawY + (flipY ? 7 - cy : cy) + offsetY;
|
||||
if (y >= RasterHeight)
|
||||
break;
|
||||
|
||||
uint8_t x = drawX + cx + offsetX;
|
||||
uint8_t x = drawX + (flipX ? 7 - cx : cx) + offsetX;
|
||||
if (x >= RasterWidth)
|
||||
break;
|
||||
|
||||
auto outputPixel = y * RasterWidth + x;
|
||||
|
||||
auto colour = palette[definition.get()[cy * 8 + cx]];
|
||||
m_pixels[outputPixel] = m_colours->getColour(colour);
|
||||
auto colour = definition.get()[cy * 8 + cx];
|
||||
if (!allowTransparencies || (allowTransparencies && (colour > 0)))
|
||||
m_pixels[outputPixel] = m_colours->getColour(palette[colour]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user