diff options
| author | Max Horn | 2009-04-11 00:29:52 +0000 | 
|---|---|---|
| committer | Max Horn | 2009-04-11 00:29:52 +0000 | 
| commit | 1c5110e725e8d5bd2682727b5cbbc9d7b959b95f (patch) | |
| tree | 675dcc14e8310e5f04c9f9a02e68b4a662d2fc88 | |
| parent | 7db2648ba00137d5cc5b7fc26f1ab54584dd3ad0 (diff) | |
| download | scummvm-rg350-1c5110e725e8d5bd2682727b5cbbc9d7b959b95f.tar.gz scummvm-rg350-1c5110e725e8d5bd2682727b5cbbc9d7b959b95f.tar.bz2 scummvm-rg350-1c5110e725e8d5bd2682727b5cbbc9d7b959b95f.zip | |
SAGA: Got rid of some more SortedList methods
svn-id: r39922
| -rw-r--r-- | engines/saga/events.cpp | 2 | ||||
| -rw-r--r-- | engines/saga/font.h | 4 | ||||
| -rw-r--r-- | engines/saga/list.h | 25 | 
3 files changed, 8 insertions, 23 deletions
| diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 99eb200f0f..5570665606 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -290,7 +290,7 @@ int Events::handleOneShot(Event *event) {  			((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; diff --git a/engines/saga/font.h b/engines/saga/font.h index 84a1ec70ba..248cee6d4f 100644 --- a/engines/saga/font.h +++ b/engines/saga/font.h @@ -88,6 +88,10 @@ struct TextListEntry {  	TextListEntry() {  		memset(this, 0, sizeof(*this));  	} + +	bool operator==(const TextListEntry &e) const { +		return 0 == memcmp(this, &e, sizeof(*this)); +	}  };  class TextList: public SortedList<TextListEntry> { diff --git a/engines/saga/list.h b/engines/saga/list.h index f7d7eee8fc..15ec088b03 100644 --- a/engines/saga/list.h +++ b/engines/saga/list.h @@ -43,10 +43,6 @@ public:  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,11 +53,8 @@ public:  	}  	iterator pushFront() { -		return insert(Common_List::begin()); -	} - -	iterator pushBack() { -		return insert(Common_List::end()); +		T tmp; +		return insert(Common_List::begin(), tmp);  	}  	iterator insert(iterator pos) { @@ -69,10 +62,6 @@ public:  		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 @@ public:  		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 | 
