Remove dead code in hud directory.

Removed a lot of unused functions.
This is mostly a cleanup of a prior refactoring.
There where a lot of unimplemented functions remaining from renaming.
Removed several outcommented parts of code.
This commit is contained in:
CasparKielwein committed 2018-12-26 20:40:20 +01:00
1 parent 72dae916a9
commit 0692286bba
18 files changed
-687

No files matched your search

-367
View File
@@ -46,7 +46,6 @@ void hud_init_brackets()
{
}
// Called by draw_bounding_brackets.
void draw_brackets_square(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2, int resize_mode)
{
int width, height;
@@ -140,112 +139,6 @@ void draw_brackets_square_quick(graphics::line_draw_list* draw_list, int x1, int
}
}
#define NUM_DASHES 2
void draw_brackets_dashed_square_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2)
{
int width, height, i;
width = x2 - x1;
height = y2 - y1;
// make the brackets extend 25% of the way along the width or height
float bracket_width = width/4.0f;
float bracket_height = height/4.0f;
int dash_width = (int)std::lround(bracket_width / ( NUM_DASHES*2 - 1 ));
if ( dash_width < 1 ) {
draw_brackets_square_quick(draw_list, x1, y1, x2, y2);
return;
}
int dash_height = (int)std::lround(bracket_height / ( NUM_DASHES*2 - 1 ));
if ( dash_height < 1 ) {
draw_brackets_square_quick(draw_list, x1, y1, x2, y2);
return;
}
int dash_x1, dash_x2, dash_y1, dash_y2;
dash_x1 = x1;
dash_x2 = x2;
dash_y1 = y1;
dash_y2 = y2;
for ( i = 0; i < NUM_DASHES; i++ ) {
// top line
draw_list->add_line(dash_x1, y1, dash_x1+(dash_width-1), y1);
draw_list->add_line(dash_x2, y1, dash_x2-(dash_width-1), y1);
// bottom line
draw_list->add_line(dash_x1, y2, dash_x1+(dash_width-1), y2);
draw_list->add_line(dash_x2, y2, dash_x2-(dash_width-1), y2);
dash_x1 += dash_width*2;
dash_x2 -= dash_width*2;
// left line
draw_list->add_line(x1, dash_y1, x1, dash_y1+(dash_height-1));
draw_list->add_line(x1, dash_y2, x1, dash_y2-(dash_height-1));
// right line
draw_list->add_line(x2, dash_y1, x2, dash_y1+(dash_height-1));
draw_list->add_line(x2, dash_y2, x2, dash_y2-(dash_height-1));
dash_y1 += dash_height*2;
dash_y2 -= dash_height*2;
}
}
// draw_brackets_diamond()
// Called by draw_bounding_brackets.
void draw_brackets_diamond(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2)
{
int width, height, half_width, half_height;
int center_x, center_y;
int x_delta, y_delta;
float side_len, bracket_len;
width = x2 - x1;
height = y2 - y1;
half_width = (int)std::lround( width/2.0f );
half_height = (int)std::lround( height/2.0f );
side_len = (float)_hypot(half_width, half_height);
bracket_len = side_len / 8;
x_delta = (int)std::lround(bracket_len * width / side_len);
y_delta = (int)std::lround(bracket_len * height / side_len);
center_x = x1 + half_width;
center_y = y1 + half_height;
// top left line
draw_list->add_gradient(center_x - x_delta, y1 + y_delta,center_x, y1);
draw_list->add_gradient(x1 + x_delta, center_y - y_delta, x1, center_y);
// top right line
draw_list->add_gradient(center_x + x_delta, y1 + y_delta,center_x, y1);
draw_list->add_gradient(x2 - x_delta, center_y - y_delta, x2, center_y);
// bottom left line
draw_list->add_gradient(x1 + x_delta, center_y + y_delta, x1, center_y);
draw_list->add_gradient(center_x - x_delta, y2 - y_delta, center_x, y2);
// bottom right line
draw_list->add_gradient(x2 - x_delta, center_y + y_delta, x2, center_y);
draw_list->add_gradient(center_x + x_delta, y2 - y_delta, center_x, y2);
}
void draw_brackets_diamond_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2)
{
int width, height, half_width, half_height;
@@ -290,91 +183,6 @@ void draw_brackets_diamond_quick(graphics::line_draw_list* draw_list, int x1, in
draw_list->add_line(center_x-x_delta, center_y+y_delta, center_x+x_delta, center_y-y_delta);
}
// Draw bounding brackets for a subobject.
// unused function, candidate for removal
#if 0
void draw_bounding_brackets_subobject()
{
if (Player_ai->targeted_subsys_parent == Player_ai->target_objnum)
if (Player_ai->targeted_subsys != NULL) {
ship_subsys *subsys;
int target_objnum;
object* targetp;
vertex subobj_vertex;
vec3d subobj_pos;
int x1,x2,y1,y2;
subsys = Player_ai->targeted_subsys;
target_objnum = Player_ai->target_objnum;
Assert(target_objnum != -1);
targetp = &Objects[target_objnum];
Assert( targetp->type == OBJ_SHIP );
get_subsystem_world_pos(targetp, subsys, &subobj_pos);
g3_rotate_vertex(&subobj_vertex,&subobj_pos);
g3_project_vertex(&subobj_vertex);
if (subobj_vertex.flags & PF_OVERFLOW) // if overflow, no point in drawing brackets
return;
int subobj_x = fl2i(subobj_vertex.screen.xyw.x + 0.5f);
int subobj_y = fl2i(subobj_vertex.screen.xyw.y + 0.5f);
int hud_subtarget_w, hud_subtarget_h, bound_rc;
bound_rc = subobj_find_2d_bound(subsys->system_info->radius, &targetp->orient, &subobj_pos, &x1,&y1,&x2,&y2);
if ( bound_rc != 0 )
return;
hud_subtarget_w = x2-x1+1;
if ( hud_subtarget_w > gr_screen.clip_width ) {
hud_subtarget_w = gr_screen.clip_width;
}
hud_subtarget_h = y2-y1+1;
if ( hud_subtarget_h > gr_screen.clip_height ) {
hud_subtarget_h = gr_screen.clip_height;
}
if ( hud_subtarget_w > gr_screen.max_w ) {
x1 = subobj_x - (gr_screen.max_w>>1);
x2 = subobj_x + (gr_screen.max_w>>1);
}
if ( hud_subtarget_h > gr_screen.max_h ) {
y1 = subobj_y - (gr_screen.max_h>>1);
y2 = subobj_y + (gr_screen.max_h>>1);
}
// *** these unsize take care of everything below ***
gr_unsize_screen_pos( &hud_subtarget_w, &hud_subtarget_h );
gr_unsize_screen_pos( &subobj_x, &subobj_y );
gr_unsize_screen_pos( &x1, &y1 );
gr_unsize_screen_pos( &x2, &y2 );
// determine if subsystem is on far or near side of the ship
Player->subsys_in_view = ship_subsystem_in_sight(targetp, subsys, &View_position, &subobj_pos, 0);
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
// Goober5000: this will now execute for fighterbays if the bay has been given a
// percentage subsystem strength in ships.tbl
// Goober5000: this will now execute for any subsys that takes damage and will not
// execute for any subsys that doesn't take damage
if ( (Player_ai->targeted_subsys->current_hits <= 0) && ( ship_subsys_takes_damage(Player_ai->targeted_subsys) ) ) {
gr_set_color_fast(iff_get_color(IFF_COLOR_MESSAGE, 1));
} else {
hud_set_iff_color( targetp, 1 );
}
if ( Player->subsys_in_view ) {
draw_brackets_square_quick(x1, y1, x2, y2);
} else {
draw_brackets_diamond_quick(x1, y1, x2, y2);
}
// mprintf(("Drawing subobject brackets at %4i, %4i\n", sx, sy));
}
}
#endif
extern int HUD_drew_selection_bracket_on_target;
//Do we want to show the ship & class name?
extern int Cmdline_targetinfo;
@@ -414,181 +222,6 @@ int Ships_attacking_bitmap = -1;
int num_ships_attacking(int target_objnum);
// draw_bounding_brackets() will draw the faded brackets that surround the current target
// NOTE: x1, y1, x2 & y2 are assumed to be scaled sizes, w_correction & h_correction are assumed to be unscaled!!
// unused function, candidate for removal
#if 0
void draw_bounding_brackets(int x1, int y1, int x2, int y2, int w_correction, int h_correction, float distance, int target_objnum)
{
int width, height;
if ( ( x1 < 0 && x2 < 0 ) || ( y1 < 0 && y2 < 0 ) )
return;
if ( ( x1 > gr_screen.clip_width && x2 > gr_screen.clip_width ) ||
( y1 > gr_screen.clip_height && y2 > gr_screen.clip_height ) )
return;
// *** everything below is taken care of with this unsize ***
gr_unsize_screen_pos(&x1, &y1);
gr_unsize_screen_pos(&x2, &y2);
width = x2-x1;
Assert(width>=0);
height = y2-y1;
Assert(height>=0);
if ( (width >= (gr_screen.max_w_unscaled)) && (height >= (gr_screen.max_h_unscaled)) ) {
return;
}
if (width < Min_target_box_width[gr_screen.res]) {
x1 = x1 - (Min_target_box_width[gr_screen.res]-width)/2;
x2 = x2 + (Min_target_box_width[gr_screen.res]-width)/2;
}
if (height < Min_target_box_height[gr_screen.res]) {
y1 = y1 - (Min_target_box_height[gr_screen.res]-height)/2;
y2 = y2 + (Min_target_box_height[gr_screen.res]-height)/2;
}
draw_brackets_square(x1-w_correction, y1-h_correction, x2+w_correction, y2+h_correction);
// draw distance to target in lower right corner of box
if ( distance > 0 ) {
hud_target_show_dist_on_bracket(x2+w_correction,y2+h_correction,distance);
}
// Maybe show + for each additional fighter or bomber attacking target.
if ( (target_objnum != -1) && hud_gauge_active(HUD_ATTACKING_TARGET_COUNT) ) {
int num_attacking = num_ships_attacking(target_objnum);
if (Ships_attacking_bitmap == -1){
Ships_attacking_bitmap = bm_load(Ships_attack_fname[gr_screen.res]);
}
if (Ships_attacking_bitmap == -1) {
Int3();
return;
}
// If a ship is attacked by player, show one fewer plus
int k=0;
if (Objects[target_objnum].type == OBJ_SHIP) {
if (iff_x_attacks_y(Player_ship->team, Ships[Objects[target_objnum].instance].team)) {
k = 1;
}
} else {
k = 1;
}
if (num_attacking > k) {
int i, num_blips;
num_blips = num_attacking-k;
if (num_blips > 4){
num_blips = 4;
}
if (Ships_attacking_bitmap >= 0) {
if (num_blips > 3)
y1 -= 3;
for (i=0; i<num_blips; i++) {
GR_AABITMAP(Ships_attacking_bitmap, x2+3, y1+i*7);
}
}
//Increment for the position of ship name/class.
//DEPENDANT ON ATTACKER SIZE (X)
x2 += 7;
}
}
if(Cmdline_targetinfo && (target_objnum != -1))
{
object* t_objp = &Objects[target_objnum];
const char* tinfo_name = NULL;
const char* tinfo_class = NULL;
char temp_name[NAME_LENGTH*2+3];
char temp_class[NAME_LENGTH];
SCP_list<CJumpNode>::iterator jnp;
switch(t_objp->type)
{
case OBJ_SHIP:
hud_stuff_ship_name(temp_name, &Ships[t_objp->instance]);
hud_stuff_ship_class(temp_class, &Ships[t_objp->instance]);
tinfo_name = temp_name;
tinfo_class = temp_class;
// maybe concatenate the callsign
if (*temp_name)
{
char temp_callsign[NAME_LENGTH];
hud_stuff_ship_callsign(temp_callsign, &Ships[t_objp->instance]);
if (*temp_callsign)
sprintf(&temp_name[strlen(temp_name)], " (%s)", temp_callsign);
}
// maybe substitute the callsign
else
{
hud_stuff_ship_callsign(temp_name, &Ships[t_objp->instance]);
}
break;
case OBJ_DEBRIS:
tinfo_name = XSTR("Debris", 348);
break;
case OBJ_WEAPON:
strcpy_s(temp_name, Weapon_info[Weapons[t_objp->instance].weapon_info_index].name);
end_string_at_first_hash_symbol(temp_name);
tinfo_name = temp_name;
break;
case OBJ_ASTEROID:
switch(Asteroids[t_objp->instance].asteroid_type)
{
case ASTEROID_TYPE_SMALL:
case ASTEROID_TYPE_MEDIUM:
case ASTEROID_TYPE_LARGE:
tinfo_name = NOX("Asteroid");
break;
default:
tinfo_name = XSTR("Debris", 348);
}
break;
case OBJ_JUMP_NODE:
for (jnp = Jump_nodes.begin(); jnp != Jump_nodes.end(); ++jnp) {
if(jnp->GetSCPObject() == t_objp)
break;
}
strcpy_s(temp_name, jnp->GetName());
end_string_at_first_hash_symbol(temp_name);
tinfo_name = temp_name;
break;
}
if(tinfo_name)
{
gr_string(x2+3, y1, tinfo_name);
}
if(tinfo_class)
{
gr_string(x2+3, y1+9, tinfo_class);
}
/*
if(tinfo_callsign)
{
gr_string(x2+3, y1+18, tinfo_callsign);
}
*/
}
}
#endif
int draw_subsys_brackets(graphics::line_draw_list* draw_list, ship_subsys* subsys, int min_width, int min_height, bool draw, bool set_color, int* draw_coords)
{
Assertion(subsys != NULL, "Invalid subsystem pointer passed to draw_subsys_brackets!");
-8
View File
@@ -16,16 +16,9 @@
#include "graphics/line_draw_list.h"
void hud_init_brackets();
// two unused functions, candidates for removal?
#if 0
void draw_bounding_brackets(int x1, int y1, int x2, int y2, int w_correction, int h_correction, float distance=0.0f, int target_objnum=-1);
void draw_bounding_brackets_subobject();
#endif
void draw_brackets_square(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2, int resize_mode = GR_RESIZE_FULL);
void draw_brackets_diamond(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2);
void draw_brackets_square_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2, int thick=0);
void draw_brackets_diamond_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2);
void draw_brackets_dashed_square_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2);
int draw_subsys_brackets(graphics::line_draw_list* draw_list, ship_subsys* subsys, int min_width, int min_height, bool draw = true, bool set_color = true, int* draw_coords = NULL);
@@ -50,7 +43,6 @@ public:
void renderNavBrackets(vec3d* nav_pos, vertex* nav_point, color* clr, char* string);
void renderBoundingBrackets(int x1, int y1, int x2, int y2, int w_correction, int h_correction, float distance, int target_objnum, int flags);
void renderBoundingBracketsSubobject();
void renderDistance(int x, int y, float distance);
};
#endif
-63
View File
@@ -554,29 +554,6 @@ UI_XSTR HC_text[GR_NUM_RESOLUTIONS][NUM_HUD_TEXT] = {
}
};
void hud_config_set_rgb(int gauge, int r, int g, int b);
void hud_config_set_alpha(int gauge, int a);
/*
#define NUM_HC_SPECIAL_BITMAPS 2
#define HC_SPECIAL_RETICLE 0
#define HC_SPECIAL_TEXT 1
typedef struct HC_special_bitmap
{
char *filename;
int x,y;
int bitmap;
} HC_special_bitmap;
HC_special_bitmap HC_special_bitmaps[NUM_HC_SPECIAL_BITMAPS] =
{
//XSTR:OFF
{"HG_00a", 272, 146, -1},
{"HG_04a", 132, 271, -1},
//XSTR:ON
};
*/
static int HC_background_bitmap;
static int HC_background_bitmap_mask;
static UI_WINDOW HC_ui_window;
@@ -584,46 +561,6 @@ static UI_WINDOW HC_ui_window;
static int HC_gauge_hot; // mouse is over this gauge
static int HC_gauge_selected; // gauge is selected
// slider controls
/*
#define HC_NUM_SLIDERS 1
#define HC_BRIGHTNESS_SLIDER 0
struct hc_sliders {
// base slider
char *filename;
int x, y, xt, yt;
int hotspot;
int dot_w;
int dots;
// left and right buttons
char *left_filename;
int left_mask, left_x, left_y;
char *right_filename;
int right_mask, right_x, right_y;
// slider control
UI_DOT_SLIDER_NEW slider; // because we have a class inside this struct, we need the constructor below..
hc_sliders(char *name, int x1, int y1, int xt1, int yt1, int h, int _dot_w, int _dots, char *_left_filename, int _left_mask, int _left_x, int _left_y, char *_right_filename, int _right_mask, int _right_x, int _right_y) :
filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h), dot_w(_dot_w), dots(_dots), left_filename(_left_filename), left_mask(_left_mask), left_x(_left_x), left_y(_left_y), right_filename(_right_filename), right_mask(_right_mask), right_x(_right_x), right_y(_right_y) {}
};
hc_sliders HC_sliders[GR_NUM_RESOLUTIONS][HC_NUM_SLIDERS] = {
{ // GR_640
hc_sliders( "HCB_22", 419, 379, -1, -1, 22, 20, 10,
"HCB_23", 23, 611, 379,
"HCB_21", 21, 391, 379)
},
{ // GR_1024
hc_sliders( "2_HCB_22", 670, 606, -1, -1, 22, 32, 10,
"2_HCB_23", 23, 698, 606,
"2_HCB_21", 21, 625, 606),
}
};
*/
// HUD colors
typedef struct hc_col {
ubyte r, g, b;
-4
View File
@@ -73,11 +73,7 @@ void hud_config_restore();
void hud_config_backup();
void hud_config_as_observer(ship *shipp,ai_info *aif);
void hud_config_as_observer();
void hud_config_as_player();
void hud_config_display_text(char* gauge_text, int x, int y);
void hud_set_display_gauge_cbox();
// leave hud config without accepting changes
void hud_config_cancel();
-89
View File
@@ -51,95 +51,6 @@ escort_info Escort_ships[MAX_COMPLETE_ESCORT_LIST];
int Num_escort_ships;
int Max_escort_ships = 3;
//int Escort_gauge_y[MAX_ESCORT_SHIPS] = { 219, 230, 241 };
/*
int Escort_gauge_text_coords[GR_NUM_RESOLUTIONS][MAX_ESCORT_SHIPS][4][2] =
{
{ // GR_640
{
{489,219},
{599,212},
{604,219},
{474,219}
},
{
{489,230},
{599,223},
{604,230},
{474,230}
},
{
{489,241},
{599,234},
{604,241},
{474,241}
},
},
{ // GR_1024
{
{869,343},
{973,338},
{981,343},
{854,343}
},
{
{869,354},
{973,349},
{981,354},
{854,354}
},
{
{869,365},
{973,360},
{981,365},
{854,365}
},
}
};
// escort gauge coords
int Escort_coords[GR_NUM_RESOLUTIONS][4][2] = {
{ // GR_640
{486, 206},
{486, 219},
{486, 230},
{486, 241}
},
{ // GR_1024
{865, 330},
{865, 343},
{865, 354},
{865, 365}
}
};
// monitoring text coords
int Monitoring_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
489, 208
},
{ // GR_1024
869, 331
}
};
char *Escort_gauge_filenames[GR_NUM_RESOLUTIONS][MAX_ESCORT_SHIPS] =
{
//XSTR:OFF
{ // GR_640
"escort1",
"escort2",
"escort3"
},
{ // GR_1024
"escort1",
"escort2",
"escort3"
}
//XSTR:ON
};*/
static int Last_target_index; // index into Escort_gauges for last targeted via 'Next Escort Target' key
HudGaugeEscort::HudGaugeEscort():
-1
View File
@@ -24,7 +24,6 @@ class object;
void hud_escort_update_list();
void hud_escort_init();
void hud_setup_escort_list(int level = 1);
void hud_escort_view_toggle();
void hud_add_remove_ship_escort(int objnum, int supress_feedback = 0);
void hud_escort_clear_all(bool clear_flags = false);
void hud_escort_ship_hit(object *objp, int quadrant);
-1
View File
@@ -27,7 +27,6 @@ class object;
#define AI_MODIFY_ETS_INTERVAL 500 // time between ets modifications for ai's (in milliseconds)
#define ZERO_INDEX 0
#define ONE_THIRD_INDEX 4
#define ONE_HALF_INDEX 6
#define ALL_INDEX 12
-2
View File
@@ -15,10 +15,8 @@
#include "hud/hud.h"
void hud_init_missile_lock();
void hud_draw_lock_triangles(int center_x, int center_y, float frametime);
void hud_calculate_lock_position(float frametime);
void hud_calculate_lock_start_pos();
void hud_show_lock_indicator(float frametime, vec3d *lock_point_pos);
void hud_do_lock_indicator(float frametime);
void hud_stop_looped_locking_sounds();
void hud_lock_reset(float lock_time_scale=1.0f);
-38
View File
@@ -551,24 +551,6 @@ void HUD_printf(const char *format, ...)
hud_sourced_print(HUD_SOURCE_COMPUTER, tmp);
}
void HUD_ship_sent_printf(int sh, const char *format, ...)
{
va_list args;
char tmp[HUD_MSG_LENGTH_MAX];
tmp[sizeof(tmp)-1] = '\0';
size_t len;
snprintf(tmp, sizeof(tmp)-1, NOX("%s: "), Ships[sh].get_display_string());
len = strlen(tmp);
va_start(args, format);
vsnprintf(tmp + len, sizeof(tmp)-1-len, format, args);
va_end(args);
Assert(strlen(tmp) < HUD_MSG_LENGTH_MAX); // If greater than this, probably crashed anyway.
hud_sourced_print(HUD_team_get_source(Ships[sh].team), tmp);
}
// --------------------------------------------------------------------------------------
// HUD_sourced_printf()
//
@@ -1235,26 +1217,6 @@ void HudGaugeTalkingHead::initBitmaps(const char *fname)
}
}
/**
* Create a new head animation object
*/
anim_instance* HudGaugeTalkingHead::createAnim(int anim_start_frame, anim* anim_data)
{
anim_play_struct aps;
float scale_x = i2fl(Anim_size[0]) / i2fl(anim_data->width);
float scale_y = i2fl(Anim_size[1]) / i2fl(anim_data->height);
anim_play_init(&aps, anim_data, fl2ir((position[0] + Anim_offsets[0] + HUD_offset_x) / scale_x), fl2ir((position[1] + Anim_offsets[1] + HUD_offset_y) / scale_y), base_w, base_h);
aps.start_at = anim_start_frame;
// aps.color = &HUD_color_defaults[HUD_color_alpha];
aps.color = &HUD_config.clr[HUD_TALKING_HEAD];
// I'd much rather use gr_init_color and retrieve the colors from this object but no, aps.color just happens to be a pointer.
// So, just give it the address from the player's HUD configuration. You win, aps.color. I'll take care of you next time. (Swifty)
return anim_play(&aps);
}
/**
* Renders everything for a head animation
* Also checks for when new head ani's need to start playing
-2
View File
@@ -68,7 +68,6 @@ int HUD_source_get_team(int team);
void HUD_printf(SCP_FORMAT_STRING const char *format, ...) SCP_FORMAT_STRING_ARGS(1, 2);
void hud_sourced_print(int source, const char *msg);
void HUD_sourced_printf(int source, SCP_FORMAT_STRING const char *format, ...) SCP_FORMAT_STRING_ARGS(2, 3); // send hud message from specified source
void HUD_ship_sent_printf(int sh, SCP_FORMAT_STRING const char *format, ...) SCP_FORMAT_STRING_ARGS(2, 3); // send hud message from a specific ship
void HUD_fixed_printf(float duration, color col, SCP_FORMAT_STRING const char *format, ...) SCP_FORMAT_STRING_ARGS(3, 4); // Display a single message for duration seconds.
void HUD_init_fixed_text(); // Clear all pending fixed text.
@@ -140,7 +139,6 @@ public:
void render(float frametime) override;
void initialize() override;
bool canRender() override;
anim_instance* createAnim(int anim_start_frame, anim* anim_data);
};
class HudGaugeFixedMessages: public HudGauge
-24
View File
@@ -58,27 +58,3 @@ void hud_observer_init(ship *shipp, ai_info *aip)
void hud_obs_render_player(int /*loc*/,net_player * /*pl*/)
{
}
void hud_obs_render_players_all()
{
int idx,count;
// render kills and stats information for all players
count = 0;
for(idx=0;idx<MAX_PLAYERS;idx++){
if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(Net_players[idx]) && !MULTI_PERM_OBSERVER(Net_players[idx]) ){
hud_obs_render_player(count,&Net_players[idx]);
}
}
}
/**
* Render any specific observer stuff
*/
void hud_render_observer()
{
Assert((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER));
// render individual player text
hud_obs_render_players_all();
}
-2
View File
@@ -22,6 +22,4 @@ extern ai_info Hud_obs_ai;
void hud_observer_init(ship *shipp,ai_info *aip);
void hud_render_observer();
#endif
-2
View File
@@ -53,14 +53,12 @@ typedef struct gauge_settings {
} gauge_settings;
//Functions
int hud_get_gauge_index(char* name);
void hud_positions_init();
void set_current_hud();
void init_hud();
void load_missing_retail_gauges();
void check_color(int *colorp);
#define NUM_HUD_OBJECT_ENTRIES 56 // not used anywhere?
int parse_gauge_type();
void load_gauge(int gauge, gauge_settings* settings);
-7
View File
@@ -169,11 +169,4 @@ public:
void hud_init_reticle();
void hud_update_reticle( player *pp );
void hud_draw_outer_reticle();
void hud_draw_center_reticle();
void hud_draw_throttle_gauge();
void hud_draw_target_throttle_gauge();
#endif
-71
View File
@@ -1909,77 +1909,6 @@ void hud_target_live_turret(int next_flag, int auto_advance, int only_player_tar
}
}
// -------------------------------------------------------------------
// hud_target_closest_locked_missile()
//
// Target the closest locked missile that is locked on locked_obj
//
// input: locked_obj => pointer to object that you want to find
// closest missile to
//
void hud_target_closest_locked_missile(object *locked_obj)
{
object *A, *nearest_obj=NULL;
weapon *wp;
weapon_info *wip;
float nearest_dist, dist;
int target_found = FALSE;
missile_obj *mo;
nearest_dist = 10000.0f;
for ( mo = GET_NEXT(&Missile_obj_list); mo != END_OF_LIST(&Missile_obj_list); mo = GET_NEXT(mo) ) {
Assert(mo->objnum >= 0 && mo->objnum < MAX_OBJECTS);
A = &Objects[mo->objnum];
if (A->type != OBJ_WEAPON){
continue;
}
Assert((A->instance >= 0) && (A->instance < MAX_WEAPONS));
wp = &Weapons[A->instance];
wip = &Weapon_info[wp->weapon_info_index];
if ( wip->subtype != WP_MISSILE ){
continue;
}
if ( !(wip->is_homing() ) ){
continue;
}
if (wp->lssm_stage==3){
continue;
}
if(hud_target_invalid_awacs(A)){
continue;
}
if (wp->homing_object == locked_obj) {
dist = vm_vec_dist_quick(&A->pos, &locked_obj->pos); // Find distance!
if (dist < nearest_dist) {
nearest_obj = A;
nearest_dist = dist;
}
}
} // end for
if (nearest_dist < 10000.0f) {
Assert(nearest_obj);
set_target_objnum( Player_ai, OBJ_INDEX(nearest_obj) );
hud_shield_hit_reset(nearest_obj);
target_found = TRUE;
}
if ( !target_found ){
snd_play( gamesnd_get_game_sound(GameSounds::TARGET_FAIL), 0.0f );
}
}
// select a new target, by auto-targeting
void hud_target_auto_target_next()
{
-2
View File
@@ -95,7 +95,6 @@ void hud_target_subsystem_in_reticle();
void hud_show_targeting_gauges(float frametime);
void hud_target_targets_target();
void hud_check_reticle_list();
void hud_target_closest_locked_missile(object *A);
void hud_target_missile(object *source_obj, int next_flag);
void hud_target_next_list(int hostile=1, int next_flag=1, int team_mask = -1, int attacked_objnum = -1, int play_fail_sound = TRUE, int filter = 0, int turret_attacking_target = 0);
int hud_target_closest_repair_ship(int goal_objnum=-1);
@@ -117,7 +116,6 @@ void hud_target_prev_subobject();
void hud_cease_subsystem_targeting(bool print_message = true);
void hud_cease_targeting(bool deliberate = false);
void hud_restore_subsystem_target(ship* shipp);
int subsystem_in_sight(object* objp, ship_subsys* subsys, vec3d *eye, vec3d* subsystem);
vec3d* get_subsystem_world_pos(object* parent_obj, ship_subsys* subsys, vec3d* world_pos);
void hud_target_change_check();
-2
View File
@@ -148,7 +148,6 @@ public:
void initTimeOffsets(int x, int y);
void initOrderOffsets(int x, int y);
void initOrderMaxWidth(int width);
void updateFrame();
void render(float frametime) override;
void initialize() override;
void initDockFlashTimer();
@@ -158,7 +157,6 @@ public:
void pageIn() override;
};
void hud_targetbox_init();
void hud_targetbox_init_flash();
void hud_get_target_strength(object *objp, float *shields, float *integrity);
-2
View File
@@ -20,9 +20,7 @@ class p_object;
void hud_init_wingman_status_gauge();
void hud_wingman_status_update();
void hud_wingman_status_render();
void hud_wingman_status_init_flash();
int hud_wingman_status_maybe_flash(int wing_index, int wing_pos);
void hud_set_wingman_status_dead(int wing_index, int wing_pos);
void hud_set_wingman_status_departed(int wing_index, int wing_pos);
void hud_set_wingman_status_alive( int wing_index, int wing_pos);