Making ComplexBitMap a POD part 1

This commit is contained in:
2022-09-11 11:36:51 +02:00
parent 9cb0b70308
commit d30a975725
9 changed files with 386 additions and 238 deletions

View File

@@ -46,16 +46,16 @@ namespace GPU {
struct __no_align GP0 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(GP0);
static constexpr GP0 QuickFill(Color color) {
return {(0x02 << 24) | color.raw()};
static constexpr GP0 QuickFill(Color24 color) {
return ComplexBitMap{(0x02 << 24) | color.raw()};
}
static constexpr GP0 TopLeftPosition(uint16_t x, uint16_t y) {
return {(y << 16) | x};
return ComplexBitMap{static_cast<uint16_t>((y << 16) | x)};
}
static constexpr GP0 WidthHeight(uint16_t w, uint16_t h) {
return {(h << 16) | w};
return ComplexBitMap{static_cast<uint16_t>((h << 16) | w)};
}
};
@@ -67,11 +67,11 @@ namespace GPU {
}
static constexpr GP1 Reset() {
return {0};
return ComplexBitMap{0};
}
static constexpr GP1 SetDisplayState(DisplayState state) {
return {construct_cmd(0x03, static_cast<uint32_t>(state))};
return ComplexBitMap{construct_cmd(0x03, static_cast<uint32_t>(state))};
}
};
}