Jeck - Resource manager zipfile fix.
* Only attaches when necessary.
This commit is contained in:
@@ -196,6 +196,7 @@ private:
|
|||||||
vector<WManagedQuad*> managedQuads;
|
vector<WManagedQuad*> managedQuads;
|
||||||
|
|
||||||
//Statistics of record.
|
//Statistics of record.
|
||||||
|
string attachedZip;
|
||||||
unsigned int lastTime;
|
unsigned int lastTime;
|
||||||
int lastError;
|
int lastError;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -620,7 +620,6 @@ string WResourceManager::cardFile(const string filename, const string specific){
|
|||||||
JFileSystem* fs = JFileSystem::GetInstance();
|
JFileSystem* fs = JFileSystem::GetInstance();
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
fs->DetachZipFile();
|
|
||||||
|
|
||||||
//Check the specific location, if any.
|
//Check the specific location, if any.
|
||||||
if(specific != ""){
|
if(specific != ""){
|
||||||
@@ -669,7 +668,12 @@ string WResourceManager::cardFile(const string filename, const string specific){
|
|||||||
char zipname[512];
|
char zipname[512];
|
||||||
sprintf(zipname, "Res/sets/%s/%s.zip", set.c_str(),set.c_str());
|
sprintf(zipname, "Res/sets/%s/%s.zip", set.c_str(),set.c_str());
|
||||||
if (fileOK(zipname)){
|
if (fileOK(zipname)){
|
||||||
fs->AttachZipFile(zipname);
|
if(attachedZip != zipname)
|
||||||
|
{
|
||||||
|
fs->DetachZipFile();
|
||||||
|
attachedZip = zipname;
|
||||||
|
fs->AttachZipFile(zipname);
|
||||||
|
}
|
||||||
return filename.substr(i+1);
|
return filename.substr(i+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user