From 2dc355ff6ecbbc3650beecb341ebe4415de20101 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 Mar 2015 22:32:41 -0400 Subject: SHERLOCK: Implement Scalpel-specific scene starting --- engines/sherlock/events.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'engines/sherlock/events.cpp') 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(); } /** -- cgit v1.2.3