aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/dm/dm.cpp1
-rw-r--r--engines/dm/eventman.cpp37
-rw-r--r--engines/dm/eventman.h3
3 files changed, 36 insertions, 5 deletions
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index df6629c3f9..a86e7850b9 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -80,6 +80,7 @@ Common::Error DMEngine::run() {
_displayMan->loadPalette(gPalCredits);
_eventMan->initMouse();
+ _eventMan->showMouse(true);
while (true) {
_eventMan->processInput();
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 44ea32795f..96a6bf570a 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -2,23 +2,52 @@
#include "dm.h"
#include "common/system.h"
#include "dungeonman.h"
+#include "graphics/cursorman.h"
+#include "gfx.h"
using namespace DM;
-EventManager::EventManager(DMEngine *vm) : _vm(vm) {}
+EventManager::EventManager(DMEngine *vm) : _vm(vm) {
+ _dummyMapIndex = 0;
+}
+
+
+// dummy data
+static const byte mouseData[] = {
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 1, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 1, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 1, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 1, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 1, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 7, 1, 0,
+ 1, 7, 7, 7, 7, 7, 1, 1, 1, 1,
+ 1, 7, 7, 1, 7, 7, 1, 0, 0, 0,
+ 1, 7, 1, 0, 1, 7, 7, 1, 0, 0,
+ 1, 1, 0, 0, 1, 7, 7, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 0, 0
+};
+#define MOUSE_WIDTH 10
+#define MOUSE_HEIGHT 15
void EventManager::initMouse() {
_mousePos = Common::Point(0, 0);
- _dummyMapIndex = 0;
+ CursorMan.pushCursor(mouseData, MOUSE_WIDTH, MOUSE_HEIGHT, 0, 0, 0);
+ CursorMan.showMouse(false);
+
+ setMousePos(Common::Point(320/2, 200/2));
// TODO: add cursor creatin, set to hidden
}
-void showMouse(bool visibility) {
- // TODO: add code
+void EventManager::showMouse(bool visibility) {
+ CursorMan.showMouse(visibility);
}
void EventManager::setMousePos(Common::Point pos) {
diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h
index eabff49a2b..ccce4c46b7 100644
--- a/engines/dm/eventman.h
+++ b/engines/dm/eventman.h
@@ -17,12 +17,13 @@ class EventManager {
public:
EventManager(DMEngine *vm);
void initMouse();
+ void showMouse(bool visibility);
void setMousePos(Common::Point pos);
void processInput();
};
-};
+}
#endif DM_EVENTMAN_H