Support Overlays #2

Merged
jaby merged 48 commits from Overlay-The-Beginning_CDDrive into main 2023-04-22 09:38:32 +00:00
1 changed files with 14 additions and 7 deletions
Showing only changes of commit 5a39a9a896 - Show all commits

View File

@ -60,25 +60,31 @@ namespace JabyEngine {
#define __declare_io_type(name, type, ...) \
template<template<typename> typename T> \
struct name##_io_base { \
T<type>::Value raw_value; \
T<type>::Value raw_value = 0; \
\
name##_io_base(type value) : raw_value(value) {} \
constexpr name##_io_base() = default; \
\
constexpr name##_io_base(type value) : raw_value(value) {} \
__VA_ARGS__ \
\
void set(IOBitSet bit) { \
constexpr name##_io_base& set(IOBitSet bit) { \
this->raw_value = bit::set(this->raw_value, bit.pos); \
return *this; \
} \
\
void set(IOBitUnset bit) { \
constexpr name##_io_base& set(IOBitUnset bit) { \
this->raw_value = bit::clear(this->raw_value, bit.pos); \
return *this; \
} \
\
void set(IOValueSet bits, type value) { \
constexpr name##_io_base& set(IOValueSet bits, type value) { \
this->raw_value = bit::value::set_normalized(this->raw_value, value, bits.pos, bits.length); \
return *this; \
} \
\
void set(const IOValueSet::IOValueSetPair<type>& value) { \
constexpr name##_io_base& set(const IOValueSet::IOValueSetPair<type>& value) { \
this->set(value.first, value.second); \
return *this; \
} \
\
type get(IOValueSet bits) const { \
@ -86,8 +92,9 @@ namespace JabyEngine {
} \
\
\
void clear(IOBitSet bit) { \
constexpr name##_io_base& clear(IOBitSet bit) { \
this->raw_value = bit::clear(this->raw_value, bit.pos); \
return *this; \
} \
\
\