mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
need to do relocs separately from ddef creation due to pr_globals needing
to be allocated first
This commit is contained in:
parent
e8a9060219
commit
f748b6582a
1 changed files with 10 additions and 5 deletions
|
@ -363,6 +363,16 @@ convert_qfo (void)
|
|||
pr.pr_fielddefs[progs.numfielddefs++] = ddef;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
progs.numglobals = qfo->data_size;
|
||||
pr.globals_size = progs.numglobals + num_locals + num_externs;
|
||||
pr.pr_globals = calloc (pr.globals_size, sizeof (pr_type_t));
|
||||
memcpy (pr.pr_globals, qfo->data, qfo->data_size * sizeof (pr_type_t));
|
||||
|
||||
for (i = 0; i < qfo->num_defs; i++) {
|
||||
qfo_def_t *def = defs + i;
|
||||
|
||||
for (j = 0; j < def->num_relocs; j++) {
|
||||
qfo_reloc_t *reloc = qfo->relocs + def->relocs + j;
|
||||
switch ((reloc_type)reloc->type) {
|
||||
|
@ -406,11 +416,6 @@ convert_qfo (void)
|
|||
}
|
||||
}
|
||||
|
||||
progs.numglobals = qfo->data_size;
|
||||
pr.globals_size = progs.numglobals + num_locals + num_externs;
|
||||
pr.pr_globals = calloc (pr.globals_size, sizeof (pr_type_t));
|
||||
memcpy (pr.pr_globals, qfo->data, qfo->data_size * sizeof (pr_type_t));
|
||||
|
||||
pr.pr_edict_size = progs.entityfields * 4;
|
||||
|
||||
pr.linenos = qfo->lines;
|
||||
|
|
Loading…
Reference in a new issue