summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/dartboat_wasm.c8
-rw-r--r--web/static/dartboat.js6
2 files changed, 5 insertions, 9 deletions
diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c
index 83e2a42..26018fa 100644
--- a/web/dartboat_wasm.c
+++ b/web/dartboat_wasm.c
@@ -449,12 +449,10 @@ EMSCRIPTEN_KEEPALIVE void set_delay(int delay)
delay_ms = delay;
}
-EMSCRIPTEN_KEEPALIVE void set_stdev(float hstdev, float vstdev)
+EMSCRIPTEN_KEEPALIVE void set_stdev(float stdev)
{
- if (!isnan(hstdev))
- horizontal_stdev = hstdev;
- if (!isnan(vstdev))
- vertical_stdev = vstdev;
+ if (!isnan(stdev))
+ horizontal_stdev = vertical_stdev = stdev;
}
void init_boat()
diff --git a/web/static/dartboat.js b/web/static/dartboat.js
index 23c7a8d..a97e8bb 100644
--- a/web/static/dartboat.js
+++ b/web/static/dartboat.js
@@ -147,10 +147,8 @@ function updateStdev(val) {
function setOpt(opt, val, update_opts = true) {
if (update_opts) localStorage.setItem(`dartboat_${opt}`, val);
- if (opt === 'delay')
- _set_delay(Number(val));
- else if (opt === 'stdev')
- _set_stdev(Number(val), Number(val));
+ if (opt === 'delay' || opt === 'stdev')
+ Module[`_set_${opt}`](Number(val));
}
function readOpts() {