[Scummvm-cvs-logs] SF.net SVN: scummvm:[50257] scummvm/branches/gsoc2010-testbed/engines/ testbed/graphics.cpp

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Fri Jun 25 05:48:29 CEST 2010


Revision: 50257
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50257&view=rev
Author:   sud03r
Date:     2010-06-25 03:48:28 +0000 (Fri, 25 Jun 2010)

Log Message:
-----------
added code to test 16+ bit pixel formats

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-25 00:14:09 UTC (rev 50256)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-25 03:48:28 UTC (rev 50257)
@@ -1,4 +1,5 @@
 #include "common/events.h"
+#include "common/list.h"
 #include "common/random.h"
 
 #include "testbed/graphics.h"
@@ -695,11 +696,11 @@
 
 	while (toRotate--) {
 		g_system->updateScreen();
-		g_system->delayMillis(1000);
+		g_system->delayMillis(300);
 		rotatePalette(palette, 10);
 	}
 
-	if(Testsuite::handleInteractiveInput("Did you want to rotate the palettes?", "Yes", "No", kOptionRight)) {
+	if(Testsuite::handleInteractiveInput("Did you saw palettes rotating?", "Yes", "No", kOptionRight)) {
 		return false;
 	}
 
@@ -707,7 +708,50 @@
 }
 
 bool GFXtests::pixelFormats() {
+	Common::List<Graphics::PixelFormat> pfList = g_system->getSupportedFormats();
+	Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin();
+	
+	Graphics::PixelFormat currPixelformat = g_system->getScreenFormat();
+	printf("Current bpp: %d List size : %d\n",currPixelformat.bytesPerPixel, pfList.size());
+	
+	while (iter != pfList.end()) {
+		printf("bpp : %d\n", (*iter).bytesPerPixel);
+		
+		// Switch to that pixelFormat
+		g_system->beginGFXTransaction();
+		g_system->initSize(320, 200, &(*iter));
+		g_system->endGFXTransaction();
+		
+		// Draw some nice gradients
+		// Pick up some colors
+		uint colors[6];
+		
+		colors[0] = iter->RGBToColor(255, 255, 255);
+		colors[1] = iter->RGBToColor(135, 48, 21);
+		colors[2] = iter->RGBToColor(205, 190, 87);
+		colors[3] = iter->RGBToColor(0, 32, 64);
+		colors[4] = iter->RGBToColor(181, 126, 145);
+		colors[5] = iter->RGBToColor(47, 78, 36);
 
+		// Draw some Rectangles, each of width 100 pixels and height 10 pixels
+		byte buffer[6 * 100 * 10] = {0};
+		int indx;
+		for (int i = 0; i < ARRAYSIZE(colors); i++) {
+			indx = i * 1000;
+			for (int j = 0; j < 1000; j++) {
+				buffer[indx + j] = colors[i];
+			}
+		}
+	
+		g_system->copyRectToScreen(buffer, 100, 110, 70, 100, 60);
+		g_system->updateScreen();
+
+		g_system->delayMillis(2000);
+		break;
+		iter++;
+	}
+
+	return true;
 }
 
 }


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