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:
Denis Kasak 2009-08-09 03:58:03 +00:00
parent c193c80e67
commit 295ab7e6ff
2 changed files with 14 additions and 3 deletions

View File

@ -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);

View File

@ -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; }