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 = Utils::String::replace(
startDirectory, "%EMUDIR%", startDirectory, "%EMUDIR%",
Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\"", ""))); Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\"", "")));
startDirectory = Utils::String::replace(
startDirectory, "%GAMEDIR%",
Utils::FileSystem::getParent(Utils::String::replace(romPath, "\"", "")));
#else #else
startDirectory = Utils::String::replace( startDirectory = Utils::String::replace(
startDirectory, "%EMUDIR%", startDirectory, "%EMUDIR%",
Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\\", ""))); Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\\", "")));
startDirectory = Utils::String::replace(
startDirectory, "%GAMEDIR%",
Utils::FileSystem::getParent(Utils::String::replace(romPath, "\\", "")));
#endif #endif
if (!Utils::FileSystem::isDirectory(startDirectory)) { if (!Utils::FileSystem::isDirectory(startDirectory)) {
Utils::FileSystem::createDirectory(startDirectory); Utils::FileSystem::createDirectory(startDirectory);