[Scummvm-cvs-logs] scummvm master -> 4207fbd2d6f2ee01e6992de526c0c43333b8e624

bluegr bluegr at gmail.com
Mon Jul 7 01:01:50 CEST 2014


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

Summary:
4207fbd2d6 NEVERHOOD: Play a single sound when losing the memory puzzle (bug #6672)


Commit: 4207fbd2d6f2ee01e6992de526c0c43333b8e624
    https://github.com/scummvm/scummvm/commit/4207fbd2d6f2ee01e6992de526c0c43333b8e624
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-07T02:00:58+03:00

Commit Message:
NEVERHOOD: Play a single sound when losing the memory puzzle (bug #6672)

When the memory puzzle is reset, each revealed tile gets hidden again.
When a lot of tiles were hidden, the multiple clicking sounds would
fill the available sound slots. To avoid this, only a single click is
sounded when losing

Changed paths:
    engines/neverhood/modules/module1400.cpp
    engines/neverhood/modules/module1400_sprites.cpp
    engines/neverhood/modules/module1400_sprites.h



diff --git a/engines/neverhood/modules/module1400.cpp b/engines/neverhood/modules/module1400.cpp
index 551b687..465ad59 100644
--- a/engines/neverhood/modules/module1400.cpp
+++ b/engines/neverhood/modules/module1400.cpp
@@ -709,13 +709,14 @@ Scene1405::Scene1405(NeverhoodEngine *vm, Module *parentModule)
 
 void Scene1405::update() {
 	Scene::update();
+	// Check if the player chose a wrong tile, in which case the whole grid gets reset
 	if (_countdown != 0 && (--_countdown == 0)) {
 		_tilesLeft = 48;
-		_tiles[_firstTileIndex]->hide();
-		_tiles[_secondTileIndex]->hide();
+		_tiles[_firstTileIndex]->hide(true);
+		_tiles[_secondTileIndex]->hide(false);
 		for (uint32 i = 0; i < 48; i++) {
 			if (getSubVar(VA_IS_TILE_MATCH, i)) {
-				_tiles[i]->hide();
+				_tiles[i]->hide(false);
 				setSubVar(VA_IS_TILE_MATCH, i, 0);
 			}
 		}
diff --git a/engines/neverhood/modules/module1400_sprites.cpp b/engines/neverhood/modules/module1400_sprites.cpp
index 30a5c34..99a2a31 100644
--- a/engines/neverhood/modules/module1400_sprites.cpp
+++ b/engines/neverhood/modules/module1400_sprites.cpp
@@ -873,10 +873,11 @@ void AsScene1405Tile::show() {
 	}
 }
 
-void AsScene1405Tile::hide() {
+void AsScene1405Tile::hide(bool playClickSound) {
 	if (_isShowing) {
 		_isShowing = false;
-		playSound(0);
+		if (playClickSound)
+			playSound(0);
 		setVisible(false);
 	}
 }
diff --git a/engines/neverhood/modules/module1400_sprites.h b/engines/neverhood/modules/module1400_sprites.h
index fe0db66..e709193 100644
--- a/engines/neverhood/modules/module1400_sprites.h
+++ b/engines/neverhood/modules/module1400_sprites.h
@@ -155,7 +155,7 @@ class AsScene1405Tile : public AnimatedSprite {
 public:
 	AsScene1405Tile(NeverhoodEngine *vm, Scene1405 *parentScene, uint32 tileIndex);
 	void show();
-	void hide();
+	void hide(bool playClickSound);
 protected:
 	Scene1405 *_parentScene;
 	bool _isShowing;






More information about the Scummvm-git-logs mailing list