From f6dc556af51bc1d7ea8500cbb0a046696c863288 Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sat, 11 Jun 2011 22:35:07 -0700 Subject: [PATCH] skip extraneous elements in reading tile row --- src/area.cpp | 7 +++---- src/babysfirst/world.conf | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/area.cpp b/src/area.cpp index 53df572..9740a9d 100644 --- a/src/area.cpp +++ b/src/area.cpp @@ -17,9 +17,8 @@ /* NOTE: Tileset tiles start counting their positions from 0, while layer tiles start counting from 1. I can't imagine why the author did this, but we - have to take it into account. Also, your current code is incapable of - rendering any piece of bigbaby. Try it and see. - + have to take it into account. +*/ Area::Area(Resourcer* rc, Entity* player, const std::string descriptor) : rc(rc), player(player), descriptor(descriptor) @@ -377,7 +376,7 @@ bool Area::processLayerData(xmlNode* node) Tile* t = new Tile; t->type = &tilesets[0].defaults[gid]; // XXX can only access first tileset row.push_back(t); - if (i % dim.x == 0) { + if (row.size() % dim.x == 0) { grid.push_back(row); row.clear(); } diff --git a/src/babysfirst/world.conf b/src/babysfirst/world.conf index e8ffdb3..93b32da 100644 --- a/src/babysfirst/world.conf +++ b/src/babysfirst/world.conf @@ -7,7 +7,7 @@ Michael D. Reiley local - + -- 2.11.4.GIT