[Scummvm-cvs-logs] SF.net SVN: scummvm:[33805] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Tue Aug 12 21:33:17 CEST 2008


Revision: 33805
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33805&view=rev
Author:   buddha_
Date:     2008-08-12 19:33:17 +0000 (Tue, 12 Aug 2008)

Log Message:
-----------
Implemented Operation Stealth's makeCommandLine.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/texte.cpp
    scummvm/trunk/engines/cine/texte.h
    scummvm/trunk/engines/cine/various.cpp

Modified: scummvm/trunk/engines/cine/texte.cpp
===================================================================
--- scummvm/trunk/engines/cine/texte.cpp	2008-08-12 19:02:21 UTC (rev 33804)
+++ scummvm/trunk/engines/cine/texte.cpp	2008-08-12 19:33:17 UTC (rev 33805)
@@ -34,7 +34,8 @@
 const CommandeType *systemMenu;
 const CommandeType *confirmMenu;
 const char **otherMessages;
-const char *commandPrepositionOn;
+const char *defaultCommandPreposition;
+const char **commandPrepositionTable;
 
 void generateMask(const byte *sprite, byte *mask, uint16 size, byte transparency);
 
@@ -190,6 +191,16 @@
 		"NOACTION"
 	};
 
+	static const char *commandPrepositionTable_EN[] = {
+		"",   // EXAMINE
+		"",   // TAKE
+		"",   // INVENTORY
+		"on", // USE
+		"",   // OPERATE
+		"to", // SPEAK
+		""    // NOACTION
+	};
+
 	static const CommandeType systemMenu_EN[] = {
 		"Pause",
 		"Restart Game",
@@ -206,8 +217,7 @@
 		"Loading | %s",
 		"Loading canceled ...",
 		"No baclup in the drive...",
-		"Please enter the backup name",
-		"on"
+		"Please enter the backup name"
 	};
 
 	static const CommandeType confirmMenu_EN[] = {
@@ -258,6 +268,16 @@
 		"NOACTION"
 	};
 
+	static const char *commandPrepositionTable_FR[] = {
+		"",    // EXAMINER
+		"",    // PRENDRE
+		"",    // INVENTAIRE
+		"sur", // UTILISER
+		"",    // ACTIONNER
+		"a",   // PARLER
+		""     // NOACTION
+	};
+
 	static const CommandeType systemMenu_FR[] = {
 		"Pause",
 		"Nouvelle partie",
@@ -279,8 +299,7 @@
 		"Sauvegarde de | %s",
 		"Sauvegarde Annul\x82""e ...",
 		"Aucune sauvegarde dans le lecteur ...",
-		"Veuillez entrer le Nom de la Sauvegarde .",
-		"sur"
+		"Veuillez entrer le Nom de la Sauvegarde ."
 	};
 
 	static const char *failureMessages_ES[] = {
@@ -326,6 +345,16 @@
 		"NOACTION"
 	};
 
+	static const char *commandPrepositionTable_ES[] = {
+		"",      // EXAMINAR
+		"",      // COGER
+		"",      // INVENTARIO
+		"donde", // USAR
+		"",      // ACCIONAR
+		"a",     // HABLAR
+		""       // NOACTION
+	};
+
 	static const CommandeType systemMenu_ES[] = {
 		"Pause",
 		"Nueva partida",
@@ -347,8 +376,7 @@
 		"Gabacion de| %s",
 		"Rrabacion anulada",
 		"No hay partidas grabadas en este disco...",
-		"Teclea el nombre de la partida grabada",
-		"donde"
+		"Teclea el nombre de la partida grabada"
 	};
 
 	static const char *failureMessages_DE[] = {
@@ -385,15 +413,25 @@
 	};
 
 	static const CommandeType defaultActionCommand_DE[] = {
-		"Pr\x81""fe",
+		"Pr\x81""fe", // FIXME? The third letter should be Latin Small Letter U with diaeresis
 		"Nimm",
 		"Bestand",
 		"Benutze",
-		"Bet\x84tige",
+		"Bet\x84tige", // FIXME? The third letter should be Latin Small Letter A with diaeresis
 		"Sprich",
 		"NOACTION"
 	};
 
