Fix broken recording saving with unicode path in windows

This commit is contained in:
Benau 2021-10-08 15:49:53 +08:00
parent 1c983f7090
commit 786dc6b08f

View File

@ -79,6 +79,7 @@
#include "tracks/track_manager.hpp"
#include "tracks/track.hpp"
#include "utils/constants.hpp"
#include "utils/file_utils.hpp"
#include "utils/log.hpp"
#include "utils/profiler.hpp"
#include "utils/string_utils.hpp"
@ -2197,8 +2198,10 @@ void IrrDriver::setRecording(bool val)
timeInfo->tm_year + 1900, timeInfo->tm_mon + 1,
timeInfo->tm_mday, timeInfo->tm_hour,
timeInfo->tm_min, timeInfo->tm_sec);
ogrSetSavedName((file_manager->getScreenshotDir() +
track_name + "_" + time_buffer).c_str());
std::string portable_path = FileUtils::getPortableWritingPath(
file_manager->getScreenshotDir());
ogrSetSavedName(
(portable_path + track_name + "_" + time_buffer).c_str());
ogrPrepareCapture();
}
else