diff options
author | Arnaud Boutonné | 2010-10-22 20:45:00 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-10-22 20:45:00 +0000 |
commit | 4a0ba817e58c5a1c7d17af5a79f91570dd98ca16 (patch) | |
tree | 9cd068b31f3cb26e73a0b016de7701a651e76183 /engines/hugo/hugo.cpp | |
parent | 031e0167e4979fcb9f5bef3fde273605d3dc8eb9 (diff) | |
download | scummvm-rg350-4a0ba817e58c5a1c7d17af5a79f91570dd98ca16.tar.gz scummvm-rg350-4a0ba817e58c5a1c7d17af5a79f91570dd98ca16.tar.bz2 scummvm-rg350-4a0ba817e58c5a1c7d17af5a79f91570dd98ca16.zip |
HUGO: Move findObjectSpace() to ObjectHandler class
svn-id: r53705
Diffstat (limited to 'engines/hugo/hugo.cpp')
-rw-r--r-- | engines/hugo/hugo.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index e59ee9a61c..cd7d8ac2fc 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -1737,49 +1737,6 @@ void HugoEngine::processMaze() { } } -// Find a clear space around supplied object that hero can walk to -bool HugoEngine::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) { - debugC(1, kDebugEngine, "findObjectSpace(obj, %d, %d)", *destx, *desty); - - seq_t *curImage = obj->currImagePtr; - int16 y = obj->y + curImage->y2 - 1; - - bool foundFl = true; - // Try left rear corner - for (int16 x = *destx = obj->x + curImage->x1; x < *destx + HERO_MAX_WIDTH; x++) { - if (BOUND(x, y)) - foundFl = false; - } - - if (!foundFl) { // Try right rear corner - foundFl = true; - for (int16 x = *destx = obj->x + curImage->x2 - HERO_MAX_WIDTH + 1; x <= obj->x + (int16)curImage->x2; x++) { - if (BOUND(x, y)) - foundFl = false; - } - } - - if (!foundFl) { // Try left front corner - foundFl = true; - y += 2; - for (int16 x = *destx = obj->x + curImage->x1; x < *destx + HERO_MAX_WIDTH; x++) { - if (BOUND(x, y)) - foundFl = false; - } - } - - if (!foundFl) { // Try right rear corner - foundFl = true; - for (int16 x = *destx = obj->x + curImage->x2 - HERO_MAX_WIDTH + 1; x <= obj->x + (int16)curImage->x2; x++) { - if (BOUND(x, y)) - foundFl = false; - } - } - - *desty = y; - return foundFl; -} - // Search background command list for this screen for supplied object. // Return first associated verb (not "look") or 0 if none found. char *HugoEngine::useBG(char *name) { |