diff options
author | Bertrand Augereau | 2011-09-02 06:38:08 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-09-02 07:57:18 +0200 |
commit | 98a6b339afcb6bb177ef898f2a83633269d2eea7 (patch) | |
tree | 0fc566270549ab0f248cbd675860c5ba2955e53d /engines | |
parent | 850501147253fa1f0c3f1458ccfb11a733eaa355 (diff) | |
download | scummvm-rg350-98a6b339afcb6bb177ef898f2a83633269d2eea7.tar.gz scummvm-rg350-98a6b339afcb6bb177ef898f2a83633269d2eea7.tar.bz2 scummvm-rg350-98a6b339afcb6bb177ef898f2a83633269d2eea7.zip |
DREAMWEB: 'checkpathison' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 15 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/pathfind.cpp | 18 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
5 files changed, 18 insertions, 22 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index d59ff61a94..79e4746fb4 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14882,20 +14882,6 @@ gotfirst: al = es.byte(bx+6); } -void DreamGenContext::checkifpathison() { - STACK_CHECK; - push(ax); - getroomspaths(); - ax = pop(); - ah = 0; - _add(ax, ax); - _add(ax, ax); - _add(ax, ax); - _add(bx, ax); - al = es.byte(bx+6); - _cmp(al, 255); -} - void DreamGenContext::afternewroom() { STACK_CHECK; _cmp(data.byte(kNowinnewroom), 0); @@ -17852,7 +17838,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_identifyob: identifyob(); break; case addr_findpathofpoint: findpathofpoint(); break; case addr_findfirstpath: findfirstpath(); break; - case addr_checkifpathison: checkifpathison(); break; case addr_afternewroom: afternewroom(); break; case addr_atmospheres: atmospheres(); break; case addr_walkintoroom: walkintoroom(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index a27665bf37..c2674c2d42 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -110,7 +110,6 @@ public: static const uint16 addr_walkintoroom = 0xca10; static const uint16 addr_atmospheres = 0xca0c; static const uint16 addr_afternewroom = 0xca08; - static const uint16 addr_checkifpathison = 0xca04; static const uint16 addr_findfirstpath = 0xc9f0; static const uint16 addr_findpathofpoint = 0xc9ec; static const uint16 addr_identifyob = 0xc9d4; @@ -1576,7 +1575,7 @@ public: void usecooker(); void loadmenu(); void checkforemm(); - void checkifpathison(); + //void checkifpathison(); //void finalframe(); void receptionist(); void selectslot(); diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp index ef07199211..9069c9d3be 100644 --- a/engines/dreamweb/pathfind.cpp +++ b/engines/dreamweb/pathfind.cpp @@ -36,7 +36,7 @@ void DreamGenContext::turnpathon(uint8 param) { PathNode *roomsPaths = getroomspathsCPP()->nodes; if (param == 0xff) return; - roomsPaths[param].b6 = 0xff; + roomsPaths[param].on = 0xff; } void DreamGenContext::turnpathoff() { @@ -48,13 +48,13 @@ void DreamGenContext::turnpathoff(uint8 param) { PathNode *roomsPaths = getroomspathsCPP()->nodes; if (param == 0xff) return; - roomsPaths[param].b6 = 0x00; + roomsPaths[param].on = 0x00; } void DreamGenContext::turnanypathon(uint8 param, uint8 room) { findormake(param, 0xff, room + 100); PathNode *paths = (PathNode *)segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); - paths[param].b6 = 0xff; + paths[param].on = 0xff; } @@ -65,7 +65,7 @@ void DreamGenContext::turnanypathon() { void DreamGenContext::turnanypathoff(uint8 param, uint8 room) { findormake(param, 0x00, room + 100); PathNode *paths = (PathNode *)segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); - paths[param].b6 = 0x00; + paths[param].on = 0x00; } void DreamGenContext::turnanypathoff() { @@ -128,5 +128,15 @@ void DreamGenContext::findxyfrompath() { data.byte(kRyany) = roomsPaths[data.byte(kManspath)].y - 12; } +void DreamGenContext::checkifpathison() { + flags._z = checkifpathison(al); +} + +bool DreamGenContext::checkifpathison(uint8 index) { + RoomPaths *roomsPaths = getroomspathsCPP(); + uint8 pathOn = roomsPaths->nodes[index].on; + return pathOn == 0xff; +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 7c9d9a5814..0d7bbb6cbf 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -235,7 +235,7 @@ struct PathNode { uint8 b3; uint8 b4; uint8 b5; - uint8 b6; + uint8 on; uint8 dir; }; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index da743c05f0..a272407b4f 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -220,4 +220,6 @@ bool isitdescribed(const ObjPos *objPos); void checkifset(); bool checkifset(uint8 x, uint8 y); + void checkifpathison(); + bool checkifpathison(uint8 index); |