diff options
author | Paul Gilbert | 2018-01-26 07:55:57 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-01-26 07:55:57 -0500 |
commit | e4ab945b41796912f11b3b51eea8bc9f27dff6ae (patch) | |
tree | 17aee2973a7346f0ab92e12e6484ec125ecd1fa2 | |
parent | 5b3526e58712bce866add853418314be33ea1c28 (diff) | |
download | scummvm-rg350-e4ab945b41796912f11b3b51eea8bc9f27dff6ae.tar.gz scummvm-rg350-e4ab945b41796912f11b3b51eea8bc9f27dff6ae.tar.bz2 scummvm-rg350-e4ab945b41796912f11b3b51eea8bc9f27dff6ae.zip |
XEEN: Added further enum values to make falling code clearer
-rw-r--r-- | engines/xeen/interface.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index a46883b028..e8adee383b 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -40,7 +40,7 @@ namespace Xeen { enum { - SCENE_WINDOW = 11 + SCENE_WINDOW = 11, SCENE_WIDTH = 216, SCENE_HEIGHT = 132 }; PartyDrawer::PartyDrawer(XeenEngine *vm): _vm(vm) { @@ -1297,13 +1297,13 @@ void Interface::handleFalling() { sound.playFX(11); sound.playSound("scream.voc"); - for (int idx = 0, incr = 2; idx < 133; ++incr, idx += incr) { + for (int idx = 0, incr = 2; idx <= SCENE_HEIGHT; ++incr, idx += incr) { fall(idx); assembleBorder(); w.update(); } - fall(132); + fall(SCENE_HEIGHT); assembleBorder(); w.update(); @@ -1311,19 +1311,19 @@ void Interface::handleFalling() { sound.playSound("unnh.voc"); sound.playFX(31); - fall(127); + fall(SCENE_HEIGHT - 5); assembleBorder(); w.update(); - fall(132); + fall(SCENE_HEIGHT); assembleBorder(); w.update(); - fall(129); + fall(SCENE_HEIGHT - 3); assembleBorder(); w.update(); - fall(132); + fall(SCENE_HEIGHT); assembleBorder(); w.update(); @@ -1335,16 +1335,15 @@ void Interface::handleFalling() { void Interface::setupFallSurface(bool isTop) { Window &w = (*g_vm->_windows)[SCENE_WINDOW]; - const Common::Rect &r = w.getBounds(); if (_fallSurface.empty()) - _fallSurface.create(r.width(), r.height() * 2); - _fallSurface.blitFrom(w, Common::Point(0, isTop ? 0 : r.height())); + _fallSurface.create(SCENE_WIDTH, SCENE_HEIGHT * 2); + _fallSurface.blitFrom(w, Common::Point(0, isTop ? 0 : SCENE_HEIGHT)); } void Interface::fall(int yp) { Window &w = (*g_vm->_windows)[SCENE_WINDOW]; - w.blitFrom(_fallSurface, Common::Rect(0, yp, _fallSurface.w, yp + (_fallSurface.h / 2)), Common::Point(0, 0)); + w.blitFrom(_fallSurface, Common::Rect(0, yp, SCENE_WIDTH, yp + SCENE_HEIGHT), Common::Point(0, 0)); } void Interface::shake(int time) { |