2010-06-26 13:07:13 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*/
|
|
|
|
|
2010-05-24 17:43:55 +00:00
|
|
|
#include "common/scummsys.h"
|
2010-05-31 04:58:19 +00:00
|
|
|
#include "common/system.h"
|
2010-05-24 17:43:55 +00:00
|
|
|
|
|
|
|
#include "engines/util.h"
|
|
|
|
|
2010-06-17 11:23:51 +00:00
|
|
|
#include "testbed/fs.h"
|
2010-06-02 13:56:04 +00:00
|
|
|
#include "testbed/graphics.h"
|
2010-06-25 21:03:53 +00:00
|
|
|
#include "testbed/savegame.h"
|
|
|
|
#include "testbed/testbed.h"
|
2010-05-24 17:43:55 +00:00
|
|
|
|
2010-05-31 04:58:19 +00:00
|
|
|
namespace Testbed {
|
2010-05-24 17:43:55 +00:00
|
|
|
|
2010-05-31 04:58:19 +00:00
|
|
|
TestbedEngine::TestbedEngine(OSystem *syst)
|
2010-05-24 17:43:55 +00:00
|
|
|
: Engine(syst) {
|
|
|
|
// Put your engine in a sane state, but do nothing big yet;
|
|
|
|
// in particular, do not load data from files; rather, if you
|
|
|
|
// need to do such things, do them from init().
|
|
|
|
|
|
|
|
// Do not initialize graphics here
|
|
|
|
|
|
|
|
// However this is the place to specify all default directories
|
|
|
|
|
2010-05-31 04:58:19 +00:00
|
|
|
printf("TestbedEngine::TestbedEngine()\n");
|
2010-05-24 17:43:55 +00:00
|
|
|
}
|
|
|
|
|
2010-05-31 04:58:19 +00:00
|
|
|
TestbedEngine::~TestbedEngine() {
|
2010-05-24 17:43:55 +00:00
|
|
|
// Dispose your resources here
|
2010-05-31 04:58:19 +00:00
|
|
|
printf("TestbedEngine::~TestbedEngine()\n");
|
2010-05-24 17:43:55 +00:00
|
|
|
|
|
|
|
// Remove all of our debug levels here
|
|
|
|
}
|
2010-05-31 04:58:19 +00:00
|
|
|
|
|
|
|
Common::Error TestbedEngine::run() {
|
2010-05-24 17:43:55 +00:00
|
|
|
// Initialize graphics using following:
|
|
|
|
initGraphics(320, 200, false);
|
|
|
|
|
|
|
|
// You could use backend transactions directly as an alternative,
|
|
|
|
// but it isn't recommended, until you want to handle the error values
|
|
|
|
// from OSystem::endGFXTransaction yourself.
|
|
|
|
// This is just an example template:
|
|
|
|
//_system->beginGFXTransaction();
|
|
|
|
// // This setup the graphics mode according to users seetings
|
|
|
|
// initCommonGFX(false);
|
|
|
|
//
|
|
|
|
// // Specify dimensions of game graphics window.
|
|
|
|
// // In this example: 320x200
|
|
|
|
// _system->initSize(320, 200);
|
|
|
|
//FIXME: You really want to handle
|
|
|
|
//OSystem::kTransactionSizeChangeFailed here
|
|
|
|
//_system->endGFXTransaction();
|
|
|
|
|
|
|
|
// Additional setup.
|
2010-05-31 04:58:19 +00:00
|
|
|
printf("TestbedEngine::init\n");
|
|
|
|
|
2010-06-06 14:06:51 +00:00
|
|
|
// As of now we are using GUI::MessageDialog for interaction, Test if it works.
|
|
|
|
// interactive mode could also be modified by a config parameter "non-interactive=1"
|
|
|
|
// TODO: Implement that
|
2010-06-02 13:56:04 +00:00
|
|
|
|
2010-06-10 12:40:58 +00:00
|
|
|
Common::String prompt("Welcome to the ScummVM testbed!\n"
|
|
|
|
"It is a framework to test the various ScummVM subsystems namely GFX, Sound, FS, events etc.\n"
|
|
|
|
"If you see this, it means interactive tests would run on this system :)");
|
|
|
|
|
|
|
|
// To be set from config file
|
2010-06-26 14:29:50 +00:00
|
|
|
// By default Interactive tests are enabled
|
2010-06-17 11:23:51 +00:00
|
|
|
// XXX: disabling these as of now for fastly testing other tests
|
2010-06-26 14:29:50 +00:00
|
|
|
// Testsuite::isInteractive = false;
|
2010-06-06 14:06:51 +00:00
|
|
|
|
2010-06-26 14:29:50 +00:00
|
|
|
if (Testsuite::isInteractive) {
|
2010-06-17 11:23:51 +00:00
|
|
|
printf("Running Interactive tests as well\n");
|
|
|
|
Testsuite::displayMessage(prompt, "proceed?");
|
2010-06-06 14:06:51 +00:00
|
|
|
// Executing GFX Tests
|
2010-06-17 11:23:51 +00:00
|
|
|
GFXTestSuite gts;
|
|
|
|
gts.execute();
|
2010-06-06 14:06:51 +00:00
|
|
|
}
|
2010-05-31 04:58:19 +00:00
|
|
|
|
2010-06-17 11:23:51 +00:00
|
|
|
FSTestSuite fts;
|
|
|
|
fts.execute();
|
2010-06-25 21:03:53 +00:00
|
|
|
|
|
|
|
SaveGameTestSuite sts;
|
|
|
|
sts.execute();
|
2010-06-17 11:23:51 +00:00
|
|
|
|
2010-05-24 17:43:55 +00:00
|
|
|
return Common::kNoError;
|
|
|
|
}
|
|
|
|
|
2010-05-31 04:58:19 +00:00
|
|
|
} // End of namespace Testbed
|