added fadeout tables

svn-id: r46898
This commit is contained in:
Vladimir Menshakov 2010-01-02 20:44:47 +00:00
parent 13a242838f
commit 2b083c491d
4 changed files with 24 additions and 0 deletions

View File

@ -172,5 +172,10 @@ void Walkbox::save() const {
rect.save();
}
void FadeType::load(byte *src) {
rect.load(src);
src += 8;
value = *src;
}
} // End of namespace TeenAgent

View File

@ -215,6 +215,13 @@ protected:
byte * _base;
};
struct FadeType {
Rect rect;
byte value;
void load(byte *src);
};
//\todo move it to util.h?
template<typename T> inline T SIGN (T x) { return (x > 0)? 1: ((x < 0)? -1: 0); }

View File

@ -221,6 +221,7 @@ void Scene::loadObjectData() {
//loading objects & walkboxes
objects.resize(42);
walkboxes.resize(42);
fades.resize(42);
for (byte i = 0; i < 42; ++i) {
Common::Array<Object> &scene_objects = objects[i];
@ -248,6 +249,16 @@ void Scene::loadObjectData() {
//walkbox[i]->dump();
scene_walkboxes.push_back(w);
}
byte *fade_table = res->dseg.ptr(res->dseg.get_word(0x663e + i * 2));
Common::Array<FadeType> &scene_fades = fades[i];
while(READ_LE_UINT16(fade_table) != 0xffff) {
FadeType fade;
fade.load(fade_table);
fade_table += 9;
scene_fades.push_back(fade);
}
debug(0, "scene[%u] has %u fadeboxes", i + 1, scene_fades.size());
}
}

View File

@ -201,6 +201,7 @@ private:
Common::Array<Common::Array<Object> > objects;
Common::Array<Common::Array<Walkbox> > walkboxes;
Common::Array<Common::Array<FadeType> > fades;
Common::String message;
Common::Point message_pos;