ScummVM API documentation
castle.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 class CastleEngine : public FreescapeEngine {
25 public:
26  CastleEngine(OSystem *syst, const ADGameDescription *gd);
27  ~CastleEngine();
28 
29  // Only in DOS
30  Graphics::ManagedSurface *_option;
31  Graphics::ManagedSurface *_menuButtons;
32  Graphics::ManagedSurface *_menuCrawlIndicator;
33  Graphics::ManagedSurface *_menuWalkIndicator;
34  Graphics::ManagedSurface *_menuRunIndicator;
35  Graphics::ManagedSurface *_menuFxOnIndicator;
36  Graphics::ManagedSurface *_menuFxOffIndicator;
37  Graphics::ManagedSurface *_something;
39 
40  void initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *infoScreenKeyMap, const char *target) override;
41  void initGameState() override;
42  void endGame() override;
43 
44  void drawInfoMenu() override;
45  void loadAssets() override;
46  void loadAssetsDOSFullGame() override;
47  void loadAssetsDOSDemo() override;
48  void loadAssetsAmigaDemo() override;
49  void loadAssetsZXFullGame() override;
50  void borderScreen() override;
51  void selectCharacterScreen();
52  void drawOption();
53 
54  void initZX();
55 
56  void drawDOSUI(Graphics::Surface *surface) override;
57  void drawZXUI(Graphics::Surface *surface) override;
58  void drawEnergyMeter(Graphics::Surface *surface);
59  void pressedKey(const int keycode) override;
60  void checkSensors() override;
61  void updateTimeVariables() override;
62 
63  bool checkIfGameEnded() override;
64 
65  void executePrint(FCLInstruction &instruction) override;
66  void executeMakeInvisible(FCLInstruction &instruction) override;
67  void gotoArea(uint16 areaID, int entranceID) override;
68  Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
69  Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
70 
71  Common::StringArray _riddleList;
72  Common::BitArray _fontPlane1;
73  Common::BitArray _fontPlane2;
74  Common::BitArray _fontPlane3;
75 
76  void drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface, int offset = 0) override;
77  //void drawStringInSurface(const Common::String &str, int x, int y, uint32 primaryFontColor, uint32 secondaryFontColor, uint32 backColor, Graphics::Surface *surface, int offset = 0) override;
78  Common::Array<Graphics::Surface *> loadFramesWithHeader(Common::SeekableReadStream *file, int pos, int numFrames, uint32 front, uint32 back);
79  Graphics::Surface *loadFrameWithHeader(Common::SeekableReadStream *file, int pos, uint32 front, uint32 back);
80  Graphics::Surface *loadFrame(Common::SeekableReadStream *file, Graphics::Surface *surface, int width, int height, uint32 back);
81  Graphics::ManagedSurface *loadFrameFromPlanes(Common::SeekableReadStream *file, int widthInBytes, int height);
82  Graphics::ManagedSurface *loadFrameFromPlanesInternal(Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int width, int height);
83 
84  Graphics::Surface *_keysFrame;
85  Graphics::Surface *_spiritsMeterIndicatorFrame;
86  Graphics::Surface *_strenghtBackgroundFrame;
87  Graphics::Surface *_strenghtBarFrame;
88  Common::Array<Graphics::Surface *> _strenghtWeightsFrames;
89  Graphics::ManagedSurface *_flagFrames[4];
90  Graphics::Surface *_thunderFrame;
91 
92  int _numberKeys;
93  bool _useRockTravel;
94  int _spiritsDestroyed;
95  int _spiritsMeter;
96  int _spiritsMeterPosition;
97  int _spiritsMeterMax;
98  int _spiritsToKill;
99 
100 private:
101  Common::SeekableReadStream *decryptFile(const Common::Path &filename);
102  void loadRiddles(Common::SeekableReadStream *file, int offset, int number);
103  void loadDOSFonts(Common::SeekableReadStream *file, int pos);
104  void drawFullscreenRiddleAndWait(uint16 riddle);
105  void drawRiddle(uint16 riddle, uint32 front, uint32 back, Graphics::Surface *surface);
106  void addGhosts();
107  Texture *_optionTexture;
108 };
109 
110 }
Definition: managed_surface.h:51
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: path.h:52
Definition: stream.h:745
Definition: freescape.h:148
Definition: bitarray.h:29
Definition: system.h:161
Definition: instruction.h:36
Definition: castle.h:24
Definition: gfx.h:45