Re-create PoolBox Paco
This commit is contained in:
parent
984805eb27
commit
1397ee9818
|
@ -0,0 +1,12 @@
|
||||||
|
#pragma once
|
||||||
|
#include <PSX/File/cd_file_types.hpp>
|
||||||
|
|
||||||
|
namespace Assets {
|
||||||
|
using namespace JabyEngine;
|
||||||
|
|
||||||
|
namespace Main {
|
||||||
|
static constexpr auto PacoTIM = SimpleTIM(896, 0, 960, 510);
|
||||||
|
|
||||||
|
void load();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
#include "../include/asset_mgr.hpp"
|
||||||
|
#include "include/paco.hpp"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
using namespace JabyEngine;
|
||||||
|
|
||||||
|
// Do we want this namespace?
|
||||||
|
// Do we want Paco to be HERE?!
|
||||||
|
static object::Paco paco;
|
||||||
|
|
||||||
|
static void setup() {
|
||||||
|
Assets::Main::load();
|
||||||
|
paco.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void update() {
|
||||||
|
paco.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void render() {
|
||||||
|
paco.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
setup();
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
update();
|
||||||
|
GPU::swap_buffers_vsync(1);
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include "../include/asset_mgr.hpp"
|
||||||
|
#include <PSX/File/Processor/cd_file_processor.hpp>
|
||||||
|
#include <PSX/AutoLBA/auto_lba.hpp>
|
||||||
|
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace Assets {
|
||||||
|
enum LBA {
|
||||||
|
__jabyengine_start_lba_request
|
||||||
|
__jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.BIN"),
|
||||||
|
__jabyengine_end_lba_request
|
||||||
|
};
|
||||||
|
__declare_lba_header(LBA);
|
||||||
|
|
||||||
|
static void load(const CDFile* assets, size_t size) {
|
||||||
|
const auto buffer_cfg = CDFileProcessor::BufferConfiguration::new_default();
|
||||||
|
CDFileProcessor file_processor;
|
||||||
|
|
||||||
|
file_processor.setup(lba, CDFileProcessor::JobArray{assets, size}, buffer_cfg);
|
||||||
|
while(true) {
|
||||||
|
switch(file_processor.process()) {
|
||||||
|
case Progress::InProgress:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Progress::Done:
|
||||||
|
if(!file_processor.next(lba, buffer_cfg)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Progress::Error:
|
||||||
|
printf("Error detected! Aborting load\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Main {
|
||||||
|
static const CDFile Files[] = {
|
||||||
|
CDFileBuilder::simple_tim(LBA::PACO, PacoTIM)
|
||||||
|
};
|
||||||
|
|
||||||
|
void load() {
|
||||||
|
::Assets::load(Files, sizeof(Files)/sizeof(Files[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <PSX/File/Processor/cd_file_processor.hpp>
|
#include "../../include/asset_mgr.hpp"
|
||||||
#include <PSX/GPU/gpu.hpp>
|
#include <PSX/GPU/make_gpu_primitives.hpp>
|
||||||
#include <PSX/Timer/frame_timer.hpp>
|
#include <PSX/Timer/frame_timer.hpp>
|
||||||
|
|
||||||
namespace object {
|
namespace object {
|
||||||
using namespace JabyEngine;
|
using namespace JabyEngine;
|
||||||
|
|
||||||
class Paco {
|
class Paco {
|
||||||
public:
|
|
||||||
static constexpr auto TIM = SimpleTIM(896, 0, 960, 510);
|
|
||||||
private:
|
private:
|
||||||
static const GPU::Color24 Colors[];
|
static const GPU::Color24 Colors[];
|
||||||
|
|
||||||
|
@ -19,12 +17,12 @@ namespace object {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr Paco() :
|
constexpr Paco() :
|
||||||
tex_page(GPU::TexPage::create(GPU::PositionU16::create(
|
tex_page(Make::TexPage(Make::PositionU16(
|
||||||
TIM.get_texture_x(), TIM.get_texture_y()),
|
Assets::Main::PacoTIM.get_texture_x(), Assets::Main::PacoTIM.get_texture_y()),
|
||||||
GPU::TexturePageColor::$4bit).linked()),
|
GPU::TexturePageColor::$4bit).linked()),
|
||||||
sprite(GPU::SPRT::create(
|
sprite(Make::SPRT(
|
||||||
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
|
Make::AreaI16(Make::PositionI16(0, 100), Make::SizeI16(120, 128)),
|
||||||
GPU::OffsetPageWithClut(GPU::PageOffset::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
|
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(Assets::Main::PacoTIM.get_clut_x(), Assets::Main::PacoTIM.get_clut_y())),
|
||||||
GPU::Color24::Blue()).linked()),
|
GPU::Color24::Blue()).linked()),
|
||||||
timer(),
|
timer(),
|
||||||
color_idx(0) {}
|
color_idx(0) {}
|
|
@ -1,11 +1,19 @@
|
||||||
#include "paco.hpp"
|
#include "include/paco.hpp"
|
||||||
|
|
||||||
namespace object {
|
namespace object {
|
||||||
const GPU::Color24 Paco :: Colors[] = {GPU::Color24::Red(), GPU::Color24::Green(), GPU::Color24::Blue(), GPU::Color24::Yellow()};
|
const GPU::Color24 Paco :: Colors[] = {GPU::Color24::Red(), GPU::Color24::Green(), GPU::Color24::Blue(), GPU::Color24::Yellow()};
|
||||||
|
|
||||||
void Paco :: setup() {
|
void Paco :: setup() {
|
||||||
|
/*this->tex_page = Make::TexPage(Make::PositionU16(
|
||||||
|
Assets::Main::PacoTIM.get_texture_x(), Assets::Main::PacoTIM.get_texture_y()),
|
||||||
|
GPU::TexturePageColor::$4bit).linked();
|
||||||
|
|
||||||
|
this->sprite = Make::SPRT(
|
||||||
|
Make::AreaI16(Make::PositionI16(0, 100), Make::SizeI16(120, 128)),
|
||||||
|
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(Assets::Main::PacoTIM.get_clut_x(), Assets::Main::PacoTIM.get_clut_y())),
|
||||||
|
GPU::Color24::Blue()).linked();*/
|
||||||
|
|
||||||
this->timer.reset();
|
this->timer.reset();
|
||||||
// This should only work on elements that are linkable - but it didn't
|
|
||||||
this->tex_page.concat(this->sprite);
|
this->tex_page.concat(this->sprite);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ include $(JABY_ENGINE_DIR)/mkfile/ExportPath.mk
|
||||||
include $(JABY_ENGINE_DIR)/mkfile/RebuildTarget.mk
|
include $(JABY_ENGINE_DIR)/mkfile/RebuildTarget.mk
|
||||||
|
|
||||||
OUTPUT_DIR = bin
|
OUTPUT_DIR = bin
|
||||||
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/YoshiFont.bin $(OUTPUT_DIR)/Paco.bin
|
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin
|
||||||
|
|
||||||
$(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
|
$(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
|
||||||
@mkdir -p $(OUTPUT_DIR)
|
@mkdir -p $(OUTPUT_DIR)
|
||||||
|
@ -12,9 +12,6 @@ $(OUTPUT_DIR)/IconTexture.bin: IconTexture.png
|
||||||
@mkdir -p $(OUTPUT_DIR)
|
@mkdir -p $(OUTPUT_DIR)
|
||||||
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --semi-trans --color-trans
|
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --semi-trans --color-trans
|
||||||
|
|
||||||
$(OUTPUT_DIR)/YoshiFont.bin: YoshiFont.png
|
|
||||||
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
|
|
||||||
|
|
||||||
$(OUTPUT_DIR)/Paco.bin: Paco.png
|
$(OUTPUT_DIR)/Paco.bin: Paco.png
|
||||||
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
|
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
|
||||||
|
|
||||||
|
|
BIN
examples/PoolBox/assets/YoshiFont.png (Stored with Git LFS)
BIN
examples/PoolBox/assets/YoshiFont.png (Stored with Git LFS)
Binary file not shown.
|
@ -5,10 +5,9 @@
|
||||||
</Description>
|
</Description>
|
||||||
<Track>
|
<Track>
|
||||||
<File name = "SYSTEM.CNF">System.cnf</File>
|
<File name = "SYSTEM.CNF">System.cnf</File>
|
||||||
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/main_assets.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
|
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/asset_mgr.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
|
||||||
<Directory name="ASSETS" hidden = "true">
|
<Directory name="ASSETS" hidden = "true">
|
||||||
<Directory name = "MAIN">
|
<Directory name = "MAIN">
|
||||||
<File name = "FONT.BIN" lz4 = "already">../assets/bin/YoshiFont.bin</File>
|
|
||||||
<File name = "PACO.BIN" lz4 = "already">../assets/bin/Paco.bin</File>
|
<File name = "PACO.BIN" lz4 = "already">../assets/bin/Paco.bin</File>
|
||||||
</Directory>
|
</Directory>
|
||||||
<File name = "FONT.BIN" lz4 = "already">../assets/bin/TexturePage.bin</File>
|
<File name = "FONT.BIN" lz4 = "already">../assets/bin/TexturePage.bin</File>
|
||||||
|
|
Loading…
Reference in New Issue