Create constructor for SimpleTIM
This commit is contained in:
parent
8134979b1c
commit
02838c1228
|
@ -10,9 +10,9 @@ namespace Assets {
|
|||
GPU::SizeI16 size;
|
||||
};
|
||||
|
||||
static constexpr auto PacoTIM = SimpleTIM(896, 0, 960, 510);
|
||||
static constexpr auto PacoTIM = SimpleTIM::create(896, 0, 960, 510);
|
||||
static constexpr auto DoenerFishInfo = ImageInfo{
|
||||
.tim = SimpleTIM(896 + 30, 0, 960 + 16, 510),
|
||||
.tim = SimpleTIM::create(896 + 30, 0, 960 + 16, 510),
|
||||
.size = GPU::SizeI16::create(128, 64)
|
||||
};
|
||||
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
namespace ControllerTest {
|
||||
using namespace JabyEngine;
|
||||
|
||||
static constexpr auto ControllerButtonTIM = SimpleTIM(384, 0, 384, 511);
|
||||
static constexpr auto ControllerButtonTIM = SimpleTIM::create(384, 0, 384, 511);
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
namespace GPUTest {
|
||||
using namespace JabyEngine;
|
||||
|
||||
static constexpr auto TexPageTIM = SimpleTIM(384, 0, 384, 511);
|
||||
static constexpr auto IconTIM = SimpleTIM(384, 256, 384, 510);
|
||||
static constexpr auto TexPageTIM = SimpleTIM::create(384, 0, 384, 511);
|
||||
static constexpr auto IconTIM = SimpleTIM::create(384, 256, 384, 510);
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
namespace GTETest {
|
||||
using namespace JabyEngine;
|
||||
|
||||
static constexpr auto JabySTARTim = SimpleTIM(
|
||||
static constexpr auto JabySTARTim = SimpleTIM::create(
|
||||
// v Doenerfisch rotates so we need some space
|
||||
Assets::Main::DoenerFishInfo.tim.get_texture_x(), Assets::Main::DoenerFishInfo.tim.get_texture_y() + Assets::Main::DoenerFishInfo.size.height + 2,
|
||||
Assets::Main::DoenerFishInfo.tim.get_clut_x() + 16, Assets::Main::DoenerFishInfo.tim.get_clut_y()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
namespace FontWriter {
|
||||
using namespace JabyEngine;
|
||||
|
||||
static constexpr auto LibraryFontTIM = SimpleTIM(320, 0, 320, DefaultFont::Info.texture_size.height);
|
||||
static constexpr auto LibraryFontTIM = SimpleTIM::create(320, 0, 320, DefaultFont::Info.texture_size.height);
|
||||
|
||||
static FontPrimitive font_buffer[2*256];
|
||||
Wiggle wiggle = {Make::PositionI8(0, 0), Make::PositionI8(1, -2), Make::PositionI8(0, -4), Make::PositionI8(-1, -2), Make::PositionI8(0, 0), Make::PositionI8(1, 2), Make::PositionI8(0, 4), Make::PositionI8(-1, 2)};
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace JabyEngine {
|
|||
};
|
||||
|
||||
// TODO: Call TIM?
|
||||
// TODO: Add create function?
|
||||
struct SimpleTIM {
|
||||
static constexpr auto TextureX = BitRange::from_to(0, 8);
|
||||
static constexpr auto TextureY = BitRange::from_to(9, 16);
|
||||
|
@ -23,9 +22,8 @@ namespace JabyEngine {
|
|||
|
||||
uint32_t raw;
|
||||
|
||||
constexpr SimpleTIM() : raw(0) {}
|
||||
|
||||
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : raw(TextureX.as_value(texX >> 1) | TextureY.as_value(texY >> 1) | ClutX.as_value(clutX >> 4) | ClutY.as_value(static_cast<uint32_t>(clutY))) {
|
||||
static constexpr SimpleTIM create(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) {
|
||||
return SimpleTIM{.raw = TextureX.as_value(texX >> 1) | TextureY.as_value(texY >> 1) | ClutX.as_value(clutX >> 4) | ClutY.as_value(static_cast<uint32_t>(clutY))};
|
||||
}
|
||||
|
||||
constexpr uint16_t get_texture_x() const {
|
||||
|
@ -79,5 +77,5 @@ namespace JabyEngine {
|
|||
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef CopyTo Overlay;
|
||||
using Overlay = CopyTo;
|
||||
}
|
|
@ -78,7 +78,7 @@ namespace JabyEngine {
|
|||
const auto bytes_ready = decompress_logo();
|
||||
|
||||
// Upload SplashScreen picture
|
||||
auto state = FileProcessor::create(&__boot_loader_end, SimpleTIM(32, 0, 0, 0));
|
||||
auto state = FileProcessor::create(&__boot_loader_end, SimpleTIM::create(32, 0, 0, 0));
|
||||
state.process(bytes_ready);
|
||||
|
||||
// Now load the BIOS font to the specified location
|
||||
|
|
|
@ -11,6 +11,6 @@ namespace JabyEngine {
|
|||
|
||||
struct BIOSFont {
|
||||
static constexpr auto Info = FontInfo::create(Make::SizeU16(64, 96), Make::SizeU8(16, 16), Make::SizeU8(12, 16));
|
||||
static constexpr auto TIM = SimpleTIM(JabyEngine::GPU::BIOS_Font::TextureLoadPos.x, JabyEngine::GPU::BIOS_Font::TextureLoadPos.y, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.x, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.y);
|
||||
static constexpr auto TIM = SimpleTIM::create(JabyEngine::GPU::BIOS_Font::TextureLoadPos.x, JabyEngine::GPU::BIOS_Font::TextureLoadPos.y, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.x, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.y);
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue