implements PLN-0070

This commit is contained in:
2026-05-23 19:23:07 +01:00
parent c4c2dfb017
commit f273745589
7 changed files with 28 additions and 42 deletions
@@ -366,7 +366,7 @@ mod tests {
bank_type: BankType::GLYPH,
offset,
size,
decoded_size: 16 * 16 + (GLYPH_BANK_PALETTE_COUNT_V1 as u64 * 16 * 2),
decoded_size: 16 * 16 + (GLYPH_BANK_PALETTE_COUNT_V1 as u64 * 16 * 4),
codec: AssetCodec::None,
metadata: json!({
"tile_size": 16,
@@ -449,7 +449,7 @@ mod tests {
bank_type: BankType::GLYPH,
offset: 4,
size: 4,
decoded_size: 16 * 16 + (GLYPH_BANK_PALETTE_COUNT_V1 as u64 * 16 * 2),
decoded_size: 16 * 16 + (GLYPH_BANK_PALETTE_COUNT_V1 as u64 * 16 * 4),
codec: AssetCodec::None,
metadata: json!({
"tile_size": 16,
-19
View File
@@ -65,23 +65,4 @@ impl Color {
(self.0 & 0xFF) as u8
}
#[deprecated(note = "Temporary bridge until the renderer buffer migrates to RGBA8888.")]
pub const fn to_rgb565_lossy(self) -> u16 {
let (r, g, b, _) = Self::unpack_to_native(self.0);
let r5 = (r as u16 >> 3) & 0x1F;
let g6 = (g as u16 >> 2) & 0x3F;
let b5 = (b as u16 >> 3) & 0x1F;
(r5 << 11) | (g6 << 5) | b5
}
#[deprecated(note = "Temporary bridge until asset palettes migrate to RGBA8888.")]
pub const fn from_rgb565_lossy(raw: u16) -> Self {
let r5 = ((raw >> 11) & 0x1F) as u32;
let g6 = ((raw >> 5) & 0x3F) as u32;
let b5 = (raw & 0x1F) as u32;
let r = ((r5 << 3) | (r5 >> 2)) as u8;
let g = ((g6 << 2) | (g6 >> 4)) as u8;
let b = ((b5 << 3) | (b5 >> 2)) as u8;
Self::rgba(r, g, b, 255)
}
}