UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_geoscape.h File Reference

Header for Geoscape management. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define KILOMETER_PER_DEGREE   111.2 /* this is the conversion between distance in game (in degree) and km */
#define MapIsWater(color)
#define MapIsWestern(color)
#define MapIsEastern(color)
#define MapIsOriental(color)
#define MapIsAfrican(color)
#define MapIsUrban(color)
#define MapIsSuburban(color)
#define MapIsVillage(color)
#define MapIsRural(color)
#define MapIsNopopulation(color)
#define RASTER   2
#define GEO_IsAircraftSelected(aircraft)
#define GEO_IsInterceptorSelected(aircraft)
#define GEO_IsUFOSelected(ufo)
#define GEO_IsMissionSelected(mission)
#define GEO_GetSelectedAircraft()
#define GEO_GetInterceptorAircraft()
#define GEO_GetSelectedUFO()
#define GEO_GetSelectedMission()
#define GEO_GetMissionAircraft()
#define GEO_SetSelectedAircraft(aircraft)
#define GEO_SetInterceptorAircraft(interceptor)
#define GEO_SetSelectedUFO(ufo)
#define GEO_SetSelectedMission(mission)
#define GEO_SetMissionAircraft(aircraft)

Functions

void GEO_DrawMarkers (const uiNode_t *node)
 Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D).
bool GEO_Click (const uiNode_t *node, int x, int y, const vec2_t pos)
 Click on the map/geoscape.
nation_tGEO_GetNation (const vec2_t pos)
 Translate nation map color to nation.
float GEO_AngleOfPath (const vec2_t start, const vec2_t end, vec3_t direction, vec3_t ortVector)
 Select which function should be used for calculating the direction of model on 2D or 3D geoscape.
void GEO_CalcLine (const vec2_t start, const vec2_t end, mapline_t *line)
 Calculate the shortest way to go from start to end on a sphere.
void GEO_Draw (geoscapeData_t *data)
 Draw the geoscape.
void GEO_CenterOnPoint_f (void)
 Switch to next model on 2D and 3D geoscape.
void GEO_CenterPosition (const vec2_t pos)
 Start to rotate or shift the globe to the given position.
base_tGEO_PositionCloseToBase (const vec2_t pos)
 Check if given pos is close to an existing base.
void GEO_ResetAction (void)
 No more special action on the geoscape.
void GEO_SelectAircraft (aircraft_t *aircraft)
 Select the specified aircraft on the geoscape.
void GEO_SelectUFO (aircraft_t *ufo)
 Select the specified ufo on the geoscape.
struct mission_s * GEO_SelectMission (struct mission_s *mission)
void GEO_NotifyMissionRemoved (const struct mission_s *mission)
void GEO_NotifyUFORemoved (const aircraft_t *ufo, bool destroyed)
 Notify that a UFO has been removed.
void GEO_NotifyAircraftRemoved (const aircraft_t *aircraft)
 Notify that an aircraft has been removed from game.
void GEO_NotifyUFODisappear (const aircraft_t *ufo)
 Notify that a UFO disappears on radars.
void GEO_InitStartup (void)
 Initialise MAP/Geoscape.
int GEO_GetCivilianNumberByPosition (const vec2_t pos)
 Get number of civilian on a map at given position.
void GEO_PrintParameterStringByPos (const vec2_t pos)
 Prints positions parameter in console.
void GEO_CheckPositionBoundaries (float *pos)
 Check that a position (in latitude / longitude) is within boundaries.
bool GEO_IsNight (const vec2_t pos)
 Check whether given position is Day or Night.
const byteGEO_GetColor (const vec2_t pos, mapType_t type, bool *coast)
 Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given position.
void GEO_Init (const char *map)
void GEO_Reset (const char *map)
void GEO_Shutdown (void)
bool GEO_PositionFitsTCPNTypes (const vec2_t posT, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations)
 Checks for a given location, if it fulfills all criteria given via parameters (terrain, culture, population, nation type).
