aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristopher Page2008-07-09 02:27:05 +0000
committerChristopher Page2008-07-09 02:27:05 +0000
commite808cdf7a08d641389ecc81063b3b1016c7bc8cf (patch)
treedd21fa0f4b624d426675820b318aa3e41707c3ca /common
parentb8fe71e7a12e60f0c19fa86da83f270dc09e14fd (diff)
downloadscummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.gz
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.bz2
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.zip
Reimplemented pushEvent() and artificialEventQueue to work with Events instead of EventTypes. Reimplemented Queue as a List instead of Array. Updated AGOS, AGI, CINE, GOB, and KYRA to work with the current implementation of the GMM
svn-id: r32971
Diffstat (limited to 'common')
-rw-r--r--common/events.h4
-rw-r--r--common/list.h5
-rw-r--r--common/queue.h16
3 files changed, 13 insertions, 12 deletions
diff --git a/common/events.h b/common/events.h
index 10ddb7cc62..efaa90fab6 100644
--- a/common/events.h
+++ b/common/events.h
@@ -149,7 +149,7 @@ public:
/**
* Pushes a "fake" event of the specified type into the event queue
*/
- virtual void pushEvent(Common::EventType eventType) = 0;
+ virtual void pushEvent(Common::Event event) = 0;
/** Register random source so it can be serialized in game test purposes **/
virtual void registerRandomSource(Common::RandomSource &rnd, const char *name) = 0;
@@ -200,7 +200,7 @@ public:
// replacing it by a generic getScreenChangeID method here
protected:
- Common::Queue<Common::EventType> artificialEventQueue;
+ Common::Queue<Common::Event> artificialEventQueue;
};
} // End of namespace Common
diff --git a/common/list.h b/common/list.h
index c4e7b47644..0372d217b7 100644
--- a/common/list.h
+++ b/common/list.h
@@ -209,6 +209,11 @@ public:
++i;
}
+ void pop_front() {
+ iterator i = begin();
+ i = erase(i);
+ }
+
List<t_T> &operator=(const List<t_T> &list) {
if (this != &list) {
diff --git a/common/queue.h b/common/queue.h
index 56f0b70415..51d56ed54b 100644
--- a/common/queue.h
+++ b/common/queue.h
@@ -26,7 +26,7 @@
#define COMMON_QUEUE_H
#include "common/scummsys.h"
-#include "common/array.h"
+#include "common/list.h"
namespace Common {
@@ -36,10 +36,10 @@ namespace Common {
template<class T>
class Queue {
protected:
- Array<T> _queue;
+ List<T> _queue;
public:
Queue<T>() {}
- Queue<T>(const Array<T> &queueContent) : _queue(queueContent) {}
+ Queue<T>(const List<T> &queueContent) : _queue(queueContent) {}
bool empty() const {
return _queue.empty();
@@ -51,23 +51,19 @@ public:
_queue.push_back(x);
}
T back() const {
- const int s = size();
- return _queue[s - 1];
+ return _queue.reverse_begin().operator*();
}
T front() const {
- return _queue[0];
+ return _queue.begin().operator*();
}
T pop() {
T tmp = front();
- _queue.remove_at(0);
+ _queue.pop_front();
return tmp;
}
int size() const {
return _queue.size();
}
- T operator[](int i) {
- return _queue[i];
- }
};
} // End of namespace Common