1 /**
2  * @file
3  * @brief Header for Geoscape management
4  */
5 
6 /*
7 Copyright (C) 2002-2013 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #define KILOMETER_PER_DEGREE	111.2		/* this is the conversion between distance in game (in degree) and km */
29 
30 #define GEO_IsAircraftSelected(aircraft) ((aircraft) == ccs.geoscape.selectedAircraft)
31 #define GEO_IsInterceptorSelected(aircraft) ((aircraft) == ccs.geoscape.interceptAircraft)
32 #define GEO_IsUFOSelected(ufo) ((ufo) == ccs.geoscape.selectedUFO)
33 #define GEO_IsMissionSelected(mission) ((mission) == ccs.geoscape.selectedMission)
34 
35 #define GEO_GetSelectedAircraft() (ccs.geoscape.selectedAircraft)
36 #define GEO_GetInterceptorAircraft() (ccs.geoscape.interceptAircraft)
37 #define GEO_GetSelectedUFO() (ccs.geoscape.selectedUFO)
38 #define GEO_GetSelectedMission() (ccs.geoscape.selectedMission)
39 #define GEO_GetMissionAircraft() (ccs.geoscape.missionAircraft)
40 
41 #define GEO_SetSelectedAircraft(aircraft) (ccs.geoscape.selectedAircraft = (aircraft))
42 #define GEO_SetInterceptorAircraft(interceptor) (ccs.geoscape.interceptAircraft = (interceptor))
43 #define GEO_SetSelectedUFO(ufo) (ccs.geoscape.selectedUFO = (ufo))
44 #define GEO_SetSelectedMission(mission) (ccs.geoscape.selectedMission = (mission))
45 #define GEO_SetMissionAircraft(aircraft) (ccs.geoscape.missionAircraft = (aircraft))
46 
47 /* prototype */
48 struct uiNode_t;
49 
50 void GEO_DrawMarkers(const uiNode_t* node);
51 bool GEO_Click(const uiNode_t* node, int x, int y, const vec2_t pos);
52 
53 nation_t* GEO_GetNation(const vec2_t pos);
54 float GEO_AngleOfPath(const vec2_t start, const vec2_t end, vec3_t direction, vec3_t ortVector);
55 void GEO_CalcLine(const vec2_t start, const vec2_t end, mapline_t* line);
56 void GEO_Draw(geoscapeData_t* data);
57 void GEO_CenterOnPoint_f(void);
58 void GEO_CenterPosition(const vec2_t pos);
59 base_t* GEO_PositionCloseToBase(const vec2_t pos);
60 
61 void GEO_ResetAction(void);
62 void GEO_SelectAircraft(aircraft_t* aircraft);
63 void GEO_SelectUFO(aircraft_t* ufo);
64 mission_t* GEO_SelectMission(mission_t* mission);
65 void GEO_NotifyMissionRemoved(const mission_t* mission);
66 void GEO_NotifyUFORemoved(const aircraft_t* ufo, bool destroyed);
67 void GEO_NotifyAircraftRemoved(const aircraft_t* aircraft);
68 void GEO_NotifyUFODisappear(const aircraft_t* ufo);
69 void GEO_InitStartup(void);
70 const char* GEO_GetTerrainType(const byte* color);
71 int GEO_GetCivilianNumberByPosition(const vec2_t pos);
72 void GEO_PrintParameterStringByPos(const vec2_t pos);
73 void GEO_CheckPositionBoundaries(float* pos);
74 bool GEO_IsNight(const vec2_t pos);
75 const byte* GEO_GetColor(const vec2_t pos, mapType_t type, bool *coast);
76 void GEO_Init(const char* map);
77 void GEO_Reset(const char* map);
78 void GEO_Shutdown(void);
79 bool GEO_PositionFitsTCPNTypes(const vec2_t posT, const linkedList_t* terrainTypes, const linkedList_t* cultureTypes, const linkedList_t* populationTypes, const linkedList_t* nations);
80 void GEO_SetOverlay(const char* overlayID);
81 void GEO_DeactivateOverlay(const char* overlayID);
82 void GEO_UpdateGeoscapeDock(void);
83 bool GEO_IsRadarOverlayActivated(void);
84