diff options
author | Paul Gilbert | 2015-03-18 22:32:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-03-18 22:32:41 -0400 |
commit | 2dc355ff6ecbbc3650beecb341ebe4415de20101 (patch) | |
tree | 94faa056336d7a1cd77f23f92a3b5fc6c462d9da /engines/sherlock/events.cpp | |
parent | b8ad1ce140c91257ba79fe50f41da34a5a6e74c2 (diff) | |
download | scummvm-rg350-2dc355ff6ecbbc3650beecb341ebe4415de20101.tar.gz scummvm-rg350-2dc355ff6ecbbc3650beecb341ebe4415de20101.tar.bz2 scummvm-rg350-2dc355ff6ecbbc3650beecb341ebe4415de20101.zip |
SHERLOCK: Implement Scalpel-specific scene starting
Diffstat (limited to 'engines/sherlock/events.cpp')
-rw-r--r-- | engines/sherlock/events.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index b2d9fc65e8..1a882eedea 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -32,7 +32,8 @@ namespace Sherlock { EventsManager::EventsManager(SherlockEngine *vm) { _vm = vm; - _cursorId = CURSOR_NONE; + _cursorSprites = nullptr; + _cursorIndex = -1; _frameCounter = 1; _priorFrameTime = 0; _mouseClicked = false; @@ -40,15 +41,30 @@ EventsManager::EventsManager(SherlockEngine *vm) { } EventsManager::~EventsManager() { + delete _cursorSprites; +} + +/** + * Load a set of cursors from the specified file + */ +void EventsManager::loadCursors(const Common::String &filename) { + hideCursor(); + delete _cursorSprites; + + _cursorSprites = new Sprite(filename); } /** * Set the cursor to show */ -void EventsManager::setCursor(CursorType cursorId) { - _cursorId = cursorId; +void EventsManager::changeCursor(int cursorIndex) { + _cursorIndex = cursorIndex; + + // Set the cursor data + Graphics::Surface &s = (*_cursorSprites)[cursorIndex]; + CursorMan.replaceCursor(s.getPixels(), s.w, s.h, s.w / 2, s.h / 2, 0xff); - // TODO: Cursor handling + showCursor(); } /** |