mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-27 16:21:53 +00:00
clean up a const -> constexpr
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user