From 5edead61d02d03d88c034b42f180f440e3b69740 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 12 Sep 2017 01:39:24 +0200 Subject: [PATCH] rwgame: create texture filename in buffer in one go --- rwgame/RWGame.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rwgame/RWGame.cpp b/rwgame/RWGame.cpp index ef49edc6..785443c5 100644 --- a/rwgame/RWGame.cpp +++ b/rwgame/RWGame.cpp @@ -20,6 +20,7 @@ #include #include +#include std::map kSpecialModels = { {GameRenderer::ZoneCylinderA, "zonecyla.dff"}, @@ -78,9 +79,9 @@ RWGame::RWGame(Logger& log, int argc, char* argv[]) 128 * 128); for (int m = 0; m < MAP_BLOCK_SIZE; ++m) { - std::string num = (m < 10 ? "0" : ""); - std::string name = "radar" + num + std::to_string(m); - data.loadTXD(name + ".txd"); + std::ostringstream oss; + oss << "radar" << std::setw(2) << std::setfill('0') << m << ".txd"; + data.loadTXD(oss.str()); } StateManager::get().enter(this, [=]() {