From bcda96a4452b8a6a10482318fefac94b1e76d27f Mon Sep 17 00:00:00 2001 From: Bill Currie <bill@taniwha.org> Date: Wed, 12 Sep 2012 08:33:44 +0900 Subject: [PATCH] Report the source line of the entity in messages. For now, just when PrintEntity is used to print the message, but having the first line of the entity sure makes life easier. --- tools/qfbsp/include/map.h | 1 + tools/qfbsp/source/map.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tools/qfbsp/include/map.h b/tools/qfbsp/include/map.h index f95691a7e..1e6c18f29 100644 --- a/tools/qfbsp/include/map.h +++ b/tools/qfbsp/include/map.h @@ -51,6 +51,7 @@ typedef struct epair_s { /** In-memory representation of an entity as parsed from the map script. */ typedef struct { + int line; ///< Map line of entity start (for messages) vec3_t origin; ///< Location of this entity in world-space. mbrush_t *brushes; ///< Nul terminated list of brushes. epair_t *epairs; ///< Nul terminated list of key=value pairs. diff --git a/tools/qfbsp/source/map.c b/tools/qfbsp/source/map.c index 3ee844f10..dcf5e82e1 100644 --- a/tools/qfbsp/source/map.c +++ b/tools/qfbsp/source/map.c @@ -465,6 +465,7 @@ ParseEntity (void) mapent = &entities[num_entities]; num_entities++; memset (mapent, 0, sizeof (entity_t)); + mapent->line = map_script->line; do { if (!Script_GetToken (map_script, true)) @@ -552,6 +553,7 @@ PrintEntity (const entity_t *ent) { const epair_t *ep; + printf ("%20s : %d\n", "map source line", ent->line); for (ep = ent->epairs; ep; ep = ep->next) printf ("%20s : %s\n", ep->key, ep->value); }