void GEO_SetOverlay (const char *overlayID, int status)
 Turn overlay on/off.
void GEO_UpdateGeoscapeDock (void)
 Will add missions and UFOs to the geoscape dock panel.
bool GEO_IsRadarOverlayActivated (void)
void CP_GetRandomPosOnGeoscape (vec2_t pos, bool noWater)
 Determines a random position on geoscape.
bool CP_GetRandomPosOnGeoscapeWithParameters (vec2_t pos, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations)
 Determines a random position on geoscape that fulfills certain criteria given via parameters.

Detailed Description

Header for Geoscape management.

Definition in file cp_geoscape.h.

Macro Definition Documentation

◆ GEO_GetInterceptorAircraft

#define GEO_GetInterceptorAircraft ( )
Value:
(ccs.geoscape.interceptAircraft)
ccs_t ccs

Definition at line 57 of file cp_geoscape.h.

Referenced by AM_Check_f(), and AM_Go_f().

◆ GEO_GetMissionAircraft

#define GEO_GetMissionAircraft ( )
Value:
(ccs.geoscape.missionAircraft)

Definition at line 60 of file cp_geoscape.h.

Referenced by AM_Go_f(), CP_MissionEnd(), CP_StartSelectedMission(), GAME_CP_Results(), and GAME_CP_Spawn().

◆ GEO_GetSelectedAircraft

#define GEO_GetSelectedAircraft ( )
Value:
(ccs.geoscape.selectedAircraft)

Definition at line 56 of file cp_geoscape.h.

Referenced by CL_PopupChangeHomebase_f(), GEO_Click(), and GEO_Draw().

◆ GEO_GetSelectedMission

#define GEO_GetSelectedMission ( )
Value:
(ccs.geoscape.selectedMission)

Definition at line 59 of file cp_geoscape.h.

Referenced by AM_Check_f(), AM_Go_f(), CP_ChangeNationHappiness_f(), CP_StartSelectedMission(), GAME_CP_Results_f(), GEO_Draw(), and GEO_SelectMission().

◆ GEO_GetSelectedUFO

#define GEO_GetSelectedUFO ( )
Value:
(ccs.geoscape.selectedUFO)

Definition at line 58 of file cp_geoscape.h.

Referenced by CL_PopupInterceptBaseClick_f(), GEO_Draw(), and GEO_NotifyUFORemoved().

◆ GEO_IsAircraftSelected

#define GEO_IsAircraftSelected ( aircraft)
Value:
((aircraft) == ccs.geoscape.selectedAircraft)

Definition at line 51 of file cp_geoscape.h.

Referenced by AIR_GeoSelectAircraft_f(), CP_SpawnRescueMission(), GEO_DrawMapOnePhalanxAircraft(), and GEO_NotifyAircraftRemoved().

◆ GEO_IsInterceptorSelected

#define GEO_IsInterceptorSelected ( aircraft)
Value:
((aircraft) == ccs.geoscape.interceptAircraft)

Definition at line 52 of file cp_geoscape.h.

Referenced by GEO_NotifyAircraftRemoved().

◆ GEO_IsMissionSelected

#define GEO_IsMissionSelected ( mission)
Value:
((mission) == ccs.geoscape.selectedMission)

Definition at line 54 of file cp_geoscape.h.

Referenced by GEO_DrawMapOneMission(), GEO_NotifyMissionRemoved(), GEO_SelectMission(), and MIS_GeoSelectMission_f().

◆ GEO_IsUFOSelected

#define GEO_IsUFOSelected ( ufo)
Value:
((ufo) == ccs.geoscape.selectedUFO)

Definition at line 53 of file cp_geoscape.h.

Referenced by GEO_DrawMarkers(), GEO_NotifyUFODisappear(), GEO_NotifyUFORemoved(), and UFO_GeoSelectUFO_f().

