ScummVM API documentation
game.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef LURE_GAME_H
23 #define LURE_GAME_H
24 
25 
26 #include "common/config-manager.h"
27 #include "engines/engine.h"
28 #include "lure/luredefs.h"
29 #include "lure/menu.h"
30 #include "lure/palette.h"
31 #include "lure/disk.h"
32 #include "lure/memory.h"
33 #include "lure/screen.h"
34 #include "lure/events.h"
35 #include "lure/debugger.h"
36 
37 namespace Lure {
38 
39 enum GameState {GS_ERROR = 1, GS_TICK = 2, GS_TOCK = 4, GS_PROT = 8, GS_RESTART = 0x10,
40  GS_CAUGHT = 0x20, GS_RESTORE = 0x40, GS_FLOPPY = 0x80,
41  GS_RESTORE_RESTART = 0x50};
42 
43 class Game {
44 private:
45  bool _fastTextFlag, _soundFlag;
46  uint8 _state;
47  uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1];
48  int _numTellCommands;
49  bool _preloadFlag;
50  bool _debugFlag;
51 
52  void handleMenuResponse(uint8 selection);
53  void handleClick();
54  void handleRightClickMenu();
55  void handleLeftClick();
56  bool GetTellActions();
57  void doAction(Action action, uint16 hotspotId, uint16 usedId);
58 
59  void playerChangeRoom();
60  void displayChuteAnimation();
61  void displayBarrelAnimation();
62  void handleBootParam(int value);
63  bool getYN();
64  bool isMenuAvailable();
65 public:
66  Game();
67  virtual ~Game();
68 
69  static bool isCreated();
70  static Game &getReference();
71  void saveToStream(Common::WriteStream *stream);
72  void loadFromStream(Common::ReadStream *stream);
73 
74  void tick();
75  void tickCheck();
76  void nextFrame();
77  void execute();
78  void setState(uint8 flags) { _state = flags; }
79  bool &preloadFlag() { return _preloadFlag; }
80  bool &debugFlag() { return _debugFlag; }
81  bool fastTextFlag() { return _fastTextFlag; }
82  bool soundFlag() { return _soundFlag; }
83 
84  // Menu item support methods
85  void doDebugMenu();
86  void doShowCredits();
87  void doQuit();
88  void doRestart();
89  void doTextSpeed();
90  void doSound();
91 };
92 
93 } // End of namespace Lure
94 
95 #endif
Definition: stream.h:77
Definition: game.h:43
Definition: stream.h:385
Definition: animseq.h:27