From 1edbba5a9482aa126edd6daab4b379c92ffae5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bend=C3=ADk?= Date: Sat, 1 Sep 2012 13:41:00 +0200 Subject: [PATCH] Added path separator handling. --- TileGenerator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TileGenerator.cpp b/TileGenerator.cpp index b1ea5fd..8ed0f0e 100644 --- a/TileGenerator.cpp +++ b/TileGenerator.cpp @@ -233,7 +233,12 @@ void TileGenerator::parseColorsFile(const std::string &fileName) void TileGenerator::generate(const std::string &input, const std::string &output) { - openDb(input); + string input_path = input; + if (input_path[input.length() - 1] != PATH_SEPARATOR) { + input_path += PATH_SEPARATOR; + } + + openDb(input_path); loadBlocks(); createImage(); renderMap(); @@ -244,7 +249,7 @@ void TileGenerator::generate(const std::string &input, const std::string &output renderOrigin(); } if (m_drawPlayers) { - renderPlayers(input); + renderPlayers(input_path); } writeImage(output); printUnknown();