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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  *
22  * Based on the original sources
23  *   Faery Tale II -- The Halls of the Dead
24  *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
25  */
26 
27 #ifndef SAGA2_AUTOMAP_H
28 #define SAGA2_AUTOMAP_H
29 
30 #include "saga2/intrface.h"
31 
32 namespace Saga2 {
33 
34 class AutoMap : public ModalWindow {
35 private:
36 
37 	enum summaryMapEnum {
38 		kTileSumWidth        = 8,
39 		kTileSumHeight       = 8,
40 		kSumMapAreaWidth     = 544,  // the sumMap number could be more efficient
41 		kSumMapAreaHeight    = 324,
42 
43 		kSummaryDiameter     = 62,
44 		kSummaryRadius       = kSummaryDiameter / 2
45 	};
46 
47 public:
48 	TilePoint   _trackPos,
49 	            _centerCoords,
50 	            _baseCoords;
51 	TileRegion  _localAreaRegion;
52 private:
53 
54 	// used as a temporary blit surface
55 	gPort   _tPort;
56 
57 	// tile summary data
58 	uint8   *_summaryData;
59 	Rect16  _sumMapArea;
60 
61 public:
62 	AutoMap(const Rect16 box,
63 	         uint8 *summary,
64 	         uint16 ident,
65 	         AppFunc *cmd);
66 	~AutoMap();
67 
68 	void drawClipped(gPort &port,
69 	                 const Point16 &offset,
70 	                 const Rect16  &clipRect);
71 	void draw(void);             // redraw the window
72 
73 	void createSmallMap(void);
74 	void locateRegion(void);
75 	APPFUNCV(cmdAutoMapEsc);
76 	APPFUNCV(cmdAutoMapHome);
77 	APPFUNCV(cmdAutoMapEnd);
78 	APPFUNCV(cmdAutoMapPgUp);
79 	APPFUNCV(cmdAutoMapPgDn);
80 
81 	gPanel *keyTest(int16 key);
82 private:
83 	bool activate(gEventType why);       // activate the control
84 	void deactivate(void);
85 
86 	void pointerMove(gPanelMessage &msg);
87 	bool pointerHit(gPanelMessage &msg);
88 	void pointerDrag(gPanelMessage &msg);
89 	void pointerRelease(gPanelMessage &msg);
90 	bool keyStroke(gPanelMessage &msg);
91 
92 };
93 
94 //
95 // object access routines
96 //
97 
98 int16 openAutoMap();
99 
100 } // end of namespace Saga2
101 
102 #endif // SAGA2_AUTOMAP_H
103