[Scummvm-git-logs] scummvm master -> 0fae43196e9b3b87b44ec5df0f462a9f9a282cce

neuromancer noreply at scummvm.org
Tue Nov 8 18:30:49 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:
846037c0da FREESCAPE: Lock mouse before showing the title screen and unlock when the main menu is active
3124496dbc FREESCAPE: Allow playing laser sounds in driller
0fae43196e FREESCAPE: improved drilling logic in driller


Commit: 846037c0dabc12408e0b63648131bcf686c1a553
    https://github.com/scummvm/scummvm/commit/846037c0dabc12408e0b63648131bcf686c1a553
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-08T19:31:11+01:00

Commit Message:
FREESCAPE: Lock mouse before showing the title screen and unlock when the main menu is active

Changed paths:
    engines/freescape/freescape.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 2e91023fec5..9f8224c9d45 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -315,7 +315,9 @@ void FreescapeEngine::processInput() {
 				_flyMode = _noClipMode;
 				break;
 			case Common::KEYCODE_ESCAPE:
+				_system->lockMouse(false);
 				openMainMenuDialog();
+				_system->lockMouse(true);
 				break;
 			case Common::KEYCODE_SPACE:
 				_shootMode = !_shootMode;
@@ -410,6 +412,7 @@ Common::Error FreescapeEngine::run() {
 
 	// Simple main event loop
 	int saveSlot = ConfMan.getInt("save_slot");
+	_system->lockMouse(true);
 
 	if (_title) {
 		if (saveSlot == -1) {
@@ -431,7 +434,6 @@ Common::Error FreescapeEngine::run() {
 		gotoArea(_startArea, _startEntrance);
 
 	debugC(1, kFreescapeDebugMove, "Starting area %d", _currentArea->getAreaID());
-	_system->lockMouse(true);
 	bool endGame = false;
 	// Draw first frame
 


Commit: 3124496dbc8dea5656ca08adaaf2910d8dbfd7be
    https://github.com/scummvm/scummvm/commit/3124496dbc8dea5656ca08adaaf2910d8dbfd7be
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-08T19:31:11+01:00

Commit Message:
FREESCAPE: Allow playing laser sounds in driller

Changed paths:
    engines/freescape/movement.cpp


diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index c216a729317..20a59202a80 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -49,8 +49,8 @@ void FreescapeEngine::traverseEntrance(uint16 entranceID) {
 }
 
 void FreescapeEngine::shoot() {
+	//_mixer->stopHandle(_soundFxHandle);
 	playSound(1, true);
-	_mixer->stopHandle(_soundFxHandle);
 	_gfx->renderShoot(0, _crossairPosition);
 
 	float xoffset = _crossairPosition.x - float(_screenW) / 2;


Commit: 0fae43196e9b3b87b44ec5df0f462a9f9a282cce
    https://github.com/scummvm/scummvm/commit/0fae43196e9b3b87b44ec5df0f462a9f9a282cce
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-08T19:31:11+01:00

Commit Message:
FREESCAPE: improved drilling logic in driller

Changed paths:
    engines/freescape/games/driller.cpp
    engines/freescape/loaders/8bitBinaryLoader.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 8899b3bd607..c82c8b3c623 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -414,24 +414,30 @@ void DrillerEngine::pressedKey(const int keycode) {
 
 		Math::Vector3d drillPosition = _cameraFront;
 		drillPosition = _position + 256 * drillPosition;
+		debugC(1, kFreescapeDebugMove, "Current position at %f %f %f", _position.x(), _position.y(), _position.z());
+		drillPosition.setValue(1, _position.y() - _playerHeight * _currentArea->getScale());
+		debugC(1, kFreescapeDebugMove, "Trying to adding drill at %f %f %f", drillPosition.x(), drillPosition.y(), drillPosition.z());
+		debugC(1, kFreescapeDebugMove, "with pitch: %f and yaw %f", _pitch, _yaw);
+
 		if (!checkDrill(drillPosition)) {
 			_currentAreaMessages[0] = _messagesList[4];
 			return;
 		}
 
 		_gameStateVars[k8bitVariableEnergy] = _gameStateVars[k8bitVariableEnergy] - 5;
-		_gameStateVars[32]++;
-		debugC(1, kFreescapeDebugMove, "Current position at %f %f %f", _position.x(), _position.y(), _position.z());
-		drillPosition.setValue(1, _position.y() - _playerHeight * _currentArea->getScale());
-		debugC(1, kFreescapeDebugMove, "Trying to adding drill at %f %f %f", drillPosition.x(), drillPosition.y(), drillPosition.z());
-		debugC(1, kFreescapeDebugMove, "with pitch: %f and yaw %f", _pitch, _yaw);
-
-		const Math::Vector3d gasPocket3D(gasPocket.x, 1, gasPocket.y);
+		const Math::Vector3d gasPocket3D(gasPocket.x, drillPosition.y(), gasPocket.y);
 		addDrill(drillPosition);
-		float distance = (gasPocket3D - drillPosition).length();
-		debugC(1, kFreescapeDebugMove, "length to gas pocket: %f with radius %d", distance, _currentArea->_gasPocketRadius);
-		// TODO: show the result of the drilling
-		_currentAreaMessages[0] = _messagesList[3];
+		float distanceToPocket = (gasPocket3D - drillPosition).length();
+		float success = 100.0 * (1.0 - distanceToPocket / _currentArea->_gasPocketRadius);
+
+		if (success <= 0) {
+			_currentAreaMessages[0] = _messagesList[9];
+			return;
+		}
+
+		_gameStateVars[32]++; // TODO: save a boolean to indicate if a level is safe or not
+		_currentAreaMessages[0] = _messagesList[6];
+		_currentAreaMessages[0].replace(0, 4, Common::String::format("%d", int(success)));
 
 	} else if (keycode == Common::KEYCODE_c) {
 		uint32 gasPocketRadius = _currentArea->_gasPocketRadius;
@@ -454,6 +460,8 @@ void DrillerEngine::pressedKey(const int keycode) {
 		}
 
 		_gameStateVars[k8bitVariableEnergy] = _gameStateVars[k8bitVariableEnergy] - 5;
+
+		// TODO: check if level is safe and decrement if necessary
 		_gameStateVars[32]--;
 		removeDrill();
 	}
@@ -475,8 +483,8 @@ bool DrillerEngine::checkDrill(const Math::Vector3d position) {
 	assert(obj);
 	obj = obj->duplicate();
 	obj->setOrigin(origin);
-	if (!_currentArea->checkCollisions(obj->_boundingBox))
-		return false;
+	//if (!_currentArea->checkCollisions(obj->_boundingBox))
+	//	return false;
 
 	heightLastObject = obj->getSize().y();
 	delete obj;
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index 877d195c7f9..ecdffbe8b51 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -374,7 +374,7 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
 
 	// Driller specific
 	area->_gasPocketPosition = Common::Point(32 * gasPocketX, 32 * gasPocketY);
-	area->_gasPocketRadius = gasPocketRadius;
+	area->_gasPocketRadius = 32 * gasPocketRadius;
 
 	while (numConditions--) {
 		FCLInstructionVector instructions;




More information about the Scummvm-git-logs mailing list