From 548127363919060abcae297f68a86bb0c3d77cb4 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 17 Jul 2003 18:27:00 +0000 Subject: [PATCH] start working on plist entity files --- libs/gamecode/engine/pr_parse.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/libs/gamecode/engine/pr_parse.c b/libs/gamecode/engine/pr_parse.c index 4443b1584..8df95f4f1 100644 --- a/libs/gamecode/engine/pr_parse.c +++ b/libs/gamecode/engine/pr_parse.c @@ -48,6 +48,7 @@ static __attribute__ ((unused)) const char rcsid[] = #include "QF/idparse.h" #include "QF/progs.h" #include "QF/qdefs.h" +#include "QF/qfplist.h" #include "QF/qendian.h" #include "QF/quakefs.h" #include "QF/sys.h" @@ -408,9 +409,8 @@ ED_ParseGlobals (progs_t *pr, const char *data) dstring_delete (keyname); } - /* - ED_LoadFromFile + ED_ParseOld The entities are directly placed in the array, rather than allocated with ED_Alloc, because otherwise an error loading the map would have entity @@ -422,8 +422,8 @@ ED_ParseGlobals (progs_t *pr, const char *data) Used for both fresh maps and savegame loads. A fresh map would also need to call ED_CallSpawnFunctions () to let the objects initialize themselves. */ -void -ED_LoadFromFile (progs_t *pr, const char *data) +static void +ED_ParseOld (progs_t *pr, const char *data) { edict_t *ent = NULL; int inhibit = 0; @@ -483,3 +483,17 @@ ED_LoadFromFile (progs_t *pr, const char *data) Sys_DPrintf ("%i entities inhibited\n", inhibit); } + +void +ED_LoadFromFile (progs_t *pr, const char *data) +{ + if (*data == '{') { + // oldstyle entity data + ED_ParseOld (pr, data); + } else if (*data == '(') { + // new style (plist) entity data + } else { + plitem_t *plist = PL_GetPropertyList (data); + plist = plist; + } +}