Improve naming
This commit is contained in:
@@ -60,37 +60,37 @@ namespace JabyEngine {
|
||||
|
||||
struct POLY_FT3 : public internal::RenderPrimitive<POLY_FT3>, public internal::PolyCodeInterface<POLY_FT3>, public internal::LinkedElementCreator<POLY_FT3> {
|
||||
struct VertexEx {
|
||||
Vertex position;
|
||||
PagePosition page;
|
||||
Vertex position;
|
||||
PageOffset tex_offset;
|
||||
};
|
||||
static constexpr auto IdentityCode = Code(POLY_F3::IdentityCode).set(Code::Textured);
|
||||
|
||||
Color24 color; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PagePosition page0; // c
|
||||
PageClut page_clut; // c
|
||||
Vertex vertex1; // d
|
||||
PagePosition page1; // e
|
||||
TPage tpage; // e
|
||||
Vertex vertex2; // f
|
||||
PagePosition page2; // g
|
||||
uint16_t padded2; // g
|
||||
Color24 color; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PageOffset tex_offset0; // c
|
||||
PageClut page_clut; // c
|
||||
Vertex vertex1; // d
|
||||
PageOffset tex_offset1; // e
|
||||
TPage tpage; // e
|
||||
Vertex vertex2; // f
|
||||
PageOffset tex_offset2; // g
|
||||
uint16_t padded2; // g
|
||||
|
||||
static constexpr POLY_FT3 create(const Vertex (&verticies)[3], const PagePosition (&page_pos)[3], TPage tpage, PageClut clut, Color24 color = Color24::Grey()) {
|
||||
return POLY_FT3::create(
|
||||
{{verticies[0], page_pos[0]},
|
||||
{verticies[1], page_pos[1]},
|
||||
{verticies[2], page_pos[2]}
|
||||
static constexpr POLY_FT3 create(const Vertex (&verticies)[3], const PageOffset (&tex_offsets)[3], TPage tpage, PageClut clut, Color24 color = Color24::Grey()) {
|
||||
return POLY_FT3::create({
|
||||
{verticies[0], tex_offsets[0]},
|
||||
{verticies[1], tex_offsets[1]},
|
||||
{verticies[2], tex_offsets[2]}
|
||||
}, tpage, clut, color);
|
||||
}
|
||||
|
||||
static constexpr POLY_FT3 create(const VertexEx (&vertices_ex)[3], TPage tpage, PageClut clut, Color24 color) {
|
||||
return POLY_FT3 {
|
||||
.color = color, .code = IdentityCode,
|
||||
.vertex0 = vertices_ex[0].position, .page0 = vertices_ex[0].page, .page_clut = clut,
|
||||
.vertex1 = vertices_ex[1].position, .page1 = vertices_ex[1].page, .tpage = tpage,
|
||||
.vertex2 = vertices_ex[2].position, .page2 = vertices_ex[2].page};
|
||||
.vertex0 = vertices_ex[0].position, .tex_offset0 = vertices_ex[0].tex_offset, .page_clut = clut,
|
||||
.vertex1 = vertices_ex[1].position, .tex_offset1 = vertices_ex[1].tex_offset, .tpage = tpage,
|
||||
.vertex2 = vertices_ex[2].position, .tex_offset2 = vertices_ex[2].tex_offset};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -126,41 +126,41 @@ namespace JabyEngine {
|
||||
|
||||
struct POLY_GT3 : public internal::RenderPrimitive<POLY_GT3>, public internal::PolyCodeInterface<POLY_GT3>, public internal::LinkedElementCreator<POLY_GT3> {
|
||||
struct VertexEx {
|
||||
Vertex position;
|
||||
PagePosition page;
|
||||
Color24 color;
|
||||
Vertex position;
|
||||
PageOffset tex_offset;
|
||||
Color24 color;
|
||||
};
|
||||
static constexpr auto IdentityCode = Code(POLY_G3::IdentityCode).set(Code::Textured);
|
||||
|
||||
Color24 color0; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PagePosition page0; // c
|
||||
PageClut page_clut; // c
|
||||
Color24 color1; // d
|
||||
uint8_t pad1; // d
|
||||
Vertex vertex1; // e
|
||||
PagePosition page1; // f
|
||||
TPage tpage; // f
|
||||
Color24 color2; // g
|
||||
uint8_t pad2; // g
|
||||
Vertex vertex2; // h
|
||||
PagePosition page2; // i
|
||||
uint16_t pad3; // i
|
||||
Color24 color0; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PageOffset tex_offset0; // c
|
||||
PageClut page_clut; // c
|
||||
Color24 color1; // d
|
||||
uint8_t pad1; // d
|
||||
Vertex vertex1; // e
|
||||
PageOffset tex_offset1; // f
|
||||
TPage tpage; // f
|
||||
Color24 color2; // g
|
||||
uint8_t pad2; // g
|
||||
Vertex vertex2; // h
|
||||
PageOffset tex_offset2; // i
|
||||
uint16_t pad3; // i
|
||||
|
||||
static constexpr POLY_GT3 create(const Vertex (&verticies)[3], const PagePosition (&page_pos)[3], const Color24 (&color)[3], TPage tpage, PageClut clut) {
|
||||
static constexpr POLY_GT3 create(const Vertex (&verticies)[3], const PageOffset (&tex_offsets)[3], const Color24 (&color)[3], TPage tpage, PageClut clut) {
|
||||
return POLY_GT3::create({
|
||||
{verticies[0], page_pos[0], color[0]},
|
||||
{verticies[1], page_pos[1], color[1]},
|
||||
{verticies[2], page_pos[2], color[2]}
|
||||
{verticies[0], tex_offsets[0], color[0]},
|
||||
{verticies[1], tex_offsets[1], color[1]},
|
||||
{verticies[2], tex_offsets[2], color[2]}
|
||||
}, tpage, clut);
|
||||
}
|
||||
|
||||
static constexpr POLY_GT3 create(const VertexEx (&verticies_ex)[3], TPage tpage, PageClut clut) {
|
||||
return POLY_GT3 {
|
||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .page0 = verticies_ex[0].page, .page_clut = clut,
|
||||
.color1 = verticies_ex[1].color, .pad1 = 0, .vertex1 = verticies_ex[1].position, .page1 = verticies_ex[1].page, .tpage = tpage,
|
||||
.color2 = verticies_ex[2].color, .pad2 = 0, .vertex2 = verticies_ex[2].position, .page2 = verticies_ex[2].page, .pad3 = 0
|
||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .tex_offset0 = verticies_ex[0].tex_offset, .page_clut = clut,
|
||||
.color1 = verticies_ex[1].color, .pad1 = 0, .vertex1 = verticies_ex[1].position, .tex_offset1 = verticies_ex[1].tex_offset, .tpage = tpage,
|
||||
.color2 = verticies_ex[2].color, .pad2 = 0, .vertex2 = verticies_ex[2].position, .tex_offset2 = verticies_ex[2].tex_offset, .pad3 = 0
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -204,46 +204,46 @@ namespace JabyEngine {
|
||||
typedef POLY_FT3::VertexEx VertexEx;
|
||||
static constexpr auto IdentityCode = Code(POLY_FT3::IdentityCode).set(Code::QuadVertics);
|
||||
|
||||
Color24 color; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PagePosition page0; // c
|
||||
PageClut page_clut; // c
|
||||
Vertex vertex1; // d
|
||||
PagePosition page1; // e
|
||||
TPage tpage; // e
|
||||
Vertex vertex2; // f
|
||||
PagePosition page2; // g
|
||||
uint16_t pad2; // g
|
||||
Vertex vertex3; // h
|
||||
PagePosition page3; // i
|
||||
uint16_t pad3; // i
|
||||
Color24 color; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PageOffset tex_offset0; // c
|
||||
PageClut page_clut; // c
|
||||
Vertex vertex1; // d
|
||||
PageOffset tex_offset1; // e
|
||||
TPage tpage; // e
|
||||
Vertex vertex2; // f
|
||||
PageOffset tex_offset2; // g
|
||||
uint16_t pad2; // g
|
||||
Vertex vertex3; // h
|
||||
PageOffset tex_offset3; // i
|
||||
uint16_t pad3; // i
|
||||
|
||||
static constexpr POLY_FT4 create(const Vertex (&verticies)[4], const PagePosition (&page_pos)[4], TPage tpage, PageClut clut, Color24 color) {
|
||||
static constexpr POLY_FT4 create(const Vertex (&verticies)[4], const PageOffset (&tex_offsets)[4], TPage tpage, PageClut clut, Color24 color) {
|
||||
return POLY_FT4::create({
|
||||
{verticies[0], page_pos[0]},
|
||||
{verticies[1], page_pos[1]},
|
||||
{verticies[2], page_pos[2]},
|
||||
{verticies[3], page_pos[3]}
|
||||
{verticies[0], tex_offsets[0]},
|
||||
{verticies[1], tex_offsets[1]},
|
||||
{verticies[2], tex_offsets[2]},
|
||||
{verticies[3], tex_offsets[3]}
|
||||
}, tpage, clut, color);
|
||||
}
|
||||
|
||||
static constexpr POLY_FT4 create(const VertexEx (&vertices_ex)[4], TPage tpage, PageClut clut, Color24 color = Color24::Grey()) {
|
||||
return POLY_FT4 {
|
||||
.color = color, .code = IdentityCode,
|
||||
.vertex0 = vertices_ex[0].position, .page0 = vertices_ex[0].page, .page_clut = clut,
|
||||
.vertex1 = vertices_ex[1].position, .page1 = vertices_ex[1].page, .tpage = tpage,
|
||||
.vertex2 = vertices_ex[2].position, .page2 = vertices_ex[2].page, .pad2 = 0,
|
||||
.vertex3 = vertices_ex[3].position, .page3 = vertices_ex[3].page, .pad3 = 0
|
||||
.vertex0 = vertices_ex[0].position, .tex_offset0 = vertices_ex[0].tex_offset, .page_clut = clut,
|
||||
.vertex1 = vertices_ex[1].position, .tex_offset1 = vertices_ex[1].tex_offset, .tpage = tpage,
|
||||
.vertex2 = vertices_ex[2].position, .tex_offset2 = vertices_ex[2].tex_offset, .pad2 = 0,
|
||||
.vertex3 = vertices_ex[3].position, .tex_offset3 = vertices_ex[3].tex_offset, .pad3 = 0
|
||||
};
|
||||
}
|
||||
|
||||
static constexpr POLY_FT4 create(const AreaI16& area, const PagePosition& texture_pos, TPage tpage, PageClut clut, Color24 color) {
|
||||
static constexpr POLY_FT4 create(const AreaI16& area, const PageOffset& tex_offset, TPage tpage, PageClut clut, Color24 color) {
|
||||
return POLY_FT4::create({
|
||||
{area.position, texture_pos},
|
||||
{area.position.move(area.size.width, 0), texture_pos.move(area.size.width, 0)},
|
||||
{area.position.move(0, area.size.height), texture_pos.move(0, area.size.height)},
|
||||
{area.position.move(area.size.width, area.size.height), texture_pos.move(area.size.width, area.size.height)}
|
||||
{area.position, tex_offset},
|
||||
{area.position.move(area.size.width, 0), tex_offset.move(area.size.width, 0)},
|
||||
{area.position.move(0, area.size.height), tex_offset.move(0, area.size.height)},
|
||||
{area.position.move(area.size.width, area.size.height), tex_offset.move(area.size.width, area.size.height)}
|
||||
}, tpage, clut, color);
|
||||
}
|
||||
};
|
||||
@@ -296,51 +296,51 @@ namespace JabyEngine {
|
||||
typedef POLY_GT3::VertexEx VertexEx;
|
||||
static constexpr auto IdentityCode = Code(POLY_GT3::IdentityCode).set(Code::QuadVertics);
|
||||
|
||||
Color24 color0; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PagePosition page0; // c
|
||||
PageClut page_clut; // c
|
||||
Color24 color1; // d
|
||||
uint8_t pad1; // d
|
||||
Vertex vertex1; // e
|
||||
PagePosition page1; // f
|
||||
TPage tpage; // f
|
||||
Color24 color2; // g
|
||||
uint8_t pad2; // g
|
||||
Vertex vertex2; // h
|
||||
PagePosition page2; // i
|
||||
uint16_t pad3; // i
|
||||
Color24 color3; // j
|
||||
uint8_t pad4; // j
|
||||
Vertex vertex3; // k
|
||||
PagePosition page3; // l
|
||||
uint16_t pad5; // l
|
||||
Color24 color0; // a
|
||||
Code code; // a
|
||||
Vertex vertex0; // b
|
||||
PageOffset tex_offset0; // c
|
||||
PageClut page_clut; // c
|
||||
Color24 color1; // d
|
||||
uint8_t pad1; // d
|
||||
Vertex vertex1; // e
|
||||
PageOffset tex_offset1; // f
|
||||
TPage tpage; // f
|
||||
Color24 color2; // g
|
||||
uint8_t pad2; // g
|
||||
Vertex vertex2; // h
|
||||
PageOffset tex_offset2; // i
|
||||
uint16_t pad3; // i
|
||||
Color24 color3; // j
|
||||
uint8_t pad4; // j
|
||||
Vertex vertex3; // k
|
||||
PageOffset tex_offset3; // l
|
||||
uint16_t pad5; // l
|
||||
|
||||
static constexpr POLY_GT4 create(const Vertex (&verticies)[4], const PagePosition (&page_pos)[4], const Color24 (&color)[4], TPage tpage, PageClut clut) {
|
||||
static constexpr POLY_GT4 create(const Vertex (&verticies)[4], const PageOffset (&tex_offsets)[4], const Color24 (&color)[4], TPage tpage, PageClut clut) {
|
||||
return POLY_GT4::create({
|
||||
{verticies[0], page_pos[0], color[0]},
|
||||
{verticies[1], page_pos[1], color[1]},
|
||||
{verticies[2], page_pos[2], color[2]},
|
||||
{verticies[3], page_pos[3], color[3]},
|
||||
{verticies[0], tex_offsets[0], color[0]},
|
||||
{verticies[1], tex_offsets[1], color[1]},
|
||||
{verticies[2], tex_offsets[2], color[2]},
|
||||
{verticies[3], tex_offsets[3], color[3]},
|
||||
}, tpage, clut);
|
||||
}
|
||||
|
||||
static constexpr POLY_GT4 create(const VertexEx (&verticies_ex)[4], TPage tpage, PageClut clut) {
|
||||
return POLY_GT4 {
|
||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .page0 = verticies_ex[0].page, .page_clut = clut,
|
||||
.color1 = verticies_ex[1].color, .pad1 = 0, .vertex1 = verticies_ex[1].position, .page1 = verticies_ex[1].page, .tpage = tpage,
|
||||
.color2 = verticies_ex[2].color, .pad2 = 0, .vertex2 = verticies_ex[2].position, .page2 = verticies_ex[2].page, .pad3 = 0,
|
||||
.color3 = verticies_ex[3].color, .pad4 = 0, .vertex3 = verticies_ex[3].position, .page3 = verticies_ex[3].page, .pad5 = 0
|
||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .tex_offset0 = verticies_ex[0].tex_offset, .page_clut = clut,
|
||||
.color1 = verticies_ex[1].color, .pad1 = 0, .vertex1 = verticies_ex[1].position, .tex_offset1 = verticies_ex[1].tex_offset, .tpage = tpage,
|
||||
.color2 = verticies_ex[2].color, .pad2 = 0, .vertex2 = verticies_ex[2].position, .tex_offset2 = verticies_ex[2].tex_offset, .pad3 = 0,
|
||||
.color3 = verticies_ex[3].color, .pad4 = 0, .vertex3 = verticies_ex[3].position, .tex_offset3 = verticies_ex[3].tex_offset, .pad5 = 0
|
||||
};
|
||||
}
|
||||
|
||||
static constexpr POLY_GT4 create(const AreaI16& area, const PagePosition& texture_pos, TPage tpage, PageClut clut, const Color24 (&color)[4]) {
|
||||
static constexpr POLY_GT4 create(const AreaI16& area, const PageOffset& tex_offset, TPage tpage, PageClut clut, const Color24 (&color)[4]) {
|
||||
return POLY_GT4::create({
|
||||
{area.position, texture_pos, color[0]},
|
||||
{area.position.move(area.size.width, 0), texture_pos.move(area.size.width, 0), color[1]},
|
||||
{area.position.move(0, area.size.height), texture_pos.move(0, area.size.height), color[2]},
|
||||
{area.position.move(area.size.width, area.size.height), texture_pos.move(area.size.width, area.size.height), color[3]}
|
||||
{area.position, tex_offset, color[0]},
|
||||
{area.position.move(area.size.width, 0), tex_offset.move(area.size.width, 0), color[1]},
|
||||
{area.position.move(0, area.size.height), tex_offset.move(0, area.size.height), color[2]},
|
||||
{area.position.move(area.size.width, area.size.height), tex_offset.move(area.size.width, area.size.height), color[3]}
|
||||
}, tpage, clut);
|
||||
}
|
||||
};
|
||||
|
@@ -4,12 +4,12 @@
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace GPU {
|
||||
struct PagePositionClut {
|
||||
PagePosition page;
|
||||
PageClut clut;
|
||||
struct OffsetPageWithClut {
|
||||
PageOffset tex_offset;
|
||||
PageClut clut;
|
||||
|
||||
static constexpr PagePositionClut create(PagePosition page, PageClut clut) {
|
||||
return PagePositionClut{page, clut};
|
||||
static constexpr OffsetPageWithClut create(PageOffset tex_offset, PageClut clut) {
|
||||
return OffsetPageWithClut{tex_offset, clut};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -61,15 +61,15 @@ namespace JabyEngine {
|
||||
typedef RectCodeInterface<RECT_BASE_T<Size>>::Code Code;
|
||||
static constexpr auto IdentityCode = Code(RECT_BASE_F<Size>::IdentityCode).set(Code::Textured);
|
||||
|
||||
Color24 color;
|
||||
Code code;
|
||||
Vertex position;
|
||||
PagePosition page;
|
||||
PageClut clut;
|
||||
Color24 color;
|
||||
Code code;
|
||||
Vertex position;
|
||||
PageOffset tex_offset;
|
||||
PageClut clut;
|
||||
|
||||
static constexpr RECT_BASE_T create(const Vertex& position, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
static constexpr RECT_BASE_T create(const Vertex& position, const OffsetPageWithClut& tex_offset_w_clut, const Color24& color = Color24::Grey()) {
|
||||
return RECT_BASE_T {
|
||||
.color = color, .code = IdentityCode, .position = position, .page = page.page, .clut = page.clut
|
||||
.color = color, .code = IdentityCode, .position = position, .tex_offset = tex_offset_w_clut.tex_offset, .clut = tex_offset_w_clut.clut
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -86,10 +86,10 @@ namespace JabyEngine {
|
||||
|
||||
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>> {
|
||||
static constexpr RECT_T create(const Vertex& position, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
static constexpr RECT_T create(const Vertex& position, const OffsetPageWithClut& tex_offset_w_clut, const Color24& color = Color24::Grey()) {
|
||||
RECT_T rect;
|
||||
|
||||
static_cast<RECT_BASE_T<Size>&>(rect) = RECT_BASE_T<Size>::create(position, page, color);
|
||||
static_cast<RECT_BASE_T<Size>&>(rect) = RECT_BASE_T<Size>::create(position, tex_offset_w_clut, color);
|
||||
return rect;
|
||||
}
|
||||
};
|
||||
@@ -116,7 +116,7 @@ namespace JabyEngine {
|
||||
struct SPRT : public internal::RECT_BASE_T<internal::RectCode::SizeType::Variable>, public internal::RenderPrimitive<SPRT>, public internal::LinkedElementCreator<SPRT> {
|
||||
SizeI16 size;
|
||||
|
||||
static constexpr SPRT create(const AreaI16& area, const PagePositionClut& page, const Color24& color = Color24::Grey()) {
|
||||
static constexpr SPRT create(const AreaI16& area, const OffsetPageWithClut& page, const Color24& color = Color24::Grey()) {
|
||||
SPRT sprt;
|
||||
|
||||
static_cast<RECT_BASE_T&>(sprt) = RECT_BASE_T::create(area.position, page, color);
|
||||
|
Reference in New Issue
Block a user