◆ GEO_SetInterceptorAircraft

#define GEO_SetInterceptorAircraft ( interceptor)
Value:
(ccs.geoscape.interceptAircraft = (interceptor))

Definition at line 63 of file cp_geoscape.h.

Referenced by AIR_Move(), AIR_SendAircraftToMission(), CP_BaseAttackPrepareBattle(), and GEO_ResetAction().

◆ GEO_SetMissionAircraft

#define GEO_SetMissionAircraft ( aircraft)
Value:
(ccs.geoscape.missionAircraft = (aircraft))

Definition at line 66 of file cp_geoscape.h.

Referenced by AIR_Move(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackMissionIsFailure(), and CP_BaseAttackPrepareBattle().

◆ GEO_SetSelectedAircraft

#define GEO_SetSelectedAircraft ( aircraft)
Value:
(ccs.geoscape.selectedAircraft = (aircraft))

Definition at line 62 of file cp_geoscape.h.

Referenced by CP_SpawnRescueMission(), GEO_ResetAction(), and GEO_SelectAircraft().

◆ GEO_SetSelectedMission

#define GEO_SetSelectedMission ( mission)
Value:
(ccs.geoscape.selectedMission = (mission))

Definition at line 65 of file cp_geoscape.h.

Referenced by CP_StartSelectedMission(), GEO_ResetAction(), and GEO_SelectMission().

◆ GEO_SetSelectedUFO

#define GEO_SetSelectedUFO ( ufo)
Value:
(ccs.geoscape.selectedUFO = (ufo))

Definition at line 64 of file cp_geoscape.h.

Referenced by GEO_ResetAction(), and GEO_SelectUFO().

◆ KILOMETER_PER_DEGREE

#define KILOMETER_PER_DEGREE   111.2 /* this is the conversion between distance in game (in degree) and km */

Definition at line 28 of file cp_geoscape.h.

Referenced by AIR_GetOperationRange().

◆ MapIsAfrican

#define MapIsAfrican ( color)
Value:
(color[0] == 128 && color[1] == 128 && color[2] == 255)

Definition at line 38 of file cp_geoscape.h.

Referenced by GEO_GetCultureType().

◆ MapIsEastern

#define MapIsEastern ( color)
Value:
(color[0] == 255 && color[1] == 128 && color[2] == 0)

Definition at line 36 of file cp_geoscape.h.

Referenced by GEO_GetCultureType().

◆ MapIsNopopulation

#define MapIsNopopulation ( color)
Value:
(color[0] == 128 && color[1] == 255 && color[2] == 0)

Definition at line 45 of file cp_geoscape.h.

Referenced by GEO_GetCivilianNumberByPosition().

◆ MapIsOriental

#define MapIsOriental ( color)
Value:
(color[0] == 255 && color[1] == 0 && color[2] == 0)

Definition at line 37 of file cp_geoscape.h.

Referenced by GEO_GetCultureType().

◆ MapIsRural

#define MapIsRural ( color)
Value:
(color[0] == 128 && color[1] == 128 && color[2] == 255)

Definition at line 44 of file cp_geoscape.h.

Referenced by GEO_GetCivilianNumberByPosition(), and GEO_GetPopulationType().

◆ MapIsSuburban

#define MapIsSuburban ( color)
Value:
(color[0] == 255 && color[1] == 128 && color[2] == 0)

Definition at line 42 of file cp_geoscape.h.

Referenced by GEO_GetCivilianNumberByPosition(), and GEO_GetPopulationType().

◆ MapIsUrban

#define MapIsUrban ( color)
Value:
(color[0] == 128 && color[1] == 255 && color[2] == 255)

Definition at line 41 of file cp_geoscape.h.

Referenced by GEO_GetCivilianNumberByPosition(), and GEO_GetPopulationType().

◆ MapIsVillage

#define MapIsVillage ( color)
Value:
(color[0] == 255 && color[1] == 0 && color[2] == 0)

Definition at line 43 of file cp_geoscape.h.

Referenced by GEO_GetCivilianNumberByPosition(), and GEO_GetPopulationType().

◆ MapIsWater

◆ MapIsWestern

#define MapIsWestern ( color)
Value:
(color[0] == 128 && color[1] == 255 && color[2] == 255)

Definition at line 35 of file cp_geoscape.h.

Referenced by GEO_GetCultureType().

◆ RASTER

#define RASTER   2

Definition at line 49 of file cp_geoscape.h.

Referenced by CP_GetRandomPosOnGeoscapeWithParameters().

Function Documentation

◆ CP_GetRandomPosOnGeoscape()

void CP_GetRandomPosOnGeoscape ( vec2_t pos,
bool noWater )

Determines a random position on geoscape.

Parameters
[out]posThe position that will be overwritten. pos[0] is within -180, +180. pos[1] within -90, +90.
[in]noWaterTrue if the position should not be on water
See also
CP_GetRandomPosOnGeoscapeWithParameters
Note
The random positions should be roughly uniform thanks to the non-uniform distribution used.
This function always returns a value.

Definition at line 2085 of file cp_geoscape.cpp.

References cgi, DEBUG_CLIENT, frand(), GEO_GetColor(), MapIsWater, MAPTYPE_TERRAIN, and todeg.

Referenced by AB_SetAlienBasePosition(), CP_AttackUFOCarrier_f(), UFO_SetRandomDest(), and UFO_SetRandomPos().

◆ CP_GetRandomPosOnGeoscapeWithParameters()

bool CP_GetRandomPosOnGeoscapeWithParameters ( vec2_t pos,
const linkedList_t * terrainTypes,
const linkedList_t * cultureTypes,
const linkedList_t * populationTypes,
const linkedList_t * nations )

Determines a random position on geoscape that fulfills certain criteria given via parameters.

Parameters
[out]posThe position that will be overwritten with the random point fulfilling the criteria. pos[0] is within -180, +180. pos[1] within -90, +90.
[in]terrainTypesA linkedList_t containing a list of strings determining the acceptable terrain types (e.g. "grass") May be nullptr.
[in]cultureTypesA linkedList_t containing a list of strings determining the acceptable culture types (e.g. "western") May be nullptr.
[in]populationTypesA linkedList_t containing a list of strings determining the acceptable population types (e.g. "suburban") May be nullptr.
[in]nationsA linkedList_t containing a list of strings determining the acceptable nations (e.g. "asia"). May be nullptr
Returns
true if a location was found, otherwise false
Note
There may be no position fitting the parameters. The higher RASTER, the lower the probability to find a position.
See also
LIST_AddString
LIST_Delete
Note
When all parameters are nullptr, the algorithm assumes that it does not need to include "water" terrains when determining a random position
You should rather use CP_GetRandomPosOnGeoscape if there are no parameters (except water) to choose a random position
Todo
  • cache the counted hits
Todo
add EQUAL_EPSILON here?

Definition at line 2109 of file cp_geoscape.cpp.

References cgi, DEBUG_CLIENT, frand(), GEO_PositionFitsTCPNTypes(), RASTER, todeg, and Vector2Set.

Referenced by CP_HarvestMissionGo(), CP_ReconMissionGroundGo(), and TEST_F().

◆ GEO_AngleOfPath()

float GEO_AngleOfPath ( const vec2_t start,
const vec2_t end,
vec3_t direction,
vec3_t ortVector )

Select which function should be used for calculating the direction of model on 2D or 3D geoscape.

Parameters
[in]startLatitude and longitude of the position of the model.
[in]endLatitude and longitude of aimed point.
[in]directionvec3_t giving current direction of the model (nullptr if the model is idle).
[out]ortVectorIf not nullptr, this will be filled with the normalized vector around which rotation allows to go toward direction.
Returns
Angle (degrees) of rotation around the radius axis of earth for start going toward end. Zero value is the direction of North pole.

Definition at line 717 of file cp_geoscape.cpp.

References data, GEO_AngleOfPath2D(), GEO_AngleOfPath3D(), geoscapeNode, and UI_MAPEXTRADATA.

Referenced by AIRFIGHT_GetNextPointInPath(), GEO_DrawMapOnePhalanxAircraft(), and GEO_DrawMarkers().

◆ GEO_CalcLine()

void GEO_CalcLine ( const vec2_t start,
const vec2_t end,
mapline_t * line )

Calculate the shortest way to go from start to end on a sphere.

Parameters
[in]startThe point you start from
[in]endThe point you go to
[out]lineContains the shortest path to go from start to end
See also
GEO_MapDrawLine

Definition at line 372 of file cp_geoscape.cpp.

References CrossProduct(), mapline_t::distance, i, LINE_MAXPTS, LINE_MAXSEG, M_PI, mapline_t::numPoints, mapline_t::point, PolarToVec(), todeg, torad, v, VecToPolar(), Vector2Set, VectorEqual, VectorNormalize(), and VectorSet.

Referenced by AIR_AircraftReturnToBase(), AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), GEO_Click(), UFO_SearchAircraftTarget(), UFO_SendPursuingAircraft(), and UFO_SendToDestination().

