[Scummvm-git-logs] scummvm master -> 1f900a2cf44454bb3b024da9c8b579d3b644923e

neuromancer noreply at scummvm.org
Sun Nov 27 13:03:55 UTC 2022


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

Summary:
1b8759f13b FREESCAPE: removed useless call to clear
aa0be90ef5 FREESCAPE: added extended timer cheat for all the games
1f900a2cf4 FREESCAPE: first approach to check if a sensor can shoot the player


Commit: 1b8759f13b17bfd68b6da02ae973c51f29951add
    https://github.com/scummvm/scummvm/commit/1b8759f13b17bfd68b6da02ae973c51f29951add
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-27T14:04:54+01:00

Commit Message:
FREESCAPE: removed useless call to clear

Changed paths:
    engines/freescape/freescape.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 580335d3b04..036db614211 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -543,8 +543,6 @@ Common::Error FreescapeEngine::run() {
 	initGameState();
 	loadColorPalette();
 
-	_gfx->clear(0);
-
 	_gfx->convertImageFormatIfNecessary(_title);
 	_gfx->convertImageFormatIfNecessary(_border);
 


Commit: aa0be90ef542d250a735023e24c4883da40184d6
    https://github.com/scummvm/scummvm/commit/aa0be90ef542d250a735023e24c4883da40184d6
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-27T14:04:54+01:00

Commit Message:
FREESCAPE: added extended timer cheat for all the games

Changed paths:
    engines/freescape/detection.cpp
    engines/freescape/detection.h
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/loaders/8bitBinaryLoader.cpp
    engines/freescape/metaengine.cpp


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index e93aadb0742..a210c72ab29 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -252,7 +252,7 @@ static const DebugChannelDef debugFlagList[] = {
 class FreescapeMetaEngineDetection : public AdvancedMetaEngineDetection {
 public:
 	FreescapeMetaEngineDetection() : AdvancedMetaEngineDetection(Freescape::gameDescriptions, sizeof(ADGameDescription), Freescape::freescapeGames) {
-		_guiOptions = GUIO3(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_DISABLE_DEMO_MODE);
+		_guiOptions = GUIO4(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE);
 	}
 
 	const char *getName() const override {
diff --git a/engines/freescape/detection.h b/engines/freescape/detection.h
index 4fb0f207015..85c4034d9f0 100644
--- a/engines/freescape/detection.h
+++ b/engines/freescape/detection.h
@@ -22,8 +22,13 @@
 #ifndef FREESCAPE_DETECTION_H
 #define FREESCAPE_DETECTION_H
 
+// Engine options
 #define GAMEOPTION_PRERECORDED_SOUNDS   GUIO_GAMEOPTIONS1
-#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS2
+#define GAMEOPTION_EXTENDED_TIMER   	GUIO_GAMEOPTIONS2
 #define GAMEOPTION_DISABLE_DEMO_MODE    GUIO_GAMEOPTIONS3
 
+// Driller options
+#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS4
+
+
 #endif
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 036db614211..01660d0f259 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -56,6 +56,9 @@ FreescapeEngine::FreescapeEngine(OSystem *syst, const ADGameDescription *gd)
 	if (!Common::parseBool(ConfMan.get("prerecorded_sounds"), _usePrerecordedSounds))
 		error("Failed to parse bool from prerecorded_sounds option");
 
+	if (!Common::parseBool(ConfMan.get("extended_timer"), _useExtendedTimer))
+		error("Failed to parse bool from extended_timer option");
+
 	if (!Common::parseBool(ConfMan.get("disable_demo_mode"), _disableDemoMode))
 		error("Failed to parse bool from disable_demo_mode option");
 
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 02e1f306a26..6144c0af106 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -320,6 +320,9 @@ public:
 	bool _timerStarted;
 	int _countdown;
 	int _ticks;
+
+	// Cheats
+	bool _useExtendedTimer;
 };
 
 enum DrillerReleaseFlags {
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index 65266aaa45e..3a7d2a09a2a 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -528,6 +528,9 @@ void FreescapeEngine::load8bitBinary(Common::SeekableReadStream *file, int offse
 		n += char(readField(file, 8));
 		n += char(readField(file, 8));
 		_countdown = _countdown + atoi(n.c_str());
+
+		if (_useExtendedTimer)
+			_countdown = 359999; // 99:59:59
 	}
 
 	if (isAmiga() || isAtariST())
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index 2c5ade56a3f..ecb7796d666 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -36,6 +36,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 			0
 		}
 	},
+	{
+		GAMEOPTION_EXTENDED_TIMER,
+		{
+			_s("Extended timer"),
+			_s("Start the game timer at 99:59:59"),
+			"extended_timer",
+			false,
+			0,
+			0
+		}
+	},
 	{
 		GAMEOPTION_AUTOMATIC_DRILLING,
 		{


Commit: 1f900a2cf44454bb3b024da9c8b579d3b644923e
    https://github.com/scummvm/scummvm/commit/1f900a2cf44454bb3b024da9c8b579d3b644923e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-27T14:04:54+01:00

Commit Message:
FREESCAPE: first approach to check if a sensor can shoot the player

Changed paths:
    engines/freescape/area.cpp
    engines/freescape/area.h
    engines/freescape/freescape.cpp


diff --git a/engines/freescape/area.cpp b/engines/freescape/area.cpp
index 85725518a6f..e3e5ef57e41 100644
--- a/engines/freescape/area.cpp
+++ b/engines/freescape/area.cpp
@@ -212,6 +212,33 @@ ObjectArray Area::checkCollisions(const Math::AABB &boundingBox) {
 	return collided;
 }
 
+bool Area::checkInSight(const Math::Ray &ray, float maxDistance) {
+	Math::Vector3d direction = ray.getDirection();
+	direction.normalize();
+	GeometricObject point(kCubeType,
+			0,
+			0,
+			Math::Vector3d(0, 0, 0),
+			Math::Vector3d(maxDistance / 30, maxDistance / 30, maxDistance / 30), // size
+			nullptr,
+			nullptr,
+			FCLInstructionVector(),
+			"");
+
+	for (int distanceMultiplier = 2; distanceMultiplier <= 10; distanceMultiplier++) {
+		Math::Vector3d origin = ray.getOrigin() + distanceMultiplier * (maxDistance / 10) * direction;
+		point.setOrigin(origin);
+
+		for (auto &obj : _drawableObjects) {
+			if (obj->getType() != kSensorType && !obj->isDestroyed() && !obj->isInvisible() && obj->_boundingBox.isValid() && point.collides(obj->_boundingBox)) {
+				return false;
+			}
+		}
+	}
+
+	return true;
+}
+
 void Area::addObject(Object *obj) {
 	assert(obj);
 	int id = obj->getObjectID();
diff --git a/engines/freescape/area.h b/engines/freescape/area.h
index 53a243de42f..78537689c39 100644
--- a/engines/freescape/area.h
+++ b/engines/freescape/area.h
@@ -53,6 +53,7 @@ public:
 	void show();
 
 	Object *shootRay(const Math::Ray &ray);
+	bool checkInSight(const Math::Ray &ray, float maxDistance);
 	ObjectArray checkCollisions(const Math::AABB &boundingBox);
 	void addObjectFromArea(int16 id, Area *global);
 	void addObject(Object *obj);
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 01660d0f259..bbe05e09aed 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -252,6 +252,11 @@ bool FreescapeEngine::checkSensors() {
 		else if (sensor->_axis == 0x20 && diff.z() <= 0)
 			playerDetected = true;
 
+		if (playerDetected) {
+			Math::Ray sight(sensor->getOrigin(), -diff);
+			playerDetected = _currentArea->checkInSight(sight, diff.length());
+		}
+
 		if (playerDetected) {
 			if ((ABS(diff.x() + ABS(diff.y())) + ABS(diff.z()) <= sensor->_firingRange) &&
 			    (_ticks % sensor->_firingInterval == 0)) {




More information about the Scummvm-git-logs mailing list