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

DrMcCoy drmccoy at drmccoy.de
Thu Jun 7 04:29:57 CEST 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:
c37577a950 GOB: Hook up the Penetration minigame in the cheater


Commit: c37577a950f7337889d5c705c9bc67d434ed3670
    https://github.com/scummvm/scummvm/commit/c37577a950f7337889d5c705c9bc67d434ed3670
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2012-06-06T19:29:10-07:00

Commit Message:
GOB: Hook up the Penetration minigame in the cheater

Changed paths:
    engines/gob/cheater.h
    engines/gob/cheater_geisha.cpp
    engines/gob/inter_geisha.cpp
    engines/gob/minigames/geisha/penetration.cpp
    engines/gob/minigames/geisha/penetration.h



diff --git a/engines/gob/cheater.h b/engines/gob/cheater.h
index 334a5e8..bf6c137 100644
--- a/engines/gob/cheater.h
+++ b/engines/gob/cheater.h
@@ -31,6 +31,7 @@ namespace Gob {
 
 namespace Geisha {
 	class Diving;
+	class Penetration;
 }
 
 class GobEngine;
@@ -48,13 +49,14 @@ protected:
 
 class Cheater_Geisha : public Cheater {
 public:
-	Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving);
+	Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving, Geisha::Penetration *penetration);
 	~Cheater_Geisha();
 
 	bool cheat(GUI::Debugger &console);
 
 private:
-	Geisha::Diving *_diving;
+	Geisha::Diving      *_diving;
+	Geisha::Penetration *_penetration;
 };
 
 } // End of namespace Gob
diff --git a/engines/gob/cheater_geisha.cpp b/engines/gob/cheater_geisha.cpp
index 3d8c567..567333c 100644
--- a/engines/gob/cheater_geisha.cpp
+++ b/engines/gob/cheater_geisha.cpp
@@ -27,11 +27,12 @@
 #include "gob/inter.h"
 
 #include "gob/minigames/geisha/diving.h"
+#include "gob/minigames/geisha/penetration.h"
 
 namespace Gob {
 
-Cheater_Geisha::Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving) :
-	Cheater(vm), _diving(diving) {
+Cheater_Geisha::Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving, Geisha::Penetration *penetration) :
+	Cheater(vm), _diving(diving), _penetration(penetration) {
 
 }
 
@@ -45,6 +46,12 @@ bool Cheater_Geisha::cheat(GUI::Debugger &console) {
 		return false;
 	}
 
+	// A cheat to get around the Penetration minigame
+	if (_penetration->isPlaying()) {
+		_penetration->cheatWin();
+		return false;
+	}
+
 	// A cheat to get around the mastermind puzzle
 	if (_vm->isCurrentTot("hard.tot") && _vm->_inter->_variables) {
 		uint32 digit1 = READ_VARO_UINT32(0x768);
diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp
index 99f834d..75204a3 100644
--- a/engines/gob/inter_geisha.cpp
+++ b/engines/gob/inter_geisha.cpp
@@ -55,7 +55,7 @@ Inter_Geisha::Inter_Geisha(GobEngine *vm) : Inter_v1(vm),
 	_diving      = new Geisha::Diving(vm);
 	_penetration = new Geisha::Penetration(vm);
 
-	_cheater = new Cheater_Geisha(vm, _diving);
+	_cheater = new Cheater_Geisha(vm, _diving, _penetration);
 
 	_vm->_console->registerCheater(_cheater);
 }
diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp
index e260d3c..9791757 100644
--- a/engines/gob/minigames/geisha/penetration.cpp
+++ b/engines/gob/minigames/geisha/penetration.cpp
@@ -377,7 +377,7 @@ Penetration::ManagedSub::~ManagedSub() {
 
 
 Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(0), _sprites(0), _objects(0), _sub(0),
-	_shieldMeter(0), _healthMeter(0), _floor(0) {
+	_shieldMeter(0), _healthMeter(0), _floor(0), _isPlaying(false) {
 
 	_background = new Surface(320, 200, 1);
 
@@ -404,6 +404,8 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) {
 	_hasMaxEnergy  = hasMaxEnergy;
 	_testMode      = testMode;
 
+	_isPlaying = true;
+
 	init();
 	initScreen();
 
@@ -432,9 +434,19 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) {
 	deinit();
 	drawEndText();
 
+	_isPlaying = false;
+
 	return hasWon();
 }
 
+bool Penetration::isPlaying() const {
+	return _isPlaying;
+}
+
+void Penetration::cheatWin() {
+	_floor = 3;
+}
+
 void Penetration::init() {
 	// Load sounds
 	_vm->_sound->sampleLoad(&_soundShield, SOUND_SND, "boucl.snd");
@@ -748,6 +760,10 @@ void Penetration::checkInput() {
 				_keys[kKeyRight] = true;
 			else if (event.kbd.keycode == Common::KEYCODE_SPACE)
 				_keys[kKeySpace] = true;
+			else if (event.kbd.keycode == Common::KEYCODE_d) {
+				_vm->getDebugger()->attach();
+				_vm->getDebugger()->onFrame();
+			}
 			break;
 
 		case Common::EVENT_KEYUP:
diff --git a/engines/gob/minigames/geisha/penetration.h b/engines/gob/minigames/geisha/penetration.h
index 0f36453..0336ef8 100644
--- a/engines/gob/minigames/geisha/penetration.h
+++ b/engines/gob/minigames/geisha/penetration.h
@@ -50,6 +50,9 @@ public:
 
 	bool play(bool hasAccessPass, bool hasMaxEnergy, bool testMode);
 
+	bool isPlaying() const;
+	void cheatWin();
+
 private:
 	static const int kModeCount  = 2;
 	static const int kFloorCount = 3;
@@ -141,6 +144,8 @@ private:
 	SoundDesc _soundShoot;
 	SoundDesc _soundExit;
 
+	bool _isPlaying;
+
 
 	void init();
 	void deinit();






More information about the Scummvm-git-logs mailing list