Create constructor for SimpleTIM
This commit is contained in:
@@ -14,7 +14,6 @@ namespace JabyEngine {
|
||||
};
|
||||
|
||||
// TODO: Call TIM?
|
||||
// TODO: Add create function?
|
||||
struct SimpleTIM {
|
||||
static constexpr auto TextureX = BitRange::from_to(0, 8);
|
||||
static constexpr auto TextureY = BitRange::from_to(9, 16);
|
||||
@@ -23,9 +22,8 @@ namespace JabyEngine {
|
||||
|
||||
uint32_t raw;
|
||||
|
||||
constexpr SimpleTIM() : raw(0) {}
|
||||
|
||||
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(static_cast<uint32_t>(clutY))) {
|
||||
static constexpr SimpleTIM create(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) {
|
||||
return SimpleTIM{.raw = TextureX.as_value(texX >> 1) | TextureY.as_value(texY >> 1) | ClutX.as_value(clutX >> 4) | ClutY.as_value(static_cast<uint32_t>(clutY))};
|
||||
}
|
||||
|
||||
constexpr uint16_t get_texture_x() const {
|
||||
@@ -79,5 +77,5 @@ namespace JabyEngine {
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef CopyTo Overlay;
|
||||
using Overlay = CopyTo;
|
||||
}
|
Reference in New Issue
Block a user