cepheid

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

commit cf1dc4c2d23be0ffabbe11e54124331f25fb255b
parent 6b57332aed2b3a7e3419509a43d36e8837bc8d1c
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 12 Sep 2022 17:26:04 +0100

strkmdist -> strkm, strlightdist -> strly

Diffstat:
Msrc/main.h | 4++--
Msrc/str.c | 4++--
Msrc/ui/bodies.c | 4++--
Msrc/ui/main.c | 4++--
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main.h b/src/main.h @@ -27,8 +27,8 @@ char * sfprintf(char *fmt, ...); /* return string allocated for current frame */ char * vsmprintf(char *fmt, va_list args); char * smprintf(char *fmt, ...); /* return allocated string */ char * nstrdup(char *str); /* NULL-safe */ -char * strkmdist(float km); -char * strlightdist(float km); +char * strkm(float km); +char * strly(float km); int streq(char *s1, char *s2); /* NULL-safe, no `== 0` required */ int strprefix(char *str, char *prefix); char * strsuffix(char *str, char *suffix); diff --git a/src/str.c b/src/str.c @@ -94,7 +94,7 @@ nstrdup(char *str) { } char * -strkmdist(float km) { +strkm(float km) { if (km > GIGA) return sfprintf("%.2fb km", km / GIGA); else if (km > MEGA) @@ -106,7 +106,7 @@ strkmdist(float km) { } char * -strlightdist(float km) { +strly(float km) { float ls = km * KILO / C_MS; if (ls > YEAR_LEN) diff --git a/src/ui/bodies.c b/src/ui/bodies.c @@ -164,8 +164,8 @@ ui_draw_view_bodies(void) { if (v->sel->type != BODY_COMET) { ui_print(x, y += FONT_SIZE, col_info, "Orbital distance:"); ui_print(x + INFOBOX_W / 2, y, col_fg, - "%s (%s)", strkmdist(v->sel->dist), - strlightdist(v->sel->dist)); + "%s (%s)", strkm(v->sel->dist), + strly(v->sel->dist)); } ui_draw_border_around(EXPLODE_RECT(v->mins), 1); diff --git a/src/ui/main.c b/src/ui/main.c @@ -252,7 +252,7 @@ ui_draw_view_main(void) { ruler = kmtopx(view_main.ruler.origin); ui_draw_line_v(ruler, mouse, 1, col_info); dist = ui_vectordist(view_main.ruler.origin, mousekm); - ui_print(mouse.x + PAD, mouse.y - PAD, col_info, "%s (%s)", strkmdist(dist), strlightdist(dist)); + ui_print(mouse.x + PAD, mouse.y - PAD, col_info, "%s (%s)", strkm(dist), strly(dist)); } /* scale */ @@ -268,7 +268,7 @@ ui_draw_view_main(void) { dist = view_main.scale.w * view_main.kmperpx; ui_print(view_main.scale.x + view_main.scale.w + FONT_SIZE / 3, GetScreenHeight() - view_main.scale.y - FONT_SIZE / 2, - col_info, "%s", strkmdist(dist)); + col_info, "%s", strkm(dist)); /* infobox */ ui_draw_tabbed_window(EXPLODE_RECT(view_main.infobox.geom.rect),