diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/game/StarDungeonTMXPart.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/game/StarDungeonTMXPart.cpp')
-rw-r--r-- | source/game/StarDungeonTMXPart.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/game/StarDungeonTMXPart.cpp b/source/game/StarDungeonTMXPart.cpp index 9058a38..c319ab7 100644 --- a/source/game/StarDungeonTMXPart.cpp +++ b/source/game/StarDungeonTMXPart.cpp @@ -180,7 +180,7 @@ namespace Dungeon { m_tileData.append(index.toUInt() & ~TileFlip::AllBits); } } else { - throw StarException::format("TMXTileLayer does not support compression mode %s", layer.getString("compression")); + throw StarException::format("TMXTileLayer does not support compression mode {}", layer.getString("compression")); } if (m_tileData.count() != width * height) @@ -208,7 +208,7 @@ namespace Dungeon { m_objectGroups.append(group); } else { - throw StarException(strf("Unknown layer type '%s'", layerType.utf8Ptr())); + throw StarException(strf("Unknown layer type '{}'", layerType.utf8Ptr())); } } } @@ -244,7 +244,7 @@ namespace Dungeon { TMXTilesets::TMXTilesets(Json const& tmx) { for (Json const& tilesetJson : tmx.iterateArray()) { if (!tilesetJson.contains("source")) - throw StarException::format("Tiled map has embedded tileset %s", tilesetJson.optString("name")); + throw StarException::format("Tiled map has embedded tileset {}", tilesetJson.optString("name")); String sourcePath = tilesetAssetPath(tilesetJson.getString("source")); Tiled::TilesetConstPtr tileset = Root::singleton().tilesetDatabase()->get(sourcePath); @@ -407,7 +407,7 @@ namespace Dungeon { StarException TMXObject::tmxObjectError(Json const& tmx, String const& msg) { Vec2I pos = getPos(tmx); - return StarException::format("At %d,%d: %s", pos[0], pos[1], msg); + return StarException::format("At {},{}: {}", pos[0], pos[1], msg); } TMXObjectGroup::TMXObjectGroup(Json const& tmx, TMXTilesetsPtr tilesets) { |