ScummVM API documentation
automap.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  * Based on the original sources
22  * Faery Tale II -- The Halls of the Dead
23  * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24  */
25 
26 #ifndef SAGA2_AUTOMAP_H
27 #define SAGA2_AUTOMAP_H
28 
29 #include "saga2/intrface.h"
30 
31 namespace Saga2 {
32 
33 class AutoMap : public ModalWindow {
34 private:
35 
36  enum summaryMapEnum {
37  kTileSumWidth = 8,
38  kTileSumHeight = 8,
39  kSumMapAreaWidth = 544, // the sumMap number could be more efficient
40  kSumMapAreaHeight = 324,
41 
42  kSummaryDiameter = 62,
43  kSummaryRadius = kSummaryDiameter / 2
44  };
45 
46 public:
47  TilePoint _trackPos,
48  _centerCoords,
49  _baseCoords;
50  TileRegion _localAreaRegion;
51 private:
52 
53  // used as a temporary blit surface
54  gPort _tPort;
55 
56  // tile summary data
57  uint8 *_summaryData;
58  Rect16 _sumMapArea;
59 
60  bool _autoMapCheat;
61 
62 public:
63  AutoMap(const Rect16 box,
64  uint8 *summary,
65  uint16 ident,
66  AppFunc *cmd);
67  ~AutoMap();
68 
69  void drawClipped(gPort &port,
70  const Point16 &offset,
71  const Rect16 &clipRect);
72  void draw(); // redraw the window
73 
74  void createSmallMap();
75  void locateRegion();
76  APPFUNCV(cmdAutoMapEsc);
77  APPFUNCV(cmdAutoMapHome);
78  APPFUNCV(cmdAutoMapEnd);
79  APPFUNCV(cmdAutoMapPgUp);
80  APPFUNCV(cmdAutoMapPgDn);
81 
82  gPanel *keyTest(int16 key);
83 
84  void setCheatFlag(bool flag) { _autoMapCheat = flag; }
85  bool getCheatFlag() { return _autoMapCheat; }
86 private:
87  bool activate(gEventType why); // activate the control
88  void deactivate();
89 
90  void pointerMove(gPanelMessage &msg);
91  bool pointerHit(gPanelMessage &msg);
92  void pointerDrag(gPanelMessage &msg);
93  void pointerRelease(gPanelMessage &msg);
94  bool keyStroke(gPanelMessage &msg);
95 
96 };
97 
98 //
99 // object access routines
100 //
101 
102 int16 openAutoMap();
103 
104 } // end of namespace Saga2
105 
106 #endif // SAGA2_AUTOMAP_H
Definition: panel.h:118
Definition: actor.h:32
Definition: gdraw.h:178
Definition: tcoords.h:127
Definition: tcoords.h:222
Definition: rect.h:42
Definition: panel.h:218
Definition: automap.h:33
Definition: modal.h:45
Definition: rect.h:290