diff options
author | Bertrand Augereau | 2011-06-28 14:37:46 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-07-18 22:59:15 +0200 |
commit | 04d9db09022fdb2e9e747dfc8305a94fd64760ed (patch) | |
tree | 6688d7b00b02a58233863c3db9d0a188d786670c | |
parent | 40e5e03e32f08562738abde8a22ce4b0c98264f0 (diff) | |
download | scummvm-rg350-04d9db09022fdb2e9e747dfc8305a94fd64760ed.tar.gz scummvm-rg350-04d9db09022fdb2e9e747dfc8305a94fd64760ed.tar.bz2 scummvm-rg350-04d9db09022fdb2e9e747dfc8305a94fd64760ed.zip |
DREAMWEB: mainman reversed
-rw-r--r-- | engines/dreamweb/structs.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 52 |
2 files changed, 52 insertions, 3 deletions
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index c042a2d9cf..23d8390a7d 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -17,7 +17,8 @@ struct Sprite { uint8 priority; uint16 w24; uint16 w26; - uint16 w28; + uint8 b28; + uint8 b29; uint8 type; uint8 hidden; }; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 3271b701d6..c643e8abb0 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -702,7 +702,7 @@ void DreamGenContext::printasprite(const Sprite* sprite) { } ax = sprite->b15; - if (sprite->type != 0) + if (sprite->b29 != 0) ah = 8; showframe(); @@ -789,7 +789,54 @@ void DreamGenContext::mainmanCPP(Sprite* sprite) { bx += 32*(sprite-sprites); // - mainman(); + if (data.byte(kResetmanxy) == 1) { + data.byte(kResetmanxy) = 0; + sprite->x = data.byte(kRyanx); + sprite->y = data.byte(kRyany); + sprite->b29 = 0; + } + --sprite->b22; + if (sprite->b22 != 0xff) { + ds = pop(); + es = pop(); + return; + } + sprite->b22 = 0; + if (data.byte(kTurntoface) != data.byte(kFacing)) { + aboutturn(); + } else { + if ((data.byte(kTurndirection) != 0) && (data.byte(kLinepointer) == 254)) { + data.byte(kReasseschanges) = 1; + if (data.byte(kFacing) == data.byte(kLeavedirection)) + checkforexit(); + } + data.byte(kTurndirection) = 0; + if (data.byte(kLinepointer) == 254) { + sprite->b29 = 0; + } else { + ++sprite->b29; + if (sprite->b29 == 11) + sprite->b29 = 1; + walking(); + if (data.byte(kLinepointer) != 254) { + if ((data.byte(kFacing) & 1) == 0) + walking(); + else if ((sprite->b29 != 2) && (sprite->b29 != 7)) + walking(); + } + if (data.byte(kLinepointer) == 254) { + if (data.byte(kTurntoface) == data.byte(kFacing)) { + data.byte(kReasseschanges) = 1; + if (data.byte(kFacing) == data.byte(kLeavedirection)) + checkforexit(); + } + } + } + } + static const uint8 facelist[] = { 0,60,33,71,11,82,22,93 }; + sprite->b15 = sprite->b29 + facelist[data.byte(kFacing)]; + data.byte(kRyanx) = sprite->x; + data.byte(kRyany) = sprite->y; ds = pop(); es = pop(); @@ -1018,3 +1065,4 @@ void DreamGenContext::lockmon() { } } /*namespace dreamgen */ + |