[Scummvm-cvs-logs] scummvm master -> 15bbcff786d830bf665901b7bf02591fc818360c

wjp wjp at usecode.org
Tue Jan 5 23:02:19 CET 2016


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

Summary:
9cb7535e6d LAB: Ignore clicks in empty region in monitor
1eed77c376 LAB: Fix end-of-text detection in monitor
15bbcff786 LAB: Fix switching between texts in monitor


Commit: 9cb7535e6df646f3989c58bed8e327f5e765a56a
    https://github.com/scummvm/scummvm/commit/9cb7535e6df646f3989c58bed8e327f5e765a56a
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-01-05T22:05:23+01:00

Commit Message:
LAB: Ignore clicks in empty region in monitor

Regression from e71f28d0ba319bca35056b7e88d8ebfe0ea92017

Changed paths:
    engines/lab/special.cpp



diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 43d6056..6613b38 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -387,11 +387,15 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
 				int16 mouseX = msg->_mouse.x;
 				int16 mouseY = msg->_mouse.y;
 
+				// Check if mouse was in button bar
 				if ((mouseY >= _utils->vgaScaleY(171)) && (mouseY <= _utils->vgaScaleY(200))) {
-					if (mouseX <= _utils->vgaScaleX(31))
+					if (mouseX <= _utils->vgaScaleX(31)) {
+						// Exit button
 						return;
+					}
 					
 					if (mouseX <= _utils->vgaScaleX(59)) {
+						// Back button
 						if (isInteractive) {
 							_monitorPage = 0;
 
@@ -404,14 +408,15 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
 							drawMonText(ntext, monitorFont, textRect, isInteractive);
 						}
 					} else if (mouseX < _utils->vgaScaleX(259)) {
-						return;
+						// empty region; ignore
 					} else if (mouseX <= _utils->vgaScaleX(289)) {
+						// Page down button
 						if (!_lastPage) {
 							_monitorPage += 1;
 							drawMonText(ntext, monitorFont, textRect, isInteractive);
 						}
 					} else if (_monitorPage >= 1) {
-						// mouseX is greater than 290 (scaled)
+						// Page up button
 						_monitorPage -= 1;
 						drawMonText(ntext, monitorFont, textRect, isInteractive);
 					}


Commit: 1eed77c376d9131be926a6e2f587afdb5e52b456
    https://github.com/scummvm/scummvm/commit/1eed77c376d9131be926a6e2f587afdb5e52b456
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-01-05T22:59:14+01:00

Commit Message:
LAB: Fix end-of-text detection in monitor

Changed paths:
    engines/lab/special.cpp



diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 6613b38..d06d591 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -288,8 +288,6 @@ void LabEngine::doJournal() {
 
 void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) {
 	uint16 drawingToPage = 0, yspacing = 0;
-	int charsDrawn = 0;
-	const char *curText = text;
 
 	_event->mouseHide();
 
@@ -319,10 +317,10 @@ void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rec
 		_graphics->rectFill(textRect, 0);
 	}
 
+	const char *curText = text;
 	while (drawingToPage < _monitorPage) {
 		updateEvents();
-		curText = text + charsDrawn;
-		charsDrawn += _graphics->flowText(monitorFont, yspacing, 0, 0, false, false, false, false, textRect, curText);
+		curText += _graphics->flowText(monitorFont, yspacing, 0, 0, false, false, false, false, textRect, curText);
 		_lastPage = (*curText == 0);
 
 		if (_lastPage)
@@ -331,9 +329,8 @@ void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rec
 			drawingToPage++;
 	}
 
-	curText = text + charsDrawn;
+	curText += _graphics->flowText(monitorFont, yspacing, 2, 0, false, false, false, true, textRect, curText);
 	_lastPage = (*curText == 0);
-	_graphics->flowText(monitorFont, yspacing, 2, 0, false, false, false, true, textRect, curText);
 	_event->mouseShow();
 }
 


Commit: 15bbcff786d830bf665901b7bf02591fc818360c
    https://github.com/scummvm/scummvm/commit/15bbcff786d830bf665901b7bf02591fc818360c
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-01-05T23:00:06+01:00

Commit Message:
LAB: Fix switching between texts in monitor

Changed paths:
    engines/lab/lab.h
    engines/lab/special.cpp



diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 2c3a723..0e9cdd3 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -461,7 +461,7 @@ private:
 	/**
 	 * Processes user input.
 	 */
-	void processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
+	void processMonitor(const Common::String &ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
 
 	/**
 	 * Figures out what a room's coordinates should be.
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index d06d591..48e32cb 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -334,10 +334,11 @@ void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rec
 	_event->mouseShow();
 }
 
-void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
+void LabEngine::processMonitor(const Common::String &ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
 	Common::String startFileName = _monitorTextFilename;
 	const CloseData *startClosePtr = _closeDataPtr, *lastClosePtr[10];
 	uint16 depth = 0;
+	Common::String text = ntext;
 
 	lastClosePtr[0] = _closeDataPtr;
 
@@ -356,7 +357,7 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
 				_monitorPage = 0;
 				_monitorTextFilename = filename;
 
-				Common::String text = _resource->getText(_monitorTextFilename);
+				text = _resource->getText(_monitorTextFilename);
 				_graphics->fade(false);
 				drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
 				_graphics->fade(true);
@@ -402,7 +403,7 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
 							}
 						} else if (_monitorPage > 0) {
 							_monitorPage = 0;
-							drawMonText(ntext, monitorFont, textRect, isInteractive);
+							drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
 						}
 					} else if (mouseX < _utils->vgaScaleX(259)) {
 						// empty region; ignore
@@ -410,12 +411,12 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
 						// Page down button
 						if (!_lastPage) {
 							_monitorPage += 1;
-							drawMonText(ntext, monitorFont, textRect, isInteractive);
+							drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
 						}
 					} else if (_monitorPage >= 1) {
 						// Page up button
 						_monitorPage -= 1;
-						drawMonText(ntext, monitorFont, textRect, isInteractive);
+						drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
 					}
 				} else if (isInteractive) {
 					const CloseData *tmpClosePtr = _closeDataPtr;
@@ -458,7 +459,7 @@ void LabEngine::doMonitor(const Common::String background, const Common::String
 	drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
 	_event->mouseShow();
 	_graphics->fade(true);
-	processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
+	processMonitor(ntext, monitorFont, isinteractive, scaledRect);
 	_graphics->fade(false);
 	_event->mouseHide();
 	_graphics->freeFont(&monitorFont);






More information about the Scummvm-git-logs mailing list