Go to the source code of this file.
Defines | |
#define | OVERLAY_NATION (1<<0) |
#define | OVERLAY_XVI (1<<1) |
#define | OVERLAY_RADAR (1<<2) |
Functions | |
void | CP_DecreaseXVILevelEverywhere (void) |
void | CP_ChangeXVILevel (const vec2_t pos, float factor) |
void | CP_InitializeXVIOverlay (const byte *data) |
Initialize XVI overlay on geoscape. | |
void | CP_InitOverlay (void) |
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 (qboolean source) |
Radar overlay code description The radar overlay is handled in 2 times : bases radar range and aircraft radar range. Bases radar range needs to be updated only when a radar facilities is built or destroyed. The base radar overlay is stored in r_radarSourcePic. Aircraft radar overlay needs to be updated every time an aircraft moves, because the position of the radar moves. this overlay is created by duplicating r_radarSourcePic, and then adding any aircraft radar coverage. It is stored in r_radarTexture. | |
void | CP_AddRadarCoverage (const vec2_t pos, float innerRadius, float outerRadius, qboolean source) |
Add a radar coverage (base or aircraft) to radar overlay. | |
void | CP_UploadRadarCoverage (void) |
Smooth radar coverage. | |
void | CP_ShutdownOverlay (void) |
void | CP_CalcAndUploadDayAndNightTexture (float q) |
Applies alpha values to the night overlay image for 2d geoscape. |
#define OVERLAY_NATION (1<<0) |
Definition at line 40 of file cp_overlay.h.
Referenced by MAP_IsNationOverlayActivated(), and MAP_SetOverlay().
#define OVERLAY_RADAR (1<<2) |
Definition at line 42 of file cp_overlay.h.
Referenced by MAP_IsRadarOverlayActivated(), and MAP_SetOverlay().
#define OVERLAY_XVI (1<<1) |
Definition at line 41 of file cp_overlay.h.
Referenced by MAP_IsXVIOverlayActivated(), and MAP_SetOverlay().
void CP_AddRadarCoverage | ( | const vec2_t | pos, | |
float | innerRadius, | |||
float | outerRadius, | |||
qboolean | source | |||
) |
Add a radar coverage (base or aircraft) to radar overlay.
[in] | pos | Position of the center of radar |
[in] | innerRadius | Radius of the radar coverage |
[in] | outerRadius | Radius of the outer radar coverage |
[in] | source | True if we must update the source of the radar coverage, false if the copy must be updated. |
< 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
Definition at line 420 of file cp_overlay.c.
References byte, CP_DrawRadarOverlayRow(), CP_GetCircleDeltaLongitude(), CP_SetMinMaxOverlayRows(), f, RADAR_HEIGHT, and torad.
Referenced by RADAR_DrawCoverage(), and RADAR_UpdateStaticRadarCoverage().
void CP_CalcAndUploadDayAndNightTexture | ( | float | q | ) |
Applies alpha values to the night overlay image for 2d geoscape.
[in] | q | The angle the sun is standing against the equator on earth |
Definition at line 66 of file cp_overlay.c.
References byte, COS_ALPHA, DAN_HEIGHT, DAN_WIDTH, DAWN, HIGH_LAT, LOW_LAT, pos, r_dayandnightAlpha, R_UploadAlpha(), and SIN_ALPHA.
Referenced by MAP_DrawMap().
void CP_ChangeXVILevel | ( | const vec2_t | pos, | |
float | factor | |||
) |
Definition at line 304 of file cp_overlay.c.
References CP_IncreaseXVILevel(), f, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_SpreadXVIAtPos().
void CP_DecreaseXVILevelEverywhere | ( | void | ) |
< current position (in pixel)
Definition at line 289 of file cp_overlay.c.
References CP_GetXVILevel(), CP_SetXVILevel(), R_UploadAlpha(), r_xviAlpha, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_ReduceXVIEverywhere().
int CP_GetXVILevel | ( | int | x, | |
int | y | |||
) |
Definition at line 122 of file cp_overlay.c.
References INITIAL_ALPHA_VALUE, r_xviAlpha, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_DecreaseXVILevelEverywhere(), CP_DrawXVIOverlayPixel(), CP_IncreaseXVILevel(), CP_UpdateNationXVIInfection(), and XVI_SaveXML().
void CP_GetXVIMapDimensions | ( | int * | width, | |
int * | height | |||
) |
Definition at line 103 of file cp_overlay.c.
References XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_UpdateNationXVIInfection(), and XVI_SaveXML().
void CP_InitializeRadarOverlay | ( | qboolean | source | ) |
Radar overlay code description The radar overlay is handled in 2 times : bases radar range and aircraft radar range. Bases radar range needs to be updated only when a radar facilities is built or destroyed. The base radar overlay is stored in r_radarSourcePic. Aircraft radar overlay needs to be updated every time an aircraft moves, because the position of the radar moves. this overlay is created by duplicating r_radarSourcePic, and then adding any aircraft radar coverage. It is stored in r_radarTexture.
[in] | source | Initialize the source texture if qtrue: 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 345 of file cp_overlay.c.
References INITIAL_ALPHA_VALUE, r_radarPic, and r_radarSourcePic.
Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().
void CP_InitializeXVIOverlay | ( | const byte * | data | ) |
Initialize XVI overlay on geoscape.
[in] | data | Pointer to the data containing values to store in XVI map. Can be NULL for new games. This is only the alpha channel of the xvi map |
Definition at line 318 of file cp_overlay.c.
References R_UploadAlpha(), and r_xviAlpha.
Referenced by CP_CampaignInit(), and XVI_LoadXML().
void CP_InitOverlay | ( | void | ) |
Definition at line 488 of file cp_overlay.c.
References DAN_HEIGHT, DAN_WIDTH, it_effect, R_LoadImageData(), RADAR_HEIGHT, RADAR_WIDTH, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_CampaignInit().
void CP_SetXVILevel | ( | int | x, | |
int | y, | |||
int | value | |||
) |
Definition at line 109 of file cp_overlay.c.
References INITIAL_ALPHA_VALUE, MAX_ALPHA_VALUE, r_xviAlpha, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_DecreaseXVILevelEverywhere(), CP_DrawXVIOverlayPixel(), and XVI_LoadXML().
void CP_ShutdownOverlay | ( | void | ) |
Definition at line 482 of file cp_overlay.c.
Referenced by CP_CampaignExit().
void CP_UploadRadarCoverage | ( | void | ) |
Smooth radar coverage.
Definition at line 475 of file cp_overlay.c.
References r_radarPic, R_SoftenTexture(), R_UploadAlpha(), RADAR_HEIGHT, and RADAR_WIDTH.
Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().