cepheid

An Aurora 4X clone
Log | Files | Refs | README

commit 8cd537cf8b09e05ab7eb7eac9765ce49828909ec
parent 750ed049e5a3e77712389fc848ea5bd29ce03997
Author: hhvn <dev@hhvn.uk>
Date:   Fri, 19 Aug 2022 16:08:47 +0100

Draw tails proportional to comet size

Diffstat:
Msrc/ui.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ui.c b/src/ui.c @@ -660,8 +660,10 @@ ui_draw_body(Body *body) { DrawCircle(body->pxloc.x, body->pxloc.y, w, body_col[body->type]); if (body->type == BODY_COMET && view_main.infobox.comettail.val && 10 * view_main.kmperpx < body->curdist) - DrawLineV(body->pxloc, sys_vectorize_around(body->pxloc, - (Polar){11, body->inward ? body->theta : body->theta + 180}), COL_COMET); + DrawLineEx(body->pxloc, sys_vectorize_around(body->pxloc, + (Polar){w * 11 / min_body_rad[BODY_COMET], + body->inward ? body->theta : body->theta + 180}), + w / min_body_rad[BODY_COMET], COL_COMET); if (ui_should_draw_body(body, 0)) ui_print(body->pxloc.x + w + 2, body->pxloc.y + w + 2, COL_FG, "%s", body->name);