[Scummvm-git-logs] scummvm branch-2-1 -> 55e7aabf6e7f806ccd1c98831c367fe715abe805

antoniou79 a.antoniou79 at gmail.com
Sun Jan 12 19:32:24 UTC 2020


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

Summary:
50a9f5f4d0 BLADERUNNER: Minor comments update and spelling correction
048b4ec63b BLADERUNNER: Remove redundant assignment for ammo
58eb373eb2 BLADERUNNER: Spelling correction in comment
5fb5a33c04 BLADERUNNER: Fix wrong order for GPS map selection
86bbd47394 BLADERUNNER: Add a engine checkbox to target 120 fps
8268d66583 BLADERUNNER: Fixed crossplatform thumbnails in saves
04e476c264 BLADERUNNER: Debugger get or set game difficulty
55e7aabf6e BLADERUNNER: Use virtual keyboard feature in save screen


Commit: 50a9f5f4d06195c30124b46b921701078715405b
    https://github.com/scummvm/scummvm/commit/50a9f5f4d06195c30124b46b921701078715405b
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:23:04+02:00

Commit Message:
BLADERUNNER: Minor comments update and spelling correction

Changed paths:
    engines/bladerunner/set.cpp
    engines/bladerunner/settings.cpp


diff --git a/engines/bladerunner/set.cpp b/engines/bladerunner/set.cpp
index 33d6027..f968efd 100644
--- a/engines/bladerunner/set.cpp
+++ b/engines/bladerunner/set.cpp
@@ -432,7 +432,7 @@ void Set::load(SaveFileReadStream &f) {
 /**
 * Used for bugfixes mainly with respect to bad box positioning / bounding box fixes
 * TODO If we have many such cases, perhaps we could use a lookup table
-*		using sceneId, objectId (or name) as keys
+*      using sceneId, objectId (or name) as keys
 */
 void Set::overrideSceneObjectInfo(int objectId) const {
 	switch (_vm->_scene->getSceneId()) {
diff --git a/engines/bladerunner/settings.cpp b/engines/bladerunner/settings.cpp
index b4a0022..b0c6092 100644
--- a/engines/bladerunner/settings.cpp
+++ b/engines/bladerunner/settings.cpp
@@ -65,7 +65,8 @@ Settings::Settings(BladeRunnerEngine *vm) {
 	_fullHDFrames = true;
 	_mst3k = false;
 
-	// TODO: A bug? why is this set again here?
+	// TODO: A bug? why is this set again here, overriding the initialization above?
+	//       Also note: the reset() method assigns "_ammoAmounts[0] = 1" like above!
 	_ammoType = 0;
 	_ammoAmounts[0] = 0;
 	_ammoAmounts[1] = 0;


Commit: 048b4ec63b7efe25a7a0c3821ddaffb553304323
    https://github.com/scummvm/scummvm/commit/048b4ec63b7efe25a7a0c3821ddaffb553304323
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:23:23+02:00

Commit Message:
BLADERUNNER: Remove redundant assignment for ammo

Changed paths:
    engines/bladerunner/settings.cpp


diff --git a/engines/bladerunner/settings.cpp b/engines/bladerunner/settings.cpp
index b0c6092..722929f 100644
--- a/engines/bladerunner/settings.cpp
+++ b/engines/bladerunner/settings.cpp
@@ -65,12 +65,14 @@ Settings::Settings(BladeRunnerEngine *vm) {
 	_fullHDFrames = true;
 	_mst3k = false;
 
-	// TODO: A bug? why is this set again here, overriding the initialization above?
+#if BLADERUNNER_ORIGINAL_BUGS
+	// Probably a bug. Assigning these here again, overrides the initialization above.
 	//       Also note: the reset() method assigns "_ammoAmounts[0] = 1" like above!
 	_ammoType = 0;
 	_ammoAmounts[0] = 0;
 	_ammoAmounts[1] = 0;
 	_ammoAmounts[2] = 0;
+#endif // BLADERUNNER_ORIGINAL_BUGS
 
 	_learyMode = false;
 }


Commit: 58eb373eb26e0336aa3688035f2723737bdda5c6
    https://github.com/scummvm/scummvm/commit/58eb373eb26e0336aa3688035f2723737bdda5c6
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:23:36+02:00

Commit Message:
BLADERUNNER: Spelling correction in comment

Changed paths:
    engines/bladerunner/actor.cpp


diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index 7080b33..fae604b 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -140,7 +140,7 @@ void Actor::setup(int actorId) {
 #if BLADERUNNER_ORIGINAL_BUGS
 #else
 	// if player actor was not idle and had an active _walkInfo then
-	// upon starting a new game, the player actpr wpi;d be put on the old _walkInfo
+	// upon starting a new game, the player actor would be put on the old _walkInfo
 	_walkInfo->reset();
 //	// delete _walkInfo and re-allocate it (a reset method would probably be better)
 //	if (_walkInfo != nullptr) {


Commit: 5fb5a33c04252e7608107697afbbe998372a55b4
    https://github.com/scummvm/scummvm/commit/5fb5a33c04252e7608107697afbbe998372a55b4
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:23:51+02:00

Commit Message:
BLADERUNNER: Fix wrong order for GPS map selection

Changed paths:
    engines/bladerunner/ui/spinner.cpp


diff --git a/engines/bladerunner/ui/spinner.cpp b/engines/bladerunner/ui/spinner.cpp
index 4e7379d..c6d42b0 100644
--- a/engines/bladerunner/ui/spinner.cpp
+++ b/engines/bladerunner/ui/spinner.cpp
@@ -105,15 +105,24 @@ int Spinner::chooseDestination(int loopId, bool immediately) {
 	_destinations = nullptr;
 	int spinnerLoopId = 4;
 
-	if (mapmask & 1) {
-		_destinations = getDestinationsNear();
-		spinnerLoopId = 0;
+	// mapmask determines which map version will be displayed
+	// Depending on which destinations are available, mapmaks will have value:
+	// 1: For the near view (first chapter locations, and animoid row for some reason)
+	// 3: For medium view locations (includes the near view ones)
+	// 7: For far view locations (includes all the previous ones)
+	// This values are determined in mapmaskv table
+	//
+	// Since the checks below use bitwise AND, we need to check in order
+	// from the "far" version to the "near" version
+	if (mapmask & 4) {
+		_destinations = getDestinationsFar();
+		spinnerLoopId = 4;
 	} else if (mapmask & 2) {
 		_destinations = getDestinationsMedium();
 		spinnerLoopId = 2;
-	} else if (mapmask & 4) {
-		_destinations = getDestinationsFar();
-		spinnerLoopId = 4;
+	} else if (mapmask & 1) {
+		_destinations = getDestinationsNear();
+		spinnerLoopId = 0;
 	} else {
 		return -1;
 	}


Commit: 86bbd47394fb3123ab82f8cbacc705b3ab82ad10
    https://github.com/scummvm/scummvm/commit/86bbd47394fb3123ab82f8cbacc705b3ab82ad10
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:27:26+02:00

Commit Message:
BLADERUNNER: Add a engine checkbox to target 120 fps

This is added in the Engine tab for the game. Default is false (60 fps)

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/bladerunner.h
    engines/bladerunner/detection.cpp
    engines/bladerunner/detection_tables.h


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index ed7846f..21ebebc 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -83,6 +83,7 @@
 #include "common/events.h"
 #include "common/savefile.h"
 #include "common/system.h"
+#include "common/debug.h"
 #include "common/debug-channels.h"
 #include "common/translation.h"
 #include "gui/message.h"
@@ -111,10 +112,11 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des
 
 	_subtitlesEnabled = false;
 
-	_sitcomMode                = false;
-	_shortyMode                = false;
-	_noDelayMillisFramelimiter = false;
-	_cutContent                = Common::String(desc->gameId).contains("bladerunner-final");
+	_sitcomMode                   = false;
+	_shortyMode                   = false;
+	_noDelayMillisFramelimiter    = false;
+	_framesPerSecondMax           = false;
+	_cutContent                   = Common::String(desc->gameId).contains("bladerunner-final");
 
 	_playerLosesControlCounter = 0;
 
@@ -464,8 +466,24 @@ bool BladeRunnerEngine::checkFiles(Common::Array<Common::String> &missingFiles)
 }
 
 bool BladeRunnerEngine::startup(bool hasSavegames) {
-	// These are static objects in original game
+		// Assign default values to the ScummVM configuration manager, in case settings are missing
+	ConfMan.registerDefault("subtitles", "true");
+	ConfMan.registerDefault("sfx_volume", 192);
+	ConfMan.registerDefault("music_volume", 192);
+	ConfMan.registerDefault("speech_volume", 192);
+	ConfMan.registerDefault("mute", "false");
+	ConfMan.registerDefault("speech_mute", "false");
+	ConfMan.registerDefault("sitcom", "false");
+	ConfMan.registerDefault("shorty", "false");
+	ConfMan.registerDefault("nodelaymillisfl", "false");
+	ConfMan.registerDefault("frames_per_secondfl", "false");
 
+	_sitcomMode                = ConfMan.getBool("sitcom");
+	_shortyMode                = ConfMan.getBool("shorty");
+	_noDelayMillisFramelimiter = ConfMan.getBool("nodelaymillisfl");
+	_framesPerSecondMax        = ConfMan.getBool("frames_per_secondfl");
+
+	// These are static objects in original game
 	_screenEffects = new ScreenEffects(this, 0x8000);
 
 	_endCredits = new EndCredits(this);
@@ -493,7 +511,8 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 
 	_time = new Time(this);
 
-	_framelimiter = new Framelimiter(this);
+	debug("_framesPerSecondMax:: %s", _framesPerSecondMax? "true" : "false");
+	_framelimiter = new Framelimiter(this, _framesPerSecondMax? 120 : 60);
 
 	// Try to load the SUBTITLES.MIX first, before Startup.MIX
 	// allows overriding any identically named resources (such as the original font files and as a bonus also the TRE files for the UI and dialogue menu)
@@ -559,25 +578,9 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 
 	_ambientSounds = new AmbientSounds(this);
 
-	// Assign default values to the ScummVM configuration manager, in case settings are missing
-	ConfMan.registerDefault("subtitles", "true");
-	ConfMan.registerDefault("sfx_volume", 192);
-	ConfMan.registerDefault("music_volume", 192);
-	ConfMan.registerDefault("speech_volume", 192);
-	ConfMan.registerDefault("mute", "false");
-	ConfMan.registerDefault("speech_mute", "false");
-
-	// get value from the ScummVM configuration manager
-	syncSoundSettings();
-
-	_sitcomMode                = ConfMan.getBool("sitcom");
-	_shortyMode                = ConfMan.getBool("shorty");
-
-	if (!ConfMan.hasKey("nodelaymillisfl")) {
-		ConfMan.setBool("nodelaymillisfl", false);
-	}
-	_noDelayMillisFramelimiter = ConfMan.getBool("nodelaymillisfl");
 	// BLADE.INI was read here, but it was replaced by ScummVM configuration
+	//
+	syncSoundSettings();
 
 	_chapters = new Chapters(this);
 	if (!_chapters)
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 973d9b8..b8e0d54 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -215,6 +215,7 @@ public:
 	bool _sitcomMode;
 	bool _shortyMode;
 	bool _noDelayMillisFramelimiter;
+	bool _framesPerSecondMax;
 	bool _cutContent;
 
 	int _walkSoundId;
diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp
index 26772e2..39a7bd6 100644
--- a/engines/bladerunner/detection.cpp
+++ b/engines/bladerunner/detection.cpp
@@ -69,6 +69,15 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 			false
 		}
 	},
+	{
+		GAMEOPTION_FRAMELIMITER_FPS,
+		{
+			_s("Max frames per second limit"),
+			_s("This mode targets a maximum of 120 fps. When disabled, the game targets 60 fps"),
+			"frames_per_secondfl",
+			false
+		}
+	},
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
diff --git a/engines/bladerunner/detection_tables.h b/engines/bladerunner/detection_tables.h
index 869839f..bc504bd 100644
--- a/engines/bladerunner/detection_tables.h
+++ b/engines/bladerunner/detection_tables.h
@@ -28,6 +28,7 @@
 #define GAMEOPTION_SITCOM                     GUIO_GAMEOPTIONS1
 #define GAMEOPTION_SHORTY                     GUIO_GAMEOPTIONS2
 #define GAMEOPTION_FRAMELIMITER_NODELAYMILLIS GUIO_GAMEOPTIONS3
+#define GAMEOPTION_FRAMELIMITER_FPS           GUIO_GAMEOPTIONS4
 
 namespace BladeRunner {
 
@@ -40,7 +41,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (German)
@@ -51,7 +52,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::DE_DEU,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (French) - Bug #9722
@@ -62,7 +63,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::FR_FRA,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Italian)
@@ -73,7 +74,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::IT_ITA,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc.)
@@ -84,7 +85,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R3)
@@ -95,7 +96,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R4)
@@ -106,7 +107,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Spanish)
@@ -117,7 +118,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::ES_ESP,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO4(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GUIO_NOMIDI)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// Versions with restored content
@@ -130,7 +131,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (German)
@@ -141,7 +142,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::DE_DEU,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (French)
@@ -152,7 +153,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::FR_FRA,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Italian)
@@ -163,7 +164,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::IT_ITA,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc.)
@@ -174,7 +175,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R3)
@@ -185,7 +186,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R4)
@@ -196,7 +197,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformWindows,
 		ADGF_UNSTABLE,
