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

bgK bastien.bouclet at gmail.com
Sun Feb 14 09:59:45 CET 2016


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:
fe7e58d0d1 MOHAWK: Play the handle going up anim when closing the Myst cabin safe
4b81c807c8 MOHAWK: Issue a warning when trying to pop with no card pushed
f0e416a034 MOHAWK: Add a console command that does random clicks in all the cards
a12940c0a9 IMAGE: Fix a memory leak in the RPZA decoder


Commit: fe7e58d0d14e83a6a005f95237cb11d6a1119e83
    https://github.com/scummvm/scummvm/commit/fe7e58d0d14e83a6a005f95237cb11d6a1119e83
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-14T09:58:43+01:00

Commit Message:
MOHAWK: Play the handle going up anim when closing the Myst cabin safe

Changed paths:
    engines/mohawk/myst_stacks/myst.cpp
    engines/mohawk/myst_stacks/myst.h



diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 4009d0d..0576bdd 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -50,6 +50,7 @@ Myst::Myst(MohawkEngine_Myst *vm) :
 	_libraryBookcaseChanged = false;
 	_dockVaultState = 0;
 	_cabinDoorOpened = 0;
+	_cabinHandleDown = 0;
 	_cabinMatchState = 2;
 	_matchBurning = false;
 	_tree = nullptr;
@@ -626,7 +627,7 @@ uint16 Myst::getVar(uint16 var) {
 	case 307: // Cabin Boiler Fully Pressurized
 		return _state.cabinPilotLightLit == 1 && _state.cabinValvePosition > 12;
 	case 308: // Cabin handle position
-		return 0; // Not implemented in the original
+		return _cabinHandleDown;
 	default:
 		return MystScriptParser::getVar(var);
 	}
