Display text
This commit is contained in:
@@ -141,6 +141,8 @@ namespace JabyEngine {
|
||||
return Position{.x = x, .y = y};
|
||||
}
|
||||
};
|
||||
typedef Position<int16_t> PositionI16;
|
||||
typedef Position<uint16_t> PositionU16;
|
||||
|
||||
template<typename T>
|
||||
struct Size {
|
||||
@@ -151,6 +153,10 @@ namespace JabyEngine {
|
||||
return Size{w, h};
|
||||
}
|
||||
};
|
||||
typedef Size<int16_t> SizeI16;
|
||||
typedef Size<uint16_t> SizeU16;
|
||||
// Type used for primitives
|
||||
typedef PositionI16 Vertex;
|
||||
|
||||
template<typename T>
|
||||
struct Area {
|
||||
@@ -173,6 +179,8 @@ namespace JabyEngine {
|
||||
return this->position.move(this->size.width, this->size.height);
|
||||
}
|
||||
};
|
||||
typedef Area<int16_t> AreaI16;
|
||||
typedef Area<uint16_t> AreaU16;
|
||||
|
||||
// Type used for primitives
|
||||
struct PageOffset : public internal::XYMovement<PageOffset, uint8_t> {
|
||||
@@ -189,20 +197,15 @@ namespace JabyEngine {
|
||||
static constexpr PageOffset create(uint8_t u, uint8_t v) {
|
||||
return PageOffset{.x = u, .y = v}; //< Activate x and y to use XYMovement during constexpr
|
||||
}
|
||||
|
||||
static constexpr PageOffset from_tile_id(int16_t id, int16_t row_count, SizeI16 size) {
|
||||
const auto x = id%row_count;
|
||||
const auto y = id/row_count;
|
||||
|
||||
return PageOffset::create(static_cast<int16_t>(size.width*x), static_cast<int16_t>(size.height*y));
|
||||
}
|
||||
};
|
||||
|
||||
typedef Position<int16_t> PositionI16;
|
||||
typedef Position<uint16_t> PositionU16;
|
||||
|
||||
typedef Size<int16_t> SizeI16;
|
||||
typedef Size<uint16_t> SizeU16;
|
||||
|
||||
typedef Area<int16_t> AreaI16;
|
||||
typedef Area<uint16_t> AreaU16;
|
||||
|
||||
// Type used for primitives
|
||||
typedef PositionI16 Vertex;
|
||||
|
||||
struct VertexColor {
|
||||
Vertex position;
|
||||
Color24 color;
|
||||
|
Reference in New Issue
Block a user