[Scummvm-cvs-logs] SF.net SVN: scummvm:[46823] scummvm/trunk/engines/teenagent
megath at users.sourceforge.net
megath at users.sourceforge.net
Fri Jan 1 14:54:05 CET 2010
Revision: 46823
http://scummvm.svn.sourceforge.net/scummvm/?rev=46823&view=rev
Author: megath
Date: 2010-01-01 13:54:05 +0000 (Fri, 01 Jan 2010)
Log Message:
-----------
found zoom tables, added original zoom support.
Modified Paths:
--------------
scummvm/trunk/engines/teenagent/scene.cpp
scummvm/trunk/engines/teenagent/scene.h
Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp 2010-01-01 13:53:40 UTC (rev 46822)
+++ scummvm/trunk/engines/teenagent/scene.cpp 2010-01-01 13:54:05 UTC (rev 46823)
@@ -498,6 +498,22 @@
}
};
+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 @@
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);
Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h 2010-01-01 13:53:40 UTC (rev 46822)
+++ scummvm/trunk/engines/teenagent/scene.h 2010-01-01 13:54:05 UTC (rev 46823)
@@ -158,6 +158,7 @@
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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list