diff options
Diffstat (limited to 'engines/lilliput/lilliput.cpp')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp new file mode 100644 index 0000000000..befec749b7 --- /dev/null +++ b/engines/lilliput/lilliput.cpp @@ -0,0 +1,113 @@ +/* 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. + * + */ + +#include "common/system.h" +#include "common/random.h" +#include "common/error.h" +#include "common/events.h" +#include "common/debug-channels.h" +#include "common/config-manager.h" +#include "common/textconsole.h" + +#include "lilliput/lilliput.h" + +#include "engines/util.h" + +namespace Lilliput { + +LilliputEngine *LilliputEngine::s_Engine = 0; + +LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) : Engine(syst), _gameDescription(gd) +{ + _system = syst; + DebugMan.addDebugChannel(kDebugSchedule, "Schedule", "Script Schedule debug level"); + DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level"); + DebugMan.addDebugChannel(kDebugDisplay, "Display", "Display debug level"); + DebugMan.addDebugChannel(kDebugMouse, "Mouse", "Mouse debug level"); + DebugMan.addDebugChannel(kDebugParser, "Parser", "Parser debug level"); + DebugMan.addDebugChannel(kDebugFile, "File", "File IO debug level"); + DebugMan.addDebugChannel(kDebugRoute, "Route", "Route debug level"); + DebugMan.addDebugChannel(kDebugInventory, "Inventory", "Inventory debug level"); + DebugMan.addDebugChannel(kDebugObject, "Object", "Object debug level"); + DebugMan.addDebugChannel(kDebugMusic, "Music", "Music debug level"); + + _console = new LilliputConsole(this); + _rnd = 0; +} + +LilliputEngine::~LilliputEngine() { + + DebugMan.clearAllDebugChannels(); + delete _console; + delete _rnd; +} + +GUI::Debugger *LilliputEngine::getDebugger() { + return _console; +} + +bool LilliputEngine::hasFeature(EngineFeature f) const { + return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime); +} + +const char *LilliputEngine::getCopyrightString() const { + return "Copyright 1989-1997 David P Gray, All Rights Reserved."; +} + +GameType LilliputEngine::getGameType() const { + return _gameType; +} + +Common::Platform LilliputEngine::getPlatform() const { + return _platform; +} + +Common::Error LilliputEngine::run() { + s_Engine = this; + initGraphics(320, 200); + + // Setup mixer + syncSoundSettings(); + + return Common::kNoError; +} + +void LilliputEngine::initialize() { + debugC(1, kDebugEngine, "initialize"); + + _rnd = new Common::RandomSource("robin"); + _rnd->setSeed(42); // Kick random number generator +} + +void LilliputEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + +// _sound->syncVolume(); +} + +Common::String LilliputEngine::getSavegameFilename(int slot) { + return _targetName + Common::String::format("-%02d.SAV", slot); +} + + + +} // End of namespace Lilliput |