2013-06-18 15:52:25 +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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2013-09-07 07:00:34 +00:00
|
|
|
#ifndef AVALANCHE_AVALANCHE_H
|
|
|
|
#define AVALANCHE_AVALANCHE_H
|
2013-06-18 15:52:25 +00:00
|
|
|
|
|
|
|
#include "avalanche/console.h"
|
2013-07-24 15:02:08 +00:00
|
|
|
#include "avalanche/graphics.h"
|
2013-07-27 19:36:07 +00:00
|
|
|
#include "avalanche/parser.h"
|
2013-06-29 08:20:22 +00:00
|
|
|
#include "avalanche/avalot.h"
|
2013-09-15 11:03:21 +00:00
|
|
|
#include "avalanche/pingo.h"
|
2013-09-21 16:06:37 +00:00
|
|
|
#include "avalanche/dialogs.h"
|
2013-09-19 18:53:47 +00:00
|
|
|
#include "avalanche/background.h"
|
2013-09-15 11:03:21 +00:00
|
|
|
#include "avalanche/sequence.h"
|
2013-09-08 09:30:23 +00:00
|
|
|
#include "avalanche/timer.h"
|
2013-09-07 17:09:06 +00:00
|
|
|
#include "avalanche/animation.h"
|
2013-09-18 05:47:52 +00:00
|
|
|
#include "avalanche/menu.h"
|
2013-09-15 11:03:21 +00:00
|
|
|
#include "avalanche/closing.h"
|
2013-09-18 21:59:26 +00:00
|
|
|
#include "avalanche/sound.h"
|
2013-06-20 12:08:58 +00:00
|
|
|
|
2013-08-19 16:18:02 +00:00
|
|
|
#include "common/serializer.h"
|
|
|
|
|
2013-06-20 12:08:58 +00:00
|
|
|
#include "engines/engine.h"
|
2013-06-18 15:52:25 +00:00
|
|
|
#include "engines/advancedDetector.h"
|
|
|
|
|
2013-08-16 11:00:00 +00:00
|
|
|
#include "graphics/cursorman.h"
|
|
|
|
|
2013-06-18 15:52:25 +00:00
|
|
|
namespace Common {
|
|
|
|
class RandomSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Avalanche {
|
|
|
|
|
2013-06-20 06:32:58 +00:00
|
|
|
struct AvalancheGameDescription;
|
|
|
|
|
2013-06-18 15:52:25 +00:00
|
|
|
static const int kSavegameVersion = 1;
|
|
|
|
|
|
|
|
class AvalancheEngine : public Engine {
|
|
|
|
public:
|
2013-09-22 15:45:48 +00:00
|
|
|
byte _saveNum; // number of times this game has been saved
|
2013-07-11 16:02:15 +00:00
|
|
|
|
2013-07-24 16:12:16 +00:00
|
|
|
Avalot *_avalot;
|
2013-09-22 15:45:48 +00:00
|
|
|
Graphics *_graphics;
|
|
|
|
Parser *_parser;
|
2013-07-24 16:50:13 +00:00
|
|
|
Pingo *_pingo;
|
2013-09-21 16:06:37 +00:00
|
|
|
Dialogs *_dialogs;
|
2013-09-19 18:53:47 +00:00
|
|
|
Background *_background;
|
2013-07-24 17:43:10 +00:00
|
|
|
Sequence *_sequence;
|
2013-09-08 09:30:23 +00:00
|
|
|
Timer *_timer;
|
2013-09-07 17:09:06 +00:00
|
|
|
Animation *_animation;
|
2013-09-18 05:47:52 +00:00
|
|
|
Menu *_menu;
|
2013-07-24 17:43:10 +00:00
|
|
|
Closing *_closing;
|
2013-09-18 21:59:26 +00:00
|
|
|
SoundHandler *_sound;
|
2013-06-28 10:27:14 +00:00
|
|
|
|
2013-07-24 15:52:57 +00:00
|
|
|
OSystem *_system;
|
|
|
|
|
2013-06-20 06:32:58 +00:00
|
|
|
AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
|
2013-06-18 15:52:25 +00:00
|
|
|
~AvalancheEngine();
|
|
|
|
|
2013-09-07 07:00:34 +00:00
|
|
|
Common::ErrorCode initialize();
|
2013-06-18 15:52:25 +00:00
|
|
|
GUI::Debugger *getDebugger();
|
|
|
|
|
|
|
|
Common::RandomSource *_rnd;
|
2013-09-07 07:00:34 +00:00
|
|
|
|
2013-06-20 06:32:58 +00:00
|
|
|
const AvalancheGameDescription *_gameDescription;
|
2013-06-18 15:52:25 +00:00
|
|
|
uint32 getFeatures() const;
|
|
|
|
const char *getGameId() const;
|
|
|
|
Common::Platform getPlatform() const;
|
|
|
|
bool hasFeature(EngineFeature f) const;
|
|
|
|
const char *getCopyrightString() const;
|
|
|
|
|
2013-08-19 16:18:02 +00:00
|
|
|
void synchronize(Common::Serializer &sz);
|
2013-08-18 13:08:32 +00:00
|
|
|
virtual bool canSaveGameStateCurrently();
|
|
|
|
Common::Error saveGameState(int slot, const Common::String &desc);
|
2013-08-19 16:18:02 +00:00
|
|
|
bool saveGame(const int16 slot, const Common::String &desc);
|
2013-08-19 19:14:21 +00:00
|
|
|
Common::String getSaveFileName(const int slot);
|
2013-08-18 13:08:32 +00:00
|
|
|
virtual bool canLoadGameStateCurrently();
|
2013-08-19 19:14:21 +00:00
|
|
|
Common::Error loadGameState(int slot);
|
|
|
|
bool loadGame(const int16 slot);
|
2013-08-20 17:23:24 +00:00
|
|
|
Common::String expandDate(int d, int m, int y);
|
|
|
|
|
2013-08-18 13:08:32 +00:00
|
|
|
void updateEvents();
|
2013-08-19 16:18:02 +00:00
|
|
|
bool getEvent(Common::Event &event); // A wrapper around _eventMan->pollEvent(), so we can use it in Scrolls::normscroll() for example.
|
2013-08-16 15:29:22 +00:00
|
|
|
Common::Point getMousePos();
|
|
|
|
|
2013-06-18 15:52:25 +00:00
|
|
|
protected:
|
|
|
|
// Engine APIs
|
|
|
|
Common::Error run();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static AvalancheEngine *s_Engine;
|
|
|
|
|
|
|
|
AvalancheConsole *_console;
|
|
|
|
Common::Platform _platform;
|
|
|
|
|
2013-09-20 05:35:50 +00:00
|
|
|
#if 0
|
2013-06-19 14:59:12 +00:00
|
|
|
struct {
|
2013-09-03 10:09:29 +00:00
|
|
|
byte _operation;
|
|
|
|
uint16 _skellern;
|
|
|
|
byte _contents[1000];
|
2013-06-19 14:59:12 +00:00
|
|
|
} _storage;
|
|
|
|
|
2013-09-20 05:35:50 +00:00
|
|
|
static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
|
|
|
|
static const int16 kReset = 0;
|
2013-06-19 14:59:12 +00:00
|
|
|
|
2013-09-20 05:35:50 +00:00
|
|
|
static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false;
|
2013-09-09 21:00:24 +00:00
|
|
|
|
2013-09-09 21:34:12 +00:00
|
|
|
// From bootstrp:
|
|
|
|
enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
|
|
|
|
|
2013-09-20 05:02:18 +00:00
|
|
|
Common::String _argsWithNoFilename;
|
2013-09-09 21:00:24 +00:00
|
|
|
byte _originalMode;
|
|
|
|
byte *_old1c;
|
|
|
|
Common::String _segofs;
|
|
|
|
int32 _soundcard, _speed, _baseaddr, _irq, _dma;
|
2013-09-20 05:35:50 +00:00
|
|
|
bool _zoomy;
|
2013-09-09 21:00:24 +00:00
|
|
|
|
2013-09-09 21:34:12 +00:00
|
|
|
void run(Common::String what, bool withJsb, bool withBflight, Elm how);
|
2013-09-20 05:35:50 +00:00
|
|
|
void bFlightOn();
|
2013-09-09 21:00:24 +00:00
|
|
|
void bFlightOff();
|
|
|
|
Common::String elmToStr(Elm how);
|
2013-09-03 10:09:29 +00:00
|
|
|
bool keyPressed();
|
|
|
|
void flushBuffer();
|
2013-09-09 21:00:24 +00:00
|
|
|
void dosShell();
|
|
|
|
void bFlight();
|
|
|
|
Common::String commandCom();
|
|
|
|
void explain(byte error);
|
|
|
|
void cursorOff();
|
|
|
|
void cursorOn();
|
|
|
|
void quit();
|
|
|
|
#endif
|
2013-06-18 15:52:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Avalanche
|
|
|
|
|
2013-09-07 07:00:34 +00:00
|
|
|
#endif // AVALANCHE_AVALANCHE_H
|