[Scummvm-cvs-logs] scummvm master -> 984010faae5d7cac0cef8f74229f9761cf7dd934
bluegr
md5 at scummvm.org
Fri Dec 16 21:30:32 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
984010faae DREAMWEB: Port 'identifyob' to C++
Commit: 984010faae5d7cac0cef8f74229f9761cf7dd934
https://github.com/scummvm/scummvm/commit/984010faae5d7cac0cef8f74229f9761cf7dd934
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-16T12:29:41-08:00
Commit Message:
DREAMWEB: Port 'identifyob' to C++
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/object.cpp
engines/dreamweb/stubs.h
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 6129340..c68483f 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -480,6 +480,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'helicopter',
'hotelbell',
'hotelcontrol',
+ 'identifyob',
'initialinv',
'initman',
'initrain',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0938efc..ddc599f 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3104,69 +3104,6 @@ void DreamGenContext::clearChanges() {
_stosw(cx, true);
}
-void DreamGenContext::identifyOb() {
- STACK_CHECK;
- _cmp(data.word(kWatchingtime), 0);
- if (!flags.z())
- { blank(); return; };
- ax = data.word(kMousex);
- _sub(ax, data.word(kMapadx));
- _cmp(ax, 22*8);
- if (flags.c())
- goto notover1;
- blank();
- return;
-notover1:
- bx = data.word(kMousey);
- _sub(bx, data.word(kMapady));
- _cmp(bx, 20*8);
- if (flags.c())
- goto notover2;
- blank();
- return;
-notover2:
- data.byte(kInmaparea) = 1;
- ah = bl;
- push(ax);
- findPathOfPoint();
- data.byte(kPointerspath) = dl;
- ax = pop();
- push(ax);
- findFirstPath();
- data.byte(kPointerfirstpath) = al;
- ax = pop();
- checkIfEx();
- if (!flags.z())
- return /* (finishidentify) */;
- checkIfFree();
- if (!flags.z())
- return /* (finishidentify) */;
- checkIfPerson();
- if (!flags.z())
- return /* (finishidentify) */;
- checkIfSet();
- if (!flags.z())
- return /* (finishidentify) */;
- ax = data.word(kMousex);
- _sub(ax, data.word(kMapadx));
- cl = al;
- ax = data.word(kMousey);
- _sub(ax, data.word(kMapady));
- ch = al;
- checkOne();
- _cmp(al, 0);
- if (flags.z())
- goto nothingund;
- _cmp(data.byte(kMandead), 1);
- if (flags.z())
- goto nothingund;
- ah = 3;
- obName();
- return;
-nothingund:
- blank();
-}
-
void DreamGenContext::findPathOfPoint() {
STACK_CHECK;
push(ax);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f3cedd8..5273270 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -475,12 +475,11 @@ public:
#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
void fadeDownMon();
- void identifyOb();
void getPersonText();
void clearBuffers();
void getObTextStart();
void checkObjectSize();
- void fillOpen();
+ void showSlots();
void useCashCard();
void moneyPoke();
void doSomeTalk();
@@ -519,7 +518,7 @@ public:
void rollEm();
void lookAtPlace();
void findAllOpen();
- void showSlots();
+ void fillOpen();
void deleteExObject();
void getEitherAd();
void setPickup();
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 5f326a5..64f70ad 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
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index d3f656d..6140f3d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -392,5 +392,6 @@
void withWhat();
void notHeldError();
void useGun();
+ void identifyOb();
#endif
More information about the Scummvm-git-logs
mailing list