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

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. More...
 
#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]) More...
 
void R_Draw2DMapMarkers (const vec2_t screenPos, float direction, const char *model, int skin)
 Draw 3D Marker on the 2D geoscape. More...
 
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. More...
 
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. More...
 
void R_DrawBloom (void)
 handle post-processing bloom More...
 

Macro Definition Documentation

#define EARTH_RADIUS   8192.0f

Definition at line 34 of file r_geoscape.h.

Referenced by R_SphereInit().

#define MOON_RADIUS   1024.0f

Definition at line 35 of file r_geoscape.h.

Referenced by R_SphereInit().

#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().

#define SUN_RADIUS   1024.0f

Definition at line 36 of file r_geoscape.h.

Function Documentation

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 178 of file r_geoscape.cpp.

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

Referenced by GAME_GetImportData().

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 
)
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 235 of file r_geoscape.cpp.

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

Referenced by GAME_GetImportData().

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 48 of file r_geoscape.cpp.

References rendererData_t::batchCount, Com_Error(), ERR_FATAL, it_wrappic, R_BindArray(), R_BindDefaultArray(), R_BindLightmapTexture(), R_BindTexture, R_EnableTexture(), R_FindImage(), r_noTexture, R_SelectTexture(), refdef, viddef_t::rx, viddef_t::ry, image_s::texnum, texunit_diffuse, texunit_lightmap, va(), and viddef.

Referenced by uiGeoscapeNode::draw().