diff options
| author | Florian Kagerer | 2009-05-28 23:49:41 +0000 | 
|---|---|---|
| committer | Florian Kagerer | 2009-05-28 23:49:41 +0000 | 
| commit | 69d054660a8d2b19a449146d4982294150a073c9 (patch) | |
| tree | fcd79cda753a3e4503166904bf67dd2e66f2ed7a | |
| parent | d3bd7b622cf84a9d7f5cda9df9b68174953fe1ac (diff) | |
| download | scummvm-rg350-69d054660a8d2b19a449146d4982294150a073c9.tar.gz scummvm-rg350-69d054660a8d2b19a449146d4982294150a073c9.tar.bz2 scummvm-rg350-69d054660a8d2b19a449146d4982294150a073c9.zip  | |
LOL: - fix valgrind warning
- fix more input code issues
- add workround for another script bug (some invalid monster sound index in urbish mine level 2)
svn-id: r40974
| -rw-r--r-- | engines/kyra/gui_lol.cpp | 25 | ||||
| -rw-r--r-- | engines/kyra/gui_lol.h | 1 | ||||
| -rw-r--r-- | engines/kyra/lol.cpp | 3 | ||||
| -rw-r--r-- | engines/kyra/lol.h | 3 | ||||
| -rw-r--r-- | engines/kyra/scene_lol.cpp | 2 | ||||
| -rw-r--r-- | engines/kyra/script_lol.cpp | 4 | ||||
| -rw-r--r-- | engines/kyra/sprites_lol.cpp | 2 | 
7 files changed, 32 insertions, 8 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 912c3b2c37..940086e00f 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -746,7 +746,7 @@ void LoLEngine::gui_updateInput() {  void LoLEngine::gui_triggerEvent(int eventType) {  	Common::Event evt; -	memset(&evt, 0, sizeof(Common::Event)); +	memset(&evt, 0, sizeof(Common::Event));	  	evt.mouse.x = _mouseX;  	evt.mouse.y = _mouseY; @@ -813,6 +813,19 @@ void LoLEngine::gui_triggerEvent(int eventType) {  	_preserveEvents = true;  } +void LoLEngine::removeInputTop() { +	if (!_eventList.empty()) {		 +		if (_eventList.begin()->event.type == Common::EVENT_LBUTTONDOWN) +			_gui->_mouseClick = 1; +		else if (_eventList.begin()->event.type == Common::EVENT_RBUTTONDOWN) +			_gui->_mouseClick = 2; +		else +			_gui->_mouseClick = 0; + +		_eventList.erase(_eventList.begin()); +	} +} +  void LoLEngine::gui_enableDefaultPlayfieldButtons() {  	gui_resetButtonList();  	gui_initButtonsFromList(_buttonList1); @@ -1814,6 +1827,7 @@ GUI_LoL::GUI_LoL(LoLEngine *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) {  	_scrollDownFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::scrollDown);  	_specialProcessButton = _backUpButtonList = 0;  	_flagsModifier = 0; +	_mouseClick = 0;  	_buttonListChanged = false;  } @@ -1910,7 +1924,14 @@ int GUI_LoL::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseW  	if (_backUpButtonList != buttonList || _buttonListChanged) {  		_specialProcessButton = 0; -		//flagsModifier |= 0x2200; + +		_flagsModifier = 0; +		if (_mouseClick == 1) +			_flagsModifier |= 0x200; +		if (_mouseClick == 2) +			_flagsModifier |= 0x2000; +		_mouseClick = 0; +		  		_backUpButtonList = buttonList;  		_buttonListChanged = false; diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 5cb7686dea..631e29bd3b 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -57,6 +57,7 @@ private:  	Button *_backUpButtonList;  	bool _buttonListChanged;  	uint16 _flagsModifier; +	uint8 _mouseClick;  	int scrollUp(Button *button) { return 0; }  	int scrollDown(Button *button) { return 0; } diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 46a3bcdb82..4dcca4771f 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -128,6 +128,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy  	_currentDirection = 0;  	_currentBlock = 0;  	_compassDirection = _compassDirectionIndex = -1; +	_compassStep = 0;  	memset(_visibleBlockIndex, 0, sizeof(_visibleBlockIndex));  	_smoothScrollModeNormal = 1; @@ -148,7 +149,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy  	_levelShapeProperties = 0;  	_levelShapes = 0;  	_specialGuiShape = 0; -	_specialGuiShapeX = _specialGuiShapeY = _specialGuiShapeShadowFlag = 0; +	_specialGuiShapeX = _specialGuiShapeY = _specialGuiShapeMirrorFlag = 0;  	_blockDrawingBuffer = 0;  	_sceneWindowBuffer = 0;  	memset(_doorShapes, 0, sizeof(_doorShapes)); diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 537081af99..b0a41eded7 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -503,6 +503,7 @@ private:  	void gui_updateInput();  	void gui_triggerEvent(int eventType); +	void removeInputTop();  	void gui_enableDefaultPlayfieldButtons();  	void gui_enableSequenceButtons(int x, int y, int w, int h, int enableFlags);  	void gui_specialSceneRestoreButtons(); @@ -1015,7 +1016,7 @@ private:  	uint8 *_specialGuiShape;  	uint16 _specialGuiShapeX;  	uint16 _specialGuiShapeY; -	uint16 _specialGuiShapeShadowFlag; +	uint16 _specialGuiShapeMirrorFlag;  	char _lastSuppFile[12];  	char _lastOverridePalFile[12]; diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index e2931c5098..41649f34a7 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -2047,7 +2047,7 @@ void LoLEngine::drawSpecialGuiShape(int pageNum) {  	_screen->drawShape(pageNum, _specialGuiShape, _specialGuiShapeX, _specialGuiShapeY, 2, 0); -	if (_specialGuiShapeShadowFlag & 1) +	if (_specialGuiShapeMirrorFlag & 1)  		_screen->drawShape(pageNum, _specialGuiShape, _specialGuiShapeX + _specialGuiShape[3], _specialGuiShapeY, 2, 1);  } diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 49d481bd29..f8de48e90a 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -1873,11 +1873,11 @@ int LoLEngine::olol_assignSpecialGuiShape(EMCState *script) {  		_specialGuiShape = _levelShapes[_levelShapeProperties[_wllShapeMap[stackPos(0)]].shapeIndex[stackPos(1)]];  		_specialGuiShapeX = stackPos(2);  		_specialGuiShapeY = stackPos(3); -		_specialGuiShapeShadowFlag = stackPos(4); +		_specialGuiShapeMirrorFlag = stackPos(4);  	} else {  		_specialGuiShape = 0; -		_specialGuiShapeX = _specialGuiShapeY = _specialGuiShapeShadowFlag = 0; +		_specialGuiShapeX = _specialGuiShapeY = _specialGuiShapeMirrorFlag = 0;  	}  	return 1;  } diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 35350103fc..8d6afe3c9b 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -265,7 +265,7 @@ void LoLEngine::placeMonster(MonsterInPlay *monster, uint16 x, uint16 y) {  	_levelBlockProperties[monster->block].direction = 5;  	checkSceneUpdateNeed(monster->block); -	if (monster->properties->sounds[0] == 0 || cont == false) +	if (monster->properties->sounds[0] == 0 || monster->properties->sounds[0] == 255 || cont == false)  		return;  	if ((!(monster->properties->flags & 0x100) || ((monster->currentSubFrame & 1) == 0)) && monster->block == t)  | 
