Live Reloading of Worlds and Fixes
The new multi-map world view that was released with last week's development snapshot now automatically refreshes when loading, unloading or changing a world file. A number of fixes have been made as well, the biggest being the proper flipping and rotating of multi-layer stamps.
If anybody had already updated to yesterday's 2018.05.31 build, please update again because unfortunately I had introduced a crash when rotating the current stamp.
Changelog
Thorbjørn Lindeijer
- Worlds: Report errors and refresh on load/unload
- Worlds: Automatically reload world files when they change
- Worlds: Only jump to another map with left mouse button
- Fixed terrain brush issue on staggered isometric maps (#1951)
- Fixed flip and rotate actions for multi-layer stamps (#282)
- Fixed handling of tile drawing offset in Tile Collision Editor (#1955)
- Fixed objects to stay selected when moving them between groups
- Qbs: Fixed issue with building the snapshot for Windows XP
Code Maintenance
For those who are interested I'm going to share a bit about some under the hood changes I recently made!
Range-based For Loops
While working to fix some issues with the recently introduced multi-layer tile stamps, I realized that I needed a convenient way to iterate over all the tile layers of a map. I already had written a LayerIterator
, but I really wanted to be able to use the range-based for loops that were introduced with C++11.
To enable this, I extended the LayerIterator
class with some standard operators for iterators and added a LayerIteratorHelper
class, which returns the begin and end of the range. Based on that change, we can now iterate tile layers as follows without allocating a temporary list:
for (Layer *layer : map->tileLayers()) { auto tileLayer = static_cast<TileLayer*>(layer); // do something with the tile layer }
I don't like the need for the static_cast
, and maybe in the future I will use templates to get rid of that. But it may be tricky, because the LayerIterator
can filter on multiple layer types.
General Modernizations
This week I also replaced QScopedPointer with std::unique_ptr, and last week I've replaced Qt's foreach macro with range-based for loops everywhere. Also, all connections made between objects are now using the new type-safe syntax instead of the previously string-based API that could not report errors at compile time. While you won't see any of this when using Tiled, it can sometimes help to avoid bugs and it can make the code easier to read.
I hope you found that interesting!
Files
Get Tiled Map Editor
Tiled Map Editor
Free, easy to use and flexible level editor.
Status | In development |
Category | Tool |
Author | Thorbjørn Lindeijer |
Tags | 2D, Level Editor, Tilemap |
Languages | Bulgarian, German, English, Spanish; Castilian, Finnish, French, Hungarian, Japanese, Korean, Norwegian Bokmål, Dutch, Russian, Turkish, Ukrainian, Chinese |
More posts
- Tiled 1.11 ReleasedJun 27, 2024
- Tiled 1.10.2 ReleasedAug 05, 2023
- Tiled 1.10.1 ReleasedApr 04, 2023
- Tiled 1.10 ReleasedMar 10, 2023
- Tiled 1.9.2 ReleasedSep 16, 2022
- Tiled 1.9.1 ReleasedAug 11, 2022
- Tiled 1.9 ReleasedJun 25, 2022
- Tiled 1.8.6 ReleasedJun 15, 2022
- Tiled 1.8.5 ReleasedMay 17, 2022
- Tiled 1.9 Alpha ReleasedApr 08, 2022
Leave a comment
Log in with itch.io to leave a comment.