Compare commits

..

No commits in common. "63c56e4b9d9b61d288f0c000f4e117e3303d49de" and "447896b56e86db81a2f1d01b267681884f18aeab" have entirely different histories.

3 changed files with 7 additions and 14 deletions

View file

@ -1,7 +1,5 @@
path:"../myou-engine/libs/packages/" path:"../myou-engine/libs/packages/"
threads:on
gc:arc
out:"build/game" out:"build/game"
@ -37,7 +35,6 @@ out:"build/game"
@if emscripten: @if emscripten:
passL:"-o build/web/game.js" passL:"-o build/web/game.js"
passC:"-DGLFW_KEYMAP"
d:opengl_es d:opengl_es
noMain:on noMain:on
nimcache:"tmp/emscripten" nimcache:"tmp/emscripten"

View file

@ -3,7 +3,6 @@
"""Use instead of `python3 -m http.server` when you need CORS and SharedArrayBuffer""" """Use instead of `python3 -m http.server` when you need CORS and SharedArrayBuffer"""
from http.server import HTTPServer, SimpleHTTPRequestHandler from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys
class CORSRequestHandler(SimpleHTTPRequestHandler): class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self): def end_headers(self):
@ -13,8 +12,5 @@ class CORSRequestHandler(SimpleHTTPRequestHandler):
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate') self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
return super(CORSRequestHandler, self).end_headers() return super(CORSRequestHandler, self).end_headers()
port = 8003 httpd = HTTPServer(('', 8003), CORSRequestHandler)
if len(sys.argv) > 1:
port = int(sys.argv[1])
httpd = HTTPServer(('', port), CORSRequestHandler)
httpd.serve_forever() httpd.serve_forever()

12
scripts/watch.sh Executable file → Normal file
View file

@ -1,4 +1,4 @@
#!/bin/sh
# TODO: port this to nimscript # TODO: port this to nimscript
cd "$(dirname $0)/.." cd "$(dirname $0)/.."
@ -6,9 +6,9 @@ cd "$(dirname $0)/.."
OUT_NAME=game OUT_NAME=game
MAIN_FILE=src/main.nim MAIN_FILE=src/main.nim
MAIN_FILE_NAME=main MAIN_FILE_NAME=main
JSON="$HOME/.cache/nimskull/${MAIN_FILE_NAME}_d/$OUT_NAME.json" JSON="$HOME/.cache/nimskull/$MAIN_FILE_NAME_d/$OUT_NAME.json"
function build(){ function build(){
$NIM c "$@" "$MAIN_FILE" && (pkill -9 game; build/game &) $NIM c "$MAIN_FILE" && (pkill -9 game; build/game &)
} }
function file_list(){ function file_list(){
if [ -e $JSON ]; then if [ -e $JSON ]; then
@ -17,8 +17,8 @@ function file_list(){
find -iname "*.nim" find -iname "*.nim"
find -iname "*.blend" find -iname "*.blend"
} }
# for p in $(file_list);do echo $p;done for p in $(file_list);do echo $p;done
build "$@" build
while inotifywait -e modify $(file_list) ;do while inotifywait -e modify $(file_list) ;do
build "$@" build
done done