[Scummvm-cvs-logs] SF.net SVN: scummvm:[43158] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sun Aug 9 05:58:03 CEST 2009


Revision: 43158
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43158&view=rev
Author:   dkasak13
Date:     2009-08-09 03:58:03 +0000 (Sun, 09 Aug 2009)

Log Message:
-----------
Added Mouse::loadItemCursor(). Removed hotspot FIXME as all cursors seem to use the same hotspot (the center of the sprite).

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/mouse.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp	2009-08-09 01:56:43 UTC (rev 43157)
+++ scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp	2009-08-09 03:58:03 UTC (rev 43158)
@@ -88,12 +88,22 @@
 	_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);

Modified: scummvm/branches/gsoc2009-draci/engines/draci/mouse.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/mouse.h	2009-08-09 01:56:43 UTC (rev 43157)
+++ scummvm/branches/gsoc2009-draci/engines/draci/mouse.h	2009-08-09 03:58:03 UTC (rev 43158)
@@ -50,8 +50,9 @@
 	void cursorOff();
 	bool isCursorOn();
 	void setPosition(uint16 x, uint16 y);
+	CursorType getCursorType() { return _cursorType; }
 	void setCursorType(CursorType cur);
-	CursorType getCursorType() { return _cursorType; }
+	void loadItemCursor(int itemID, bool highlighted = false);
 	bool lButtonPressed() { return _lButton; }
 	bool rButtonPressed() { return _rButton; }
 	void lButtonSet(bool state) { _lButton = state; }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list