aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2010-02-26 07:36:52 +0000
committerVladimir Menshakov2010-02-26 07:36:52 +0000
commiteacf1030e4fce35c9f9e048edfa05dc44d0a3e5d (patch)
tree848dab6becc7a3fe779bef2e109fd1dadb367036 /engines
parent00d3d5bffec293c2b66ad5253bdef9ce660018ce (diff)
downloadscummvm-rg350-eacf1030e4fce35c9f9e048edfa05dc44d0a3e5d.tar.gz
scummvm-rg350-eacf1030e4fce35c9f9e048edfa05dc44d0a3e5d.tar.bz2
scummvm-rg350-eacf1030e4fce35c9f9e048edfa05dc44d0a3e5d.zip
added async getFlag(addr)
svn-id: r48131
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/scene.cpp10
-rw-r--r--engines/teenagent/scene.h1
-rw-r--r--engines/teenagent/teenagent.cpp3
-rw-r--r--engines/teenagent/teenagent.h1
4 files changed, 15 insertions, 0 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 6ed6d72c7a..0e987e36c2 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -452,6 +452,16 @@ Animation * Scene::getAnimation(byte slot) {
return custom_animation + slot;
}
+byte Scene::peekFlagEvent(uint16 addr) const {
+ for(EventList::const_iterator i = events.reverse_begin(); i != events.end(); --i) {
+ const SceneEvent &e = *i;
+ if (e.type == SceneEvent::kSetFlag && e.callback == addr)
+ return e.color;
+ }
+ return Resources::instance()->dseg.get_byte(addr);
+}
+
+
void Scene::push(const SceneEvent &event) {
//debug(0, "push");
//event.dump();
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 0e0a3440bf..bf01e211ef 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -140,6 +140,7 @@ public:
void displayMessage(const Common::String &str, byte color = 0xd1, const Common::Point &pos = Common::Point());
void setOrientation(uint8 o) { orientation = o; }
void push(const SceneEvent &event);
+ byte peekFlagEvent(uint16 addr) const;
SceneEvent::Type last_event_type() const { return !events.empty()? events.back().type: SceneEvent::kNone; }
bool processEvent(const Common::Event &event);
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 551acd5343..2475f21d42 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -804,6 +804,9 @@ void TeenAgentEngine::setFlag(uint16 addr, byte value) {
scene->push(event);
}
+byte TeenAgentEngine::getFlag(uint16 addr) {
+ return scene->peekFlagEvent(addr);
+}
void TeenAgentEngine::reloadLan() {
SceneEvent event(SceneEvent::kSetLan);
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 4a932047b5..7176108007 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -96,6 +96,7 @@ public:
void setOns(byte id, byte value, byte scene_id = 0);
void setLan(byte id, byte value, byte scene_id = 0);
void setFlag(uint16 addr, byte value);
+ byte getFlag(uint16 addr);
void reloadLan();
void rejectMessage();