[Scummvm-cvs-logs] scummvm master -> a7959a4ed4132c4a4f5ce7af5de1a8d075038395

bluegr bluegr at gmail.com
Sun Dec 27 21:50:52 CET 2015


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b0a029cd64 LAB: Remove superfluous mouseShow() calls in diffNextFrame()
a7959a4ed4 LAB: Remove superfluous mouse show/hide calls


Commit: b0a029cd64c8e8fc6f8e9675eb04d990ff27bd9b
    https://github.com/scummvm/scummvm/commit/b0a029cd64c8e8fc6f8e9675eb04d990ff27bd9b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-27T22:47:44+02:00

Commit Message:
LAB: Remove superfluous mouseShow() calls in diffNextFrame()

This fixes the incorrectly visible cursor in the intro

Changed paths:
    engines/lab/anim.cpp



diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index ef66944..01ca905 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -105,8 +105,6 @@ void Anim::diffNextFrame(bool onlyDiffData) {
 		byte *buf = startOfBuf + 0x10000 * curBit;
 
 		if (buf >= endOfBuf) {
-			_vm->_event->mouseShow();
-
 			if (!onlyDiffData) {
 				if (_headerdata._fps) {
 					uint32 targetMillis = _vm->_system->getMillis() + _delayMicros;
@@ -238,7 +236,6 @@ void Anim::diffNextFrame(bool onlyDiffData) {
 				}
 
 				_isPlaying = false;
-				_vm->_event->mouseShow();
 
 				if (!didTOF)
 					_vm->_graphics->screenUpdate();


Commit: a7959a4ed4132c4a4f5ce7af5de1a8d075038395
    https://github.com/scummvm/scummvm/commit/a7959a4ed4132c4a4f5ce7af5de1a8d075038395
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-27T22:50:09+02:00

Commit Message:
LAB: Remove superfluous mouse show/hide calls

Our mouse cursor is drawn in a separate layer, so we can draw on the
screen without needing to hide it beforehand

Changed paths:
    engines/lab/dispman.cpp
    engines/lab/engine.cpp
    engines/lab/eventman.cpp
    engines/lab/map.cpp



diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index 4b256f0..289e668 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -218,7 +218,6 @@ int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) {
 		return 0;
 
 	_vm->_event->attachButtonList(nullptr);
-	_vm->_event->mouseHide();
 
 	if (!_longWinInFront) {
 		_longWinInFront = true;
@@ -227,7 +226,6 @@ int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) {
 	}
 
 	createBox(198);
-	_vm->_event->mouseShow();
 
 	return flowText(_vm->_msgFont, 0, 1, 7, false, true, true, true, _vm->_utils->vgaRectScale(6, 155, 313, 195), str.c_str());
 }
@@ -252,17 +250,13 @@ void DisplayMan::drawMessage(Common::String str, bool isActionMessage) {
 			drawPanel();
 		}
 
-		_vm->_event->mouseHide();
 		createBox(168);
 		drawText(_vm->_msgFont, _vm->_utils->vgaScaleX(7), _vm->_utils->vgaScaleY(155) + _vm->_utils->svgaCord(2), 1, str);
-		_vm->_event->mouseShow();
 		_lastMessageLong = false;
 	}
 }
 
 void DisplayMan::drawPanel() {
-	_vm->_event->mouseHide();
-
 	// Clear Area
 	rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3);
 
@@ -307,8 +301,6 @@ void DisplayMan::drawPanel() {
 
 		_vm->_event->drawButtonList(&_vm->_invButtonList);
 	}
-
-	_vm->_event->mouseShow();
 }
 
 void DisplayMan::setUpScreens() {
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 8894ae7..8f39ff5 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -150,11 +150,8 @@ void LabEngine::perFlipButton(uint16 buttonId) {
 			topButton->_image = topButton->_altImage;
 			topButton->_altImage = tmpImage;
 
-			if (!_alternate) {
-				_event->mouseHide();
+			if (!_alternate)
 				topButton->_image->drawImage(topButton->_x, topButton->_y);
-				_event->mouseShow();
-			}
 
 			break;
 		}
@@ -1022,13 +1019,13 @@ void LabEngine::go() {
 		_msgFont = _resource->getFont("F:AvanteG.12");
 	else
 		_msgFont = _resource->getFont("F:Map.fon");
-	_event->mouseHide();
 
+	_event->mouseHide();
 	Intro *intro = new Intro(this);
 	intro->play();
 	delete intro;
-
 	_event->mouseShow();
+
 	mainGameLoop();
 
 	_graphics->freeFont(&_msgFont);
@@ -1133,9 +1130,7 @@ void LabEngine::mayShowCrumbIndicator() {
 		memcpy(imgData, dropCrumbsImageData, CRUMBSWIDTH * CRUMBSHEIGHT);
 		static Image dropCrumbsImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this);
 
-		_event->mouseHide();
 		dropCrumbsImage.drawMaskImage(612, 4);
-		_event->mouseShow();
 	}
 }
 
