[Scummvm-cvs-logs] SF.net SVN: scummvm:[51031] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Jul 19 17:30:27 CEST 2010


Revision: 51031
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51031&view=rev
Author:   m_kiewitz
Date:     2010-07-19 15:30:27 +0000 (Mon, 19 Jul 2010)

Log Message:
-----------
SCI: fix regression of r51027

we have to reset the parser when switching vocabulary

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/parser/vocabulary.cpp
    scummvm/trunk/engines/sci/parser/vocabulary.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2010-07-19 14:54:25 UTC (rev 51030)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2010-07-19 15:30:27 UTC (rev 51031)
@@ -332,6 +332,7 @@
 	if (parserLanguage != _vocabularyLanguage) {
 		delete _vocabulary;
 		_vocabulary = new Vocabulary(_resMan, parserLanguage > 1 ? true : false);
+		_vocabulary->reset();
 		_vocabularyLanguage = parserLanguage;
 	}
 }

Modified: scummvm/trunk/engines/sci/parser/vocabulary.cpp
===================================================================
--- scummvm/trunk/engines/sci/parser/vocabulary.cpp	2010-07-19 14:54:25 UTC (rev 51030)
+++ scummvm/trunk/engines/sci/parser/vocabulary.cpp	2010-07-19 15:30:27 UTC (rev 51031)
@@ -82,6 +82,12 @@
 	freeSuffixes();
 }
 
+void Vocabulary::reset() {
+	parserIsValid = false; // Invalidate parser
+	parser_event = NULL_REG; // Invalidate parser event
+	parser_base = make_reg(g_sci->getEngineState()->_segMan->getSysStringsSegment(), SYS_STRING_PARSER_BASE);
+}
+
 bool Vocabulary::loadParserWords() {
 	char currentWord[VOCAB_MAX_WORDLENGTH] = "";
 	int currentWordPos = 0;

Modified: scummvm/trunk/engines/sci/parser/vocabulary.h
===================================================================
--- scummvm/trunk/engines/sci/parser/vocabulary.h	2010-07-19 14:54:25 UTC (rev 51030)
+++ scummvm/trunk/engines/sci/parser/vocabulary.h	2010-07-19 15:30:27 UTC (rev 51031)
@@ -174,6 +174,9 @@
 	Vocabulary(ResourceManager *resMan, bool foreign);
 	~Vocabulary();
 
+	// reset parser status
+	void reset();
+
 	/**
 	 * Gets any word from the specified group. For debugging only.
 	 * @param group		Group number

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-07-19 14:54:25 UTC (rev 51030)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-07-19 15:30:27 UTC (rev 51031)
@@ -301,9 +301,7 @@
 
 	// Reset parser
 	if (_vocabulary) {
-		_vocabulary->parserIsValid = false; // Invalidate parser
-		_vocabulary->parser_event = NULL_REG; // Invalidate parser event
-		_vocabulary->parser_base = make_reg(_gamestate->_segMan->getSysStringsSegment(), SYS_STRING_PARSER_BASE);
+		_vocabulary->reset();
 	}
 
 	_gamestate->gameStartTime = _gamestate->lastWaitTime = _gamestate->_screenUpdateTime = g_system->getMillis();


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