diff --git a/src/sagotmx/tmx_struct.h b/src/sagotmx/tmx_struct.h index 39cbff3..bd9a02d 100644 --- a/src/sagotmx/tmx_struct.h +++ b/src/sagotmx/tmx_struct.h @@ -442,7 +442,7 @@ inline void xml_add_tileset(std::iostream& io, const TileMap& m, size_t tile_set } io << ">\n"; if (ts.image.source.length() > 0) { - io << "\n"; + io << "\n"; } io << "\n"; } @@ -556,6 +556,10 @@ inline void getTextureLocationFromGid(const TileMap& tm, int gid, std::string* i if (imageFile) { *imageFile = ts->image.source; } + if (ts->image.width == 0) { + std::cerr << "image: " << ts->image.source << " (" << ts->image.width << ", " << ts->image.height << ") is not good\n"; + abort(); + } if (x) { *x = ( gid *ts->tilewidth)%ts->image.width; }