ScummVM API documentation
dark.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 namespace Freescape {
23 
24 enum {
25  kVariableDarkEnding = 28,
26  kVariableDarkECD = 29,
27  kVariableActiveECDs = 60,
28 };
29 
30 enum {
31  kDarkEndingEvathDestroyed = 1,
32  kDarkEndingECDsDestroyed = 2,
33 };
34 
35 struct ECD {
36  uint16 _area;
37  int _id;
38 };
39 
40 enum DarkFontSize {
41  kDarkFontSmall,
42  kDarkFontMedium,
43  kDarkFontBig,
44 };
45 
46 class DarkEngine : public FreescapeEngine {
47 public:
48  DarkEngine(OSystem *syst, const ADGameDescription *gd);
49 
50  uint32 _initialEnergy;
51  uint32 _initialShield;
52  uint32 _jetFuelSeconds;
53  void addSkanner(Area *area);
54 
55  void initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *infoScreenKeyMap, const char *target) override;
56  void initGameState() override;
57  void borderScreen() override;
58  bool checkIfGameEnded() override;
59  void endGame() override;
60 
61  void gotoArea(uint16 areaID, int entranceID) override;
62  void pressedKey(const int keycode) override;
63  void executePrint(FCLInstruction &instruction) override;
64 
65  void initDOS();
66  void initAmigaAtari();
67  void initZX();
68  void initCPC();
69 
70  void loadAssets() override;
71  void loadAssetsDOSFullGame() override;
72  void loadAssetsDOSDemo() override;
73  void loadAssetsAmigaFullGame() override;
74  void loadAssetsAtariFullGame() override;
75 
76  void loadAssetsCPCFullGame() override;
77 
78  void loadAssetsZXDemo() override;
79  void loadAssetsZXFullGame() override;
80  void loadMessagesVariableSize(Common::SeekableReadStream *file, int offset, int number) override;
81 
82  int _lastTenSeconds;
83  int _lastSecond;
84  void updateTimeVariables() override;
85 
86  void drawBinaryClock(Graphics::Surface *surface, int xPosition, int yPosition, uint32 front, uint32 back);
87  void drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition);
88 
89  void drawSensorShoot(Sensor *sensor) override;
90  void drawDOSUI(Graphics::Surface *surface) override;
91  void drawZXUI(Graphics::Surface *surface) override;
92  void drawCPCUI(Graphics::Surface *surface) override;
93  void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
94 
95  Common::BitArray _fontBig;
96  Common::BitArray _fontMedium;
97  Common::BitArray _fontSmall;
98 
99  int _soundIndexRestoreECD;
100 
101  void drawString(const DarkFontSize size, const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface);
102  void drawInfoMenu() override;
103 
104  Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
105  Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
106 
107 private:
108  void addECDs(Area *area);
109  void addECD(Area *area, const Math::Vector3d position, int index);
110  void restoreECD(Area &area, int index);
111  bool checkECD(uint16 areaID, int index);
112  bool tryDestroyECD(int index);
113  bool tryDestroyECDFullGame(int index);
114  void addWalls(Area *area);
115  Common::HashMap<uint16, bool> _exploredAreas;
116 };
117 
118 }
Definition: keymap.h:66
Definition: str.h:59
Definition: surface.h:67
Definition: stream.h:77
Definition: error.h:84
Definition: area.h:36
Definition: advancedDetector.h:163
Definition: area.h:40
Definition: stream.h:745
Definition: freescape.h:148
Definition: sensor.h:34
Definition: bitarray.h:29
Definition: dark.h:35
Definition: system.h:161
Definition: instruction.h:36
Definition: dark.h:46