aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-11 09:23:40 +0000
committerFilippos Karapetis2009-04-11 09:23:40 +0000
commit02ca56eec864c6e4e74b614a9d4be6c331e99eef (patch)
tree24a750275722ce62d480ee1bb26d7f5c9af823df
parent271f8b58b594aee76dcee625251a6ca9f517fcd8 (diff)
downloadscummvm-rg350-02ca56eec864c6e4e74b614a9d4be6c331e99eef.tar.gz
scummvm-rg350-02ca56eec864c6e4e74b614a9d4be6c331e99eef.tar.bz2
scummvm-rg350-02ca56eec864c6e4e74b614a9d4be6c331e99eef.zip
Removed all but one of the functions of the SortedList, apart from the custom insert() operation. It's only used in one place now (in _drawOrderList)
svn-id: r39925
-rw-r--r--engines/saga/actor.cpp4
-rw-r--r--engines/saga/events.cpp3
-rw-r--r--engines/saga/events.h2
-rw-r--r--engines/saga/font.h5
-rw-r--r--engines/saga/list.h21
-rw-r--r--engines/saga/script.h2
6 files changed, 13 insertions, 24 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index d52aac8b92..17834aec35 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -985,7 +985,7 @@ void Actor::createDrawOrderList() {
continue;
if (calcScreenPosition(actor)) {
- _drawOrderList.pushBack(actor, compareFunction);
+ _drawOrderList.insert(actor, compareFunction);
}
}
@@ -1005,7 +1005,7 @@ void Actor::createDrawOrderList() {
continue;
if (calcScreenPosition(obj)) {
- _drawOrderList.pushBack(obj, compareFunction);
+ _drawOrderList.insert(obj, compareFunction);
}
}
}
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 5570665606..2e0cb9f09a 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -580,7 +580,8 @@ int Events::handleInterval(Event *event) {
Event *Events::queue(Event *event) {
Event *queuedEvent;
- queuedEvent = &*_eventList.pushBack(*event);
+ _eventList.push_back(*event);
+ queuedEvent = &*--_eventList.end();
initializeEvent(queuedEvent);
return queuedEvent;
diff --git a/engines/saga/events.h b/engines/saga/events.h
index c2082994bc..299e707195 100644
--- a/engines/saga/events.h
+++ b/engines/saga/events.h
@@ -148,7 +148,7 @@ struct Event {
}
};
-typedef SortedList<Event> EventList;
+typedef Common::List<Event> EventList;
#define EVENT_WARNINGCOUNT 1000
#define EVENT_MASK 0x00FF
diff --git a/engines/saga/font.h b/engines/saga/font.h
index 248cee6d4f..37ff56ea2d 100644
--- a/engines/saga/font.h
+++ b/engines/saga/font.h
@@ -94,11 +94,12 @@ struct TextListEntry {
}
};
-class TextList: public SortedList<TextListEntry> {
+class TextList: public Common::List<TextListEntry> {
public:
TextListEntry *addEntry(const TextListEntry &entry) {
- return &*pushBack(entry);
+ Common::List<TextListEntry>::push_back(entry);
+ return &*--Common::List<TextListEntry>::end();
}
};
diff --git a/engines/saga/list.h b/engines/saga/list.h
index 454b81dce4..c6789fec0c 100644
--- a/engines/saga/list.h
+++ b/engines/saga/list.h
@@ -37,31 +37,18 @@ class SortedList : public Common::List<T> {
public:
typedef int (*CompareFunction) (const T& a, const T& b);
- typedef typename Common::List<T>::iterator iterator;
- typedef typename Common::List<T>::const_iterator const_iterator;
-
-public:
-
- iterator pushBack(const T& element) {
- Common::List<T>::insert(Common::List<T>::end(), element);
- return --Common::List<T>::end();
- }
-
- iterator pushBack(const T& element, CompareFunction compareFunction) {
- return insert(Common::List<T>::end(), element, compareFunction);
- }
-
- iterator insert(iterator pos, const T& element, CompareFunction compareFunction) {
+ iterator insert(const T& element, CompareFunction compareFunction) {
int res;
- for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) {
+ for (Common::List<T>::iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) {
res = compareFunction(element, *i);
if (res < 0) {
Common::List<T>::insert(i, element);
return --i;
}
}
- return pushBack(element);
+ Common::List<T>::push_back(element);
+ return --Common::List<T>::end();
}
};
diff --git a/engines/saga/script.h b/engines/saga/script.h
index 3061a31bb3..423e4d0ee7 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -268,7 +268,7 @@ public:
}
};
-typedef SortedList<ScriptThread> ScriptThreadList;
+typedef Common::List<ScriptThread> ScriptThreadList;
#define SCRIPTOP_PARAMS ScriptThread *thread, MemoryReadStream *scriptS, bool &stopParsing, bool &breakOut
#define SCRIPTFUNC_PARAMS ScriptThread *thread, int nArgs, bool &disContinue