diff options
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); |