Integrate new Jaby sprite

This commit is contained in:
Jaby 2024-04-05 19:57:02 -05:00
parent d68fea41ed
commit 1eba386663
9 changed files with 52 additions and 6 deletions

View File

@ -1,6 +1,7 @@
#include "../../../include/asset_mgr.hpp"
#include "../../../include/shared.hpp"
#include "include/GTE_Sprite.hpp"
#include "include/gte_test_assets.hpp"
#include <PSX/Periphery/periphery.hpp>
#include <stdio.h>
@ -8,6 +9,12 @@ namespace GTETest {
using namespace JabyEngine;
using namespace GTETest;
static auto jaby_star_base = Make::SPRT(
// TODO: improve magic numbers
Make::AreaI16(GPU::Display::Width - 64, GPU::Display::Height - 64, 64, 64),
Make::OffsetPageWithClut(JabySTARTim.get_page_offset_clut4(), Make::PageClut(JabySTARTim.get_clut_position()))
);
static auto doener_fish = GTE_Sprite::create(Make::POLY_FT4(
Make::AreaI16(Make::PositionI16(0, 0), Assets::Main::DoenerFishInfo.size),
Assets::Main::DoenerFishInfo.tim.get_page_offset_clut4(),
@ -15,6 +22,7 @@ namespace GTETest {
Make::PageClut(Assets::Main::DoenerFishInfo.tim.get_clut_position()),
GPU::Color24::Grey()
));
static auto rotation = 0.0_deg;
static void setup() {
@ -41,6 +49,7 @@ namespace GTETest {
static void render() {
doener_fish.render();
GPU::render(jaby_star_base);
Shared::back_menu.render();
}

View File

@ -0,0 +1,15 @@
#include "include/gte_test_assets.hpp"
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
namespace GTETest {
enum LBA {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(JABY_STAR, "ASSETS/GTE/JABY.BIN"),
__jabyengine_end_lba_request
};
__declare_lba_header(LBA);
CDFile Assets[1] = {
CDFileBuilder::simple_tim(LBA::JABY_STAR, JabySTARTim),
};
}

View File

@ -1,6 +1,13 @@
#pragma once
#include "../../../../include/asset_mgr.hpp"
#include <PSX/File/cd_file_types.hpp>
namespace GTETest {
using namespace JabyEngine;
static constexpr auto JabySTARTim = SimpleTIM(
// v Doenerfisch rotates so we need some space
Assets::Main::DoenerFishInfo.tim.get_texture_x(), Assets::Main::DoenerFishInfo.tim.get_texture_y() + Assets::Main::DoenerFishInfo.size.height + 2,
Assets::Main::DoenerFishInfo.tim.get_clut_x() + 16, Assets::Main::DoenerFishInfo.tim.get_clut_y()
);
}

View File

@ -20,6 +20,9 @@ namespace GPUTest {
}
namespace GTETest {
extern const volatile JabyEngine::AutoLBAEntry lba[];
extern JabyEngine::CDFile Assets[1];
void main();
}

View File

@ -95,7 +95,7 @@ namespace Assets {
}
void load_gte_test() {
load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start));
load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start), GTETest::lba, GTETest::Assets);
}
void load_font_cycler() {

BIN
examples/PoolBox/assets/JabyStar.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -2,8 +2,9 @@ include $(JABY_ENGINE_DIR)/mkfile/common/ExportPath.mk
include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk
OUTPUT_DIR = bin
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin $(OUTPUT_DIR)/Controller.bin $(OUTPUT_DIR)/doener_fish.bin
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin $(OUTPUT_DIR)/Controller.bin $(OUTPUT_DIR)/doener_fish.bin $(OUTPUT_DIR)/JabyStar.bin
# TODO: Simplyfy all of these?
$(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
@mkdir -p $(OUTPUT_DIR)
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4
@ -21,6 +22,9 @@ $(OUTPUT_DIR)/Controller.bin: Controller.png
$(OUTPUT_DIR)/doener_fish.bin: doener_fish.png
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
$(OUTPUT_DIR)/JabyStar.bin: JabyStar.png
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
all: $(INPUT)
clean:

View File

@ -4,12 +4,13 @@
<License>%PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT</License>
</Description>
<Track>
<!--TODO: JabyEngine should warn at runtime that I did not apply lba_source!-->
<File name = "SYSTEM.CNF">System.cnf.subst</File>
<Main name = "%PSX_BOOT_FILE%" lba_source = "../application/src/asset_mgr.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/PoolBox.psexe</Main>
<Overlay name = "BIO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.bios_info</Overlay>
<Overlay name = "CTO.BIN" lba_source = "../application/src/Overlay/ControllerTest/controller_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests</Overlay>
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
<Overlay name = "GTE.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
<Overlay name = "GTE.BIN" lba_source = "../application/src/Overlay/GTETest/gte_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
<Overlay name = "FCO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.font_cycler</Overlay>
<Overlay name = "SCO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>
@ -23,6 +24,10 @@
<File name = "CONT.BIN" lz4 = "already">../assets/bin/Controller.bin</File>
</Directory>
<Directory name = "GTE">
<File name = "JABY.BIN" lz4 = "already">../assets/bin/JabyStar.bin</File>
</Directory>
<File name = "TEX.BIN" lz4 = "already">../assets/bin/TexturePage.bin</File>
<File name = "ICON.BIN" lz4 = "already">../assets/bin/IconTexture.bin</File>
</Directory>

View File

@ -5,7 +5,7 @@ namespace math {
template<typename T>
struct raw_math {
constexpr T operator-() const {
return T{.raw = -(static_cast<const T&>(*this).raw)};
return T{.raw = static_cast<decltype(T::raw)>(-(static_cast<const T&>(*this).raw))};
}
constexpr T operator+(const T& obj) const {