diff options
author | Filippos Karapetis | 2008-09-11 09:31:45 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-09-11 09:31:45 +0000 |
commit | fa3d3e36436770ca8ecc7fc9ddadaf515e0c7861 (patch) | |
tree | 7ba2043f5b46024e047e6c360fd38bb68a1de015 /engines/drascula/graphics.cpp | |
parent | 19dd03dfa8fbc48d4cfb511033e8c2930607a01b (diff) | |
download | scummvm-rg350-fa3d3e36436770ca8ecc7fc9ddadaf515e0c7861.tar.gz scummvm-rg350-fa3d3e36436770ca8ecc7fc9ddadaf515e0c7861.tar.bz2 scummvm-rg350-fa3d3e36436770ca8ecc7fc9ddadaf515e0c7861.zip |
- The game's cursor is now handled via ScummVM's cursor manager, instead of the game itself (this means that there might be regressions where the cursor is visible when it shouldn't be)
- Removed the textSurface pointer, which was used in the Spanish version. Non-Spanish versions of the game hold the font data in the tableSurface buffer (which contains picture 96). The font data for Spanish versions is in picture 974. Now both versions load their font data from the tableSurface buffer
- hay_que_load -> loadedDifferentChapter
- Merged withoutVerb() and selectVerb()
This is a big change, it might lead to regressions!
svn-id: r34488
Diffstat (limited to 'engines/drascula/graphics.cpp')
-rw-r--r-- | engines/drascula/graphics.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 6fc7e54bc4..e11181e798 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -24,6 +24,7 @@ */ #include "drascula/drascula.h" +#include "graphics/cursorman.h" namespace Drascula { @@ -47,6 +48,10 @@ void DrasculaEngine::allocMemory() { assert(tableSurface); extraSurface = (byte *)malloc(64000); assert(extraSurface); + crosshairCursor = (byte *)malloc(40 * 25); + assert(crosshairCursor); + mouseCursor = (byte *)malloc(OBJWIDTH * OBJHEIGHT); + assert(mouseCursor); } void DrasculaEngine::freeMemory() { @@ -58,6 +63,8 @@ void DrasculaEngine::freeMemory() { free(drawSurface3); free(extraSurface); free(frontSurface); + free(crosshairCursor); + free(mouseCursor); } void DrasculaEngine::moveCursor() { @@ -78,14 +85,26 @@ void DrasculaEngine::moveCursor() { showMenu(); else if (menuBar == 1) clearMenu(); +} + +void DrasculaEngine::setCursor(int cursor) { + switch (cursor) { + case kCursorCrosshair: + CursorMan.replaceCursor((const byte *)crosshairCursor, 40, 25, 0, 0); + break; + case kCursorCurrentItem: + CursorMan.replaceCursor((const byte *)mouseCursor, OBJWIDTH, OBJHEIGHT, 20, 17); + default: + break; + } +} - int cursorPos[6] = { 0, 0, mouseX - 20, mouseY - 17, OBJWIDTH, OBJHEIGHT }; - copyRectClip(cursorPos, drawSurface3, screenSurface); +void DrasculaEngine::showCursor() { + CursorMan.showMouse(true); } -void DrasculaEngine::setCursorTable() { - int cursorPos[6] = { 225, 56, mouseX - 20, mouseY - 12, 40, 25 }; - copyRectClip(cursorPos, tableSurface, screenSurface); +void DrasculaEngine::hideCursor() { + CursorMan.showMouse(false); } void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) { @@ -244,7 +263,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { } // for int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT }; - copyRectClip(textPos, textSurface, screenSurface); + copyRectClip(textPos, tableSurface, screenSurface); screenX = screenX + CHAR_WIDTH; if (screenX > 317) { |