From 266bde4477ba5f7b51520cc37f0f1f402e78e046 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 11 Oct 2020 22:45:47 +0100 Subject: [PATCH] Get rid of Bigfloat in JS Signed-off-by: Ian Jackson --- Makefile | 2 +- templates/script.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d489fbd0..f1c90d77 100644 --- a/Makefile +++ b/Makefile @@ -178,7 +178,7 @@ $(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_BINARY) Makefile #---------- typescript ---------- -TS_SRCS= script bigfloat +TS_SRCS= script TS_SRC_FILES= \ webassembly-types/webassembly.d.ts \ templates/otter_wasm.ns.d.ts \ diff --git a/templates/script.ts b/templates/script.ts index c812b67e..2f77cfda 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -59,11 +59,13 @@ type UoRecord = UoDescription & { targets: PieceId[] | null, } +type ZCoord = string; + type PieceInfo = { held : PlayerId | null, cseq : number | null, cseq_updatesvg : number | null, - z : Bigfloat, + z : ZCoord, zg : Generation, pinned: boolean, uos : UoDescription[], @@ -819,7 +821,7 @@ type PieceStateMessage = { svg: string, held: PlayerId, pos: Pos, - z: Bigfloat, + z: ZCoord, zg: Generation, pinned: boolean, uos: UoDescription[], @@ -932,7 +934,7 @@ pieceops.Move = function } pieceops.SetZLevel = function -(piece,p, info: { z: Bigfloat, zg: Generation }) { +(piece,p, info: { z: ZCoord, zg: Generation }) { piece_set_zlevel(piece,p, (oldtop_piece)=>{ let oldtop_p = pieces[oldtop_piece]!; p.z = info.z; -- 2.30.2