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.
|
2006-02-11 12:54:56 +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.
|
2014-02-18 01:34:22 +00:00
|
|
|
*
|
2006-02-11 12:54:56 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2006-02-11 12:54:56 +00:00
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:22 +00:00
|
|
|
*
|
2006-02-11 12:54:56 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-07-23 15:32:14 +00:00
|
|
|
#ifndef LURE_GAME_H
|
|
|
|
#define LURE_GAME_H
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2008-07-15 22:54:39 +00:00
|
|
|
#include "common/config-manager.h"
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
#include "lure/luredefs.h"
|
|
|
|
#include "lure/menu.h"
|
|
|
|
#include "lure/palette.h"
|
|
|
|
#include "lure/disk.h"
|
|
|
|
#include "lure/memory.h"
|
|
|
|
#include "lure/screen.h"
|
|
|
|
#include "lure/events.h"
|
2006-07-08 08:39:42 +00:00
|
|
|
#include "lure/debugger.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
namespace Lure {
|
|
|
|
|
2007-08-12 11:15:06 +00:00
|
|
|
enum GameState {GS_ERROR = 1, GS_TICK = 2, GS_TOCK = 4, GS_PROT = 8, GS_RESTART = 0x10,
|
|
|
|
GS_CAUGHT = 0x20, GS_RESTORE = 0x40, GS_FLOPPY = 0x80,
|
|
|
|
GS_RESTORE_RESTART = 0x50};
|
2006-05-23 12:41:28 +00:00
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
class Game {
|
|
|
|
private:
|
2007-10-24 10:01:55 +00:00
|
|
|
bool _fastTextFlag, _soundFlag;
|
2006-05-23 12:41:28 +00:00
|
|
|
uint8 _state;
|
2007-02-09 10:54:55 +00:00
|
|
|
uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1];
|
|
|
|
int _numTellCommands;
|
2007-08-12 11:15:06 +00:00
|
|
|
bool _preloadFlag;
|
2008-01-07 03:53:30 +00:00
|
|
|
bool _debugFlag;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
void handleMenuResponse(uint8 selection);
|
2006-02-19 04:29:26 +00:00
|
|
|
void handleClick();
|
2006-02-11 12:54:56 +00:00
|
|
|
void handleRightClickMenu();
|
|
|
|
void handleLeftClick();
|
2006-08-27 11:47:03 +00:00
|
|
|
bool GetTellActions();
|
2006-04-29 11:22:05 +00:00
|
|
|
void doAction(Action action, uint16 hotspotId, uint16 usedId);
|
2006-04-11 10:48:28 +00:00
|
|
|
|
|
|
|
void playerChangeRoom();
|
2007-01-31 02:34:55 +00:00
|
|
|
void displayChuteAnimation();
|
|
|
|
void displayBarrelAnimation();
|
2006-07-08 08:39:42 +00:00
|
|
|
void handleBootParam(int value);
|
2007-08-25 06:08:02 +00:00
|
|
|
bool getYN();
|
2007-12-28 11:07:35 +00:00
|
|
|
bool isMenuAvailable();
|
2006-02-11 12:54:56 +00:00
|
|
|
public:
|
|
|
|
Game();
|
2006-07-08 08:39:42 +00:00
|
|
|
virtual ~Game();
|
|
|
|
|
2010-01-05 05:25:18 +00:00
|
|
|
static bool isCreated();
|
2006-02-11 12:54:56 +00:00
|
|
|
static Game &getReference();
|
2010-01-19 23:48:55 +00:00
|
|
|
void saveToStream(Common::WriteStream *stream);
|
|
|
|
void loadFromStream(Common::ReadStream *stream);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2007-08-12 11:15:06 +00:00
|
|
|
void tick();
|
|
|
|
void tickCheck();
|
2006-02-11 12:54:56 +00:00
|
|
|
void nextFrame();
|
|
|
|
void execute();
|
2006-05-23 12:41:28 +00:00
|
|
|
void setState(uint8 flags) { _state = flags; }
|
2007-08-12 11:15:06 +00:00
|
|
|
bool &preloadFlag() { return _preloadFlag; }
|
2008-01-07 03:53:30 +00:00
|
|
|
bool &debugFlag() { return _debugFlag; }
|
2007-10-24 10:01:55 +00:00
|
|
|
bool fastTextFlag() { return _fastTextFlag; }
|
2007-10-25 10:39:19 +00:00
|
|
|
bool soundFlag() { return _soundFlag; }
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
// Menu item support methods
|
|
|
|
void doDebugMenu();
|
|
|
|
void doShowCredits();
|
|
|
|
void doQuit();
|
2007-08-25 06:08:02 +00:00
|
|
|
void doRestart();
|
2006-02-11 12:54:56 +00:00
|
|
|
void doTextSpeed();
|
|
|
|
void doSound();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Lure
|
|
|
|
|
|
|
|
#endif
|