mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 20:50:42 +00:00
main.c:
allow dumping to work with entities main.qc: more tests
This commit is contained in:
parent
d86ed9a3b9
commit
1e6d69e2be
2 changed files with 26 additions and 0 deletions
|
@ -6,10 +6,16 @@
|
|||
#include <QF/sys.h>
|
||||
#include <QF/zone.h>
|
||||
|
||||
#define MAX_EDICTS 1024
|
||||
|
||||
progs_t progs;
|
||||
void *membase;
|
||||
int memsize = 16*1024*1024;
|
||||
|
||||
edict_t *edicts;
|
||||
int num_edicts;
|
||||
int reserved_edicts;
|
||||
|
||||
void BI_Init (progs_t *progs);
|
||||
|
||||
extern char *type_name[];
|
||||
|
@ -34,6 +40,10 @@ main ()
|
|||
PR_Init ();
|
||||
BI_Init (&progs);
|
||||
|
||||
progs.edicts = &edicts;
|
||||
progs.num_edicts = &num_edicts;
|
||||
progs.reserved_edicts = &reserved_edicts;
|
||||
|
||||
f = fopen ("qwaq.dat", "rb");
|
||||
if (f) {
|
||||
fseek (f, 0, SEEK_END);
|
||||
|
@ -47,6 +57,9 @@ main ()
|
|||
}
|
||||
if (!progs.progs)
|
||||
Sys_Error ("couldn't load %s\n", "qwaq.dat");
|
||||
|
||||
*progs.edicts = PR_InitEdicts (&progs, MAX_EDICTS);
|
||||
|
||||
for (i = 0; i < progs.progs->numstatements; i++)
|
||||
PR_PrintStatement (&progs, &progs.pr_statements[i]);
|
||||
printf ("\n");
|
||||
|
|
|
@ -14,3 +14,16 @@ float () main =
|
|||
s = s + "\n";
|
||||
print (s);
|
||||
};
|
||||
|
||||
float () CheckExistence =
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
void () test =
|
||||
{
|
||||
if (CheckExistence() == 0) {
|
||||
return;
|
||||
}
|
||||
local entity p;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue