mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-25 19:15:41 +00:00
fixed extra directory issues
This commit is contained in:
parent
9c2fd41bce
commit
959f84ff95
3 changed files with 20 additions and 1 deletions
|
@ -41,9 +41,23 @@ void
|
||||||
CDirectory::AddItem(const DirectoryInfo &dirinfo)
|
CDirectory::AddItem(const DirectoryInfo &dirinfo)
|
||||||
{
|
{
|
||||||
assert(numEntries < maxEntries);
|
assert(numEntries < maxEntries);
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
// don't add if already exists
|
||||||
|
uint32 offset, size;
|
||||||
|
if(FindItem(dirinfo.name, offset, size))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
entries[numEntries++] = dirinfo;
|
entries[numEntries++] = dirinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CDirectory::AddItem(const DirectoryInfo &dirinfo, int32 imgId)
|
||||||
|
{
|
||||||
|
DirectoryInfo di = dirinfo;
|
||||||
|
di.offset |= imgId<<24;
|
||||||
|
AddItem(di);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CDirectory::FindItem(const char *name, uint32 &offset, uint32 &size)
|
CDirectory::FindItem(const char *name, uint32 &offset, uint32 &size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,5 +18,6 @@ public:
|
||||||
void ReadDirFile(const char *filename);
|
void ReadDirFile(const char *filename);
|
||||||
bool WriteDirFile(const char *filename);
|
bool WriteDirFile(const char *filename);
|
||||||
void AddItem(const DirectoryInfo &dirinfo);
|
void AddItem(const DirectoryInfo &dirinfo);
|
||||||
|
void AddItem(const DirectoryInfo &dirinfo, int32 imgId);
|
||||||
bool FindItem(const char *name, uint32 &offset, uint32 &size);
|
bool FindItem(const char *name, uint32 &offset, uint32 &size);
|
||||||
};
|
};
|
||||||
|
|
|
@ -369,8 +369,12 @@ CStreaming::LoadCdDirectory(const char *dirname, int n)
|
||||||
lastID = modelId;
|
lastID = modelId;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// BUG: doesn't remember which cdimage this was in
|
#ifdef FIX_BUGS
|
||||||
|
// remember which cdimage this came from
|
||||||
|
ms_pExtraObjectsDir->AddItem(direntry, n);
|
||||||
|
#else
|
||||||
ms_pExtraObjectsDir->AddItem(direntry);
|
ms_pExtraObjectsDir->AddItem(direntry);
|
||||||
|
#endif
|
||||||
lastID = -1;
|
lastID = -1;
|
||||||
}
|
}
|
||||||
}else if(!CGeneral::faststrcmp(dot+1, "TXD") || !CGeneral::faststrcmp(dot+1, "txd")){
|
}else if(!CGeneral::faststrcmp(dot+1, "TXD") || !CGeneral::faststrcmp(dot+1, "txd")){
|
||||||
|
|
Loading…
Reference in a new issue