Remove the ComplexBitMap
This commit is contained in:
@@ -4,33 +4,35 @@
|
||||
#include "../jabyengine_defines.h"
|
||||
|
||||
namespace JabyEngine {
|
||||
struct __no_align SimpleTIM : private ComplexBitMap<uint32_t> {
|
||||
static constexpr auto TextureX = BitRange<uint32_t>(0, 8);
|
||||
static constexpr auto TextureY = BitRange<uint32_t>(9, 16);
|
||||
static constexpr auto ClutX = BitRange<uint32_t>(17, 22);
|
||||
static constexpr auto ClutY = BitRange<uint32_t>(23, 31);
|
||||
struct __no_align SimpleTIM {
|
||||
static constexpr auto TextureX = BitRange::from_to(0, 8);
|
||||
static constexpr auto TextureY = BitRange::from_to(9, 16);
|
||||
static constexpr auto ClutX = BitRange::from_to(17, 22);
|
||||
static constexpr auto ClutY = BitRange::from_to(23, 31);
|
||||
|
||||
uint32_t raw;
|
||||
|
||||
constexpr SimpleTIM() {
|
||||
this->raw = 0;
|
||||
}
|
||||
|
||||
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : ComplexBitMap(ComplexBitMap::with(TextureX.with(texX >> 1), TextureY.with(texY >> 1), ClutX.with(clutX >> 4), ClutY.with(clutY))) {
|
||||
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : raw(TextureX.as_value(texX >> 1) | TextureY.as_value(texY >> 1) | ClutX.as_value(clutX >> 4) | ClutY.as_value(clutY)) {
|
||||
}
|
||||
|
||||
constexpr uint16_t getTextureX() const {
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureX) << 1);
|
||||
return bit::value::get_normalized(this->raw, TextureX) << 1;
|
||||
}
|
||||
|
||||
constexpr uint16_t getTextureY() const {
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureY) << 1);
|
||||
return bit::value::get_normalized(this->raw, TextureY) << 1;
|
||||
}
|
||||
|
||||
constexpr uint16_t getClutX() const {
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutX) << 4);
|
||||
return bit::value::get_normalized(this->raw, SimpleTIM::ClutX) << 4;
|
||||
}
|
||||
|
||||
constexpr uint16_t getClutY() const {
|
||||
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutY);
|
||||
return bit::value::get_normalized(this->raw, ClutY);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user