First draft for LookUpColor8
This commit is contained in:
@@ -153,6 +153,30 @@ namespace JabyEngine {
|
||||
}
|
||||
};
|
||||
|
||||
struct LookUpColor8 {
|
||||
static constexpr BitRange LUPosition[] = {
|
||||
BitRange::from_to(0, 7),
|
||||
BitRange::from_to(8, 15)
|
||||
};
|
||||
uint8_t lu_id[2];
|
||||
|
||||
static constexpr LookUpColor8 from_ids(uint8_t px0, uint8_t px1) {
|
||||
return {{px0, px1}};
|
||||
}
|
||||
|
||||
constexpr uint8_t get_lu_id(size_t at) const {
|
||||
return this->lu_id[at];
|
||||
}
|
||||
|
||||
constexpr void set_lu_id(uint8_t new_lu_id, size_t at) {
|
||||
this->lu_id[at] = new_lu_id;
|
||||
}
|
||||
|
||||
uint16_t force_read() const {
|
||||
return *const_cast<const volatile uint16_t*>(reinterpret_cast<const uint16_t*>(this->lu_id));
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Position : public internal::XYMovement<Position<T>, T> {
|
||||
T x;
|
||||
|
Reference in New Issue
Block a user