aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-03 22:43:18 +0100
committerAlyssa Milburn2011-11-03 22:43:18 +0100
commit07f578b8aa8df60ab27f6ac3b9d0c1933d5e8796 (patch)
tree4b56812b75cf63dbf24e3912cc11014786b54173
parent51fb6295696067a54576e1ccdac9aaa8b4e8fcae (diff)
downloadscummvm-rg350-07f578b8aa8df60ab27f6ac3b9d0c1933d5e8796.tar.gz
scummvm-rg350-07f578b8aa8df60ab27f6ac3b9d0c1933d5e8796.tar.bz2
scummvm-rg350-07f578b8aa8df60ab27f6ac3b9d0c1933d5e8796.zip
COMPOSER: Provide default mouse cursor if needed.
-rw-r--r--engines/composer/composer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 6650a4a129..9f4936b8c8 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -32,6 +32,7 @@
#include "graphics/cursorman.h"
#include "graphics/surface.h"
#include "graphics/pixelformat.h"
+#include "graphics/wincursor.h"
#include "engines/util.h"
#include "engines/advancedDetector.h"
@@ -99,6 +100,11 @@ Common::Error ComposerEngine::run() {
_surface.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_needsUpdate = true;
+ Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor();
+ CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(),
+ cursor->getHotspotY(), cursor->getKeyColor());
+ CursorMan.replaceCursorPalette(cursor->getPalette(), cursor->getPaletteStartIndex(), cursor->getPaletteCount());
+
loadLibrary(0);
_currentTime = 0;
@@ -241,8 +247,8 @@ void ComposerEngine::onMouseMove(const Common::Point &pos) {
if (_mouseSpriteId) {
addSprite(_mouseSpriteId, 0, 0, _lastMousePos - _mouseOffset);
- _needsUpdate = true;
}
+ _needsUpdate = true;
}
void ComposerEngine::onKeyDown(uint16 keyCode) {
@@ -269,11 +275,15 @@ void ComposerEngine::setCursorVisible(bool visible) {
_mouseVisible = true;
if (_mouseSpriteId)
addSprite(_mouseSpriteId, 0, 0, _lastMousePos - _mouseOffset);
+ else
+ CursorMan.showMouse(true);
onMouseMove(_lastMousePos);
} else if (!visible && _mouseVisible) {
_mouseVisible = false;
if (_mouseSpriteId)
removeSprite(_mouseSpriteId, 0);
+ else
+ CursorMan.showMouse(false);
}
}