Added a new %GAMEDIR% variable to be used in conjunction with the %STARTDIR% variable.

This commit is contained in:
Leon Styhre 2022-05-13 19:18:38 +02:00
parent 7849b44664
commit 46790fc1cb

View file

@ -1239,10 +1239,18 @@ void FileData::launchGame()
startDirectory = Utils::String::replace(
startDirectory, "%EMUDIR%",
Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\"", "")));
startDirectory = Utils::String::replace(
startDirectory, "%GAMEDIR%",
Utils::FileSystem::getParent(Utils::String::replace(romPath, "\"", "")));
#else
startDirectory = Utils::String::replace(
startDirectory, "%EMUDIR%",
Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\\", "")));
startDirectory = Utils::String::replace(
startDirectory, "%GAMEDIR%",
Utils::FileSystem::getParent(Utils::String::replace(romPath, "\\", "")));
#endif
if (!Utils::FileSystem::isDirectory(startDirectory)) {
Utils::FileSystem::createDirectory(startDirectory);