FS2_Open
Open source remastering of the Freespace 2 engine
iff_defs.cpp File Reference
#include "globalincs/def_files.h"
#include "hud/hud.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "mission/missionparse.h"
#include "parse/parselo.h"
#include "ship/ship.h"

Go to the source code of this file.

Functions

int iff_get_alpha_value (bool is_bright)
 
int iff_init_color (int r, int g, int b)
 
void iff_init ()
 
int iff_lookup (char *iff_name)
 
int iff_get_attackee_mask (int attacker_team)
 
int iff_get_attacker_mask (int attackee_team)
 
int iff_x_attacks_y (int team_x, int team_y)
 
int iff_get_mask (int team)
 
int iff_matches_mask (int team, int mask)
 
coloriff_get_color (int color_index, int is_bright)
 
coloriff_get_color_by_team (int team, int seen_from_team, int is_bright)
 
coloriff_get_color_by_team_and_object (int team, int seen_from_team, int is_bright, object *objp)
 

Variables

int radar_target_id_flags
 
int Num_iffs
 
iff_info Iff_info [MAX_IFFS]
 
int Iff_traitor
 
int radar_iff_color [5][2][4]
 
int iff_bright_delta
 
intiff_color_brightness = &iff_bright_delta
 
color Iff_colors [MAX_IFF_COLORS][2]
 
flag_def_list rti_flags []
 
int Num_rti_flags = sizeof(rti_flags)/sizeof(flag_def_list)
 

Function Documentation

int iff_get_alpha_value ( bool  is_bright)

Borrowed from ship.cpp, ship_iff_init_colors

Parameters
is_brightWhether set to bright

Definition at line 45 of file iff_defs.cpp.

int iff_get_attackee_mask ( int  attacker_team)

Get the mask, taking All Teams At War into account

Parameters
attacker_teamTeam of attacker
Returns
Bitmask

Definition at line 561 of file iff_defs.cpp.

int iff_get_attacker_mask ( int  attackee_team)

Rather slower, since it has to construct a mask

Parameters
attackee_teamTeam of attacker
Returns
Bitmask

Definition at line 583 of file iff_defs.cpp.

color* iff_get_color ( int  color_index,
int  is_bright 
)

Get the color from the color index

Definition at line 636 of file iff_defs.cpp.

color* iff_get_color_by_team ( int  team,
int  seen_from_team,
int  is_bright 
)

Get the color index, taking objective vs. subjective into account

Definition at line 644 of file iff_defs.cpp.

color* iff_get_color_by_team_and_object ( int  team,
int  seen_from_team,
int  is_bright,
object objp 
)

Get the color index, taking objective vs. subjective into account

this one for the function calls that include some - any - of object

Definition at line 678 of file iff_defs.cpp.

int iff_get_mask ( int  team)

Generate a mask for a team

Parameters
teamTeam to generate mask for

Definition at line 615 of file iff_defs.cpp.

void iff_init ( )

Parse the table

Definition at line 117 of file iff_defs.cpp.

int iff_init_color ( int  r,
int  g,
int  b 
)

Init a color and add it to the Iff_colors array

Parameters
rRed
gGreen
bBlue
Returns
The new IFF colour slot in Iff_colors array

Definition at line 62 of file iff_defs.cpp.

int iff_lookup ( char *  iff_name)

Find the iff name

Parameters
iff_namePointer to name as a string
Returns
Index into Iff_info array

Definition at line 540 of file iff_defs.cpp.

int iff_matches_mask ( int  team,
int  mask 
)

See if the mask contains the team

Parameters
teamTeam to test
maskMask
Returns
1 if matches, 0 if does not match

Definition at line 628 of file iff_defs.cpp.

int iff_x_attacks_y ( int  team_x,
int  team_y 
)

Similar to above

Parameters
team_xTeam of attacker
team_yTeam of attackee
Returns
>0 if true, 0 if false

Definition at line 605 of file iff_defs.cpp.

Variable Documentation

int iff_bright_delta

Definition at line 25 of file iff_defs.cpp.

int* iff_color_brightness = &iff_bright_delta

Definition at line 26 of file iff_defs.cpp.

color Iff_colors[MAX_IFF_COLORS][2]

Definition at line 29 of file iff_defs.cpp.

iff_info Iff_info[MAX_IFFS]

Definition at line 20 of file iff_defs.cpp.

int Iff_traitor

Definition at line 22 of file iff_defs.cpp.

int Num_iffs

Definition at line 19 of file iff_defs.cpp.

int Num_rti_flags = sizeof(rti_flags)/sizeof(flag_def_list)

Definition at line 38 of file iff_defs.cpp.

int radar_iff_color[5][2][4]

Definition at line 24 of file iff_defs.cpp.

int radar_target_id_flags

Definition at line 69 of file radarsetup.cpp.

flag_def_list rti_flags[]
Initial value:
= {
{ "crosshairs", RTIF_CROSSHAIRS, 0 },
{ "blink", RTIF_BLINK, 0 },
{ "pulsate", RTIF_PULSATE, 0 },
{ "enlarge", RTIF_ENLARGE, 0 }
}
#define RTIF_CROSSHAIRS
Definition: hud.h:83
#define RTIF_PULSATE
Definition: hud.h:85
#define RTIF_BLINK
Definition: hud.h:84
#define RTIF_ENLARGE
Definition: hud.h:86

Definition at line 31 of file iff_defs.cpp.