[Scummvm-cvs-logs] SF.net SVN: scummvm:[49046] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun May 16 12:23:45 CEST 2010


Revision: 49046
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49046&view=rev
Author:   thebluegr
Date:     2010-05-16 10:23:44 +0000 (Sun, 16 May 2010)

Log Message:
-----------
Added automatic detection for the non-interactive ITE demos

Modified Paths:
--------------
    scummvm/trunk/engines/saga/detection_tables.h
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/resource.h
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/script.cpp
    scummvm/trunk/engines/saga/script.h
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/detection_tables.h
===================================================================
--- scummvm/trunk/engines/saga/detection_tables.h	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/detection_tables.h	2010-05-16 10:23:44 UTC (rev 49046)
@@ -250,7 +250,7 @@
 			GUIO_NOSPEECH
 		},
 		GID_ITE,
-		GF_WYRMKEEP | GF_NON_INTERACTIVE | GF_LE_VOICES,
+		GF_WYRMKEEP | GF_LE_VOICES,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -302,7 +302,7 @@
 			GUIO_NONE
 		},
 		GID_ITE,
-		GF_WYRMKEEP | GF_NON_INTERACTIVE | GF_8BIT_UNSIGNED_PCM,
+		GF_WYRMKEEP | GF_8BIT_UNSIGNED_PCM,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/interface.cpp	2010-05-16 10:23:44 UTC (rev 49046)
@@ -186,7 +186,7 @@
 	free(resource);
 
 	// Option panel
-	if (!(_vm->getFeatures() & GF_NON_INTERACTIVE)) {
+	if (!_vm->_script->isNonInteractiveDemo()) {
 		_optionPanel.buttons = _vm->getDisplayInfo().optionPanelButtons;
 		_optionPanel.buttonsCount = _vm->getDisplayInfo().optionPanelButtonsCount;
 
@@ -237,7 +237,7 @@
 
 	// Main panel sprites
 	_vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites);
-	if (!(_vm->getFeatures() & GF_NON_INTERACTIVE)) {
+	if (!_vm->_script->isNonInteractiveDemo()) {
 		// Option panel sprites
 		_vm->_sprite->loadList(_vm->getResourceDescription()->optionPanelSpritesResourceId, _optionPanel.sprites);
 		// Save panel sprites

Modified: scummvm/trunk/engines/saga/resource.h
===================================================================
--- scummvm/trunk/engines/saga/resource.h	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/resource.h	2010-05-16 10:23:44 UTC (rev 49046)
@@ -119,6 +119,10 @@
 		return _fileType;
 	}
 
+	int32 fileSize() const {
+		return _fileSize;
+	}
+
 	int serial() const {
 		return _serial;
 	}

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/saga.h	2010-05-16 10:23:44 UTC (rev 49046)
@@ -145,15 +145,14 @@
 	GF_WYRMKEEP          = 1 << 0,
 	GF_ITE_FLOPPY        = 1 << 1,
 	GF_SCENE_SUBSTITUTES = 1 << 2,
-	GF_NON_INTERACTIVE   = 1 << 3,
 #if 0
-	GF_OLD_ITE_DOS       = 1 << 4, 	// Currently unused
+	GF_OLD_ITE_DOS       = 1 << 3, 	// Currently unused
 #endif
-	GF_MONO_MUSIC        = 1 << 5,
-	GF_EXTRA_ITE_CREDITS = 1 << 6,
-	GF_IHNM_DEMO         = 1 << 7,
-	GF_LE_VOICES         = 1 << 8,
-	GF_8BIT_UNSIGNED_PCM = 1 << 9
+	GF_MONO_MUSIC        = 1 << 4,
+	GF_EXTRA_ITE_CREDITS = 1 << 5,
+	GF_IHNM_DEMO         = 1 << 6,
+	GF_LE_VOICES         = 1 << 7,
+	GF_8BIT_UNSIGNED_PCM = 1 << 8
 };
 
 enum VerbTypeIds {

Modified: scummvm/trunk/engines/saga/script.cpp
===================================================================
--- scummvm/trunk/engines/saga/script.cpp	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/script.cpp	2010-05-16 10:23:44 UTC (rev 49046)
@@ -1321,6 +1321,12 @@
 	showVerb();
 }
 
+bool Script::isNonInteractiveDemo() {
+	// This detection only works in ITE. The early non-interactive demos had
+	// a very small script file
+	return _vm->getGameId() == GID_ITE && _scriptContext->fileSize() < 50000;
+}
+
 void Script::setLeftButtonVerb(int verb) {
 	int		oldVerb = _currentVerb;
 

Modified: scummvm/trunk/engines/saga/script.h
===================================================================
--- scummvm/trunk/engines/saga/script.h	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/script.h	2010-05-16 10:23:44 UTC (rev 49046)
@@ -341,6 +341,8 @@
 	int getVerbType(VerbTypes verbType);
 	TextListEntry *getPlacardTextEntry() { return _placardTextEntry; }
 
+	bool isNonInteractiveDemo();
+
 protected:
 	// When reading or writing data to the common buffer, we have to use a
 	// well-defined byte order since it's stored in savegames. Otherwise,

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2010-05-16 01:32:46 UTC (rev 49045)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2010-05-16 10:23:44 UTC (rev 49046)
@@ -226,7 +226,7 @@
 	// exit the game. Therefore, once this opcode is called in the older ITE demos,
 	// exit the game. Known non-interactive demos are GID_ITE_MACDEMO1 and
 	// GID_ITE_WINDEMO1
-	if (_vm->getFeatures() & GF_NON_INTERACTIVE)
+	if (_vm->_script->isNonInteractiveDemo())
 		_vm->quitGame();
 }
 


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