From f750c10c6f0cae4a1fcb24695b0bf25daf006cab Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 2 May 2016 12:54:43 +0100 Subject: [PATCH] Blink some blips on radar. Show disabled craft as light blue. --- src/battle/radar.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/battle/radar.c b/src/battle/radar.c index cd5649c..3297dd9 100644 --- a/src/battle/radar.c +++ b/src/battle/radar.c @@ -34,7 +34,7 @@ void drawRadar(void) { SDL_Rect r; Entity *e; - int dist, inRange; + int dist, inRange, blink; blit(radarTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 1); @@ -42,6 +42,8 @@ void drawRadar(void) r.w = r.h = 3; + blink = battle.stats[STAT_TIME] % 60 < 30; + for (e = battle.entityHead.next ; e != NULL ; e = e->next) { dist = getDistance(e->x, e->y, player->x, player->y); @@ -78,21 +80,24 @@ void drawRadar(void) break; } - if (e == player->target) - { - SDL_SetRenderDrawColor(app.renderer, 255, 255, 0, 255); - } - - if (e == battle.missionTarget) - { - SDL_SetRenderDrawColor(app.renderer, 255, 255, 255, 255); - } - if (e->type == ET_MINE || e->type == ET_SHADOW_MINE || e->type == ET_JUMPGATE || (e->owner && e->owner->type == ET_JUMPGATE)) { SDL_SetRenderDrawColor(app.renderer, 255, 255, 255, 255); } + if (blink) + { + if (e == player->target || e == battle.missionTarget) + { + SDL_SetRenderDrawColor(app.renderer, 255, 255, 0, 255); + } + + if (e->flags & EF_DISABLED) + { + SDL_SetRenderDrawColor(app.renderer, 0, 192, 255, 255); + } + } + SDL_RenderFillRect(app.renderer, &r); } }