◆ GEO_CenterOnPoint_f()

void GEO_CenterOnPoint_f ( void )

Switch to next model on 2D and 3D geoscape.

Note
Set smoothRotation to true to allow a smooth rotation in GEO_Draw.
This function sets the value of smoothFinalGlobeAngle (for 3D) or smoothFinal2DGeoscapeCenter (for 2D), which contains the final value that ccs.angles or ccs.centre must respectively take.

Definition at line 972 of file cp_geoscape.cpp.

References centerOnEventIdx, cgi, GEO_CenterPosition(), GEO_GetGeoscapeAngle(), geoscapeNode, and Q_streq.

◆ GEO_CenterPosition()

void GEO_CenterPosition ( const vec2_t pos)

Start to rotate or shift the globe to the given position.

Parameters
[in]posLongitude and latitude of the position to center on

Definition at line 811 of file cp_geoscape.cpp.

References data, GEO_ConvertObjectPositionToGeoscapePosition(), GEO_StartCenter(), geoscapeNode, and UI_MAPEXTRADATA.

Referenced by CP_SpawnUFOCarrier_f(), and GEO_CenterOnPoint_f().

◆ GEO_CheckPositionBoundaries()

void GEO_CheckPositionBoundaries ( float * pos)

Check that a position (in latitude / longitude) is within boundaries.

