aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThanasis Antoniou2019-09-18 22:52:31 +0300
committerThanasis Antoniou2019-09-18 22:54:20 +0300
commit181055b62a3084b569b19861d49fa3035888594a (patch)
tree9ce412a3ee5934920c552f0660900b19c29ef92b /engines
parent03819178e746e5f2130541bf3937817f971fe3da (diff)
downloadscummvm-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')
-rw-r--r--engines/bladerunner/bladerunner.cpp12
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);