cp_radar.h File Reference

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

Go to the source code of this file.

Data Structures

struct  radar_s

Defines

#define MAX_UFOONGEOSCAPE   8

Typedefs

typedef struct radar_s radar_t

Functions

void RADAR_UpdateStaticRadarCoverage (void)
 Update every static radar drawing (radar that don't move: base and installation radar).
void RADAR_UpdateWholeRadarOverlay (void)
 Update radar overlay of base, installation and aircraft range.
void RADAR_DrawInMap (const struct uiNode_s *node, const radar_t *radar, const vec2_t pos)
void RADAR_DeactivateRadarOverlay (void)
 Deactivate Radar overlay if there is no more UFO on geoscape.
void RADAR_NotifyUFORemoved (const struct aircraft_s *ufo, qboolean destroyed)
void RADAR_Initialise (radar_t *radar, float range, float trackingRange, float level, qboolean updateSourceRadarMap)
 Set radar range to new value.
void RADAR_InitialiseUFOs (radar_t *radar)
 Reset UFO sensored on radar.
void RADAR_UpdateBaseRadarCoverage_f (void)
 Update radar coverage when building/destroying new radar.
void RADAR_UpdateInstallationRadarCoverage (struct installation_s *installation, const float radarRange, const float trackingRadarRange)
 Update radar coverage when building/destroying new radar.
void RADAR_AddDetectedUFOToEveryRadar (const struct aircraft_s const *ufo)
qboolean RADAR_CheckRadarSensored (const vec2_t pos)
 Check if the specified position is within base radar range.
qboolean RADAR_CheckUFOSensored (radar_t *radar, const vec2_t posRadar, const struct aircraft_s *ufo, qboolean detected)
void RADAR_SetRadarAfterLoading (void)
 Set radar to proper values after loading.

Variables

qboolean radarOverlayWasSet
const float RADAR_BASERANGE
const float RADAR_BASERTRACKINGANGE
const float RADAR_AIRCRAFTRANGE
const float RADAR_AIRCRAFTTRACKINGRANGE

Detailed Description

Definition in file cp_radar.h.


Define Documentation

#define MAX_UFOONGEOSCAPE   8

Typedef Documentation

typedef struct radar_s radar_t

Function Documentation

void RADAR_AddDetectedUFOToEveryRadar ( const struct aircraft_s const *  ufo  ) 
qboolean RADAR_CheckRadarSensored ( const vec2_t  pos  ) 

Check if the specified position is within base radar range.

Note:
aircraft radars are not checked (and this is intended)
Returns:
true if the position is inside one of the base radar range

Definition at line 480 of file cp_radar.c.

References B_GetFoundedBaseByIDX(), GetDistanceOnGlobe(), INS_GetFoundedInstallationByIDX(), MAX_BASES, MAX_INSTALLATIONS, installation_s::pos, base_s::pos, qfalse, qtrue, and radar.

Referenced by AIRFIGHT_ExecuteActions(), CP_CheckMissionVisibleOnGeoscape(), and CP_UFORemoveFromGeoscape().

qboolean RADAR_CheckUFOSensored ( radar_t radar,
const vec2_t  posRadar,
const struct aircraft_s ufo,
qboolean  detected 
)
void RADAR_DeactivateRadarOverlay ( void   ) 
void RADAR_DrawInMap ( const struct uiNode_s node,
const radar_t radar,
const vec2_t  pos 
)
void RADAR_Initialise ( radar_t radar,
float  range,
float  trackingRange,
float  level,
qboolean  updateSourceRadarMap 
)

Set radar range to new value.

Parameters:
[in,out] radar The radar to update/initialize
[in] range New range of the radar
[in] trackingRange New tracking range of the radar
[in] level The tech level of the radar
[in] updateSourceRadarMap if the radar overlay should be updated.

Definition at line 332 of file cp_radar.c.

References radar_s::numUFOs, RADAR_UpdateStaticRadarCoverage(), RADAR_UpdateWholeRadarOverlay(), RADAR_UPGRADE_MULTIPLIER, radar_s::range, and radar_s::trackingRange.

Referenced by AIR_NewAircraft(), B_LoadXML(), B_SetUpBase(), INS_LoadXML(), INS_SetUpInstallation(), RADAR_UpdateBaseRadarCoverage_f(), and RADAR_UpdateInstallationRadarCoverage().

void RADAR_InitialiseUFOs ( radar_t radar  ) 

Reset UFO sensored on radar.

Parameters:
[out] radar The radar to initialize.

Definition at line 356 of file cp_radar.c.

References radar_s::numUFOs, and radar_s::ufos.

Referenced by AIR_LoadAircraftXML(), AIR_ParseAircraft(), B_AircraftReturnedToHomeBase(), B_LoadXML(), B_SetUpBase(), and INS_LoadXML().

void RADAR_NotifyUFORemoved ( const struct aircraft_s ufo,
qboolean  destroyed 
)
void RADAR_SetRadarAfterLoading ( void   ) 

Set radar to proper values after loading.

Note:
numUFOs is not saved, so we must calculate it.
should be called after loading.

Definition at line 572 of file cp_radar.c.

References ccs, aircraft_s::detected, MAP_UpdateGeoscapeDock(), ccs_s::numUFOs, RADAR_AddDetectedUFOToEveryRadar(), and UFO_GetByIDX().

Referenced by SAV_GameActionsAfterLoad().

void RADAR_UpdateBaseRadarCoverage_f ( void   ) 

Update radar coverage when building/destroying new radar.

Note:
This must be called on each radar build/destruction because radar facilities may have different level.
This must also be called when radar installation become inactive or active (due to dependencies)
called with update_base_radar_coverage

Definition at line 368 of file cp_radar.c.

References B_GetFoundedBaseByIDX(), B_GetMaxBuildingLevel(), B_RADAR, Cmd_Argc(), Cmd_Argv(), Com_Printf(), CP_UpdateMissionVisibleOnGeoscape(), level, MAX_BASES, qtrue, base_s::radar, RADAR_BASERANGE, RADAR_BASETRACKINGRANGE, and RADAR_Initialise().

void RADAR_UpdateInstallationRadarCoverage ( installation_t installation,
const float  radarRange,
const float  trackingRadarRange 
)

Update radar coverage when building/destroying new radar.

Parameters:
[in,out] installation The radartower to update
[in] radarRange New range of the radar
[in] trackingRadarRange New tracking range of the radar

Definition at line 402 of file cp_radar.c.

References Com_Error(), CP_UpdateMissionVisibleOnGeoscape(), ERR_DROP, installation_s::founded, INSTALLATION_WORKING, installation_s::installationStatus, installation_s::installationTemplate, qtrue, installation_s::radar, RADAR_Initialise(), RADAR_INSTALLATIONLEVEL, installationTemplate_s::radarRange, and installationTemplate_s::trackingRange.

Referenced by INS_DestroyInstallation(), INS_FinishInstallation(), and INS_LoadXML().

void RADAR_UpdateStaticRadarCoverage ( void   ) 
void RADAR_UpdateWholeRadarOverlay ( void   ) 

Variable Documentation

const float RADAR_AIRCRAFTRANGE

Definition at line 45 of file cp_radar.c.

Referenced by AIR_NewAircraft().

Definition at line 46 of file cp_radar.c.

Referenced by AIR_NewAircraft().

const float RADAR_BASERANGE

Definition at line 43 of file cp_radar.c.

Referenced by RADAR_UpdateBaseRadarCoverage_f().

used to store the previous configuration of overlay before radar is automatically turned on (e.g when creating base or when UFO appears)

Definition at line 40 of file cp_radar.c.

Referenced by CP_LoadXML(), CP_SaveXML(), MAP_ResetAction(), MAP_SetOverlay_f(), and RADAR_DeactivateRadarOverlay().


Generated by  doxygen 1.6.2