Parameters
[in,out]posPointer to the 2 elements vector giving the position.

Definition at line 1891 of file cp_geoscape.cpp.

Referenced by AIR_AircraftMakeMove(), AIR_Move(), and UFO_CampaignRunUFOs().

◆ GEO_Click()

bool GEO_Click ( const uiNode_t * node,
int x,
int y,
const vec2_t pos )

Click on the map/geoscape.

Parameters
[in]nodeUI Node of the geoscape map
[in]x,yMouse click coordinates
[in]posGeoscape (longitude, latitude) coordinate of the click
Returns
True if the event is used for something
Todo
make this a function in cp_base.c - B_BuildBaseAtPos

Definition at line 107 of file cp_geoscape.cpp.

◆ GEO_Draw()

void GEO_Draw ( geoscapeData_t * data)

Draw the geoscape.

Parameters
[in]dataGeoscape status data structure

Definition at line 1589 of file cp_geoscape.cpp.

◆ GEO_DrawMarkers()

void GEO_DrawMarkers ( const uiNode_t * node)

Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D).

Parameters
[in]nodeThe menu node which will be used for drawing markers.
Note
This is a drawing function only, called each time a frame is drawn. Therefore you should not use this function to calculate eg. the distance between 2 items on the geoscape (you should instead calculate it just after one of the items moved – distance is not going to change when you rotate the earth around itself and the time is stopped eg.).
See also
GEO_Draw
Todo
we should only show healthbar if aircraft is fighting but it's a slow algo

