aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2010-01-01 13:54:05 +0000
committerVladimir Menshakov2010-01-01 13:54:05 +0000
commit0cdcd59322be384c9f2638cda2df50aa32105b1b (patch)
treed0a283758ce8c428f556992423593e501f5775eb /engines/teenagent
parenta8f7d7e61e8c70a52d74fc0e2b3591792c9243da (diff)
downloadscummvm-rg350-0cdcd59322be384c9f2638cda2df50aa32105b1b.tar.gz
scummvm-rg350-0cdcd59322be384c9f2638cda2df50aa32105b1b.tar.bz2
scummvm-rg350-0cdcd59322be384c9f2638cda2df50aa32105b1b.zip
found zoom tables, added original zoom support.
svn-id: r46823
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/scene.cpp27
-rw-r--r--engines/teenagent/scene.h1
2 files changed, 19 insertions, 9 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index f3e1a66905..7a640abd2b 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -498,6 +498,22 @@ struct ZOrderCmp {
}
};
+int Scene::lookupZoom(uint y) const {
+ Resources *res = Resources::instance();
+ for(byte *zoom_table = res->dseg.ptr(res->dseg.get_word(0x70f4 + (_id - 1) * 2));
+ zoom_table[0] != 0xff && zoom_table[1] != 0xff;
+ zoom_table += 2
+ ) {
+ //debug(0, "%d %d->%d", y, zoom_table[0], zoom_table[1]);
+ if (y <= zoom_table[0]) {
+ //debug(0, "%d %d->%d", y, zoom_table[0], zoom_table[1]);
+ return 256u * (100 - zoom_table[1]) / 100;
+ }
+ }
+ return 256;
+}
+
+
bool Scene::render(OSystem *system) {
Resources *res = Resources::instance();
bool busy;
@@ -643,17 +659,10 @@ bool Scene::render(OSystem *system) {
got_any_animation = true;
} else if (!hide_actor) {
actor_animation.free();
- uint zoom = 256;
- const int zoom_min = 115, zoom_max = 150;
- if (_id == 18 && position.y < zoom_max) { //zoom hack
- if (position.y >= zoom_min)
- zoom = 128 + 128 * (position.y - zoom_min) / (zoom_max - zoom_min);
- else
- zoom = 128;
- }
+ uint zoom = lookupZoom(position.y);
if (!path.empty()) {
- const int speed_x = 10, speed_y = 3;
+ const int speed_x = 10 * zoom / 256, speed_y = 3 * zoom / 256;
const Common::Point &destination = path.front();
Common::Point dp(destination.x - position.x, destination.y - position.y);
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index bdd38c6efb..51c1fc4ffd 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -158,6 +158,7 @@ public:
inline Animation * getActorAnimation() { return &actor_animation; }
inline const Common::String& getMessage() const { return message; }
void setPalette(unsigned mul);
+ int lookupZoom(uint y) const;
private:
void loadOns();