+	static const char *commandPrepositionTable_DE[] = {
+		"",      // Prufe
+		"",      // Nimm
+		"",      // Bestand
+		"gegen", // Benutze
+		"",      // Betatige
+		"a",     // Sprich
+		""       // NOACTION
+	};
+
 	static const CommandeType systemMenu_DE[] = {
 		"Pause",
 		"Spiel Neu Starten",
@@ -415,8 +453,7 @@
 		"Er L\x84""dt | %s",
 		"Ladevorgang Abgebrochen...",
 		"Kein Backup im Laufwerk...",
-		"Geben Sie den Namen|der Sicherungsdiskette ein",
-		"gegen"
+		"Geben Sie den Namen|der Sicherungsdiskette ein"
 	};
 
 	static const char *failureMessages_IT[] = {
@@ -462,6 +499,16 @@
 		"NOACTION"
 	};
 
+	static const char *commandPrepositionTable_IT[] = {
+		"",   // ESAMINARE
+		"",   // PRENDERE
+		"",   // INVENTARIO
+		"su", // UTILIZZARE
+		"",   // AZIONARE
+		"a",  // PARLARE
+		""    // NOACTION
+	};
+
 	static const CommandeType systemMenu_IT[] = {
 		"Pausa",
 		"Parte nuova",
@@ -483,8 +530,7 @@
 		"Caricamento di| %s",
 		"Caricamento annullato...",
 		"Nessun salvataggio su questo disco...",
-		"Vogliate accedere con il nome del salvataggio",
-		"su"
+		"Vogliate accedere con il nome del salvataggio"
 	};
 
 	switch (lang) {
@@ -494,7 +540,8 @@
 		systemMenu = systemMenu_FR;
 		confirmMenu = confirmMenu_FR;
 		otherMessages = otherMessages_FR;
-		commandPrepositionOn = otherMessages_FR[7];
+		defaultCommandPreposition = commandPrepositionTable_FR[3];
+		commandPrepositionTable = commandPrepositionTable_FR;
 		break;
 
 	case Common::ES_ESP:
@@ -503,7 +550,8 @@
 		systemMenu = systemMenu_ES;
 		confirmMenu = confirmMenu_ES;
 		otherMessages = otherMessages_ES;
-		commandPrepositionOn = otherMessages_ES[7];
+		defaultCommandPreposition = commandPrepositionTable_ES[3];
+		commandPrepositionTable = commandPrepositionTable_ES;
 		break;
 
 	case Common::DE_DEU:
@@ -512,7 +560,8 @@
 		systemMenu = systemMenu_DE;
 		confirmMenu = confirmMenu_DE;
 		otherMessages = otherMessages_DE;
-		commandPrepositionOn = otherMessages_DE[7];
+		defaultCommandPreposition = commandPrepositionTable_DE[3];
+		commandPrepositionTable = commandPrepositionTable_DE;
 		break;
 
 	case Common::IT_ITA:
@@ -521,7 +570,8 @@
 		systemMenu = systemMenu_IT;
 		confirmMenu = confirmMenu_IT;
 		otherMessages = otherMessages_IT;
-		commandPrepositionOn = otherMessages_IT[7];
+		defaultCommandPreposition = commandPrepositionTable_IT[3];
+		commandPrepositionTable = commandPrepositionTable_IT;
 		break;
 
 	default:
@@ -530,7 +580,8 @@
 		systemMenu = systemMenu_EN;
 		confirmMenu = confirmMenu_EN;
 		otherMessages = otherMessages_EN;
-		commandPrepositionOn = otherMessages_EN[7];
+		defaultCommandPreposition = commandPrepositionTable_EN[3];
+		commandPrepositionTable = commandPrepositionTable_EN;
 		break;
 	}
 

Modified: scummvm/trunk/engines/cine/texte.h
===================================================================
--- scummvm/trunk/engines/cine/texte.h	2008-08-12 19:02:21 UTC (rev 33804)
+++ scummvm/trunk/engines/cine/texte.h	2008-08-12 19:33:17 UTC (rev 33805)
@@ -51,7 +51,8 @@
 extern const CommandeType *systemMenu;
 extern const CommandeType *confirmMenu;
 extern const char **otherMessages;
