|
UFO: Alien Invasion
|
Functions to generate and render overlay for geoscape. More...

Go to the source code of this file.
Functions | |
| static byte * | CP_XVIGetAlpha (int x, int y) |
| static byte * | CP_RadarGet (int x, int y, bool source) |
| static void | CP_UploadXVI (void) |
| void | CP_GetXVIMapDimensions (int *width, int *height) |
| void | CP_SetXVILevel (int x, int y, int value) |
| int | CP_GetXVILevel (int x, int y) |
| static void | CP_SetMinMaxOverlayRows (const vec2_t pos, float radius, const int height, int *yMin, int *yMax) |
| Set lower and upper value of an overlay (radar, xvi) row that can be modified when tracing a circle. | |
| static float | CP_GetCircleDeltaLongitude (const vec2_t centerPos, float radius, const float yLat) |
| Return the half longitude affected when tracing a circle at a given latitude. | |
| static void | CP_DrawXVIOverlayPixel (int xMin, int xMax, const vec2_t centerPos, int y, const float yLat, int xviLevel, float radius) |
| Change the value of 1 pixel in XVI overlay, the new value is higher than old one. | |
| static void | CP_DrawXVIOverlayRow (float latMin, float latMax, const vec2_t center, int y, float yLat, int xviLevel, float radius) |
| Draw XVI overlay for a given latitude between 2 longitudes. | |
| static void | CP_IncreaseXVILevel (const vec2_t pos, int xCenter, int yCenter, float factor) |
| Applies spreading on xvi transparency channel centered on a given pos. | |
| void | CP_DecreaseXVILevelEverywhere (void) |
| void | CP_ChangeXVILevel (const vec2_t pos, float factor) |
| Convert the pos into degrees and increase XVI there. | |
| void | CP_InitializeXVIOverlay (void) |
| Initialize XVI overlay on geoscape. | |
| void | CP_InitializeRadarOverlay (bool source) |
| Initialize radar overlay on geoscape. | |
| static void | CP_DrawRadarOverlayRow (float latMin, float latMax, int y, byte alpha, bool source) |
| Draw radar overlay for a given latitude between 2 longitudes. | |
| void | CP_AddRadarCoverage (const vec2_t pos, float innerRadius, float outerRadius, bool source) |
| Add a radar coverage (base or aircraft) to radar overlay. | |
| void | CP_UploadRadarCoverage (void) |
| Smooth radar coverage. | |
Variables | |
| static const int | MAX_ALPHA_VALUE = 200 |
| static const int | INITIAL_ALPHA_VALUE = 60 |
Functions to generate and render overlay for geoscape.
Definition in file cp_overlay.cpp.
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 367 of file cp_overlay.cpp.
References CP_DrawRadarOverlayRow(), CP_GetCircleDeltaLongitude(), CP_SetMinMaxOverlayRows(), RADAR_HEIGHT, and torad.
Referenced by RADAR_DrawCoverage(), and RADAR_UpdateStaticRadarCoverage().
Convert the pos into degrees and increase XVI there.
| pos | The x/y-location in the flat XVI map |
| factor | The factor of the XVI raise |
Definition at line 257 of file cp_overlay.cpp.
References CP_IncreaseXVILevel(), XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_SpreadXVIAtPos().
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().
Draw radar overlay for a given latitude between 2 longitudes.
| [in] | latMin,latMax | Minimum and maximum latitude. |
| [in] | y | current row in radar overlay. |
| [in] | alpha | The value for the alpha channel (creates the different look). |
| [in] | source | True if we must update the source of the radar coverage, false if the copy must be updated. |
Definition at line 309 of file cp_overlay.cpp.
References CP_RadarGet(), dest, EQUAL_EPSILON, and RADAR_WIDTH.
Referenced by CP_AddRadarCoverage().
|
static |
Change the value of 1 pixel in XVI overlay, the new value is higher than old one.
| [in] | xMin | Minimum column (this volumn will be reached). |
| [in] | xMax | Maximum column (this volumn won't be reached). |
| [in] | centerPos | Position of the center of the circle. |
| [in] | y | current row in XVI overlay. |
| [in] | yLat | Latitude (in degree) of the current Row. |
| [in] | xviLevel | Level of XVI at the center of the circle (ie at center ). |
| [in] | radius | Radius of the circle. |
Definition at line 138 of file cp_overlay.cpp.
References CP_GetXVILevel(), CP_SetXVILevel(), GetDistanceOnGlobe(), and XVI_WIDTH.
Referenced by CP_DrawXVIOverlayRow().
|
static |
Draw XVI overlay for a given latitude between 2 longitudes.
| [in] | latMin,latMax | Minimum and maximum latitude (in degree). |
| [in] | center | Position of the center of the circle. |
| [in] | y | current row in XVI overlay. |
| [in] | yLat | Latitude (in degree) of the current Row. |
| [in] | xviLevel | Level of XVI at the center of the circle (ie at center ). |
| [in] | radius | Radius of the circle. |
Definition at line 168 of file cp_overlay.cpp.
References CP_DrawXVIOverlayPixel(), EQUAL_EPSILON, RADAR_WIDTH, and XVI_WIDTH.
Referenced by CP_IncreaseXVILevel().
|
inlinestatic |
Return the half longitude affected when tracing a circle at a given latitude.
| [in] | centerPos | center of the circle (radar coverage, XVI infection zone). |
| [in] | radius | radius of the circle. |
| [in] | yLat | latitude of current point (in radians). |
Definition at line 122 of file cp_overlay.cpp.
Referenced by CP_AddRadarCoverage(), and CP_IncreaseXVILevel().
Definition at line 71 of file cp_overlay.cpp.
References CP_XVIGetAlpha(), INITIAL_ALPHA_VALUE, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_DecreaseXVILevelEverywhere(), CP_DrawXVIOverlayPixel(), CP_IncreaseXVILevel(), CP_UpdateNationXVIInfection(), and XVI_SaveXML().
Definition at line 52 of file cp_overlay.cpp.
References XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_UpdateNationXVIInfection(), and XVI_SaveXML().
Applies spreading on xvi transparency channel centered on a given pos.
| pos | The x/y-location in the flat XVI map | |
| [in] | xCenter,yCenter | Position of the center of XVI spreading (in degrees) |
| factor | The factor of the XVI raise |
< XVI level rate at position pos
< current position (in pixel)
< Bounding box of the XVI zone to be drawn (circle)
< radius of the new XVI circle (in degree)
Definition at line 207 of file cp_overlay.cpp.
References CP_DrawXVIOverlayRow(), CP_GetCircleDeltaLongitude(), CP_GetXVILevel(), CP_SetMinMaxOverlayRows(), CP_UploadXVI(), INITIAL_ALPHA_VALUE, MAX_ALPHA_VALUE, torad, and XVI_HEIGHT.
Referenced by CP_ChangeXVILevel().
| void CP_InitializeRadarOverlay | ( | bool | source | ) |
Initialize radar overlay on geoscape.
| [in] | source | Initialize 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, RADAR_HEIGHT, and RADAR_WIDTH.
Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().
Initialize XVI overlay on geoscape.
Definition at line 269 of file cp_overlay.cpp.
References cgi, CP_UploadXVI(), XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_CampaignInit(), CP_InitStartup(), and XVI_LoadXML().
Definition at line 40 of file cp_overlay.cpp.
References cgi, and RADAR_WIDTH.
Referenced by CP_DrawRadarOverlayRow().
|
static |
Set lower and upper value of an overlay (radar, xvi) row that can be modified when tracing a circle.
| [in] | pos | Position of the center of circle. |
| [in] | radius | Radius of the circle to be drawn. |
| [in] | height | Height of the overlay (in pixel). |
| [out] | yMin | Pointer to the lower row of the overlay that should be changed. |
| [out] | yMax | Pointer to the higher row of the overlay that should be changed. |
Definition at line 91 of file cp_overlay.cpp.
Referenced by CP_AddRadarCoverage(), and CP_IncreaseXVILevel().
Definition at line 58 of file cp_overlay.cpp.
References CP_XVIGetAlpha(), INITIAL_ALPHA_VALUE, MAX_ALPHA_VALUE, XVI_HEIGHT, and XVI_WIDTH.
Referenced by CP_DecreaseXVILevelEverywhere(), CP_DrawXVIOverlayPixel(), and XVI_LoadXML().
Smooth radar coverage.
Definition at line 422 of file cp_overlay.cpp.
References cgi, RADAR_HEIGHT, and RADAR_WIDTH.
Referenced by RADAR_UpdateStaticRadarCoverage(), and RADAR_UpdateWholeRadarOverlay().
Definition at line 47 of file cp_overlay.cpp.
References cgi.
Referenced by CP_DecreaseXVILevelEverywhere(), CP_IncreaseXVILevel(), and CP_InitializeXVIOverlay().
Definition at line 35 of file cp_overlay.cpp.
References cgi, and XVI_WIDTH.
Referenced by CP_GetXVILevel(), and CP_SetXVILevel().
|
static |
Definition at line 33 of file cp_overlay.cpp.
Referenced by CP_GetXVILevel(), CP_IncreaseXVILevel(), CP_InitializeRadarOverlay(), and CP_SetXVILevel().
|
static |
Max alpha level - don't set this to 255 or nothing else will be visible below the mask
Definition at line 32 of file cp_overlay.cpp.
Referenced by CP_IncreaseXVILevel(), and CP_SetXVILevel().