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