[Scummvm-cvs-logs] SF.net SVN: scummvm:[39924] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Apr 11 11:04:50 CEST 2009
Revision: 39924
http://scummvm.svn.sourceforge.net/scummvm/?rev=39924&view=rev
Author: thebluegr
Date: 2009-04-11 09:04:50 +0000 (Sat, 11 Apr 2009)
Log Message:
-----------
Removed move SortedList methods
Modified Paths:
--------------
scummvm/trunk/engines/saga/list.h
scummvm/trunk/engines/saga/sthread.cpp
Modified: scummvm/trunk/engines/saga/list.h
===================================================================
--- scummvm/trunk/engines/saga/list.h 2009-04-11 00:30:11 UTC (rev 39923)
+++ scummvm/trunk/engines/saga/list.h 2009-04-11 09:04:50 UTC (rev 39924)
@@ -39,40 +39,26 @@
typedef typename Common::List<T>::iterator iterator;
typedef typename Common::List<T>::const_iterator const_iterator;
- typedef typename Common::List<T> Common_List;
public:
iterator pushBack(const T& element) {
- return insert(Common_List::end(), element);
+ Common::List<T>::insert(Common::List<T>::end(), element);
+ return --Common::List<T>::end();
}
- iterator insert(iterator pos, const T& element) {
- Common_List::insert(pos, element);
- return --pos;
- }
-
- iterator pushFront() {
- T tmp;
- return insert(Common_List::begin(), tmp);
- }
-
- iterator insert(iterator pos) {
- T init;
- return insert(pos, init);
- }
-
iterator pushBack(const T& element, CompareFunction compareFunction) {
- return insert(Common_List::end(), element, compareFunction);
+ return insert(Common::List<T>::end(), element, compareFunction);
}
iterator insert(iterator pos, const T& element, CompareFunction compareFunction) {
int res;
- for (iterator i = Common_List::begin(); i != Common_List::end(); ++i) {
+ for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) {
res = compareFunction(element, *i);
if (res < 0) {
- return insert(i, element);
+ Common::List<T>::insert(i, element);
+ return --i;
}
}
return pushBack(element);
Modified: scummvm/trunk/engines/saga/sthread.cpp
===================================================================
--- scummvm/trunk/engines/saga/sthread.cpp 2009-04-11 00:30:11 UTC (rev 39923)
+++ scummvm/trunk/engines/saga/sthread.cpp 2009-04-11 09:04:50 UTC (rev 39924)
@@ -38,14 +38,13 @@
namespace Saga {
ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntryPointNumber) {
- ScriptThread *newThread;
+ ScriptThread *newThread = new ScriptThread();
loadModule(scriptModuleNumber);
if (_modules[scriptModuleNumber].entryPointsCount <= scriptEntryPointNumber) {
error("Script::createThread wrong scriptEntryPointNumber");
}
- newThread = &(*_threadList.pushFront());
newThread->_flags = kTFlagNone;
newThread->_stackSize = DEFAULT_THREAD_STACK_SIZE;
newThread->_stackBuf = (uint16 *)malloc(newThread->_stackSize * sizeof(uint16));
@@ -55,7 +54,6 @@
newThread->_staticBase = _commonBuffer + _modules[scriptModuleNumber].staticOffset;
newThread->_moduleBase = _modules[scriptModuleNumber].moduleBase;
newThread->_moduleBaseSize = _modules[scriptModuleNumber].moduleBaseSize;
-
newThread->_strings = &_modules[scriptModuleNumber].strings;
if (_vm->getGameId() == GID_IHNM)
@@ -63,7 +61,9 @@
else
newThread->_voiceLUT = &_modules[scriptModuleNumber].voiceLUT;
- return newThread;
+ _threadList.push_front(*newThread);
+
+ return &*_threadList.begin();
}
void Script::wakeUpActorThread(int waitType, void *threadObj) {
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