[Scummvm-git-logs] scummvm master -> 181055b62a3084b569b19861d49fa3035888594a

antoniou79 antoniou at cti.gr
Wed Sep 18 22:03:47 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
181055b62a BLADERUNNER: Fix crash for some devices for Android SDL port


Commit: 181055b62a3084b569b19861d49fa3035888594a
    https://github.com/scummvm/scummvm/commit/181055b62a3084b569b19861d49fa3035888594a
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-09-18T22:54:20+03:00

Commit Message:
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

Changed paths:
    engines/bladerunner/bladerunner.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 76a95ab..f4032b8 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);
 





More information about the Scummvm-git-logs mailing list