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 "mm/xeen/dialogs/dialogs.h"
27 #include "mm/xeen/interface_minimap.h"
28 #include "mm/xeen/interface_scene.h"
29 #include "mm/xeen/party.h"
30 #include "mm/xeen/window.h"
31 
32 namespace MM {
33 namespace Xeen {
34 
35 class XeenEngine;
36 
37 enum Obscurity {
38  OBSCURITY_BLACK = 0,
39  OBSCURITY_3 = 1,
40  OBSCURITY_2 = 2,
41  OBSCURITY_1 = 3,
42  OBSCURITY_NONE = 4
43 };
44 
45 enum IconsMode {
46  ICONS_STANDARD = 0,
47  ICONS_COMBAT = 1
48 };
49 
50 enum FallState {
51  FALL_NONE = 0,
52  FALL_IN_PROGRESS = 1,
53  FALL_START = 2
54 };
55 
56 #define HILIGHT_CHAR_DISABLED -2
57 #define HILIGHT_CHAR_NONE -1
58 
62 class PartyDrawer {
63 private:
64  XeenEngine *_vm;
65  SpriteResource _dseFace;
66  SpriteResource _hpSprites;
67  SpriteResource _restoreSprites;
68  int _hiliteChar;
69 public:
71 
72  void drawParty(bool updateFlag);
73 
78  void highlightChar(int charId);
79 
84  void highlightChar(const Character *c);
85 
86  void unhighlightChar();
87 
88  void resetHighlight();
89 
90 private:
91  void drawHitPoints(int charIndex);
92 };
93 
98  public InterfaceMinimap, public PartyDrawer {
99 private:
100  XeenEngine *_vm;
101  SpriteResource _uiSprites;
102  SpriteResource _borderSprites;
103  SpriteResource _spellFxSprites;
104  SpriteResource _fecpSprites;
105  SpriteResource _blessSprites;
106  SpriteResource _stdIcons;
107  SpriteResource _combatIcons;
108  Graphics::ManagedSurface _fallSurface;
109  bool _buttonsLoaded;
110  int _steppingFX;
111  int _blessedUIFrame;
112  int _powerShieldUIFrame;
113  int _holyBonusUIFrame;
114  int _heroismUIFrame;
115  int _flipUIFrame;
116 
117  void loadSprites();
118 
119  void setupBackground();
120 
124  void setMainButtons(IconsMode mode = ICONS_STANDARD);
125 
126  void chargeStep();
127 
131  void stepTime();
132 
133  void doStepCode();
134 
138  bool checkMoveDirection(int key);
139 
143  void handleFalling();
144 
151  void setupFallSurface(bool isTop);
152 
156  void fall(int yp);
157 
162  void shake(int count);
163 
167  void nextChar();
168 public:
169  Obscurity _obscurity;
170  FallState _falling;
171  int _face1State, _face2State;
172  int _face1UIFrame, _face2UIFrame;
173  int _spotDoorsUIFrame;
174  int _dangerSenseUIFrame;
175  int _levitateUIFrame;
176  bool _upDoorText;
177  Common::String _screenText;
178  byte _tillMove;
179  int _charFX[6];
180  IconsMode _iconsMode;
181 public:
182  Interface(XeenEngine *vm);
183 
184  ~Interface() override {}
185 
186  void setup();
187 
188  void manageCharacters(bool soundPlayed);
189 
190  void startup();
191 
192  void mainIconsPrint();
193 
197  void startFalling(bool v);
198 
203  void perform();
204 
205  void rest();
206 
210  void bash(const Common::Point &pt, Direction direction);
211 
217  void draw3d(bool updateFlag, bool pauseFlag = true);
218 
222  void assembleBorder();
223 
224  void doCombat();
225 
226  void spellFX(Character *c);
227 
231  void obscureScene(Obscurity obscurity);
232 };
233 
234 } // End of namespace Xeen
235 } // End of namespace MM
236 
237 #endif
Definition: managed_surface.h:51
Definition: interface_minimap.h:28
Definition: str.h:59
Definition: sprites.h:52
void highlightChar(int charId)
Definition: interface_scene.h:120
Definition: xeen.h:93
Definition: interface.h:97
Definition: character.h:106
Definition: detection.h:27
Definition: interface.h:62
Definition: rect.h:45
Definition: dialogs.h:74