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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Jul 2 09:32:06 CEST 2007


Revision: 27850
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27850&view=rev
Author:   peres001
Date:     2007-07-02 00:32:06 -0700 (Mon, 02 Jul 2007)

Log Message:
-----------
Removed special displayBalloonString routine.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables.cpp
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/zone.cpp

Modified: scummvm/trunk/engines/parallaction/callables.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/callables.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -253,7 +253,7 @@
 	_vm->_gfx->floodFill(Gfx::kBitFront, r, 1);
 
 	_vm->_gfx->setFont(kFontDialogue);
-	_vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 130, 0);
+	_vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 0, 130);
 	_vm->_gfx->updateScreen();
 
 	uint32 di = 0;

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -179,7 +179,7 @@
 	} while (strlen(vD0) == 0);
 
 	vD0[strlen(vD0)-1] = '\0';	// deletes the trailing '0xA'
-								// this is critical for Gfx::displayBalloonString to work properly
+								// this is critical for Gfx::displayWrappedString to work properly
 
 	char *vCC = (char*)malloc(strlen(vD0)+1);
 	strcpy(vCC, vD0);
@@ -248,9 +248,10 @@
 		r.moveTo(_answerBalloonX[0], _answerBalloonY[0]);
 
 		_vm->_gfx->drawBalloon(r, 1);
-		_vm->_gfx->displayWrappedString(_q->_answers[0]->_text, _answerBalloonX[0], _answerBalloonY[0], MAX_BALLOON_WIDTH, 3);
+		_vm->_gfx->displayWrappedString(_q->_answers[0]->_text, _answerBalloonX[0], _answerBalloonY[0], 3, MAX_BALLOON_WIDTH);
 		_vm->_gfx->flatBlitCnv(_answerer, 0, ANSWER_CHARACTER_X, ANSWER_CHARACTER_Y,	Gfx::kBitFront);
-		_vm->_gfx->displayBalloonString(_answerBalloonX[0] + 5,	_answerBalloonY[0] + _answerBalloonH[0] - 15, "> ", 0);
+		_vm->_gfx->displayString(_answerBalloonX[0] + 5, _answerBalloonY[0] + _answerBalloonH[0] - 15, "> ", 0);
+		_vm->_gfx->updateScreen();
 
 		Common::Event e;
 		while (e.kbd.ascii != Common::KEYCODE_RETURN && passwordLen < MAX_PASSWORD_LENGTH) {
@@ -266,7 +267,7 @@
 			passwordLen++;
 			password[passwordLen] = '\0';
 
-			_vm->_gfx->displayBalloonString(_answerBalloonX[0] + 10, _answerBalloonY[0] + _answerBalloonH[0] - 15, password, 0);
+			_vm->_gfx->displayString(_answerBalloonX[0] + 10, _answerBalloonY[0] + _answerBalloonH[0] - 15, password, 0);
 			_vm->_gfx->updateScreen();
 
 			g_system->delayMillis(20);
@@ -305,7 +306,7 @@
 		_vm->_gfx->drawBalloon(r, 1);
 
 		_answerBalloonY[i+1] = 10 + _answerBalloonY[i] + _answerBalloonH[i];
-		_askPassword = _vm->_gfx->displayWrappedString(_q->_answers[i]->_text, _answerBalloonX[i], _answerBalloonY[i], MAX_BALLOON_WIDTH, 3);
+		_askPassword = _vm->_gfx->displayWrappedString(_q->_answers[i]->_text, _answerBalloonX[i], _answerBalloonY[i], 3, MAX_BALLOON_WIDTH);
 
 		return true;
 	}
@@ -347,7 +348,7 @@
 	r.moveTo(QUESTION_BALLOON_X, QUESTION_BALLOON_Y);
 
 	_vm->_gfx->drawBalloon(r, _q->_mood & 0x10);