Definition at line 1432 of file cp_geoscape.cpp.

◆ GEO_GetCivilianNumberByPosition()

int GEO_GetCivilianNumberByPosition ( const vec2_t pos)

Get number of civilian on a map at given position.

Parameters
[in]posPosition where the mission takes place.
Returns
Number of civilian.
See also
CP_CreateCivilianTeam

Definition at line 1849 of file cp_geoscape.cpp.

References cgi, ERR_DROP, GEO_GetColor(), MapIsNopopulation, MapIsRural, MapIsSuburban, MapIsUrban, MapIsVillage, MapIsWater, and MAPTYPE_POPULATION.

Referenced by CP_CreateCivilianTeam().

◆ GEO_GetColor()

const byte * GEO_GetColor ( const vec2_t pos,
mapType_t type,
bool * coast )

Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given position.

Parameters
[in]posvec2_t Value of position on map to get the color value from. pos is longitude and latitude
[in]typedetermine the map to get the color from (there are different masks) one for the climatezone (bases made use of this - there are grass, ice and desert base tiles available) and one for the nations
[out]coastThe function will set this to true if the given position is a coast line. This can be nullptr if you are not interested in this fact.
Returns
Returns the color value at given position.
Note
terrainPic, culturePic and populationPic are pointers to an rgba image in memory
Todo
add EQUAL_EPSILON here?

Definition at line 1935 of file cp_geoscape.cpp.

References cgi, cultureHeight, culturePic, cultureWidth, ERR_DROP, MapIsWater, MAPTYPE_CULTURE, MAPTYPE_NATIONS, MAPTYPE_POPULATION, MAPTYPE_TERRAIN, nationsHeight, nationsPic, nationsWidth, populationHeight, populationPic, populationWidth, terrainHeight, terrainPic, terrainWidth, and type.

Referenced by AIR_PilotSurvivedCrash(), AIRFIGHT_ActionsAfterAirfight(), B_MoveAircraftOnGeoscapeToOtherBases(), CP_ChooseMap(), CP_CreateBattleParameters(), CP_GetRandomPosOnGeoscape(), CP_SpawnUFOCarrier_f(), CP_UpdateNationXVIInfection(), GEO_Click(), GEO_GetCivilianNumberByPosition(), GEO_GetCultureTypeByPos(), GEO_GetNation(), GEO_GetPopulationTypeByPos(), GEO_GetTerrainTypeByPos(), GEO_PositionFitsTCPNTypes(), NAT_ScriptSanityCheck(), and TEST_F().

◆ GEO_GetNation()

nation_t * GEO_GetNation ( const vec2_t pos)

Translate nation map color to nation.

See also
GEO_GetColor
Parameters
[in]posMap Coordinates to get the nation from
Returns
returns the nation pointer with the given color on nationPic at given pos
nullptr if no nation with the given color value was found
Note
The coordinates already have to be transformed to map coordinates via GEO_ScreenToMap

Definition at line 1745 of file cp_geoscape.cpp.

References cgi, DEBUG_CLIENT, GEO_GetColor(), MAPTYPE_NATIONS, NAT_Foreach, and VectorEqualEpsilon.

Referenced by AB_BaseSearchedByNations(), B_BuildBase_f(), CP_BuildBaseGovernmentLeave(), CP_ChangeNationHappiness_f(), CP_CreateCivilianTeam(), CP_MissionGetMessage(), CP_UpdateNationXVIInfection(), GEO_PositionFitsTCPNTypes(), INS_BuildInstallation_f(), INS_FillUFOYardData_f(), MIS_GetName(), NAT_UpdateHappinessForAllNations(), and US_FillUFOTransfer_f().

