UFO: Alien Invasion
Loading...
Searching...
No Matches
r_geoscape.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STANDARD_3D_ZOOM   40.0f
 Typical zoom to use on the 3D geoscape to use same zoom values for both 2D and 3D geoscape.
#define EARTH_RADIUS   8192.0f
#define MOON_RADIUS   1024.0f
#define SUN_RADIUS   1024.0f

Functions

void R_Draw3DGlobe (const vec2_t pos, const vec2_t size, int day, int second, const vec3_t rotate, float zoom, const char *map, bool disableSolarRender, float ambient, bool overlayNation, bool overlayXVI, bool overlayRadar, image_t *r_xviTexture, image_t *r_radarTexture, bool renderNationGlow)
 responsible for drawing the 3d globe on geoscape param[in] rotate the rotate angle of the globe param[in] zoom the current globe zoon param[in] map the prefix of the map to use (image must be at base/pics/menu/<map>_[day|night])
void R_Draw2DMapMarkers (const vec2_t screenPos, float direction, const char *model, int skin)
 Draw 3D Marker on the 2D geoscape.
void R_Draw3DMapMarkers (const vec2_t nodePos, const vec2_t nodeSize, const vec3_t rotate, const vec2_t pos, float direction, float earthRadius, const char *model, int skin)
 Draw 3D Marker on the 3D geoscape.
void R_DrawFlatGeoscape (const vec2_t nodePos, const vec2_t nodeSize, float p, float cx, float cy, float iz, const char *map, bool overlayNation, bool overlayXVI, bool overlayRadar, image_t *r_dayandnightTexture, image_t *r_xviTexture, image_t *r_radarTexture)
 Draw the day and night images of a flat geoscape multitexture feature is used to blend the images.
void R_DrawBloom (void)
 handle post-processing bloom

Macro Definition Documentation

◆ EARTH_RADIUS

#define EARTH_RADIUS   8192.0f

Definition at line 34 of file r_geoscape.h.

Referenced by R_SphereInit().

◆ MOON_RADIUS

#define MOON_RADIUS   1024.0f

Definition at line 35 of file r_geoscape.h.

Referenced by R_SphereInit().

◆ STANDARD_3D_ZOOM

#define STANDARD_3D_ZOOM   40.0f

Typical zoom to use on the 3D geoscape to use same zoom values for both 2D and 3D geoscape.

Todo
these are currently duplicated - remove this defines here
Note
Used to convert openGL coordinates of the sphere into screen coordinates
See also
GLOBE_RADIUS

Definition at line 32 of file r_geoscape.h.

Referenced by R_Draw3DGlobe().

◆ SUN_RADIUS

#define SUN_RADIUS   1024.0f

Definition at line 36 of file r_geoscape.h.

Function Documentation

◆ R_Draw2DMapMarkers()

void R_Draw2DMapMarkers ( const vec2_t screenPos,
float direction,
const char * model,
int skin )

Draw 3D Marker on the 2D geoscape.

Parameters
[in]screenPosPosition on screenlongitude and latitude of the model to draw.
[in]directionangle giving the direction the model is heading toward.
[in]modelThe name of the model of the marker.
[in]skinNumber of modelskin to draw on marker

Definition at line 180 of file r_geoscape.cpp.

References modelInfo_t::angles, modelInfo_t::center, Com_Printf(), MARKER_SIZE, modelInfo_t::model, modelInfo_t::name, OBJZERO, modelInfo_t::origin, R_DrawModelDirect(), R_FindModel(), R_ModelAutoScale(), scale, modelInfo_t::skin, vec3_origin, VectorCopy, and viddef.

Referenced by GAME_GetImportData().

◆ R_Draw3DGlobe()

void R_Draw3DGlobe ( const vec2_t pos,
const vec2_t size,
int day,
int second,
const vec3_t rotate,
float zoom,
const char * map,
bool disableSolarRender,
float ambient,
bool overlayNation,
bool overlayXVI,
bool overlayRadar,
image_t * r_xviTexture,
image_t * r_radarTexture,
bool renderNationGlow )

responsible for drawing the 3d globe on geoscape param[in] rotate the rotate angle of the globe param[in] zoom the current globe zoon param[in] map the prefix of the map to use (image must be at base/pics/menu/<map>_[day|night])

