Turn Paco into an object

This commit is contained in:
Jaby Blubb
2023-08-30 03:23:05 +02:00
parent 2702bed58e
commit 56486e5c3c
5 changed files with 74 additions and 28 deletions

View File

@@ -0,0 +1,40 @@
#ifndef __PACO_HPP__
#define __PACO_HPP__
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/GPU/gpu.hpp>
#include <PSX/Timer/frame_timer.hpp>
namespace object {
using namespace JabyEngine;
class Paco {
public:
static constexpr auto TIM = SimpleTIM(896, 0, 960, 510);
private:
static const GPU::Color24 Colors[];
GPU::TexPage::Linked tex_page;
GPU::SPRT::Linked sprite;
SimpleTimer<uint8_t> timer;
uint8_t color_idx;
public:
constexpr Paco() :
tex_page(GPU::TexPage(
{TIM.get_texture_x(), TIM.get_texture_y()},
GPU::TexturePageColor::$4bit).linked()),
sprite(GPU::SPRT(
// This pic used to be 122px (file size) and every tool would except it - however the display would be corrupt. Try it!!
GPU::AreaI16({0, 100}, {120, 128}),
GPU::PagePositionClut({0, 0}, GPU::PageClut(TIM.get_clut_x(), TIM.get_clut_y())),
GPU::Color24::Blue()).linked()),
timer(),
color_idx(0) {}
void setup();
void update();
void render();
};
}
#endif //!__PACO_HPP__