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

bluegr bluegr at gmail.com
Thu Dec 24 11:30:26 CET 2015


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

Summary:
05973b9b41 LAB: Get rid of a superfluous variable
7216bddd56 LAB: Merge setPen() into rectFill()
4b3e671de5 LAB: Merge flowTextToMem() inside flowText()
f018b44ff8 LAB: Fix loading of journal text


Commit: 05973b9b41e28d0f1cc81608aad0093d9efc5c60
    https://github.com/scummvm/scummvm/commit/05973b9b41e28d0f1cc81608aad0093d9efc5c60
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T11:59:03+02:00

Commit Message:
LAB: Get rid of a superfluous variable

Changed paths:
    engines/lab/intro.cpp



diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index e5a41d6..95f9c02 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -95,17 +95,15 @@ void Intro::doPictText(const Common::String filename, bool isScreen) {
 			else if (isScreen)
 				_vm->_graphics->fade(false);
 
-			int charDrawn = 0;
 			if (isScreen) {
 				_vm->_graphics->setPen(7);
 				_vm->_graphics->rectFillScaled(10, 10, 310, 190);
 
-				charDrawn = _vm->_graphics->flowText(_font, _vm->_isHiRes ? 0 : -1, 5, 7, false, false, true, true, _vm->_utils->vgaRectScale(14, 11, 306, 189), (char *)curText);
+				curText += _vm->_graphics->flowText(_font, _vm->_isHiRes ? 0 : -1, 5, 7, false, false, true, true, _vm->_utils->vgaRectScale(14, 11, 306, 189), (char *)curText);
 				_vm->_graphics->fade(true);
 			} else
-				charDrawn = _vm->_graphics->longDrawMessage(Common::String((char *)curText), false);
+				curText += _vm->_graphics->longDrawMessage(Common::String((char *)curText), false);
 
-			curText += charDrawn;
 			doneFl = (*curText == 0);
 
 			drawNextText = false;


Commit: 7216bddd56d48a4e0ec1f92d9a261943eb8ea072
    https://github.com/scummvm/scummvm/commit/7216bddd56d48a4e0ec1f92d9a261943eb8ea072
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T12:08:51+02:00

Commit Message:
LAB: Merge setPen() into rectFill()

Changed paths:
    engines/lab/dispman.cpp
    engines/lab/dispman.h
    engines/lab/intro.cpp
    engines/lab/map.cpp
    engines/lab/special.cpp
    engines/lab/tilepuzzle.cpp



diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index 0457da8..ead60f7 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -48,7 +48,6 @@ DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) {
 	_actionMessageShown = false;
 
 	_screenBytesPerPage = 0;
-	_curPen = 0;
 	_curBitmap = nullptr;
 	_displayBuffer = nullptr;
 	_currentDisplayBuffer = nullptr;
@@ -148,16 +147,12 @@ Common::String DisplayMan::getLine(TextFont *tf, const char **mainBuffer, uint16
 
 int DisplayMan::flowText(TextFont *font, int16 spacing, byte penColor, byte backPen,
 			bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect, const char *str) {
-	if (fillBack) {
-		setPen(backPen);
-		rectFill(textRect);
-	}
+	if (fillBack)
+		rectFill(textRect, backPen);
 
 	if (!str)
 		return 0;
 
-	setPen(penColor);
-
 	TextFont *msgFont = font;
 	uint16 fontHeight = textHeight(msgFont) + spacing;
 	uint16 numLines   = (textRect.height() + 1) / fontHeight;
@@ -219,15 +214,13 @@ int DisplayMan::flowTextToMem(Image *destIm, TextFont *font, int16 spacing, byte
 
 void DisplayMan::createBox(uint16 y2) {
 	// Message box area
-	setPen(7);
-	rectFillScaled(4, 154, 315, y2 - 2);
+	rectFillScaled(4, 154, 315, y2 - 2, 7);
 
 	// Box around message area
-	setPen(0);
-	drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleX(317));
-	drawVLine(_vm->_utils->vgaScaleX(317), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2));
-	drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(y2), _vm->_utils->vgaScaleX(317));
-	drawVLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2));
+	drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleX(317), 0);
+	drawVLine(_vm->_utils->vgaScaleX(317), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2), 0);
+	drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(y2), _vm->_utils->vgaScaleX(317), 0);
+	drawVLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2), 0);
 }
 
 int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) {
@@ -247,8 +240,7 @@ int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) {
 	if (!_longWinInFront) {
 		_longWinInFront = true;
 		// Clear Area
-		setPen(3);
-		rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199));
+		rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3);
 	}
 
 	createBox(198);