◆ GEO_Init()

◆ GEO_InitStartup()

void GEO_InitStartup ( void )

Initialise MAP/Geoscape.

Definition at line 2294 of file cp_geoscape.cpp.

References cgi, CVAR_DEVELOPER, GEO_ResetAction(), GEO_SelectObject_f(), and GEO_SetOverlay_f().

Referenced by CP_InitStartup().

◆ GEO_IsNight()

bool GEO_IsNight ( const vec2_t pos)

Check whether given position is Day or Night.

Parameters
[in]posGiven position.
Returns
True if given position is Night.

Definition at line 1908 of file cp_geoscape.cpp.

References ccs, COS_ALPHA, DateTime::DAYS_PER_YEAR_AVG, M_PI, DateTime::SECONDS_PER_DAY, SIN_ALPHA, and torad.

Referenced by B_AssembleMap_f(), BATTLE_Start(), and GEO_DrawMapOneMission().

◆ GEO_IsRadarOverlayActivated()

◆ GEO_NotifyAircraftRemoved()

void GEO_NotifyAircraftRemoved ( const aircraft_t * aircraft)

Notify that an aircraft has been removed from game.

Parameters
[in]aircraftPointer to the aircraft that has been removed

Definition at line 1730 of file cp_geoscape.cpp.

References GEO_IsAircraftSelected, GEO_IsInterceptorSelected, and GEO_ResetAction().

Referenced by AIR_DeleteAircraft().

◆ GEO_NotifyMissionRemoved()

void GEO_NotifyMissionRemoved ( const struct mission_s * mission)

References type.

◆ GEO_NotifyUFODisappear()

void GEO_NotifyUFODisappear ( const aircraft_t * ufo)

Notify that a UFO disappears on radars.

Definition at line 2236 of file cp_geoscape.cpp.

References GEO_IsUFOSelected, GEO_ResetAction(), and GEO_UpdateGeoscapeDock().

Referenced by UFO_CampaignCheckEvents().

◆ GEO_NotifyUFORemoved()

void GEO_NotifyUFORemoved ( const aircraft_t * ufo,
bool destroyed )

Notify that a UFO has been removed.

Parameters
[in]ufoPointer to the ufo has been removed
[in]destroyedTrue if the UFO has been destroyed, false if it's been only set invisible (landed)
Todo
convert to linked list

Definition at line 1711 of file cp_geoscape.cpp.

References ccs, GEO_GetSelectedUFO, GEO_IsUFOSelected, GEO_ResetAction(), and GEO_UpdateGeoscapeDock().

Referenced by CP_UFORemoveFromGeoscape().

◆ GEO_PositionCloseToBase()

base_t * GEO_PositionCloseToBase ( const vec2_t pos)

Check if given pos is close to an existing base.

Returns
Pointer to the base if one base is closer than MIN_DIST_BASE from pos, nullptr else

Definition at line 2030 of file cp_geoscape.cpp.

References B_GetNext(), GetDistanceOnGlobe(), MIN_DIST_BASE, and base_t::pos.

Referenced by AB_SetAlienBasePosition(), CP_HarvestMissionGo(), CP_ReconMissionGroundGo(), and CP_TerrorMissionGo().

◆ GEO_PositionFitsTCPNTypes()

bool GEO_PositionFitsTCPNTypes ( const vec2_t pos,
const linkedList_t * terrainTypes,
const linkedList_t * cultureTypes,
const linkedList_t * populationTypes,
const linkedList_t * nations )

Checks for a given location, if it fulfills all criteria given via parameters (terrain, culture, population, nation type).

