diff options
author | Matthew Hoops | 2011-08-16 01:23:02 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-08-16 01:23:02 -0400 |
commit | 310bd54e64fef98438439c6966c7785764ca53b7 (patch) | |
tree | 0241c29743af9401ac6d7f262087f3bf8e2a4504 | |
parent | a18312677d3fa29b55168743c0d8b58f94847f53 (diff) | |
download | scummvm-rg350-310bd54e64fef98438439c6966c7785764ca53b7.tar.gz scummvm-rg350-310bd54e64fef98438439c6966c7785764ca53b7.tar.bz2 scummvm-rg350-310bd54e64fef98438439c6966c7785764ca53b7.zip |
SCUMM: Set the default moonbase cursor to be the default Windows cursor
-rw-r--r-- | engines/scumm/cursor.cpp | 42 | ||||
-rw-r--r-- | engines/scumm/he/intern_he.h | 2 |
2 files changed, 44 insertions, 0 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index a8adb4d5c5..6708d393f3 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -22,6 +22,9 @@ #include "common/system.h" #include "common/util.h" #include "graphics/cursorman.h" +#ifdef ENABLE_HE +#include "graphics/wincursor.h" +#endif #include "scumm/bomp.h" #include "scumm/charset.h" #include "scumm/he/intern_he.h" @@ -226,6 +229,45 @@ void ScummEngine_v70he::setDefaultCursor() { updateCursor(); } +#ifdef ENABLE_HE +void ScummEngine_v100he::setDefaultCursor() { + if (_game.id == GID_MOONBASE) { + // Moonbase uses the default Windows cursor instead of the usual + // default HE cursor. + Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor(); + + // Clear the cursor + for (int i = 0; i < 1024; i++) + WRITE_UINT16(_grabbedCursor + i * 2, 5); + + _cursor.width = cursor->getWidth(); + _cursor.height = cursor->getHeight(); + _cursor.hotspotX = cursor->getHotspotX(); + _cursor.hotspotY = cursor->getHotspotY(); + + const byte *surface = cursor->getSurface(); + const byte *palette = cursor->getPalette(); + + for (uint16 y = 0; y < _cursor.height; y++) { + for (uint16 x = 0; x < _cursor.width; x++) { + byte pixel = *surface++; + if (pixel != cursor->getKeyColor()) { + pixel -= cursor->getPaletteStartIndex(); + WRITE_UINT16(_grabbedCursor + (y * _cursor.width + x) * 2, get16BitColor(palette[pixel * 3], palette[pixel * 3 + 1], palette[pixel * 3 + 2])); + } + + } + } + + delete cursor; + + updateCursor(); + } else { + ScummEngine_v70he::setDefaultCursor(); + } +} +#endif + void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) { int w, h; const byte *dataptr, *bomp; diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index c49217b650..145172b901 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -570,6 +570,8 @@ protected: virtual void decodeParseString(int a, int b); + virtual void setDefaultCursor(); + /* HE version 100 script opcodes */ void o100_actorOps(); void o100_arrayOps(); |