-		GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
+		GUIO5(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS, GAMEOPTION_FRAMELIMITER_FPS, GUIO_NOMIDI)
 	},
 
 	AD_TABLE_END_MARKER


Commit: 8268d66583133ddb548aea8e9d6f81bab01fc07f
    https://github.com/scummvm/scummvm/commit/8268d66583133ddb548aea8e9d6f81bab01fc07f
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2020-01-12T21:27:44+02:00

Commit Message:
BLADERUNNER: Fixed crossplatform thumbnails in saves

Thumbnail was broken when savefile was transfered between big endiang
and little endian platforms.

closes #11258

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/savefile.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 21ebebc..3493c8a 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -2043,7 +2043,12 @@ bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, Graphics::Surface
 	SaveFileWriteStream s(memoryStream);
 
 	thumbnail.convertToInPlace(gameDataPixelFormat());
-	s.write(thumbnail.getPixels(), SaveFileManager::kThumbnailSize);
+
+	uint16* thumbnailData = (uint16*)thumbnail.getPixels();
+	for (uint i = 0; i < SaveFileManager::kThumbnailSize / 2; ++i) {
+		s.writeUint16LE(thumbnailData[i]);
+	}
+
 	s.writeFloat(1.0f);
 	_settings->save(s);
 	_scene->save(s);
