[Scummvm-cvs-logs] SF.net SVN: scummvm:[46813] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Fri Jan 1 10:40:31 CET 2010
Revision: 46813
http://scummvm.svn.sourceforge.net/scummvm/?rev=46813&view=rev
Author: m_kiewitz
Date: 2010-01-01 09:40:28 +0000 (Fri, 01 Jan 2010)
Log Message:
-----------
SCI: switch to previous gameid, when importing character data in qfg series
Modified Paths:
--------------
scummvm/trunk/engines/sci/sci.cpp
scummvm/trunk/engines/sci/sci.h
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2010-01-01 06:41:52 UTC (rev 46812)
+++ scummvm/trunk/engines/sci/sci.cpp 2010-01-01 09:40:28 UTC (rev 46813)
@@ -280,12 +280,29 @@
return _targetName + ".???";
}
+Common::String SciEngine::getFilePrefix() const {
+ const char* gameID = getGameID();
+ if (!strcmp(gameID, "qfg2")) {
+ // Quest for Glory 2 wants to read files from Quest for Glory 1 (EGA/VGA) to import character data
+ if (_gamestate->currentRoomNumber() == 805)
+ return "qfg1";
+ // TODO: Include import-room for qfg1vga
+ }
+ if (!strcmp(gameID, "qfg3")) {
+ // Quest for Glory 3 wants to read files from Quest for Glory 2 to import character data
+ if (_gamestate->currentRoomNumber() == 54)
+ return "qfg2";
+ }
+ // TODO: Implement the same for qfg4, when sci32 is good enough
+ return _targetName;
+}
+
Common::String SciEngine::wrapFilename(const Common::String &name) const {
- return _targetName + "-" + name;
+ return getFilePrefix() + "-" + name;
}
Common::String SciEngine::unwrapFilename(const Common::String &name) const {
- Common::String prefix = _targetName + "-";
+ Common::String prefix = getFilePrefix() + "-";
if (name.hasPrefix(prefix.c_str()))
return Common::String(name.c_str() + prefix.size());
return name;
Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h 2010-01-01 06:41:52 UTC (rev 46812)
+++ scummvm/trunk/engines/sci/sci.h 2010-01-01 09:40:28 UTC (rev 46813)
@@ -139,6 +139,8 @@
Common::String getSavegameName(int nr) const;
Common::String getSavegamePattern() const;
+ Common::String getFilePrefix() const;
+
/** Prepend 'TARGET-' to the given filename. */
Common::String wrapFilename(const Common::String &name) const;
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