|
|
|
@@ -15,34 +15,33 @@ using namespace JabyEngine;
|
|
|
|
|
|
|
|
|
|
// Some default values for the objects
|
|
|
|
|
static constexpr auto TriangleColor = GPU::Color24(0x0, 0xFF, 0xFF);
|
|
|
|
|
static constexpr auto TriangleArea = GPU::AreaI16({0, 0}, {64, 64});
|
|
|
|
|
static constexpr auto TriangleArea = GPU::AreaI16::create(GPU::PositionI16::create(0, 0), GPU::SizeI16::create(64, 64));
|
|
|
|
|
static constexpr auto TriangleTPage = GPU::TPage::create(320, 0, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
|
|
|
|
static constexpr auto TriangleClut = GPU::PageClut::create(320, 511);
|
|
|
|
|
|
|
|
|
|
static constexpr auto RectangleColor = GPU::Color24(0x80, 0x80, 0xFF);
|
|
|
|
|
static constexpr auto RectangleArea = GPU::AreaI16({0, TriangleArea.size.height}, {80, 80});
|
|
|
|
|
static constexpr auto RectangleArea = GPU::AreaI16::create(GPU::PositionI16::create(0, TriangleArea.size.height), GPU::SizeI16::create(80, 80));
|
|
|
|
|
static constexpr auto RectangleTPage = GPU::TPage::create(320, 256, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
|
|
|
|
static constexpr auto RectangleClut = GPU::PageClut::create(320, 510);
|
|
|
|
|
|
|
|
|
|
static constexpr auto LineColor = GPU::Color24(0xFF, 0x0, 0x0);
|
|
|
|
|
|
|
|
|
|
static constexpr const auto triangle1 = GPU::POLY_F3::create({
|
|
|
|
|
{TriangleArea.position.x, TriangleArea.position.y},
|
|
|
|
|
{TriangleArea.size.width, TriangleArea.size.height},
|
|
|
|
|
{TriangleArea.position.x, TriangleArea.size.height}},
|
|
|
|
|
TriangleColor
|
|
|
|
|
GPU::Vertex::create(TriangleArea.position.x, TriangleArea.position.y),
|
|
|
|
|
GPU::Vertex::create(TriangleArea.size.width, TriangleArea.size.height),
|
|
|
|
|
GPU::Vertex::create(TriangleArea.position.x, TriangleArea.size.height)
|
|
|
|
|
}, TriangleColor
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto triangle2 = GPU::POLY_FT3::create({
|
|
|
|
|
{TriangleArea.position.x, TriangleArea.position.y},
|
|
|
|
|
{TriangleArea.size.width, TriangleArea.position.y},
|
|
|
|
|
{TriangleArea.size.width, TriangleArea.size.height}},{
|
|
|
|
|
GPU::Vertex::create(TriangleArea.position.x, TriangleArea.position.y),
|
|
|
|
|
GPU::Vertex::create(TriangleArea.size.width, TriangleArea.position.y),
|
|
|
|
|
GPU::Vertex::create(TriangleArea.size.width, TriangleArea.size.height)
|
|
|
|
|
},{
|
|
|
|
|
// Texture
|
|
|
|
|
{TriangleArea.position.x, TriangleArea.position.y},
|
|
|
|
|
{TriangleArea.size.width, TriangleArea.position.y},
|
|
|
|
|
{TriangleArea.size.width, TriangleArea.size.height}},
|
|
|
|
|
TriangleTPage,
|
|
|
|
|
TriangleClut,
|
|
|
|
|
GPU::Color24::Grey()
|
|
|
|
|
GPU::PagePosition::create(TriangleArea.position.x, TriangleArea.position.y),
|
|
|
|
|
GPU::PagePosition::create(TriangleArea.size.width, TriangleArea.position.y),
|
|
|
|
|
GPU::PagePosition::create(TriangleArea.size.width, TriangleArea.size.height)
|
|
|
|
|
}, TriangleTPage, TriangleClut, GPU::Color24::Grey()
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto triangle3 = GPU::POLY_G3::create({
|
|
|
|
|
{triangle1.vertex0.move(TriangleArea.size.width, 0), GPU::Color24::Red()},
|
|
|
|
@@ -58,8 +57,8 @@ static constexpr const auto triangle4 = GPU::POLY_GT3::create({
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
static constexpr const auto rectangle1 = GPU::POLY_F4::create(RectangleArea, RectangleColor);
|
|
|
|
|
static constexpr const auto rectangle2 = GPU::POLY_FT4::create({
|
|
|
|
|
RectangleArea.position.move(RectangleArea.size.width, 0), RectangleArea.size}, {0, 0},
|
|
|
|
|
static constexpr const auto rectangle2 = GPU::POLY_FT4::create(GPU::AreaI16::create(
|
|
|
|
|
RectangleArea.position.move(RectangleArea.size.width, 0), RectangleArea.size), GPU::PagePosition::create(0, 0),
|
|
|
|
|
RectangleTPage,
|
|
|
|
|
RectangleClut,
|
|
|
|
|
GPU::Color24::Grey()
|
|
|
|
@@ -70,8 +69,8 @@ static constexpr const auto rectangle3 = GPU::POLY_G4::create(
|
|
|
|
|
GPU::Color24::Blue(),
|
|
|
|
|
GPU::Color24::Green(),
|
|
|
|
|
GPU::Color24::White()});
|
|
|
|
|
static constexpr const auto rectangle4 = GPU::POLY_GT4::create(
|
|
|
|
|
{RectangleArea.position.move(RectangleArea.size.width*3, 0), RectangleArea.size}, {0, 0},
|
|
|
|
|
static constexpr const auto rectangle4 = GPU::POLY_GT4::create(GPU::AreaI16::create(
|
|
|
|
|
RectangleArea.position.move(RectangleArea.size.width*3, 0), RectangleArea.size), GPU::PagePosition::create(0, 0),
|
|
|
|
|
RectangleTPage,
|
|
|
|
|
RectangleClut, {
|
|
|
|
|
GPU::Color24::Red(),
|
|
|
|
@@ -79,8 +78,8 @@ static constexpr const auto rectangle4 = GPU::POLY_GT4::create(
|
|
|
|
|
GPU::Color24::Green(),
|
|
|
|
|
GPU::Color24::White()}
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto rectangle5 = GPU::POLY_GT4::create(
|
|
|
|
|
{RectangleArea.position.move(0, RectangleArea.size.height), RectangleArea.size}, {0, 0},
|
|
|
|
|
static constexpr const auto rectangle5 = GPU::POLY_GT4::create(GPU::AreaI16::create(
|
|
|
|
|
RectangleArea.position.move(0, RectangleArea.size.height), RectangleArea.size), GPU::PagePosition::create(0, 0),
|
|
|
|
|
RectangleTPage,
|
|
|
|
|
RectangleClut, {
|
|
|
|
|
GPU::Color24::Red(),
|
|
|
|
@@ -90,39 +89,39 @@ static constexpr const auto rectangle5 = GPU::POLY_GT4::create(
|
|
|
|
|
).set_semi_transparent(true);
|
|
|
|
|
|
|
|
|
|
static constexpr const auto line1 = GPU::LINE_F::create(LineColor,
|
|
|
|
|
{0, 0},
|
|
|
|
|
{GPU::Display::Width, GPU::Display::Height}
|
|
|
|
|
GPU::Vertex::create(0, 0),
|
|
|
|
|
GPU::Vertex::create(GPU::Display::Width, GPU::Display::Height)
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto line2 = GPU::LINE_F::create(LineColor.invert(),
|
|
|
|
|
GPU::Vertex(0, 0),
|
|
|
|
|
GPU::Vertex(16, 0),
|
|
|
|
|
GPU::Vertex(16, 16),
|
|
|
|
|
GPU::Vertex(0, 0)
|
|
|
|
|
GPU::Vertex::create(0, 0),
|
|
|
|
|
GPU::Vertex::create(16, 0),
|
|
|
|
|
GPU::Vertex::create(16, 16),
|
|
|
|
|
GPU::Vertex::create(0, 0)
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto line3 = GPU::LINE_G::create(
|
|
|
|
|
{LineColor, {GPU::Display::Width, 0}},
|
|
|
|
|
{LineColor.invert(), {0, GPU::Display::Height}}
|
|
|
|
|
GPU::ColorVertex{LineColor, GPU::Vertex::create(GPU::Display::Width, 0)},
|
|
|
|
|
GPU::ColorVertex{LineColor.invert(), GPU::Vertex::create(0, GPU::Display::Height)}
|
|
|
|
|
);
|
|
|
|
|
static constexpr const auto line4 = GPU::LINE_G::create(
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Red(), {0, 0}},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Green(), {0, 16}},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Blue(), {16, 16}},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::White(), {0, 0}}
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Red(), GPU::Vertex::create(0, 0)},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Green(), GPU::Vertex::create(0, 16)},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::Blue(), GPU::Vertex::create(16, 16)},
|
|
|
|
|
GPU::ColorVertex{GPU::Color24::White(), GPU::Vertex::create(0, 0)}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
static constexpr const auto rect1 = GPU::TILE::create(GPU::AreaI16({GPU::Display::Width - 32, GPU::Display::Height - 32}, {32, 32}), GPU::Color24::Green());
|
|
|
|
|
static constexpr const auto rect2 = GPU::TILE_16::create({GPU::Display::Width - 16, GPU::Display::Height - 16}, GPU::Color24::Blue());
|
|
|
|
|
static constexpr const auto rect3 = GPU::TILE_8::create({GPU::Display::Width - 8, GPU::Display::Height - 8}, GPU::Color24::Yellow());
|
|
|
|
|
static constexpr const auto rect4 = GPU::TILE_1::create({GPU::Display::Width - 1, GPU::Display::Height - 1}, GPU::Color24::Red());
|
|
|
|
|
static constexpr const auto rect1 = GPU::TILE::create(GPU::AreaI16::create(GPU::PositionI16::create(GPU::Display::Width - 32, GPU::Display::Height - 32), GPU::SizeI16::create(32, 32)), GPU::Color24::Green());
|
|
|
|
|
static constexpr const auto rect2 = GPU::TILE_16::create(GPU::PositionI16::create(GPU::Display::Width - 16, GPU::Display::Height - 16), GPU::Color24::Blue());
|
|
|
|
|
static constexpr const auto rect3 = GPU::TILE_8::create(GPU::PositionI16::create(GPU::Display::Width - 8, GPU::Display::Height - 8), GPU::Color24::Yellow());
|
|
|
|
|
static constexpr const auto rect4 = GPU::TILE_1::create(GPU::PositionI16::create(GPU::Display::Width - 1, GPU::Display::Height - 1), GPU::Color24::Red());
|
|
|
|
|
|
|
|
|
|
static constexpr const auto texpage = GPU::TexPage::create({320, 0}, GPU::TexturePageColor::$4bit);
|
|
|
|
|
static constexpr const auto rect5 = GPU::SPRT::create(GPU::AreaI16({0, GPU::Display::Height - 32}, {32, 32}), {{0, 0}, TriangleClut}, GPU::Color24::Green());
|
|
|
|
|
static constexpr const auto rect6 = GPU::SPRT_16::create({0, GPU::Display::Height - 16}, {{0, 0}, TriangleClut}, GPU::Color24::Blue());
|
|
|
|
|
static constexpr const auto rect7 = GPU::SPRT_8::create({0, GPU::Display::Height - 8}, {{0, 0}, TriangleClut}, GPU::Color24::Yellow());
|
|
|
|
|
static constexpr const auto rect8 = GPU::SPRT_1::create({0, GPU::Display::Height - 1}, {{0, 0}, TriangleClut}, GPU::Color24::Red());
|
|
|
|
|
static constexpr const auto texpage = GPU::TexPage::create(GPU::PositionU16::create(320, 0), GPU::TexturePageColor::$4bit);
|
|
|
|
|
static constexpr const auto rect5 = GPU::SPRT::create(GPU::AreaI16(GPU::PositionI16::create(0, GPU::Display::Height - 32), GPU::SizeI16(32, 32)), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Green());
|
|
|
|
|
static constexpr const auto rect6 = GPU::SPRT_16::create(GPU::Vertex::create(0, GPU::Display::Height - 16), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Blue());
|
|
|
|
|
static constexpr const auto rect7 = GPU::SPRT_8::create(GPU::Vertex::create(0, GPU::Display::Height - 8), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Yellow());
|
|
|
|
|
static constexpr const auto rect8 = GPU::SPRT_1::create(GPU::Vertex::create(0, GPU::Display::Height - 1), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Red());
|
|
|
|
|
|
|
|
|
|
static auto rect9 = GPU::SPRT::create(GPU::AreaI16({GPU::Display::Width/2, GPU::Display::Height/2}, {32, 32}).centered(), {{0, 0}, TriangleClut}, GPU::Color24::Grey()).linked();
|
|
|
|
|
static auto rect10 = GPU::SPRT::create(GPU::AreaI16({GPU::Display::Width/2, GPU::Display::Height/2 - 32}, {32, 32}).centered(), {{0, 0}, TriangleClut}, GPU::Color24::Grey()).linked();
|
|
|
|
|
static auto rect9 = GPU::SPRT::create(GPU::AreaI16(GPU::PositionI16::create(GPU::Display::Width/2, GPU::Display::Height/2), GPU::SizeI16::create(32, 32)).centered(), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Grey()).linked();
|
|
|
|
|
static auto rect10 = GPU::SPRT::create(GPU::AreaI16(GPU::PositionI16::create(GPU::Display::Width/2, GPU::Display::Height/2 - 32), GPU::SizeI16::create(32, 32)).centered(), {GPU::PagePosition::create(0, 0), TriangleClut}, GPU::Color24::Grey()).linked();
|
|
|
|
|
|
|
|
|
|
static void load_assets() {
|
|
|
|
|
static const CDFile Assets[] = {
|
|
|
|
|