[Scummvm-cvs-logs] SF.net SVN: scummvm:[39925] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Apr 11 11:23:41 CEST 2009


Revision: 39925
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39925&view=rev
Author:   thebluegr
Date:     2009-04-11 09:23:40 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
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)

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.cpp
    scummvm/trunk/engines/saga/events.cpp
    scummvm/trunk/engines/saga/events.h
    scummvm/trunk/engines/saga/font.h
    scummvm/trunk/engines/saga/list.h
    scummvm/trunk/engines/saga/script.h

Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/actor.cpp	2009-04-11 09:23:40 UTC (rev 39925)
@@ -985,7 +985,7 @@
 			continue;
 
 		if (calcScreenPosition(actor)) {
-			_drawOrderList.pushBack(actor, compareFunction);
+			_drawOrderList.insert(actor, compareFunction);
 		}
 	}
 
@@ -1005,7 +1005,7 @@
 			continue;
 
 		if (calcScreenPosition(obj)) {
-			_drawOrderList.pushBack(obj, compareFunction);
+			_drawOrderList.insert(obj, compareFunction);
 		}
 	}
 }

Modified: scummvm/trunk/engines/saga/events.cpp
===================================================================
--- scummvm/trunk/engines/saga/events.cpp	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/events.cpp	2009-04-11 09:23:40 UTC (rev 39925)
@@ -580,7 +580,8 @@
 Event *Events::queue(Event *event) {
 	Event *queuedEvent;
 
-	queuedEvent = &*_eventList.pushBack(*event);
+	_eventList.push_back(*event);
+	queuedEvent = &*--_eventList.end();
 	initializeEvent(queuedEvent);
 
 	return queuedEvent;

Modified: scummvm/trunk/engines/saga/events.h
===================================================================
--- scummvm/trunk/engines/saga/events.h	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/events.h	2009-04-11 09:23:40 UTC (rev 39925)
@@ -148,7 +148,7 @@
 	}
 };
 
-typedef SortedList<Event> EventList;
+typedef Common::List<Event> EventList;
 
 #define EVENT_WARNINGCOUNT 1000
 #define EVENT_MASK 0x00FF

Modified: scummvm/trunk/engines/saga/font.h
===================================================================
--- scummvm/trunk/engines/saga/font.h	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/font.h	2009-04-11 09:23:40 UTC (rev 39925)
@@ -94,11 +94,12 @@
 	}
 };
 
-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();
 	}
 };
 

Modified: scummvm/trunk/engines/saga/list.h
===================================================================
--- scummvm/trunk/engines/saga/list.h	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/list.h	2009-04-11 09:23:40 UTC (rev 39925)
@@ -37,31 +37,18 @@
 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();
 	}
 };
 

Modified: scummvm/trunk/engines/saga/script.h
===================================================================
--- scummvm/trunk/engines/saga/script.h	2009-04-11 09:04:50 UTC (rev 39924)
+++ scummvm/trunk/engines/saga/script.h	2009-04-11 09:23:40 UTC (rev 39925)
@@ -268,7 +268,7 @@
 	}
 };
 
-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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list