aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-01-25 20:59:37 -0500
committerPaul Gilbert2018-01-25 20:59:37 -0500
commitb85d6101d300bba1cf305b9306c7d8477bd855c6 (patch)
tree42216ce3ed5874dd5e0901383992ebefb215e34e /engines
parent22d1a6496cb71d8402c510f3b79470bf3d132a71 (diff)
downloadscummvm-rg350-b85d6101d300bba1cf305b9306c7d8477bd855c6.tar.gz
scummvm-rg350-b85d6101d300bba1cf305b9306c7d8477bd855c6.tar.bz2
scummvm-rg350-b85d6101d300bba1cf305b9306c7d8477bd855c6.zip
XEEN: Change _falling to enum, properly implement startFalling
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/interface.cpp43
-rw-r--r--engines/xeen/interface.h8
2 files changed, 25 insertions, 26 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index ad38b390b7..0073552ca0 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -136,7 +136,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceScene(vm),
_buttonsLoaded = false;
_obscurity = OBSCURITY_NONE;
_steppingFX = 0;
- _falling = false;
+ _falling = FALL_NONE;
_blessedUIFrame = 0;
_powerShieldUIFrame = 0;
_holyBonusUIFrame = 0;
@@ -639,7 +639,7 @@ void Interface::doStepCode() {
// We can fly, we can.. oh wait, we can't!
damage = 100;
party._damageType = DT_PHYSICAL;
- _falling = true;
+ _falling = FALL_1;
break;
case SURFTYPE_DESERT:
// Without navigation skills, simulate getting lost by adding extra time
@@ -649,7 +649,7 @@ void Interface::doStepCode() {
case SURFTYPE_CLOUD:
if (!party._levitateCount) {
party._damageType = DT_PHYSICAL;
- _falling = true;
+ _falling = FALL_1;
damage = 100;
}
break;
@@ -658,9 +658,9 @@ void Interface::doStepCode() {
}
if (_vm->_files->_isDarkCc && party._gameFlags[1][118]) {
- _falling = false;
+ _falling = FALL_NONE;
} else {
- if (_falling)
+ if (_falling != FALL_NONE)
startFalling(false);
if ((party._mazePosition.x & 16) || (party._mazePosition.y & 16)) {
@@ -692,32 +692,19 @@ void Interface::startFalling(bool flag) {
bool isDarkCc = _vm->_files->_isDarkCc;
if (isDarkCc && party._gameFlags[1][118]) {
- _falling = 0;
+ _falling = FALL_NONE;
return;
}
- _falling = false;
+ _falling = FALL_NONE;
draw3d(true);
- _falling = 2;
+ _falling = FALL_2;
draw3d(false);
- if (flag) {
- if (!isDarkCc || party._fallMaze != 0) {
- party._mazeId = party._fallMaze;
- party._mazePosition = party._fallPosition;
- }
- }
-
- _falling = true;
- map.load(party._mazeId);
- if (flag) {
- if (((party._mazePosition.x & 16) || (party._mazePosition.y & 16)) &&
- map._isOutdoors) {
- map.getNewMaze();
- }
- }
-
- if (isDarkCc) {
+ if (flag && (!isDarkCc || party._fallMaze != 0)) {
+ party._mazeId = party._fallMaze;
+ party._mazePosition = party._fallPosition;
+ } else if (!isDarkCc) {
switch (party._mazeId - 25) {
case 0:
case 26:
@@ -888,6 +875,12 @@ void Interface::startFalling(bool flag) {
}
}
+ _falling = FALL_1;
+ map.load(party._mazeId);
+
+ if (flag && map._isOutdoors && ((party._mazePosition.x & 16) || (party._mazePosition.y & 16)))
+ map.getNewMaze();
+
_flipGround ^= 1;
draw3d(true);
int tempVal = scripts._v2;
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index 991b050bad..5051dad692 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -47,6 +47,12 @@ enum IconsMode {
ICONS_COMBAT = 1
};
+enum FallState {
+ FALL_NONE = 0,
+ FALL_1 = 1,
+ FALL_2 = 2
+};
+
#define HILIGHT_CHAR_DISABLED -2
#define HILIGHT_CHAR_NONE -1
@@ -139,7 +145,7 @@ private:
public:
Obscurity _obscurity;
Common::String _interfaceText;
- int _falling;
+ FallState _falling;
int _face1State, _face2State;
int _face1UIFrame, _face2UIFrame;
int _spotDoorsUIFrame;