[Scummvm-cvs-logs] SF.net SVN: scummvm:[41658] scummvm/branches/gsoc2009-draci/engines/draci/ draci.cpp

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Fri Jun 19 02:15:29 CEST 2009


Revision: 41658
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41658&view=rev
Author:   dkasak13
Date:     2009-06-19 00:15:28 +0000 (Fri, 19 Jun 2009)

Log Message:
-----------
Updated the demo animation to use the new Surface features (transparency, dirty rects). Changed background to light grey. A transparent string is now drawn over the dragon sprite.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-06-19 00:13:05 UTC (rev 41657)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-06-19 00:15:28 UTC (rev 41658)
@@ -130,12 +130,12 @@
 
 	_screen->setPalette(f->_data, 0, kNumColours);
 	
-	// Fill screen with white
-	_screen->fillScreen(255);
+	// Fill screen with light grey
+	_screen->fillScreen(225);
 
 	// Draw big string
 	Common::String testString = "Testing, testing, read all about it!";
-	Graphics::Surface *surf = _screen->getSurface();
+	Surface *surf = _screen->getSurface();
 	_font->drawString(surf, testString, 
 		(kScreenWidth - _font->getStringWidth(testString, 1)) / 2, 130, 1);
 
@@ -160,13 +160,26 @@
 		return 0;
 	}	
 
+	testString = "I'm transparent";
 	for (unsigned int t = 0; t < 25; ++t) {
 		debugC(5, kDraciGeneralDebugLevel, "Drawing frame %d...", t);
 
 		// Load frame to memory
 		f = ar[t];
 		Sprite sp(f->_data, f->_length, ((kScreenWidth - 50) / 2), 60, true);
-		_screen->drawSprite(sp);
+
+		// Delete previous frame
+		Common::Rect r(sp._x, sp._y, sp._x + sp._width, sp._y + sp._height);
+		_screen->drawRect(r, 225);	
+
+		// Draw dragon
+		sp.draw(surf);
+
+		// Draw transparent text over dragon
+		_font->setColour(kDefaultTransparent);	
+		_font->drawString(surf, testString, 
+		(kScreenWidth - _font->getStringWidth(testString, 1)) / 2, 80, 1);
+
 		_screen->copyToScreen();
 		_system->delayMillis(100);
 


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