summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/web_main.c5
-rw-r--r--web/web_opts.c7
-rw-r--r--web/web_opts.h2
3 files changed, 10 insertions, 4 deletions
diff --git a/web/web_main.c b/web/web_main.c
index 50dd318..f1a692c 100644
--- a/web/web_main.c
+++ b/web/web_main.c
@@ -16,10 +16,7 @@ void init()
srand(time(NULL));
init_board();
svg_draw_board();
-
- EM_ASM(readOpts());
- EM_ASM({updateDelay($0)}, delay_ms);
- EM_ASM({updateStdev($0)}, horizontal_stdev);
+ opts_init();
handle_next();
}
diff --git a/web/web_opts.c b/web/web_opts.c
index 1188232..0f37bba 100644
--- a/web/web_opts.c
+++ b/web/web_opts.c
@@ -8,6 +8,13 @@
int delay_ms = 1000;
+void opts_init()
+{
+ EM_ASM(readOpts());
+ EM_ASM({updateDelay($0)}, delay_ms);
+ EM_ASM({updateStdev($0)}, horizontal_stdev);
+}
+
EMSCRIPTEN_KEEPALIVE
void set_delay(int delay)
{
diff --git a/web/web_opts.h b/web/web_opts.h
index e016373..f66ac37 100644
--- a/web/web_opts.h
+++ b/web/web_opts.h
@@ -3,6 +3,8 @@
extern int delay_ms;
+void opts_init();
+
void set_delay(int delay);
void set_stdev(float stdev);