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