From a724173b76d5c2d16c489d45a38c1b4d8b101565 Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 9 Oct 2020 23:27:29 +0200 Subject: [PATCH] tweaking... --- specific/README.md | 2 +- specific/joy2laser.c | 9 +++++---- specific/laserblast.c | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/specific/README.md b/specific/README.md index 158fb0f..703ca01 100644 --- a/specific/README.md +++ b/specific/README.md @@ -1,4 +1,4 @@ # joy2laser -Kluge intuité pendant [Sonoptic 2020](https://sonoptic.net). +Kluge intuité pendant [Sonoptic 2020](http://sonoptic.net). diff --git a/specific/joy2laser.c b/specific/joy2laser.c index 4ae1daa..31d0f92 100644 --- a/specific/joy2laser.c +++ b/specific/joy2laser.c @@ -44,7 +44,7 @@ blast_addpoint(fx-SZ, fy-SZ, 0); blast_flush(0); -return -1; +return 0; } /* ------------------------------------------------------------------- */ int xy_handler(const char *path, const char *types, lo_arg ** argv, @@ -54,7 +54,7 @@ int val_x, val_y; int foo; #if DEBUG_LEVEL -fprintf(stderr, "%s ( %s %s %d )\n", __func__, path, types, argc); +fprintf(stderr, ">>> %s ( %s %s %d )\n", __func__, path, types, argc); #endif val_x = argv[0]->i; val_y = argv[1]->i; @@ -80,7 +80,7 @@ return 0; /* ------------------------------------------------------------------- */ int main(int argc, char *argv[]) { -char *local_port = LOCAL_PORT; +char *local_port = LOCAL_PORT; char *remote_host = REMOTE_HOST; char *remote_port = REMOTE_PORT; @@ -89,7 +89,7 @@ lo_server_thread st; long starttime; /* parsing command line options */ -while ((opt = getopt(argc, argv, "hp:vL:S:")) != -1) { +while ((opt = getopt(argc, argv, "hp:vL:S:R:P:")) != -1) { switch (opt) { case 'h': if (help(0)) exit(1); break; case 'p': local_port = optarg; break; @@ -107,6 +107,7 @@ if (verbosity) { fprintf(stderr, "local port : %s\n", local_port); fprintf(stderr, "scene : %d\n", scenenumber); fprintf(stderr, "laser : %d\n", lasernumber); + fprintf(stderr, "remote : %s %s\n", remote_host, remote_port); } foo = blast_init(remote_host, remote_port, scenenumber, lasernumber); diff --git a/specific/laserblast.c b/specific/laserblast.c index cbeb536..9bb6f65 100644 --- a/specific/laserblast.c +++ b/specific/laserblast.c @@ -59,7 +59,7 @@ int blast_addpoint(float x, float y, long col) char buff[100]; int foo, sz; -sz = sprintf(buff, "(%f, %f, %ld),", x, y, col); +sz = sprintf(buff, "(%.2f, %.2f, %ld),", x, y, col); if (verbosity) fprintf(stderr, "%s --> %s\n", __func__, buff); @@ -80,7 +80,8 @@ int blast_flush(void) int foo; char buffer[100]; -big_buffer[curpos-1] = ']'; big_buffer[curpos] = '\0'; +/* we have to kill the last ',' in the big buff before send */ +big_buffer[curpos-1] = ']'; big_buffer[curpos] = '\0'; if (verbosity) fprintf(stderr, "BLAST %s\n", big_buffer);