allow dumping to work with entities
main.qc:
	more tests
This commit is contained in:
Bill Currie 2001-06-05 23:53:55 +00:00
parent d86ed9a3b9
commit 1e6d69e2be
2 changed files with 26 additions and 0 deletions

View file

@ -6,10 +6,16 @@
#include <QF/sys.h> #include <QF/sys.h>
#include <QF/zone.h> #include <QF/zone.h>
#define MAX_EDICTS 1024
progs_t progs; progs_t progs;
void *membase; void *membase;
int memsize = 16*1024*1024; int memsize = 16*1024*1024;
edict_t *edicts;
int num_edicts;
int reserved_edicts;
void BI_Init (progs_t *progs); void BI_Init (progs_t *progs);
extern char *type_name[]; extern char *type_name[];
@ -34,6 +40,10 @@ main ()
PR_Init (); PR_Init ();
BI_Init (&progs); BI_Init (&progs);
progs.edicts = &edicts;
progs.num_edicts = &num_edicts;
progs.reserved_edicts = &reserved_edicts;
f = fopen ("qwaq.dat", "rb"); f = fopen ("qwaq.dat", "rb");
if (f) { if (f) {
fseek (f, 0, SEEK_END); fseek (f, 0, SEEK_END);
@ -47,6 +57,9 @@ main ()
} }
if (!progs.progs) if (!progs.progs)
Sys_Error ("couldn't load %s\n", "qwaq.dat"); Sys_Error ("couldn't load %s\n", "qwaq.dat");
*progs.edicts = PR_InitEdicts (&progs, MAX_EDICTS);
for (i = 0; i < progs.progs->numstatements; i++) for (i = 0; i < progs.progs->numstatements; i++)
PR_PrintStatement (&progs, &progs.pr_statements[i]); PR_PrintStatement (&progs, &progs.pr_statements[i]);
printf ("\n"); printf ("\n");

View file

@ -14,3 +14,16 @@ float () main =
s = s + "\n"; s = s + "\n";
print (s); print (s);
}; };
float () CheckExistence =
{
return 1;
};
void () test =
{
if (CheckExistence() == 0) {
return;
}
local entity p;
};