[Scummvm-git-logs] scummvm master -> 72084365afa995ae3e78ff3af85c359245a91f19

athrxx athrxx at scummvm.org
Thu Oct 31 13:12:39 CET 2019


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:
1a08072dea KYRA: (EOB/Amiga) - minor audio driver improvements
6651b08d31 KYRA: (EOB) - fix some typos in comments
72084365af KYRA: (LOL) - fix item pickup glitch


Commit: 1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a
    https://github.com/scummvm/scummvm/commit/1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a
Author: athrxx (athrxx at scummvm.org)
Date: 2019-10-31T13:10:22+01:00

Commit Message:
KYRA: (EOB/Amiga) - minor audio driver improvements

(mostly paranoia fixes)

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


diff --git a/engines/kyra/sound/drivers/audiomaster2.cpp b/engines/kyra/sound/drivers/audiomaster2.cpp
index 261c813..5fb8043 100644
--- a/engines/kyra/sound/drivers/audiomaster2.cpp
+++ b/engines/kyra/sound/drivers/audiomaster2.cpp
@@ -22,7 +22,7 @@
 
 #ifdef ENABLE_EOB
 
-#include "kyra/resource/resource.h"
+#include "kyra/kyra_v1.h"
 #include "kyra/sound/drivers/audiomaster2.h"
 
 #include "audio/mods/paula.h"
