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
|
|
|
*
|
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-03-05 19:04:34 +00:00
|
|
|
*
|
2006-02-11 10:03:24 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-03-05 19:04:34 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-02-20 17:52:55 +00:00
|
|
|
#ifndef SKY_H
|
|
|
|
#define SKY_H
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2007-06-22 22:18:56 +00:00
|
|
|
#include "common/events.h"
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2003-03-05 19:04:34 +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
|
|
|
};
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
struct Compact;
|
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
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
class SkyEngine : public Engine {
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
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);
|
2003-10-05 20:21:20 +00:00
|
|
|
virtual ~SkyEngine();
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
static bool isDemo(void);
|
|
|
|
static bool isCDVersion(void);
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2008-11-12 20:41:19 +00:00
|
|
|
Common::Error loadGameState(int slot);
|
|
|
|
Common::Error saveGameState(int slot, const char *desc);
|
|
|
|
bool canLoadGameStateCurrently();
|
|
|
|
bool canSaveGameStateCurrently();
|
|
|
|
|
2004-12-15 06:48:08 +00:00
|
|
|
static void *fetchItem(uint32 num);
|
|
|
|
static void *_itemList[300];
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
static SystemVars _systemVars;
|
|
|
|
|
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();
|
|
|
|
virtual Common::Error run() {
|
|
|
|
Common::Error err;
|
|
|
|
err = init();
|
|
|
|
if (err != Common::kNoError)
|
|
|
|
return err;
|
|
|
|
return go();
|
|
|
|
}
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual GUI::Debugger *getDebugger();
|
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
|
|
|
|
2003-08-03 15:50:39 +00:00
|
|
|
byte _fastMode;
|
|
|
|
|
2004-12-16 04:22:32 +00:00
|
|
|
void delay(int32 amount);
|
2003-07-12 02:07:37 +00:00
|
|
|
void handleKey(void);
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-07-11 22:19:16 +00:00
|
|
|
uint32 _lastSaveTime;
|
2003-04-28 14:47:39 +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-03-11 18:32:58 +00:00
|
|
|
static void timerHandler(void *ptr);
|
2003-05-14 22:33:39 +00:00
|
|
|
void gotTimerTick();
|
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
|