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

Battlescape radar code. More...

#include "../client.h"
#include "cl_radar.h"
#include "../renderer/r_draw.h"
#include "../renderer/r_misc.h"
#include "../cl_video.h"
#include "../ui/ui_main.h"
#include "../ui/ui_timer.h"
#include "cl_localentity.h"
#include "cl_camera.h"
#include "cl_battlescape.h"

Go to the source code of this file.

Functions

static void CL_BattlescapeRadarOpen_f (void)
 
static void CL_BattlescapeRadarClose_f (void)
 
static void CL_BattlescapeRadarMapInFrameBuffer (int *x, int *y, int *width, int *height)
 
static void CL_BattlescapeRadarGenPreview_f (void)
 
static void CL_BattlescapeRadarGenerate_f (void)
 Take a screen shot of the map with the position of the radar. More...
 
static void CL_BattlescapeRadarGenerateAll (uiNode_t *node, uiTimer_t *timer)
 
static void CL_BattlescapeRadarGenerateAll_f (void)
 Take all screenshots from lower to upper map level. Use a timer to delay each capture. More...
 
static void CL_BattlescapeRadarGenerateAllRelease_f (void)
 
void CL_BattlescapeRadarInit (void)
 

Variables

static uiTimer_ttimer
 

Detailed Description

Battlescape radar code.

Definition in file cl_radar.cpp.

Function Documentation

static void CL_BattlescapeRadarClose_f ( void  )
static

Definition at line 44 of file cl_radar.cpp.

References UI_CloseWindow().

Referenced by CL_BattlescapeRadarInit().

static void CL_BattlescapeRadarGenerate_f ( void  )
static

Take a screen shot of the map with the position of the radar.

We add 1 pixel into the border to easy check the result: the screen shot must have a border of 1 black pixel

Definition at line 96 of file cl_radar.cpp.

References CL_BattlescapeRadarMapInFrameBuffer(), Cvar_GetInteger(), Cvar_GetString(), level, mapName, R_ScreenShot(), and va().

Referenced by CL_BattlescapeRadarInit().

static void CL_BattlescapeRadarGenerateAll ( uiNode_t node,
uiTimer_t timer 
)
static
static void CL_BattlescapeRadarGenerateAll_f ( void  )
static

Take all screenshots from lower to upper map level. Use a timer to delay each capture.

Definition at line 131 of file cl_radar.cpp.

References CL_BattlescapeRadarGenerateAll(), UI_AllocTimer(), and UI_TimerStart().

Referenced by CL_BattlescapeRadarInit().

static void CL_BattlescapeRadarGenerateAllRelease_f ( void  )
static
Todo:
allow to call UI_TimerRelease into timer callback

Definition at line 141 of file cl_radar.cpp.

References UI_ExecuteConfunc(), and UI_TimerRelease().

Referenced by CL_BattlescapeRadarInit().

static void CL_BattlescapeRadarGenPreview_f ( void  )
static
static void CL_BattlescapeRadarMapInFrameBuffer ( int x,
int y,
int width,
int height 
)
static
Parameters
[out]xX position of the rect in the frame buffer (from bottom-to-top according to the screen)
[out]yY position of the rect in the frame buffer (from bottom-to-top according to the screen)
[out]widthWidth of the rect in the frame buffer (from bottom-to-top according to the screen)
[out]heightHeight of the rect in the frame buffer (from bottom-to-top according to the screen)
Returns
the rect where the radarmap should be, when we generate radar images
Todo:
fix that function, map is not well captured
Todo:
viddef.context should be removed

Definition at line 57 of file cl_radar.cpp.

References cl, viddef_t::context, AABB::getWidthX(), AABB::getWidthY(), viddefContext_t::height, mapData_s::mapBox, clientBattleScape_s::mapData, viddef, and viddefContext_t::width.

Referenced by CL_BattlescapeRadarGenerate_f(), and CL_BattlescapeRadarGenPreview_f().

static void CL_BattlescapeRadarOpen_f ( void  )
static

Definition at line 39 of file cl_radar.cpp.

References UI_PushWindow().

Referenced by CL_BattlescapeRadarInit().

Variable Documentation

uiTimer_t* timer
static

Definition at line 37 of file cl_radar.cpp.

Referenced by CP_CampaignRun(), and UI_AllocTimer().