UFO: Alien Invasion
|
Header for Geoscape management. More...
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) (color[0] == 0 && color[1] == 0 && color[2] == 64) |
#define | MapIsWestern(color) (color[0] == 128 && color[1] == 255 && color[2] == 255) |
#define | MapIsEastern(color) (color[0] == 255 && color[1] == 128 && color[2] == 0) |
#define | MapIsOriental(color) (color[0] == 255 && color[1] == 0 && color[2] == 0) |
#define | MapIsAfrican(color) (color[0] == 128 && color[1] == 128 && color[2] == 255) |
#define | MapIsUrban(color) (color[0] == 128 && color[1] == 255 && color[2] == 255) |
#define | MapIsSuburban(color) (color[0] == 255 && color[1] == 128 && color[2] == 0) |
#define | MapIsVillage(color) (color[0] == 255 && color[1] == 0 && color[2] == 0) |
#define | MapIsRural(color) (color[0] == 128 && color[1] == 128 && color[2] == 255) |
#define | MapIsNopopulation(color) (color[0] == 128 && color[1] == 255 && color[2] == 0) |
#define | RASTER 2 |
#define | GEO_IsAircraftSelected(aircraft) ((aircraft) == ccs.geoscape.selectedAircraft) |
#define | GEO_IsInterceptorSelected(aircraft) ((aircraft) == ccs.geoscape.interceptAircraft) |
#define | GEO_IsUFOSelected(ufo) ((ufo) == ccs.geoscape.selectedUFO) |
#define | GEO_IsMissionSelected(mission) ((mission) == ccs.geoscape.selectedMission) |
#define | GEO_GetSelectedAircraft() (ccs.geoscape.selectedAircraft) |
#define | GEO_GetInterceptorAircraft() (ccs.geoscape.interceptAircraft) |
#define | GEO_GetSelectedUFO() (ccs.geoscape.selectedUFO) |
#define | GEO_GetSelectedMission() (ccs.geoscape.selectedMission) |
#define | GEO_GetMissionAircraft() (ccs.geoscape.missionAircraft) |
#define | GEO_SetSelectedAircraft(aircraft) (ccs.geoscape.selectedAircraft = (aircraft)) |
#define | GEO_SetInterceptorAircraft(interceptor) (ccs.geoscape.interceptAircraft = (interceptor)) |
#define | GEO_SetSelectedUFO(ufo) (ccs.geoscape.selectedUFO = (ufo)) |
#define | GEO_SetSelectedMission(mission) (ccs.geoscape.selectedMission = (mission)) |
#define | GEO_SetMissionAircraft(aircraft) (ccs.geoscape.missionAircraft = (aircraft)) |
Functions | |
void | GEO_DrawMarkers (const uiNode_t *node) |
Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D) More... | |
bool | GEO_Click (const uiNode_t *node, int x, int y, const vec2_t pos) |
Click on the map/geoscape. More... | |
nation_t * | GEO_GetNation (const vec2_t pos) |
Translate nation map color to nation. More... | |
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. More... | |
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. More... | |
void | GEO_Draw (geoscapeData_t *data) |
Draw the geoscape. More... | |
void | GEO_CenterOnPoint_f (void) |
Switch to next model on 2D and 3D geoscape. More... | |
void | GEO_CenterPosition (const vec2_t pos) |
Start to rotate or shift the globe to the given position. More... | |
base_t * | GEO_PositionCloseToBase (const vec2_t pos) |
Check if given pos is close to an existing base. More... | |
void | GEO_ResetAction (void) |
No more special action on the geoscape. More... | |
void | GEO_SelectAircraft (aircraft_t *aircraft) |
Select the specified aircraft on the geoscape. More... | |
void | GEO_SelectUFO (aircraft_t *ufo) |
Select the specified ufo on the geoscape. More... | |
struct mission_s * | GEO_SelectMission (struct mission_s *mission) |
Select the specified mission. More... | |
void | GEO_NotifyMissionRemoved (const struct mission_s *mission) |
void | GEO_NotifyUFORemoved (const aircraft_t *ufo, bool destroyed) |
Notify that a UFO has been removed. More... | |
void | GEO_NotifyAircraftRemoved (const aircraft_t *aircraft) |
Notify that an aircraft has been removed from game. More... | |
void | GEO_NotifyUFODisappear (const aircraft_t *ufo) |
Notify that a UFO disappears on radars. More... | |
void | GEO_InitStartup (void) |
Initialise MAP/Geoscape. More... | |
int | GEO_GetCivilianNumberByPosition (const vec2_t pos) |
Get number of civilian on a map at given position. More... | |
void | GEO_PrintParameterStringByPos (const vec2_t pos) |
Prints positions parameter in console. More... | |
void | GEO_CheckPositionBoundaries (float *pos) |
Check that a position (in latitude / longitude) is within boundaries. More... | |
bool | GEO_IsNight (const vec2_t pos) |
Check whether given position is Day or Night. More... | |
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. More... | |
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) More... | |
void | GEO_SetOverlay (const char *overlayID, int status) |
Turn overlay on/off. More... | |
void | GEO_UpdateGeoscapeDock (void) |
Will add missions and UFOs to the geoscape dock panel. More... | |
bool | GEO_IsRadarOverlayActivated (void) |
void | CP_GetRandomPosOnGeoscape (vec2_t pos, bool noWater) |
Determines a random position on geoscape. More... | |
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. More... | |
Header for Geoscape management.
Definition in file cp_geoscape.h.
#define GEO_GetInterceptorAircraft | ( | ) | (ccs.geoscape.interceptAircraft) |
Definition at line 57 of file cp_geoscape.h.
Referenced by AM_Check_f(), and AM_Go_f().
#define GEO_GetMissionAircraft | ( | ) | (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().
#define GEO_GetSelectedAircraft | ( | ) | (ccs.geoscape.selectedAircraft) |
Definition at line 56 of file cp_geoscape.h.
Referenced by CL_PopupChangeHomebase_f(), GEO_Click(), and GEO_Draw().
#define GEO_GetSelectedMission | ( | ) | (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().
#define GEO_GetSelectedUFO | ( | ) | (ccs.geoscape.selectedUFO) |
Definition at line 58 of file cp_geoscape.h.
Referenced by CL_PopupInterceptBaseClick_f(), GEO_Draw(), and GEO_NotifyUFORemoved().
#define GEO_IsAircraftSelected | ( | aircraft | ) | ((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().
#define GEO_IsInterceptorSelected | ( | aircraft | ) | ((aircraft) == ccs.geoscape.interceptAircraft) |
Definition at line 52 of file cp_geoscape.h.
Referenced by GEO_NotifyAircraftRemoved().
#define GEO_IsMissionSelected | ( | mission | ) | ((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().
#define GEO_IsUFOSelected | ( | ufo | ) | ((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().
#define GEO_SetInterceptorAircraft | ( | interceptor | ) | (ccs.geoscape.interceptAircraft = (interceptor)) |
Definition at line 63 of file cp_geoscape.h.
Referenced by AIR_Move(), AIR_SendAircraftToMission(), CP_BaseAttackPrepareBattle(), and GEO_ResetAction().
#define GEO_SetMissionAircraft | ( | aircraft | ) | (ccs.geoscape.missionAircraft = (aircraft)) |
Definition at line 66 of file cp_geoscape.h.
Referenced by AIR_Move(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackMissionIsFailure(), and CP_BaseAttackPrepareBattle().
#define GEO_SetSelectedAircraft | ( | aircraft | ) | (ccs.geoscape.selectedAircraft = (aircraft)) |
Definition at line 62 of file cp_geoscape.h.
Referenced by CP_SpawnRescueMission(), GEO_ResetAction(), and GEO_SelectAircraft().
#define GEO_SetSelectedMission | ( | mission | ) | (ccs.geoscape.selectedMission = (mission)) |
Definition at line 65 of file cp_geoscape.h.
Referenced by CP_StartSelectedMission(), GEO_ResetAction(), and GEO_SelectMission().
#define GEO_SetSelectedUFO | ( | ufo | ) | (ccs.geoscape.selectedUFO = (ufo)) |
Definition at line 64 of file cp_geoscape.h.
Referenced by GEO_ResetAction(), and GEO_SelectUFO().
#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().
#define MapIsAfrican | ( | color | ) | (color[0] == 128 && color[1] == 128 && color[2] == 255) |
Definition at line 38 of file cp_geoscape.h.
Referenced by GEO_GetCultureType().
#define MapIsEastern | ( | color | ) | (color[0] == 255 && color[1] == 128 && color[2] == 0) |
Definition at line 36 of file cp_geoscape.h.
Referenced by GEO_GetCultureType().
#define MapIsNopopulation | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 0) |
Definition at line 45 of file cp_geoscape.h.
Referenced by GEO_GetCivilianNumberByPosition().
#define MapIsOriental | ( | color | ) | (color[0] == 255 && color[1] == 0 && color[2] == 0) |
Definition at line 37 of file cp_geoscape.h.
Referenced by GEO_GetCultureType().
#define MapIsRural | ( | color | ) | (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().
#define MapIsSuburban | ( | color | ) | (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().
#define MapIsUrban | ( | color | ) | (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().
#define MapIsVillage | ( | color | ) | (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().
#define MapIsWater | ( | color | ) | (color[0] == 0 && color[1] == 0 && color[2] == 64) |
Definition at line 32 of file cp_geoscape.h.
Referenced by AIRFIGHT_ActionsAfterAirfight(), B_MoveAircraftOnGeoscapeToOtherBases(), CP_ChooseMap(), CP_GetRandomPosOnGeoscape(), CP_SpawnUFOCarrier_f(), GEO_Click(), GEO_GetCivilianNumberByPosition(), GEO_GetColor(), GEO_GetCultureType(), GEO_GetPopulationType(), GEO_PositionFitsTCPNTypes(), NAT_ScriptSanityCheck(), and TEST_F().
#define MapIsWestern | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 255) |
Definition at line 35 of file cp_geoscape.h.
Referenced by GEO_GetCultureType().
#define RASTER 2 |
Definition at line 49 of file cp_geoscape.h.
Referenced by CP_GetRandomPosOnGeoscapeWithParameters().
Determines a random position on geoscape.
[out] | pos | The position that will be overwritten. pos[0] is within -180, +180. pos[1] within -90, +90. |
[in] | noWater | True if the position should not be on water |
Definition at line 2084 of file cp_geoscape.cpp.
References cgi, DEBUG_CLIENT, f, frand(), GEO_GetColor(), MapIsWater, MAPTYPE_TERRAIN, and todeg.
Referenced by AB_SetAlienBasePosition(), CP_AttackUFOCarrier_f(), UFO_SetRandomDest(), and UFO_SetRandomPos().
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.
[out] | pos | The position that will be overwritten with the random point fulfilling the criteria. pos[0] is within -180, +180. pos[1] within -90, +90. |
[in] | terrainTypes | A linkedList_t containing a list of strings determining the acceptable terrain types (e.g. "grass") May be nullptr. |
[in] | cultureTypes | A linkedList_t containing a list of strings determining the acceptable culture types (e.g. "western") May be nullptr. |
[in] | populationTypes | A linkedList_t containing a list of strings determining the acceptable population types (e.g. "suburban") May be nullptr. |
[in] | nations | A linkedList_t containing a list of strings determining the acceptable nations (e.g. "asia"). May be nullptr |
Definition at line 2108 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().
Select which function should be used for calculating the direction of model on 2D or 3D geoscape.
[in] | start | Latitude and longitude of the position of the model. |
[in] | end | Latitude and longitude of aimed point. |
[in] | direction | vec3_t giving current direction of the model (nullptr if the model is idle). |
[out] | ortVector | If not nullptr, this will be filled with the normalized vector around which rotation allows to go toward direction . |
start
going toward end
. Zero value is the direction of North pole. Definition at line 716 of file cp_geoscape.cpp.
References mapExtraData_s::flatgeoscape, GEO_AngleOfPath2D(), GEO_AngleOfPath3D(), geoscapeNode, and UI_MAPEXTRADATA.
Referenced by AIRFIGHT_GetNextPointInPath(), GEO_DrawMapOnePhalanxAircraft(), and GEO_DrawMarkers().
Calculate the shortest way to go from start to end on a sphere.
[in] | start | The point you start from |
[in] | end | The point you go to |
[out] | line | Contains the shortest path to go from start to end |
Definition at line 371 of file cp_geoscape.cpp.
References CrossProduct(), mapline_s::distance, i, LINE_MAXPTS, LINE_MAXSEG, M_PI, mapline_s::numPoints, mapline_s::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().
Switch to next model on 2D and 3D geoscape.
smoothRotation
to true
to allow a smooth rotation in GEO_Draw. Definition at line 971 of file cp_geoscape.cpp.
References centerOnEventIdx, cgi, GEO_CenterPosition(), GEO_GetGeoscapeAngle(), geoscapeNode, Q_streq, and cgame_import_s::UI_GetActiveWindowName().
Start to rotate or shift the globe to the given position.
[in] | pos | Longitude and latitude of the position to center on |
Definition at line 810 of file cp_geoscape.cpp.
References mapExtraData_s::flatgeoscape, GEO_ConvertObjectPositionToGeoscapePosition(), GEO_StartCenter(), geoscapeNode, mapExtraData_s::smoothFinal2DGeoscapeCenter, mapExtraData_s::smoothFinalGlobeAngle, and UI_MAPEXTRADATA.
Referenced by CP_SpawnUFOCarrier_f(), and GEO_CenterOnPoint_f().
void GEO_CheckPositionBoundaries | ( | float * | pos | ) |
Check that a position (in latitude / longitude) is within boundaries.
[in,out] | pos | Pointer to the 2 elements vector giving the position. |
Definition at line 1890 of file cp_geoscape.cpp.
Referenced by AIR_AircraftMakeMove(), AIR_Move(), and UFO_CampaignRunUFOs().
Click on the map/geoscape.
[in] | node | UI Node of the geoscape map |
[in] | x,y | Mouse click coordinates |
[in] | pos | Geoscape (longitude, latitude) coordinate of the click |
Definition at line 106 of file cp_geoscape.cpp.
References AIR_AircraftHasEnoughFuel(), AIR_Foreach, AIR_IsAircraftOnGeoscape(), AIR_TRANSIT, aircraft_s::aircraftTarget, B_GetCount(), B_GetNext(), ccs, cgi, CP_GameTimeStop(), GEO_CalcLine(), GEO_GetColor(), GEO_GetSelectedAircraft, GEO_IsPositionSelected(), GEO_ResetAction(), base_s::idx, INS_Foreach, MA_NEWBASE, MA_NEWINSTALLATION, ccs_s::mapAction, MapIsWater, MAPTYPE_TERRAIN, MAX_BASES, MIS_Foreach, MIS_GetIdx(), MIS_GetName(), base_s::name, ccs_s::newBasePos, aircraft_s::point, base_s::pos, aircraft_s::pos, aircraft_s::route, STAGE_NOT_ACTIVE, aircraft_s::status, aircraft_s::time, UFO_GetGeoscapeIDX, UFO_GetName(), UFO_GetNextOnGeoscape(), and Vector2Copy.
void GEO_Draw | ( | geoscapeData_t * | data | ) |
Draw the geoscape.
[in] | data | Geoscape status data structure |
Definition at line 1588 of file cp_geoscape.cpp.
References _, geoscapeData_s::active, AIR_IsAircraftInBase(), ccs, cgi, Com_sprintf(), CP_IsRunning(), ccs_s::curCampaign, geoscapeData_s::date, ccs_s::date, GEO_GetAircraftText(), GEO_GetMissionText(), GEO_GetSelectedAircraft, GEO_GetSelectedMission, GEO_GetSelectedUFO, GEO_GetUFOText(), GEO_IsNationOverlayActivated(), GEO_IsRadarOverlayActivated(), GEO_IsXVIOverlayActivated(), GEO_ResetAction(), geoscapeData_s::geoscapeNode, cvar_s::integer, lengthof, MA_NEWBASE, MA_NEWINSTALLATION, MA_NONE, geoscapeData_s::map, campaign_s::map, ccs_s::mapAction, geoscapeData_s::nationOverlay, ccs_s::overallInterest, geoscapeData_s::radarOverlay, TEXT_STANDARD, textStandard, and geoscapeData_s::xviOverlay.
Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D)
[in] | node | The menu node which will be used for drawing markers. |
Definition at line 1431 of file cp_geoscape.cpp.
References _, aircraftProjectile_s::aimedAircraft, AIR_Foreach, AIR_IsAircraftOnGeoscape(), aircraftProjectile_s::aircraftItem, ALIGN_UC, aircraftProjectile_s::angle, aircraftProjectile_s::attackerPos, aircraftProjectile_s::attackingAircraft, B_GetNext(), aircraftProjectile_s::beam, craftitem_s::beamColor, aircraftProjectile_s::bullets, ccs, cgi, uiNode_t::color, CP_IsXVIVisible(), objDef_s::craftitem, aircraft_s::direction, f, mapExtraData_s::flatgeoscape, ccs_s::frametime, ccs_s::gameTimeScale, GEO_3DMapDrawLine(), GEO_AllMapToScreen(), GEO_AngleOfPath(), GEO_Draw3DMarkerIfVisible(), GEO_DrawAircraftHealthBar(), GEO_DrawBeam(), GEO_DrawBullets(), GEO_DrawMapOneBase(), GEO_DrawMapOneInstallation(), GEO_DrawMapOneMission(), GEO_DrawMapOnePhalanxAircraft(), GEO_IsUFOSelected, GEO_MapDrawEquidistantPoints(), GEO_MapDrawLine(), GEO_RenderImage(), aircraftProjectile_s::hasMoved, i, aircraftProjectile_s::idleTarget, INS_Foreach, LinearInterpolation, MIS_Foreach, aircraft_s::model, objDef_s::model, NAT_Foreach, NAT_GetCurrentMonthInfo(), aircraftProjectile_s::numInterpolationPoints, mapline_s::numPoints, ccs_s::numProjectiles, mapline_s::point, aircraftProjectile_s::pos, aircraft_s::pos, aircraftProjectile_s::projectedPos, ccs_s::projectiles, Q_strcat(), aircraft_s::route, RS_IsResearched_ptr(), SELECT_CIRCLE_RADIUS, aircraft_s::tech, TEXT_XVI, UFO_GetNextOnGeoscape(), cgame_import_s::UI_GetFontFromNode(), UI_MAPEXTRADATACONST, VectorCopy, nationInfo_s::xviInfection, and yellow.
Get number of civilian on a map at given position.
[in] | pos | Position where the mission takes place. |
Definition at line 1848 of file cp_geoscape.cpp.
References cgi, ERR_DROP, GEO_GetColor(), MapIsNopopulation, MapIsRural, MapIsSuburban, MapIsUrban, MapIsVillage, MapIsWater, and MAPTYPE_POPULATION.
Referenced by CP_CreateCivilianTeam().
Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given position.
[in] | pos | vec2_t Value of position on map to get the color value from. pos is longitude and latitude |
[in] | type | determine 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] | coast | The 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. |
Definition at line 1934 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, and terrainWidth.
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().
Translate nation map color to nation.
[in] | pos | Map Coordinates to get the nation from |
Definition at line 1744 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().
void GEO_Init | ( | const char * | map | ) |
Definition at line 2201 of file cp_geoscape.cpp.
References cgi, cultureHeight, culturePic, cultureWidth, ERR_DROP, nationsHeight, nationsPic, nationsWidth, populationHeight, populationPic, populationWidth, terrainHeight, terrainPic, terrainWidth, and va().
Referenced by GEO_Reset(), and CampaignTest::SetUp().
Initialise MAP/Geoscape.
Definition at line 2293 of file cp_geoscape.cpp.
References cgi, CVAR_DEVELOPER, cgame_import_s::Cvar_Get(), GEO_ResetAction(), GEO_SelectObject_f(), and GEO_SetOverlay_f().
Referenced by CP_InitStartup().
bool GEO_IsNight | ( | const vec2_t | pos | ) |
Check whether given position is Day or Night.
[in] | pos | Given position. |
Definition at line 1907 of file cp_geoscape.cpp.
References ccs, COS_ALPHA, ccs_s::date, date_s::day, DAYS_PER_YEAR_AVG, M_PI, date_s::sec, SECONDS_PER_DAY, SIN_ALPHA, and torad.
Referenced by B_AssembleMap_f(), BATTLE_Start(), and GEO_DrawMapOneMission().
bool GEO_IsRadarOverlayActivated | ( | void | ) |
Definition at line 84 of file cp_geoscape.cpp.
References cgi.
Referenced by AIR_CampaignRun(), B_BuildBase_f(), B_SelectBase(), GEO_Draw(), GEO_DrawMapOneBase(), GEO_DrawMapOneInstallation(), GEO_DrawMapOnePhalanxAircraft(), GEO_SetOverlay(), GEO_SetOverlay_f(), INS_BuildInstallation_f(), INS_SelectType_f(), RADAR_DeactivateRadarOverlay(), and UFO_DetectNewUFO().
void GEO_NotifyAircraftRemoved | ( | const aircraft_t * | aircraft | ) |
Notify that an aircraft has been removed from game.
[in] | aircraft | Pointer to the aircraft that has been removed |
Definition at line 1729 of file cp_geoscape.cpp.
References GEO_IsAircraftSelected, GEO_IsInterceptorSelected, and GEO_ResetAction().
Referenced by AIR_DeleteAircraft().
void GEO_NotifyUFODisappear | ( | const aircraft_t * | ufo | ) |
Notify that a UFO disappears on radars.
Definition at line 2235 of file cp_geoscape.cpp.
References GEO_IsUFOSelected, GEO_ResetAction(), and GEO_UpdateGeoscapeDock().
Referenced by UFO_CampaignCheckEvents().
void GEO_NotifyUFORemoved | ( | const aircraft_t * | ufo, |
bool | destroyed | ||
) |
Notify that a UFO has been removed.
[in] | ufo | Pointer to the ufo has been removed |
[in] | destroyed | True if the UFO has been destroyed, false if it's been only set invisible (landed) |
Definition at line 1710 of file cp_geoscape.cpp.
References ccs, GEO_GetSelectedUFO, GEO_IsUFOSelected, GEO_ResetAction(), GEO_UpdateGeoscapeDock(), ccs_s::geoscape, and ccs_s::selectedUFO.
Referenced by CP_UFORemoveFromGeoscape().
Check if given pos is close to an existing base.
Definition at line 2029 of file cp_geoscape.cpp.
References B_GetNext(), GetDistanceOnGlobe(), MIN_DIST_BASE, and base_s::pos.
Referenced by AB_SetAlienBasePosition(), CP_HarvestMissionGo(), CP_ReconMissionGroundGo(), and CP_TerrorMissionGo().
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)
[in] | pos | Location to be tested |
[in] | terrainTypes | A linkedList_t containing a list of strings determining the terrain types to be tested for (e.g. "grass") may be nullptr |
[in] | cultureTypes | A linkedList_t containing a list of strings determining the culture types to be tested for (e.g. "western") may be nullptr |
[in] | populationTypes | A linkedList_t containing a list of strings determining the population types to be tested for (e.g. "suburban") may be nullptr |
[in] | nations | A linkedList_t containing a list of strings determining the nations to be tested for (e.g. "asia") may be nullptr |
Definition at line 2049 of file cp_geoscape.cpp.
References cgi, GEO_GetColor(), GEO_GetCultureTypeByPos(), GEO_GetNation(), GEO_GetPopulationTypeByPos(), GEO_GetTerrainTypeByPos(), nation_s::id, cgame_import_s::LIST_ContainsString(), MapIsWater, and MAPTYPE_TERRAIN.
Referenced by CP_GetRandomPosOnGeoscapeWithParameters(), CP_MapIsSelectable(), and NAT_ScriptSanityCheck().
Prints positions parameter in console.
[in] | pos | Location (latitude, longitude) where you want to check |
Definition at line 1875 of file cp_geoscape.cpp.
References cgi, GEO_GetCultureTypeByPos(), GEO_GetPopulationTypeByPos(), and GEO_GetTerrainTypeByPos().
Referenced by NAT_ScriptSanityCheck().
void GEO_Reset | ( | const char * | map | ) |
Definition at line 2224 of file cp_geoscape.cpp.
References GEO_Init(), GEO_ResetAction(), GEO_Shutdown(), and GEO_UpdateGeoscapeDock().
Referenced by CP_CampaignInit(), and CP_LoadXML().
No more special action on the geoscape.
Definition at line 1646 of file cp_geoscape.cpp.
References B_AtLeastOneExists, ccs, GEO_SetInterceptorAircraft, GEO_SetOverlay(), GEO_SetSelectedAircraft, GEO_SetSelectedMission, GEO_SetSelectedUFO, MA_NONE, ccs_s::mapAction, and radarOverlayWasSet.
Referenced by B_SelectBase(), CL_PopupInterceptRClick_f(), GEO_Click(), GEO_Draw(), GEO_InitStartup(), GEO_NotifyAircraftRemoved(), GEO_NotifyMissionRemoved(), GEO_NotifyUFODisappear(), GEO_NotifyUFORemoved(), GEO_Reset(), GEO_SelectAircraft(), GEO_SelectMission(), GEO_SelectUFO(), and INS_SelectType_f().
void GEO_SelectAircraft | ( | aircraft_t * | aircraft | ) |
Select the specified aircraft on the geoscape.
Definition at line 1673 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().
Select the specified mission.
[in] | mission | Pointer to the mission to select |
Definition at line 1684 of file cp_geoscape.cpp.
References GEO_GetSelectedMission, GEO_IsMissionSelected, GEO_ResetAction(), and GEO_SetSelectedMission.
Referenced by AIR_Move(), CP_BaseAttackPrepareBattle(), GEO_GetGeoscapeAngle(), GEO_GetMissionAngle(), and MIS_GeoSelectMission_f().
void GEO_SelectUFO | ( | aircraft_t * | ufo | ) |
Select the specified ufo on the geoscape.
Definition at line 1664 of file cp_geoscape.cpp.
References GEO_ResetAction(), and GEO_SetSelectedUFO.
Referenced by GEO_GetGeoscapeAngle(), GEO_GetUFOAngle(), and UFO_GeoSelectUFO_f().
Turn overlay on/off.
[in] | overlayID | Name of the overlay you want to switch. |
[in] | status | On/Off status to set |
Definition at line 2249 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().
Definition at line 2186 of file cp_geoscape.cpp.
References cgi, culturePic, nationsPic, populationPic, and terrainPic.
Referenced by CP_Shutdown(), GEO_Reset(), and CampaignTest::SetUp().
Will add missions and UFOs to the geoscape dock panel.
Definition at line 1397 of file cp_geoscape.cpp.
References _, cgi, GEO_GetUFOText(), MIS_Foreach, MIS_GetModel(), MIS_GetName(), aircraft_s::model, UFO_GetGeoscapeIDX, and UFO_GetNextOnGeoscape().
Referenced by CP_MissionAddToGeoscape(), GEO_NotifyMissionRemoved(), GEO_NotifyUFODisappear(), GEO_NotifyUFORemoved(), GEO_Reset(), RADAR_SetRadarAfterLoading(), and UFO_DetectNewUFO().