Added path separator handling.

This commit is contained in:
Miroslav Bendík 2012-09-01 13:41:00 +02:00
parent 6dff561ec0
commit 1edbba5a94
1 changed files with 7 additions and 2 deletions

View File

@ -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();