Remove all old code

This commit is contained in:
2024-01-03 10:21:07 -06:00
parent 7bc901355f
commit b4458d4280
12 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include "paco.hpp"
namespace object {
const GPU::Color24 Paco :: Colors[] = {GPU::Color24::Red(), GPU::Color24::Green(), GPU::Color24::Blue(), GPU::Color24::Yellow()};
void Paco :: setup() {
this->timer.reset();
// This should only work on elements that are linkable - but it didn't
this->tex_page.concat(this->sprite);
}
void Paco :: update() {
if(this->timer.is_expired_for(325_ms)) {
static constexpr uint8_t LastIDX = (sizeof(Paco::Colors)/sizeof(Paco::Colors[0])) - 1;
this->color_idx = (this->color_idx == LastIDX) ? 0 : this->color_idx + 1;
this->timer.reset();
}
}
void Paco :: render() {
this->sprite->color = Paco::Colors[this->color_idx];
GPU::render(this->tex_page);
}
}

View File

@@ -0,0 +1,36 @@
#pragma once
#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::create(GPU::PositionU16::create(
TIM.get_texture_x(), TIM.get_texture_y()),
GPU::TexturePageColor::$4bit).linked()),
sprite(GPU::SPRT::create(
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
GPU::OffsetPageWithClut(GPU::PageOffset::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
GPU::Color24::Blue()).linked()),
timer(),
color_idx(0) {}
void setup();
void update();
void render();
};
}