@@ -892,6 +892,8 @@ void AudioMaster2ResourceManager::initResource(SoundResource *resource) {
 	if (!resource)
 		return;
 
+	Common::StackLock lock(_mutex);
+
 	SoundResource *res = retrieveFromChain(resource->getName());
 	// The driver does not replace resources with the same name, but disposes the new resource instead.
 	// So these names seem to be considered "globally unique".
@@ -1198,12 +1200,11 @@ AudioMaster2Internal::AudioMaster2Internal(Audio::Mixer *mixer) : Paula(true, mi
 }
 
 AudioMaster2Internal::~AudioMaster2Internal() {
-	Common::StackLock lock(_mutex);
-
 	stopPaula();
-
 	_mixer->stopHandle(_soundHandle);
 
+	Common::StackLock lock(_mutex);
+
 	delete _res;
 	delete _io;
 }
@@ -1284,7 +1285,7 @@ void AudioMaster2Internal::fadeOut(int delay) {
 }
 
 bool AudioMaster2Internal::isFading() {
-	return _io->isFading();
+	return _ready ? _io->isFading() : false;
 }
 
 void AudioMaster2Internal::setMusicVolume(int volume) {
@@ -1313,18 +1314,18 @@ void AudioMaster2Internal::resetCounter() {
 }
 
 int AudioMaster2Internal::getPlayDuration() {
-	return _durationCounter;
+	return _ready ? _durationCounter : 0;
 }
 
 void AudioMaster2Internal::sync(SoundResource *res) {
 	if (!_ready || !res)
 		return;
 
+	Common::StackLock lock(_mutex);
+
 	if (res->getType() != 1)
 		return;
 
-	Common::StackLock lock(_mutex);
-
 	SoundResourceSMUS *smus = static_cast<SoundResourceSMUS*>(res);
 	_io->_tempo = smus->getTempo();
 	smus->setSync(_io->_sync);


Commit: 6651b08d311d90a8ae491f31b92ffa593795cbee
    https://github.com/scummvm/scummvm/commit/6651b08d311d90a8ae491f31b92ffa593795cbee
Author: athrxx (athrxx at scummvm.org)
Date: 2019-10-31T13:10:22+01:00

Commit Message:
KYRA: (EOB) - fix some typos in comments

Changed paths:
    engines/kyra/graphics/screen_eob.cpp
    engines/kyra/sound/drivers/audiomaster2.cpp


diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp
index 618f85f..4f31074 100644
--- a/engines/kyra/graphics/screen_eob.cpp
+++ b/engines/kyra/graphics/screen_eob.cpp
@@ -278,10 +278,10 @@ void Screen_EoB::loadEoBBitmap(const char *file, const uint8 *cgaMapping, int te
 
 		// This check is due to EOB II Amiga German. That version simply checks
 		// for certain file names which aren't actual CPS files. These files use
-		// a diffenrent format and compression type. I check the header size
+		// a different format and compression type. I check the header size
 		// info to identify these.
 		} else if (_vm->gameFlags().platform == Common::kPlatformAmiga) {
-			// Tolerance for diffenrences up to 2 bytes is needed in some cases
+			// Tolerance for size mismatches up to 2 bytes is needed in some cases
 			if ((((s->readUint16LE()) + 5) & ~3) != (((s->size()) + 3) & ~3))
 				loadAlternative = true;
 		} 
diff --git a/engines/kyra/sound/drivers/audiomaster2.cpp b/engines/kyra/sound/drivers/audiomaster2.cpp
index 5fb8043..352e106 100644
--- a/engines/kyra/sound/drivers/audiomaster2.cpp
+++ b/engines/kyra/sound/drivers/audiomaster2.cpp
@@ -662,7 +662,7 @@ void SoundResourceINST::loadSamples(Common::ReadStream *stream, uint32 size) {
 		instr->open();
 		_samplesResource = instr;
 	} else {
-		// This will come up quite often in EOB II. But never with intruments that are actually used. No need to bother the user with a warning here.
+		// This will come up quite often in EOB II. But never with instruments that are actually used. No need to bother the user with a warning here.
 		debugC(9, kDebugLevelSound, "SoundResourceINST::loadInstrument(): Samples resource '%s' not found for '%s'.", data, _name.c_str());
 		_samplesResource = 0;
 	}


Commit: 72084365afa995ae3e78ff3af85c359245a91f19
    https://github.com/scummvm/scummvm/commit/72084365afa995ae3e78ff3af85c359245a91f19
Author: athrxx (athrxx at scummvm.org)
Date: 2019-10-31T13:10:23+01:00

Commit Message:
KYRA: (LOL) - fix item pickup glitch

This fixes an original bug that recently got my attention.
While I never managed to duplicate items like the person in the video I did experience lockups.
Maybe the exploit works only  with the original executable...

https://www.youtube.com/watch?v=fkJ2KilULco&feature=youtu.be

https://www.youtube.com/watch?v=4oRESbQLDig&feature=youtu.be

Changed paths:
    engines/kyra/gui/gui_lol.cpp


diff --git a/engines/kyra/gui/gui_lol.cpp b/engines/kyra/gui/gui_lol.cpp
index 293d507..602309c 100644
--- a/engines/kyra/gui/gui_lol.cpp
+++ b/engines/kyra/gui/gui_lol.cpp
@@ -1300,9 +1300,18 @@ int LoLEngine::clickedScenePickupItem(Button *button) {
 
 	redrawSceneItem();
 
+	// WORKAROUND for original bug that allowed picking up items by clicking exactly 1 pixel from the
+	// left, right or bottom border (which could even cause lockups). We simply clip the item pixel
+	// search zone to the dimensions of the calling button...
+	const ScreenDim *dim = _screen->getScreenDim(button->dimTableIndex);
+	int clipLeft = (dim->sx << 3) + button->x;
+	int clipTop = dim->sy + button->y;
+	int clipRight = (dim->sx << 3) + button->x + button->width - 1;
+	int clipBottom = dim->sy + button->y + button->height - 1;
+
 	int p = 0;
 	for (int i = 0; i < len; i++) {
-		p = _screen->getPagePixel(_screen->_curPage, CLIP(_mouseX + checkX[i], 0, 320), CLIP(_mouseY + checkY[i], 0, 200));
+		p = _screen->getPagePixel(_screen->_curPage, CLIP(_mouseX + checkX[i], clipLeft, clipRight), CLIP(_mouseY + checkY[i], clipTop, clipBottom));
 		if (p)
 			break;
 	}





More information about the Scummvm-git-logs mailing list