Blink some blips on radar. Show disabled craft as light blue.

This commit is contained in:
Steve 2016-05-02 12:54:43 +01:00
parent c492115bbc
commit f750c10c6f
1 changed files with 16 additions and 11 deletions

View File

@ -34,7 +34,7 @@ void drawRadar(void)
{ {
SDL_Rect r; SDL_Rect r;
Entity *e; Entity *e;
int dist, inRange; int dist, inRange, blink;
blit(radarTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 1); blit(radarTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 1);
@ -42,6 +42,8 @@ void drawRadar(void)
r.w = r.h = 3; r.w = r.h = 3;
blink = battle.stats[STAT_TIME] % 60 < 30;
for (e = battle.entityHead.next ; e != NULL ; e = e->next) for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{ {
dist = getDistance(e->x, e->y, player->x, player->y); dist = getDistance(e->x, e->y, player->x, player->y);
@ -78,21 +80,24 @@ void drawRadar(void)
break; 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)) 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); 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); SDL_RenderFillRect(app.renderer, &r);
} }
} }