[Scummvm-cvs-logs] scummvm master -> caeae1a7d66843823a31bb99e081da0165a18a22

DrMcCoy drmccoy at drmccoy.de
Sat Jan 28 23:30:54 CET 2012


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:
caeae1a7d6 GOB: Pick the pearl at the right frame of the animation


Commit: caeae1a7d66843823a31bb99e081da0165a18a22
    https://github.com/scummvm/scummvm/commit/caeae1a7d66843823a31bb99e081da0165a18a22
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2012-01-28T14:29:47-08:00

Commit Message:
GOB: Pick the pearl at the right frame of the animation

And make the pearl picking a bit less...picky.

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 a635415..3f7d6fc 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -92,8 +92,7 @@ const Diving::PlantLevel Diving::kPlantLevels[] = {
 
 Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
 	_objects(0), _gui(0), _okoAnim(0), _lungs(0), _heart(0),
-	_blackPearl(0), _airMeter(0), _healthMeter(0),
-	_whitePearlCount(0), _blackPearlCount(0) {
+	_blackPearl(0), _airMeter(0), _healthMeter(0) {
 
 	_blackPearl = new Surface(11, 8, 1);
 
@@ -307,6 +306,9 @@ void Diving::init() {
 
 	_airCycle = 0;
 	_hurtGracePeriod = 0;
+
+	_whitePearlCount = 0;
+	_blackPearlCount = 0;
 }
 
 void Diving::deinit() {
@@ -467,6 +469,7 @@ void Diving::enterPearl(int16 x) {
 
 	_pearl.pearl->setVisible(true);
 	_pearl.pearl->setPause(false);
+	_pearl.picked = false;
 }
 
 void Diving::updateAirMeter() {
@@ -610,6 +613,21 @@ void Diving::updatePearl() {
 	if (!_oko->isMoving())
 		return;
 
+	// Picking the pearl
+	if (_pearl.picked && (_oko->getState() == Oko::kStatePick) && (_oko->getFrame() == 8)) {
+		// Remove the pearl
+		_pearl.pearl->setVisible(false);
+		_pearl.pearl->setPause(true);
+
+		// Add the pearl to our found pearls repository
+		if (_pearl.black)
+			foundBlackPearl();
+		else
+			foundWhitePearl();
+
+		return;
+	}
+
 	// Move the pearl
 	int16 x, y, width, height;
 	_pearl.pearl->getPosition(x, y);
@@ -635,18 +653,10 @@ void Diving::getPearl() {
 	_pearl.pearl->getFramePosition(x, y);
 	_pearl.pearl->getFrameSize(width, height);
 
-	if ((x > 175) || ((x + width) < 168))
+	if ((x > 190) || ((x + width) < 140))
 		return;
 
-	// Remove the pearl
-	_pearl.pearl->setVisible(false);
-	_pearl.pearl->setPause(true);
-
-	// Add the pearl to our found pearls repository
-	if (_pearl.black)
-		foundBlackPearl();
-	else
-		foundWhitePearl();
+	_pearl.picked = true;
 }
 
 void Diving::foundBlackPearl() {
diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h
index 5db1b81..65ae06e 100644
--- a/engines/gob/minigames/geisha/diving.h
+++ b/engines/gob/minigames/geisha/diving.h
@@ -101,6 +101,7 @@ private:
 	struct ManagedPearl {
 		ANIObject *pearl;
 
+		bool picked;
 		bool black;
 	};
 






More information about the Scummvm-git-logs mailing list