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"]
pixels-renderer = ["dep:pixels"]
config = ["dep:directories", "dep:ron"]
error-colour = []
[dependencies]
rand = "0.8.5"

View file

@ -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