From 59cd6d4b6626f9f7a40a7c9b14a7ac18b2fb6f09 Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Fri, 6 Jun 2014 09:55:55 +0200 Subject: DEVTOOLS: Remove duplicate table entry in create_neverhood --- devtools/create_neverhood/tables.h | 1 - 1 file changed, 1 deletion(-) (limited to 'devtools') diff --git a/devtools/create_neverhood/tables.h b/devtools/create_neverhood/tables.h index cea962d4c1..edcecc5d8d 100644 --- a/devtools/create_neverhood/tables.h +++ b/devtools/create_neverhood/tables.h @@ -45,7 +45,6 @@ static const uint32 rectListOffsets[] = { // Scene1002 3, 0x004B43A0, 1, 0x004B4418, - 3, 0x004B43A0, // Scene1004 1, 0x004B7C70, // Scene1109 -- cgit v1.2.3 From 9759b3481d53a70bead5069ca3e2a2cc7b349416 Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Fri, 6 Jun 2014 09:57:48 +0200 Subject: DEVTOOLS: Skip adding duplicate items in create_neverhood Some sub rectangles point to the same message list, these are now saved only once instead of several times. --- devtools/create_neverhood/create_neverhood.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'devtools') diff --git a/devtools/create_neverhood/create_neverhood.cpp b/devtools/create_neverhood/create_neverhood.cpp index a1201cdaa3..fb2912f722 100644 --- a/devtools/create_neverhood/create_neverhood.cpp +++ b/devtools/create_neverhood/create_neverhood.cpp @@ -467,7 +467,15 @@ public: std::vector lists; void add(LISTCLASS *list) { - lists.push_back(list); + bool doAppend = true; + for (typename std::vector::iterator it = lists.begin(); it != lists.end(); it++) { + if ((*it)->id == list->id) { + doAppend = false; + break; + } + } + if (doAppend) + lists.push_back(list); } void loadListVector(const uint32 *offsets) { @@ -475,7 +483,6 @@ public: LISTCLASS *list = new LISTCLASS(); list->loadList(offsets[i], offsets[i + 1]); bool doAppend = true; - // Bad for (typename std::vector::iterator it = lists.begin(); it != lists.end(); it++) { if ((*it)->id == list->id) { doAppend = false; -- cgit v1.2.3