Parameters
[in]posLocation to be tested
[in]terrainTypesA linkedList_t containing a list of strings determining the terrain types to be tested for (e.g. "grass") may be nullptr
[in]cultureTypesA linkedList_t containing a list of strings determining the culture types to be tested for (e.g. "western") may be nullptr
[in]populationTypesA linkedList_t containing a list of strings determining the population types to be tested for (e.g. "suburban") may be nullptr
[in]nationsA linkedList_t containing a list of strings determining the nations to be tested for (e.g. "asia") may be nullptr
Returns
true if a location was found, otherwise false. If the map is over water, return false
Note
The name TCPNTypes comes from terrain, culture, population, nation types

Definition at line 2050 of file cp_geoscape.cpp.

References cgi, GEO_GetColor(), GEO_GetCultureTypeByPos(), GEO_GetNation(), GEO_GetPopulationTypeByPos(), GEO_GetTerrainTypeByPos(), nation_t::id, MapIsWater, and MAPTYPE_TERRAIN.

Referenced by CP_GetRandomPosOnGeoscapeWithParameters(), CP_MapIsSelectable(), and NAT_ScriptSanityCheck().

◆ GEO_PrintParameterStringByPos()

void GEO_PrintParameterStringByPos ( const vec2_t pos)

Prints positions parameter in console.

Parameters
[in]posLocation (latitude, longitude) where you want to check
Note
Used for printing in console, do not translate.
See also
NAT_ScriptSanityCheck

Definition at line 1876 of file cp_geoscape.cpp.

References cgi, GEO_GetCultureTypeByPos(), GEO_GetPopulationTypeByPos(), and GEO_GetTerrainTypeByPos().

Referenced by NAT_ScriptSanityCheck().

◆ GEO_Reset()

void GEO_Reset ( const char * map)

Definition at line 2225 of file cp_geoscape.cpp.

References GEO_Init(), GEO_ResetAction(), GEO_Shutdown(), and GEO_UpdateGeoscapeDock().

Referenced by CP_CampaignInit(), and CP_LoadXML().

◆ GEO_ResetAction()

◆ GEO_SelectAircraft()

void GEO_SelectAircraft ( aircraft_t * aircraft)

Select the specified aircraft on the geoscape.

Definition at line 1674 of file cp_geoscape.cpp.

References GEO_ResetAction(), and GEO_SetSelectedAircraft.

Referenced by AIM_AircraftStart_f(), AIR_GeoSelectAircraft_f(), AIR_MoveAircraftIntoNewHomebase(), CL_DisplayHomebasePopup(), and GEO_GetGeoscapeAngle().

◆ GEO_SelectMission()

struct mission_s * GEO_SelectMission ( struct mission_s * mission)

◆ GEO_SelectUFO()

void GEO_SelectUFO ( aircraft_t * ufo)

Select the specified ufo on the geoscape.

Definition at line 1665 of file cp_geoscape.cpp.

References GEO_ResetAction(), and GEO_SetSelectedUFO.

Referenced by GEO_GetGeoscapeAngle(), GEO_GetUFOAngle(), and UFO_GeoSelectUFO_f().

◆ GEO_SetOverlay()

void GEO_SetOverlay ( const char * overlayID,
int status )

Turn overlay on/off.

Parameters
[in]overlayIDName of the overlay you want to switch.
[in]statusOn/Off status to set

Definition at line 2250 of file cp_geoscape.cpp.

References B_AtLeastOneExists, cgi, GEO_IsRadarOverlayActivated(), Q_streq, and RADAR_UpdateWholeRadarOverlay().

Referenced by B_BuildBase_f(), B_SelectBase(), GEO_ResetAction(), GEO_SetOverlay_f(), INS_BuildInstallation_f(), INS_SelectType_f(), RADAR_DeactivateRadarOverlay(), and UFO_DetectNewUFO().

◆ GEO_Shutdown()

void GEO_Shutdown ( void )

Definition at line 2187 of file cp_geoscape.cpp.

References cgi, culturePic, nationsPic, populationPic, and terrainPic.

Referenced by CP_Shutdown(), GEO_Reset(), and CampaignTest::SetUp().

◆ GEO_UpdateGeoscapeDock()