@@ -764,6 +765,9 @@ bool Myst::setVarValue(uint16 var, uint16 value) {
 	case 304: // Myst Library Image Present on Tower Rotation Map
 		_towerRotationMapInitialized = value;
 		break;
+	case 308: // Cabin handle position
+		_cabinHandleDown = value;
+		break;
 	case 309: // Tree stopped
 		_treeStopped = value;
 		break;
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 5c84cd7..9d66b79 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -256,6 +256,7 @@ protected:
 	bool _matchBurning;
 	uint16 _matchGoOutCnt;
 	uint16 _cabinDoorOpened; // 56
+	uint16 _cabinHandleDown; // 344
 	uint16 _cabinMatchState; // 60
 	uint32 _matchGoOutTime; // 144
 


Commit: 4b81c807c8432e48be64d971a4b6cc932bb9c109
    https://github.com/scummvm/scummvm/commit/4b81c807c8432e48be64d971a4b6cc932bb9c109
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-14T09:58:43+01:00

Commit Message:
MOHAWK: Issue a warning when trying to pop with no card pushed

Changed paths:
    engines/mohawk/myst_scripts.cpp



diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index a935ef5..0e14b24 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -509,6 +509,11 @@ void MystScriptParser::o_changeCardPop(uint16 op, uint16 var, uint16 argc, uint1
 	debugC(kDebugScript, "Opcode %d: Return To Stored Card Id", op);
 	debugC(kDebugScript, "\tCardId: %d", _savedCardId);
 
+	if (_savedCardId == 0) {
+		warning("No pushed card to go back to");
+		return;
+	}
+
 	TransitionType transition = static_cast<TransitionType>(argv[0]);
 
 	_vm->changeToCard(_savedCardId, transition);


Commit: f0e416a0341f437f267a505191e7485917c312dd
    https://github.com/scummvm/scummvm/commit/f0e416a0341f437f267a505191e7485917c312dd
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-14T09:58:43+01:00

Commit Message:
MOHAWK: Add a console command that does random clicks in all the cards

A surprisingly effective way of finding bugs

Changed paths:
    engines/mohawk/console.cpp
    engines/mohawk/console.h
    engines/mohawk/myst.cpp
    engines/mohawk/myst.h



diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index 629cfdf..93fa05f 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -63,6 +63,7 @@ MystConsole::MystConsole(MohawkEngine_Myst *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("disableInitOpcodes",	WRAP_METHOD(MystConsole, Cmd_DisableInitOpcodes));
 	registerCmd("cache",				WRAP_METHOD(MystConsole, Cmd_Cache));
 	registerCmd("resources",			WRAP_METHOD(MystConsole, Cmd_Resources));
+	registerCmd("quickTest",            WRAP_METHOD(MystConsole, Cmd_QuickTest));
 	registerVar("show_resource_rects",  &_vm->_showResourceRects);
 }
 
@@ -330,6 +331,44 @@ bool MystConsole::Cmd_Resources(int argc, const char **argv) {
 	return true;
 }
 
+bool MystConsole::Cmd_QuickTest(int argc, const char **argv) {
+	// Go through all the ages, all the views and click random stuff
+	for (uint i = 0; i < ARRAYSIZE(mystStackNames); i++) {
+		if (i == 2 || i == 5 || i == 9 || i == 10) continue;
+		debug("Loading stack %s", mystStackNames[i]);
+		_vm->changeToStack(i, default_start_card[i], 0, 0);
+
+		Common::Array<uint16> ids = _vm->getResourceIDList(ID_VIEW);
+		for (uint j = 0; j < ids.size(); j++) {
+			if (ids[j] == 4632) continue;
+
+			debug("Loading card %d", ids[j]);
+			_vm->changeToCard(ids[j], kTransitionCopy);
+
+			_vm->_video->updateMovies();
+			_vm->_scriptParser->runPersistentScripts();
+			_vm->_system->updateScreen();
+
+			int16 resIndex = _vm->_rnd->getRandomNumber(_vm->_resources.size()) - 1;
+			if (resIndex >= 0 && _vm->_resources[resIndex]->isEnabled()) {
+				_vm->_resources[resIndex]->handleMouseDown();
+				_vm->_resources[resIndex]->handleMouseUp();
+			}
+
+			_vm->_video->updateMovies();
+			_vm->_scriptParser->runPersistentScripts();
+			_vm->_system->updateScreen();
+
+			if (_vm->getCurStack() != i) {
+				// Clicking may have linked us to another age
+				_vm->changeToStack(i, default_start_card[i], 0, 0);
+			}
+		}
+	}
+
+	return true;
+}
+
 #endif // ENABLE_MYST
 
 #ifdef ENABLE_RIVEN
diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h
index af01c0d..dc40049 100644
--- a/engines/mohawk/console.h
+++ b/engines/mohawk/console.h
@@ -55,6 +55,7 @@ private:
 	bool Cmd_DisableInitOpcodes(int argc, const char **argv);
 	bool Cmd_Cache(int argc, const char **argv);
 	bool Cmd_Resources(int argc, const char **argv);
+	bool Cmd_QuickTest(int argc, const char **argv);
 };
 
 #endif
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index dc6fe9a..852196e 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -121,6 +121,10 @@ Common::SeekableReadStream *MohawkEngine_Myst::getResource(uint32 tag, uint16 id
 	return nullptr;
 }
 
+Common::Array<uint16> MohawkEngine_Myst::getResourceIDList(uint32 type) const {
+	return _mhk[0]->getResourceIDList(type);
+}
+
 void MohawkEngine_Myst::cachePreload(uint32 tag, uint16 id) {
 	if (!_cache.enabled)
 		return;
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 6e661b6..4b4ceb4 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -174,6 +174,7 @@ public:
 	virtual ~MohawkEngine_Myst();
 
 	Common::SeekableReadStream *getResource(uint32 tag, uint16 id) override;
+	Common::Array<uint16> getResourceIDList(uint32 type) const;
 
 	Common::String wrapMovieFilename(const Common::String &movieName, uint16 stack);
 


Commit: a12940c0a9d67ceb3e13a0b20f50000cc18841a3
    https://github.com/scummvm/scummvm/commit/a12940c0a9d67ceb3e13a0b20f50000cc18841a3
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-14T09:58:43+01:00

Commit Message:
IMAGE: Fix a memory leak in the RPZA decoder

Changed paths:
    image/codecs/rpza.cpp



diff --git a/image/codecs/rpza.cpp b/image/codecs/rpza.cpp
index 8d648e1..db0d512 100644
--- a/image/codecs/rpza.cpp
+++ b/image/codecs/rpza.cpp
@@ -50,6 +50,7 @@ RPZADecoder::~RPZADecoder() {
 	}
 
 	delete[] _ditherPalette;
+	delete[] _colorMap;
 }
 
 #define ADVANCE_BLOCK() \






More information about the Scummvm-git-logs mailing list