[Scummvm-cvs-logs] scummvm master -> 8fff7e29de2663e961c4be92f5f433f69313030b

yaz0r vincent.hamm at gmail.com
Tue Aug 14 09:00:29 CEST 2012


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

Summary:
92df76fbb3 CINE: Fix system menu sometimes not appearing in OS
8fff7e29de Merge pull request #266 from yaz0r/master


Commit: 92df76fbb3802bf28819c2684d188251c249cdbb
    https://github.com/scummvm/scummvm/commit/92df76fbb3802bf28819c2684d188251c249cdbb
Author: Vincent Hamm (vincent.hamm at gmail.com)
Date: 2012-08-13T23:58:32-07:00

Commit Message:
CINE: Fix system menu sometimes not appearing in OS

Changed paths:
    engines/cine/cine.cpp
    engines/cine/gfx.cpp
    engines/cine/main_loop.cpp
    engines/cine/script_fw.cpp
    engines/cine/various.cpp
    engines/cine/various.h



diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 6b94c33..bbe2cd4 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -189,6 +189,8 @@ void CineEngine::initialize() {
 	g_cine->_messageTable.clear();
 	resetObjectTable();
 
+	disableSystemMenu = 1;
+
 	var8 = 0;
 
 	var2 = var3 = var4 = var5 = 0;
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index c51420e..adc501b 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -249,14 +249,17 @@ void FWRenderer::drawCommand() {
 	unsigned int i;
 	int x = 10, y = _cmdY;
 
-	drawPlainBox(x, y, 301, 11, 0);
-	drawBorder(x - 1, y - 1, 302, 12, 2);
+	if(disableSystemMenu == 0)
+	{
+		drawPlainBox(x, y, 301, 11, 0);
+		drawBorder(x - 1, y - 1, 302, 12, 2);
 
-	x += 2;
-	y += 2;
+		x += 2;
+		y += 2;
 
-	for (i = 0; i < _cmd.size(); i++) {
-		x = drawChar(_cmd[i], x, y);
+		for (i = 0; i < _cmd.size(); i++) {
+			x = drawChar(_cmd[i], x, y);
+		}
 	}
 }
 
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 7cd3cac..f13f38a 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -121,7 +121,7 @@ static void processEvent(Common::Event &event) {
 			}
 			break;
 		case Common::KEYCODE_F10:
-			if (!disableSystemMenu && !inMenu) {
+			if (!inMenu) {
 				g_cine->makeSystemMenu();
 			}
 			break;
@@ -384,8 +384,8 @@ void CineEngine::mainLoop(int bootScriptIdx) {
 			playerAction = false;
 
 			_messageLen <<= 3;
-			if (_messageLen < 0x800)
-				_messageLen = 0x800;
+			if (_messageLen < 800)
+				_messageLen = 800;
 
 			do {
 				manageEvents();
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index 66150cc..a34bf7b 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -1861,7 +1861,7 @@ int FWScript::o1_disableSystemMenu() {
 	byte param = getNextByte();
 
 	debugC(5, kCineDebugScript, "Line: %d: disableSystemMenu(%d)", _line, param);
-	disableSystemMenu = (param != 0);
+	disableSystemMenu = param;
 	return 0;
 }
 
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 9b73ae1..eccd71c 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -36,7 +36,7 @@
 
 namespace Cine {
 
-bool disableSystemMenu = false;
+int16 disableSystemMenu = 0;
 bool inMenu;
 
 int16 commandVar3[4];
@@ -341,7 +341,7 @@ void CineEngine::makeSystemMenu() {
 	int16 mouseX, mouseY, mouseButton;
 	int16 selectedSave;
 
-	if (!disableSystemMenu) {
+	if (disableSystemMenu != 1) {
 		inMenu = true;
 
 		do {
@@ -544,14 +544,16 @@ int16 buildObjectListCommand(int16 param) {
 
 int16 selectSubObject(int16 x, int16 y, int16 param) {
 	int16 listSize = buildObjectListCommand(param);
-	int16 selectedObject;
+	int16 selectedObject = -1;
 	bool osExtras = g_cine->getGameType() == Cine::GType_OS;
 
 	if (!listSize) {
 		return -2;
 	}
 
-	selectedObject = makeMenuChoice(objectListCommand, listSize, x, y, 140, osExtras);
+	if (disableSystemMenu == 0) {
+		selectedObject = makeMenuChoice(objectListCommand, listSize, x, y, 140, osExtras);
+	}
 
 	if (selectedObject == -1)
 		return -1;
@@ -691,9 +693,6 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
 	int16 var_4;
 	SelectionMenu *menu;
 
-	if (disableSystemMenu)
-		return -1;
-
 	paramY = (height * 9) + 10;
 
 	if (X + width > 319) {
@@ -810,14 +809,18 @@ void makeActionMenu() {
 	getMouseData(mouseUpdateStatus, &mouseButton, &mouseX, &mouseY);
 
 	if (g_cine->getGameType() == Cine::GType_OS) {
-		playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70, true);
+		if(disableSystemMenu == 0) {
+			playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70, true);
+		}
 
 		if (playerCommand >= 8000) {
 			playerCommand -= 8000;
 			canUseOnObject = canUseOnItemTable[playerCommand];
 		}
 	} else {
-		playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
+		if(disableSystemMenu == 0) {
+			playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
+		}
 	}
 
 	inMenu = false;
diff --git a/engines/cine/various.h b/engines/cine/various.h
index 0c1883c..8136198 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -41,7 +41,7 @@ void makeActionMenu();
 void waitPlayerInput();
 void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4);
 
-extern bool disableSystemMenu;
+extern int16 disableSystemMenu;
 extern bool inMenu;
 
 extern CommandeType currentSaveName[10];


Commit: 8fff7e29de2663e961c4be92f5f433f69313030b
    https://github.com/scummvm/scummvm/commit/8fff7e29de2663e961c4be92f5f433f69313030b
Author: yaz0r (vincent.hamm at gmail.com)
Date: 2012-08-13T23:59:59-07:00

Commit Message:
Merge pull request #266 from yaz0r/master

Fix system menu in OS

Changed paths:
    engines/cine/cine.cpp
    engines/cine/gfx.cpp
    engines/cine/main_loop.cpp
    engines/cine/script_fw.cpp
    engines/cine/various.cpp
    engines/cine/various.h









More information about the Scummvm-git-logs mailing list