summaryrefslogtreecommitdiff
path: root/meme/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-05-11 19:59:48 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-05-11 19:59:48 (GMT)
commitd5001b879aef0f5f946e4bc29c8a406adfe0d68e (patch)
tree31aa234e7730266629fa620a6ab14a9b8e6786f4 /meme/gui.c
parent49ffe0b41738d365d01f09f230955f0f404784a8 (diff)
downloadmisc-d5001b879aef0f5f946e4bc29c8a406adfe0d68e.zip
misc-d5001b879aef0f5f946e4bc29c8a406adfe0d68e.tar.gz
misc-d5001b879aef0f5f946e4bc29c8a406adfe0d68e.tar.bz2
meme/gui.c: output "B" marker as "A" on marker_next
This lets log2mark.pl keep track of the marker change.
Diffstat (limited to 'meme/gui.c')
-rw-r--r--meme/gui.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/meme/gui.c b/meme/gui.c
index c557492..03660d3 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -836,11 +836,19 @@ static bool select_marker(const struct vertex *v)
static void print_marker(FILE *file)
{
+ const struct vertex *mark;
double dx, dy, dz;
+ char name;
- fprintf(file, "%c:\tX %.3f\tY %.3f\tZ %.3f\n",
- curr_mark ? 'B' : 'A',
- cursor->x/1000.0, cursor->y/1000.0, cursor->z/1000.0);
+ if (curr_mark) {
+ mark = mark_b;
+ name = 'B';
+ } else {
+ mark = mark_a;
+ name = 'A';
+ }
+ fprintf(file, "%c:\tX %.3f\tY %.3f\tZ %.3f\n", name,
+ mark->x / 1000.0, mark->y / 1000.0, mark->z / 1000.0);
if (!mark_a || !mark_b)
return;
@@ -892,11 +900,15 @@ static void clear_markers(void)
}
-static void marker_next(void)
+static void marker_next(const char *logfile)
{
mark_a = mark_b ? mark_b : cursor;
mark_b = 0;
curr_mark = 0;
+
+ print_marker(stderr);
+ if (logfile)
+ log_marker(logfile);
}
@@ -1366,7 +1378,7 @@ static bool event_loop(SDL_Surface **surf, const char *logfile,
case SDLK_m:
show_mesh = !show_mesh;
case SDLK_n:
- marker_next();
+ marker_next(logfile);
return 0;
case SDLK_o:
show_overlay = !show_overlay;