Improve naming
This commit is contained in:
parent
ac3903a38d
commit
07d7781530
|
@ -1,4 +1,5 @@
|
||||||
#include <PSX/GPU/gpu.hpp>
|
#include <PSX/GPU/gpu.hpp>
|
||||||
|
#include <PSX/GPU/gpu_primitives.hpp>
|
||||||
#include <FontWriter/font_writer.hpp>
|
#include <FontWriter/font_writer.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -17,19 +18,19 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(const FontBufferInfo& buffer_info, const SimpleTIM& vram_dst, const GPU::SizeI16& font_size) {
|
void setup(const FontBufferInfo& buffer_info, const SimpleTIM& vram_dst, const GPU::SizeI16& font_size) {
|
||||||
this->tex_page = GPU::TexPage::create(vram_dst.get_texture_position(), GPU::TexturePageColor::$4bit).linked();
|
this->tex_page = Make::TexPage(vram_dst.get_texture_position(), GPU::TexturePageColor::$4bit).linked();
|
||||||
this->prim_buffer = buffer_info;
|
this->prim_buffer = buffer_info;
|
||||||
|
|
||||||
this->planschi = GPU::SPRT_16::create(
|
this->planschi = Make::SPRT_16(
|
||||||
GPU::PositionI16::create(0, 0),
|
Make::PositionI16(0, 0),
|
||||||
GPU::PagePositionClut::create(GPU::PagePosition::create(0, 0), GPU::PageClut::create(vram_dst.get_clut_position()))
|
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(vram_dst.get_clut_position()))
|
||||||
).linked();
|
).linked();
|
||||||
|
|
||||||
for(size_t buffer_id = 0; buffer_id < 2; buffer_id++) {
|
for(size_t buffer_id = 0; buffer_id < 2; buffer_id++) {
|
||||||
for(size_t buffer_element_id = 0; buffer_element_id < buffer_info.single_buffer_length; buffer_element_id++) {
|
for(size_t buffer_element_id = 0; buffer_element_id < buffer_info.single_buffer_length; buffer_element_id++) {
|
||||||
this->prim_buffer.double_buffer[buffer_id][buffer_element_id] = GPU::SPRT::create(
|
this->prim_buffer.double_buffer[buffer_id][buffer_element_id] = Make::SPRT(
|
||||||
GPU::AreaI16::create(GPU::PositionI16::create(0, 0), font_size),
|
Make::AreaI16(Make::PositionI16(0, 0), font_size),
|
||||||
GPU::PagePositionClut::create(GPU::PagePosition::create(0, 0), GPU::PageClut::create(vram_dst.get_clut_position()))
|
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(vram_dst.get_clut_position()))
|
||||||
).linked();
|
).linked();
|
||||||
|
|
||||||
this->prim_buffer.double_buffer[buffer_id][buffer_element_id]->set_identitiy();
|
this->prim_buffer.double_buffer[buffer_id][buffer_element_id]->set_identitiy();
|
||||||
|
@ -42,7 +43,7 @@ namespace JabyEngine {
|
||||||
|
|
||||||
void FontWriter :: setup(const FontBufferInfo& buffer_info, const SimpleTIM& vram_dst, const FontInfo& font_info) {
|
void FontWriter :: setup(const FontBufferInfo& buffer_info, const SimpleTIM& vram_dst, const FontInfo& font_info) {
|
||||||
printf("Hello Planschi c: @0x%p @0x%p\n", buffer_info.double_buffer[0], buffer_info.double_buffer[1]);
|
printf("Hello Planschi c: @0x%p @0x%p\n", buffer_info.double_buffer[0], buffer_info.double_buffer[1]);
|
||||||
double_buffer.setup(buffer_info, vram_dst, GPU::SizeI16::create(font_info.FontSize.width, font_info.FontSize.height));
|
double_buffer.setup(buffer_info, vram_dst, Make::SizeI16(font_info.FontSize.width, font_info.FontSize.height));
|
||||||
|
|
||||||
//TMP
|
//TMP
|
||||||
double_buffer.prim_buffer.double_buffer[0][0].terminate();
|
double_buffer.prim_buffer.double_buffer[0][0].terminate();
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace FontWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t char_id = cur_char - '!';
|
const uint8_t char_id = cur_char - '!';
|
||||||
(*Pool::text_ptr)->page = GPU::PagePosition::create(((char_id & 0xF) << 4), ((char_id >> 4) << 4));
|
(*Pool::text_ptr)->tex_offset = GPU::PageOffset::create(((char_id & 0xF) << 4), ((char_id >> 4) << 4));
|
||||||
(*Pool::text_ptr)->color = font_color;
|
(*Pool::text_ptr)->color = font_color;
|
||||||
|
|
||||||
Pool::last_link = &Pool::last_link->concat(*Pool::text_ptr);
|
Pool::last_link = &Pool::last_link->concat(*Pool::text_ptr);
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace object {
|
||||||
GPU::TexturePageColor::$4bit).linked()),
|
GPU::TexturePageColor::$4bit).linked()),
|
||||||
sprite(GPU::SPRT::create(
|
sprite(GPU::SPRT::create(
|
||||||
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
|
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
|
||||||
GPU::PagePositionClut(GPU::PagePosition::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
|
GPU::OffsetPageWithClut(GPU::PageOffset::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
|
||||||
GPU::Color24::Blue()).linked()),
|
GPU::Color24::Blue()).linked()),
|
||||||
timer(),
|
timer(),
|
||||||
color_idx(0) {}
|
color_idx(0) {}
|
||||||
|
|
|
@ -38,9 +38,9 @@ static constexpr const auto triangle2 = Make::POLY_FT3({
|
||||||
Make::Vertex(TriangleArea.size.width, TriangleArea.size.height)
|
Make::Vertex(TriangleArea.size.width, TriangleArea.size.height)
|
||||||
},{
|
},{
|
||||||
// Texture
|
// Texture
|
||||||
Make::PagePosition(TriangleArea.position.x, TriangleArea.position.y),
|
Make::PageOffset(TriangleArea.position.x, TriangleArea.position.y),
|
||||||
Make::PagePosition(TriangleArea.size.width, TriangleArea.position.y),
|
Make::PageOffset(TriangleArea.size.width, TriangleArea.position.y),
|
||||||
Make::PagePosition(TriangleArea.size.width, TriangleArea.size.height)
|
Make::PageOffset(TriangleArea.size.width, TriangleArea.size.height)
|
||||||
}, TriangleTPage, TriangleClut, GPU::Color24::Grey()
|
}, TriangleTPage, TriangleClut, GPU::Color24::Grey()
|
||||||
);
|
);
|
||||||
static constexpr const auto triangle3 = Make::POLY_G3({
|
static constexpr const auto triangle3 = Make::POLY_G3({
|
||||||
|
@ -49,16 +49,16 @@ static constexpr const auto triangle3 = Make::POLY_G3({
|
||||||
{triangle1.vertex2.move(TriangleArea.size.width, 0), GPU::Color24::Blue()}}
|
{triangle1.vertex2.move(TriangleArea.size.width, 0), GPU::Color24::Blue()}}
|
||||||
);
|
);
|
||||||
static constexpr const auto triangle4 = Make::POLY_GT3({
|
static constexpr const auto triangle4 = Make::POLY_GT3({
|
||||||
{triangle2.vertex0.move(TriangleArea.size.width, 0), triangle2.page0, GPU::Color24::Red()},
|
{triangle2.vertex0.move(TriangleArea.size.width, 0), triangle2.tex_offset0, GPU::Color24::Red()},
|
||||||
{triangle2.vertex1.move(TriangleArea.size.width, 0), triangle2.page1, GPU::Color24::Blue()},
|
{triangle2.vertex1.move(TriangleArea.size.width, 0), triangle2.tex_offset1, GPU::Color24::Blue()},
|
||||||
{triangle2.vertex2.move(TriangleArea.size.width, 0), triangle2.page2, GPU::Color24::Green()}},
|
{triangle2.vertex2.move(TriangleArea.size.width, 0), triangle2.tex_offset2, GPU::Color24::Green()}},
|
||||||
TriangleTPage,
|
TriangleTPage,
|
||||||
TriangleClut
|
TriangleClut
|
||||||
);
|
);
|
||||||
|
|
||||||
static constexpr const auto rectangle1 = Make::POLY_F4(RectangleArea, RectangleColor);
|
static constexpr const auto rectangle1 = Make::POLY_F4(RectangleArea, RectangleColor);
|
||||||
static constexpr const auto rectangle2 = Make::POLY_FT4(Make::AreaI16(
|
static constexpr const auto rectangle2 = Make::POLY_FT4(Make::AreaI16(
|
||||||
RectangleArea.position.move(RectangleArea.size.width, 0), RectangleArea.size), Make::PagePosition(0, 0),
|
RectangleArea.position.move(RectangleArea.size.width, 0), RectangleArea.size), Make::PageOffset(0, 0),
|
||||||
RectangleTPage,
|
RectangleTPage,
|
||||||
RectangleClut,
|
RectangleClut,
|
||||||
GPU::Color24::Grey()
|
GPU::Color24::Grey()
|
||||||
|
@ -70,7 +70,7 @@ static constexpr const auto rectangle3 = Make::POLY_G4(
|
||||||
GPU::Color24::Green(),
|
GPU::Color24::Green(),
|
||||||
GPU::Color24::White()});
|
GPU::Color24::White()});
|
||||||
static constexpr const auto rectangle4 = Make::POLY_GT4(Make::AreaI16(
|
static constexpr const auto rectangle4 = Make::POLY_GT4(Make::AreaI16(
|
||||||
RectangleArea.position.move(RectangleArea.size.width*3, 0), RectangleArea.size), Make::PagePosition(0, 0),
|
RectangleArea.position.move(RectangleArea.size.width*3, 0), RectangleArea.size), Make::PageOffset(0, 0),
|
||||||
RectangleTPage,
|
RectangleTPage,
|
||||||
RectangleClut, {
|
RectangleClut, {
|
||||||
GPU::Color24::Red(),
|
GPU::Color24::Red(),
|
||||||
|
@ -79,7 +79,7 @@ static constexpr const auto rectangle4 = Make::POLY_GT4(Make::AreaI16(
|
||||||
GPU::Color24::White()}
|
GPU::Color24::White()}
|
||||||
);
|
);
|
||||||
static constexpr const auto rectangle5 = Make::POLY_GT4(Make::AreaI16(
|
static constexpr const auto rectangle5 = Make::POLY_GT4(Make::AreaI16(
|
||||||
RectangleArea.position.move(0, RectangleArea.size.height), RectangleArea.size), Make::PagePosition(0, 0),
|
RectangleArea.position.move(0, RectangleArea.size.height), RectangleArea.size), Make::PageOffset(0, 0),
|
||||||
RectangleTPage,
|
RectangleTPage,
|
||||||
RectangleClut, {
|
RectangleClut, {
|
||||||
GPU::Color24::Red(),
|
GPU::Color24::Red(),
|
||||||
|
@ -115,13 +115,13 @@ static constexpr const auto rect3 = Make::TILE_8(Make::PositionI16(GPU::Display:
|
||||||
static constexpr const auto rect4 = Make::TILE_1(Make::PositionI16(GPU::Display::Width - 1, GPU::Display::Height - 1), GPU::Color24::Red());
|
static constexpr const auto rect4 = Make::TILE_1(Make::PositionI16(GPU::Display::Width - 1, GPU::Display::Height - 1), GPU::Color24::Red());
|
||||||
|
|
||||||
static constexpr const auto texpage = Make::TexPage(Make::PositionU16(320, 0), GPU::TexturePageColor::$4bit);
|
static constexpr const auto texpage = Make::TexPage(Make::PositionU16(320, 0), GPU::TexturePageColor::$4bit);
|
||||||
static constexpr const auto rect5 = Make::SPRT(Make::AreaI16(Make::PositionI16(0, GPU::Display::Height - 32), Make::SizeI16(32, 32)), {Make::PagePosition(0, 0), TriangleClut}, GPU::Color24::Green());
|
static constexpr const auto rect5 = Make::SPRT(Make::AreaI16(Make::PositionI16(0, GPU::Display::Height - 32), Make::SizeI16(32, 32)), {Make::PageOffset(0, 0), TriangleClut}, GPU::Color24::Green());
|
||||||
static constexpr const auto rect6 = Make::SPRT_16(Make::Vertex(0, GPU::Display::Height - 16), Make::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Blue());
|
static constexpr const auto rect6 = Make::SPRT_16(Make::Vertex(0, GPU::Display::Height - 16), Make::OffsetPageWithClut(Make::PageOffset(0, 0), TriangleClut), GPU::Color24::Blue());
|
||||||
static constexpr const auto rect7 = Make::SPRT_8(Make::Vertex(0, GPU::Display::Height - 8), Make::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Yellow());
|
static constexpr const auto rect7 = Make::SPRT_8(Make::Vertex(0, GPU::Display::Height - 8), Make::OffsetPageWithClut(Make::PageOffset(0, 0), TriangleClut), GPU::Color24::Yellow());
|
||||||
static constexpr const auto rect8 = Make::SPRT_1(Make::Vertex(0, GPU::Display::Height - 1), Make::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Red());
|
static constexpr const auto rect8 = Make::SPRT_1(Make::Vertex(0, GPU::Display::Height - 1), Make::OffsetPageWithClut(Make::PageOffset(0, 0), TriangleClut), GPU::Color24::Red());
|
||||||
|
|
||||||
static auto rect9 = Make::SPRT(Make::AreaI16(Make::PositionI16(GPU::Display::Width/2, GPU::Display::Height/2), Make::SizeI16(32, 32)).centered(), Make::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
static auto rect9 = Make::SPRT(Make::AreaI16(Make::PositionI16(GPU::Display::Width/2, GPU::Display::Height/2), Make::SizeI16(32, 32)).centered(), Make::OffsetPageWithClut(Make::PageOffset(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
||||||
static auto rect10 = Make::SPRT(Make::AreaI16(Make::PositionI16(GPU::Display::Width/2, GPU::Display::Height/2 - 32), Make::SizeI16(32, 32)).centered(), Make::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
static auto rect10 = Make::SPRT(Make::AreaI16(Make::PositionI16(GPU::Display::Width/2, GPU::Display::Height/2 - 32), Make::SizeI16(32, 32)).centered(), Make::OffsetPageWithClut(Make::PageOffset(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
||||||
|
|
||||||
static void load_assets() {
|
static void load_assets() {
|
||||||
static const CDFile Assets[] = {
|
static const CDFile Assets[] = {
|
||||||
|
|
|
@ -61,36 +61,36 @@ namespace JabyEngine {
|
||||||
struct POLY_FT3 : public internal::RenderPrimitive<POLY_FT3>, public internal::PolyCodeInterface<POLY_FT3>, public internal::LinkedElementCreator<POLY_FT3> {
|
struct POLY_FT3 : public internal::RenderPrimitive<POLY_FT3>, public internal::PolyCodeInterface<POLY_FT3>, public internal::LinkedElementCreator<POLY_FT3> {
|
||||||
struct VertexEx {
|
struct VertexEx {
|
||||||
Vertex position;
|
Vertex position;
|
||||||
PagePosition page;
|
PageOffset tex_offset;
|
||||||
};
|
};
|
||||||
static constexpr auto IdentityCode = Code(POLY_F3::IdentityCode).set(Code::Textured);
|
static constexpr auto IdentityCode = Code(POLY_F3::IdentityCode).set(Code::Textured);
|
||||||
|
|
||||||
Color24 color; // a
|
Color24 color; // a
|
||||||
Code code; // a
|
Code code; // a
|
||||||
Vertex vertex0; // b
|
Vertex vertex0; // b
|
||||||
PagePosition page0; // c
|
PageOffset tex_offset0; // c
|
||||||
PageClut page_clut; // c
|
PageClut page_clut; // c
|
||||||
Vertex vertex1; // d
|
Vertex vertex1; // d
|
||||||
PagePosition page1; // e
|
PageOffset tex_offset1; // e
|
||||||
TPage tpage; // e
|
TPage tpage; // e
|
||||||
Vertex vertex2; // f
|
Vertex vertex2; // f
|
||||||
PagePosition page2; // g
|
PageOffset tex_offset2; // g
|
||||||
uint16_t padded2; // 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()) {
|
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(
|
return POLY_FT3::create({
|
||||||
{{verticies[0], page_pos[0]},
|
{verticies[0], tex_offsets[0]},
|
||||||
{verticies[1], page_pos[1]},
|
{verticies[1], tex_offsets[1]},
|
||||||
{verticies[2], page_pos[2]}
|
{verticies[2], tex_offsets[2]}
|
||||||
}, tpage, clut, color);
|
}, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr POLY_FT3 create(const VertexEx (&vertices_ex)[3], TPage tpage, PageClut clut, Color24 color) {
|
static constexpr POLY_FT3 create(const VertexEx (&vertices_ex)[3], TPage tpage, PageClut clut, Color24 color) {
|
||||||
return POLY_FT3 {
|
return POLY_FT3 {
|
||||||
.color = color, .code = IdentityCode,
|
.color = color, .code = IdentityCode,
|
||||||
.vertex0 = vertices_ex[0].position, .page0 = vertices_ex[0].page, .page_clut = clut,
|
.vertex0 = vertices_ex[0].position, .tex_offset0 = vertices_ex[0].tex_offset, .page_clut = clut,
|
||||||
.vertex1 = vertices_ex[1].position, .page1 = vertices_ex[1].page, .tpage = tpage,
|
.vertex1 = vertices_ex[1].position, .tex_offset1 = vertices_ex[1].tex_offset, .tpage = tpage,
|
||||||
.vertex2 = vertices_ex[2].position, .page2 = vertices_ex[2].page};
|
.vertex2 = vertices_ex[2].position, .tex_offset2 = vertices_ex[2].tex_offset};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ namespace JabyEngine {
|
||||||
struct POLY_GT3 : public internal::RenderPrimitive<POLY_GT3>, public internal::PolyCodeInterface<POLY_GT3>, public internal::LinkedElementCreator<POLY_GT3> {
|
struct POLY_GT3 : public internal::RenderPrimitive<POLY_GT3>, public internal::PolyCodeInterface<POLY_GT3>, public internal::LinkedElementCreator<POLY_GT3> {
|
||||||
struct VertexEx {
|
struct VertexEx {
|
||||||
Vertex position;
|
Vertex position;
|
||||||
PagePosition page;
|
PageOffset tex_offset;
|
||||||
Color24 color;
|
Color24 color;
|
||||||
};
|
};
|
||||||
static constexpr auto IdentityCode = Code(POLY_G3::IdentityCode).set(Code::Textured);
|
static constexpr auto IdentityCode = Code(POLY_G3::IdentityCode).set(Code::Textured);
|
||||||
|
@ -135,32 +135,32 @@ namespace JabyEngine {
|
||||||
Color24 color0; // a
|
Color24 color0; // a
|
||||||
Code code; // a
|
Code code; // a
|
||||||
Vertex vertex0; // b
|
Vertex vertex0; // b
|
||||||
PagePosition page0; // c
|
PageOffset tex_offset0; // c
|
||||||
PageClut page_clut; // c
|
PageClut page_clut; // c
|
||||||
Color24 color1; // d
|
Color24 color1; // d
|
||||||
uint8_t pad1; // d
|
uint8_t pad1; // d
|
||||||
Vertex vertex1; // e
|
Vertex vertex1; // e
|
||||||
PagePosition page1; // f
|
PageOffset tex_offset1; // f
|
||||||
TPage tpage; // f
|
TPage tpage; // f
|
||||||
Color24 color2; // g
|
Color24 color2; // g
|
||||||
uint8_t pad2; // g
|
uint8_t pad2; // g
|
||||||
Vertex vertex2; // h
|
Vertex vertex2; // h
|
||||||
PagePosition page2; // i
|
PageOffset tex_offset2; // i
|
||||||
uint16_t pad3; // 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({
|
return POLY_GT3::create({
|
||||||
{verticies[0], page_pos[0], color[0]},
|
{verticies[0], tex_offsets[0], color[0]},
|
||||||
{verticies[1], page_pos[1], color[1]},
|
{verticies[1], tex_offsets[1], color[1]},
|
||||||
{verticies[2], page_pos[2], color[2]}
|
{verticies[2], tex_offsets[2], color[2]}
|
||||||
}, tpage, clut);
|
}, tpage, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr POLY_GT3 create(const VertexEx (&verticies_ex)[3], TPage tpage, PageClut clut) {
|
static constexpr POLY_GT3 create(const VertexEx (&verticies_ex)[3], TPage tpage, PageClut clut) {
|
||||||
return POLY_GT3 {
|
return POLY_GT3 {
|
||||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .page0 = verticies_ex[0].page, .page_clut = clut,
|
.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, .page1 = verticies_ex[1].page, .tpage = tpage,
|
.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, .page2 = verticies_ex[2].page, .pad3 = 0
|
.color2 = verticies_ex[2].color, .pad2 = 0, .vertex2 = verticies_ex[2].position, .tex_offset2 = verticies_ex[2].tex_offset, .pad3 = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -207,43 +207,43 @@ namespace JabyEngine {
|
||||||
Color24 color; // a
|
Color24 color; // a
|
||||||
Code code; // a
|
Code code; // a
|
||||||
Vertex vertex0; // b
|
Vertex vertex0; // b
|
||||||
PagePosition page0; // c
|
PageOffset tex_offset0; // c
|
||||||
PageClut page_clut; // c
|
PageClut page_clut; // c
|
||||||
Vertex vertex1; // d
|
Vertex vertex1; // d
|
||||||
PagePosition page1; // e
|
PageOffset tex_offset1; // e
|
||||||
TPage tpage; // e
|
TPage tpage; // e
|
||||||
Vertex vertex2; // f
|
Vertex vertex2; // f
|
||||||
PagePosition page2; // g
|
PageOffset tex_offset2; // g
|
||||||
uint16_t pad2; // g
|
uint16_t pad2; // g
|
||||||
Vertex vertex3; // h
|
Vertex vertex3; // h
|
||||||
PagePosition page3; // i
|
PageOffset tex_offset3; // i
|
||||||
uint16_t pad3; // 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({
|
return POLY_FT4::create({
|
||||||
{verticies[0], page_pos[0]},
|
{verticies[0], tex_offsets[0]},
|
||||||
{verticies[1], page_pos[1]},
|
{verticies[1], tex_offsets[1]},
|
||||||
{verticies[2], page_pos[2]},
|
{verticies[2], tex_offsets[2]},
|
||||||
{verticies[3], page_pos[3]}
|
{verticies[3], tex_offsets[3]}
|
||||||
}, tpage, clut, color);
|
}, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr POLY_FT4 create(const VertexEx (&vertices_ex)[4], TPage tpage, PageClut clut, Color24 color = Color24::Grey()) {
|
static constexpr POLY_FT4 create(const VertexEx (&vertices_ex)[4], TPage tpage, PageClut clut, Color24 color = Color24::Grey()) {
|
||||||
return POLY_FT4 {
|
return POLY_FT4 {
|
||||||
.color = color, .code = IdentityCode,
|
.color = color, .code = IdentityCode,
|
||||||
.vertex0 = vertices_ex[0].position, .page0 = vertices_ex[0].page, .page_clut = clut,
|
.vertex0 = vertices_ex[0].position, .tex_offset0 = vertices_ex[0].tex_offset, .page_clut = clut,
|
||||||
.vertex1 = vertices_ex[1].position, .page1 = vertices_ex[1].page, .tpage = tpage,
|
.vertex1 = vertices_ex[1].position, .tex_offset1 = vertices_ex[1].tex_offset, .tpage = tpage,
|
||||||
.vertex2 = vertices_ex[2].position, .page2 = vertices_ex[2].page, .pad2 = 0,
|
.vertex2 = vertices_ex[2].position, .tex_offset2 = vertices_ex[2].tex_offset, .pad2 = 0,
|
||||||
.vertex3 = vertices_ex[3].position, .page3 = vertices_ex[3].page, .pad3 = 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({
|
return POLY_FT4::create({
|
||||||
{area.position, texture_pos},
|
{area.position, tex_offset},
|
||||||
{area.position.move(area.size.width, 0), texture_pos.move(area.size.width, 0)},
|
{area.position.move(area.size.width, 0), tex_offset.move(area.size.width, 0)},
|
||||||
{area.position.move(0, area.size.height), texture_pos.move(0, area.size.height)},
|
{area.position.move(0, area.size.height), tex_offset.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.move(area.size.width, area.size.height), tex_offset.move(area.size.width, area.size.height)}
|
||||||
}, tpage, clut, color);
|
}, tpage, clut, color);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -299,48 +299,48 @@ namespace JabyEngine {
|
||||||
Color24 color0; // a
|
Color24 color0; // a
|
||||||
Code code; // a
|
Code code; // a
|
||||||
Vertex vertex0; // b
|
Vertex vertex0; // b
|
||||||
PagePosition page0; // c
|
PageOffset tex_offset0; // c
|
||||||
PageClut page_clut; // c
|
PageClut page_clut; // c
|
||||||
Color24 color1; // d
|
Color24 color1; // d
|
||||||
uint8_t pad1; // d
|
uint8_t pad1; // d
|
||||||
Vertex vertex1; // e
|
Vertex vertex1; // e
|
||||||
PagePosition page1; // f
|
PageOffset tex_offset1; // f
|
||||||
TPage tpage; // f
|
TPage tpage; // f
|
||||||
Color24 color2; // g
|
Color24 color2; // g
|
||||||
uint8_t pad2; // g
|
uint8_t pad2; // g
|
||||||
Vertex vertex2; // h
|
Vertex vertex2; // h
|
||||||
PagePosition page2; // i
|
PageOffset tex_offset2; // i
|
||||||
uint16_t pad3; // i
|
uint16_t pad3; // i
|
||||||
Color24 color3; // j
|
Color24 color3; // j
|
||||||
uint8_t pad4; // j
|
uint8_t pad4; // j
|
||||||
Vertex vertex3; // k
|
Vertex vertex3; // k
|
||||||
PagePosition page3; // l
|
PageOffset tex_offset3; // l
|
||||||
uint16_t pad5; // 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({
|
return POLY_GT4::create({
|
||||||
{verticies[0], page_pos[0], color[0]},
|
{verticies[0], tex_offsets[0], color[0]},
|
||||||
{verticies[1], page_pos[1], color[1]},
|
{verticies[1], tex_offsets[1], color[1]},
|
||||||
{verticies[2], page_pos[2], color[2]},
|
{verticies[2], tex_offsets[2], color[2]},
|
||||||
{verticies[3], page_pos[3], color[3]},
|
{verticies[3], tex_offsets[3], color[3]},
|
||||||
}, tpage, clut);
|
}, tpage, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr POLY_GT4 create(const VertexEx (&verticies_ex)[4], TPage tpage, PageClut clut) {
|
static constexpr POLY_GT4 create(const VertexEx (&verticies_ex)[4], TPage tpage, PageClut clut) {
|
||||||
return POLY_GT4 {
|
return POLY_GT4 {
|
||||||
.color0 = verticies_ex[0].color, .code = IdentityCode, .vertex0 = verticies_ex[0].position, .page0 = verticies_ex[0].page, .page_clut = clut,
|
.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, .page1 = verticies_ex[1].page, .tpage = tpage,
|
.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, .page2 = verticies_ex[2].page, .pad3 = 0,
|
.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, .page3 = verticies_ex[3].page, .pad5 = 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({
|
return POLY_GT4::create({
|
||||||
{area.position, texture_pos, color[0]},
|
{area.position, tex_offset, color[0]},
|
||||||
{area.position.move(area.size.width, 0), texture_pos.move(area.size.width, 0), color[1]},
|
{area.position.move(area.size.width, 0), tex_offset.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(0, area.size.height), tex_offset.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.move(area.size.width, area.size.height), tex_offset.move(area.size.width, area.size.height), color[3]}
|
||||||
}, tpage, clut);
|
}, tpage, clut);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
namespace JabyEngine {
|
namespace JabyEngine {
|
||||||
namespace GPU {
|
namespace GPU {
|
||||||
struct PagePositionClut {
|
struct OffsetPageWithClut {
|
||||||
PagePosition page;
|
PageOffset tex_offset;
|
||||||
PageClut clut;
|
PageClut clut;
|
||||||
|
|
||||||
static constexpr PagePositionClut create(PagePosition page, PageClut clut) {
|
static constexpr OffsetPageWithClut create(PageOffset tex_offset, PageClut clut) {
|
||||||
return PagePositionClut{page, clut};
|
return OffsetPageWithClut{tex_offset, clut};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,12 +64,12 @@ namespace JabyEngine {
|
||||||
Color24 color;
|
Color24 color;
|
||||||
Code code;
|
Code code;
|
||||||
Vertex position;
|
Vertex position;
|
||||||
PagePosition page;
|
PageOffset tex_offset;
|
||||||
PageClut clut;
|
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 {
|
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>
|
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>> {
|
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;
|
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;
|
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> {
|
struct SPRT : public internal::RECT_BASE_T<internal::RectCode::SizeType::Variable>, public internal::RenderPrimitive<SPRT>, public internal::LinkedElementCreator<SPRT> {
|
||||||
SizeI16 size;
|
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;
|
SPRT sprt;
|
||||||
|
|
||||||
static_cast<RECT_BASE_T&>(sprt) = RECT_BASE_T::create(area.position, page, color);
|
static_cast<RECT_BASE_T&>(sprt) = RECT_BASE_T::create(area.position, page, color);
|
||||||
|
|
|
@ -86,11 +86,11 @@ namespace JabyEngine {
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
static constexpr GPU::PagePosition PagePosition() {
|
static constexpr GPU::PageOffset PageOffset() {
|
||||||
return creator_template<GPU::PagePosition>(0_u8, 0_u8);
|
return creator_template<GPU::PageOffset>(0_u8, 0_u8);
|
||||||
}
|
}
|
||||||
static constexpr GPU::PagePosition PagePosition(uint8_t u, uint8_t v) {
|
static constexpr GPU::PageOffset PageOffset(uint8_t u, uint8_t v) {
|
||||||
return creator_template<GPU::PagePosition>(u, v);
|
return creator_template<GPU::PageOffset>(u, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
@ -101,6 +101,9 @@ namespace JabyEngine {
|
||||||
static constexpr GPU::PageClut PageClut(uint16_t x, uint16_t y) {
|
static constexpr GPU::PageClut PageClut(uint16_t x, uint16_t y) {
|
||||||
return creator_template<GPU::PageClut>(x, y);
|
return creator_template<GPU::PageClut>(x, y);
|
||||||
}
|
}
|
||||||
|
static constexpr GPU::PageClut PageClut(const GPU::PositionU16& clut_pos) {
|
||||||
|
return creator_template<GPU::PageClut>(clut_pos);
|
||||||
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
|
@ -122,11 +125,11 @@ namespace JabyEngine {
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
static constexpr GPU::PagePositionClut PagePositionClut() {
|
static constexpr GPU::OffsetPageWithClut OffsetPageWithClut() {
|
||||||
return creator_template<GPU::PagePositionClut>(PagePosition(), PageClut());
|
return creator_template<GPU::OffsetPageWithClut>(PageOffset(), PageClut());
|
||||||
}
|
}
|
||||||
static constexpr GPU::PagePositionClut PagePositionClut(GPU::PagePosition page, GPU::PageClut clut) {
|
static constexpr GPU::OffsetPageWithClut OffsetPageWithClut(GPU::PageOffset tex_offset, GPU::PageClut clut) {
|
||||||
return creator_template<GPU::PagePositionClut>(page, clut);
|
return creator_template<GPU::OffsetPageWithClut>(tex_offset, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
@ -175,8 +178,8 @@ namespace JabyEngine {
|
||||||
return creator_template<GPU::POLY_F3>(verticies, color);
|
return creator_template<GPU::POLY_F3>(verticies, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_FT3 POLY_FT3(const GPU::Vertex (&verticies)[3], const GPU::PagePosition (&page_pos)[3], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color = GPU::Color24::Grey()) {
|
static constexpr GPU::POLY_FT3 POLY_FT3(const GPU::Vertex (&verticies)[3], const GPU::PageOffset (&tex_offset)[3], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::POLY_FT3>(verticies, page_pos, tpage, clut, color);
|
return creator_template<GPU::POLY_FT3>(verticies, tex_offset, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_FT3 POLY_FT3(const GPU::POLY_FT3::VertexEx (&vertices_ex)[3], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
static constexpr GPU::POLY_FT3 POLY_FT3(const GPU::POLY_FT3::VertexEx (&vertices_ex)[3], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
||||||
|
@ -191,8 +194,8 @@ namespace JabyEngine {
|
||||||
return creator_template<GPU::POLY_G3>(verticies_ex);
|
return creator_template<GPU::POLY_G3>(verticies_ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_GT3 POLY_GT3(const GPU::Vertex (&verticies)[3], const GPU::PagePosition (&page_pos)[3], const GPU::Color24 (&color)[3], GPU::TPage tpage, GPU::PageClut clut) {
|
static constexpr GPU::POLY_GT3 POLY_GT3(const GPU::Vertex (&verticies)[3], const GPU::PageOffset (&tex_offset)[3], const GPU::Color24 (&color)[3], GPU::TPage tpage, GPU::PageClut clut) {
|
||||||
return creator_template<GPU::POLY_GT3>(verticies, page_pos, color, tpage, clut);
|
return creator_template<GPU::POLY_GT3>(verticies, tex_offset, color, tpage, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_GT3 POLY_GT3(const GPU::POLY_GT3::VertexEx (&verticies_ex)[3], GPU::TPage tpage, GPU::PageClut clut) {
|
static constexpr GPU::POLY_GT3 POLY_GT3(const GPU::POLY_GT3::VertexEx (&verticies_ex)[3], GPU::TPage tpage, GPU::PageClut clut) {
|
||||||
|
@ -207,16 +210,16 @@ namespace JabyEngine {
|
||||||
return creator_template<GPU::POLY_F4>(area, color);
|
return creator_template<GPU::POLY_F4>(area, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::Vertex (&verticies)[4], const GPU::PagePosition (&page_pos)[4], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::Vertex (&verticies)[4], const GPU::PageOffset (&tex_offset)[4], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
||||||
return creator_template<GPU::POLY_FT4>(verticies, page_pos, tpage, clut, color);
|
return creator_template<GPU::POLY_FT4>(verticies, tex_offset, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::POLY_FT4::VertexEx (&vertices_ex)[4], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color = GPU::Color24::Grey()) {
|
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::POLY_FT4::VertexEx (&vertices_ex)[4], GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::POLY_FT4>(vertices_ex, tpage, clut, color);
|
return creator_template<GPU::POLY_FT4>(vertices_ex, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::AreaI16& area, const GPU::PagePosition& texture_pos, GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
static constexpr GPU::POLY_FT4 POLY_FT4(const GPU::AreaI16& area, const GPU::PageOffset& tex_offset, GPU::TPage tpage, GPU::PageClut clut, GPU::Color24 color) {
|
||||||
return creator_template<GPU::POLY_FT4>(area, texture_pos, tpage, clut, color);
|
return creator_template<GPU::POLY_FT4>(area, tex_offset, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_G4 POLY_G4(const GPU::Vertex (&verticies)[4], const GPU::Color24 (&color)[4]) {
|
static constexpr GPU::POLY_G4 POLY_G4(const GPU::Vertex (&verticies)[4], const GPU::Color24 (&color)[4]) {
|
||||||
|
@ -231,16 +234,16 @@ namespace JabyEngine {
|
||||||
return creator_template<GPU::POLY_G4>(area, color);
|
return creator_template<GPU::POLY_G4>(area, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::Vertex (&verticies)[4], const GPU::PagePosition (&page_pos)[4], const GPU::Color24 (&color)[4], GPU::TPage tpage, GPU::PageClut clut) {
|
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::Vertex (&verticies)[4], const GPU::PageOffset (&tex_offset)[4], const GPU::Color24 (&color)[4], GPU::TPage tpage, GPU::PageClut clut) {
|
||||||
return creator_template<GPU::POLY_GT4>(verticies, page_pos, color, tpage, clut);
|
return creator_template<GPU::POLY_GT4>(verticies, tex_offset, color, tpage, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::POLY_GT4::VertexEx (&verticies_ex)[4], GPU::TPage tpage, GPU::PageClut clut) {
|
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::POLY_GT4::VertexEx (&verticies_ex)[4], GPU::TPage tpage, GPU::PageClut clut) {
|
||||||
return creator_template<GPU::POLY_GT4>(verticies_ex, tpage, clut);
|
return creator_template<GPU::POLY_GT4>(verticies_ex, tpage, clut);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::AreaI16& area, const GPU::PagePosition& texture_pos, GPU::TPage tpage, GPU::PageClut clut, const GPU::Color24 (&color)[4]) {
|
static constexpr GPU::POLY_GT4 POLY_GT4(const GPU::AreaI16& area, const GPU::PageOffset& tex_offset, GPU::TPage tpage, GPU::PageClut clut, const GPU::Color24 (&color)[4]) {
|
||||||
return creator_template<GPU::POLY_GT4>(area, texture_pos, tpage, clut, color);
|
return creator_template<GPU::POLY_GT4>(area, tex_offset, tpage, clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
@ -280,35 +283,35 @@ namespace JabyEngine {
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
static constexpr GPU::SPRT_1 SPRT_1() {
|
static constexpr GPU::SPRT_1 SPRT_1() {
|
||||||
return creator_template<GPU::SPRT_1>(Vertex(), PagePositionClut(), GPU::Color24::Black());
|
return creator_template<GPU::SPRT_1>(Vertex(), OffsetPageWithClut(), GPU::Color24::Black());
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT_1 SPRT_1(const GPU::Vertex& position, const GPU::PagePositionClut& page, const GPU::Color24& color = GPU::Color24::Grey()) {
|
static constexpr GPU::SPRT_1 SPRT_1(const GPU::Vertex& position, const GPU::OffsetPageWithClut& tex_offset_w_clut, const GPU::Color24& color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::SPRT_1>(position, page, color);
|
return creator_template<GPU::SPRT_1>(position, tex_offset_w_clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT_8 SPRT_8() {
|
static constexpr GPU::SPRT_8 SPRT_8() {
|
||||||
return creator_template<GPU::SPRT_8>(Vertex(), PagePositionClut(), GPU::Color24::Black());
|
return creator_template<GPU::SPRT_8>(Vertex(), OffsetPageWithClut(), GPU::Color24::Black());
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT_8 SPRT_8(const GPU::Vertex& position, const GPU::PagePositionClut& page, const GPU::Color24& color = GPU::Color24::Grey()) {
|
static constexpr GPU::SPRT_8 SPRT_8(const GPU::Vertex& position, const GPU::OffsetPageWithClut& tex_offset_w_clut, const GPU::Color24& color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::SPRT_8>(position, page, color);
|
return creator_template<GPU::SPRT_8>(position, tex_offset_w_clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT_16 SPRT_16() {
|
static constexpr GPU::SPRT_16 SPRT_16() {
|
||||||
return creator_template<GPU::SPRT_16>(Vertex(), PagePositionClut(), GPU::Color24::Black());
|
return creator_template<GPU::SPRT_16>(Vertex(), OffsetPageWithClut(), GPU::Color24::Black());
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT_16 SPRT_16(const GPU::Vertex& position, const GPU::PagePositionClut& page, const GPU::Color24& color = GPU::Color24::Grey()) {
|
static constexpr GPU::SPRT_16 SPRT_16(const GPU::Vertex& position, const GPU::OffsetPageWithClut& tex_offset_w_clut, const GPU::Color24& color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::SPRT_16>(position, page, color);
|
return creator_template<GPU::SPRT_16>(position, tex_offset_w_clut, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT SPRT() {
|
static constexpr GPU::SPRT SPRT() {
|
||||||
return creator_template<GPU::SPRT>(AreaI16(), PagePositionClut(), GPU::Color24::Black());
|
return creator_template<GPU::SPRT>(AreaI16(), OffsetPageWithClut(), GPU::Color24::Black());
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr GPU::SPRT SPRT(const GPU::AreaI16& area, const GPU::PagePositionClut& page, const GPU::Color24& color = GPU::Color24::Grey()) {
|
static constexpr GPU::SPRT SPRT(const GPU::AreaI16& area, const GPU::OffsetPageWithClut& tex_offset_w_clut, const GPU::Color24& color = GPU::Color24::Grey()) {
|
||||||
return creator_template<GPU::SPRT>(area, page, color);
|
return creator_template<GPU::SPRT>(area, tex_offset_w_clut, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -175,7 +175,7 @@ namespace JabyEngine {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Type used for primitives
|
// Type used for primitives
|
||||||
struct PagePosition : public internal::XYMovement<PagePosition, uint8_t> {
|
struct PageOffset : public internal::XYMovement<PageOffset, uint8_t> {
|
||||||
union {
|
union {
|
||||||
uint8_t x;
|
uint8_t x;
|
||||||
uint8_t u;
|
uint8_t u;
|
||||||
|
@ -186,8 +186,8 @@ namespace JabyEngine {
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr PagePosition create(uint8_t u, uint8_t v) {
|
static constexpr PageOffset create(uint8_t u, uint8_t v) {
|
||||||
return PagePosition{.x = u, .y = v}; //< Activate x and y to use XYMovement during constexpr
|
return PageOffset{.x = u, .y = v}; //< Activate x and y to use XYMovement during constexpr
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue