Integrate new Jaby sprite

This commit is contained in:
2024-04-05 19:57:02 -05:00
parent d0aa1d43d2
commit 0045c892b5
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() {