Add more make functions
This commit is contained in:
@@ -8,6 +8,10 @@ namespace JabyEngine {
|
||||
struct PagePositionClut {
|
||||
PagePosition page;
|
||||
PageClut clut;
|
||||
|
||||
static constexpr PagePositionClut create(PagePosition page, PageClut clut) {
|
||||
return PagePositionClut{page, clut};
|
||||
}
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
@@ -65,6 +65,76 @@ namespace JabyEngine {
|
||||
static constexpr GPU::Vertex Vertex(int16_t x, int16_t y) {
|
||||
return creator_template<GPU::Vertex>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::AreaI16 AreaI16(int16_t x, int16_t y, int16_t w, int16_t h) {
|
||||
return creator_template<GPU::AreaI16>(x, y, w, h);
|
||||
}
|
||||
|
||||
static constexpr GPU::AreaI16 AreaI16(GPU::PositionI16 pos, GPU::SizeI16 size) {
|
||||
return creator_template<GPU::AreaI16>(pos, size);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::AreaU16 AreaU16(uint16_t x, uint16_t y, uint16_t w, uint16_t h) {
|
||||
return creator_template<GPU::AreaU16>(x, y, w, h);
|
||||
}
|
||||
|
||||
static constexpr GPU::AreaU16 AreaU16(GPU::PositionU16 pos, GPU::SizeU16 size) {
|
||||
return creator_template<GPU::AreaU16>(pos, size);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::PagePosition PagePosition() {
|
||||
return creator_template<GPU::PagePosition>(0, 0);
|
||||
}
|
||||
|
||||
static constexpr GPU::PagePosition PagePosition(uint8_t u, uint8_t v) {
|
||||
return creator_template<GPU::PagePosition>(u, v);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::PageClut PageClut() {
|
||||
return creator_template<GPU::PageClut>(0, 0);
|
||||
}
|
||||
|
||||
static constexpr GPU::PageClut PageClut(uint16_t x, uint16_t y) {
|
||||
return creator_template<GPU::PageClut>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::PagePositionClut PagePositionClut() {
|
||||
return creator_template<GPU::PagePositionClut>(PagePosition(), PageClut());
|
||||
}
|
||||
|
||||
static constexpr GPU::PagePositionClut PagePositionClut(GPU::PagePosition page, GPU::PageClut clut) {
|
||||
return creator_template<GPU::PagePositionClut>(page, clut);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::VertexColor VertexColor() {
|
||||
return creator_template<GPU::VertexColor>(Vertex(), GPU::Color24::Black());
|
||||
}
|
||||
|
||||
static constexpr GPU::VertexColor VertexColor(GPU::Vertex pos, GPU::Color24 color) {
|
||||
return creator_template<GPU::VertexColor>(pos, color);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::ColorVertex ColorVertex() {
|
||||
return creator_template<GPU::ColorVertex>(GPU::Color24::Black(), Vertex());
|
||||
}
|
||||
|
||||
static constexpr GPU::ColorVertex ColorVertex(GPU::Color24 color, GPU::Vertex pos) {
|
||||
return creator_template<GPU::ColorVertex>(color, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -207,11 +207,19 @@ namespace JabyEngine {
|
||||
struct VertexColor {
|
||||
Vertex position;
|
||||
Color24 color;
|
||||
|
||||
static constexpr VertexColor create(Vertex vertex, Color24 color) {
|
||||
return VertexColor{vertex, color};
|
||||
}
|
||||
};
|
||||
|
||||
struct ColorVertex {
|
||||
Color24 color;
|
||||
alignas(2) Vertex position;
|
||||
|
||||
static constexpr ColorVertex create(Color24 color, Vertex vertex) {
|
||||
return ColorVertex{color, vertex};
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user