[Scummvm-cvs-logs] SF.net SVN: scummvm: [23809] scummvm/trunk/engines/lure/room.cpp

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Wed Aug 30 13:48:50 CEST 2006


Revision: 23809
Author:   dreammaster
Date:     2006-08-30 04:48:43 -0700 (Wed, 30 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23809&view=rev

Log Message:
-----------
Added word wrapping to the status line (necessary when giving long sets of Tell instructions)

Modified Paths:
--------------
    scummvm/trunk/engines/lure/room.cpp
Modified: scummvm/trunk/engines/lure/room.cpp
===================================================================
--- scummvm/trunk/engines/lure/room.cpp	2006-08-30 08:13:32 UTC (rev 23808)
+++ scummvm/trunk/engines/lure/room.cpp	2006-08-30 11:48:43 UTC (rev 23809)
@@ -441,7 +441,18 @@
 		if (_hotspotId != 0) 
 			s.writeString(0, 0, _hotspotName, false, DIALOG_TEXT_COLOUR);
 	} else {
-		s.writeString(0, 0, _statusLine, false, DIALOG_WHITE_COLOUR);
+		// Word wrap (if necessary) the status line and dispaly it
+		char *statusLineCopy = strdup(_statusLine);
+		char **lines;
+		uint8 numLines;
+		int16 yPos = 0;
+		s.wordWrap(statusLineCopy, s.width(), lines, numLines);
+		for (int lineNum = 0; lineNum < numLines; ++lineNum) {
+			s.writeString(0, yPos, lines[lineNum], false, DIALOG_WHITE_COLOUR);
+			yPos += FONT_HEIGHT;
+		}
+		Memory::dealloc(lines);
+		Memory::dealloc(statusLineCopy);
 	}
 
 	// If show information is turned on, show extra debugging information


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