@@ -2126,8 +2131,9 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {
 
 	_gameIsLoading = true;
 	_settings->setLoadingGame();
+
 	s.skip(SaveFileManager::kThumbnailSize); // skip the thumbnail
-	s.skip(4);// always float 1.0, but never used
+	s.skip(4);// always float 1.0, but never used, assuming it's the game version
 	_settings->load(s);
 	_scene->load(s);
 	_scene->_exits->load(s);
diff --git a/engines/bladerunner/savefile.cpp b/engines/bladerunner/savefile.cpp
index 1ea1a88..7a0739b 100644
--- a/engines/bladerunner/savefile.cpp
+++ b/engines/bladerunner/savefile.cpp
@@ -146,8 +146,10 @@ bool SaveFileManager::readHeader(Common::SeekableReadStream &in, SaveFileHeader
 
 		s.skip(4); //skip size;
 
-		void *thumbnailData = malloc(kThumbnailSize); // freed by ScummVM's smartptr
-		s.read(thumbnailData, kThumbnailSize);
+		uint16 *thumbnailData = (uint16*)malloc(kThumbnailSize); // freed by ScummVM's smartptr
+		for (uint i = 0; i < kThumbnailSize / 2; ++i) {
+			thumbnailData[i] = s.readUint16LE();
+		}
 
 		header._thumbnail->init(80, 60, 160, thumbnailData, gameDataPixelFormat());
 


Commit: 04e476c264fbe6c7145019c1d09ff979315d663d
    https://github.com/scummvm/scummvm/commit/04e476c264fbe6c7145019c1d09ff979315d663d
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-01-12T21:27:57+02:00

Commit Message:
BLADERUNNER: Debugger get or set game difficulty

Changed paths:
    engines/bladerunner/debugger.cpp
    engines/bladerunner/debugger.h


diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index d7315af..a1867e8 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -133,6 +133,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
 	registerCmd("item", WRAP_METHOD(Debugger, cmdItem));
 	registerCmd("region", WRAP_METHOD(Debugger, cmdRegion));
 	registerCmd("click", WRAP_METHOD(Debugger, cmdClick));
+	registerCmd("difficulty", WRAP_METHOD(Debugger, cmdDifficulty));
 #if BLADERUNNER_ORIGINAL_BUGS
 #else
 	registerCmd("effect", WRAP_METHOD(Debugger, cmdEffect));
@@ -1780,6 +1781,59 @@ bool Debugger::cmdClick(int argc, const char **argv) {
 	return true;
 }
 
+/**
+* Auxiliary function to get a descriptive string for a given difficulty value
+*/
+Common::String Debugger::getDifficultyDescription(int difficultyValue) {
+	Common::String difficultyStr;
+	switch (difficultyValue) {
+	default:
+		// fall through
+	case kGameDifficultyEasy:
+		difficultyStr = Common::String::format("Easy (%d)", kGameDifficultyEasy);
+		break;
+	case kGameDifficultyMedium:
+		difficultyStr = Common::String::format("Normal (%d)", kGameDifficultyMedium);
+		break;
+	case kGameDifficultyHard:
+		difficultyStr = Common::String::format("Hard (%d)", kGameDifficultyHard);
+		break;
+	}
+	return difficultyStr;
+}
+
+/**
+* Show or set current game's difficulty mode
+*/
+bool Debugger::cmdDifficulty(int argc, const char **argv) {
+	bool invalidSyntax = false;
+
+	if (argc == 1) {
+		debugPrintf("Current game difficulty is %s\n", getDifficultyDescription(_vm->_settings->getDifficulty()).c_str());
+	} else if (argc == 2) {
+		int difficultyID = atoi(argv[1]);
+		if (difficultyID < kGameDifficultyEasy || difficultyID > kGameDifficultyHard) {
+			debugPrintf("The difficulty value must be an integer within [0, 2]\n");
+			return true;
+		} else {
+			_vm->_settings->setDifficulty(difficultyID);
+			debugPrintf("Current game difficulty is set to %s\n", getDifficultyDescription(_vm->_settings->getDifficulty()).c_str());
+		}
+	} else {
+		invalidSyntax = true;
+	}
+
+	if (invalidSyntax) {
+		debugPrintf("Show or set current game's difficulty mode\n");
+		debugPrintf("Valid difficulty values: \n");
+		debugPrintf("0: Easy\n");
+		debugPrintf("1: Normal\n");
+		debugPrintf("2: Hard\n");
+		debugPrintf("Usage 1: %s\n", argv[0]);
+		debugPrintf("Usage 2: %s <difficulty>\n", argv[0]);
+	}
+	return true;
+}
 #if BLADERUNNER_ORIGINAL_BUGS
 #else
 bool Debugger::cmdEffect(int argc, const char **argv) {
diff --git a/engines/bladerunner/debugger.h b/engines/bladerunner/debugger.h
index 359163d..a7c0aa4 100644
--- a/engines/bladerunner/debugger.h
+++ b/engines/bladerunner/debugger.h
@@ -113,6 +113,7 @@ public:
 	bool cmdItem(int argc, const char **argv);
 	bool cmdRegion(int argc, const char **argv);
 	bool cmdClick(int argc, const char **argv);
+	bool cmdDifficulty(int argc, const char **argv);
 #if BLADERUNNER_ORIGINAL_BUGS
 #else
 	bool cmdEffect(int argc, const char **argv);
@@ -120,6 +121,7 @@ public:
 	bool cmdList(int argc, const char **argv);
 	bool cmdVk(int argc, const char **argv);
 
+	Common::String getDifficultyDescription(int difficultyValue);
 	void drawDebuggerOverlay();
 
 	void drawBBox(Vector3 start, Vector3 end, View *view, Graphics::Surface *surface, int color);


Commit: 55e7aabf6e7f806ccd1c98831c367fe715abe805
    https://github.com/scummvm/scummvm/commit/55e7aabf6e7f806ccd1c98831c367fe715abe805
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-01-12T21:28:15+02:00

Commit Message:
BLADERUNNER: Use virtual keyboard feature in save screen

This is used on platforms that have a virtual keyboard, such
as iOS, to show/hide the virtual keyboard when we expect text
input.

Changed paths:
    engines/bladerunner/ui/ui_input_box.cpp


diff --git a/engines/bladerunner/ui/ui_input_box.cpp b/engines/bladerunner/ui/ui_input_box.cpp
index be12f94..6c60f7e 100644
--- a/engines/bladerunner/ui/ui_input_box.cpp
+++ b/engines/bladerunner/ui/ui_input_box.cpp
@@ -27,6 +27,7 @@
 #include "bladerunner/time.h"
 
 #include "common/keyboard.h"
+#include "common/system.h"
 
 #include "graphics/surface.h"
 
@@ -39,6 +40,7 @@ UIInputBox::UIInputBox(BladeRunnerEngine *vm, UIComponentCallback *valueChangedC
 
 	_isVisible = true;
 	_rect = rect;
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
 
 	_maxLength = maxLength;
 	setText(text);
@@ -77,10 +79,12 @@ const Common::String &UIInputBox::getText() {
 
 void UIInputBox::show() {
 	_isVisible = true;
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
 }
 
 void UIInputBox::hide() {
 	_isVisible = false;
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 }
 
 void UIInputBox::handleKeyDown(const Common::KeyState &kbd) {




More information about the Scummvm-git-logs mailing list