[Scummvm-git-logs] scummvm branch-2-7 -> d7517eb8e3d53ca06104f763db584f835dbacdd8

antoniou79 noreply at scummvm.org
Sat Jul 1 10:34:07 UTC 2023


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

Summary:
cc2fcd6822 BLADERUNNER: Remove unnecessary translation.h include
12d3534f26 BLADERUNNER: avoid writing two times XYZ waypoints
23eac5692c BLADERUNNER: Support merging of CDs in original layout.
0a937d4b98 BLADERUNNER: Add assertion for undershort files
404843681f BLADERUNNER: add BiDi support for subtitles
d7517eb8e3 BLADERUNNER: Add unsupported version to final mode too


Commit: cc2fcd68226f472367ec5f8dd51c2cd029406234
    https://github.com/scummvm/scummvm/commit/cc2fcd68226f472367ec5f8dd51c2cd029406234
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-07-01T13:32:27+03:00

Commit Message:
BLADERUNNER: Remove unnecessary translation.h include

Changed paths:
    engines/bladerunner/detection.cpp


diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp
index 26b3b06fbed..748cbe6edd4 100644
--- a/engines/bladerunner/detection.cpp
+++ b/engines/bladerunner/detection.cpp
@@ -28,7 +28,6 @@
 #include "common/system.h"
 #include "common/savefile.h"
 #include "common/serializer.h"
-#include "common/translation.h"
 
 #include "engines/advancedDetector.h"
 


Commit: 12d3534f269ce050850393c2740d51d522fe68b5
    https://github.com/scummvm/scummvm/commit/12d3534f269ce050850393c2740d51d522fe68b5
Author: Carlo Bramini (30959007+carlo-bramini at users.noreply.github.com)
Date: 2023-07-01T13:32:34+03:00

Commit Message:
BLADERUNNER: avoid writing two times XYZ waypoints

In my opinion, there is no need to write values into X/Y/Z pointers two times, it can be more efficient to write only once the value that we need.

Changed paths:
    engines/bladerunner/waypoints.cpp


