ScummVM API documentation
eclipse.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 "common/file.h"
23 
24 #include "freescape/sound.h"
25 
26 namespace Freescape {
27 
28 enum EclipseReleaseFlags {
29  GF_ZX_DEMO_CRASH = (1 << 0),
30  GF_ZX_DEMO_MICROHOBBY = (1 << 1),
31 };
32 
33 enum {
34  kVariableEclipseAnkhs = 32,
35 };
36 
38 public:
39  EclipseEngine(OSystem *syst, const ADGameDescription *gd);
40 
41  void gotoArea(uint16 areaID, int entranceID) override;
42 
43  void borderScreen() override;
44  void titleScreen() override;
45  void drawInfoMenu() override;
46  void drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition, int separation);
47 
48  void drawSensorShoot(Sensor *sensor) override;
49 
50  void loadAssets() override;
51  void loadAssetsDOSFullGame() override;
52  void pressedKey(const int keycode) override;
53  void releasedKey(const int keycode) override;
54 
55  uint32 _initialEnergy;
56  uint32 _initialShield;
57 
58  int _soundIndexStartFalling;
59  int _soundIndexEndFalling;
60 
61  bool _resting;
62  int _lastThirtySeconds;
63  int _lastFiveSeconds;
64 
65  int _lastSecond;
66  void updateTimeVariables() override;
67 
68  void initDOS();
69  void initCPC();
70  void initZX();
71  void initC64();
72  void initAmigaAtari();
73 
74  void loadAssetsZXFullGame() override;
75  void loadAssetsCPCFullGame() override;
76  void loadAssetsC64FullGame() override;
77  void loadAssetsAtariFullGame() override;
78  void loadAssetsCPCDemo() override;
79  void loadAssetsZXDemo() override;
80 
81  void initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *infoScreenKeyMap, const char *target) override;
82  void initGameState() override;
83  void executePrint(FCLInstruction &instruction) override;
84 
85  void drawBackground() override;
86  void drawDOSUI(Graphics::Surface *surface) override;
87  void drawCPCUI(Graphics::Surface *surface) override;
88  void drawC64UI(Graphics::Surface *surface) override;
89  void drawZXUI(Graphics::Surface *surface) override;
90  void drawAnalogClock(Graphics::Surface *surface, int x, int y, uint32 colorHand1, uint32 colorHand2, uint32 colorBack);
91  void drawAnalogClockHand(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
92  void drawCompass(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
93  void drawEclipseIndicator(Graphics::Surface *surface, int x, int y, uint32 color1, uint32 color2);
94  Common::String getScoreString(int score);
95 
96  soundFx *load1bPCM(Common::SeekableReadStream *file, int offset);
97 
98  bool checkIfGameEnded() override;
99  void endGame() override;
100  void loadSoundsFx(Common::SeekableReadStream *file, int offset, int number) override;
101  void playSoundFx(int index, bool sync) override;
102 
103  Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
104  Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
105 };
106 
107 }
Definition: keymap.h:66
Definition: str.h:59
Definition: surface.h:67
Definition: stream.h:77
Definition: error.h:81
Definition: area.h:36
Definition: advancedDetector.h:164
Definition: sound.h:30
Definition: stream.h:745
Definition: freescape.h:170
Definition: sensor.h:34
Definition: eclipse.h:37
Definition: system.h:163
Definition: instruction.h:36