diff options
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/actor.cpp | 4 | ||||
-rw-r--r-- | engines/saga/events.cpp | 3 | ||||
-rw-r--r-- | engines/saga/events.h | 2 | ||||
-rw-r--r-- | engines/saga/font.h | 5 | ||||
-rw-r--r-- | engines/saga/list.h | 21 | ||||
-rw-r--r-- | engines/saga/script.h | 2 |
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 |