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

Go to the source code of this file.

Data Structures

struct  hudRadarImage_s
 Each maptile must have an entry in the images array. More...
 
struct  hudRadar_s
 

Typedefs

typedef struct hudRadarImage_s hudRadarImage_t
 Each maptile must have an entry in the images array. More...
 
typedef struct hudRadar_s hudRadar_t
 

Functions

static void UI_FreeRadarImages (void)
 
static void UI_BuildRadarImageList (const char *tiles, const char *pos)
 Reads the tiles and position config strings and convert them into a linked list that holds the imagename (mapname), the x and the y position (screencoordinates) More...
 
static void UI_GetRadarWidth (const uiNode_t *node, vec2_t gridSize)
 Get the width of radar. More...
 
static bool UI_CheckRadarImage (const char *imageName, const int level)
 
static void UI_InitRadar (const uiNode_t *node)
 Calculate some radar values that won't change during a mission. More...
 
static void UI_RadarNodeGetActorColor (const le_t *le, vec4_t color)
 
static void UI_RadarNodeDrawArrays (const vec4_t color, vec2_t coords[4], vec2_t vertices[4], const image_t *image)
 
static void UI_RadarNodeDrawItem (const le_t *le, const vec3_t pos)
 
static void UI_RadarNodeDrawActor (const le_t *le, const vec3_t pos)
 
void UI_RegisterRadarNode (uiBehaviour_t *behaviour)
 

Variables

static hudRadar_t radar
 
static char const *const imageExtensions []
 

Typedef Documentation

typedef struct hudRadar_s hudRadar_t

Each maptile must have an entry in the images array.

Function Documentation

static void UI_BuildRadarImageList ( const char *  tiles,
const char *  pos 
)
static

Reads the tiles and position config strings and convert them into a linked list that holds the imagename (mapname), the x and the y position (screencoordinates)

Parameters
[in]tilesThe configstring with the tiles (map tiles)
[in]posThe position string, only used in case of random map assembly
See also
UI_DrawRadar
R_ModBeginLoading

Definition at line 103 of file ui_node_radar.cpp.

References hudRadar_s::base, cl, Com_Error(), Com_Parse(), Com_Printf(), Com_sprintf(), ERR_DROP, AABB::getWidthX(), AABB::getWidthY(), hudRadar_s::gridMin, hudRadarImage_s::gridX, hudRadarImage_s::gridY, i, hudRadar_s::images, hudRadarImage_s::isTile, mapData_s::mapBox, clientBattleScape_s::mapData, hudRadarImage_s::mapX, hudRadarImage_s::mapY, MAX_VAR, Mem_StrDup, hudRadarImage_s::name, name, hudRadar_s::numImages, Q_strncpyz(), and UNIT_SIZE.

Referenced by UI_InitRadar().

static bool UI_CheckRadarImage ( const char *  imageName,
const int  level 
)
static

Definition at line 247 of file ui_node_radar.cpp.

References FS_CheckFile(), and imageExtensions.

Referenced by UI_InitRadar().

static void UI_FreeRadarImages ( void  )
static
static void UI_GetRadarWidth ( const uiNode_t node,
vec2_t  gridSize 
)
static

Get the width of radar.

Parameters
[in]nodeNode description of the radar
[in]gridSizesize of the radar picture, in grid units.
See also
UI_InitRadar

< Contains the width of the first and the last tile of the first line (in screen unit)

< Contains the height of the first and the last tile of the first column (in screen unit)

< Contains the grid X position of 2nd tiles in first line

< Contains the grid Y position of 2nd tiles in first column

< ratio conversion between screen coordinates and grid coordinates

< Number of pixel to remove to avoid rounding errors (and lines between tiles) We remove pixel because this is much nicer if tiles overlap a little bit rather than if they are too distant one from the other

Definition at line 164 of file ui_node_radar.cpp.

References hudRadar_s::gridMax, hudRadar_s::gridMin, hudRadarImage_s::gridX, hudRadarImage_s::gridY, hudRadar_s::h, hudRadarImage_s::height, hudRadar_s::images, hudRadar_s::numImages, Vector2Set, hudRadar_s::w, and hudRadarImage_s::width.

Referenced by UI_InitRadar().

static void UI_InitRadar ( const uiNode_t node)
static
static void UI_RadarNodeDrawActor ( const le_t le,
const vec3_t  pos 
)
static
static void UI_RadarNodeDrawArrays ( const vec4_t  color,
vec2_t  coords[4],
vec2_t  vertices[4],
const image_t image 
)
static

Definition at line 410 of file ui_node_radar.cpp.

References R_Color(), and R_DrawImageArray().

Referenced by UI_RadarNodeDrawActor().

static void UI_RadarNodeDrawItem ( const le_t le,
const vec3_t  pos 
)
static

Definition at line 417 of file ui_node_radar.cpp.

Referenced by uiRadarNode::draw().

static void UI_RadarNodeGetActorColor ( const le_t le,
vec4_t  color 
)
static
void UI_RegisterRadarNode ( uiBehaviour_t behaviour)

Variable Documentation

char const* const imageExtensions[]
static
Initial value:
= {
"jpg", "png", nullptr
}

Definition at line 243 of file ui_node_radar.cpp.

Referenced by UI_CheckRadarImage().

hudRadar_t radar
static

Definition at line 81 of file ui_node_radar.cpp.

Referenced by RADAR_AddDetectedUFOToEveryRadar(), and RADAR_CheckRadarSensored().