mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Cleaner handling of zone_size/zone.
This commit is contained in:
parent
82809eb856
commit
61185813fa
1 changed files with 8 additions and 3 deletions
|
@ -197,8 +197,12 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
|
|||
|
||||
if (pr->edicts)
|
||||
*pr->edicts = (edict_t *)((byte *) pr->progs + pr->progs_size);
|
||||
pr->zone = (memzone_t *)((byte *) pr->progs + pr->progs_size
|
||||
+ pr->pr_edictareasize);
|
||||
if (pr->zone_size) {
|
||||
//FIXME zone_size needs to be at least as big as memzone_t, but
|
||||
//memzone_t is opaque so its size is unknown
|
||||
pr->zone = (memzone_t *)((byte *) pr->progs + pr->progs_size
|
||||
+ pr->pr_edictareasize);
|
||||
}
|
||||
|
||||
pr->pr_functions =
|
||||
(dfunction_t *) (base + pr->progs->ofs_functions);
|
||||
|
@ -212,8 +216,9 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
|
|||
|
||||
pr->globals_size = (pr_type_t*)((byte *) pr->zone + pr->zone_size)
|
||||
- pr->pr_globals;
|
||||
if (pr->zone_size)
|
||||
if (pr->zone) {
|
||||
PR_Zone_Init (pr);
|
||||
}
|
||||
|
||||
if (pr->function_hash) {
|
||||
Hash_FlushTable (pr->function_hash);
|
||||
|
|
Loading…
Reference in a new issue