2010-06-02 04:45:44 +00:00
|
|
|
#include "testbed/graphics.h"
|
2010-06-03 03:55:08 +00:00
|
|
|
#include "testbed/gfxtests.h"
|
2010-06-02 04:45:44 +00:00
|
|
|
|
|
|
|
namespace Testbed {
|
|
|
|
|
2010-06-08 17:24:29 +00:00
|
|
|
byte GFXTestSuite::_palette[3 * 4] = {0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0};
|
|
|
|
|
2010-06-02 04:45:44 +00:00
|
|
|
GFXTestSuite::GFXTestSuite() {
|
2010-06-06 14:06:51 +00:00
|
|
|
// Initialize color palettes
|
|
|
|
// Te fourth field is for alpha channel which is unused
|
|
|
|
// Assuming 8bpp as of now
|
|
|
|
g_system->setPalette(_palette, 0, 3);
|
|
|
|
g_system->grabPalette(_palette, 0, 3);
|
|
|
|
|
|
|
|
// Add tests here
|
2010-06-08 17:24:29 +00:00
|
|
|
// addTest("FullScreenMode", &testFullScreenMode);
|
|
|
|
// addTest("AspectRatio", &testAspectRatio);
|
|
|
|
addTest("PalettizedCursors", &testPalettizedCursors);
|
|
|
|
// addTest("BlitBitmaps", &testCopyRectToScreen);
|
2010-06-02 04:45:44 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 13:56:04 +00:00
|
|
|
const char *GFXTestSuite::getName() {
|
|
|
|
return "GFX";
|
|
|
|
}
|
|
|
|
|
2010-06-06 14:06:51 +00:00
|
|
|
void GFXTestSuite::setCustomColor(uint r, uint g, uint b) {
|
|
|
|
_palette[8] = r;
|
|
|
|
_palette[9] = g;
|
|
|
|
_palette[10] = b;
|
|
|
|
g_system->setPalette(_palette, 0, 3);
|
|
|
|
g_system->grabPalette(_palette, 0, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GFXTestSuite::execute() {
|
2010-06-02 13:56:04 +00:00
|
|
|
for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
|
|
|
|
printf("Executing Test:%s\n", ((*i)->featureName).c_str());
|
2010-06-06 14:06:51 +00:00
|
|
|
// Invoke the test
|
|
|
|
(*i)->driver();
|
|
|
|
_numTestsExecuted++;
|
|
|
|
// Verify result by Interacting with the tester.
|
|
|
|
Common::String prompt("Was this similar to what you expected?");
|
|
|
|
if (handleInteractiveInput(prompt)) {
|
|
|
|
_numTestsPassed++;
|
|
|
|
}
|
2010-06-02 13:56:04 +00:00
|
|
|
}
|
|
|
|
|
2010-06-06 14:06:51 +00:00
|
|
|
// Report Generation
|
|
|
|
genReport();
|
2010-06-02 04:45:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|