-	_vm->_gfx->displayWrappedString(_q->_text, QUESTION_BALLOON_X, QUESTION_BALLOON_Y, MAX_BALLOON_WIDTH, 0);
+	_vm->_gfx->displayWrappedString(_q->_text, QUESTION_BALLOON_X, QUESTION_BALLOON_Y, 0, MAX_BALLOON_WIDTH);
 	_vm->_gfx->updateScreen();
 
 	waitUntilLeftClick();
@@ -423,7 +424,7 @@
 	_answerBalloonY[i] = 2000;
 
 	if (numAvailableAnswers == 1) {
-		_vm->_gfx->displayWrappedString(_q->_answers[_di]->_text, _answerBalloonX[_di], _answerBalloonY[_di], MAX_BALLOON_WIDTH, 0);
+		_vm->_gfx->displayWrappedString(_q->_answers[_di]->_text, _answerBalloonX[_di], _answerBalloonY[_di], 0, MAX_BALLOON_WIDTH);
 		_vm->_gfx->flatBlitCnv(_answerer, 0, ANSWER_CHARACTER_X,	ANSWER_CHARACTER_Y, Gfx::kBitFront);
 		_vm->_gfx->updateScreen();
 		waitUntilLeftClick();
@@ -440,9 +441,9 @@
 
 		if (_si != v2) {
 			if (v2 != -1)
-				_vm->_gfx->displayWrappedString(_q->_answers[v2]->_text, _answerBalloonX[v2], _answerBalloonY[v2], MAX_BALLOON_WIDTH, 3);
+				_vm->_gfx->displayWrappedString(_q->_answers[v2]->_text, _answerBalloonX[v2], _answerBalloonY[v2], 3, MAX_BALLOON_WIDTH);
 
-			_vm->_gfx->displayWrappedString(_q->_answers[_si]->_text, _answerBalloonX[_si],	_answerBalloonY[_si], MAX_BALLOON_WIDTH, 0);
+			_vm->_gfx->displayWrappedString(_q->_answers[_si]->_text, _answerBalloonX[_si],	_answerBalloonY[_si], 0, MAX_BALLOON_WIDTH);
 			_vm->_gfx->flatBlitCnv(_answerer, _q->_answers[_si]->_mood & 0xF, ANSWER_CHARACTER_X, ANSWER_CHARACTER_Y, Gfx::kBitFront);
 		}
 

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -583,31 +583,20 @@
 
 }
 
