aboutsummaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-06-08 09:48:05 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-06-08 09:48:05 +0000
commit99e4780dce5c8f4aa0fbd8dbef936d320cd39b93 (patch)
tree47214f5d830be947ba5ad32d8b352a15e487c2a2 /src/game.c
parenta8105e663793e0e9bab7aa5f8eb1d805e7d61077 (diff)
Text comments for rooms
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@83 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index 56d6266..0834dfb 100644
--- a/src/game.c
+++ b/src/game.c
@@ -84,6 +84,7 @@ static Room *room_load(int rx, int ry, int rz, ModelContext *models, RenderConte
r->rx = rx;
r->ry = ry;
r->rz = rz;
+ r->comment = NULL;
while ( !feof(fh) ) {
@@ -119,6 +120,8 @@ static Room *room_load(int rx, int ry, int rz, ModelContext *models, RenderConte
r->num_lights++;
} else if ( sscanf(line+i, "%f %f %f", &x, &y, &z) == 3 ) {
room_add_object(r, models, line, x, y, z, OBJ_NONE, render);
+ } else if ( strcmp(line, "comment") == 0 ) {
+ r->comment = strdup(line+i);
}
}
@@ -155,6 +158,7 @@ static void game_delete_room(Game *game, int idx) {
free(room->objects[i]);
}
free(room->objects);
+ free(room->comment);
free(room);
/* Shift the list up one place */