@@ -289,52 +281,45 @@ void DisplayMan::drawPanel() {
 	_vm->_event->mouseHide();
 
 	// Clear Area
-	setPen(3);
-	rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199));
+	rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3);
 
 	// First Line
-	setPen(0);
-	drawHLine(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
+	drawHLine(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), 0);
 	// Second Line
-	setPen(5);
-	drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
+	drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), 5);
 	// Button Separators
-	setPen(0);
-	// First black line to separate buttons
-	drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319));
+	drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319), 0);
 
 	if (!_vm->_alternate) {
-		setPen(4);
 		// The horizontal lines under the black one
-		drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319));
+		drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319), 4);
 		_vm->_event->drawButtonList(&_vm->_moveButtonList);
 	} else {
 		if (_vm->getPlatform() != Common::kPlatformWindows) {
 			// Vertical Black lines
-			drawVLine(_vm->_utils->vgaScaleX(124), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
-			drawVLine(_vm->_utils->vgaScaleX(194), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
+			drawVLine(_vm->_utils->vgaScaleX(124), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+			drawVLine(_vm->_utils->vgaScaleX(194), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
 		} else {
 			// Vertical Black lines
-			drawVLine(_vm->_utils->vgaScaleX(90), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
-			drawVLine(_vm->_utils->vgaScaleX(160), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
-			drawVLine(_vm->_utils->vgaScaleX(230), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
+			drawVLine(_vm->_utils->vgaScaleX(90), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+			drawVLine(_vm->_utils->vgaScaleX(160), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+			drawVLine(_vm->_utils->vgaScaleX(230), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
 		}
 
-		setPen(4);
 		// The horizontal lines under the black one
-		drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(122));
-		drawHLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(192));
-		drawHLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319));
+		drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(122), 4);
+		drawHLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(192), 4);
+		drawHLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319), 4);
 		// The vertical high light lines
-		drawVLine(_vm->_utils->vgaScaleX(1), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
+		drawVLine(_vm->_utils->vgaScaleX(1), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
 
 		if (_vm->getPlatform() != Common::kPlatformWindows) {
-			drawVLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
-			drawVLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
+			drawVLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+			drawVLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
 		} else {
-			drawVLine(_vm->_utils->vgaScaleX(92), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
-			drawVLine(_vm->_utils->vgaScaleX(162), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
-			drawVLine(_vm->_utils->vgaScaleX(232), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
+			drawVLine(_vm->_utils->vgaScaleX(92), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+			drawVLine(_vm->_utils->vgaScaleX(162), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+			drawVLine(_vm->_utils->vgaScaleX(232), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
 		}
 
 		_vm->_event->drawButtonList(&_vm->_invButtonList);
@@ -400,11 +385,7 @@ void DisplayMan::setUpScreens() {
 	delete invFile;
 }
 
-void DisplayMan::setPen(byte penNum) {
-	_curPen = penNum;
-}
-
-void DisplayMan::rectFill(Common::Rect fillRect) {
+void DisplayMan::rectFill(Common::Rect fillRect, byte color) {
 	int width = fillRect.width() + 1;
 	int height = fillRect.height() + 1;
 
@@ -422,7 +403,7 @@ void DisplayMan::rectFill(Common::Rect fillRect) {
 			int ww = width;
 
 			while (ww-- > 0) {
-				*dd++ = _curPen;
+				*dd++ = color;
 			}
 
 			d += _screenWidth;
@@ -430,20 +411,20 @@ void DisplayMan::rectFill(Common::Rect fillRect) {
 	}
 }
 
-void DisplayMan::rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
-	rectFill(Common::Rect(x1, y1, x2, y2));
+void DisplayMan::rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color) {
+	rectFill(Common::Rect(x1, y1, x2, y2), color);
 }
 
-void DisplayMan::rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
-	rectFill(_vm->_utils->vgaRectScale(x1, y1, x2, y2));
+void DisplayMan::rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color) {
+	rectFill(_vm->_utils->vgaRectScale(x1, y1, x2, y2), color);
 }
 
-void DisplayMan::drawVLine(uint16 x, uint16 y1, uint16 y2) {
-	rectFill(x, y1, x, y2);
+void DisplayMan::drawVLine(uint16 x, uint16 y1, uint16 y2, byte color) {
+	rectFill(x, y1, x, y2, color);
 }
 
-void DisplayMan::drawHLine(uint16 x1, uint16 y, uint16 x2) {
-	rectFill(x1, y, x2, y);
+void DisplayMan::drawHLine(uint16 x1, uint16 y, uint16 x2, byte color) {
+	rectFill(x1, y, x2, y, color);
 }
 
 void DisplayMan::screenUpdate() {
@@ -797,13 +778,11 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi
 				if (j == 0)
 					checkerboardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
 				else
-					rectFill(0, curY, _screenWidth - 1, curY + 1);
+					rectFill(0, curY, _screenWidth - 1, curY + 1, 0);
 				curY += 4;
 				linesDone++;
 			}	// while
 		}	// for i
-
-		setPen(0);
 	}	// for j
 
 	if (filename.empty())
@@ -926,8 +905,7 @@ void DisplayMan::scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint1
 		im.readScreenImage(x1, y1);
 		im.drawImage(x1 + dx, y1);
 
-		setPen(0);
-		rectFill(x1, y1, x1 + dx - 1, y2);
+		rectFill(x1, y1, x1 + dx - 1, y2, 0);
 	} else if (dx < 0) {
 		im._width = x2 - x1 + 1 + dx;
 		im._height = y2 - y1 + 1;
@@ -935,8 +913,7 @@ void DisplayMan::scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint1
 		im.readScreenImage(x1 - dx, y1);
 		im.drawImage(x1, y1);
 
-		setPen(0);
-		rectFill(x2 + dx + 1, y1, x2, y2);
+		rectFill(x2 + dx + 1, y1, x2, y2, 0);
 	}
 
 	// Prevent the Image destructor from deleting the external buffer
@@ -960,8 +937,7 @@ void DisplayMan::scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint1
 		im.readScreenImage(x1, y1);
 		im.drawImage(x1, y1 + dy);
 
-		setPen(0);
-		rectFill(x1, y1, x2, y1 + dy - 1);
+		rectFill(x1, y1, x2, y1 + dy - 1, 0);
 	} else if (dy < 0) {
 		im._width = x2 - x1 + 1;
 		im._height = y2 - y1 + 1 + dy;
@@ -969,8 +945,7 @@ void DisplayMan::scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint1
 		im.readScreenImage(x1, y1 - dy);
 		im.drawImage(x1, y1);
 
-		setPen(0);
-		rectFill(x1, y2 + dy + 1, x2, y2);
+		rectFill(x1, y2 + dy + 1, x2, y2, 0);
 	}
 
 	// Prevent the Image destructor from deleting the external buffer
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
index 8e9cfdf..cbad419 100644
--- a/engines/lab/dispman.h
+++ b/engines/lab/dispman.h
@@ -157,9 +157,9 @@ public:
 	/**
 	 * Fills in a rectangle.
 	 */
-	void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
-	void rectFill(Common::Rect fillRect);
-	void rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+	void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color);
+	void rectFill(Common::Rect fillRect, byte color);
+	void rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color);
 	/**
 	 * Dumps a chunk of text to an arbitrary box; flows it within that box and
 	 * optionally centers it. Returns the number of characters that were processed.
@@ -199,12 +199,12 @@ public:
 	/**
 	 * Draws a vertical line.
 	 */
-	void drawHLine(uint16 x, uint16 y1, uint16 y2);
+	void drawHLine(uint16 x, uint16 y1, uint16 y2, byte color);
 
 	/**
 	 * Draws a horizontal line.
 	 */
-	void drawVLine(uint16 x1, uint16 y, uint16 x2);
+	void drawVLine(uint16 x1, uint16 y, uint16 x2, byte color);
 	void screenUpdate();
 
 	/**
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index 95f9c02..5ed604c 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -96,8 +96,7 @@ void Intro::doPictText(const Common::String filename, bool isScreen) {
 				_vm->_graphics->fade(false);
 
 			if (isScreen) {
-				_vm->_graphics->setPen(7);
-				_vm->_graphics->rectFillScaled(10, 10, 310, 190);
+				_vm->_graphics->rectFillScaled(10, 10, 310, 190, 7);
 
 				curText += _vm->_graphics->flowText(_font, _vm->_isHiRes ? 0 : -1, 5, 7, false, false, true, true, _vm->_utils->vgaRectScale(14, 11, 306, 189), (char *)curText);
 				_vm->_graphics->fade(true);
@@ -431,8 +430,7 @@ void Intro::play() {
 	nReadPict("SubX");
 
 	if (_quitIntro) {
-		_vm->_graphics->setPen(0);
-		_vm->_graphics->rectFill(0, 0, _vm->_graphics->_screenWidth - 1, _vm->_graphics->_screenHeight - 1);
+		_vm->_graphics->rectFill(0, 0, _vm->_graphics->_screenWidth - 1, _vm->_graphics->_screenHeight - 1, 0);
 		_vm->_anim->_doBlack = true;
 	}
 }
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 12df8ca..fa657c0 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -335,8 +335,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
 	if (fadeOut)
 		_graphics->fade(false);
 
-	_graphics->setPen(0);
-	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1);
+	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 
 	_imgMap->drawImage(0, 0);
 	_event->drawButtonList(&_mapButtonList);
@@ -515,8 +514,7 @@ void LabEngine::processMap(uint16 curRoom) {
 						const char *sptr;
 						if ((sptr = _rooms[curMsg]._roomMsg.c_str())) {
 							_event->mouseHide();
-							_graphics->setPen(3);
-							_graphics->rectFillScaled(13, 148, 135, 186);
+							_graphics->rectFillScaled(13, 148, 135, 186, 3);
 							_graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), sptr);
 
 							if (_maps[oldMsg]._pageNumber == curFloor)
@@ -529,8 +527,7 @@ void LabEngine::processMap(uint16 curRoom) {
 							top = bottom = (curCoords.top + curCoords.bottom) / 2;
 
 							if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor)) {
-								_graphics->setPen(1);
-								_graphics->rectFill(left, top, right, bottom);
+								_graphics->rectFill(left, top, right, bottom, 1);
 							}
 
 							_event->mouseShow();
@@ -566,8 +563,7 @@ void LabEngine::doMap(uint16 curRoom) {
 	_graphics->fade(false);
 	_graphics->blackAllScreen();
 	_event->mouseHide();
-	_graphics->setPen(0);
-	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1);
+	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	freeMapData();
 	_graphics->blackAllScreen();
 	_event->mouseShow();
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 7166286..301ed59 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -288,8 +288,7 @@ void LabEngine::doJournal() {
 
 	_screenImage->_imageData = _graphics->getCurrentDrawingBuffer();
 
-	_graphics->setPen(0);
-	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1);
+	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	_graphics->blackScreen();
 }
 
@@ -316,17 +315,14 @@ void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rec
 		else
 			_monitorButtonHeight = fheight;
 
-		_graphics->setPen(0);
-		_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom);
+		_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom, 0);
 
 		for (int i = 0; i < numlines; i++)
 			_monitorButton->drawImage(0, i * _monitorButtonHeight);
 	} else if (isinteractive) {
-		_graphics->setPen(0);
-		_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom);
+		_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom, 0);
 	} else {
-		_graphics->setPen(0);
-		_graphics->rectFill(textRect);
+		_graphics->rectFill(textRect, 0);
 	}
 
 	while (drawingToPage < _monitorPage) {
@@ -469,8 +465,7 @@ void LabEngine::doMonitor(const Common::String background, const Common::String
 	_event->mouseHide();
 	_graphics->closeFont(&monitorFont);
 
-	_graphics->setPen(0);
-	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1);
+	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	_graphics->blackAllScreen();
 	_graphics->freePict();
 }
diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp
index bea2b61..8f21cee 100644
--- a/engines/lab/tilepuzzle.cpp
+++ b/engines/lab/tilepuzzle.cpp
@@ -208,8 +208,7 @@ void TilePuzzle::doTile(bool showsolution) {
 		rows = _vm->_utils->vgaScaleY(31);
 		cols = _vm->_utils->vgaScaleX(105);
 	} else {
-		_vm->_graphics->setPen(0);
-		_vm->_graphics->rectFillScaled(97, 22, 220, 126);
+		_vm->_graphics->rectFillScaled(97, 22, 220, 126, 0);
 
 		rowm = _vm->_utils->vgaScaleY(25);
 		colm = _vm->_utils->vgaScaleX(30);


Commit: 4b3e671de564b447eae23bfcdb3ce365ba5dd9a0
    https://github.com/scummvm/scummvm/commit/4b3e671de564b447eae23bfcdb3ce365ba5dd9a0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T12:27:56+02:00

Commit Message:
LAB: Merge flowTextToMem() inside flowText()

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



diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index ead60f7..b6ffbf8 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -146,7 +146,16 @@ Common::String DisplayMan::getLine(TextFont *tf, const char **mainBuffer, uint16
 }
 
 int DisplayMan::flowText(TextFont *font, int16 spacing, byte penColor, byte backPen,
-			bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect, const char *str) {
+			bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect, const char *str, Image *targetImage) {
+
+	byte *saveDisplayBuffer = _currentDisplayBuffer;
+	uint32 bytesPerPage = _screenBytesPerPage;
+
+	if (targetImage) {
+		_currentDisplayBuffer = targetImage->_imageData;
+		_screenBytesPerPage = (uint32)targetImage->_width * (int32)targetImage->_height;
+	}
+
 	if (fillBack)
 		rectFill(textRect, backPen);
 
@@ -192,24 +201,10 @@ int DisplayMan::flowText(TextFont *font, int16 spacing, byte penColor, byte back
 
 	len--;
 
-	return len;
-}
-
-int DisplayMan::flowTextToMem(Image *destIm, TextFont *font, int16 spacing, byte penColor,
-			byte backPen, bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect,
-			const char *str) {
-	byte *saveDisplayBuffer = _currentDisplayBuffer;
-	uint32 bytesPerPage = _screenBytesPerPage;
-
-	_currentDisplayBuffer = destIm->_imageData;
-	_screenBytesPerPage = (uint32)destIm->_width * (int32)destIm->_height;
-
-	int res = flowText(font, spacing, penColor, backPen, fillBack, centerh, centerv, output, textRect, str);
-
 	_screenBytesPerPage = bytesPerPage;
 	_currentDisplayBuffer = saveDisplayBuffer;
 
-	return res;
+	return len;
 }
 
 void DisplayMan::createBox(uint16 y2) {
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
index cbad419..3b41505 100644
--- a/engines/lab/dispman.h
+++ b/engines/lab/dispman.h
@@ -177,24 +177,7 @@ public:
 	 * @param text The text itself
 	 */
 	int flowText(TextFont *font, int16 spacing, byte penColor, byte backPen, bool fillBack,
-				bool centerh, bool centerv, bool output, Common::Rect textRect, const char *text);
-
-	/**
-	 * Calls flowText, but flows it to memory.  Same restrictions as flowText.
-	 * @param destIm Destination buffer
-	 * @param font Pointer on the font used
-	 * @param penColor Pen number to use for text
-	 * @param backPen Background color
-	 * @param fillBack Whether to fill the background
-	 * @param centerh Whether to center the text horizontally
-	 * @param centerv Whether to center the text vertically
-	 * @param output Whether to output any text
-	 * @param textRect Coords
-	 * @param text The text itself
-	 */
-	int flowTextToMem(Image *destIm, TextFont *font, int16 spacing, byte penColor, byte backPen,
-				bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect,
-				const char *text);
+				bool centerh, bool centerv, bool output, Common::Rect textRect, const char *text, Image *targetImage = nullptr);
 
 	/**
 	 * Draws a vertical line.
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 301ed59..be371c6 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -168,16 +168,16 @@ void LabEngine::drawJournalText() {
 
 	if (_journalPage <= 1) {
 		curText = _journalTextTitle.c_str();
-		_graphics->flowTextToMem(_journalBackImage, _journalFont, -2, 2, 0, false, true, true, true, _utils->vgaRectScale(52, 32, 152, 148), curText);
+		_graphics->flowText(_journalFont, -2, 2, 0, false, true, true, true, _utils->vgaRectScale(52, 32, 152, 148), curText, _journalBackImage);
 	} else {
 		curText = _journalText.c_str() + charsDrawn;
-		charsDrawn += _graphics->flowTextToMem(_journalBackImage, _journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(52, 32, 152, 148), curText);
+		charsDrawn += _graphics->flowText(_journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(52, 32, 152, 148), curText, _journalBackImage);
 	}
 
 	updateMusicAndEvents();
 	curText = _journalText.c_str() + charsDrawn;
 	_lastPage = (*curText == 0);
-	_graphics->flowTextToMem(_journalBackImage, _journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(171, 32, 271, 148), curText);
+	_graphics->flowText(_journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(171, 32, 271, 148), curText, _journalBackImage);
 }
 
 void LabEngine::turnPage(bool fromLeft) {


Commit: f018b44ff869cc774923818caccf203ff9c56e0b
    https://github.com/scummvm/scummvm/commit/f018b44ff869cc774923818caccf203ff9c56e0b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T12:29:23+02:00

Commit Message:
LAB: Fix loading of journal text

Changed paths:
    engines/lab/special.cpp



diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index be371c6..8c69fb4 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -101,7 +101,7 @@ void LabEngine::loadJournalData() {
 	_journalFont = _resource->getFont("F:Journal.fon");
 	updateMusicAndEvents();
 
-	Common::String filename = "Lab:Rooms/j0";
+	Common::String filename = "Lab:Rooms/j";
 
 	bool bridge = _conditions->in(BRIDGE0) || _conditions->in(BRIDGE1);
 	bool dirty  = _conditions->in(DIRTY);
@@ -126,6 +126,8 @@ void LabEngine::loadJournalData() {
 		filename += '3';
 	else if (bridge)
 		filename += '1';
+	else
+		filename += '0';
 
 	_journalText = _resource->getText(filename);
 	_journalTextTitle = _resource->getText("Lab:Rooms/jt");






More information about the Scummvm-git-logs mailing list