v0.1 working

This commit is contained in:
Nilton Constantino
2026-01-13 08:17:06 +00:00
parent e440b7280c
commit 140c56d731
5 changed files with 124 additions and 21 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
pub struct Color(pub u16);
impl Color {
pub const INDIGO: Self = Self::rgb(32, 32, 64);
pub const BLACK: Self = Self::rgb(0, 0, 0); // 0x0000
pub const WHITE: Self = Self::rgb(255, 255, 255); // 0xFFFF
pub const RED: Self = Self::rgb(255, 0, 0); // 0xF800
@@ -35,7 +36,7 @@ impl Color {
pub const fn pack_from_native(r: u8, g: u8, b: u8) -> u16 {
((r as u16 & 0x1F) << 11) | ((g as u16 & 0x3F) << 5) | (b as u16 & 0x1F)
}
/// Cria uma cor RGB565 a partir de componentes 8-bit (0..255).
pub const fn rgb(r: u8, g: u8, b: u8) -> Self {
let r5 = (r as u16 >> 3) & 0x1F;
+1 -1
View File
@@ -9,5 +9,5 @@ pub struct Sprite {
pub active: bool,
pub flip_x: bool,
pub flip_y: bool,
// No futuro: priority, palette override, etc.
pub priority: u8,
}