[Scummvm-cvs-logs] SF.net SVN: scummvm:[34083] scummvm/branches/branch-0-12-0/engines/kyra
athrxx at users.sourceforge.net
athrxx at users.sourceforge.net
Thu Aug 21 16:42:35 CEST 2008
Revision: 34083
http://scummvm.svn.sourceforge.net/scummvm/?rev=34083&view=rev
Author: athrxx
Date: 2008-08-21 14:42:34 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
KYRA: - backport only: res manager initialization speedup (PLEASE TEST)
- trunk will rely on the upcoming common file management improvements, no need to include the hack there
Modified Paths:
--------------
scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp
scummvm/branches/branch-0-12-0/engines/kyra/resource.cpp
scummvm/branches/branch-0-12-0/engines/kyra/resource.h
Modified: scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp 2008-08-21 14:14:52 UTC (rev 34082)
+++ scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp 2008-08-21 14:42:34 UTC (rev 34083)
@@ -297,6 +297,12 @@
// load just the pak files needed for ingame
_res->loadPakFile(StaticResource::staticDataFilename());
if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) {
+ if (_flags.isDemo) {
+ _res->preloadProtected("SKY.EMC");
+ _res->preloadProtected("SKY.FMC");
+ _res->preloadProtected("SKY.GMC");
+ }
+
if (!_res->loadFileList("FILEDATA.FDT"))
error("couldn't load 'FILEDATA.FDT'");
} else {
Modified: scummvm/branches/branch-0-12-0/engines/kyra/resource.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/resource.cpp 2008-08-21 14:14:52 UTC (rev 34082)
+++ scummvm/branches/branch-0-12-0/engines/kyra/resource.cpp 2008-08-21 14:42:34 UTC (rev 34083)
@@ -179,11 +179,6 @@
for (ResArchiveLoader::FileList::iterator i = files.begin(); i != files.end(); ++i) {
iter = _map.find(i->filename);
if (iter == _map.end()) {
- // We do an internal check for a file in gamepath with same filename to
- // allow overwriting files inside archives with plain files inside the
- // game directory
- checkFile(i->filename);
-
// A new file entry, so we just insert it into the file map.
if (_map.find(i->filename) == _map.end())
_map[i->filename] = i->entry;
@@ -219,6 +214,16 @@
return true;
}
+bool Resource::preloadProtected(const Common::String &filename) {
+ checkFile(filename);
+ ResFileMap::iterator iter = _map.find(filename);
+ if (iter == _map.end())
+ return false;
+
+ iter->_value.prot = true;
+ return true;
+}
+
bool Resource::loadFileList(const Common::String &filedata) {
Common::File f;
Modified: scummvm/branches/branch-0-12-0/engines/kyra/resource.h
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/resource.h 2008-08-21 14:14:52 UTC (rev 34082)
+++ scummvm/branches/branch-0-12-0/engines/kyra/resource.h 2008-08-21 14:42:34 UTC (rev 34083)
@@ -115,6 +115,7 @@
bool reset();
bool loadPakFile(const Common::String &filename);
+ bool preloadProtected(const Common::String &filename);
void unloadPakFile(const Common::String &filename);
bool isInPakList(const Common::String &filename);
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