EightBit/LR35902/inc/AbstractColourPalette.h
Adrian Conlon 759b4a9fa8 GameBoy: Correct a few (very minor C++) niggles in the implementation. No functional changes.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2020-11-07 09:41:12 +00:00

29 lines
444 B
C++

#pragma once
#include <array>
#include <cstdint>
#include <cassert>
namespace EightBit {
namespace GameBoy {
class AbstractColourPalette {
public:
enum {
Off,
Light,
Medium,
Dark
};
AbstractColourPalette() = default;
[[nodiscard]] auto colour(size_t index) const noexcept {
assert(index < m_colours.size());
return m_colours[index];
}
protected:
std::array<uint32_t, 4> m_colours;
};
}
}