UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_overlay.h File Reference

Functions to generate and render overlay for geoscape. More...

Go to the source code of this file.

Functions

void CP_DecreaseXVILevelEverywhere (void)
 
void CP_ChangeXVILevel (const vec2_t pos, float factor)
 Convert the pos into degrees and increase XVI there. More...
 
void CP_InitializeXVIOverlay (void)
 Initialize XVI overlay on geoscape. More...
 
void CP_GetXVIMapDimensions (int *width, int *height)
 
int CP_GetXVILevel (int x, int y)
 
void CP_SetXVILevel (int x, int y, int value)
 
void CP_InitializeRadarOverlay (bool source)
 Initialize radar overlay on geoscape. More...
 
void CP_AddRadarCoverage (const vec2_t pos, float innerRadius, float outerRadius, bool source)
 Add a radar coverage (base or aircraft) to radar overlay. More...
 
void CP_UploadRadarCoverage (void)
 Smooth radar coverage. More...
 

Detailed Description

Functions to generate and render overlay for geoscape.

Definition in file cp_overlay.h.

Function Documentation

void CP_AddRadarCoverage ( const vec2_t  pos,
float  innerRadius,
float  outerRadius,
bool  source 
)

Add a radar coverage (base or aircraft) to radar overlay.

Parameters
[in]posPosition of the center of radar
[in]innerRadiusRadius of the radar coverage
[in]outerRadiusRadius of the outer radar coverage
[in]sourceTrue if we must update the source of the radar coverage, false if the copy must be updated.
Precondition
We assume outerRadius is smaller than 180 degrees

< Alpha of the inner radar range

< Alpha of the outer radar range

< current position (in pixel)

< Bounding box of the inner radar zone

< Bounding box of the outer radar zone

Todo:
add EQUAL_EPSILON here?

Definition at line 367 of file cp_overlay.cpp.

References CP_DrawRadarOverlayRow(), CP_GetCircleDeltaLongitude(), CP_SetMinMaxOverlayRows(), f, RADAR_HEIGHT, and torad.

Referenced by RADAR_DrawCoverage(), and RADAR_UpdateStaticRadarCoverage().

void CP_ChangeXVILevel ( const vec2_t  pos,
float  factor 
)

Convert the pos into degrees and increase XVI there.

Parameters
posThe x/y-location in the flat XVI map
factorThe factor of the XVI raise
Note
xvi rate is null when alpha = 0, max when alpha = maxAlpha

Definition at line 257 of file cp_overlay.cpp.

References CP_IncreaseXVILevel(), f, XVI_HEIGHT, and XVI_WIDTH.

Referenced by CP_SpreadXVIAtPos().

void CP_DecreaseXVILevelEverywhere ( void  )
See also
R_IncreaseXVILevel

x,y: current position (in pixel)

Definition at line 237 of file cp_overlay.cpp.

References CP_GetXVILevel(), CP_SetXVILevel(), CP_UploadXVI(), XVI_HEIGHT, and XVI_WIDTH.

Referenced by CP_ReduceXVIEverywhere().

void CP_GetXVIMapDimensions ( int width,
int height 
)

Definition at line 52 of file cp_overlay.cpp.

References XVI_HEIGHT, and XVI_WIDTH.

Referenced by CP_UpdateNationXVIInfection(), and XVI_SaveXML().

void CP_InitializeRadarOverlay ( bool  source)

Initialize radar overlay on geoscape.

Parameters
[in]sourceInitialize the source texture if true: if you are updating base radar overlay. false if you are updating aircraft radar overlay (base radar overlay will be copied to aircraft radar overlay)

Definition at line 292 of file cp_overlay.cpp.

References cgi, INITIAL_ALPHA_VALUE, cgame_import_s::r_radarPic, cgame_import_s::r_radarSourcePic, RADAR_HEIGHT, and RADAR_WIDTH.

Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().

void CP_InitializeXVIOverlay ( void  )

Initialize XVI overlay on geoscape.

Note
xvi rate is null when alpha = 0, max when alpha = maxAlpha

Definition at line 269 of file cp_overlay.cpp.

References cgi, CP_UploadXVI(), cgame_import_s::r_xviAlpha, XVI_HEIGHT, and XVI_WIDTH.

Referenced by CP_CampaignInit(), CP_InitStartup(), and XVI_LoadXML().

void CP_SetXVILevel ( int  x,
int  y,
int  value 
)
void CP_UploadRadarCoverage ( void  )

Smooth radar coverage.

Note
allows to make texture pixels less visible.

Definition at line 422 of file cp_overlay.cpp.

References cgi, cgame_import_s::r_radarPic, RADAR_HEIGHT, and RADAR_WIDTH.

Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().