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

DrMcCoy drmccoy at drmccoy.de
Fri Jan 31 12:10:41 CET 2014


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:
edacb7ada7 GOB: Move getTotTextItemPart() from Inter_v3 to Inter_v2
ca861961a9 GOB: Add a game type and detection table for Croustibat


Commit: edacb7ada78d31985ea85945432bf2969e1019cc
    https://github.com/scummvm/scummvm/commit/edacb7ada78d31985ea85945432bf2969e1019cc
Author: Sven Hesse (drmccoy at drmccoy.de)
Date: 2014-01-31T02:54:44-08:00

Commit Message:
GOB: Move getTotTextItemPart() from Inter_v3 to Inter_v2

Changed paths:
    engines/gob/inter.h
    engines/gob/inter_v2.cpp
    engines/gob/inter_v3.cpp



diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 2aa837e..fabd31b 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -439,6 +439,7 @@ protected:
 	void o2_animPalInit(OpFuncParams &params);
 	void o2_addHotspot(OpFuncParams &params);
 	void o2_removeHotspot(OpFuncParams &params);
+	void o2_getTotTextItemPart(OpFuncParams &params);
 	void o2_goblinFunc(OpFuncParams &params);
 	void o2_stopSound(OpFuncParams &params);
 	void o2_loadSound(OpFuncParams &params);
@@ -540,7 +541,6 @@ protected:
 	virtual void setupOpcodesFunc();
 	virtual void setupOpcodesGob();
 
