From aebd68f633c525b43e1a4b0924cd6a786d7d4a1e Mon Sep 17 00:00:00 2001 From: Jaby Blubb Date: Tue, 3 Oct 2023 16:18:43 +0200 Subject: [PATCH] Support even more make functions --- .../src/Overlay/GPUTests/gpu_tests.cpp | 8 +++---- include/PSX/GPU/gpu_primitives.hpp | 21 +++++++++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp b/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp index 569c1275..1099fafe 100644 --- a/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp +++ b/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp @@ -16,13 +16,13 @@ using namespace JabyEngine; // Some default values for the objects static constexpr auto TriangleColor = GPU::Color24::from_rgb(0x0, 0xFF, 0xFF); static constexpr auto TriangleArea = Make::AreaI16(Make::PositionI16(0, 0), Make::SizeI16(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 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 RectangleColor = GPU::Color24(0x80, 0x80, 0xFF); static constexpr auto RectangleArea = Make::AreaI16(Make::PositionI16(0, TriangleArea.size.height), Make::SizeI16(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 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 LineColor = GPU::Color24(0xFF, 0x0, 0x0); diff --git a/include/PSX/GPU/gpu_primitives.hpp b/include/PSX/GPU/gpu_primitives.hpp index 112620ab..2c3cc38f 100644 --- a/include/PSX/GPU/gpu_primitives.hpp +++ b/include/PSX/GPU/gpu_primitives.hpp @@ -89,7 +89,7 @@ namespace JabyEngine { // ################################################################### static constexpr GPU::PagePosition PagePosition() { - return creator_template(0, 0); + return creator_template(0_u8, 0_u8); } static constexpr GPU::PagePosition PagePosition(uint8_t u, uint8_t v) { @@ -99,7 +99,7 @@ namespace JabyEngine { // ################################################################### static constexpr GPU::PageClut PageClut() { - return creator_template(0, 0); + return creator_template(0_u16, 0_u16); } static constexpr GPU::PageClut PageClut(uint16_t x, uint16_t y) { @@ -108,6 +108,16 @@ namespace JabyEngine { // ################################################################### + static constexpr GPU::TPage TPage() { + return creator_template(0_u16, 0_u16, GPU::SemiTransparency::B_add_F, GPU::TexturePageColor::$4bit); + } + + static constexpr GPU::TPage TPage(uint16_t x, uint16_t y, GPU::SemiTransparency transparency, GPU::TexturePageColor clut_color) { + return creator_template(x, y, transparency, clut_color); + } + + // ################################################################### + static constexpr GPU::PagePositionClut PagePositionClut() { return creator_template(PagePosition(), PageClut()); } @@ -135,6 +145,13 @@ namespace JabyEngine { static constexpr GPU::ColorVertex ColorVertex(GPU::Color24 color, GPU::Vertex pos) { return creator_template(color, pos); } + + // ################################################################### + // ################################################################### + // ################################################################### + // ################################################################### + // ################################################################### + // ################################################################### } }