diff --git a/tools/qwaq/Makefile b/tools/qwaq/Makefile index d98340c5b..3ca52012a 100644 --- a/tools/qwaq/Makefile +++ b/tools/qwaq/Makefile @@ -21,7 +21,7 @@ all: $(EXE) $(EXE).dat $(EXE): $(OBJ) $(LIBS) $(CC) $(LDFLAGS) -o $@ $^ ../../d.o/libs/gamecode/engine/.libs/libQFgamecode.a -lQFutil -lz -lm -$(EXE).dat: progs.src *.qc +$(EXE).dat: progs.src *.qc ../../cs-code/object.r *.r qfcc --warn=error --code=debug clean: diff --git a/tools/qwaq/builtins.c b/tools/qwaq/builtins.c index fcdf99db4..3e69dc980 100644 --- a/tools/qwaq/builtins.c +++ b/tools/qwaq/builtins.c @@ -174,9 +174,6 @@ bi_printf (progs_t *pr) void BI_Init (progs_t *progs) { - progs->builtins = 0; - progs->numbuiltins = 0; - PR_AddBuiltin (progs, "print", bi_print, 1); PR_AddBuiltin (progs, "GarbageCollect", bi_GarbageCollect, 2); PR_AddBuiltin (progs, "errno", bi_errno, 3); diff --git a/tools/qwaq/main.c b/tools/qwaq/main.c index 321511f56..cc97fc1f2 100644 --- a/tools/qwaq/main.c +++ b/tools/qwaq/main.c @@ -81,6 +81,7 @@ main () COM_Filesystem_Init_Cvars (); COM_Filesystem_Init (); PR_Init (); + PR_Obj_Progs_Init (&progs); BI_Init (&progs); progs.edicts = &edicts; @@ -107,6 +108,7 @@ main () PR_LoadDebug (&progs); PR_Check_Opcodes (&progs); PR_RelocateBuiltins (&progs); + PR_InitRuntime (&progs); *progs.edicts = PR_InitEdicts (&progs, MAX_EDICTS); for (i = 0; i < progs.progs->numstatements; i++) { diff --git a/tools/qwaq/main.qc b/tools/qwaq/main.qc index 1d743d2f1..67077e338 100644 --- a/tools/qwaq/main.qc +++ b/tools/qwaq/main.qc @@ -3,12 +3,12 @@ #define NIT_TELEPORTER 131072 //CH Teleporter #define PC_ENGINEER_TF_ITEMS NIT_TESLA | NIT_SECURITY_CAMERA | NIT_TELEPORTER -struct foo = { +struct foo_struct = { integer result; string buffer; }; -void (foo bar) eek; +void (foo_struct bar) eek; float (float a, float b) boing; string [6] dot = { @@ -56,5 +56,8 @@ float () main = close (handle); for (handle = 0; handle < 6; handle++) print (dot[handle] + "\n"); + + local id ffoo = [[Foo alloc] init]; + [ffoo run]; return 0; }; diff --git a/tools/qwaq/progs.src b/tools/qwaq/progs.src index eb2c0b2da..75bbd7b04 100644 --- a/tools/qwaq/progs.src +++ b/tools/qwaq/progs.src @@ -2,4 +2,6 @@ qwaq.dat defs.qc +../../cs-code/object.r +test.r main.qc diff --git a/tools/qwaq/test.r b/tools/qwaq/test.r new file mode 100644 index 000000000..ad343c37e --- /dev/null +++ b/tools/qwaq/test.r @@ -0,0 +1,14 @@ +@interface Foo : Object +-run; +@end + + +@implementation Foo + +-run +{ + print ("Hello world\n"); + printf ("%i\n", self); +} + +@end