ScummVM API documentation
interface.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 #ifndef XEEN_INTERFACE_H
23 #define XEEN_INTERFACE_H
24 
25 #include "common/scummsys.h"
26 #include "xeen/dialogs/dialogs.h"
27 #include "xeen/interface_minimap.h"
28 #include "xeen/interface_scene.h"
29 #include "xeen/party.h"
30 #include "xeen/window.h"
31 
32 namespace Xeen {
33 
34 class XeenEngine;
35 
36 enum Obscurity {
37  OBSCURITY_BLACK = 0,
38  OBSCURITY_3 = 1,
39  OBSCURITY_2 = 2,
40  OBSCURITY_1 = 3,
41  OBSCURITY_NONE = 4
42 };
43 
44 enum IconsMode {
45  ICONS_STANDARD = 0,
46  ICONS_COMBAT = 1
47 };
48 
49 enum FallState {
50  FALL_NONE = 0,
51  FALL_IN_PROGRESS = 1,
52  FALL_START = 2
53 };
54 
55 #define HILIGHT_CHAR_DISABLED -2
56 #define HILIGHT_CHAR_NONE -1
57 
61 class PartyDrawer {
62 private:
63  XeenEngine *_vm;
64  SpriteResource _dseFace;
65  SpriteResource _hpSprites;
66  SpriteResource _restoreSprites;
67  int _hiliteChar;
68 public:
70 
71  void drawParty(bool updateFlag);
72 
77  void highlightChar(int charId);
78 
83  void highlightChar(const Character *c);
84 
85  void unhighlightChar();
86 
87  void resetHighlight();
88 };
89 
94  public InterfaceMinimap, public PartyDrawer {
95 private:
96  XeenEngine *_vm;
97  SpriteResource _uiSprites;
98  SpriteResource _borderSprites;
99  SpriteResource _spellFxSprites;
100  SpriteResource _fecpSprites;
101  SpriteResource _blessSprites;
102  SpriteResource _stdIcons;
103  SpriteResource _combatIcons;
104  Graphics::ManagedSurface _fallSurface;
105  bool _buttonsLoaded;
106  int _steppingFX;
107  int _blessedUIFrame;
108  int _powerShieldUIFrame;
109  int _holyBonusUIFrame;
110  int _heroismUIFrame;
111  int _flipUIFrame;
112 
113  void loadSprites();
114 
115  void setupBackground();
116 
120  void setMainButtons(IconsMode mode = ICONS_STANDARD);
121 
122  void chargeStep();
123 
127  void stepTime();
128 
129  void doStepCode();
130 
134  bool checkMoveDirection(int key);
135 
139  void handleFalling();
140 
147  void setupFallSurface(bool isTop);
148 
152  void fall(int yp);
153 
158  void shake(int count);
159 
163  void nextChar();
164 public:
165  Obscurity _obscurity;
166  FallState _falling;
167  int _face1State, _face2State;
168  int _face1UIFrame, _face2UIFrame;
169  int _spotDoorsUIFrame;
170  int _dangerSenseUIFrame;
171  int _levitateUIFrame;
172  bool _upDoorText;
173  Common::String _screenText;
174  byte _tillMove;
175  int _charFX[6];
176  IconsMode _iconsMode;
177 public:
178  Interface(XeenEngine *vm);
179 
180  ~Interface() override {}
181 
182  void setup();
183 
184  void manageCharacters(bool soundPlayed);
185 
186  void startup();
187 
188  void mainIconsPrint();
189 
193  void startFalling(bool v);
194 
199  void perform();
200 
201  void rest();
202 
206  void bash(const Common::Point &pt, Direction direction);
207 
213  void draw3d(bool updateFlag, bool pauseFlag = true);
214 
218  void assembleBorder();
219 
220  void doCombat();
221 
222  void spellFX(Character *c);
223 
227  void obscureScene(Obscurity obscurity);
228 };
229 
230 } // End of namespace Xeen
231 
232 #endif /* XEEN_INTERFACE_H */
Definition: managed_surface.h:45
Definition: str.h:59
Definition: interface_minimap.h:27
Definition: sprites.h:48
void highlightChar(int charId)
Definition: interface.h:61
Definition: interface_scene.h:115
Definition: rect.h:45
Definition: xeen.h:100
Definition: character.h:101
Definition: interface.h:93
Definition: character.h:33
Definition: dialogs.h:73