diff options
author | Filippos Karapetis | 2011-12-16 22:29:41 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-16 22:29:41 +0200 |
commit | 984010faae5d7cac0cef8f74229f9761cf7dd934 (patch) | |
tree | f60fb86009270eb2b8f0265b7c84ea12ce86da27 /engines/dreamweb/object.cpp | |
parent | 12cac260c9acb16180ab4414fecd5748d77886f3 (diff) | |
download | scummvm-rg350-984010faae5d7cac0cef8f74229f9761cf7dd934.tar.gz scummvm-rg350-984010faae5d7cac0cef8f74229f9761cf7dd934.tar.bz2 scummvm-rg350-984010faae5d7cac0cef8f74229f9761cf7dd934.zip |
DREAMWEB: Port 'identifyob' to C++
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 5f326a5a03..64f70ada98 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -312,4 +312,42 @@ void DreamGenContext::openOb() { _openChangeSize = getOpenedSizeCPP() * kItempicsize + kInventx; } +void DreamGenContext::identifyOb() { + if (data.word(kWatchingtime) != 0 || + data.word(kMousex) - data.word(kMapadx) >= 22 * 8 || + data.word(kMousey) - data.word(kMapady) >= 20 * 8) { + blank(); + return; + } + + data.byte(kInmaparea) = 1; + ah = bl; + push(ax); + findPathOfPoint(); + data.byte(kPointerspath) = dl; + ax = pop(); + push(ax); + findFirstPath(); + data.byte(kPointerfirstpath) = al; + ax = pop(); + + byte x = al; + byte y = ah; + + if (checkIfEx(x, y) || checkIfFree(x, y) || + checkIfPerson(x, y) || checkIfSet(x, y)) + return; // finishidentify + + x = (data.word(kMousex) - data.word(kMapadx)) & 0xFF; + y = (data.word(kMousey) - data.word(kMapady)) & 0xFF; + byte flag, flagEx, type, flagX, flagY; + + checkOne(x, y, &flag, &flagEx, &type, &flagX, &flagY); + + if (type != 0 && data.byte(kMandead) != 1) + obName(type, 3); + else + blank(); +} + } // End of namespace DreamGen |