aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-15 11:07:52 +0000
committerVladimir Menshakov2009-11-15 11:07:52 +0000
commit196401df628298f5f7b763aa1b71293aa4def705 (patch)
treed180ef0aafb0e3dfa11765ce20fbd0ac79a30095 /engines/teenagent
parentf0b2b924b1388679cd8be2f7c5110f18e92990d4 (diff)
downloadscummvm-rg350-196401df628298f5f7b763aa1b71293aa4def705.tar.gz
scummvm-rg350-196401df628298f5f7b763aa1b71293aa4def705.tar.bz2
scummvm-rg350-196401df628298f5f7b763aa1b71293aa4def705.zip
added real face animation handling
svn-id: r45917
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/dialog.cpp8
-rw-r--r--engines/teenagent/scene.cpp27
2 files changed, 21 insertions, 14 deletions
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index 17a2378fb5..2479da42a1 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -66,12 +66,12 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
//debug(0, "displaymessage %s", message.c_str());
if (color == color2) {
//pause animation in other slot
- if (animation1 != 0) {
+ {
SceneEvent e(SceneEvent::kPauseAnimation);
e.slot = 0x80 | slot1;
scene->push(e);
}
- if (animation2 != 0) {
+ {
SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation2;
e.slot = 0x80 | slot2;
@@ -79,12 +79,12 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
}
} else if (color == color1) {
//pause animation in other slot
- if (animation2 != 0) {
+ {
SceneEvent e(SceneEvent::kPauseAnimation);
e.slot = 0x80 | slot2;
scene->push(e);
}
- if (animation1 != 0) {
+ {
SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation1;
e.slot = 0x80 | slot1;
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index ad064e954f..bc7a95e66b 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -667,7 +667,7 @@ bool Scene::render(OSystem *system) {
busy = true;
} else
busy = true;
- } else
+ } else
actor_animation_position = teenagent.render(surface, position, orientation, 0, actor_talking);
}
}
@@ -857,36 +857,43 @@ bool Scene::processEventQueue() {
case SceneEvent::kPlayAnimation: {
byte slot = current_event.slot & 7; //0 - mark's
if (current_event.animation != 0) {
+ debug(0, "playing animation %u in slot %u", current_event.animation, slot);
if (slot != 0) {
--slot;
- debug(0, "playing animation %u in slot %u", current_event.animation, slot);
assert(slot < 4);
playAnimation(slot, current_event.animation, (current_event.slot & 0x80) != 0, (slot & 0x40) != 0, (slot & 0x20) != 0);
- }
+ } else
+ actor_talking = true;
} else {
if (slot != 0) {
--slot;
debug(0, "cancelling animation in slot %u", slot);
assert(slot < 4);
custom_animation[slot].free();
- }
+ } else
+ actor_talking = true;
}
current_event.clear();
}
break;
- case SceneEvent::kPauseAnimation:
- if (current_event.slot != 0) {
- --current_event.slot;
- debug(0, "pause animation in slot %u", current_event.slot & 3);
- custom_animation[current_event.slot & 3].paused = (current_event.slot & 0x80) != 0;
+ case SceneEvent::kPauseAnimation: {
+ byte slot = current_event.slot & 7; //0 - mark's
+ if (slot != 0) {
+ --slot;
+ debug(0, "pause animation in slot %u", slot);
+ custom_animation[slot].paused = (current_event.slot & 0x80) != 0;
+ } else {
+ actor_talking = false;
+ }
+ current_event.clear();
}
- current_event.clear();
break;
case SceneEvent::kClearAnimations:
for (byte i = 0; i < 4; ++i)
custom_animation[i].free();
+ actor_talking = false;
current_event.clear();
break;