misc fixes

This commit is contained in:
Clément Le Bihan
2021-07-13 22:18:55 +02:00
parent 2913e9eb2c
commit 9692120626
3 changed files with 22 additions and 40 deletions
+9 -19
View File
@@ -10,22 +10,22 @@
namespace ComSquare::PPU
{
Background::Background(ComSquare::PPU::PPU &ppu, int backGroundNumber, bool hasPriority)
Background::Background(ComSquare::PPU::PPU &ppu, int backgroundNumber)
: _ppu(ppu),
_tileMapMirroring(ppu.getBackgroundMirroring(backGroundNumber)),
_characterNbPixels(ppu.getCharacterSize(backGroundNumber)),
_bpp(ppu.getBPP(backGroundNumber)),
_tileMapMirroring(ppu.getBackgroundMirroring(backgroundNumber)),
_characterNbPixels(ppu.getCharacterSize(backgroundNumber)),
_bpp(ppu.getBPP(backgroundNumber)),
_directColor(false),
_highRes(false),
_tileMapStartAddress(ppu.getTileMapStartAddress(backGroundNumber)),
_tilesetAddress(ppu.getTilesetAddress(backGroundNumber)),
_priority(hasPriority),
_bgNumber(backGroundNumber),
_tileMapStartAddress(ppu.getTileMapStartAddress(backgroundNumber)),
_tilesetAddress(ppu.getTilesetAddress(backgroundNumber)),
_bgNumber(backgroundNumber),
_tileBuffer({{{0}}}),
_vram(ppu.vram),
_cgram(ppu.cgram),
_tileRenderer(this->_vram, this->_cgram),
buffer({{{0}}})
buffer({{{0}}}),
tilesPriority({{{false}}})
{}
void Background::renderBackground()
@@ -155,16 +155,6 @@ namespace ComSquare::PPU
return this->_bgNumber;
}
void Background::setPriority(bool priority)
{
this->_priority = priority;
}
bool Background::getPriority() const
{
return this->_priority;
}
bool Background::isPriorityPixel(int y, int x) const
{
return this->tilesPriority[y / this->_characterNbPixels.y][x / this->_characterNbPixels.x];