1 /*
2 	This file is part of Warzone 2100.
3 	Copyright (C) 1999-2004  Eidos Interactive
4 	Copyright (C) 2005-2020  Warzone 2100 Project
5 
6 	Warzone 2100 is free software; you can redistribute it and/or modify
7 	it under the terms of the GNU General Public License as published by
8 	the Free Software Foundation; either version 2 of the License, or
9 	(at your option) any later version.
10 
11 	Warzone 2100 is distributed in the hope that it will be useful,
12 	but WITHOUT ANY WARRANTY; without even the implied warranty of
13 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 	GNU General Public License for more details.
15 
16 	You should have received a copy of the GNU General Public License
17 	along with Warzone 2100; if not, write to the Free Software
18 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 /**
22  *      @file radar.h
23  *      Minimap code.
24  *      @defgroup Minimap Minimap (radar) subsystem.
25  *      @{
26  */
27 
28 #ifndef __INCLUDED_SRC_RADAR_H__
29 #define __INCLUDED_SRC_RADAR_H__
30 
31 void radarColour(UDWORD tileNumber, uint8_t r, uint8_t g, uint8_t b);	///< Set radar colour for given terrain type.
32 
33 #define MAX_RADARZOOM		(64)
34 #define MIN_RADARZOOM		(8)
35 #define DEFAULT_RADARZOOM	(32)
36 #define RADARZOOM_STEP		(4)
37 
38 bool InitRadar();				///< Initialize minimap subsystem.
39 bool ShutdownRadar();			///< Shutdown minimap subsystem.
40 bool resizeRadar();				///< Recalculate minimap size. For initialization code only.
41 void drawRadar();				///< Draw the minimap on the screen.
42 void CalcRadarPosition(int mX, int mY, int *PosX, int *PosY);	///< Given a position within the radar, returns a world coordinate.
43 void SetRadarZoom(uint8_t ZoomLevel);		///< Set current zoom level. 1.0 is 1:1 resolution.
44 uint8_t GetRadarZoom();			///< Get current zoom level.
45 bool CoordInRadar(int x, int y);			///< Is screen coordinate inside minimap?
46 
47 /** Different mini-map draw modes. */
48 enum RADAR_DRAW_MODE
49 {
50 	RADAR_MODE_TERRAIN,				///< Draw terrain map
51 	RADAR_MODE_DEFAULT = RADAR_MODE_TERRAIN,	///< Default is terrain map
52 	RADAR_MODE_HEIGHT_MAP,				///< Draw height map
53 	RADAR_MODE_COMBINED,
54 	RADAR_MODE_NO_TERRAIN,				///< Only display objects
55 	NUM_RADAR_MODES
56 };
57 
58 extern bool bEnemyAllyRadarColor;		///< Enemy/ally minimap color
59 extern RADAR_DRAW_MODE	radarDrawMode;			///< Current minimap mode
60 extern bool rotateRadar;
61 extern bool radarRotationArrow;
62 
63 void radarInitVars();			///< Recalculate minimap variables. For initialization code only.
64 
65 extern PIELIGHT clanColours[];
66 
67 /** @} */
68 
69 #endif // __INCLUDED_SRC_RADAR_H__
70