@@ -1175,9 +1170,7 @@ void LabEngine::mayShowCrumbIndicatorOff() {
 		memcpy(imgData, dropCrumbsOffImageData, CRUMBSWIDTH * CRUMBSHEIGHT);
 		static Image dropCrumbsOffImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this);
 
-		_event->mouseHide();
 		dropCrumbsOffImage.drawMaskImage(612, 4);
-		_event->mouseShow();
 	}
 }
 
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
index d1db854..333cedd 100644
--- a/engines/lab/eventman.cpp
+++ b/engines/lab/eventman.cpp
@@ -79,16 +79,12 @@ Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos)
 			if (_vm->_isHiRes) {
 				_hitButton = button;
 			} else {
-				mouseHide();
 				button->_altImage->drawImage(button->_x, button->_y);
-				mouseShow();
 
 				for (int i = 0; i < 3; i++)
 					_vm->waitTOF();
 
-				mouseHide();
 				button->_image->drawImage(button->_x, button->_y);
-				mouseShow();
 			}
 
 			return button;
@@ -119,16 +115,11 @@ void EventManager::updateMouse() {
 	if (!_hitButton)
 		return;
 
-	mouseHide();
 	_hitButton->_altImage->drawImage(_hitButton->_x, _hitButton->_y);
-	mouseShow();
-
 	for (int i = 0; i < 3; i++)
 		_vm->waitTOF();
-
-	mouseHide();
 	_hitButton->_image->drawImage(_hitButton->_x, _hitButton->_y);
-	mouseShow();
+
 	_hitButton = nullptr;
 	_vm->_graphics->screenUpdate();
 }
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index ee47c2b..2b283ae 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -328,8 +328,6 @@ uint16 LabEngine::getLowerFloor(uint16 floorNum) {
 }
 
 void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeIn) {
-	_event->mouseHide();
-
 	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	_imgMap->drawImage(0, 0);
 	_event->drawButtonList(&_mapButtonList);
@@ -380,8 +378,6 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
 
 	if (fadeIn)
 		_graphics->fade(true);
-
-	_event->mouseShow();
 }
 
 void LabEngine::processMap(uint16 curRoom) {
@@ -503,7 +499,6 @@ void LabEngine::processMap(uint16 curRoom) {
 
 						const char *sptr;
 						if ((sptr = _rooms[curMsg]._roomMsg.c_str())) {
-							_event->mouseHide();
 							_graphics->rectFillScaled(13, 148, 135, 186, 3);
 							_graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), sptr);
 
@@ -516,11 +511,8 @@ void LabEngine::processMap(uint16 curRoom) {
 							int top, bottom;
 							top = bottom = (curCoords.top + curCoords.bottom) / 2;
 
-							if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor)) {
+							if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor))
 								_graphics->rectFill(left, top, right, bottom, 1);
-							}
-
-							_event->mouseShow();
 						}
 					}
 				}
@@ -552,11 +544,9 @@ void LabEngine::doMap(uint16 curRoom) {
 	_event->attachButtonList(nullptr);
 	_graphics->fade(false);
 	_graphics->blackAllScreen();
-	_event->mouseHide();
 	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	freeMapData();
 	_graphics->blackAllScreen();
-	_event->mouseShow();
 	_graphics->screenUpdate();
 }
 






More information about the Scummvm-git-logs mailing list