Giter Club home page Giter Club logo

Comments (2)

DennisSc avatar DennisSc commented on September 24, 2024 1

I get a "division by zero" exception when trying to load a map containing "collection of image" layers, at a point where it calculates something from texture size:

auto texSize = m_chunkArrays.back()->getTextureSize();
tsTileCount.x = texSize.x / tileSize.x; 

(...)
sf::Vector2f tileIndex(idIndex % tsTileCount.x, idIndex / tsTileCount.x);
(the last line causes divByZero)

which is nice - since it then stops at the exact right place to debug. :)

According to my debugger, parsing the "collection of images" layer results in an empty "m_imagePath" in m_tilesets[0], but instead a child element "m_tilesets[0].m_tiles[0]" at this point contains the correct value in "imagepath".

As a workaround, maybe you could export your "collection of images" to an actual image using Tiled, and then use that image as tileset in a regular, tileset-based layer?

from tmxlite.

fallahn avatar fallahn commented on September 24, 2024

To see if this is a bug use your debugger to inspect the tmx::Tileset object and check it has parsed the file properly - ie all the fields contain the correct information such as image file name and tile size. If this isn't loaded properly then it could well be a bug in tmxlite which I'll look into. On the other hand it could be, as this comment suggests, that the SFML example doesn't implement rendering with collection of images tile sets.

from tmxlite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.