summaryrefslogtreecommitdiff
path: root/web/dartboat_wasm.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-01 09:43:27 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-01 09:46:51 -0700
commitf9117e7c9b5b6602e4eb55ee48815882a7085782 (patch)
tree5605e10fff447eb8128e664f370f32c92e6139ff /web/dartboat_wasm.c
parent7cb5abb07968641737f943144368a2e541d05e40 (diff)
downloaddartboat-f9117e7c9b5b6602e4eb55ee48815882a7085782.tar.gz
dartboat-f9117e7c9b5b6602e4eb55ee48815882a7085782.tar.xz
make name consistent; minor file organisation
Diffstat (limited to 'web/dartboat_wasm.c')
-rw-r--r--web/dartboat_wasm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c
index 21d13fd..b4d232a 100644
--- a/web/dartboat_wasm.c
+++ b/web/dartboat_wasm.c
@@ -1,3 +1,5 @@
+#include "svg.h"
+
#include "checkouts.h"
#include "comp.h"
@@ -157,7 +159,6 @@ EMSCRIPTEN_KEEPALIVE void update_user_rem_from_pts(int pts)
update_player_rem(state->active_player, state->active_leg->rem - pts);
}
-void draw_point(double, double);
EMSCRIPTEN_KEEPALIVE void draw_boat_throwing(int pts, char *str, double x, double y)
{
char pts_str[10];
@@ -167,7 +168,7 @@ EMSCRIPTEN_KEEPALIVE void draw_boat_throwing(int pts, char *str, double x, doubl
state->legs[1]->visits[state->legs[1]->n_visits-2].rem :
state->legs[1]->start;
- draw_point(x, y);
+ svg_draw_point(x, y);
update_player_rem(2, rem - pts);
EM_ASM({setPromptInput($0)}, pts_str);
EM_ASM({promptMsgR($0)}, str);
@@ -461,12 +462,11 @@ EMSCRIPTEN_KEEPALIVE void set_stdev(float stdev)
horizontal_stdev = vertical_stdev = stdev;
}
-void draw_board();
void init_boat()
{
srand(time(NULL));
init_board();
- draw_board();
+ svg_draw_board();
EM_ASM(readOpts());
EM_ASM({updateDelay($0)}, delay_ms);