Hold R2 and L2 to active load test

This commit is contained in:
2024-07-22 20:09:47 +02:00
parent 79f2b436ff
commit c4d4b8f014
5 changed files with 20 additions and 9 deletions

View File

@@ -11,6 +11,7 @@
#include <stdio.hpp>
using namespace JabyEngine;
using DigitalButton = Periphery::GenericController::Button;
struct XAPlayer {
static constexpr auto MaxChannels = 2;
@@ -91,12 +92,19 @@ namespace Shared {
Make::AreaI16(0, 0, GPU::Display::Width, GPU::Display::Height),
{GPU::Color24::Red(0xA0), GPU::Color24::Green(0xA0), GPU::Color24::Blue(0xA0), GPU::Color24::Black()}
);
bool load_test = false;
}
static void setup() {
// Use this size for the doener fish state?
// doener_fish.set_rect_size_fast(Make::SizeI16(64, 32));
const auto& controller = Periphery::get_primary_controller_as<JabyEngine::Periphery::GenericController>();
// With this approach we can default load_test to true for debugging reasons
if(controller.button.is_down(DigitalButton::R2) && controller.button.is_down(DigitalButton::L2)) {
Shared::load_test = true;
}
Assets::Main::load();
FontWriter::setup();
paco.setup();
@@ -145,8 +153,6 @@ static void setup() {
namespace NormalScene {
static void update() {
using DigitalButton = Periphery::GenericController::Button;
static const char Title[] = ">> Pool Box <<";
static const char Version[] = "Ver. 0.8.5";
static constexpr auto TitleLength = DefaultFont::Info.estimate_str_render_length(Title);
@@ -170,10 +176,13 @@ namespace NormalScene {
FontWriter::new_font_writer.write(cursor.change_position(Make::PositionI16((GPU::Display::Width-VersionLength)/2, 16 + DefaultFont::Info.get_kern_size().height)), Version, GPU::Color24::Green(0xD0), &FontWriter::wiggle);
menu.update(FontWriter::bios_font_writer, cursor, Make::PositionI16(8, 64));
// TODO: Make this a feature
// Force state change for now
/*state_changer.asset_load = Assets::Overlay::load_gpu_test;
state_changer.main = GPUTest::main;*/
if(Shared::load_test) {
// Force state change if we are in the load_test state
state_changer.asset_load = Assets::Overlay::load_gpu_test;
state_changer.main = GPUTest::main;
}
}
static void render() {
@@ -226,6 +235,7 @@ namespace LoadingScene {
}
void main() {
Periphery::query_controller();
setup();
while(true) {