aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-07-30 05:58:48 +0000
committerTravis Howell2005-07-30 05:58:48 +0000
commit2cdb00d0a203055b4576c59c63a84b176e9d6860 (patch)
treed97136defb7f299de5a1156563b86f80bdbfe0c6
parent03d7c4ba39b04ecc608e0eb0837d70d1913ea0c2 (diff)
downloadscummvm-rg350-2cdb00d0a203055b4576c59c63a84b176e9d6860.tar.gz
scummvm-rg350-2cdb00d0a203055b4576c59c63a84b176e9d6860.tar.bz2
scummvm-rg350-2cdb00d0a203055b4576c59c63a84b176e9d6860.zip
Add He70 version of function instead.
svn-id: r18600
-rw-r--r--scumm/actor.cpp44
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/scumm.h2
3 files changed, 29 insertions, 19 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 7903527a7a..559e28571f 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1297,29 +1297,37 @@ int ScummEngine::getActorFromPos(int x, int y) {
if (!testGfxAnyUsageBits(x / 8))
return 0;
- if (_heversion >= 70) {
- int result = 0;
-
- for (i = 1; i < _numActors; i++) {
- if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
- && y >= _actors[i]._top && y <= _actors[i]._bottom && _actors[i]._pos.y > _actors[result]._pos.y) {
- if (_version > 2 || i != VAR(VAR_EGO)) {
- result = i;
- }
- }
+ for (i = 1; i < _numActors; i++) {
+ if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
+ && y >= _actors[i]._top && y <= _actors[i]._bottom) {
+ if (_version > 2 || i != VAR(VAR_EGO))
+ return i;
}
- return result;
- } else {
- for (i = 1; i < _numActors; i++) {
- if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
- && y >= _actors[i]._top && y <= _actors[i]._bottom) {
- if (_version > 2 || i != VAR(VAR_EGO))
- return i;
+ }
+
+ return 0;
+}
+
+#ifndef DISABLE_HE
+int ScummEngine_v70he::getActorFromPos(int x, int y) {
+ int i;
+ int result = 0;
+
+ if (!testGfxAnyUsageBits(x / 8))
+ return 0;
+
+ for (i = 1; i < _numActors; i++) {
+ if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
+ && y >= _actors[i]._top && y <= _actors[i]._bottom && _actors[i]._pos.y > _actors[result]._pos.y) {
+ if (_version > 2 || i != VAR(VAR_EGO)) {
+ result = i;
}
}
- return 0;
}
+
+ return result;
}
+#endif
#ifndef DISABLE_SCUMM_7_8
void ScummEngine_v7::actorTalk(const byte *msg) {
diff --git a/scumm/intern.h b/scumm/intern.h
index daf6e581c3..67031bb0b1 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -830,6 +830,8 @@ protected:
virtual void readGlobalObjects();
virtual void readIndexBlock(uint32 blocktype, uint32 itemsize);
+ virtual int getActorFromPos(int x, int y);
+
int getStringCharWidth(byte chr);
virtual int setupStringArray(int size);
void appendSubstring(int dst, int src, int len2, int len);
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 6af29e1287..989fd67084 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -842,7 +842,7 @@ protected:
void resetActorBgs();
virtual void processActors();
void processUpperActors();
- int getActorFromPos(int x, int y);
+ virtual int getActorFromPos(int x, int y);
public:
/* Actor talking stuff */