aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorEugene Sandulenko2011-07-20 17:24:04 +0100
committerEugene Sandulenko2011-07-20 17:24:04 +0100
commit6a6594c7a9a60c0d3546cb2f67c89a9b57cbacea (patch)
treea274e455c704583d9e1096de4da380da686ac848 /engines/dreamweb
parentf28e4b6de7223b59aa1190ecfc9e68b066baef1b (diff)
downloadscummvm-rg350-6a6594c7a9a60c0d3546cb2f67c89a9b57cbacea.tar.gz
scummvm-rg350-6a6594c7a9a60c0d3546cb2f67c89a9b57cbacea.tar.bz2
scummvm-rg350-6a6594c7a9a60c0d3546cb2f67c89a9b57cbacea.zip
DREAMWEB: Made aboutturn() more readable
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/stubs.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 893bef5ccc..cd5350823a 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -968,34 +968,37 @@ void DreamGenContext::walking() {
}
void DreamGenContext::aboutturn(Sprite *sprite) {
+ bool incdir = true;
+
if (data.byte(kTurndirection) == 1)
- goto incdir;
+ incdir = true;
else if ((int8)data.byte(kTurndirection) == -1)
- goto decdir;
+ incdir = false;
else {
if (data.byte(kFacing) < data.byte(kTurntoface)) {
uint8 delta = data.byte(kTurntoface) - data.byte(kFacing);
if (delta >= 4)
- goto decdir;
+ incdir = false;
else
- goto incdir;
+ incdir = true;
} else {
uint8 delta = data.byte(kFacing) - data.byte(kTurntoface);
if (delta >= 4)
- goto incdir;
+ incdir = true;
else
- goto decdir;
+ incdir = false;
}
}
-incdir:
- data.byte(kTurndirection) = 1;
- data.byte(kFacing) = (data.byte(kFacing) + 1) & 7;
- sprite->b29 = 0;
- return;
-decdir:
- data.byte(kTurndirection) = -1;
- data.byte(kFacing) = (data.byte(kFacing) - 1) & 7;
- sprite->b29 = 0;
+
+ if (incdir) {
+ data.byte(kTurndirection) = 1;
+ data.byte(kFacing) = (data.byte(kFacing) + 1) & 7;
+ sprite->b29 = 0;
+ } else {
+ data.byte(kTurndirection) = -1;
+ data.byte(kFacing) = (data.byte(kFacing) - 1) & 7;
+ sprite->b29 = 0;
+ }
}
void DreamGenContext::backobject(Sprite *sprite) {