Skip to content

Commit a30d33b

Browse files
committed
tilemap: use actual tileset size instead of level's tileset size
1 parent 515fc70 commit a30d33b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Qor/TileMap.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ void TileBank :: from_xml(
240240
)
241241
);
242242

243-
auto image_size = uvec2(
244-
boost::lexical_cast<int>(safe_ptr(
245-
image_node->first_attribute("width"))->value()),
246-
boost::lexical_cast<int>(safe_ptr(
247-
image_node->first_attribute("height"))->value())
248-
);
243+
//auto image_size = uvec2(
244+
// boost::lexical_cast<int>(safe_ptr(
245+
// image_node->first_attribute("width"))->value()),
246+
// boost::lexical_cast<int>(safe_ptr(
247+
// image_node->first_attribute("height"))->value())
248+
//);
249249

250250
size_t offset = boost::lexical_cast<size_t>(safe_ptr(
251251
xml->first_attribute("firstgid"))->value()
@@ -262,6 +262,8 @@ void TileBank :: from_xml(
262262

263263
//LOGf("tileset texture: %s", tex_fn);
264264
shared_ptr<ITexture> texture = resources->cache_as<Material>(tex_fn);
265+
266+
auto image_size = texture->size();
265267

266268
const auto num_tiles = uvec2(
267269
image_size.x / m_TileSize.x,

0 commit comments

Comments
 (0)