2009-06-01 18:05:46 +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
|
2009-07-08 19:17:47 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2009-06-01 18:05:46 +00:00
|
|
|
* 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.
|
2009-06-12 14:19:33 +00:00
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
2009-06-01 18:05:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ASYLUM_ENGINE_H
|
|
|
|
#define ASYLUM_ENGINE_H
|
|
|
|
|
|
|
|
#include "engines/engine.h"
|
2009-06-13 14:44:43 +00:00
|
|
|
|
2009-11-24 12:26:09 +00:00
|
|
|
#include "asylum/staticres.h"
|
2009-06-21 12:09:44 +00:00
|
|
|
#include "asylum/console.h"
|
2009-06-15 14:10:14 +00:00
|
|
|
#include "asylum/scene.h"
|
2009-06-14 14:23:53 +00:00
|
|
|
#include "asylum/menu.h"
|
2009-06-13 23:03:37 +00:00
|
|
|
#include "asylum/screen.h"
|
|
|
|
#include "asylum/sound.h"
|
2009-06-13 23:16:07 +00:00
|
|
|
#include "asylum/video.h"
|
2009-08-01 17:51:26 +00:00
|
|
|
#include "asylum/blowuppuzzle.h"
|
2009-08-07 12:03:23 +00:00
|
|
|
#include "asylum/encounters.h"
|
2009-06-05 02:51:23 +00:00
|
|
|
|
2009-06-01 18:05:46 +00:00
|
|
|
namespace Asylum {
|
|
|
|
|
2009-12-04 06:15:51 +00:00
|
|
|
static int32 g_object_x;
|
|
|
|
static int32 g_object_y;
|
|
|
|
|
2009-09-25 13:19:46 +00:00
|
|
|
// XXX
|
|
|
|
// If defined, this will play the scene title loading
|
|
|
|
// progress before the scene is entered. This is
|
|
|
|
// just a convenience, as there's no need for the type
|
|
|
|
// of pre-loading that was performed in the original
|
2009-11-11 09:51:36 +00:00
|
|
|
//#define SHOW_SCENE_LOADING
|
2009-09-25 01:05:23 +00:00
|
|
|
|
2009-12-03 21:35:28 +00:00
|
|
|
// XXX If defined, this flag will prevent the intro movies
|
|
|
|
// from being played whenever the engine is started
|
2009-12-04 06:15:51 +00:00
|
|
|
//#define SKIP_INTRO
|
2009-12-03 21:35:28 +00:00
|
|
|
|
2009-09-20 21:10:43 +00:00
|
|
|
// XXX
|
|
|
|
// I'm not sure if system endian-ness would have any
|
2009-09-25 13:19:46 +00:00
|
|
|
// effect on the byte order of the data files, but I guess
|
2009-09-20 21:10:43 +00:00
|
|
|
// it won't hurt to keep this here until we can test
|
|
|
|
// on a big-endian system
|
|
|
|
#ifndef SCUMM_BIG_ENDIAN
|
|
|
|
#define LOBYTE(word) (word & 0xFF)
|
|
|
|
#else
|
|
|
|
#define LOBYTE(word) ((word >> 24) & 0xFF)
|
|
|
|
#endif
|
|
|
|
|
2009-06-21 12:09:44 +00:00
|
|
|
class Console;
|
2009-06-15 14:10:14 +00:00
|
|
|
class Scene;
|
2009-06-14 14:23:53 +00:00
|
|
|
class MainMenu;
|
2009-06-12 22:42:45 +00:00
|
|
|
class Scene;
|
2009-06-05 02:51:23 +00:00
|
|
|
class Screen;
|
2009-06-13 23:03:37 +00:00
|
|
|
class Sound;
|
2009-06-13 23:16:07 +00:00
|
|
|
class Video;
|
2009-08-07 12:03:23 +00:00
|
|
|
class Encounter;
|
2009-07-06 23:35:54 +00:00
|
|
|
|
|
|
|
enum kDebugLevels {
|
2009-09-25 13:19:46 +00:00
|
|
|
kDebugLevelMain = 1 << 0,
|
2009-07-06 23:35:54 +00:00
|
|
|
kDebugLevelResources = 1 << 1,
|
2009-09-25 13:19:46 +00:00
|
|
|
kDebugLevelSprites = 1 << 2,
|
|
|
|
kDebugLevelInput = 1 << 3,
|
|
|
|
kDebugLevelMenu = 1 << 4,
|
|
|
|
kDebugLevelScripts = 1 << 5,
|
|
|
|
kDebugLevelSound = 1 << 6,
|
|
|
|
kDebugLevelSavegame = 1 << 7,
|
|
|
|
kDebugLevelScene = 1 << 8
|
2009-07-06 23:35:54 +00:00
|
|
|
};
|
2009-06-05 02:51:23 +00:00
|
|
|
|
2009-06-01 18:05:46 +00:00
|
|
|
class AsylumEngine: public Engine {
|
|
|
|
public:
|
|
|
|
|
2009-07-08 19:17:47 +00:00
|
|
|
AsylumEngine(OSystem *system, Common::Language language);
|
|
|
|
virtual ~AsylumEngine();
|
2009-06-05 02:51:23 +00:00
|
|
|
|
2009-11-27 02:02:00 +00:00
|
|
|
/** .text:0040F430
|
|
|
|
* Initalize the game environment
|
|
|
|
*/
|
2009-07-08 19:17:47 +00:00
|
|
|
Common::Error init();
|
2009-12-01 22:42:11 +00:00
|
|
|
|
|
|
|
/** .text:0041A500
|
|
|
|
* Start the game environment
|
|
|
|
*/
|
2009-07-08 19:17:47 +00:00
|
|
|
Common::Error go();
|
|
|
|
virtual Common::Error run();
|
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
2009-06-08 14:05:49 +00:00
|
|
|
|
2009-12-01 22:42:11 +00:00
|
|
|
/** .text:00415830
|
|
|
|
* Start a new the game
|
|
|
|
*/
|
|
|
|
void startGame();
|
|
|
|
|
2009-09-21 19:11:49 +00:00
|
|
|
void setGameFlag(int flag);
|
|
|
|
void clearGameFlag(int flag);
|
|
|
|
void toggleGameFlag(int flag);
|
|
|
|
bool isGameFlagSet(int flag);
|
|
|
|
bool isGameFlagNotSet(int flag);
|
|
|
|
|
2009-11-17 02:00:35 +00:00
|
|
|
/**
|
|
|
|
* Wrapper function to the OSystem getMillis() method
|
|
|
|
*/
|
2009-12-04 03:14:07 +00:00
|
|
|
int32 getTick() { return (int32)_system->getMillis(); }
|
2009-11-17 02:00:35 +00:00
|
|
|
|
2009-11-24 11:46:58 +00:00
|
|
|
/**
|
|
|
|
* This is the global tick counter.
|
|
|
|
*
|
|
|
|
* TODO rename?
|
|
|
|
*/
|
2009-11-17 02:00:35 +00:00
|
|
|
uint32 tempTick07;
|
|
|
|
|
2009-11-24 11:46:58 +00:00
|
|
|
Video* video() { return _video; }
|
|
|
|
Sound* sound() { return _sound; }
|
|
|
|
Screen* screen() { return _screen; }
|
|
|
|
Scene* scene() { return _scene;}
|
|
|
|
Text* text() { return _text; }
|
2009-09-21 19:11:49 +00:00
|
|
|
|
2009-06-21 12:09:44 +00:00
|
|
|
private:
|
2009-06-13 19:38:25 +00:00
|
|
|
void checkForEvent(bool doUpdate);
|
2009-06-13 13:40:48 +00:00
|
|
|
void waitForTimer(int msec_delay);
|
2009-06-13 13:56:13 +00:00
|
|
|
void updateMouseCursor();
|
2009-07-09 11:23:42 +00:00
|
|
|
void processDelayedEvents();
|
2009-12-01 22:42:11 +00:00
|
|
|
|
|
|
|
/** .text:0041B630
|
|
|
|
* Start a new the game
|
|
|
|
*/
|
2009-08-09 13:24:36 +00:00
|
|
|
void playIntro();
|
2009-06-12 20:38:38 +00:00
|
|
|
|
2009-09-25 13:19:46 +00:00
|
|
|
Common::Language _language;
|
2009-07-08 19:17:47 +00:00
|
|
|
Common::RandomSource _rnd;
|
2009-06-05 02:51:23 +00:00
|
|
|
|
2009-08-09 22:56:13 +00:00
|
|
|
bool _introPlaying;
|
|
|
|
|
2009-08-07 12:03:23 +00:00
|
|
|
Console *_console;
|
|
|
|
Scene *_scene;
|
|
|
|
MainMenu *_mainMenu;
|
|
|
|
Screen *_screen;
|
|
|
|
Sound *_sound;
|
|
|
|
Video *_video;
|
2009-09-25 01:05:23 +00:00
|
|
|
Text *_text;
|
2009-08-07 12:03:23 +00:00
|
|
|
Encounter *_encounter;
|
2009-06-21 12:09:44 +00:00
|
|
|
|
2009-09-19 14:25:43 +00:00
|
|
|
int _gameFlags[1512];
|
|
|
|
|
2009-06-21 12:09:44 +00:00
|
|
|
friend class Console;
|
2009-06-01 18:05:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Asylum
|
|
|
|
|
|
|
|
#endif
|