ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
driller.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/audiostream.h"
23 #include "audio/mixer.h"
24 #include "audio/softsynth/sid.h"
25 
26 #include "engines/freescape/games/driller/c64.music.h"
27 
28 namespace Freescape {
29 
31 public:
32  DrillerEngine(OSystem *syst, const ADGameDescription *gd);
33  ~DrillerEngine();
34 
35  uint32 _initialJetEnergy;
36  uint32 _initialJetShield;
37 
38  uint32 _initialTankEnergy;
39  uint32 _initialTankShield;
40 
41  bool _useAutomaticDrilling;
42 
43  DrillerSIDPlayer *_playerSid;
44 
45  Common::HashMap<uint16, uint32> _drillStatusByArea;
46  Common::HashMap<uint16, uint32> _drillMaxScoreByArea;
47  Common::HashMap<uint16, uint32> _drillSuccessByArea;
48 
49  void initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *infoScreenKeyMap, const char *target) override;
50  void initGameState() override;
51  bool checkIfGameEnded() override;
52  void endGame() override;
53 
54  void gotoArea(uint16 areaID, int entranceID) override;
55 
56  void drawInfoMenu() override;
57  void drawSensorShoot(Sensor *sensor) override;
58  void drawCompass(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, double fov, uint32 color);
59 
60  void pressedKey(const int keycode) override;
61  Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
62  Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
63 
64 private:
65  bool drillDeployed(Area *area);
66  GeometricObject *_drillBase;
67  Math::Vector3d drillPosition();
68  void addDrill(const Math::Vector3d position, bool gasFound);
69  bool checkDrill(const Math::Vector3d position);
70  void removeDrill(Area *area);
71  void addSkanner(Area *area);
72 
73  void loadAssets() override;
74  void loadAssetsAtariFullGame() override;
75  void loadAssetsAtariDemo() override;
76  void loadAssetsAmigaFullGame() override;
77  void loadAssetsAmigaDemo() override;
78  void loadAssetsDOSFullGame() override;
79  void loadAssetsDOSDemo() override;
80  void loadAssetsZXFullGame() override;
81  void loadAssetsCPCFullGame() override;
82  void loadAssetsC64FullGame() override;
83 
84  void drawDOSUI(Graphics::Surface *surface) override;
85  void drawZXUI(Graphics::Surface *surface) override;
86  void drawCPCUI(Graphics::Surface *surface) override;
87  void drawC64UI(Graphics::Surface *surface) override;
88  void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
89  bool onScreenControls(Common::Point mouse) override;
90  void initAmigaAtari();
91  void initDOS();
92  void initZX();
93  void initCPC();
94  void initC64();
95 
96  void updateTimeVariables() override;
97 
98  Common::Rect _moveFowardArea;
99  Common::Rect _moveLeftArea;
100  Common::Rect _moveRightArea;
101  Common::Rect _moveBackArea;
102  Common::Rect _moveUpArea;
103  Common::Rect _moveDownArea;
104  Common::Rect _deployDrillArea;
105  Common::Rect _infoScreenArea;
106  Common::Rect _saveGameArea;
107  Common::Rect _loadGameArea;
108 
109  Graphics::ManagedSurface *load8bitTitleImage(Common::SeekableReadStream *file, int offset);
110  Graphics::ManagedSurface *load8bitDemoImage(Common::SeekableReadStream *file, int offset);
111 
112  uint32 getPixel8bitTitleImage(int index);
113  void renderPixels8bitTitleImage(Graphics::ManagedSurface *surface, int &i, int &j, int pixels);
114  Graphics::ManagedSurface *_borderExtra;
115  Texture *_borderExtraTexture;
116 
117  Common::SeekableReadStream *decryptFileAtari(const Common::Path &filename);
118 };
119 
120 enum DrillerReleaseFlags {
121  GF_AMIGA_MAGAZINE_DEMO = (1 << 0),
122  GF_ATARI_MAGAZINE_DEMO = (1 << 1),
123 };
124 
125 }
Definition: geometricobject.h:34
Definition: managed_surface.h:51
Definition: keymap.h:66
Definition: surface.h:67
Definition: stream.h:77
Definition: error.h:84
Definition: area.h:36
Definition: advancedDetector.h:163
Definition: rect.h:144
Definition: area.h:40
Definition: path.h:52
Definition: stream.h:745
Definition: freescape.h:159
Definition: c64.music.h:29
Definition: sensor.h:34
Definition: driller.h:30
Definition: rect.h:45
Definition: system.h:161
Definition: gfx.h:47