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

DrMcCoy drmccoy at drmccoy.de
Mon Aug 29 14:13:45 CEST 2011


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:
b516e4f440 GOB: Add a workaround for some of Geisha's textboxes


Commit: b516e4f440fa853f129c2802733deebfd22566d1
    https://github.com/scummvm/scummvm/commit/b516e4f440fa853f129c2802733deebfd22566d1
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-08-29T05:10:10-07:00

Commit Message:
GOB: Add a workaround for some of Geisha's textboxes

Geisha often displays text while it loads a new TOT.
Back in the days, this took long enough so that the text
could be read. Since this isn't the case anymore, we'll
wait for the user to press a key or click the mouse.

Changed paths:
    engines/gob/inter.h
    engines/gob/inter_geisha.cpp



diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 764c7bf..c84cc38 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -345,6 +345,7 @@ protected:
 	virtual void setupOpcodesGob();
 
 	void oGeisha_loadCursor(OpFuncParams &params);
+	void oGeisha_loadTot(OpFuncParams &params);
 	void oGeisha_goblinFunc(OpFuncParams &params);
 	void oGeisha_loadSound(OpFuncParams &params);
 	void oGeisha_checkData(OpFuncParams &params);
@@ -361,6 +362,8 @@ protected:
 	void oGeisha_caress2(OpGobParams &params);
 
 	int16 loadSound(int16 slot);
+
+	bool keyPressed();
 };
 
 class Inter_v2 : public Inter_v1 {
diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp
index e547285..6c3e97c 100644
--- a/engines/gob/inter_geisha.cpp
+++ b/engines/gob/inter_geisha.cpp
@@ -56,6 +56,7 @@ void Inter_Geisha::setupOpcodesFunc() {
 	Inter_v1::setupOpcodesFunc();
 
 	OPCODEFUNC(0x03, oGeisha_loadCursor);
+	OPCODEFUNC(0x12, oGeisha_loadTot);
 	OPCODEFUNC(0x25, oGeisha_goblinFunc);
 	OPCODEFUNC(0x3A, oGeisha_loadSound);
 	OPCODEFUNC(0x3F, oGeisha_checkData);
@@ -81,6 +82,62 @@ void Inter_Geisha::oGeisha_loadCursor(OpFuncParams &params) {
 	o1_loadCursor(params);
 }
 
+bool Inter_Geisha::keyPressed() {
+	int16 key = _vm->_util->checkKey();
+	if (key)
+		return true;
+
+	int16 x, y;
+	MouseButtons buttons;
+
+	_vm->_util->getMouseState(&x, &y, &buttons);
+	return buttons != kMouseButtonsNone;
+}
+
+struct TOTTransition {
+	const char *to;
+	const char *from;
+	int32 offset;
+};
+
+static const TOTTransition kTOTTransitions[] = {
+	{"chambre.tot", "photo.tot"  ,  1801},
+	{"mo.tot"     , "chambre.tot", 13580},
+	{"chambre.tot", "mo.tot"     ,   564},
+	{"hard.tot"   , "chambre.tot", 13917},
+	{"carte.tot"  , "hard.tot"   , 17926},
+	{"chambre.tot", "carte.tot"  , 14609},
+	{"chambre.tot", "mo.tot"     ,  3658},
+	{"streap.tot" , "chambre.tot", 14652},
+	{"bonsai.tot" , "porte.tot"  ,  2858},
+	{"lit.tot"    , "napa.tot"   ,  3380},
+	{"oko.tot"    , "chambre.tot", 14146},
+	{"chambre.tot", "oko.tot"    ,  2334}
+};
+
+void Inter_Geisha::oGeisha_loadTot(OpFuncParams &params) {
+	o1_loadTot(params);
+
+	// WORKAROUND: Geisha often displays text while it loads a new TOT.
+	//             Back in the days, this took long enough so that the text
+	//             could be read. Since this isn't the case anymore, we'll
+	//             wait for the user to press a key or click the mouse.
+	bool needWait = false;
+
+	for (int i = 0; i < ARRAYSIZE(kTOTTransitions); i++)
+		if ((_vm->_game->_script->pos() == kTOTTransitions[i].offset) &&
+		    (_vm->_game->_totToLoad     == kTOTTransitions[i].to) &&
+		    (_vm->_game->_curTotFile    == kTOTTransitions[i].from)) {
+
+			needWait = true;
+			break;
+		}
+
+	if (needWait)
+		while (!keyPressed())
+			_vm->_util->longDelay(1);
+}
+
 void Inter_Geisha::oGeisha_loadSound(OpFuncParams &params) {
 	loadSound(-1);
 }






More information about the Scummvm-git-logs mailing list