-extern const char *commandPrepositionOn;
+extern const char *defaultCommandPreposition;
+extern const char **commandPrepositionTable;
 
 void loadTextData(const char *filename);
 void loadErrmessDat(const char *fname);

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2008-08-12 19:02:21 UTC (rev 33804)
+++ scummvm/trunk/engines/cine/various.cpp	2008-08-12 19:33:17 UTC (rev 33805)
@@ -1491,6 +1491,8 @@
 	return objListTab[selectedObject];
 }
 
+// TODO: Make separate functions for Future Wars's and Operation Stealth's version of this function, this is getting too messy
+// TODO: Add support for using the different prepositions for different verbs (Doesn't work currently)
 void makeCommandLine(void) {
 	uint16 x, y;
 
@@ -1515,8 +1517,12 @@
 		}
 
 		if (si < 0) {
-			playerCommand = -1;
-			commandBuffer = "";
+			if (g_cine->getGameType() == Cine::GType_OS) {
+				canUseOnObject = 0;
+			} else { // Future Wars
+				playerCommand = -1;
+				commandBuffer = "";
+			}
 		} else {
 			if (g_cine->getGameType() == Cine::GType_OS) {
 				if (si >= 8000) {
@@ -1532,9 +1538,15 @@
 			commandBuffer += " ";
 			commandBuffer += objectTable[commandVar3[0]].name;
 			commandBuffer += " ";
-			commandBuffer += commandPrepositionOn;
+			if (g_cine->getGameType() == Cine::GType_OS) {
+				commandBuffer += commandPrepositionTable[playerCommand];
+			} else { // Future Wars
+				commandBuffer += defaultCommandPreposition;
+			}
 		}
-	} else {
+	}
+	
+	if (g_cine->getGameType() == Cine::GType_OS || !(playerCommand != -1 && choiceResultTable[playerCommand] == 2)) {
 		if (playerCommand == 2) {
 			getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
 			processInventory(x, y + 8);
@@ -1544,7 +1556,7 @@
 		}
 	}
 
-	if (g_cine->getGameType() == Cine::GType_OS) {
+	if (g_cine->getGameType() == Cine::GType_OS && playerCommand != 2) {
 		if (playerCommand != -1 && canUseOnObject != 0)	{ // call use on sub object
 			int16 si;
 
@@ -1552,34 +1564,37 @@
 
 			si = selectSubObject(x, y + 8, -subObjectUseTable[playerCommand]);
 
-			if (si) {
+			if (si >= 0) {
 				if (si >= 8000) {
 					si -= 8000;
 				}
 
 				commandVar3[commandVar1] = si;
-
 				commandVar1++;
-
-				// TODO: add command message draw
+				commandBuffer += " ";
+				commandBuffer += objectTable[si].name;
 			}
+		}
 
-			isDrawCommandEnabled = 1;
+		isDrawCommandEnabled = 1;
 
-			if (playerCommand != -1 && choiceResultTable[playerCommand] == commandVar1) {
-				SelectedObjStruct obj;
-				obj.idx = commandVar3[0];
-				obj.param = commandVar3[1];
-				int16 di = getRelEntryForObject(playerCommand, commandVar1, &obj);
+		if (playerCommand != -1 && choiceResultTable[playerCommand] == commandVar1) {
+			SelectedObjStruct obj;
+			obj.idx = commandVar3[0];
+			obj.param = commandVar3[1];
+			int16 di = getRelEntryForObject(playerCommand, commandVar1, &obj);
 
-				if (di != -1) {
-					runObjectScript(di);
-				}
-			}
+			if (di != -1) {
+				runObjectScript(di);
+			} // TODO: else addFailureMessage(playerCommand)
+
+			playerCommand = -1;
+			commandVar1 = 0;
+			commandBuffer = "";
 		}
 	}
 
-	if (!disableSystemMenu) {
+	if (g_cine->getGameType() == Cine::GType_OS || !disableSystemMenu) {
 		isDrawCommandEnabled = 1;
 		renderer->setCommand(commandBuffer);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list