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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Apr 11 02:29:53 CEST 2009


Revision: 39922
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39922&view=rev
Author:   fingolfin
Date:     2009-04-11 00:29:52 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
SAGA: Got rid of some more SortedList methods

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

Modified: scummvm/trunk/engines/saga/events.cpp
===================================================================
--- scummvm/trunk/engines/saga/events.cpp	2009-04-11 00:29:34 UTC (rev 39921)
+++ scummvm/trunk/engines/saga/events.cpp	2009-04-11 00:29:52 UTC (rev 39922)
@@ -290,7 +290,7 @@
 			((TextListEntry *)event->data)->display = true;
 			break;
 		case kEventRemove:
-			_vm->_scene->_textList.remove((TextListEntry *)event->data);
+			_vm->_scene->_textList.remove(*((TextListEntry *)event->data));
 			break;
 		default:
 			break;

Modified: scummvm/trunk/engines/saga/font.h
===================================================================
--- scummvm/trunk/engines/saga/font.h	2009-04-11 00:29:34 UTC (rev 39921)
+++ scummvm/trunk/engines/saga/font.h	2009-04-11 00:29:52 UTC (rev 39922)
@@ -88,6 +88,10 @@
 	TextListEntry() {
 		memset(this, 0, sizeof(*this));
 	}
+
+	bool operator==(const TextListEntry &e) const {
+		return 0 == memcmp(this, &e, sizeof(*this));
+	}
 };
 
 class TextList: public SortedList<TextListEntry> {

Modified: scummvm/trunk/engines/saga/list.h
===================================================================
--- scummvm/trunk/engines/saga/list.h	2009-04-11 00:29:34 UTC (rev 39921)
+++ scummvm/trunk/engines/saga/list.h	2009-04-11 00:29:52 UTC (rev 39922)
@@ -43,10 +43,6 @@
 
 public:
 
-	iterator pushFront(const T& element) {
-		return insert(Common::List<T>::begin(), element);
-	}
-
 	iterator pushBack(const T& element) {
 		return insert(Common_List::end(), element);
 	}
@@ -57,22 +53,15 @@
 	}
 
 	iterator pushFront() {
-		return insert(Common_List::begin());
+		T tmp;
+		return insert(Common_List::begin(), tmp);
 	}
 
-	iterator pushBack() {
-		return insert(Common_List::end());
-	}
-
 	iterator insert(iterator pos) {
 		T init;
 		return insert(pos, init);
 	}
 
-	iterator pushFront(const T& element, CompareFunction compareFunction) {
-		return insert(Common::List<T>::begin(), element, compareFunction);
-	}
-
 	iterator pushBack(const T& element, CompareFunction compareFunction) {
 		return insert(Common_List::end(), element, compareFunction);
 	}
@@ -81,21 +70,13 @@
 		int res;
 
 		for (iterator i = Common_List::begin(); i != Common_List::end(); ++i) {
-			res = compareFunction(element, i.operator*());
+			res = compareFunction(element, *i);
 			if	(res < 0) {
 				return insert(i, element);
 			}
 		}
 		return pushBack(element);
 	}
-
-	void remove(const T* val) {
-		for (iterator i = Common_List::begin(); i != Common_List::end(); ++i)
-			if (val == i.operator->()) {
-				erase(i);
-				return;
-			}
-	}
 };
 
 } // End of namespace Saga


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