From a24a49fdcbc510815dccef1b7c4e41a093ab618b Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Thu, 5 Oct 2023 11:38:39 +1100 Subject: [PATCH] error colour as feature --- lib/Cargo.toml | 1 + lib/src/processor/memory/mmio/gpu/types.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index a3c04b4..b4b77e7 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -16,6 +16,7 @@ vulkan-renderer = [ vulkan-static = ["dep:ash-molten", "vulkan-renderer"] pixels-renderer = ["dep:pixels"] config = ["dep:directories", "dep:ron"] +error-colour = [] [dependencies] rand = "0.8.5" diff --git a/lib/src/processor/memory/mmio/gpu/types.rs b/lib/src/processor/memory/mmio/gpu/types.rs index 04d2ae6..d262ff7 100644 --- a/lib/src/processor/memory/mmio/gpu/types.rs +++ b/lib/src/processor/memory/mmio/gpu/types.rs @@ -143,7 +143,7 @@ impl ColourInner { if let Some((cgb_palette, pallete_num)) = cgb_data { let offset: usize = (pallete_num as usize * 2 * 4) + (if *self == ColourInner::Error { - if cfg!(debug_assertions) { + if cfg!(feature = "error-colour") { return ERROR_COLOUR; } else { ColourInner::Zero @@ -161,7 +161,7 @@ impl ColourInner { ColourInner::Two => dmg_colours::TWO, ColourInner::Three => dmg_colours::THREE, ColourInner::Error => { - if cfg!(debug_assertions) { + if cfg!(feature = "error-colour") { ERROR_COLOUR } else { dmg_colours::ZERO