mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-14 16:07:39 +00:00
NEVERHOOD: Add mouse cursor hiding/showing
This commit is contained in:
parent
682d15fce4
commit
f5c7070ace
@ -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) {
|
||||
_mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2), _visible(true) {
|
||||
|
||||
init(fileHash);
|
||||
if (_x <= _x1) {
|
||||
@ -85,6 +85,13 @@ void Mouse::load(uint32 fileHash) {
|
||||
}
|
||||
|
||||
void Mouse::update() {
|
||||
if (_visible && !_surface->getVisible()) {
|
||||
CursorMan.showMouse(false);
|
||||
_visible = false;
|
||||
} else if (!_visible && _surface->getVisible()) {
|
||||
CursorMan.showMouse(true);
|
||||
_visible = true;
|
||||
}
|
||||
updateCursor();
|
||||
_frameNum++;
|
||||
if (_frameNum >= 6)
|
||||
|
@ -51,6 +51,7 @@ protected:
|
||||
int16 _x1;
|
||||
int16 _x2;
|
||||
int _type;
|
||||
bool _visible;
|
||||
void init(uint32 fileHash);
|
||||
void update();
|
||||
void updateCursorNum();
|
||||
|
Loading…
x
Reference in New Issue
Block a user