aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2009-09-14 21:05:43 +0000
committerVladimir Menshakov2009-09-14 21:05:43 +0000
commit9ee6e958bd2ea9b394a12923d95a9d3611f3d506 (patch)
tree827eca13562d636395fa25871fac1d8824f1894d /engines
parent1b68bf76ac1c7b6276353ee36cc6fa6141aaa3ef (diff)
downloadscummvm-rg350-9ee6e958bd2ea9b394a12923d95a9d3611f3d506.tar.gz
scummvm-rg350-9ee6e958bd2ea9b394a12923d95a9d3611f3d506.tar.bz2
scummvm-rg350-9ee6e958bd2ea9b394a12923d95a9d3611f3d506.zip
added color argument to displayMessage()
svn-id: r44088
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/scene.cpp14
-rw-r--r--engines/teenagent/scene.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index d89480942e..f7e1751f60 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -157,19 +157,18 @@ void Scene::loadLans() {
debug(0, "loading lans animation");
Resources * res = Resources::instance();
//load lan000
- byte * table_27 = res->dseg.ptr(0x32C7);
- memset(table_27, 0, 27 * 4);
for (int i = 0; i < 4; ++i) {
animations[i].free();
uint16 bx = 0xd89e + (_id - 1) * 4 + i;
byte bxv = res->dseg.get_byte(bx);
- debug(0, "lan: [%04x] = %02x", bx, bxv);
+ uint16 res_id = 4 * (_id - 1) + i + 1;
+ debug(0, "lan: [%04x] = %02x, resource id: %u", bx, bxv, res_id);
if (bxv == 0)
continue;
- Common::SeekableReadStream * s = res->loadLan000(4 * (_id - 1) + i + 1);
+ Common::SeekableReadStream * s = res->loadLan000(res_id);
if (s != NULL) {
animations[i].load(s, Animation::TypeLan);
if (bxv != 0 && bxv != 0xff)
@@ -278,6 +277,7 @@ bool Scene::processEvent(const Common::Event &event) {
events.clear();
sounds.clear();
current_event.clear();
+ message_color = 0xd1;
for(int i = 0; i < 4; ++i)
custom_animations[i].free();
_engine->playMusic(4);
@@ -393,6 +393,7 @@ bool Scene::render(OSystem * system) {
}
if (!message.empty()) {
+ res->font7.color = message_color;
res->font7.render(surface, message_pos.x, message_pos.y, message);
busy = true;
}
@@ -480,6 +481,7 @@ bool Scene::processEventQueue() {
//debug(0, "pop(%04x)", current_event.message);
message = current_event.message;
message_pos = messagePosition(message, position);
+ message_color = current_event.color;
break;
case SceneEvent::PlayAnimation: {
@@ -538,6 +540,7 @@ bool Scene::processEventQueue() {
}
}
if (events.empty()) {
+ message_color = 0xd1;
hide_actor = false;
}
return !current_event.empty();
@@ -582,10 +585,11 @@ Common::Point Scene::messagePosition(const Common::String &str, const Common::Po
return message_pos;
}
-void Scene::displayMessage(const Common::String &str) {
+void Scene::displayMessage(const Common::String &str, byte color) {
debug(0, "displayMessage: %s", str.c_str());
message = str;
message_pos = messagePosition(str, position);
+ message_color = color;
}
void Scene::clear() {
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index e899a0ecd1..01b6164785 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -105,7 +105,7 @@ public:
void moveTo(const Common::Point & point, byte orientation = 0, bool validate = 0);
Common::Point getPosition() const { return position; }
- void displayMessage(const Common::String &str);
+ void displayMessage(const Common::String &str, byte color = 0xd1);
void setOrientation(uint8 o) { orientation = o; }
void push(const SceneEvent &event);
@@ -158,6 +158,7 @@ private:
Common::String message;
Common::Point message_pos;
+ byte message_color;
typedef Common::List<SceneEvent> EventList;
EventList events;