Testing font and color font
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#ifndef __ASSETS_HPP__
|
||||
#define __ASSETS_HPP__
|
||||
#include <PSX/File/Processor/cd_file_processor.hpp>
|
||||
|
||||
namespace Assets {
|
||||
using namespace JabyEngine;
|
||||
|
||||
static constexpr auto FontTIM = SimpleTIM(960, 0, 960, 511);
|
||||
void load_for_main();
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,25 @@
|
||||
#include "assets.hpp"
|
||||
#include <PSX/GPU/gpu_primitives.hpp>
|
||||
#include <PSX/GPU/gpu.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace JabyEngine;
|
||||
static auto FontPage = GPU::TexPage({Assets::FontTIM.get_texture_x(), Assets::FontTIM.get_texture_y()}, GPU::TexturePageColor::$4bit).linked();
|
||||
static auto FontTest = GPU::SPRT(
|
||||
GPU::AreaI16({0, 0}, {256, 96}), {GPU::PagePosition(0, 0), GPU::PageClut(Assets::FontTIM.get_clut_x(), Assets::FontTIM.get_clut_y())},
|
||||
GPU::Color24::Grey()
|
||||
).linked();
|
||||
static auto FontTestColor = GPU::SPRT(
|
||||
GPU::AreaI16({0, 96}, {256, 96}), {GPU::PagePosition(0, 0), GPU::PageClut(Assets::FontTIM.get_clut_x(), Assets::FontTIM.get_clut_y())},
|
||||
GPU::Color24(0x0, 0x0, 0xA0)
|
||||
).linked();
|
||||
|
||||
void main() {
|
||||
Assets::load_for_main();
|
||||
printf("Planschbecken c:\n");
|
||||
|
||||
FontPage.concat(FontTest).concat(FontTestColor);
|
||||
while(true) {
|
||||
GPU::swap_buffers_vsync(1);
|
||||
GPU::render(FontPage);
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
#include "assets.hpp"
|
||||
#include <PSX/File/Processor/cd_file_processor.hpp>
|
||||
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -13,6 +12,29 @@ namespace Assets {
|
||||
__declare_lba_header(LBA);
|
||||
|
||||
void load_for_main() {
|
||||
printf("Loading assets! %i\n", lba[LBA::FONT].get_lba());
|
||||
static const CDFile Assets[] = {
|
||||
CDFileBuilder::simple_tim(LBA::FONT, FontTIM),
|
||||
};
|
||||
|
||||
const auto buffer_cfg = CDFileProcessor::BufferConfiguration::new_default();
|
||||
CDFileProcessor file_processor;
|
||||
|
||||
file_processor.setup(lba, Assets, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user