aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2010-01-03 00:55:56 +0000
committerVladimir Menshakov2010-01-03 00:55:56 +0000
commitf1d800cb9da2bcdd53765a01d5992687585bd878 (patch)
treedc26fe0465870bf2777efddd86c371c841c4eb1b
parent400958b04562c713e2343901d7a9ad8ee554c354 (diff)
downloadscummvm-rg350-f1d800cb9da2bcdd53765a01d5992687585bd878.tar.gz
scummvm-rg350-f1d800cb9da2bcdd53765a01d5992687585bd878.tar.bz2
scummvm-rg350-f1d800cb9da2bcdd53765a01d5992687585bd878.zip
improved mark's animation.
svn-id: r46906
-rw-r--r--engines/teenagent/actor.cpp15
-rw-r--r--engines/teenagent/scene.cpp5
2 files changed, 9 insertions, 11 deletions
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index a9afac8485..332b399472 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -67,7 +67,8 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (delta_frame == 0) {
index = 0; //static animation
}
- int dx, dy;
+
+ bool mirror = orientation == kActorLeft;
switch (orientation) {
case kActorLeft:
case kActorRight:
@@ -81,8 +82,6 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (index >= ARRAYSIZE(frames_left_right))
index = 0;
s = frames + frames_left_right[index];
- dx = 11;
- dy = 62;
break;
case kActorUp:
if (render_head) {
@@ -95,8 +94,6 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (index >= ARRAYSIZE(frames_up))
index = 0;
s = frames + frames_up[index];
- dx = 11;
- dy = 62;
break;
case kActorDown:
if (render_head) {
@@ -109,8 +106,6 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (index >= ARRAYSIZE(frames_down))
index = 0;
s = frames + frames_down[index];
- dx = 11;
- dy = 62;
break;
default:
return Common::Rect();
@@ -120,13 +115,13 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
warning("no surface, skipping");
return Common::Rect();
}
-
+
Common::Rect dirty;
Common::Rect clip(0, 0, s->w, s->h);
if (head != NULL)
clip.top = head->h;
- int xp = position.x - dx * zoom / 256, yp = position.y - dy * zoom / 256;
+ int xp = position.x - s->w * zoom / 512 - s->x, yp = position.y - s->h * zoom / 256 - s->y;
if (xp < 0)
xp = 0;
if (xp + s->w > 320)
@@ -137,7 +132,7 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (yp + clip.top + clip.height() > 200)
yp = 200 - clip.top - clip.height();
- dirty = s->render(surface, xp, yp + clip.top * zoom / 256, orientation == kActorLeft, clip, zoom);
+ dirty = s->render(surface, xp, yp + clip.top * zoom / 256, mirror, clip, zoom);
if (head != NULL)
dirty.extend(head->render(surface, xp, yp, orientation == kActorLeft, Common::Rect(), zoom));
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index f01239986e..5ffc328dad 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -677,7 +677,10 @@ bool Scene::render() {
uint zoom = lookupZoom(position.y);
if (!path.empty()) {
- const int speed_x = 10 * zoom / 256, speed_y = 3 * zoom / 256;
+ int speed_x = 4 * zoom / 256, speed_y = 3 * zoom / 256;
+ if ((teenagent.currentIndex() % 5) == 0)
+ speed_x *= 4;
+
const Common::Point &destination = path.front();
Common::Point dp(destination.x - position.x, destination.y - position.y);