Remove Rectangle constructors
This commit is contained in:
@@ -44,10 +44,12 @@ namespace JabyEngine {
|
||||
|
||||
Color24 color;
|
||||
Code code;
|
||||
Vertex position;
|
||||
Vertex position;
|
||||
|
||||
constexpr RECT_BASE_F() = default;
|
||||
constexpr RECT_BASE_F(const Vertex& position, const Color24& color) : color(color), code(IdentityCode), position(position) {
|
||||
static constexpr RECT_BASE_F create(const Vertex& position, const Color24& color) {
|
||||
return RECT_BASE_F {
|
||||
.color = color, .code = IdentityCode, .position = position
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,19 +64,31 @@ namespace JabyEngine {
|
||||
PagePosition page;
|
||||
PageClut clut;
|
||||
|
||||
constexpr RECT_BASE_T() = default;
|
||||
constexpr RECT_BASE_T(const Vertex& position, const PagePositionClut& page, const Color24& color = Color24::Grey()) : color(color), code(IdentityCode), position(position), page(page.page), clut(page.clut) {
|
||||
static constexpr RECT_BASE_T create(const Vertex& position, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
return RECT_BASE_T {
|
||||
.color = color, .code = IdentityCode, .position = position, .page = page.page, .clut = page.clut
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RectCode::SizeType Size>
|
||||
struct RECT_F : public RECT_BASE_F<Size>, public internal::RenderPrimitive<RECT_F<Size>>, public internal::LinkedElementCreator<RECT_F<Size>> {
|
||||
using RECT_BASE_F<Size>::RECT_BASE_F;
|
||||
static constexpr RECT_F create(const Vertex& position, const Color24& color) {
|
||||
RECT_F rect;
|
||||
|
||||
static_cast<RECT_BASE_F<Size>&>(rect) = RECT_BASE_F<Size>::create(position, color);
|
||||
return rect;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RectCode::SizeType Size>
|
||||
struct RECT_T : public RECT_BASE_T<Size>, public internal::RenderPrimitive<RECT_T<Size>>, public internal::LinkedElementCreator<RECT_T<Size>> {
|
||||
using RECT_BASE_T<Size>::RECT_BASE_T;
|
||||
static constexpr RECT_T create(const Vertex& position, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
RECT_T rect;
|
||||
|
||||
static_cast<RECT_BASE_T<Size>&>(rect) = RECT_BASE_T<Size>::create(position, page, color);
|
||||
return rect;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,8 +98,12 @@ namespace JabyEngine {
|
||||
struct TILE : public internal::RECT_BASE_F<internal::RectCode::SizeType::Variable>, public internal::RenderPrimitive<TILE>, public internal::LinkedElementCreator<TILE> {
|
||||
SizeI16 size;
|
||||
|
||||
constexpr TILE() = default;
|
||||
constexpr TILE(const AreaI16& area, const Color24& color) : RECT_BASE_F(area.position, color), size(area.size) {
|
||||
static constexpr TILE create(const AreaI16& area, const Color24& color) {
|
||||
TILE tile;
|
||||
|
||||
static_cast<RECT_BASE_F&>(tile) = RECT_BASE_F::create(area.position, color);
|
||||
tile.size = area.size;
|
||||
return tile;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -95,8 +113,12 @@ namespace JabyEngine {
|
||||
struct SPRT : public internal::RECT_BASE_T<internal::RectCode::SizeType::Variable>, public internal::RenderPrimitive<SPRT>, public internal::LinkedElementCreator<SPRT> {
|
||||
SizeI16 size;
|
||||
|
||||
constexpr SPRT() = default;
|
||||
constexpr SPRT(const AreaI16& area, const PagePositionClut& page, const Color24& color = Color24::Grey()) : RECT_BASE_T(area.position, page, color), size(area.size) {
|
||||
static constexpr SPRT create(const AreaI16& area, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
SPRT sprt;
|
||||
|
||||
static_cast<RECT_BASE_T&>(sprt) = RECT_BASE_T::create(area.position, page, color);
|
||||
sprt.size = area.size;
|
||||
return sprt;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user