FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "asteroid/asteroid.h"
#include "cmdline/cmdline.h"
#include "debris/debris.h"
#include "freespace2/freespace.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "globalincs/linklist.h"
#include "hud/hudartillery.h"
#include "hud/hudbrackets.h"
#include "hud/hudlock.h"
#include "hud/hudmessage.h"
#include "hud/hudparse.h"
#include "hud/hudreticle.h"
#include "hud/hudshield.h"
#include "hud/hudtarget.h"
#include "hud/hudtargetbox.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "jumpnode/jumpnode.h"
#include "localization/localize.h"
#include "mission/missionhotkey.h"
#include "mission/missionmessage.h"
#include "model/model.h"
#include "network/multi.h"
#include "network/multiutil.h"
#include "object/object.h"
#include "parse/parselo.h"
#include "playerman/player.h"
#include "render/3dinternal.h"
#include "ship/awacs.h"
#include "ship/ship.h"
#include "ship/subsysdamage.h"
#include "weapon/emp.h"
#include "weapon/weapon.h"
Go to the source code of this file.
Classes | |
struct | _reticle_list |
struct | weapon_flash |
struct | homing_beep_info |
struct | eval_next_turret |
struct | transmit_target |
Macros | |
#define | MIN_DISTANCE_TO_CONSIDER_THREAT 1500 |
#define | RL_USED (1<<0) |
#define | RL_USE_DOT (1<<1) |
#define | RESET_TARGET_IN_RETICLE 750 |
#define | MAX_RETICLE_TARGETS 50 |
#define | TL_RESET 1500 |
#define | TURRET_RESET 1000 |
#define | TOGGLE_TEXT_AUTOT 0 |
#define | TOGGLE_TEXT_TARGET 1 |
#define | TOGGLE_TEXT_AUTOS 2 |
#define | TOGGLE_TEXT_SPEED 3 |
#define | NUM_WEAPON_GAUGES 5 |
#define | MAX_WEAPON_FLASH_LINES 7 |
#define | RETICLE_DEFAULT_DIST 100000.0f |
#define | RETICLE_DEFAULT_DOT 1.0f |
#define | TYPE_NONE 0 |
#define | TYPE_FACING_BEAM 1 |
#define | TYPE_FACING_FLAK 2 |
#define | TYPE_FACING_MISSILE 3 |
#define | TYPE_FACING_LASER 4 |
#define | TYPE_NONFACING_BEAM 5 |
#define | TYPE_NONFACING_FLAK 6 |
#define | TYPE_NONFACING_MISSILE 7 |
#define | TYPE_NONFACING_LASER 8 |
#define | TYPE_NONFACING_INC 4 |
#define | TARGET_IN_RETICLE_DISTANCE 10000.0f |
#define | MIN_DOT_FOR_TARGET 0.9726 |
#define | T_LENGTH 8 |
#define | T_OFFSET_FROM_CIRCLE -13 |
#define | T_BASE_LENGTH 4 |
#define | MAX_TRANSMIT_TARGETS 10 |
Typedefs | |
typedef struct _reticle_list | reticle_list |
typedef struct weapon_flash | weapon_flash |
typedef struct homing_beep_info | homing_beep_info |
typedef struct eval_next_turret | eval_next_turret |
typedef struct transmit_target | transmit_target |
#define MAX_RETICLE_TARGETS 50 |
Definition at line 140 of file hudtarget.cpp.
#define MAX_TRANSMIT_TARGETS 10 |
Definition at line 5095 of file hudtarget.cpp.
#define MAX_WEAPON_FLASH_LINES 7 |
Definition at line 430 of file hudtarget.cpp.
#define MIN_DISTANCE_TO_CONSIDER_THREAT 1500 |
Definition at line 121 of file hudtarget.cpp.
#define MIN_DOT_FOR_TARGET 0.9726 |
Definition at line 2600 of file hudtarget.cpp.
#define NUM_WEAPON_GAUGES 5 |
Definition at line 230 of file hudtarget.cpp.
#define RESET_TARGET_IN_RETICLE 750 |
Definition at line 136 of file hudtarget.cpp.
#define RETICLE_DEFAULT_DIST 100000.0f |
Definition at line 587 of file hudtarget.cpp.
#define RETICLE_DEFAULT_DOT 1.0f |
Definition at line 588 of file hudtarget.cpp.
#define RL_USE_DOT (1<<1) |
Definition at line 127 of file hudtarget.cpp.
#define RL_USED (1<<0) |
Definition at line 126 of file hudtarget.cpp.
#define T_BASE_LENGTH 4 |
Definition at line 2744 of file hudtarget.cpp.
#define T_LENGTH 8 |
Definition at line 2742 of file hudtarget.cpp.
#define T_OFFSET_FROM_CIRCLE -13 |
Definition at line 2743 of file hudtarget.cpp.
#define TARGET_IN_RETICLE_DISTANCE 10000.0f |
Definition at line 2481 of file hudtarget.cpp.
#define TL_RESET 1500 |
Definition at line 146 of file hudtarget.cpp.
#define TOGGLE_TEXT_AUTOS 2 |
Definition at line 223 of file hudtarget.cpp.
#define TOGGLE_TEXT_AUTOT 0 |
Definition at line 221 of file hudtarget.cpp.
#define TOGGLE_TEXT_SPEED 3 |
Definition at line 224 of file hudtarget.cpp.
#define TOGGLE_TEXT_TARGET 1 |
Definition at line 222 of file hudtarget.cpp.
#define TURRET_RESET 1000 |
Definition at line 147 of file hudtarget.cpp.
#define TYPE_FACING_BEAM 1 |
Definition at line 1682 of file hudtarget.cpp.
#define TYPE_FACING_FLAK 2 |
Definition at line 1683 of file hudtarget.cpp.
#define TYPE_FACING_LASER 4 |
Definition at line 1685 of file hudtarget.cpp.
#define TYPE_FACING_MISSILE 3 |
Definition at line 1684 of file hudtarget.cpp.
#define TYPE_NONE 0 |
Definition at line 1681 of file hudtarget.cpp.
#define TYPE_NONFACING_BEAM 5 |
Definition at line 1686 of file hudtarget.cpp.
#define TYPE_NONFACING_FLAK 6 |
Definition at line 1687 of file hudtarget.cpp.
#define TYPE_NONFACING_INC 4 |
Definition at line 1690 of file hudtarget.cpp.
#define TYPE_NONFACING_LASER 8 |
Definition at line 1689 of file hudtarget.cpp.
#define TYPE_NONFACING_MISSILE 7 |
Definition at line 1688 of file hudtarget.cpp.
typedef struct eval_next_turret eval_next_turret |
typedef struct homing_beep_info homing_beep_info |
typedef struct _reticle_list reticle_list |
typedef struct transmit_target transmit_target |
typedef struct weapon_flash weapon_flash |
Definition at line 1131 of file hudtarget.cpp.
missile_obj* advance_missile_obj | ( | missile_obj * | mo, |
int | next_flag | ||
) |
Definition at line 1260 of file hudtarget.cpp.
Definition at line 1269 of file hudtarget.cpp.
ship_subsys* advance_subsys | ( | ship_subsys * | cur, |
int | next_flag | ||
) |
Definition at line 480 of file hudtarget.cpp.
bool evaluate_ship_as_closest_target | ( | esct * | esct_p | ) |
evaluate a ship (and maybe turrets) as a potential target
Check if shipp (or its turrets) is attacking attacked_objnum Provides a special case for player trying to select target (don't check if turrets are aimed at player)
[in,out] | *esct | The Evaluate Ship as Closest Target (esct) that will be used to determine if a target is a valid, harmful target and, if so, sets the min_distance attribute to the distance of either the attacker or the closest attacker's turret. Otherwise, min_distance is set to FLT_MAX |
Definition at line 2069 of file hudtarget.cpp.
vec3d* get_subsystem_world_pos | ( | object * | parent_obj, |
ship_subsys * | subsys, | ||
vec3d * | world_pos | ||
) |
Definition at line 4395 of file hudtarget.cpp.
void hud_calculate_lead_pos | ( | vec3d * | lead_target_pos, |
vec3d * | target_pos, | ||
object * | targetp, | ||
weapon_info * | wip, | ||
float | dist_to_target, | ||
vec3d * | rel_pos | ||
) |
Definition at line 3682 of file hudtarget.cpp.
Definition at line 4346 of file hudtarget.cpp.
void hud_cease_targeting | ( | ) |
Definition at line 4367 of file hudtarget.cpp.
void hud_check_reticle_list | ( | ) |
Definition at line 539 of file hudtarget.cpp.
Definition at line 4607 of file hudtarget.cpp.
Definition at line 2009 of file hudtarget.cpp.
Definition at line 3719 of file hudtarget.cpp.
void hud_init_ballistic_index | ( | ) |
Definition at line 1019 of file hudtarget.cpp.
void hud_init_homing_beep | ( | ) |
Definition at line 1012 of file hudtarget.cpp.
void hud_init_targeting | ( | ) |
Definition at line 1038 of file hudtarget.cpp.
void hud_init_targeting_colors | ( | ) |
Definition at line 973 of file hudtarget.cpp.
void hud_keyed_targets_clear | ( | ) |
Definition at line 982 of file hudtarget.cpp.
Definition at line 959 of file hudtarget.cpp.
Definition at line 4550 of file hudtarget.cpp.
Definition at line 490 of file hudtarget.cpp.
Definition at line 3098 of file hudtarget.cpp.
void hud_process_remote_detonate_missile | ( | ) |
Definition at line 3224 of file hudtarget.cpp.
void hud_prune_hotkeys | ( | ) |
Definition at line 3330 of file hudtarget.cpp.
Definition at line 4379 of file hudtarget.cpp.
void hud_reticle_clear_list | ( | reticle_list * | rlist | ) |
Definition at line 511 of file hudtarget.cpp.
int hud_reticle_list_find_free | ( | ) |
Definition at line 564 of file hudtarget.cpp.
void hud_reticle_list_init | ( | ) |
Definition at line 522 of file hudtarget.cpp.
Definition at line 612 of file hudtarget.cpp.
object* hud_reticle_pick_target | ( | ) |
Definition at line 679 of file hudtarget.cpp.
Check if targeting is possible based on sensors strength.
Definition at line 4578 of file hudtarget.cpp.
void hud_show_hostile_triangle | ( | ) |
Definition at line 3556 of file hudtarget.cpp.
void hud_show_message_sender | ( | ) |
Definition at line 3265 of file hudtarget.cpp.
void hud_show_selection_set | ( | ) |
Definition at line 3387 of file hudtarget.cpp.
Definition at line 3478 of file hudtarget.cpp.
Definition at line 4534 of file hudtarget.cpp.
void hud_stuff_reticle_list | ( | reticle_list * | rl, |
object * | objp, | ||
float | measure, | ||
int | dot_flag | ||
) |
Definition at line 589 of file hudtarget.cpp.
Definition at line 5290 of file hudtarget.cpp.
Definition at line 5325 of file hudtarget.cpp.
Definition at line 5269 of file hudtarget.cpp.
void hud_target_add_display_list | ( | object * | objp, |
vertex * | target_point, | ||
vec3d * | target_pos, | ||
int | correction, | ||
color * | bracket_clr, | ||
char * | name, | ||
int | flags | ||
) |
Definition at line 6195 of file hudtarget.cpp.
void hud_target_auto_target_next | ( | ) |
Definition at line 1971 of file hudtarget.cpp.
void hud_target_change_check | ( | ) |
Definition at line 4407 of file hudtarget.cpp.
void hud_target_clear_display_list | ( | ) |
Definition at line 6221 of file hudtarget.cpp.
int hud_target_closest | ( | int | team_mask, |
int | attacked_objnum, | ||
int | play_fail_snd, | ||
int | filter, | ||
int | get_closest_turret_attacking_player | ||
) |
Sets the Players[Player_num].current_target to the closest ship to the player that matches the team passed as a paramater.
The current algorithm is to simply iterate through the objects and calculate the magnitude of the vector that connects the player to the target. The smallest magnitude is tracked, and then used to locate the closest hostile ship. Note only the square of the magnitude is required, since we are only comparing magnitudes.
[in] | team_mask | team of closest ship that should be targeted. Default value is -1, if team doesn't matter. |
[in] | attacked_objnum | object number of ship that is being attacked |
[in] | play_fail_snd | boolean, whether to play SND_TARGET_FAIL (needed, since function called repeatedly when auto-targeting is enabled, and we don't want a string of fail sounds playing). This is a default parameter with a value of TRUE. |
[in] | filter | OPTIONAL parameter (default value 0): when set to TRUE, only fighters and bombers are considered for new targets. |
[in] | get_closest_turret_attacking_player | Finds the closest turret attacking the player if true. Otherwise, only finds the closest attacking ship, targeting the turret closest to the player. |
Definition at line 2212 of file hudtarget.cpp.
Definition at line 1908 of file hudtarget.cpp.
Definition at line 4858 of file hudtarget.cpp.
void hud_target_closest_uninspected_object | ( | ) |
Definition at line 4932 of file hudtarget.cpp.
Definition at line 1158 of file hudtarget.cpp.
Definition at line 771 of file hudtarget.cpp.
Definition at line 835 of file hudtarget.cpp.
Definition at line 855 of file hudtarget.cpp.
void hud_target_in_reticle_new | ( | ) |
Definition at line 2483 of file hudtarget.cpp.
void hud_target_in_reticle_old | ( | ) |
Definition at line 2602 of file hudtarget.cpp.
Definition at line 460 of file hudtarget.cpp.
void hud_target_last_transmit | ( | ) |
Definition at line 5127 of file hudtarget.cpp.
Definition at line 5197 of file hudtarget.cpp.
void hud_target_last_transmit_level_init | ( | ) |
Definition at line 5099 of file hudtarget.cpp.
int hud_target_last_transmit_newest | ( | ) |
Definition at line 5114 of file hudtarget.cpp.
Definition at line 1724 of file hudtarget.cpp.
Definition at line 1425 of file hudtarget.cpp.
void hud_target_newest_ship | ( | ) |
Definition at line 1619 of file hudtarget.cpp.
Definition at line 1247 of file hudtarget.cpp.
void hud_target_next_list | ( | int | hostile, |
int | next_flag, | ||
int | team_mask, | ||
int | attacked_objnum, | ||
int | play_fail_snd, | ||
int | filter, | ||
int | get_closest_turret_attacking_player | ||
) |
Definition at line 4637 of file hudtarget.cpp.
void hud_target_next_subobject | ( | ) |
Definition at line 1147 of file hudtarget.cpp.
Definition at line 1252 of file hudtarget.cpp.
void hud_target_prev_subobject | ( | ) |
Definition at line 1142 of file hudtarget.cpp.
void hud_target_random_ship | ( | ) |
Definition at line 5221 of file hudtarget.cpp.
Definition at line 1545 of file hudtarget.cpp.
Definition at line 1076 of file hudtarget.cpp.
void hud_target_subsystem_in_reticle | ( | ) |
Definition at line 2673 of file hudtarget.cpp.
void hud_target_targets_target | ( | ) |
Definition at line 2388 of file hudtarget.cpp.
void hud_target_toggle_hidden_from_sensors | ( | ) |
Definition at line 4920 of file hudtarget.cpp.
Definition at line 1567 of file hudtarget.cpp.
Definition at line 4977 of file hudtarget.cpp.
Definition at line 2803 of file hudtarget.cpp.
Definition at line 2886 of file hudtarget.cpp.
void hud_update_closest_turret | ( | ) |
Definition at line 2321 of file hudtarget.cpp.
void hud_update_weapon_flash | ( | ) |
Definition at line 6152 of file hudtarget.cpp.
void hud_weapons_init | ( | ) |
Definition at line 999 of file hudtarget.cpp.
void hudtarget_page_in | ( | ) |
Definition at line 5249 of file hudtarget.cpp.
Definition at line 2440 of file hudtarget.cpp.
void polish_predicted_target_pos | ( | weapon_info * | wip, |
object * | targetp, | ||
vec3d * | enemy_pos, | ||
vec3d * | predicted_enemy_pos, | ||
float | dist_to_enemy, | ||
vec3d * | last_delta_vec, | ||
int | num_polish_steps | ||
) |
Definition at line 3777 of file hudtarget.cpp.
Definition at line 1698 of file hudtarget.cpp.
bool turret_weapon_has_flags | ( | ship_weapon * | swp, |
int | flags | ||
) |
Returns true if any of the weapons in swp have flags
Definition at line 306 of file aiturret.cpp.
bool turret_weapon_has_subtype | ( | ship_weapon * | swp, |
int | subtype | ||
) |
Returns true if any of the weapons in swp have the subtype specified
Definition at line 411 of file aiturret.cpp.
char* Cargo_names[] |
Definition at line 208 of file missionparse.cpp.
int Cm_coords[GR_NUM_RESOLUTIONS][2] |
Definition at line 192 of file hudtarget.cpp.
char Cm_fname[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] |
Definition at line 216 of file hudtarget.cpp.
int Cm_text_coords[GR_NUM_RESOLUTIONS][2] |
Definition at line 200 of file hudtarget.cpp.
int Cm_text_val_coords[GR_NUM_RESOLUTIONS][2] |
Definition at line 208 of file hudtarget.cpp.
hud_frames Cmeasure_gauge |
Definition at line 190 of file hudtarget.cpp.
int Cmeasure_gauge_loaded = 0 |
Definition at line 191 of file hudtarget.cpp.
char Fred_alt_names[MAX_SHIPS][NAME_LENGTH+1] |
Definition at line 93 of file management.cpp.
char Fred_callsigns[MAX_SHIPS][NAME_LENGTH+1] |
Definition at line 94 of file management.cpp.
homing_beep_info Homing_beep = { -1, 0, 150, 1000, 30.0f, 1500.0f, 1.729412f } |
Definition at line 451 of file hudtarget.cpp.
object* hostile_obj = NULL |
Definition at line 76 of file hudtarget.cpp.
htarget_list htarget_free_list |
Definition at line 98 of file hudtarget.cpp.
htarget_list htarget_items[MAX_HOTKEY_TARGET_ITEMS] |
Definition at line 97 of file hudtarget.cpp.
color HUD_color_homing_indicator |
Definition at line 957 of file hudtarget.cpp.
int HUD_drew_selection_bracket_on_target |
Definition at line 3383 of file hudtarget.cpp.
int Hud_target_h |
Definition at line 52 of file hudtarget.cpp.
int Hud_target_w |
Definition at line 52 of file hudtarget.cpp.
char Lead_fname[NUM_HUD_RETICLE_STYLES][GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] |
Definition at line 182 of file hudtarget.cpp.
hud_frames Lead_indicator_gauge |
Definition at line 180 of file hudtarget.cpp.
int Lead_indicator_gauge_loaded = 0 |
Definition at line 181 of file hudtarget.cpp.
float Lead_indicator_half[NUM_HUD_RETICLE_STYLES][GR_NUM_RESOLUTIONS][2] |
Definition at line 157 of file hudtarget.cpp.
float Max_front_seperation[GR_NUM_RESOLUTIONS] |
Definition at line 67 of file hudtarget.cpp.
float Max_offscreen_tri_seperation[GR_NUM_RESOLUTIONS] |
Definition at line 63 of file hudtarget.cpp.
float Max_warning_missile_dist |
Definition at line 455 of file hudtarget.cpp.
float Min_warning_missile_dist |
Definition at line 454 of file hudtarget.cpp.
hud_frames New_weapon |
Definition at line 232 of file hudtarget.cpp.
object obj_used_list |
Definition at line 53 of file object.cpp.
float Offscreen_tri_base[GR_NUM_RESOLUTIONS] |
Definition at line 55 of file hudtarget.cpp.
float Offscreen_tri_height[GR_NUM_RESOLUTIONS] |
Definition at line 59 of file hudtarget.cpp.
reticle_list Reticle_cur_list |
Definition at line 138 of file hudtarget.cpp.
reticle_list Reticle_list[MAX_RETICLE_TARGETS] |
Definition at line 141 of file hudtarget.cpp.
reticle_list Reticle_save_list |
Definition at line 139 of file hudtarget.cpp.
int Reticle_save_timestamp |
Definition at line 137 of file hudtarget.cpp.
SCP_vector<target_display_info> target_display_list |
Definition at line 72 of file hudtarget.cpp.
int TARGET_SHIP_IGNORE_FLAGS = (SF_EXPLODED|SF_DEPART_WARP|SF_DYING|SF_ARRIVING_STAGE_1|SF_HIDDEN_FROM_SENSORS) |
Definition at line 49 of file hudtarget.cpp.
float Target_triangle_base[GR_NUM_RESOLUTIONS] |
Definition at line 87 of file hudtarget.cpp.
float Target_triangle_height[GR_NUM_RESOLUTIONS] |
Definition at line 91 of file hudtarget.cpp.
int Toggle_text_alpha = 255 |
Definition at line 226 of file hudtarget.cpp.
shader Training_msg_glass |
Definition at line 84 of file hudtarget.cpp.
weapon_flash Weapon_flash_info |
Definition at line 437 of file hudtarget.cpp.
char* Weapon_gauge_fnames[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] |
Definition at line 390 of file hudtarget.cpp.
int Weapon_gauge_primary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][3][2] |
Definition at line 235 of file hudtarget.cpp.
int Weapon_gauge_secondary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][5][2] |
Definition at line 266 of file hudtarget.cpp.
hud_frames Weapon_gauges[NUM_HUD_SETTINGS][NUM_WEAPON_GAUGES] |
Definition at line 231 of file hudtarget.cpp.
int Weapon_gauges_loaded = 0 |
Definition at line 233 of file hudtarget.cpp.
int Weapon_plink_coords[GR_NUM_RESOLUTIONS][2][2] |
Definition at line 324 of file hudtarget.cpp.
int Weapon_pname_coords[GR_NUM_RESOLUTIONS][2][2] |
Definition at line 334 of file hudtarget.cpp.
int Weapon_primary_ammo_x[GR_NUM_RESOLUTIONS] |
Definition at line 382 of file hudtarget.cpp.
int Weapon_primary_y[GR_NUM_RESOLUTIONS][2] |
Definition at line 364 of file hudtarget.cpp.
int Weapon_secondary_ammo_x[GR_NUM_RESOLUTIONS] |
Definition at line 378 of file hudtarget.cpp.
int Weapon_secondary_name_x[GR_NUM_RESOLUTIONS] |
Definition at line 374 of file hudtarget.cpp.
int Weapon_secondary_reload_x[GR_NUM_RESOLUTIONS] |
Definition at line 386 of file hudtarget.cpp.
int Weapon_secondary_y[GR_NUM_RESOLUTIONS][3] |
Definition at line 352 of file hudtarget.cpp.
int Weapon_slinked_x[GR_NUM_RESOLUTIONS] |
Definition at line 344 of file hudtarget.cpp.
int Weapon_sunlinked_x[GR_NUM_RESOLUTIONS] |
Definition at line 348 of file hudtarget.cpp.
int Weapon_title_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][2] |
Definition at line 305 of file hudtarget.cpp.