[nostalgia/core] Add missing nodiscards and noexcepts
This commit is contained in:
parent
4814b4f5cc
commit
863437fb10
@ -92,7 +92,7 @@ constexpr uint8_t blue32(Color32 c) noexcept {
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Color16 color16(uint8_t r, uint8_t g, uint8_t b) {
|
||||
constexpr Color16 color16(uint8_t r, uint8_t g, uint8_t b) noexcept {
|
||||
return r | (g << 5) | (b << 10);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ class Context {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]]
|
||||
constexpr T *windowerData() noexcept {
|
||||
return static_cast<T*>(m_windowerData);
|
||||
}
|
||||
@ -35,6 +36,7 @@ class Context {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]]
|
||||
constexpr T *rendererData() noexcept {
|
||||
return static_cast<T*>(m_rendererData);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ struct GbaTileMapTarget {
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
ox::Error modelRead(T *io, GbaPaletteTarget *t) {
|
||||
ox::Error modelRead(T *io, GbaPaletteTarget *t) noexcept {
|
||||
io->template setTypeInfo<GbaPaletteTarget>();
|
||||
const auto colorHandler = [t](std::size_t i, Color16 *c) {
|
||||
t->palette[i] = *c;
|
||||
@ -54,7 +54,7 @@ ox::Error modelRead(T *io, GbaPaletteTarget *t) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ox::Error modelRead(T *io, GbaTileMapTarget *t) {
|
||||
ox::Error modelRead(T *io, GbaTileMapTarget *t) noexcept {
|
||||
io->template setTypeInfo<GbaTileMapTarget>();
|
||||
uint8_t bpp;
|
||||
int dummy;
|
||||
|
@ -44,14 +44,14 @@ struct NostalgiaGraphic {
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, NostalgiaPalette *pal) {
|
||||
constexpr ox::Error model(T *io, NostalgiaPalette *pal) noexcept {
|
||||
io->template setTypeInfo<NostalgiaPalette>();
|
||||
oxReturnError(io->field("colors", &pal->colors));
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, NostalgiaGraphic *ng) {
|
||||
constexpr ox::Error model(T *io, NostalgiaGraphic *ng) noexcept {
|
||||
io->template setTypeInfo<NostalgiaGraphic>();
|
||||
oxReturnError(io->field("bpp", &ng->bpp));
|
||||
oxReturnError(io->field("rows", &ng->rows));
|
||||
|
Loading…
x
Reference in New Issue
Block a user