2003-03-05 19:04:34 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2003 The ScummVM project
|
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKYMAIN_H
|
|
|
|
#define SKYMAIN_H
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
#include "stdafx.h"
|
2003-09-18 02:07:18 +00:00
|
|
|
#include "base/engine.h"
|
2003-03-05 19:04:34 +00:00
|
|
|
|
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;
|
2003-07-06 21:33:22 +00:00
|
|
|
bool quitting;
|
2003-06-01 21:21:10 +00:00
|
|
|
};
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
struct Compact;
|
|
|
|
class SkySound;
|
|
|
|
class SkyDisk;
|
|
|
|
class SkyText;
|
2003-04-25 15:17:53 +00:00
|
|
|
class SkyLogic;
|
2003-10-05 20:21:20 +00:00
|
|
|
class SkyMouse;
|
2003-05-14 22:33:39 +00:00
|
|
|
class SkyScreen;
|
2003-06-22 21:42:59 +00:00
|
|
|
class SkyControl;
|
2003-10-05 20:21:20 +00:00
|
|
|
class SkyMusicBase;
|
2003-07-17 00:17:42 +00:00
|
|
|
class SkyIntro;
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
class SkyEngine : public Engine {
|
2003-03-07 15:38:11 +00:00
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2003-03-05 19:04:34 +00:00
|
|
|
byte _key_pressed;
|
2003-07-12 05:26:23 +00:00
|
|
|
bool _quickLaunch; // set when starting with -x
|
2003-07-05 00:57:03 +00:00
|
|
|
bool _floppyIntro;
|
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
uint16 _debugMode;
|
|
|
|
|
2003-03-07 14:52:24 +00:00
|
|
|
int _numScreenUpdates;
|
2003-03-05 19:04:34 +00:00
|
|
|
|
|
|
|
FILE *_dump_file;
|
|
|
|
|
|
|
|
int _number_of_savegames;
|
|
|
|
|
|
|
|
int _sdl_mouse_x, _sdl_mouse_y;
|
2003-03-08 12:46:51 +00:00
|
|
|
|
2003-04-29 20:13:00 +00:00
|
|
|
SkySound *_skySound;
|
2003-04-07 20:44:52 +00:00
|
|
|
SkyDisk *_skyDisk;
|
2003-04-25 15:17:53 +00:00
|
|
|
SkyText *_skyText;
|
|
|
|
SkyLogic *_skyLogic;
|
2003-05-05 13:19:59 +00:00
|
|
|
SkyMouse *_skyMouse;
|
2003-05-14 22:33:39 +00:00
|
|
|
SkyScreen *_skyScreen;
|
2003-06-22 21:42:59 +00:00
|
|
|
SkyControl *_skyControl;
|
2003-05-03 02:59:45 +00:00
|
|
|
|
|
|
|
SkyMusicBase *_skyMusic;
|
2003-07-17 00:17:42 +00:00
|
|
|
SkyIntro *_skyIntro;
|
2003-05-03 02:59:45 +00:00
|
|
|
GameDetector *_detector; // necessary for music
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
public:
|
2003-10-05 20:21:20 +00:00
|
|
|
SkyEngine(GameDetector *detector, OSystem *syst);
|
|
|
|
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
|
|
|
|
|
|
|
static Compact *fetchCompact(uint32 a);
|
2003-05-27 16:42:20 +00:00
|
|
|
static void **fetchItem(uint32 num);
|
2003-04-07 20:44:52 +00:00
|
|
|
|
2003-04-25 15:17:53 +00:00
|
|
|
static void **_itemList[300];
|
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
static SystemVars _systemVars;
|
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2003-08-03 15:50:39 +00:00
|
|
|
byte _fastMode;
|
|
|
|
|
2003-04-25 15:17:53 +00:00
|
|
|
void logic_engine();
|
2003-03-05 19:04:34 +00:00
|
|
|
void delay(uint amount);
|
|
|
|
void go();
|
2003-07-10 08:24:16 +00:00
|
|
|
void doCheat(uint8 num);
|
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-07 20:44:52 +00:00
|
|
|
SkyText *getSkyText();
|
2003-03-05 19:04:34 +00:00
|
|
|
void initialise();
|
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();
|
|
|
|
void loadBase0();
|
2003-03-11 18:32:58 +00:00
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
static int CDECL game_thread_proc(void *param);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|