From af949820b646d49cb570e1c00126172a8f1e6177 Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 29 Sep 2015 02:41:22 +0000 Subject: [PATCH] Use ?: for show_bomb_count gr_set_fontcolor --- similar/main/gauges.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/similar/main/gauges.cpp b/similar/main/gauges.cpp index 6cd32d169..b45b5264f 100644 --- a/similar/main/gauges.cpp +++ b/similar/main/gauges.cpp @@ -1025,10 +1025,13 @@ static void show_bomb_count(int x,int y,int bg_color,int always_show,int right_a if (always_show && count == 0) //no bombs, draw nothing on HUD return; - if (count) - gr_set_fontcolor((bomb==PROXIMITY_INDEX)?gr_find_closest_color(55,0,0):BM_XRGB(59,50,21),bg_color); - else - gr_set_fontcolor(bg_color,bg_color); //erase by drawing in background color + gr_set_fontcolor(count + ? (bomb == PROXIMITY_INDEX + ? gr_find_closest_color(55, 0, 0) + : BM_XRGB(59, 50, 21) + ) + : bg_color, //erase by drawing in background color + bg_color); snprintf(txt, sizeof(txt), "B:%02d", count);