[Scummvm-git-logs] scummvm master -> c4780d2befd15dbd66ac54de4a18f29fbc7acd93

athrxx athrxx at scummvm.org
Tue Jan 7 21:49:44 UTC 2020


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:
3dd3b61685 KYRA: (EOB/PC98) - fix music fadeout
70d7de0b98 KYRA: (LOK) - implement FM-TOWNS specific screen shake
c4780d2bef GRAPHICS: Fix screen shake x/y offsets scaling


Commit: 3dd3b616858ed3aeda4cd0cb047f19efb588f7b2
    https://github.com/scummvm/scummvm/commit/3dd3b616858ed3aeda4cd0cb047f19efb588f7b2
Author: athrxx (athrxx at scummvm.org)
Date: 2020-01-07T22:47:31+01:00

Commit Message:
KYRA: (EOB/PC98) - fix music fadeout

(irrelevant to the game, since this function isn't used, but I like to fix it nonetheless)

Changed paths:
    engines/kyra/sound/drivers/mlalf98.cpp


diff --git a/engines/kyra/sound/drivers/mlalf98.cpp b/engines/kyra/sound/drivers/mlalf98.cpp
index b2cb6d9..1474589 100644
--- a/engines/kyra/sound/drivers/mlalf98.cpp
+++ b/engines/kyra/sound/drivers/mlalf98.cpp
@@ -436,7 +436,7 @@ bool SoundChannel::_globalBlock = false;
 SoundChannel::SoundChannel(PC98AudioCore *pc98a, int part, int regOffset, int type) : _pc98a(pc98a), _regOffset(regOffset), _part(part),
 _ticksLeft(0), _program(0), _volume(0), _algorithm(0), _envRR(0), _vbrDelay(0), _vbrRem(0), _vbrRate(0), _vbrTicker(0), _vbrStepSize(0), _vbrModifier(0),
 _vbrDepth(0), _vbrState(0), _duration(0), _frequency(0), _flags2(0), _note(0), _flags(0),
-_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(0), _trmCarrier(1),
+_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(16), _trmCarrier(1),
 _dataPtr(0), _dataEnd(0), _loopStartPtr(0), _instrBuffer(0), _backupData(0), _mute(false), _type(type) {
 	_subOpcodes[0].reserve(8);
 	_subOpcodes[1].reserve(8);
@@ -510,6 +510,8 @@ void SoundChannel::updateFadeOut() {
 	if (--_fadeTicker)
 		return;
 
+	_fadeTicker = 16;
+
 	if (!_fadeProgress)
 		return;
 


Commit: 70d7de0b98cb0bf181f18125defab1ffb2d1efb5
    https://github.com/scummvm/scummvm/commit/70d7de0b98cb0bf181f18125defab1ffb2d1efb5
Author: athrxx (athrxx at scummvm.org)
Date: 2020-01-07T22:47:31+01:00

Commit Message:
KYRA: (LOK) - implement FM-TOWNS specific screen shake

(the FM-TOWNS version has a better shake animation)

Changed paths:
    engines/kyra/graphics/screen.cpp


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 7d8c1b1..dd264a1 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3170,26 +3170,31 @@ void Screen::rectClip(int &x, int &y, int w, int h) {
 }
 
 void Screen::shakeScreen(int times) {
-	while (times--) {
-		// The original did not need an artificial delay, but we do.
-		// Or the shake will be too fast to be actually seen.
-		uint32 delayuntil = _system->getMillis() + 16;
+	static const int8 _shakeParaPC[] = { 32, 0, -4, 32, 0, 0 };
+	static const int8 _shakeParaFMTOWNS[] = { 32, 0, -4, 48, 0, 4, 32, -4, 0, 32, 4, 0, 32, 0, 0 };
 
-		// seems to be 1 line (320 pixels) offset in the original
-		// -4 looks more like dosbox though, maybe check this again		
-		_system->setShakePos(0, -4);
-		_system->updateScreen();
+	const int8 *data = _shakeParaPC;
+	int steps = ARRAYSIZE(_shakeParaPC) / 3;
 
-		int diff = delayuntil - _system->getMillis();
-		if (diff > 0)
-			_system->delayMillis(diff);
-		delayuntil = _system->getMillis() + 16;
-		_system->setShakePos(0, 0);
-		_system->updateScreen();
+	// The FM-TOWNS version has a slightly better shake animation
+	// TODO: check PC-98 version
+	if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
+		data = _shakeParaFMTOWNS;
+		steps = ARRAYSIZE(_shakeParaFMTOWNS) / 3;
+	}
 
-		diff = delayuntil - _system->getMillis();
-		if (diff > 0)
-			_system->delayMillis(diff);
+	while (times--) {
+		for (int i = 0; i < steps; ++i) {
+			// The original PC version did not need an artificial delay, but we do.
+			// Or the shake will be too fast to be actually seen.
+			uint32 delayuntil = _system->getMillis() + data[0];
+			_system->setShakePos(data[1], data[2]);
+			_system->updateScreen();
+			int diff = delayuntil - _system->getMillis();
+			if (diff > 0)
+				_system->delayMillis(diff);
+			data += 3;
+		}
 	}
 }
 


Commit: c4780d2befd15dbd66ac54de4a18f29fbc7acd93
    https://github.com/scummvm/scummvm/commit/c4780d2befd15dbd66ac54de4a18f29fbc7acd93
Author: athrxx (athrxx at scummvm.org)
Date: 2020-01-07T22:47:32+01:00

Commit Message:
GRAPHICS: Fix screen shake x/y offsets scaling

The x and y offsets need to be scaled the same way as the rest of the screen output.

Changed paths:
    backends/graphics/windowed.h


diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h
index 40fbe8b..bea4522 100644
--- a/backends/graphics/windowed.h
+++ b/backends/graphics/windowed.h
@@ -405,9 +405,9 @@ private:
 					width = fracToInt(height * displayAspect);
 			}
 		}
-
-		drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset;
-		drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset;
+		
+		drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * _windowWidth / getWidth();
+		drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * _windowHeight / getHeight();
 		drawRect.setWidth(width);
 		drawRect.setHeight(height);
 	}




More information about the Scummvm-git-logs mailing list