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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun May 24 16:33:41 CEST 2009


Revision: 40863
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40863&view=rev
Author:   athrxx
Date:     2009-05-24 14:33:41 +0000 (Sun, 24 May 2009)

Log Message:
-----------
LOL: fixed some input code issues:
- party would move 2 steps instead of one when using keyboad while magic menu was open 
- viewing notes would abort at once instead of waiting for the next click

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_lol.cpp
    scummvm/trunk/engines/kyra/kyra_v1.cpp
    scummvm/trunk/engines/kyra/kyra_v1.h
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/lol.h

Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp	2009-05-24 13:59:47 UTC (rev 40862)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp	2009-05-24 14:33:41 UTC (rev 40863)
@@ -704,18 +704,19 @@
 void LoLEngine::gui_updateInput() {
 	// TODO: We need to catch all cases where loading is not possible and
 	// set the "mainLoop" parameter to false for them.
-	int inputFlag = checkInput(_activeButtons, !(_updateFlags & 3));
+	int inputFlag = checkInput(_activeButtons, !(_updateFlags & 3), 0);
 	if (_preserveEvents)
-		_preserveEvents = false;
+		_preserveEvents = false;		
 	else
 		removeInputTop();
 
-	if (inputFlag && _unkCharNum != -1 && !(inputFlag & 0x8800)) {
+	if (inputFlag && _activeMagicMenu != -1 && !(inputFlag & 0x8800)) {
 		gui_enableDefaultPlayfieldButtons();
-		_characters[_unkCharNum].flags &= 0xffef;
-		gui_drawCharPortraitWithStats(_unkCharNum);
+		_characters[_activeMagicMenu].flags &= 0xffef;
+		gui_drawCharPortraitWithStats(_activeMagicMenu);
 		gui_triggerEvent(inputFlag);
-		_unkCharNum = -1;
+		_preserveEvents = false;
+		_activeMagicMenu = -1;
 		inputFlag = 0;
 	}
 
@@ -955,6 +956,14 @@
 	b->buttonCallback = _buttonCallbacks[index];
 }
 
+void LoLEngine::gui_notifyButtonListChanged() {
+	if (_gui) {
+		if (!_gui->_buttonListChanged && !_preserveEvents)
+			removeInputTop();
+		_gui->_buttonListChanged = true;
+	}
+}
+
 int LoLEngine::clickedUpArrow(Button *button) {
 	if (button->arg && !_floatingCursorsEnabled)
 		return 0;
@@ -1093,7 +1102,7 @@
 
 	gui_drawCharPortraitWithStats(c);
 	gui_initMagicSubmenu(c);
-	_unkCharNum = c;
+	_activeMagicMenu = c;
 
 	return 1;
 }
@@ -1120,14 +1129,14 @@
 		}
 	}
 
-	_unkCharNum = -1;
+	_activeMagicMenu = -1;
 	return 1;
 }
 
 int LoLEngine::clickedScreen(Button *button) {
-	_characters[_unkCharNum].flags &= 0xffef;
-	gui_drawCharPortraitWithStats(_unkCharNum);
-	_unkCharNum = -1;
+	_characters[_activeMagicMenu].flags &= 0xffef;
+	gui_drawCharPortraitWithStats(_activeMagicMenu);
+	_activeMagicMenu = -1;
 
 	if (!(button->flags2 & 0x80)) {
 		if (button->flags2 & 0x100)

Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp	2009-05-24 13:59:47 UTC (rev 40862)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp	2009-05-24 14:33:41 UTC (rev 40863)
@@ -224,7 +224,7 @@
 	_system->warpMouse(x, y);
 }
 
-int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop) {
+int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) {
 	_isSaveAllowed = mainLoop;
 	updateInput();
 	_isSaveAllowed = false;
@@ -365,7 +365,7 @@
 	GUI *guiInstance = gui();
 	if (guiInstance) {
 		if (keys)
-			return guiInstance->processButtonList(buttonList, keys | 0x8000, mouseWheel);
+			return guiInstance->processButtonList(buttonList, keys | eventFlag, mouseWheel);
 		else
 			return guiInstance->processButtonList(buttonList, 0, mouseWheel);
 	} else {

Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h	2009-05-24 13:59:47 UTC (rev 40862)
+++ scummvm/trunk/engines/kyra/kyra_v1.h	2009-05-24 14:33:41 UTC (rev 40863)
@@ -203,7 +203,7 @@
 
 	// input
 	void updateInput();
-	int checkInput(Button *buttonList, bool mainLoop = false);
+	int checkInput(Button *buttonList, bool mainLoop = false, int eventFlag = 0x8000);
 	void removeInputTop();
 
 	int _mouseX, _mouseY;

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-05-24 13:59:47 UTC (rev 40862)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-05-24 14:33:41 UTC (rev 40863)
@@ -519,7 +519,7 @@
 	memset(&_scriptData, 0, sizeof(EMCData));
 
 	_hasTempDataFlags = 0;
-	_unkCharNum = -1;
+	_activeMagicMenu = -1;
 
 	_automapShapes = new const uint8*[109];
 	_mapOverlay = new uint8[256];

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-05-24 13:59:47 UTC (rev 40862)
+++ scummvm/trunk/engines/kyra/lol.h	2009-05-24 14:33:41 UTC (rev 40863)
@@ -515,7 +515,7 @@
 	void gui_initMagicScrollButtons();
 	void gui_initMagicSubmenu(int charNum);
 	void gui_initButton(int index, int x = -1, int y = -1, int val = -1);
-	void gui_notifyButtonListChanged() { if (_gui) _gui->_buttonListChanged = true; }
+	void gui_notifyButtonListChanged();
 
 	Common::Array<Button::Callback> _buttonCallbacks;
 	Button *_activeButtons;
@@ -870,7 +870,7 @@
 
 	int _loadLevelFlag;
 	int _hasTempDataFlags;
-	int _unkCharNum;
+	int _activeMagicMenu;
 	uint16 _scriptCharacterCycle;
 	int _charStatsTemp[5];
 


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