X-Git-Url: https://git.distorted.org.uk/~mdw/newkind/blobdiff_plain/84bbd12316a7ed2130dd1b2f2bc860a11624c3f3..1a8abebd82b12bd24a5418adab3e8c15d7a521c9:/threed.c diff --git a/threed.c b/threed.c index 1ea06a3..43a9da2 100644 --- a/threed.c +++ b/threed.c @@ -38,6 +38,38 @@ static unsigned char landscape[LAND_X_MAX+1][LAND_Y_MAX+1]; static struct point point_list[100]; +static void identify_ship(struct univ_object *univ) +{ + char buf[64]; + int lasv; + + lasv = ship_list[univ->type]->front_laser; + if (!(univ->flags & FLG_TACTICAL)) { +#ifdef HACKING + unsigned flags = univ->flags; + sprintf(buf, "%s %s%s%s%s", ship_list[univ->type]->name, + (flags & FLG_ANGRY) ? "A" : "", + (flags & FLG_TARGET) ? "T" : "", + (flags & FLG_HOSTILE) ? "H" : "", + (flags & FLG_POLICE) ? "P" : ""); +#else + sprintf(buf, "%s", ship_list[univ->type]->name); +#endif + } else { +#ifdef HACKING + unsigned flags = univ->flags; + sprintf(buf, "%s (%d) %s%s%s%s", ship_list[univ->type]->name, + univ->energy, + (flags & FLG_ANGRY) ? "A" : "", + (flags & FLG_TARGET) ? "T" : "", + (flags & FLG_HOSTILE) ? "H" : "", + (flags & FLG_POLICE) ? "P" : ""); +#else + sprintf(buf, "%s (%d)", ship_list[univ->type]->name, univ->energy); +#endif + } + gfx_display_text(point_list[lasv].x + 4, point_list[lasv].y + 4, buf); +} /* * The following routine is used to draw a wireframe represtation of a ship. @@ -154,6 +186,9 @@ void draw_wireframe_ship (struct univ_object *univ) gfx_draw_line (point_list[lasv].x, point_list[lasv].y, univ->location.x > 0 ? 0 : 511, rand255() * 2); } + + if (identify) + identify_ship(univ); } @@ -331,6 +366,9 @@ void draw_solid_ship (struct univ_object *univ) univ->location.x > 0 ? 0 : 511, rand255() * 2, point_list[lasv].z, col); } + + if (identify) + identify_ship(univ); }