aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-12-02 12:42:03 +0100
committerBertrand Augereau2011-12-02 13:09:03 +0100
commit3f02cfe77126335d45ea8b97d90d5bd93bfb61ac (patch)
treeed07109b1f2487fdcd2cbdff47320c59aa1b846a /engines
parent95a8cdd36cb43c576232b50a0dd8dbbb676e39f0 (diff)
downloadscummvm-rg350-3f02cfe77126335d45ea8b97d90d5bd93bfb61ac.tar.gz
scummvm-rg350-3f02cfe77126335d45ea8b97d90d5bd93bfb61ac.tar.bz2
scummvm-rg350-3f02cfe77126335d45ea8b97d90d5bd93bfb61ac.zip
DREAMWEB: 'showKeypad' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp72
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/keypad.cpp29
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 28 insertions, 76 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 11163ee9d2..a9fd0a6d01 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -9393,78 +9393,6 @@ void DreamGenContext::showOuterPad() {
showFrame();
}
-void DreamGenContext::showKeypad() {
- STACK_CHECK;
- al = 22;
- di = (36+112)+9;
- bx = (72)+5;
- singleKey();
- al = 23;
- di = (36+112)+31;
- bx = (72)+5;
- singleKey();
- al = 24;
- di = (36+112)+53;
- bx = (72)+5;
- singleKey();
- al = 25;
- di = (36+112)+9;
- bx = (72)+23;
- singleKey();
- al = 26;
- di = (36+112)+31;
- bx = (72)+23;
- singleKey();
- al = 27;
- di = (36+112)+53;
- bx = (72)+23;
- singleKey();
- al = 28;
- di = (36+112)+9;
- bx = (72)+41;
- singleKey();
- al = 29;
- di = (36+112)+31;
- bx = (72)+41;
- singleKey();
- al = 30;
- di = (36+112)+53;
- bx = (72)+41;
- singleKey();
- al = 31;
- di = (36+112)+9;
- bx = (72)+59;
- singleKey();
- al = 32;
- di = (36+112)+31;
- bx = (72)+59;
- singleKey();
- _cmp(data.byte(kLightcount), 0);
- if (flags.z())
- return /* (notenter) */;
- _dec(data.byte(kLightcount));
- al = 36;
- bx = (72)-1+63;
- _cmp(data.byte(kLockstatus), 0);
- if (!flags.z())
- goto changelight;
- al = 41;
- bx = (72)+4+63;
-changelight:
- _cmp(data.byte(kLightcount), 60);
- if (flags.c())
- goto gotlight;
- _cmp(data.byte(kLightcount), 100);
- if (!flags.c())
- goto gotlight;
- _dec(al);
-gotlight:
- ds = data.word(kTempgraphics);
- ah = 0;
- di = (36+112)+60;
- showFrame();
-}
-
void DreamGenContext::dumpKeypad() {
STACK_CHECK;
di = (36+112)-3;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f6c482b082..dbc21d1c87 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -774,7 +774,6 @@ public:
void setupPit();
void showPCX();
void showDecisions();
- void showKeypad();
void removeObFromInv();
void useCoveredBox();
void openYourNeighbour();
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index dc19d97bd2..c17fd10f61 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -42,8 +42,33 @@ void DreamGenContext::singleKey(uint8 key, uint16 x, uint16 y) {
showFrame(tempGraphics(), x, y, key, 0);
}
-void DreamGenContext::singleKey() {
- singleKey(al, di, bx);
+void DreamGenContext::showKeypad() {
+ singleKey(22, kKeypadx+9, kKeypady+5);
+ singleKey(23, kKeypadx+31, kKeypady+5);
+ singleKey(24, kKeypadx+53, kKeypady+5);
+ singleKey(25, kKeypadx+9, kKeypady+23);
+ singleKey(26, kKeypadx+31, kKeypady+23);
+ singleKey(27, kKeypadx+53, kKeypady+23);
+ singleKey(28, kKeypadx+9, kKeypady+41);
+ singleKey(29, kKeypadx+31, kKeypady+41);
+ singleKey(30, kKeypadx+53, kKeypady+41);
+ singleKey(31, kKeypadx+9, kKeypady+59);
+ singleKey(32, kKeypadx+31, kKeypady+59);
+ if (data.byte(kLightcount)) {
+ --data.byte(kLightcount);
+ uint8 frameIndex;
+ uint16 y;
+ if (data.byte(kLockstatus)) {
+ frameIndex = 36;
+ y = kKeypady-1+63;
+ } else {
+ frameIndex = 41;
+ y = kKeypady+4+63;
+ }
+ if ((data.byte(kLightcount) >= 60) && (data.byte(kLightcount) < 100))
+ --frameIndex;
+ showFrame(tempGraphics(), kKeypadx+60, y, frameIndex, 0);
+ }
}
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 25b2b531f9..1fca50d08a 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -383,5 +383,5 @@
void eden(ReelRoutine &routine);
void sparky(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
- void singleKey();
+ void showKeypad();