[Scummvm-cvs-logs] SF.net SVN: scummvm: [21314] scummvm/trunk/engines/kyra

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Mar 15 05:33:07 CET 2006


Revision: 21314
Author:   eriktorbjorn
Date:     2006-03-15 05:32:35 -0800 (Wed, 15 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21314&view=rev

Log Message:
-----------
Added mouse wheel scrolling to save/restore dialogs.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui.cpp
    scummvm/trunk/engines/kyra/kyra.h
Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp	2006-03-15 12:53:25 UTC (rev 21313)
+++ scummvm/trunk/engines/kyra/gui.cpp	2006-03-15 13:32:35 UTC (rev 21314)
@@ -220,6 +220,12 @@
 }
 
 void KyraEngine::processButtonList(Button *list) {
+	if (_haveScrollButtons) {
+		if (_mouseWheel < 0)
+			gui_scrollUp(&_scrollUpButton);
+		else if (_mouseWheel > 0)
+			gui_scrollDown(&_scrollDownButton);
+	}
 	while (list) {
 		if (list->flags & 8) {
 			list = list->nextButton;
@@ -524,6 +530,8 @@
 	}
 
 	if (menu.scrollUpBtnX != -1) {
+		_haveScrollButtons = true;
+
 		_scrollUpButton.x = menu.scrollUpBtnX + menu.x;
 		_scrollUpButton.y = menu.scrollUpBtnY + menu.y;
 		_scrollUpButton.buttonCallback = &KyraEngine::gui_scrollUp;
@@ -537,7 +545,8 @@
 		_scrollDownButton.nextButton = 0;
 		_menuButtonList = initButton(_menuButtonList, &_scrollDownButton);
 		processMenuButton(&_scrollDownButton);
-	}
+	} else
+		_haveScrollButtons = false;
 
 	_screen->showMouse();
 	_screen->updateScreen();
@@ -561,6 +570,7 @@
 	uint32 now = _system->getMillis();
 
 	_mousePressFlag = false;
+	_mouseWheel = 0;
 	while (_system->pollEvent(event)) {
 		switch (event.type) {
 			case OSystem::EVENT_QUIT:
@@ -574,6 +584,12 @@
 				_mouseY = event.mouse.y;
 				_system->updateScreen();
 				break;
+			case OSystem::EVENT_WHEELUP:
+				_mouseWheel = -1;
+				break;
+			case OSystem::EVENT_WHEELDOWN:
+				_mouseWheel = 1;
+				break;
 			case OSystem::EVENT_KEYDOWN:
 				_keyboardEvent.pending = true;
 				_keyboardEvent.repeat = now + 400;

Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h	2006-03-15 12:53:25 UTC (rev 21313)
+++ scummvm/trunk/engines/kyra/kyra.h	2006-03-15 13:32:35 UTC (rev 21314)
@@ -163,7 +163,7 @@
 	uint8 process2;
 	// uint8 unk
 	uint16 flags;
-	typedef int (KyraEngine::*ButtonCallback)(Button*);	
+	typedef int (KyraEngine::*ButtonCallback)(Button*);
 	// using 6 pointers instead of 3 as in the orignal here (safer for use with classes)
 	uint8 *process0PtrShape;
 	uint8 *process1PtrShape;
@@ -698,6 +698,7 @@
 	bool _abortWalkFlag;
 	bool _abortWalkFlag2;
 	bool _mousePressFlag;
+	int8 _mouseWheel;
 	uint8 _flagsTable[53];
 	uint8 *_shapes[377];
 	uint16 _gameSpeed;
@@ -967,6 +968,8 @@
 	static Button _scrollUpButton;
 	static Button _scrollDownButton;
 
+	bool _haveScrollButtons;
+
 	static Menu _menu[];
 
 	static const uint8 _magicMouseItemStartFrame[];


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