clean up a const -> constexpr

This commit is contained in:
Clément Le Bihan
2021-07-04 10:48:02 +02:00
parent 5860c10653
commit e4249b1576
2 changed files with 4 additions and 3 deletions
+1 -3
View File
@@ -83,13 +83,11 @@ namespace ComSquare::PPU
{
// TODO unit test this
uint16_t result = 0;
// TODO do a constexpr
const int TileByteSizeRow = 16;
switch (this->_bpp) {
case 8:
result += this->read2BPPValue(tileRowAddress + TileByteSizeRow * 2, pixelIndex) << 4;
result += this->read2BPPValue(tileRowAddress + TileByteSizeRow * 3, pixelIndex) << 6;
result += this->read2BPPValue(tileRowAddress + TileByteSizeRow * 2, pixelIndex) << 4;
FALLTHROUGH
case 4:
result += this->read2BPPValue(tileRowAddress + TileByteSizeRow, pixelIndex) << 2;
+3
View File
@@ -11,6 +11,9 @@ namespace ComSquare::PPU
{
class TileRenderer {
private:
//! @brief The byte size offset for 1 row in VRAM
static constexpr int TileByteSizeRow = 16;
//! @brief ram to render
std::shared_ptr<Ram::Ram> _ram;
//! @brief cgram to access the colors