[Scummvm-cvs-logs] SF.net SVN: scummvm: [28481] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue Aug 7 15:54:29 CEST 2007


Revision: 28481
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28481&view=rev
Author:   peres001
Date:     2007-08-07 06:54:29 -0700 (Tue, 07 Aug 2007)

Log Message:
-----------
Location comments are now displayed by a single Gfx function.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/location.cpp

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2007-08-07 01:01:01 UTC (rev 28480)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2007-08-07 13:54:29 UTC (rev 28481)
@@ -338,19 +338,8 @@
 
 void Parallaction_ns::_c_endComment(void *param) {
 
-	int16 w = 0, h = 0;
-	_gfx->getStringExtent(_location._endComment, 130, &w, &h);
+	_gfx->showLocationComment(_location._endComment, true);
 
-	Common::Rect r(w+5, h+5);
-	r.moveTo(5, 5);
-	_gfx->floodFill(Gfx::kBitFront, r, 0);
-	r.grow(-2);
-	_gfx->floodFill(Gfx::kBitFront, r, 1);
-
-	_gfx->setFont(kFontDialogue);
-	_gfx->displayWrappedString(_location._endComment, 3, 5, 0, 130);
-	_gfx->updateScreen();
-
 	Gfx::Palette pal;
 	_gfx->makeGrayscalePalette(pal);
 

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-08-07 01:01:01 UTC (rev 28480)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-08-07 13:54:29 UTC (rev 28481)
@@ -96,7 +96,26 @@
 	return;
 }
 
+void Gfx::showLocationComment(const char *text, bool end) {
 
+	setFont(kFontDialogue);
+
+	int16 w, h;
+	getStringExtent(const_cast<char*>(text), 130, &w, &h);
+
+	Common::Rect r(w + (end ? 5 : 10), h + 5);
+	r.moveTo(5, 5);
+
+	floodFill(kBitFront, r, 0);
+	r.grow(-2);
+	floodFill(kBitFront, r, 1);
+	displayWrappedString(const_cast<char*>(text), 3, 5, 0, 130);
+
+	updateScreen();
+
+	return;
+}
+
 void Gfx::setPalette(Palette pal, uint32 first, uint32 num) {
 //	printf("setPalette(%i, %i)\n", first, num);
 

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-08-07 01:01:01 UTC (rev 28480)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-08-07 13:54:29 UTC (rev 28481)
@@ -221,6 +221,7 @@
 	int16 queryMask(int16 v);
 	void intGrottaHackMask();
 	void restoreBackground(const Common::Rect& r);
+	void showLocationComment(const char *text, bool end = false);
 
 	// intro hacks for Nippon Safes
 	void fillMaskRect(const Common::Rect& r, byte color);

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-08-07 01:01:01 UTC (rev 28480)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-08-07 13:54:29 UTC (rev 28481)
@@ -431,21 +431,10 @@
 	jobEraseAnimations(NULL, NULL);
 	jobDisplayAnimations(NULL, NULL);
 
-	_gfx->setFont(kFontDialogue);
 	_gfx->swapBuffers();
 	_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
 
-	int16 w, h;
-	_gfx->getStringExtent(_location._comment, 130, &w, &h);
-
-	Common::Rect r(10 + w, 5 + h);
-	r.moveTo(5, 5);
-	_gfx->floodFill(Gfx::kBitFront, r, 0);
-	r.grow(-2);
-	_gfx->floodFill(Gfx::kBitFront, r, 1);
-	_gfx->displayWrappedString(_location._comment, 3, 5, 0, 130);
-
-	_gfx->updateScreen();
+	_gfx->showLocationComment(_location._comment);
 	waitUntilLeftClick();
 
 	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront );


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list