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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Aug 16 14:49:27 CEST 2008


Revision: 33939
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33939&view=rev
Author:   peres001
Date:     2008-08-16 12:49:27 +0000 (Sat, 16 Aug 2008)

Log Message:
-----------
Multiple balloons (answers) are now positioned correctly in BRA.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/balloons.cpp

Modified: scummvm/trunk/engines/parallaction/balloons.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/balloons.cpp	2008-08-16 12:38:37 UTC (rev 33938)
+++ scummvm/trunk/engines/parallaction/balloons.cpp	2008-08-16 12:49:27 UTC (rev 33939)
@@ -637,11 +637,11 @@
 
 	if (winding == 0) {
 		src = _rightBalloon;
-		srcFrame = id;
+		srcFrame = 0;
 	} else
 	if (winding == 1) {
 		src = _leftBalloon;
-		srcFrame = 0;
+		srcFrame = id;
 	}
 
 	assert(src);
@@ -657,17 +657,18 @@
 	balloon->obj->y = balloon->box.top;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_BR;
 
-	if (id > 0) {
-		balloon->obj->y += _intBalloons[id - 1].obj->y + _intBalloons[id - 1].box.height();
-	}
-
 	_numBalloons++;
 
 	return id;
 }
 
-void BalloonManager_br::setBalloonText(uint id, char *text, byte textColor) { }
+void BalloonManager_br::setBalloonText(uint id, char *text, byte textColor) {
+	Balloon *balloon = getBalloon(id);
 
+	StringWriter_BR sw(_vm->_dialogueFont);
+	sw.write(text, MAX_BALLOON_WIDTH, textColor, balloon->surface);
+}
+
 int BalloonManager_br::setLocationBalloon(char *text, bool endGame) {
 /*
 	int16 w, h;
@@ -691,11 +692,9 @@
 	Common::Point p;
 
 	for (uint i = 0; i < _numBalloons; i++) {
-		p.x = x - _intBalloons[i].obj->x;
-		p.y = y - _intBalloons[i].obj->y;
-
-		if (_intBalloons[i].box.contains(p))
+		if (_intBalloons[i].box.contains(x, y)) {
 			return i;
+		}
 	}
 
 	return -1;


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