aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232012-10-18 16:50:18 +0000
committerWillem Jan Palenstijn2013-05-08 20:47:32 +0200
commit9b7354dacb343a1618f8329c660fcba170f86ede (patch)
tree59464b5f3a26c7c7f0ee8e59df0054c8883194d3 /engines
parentc7ad09c6856cc5e3be805866623d94258360fd60 (diff)
downloadscummvm-rg350-9b7354dacb343a1618f8329c660fcba170f86ede.tar.gz
scummvm-rg350-9b7354dacb343a1618f8329c660fcba170f86ede.tar.bz2
scummvm-rg350-9b7354dacb343a1618f8329c660fcba170f86ede.zip
NEVERHOOD: Fix mouse cursor visibility by starting out invisible when the Mouse object is created and hiding the cursor when it's destroyed
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/mouse.cpp6
-rw-r--r--engines/neverhood/mouse.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/neverhood/mouse.cpp b/engines/neverhood/mouse.cpp
index bce66467de..8cd5e602fb 100644
--- a/engines/neverhood/mouse.cpp
+++ b/engines/neverhood/mouse.cpp
@@ -42,7 +42,7 @@ Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, const NRect &mouseRect)
Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, int16 x1, int16 x2)
: StaticSprite(vm, 2000), _mouseType(kMouseType435),
- _mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2), _visible(true) {
+ _mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2), _visible(false) {
init(fileHash);
if (_x <= _x1) {
@@ -63,6 +63,10 @@ Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, int type)
_mouseCursorResource.setCursorNum(0);
}
+Mouse::~Mouse() {
+ CursorMan.showMouse(false);
+}
+
void Mouse::init(uint32 fileHash) {
_mouseCursorResource.load(fileHash);
_x = _vm->getMouseX();
diff --git a/engines/neverhood/mouse.h b/engines/neverhood/mouse.h
index a163a7a01c..2b0e8b720e 100644
--- a/engines/neverhood/mouse.h
+++ b/engines/neverhood/mouse.h
@@ -41,6 +41,7 @@ public:
Mouse(NeverhoodEngine *vm, uint32 fileHash, const NRect &mouseRect);
Mouse(NeverhoodEngine *vm, uint32 fileHash, int16 x1, int16 x2);
Mouse(NeverhoodEngine *vm, uint32 fileHash, int _type);
+ virtual ~Mouse();
void load(uint32 fileHash);
void updateCursor();
protected: