From 425e093442c750b96bc50e1ce8254d9a14030a7b Mon Sep 17 00:00:00 2001 From: jaby Date: Thu, 4 Jan 2024 10:03:25 -0600 Subject: [PATCH] Improve colors --- examples/PoolBox/application/src/application.cpp | 4 ++-- examples/PoolBox/application/src/menu.cpp | 2 +- include/PSX/GPU/gpu_types.hpp | 4 ++-- support/src/FontWriter/src/font_writer.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/PoolBox/application/src/application.cpp b/examples/PoolBox/application/src/application.cpp index 0816884d..5c3996ad 100644 --- a/examples/PoolBox/application/src/application.cpp +++ b/examples/PoolBox/application/src/application.cpp @@ -79,7 +79,7 @@ namespace NormalScene { auto cursor = FontWriter::update(JabyEngine::Make::PositionI16((GPU::Display::Width-TitleLength)/2, 16)); paco.update(); - FontWriter::new_font_writer.write(cursor, Title, GPU::Color24::Yellow(), &FontWriter::wiggle); + FontWriter::new_font_writer.write(cursor, Title, GPU::Color24::Yellow(0xD0), &FontWriter::wiggle); menu.update(FontWriter::bios_font_writer, cursor, Make::PositionI16(8, 64)); } @@ -102,7 +102,7 @@ namespace LoadingScene { static constexpr auto TitleLength = (sizeof(Title) - 1)*DefaultFont::Info.font_size.width; auto cursor = FontWriter::update(JabyEngine::Make::PositionI16((GPU::Display::Width-TitleLength)/2, (GPU::Display::Height-16)/2)); - FontWriter::new_font_writer.write(cursor, Title, GPU::Color24::Blue()); + FontWriter::new_font_writer.write(cursor, Title, GPU::Color24::Blue(0xD0)); } static void render() { diff --git a/examples/PoolBox/application/src/menu.cpp b/examples/PoolBox/application/src/menu.cpp index e560dc5b..ab8e984c 100644 --- a/examples/PoolBox/application/src/menu.cpp +++ b/examples/PoolBox/application/src/menu.cpp @@ -63,7 +63,7 @@ namespace Menu { if(this->waiting) { auto state = JabyEngine::State::create(position); - this->font_writer->write(state, "Press and hold ()\nto get back", GPU::Color24::Red()); + this->font_writer->write(state, "Press and hold ()\nto get back", GPU::Color24::Red(0xD0)); } else { diff --git a/include/PSX/GPU/gpu_types.hpp b/include/PSX/GPU/gpu_types.hpp index 605a057c..22183077 100644 --- a/include/PSX/GPU/gpu_types.hpp +++ b/include/PSX/GPU/gpu_types.hpp @@ -64,8 +64,8 @@ namespace JabyEngine { return T::from_rgb(0x80, 0x80, 0x80); } - static constexpr T White() { - return T::from_rgb(0xFF, 0xFF, 0xFF); + static constexpr T White(uint8_t base = 0xFF) { + return T::from_rgb(base, base, base); } static constexpr T Red(uint8_t base = 0xFF) { diff --git a/support/src/FontWriter/src/font_writer.cpp b/support/src/FontWriter/src/font_writer.cpp index 74ae5d88..cd858f77 100644 --- a/support/src/FontWriter/src/font_writer.cpp +++ b/support/src/FontWriter/src/font_writer.cpp @@ -78,7 +78,7 @@ namespace JabyEngine { const auto row_count = 256/font_size.width; const auto push_char = [&](State& state, char cur_char) -> bool { - auto& primitive = GlobalPrimitiveFactory.new_primitive(); + auto& primitive = GlobalPrimitiveFactory.new_primitive(); primitive->position = state.pos; primitive->size = this->font_size;