File tree 3 files changed +14
-9
lines changed
3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ handlers:
10
10
upload : load81.html
11
11
- url : /static
12
12
static_dir : static
13
+ - url : /examples
14
+ static_dir : examples
13
15
- url : /load81-i686-nacl.nexe
14
16
static_files : load81-i686-nacl.nexe
15
17
upload : load81-i686-nacl.nexe
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- # TODO use the common Makfile instead of duplicating it.
2
+ # TODO use the common Makefile instead of duplicating it.
3
3
set -ex
4
4
5
5
if [ -z $NACL_SDK_ROOT ]
@@ -13,7 +13,8 @@ TOOLCHAIN=$NACL_SDK_ROOT/toolchain/linux_x86_newlib
13
13
NACL_ROOT=$( dirname $( which $0 ) )
14
14
ROOT=$( readlink -f $NACL_ROOT /../..)
15
15
PKGS=" sdl SDL_gfx"
16
- EXAMPLE=asteroids.lua
16
+
17
+ ln -sf $ROOT /examples $NACL_ROOT /examples
17
18
18
19
for HOST in i686-nacl x86_64-nacl
19
20
do
26
27
else
27
28
BFDNAME=elf64-nacl
28
29
fi
29
- cp $ROOT /examples/$EXAMPLE example.lua
30
- $HOST -objcopy -I binary -O $BFDNAME -B $BFDARCH example.lua example.o
31
- rm example.lua
32
30
CFLAGS=" -O2 -Wall -W -D main=load81_main ` pkg-config --cflags $PKGS ` "
33
31
LDFLAGS=" "
34
32
for X in read write open close seek mount; do
35
33
LDFLAGS=" $LDFLAGS -Xlinker --wrap -Xlinker $X "
36
34
done
37
35
LIBS=" ` pkg-config --libs $PKGS ` -llua -lm -lppapi -lppapi_cpp -lnacl-mounts -lstdc++ -lnosys"
38
- SRCS=" $ROOT /load81.c $ROOT /editor.c $ROOT /framebuffer.c nacl.cc example.o "
36
+ SRCS=" $ROOT /load81.c $ROOT /editor.c $ROOT /framebuffer.c nacl.cc"
39
37
$CC $CFLAGS $LDFLAGS $SRCS $LIBS -o load81-$HOST .nexe
40
- rm example.o
41
38
$HOST -strip load81-$HOST .nexe
42
39
done
43
40
Original file line number Diff line number Diff line change 1
- demo_src = 'function draw() background(100, 50, 50) end'
1
+ var initial_script = "examples/asteroids.lua" ;
2
2
3
3
$ ( document ) . ready ( function ( ) {
4
4
var nacl_module = null ;
5
5
var src = null ;
6
6
7
7
function main ( ) {
8
- start_game ( demo_src ) ;
8
+ xhr = new XMLHttpRequest ( ) ;
9
+ xhr . open ( "GET" , initial_script ) ;
10
+ xhr . onload = function ( event ) {
11
+ // TODO check for failure
12
+ start_game ( xhr . responseText ) ;
13
+ }
14
+ xhr . send ( ) ;
9
15
}
10
16
11
17
function switch_screen ( id ) {
You can’t perform that action at this time.
0 commit comments