2007-05-30 21:56:52 +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.
|
2003-03-05 19:04:34 +00:00
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-02-18 02:34:25 +01:00
|
|
|
*
|
2003-03-05 19:04:34 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:25 +01:00
|
|
|
*
|
2003-03-05 19:04:34 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-03-05 19:04:34 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-05-17 18:20:01 +02:00
|
|
|
#ifndef SKY_SKY_H
|
|
|
|
#define SKY_SKY_H
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2011-04-24 11:34:27 +03:00
|
|
|
#include "common/error.h"
|
|
|
|
#include "common/keyboard.h"
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the Sky engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: ???
|
|
|
|
*
|
2010-10-15 12:48:19 +00:00
|
|
|
* Games using this engine:
|
|
|
|
* - Beneath a Steel Sky
|
2009-11-24 22:10:14 +00:00
|
|
|
*/
|
2004-01-03 01:58:58 +00:00
|
|
|
namespace Sky {
|
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
struct SystemVars {
|
|
|
|
uint32 systemFlags;
|
|
|
|
uint32 gameVersion;
|
|
|
|
uint32 mouseFlag;
|
|
|
|
uint16 language;
|
2003-06-27 02:54:05 +00:00
|
|
|
uint32 currentPalette;
|
|
|
|
uint16 gameSpeed;
|
2003-07-09 18:12:58 +00:00
|
|
|
uint16 currentMusic;
|
2003-07-02 01:46:25 +00:00
|
|
|
bool pastIntro;
|
2005-04-01 07:33:39 +00:00
|
|
|
bool paused;
|
2003-06-01 21:21:10 +00:00
|
|
|
};
|
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
class Sound;
|
|
|
|
class Disk;
|
|
|
|
class Text;
|
|
|
|
class Logic;
|
|
|
|
class Mouse;
|
|
|
|
class Screen;
|
|
|
|
class Control;
|
|
|
|
class MusicBase;
|
2004-09-13 17:05:23 +00:00
|
|
|
class Debugger;
|
2004-12-15 06:48:08 +00:00
|
|
|
class SkyCompact;
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2020-02-01 19:50:03 +01:00
|
|
|
enum SkyAction {
|
|
|
|
kSkyActionNone,
|
|
|
|
kSkyActionToggleFastMode,
|
|
|
|
kSkyActionToggleReallyFastMode,
|
|
|
|
kSkyActionOpenControlPanel,
|
|
|
|
kSkyActionConfirm,
|
|
|
|
kSkyActionSkip,
|
|
|
|
kSkyActionSkipLine,
|
|
|
|
kSkyActionPause
|
|
|
|
};
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
class SkyEngine : public Engine {
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2020-02-01 19:50:03 +01:00
|
|
|
SkyAction _action;
|
2007-06-22 22:18:56 +00:00
|
|
|
Common::KeyState _keyPressed;
|
2003-07-05 00:57:03 +00:00
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
Sound *_skySound;
|
|
|
|
Disk *_skyDisk;
|
|
|
|
Text *_skyText;
|
|
|
|
Logic *_skyLogic;
|
|
|
|
Mouse *_skyMouse;
|
|
|
|
Screen *_skyScreen;
|
|
|
|
Control *_skyControl;
|
2004-12-15 06:48:08 +00:00
|
|
|
SkyCompact *_skyCompact;
|
2004-09-13 17:05:23 +00:00
|
|
|
Debugger *_debugger;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
MusicBase *_skyMusic;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
public:
|
2006-02-12 01:42:34 +00:00
|
|
|
SkyEngine(OSystem *syst);
|
2020-02-09 12:05:32 +01:00
|
|
|
~SkyEngine() override;
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void syncSoundSettings() override;
|
2011-03-19 15:08:59 +01:00
|
|
|
|
2009-11-02 21:54:57 +00:00
|
|
|
static bool isDemo();
|
|
|
|
static bool isCDVersion();
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2020-02-05 16:14:36 +01:00
|
|
|
Common::Error loadGameState(int slot) override;
|
2020-02-04 22:13:33 -08:00
|
|
|
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
|
2020-02-05 16:14:36 +01:00
|
|
|
bool canLoadGameStateCurrently() override;
|
|
|
|
bool canSaveGameStateCurrently() override;
|
2021-11-13 23:20:07 +02:00
|
|
|
Common::String getSaveStateName(int slot) const override {
|
2020-02-05 21:58:44 -08:00
|
|
|
return Common::String::format("SKY-VM.%03d", slot);
|
|
|
|
}
|
2008-11-12 20:41:19 +00:00
|
|
|
|
2004-12-15 06:48:08 +00:00
|
|
|
static void *fetchItem(uint32 num);
|
|
|
|
static void *_itemList[300];
|
2020-07-29 17:25:26 +03:00
|
|
|
static SystemVars *_systemVars;
|
2020-02-01 19:50:03 +01:00
|
|
|
static const char *shortcutsKeymapId;
|
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2008-11-04 16:11:40 +00:00
|
|
|
// Engine APIs
|
2009-03-01 04:30:55 +00:00
|
|
|
Common::Error init();
|
|
|
|
Common::Error go();
|
2020-02-09 12:05:32 +01:00
|
|
|
Common::Error run() override {
|
2009-03-01 04:30:55 +00:00
|
|
|
Common::Error err;
|
|
|
|
err = init();
|
2011-04-18 17:39:31 +02:00
|
|
|
if (err.getCode() != Common::kNoError)
|
2009-03-01 04:30:55 +00:00
|
|
|
return err;
|
|
|
|
return go();
|
|
|
|
}
|
2020-02-09 07:15:07 -08:00
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
bool hasFeature(EngineFeature f) const override;
|
2008-11-04 16:11:40 +00:00
|
|
|
|
2003-08-03 15:50:39 +00:00
|
|
|
byte _fastMode;
|
|
|
|
|
2004-12-16 04:22:32 +00:00
|
|
|
void delay(int32 amount);
|
2009-11-02 21:54:57 +00:00
|
|
|
void handleKey();
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-04-05 18:01:29 +00:00
|
|
|
void initItemList();
|
2003-05-14 22:33:39 +00:00
|
|
|
|
2003-03-07 14:52:24 +00:00
|
|
|
void initVirgin();
|
2003-05-01 14:10:42 +00:00
|
|
|
void loadFixedItems();
|
2003-03-05 19:04:34 +00:00
|
|
|
};
|
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
} // End of namespace Sky
|
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
#endif
|