58 lines
1.8 KiB
C++
58 lines
1.8 KiB
C++
#include "../../../include/asset_mgr.hpp"
|
|
#include "../../../include/shared.hpp"
|
|
#include "include/GTE_Sprite.hpp"
|
|
#include <PSX/Periphery/periphery.hpp>
|
|
#include <stdio.h>
|
|
|
|
namespace GTETest {
|
|
using namespace JabyEngine;
|
|
using namespace GTETest;
|
|
|
|
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(),
|
|
Make::TPage(Assets::Main::DoenerFishInfo.tim.get_texture_position(), GPU::SemiTransparency::B_add_F, GPU::TextureColorMode::clut4),
|
|
Make::PageClut(Assets::Main::DoenerFishInfo.tim.get_clut_position()),
|
|
GPU::Color24::Grey()
|
|
));
|
|
static auto rotation = 0.0_deg;
|
|
|
|
static void setup() {
|
|
Shared::back_menu.reset();
|
|
|
|
GTE::set_geom_offset(0, 0);
|
|
GTE::set_geom_screen(512);
|
|
}
|
|
|
|
static bool update_or_exit() {
|
|
Periphery::query_controller();
|
|
if(Shared::back_menu.update(Make::PositionI16(0, GPU::Display::Height - 32))) {
|
|
return true;
|
|
}
|
|
|
|
const auto matrix = GTE::MATRIX{
|
|
GTE::ROTMATRIX::rotated(-rotation, rotation, -rotation),
|
|
GTE::TRANSFERVECTOR::translated((Assets::Main::DoenerFishInfo.size.width/2), (Assets::Main::DoenerFishInfo.size.height/2))
|
|
};
|
|
doener_fish.apply(matrix);
|
|
rotation += 5.0_deg;
|
|
return false;
|
|
}
|
|
|
|
static void render() {
|
|
doener_fish.render();
|
|
Shared::back_menu.render();
|
|
}
|
|
|
|
void main() {
|
|
setup();
|
|
|
|
while(true) {
|
|
if(update_or_exit()) {
|
|
break;
|
|
}
|
|
GPU::swap_buffers_vsync(1);
|
|
render();
|
|
}
|
|
}
|
|
} |