From d53f5d9885b99e0b109489585e13acf95e832837 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Jun 2013 17:52:25 +0200 Subject: AVALANCHE: Add skeleton. --- engines/avalanche/avalanche.cpp | 101 ++++++++++++++++++++++++++++++++++++++++ engines/avalanche/avalanche.h | 83 +++++++++++++++++++++++++++++++++ engines/avalanche/console.cpp | 39 ++++++++++++++++ engines/avalanche/console.h | 54 +++++++++++++++++++++ engines/avalanche/module.mk | 2 + 5 files changed, 279 insertions(+) create mode 100644 engines/avalanche/avalanche.cpp create mode 100644 engines/avalanche/avalanche.h create mode 100644 engines/avalanche/console.cpp create mode 100644 engines/avalanche/console.h diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp new file mode 100644 index 0000000000..d9599b7308 --- /dev/null +++ b/engines/avalanche/avalanche.cpp @@ -0,0 +1,101 @@ +/* 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. + * + */ + +/* + * This code is based on the original source code of Lord Avalot d'Argent version 1.3. + * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. + */ + +#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 "avalanche/avalanche.h" + +#include "engines/util.h" + +namespace Avalanche { + + AvalancheEngine *AvalancheEngine::s_Engine = 0; + + AvalancheEngine::AvalancheEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst), _gameDescription(gd) { + _system = syst; + _console = new AvalancheConsole(this); + _rnd = 0; + } + + AvalancheEngine::~AvalancheEngine() { + delete _console; + delete _rnd; + } + + GUI::Debugger *AvalancheEngine::getDebugger() { + return _console; + } + + Common::Platform AvalancheEngine::getPlatform() const { + return _platform; + } + + bool AvalancheEngine::hasFeature(EngineFeature f) const { + return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime); + } + + const char *AvalancheEngine::getCopyrightString() const { + return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman."; + } + + Common::String AvalancheEngine::getSavegameFilename(int slot) { + return _targetName + Common::String::format("-%02d.SAV", slot); + } + + void AvalancheEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + // _sound->syncVolume(); + } + + Common::Error AvalancheEngine::run() { + s_Engine = this; + initGraphics(320, 200, false); + _console = new AvalancheConsole(this); + + // _mouse = new MouseHandler(this); + + // Setup mixer + syncSoundSettings(); + + return Common::kNoError; + } + + void AvalancheEngine::initialize() { + //debugC(1, kDebugEngine, "initialize"); + + _rnd = new Common::RandomSource("avalanche"); + _rnd->setSeed(42); // Kick random number generator + } + +} // End of namespace Avalanche diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h new file mode 100644 index 0000000000..13d20d00a4 --- /dev/null +++ b/engines/avalanche/avalanche.h @@ -0,0 +1,83 @@ +/* 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. + * + */ + +/* + * This code is based on the original source code of Lord Avalot d'Argent version 1.3. + * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. + */ + +#ifndef AVALANCHE_H +#define AVALANCHE_H + +#include "engines/engine.h" +#include "avalanche/console.h" +#include "engines/advancedDetector.h" + +namespace Common { +class RandomSource; +} + +namespace Avalanche { + +static const int kSavegameVersion = 1; + +class AvalancheEngine : public Engine { +public: + AvalancheEngine(OSystem *syst, const ADGameDescription *gd); + ~AvalancheEngine(); + + OSystem *_system; + + GUI::Debugger *getDebugger(); + + Common::RandomSource *_rnd; + + const ADGameDescription *_gameDescription; + uint32 getFeatures() const; + const char *getGameId() const; + + void initGame(const ADGameDescription *gd); + + Common::Platform getPlatform() const; + + bool hasFeature(EngineFeature f) const; + const char *getCopyrightString() const; + + Common::String getSavegameFilename(int slot); + void syncSoundSettings(); + +protected: + // Engine APIs + Common::Error run(); + +private: + static AvalancheEngine *s_Engine; + + AvalancheConsole *_console; + Common::Platform _platform; + + void initialize(); +}; + +} // End of namespace Avalanche + +#endif // AVALANCHE_H diff --git a/engines/avalanche/console.cpp b/engines/avalanche/console.cpp new file mode 100644 index 0000000000..03f198fbf5 --- /dev/null +++ b/engines/avalanche/console.cpp @@ -0,0 +1,39 @@ +/* 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. + * + */ + +/* + * This code is based on the original source code of Lord Avalot d'Argent version 1.3. + * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. + */ + +#include "avalanche/console.h" +#include "avalanche/avalanche.h" + +namespace Avalanche { + + AvalancheConsole::AvalancheConsole(AvalancheEngine *vm) : GUI::Debugger(), _vm(vm) { + } + + AvalancheConsole::~AvalancheConsole() { + } + +} // End of namespace Avalanche diff --git a/engines/avalanche/console.h b/engines/avalanche/console.h new file mode 100644 index 0000000000..91b77d4365 --- /dev/null +++ b/engines/avalanche/console.h @@ -0,0 +1,54 @@ +/* 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. + * + */ + +/* + * This code is based on the original source code of Lord Avalot d'Argent version 1.3. + * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. + */ + +#ifndef AVALANCHE_CONSOLE_H +#define AVALANCHE_CONSOLE_H + +#include "gui/debugger.h" + +namespace Avalanche { + + class AvalancheEngine; + + class AvalancheConsole : public GUI::Debugger { + public: + AvalancheConsole(AvalancheEngine *vm); + virtual ~AvalancheConsole(void); + + private: + AvalancheEngine *_vm; + bool Cmd_listScreens(int argc, const char **argv); + bool Cmd_listObjects(int argc, const char **argv); + bool Cmd_getObject(int argc, const char **argv); + bool Cmd_getAllObjects(int argc, const char **argv); + bool Cmd_gotoScreen(int argc, const char **argv); + bool Cmd_boundaries(int argc, const char **argv); + }; + +} // End of namespace Avalanche + +#endif // AVALANCHE_CONSOLE_H diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk index 1240051640..cd14820949 100644 --- a/engines/avalanche/module.mk +++ b/engines/avalanche/module.mk @@ -9,6 +9,7 @@ MODULE_OBJS = \ andexor2.o \ andextst.o \ arch.o \ + avalanche.o \ avalot9.o \ avbkgrnd.o \ avmenu.o \ @@ -46,6 +47,7 @@ MODULE_OBJS = \ chunkxfl.o \ clock.o \ closing.o \ + console.o \ convert.o \ convmous.o \ credits.o \ -- cgit v1.2.3