diff --git a/engines/bladerunner/waypoints.cpp b/engines/bladerunner/waypoints.cpp
index d105c5ed0d5..d2d041ee743 100644
--- a/engines/bladerunner/waypoints.cpp
+++ b/engines/bladerunner/waypoints.cpp
@@ -32,17 +32,15 @@ Waypoints::Waypoints(BladeRunnerEngine *vm, int count) {
 }
 
 void Waypoints::getXYZ(int waypointId, float *x, float *y, float *z) const {
-	*x = 0;
-	*y = 0;
-	*z = 0;
-
 	if (waypointId < 0 || waypointId >= _count || !_waypoints[waypointId].present) {
-		return;
+		*x = 0;
+		*y = 0;
+		*z = 0;
+	} else {
+		*x = _waypoints[waypointId].position.x;
+		*y = _waypoints[waypointId].position.y;
+		*z = _waypoints[waypointId].position.z;
 	}
-
-	*x = _waypoints[waypointId].position.x;
-	*y = _waypoints[waypointId].position.y;
-	*z = _waypoints[waypointId].position.z;
 }
 
 int Waypoints::getSetId(int waypointId) const {


Commit: 23eac5692c4f0ae3e266c578d52069ea0bd14d56
    https://github.com/scummvm/scummvm/commit/23eac5692c4f0ae3e266c578d52069ea0bd14d56
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-07-01T13:32:43+03:00

Commit Message:
BLADERUNNER: Support merging of CDs in original layout.

Right now we ask user to reshuffle files. After this commit it's
possible to just merge contents of all CDs.

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/detection.cpp
    engines/bladerunner/slice_animations.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index cbee15b8880..4234e98a691 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -352,6 +352,12 @@ void BladeRunnerEngine::pauseEngineIntern(bool pause) {
 
 Common::Error BladeRunnerEngine::run() {
 	Common::Array<Common::String> missingFiles;
+	const Common::FSNode gameDataDir(ConfMan.get("path"));
+	SearchMan.addSubDirectoryMatching(gameDataDir, "base");
+	SearchMan.addSubDirectoryMatching(gameDataDir, "cd1");
+	SearchMan.addSubDirectoryMatching(gameDataDir, "cd2");
+	SearchMan.addSubDirectoryMatching(gameDataDir, "cd3");
+	SearchMan.addSubDirectoryMatching(gameDataDir, "cd4");
 	if (!_isNonInteractiveDemo && !checkFiles(missingFiles)) {
 		Common::String missingFileStr = "";
 		for (uint i = 0; i < missingFiles.size(); ++i) {
@@ -558,15 +564,9 @@ bool BladeRunnerEngine::checkFiles(Common::Array<Common::String> &missingFiles)
 	bool hasHdFrames = Common::File::exists("HDFRAMES.DAT");
 
 	if (!hasHdFrames) {
-		requiredFiles.clear();
-		requiredFiles.push_back("CDFRAMES1.DAT");
-		requiredFiles.push_back("CDFRAMES2.DAT");
-		requiredFiles.push_back("CDFRAMES3.DAT");
-		requiredFiles.push_back("CDFRAMES4.DAT");
-
-		for (uint i = 0; i < requiredFiles.size(); ++i) {
-			if (!Common::File::exists(requiredFiles[i])) {
-				missingFiles.push_back(requiredFiles[i]);
+		for (uint i = 1; i <= 4; ++i) {
+			if (!Common::File::exists(Common::String::format("CDFRAMES%d.DAT", i)) && !Common::File::exists(Common::String::format("CD%d/CDFRAMES.DAT", i))) {
+				missingFiles.push_back(Common::String::format("CD%d/CDFRAMES.DAT", i));
 			}
 		}
 	}
diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp
index 748cbe6edd4..8bba32c2c9e 100644
--- a/engines/bladerunner/detection.cpp
+++ b/engines/bladerunner/detection.cpp
@@ -46,6 +46,10 @@ static const PlainGameDescriptor bladeRunnerGames[] = {
 	{nullptr, nullptr}
 };
 
+static const char *const directoryGlobs[] = {
+	"BASE",
+	nullptr
+};
 } // End of namespace BladeRunner
 
 class BladeRunnerMetaEngineDetection : public AdvancedMetaEngineDetection {
@@ -72,6 +76,8 @@ BladeRunnerMetaEngineDetection::BladeRunnerMetaEngineDetection()
 		// and expects ScummVM to detect both, offer a choice on which to add,
 		// and finally launch the proper one depending on which was added.
 		_flags = kADFlagUseExtraAsHint;
+		_maxScanDepth = 2;
+		_directoryGlobs = BladeRunner::directoryGlobs;
 }
 
 const char *BladeRunnerMetaEngineDetection::getName() const {
diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp
index 2994ac4ff3d..744091c8167 100644
--- a/engines/bladerunner/slice_animations.cpp
+++ b/engines/bladerunner/slice_animations.cpp
@@ -135,6 +135,11 @@ bool SliceAnimations::openFrames(int fileNumber) {
 			_framesPageFile.close(_framesPageFile._fileNumber);
 		}
 		_framesPageFile._fileNumber = fileNumber;
+
+		if (_framesPageFile.open(Common::String::format("CD%d/CDFRAMES.DAT", fileNumber), fileNumber)) {
+			return true;
+		}
+
 		// For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT
 		if (fileNumber == 1 && _framesPageFile.open("CDFRAMES.DAT", fileNumber)) {
 			return true;
@@ -151,11 +156,13 @@ bool SliceAnimations::openFrames(int fileNumber) {
 			_framesPageFile.close(i);
 			if (i == 1
 			    && (!_framesPageFile.open("CDFRAMES.DAT", i))
+			    && (!_framesPageFile.open(Common::String::format("CD%d/CDFRAMES.DAT", i), i))
 			    && (!_framesPageFile.open(Common::String::format("CDFRAMES%d.DAT", i), i))
 			) {
 				// For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT
 				return false;
 			} else if (i != 1 &&
+				   (!_framesPageFile.open(Common::String::format("CD%d/CDFRAMES.DAT", i), i)) &&
 			          !_framesPageFile.open(Common::String::format("CDFRAMES%d.DAT", i), i)
 			) {
 				return false;


Commit: 0a937d4b9836ac71714c168d55725199b0533ebd
    https://github.com/scummvm/scummvm/commit/0a937d4b9836ac71714c168d55725199b0533ebd
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-07-01T13:32:50+03:00

Commit Message:
BLADERUNNER: Add assertion for undershort files

Changed paths:
    engines/bladerunner/text_resource.cpp


diff --git a/engines/bladerunner/text_resource.cpp b/engines/bladerunner/text_resource.cpp
index 7e2f364c9c3..ccdf668b413 100644
--- a/engines/bladerunner/text_resource.cpp
+++ b/engines/bladerunner/text_resource.cpp
@@ -59,6 +59,8 @@ bool TextResource::open(const Common::String &name, bool localized) {
 
 	_count = s->readUint32LE();
 
+	assert(s->size() >= 4 * (2 * _count + 1));
+
 	_ids = new uint32[_count];
 	_offsets = new uint32[_count + 1];
 


Commit: 404843681ffcf9e8803e15f834be5f5415ab27b9
    https://github.com/scummvm/scummvm/commit/404843681ffcf9e8803e15f834be5f5415ab27b9
Author: BLooperZ (blooperz at users.noreply.github.com)
Date: 2023-07-01T13:32:58+03:00

Commit Message:
BLADERUNNER: add BiDi support for subtitles

Changed paths:
    engines/bladerunner/subtitles.cpp


diff --git a/engines/bladerunner/subtitles.cpp b/engines/bladerunner/subtitles.cpp
index 9c23ba52b2c..94e1950e5e4 100644
--- a/engines/bladerunner/subtitles.cpp
+++ b/engines/bladerunner/subtitles.cpp
@@ -28,6 +28,7 @@
 #include "bladerunner/time.h"
 
 #include "common/debug.h"
+#include "common/unicode-bidi.h"
 
 #include "graphics/font.h"
 #include "graphics/fonts/ttf.h"
@@ -658,12 +659,13 @@ void Subtitles::draw(Graphics::Surface &s) {
 					_font->drawString(&s, _subtitlesDataActive[i].lines[j], 0, y, s.w, 0, Graphics::kTextAlignCenter);
 					break;
 				case Subtitles::kSubtitlesFontTypeTTF:
-					_font->drawString(&s, _subtitlesDataActive[i].lines32[j], -1, y    , s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
-					_font->drawString(&s, _subtitlesDataActive[i].lines32[j],  0, y - 1, s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
-					_font->drawString(&s, _subtitlesDataActive[i].lines32[j],  1, y    , s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
-					_font->drawString(&s, _subtitlesDataActive[i].lines32[j],  0, y + 1, s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
+					Common::U32String line32 = Common::convertBiDiU32String(_subtitlesDataActive[i].lines32[j]).visual;
+					_font->drawString(&s, line32, -1, y    , s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
+					_font->drawString(&s, line32,  0, y - 1, s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
+					_font->drawString(&s, line32,  1, y    , s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
+					_font->drawString(&s, line32,  0, y + 1, s.w, s.format.RGBToColor(  0,   0,   0), Graphics::kTextAlignCenter);
 
-					_font->drawString(&s, _subtitlesDataActive[i].lines32[j],  0, y    , s.w, s.format.RGBToColor(255, 255, 255), Graphics::kTextAlignCenter);
+					_font->drawString(&s, line32,  0, y    , s.w, s.format.RGBToColor(255, 255, 255), Graphics::kTextAlignCenter);
 					break;
 				}
 			}


Commit: d7517eb8e3d53ca06104f763db584f835dbacdd8
    https://github.com/scummvm/scummvm/commit/d7517eb8e3d53ca06104f763db584f835dbacdd8
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:33:11+03:00

Commit Message:
BLADERUNNER: Add unsupported version to final mode too

The translator requested not to support their version

Changed paths:
    engines/bladerunner/detection_tables.h


diff --git a/engines/bladerunner/detection_tables.h b/engines/bladerunner/detection_tables.h
index b73167bc406..6a78582d00c 100644
--- a/engines/bladerunner/detection_tables.h
+++ b/engines/bladerunner/detection_tables.h
@@ -202,7 +202,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R3) - RUS
 	{
 		"bladerunner-final",
-		"",
+		_s("The fan translator does not wish his translation to be incorporated into ScummVM."),
 		AD_ENTRY1s("STARTUP.MIX", "c198b54a5366b88b1734bbca21d3b192", 2678672),
 		Common::RU_RUS,
 		Common::kPlatformWindows,
@@ -213,7 +213,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R4) - RUS
 	{
 		"bladerunner-final",
-		"",
+		_s("The fan translator does not wish his translation to be incorporated into ScummVM."),
 		AD_ENTRY1s("STARTUP.MIX", "d62498a7415682bb3ff86a894303c836", 2810053),
 		Common::RU_RUS,
 		Common::kPlatformWindows,




More information about the Scummvm-git-logs mailing list