summaryrefslogtreecommitdiffstats
path: root/src/core/Directory.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-21 13:56:33 +0200
committeraap <aap@papnet.eu>2020-04-21 13:56:33 +0200
commit959f84ff9566297701064e30b46fd292e7e840a1 (patch)
tree23885d295e8f23ad7c4db346c431953d57bd45dc /src/core/Directory.cpp
parentlibrw (diff)
downloadre3-959f84ff9566297701064e30b46fd292e7e840a1.tar
re3-959f84ff9566297701064e30b46fd292e7e840a1.tar.gz
re3-959f84ff9566297701064e30b46fd292e7e840a1.tar.bz2
re3-959f84ff9566297701064e30b46fd292e7e840a1.tar.lz
re3-959f84ff9566297701064e30b46fd292e7e840a1.tar.xz
re3-959f84ff9566297701064e30b46fd292e7e840a1.tar.zst
re3-959f84ff9566297701064e30b46fd292e7e840a1.zip
Diffstat (limited to 'src/core/Directory.cpp')
-rw-r--r--src/core/Directory.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/Directory.cpp b/src/core/Directory.cpp
index 27539824..cc4d65d8 100644
--- a/src/core/Directory.cpp
+++ b/src/core/Directory.cpp
@@ -41,9 +41,23 @@ void
CDirectory::AddItem(const DirectoryInfo &dirinfo)
{
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;
}
+void
+CDirectory::AddItem(const DirectoryInfo &dirinfo, int32 imgId)
+{
+ DirectoryInfo di = dirinfo;
+ di.offset |= imgId<<24;
+ AddItem(di);
+}
+
bool
CDirectory::FindItem(const char *name, uint32 &offset, uint32 &size)
{