mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
Added Mouse::loadItemCursor(). Removed hotspot FIXME as all cursors seem to use the same hotspot (the center of the sprite).
svn-id: r43158
This commit is contained in:
parent
c193c80e67
commit
295ab7e6ff
@ -88,12 +88,22 @@ void Mouse::setPosition(uint16 x, uint16 y) {
|
||||
_vm->_system->warpMouse(x, y);
|
||||
}
|
||||
|
||||
// FIXME: Handle hotspots properly
|
||||
void Mouse::setCursorType(CursorType cur) {
|
||||
_cursorType = cur;
|
||||
|
||||
BAFile *f;
|
||||
f = _vm->_iconsArchive->getFile(_cursorType);
|
||||
|
||||
Sprite sp(f->_data, f->_length, 0, 0, true);
|
||||
CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
|
||||
CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),
|
||||
sp.getWidth() / 2, sp.getHeight() / 2);
|
||||
}
|
||||
|
||||
void Mouse::loadItemCursor(int itemID, bool highlighted) {
|
||||
|
||||
BAFile *f;
|
||||
f = _vm->_iconsArchive->getFile(_cursorType);
|
||||
f = _vm->_itemImagesArchive->getFile(itemID + highlighted);
|
||||
|
||||
Sprite sp(f->_data, f->_length, 0, 0, true);
|
||||
CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
|
||||
|
@ -50,8 +50,9 @@ public:
|
||||
void cursorOff();
|
||||
bool isCursorOn();
|
||||
void setPosition(uint16 x, uint16 y);
|
||||
void setCursorType(CursorType cur);
|
||||
CursorType getCursorType() { return _cursorType; }
|
||||
void setCursorType(CursorType cur);
|
||||
void loadItemCursor(int itemID, bool highlighted = false);
|
||||
bool lButtonPressed() { return _lButton; }
|
||||
bool rButtonPressed() { return _rButton; }
|
||||
void lButtonSet(bool state) { _lButton = state; }
|
||||
|
Loading…
Reference in New Issue
Block a user