From 63750d678068aa92ee95dc9de2b2908a983b489d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 8 Aug 2013 16:22:08 +0200 Subject: COMMON: Rename ConfigFile to INIFile. This clears up that 'ConfigFile' is actually a class handling only INI-files. --- engines/testbed/config.cpp | 8 ++++---- engines/testbed/config.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/testbed') diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 6b56616c9b..a40d239ebf 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -213,22 +213,22 @@ void TestbedConfigManager::parseConfigFile() { return; } _configFileInterface.loadFromStream(*rs); - Common::ConfigFile::SectionList sections = _configFileInterface.getSections(); + Common::INIFile::SectionList sections = _configFileInterface.getSections(); Testsuite *currTS = 0; - for (Common::ConfigFile::SectionList::const_iterator i = sections.begin(); i != sections.end(); i++) { + for (Common::INIFile::SectionList::const_iterator i = sections.begin(); i != sections.end(); i++) { if (i->name.equalsIgnoreCase("Global")) { // Global params may be directly queried, ignore them } else { // A testsuite, process it. currTS = getTestsuiteByName(i->name); - Common::ConfigFile::SectionKeyList kList = i->getKeys(); + Common::INIFile::SectionKeyList kList = i->getKeys(); if (!currTS) { Testsuite::logPrintf("Warning! Error in config: Testsuite %s not found\n", i->name.c_str()); continue; } - for (Common::ConfigFile::SectionKeyList::const_iterator j = kList.begin(); j != kList.end(); j++) { + for (Common::INIFile::SectionKeyList::const_iterator j = kList.begin(); j != kList.end(); j++) { if (j->key.equalsIgnoreCase("this")) { currTS->enable(stringToBool(j->value)); } else { diff --git a/engines/testbed/config.h b/engines/testbed/config.h index fd5588aa31..d611ae4ec3 100644 --- a/engines/testbed/config.h +++ b/engines/testbed/config.h @@ -24,7 +24,7 @@ #include "common/array.h" -#include "common/config-file.h" +#include "common/ini-file.h" #include "common/str-array.h" #include "common/tokenizer.h" @@ -62,7 +62,7 @@ public: private: Common::Array &_testsuiteList; Common::String _configFileName; - Common::ConfigFile _configFileInterface; + Common::INIFile _configFileInterface; void parseConfigFile(); }; -- cgit v1.2.3 From 764a34edf74813d703f81c48778bd4494079f49f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 14 Aug 2013 02:37:19 +0200 Subject: TESTBED: Make code agonstic to OverlayColor. --- engines/testbed/graphics.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'engines/testbed') diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index 590e6c6d81..26e073d407 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -927,17 +927,29 @@ TestExitStatus GFXtests::overlayGraphics() { Graphics::PixelFormat pf = g_system->getOverlayFormat(); - OverlayColor buffer[50 * 100]; - OverlayColor value = pf.RGBToColor(0, 255, 0); + byte *buffer = new byte[50 * 100 * pf.bytesPerPixel]; + const uint32 value = pf.RGBToColor(0, 255, 0); - for (int i = 0; i < 50 * 100; i++) { - buffer[i] = value; + if (pf.bytesPerPixel == 2) { + uint16 *dst = (uint16 *)buffer; + for (int i = 50 * 100; i > 0; --i) { + *dst++ = value; + } + } else if (pf.bytesPerPixel == 4) { + uint32 *dst = (uint32 *)buffer; + for (int i = 50 * 100; i > 0; --i) { + *dst++ = value; + } + } else { + error("GFXtests::overlayGraphics: Unsupported color depth: %d", pf.bytesPerPixel); } g_system->showOverlay(); - g_system->copyRectToOverlay(buffer, 200, 270, 175, 100, 50); + g_system->copyRectToOverlay(buffer, 100 * pf.bytesPerPixel, 270, 175, 100, 50); g_system->updateScreen(); + delete[] buffer; + g_system->delayMillis(1000); g_system->hideOverlay(); -- cgit v1.2.3