[Scummvm-cvs-logs] scummvm master -> 1998ab500ea390ab5cba56ee9773d1a9b4f0b1df

DrMcCoy drmccoy at drmccoy.de
Wed Sep 14 21:48:49 CEST 2011


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

Summary:
2edfb693be GOB: Add EvilFish::mutate()
6c259c5d66 GOB: Randomize the evil fish types
c6bb055941 GOB: Play the shooting sound in the Diving minigame
1998ab500e GOB: Tell Geisha that we have no AdLib


Commit: 2edfb693bedbd578c6019970ae66b2d6384509ca
    https://github.com/scummvm/scummvm/commit/2edfb693bedbd578c6019970ae66b2d6384509ca
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-09-14T11:07:17-07:00

Commit Message:
GOB: Add EvilFish::mutate()

Changing a fish into a different fish type

Changed paths:
    engines/gob/minigames/geisha/evilfish.cpp
    engines/gob/minigames/geisha/evilfish.h



diff --git a/engines/gob/minigames/geisha/evilfish.cpp b/engines/gob/minigames/geisha/evilfish.cpp
index e2672d7..592e84a 100644
--- a/engines/gob/minigames/geisha/evilfish.cpp
+++ b/engines/gob/minigames/geisha/evilfish.cpp
@@ -158,6 +158,29 @@ void EvilFish::advance() {
 	}
 }
 
+void EvilFish::mutate(uint16 animSwimLeft, uint16 animSwimRight,
+                      uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie) {
+
+	_animSwimLeft  = animSwimLeft;
+	_animSwimRight = animSwimRight;
+	_animTurnLeft  = animTurnLeft;
+	_animTurnRight = animTurnRight;
+	_animDie       = animDie;
+
+	switch (_state) {
+	case kStateSwimLeft:
+		setAnimation(_animSwimLeft);
+		break;
+
+	case kStateSwimRight:
+		setAnimation(_animSwimRight);
+		break;
+
+	default:
+		break;
+	}
+}
+
 } // End of namespace Geisha
 
 } // End of namespace Gob
diff --git a/engines/gob/minigames/geisha/evilfish.h b/engines/gob/minigames/geisha/evilfish.h
index 1801ad9..223645f 100644
--- a/engines/gob/minigames/geisha/evilfish.h
+++ b/engines/gob/minigames/geisha/evilfish.h
@@ -56,6 +56,10 @@ public:
 	/** Advance the animation to the next frame. */
 	void advance();
 