-void Gfx::displayString(uint16 x, uint16 y, const char *text) {
-	assert(_font == _fonts[kFontMenu]);
-
+void Gfx::displayString(uint16 x, uint16 y, const char *text, byte color) {
 	byte *dst = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
-	_font->setColor(1);
+	_font->setColor(color);
 	_font->drawString(dst, SCREEN_WIDTH, text);
 }
 
 void Gfx::displayCenteredString(uint16 y, const char *text) {
 	uint16 x = (SCREEN_WIDTH - getStringWidth(text)) / 2;
-	displayString(x, y, text);
+	displayString(x, y, text, 1);
 }
 
-void Gfx::displayBalloonString(uint16 x, uint16 y, const char *text, byte color) {
-	assert(_font == _fonts[kFontDialogue]);
+bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, byte color, uint16 wrapwidth) {
+//	printf("Gfx::displayWrappedString(%s, %i, %i, %i, %i)...", text, x, y, color, wrapwidth);
 
-	byte *dst = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
-
-	_font->setColor(color);
-	_font->drawString(dst, SCREEN_WIDTH, text);
-}
-
-bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth, byte color) {
-//	printf("Gfx::displayWrappedString(%s, %i, %i, %i, %i)...", text, x, y, maxwidth, color);
-
 	uint16 lines = 0;
 	bool rv = false;
 	uint16 linewidth = 0;
@@ -622,7 +611,7 @@
 		text = parseNextToken(text, token, 40, "   ");
 		linewidth += getStringWidth(token);
 
-		if (linewidth > maxwidth) {
+		if (linewidth > wrapwidth) {
 			// wrap line
 			lines++;
 			rx = x + 10;			// x
@@ -636,7 +625,7 @@
 		if (!scumm_stricmp(token, "%p")) {
 			rv = true;
 		} else
-			displayBalloonString(rx, ry, token, color);
+			displayString(rx, ry, token, color);
 
 		rx += getStringWidth(token) + getStringWidth(" ");
 		linewidth += getStringWidth(" ");

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-07-02 07:32:06 UTC (rev 27850)
@@ -165,10 +165,9 @@
 
 	// dialogue and text
 	void drawBalloon(const Common::Rect& r, uint16 arg_8);
-	void displayBalloonString(uint16 x, uint16 y, const char *text, byte color);
-	void displayString(uint16 x, uint16 y, const char *text);
+	void displayString(uint16 x, uint16 y, const char *text, byte color);
 	void displayCenteredString(uint16 y, const char *text);
-	bool displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth, byte color);
+	bool displayWrappedString(char *text, uint16 x, uint16 y, byte color, uint16 wrapwidth = SCREEN_WIDTH);
 	uint16 getStringWidth(const char *text);
 	void getStringExtent(char *text, uint16 maxwidth, int16* width, int16* height);
 

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -437,7 +437,7 @@
 	_gfx->floodFill(Gfx::kBitFront, r, 0);
 	r.grow(-1);
 	_gfx->floodFill(Gfx::kBitFront, r, 1);
-	_gfx->displayWrappedString(_location._comment, 3, 5, 130, 0);
+	_gfx->displayWrappedString(_location._comment, 3, 5, 0, 130);
 
 	_gfx->updateScreen();
 	waitUntilLeftClick();

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -201,7 +201,7 @@
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
-	_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
+	_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE", 1);
 
 	_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
@@ -287,10 +287,10 @@
 
 		if (_si != 0) {
 			// load a game
-			_vm->_gfx->displayString(60, 30, loadGameMsg[_language]);
+			_vm->_gfx->displayString(60, 30, loadGameMsg[_language], 1);
 		} else {
 			// new game
-			_vm->_gfx->displayString(60, 30, newGameMsg[_language]);
+			_vm->_gfx->displayString(60, 30, newGameMsg[_language], 1);
 		}
 
 		_vm->_gfx->updateScreen();
@@ -353,7 +353,7 @@
 		askPassword = false;
 		_di = 0;
 
-		_vm->_gfx->displayString(60, 30, introMsg1[_language]);			// displays message
+		_vm->_gfx->displayString(60, 30, introMsg1[_language], 1);			// displays message
 		_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
 
 		_donna_points = 0;
@@ -415,7 +415,7 @@
 		if (askPassword == false) break;
 
 		_vm->_gfx->copyScreen(Gfx::kBit2, Gfx::kBitFront);
-		_vm->_gfx->displayString(60, 30, introMsg2[_language]);
+		_vm->_gfx->displayString(60, 30, introMsg2[_language], 1);
 		_vm->_gfx->updateScreen();
 
 		g_system->delayMillis(2000);

Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp	2007-07-02 07:23:43 UTC (rev 27849)
+++ scummvm/trunk/engines/parallaction/zone.cpp	2007-07-02 07:32:06 UTC (rev 27850)
@@ -303,7 +303,7 @@
 	Common::Rect r(v28, v26);
 	r.moveTo(140, 10);
 	_gfx->drawBalloon(r, 0);
-	_gfx->displayWrappedString(data->_description, 140, 10, 130, 0);
+	_gfx->displayWrappedString(data->_description, 140, 10, 0, 130);
 
 	_gfx->updateScreen();
 
@@ -344,7 +344,7 @@
 	r.moveTo(0, 90);
 	_gfx->drawBalloon(r, 0);
 	_gfx->flatBlitCnv(_vm->_char._head, 100, 152, Gfx::kBitFront);
-	_gfx->displayWrappedString(data->_description, 0, 90, 130, 0);
+	_gfx->displayWrappedString(data->_description, 0, 90, 0, 130);
 
 	jobEraseAnimations((void*)1, NULL);
 	_gfx->updateScreen();


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