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

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Fri Jun 25 22:26:54 CEST 2010


Revision: 50286
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50286&view=rev
Author:   sud03r
Date:     2010-06-25 20:26:54 +0000 (Fri, 25 Jun 2010)

Log Message:
-----------
some more refinements to FS and GFX tests

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

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-06-25 19:30:01 UTC (rev 50285)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-06-25 20:26:54 UTC (rev 50286)
@@ -15,13 +15,10 @@
  * compares the message contained in it, with what it expects.
  *
  */
-bool FStests::readDataFromFile(Common::FSNode &directory, const char *file) {
+bool FStests::readDataFromFile(Common::FSDirectory *directory, const char *file) {
 	
-	
-	Common::FSDirectory nestedDir(directory);
+	Common::SeekableReadStream *readStream = directory->createReadStreamForMember(file);
 
-	Common::SeekableReadStream *readStream = nestedDir.createReadStreamForMember(file);
-
 	if (!readStream) {
 		printf("LOG:Can't open game file for reading\n");
 		return false;
@@ -29,7 +26,7 @@
 	
 	Common::String msg = readStream->readLine();
 	delete readStream;
-	printf("LOG: Message Extracted from %s/%s : %s\n",directory.getName().c_str(), file, msg.c_str());
+	printf("LOG: Message Extracted from %s/%s : %s\n",directory->getFSNode().getName().c_str(), file, msg.c_str());
 
 
 	Common::String expectedMsg = "It works!";
@@ -45,10 +42,10 @@
 
 bool FStests::testReadFile() {
 	const Common::String &path = ConfMan.get("path");
-	Common::FSNode gameRoot(path);
+	Common::FSDirectory gameRoot(path);
 	int numFailed = 0;
 	
-	if (!gameRoot.isDirectory()) {
+	if (!gameRoot.getFSNode().isDirectory()) {
 		printf("LOG:game Path should be a directory");
 		return false;
 	}
@@ -59,7 +56,7 @@
 	for (unsigned int i = 0; i < ARRAYSIZE(dirList); i++) {
 		Common::String dirName = dirList[i];
 		Common::String fileName = file[i];
-		Common::FSNode directory = gameRoot.getChild(dirName); 
+		Common::FSDirectory *directory = gameRoot.getSubDirectory(dirName); 
 
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
@@ -68,7 +65,7 @@
 		
 		dirName.toLowercase();
 		fileName.toLowercase();
-		directory = gameRoot.getChild(dirName); 
+		directory = gameRoot.getSubDirectory(dirName); 
 		
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
@@ -77,7 +74,7 @@
 		
 		dirName.toUppercase();
 		fileName.toUppercase();
-		directory = gameRoot.getChild(dirName); 
+		directory = gameRoot.getSubDirectory(dirName); 
 		
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-06-25 19:30:01 UTC (rev 50285)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-06-25 20:26:54 UTC (rev 50286)
@@ -12,7 +12,7 @@
 // from commandline
 
 // Helper functions for FS tests
-bool readDataFromFile(Common::FSNode &directory, const char *file);
+bool readDataFromFile(Common::FSDirectory *directory, const char *file);
 
 // will contain function declarations for FS tests
 bool testReadFile();

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-25 19:30:01 UTC (rev 50285)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-25 20:26:54 UTC (rev 50286)
@@ -436,13 +436,14 @@
 		printf("LOG: Couldn't use Game palette for rendering cursor\n");
 		passed = false;
 	}	
-	g_system->delayMillis(1000);
 
 	if (!Testsuite::handleInteractiveInput("Did Cursor tests went as you were expecting?")) {
 		passed = false;
 	}
 	
 	Testsuite::clearScreen();
+	// Done with cursors
+	CursorMan.popAllCursors();
 	return passed;
 }
 
@@ -578,6 +579,9 @@
 		printf("LOG: Switcing to initial state failed\n");
 		return false;
 	}
+
+	// Done with cursors
+	CursorMan.popAllCursors();
 	
 	Testsuite::clearScreen();
 	return true;
@@ -651,16 +655,15 @@
 	
 	Graphics::PixelFormat pf = g_system->getOverlayFormat();
 	
-	OverlayColor buffer[20 * 40];
+	OverlayColor buffer[50 * 100];
 	OverlayColor value = pf.RGBToColor(0, 255, 0);
 
-	for (int i = 0; i < 20 * 40; i++) {
+	for (int i = 0; i < 50 * 100; i++) {
 		buffer[i] = value;
 	}
 	
-	// FIXME: Not Working.
 	g_system->showOverlay();
-	g_system->copyRectToOverlay(buffer, 40, 100, 100, 40, 20);
+	g_system->copyRectToOverlay(buffer, 100, 270, 175, 100, 50);
 	g_system->updateScreen();
 	
 	g_system->delayMillis(1000);
@@ -762,7 +765,7 @@
 		colors[4] = iter->RGBToColor(181, 126, 145);
 		colors[5] = iter->RGBToColor(47, 78, 36);
 
-		Common::Point pt(0, 10);
+		Common::Point pt(0, 170);
 		char msg[100];
 		// XXX: Can use snprintf?
 		snprintf(msg, sizeof(msg), "Testing Pixel Formats, %d of %d", numFormatsTested, pfList.size());
@@ -777,7 +780,7 @@
 		// Draw 6 rectangles centred at (50, 160), piled over one another
 		// each with color in colors[] 
 		for (int i = 0; i < 6; i++) {
-			screen->fillRect(Common::Rect::center(160, 50 + i * 10, 100, 10), colors[i]);
+			screen->fillRect(Common::Rect::center(160, 20 + i * 10, 100, 10), colors[i]);
 		}
 		
 		g_system->unlockScreen();


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