error colour as feature

This commit is contained in:
Alex Janka 2023-10-05 11:38:39 +11:00
parent 167d461c35
commit a24a49fdcb
2 changed files with 3 additions and 2 deletions

View file

@ -16,6 +16,7 @@ vulkan-renderer = [
vulkan-static = ["dep:ash-molten", "vulkan-renderer"] vulkan-static = ["dep:ash-molten", "vulkan-renderer"]
pixels-renderer = ["dep:pixels"] pixels-renderer = ["dep:pixels"]
config = ["dep:directories", "dep:ron"] config = ["dep:directories", "dep:ron"]
error-colour = []
[dependencies] [dependencies]
rand = "0.8.5" rand = "0.8.5"

View file

@ -143,7 +143,7 @@ impl ColourInner {
if let Some((cgb_palette, pallete_num)) = cgb_data { if let Some((cgb_palette, pallete_num)) = cgb_data {
let offset: usize = (pallete_num as usize * 2 * 4) let offset: usize = (pallete_num as usize * 2 * 4)
+ (if *self == ColourInner::Error { + (if *self == ColourInner::Error {
if cfg!(debug_assertions) { if cfg!(feature = "error-colour") {
return ERROR_COLOUR; return ERROR_COLOUR;
} else { } else {
ColourInner::Zero ColourInner::Zero
@ -161,7 +161,7 @@ impl ColourInner {
ColourInner::Two => dmg_colours::TWO, ColourInner::Two => dmg_colours::TWO,
ColourInner::Three => dmg_colours::THREE, ColourInner::Three => dmg_colours::THREE,
ColourInner::Error => { ColourInner::Error => {
if cfg!(debug_assertions) { if cfg!(feature = "error-colour") {
ERROR_COLOUR ERROR_COLOUR
} else { } else {
dmg_colours::ZERO dmg_colours::ZERO