diff options
| -rw-r--r-- | src/main.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5479d5a3..08d70dd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -165,20 +165,34 @@ QString getSplashPath( return {}; } + // try splash from instance directory const QString splashPath = dataPath + "/splash.png"; if (QFile::exists(dataPath + "/splash.png")) { - return splashPath; + QImage image(splashPath); + if (!image.isNull()) { + return splashPath; + } } - // currently using MO splash, see if the plugin contains one + // try splash from plugin QString pluginSplash = QString(":/%1/splash").arg(game->gameShortName()); - QImage image(pluginSplash); + if (QFile::exists(pluginSplash)) { + QImage image(pluginSplash); + if (!image.isNull()) { + image.save(splashPath); + return pluginSplash; + } + } - if (image.isNull()) { - return {}; + // try default splash from resource + QString defaultSplash = ":/MO/gui/splash"; + if (QFile::exists(defaultSplash)) { + QImage image(defaultSplash); + if (!image.isNull()) { + return defaultSplash; + } } - image.save(splashPath); return splashPath; } |
