diff options
Diffstat (limited to 'engines/drascula/interface.cpp')
| -rw-r--r-- | engines/drascula/interface.cpp | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index ef1d1cc7a3..32f07fce73 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -24,9 +24,34 @@ */ #include "drascula/drascula.h" +#include "graphics/cursorman.h" namespace Drascula { +void DrasculaEngine::setCursor(int cursor) { + switch (cursor) { + case kCursorCrosshair: + CursorMan.replaceCursor((const byte *)crosshairCursor, 40, 25, 20, 17); + break; + case kCursorCurrentItem: + CursorMan.replaceCursor((const byte *)mouseCursor, OBJWIDTH, OBJHEIGHT, 20, 17); + default: + break; + } +} + +void DrasculaEngine::showCursor() { + CursorMan.showMouse(true); +} + +void DrasculaEngine::hideCursor() { + CursorMan.showMouse(false); +} + +bool DrasculaEngine::isCursorVisible() { + return CursorMan.isVisible(); +} + void DrasculaEngine::selectVerbFromBar() { for (int n = 0; n < 7; n++) { if (mouseX > _verbBarX[n] && mouseX < _verbBarX[n + 1] && n > 0) { @@ -36,7 +61,7 @@ void DrasculaEngine::selectVerbFromBar() { } // no verb selected - withoutVerb(); + selectVerb(0); } void DrasculaEngine::selectVerb(int verb) { @@ -50,10 +75,17 @@ void DrasculaEngine::selectVerb(int verb) { addObject(pickedObject); } - copyBackground(OBJWIDTH * verb, c, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3); + for (int i = 0; i < OBJHEIGHT; i++) + memcpy(mouseCursor + i * OBJWIDTH, backSurface + OBJWIDTH * verb + (c + i) * 320, OBJWIDTH); + setCursor(kCursorCurrentItem); - takeObject = 1; - pickedObject = verb; + if (verb > 0) { + takeObject = 1; + pickedObject = verb; + } else { + takeObject = 0; + hasName = 0; + } } bool DrasculaEngine::confirmExit() { @@ -61,7 +93,7 @@ bool DrasculaEngine::confirmExit() { color_abc(kColorRed); updateRoom(); - centerText(_textsys[_lang][1], 160, 87); + centerText(_textsys[1], 160, 87); updateScreen(); delay(100); @@ -194,25 +226,4 @@ void DrasculaEngine::showMap() { } } -void DrasculaEngine::grr() { - int length = 30; - - color_abc(kColorDarkGreen); - - playFile("s10.als"); - - updateRoom(); - copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface); - - if (withVoices == 0) - centerText("groaaarrrrgghhhh!", 153, 65); - - updateScreen(); - - while (!isTalkFinished(&length)); - - updateRoom(); - updateScreen(); -} - } // End of namespace Drascula |
