Support TILE and SPRT for make functions
This commit is contained in:
parent
aebd68f633
commit
991bacfa9c
|
@ -19,12 +19,12 @@ static constexpr auto TriangleArea = Make::AreaI16(Make::PositionI16(0, 0), Mak
|
||||||
static constexpr auto TriangleTPage = Make::TPage(320, 0, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
static constexpr auto TriangleTPage = Make::TPage(320, 0, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
||||||
static constexpr auto TriangleClut = Make::PageClut(320, 511);
|
static constexpr auto TriangleClut = Make::PageClut(320, 511);
|
||||||
|
|
||||||
static constexpr auto RectangleColor = GPU::Color24(0x80, 0x80, 0xFF);
|
static constexpr auto RectangleColor = GPU::Color24::from_rgb(0x80, 0x80, 0xFF);
|
||||||
static constexpr auto RectangleArea = Make::AreaI16(Make::PositionI16(0, TriangleArea.size.height), Make::SizeI16(80, 80));
|
static constexpr auto RectangleArea = Make::AreaI16(Make::PositionI16(0, TriangleArea.size.height), Make::SizeI16(80, 80));
|
||||||
static constexpr auto RectangleTPage = Make::TPage(320, 256, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
static constexpr auto RectangleTPage = Make::TPage(320, 256, GPU::SemiTransparency::B_Half_add_F_Half, GPU::TexturePageColor::$4bit);
|
||||||
static constexpr auto RectangleClut = Make::PageClut(320, 510);
|
static constexpr auto RectangleClut = Make::PageClut(320, 510);
|
||||||
|
|
||||||
static constexpr auto LineColor = GPU::Color24(0xFF, 0x0, 0x0);
|
static constexpr auto LineColor = GPU::Color24::from_rgb(0xFF, 0x0, 0x0);
|
||||||
|
|
||||||
static constexpr const auto triangle1 = GPU::POLY_F3::create({
|
static constexpr const auto triangle1 = GPU::POLY_F3::create({
|
||||||
Make::Vertex(TriangleArea.position.x, TriangleArea.position.y),
|
Make::Vertex(TriangleArea.position.x, TriangleArea.position.y),
|
||||||
|
@ -109,19 +109,19 @@ static constexpr const auto line4 = GPU::LINE_G::create(
|
||||||
GPU::ColorVertex{GPU::Color24::White(), Make::Vertex(0, 0)}
|
GPU::ColorVertex{GPU::Color24::White(), Make::Vertex(0, 0)}
|
||||||
);
|
);
|
||||||
|
|
||||||
static constexpr const auto rect1 = GPU::TILE::create(Make::AreaI16(Make::PositionI16(GPU::Display::Width - 32, GPU::Display::Height - 32), Make::SizeI16(32, 32)), GPU::Color24::Green());
|
static constexpr const auto rect1 = Make::TILE(Make::AreaI16(Make::PositionI16(GPU::Display::Width - 32, GPU::Display::Height - 32), Make::SizeI16(32, 32)), GPU::Color24::Green());
|
||||||
static constexpr const auto rect2 = GPU::TILE_16::create(Make::PositionI16(GPU::Display::Width - 16, GPU::Display::Height - 16), GPU::Color24::Blue());
|
static constexpr const auto rect2 = Make::TILE_16(Make::PositionI16(GPU::Display::Width - 16, GPU::Display::Height - 16), GPU::Color24::Blue());
|
||||||
static constexpr const auto rect3 = GPU::TILE_8::create(Make::PositionI16(GPU::Display::Width - 8, GPU::Display::Height - 8), GPU::Color24::Yellow());
|
static constexpr const auto rect3 = Make::TILE_8(Make::PositionI16(GPU::Display::Width - 8, GPU::Display::Height - 8), GPU::Color24::Yellow());
|
||||||
static constexpr const auto rect4 = GPU::TILE_1::create(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 = GPU::TexPage::create(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 = GPU::SPRT::create(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::PagePosition(0, 0), TriangleClut}, GPU::Color24::Green());
|
||||||
static constexpr const auto rect6 = GPU::SPRT_16::create(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::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Blue());
|
||||||
static constexpr const auto rect7 = GPU::SPRT_8::create(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::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Yellow());
|
||||||
static constexpr const auto rect8 = GPU::SPRT_1::create(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::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Red());
|
||||||
|
|
||||||
static auto rect9 = GPU::SPRT::create(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::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
||||||
static auto rect10 = GPU::SPRT::create(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::PagePositionClut(Make::PagePosition(0, 0), TriangleClut), GPU::Color24::Grey()).linked();
|
||||||
|
|
||||||
static void load_assets() {
|
static void load_assets() {
|
||||||
static const CDFile Assets[] = {
|
static const CDFile Assets[] = {
|
||||||
|
|
|
@ -68,6 +68,10 @@ namespace JabyEngine {
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
|
static constexpr GPU::AreaI16 AreaI16() {
|
||||||
|
return creator_template<GPU::AreaI16>(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static constexpr GPU::AreaI16 AreaI16(int16_t x, int16_t y, int16_t w, int16_t h) {
|
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);
|
return creator_template<GPU::AreaI16>(x, y, w, h);
|
||||||
}
|
}
|
||||||
|
@ -78,6 +82,10 @@ namespace JabyEngine {
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
|
static constexpr GPU::AreaU16 AreaU16() {
|
||||||
|
return creator_template<GPU::AreaU16>(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static constexpr GPU::AreaU16 AreaU16(uint16_t x, uint16_t y, uint16_t w, uint16_t h) {
|
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);
|
return creator_template<GPU::AreaU16>(x, y, w, h);
|
||||||
}
|
}
|
||||||
|
@ -116,6 +124,16 @@ namespace JabyEngine {
|
||||||
return creator_template<GPU::TPage>(x, y, transparency, clut_color);
|
return creator_template<GPU::TPage>(x, y, transparency, clut_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ###################################################################
|
||||||
|
|
||||||
|
static constexpr GPU::TexPage TexPage() {
|
||||||
|
return creator_template<GPU::TexPage>(PositionU16(), GPU::TexturePageColor::$4bit, GPU::SemiTransparency::B_Half_add_F_Half, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TexPage TexPage(const GPU::PositionU16& tex_pos, GPU::TexturePageColor tex_color, GPU::SemiTransparency transparency = GPU::SemiTransparency::B_Half_add_F_Half, bool dither = false) {
|
||||||
|
return creator_template<GPU::TexPage>(tex_pos, tex_color, transparency, dither);
|
||||||
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
static constexpr GPU::PagePositionClut PagePositionClut() {
|
static constexpr GPU::PagePositionClut PagePositionClut() {
|
||||||
|
@ -151,7 +169,72 @@ namespace JabyEngine {
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_1 TILE_1() {
|
||||||
|
return creator_template<GPU::TILE_1>(Vertex(), GPU::Color24::Black());
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_1 TILE_1(const GPU::Vertex& position, const GPU::Color24& color) {
|
||||||
|
return creator_template<GPU::TILE_1>(position, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_8 TILE_8() {
|
||||||
|
return creator_template<GPU::TILE_8>(Vertex(), GPU::Color24::Black());
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_8 TILE_8(const GPU::Vertex& position, const GPU::Color24& color) {
|
||||||
|
return creator_template<GPU::TILE_8>(position, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_16 TILE_16() {
|
||||||
|
return creator_template<GPU::TILE_16>(Vertex(), GPU::Color24::Black());
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE_16 TILE_16(const GPU::Vertex& position, const GPU::Color24& color) {
|
||||||
|
return creator_template<GPU::TILE_16>(position, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE TILE() {
|
||||||
|
return creator_template<GPU::TILE>(AreaI16(), GPU::Color24::Black());
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::TILE TILE(const GPU::AreaI16& area, const GPU::Color24& color) {
|
||||||
|
return creator_template<GPU::TILE>(area, color);
|
||||||
|
}
|
||||||
|
|
||||||
// ###################################################################
|
// ###################################################################
|
||||||
|
|
||||||
|
static constexpr GPU::SPRT_1 SPRT_1() {
|
||||||
|
return creator_template<GPU::SPRT_1>(Vertex(), PagePositionClut(), 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()) {
|
||||||
|
return creator_template<GPU::SPRT_1>(position, page, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::SPRT_8 SPRT_8() {
|
||||||
|
return creator_template<GPU::SPRT_8>(Vertex(), PagePositionClut(), 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()) {
|
||||||
|
return creator_template<GPU::SPRT_8>(position, page, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::SPRT_16 SPRT_16() {
|
||||||
|
return creator_template<GPU::SPRT_16>(Vertex(), PagePositionClut(), 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()) {
|
||||||
|
return creator_template<GPU::SPRT_16>(position, page, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::SPRT SPRT() {
|
||||||
|
return creator_template<GPU::SPRT>(AreaI16(), PagePositionClut(), GPU::Color24::Black());
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr GPU::SPRT SPRT(const GPU::AreaI16& area, const GPU::PagePositionClut& page, const GPU::Color24& color = GPU::Color24::Grey()) {
|
||||||
|
return creator_template<GPU::SPRT>(area, page, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue