diff options
author | Thanasis Antoniou | 2019-09-18 22:52:31 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-09-18 22:54:20 +0300 |
commit | 181055b62a3084b569b19861d49fa3035888594a (patch) | |
tree | 9ce412a3ee5934920c552f0660900b19c29ef92b /engines/bladerunner/bladerunner.cpp | |
parent | 03819178e746e5f2130541bf3937817f971fe3da (diff) | |
download | scummvm-rg350-181055b62a3084b569b19861d49fa3035888594a.tar.gz scummvm-rg350-181055b62a3084b569b19861d49fa3035888594a.tar.bz2 scummvm-rg350-181055b62a3084b569b19861d49fa3035888594a.zip |
BLADERUNNER: Fix crash for some devices for Android SDL port
This is a work around that is confirmed to be working
Reference ticket is here: https://bugs.scummvm.org/ticket/11149
Diffstat (limited to 'engines/bladerunner/bladerunner.cpp')
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 76a95ab5d8..f4032b8009 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -326,7 +326,17 @@ Common::Error BladeRunnerEngine::run() { return Common::Error(Common::kNoGameDataFoundError, missingFileStr); } - _screenPixelFormat = g_system->getSupportedFormats().front(); + Common::List<Graphics::PixelFormat> tmpSupportedFormatsList = g_system->getSupportedFormats(); + if (!tmpSupportedFormatsList.empty()) { + _screenPixelFormat = tmpSupportedFormatsList.front(); + } else { + // Workaround for reported issue whereby in the AndroidSDL port + // some devices would crash with a segmentation fault due to an empty supported formats list. + // TODO: A better fix for getSupportedFormats() - maybe figure why in only some device it might return an empty list + // + // Use this as a fallback format - Should be a format supported by Android port + _screenPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0); + } debug("Using pixel format: %s", _screenPixelFormat.toString().c_str()); initGraphics(640, 480, &_screenPixelFormat); |