See also
R_DrawFlatGeoscape
R_SphereGenerate
Todo
render atmosphere glow even when postprocessing is disabled
Todo
Replace this magic number with some speaking constant

Definition at line 430 of file r_geoscape.cpp.

References Com_Error(), DateTime::DAYS_PER_YEAR, ERR_FATAL, GL_SOURCE0_ALPHA, GL_SOURCE0_RGB, GL_SOURCE1_RGB, GL_SOURCE2_RGB, int(), it_pic, it_wrappic, m, M_PI, r_config, R_DrawBuffers(), R_DrawStarfield(), R_DrawTexture(), R_FindImage(), R_FreeImage(), r_globeEarth, r_globeEarthAtmosphere, r_globeMoon, r_noTexture, r_postprocess, r_programs, r_radarTexture, R_RotateCelestialBody(), R_SelectTexture(), R_SphereRender(), r_state, r_xviTexture, DateTime::SEASONS_PER_YEAR, DateTime::SECONDS_PER_DAY, SIN_ALPHA, SKYBOX_HALFSIZE, STANDARD_3D_ZOOM, image_t::texnum, texunit_diffuse, va(), Vector4Set, VectorCopy, VectorSet, and viddef.

Referenced by uiGeoscapeNode::draw().

◆ R_Draw3DMapMarkers()

void R_Draw3DMapMarkers ( const vec2_t nodePos,
const vec2_t nodeSize,
const vec3_t rotate,
const vec2_t pos,
float direction,
float earthRadius,
const char * model,
int skin )

Draw 3D Marker on the 3D geoscape.

Parameters
[in]nodePosThe position, normalized (1024x768)
[in]nodeSizeThe dimensions, normalized (1024x768)
[in]rotatevector giving the angles of earth rotation due to player view.
[in]poslongitude and latitude of the model to draw.
[in]directionangle giving the direction the model is heading toward.
[in]earthRadiusRadius of earth on screen (this include zoom).
[in]modelThe name of the model of the marker.
[in]skinNumber of modelskin to draw on marker

Definition at line 237 of file r_geoscape.cpp.

References modelInfo_t::angles, modelInfo_t::center, Com_Printf(), MARKER_SIZE, modelInfo_t::model, modelInfo_t::name, OBJZERO, modelInfo_t::origin, R_DrawModelDirect(), R_FindModel(), R_ModelAutoScale(), scale, modelInfo_t::skin, vec3_origin, VectorCopy, and viddef.

Referenced by GAME_GetImportData().

◆ R_DrawBloom()

◆ R_DrawFlatGeoscape()

void R_DrawFlatGeoscape ( const vec2_t nodePos,
const vec2_t nodeSize,
float p,
float cx,
float cy,
float iz,
const char * map,
bool overlayNation,
bool overlayXVI,
bool overlayRadar,
image_t * r_dayandnightTexture,
image_t * r_xviTexture,
image_t * r_radarTexture )

Draw the day and night images of a flat geoscape multitexture feature is used to blend the images.

See also
R_Draw3DGlobe
Parameters
[in]nodePosThe position, normalized (1024x768)
[in]nodeSizeThe dimensions, normalized (1024x768)
[in]pThe horizontal shift of the night map
[in]cx,cyThe x/y texture coordinates
[in]izThe zoomlevel of the geoscape - see ccs.zoom
[in]mapThe geoscape map to draw (can be changed in the campaign definition)
[in]overlayNation,overlayXVI,overlayRadarWhether these overlays should be drawn or not
[in]r_dayandnightTexture,r_xviTexture,r_radarTextureThe textures used for the corresponding overlays

Definition at line 50 of file r_geoscape.cpp.

References Com_Error(), ERR_FATAL, it_wrappic, R_BindArray(), R_BindDefaultArray(), R_BindLightmapTexture(), R_BindTexture, r_dayandnightTexture, R_EnableTexture(), R_FindImage(), r_noTexture, r_radarTexture, R_SelectTexture(), r_xviTexture, refdef, image_t::texnum, texunit_diffuse, texunit_lightmap, va(), and viddef.

Referenced by uiGeoscapeNode::draw().