Support transparency

This commit is contained in:
2023-05-26 22:20:43 +02:00
parent 1832f6b066
commit 6f735eeefb
4 changed files with 52 additions and 12 deletions

View File

@@ -75,6 +75,15 @@ static constexpr const auto rectangle4 = JabyEngine::GPU::POLY_GT4(
JabyEngine::GPU::Color24::Green(),
JabyEngine::GPU::Color24::White()}
);
static constexpr const auto rectangle5 = JabyEngine::GPU::POLY_GT4(
{RectangleArea.position.move(0, RectangleArea.size.height), RectangleArea.size}, {0, 0},
RectangleTPage,
RectangleClut, {
JabyEngine::GPU::Color24::Red(),
JabyEngine::GPU::Color24::Blue(),
JabyEngine::GPU::Color24::Green(),
JabyEngine::GPU::Color24::White()}
).set_semi_transparent(true);
static void load_assets() {
static const JabyEngine::CDFile Assets[] = {
@@ -107,7 +116,8 @@ static void load_assets() {
void main() {
load_assets();
printf("Dino: 0x%02X\n", rectangle4.code.value);
while(true) {
JabyEngine::GPU::render(triangle1);
JabyEngine::GPU::render(triangle2);
@@ -118,6 +128,7 @@ void main() {
JabyEngine::GPU::render(rectangle2);
JabyEngine::GPU::render(rectangle3);
JabyEngine::GPU::render(rectangle4);
JabyEngine::GPU::render(rectangle5);
JabyEngine::GPU::swap_buffers_vsync(2);
}

View File

@@ -9,7 +9,7 @@ $(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
$(OUTPUT_DIR)/IconTexture.bin: IconTexture.png
@mkdir -p $(OUTPUT_DIR)
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --semi-trans --color-trans
all: $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin