From e7920db9a2ffac4c6e9d656412ecb2918f0a875f Mon Sep 17 00:00:00 2001 From: michaelmcallister Date: Thu, 25 Feb 2021 22:00:18 +1100 Subject: [PATCH] Add Makefile to help build wasm target. --- .gitignore | 3 +++ Makefile | 9 +++++++++ html/index.html | 16 ++++++++++++++++ main.go | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 html/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef30ed6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +html/*.wasm +html/*.js \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..09b11fa --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: wasm +wasm: + rm -f ./html/*.js ./html/*.wasm + cp $$(go env GOROOT)/misc/wasm/wasm_exec.js ./html/wasm_exec.js + GOOS=js GOARCH=wasm go build -o ./html/main.wasm . + +.PHONY: native +native: + go build -o ./build/doomfire . \ No newline at end of file diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..ea95eaa --- /dev/null +++ b/html/index.html @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/main.go b/main.go index ab200fa..f5941cd 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,7 @@ func (d *Doom) Draw(screen *ebiten.Image) { } // Layout takes the outside size (e.g., the window size) and returns the (logical) screen size. -func (d *Doom) Layout(outsideWidth, outsideHeight int) (int, int) { +func (d *Doom) Layout(_, _ int) (int, int) { return d.width, d.height }