update for new progs loader api and the makefile for the option of static

linking
This commit is contained in:
Bill Currie 2002-01-30 17:41:16 +00:00
parent e5e157a804
commit b7cfb95a64
2 changed files with 15 additions and 11 deletions

View file

@ -4,6 +4,7 @@ MAKEDEPS=$(CC) -MM $(CPPFLAGS) $< | sed -e 's/$*\.o:*/$*\.o $@:/g' > $@
CFLAGS+=-Wall -Werror -g -O2
CPPFLAGS+=
#LDFLAGS=-static
LIBS=
vpath %.a
@ -18,7 +19,7 @@ DEP=$(patsubst %.o,%.d,$(OBJ))
all: $(EXE) $(EXE).dat
$(EXE): $(OBJ) $(LIBS)
$(CC) $(LDFLAGS) -o $@ $^ -lQFgamecode -lQFutil
$(CC) $(LDFLAGS) -o $@ $^ -lQFgamecode -lQFutil -lz -lm
$(EXE).dat: progs.src *.qc
qfcc --warn=error --code=debug

View file

@ -57,7 +57,7 @@ int
main ()
{
func_t main_func;
FILE *f;
VFile *f;
int len;
int i;
@ -90,20 +90,23 @@ main ()
progs.no_exec_limit = 1;
progs.progs_name = "qwaq.dat";
f = fopen (progs.progs_name, "rb");
f = Qopen (progs.progs_name, "rb");
if (f) {
fseek (f, 0, SEEK_END);
len = ftell (f);
fseek (f, 0, SEEK_SET);
progs.progs = Hunk_AllocName (len, "qwaq.dat");
fread (progs.progs, 1, len, f);
fclose (f);
Qseek (f, 0, SEEK_END);
len = Qtell (f);
Qseek (f, 0, SEEK_SET);
com_filesize = len;
if (progs.progs)
PR_LoadProgs (&progs, progs.progs_name);
PR_LoadProgsFile (&progs, f, len, 0, 1024 * 1024);
Qclose (f);
}
if (!progs.progs)
Sys_Error ("couldn't load %s\n", "qwaq.dat");
if (!PR_ResolveGlobals (&progs))
PR_Error (&progs, "unable to load %s", progs.progs_name);
PR_LoadStrings (&progs);
PR_LoadDebug (&progs);
PR_Check_Opcodes (&progs);
PR_RelocateBuiltins (&progs);
*progs.edicts = PR_InitEdicts (&progs, MAX_EDICTS);