diff options
Diffstat (limited to 'engines/testbed/graphics.cpp')
-rw-r--r-- | engines/testbed/graphics.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index d5b5da788a..36ec726fc7 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -102,7 +102,7 @@ void GFXtests::initMousePalette() { CursorMan.replaceCursorPalette(palette, 0, 3); } -Common::Rect GFXtests::computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) { +Common::Rect GFXtests::computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) { if (cursorTargetScale == 1 || scalingFactor == 1) { // Game data and cursor would be scaled equally. // so dimensions would be same. @@ -137,7 +137,7 @@ void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, in float f, p, q, t; if (s == 0) { - r = g = b = v * 255; + rComp = gComp = bComp = (int)(v * 255); return; } @@ -186,7 +186,7 @@ void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, in bComp = (int)(b * 255); } -Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) { +Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, int cursorTargetScale) { // Buffer initialized with yellow color byte buffer[500]; memset(buffer, 2, sizeof(buffer)); @@ -249,7 +249,7 @@ void GFXtests::setupMouseLoop(bool disableCursorPalette, const char *gfxModeName if (isFeaturePresent) { - cursorRect = GFXtests::drawCursor(disableCursorPalette, gfxModeName, cursorTargetScale); + cursorRect = GFXtests::drawCursor(disableCursorPalette, cursorTargetScale); Common::EventManager *eventMan = g_system->getEventManager(); Common::Event event; @@ -741,7 +741,7 @@ TestExitStatus GFXtests::scaledCursors() { if (isAspectRatioCorrected) { info += "\nDisabling Aspect ratio correction, for letting cusors match exactly, will be restored after this test."; } - + if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) { Testsuite::logPrintf("Info! Skipping test : Scaled Cursors\n"); return kTestSkipped; @@ -753,7 +753,7 @@ TestExitStatus GFXtests::scaledCursors() { } - if (isAspectRatioCorrected) { + if (isAspectRatioCorrected) { g_system->beginGFXTransaction(); g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, false); g_system->endGFXTransaction(); @@ -766,7 +766,7 @@ TestExitStatus GFXtests::scaledCursors() { // for every graphics mode display cursors for cursorTargetScale 1, 2 and 3 // Switch Graphics mode // FIXME: Crashes with "3x" mode now.: - + info = Common::String::format("Testing : Scaled cursors with GFX Mode %s\n", gfxMode->name); if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) { Testsuite::logPrintf("\tInfo! Skipping sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name); @@ -779,7 +779,7 @@ TestExitStatus GFXtests::scaledCursors() { Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n"); return kTestSkipped; } - + g_system->beginGFXTransaction(); bool isGFXModeSet = g_system->setGraphicsMode(gfxMode->id); @@ -807,7 +807,7 @@ TestExitStatus GFXtests::scaledCursors() { if (Testsuite::handleInteractiveInput(info, "Yes", "No", kOptionRight)) { Testsuite::logPrintf("\tInfo! Failed sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name); } - + if (Engine::shouldQuit()) { // Explicit exit requested Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n"); @@ -824,7 +824,7 @@ TestExitStatus GFXtests::scaledCursors() { if (isAspectRatioCorrected) { g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, true); } - + OSystem::TransactionError gfxError = g_system->endGFXTransaction(); if (gfxError != OSystem::kTransactionSuccess || !isGFXModeSet) { @@ -962,13 +962,14 @@ TestExitStatus GFXtests::paletteRotation() { Testsuite::logPrintf("Info! Skipping test : palette Rotation\n"); return kTestSkipped; } - Common::Point pt(0, 10); + Testsuite::clearEntireScreen(); // Use 256 colors byte palette[256 * 3] = {0}; int r, g, b; + r = g = b = 0; int colIndx; for (int i = 0; i < 256; i++) { @@ -1065,7 +1066,6 @@ TestExitStatus GFXtests::pixelFormats() { } Common::List<Graphics::PixelFormat> pfList = g_system->getSupportedFormats(); - Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin(); int numFormatsTested = 0; int numPassed = 0; @@ -1073,7 +1073,7 @@ TestExitStatus GFXtests::pixelFormats() { Testsuite::logDetailedPrintf("Testing Pixel Formats. Size of list : %d\n", pfList.size()); - for (iter = pfList.begin(); iter != pfList.end(); iter++) { + for (Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin(); iter != pfList.end(); iter++) { numFormatsTested++; if (iter->bytesPerPixel == 1) { // Palettes already tested |