FS2_Open
Open source remastering of the Freespace 2 engine
hudtargetbox.h File Reference
#include "hud/hud.h"
#include "radar/radarsetup.h"
#include "ship/ship.h"

Go to the source code of this file.

Classes

class  HudGaugeTargetBox
 
class  HudGaugeExtraTargetData
 

Macros

#define TBOX_FLASH_DURATION   1400
 
#define TBOX_FLASH_INTERVAL   200
 
#define NUM_TBOX_FLASH_TIMERS   5
 
#define TBOX_FLASH_NAME   0
 
#define TBOX_FLASH_CARGO   1
 
#define TBOX_FLASH_HULL   2
 
#define TBOX_FLASH_STATUS   3
 
#define TBOX_FLASH_SUBSYS   4
 

Functions

void hud_targetbox_init ()
 
void hud_targetbox_init_flash ()
 
void hud_get_target_strength (object *objp, float *shields, float *integrity)
 
void hud_targetbox_start_flash (int index, int duration=TBOX_FLASH_DURATION)
 
void hud_targetbox_end_flash (int index)
 
void hud_init_target_static ()
 
void hud_update_target_static ()
 
void hud_update_cargo_scan_sound ()
 
void hud_cargo_scan_update (object *targetp, float frametime)
 
void hud_update_ship_status (object *targetp)
 
int hud_targetbox_subsystem_in_view (object *target_objp, int *sx, int *sy)
 
void hud_targetbox_truncate_subsys_name (char *outstr)
 
void hud_targetbox_switch_wireframe_mode ()
 

Variables

int Target_static_looping
 
int Target_display_cargo
 
char Cargo_string [256]
 
int Target_window_coords [GR_NUM_RESOLUTIONS][4]
 
int Targetbox_wire
 
int Targetbox_shader_effect
 
bool Lock_targetbox_mode
 

Macro Definition Documentation

#define NUM_TBOX_FLASH_TIMERS   5

Definition at line 25 of file hudtargetbox.h.

#define TBOX_FLASH_CARGO   1

Definition at line 27 of file hudtargetbox.h.

#define TBOX_FLASH_DURATION   1400

Definition at line 21 of file hudtargetbox.h.

#define TBOX_FLASH_HULL   2

Definition at line 28 of file hudtargetbox.h.

#define TBOX_FLASH_INTERVAL   200

Definition at line 22 of file hudtargetbox.h.

#define TBOX_FLASH_NAME   0

Definition at line 26 of file hudtargetbox.h.

#define TBOX_FLASH_STATUS   3

Definition at line 29 of file hudtargetbox.h.

#define TBOX_FLASH_SUBSYS   4

Definition at line 30 of file hudtargetbox.h.

Function Documentation

void hud_cargo_scan_update ( object targetp,
float  frametime 
)

Definition at line 1842 of file hudtargetbox.cpp.

void hud_get_target_strength ( object objp,
float shields,
float integrity 
)

Get the shield and hull percentages for a given ship object

Parameters
objpPointer to ship object that you want strength values for
shieldsOUTPUT parameter: percentage value of shields (0->1.0)
integrityOUTPUT parameter: percentage value of integrity (0->1.0)

Definition at line 1347 of file hudtargetbox.cpp.

void hud_init_target_static ( )

Called at the start of each level

Definition at line 2193 of file hudtargetbox.cpp.

void hud_targetbox_end_flash ( int  index)

Stop flashing a specific targetbox item

Definition at line 2295 of file hudtargetbox.cpp.

void hud_targetbox_init ( )
void hud_targetbox_init_flash ( )

Init the timers used to flash different parts of the targetbox.

Note
This needs to get called whenever the current target changes.
Need to call initFlashTimers for any TargetBox gauges and call initDockFlashTimer() for Extra Target Info gauges (Switfty)

Definition at line 1292 of file hudtargetbox.cpp.

void hud_targetbox_start_flash ( int  index,
int  duration 
)

Start the targetbox item flashing for duration ms

Parameters
indexTBOX_FLASH_ define
durationoptional param (default value TBOX_FLASH_DURATION), how long to flash in ms

Definition at line 2287 of file hudtargetbox.cpp.

int hud_targetbox_subsystem_in_view ( object target_objp,
int sx,
int sy 
)

Determine if the subsystem is in line-of sight, without taking into account whether the player ship is facing the subsystem

Definition at line 1802 of file hudtargetbox.cpp.

void hud_targetbox_switch_wireframe_mode ( )

Toggle through the valid targetbox modes

Note
0==standard
1==wireframe only
2==standard with lighting

Definition at line 1270 of file hudtargetbox.cpp.

void hud_targetbox_truncate_subsys_name ( char *  outstr)
Note
Cut down long subsystem names to a more manageable length

Definition at line 119 of file hudtargetbox.cpp.

void hud_update_cargo_scan_sound ( )

Definition at line 1856 of file hudtargetbox.cpp.

void hud_update_ship_status ( object targetp)

Updates the HUD status description of a particular ship

Checks for disabled or ships with disrupted engines, as well as damage levels of the target ship. If status has changed, then the HUD will flash

Parameters
targetpInstance of the ship target – note the targetp->instance cannot be negative

Definition at line 2254 of file hudtargetbox.cpp.

void hud_update_target_static ( )

Determine if we should draw static on top of the target box

Definition at line 2202 of file hudtargetbox.cpp.

Variable Documentation

char Cargo_string[256]

Definition at line 61 of file hudtargetbox.cpp.

bool Lock_targetbox_mode

Definition at line 105 of file hudtargetbox.cpp.

int Target_display_cargo

Definition at line 60 of file hudtargetbox.cpp.

int Target_static_looping

Definition at line 58 of file hudtargetbox.cpp.

int Target_window_coords[GR_NUM_RESOLUTIONS][4]

Definition at line 44 of file hudtargetbox.cpp.

int Targetbox_shader_effect

Definition at line 104 of file hudtargetbox.cpp.

int Targetbox_wire

Definition at line 103 of file hudtargetbox.cpp.