-	void o3_getTotTextItemPart(OpFuncParams &params);
 	void o3_speakerOn(OpFuncParams &params);
 	void o3_speakerOff(OpFuncParams &params);
 	void o3_copySprite(OpFuncParams &params);
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 6b7a4f0..9346a6a 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -124,6 +124,7 @@ void Inter_v2::setupOpcodesFunc() {
 
 	OPCODEFUNC(0x18, o2_addHotspot);
 	OPCODEFUNC(0x19, o2_removeHotspot);
+	OPCODEFUNC(0x1A, o2_getTotTextItemPart);
 
 	OPCODEFUNC(0x25, o2_goblinFunc);
 
@@ -1195,6 +1196,188 @@ void Inter_v2::o2_removeHotspot(OpFuncParams &params) {
 		_vm->_game->_hotspots->remove((stateType2 << 12) + id);
 }
 
+void Inter_v2::o2_getTotTextItemPart(OpFuncParams &params) {
+	byte *totData;
+	int16 totTextItem;
+	int16 part, curPart = 0;
+	int16 offX = 0, offY = 0;
+	int16 collId = 0, collCmd;
+	uint32 stringStartVar, stringVar;
+	bool end;
+
+	totTextItem = _vm->_game->_script->readInt16();
+	stringStartVar = _vm->_game->_script->readVarIndex();
+	part = _vm->_game->_script->readValExpr();
+
+	stringVar = stringStartVar;
+	if (part == -1) {
+		warning("o2_getTotTextItemPart, part == -1");
+		_vm->_draw->_hotspotText = GET_VARO_STR(stringVar);
+	}
+
+	WRITE_VARO_UINT8(stringVar, 0);
+
+	TextItem *textItem = _vm->_game->_resources->getTextItem(totTextItem);
+	if (!textItem)
+		return;
+
+	totData = textItem->getData();
+
+	// Skip background rectangles
+	while (((int16) READ_LE_UINT16(totData)) != -1)
+		totData += 9;
+	totData += 2;
+
+	while (*totData != 1) {
+		switch (*totData) {
+		case 2:
+		case 5:
+			totData++;
+			offX = READ_LE_UINT16(totData);
+			offY = READ_LE_UINT16(totData + 2);
+			totData += 4;
+			break;
+
+		case 3:
+		case 4:
+			totData += 2;
+			break;
+
+		case 6:
+			totData++;
+
+			collCmd = *totData++;
+			if (collCmd & 0x80) {
+				collId = READ_LE_UINT16(totData);
+				totData += 2;
+			}
+
+			// Skip collision coordinates
+			if (collCmd & 0x40)
+				totData += 8;
+
+			if ((collCmd & 0x8F) && ((-collId - 1) == part)) {
+				int n = 0;
+
+				while (1) {
+					if ((*totData < 1) || (*totData > 7)) {
+						if (*totData >= 32) {
+							WRITE_VARO_UINT8(stringVar++, *totData++);
+							n++;
+						} else
+							totData++;
+						continue;
+					}
+
+					if ((n != 0) || (*totData == 1) ||
+							(*totData == 6) || (*totData == 7)) {
+						WRITE_VARO_UINT8(stringVar, 0);
+						delete textItem;
+						return;
+					}
+
+					switch (*totData) {
+					case 2:
+					case 5:
+						totData += 5;
+						break;
+
+					case 3:
+					case 4:
+						totData += 2;
+						break;
+					}
+				}
+
+			}
+			break;
+
+		case 7:
+		case 8:
+		case 9:
+			totData++;
+			break;
+
+		case 10:
+			if (curPart == part) {
+				WRITE_VARO_UINT8(stringVar++, 0xFF);
+				WRITE_VARO_UINT16(stringVar, offX);
+				WRITE_VARO_UINT16(stringVar + 2, offY);
+				WRITE_VARO_UINT16(stringVar + 4,
+						totData - _vm->_game->_resources->getTexts());
+				WRITE_VARO_UINT8(stringVar + 6, 0);
+				delete textItem;
+				return;
+			}
+
+			end = false;
+			while (!end) {
+				switch (*totData) {
+				case 2:
+				case 5:
+					if (ABS(offY - READ_LE_UINT16(totData + 3)) > 1)
+						end = true;
+					else
+						totData += 5;
+					break;
+
+				case 3:
+					totData += 2;
+					break;
+
+				case 10:
+					totData += totData[1] * 2 + 2;
+					break;
+
+				default:
+					if (*totData < 32)
+						end = true;
+					while (*totData >= 32)
+						totData++;
+					break;
+				}
+			}
+
+			if (part >= 0)
+				curPart++;
+			break;
+
+		default:
+			while (1) {
+
+				while (*totData >= 32)
+					WRITE_VARO_UINT8(stringVar++, *totData++);
+				WRITE_VARO_UINT8(stringVar, 0);
+
+				if (((*totData != 2) && (*totData != 5)) ||
+						(ABS(offY - READ_LE_UINT16(totData + 3)) > 1)) {
+
+					if (curPart == part) {
+						delete textItem;
+						return;
+					}
+
+					stringVar = stringStartVar;
+					WRITE_VARO_UINT8(stringVar, 0);
+
+					while (*totData >= 32)
+						totData++;
+
+					if (part >= 0)
+						curPart++;
+					break;
+
+				} else
+					totData += 5;
+
+			}
+			break;
+		}
+	}
+
+	delete textItem;
+}
+
 void Inter_v2::o2_goblinFunc(OpFuncParams &params) {
 	OpGobParams gobParams;
 	int16 cmd;
diff --git a/engines/gob/inter_v3.cpp b/engines/gob/inter_v3.cpp
index edf5601..d6d4c52 100644
--- a/engines/gob/inter_v3.cpp
+++ b/engines/gob/inter_v3.cpp
@@ -50,7 +50,6 @@ void Inter_v3::setupOpcodesDraw() {
 void Inter_v3::setupOpcodesFunc() {
 	Inter_v2::setupOpcodesFunc();
 
-	OPCODEFUNC(0x1A, o3_getTotTextItemPart);
 	OPCODEFUNC(0x22, o3_speakerOn);
 	OPCODEFUNC(0x23, o3_speakerOff);
 	OPCODEFUNC(0x32, o3_copySprite);
@@ -66,188 +65,6 @@ void Inter_v3::setupOpcodesGob() {
 	OPCODEGOB(100, o3_wobble);
 }
 
-void Inter_v3::o3_getTotTextItemPart(OpFuncParams &params) {
-	byte *totData;
-	int16 totTextItem;
-	int16 part, curPart = 0;
-	int16 offX = 0, offY = 0;
-	int16 collId = 0, collCmd;
-	uint32 stringStartVar, stringVar;
-	bool end;
-
-	totTextItem = _vm->_game->_script->readInt16();
-	stringStartVar = _vm->_game->_script->readVarIndex();
-	part = _vm->_game->_script->readValExpr();
-
-	stringVar = stringStartVar;
-	if (part == -1) {
-		warning("o3_getTotTextItemPart, part == -1");
-		_vm->_draw->_hotspotText = GET_VARO_STR(stringVar);
-	}
-
-	WRITE_VARO_UINT8(stringVar, 0);
-
-	TextItem *textItem = _vm->_game->_resources->getTextItem(totTextItem);
-	if (!textItem)
-		return;
-
-	totData = textItem->getData();
-
-	// Skip background rectangles
-	while (((int16) READ_LE_UINT16(totData)) != -1)
-		totData += 9;
-	totData += 2;
-
-	while (*totData != 1) {
-		switch (*totData) {
-		case 2:
-		case 5:
-			totData++;
-			offX = READ_LE_UINT16(totData);
-			offY = READ_LE_UINT16(totData + 2);
-			totData += 4;
-			break;
-
-		case 3:
-		case 4:
-			totData += 2;
-			break;
-
-		case 6:
-			totData++;
-
-			collCmd = *totData++;
-			if (collCmd & 0x80) {
-				collId = READ_LE_UINT16(totData);
-				totData += 2;
-			}
-
-			// Skip collision coordinates
-			if (collCmd & 0x40)
-				totData += 8;
-
-			if ((collCmd & 0x8F) && ((-collId - 1) == part)) {
-				int n = 0;
-
-				while (1) {
-					if ((*totData < 1) || (*totData > 7)) {
-						if (*totData >= 32) {
-							WRITE_VARO_UINT8(stringVar++, *totData++);
-							n++;
-						} else
-							totData++;
-						continue;
-					}
-
-					if ((n != 0) || (*totData == 1) ||
-							(*totData == 6) || (*totData == 7)) {
-						WRITE_VARO_UINT8(stringVar, 0);
-						delete textItem;
-						return;
-					}
-
-					switch (*totData) {
-					case 2:
-					case 5:
-						totData += 5;
-						break;
-
-					case 3:
-					case 4:
-						totData += 2;
-						break;
-					}
-				}
-
-			}
-			break;
-
-		case 7:
-		case 8:
-		case 9:
-			totData++;
-			break;
-
-		case 10:
-			if (curPart == part) {
-				WRITE_VARO_UINT8(stringVar++, 0xFF);
-				WRITE_VARO_UINT16(stringVar, offX);
-				WRITE_VARO_UINT16(stringVar + 2, offY);
-				WRITE_VARO_UINT16(stringVar + 4,
-						totData - _vm->_game->_resources->getTexts());
-				WRITE_VARO_UINT8(stringVar + 6, 0);
-				delete textItem;
-				return;
-			}
-
-			end = false;
-			while (!end) {
-				switch (*totData) {
-				case 2:
-				case 5:
-					if (ABS(offY - READ_LE_UINT16(totData + 3)) > 1)
-						end = true;
-					else
-						totData += 5;
-					break;
-
-				case 3:
-					totData += 2;
-					break;
-
-				case 10:
-					totData += totData[1] * 2 + 2;
-					break;
-
-				default:
-					if (*totData < 32)
-						end = true;
-					while (*totData >= 32)
-						totData++;
-					break;
-				}
-			}
-
-			if (part >= 0)
-				curPart++;
-			break;
-
-		default:
-			while (1) {
-
-				while (*totData >= 32)
-					WRITE_VARO_UINT8(stringVar++, *totData++);
-				WRITE_VARO_UINT8(stringVar, 0);
-
-				if (((*totData != 2) && (*totData != 5)) ||
-						(ABS(offY - READ_LE_UINT16(totData + 3)) > 1)) {
-
-					if (curPart == part) {
-						delete textItem;
-						return;
-					}
-
-					stringVar = stringStartVar;
-					WRITE_VARO_UINT8(stringVar, 0);
-
-					while (*totData >= 32)
-						totData++;
-
-					if (part >= 0)
-						curPart++;
-					break;
-
-				} else
-					totData += 5;
-
-			}
-			break;
-		}
-	}
-
-	delete textItem;
-}
-
 void Inter_v3::o3_speakerOn(OpFuncParams &params) {
 	int16 frequency = _vm->_game->_script->readValExpr();
 	int32 length    = -1;


Commit: ca861961a9ba5a804fd3248ea5de5ce3a0f2b74a
    https://github.com/scummvm/scummvm/commit/ca861961a9ba5a804fd3248ea5de5ce3a0f2b74a
Author: Sven Hesse (drmccoy at drmccoy.de)
Date: 2014-01-31T03:04:08-08:00

Commit Message:
GOB: Add a game type and detection table for Croustibat

Changed paths:
  A engines/gob/detection/tables_crousti.h
    engines/gob/detection/tables.h
    engines/gob/gob.cpp
    engines/gob/gob.h



diff --git a/engines/gob/detection/tables.h b/engines/gob/detection/tables.h
index 271f75a..d042dfe 100644
--- a/engines/gob/detection/tables.h
+++ b/engines/gob/detection/tables.h
@@ -55,6 +55,7 @@ static const PlainGameDescriptor gobGames[] = {
 	{"ajworld", "A.J.'s World of Discovery"},
 	{"gob3", "Goblins Quest 3"},
 	{"gob3cd", "Goblins Quest 3 CD"},
+	{"crousti", "Croustibat"},
 	{"lit1", "Lost in Time Part 1"},
 	{"lit2", "Lost in Time Part 2"},
 	{"lit", "Lost in Time"},
@@ -110,6 +111,7 @@ static const GOBGameDescription gameDescriptions[] = {
 	#include "gob/detection/tables_adi4.h"      // The ADI / Addy 4 series
 	#include "gob/detection/tables_adibou.h"    // The Adibou / Addy Junior series
 	#include "gob/detection/tables_ajworld.h"   // A.J.'s World of Discovery / ADI Jr.
+	#include "gob/detection/tables_crousti.h"   // Croustibat
 
 	{ AD_TABLE_END_MARKER, kGameTypeNone, kFeaturesNone, 0, 0, 0}
 };
diff --git a/engines/gob/detection/tables_crousti.h b/engines/gob/detection/tables_crousti.h
new file mode 100644
index 0000000..66c54bf
--- /dev/null
+++ b/engines/gob/detection/tables_crousti.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/* Detection tables for Croustibat. */
+
+#ifndef GOB_DETECTION_TABLES_CROUSTI_H
+#define GOB_DETECTION_TABLES_CROUSTI_H
+
+// -- DOS VGA Floppy --
+
+{
+	{
+		"crousti",
+		"",
+		AD_ENTRY1s("intro.stk", "63fd795818fa72c32b903bbd99e18ea1", 851926),
+		ES_ESP,
+		kPlatformDOS,
+		ADGF_NO_FLAGS,
+		GUIO2(GUIO_NOSUBTITLES, GUIO_NOSPEECH)
+	},
+	kGameTypeCrousti,
+	kFeaturesAdLib,
+	0, 0, 0
+},
+
+#endif // GOB_DETECTION_TABLES_CROUSTI_H
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index fcf98f0..c50f4c4 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -457,6 +457,7 @@ Common::Error GobEngine::initGameParts() {
 
 	case kGameTypeWeen:
 	case kGameTypeGob2:
+	case kGameTypeCrousti:
 		_init     = new Init_v2(this);
 		_video    = new Video_v2(this);
 		_inter    = new Inter_v2(this);
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index df73404..e8da5fd 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -55,6 +55,7 @@ class StaticTextWidget;
  * - Bambou le sauveur de la jungle
  * - Geisha
  * - Once Upon A Time: Little Red Riding Hood
+ * - Croustibat
  */
 namespace Gob {
 
@@ -134,7 +135,8 @@ enum GameType {
 	kGameTypeBabaYaga,
 	kGameTypeLittleRed,
 	kGameTypeOnceUponATime, // Need more inspection to see if Baba Yaga or Abracadabra
-	kGameTypeAJWorld
+	kGameTypeAJWorld,
+	kGameTypeCrousti
 };
 
 enum Features {






More information about the Scummvm-git-logs mailing list