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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu May 28 12:28:52 CEST 2009


Revision: 40955
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40955&view=rev
Author:   fingolfin
Date:     2009-05-28 10:28:51 +0000 (Thu, 28 May 2009)

Log Message:
-----------
SCI: Turned vocab_version into a static var, and added several FIXMEs related to it (either vocab_version needs to become a member of EngineState/SciEngine, or we need to derive its value e.g. from the game version/flags, if that's possible)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/vocabulary.cpp

Modified: scummvm/trunk/engines/sci/vocabulary.cpp
===================================================================
--- scummvm/trunk/engines/sci/vocabulary.cpp	2009-05-28 08:49:56 UTC (rev 40954)
+++ scummvm/trunk/engines/sci/vocabulary.cpp	2009-05-28 10:28:51 UTC (rev 40955)
@@ -32,7 +32,7 @@
 
 namespace Sci {
 
-int vocab_version;
+static int vocab_version;	// FIXME: Avoid static vars
 
 #define VOCAB_RESOURCE_PARSE_TREE_BRANCHES vocab_version == 1 ? \
 					   VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES : \
@@ -239,6 +239,8 @@
 }
 
 bool vocab_get_suffixes(ResourceManager *resmgr, SuffixList &suffixes) {
+	// FIXME: This call relies on vocab_version being set, which is done by vocab_get_words.
+	// So vocab_get_words *must* be called before vocab_get_branches gets called
 	Resource *resource = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 1);
 	unsigned int seeker = 1;
 
@@ -274,6 +276,8 @@
 }
 
 void vocab_free_suffixes(ResourceManager *resmgr, SuffixList &suffixes) {
+	// FIXME: This call relies on vocab_version being set, which is done by vocab_get_words.
+	// So vocab_get_words *must* be called before vocab_get_branches gets called
 	resmgr->unlockResource(resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 0),
 	                     VOCAB_RESOURCE_SUFFIX_VOCAB, kResourceTypeVocab);
 
@@ -281,6 +285,8 @@
 }
 
 bool vocab_get_branches(ResourceManager * resmgr, Common::Array<parse_tree_branch_t> &branches) {
+	// FIXME: This call relies on vocab_version being set, which is done by vocab_get_words.
+	// So vocab_get_words *must* be called before vocab_get_branches gets called
 	Resource *resource = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_PARSE_TREE_BRANCHES, 0);
 
 	branches.clear();


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