From d69b144ebe07ff7ed72be573b7185078c6aeb110 Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 16 Apr 2025 21:46:13 +0200 Subject: [PATCH] Include another image for the tim_project file --- .../ControllerTest/controller_test.cpp | 1 + .../ControllerTest/controller_test_assets.cpp | 4 +- .../include/controller_state.hpp | 38 +++++++++---------- .../include/controller_test_assets.hpp | 8 ---- examples/PoolBox/assets/Makefile | 21 +++++----- .../assets/vram_doener_fish.tim_project | 2 +- 6 files changed, 32 insertions(+), 42 deletions(-) delete mode 100644 examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_test_assets.hpp diff --git a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test.cpp b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test.cpp index 9ad8e71a..d2b1afd1 100644 --- a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test.cpp +++ b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test.cpp @@ -1,3 +1,4 @@ +#include "../../../include/auto_gen/vram_layout.hpp" #include "../../../include/shared.hpp" #include "include/controller_state.hpp" #include diff --git a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test_assets.cpp b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test_assets.cpp index 4a001814..0dca6900 100644 --- a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test_assets.cpp +++ b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_test_assets.cpp @@ -1,4 +1,4 @@ -#include "include/controller_test_assets.hpp" +#include "../../../include/auto_gen/vram_layout.hpp" #include #include @@ -13,6 +13,6 @@ namespace ControllerTest { __declare_lba_header(LBA); CDFile Assets[1] = { - CDFileBuilder::simple_tim(LBA::CONT, ControllerButtonTIM), + CDFileBuilder::simple_tim(LBA::CONT, Controller_png::tim), }; } diff --git a/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_state.hpp b/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_state.hpp index f009be4c..7a8ff5a3 100644 --- a/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_state.hpp +++ b/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_state.hpp @@ -1,5 +1,5 @@ #pragma once -#include "controller_test_assets.hpp" +#include "../../../../include/auto_gen/vram_layout.hpp" #include #include #include @@ -18,43 +18,43 @@ namespace ControllerTest { ControllerState state; for(auto& tex_page : state.tex_page) { - tex_page = Make::TexPage(ControllerButtonTIM.get_texture_position(), GPU::TextureColorMode::clut4).linked(); + tex_page = Make::TexPage(Controller_png::tim.get_texture_position(), GPU::TextureColorMode::clut4).linked(); } for(auto& buttons : state.buttons) { // Triangle - buttons[0] = Make::SPRT_16(Make::Vertex(71, 0).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(0, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[0] = Make::SPRT_16(Make::Vertex(71, 0).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(0, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Circle - buttons[1] = Make::SPRT_16(Make::Vertex(82, 12).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(1, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[1] = Make::SPRT_16(Make::Vertex(82, 12).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(1, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Cross - buttons[2] = Make::SPRT_16(Make::Vertex(71, 23).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(2, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[2] = Make::SPRT_16(Make::Vertex(71, 23).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(2, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Square - buttons[3] = Make::SPRT_16(Make::Vertex(60, 11).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(3, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[3] = Make::SPRT_16(Make::Vertex(60, 11).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(3, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Play - buttons[4] = Make::SPRT_16(Make::Vertex(51, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(4, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[4] = Make::SPRT_16(Make::Vertex(51, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(4, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Block - buttons[5] = Make::SPRT_16(Make::Vertex(24, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(5, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[5] = Make::SPRT_16(Make::Vertex(24, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(5, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // L1 - buttons[6] = Make::SPRT_16(Make::Vertex(7, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[6] = Make::SPRT_16(Make::Vertex(7, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // L2 - buttons[7] = Make::SPRT_16(Make::Vertex(7, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[7] = Make::SPRT_16(Make::Vertex(7, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // R1 - buttons[8] = Make::SPRT_16(Make::Vertex(71, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[8] = Make::SPRT_16(Make::Vertex(71, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // R2 - buttons[9] = Make::SPRT_16(Make::Vertex(71, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[9] = Make::SPRT_16(Make::Vertex(71, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // L3 - buttons[10] = Make::SPRT_16(Make::Vertex(24, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[10] = Make::SPRT_16(Make::Vertex(24, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // R3 - buttons[11] = Make::SPRT_16(Make::Vertex(52, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[11] = Make::SPRT_16(Make::Vertex(52, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); // Connection Symbol - buttons[12] = Make::SPRT_16(Make::Vertex(37, 9).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(10, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); + buttons[12] = Make::SPRT_16(Make::Vertex(37, 9).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(10, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked(); } for(auto& arrows : state.arrows) { - arrows[0] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect( Make::AreaI16(Make::PositionI16( 7, 5).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); - arrows[1] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect270(Make::AreaI16(Make::PositionI16(14, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); - arrows[2] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect180(Make::AreaI16(Make::PositionI16( 7, 17).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); - arrows[3] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect90( Make::AreaI16(Make::PositionI16( 0, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); + arrows[0] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect( Make::AreaI16(Make::PositionI16( 7, 5).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked(); + arrows[1] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect270(Make::AreaI16(Make::PositionI16(14, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked(); + arrows[2] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect180(Make::AreaI16(Make::PositionI16( 7, 17).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked(); + arrows[3] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect90( Make::AreaI16(Make::PositionI16( 0, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked(); } return state; diff --git a/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_test_assets.hpp b/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_test_assets.hpp deleted file mode 100644 index f920a6c1..00000000 --- a/examples/PoolBox/application/src/Overlay/ControllerTest/include/controller_test_assets.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include - -namespace ControllerTest { - using namespace JabyEngine; - - static constexpr auto ControllerButtonTIM = SimpleTIM::create(384, 0, 384, 511); -} \ No newline at end of file diff --git a/examples/PoolBox/assets/Makefile b/examples/PoolBox/assets/Makefile index 83885f1b..eb05ed5e 100644 --- a/examples/PoolBox/assets/Makefile +++ b/examples/PoolBox/assets/Makefile @@ -1,7 +1,8 @@ include $(JABY_ENGINE_DIR)/mkfile/common/ExportPath.mk include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk -OUTPUT_DIR = bin +OUTPUT_DIR = bin +AUTO_GEN_DIR = ../application/include/auto_gen CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans # Ressources to convert @@ -22,11 +23,6 @@ IconTexture_FLAGS = simple-tim clut4 --semi-trans --color-trans INPUT += $(OUTPUT_DIR)/Paco.img Paco_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS) -INPUT += $(OUTPUT_DIR)/Controller.img -Controller_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS) - -INPUT += $(OUTPUT_DIR)/doener_fish.img - INPUT += $(OUTPUT_DIR)/JabyStar.img JabyStar_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS) @@ -43,10 +39,6 @@ $(OUTPUT_DIR)/%.vag: audio/%.wav @mkdir -p $(OUTPUT_DIR) psxfileconv --lz4 $< -o $@ vag -$(OUTPUT_DIR)/doener_fish.img: doener_fish.png vram_doener_fish.tim_project - @mkdir -p $(OUTPUT_DIR) - psxfileconv vram_doener_fish.tim_project -o $@ project --hpp ../application/include/auto_gen/vram_layout.hpp - $(OUTPUT_DIR)/OnMyOwn_BailBonds.xa: audio/OnMyOwn_BailBonds.mp3 @mkdir -p $(OUTPUT_DIR) psxfileconv $< -o $@ xa @@ -63,7 +55,12 @@ $(OUTPUT_DIR)/%.tim: %.png @mkdir -p $(OUTPUT_DIR) psxfileconv --lz4 $< -o $@ $($*_TIM_FLAGS) -all: $(INPUT) +$(AUTO_GEN_DIR)/vram_layout.hpp: vram_doener_fish.tim_project Controller.png doener_fish.png + @mkdir -p $(AUTO_GEN_DIR) + psxfileconv vram_doener_fish.tim_project -o $(OUTPUT_DIR)/dummy.img project --hpp $(AUTO_GEN_DIR)/vram_layout.hpp + +all: $(INPUT) $(AUTO_GEN_DIR)/vram_layout.hpp clean: - rm -fr $(OUTPUT_DIR) \ No newline at end of file + rm -fr $(OUTPUT_DIR) + rm -fr $(AUTO_GEN_DIR) \ No newline at end of file diff --git a/examples/PoolBox/assets/vram_doener_fish.tim_project b/examples/PoolBox/assets/vram_doener_fish.tim_project index 2d756dab..362d9699 100644 --- a/examples/PoolBox/assets/vram_doener_fish.tim_project +++ b/examples/PoolBox/assets/vram_doener_fish.tim_project @@ -1 +1 @@ -{"jobs":[{"name":"doener_fish.png","file_path":"doener_fish.png","image_pos":{"x":926,"y":0},"palette_rect":{"pos":{"x":976,"y":510},"size":{"width":16,"height":1}},"settings":{"compress":true,"transparency":"FirstColor","encoding":"FourBit"}}]} \ No newline at end of file +{"jobs":[{"name":"doener_fish.png","file_path":"doener_fish.png","image_pos":{"x":926,"y":0},"palette_rect":{"pos":{"x":976,"y":510},"size":{"width":16,"height":1}},"settings":{"compress":true,"transparency":"FirstColor","encoding":"FourBit"}},{"name":"Controller.png","file_path":"Controller.png","image_pos":{"x":384,"y":0},"palette_rect":{"pos":{"x":384,"y":511},"size":{"width":16,"height":1}},"settings":{"compress":true,"transparency":"FirstColor","encoding":"FourBit"}}]} \ No newline at end of file