[Scummvm-cvs-logs] scummvm master -> 0a0ac687227672a191c6cfce12582b982a2f5337

dreammaster dreammaster at scummvm.org
Tue May 3 14:42:15 CEST 2011


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:
9f30ffa76f TSAGE: Bugfixes to allow for drawing message strings that are empty
0a0ac68722 TSAGE: Bugfixes for displaying the credits


Commit: 9f30ffa76f927b1a58dfb48078506a9a67171326
    https://github.com/scummvm/scummvm/commit/9f30ffa76f927b1a58dfb48078506a9a67171326
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-05-03T05:40:48-07:00

Commit Message:
TSAGE: Bugfixes to allow for drawing message strings that are empty

Changed paths:
    engines/tsage/graphics.cpp
    engines/tsage/resources.cpp
    engines/tsage/resources.h



diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 9d840bf..af38f21 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -484,6 +484,8 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int trans
  */
 void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion) {
 	GfxSurface srcImage;
+	if (srcBounds.isEmpty())
+		return;
 
 	if (srcBounds == src.getBounds())
 		srcImage = src;
diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp
index a73c23a..2b678a8 100644
--- a/engines/tsage/resources.cpp
+++ b/engines/tsage/resources.cpp
@@ -404,11 +404,11 @@ byte *TLib::getSubResource(int resNum, int rlbNum, int index, uint *size, bool s
 /**
  * Retrieves a given message resource, and returns the specified message number
  */
-Common::String TLib::getMessage(int resNum, int lineNum, bool suppressErrors) {
-	byte *msgData = getResource(RES_MESSAGE, resNum, 0);
+bool TLib::getMessage(int resNum, int lineNum, Common::String &result, bool suppressErrors) {
+	byte *msgData = getResource(RES_MESSAGE, resNum, 0, true);
 	if (!msgData) {
 		if (suppressErrors)
-			return Common::String();
+			return false;
 
 		error("Unknown message %d line %d", resNum, lineNum);
 	}
@@ -417,9 +417,9 @@ Common::String TLib::getMessage(int resNum, int lineNum, bool suppressErrors) {
 	while (lineNum-- > 0)
 		srcP += strlen(srcP) + 1;
 
-	Common::String result(srcP);
+	result = Common::String(srcP);
 	_memoryManager.deallocate(msgData);
-	return result;
+	return true;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -489,8 +489,7 @@ Common::String ResourceManager::getMessage(int resNum, int lineNum, bool suppres
 	Common::String result;
 
 	for (uint idx = 0; idx < _libList.size(); ++idx) {
-		result = _libList[idx]->getMessage(resNum, lineNum, true);
-		if (!result.empty())
+		if (_libList[idx]->getMessage(resNum, lineNum, result, true))
 			return result;
 	}
 
diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h
index 4ae41f6..7b518ca 100644
--- a/engines/tsage/resources.h
+++ b/engines/tsage/resources.h
@@ -159,7 +159,7 @@ public:
 	byte *getResource(ResourceType resType, uint16 resNum, uint16 rlbNum, bool suppressErrors = false);
 	bool getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries);
 	byte *getSubResource(int resNum, int rlbNum, int index, uint *size, bool suppressErrors = false);
-	Common::String getMessage(int resNum, int lineNum, bool suppressErrors = false);
+	bool getMessage(int resNum, int lineNum, Common::String &result, bool suppressErrors = false);
 };
 
 class ResourceManager {


Commit: 0a0ac687227672a191c6cfce12582b982a2f5337
    https://github.com/scummvm/scummvm/commit/0a0ac687227672a191c6cfce12582b982a2f5337
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-05-03T05:40:49-07:00

Commit Message:
TSAGE: Bugfixes for displaying the credits

Changed paths:
    engines/tsage/ringworld_scenes10.cpp



diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp
index 8a45ff7..661c64b 100644
--- a/engines/tsage/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld_scenes10.cpp
@@ -1687,22 +1687,22 @@ void Scene9900::strAction2::signal() {
 		_lineNum = 0;
 		_txtArray1Index = 0;
 		_txtArray1[0]._position.y = 200;
-		_txtArray1[0]._position.y = 300;
+		_txtArray1[1]._position.y = 300;
 		_txtArray2[0]._position.y = 400;
-		_txtArray2[0]._position.y = 500;
+		_txtArray2[1]._position.y = 500;
 		_var3 = 0;
 		// No break on purpose
 	case 1: {
 		Common::String msg = _resourceManager->getMessage(8030, _lineNum++);
-		if (!msg.compareTo("LASTCREDIT")) {
-			if (_var3 == 0) {
+		if (msg.compareTo("LASTCREDIT")) {
+			if (_var3) {
 				// Not used?
 				// int x = _txtArray1[_txtArray1Index].getFrame().getBounds().height();
 				_txtArray1[_txtArray1Index]._moveDiff.y = 10;
 
 				NpcMover *mover = new NpcMover();
-				Common::Point pt(_txtArray1[_txtArray1Index]._moveDiff.x, -100);
-				_txtArray1[_txtArray1Index].addMover(mover, &pt, 0);
+				Common::Point pt(_txtArray1[_txtArray1Index]._position.x, -100);
+				_txtArray1[_txtArray1Index].addMover(mover, &pt, NULL);
 
 				// Not used?
 				// int x = _txtArray2[_txtArray1Index].getFrame().getBounds().height();
@@ -1721,9 +1721,10 @@ void Scene9900::strAction2::signal() {
 			int frameWidth = _txtArray1[_txtArray1Index].getFrame().getBounds().width();
 			int frameHeight = _txtArray1[_txtArray1Index].getFrame().getBounds().height();
 			_txtArray1[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200));
+
 			NpcMover *mover2 = new NpcMover();
 			Common::Point pt2(_txtArray1[_txtArray1Index]._position.x, 100);
-			_txtArray1[_txtArray1Index].addMover(mover2, &pt2, 0);
+			_txtArray1[_txtArray1Index].addMover(mover2, &pt2, this);
 
 			_txtArray2[_txtArray1Index]._textMode = ALIGN_CENTER;
 			_txtArray2[_txtArray1Index]._width = 240;






More information about the Scummvm-git-logs mailing list