+	/** Change the fish's animations, effectively making it a different fish type. */
+	void mutate(uint16 animSwimLeft, uint16 animSwimRight,
+	            uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie);
+
 private:
 	enum State {
 		kStateNone,


Commit: 6c259c5d66415e1c36640ae00ff38fa93a3e432f
    https://github.com/scummvm/scummvm/commit/6c259c5d66415e1c36640ae00ff38fa93a3e432f
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-09-14T11:31:50-07:00

Commit Message:
GOB: Randomize the evil fish types

Changed paths:
    engines/gob/minigames/geisha/diving.cpp



diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 355edd7..ae041b7 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -36,6 +36,15 @@ namespace Gob {
 
 namespace Geisha {
 
+static const int kEvilFishTypeCount = 3;
+
+static const int kEvilFishTypes[kEvilFishTypeCount][5] = {
+	{ 0, 14,  8,  9, 3}, // Shark
+	{15,  1, 12, 13, 3}, // Moray
+	{16,  2, 10, 11, 3}  // Ray
+};
+
+
 Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
 	_objects(0), _gui(0), _oko(0), _lungs(0), _heart(0),
 	_blackPearl(0), _whitePearlCount(0), _blackPearlCount(0) {
@@ -113,9 +122,8 @@ void Diving::init() {
 	_heart->setVisible(true);
 	_heart->setPause(true);
 
-	_evilFish[0] = new EvilFish(*_objects, 320,  0, 14,  8,  9, 3); // Shark
-	_evilFish[1] = new EvilFish(*_objects, 320, 15,  1, 12, 13, 3); // Moray
-	_evilFish[2] = new EvilFish(*_objects, 320, 16,  2, 10, 11, 3); // Ray
+	for (uint i = 0; i < kEvilFishCount; i++)
+		_evilFish[i] = new EvilFish(*_objects, 320, 0, 0, 0, 0, 0);
 
 	for (uint i = 0; i < kMaxShotCount; i++) {
 		_shot[i] = new ANIObject(*_objects);
@@ -221,6 +229,11 @@ void Diving::evilFishEnter() {
 		if (fish.isVisible())
 			continue;
 
+		int fishType = _vm->_util->getRandom(kEvilFishTypeCount);
+		fish.mutate(kEvilFishTypes[fishType][0], kEvilFishTypes[fishType][1],
+		            kEvilFishTypes[fishType][2], kEvilFishTypes[fishType][3],
+		            kEvilFishTypes[fishType][4]);
+
 		fish.enter((EvilFish::Direction)_vm->_util->getRandom(2), 90 + i * 20);
 	}
 }


Commit: c6bb05594122e58ab92fc04544e1fbebfe48580f
    https://github.com/scummvm/scummvm/commit/c6bb05594122e58ab92fc04544e1fbebfe48580f
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-09-14T11:43:06-07:00

Commit Message:
GOB: Play the shooting sound in the Diving minigame

Changed paths:
    engines/gob/minigames/geisha/diving.cpp
    engines/gob/minigames/geisha/diving.h



diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index ae041b7..38a62cc 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -29,6 +29,8 @@
 #include "gob/decfile.h"
 #include "gob/anifile.h"
 
+#include "gob/sound/sound.h"
+
 #include "gob/minigames/geisha/evilfish.h"
 #include "gob/minigames/geisha/diving.h"
 
@@ -149,12 +151,22 @@ void Diving::init() {
 		_anims.push_back(_evilFish[i]);
 	_anims.push_back(_lungs);
 	_anims.push_back(_heart);
+
+	_vm->_sound->sampleLoad(&_soundShoot     , SOUND_SND, "tirgim.snd");
+	_vm->_sound->sampleLoad(&_soundBreathe   , SOUND_SND, "respir.snd");
+	_vm->_sound->sampleLoad(&_soundWhitePearl, SOUND_SND, "virtou.snd");
+	_vm->_sound->sampleLoad(&_soundBlackPearl, SOUND_SND, "trouve.snd");
 }
 
 void Diving::deinit() {
 	_vm->_draw->_cursorHotspotX = -1;
 	_vm->_draw->_cursorHotspotY = -1;
 
+	_soundShoot.free();
+	_soundBreathe.free();
+	_soundWhitePearl.free();
+	_soundBlackPearl.free();
+
 	_anims.clear();
 
 	_activeShots.clear();
@@ -308,6 +320,8 @@ void Diving::shoot(int16 mouseX, int16 mouseY) {
 	_activeShots.push_back(_currentShot);
 
 	_currentShot = (_currentShot + 1) % kMaxShotCount;
+
+	_vm->_sound->blasterPlay(&_soundShoot, 1, 0);
 }
 
 void Diving::checkShots() {
diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h
index dd0773a..e2f5dd4 100644
--- a/engines/gob/minigames/geisha/diving.h
+++ b/engines/gob/minigames/geisha/diving.h
@@ -25,6 +25,8 @@
 
 #include "common/system.h"
 
+#include "gob/sound/sounddesc.h"
+
 namespace Gob {
 
 class GobEngine;
@@ -77,6 +79,12 @@ private:
 
 	uint8 _currentShot;
 
+	SoundDesc _soundShoot;
+	SoundDesc _soundBreathe;
+	SoundDesc _soundWhitePearl;
+	SoundDesc _soundBlackPearl;
+
+
 	void init();
 	void deinit();
 


Commit: 1998ab500ea390ab5cba56ee9773d1a9b4f0b1df
    https://github.com/scummvm/scummvm/commit/1998ab500ea390ab5cba56ee9773d1a9b4f0b1df
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-09-14T12:42:18-07:00

Commit Message:
GOB: Tell Geisha that we have no AdLib

The title music is then played from SND files instead of
MDY/TBR files (that we still don't yet support).

Changed paths:
    engines/gob/init.h
    engines/gob/init_geisha.cpp
    engines/gob/sound/sound.cpp



diff --git a/engines/gob/init.h b/engines/gob/init.h
index ac460fd..946a3fa 100644
--- a/engines/gob/init.h
+++ b/engines/gob/init.h
@@ -62,6 +62,7 @@ public:
 	~Init_Geisha();
 
 	void initVideo();
+	void initGame();
 };
 
 class Init_v2 : public Init_v1 {
diff --git a/engines/gob/init_geisha.cpp b/engines/gob/init_geisha.cpp
index 01081a5..b5bbcff 100644
--- a/engines/gob/init_geisha.cpp
+++ b/engines/gob/init_geisha.cpp
@@ -44,4 +44,11 @@ void Init_Geisha::initVideo() {
 	_vm->_draw->_transparentCursor =  1;
 }
 
+void Init_Geisha::initGame() {
+	// HACK - Since the MDY/TBR player is not working, claim we have no AdLib
+	_vm->_global->_soundFlags = 0;
+
+	Init::initGame();
+}
+
 } // End of namespace Gob
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index e064a31..bfe0394 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -434,6 +434,8 @@ void Sound::blasterPlay(SoundDesc *sndDesc, int16 repCount,
 	debugC(1, kDebugSound, "SoundBlaster: Playing sample (%d, %d, %d)",
 			repCount, frequency, fadeLength);
 
+	blasterStopComposition();
+
 	_blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
 }
 






More information about the Scummvm-git-logs mailing list