Open source remastering of the Freespace 2 engine
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
10 #ifndef __HUD_H__
11 #define __HUD_H__
13 #include "globalincs/vmallocator.h"
14 #include "graphics/2d.h"
15 #include "graphics/font.h"
16 #include "hud/hudgauges.h"
17 #include "hud/hudparse.h"
19 class object;
20 struct cockpit_display;
22 typedef struct hud_anim {
24  int first_frame; // the bitmap id for the first frame in the animation... note that
25  // all bitmap id's following this frame are numbered sequentially
26  int num_frames; // number of frames in the animation
27  int sx, sy; // screen (x,y) of top-left corner of animation
28  float total_time; // total time in seconds for the animation (depends on animation fps)
29  float time_elapsed; // time that has elapsed (in seconds) since animation started playing
30 } hud_anim;
32 typedef struct hud_frames {
35 } hud_frames;
37 // Objective display
38 typedef struct objective_display_info
39 {
41  int goal_type;
48 // used to track how player subsystems are getting damaged
49 typedef struct hud_subsys_info
50 {
51  float last_str;
55 // used for the display of damaged subsystems
56 typedef struct hud_subsys_damage
57 {
58  int str;
59  int type;
60  char *name;
63 extern int HUD_draw;
64 extern int HUD_contrast;
66 #define HUD_NUM_COLOR_LEVELS 16
69 // extern globals that will control the color of the HUD gauges
70 #define HUD_COLOR_ALPHA_USER_MAX 13 // max user-settable alpha, absolute max is 15
71 #define HUD_COLOR_ALPHA_USER_MIN 3 // min user-settable alpha, absolute min is 0
73 #define HUD_COLOR_ALPHA_MAX 15
76 #define HUD_BRIGHT_DELTA 7 // Level added to HUD_color_alpha to make brightness used for flashing
78 // hud macro for maybe flickering all gauges
79 #define GR_AABITMAP(a, b, c) { int jx, jy; if(emp_should_blit_gauge()) { gr_set_bitmap(a); jx = b; jy = c; emp_hud_jitter(&jx, &jy); gr_aabitmap(jx, jy); } }
80 #define GR_AABITMAP_EX(a, b, c, d, e, f, g) { int jx, jy; if(emp_should_blit_gauge()) { gr_set_bitmap(a); jx = b; jy = c; emp_hud_jitter(&jx, &jy); gr_aabitmap_ex(jx, jy, d, e, f, g); } }
82 // radar target identification flags
83 #define RTIF_CROSSHAIRS (1<<0) // draw crosshairs
84 #define RTIF_BLINK (1<<1) // make targeted blip blink
85 #define RTIF_PULSATE (1<<2) // make targeted blips size pulsate
86 #define RTIF_ENLARGE (1<<3) // make targeted blip appear larger than the other blips
88 extern int radar_target_id_flags;
90 extern int HUD_color_red;
91 extern int HUD_color_green;
92 extern int HUD_color_blue;
93 extern int HUD_color_alpha;
95 extern color HUD_color_debug;
97 // Values used "wiggle" the HUD. In the 2D HUD case, the clip region accounts
98 // for these, but for the 3d-type hud stuff, you need to add these in manually.
99 extern float HUD_offset_x;
100 extern float HUD_offset_y;
102 // the offset of the player's view vector and the ship forward vector in pixels (Swifty)
103 extern int HUD_nose_x;
104 extern int HUD_nose_y;
105 // Global: integrity of player's target
106 extern float Pl_target_integrity;
107 extern float Player_rearm_eta;
109 extern int Hud_max_targeting_range;
111 void HUD_init_colors();
112 void HUD_init();
113 void hud_close();
114 void hud_level_close();
115 void hud_update_frame(float frametime); // updates hud systems not dependant on rendering
116 void hud_render_preprocess(float frametime); // renders 3d dependant gauges
117 void hud_render_all();
118 void hud_render_gauges(int cockpit_display_num = -1);
121 // set the offset values for this render frame
122 void HUD_set_offsets(object *viewer_obj, int wiggedy_wack, matrix *eye_orient);
123 // returns the offset between the player's view vector and the forward vector of the ship in pixels (Swifty)
124 void HUD_get_nose_coordinates(int *x, int *y);
126 // Basically like gr_reset_clip only it accounts for hud jittering
127 void HUD_reset_clip();
128 void hud_save_restore_camera_data(int save);
130 // Basically like gr_set_clip only it accounts for hud jittering
131 void HUD_set_clip(int x, int y, int w, int h);
133 // do flashing text gauge
134 void hud_start_text_flash(const char *txt, int t, int interval = 200);
136 // convert a string to use mono spaced numbers
137 void hud_num_make_mono(char *num_str, int font_num = FONT1);
139 // functions for handling hud animations
140 void hud_anim_init(hud_anim *ha, int sx, int sy, const char *filename);
141 void hud_frames_init(hud_frames *hf);
142 int hud_anim_render(hud_anim *ha, float frametime, int draw_alpha=0, int loop=1, int hold_last=0, int reverse=0,int resize_mode=GR_RESIZE_FULL, bool mirror = false);
143 int hud_anim_load(hud_anim *ha);
145 // functions for displaying the support view popup
147 void hud_support_view_stop(int stop_now=0);
153 // setting HUD colors
154 void hud_set_default_color();
155 void hud_set_iff_color(object *objp, int is_bright=0);
156 color* hud_get_iff_color(object *objp, int is_bright=0);
157 void hud_set_bright_color();
158 void hud_set_dim_color();
160 // HUD gauge functions
161 #define HUD_C_NONE -4
162 #define HUD_C_BRIGHT -3
163 #define HUD_C_DIM -2
164 #define HUD_C_NORMAL -1
165 void hud_set_gauge_color(int gauge_index, int bright_index = HUD_C_NONE);
166 int hud_gauge_active(int gauge_index);
167 void hud_gauge_start_flash(int gauge_index);
168 int hud_gauge_maybe_flash(int gauge_index);
170 // popup gauges
171 void hud_gauge_popup_start(int gauge_index, int time=4000);
172 int hud_gauge_is_popup(int gauge_index);
174 // objective status gauge
176 void hud_add_objective_messsage(int type, int status);
178 int hud_get_dock_time( object *docker_objp );
179 void hud_show_target_model();
180 void hud_show_voice_status();
184 // render multiplayer text message currently being entered if any
187 int hud_get_draw();
188 void hud_toggle_draw();
189 int hud_disabled();
190 int hud_support_find_closest( int objnum );
192 // Goober5000
193 void hud_set_draw(int draw);
194 void hud_disable_except_messages(int disable);
197 // contrast stuff
198 void hud_toggle_contrast();
199 void hud_set_contrast(int high);
201 class HudGauge
202 {
203 protected:
204  int position[2];
210  int font_num;
215  bool active;
218  bool pop_up;
227  // custom gauge specific stuff
237  // Render to texture stuff
244 public:
245  // constructors
246  HudGauge();
247  HudGauge(int _gauge_object, int _gauge_config, bool _slew, bool _message, int _disabled_views, int r, int g, int b);
248  // constructor for custom gauges
249  HudGauge(int _gauge_config, bool _slew, int r, int g, int b, char* _custom_name, char* _custom_text, char* frame_fname, int txtoffset_x, int txtoffset_y);
250  virtual ~HudGauge();
252  void initPosition(int x, int y);
253  void initBaseResolution(int w, int h);
254  void initSlew(bool slew);
255  void initFont(int input_font_num);
256  void initCockpitTarget(const char* display_name, int _target_x, int _target_y, int _target_w, int _target_h, int _canvas_w, int _canvas_h);
257  void initRenderStatus(bool render);
259  int getConfigType();
260  int getObjectType();
261  void getPosition(int *x, int *y);
262  bool isOffbyDefault();
263  bool isActive();
265  void updateColor(int r, int g, int b, int a = 255);
266  void lockConfigColor(bool lock);
267  void sexpLockConfigColor(bool lock);
268  void updateActive(bool show);
269  void updatePopUp(bool pop_up_flag);
270  void updateSexpOverride(bool sexp);
273  // SEXP interfacing functions
274  // For flashing gauges in training missions
275  void startFlashSexp();
276  int maybeFlashSexp();
277  bool flashExpiredSexp();
278  void resetTimers();
280  // For updating custom gauges
281  const char* getCustomGaugeName();
282  void updateCustomGaugeCoords(int _x, int _y);
283  void updateCustomGaugeFrame(int frame_offset);
284  void updateCustomGaugeText(const char* txt);
285  void updateCustomGaugeText(const SCP_string& txt);
286  const char* getCustomGaugeText();
288  void startPopUp(int time=4000);
289  int popUpActive();
291  virtual void preprocess();
292  virtual void render(float frametime);
293  virtual bool canRender();
294  virtual void pageIn();
295  virtual void initialize();
296  virtual void onFrame(float frametime);
298  bool setupRenderCanvas(int render_target = -1);
299  void setCockpitTarget(const cockpit_display *display);
300  void resetCockpitTarget();
302  void setFont();
303  void setGaugeColor(int bright_index = -4);
305  // rendering functions
306  void renderBitmap(int x, int y);
307  void renderBitmap(int frame, int x, int y);
308  void renderBitmapColor(int frame, int x, int y);
309  void renderBitmapUv(int frame, int x, int y, int w, int h, float u0, float v0, float u1, float v1);
310  void renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy);
311  void renderString(int x, int y, const char *str);
312  void renderString(int x, int y, int gauge_id, const char *str);
313  void renderStringAlignCenter(int x, int y, int area_width, const char *s);
314  void renderPrintf(int x, int y, const char* format, ...);
315  void renderPrintf(int x, int y, int gauge_id, const char* format, ...);
316  void renderLine(int x1, int y1, int x2, int y2);
317  void renderGradientLine(int x1, int y1, int x2, int y2);
318  void renderRect(int x, int y, int w, int h);
319  void renderCircle(int x, int y, int diameter);
321  void unsize(int *x, int *y);
322  void unsize(float *x, float *y);
323  void resize(int *x, int *y);
324  void resize(float *x, float *y);
325  void setClip(int x, int y, int w, int h);
326  void resetClip();
327 };
329 class HudGaugeMissionTime: public HudGauge // HUD_MISSION_TIME
330 {
331  hud_frames time_gauge;
333  int time_text_offsets[2]; // Mission_time_text_coords[gr_screen.res]
334  int time_val_offsets[2]; // Mission_time_text_val_coords[gr_screen.res]
335 public:
337  void initBitmaps(const char *fname);
338  void initTextOffsets(int x, int y);
339  void initValueOffsets(int x, int y);
340  void render(float frametime);
341  void pageIn();
342 };
344 class HudGaugeTextWarnings: public HudGauge // HUD_TEXT_FLASH
345 {
346  int next_flash;
347  bool flash_flags;
348 public:
350  void render(float frametime);
351  void initialize();
352  int maybeTextFlash();
353 };
355 class HudGaugeKills: public HudGauge
356 {
357  hud_frames Kills_gauge;
359  int text_offsets[2];
360  int text_value_offsets[2];
361 public:
362  HudGaugeKills();
363  void initBitmaps(const char *fname);
364  void initTextOffsets(int x, int y);
365  void initTextValueOffsets(int x, int y);
366  void render(float frametime);
367  void pageIn();
368 };
370 class HudGaugeLag: public HudGauge
371 {
372  hud_frames Netlag_icon;
374  int flash_timer[2];
375  bool flash_flag;
376 public:
377  HudGaugeLag();
378  void initBitmaps(const char *fname);
379  void render(float frametime);
380  void pageIn();
382  void startFlashLag(int duration = 1400);
383  bool maybeFlashLag(bool flash_fast = false);
384 };
387 {
388 protected:
398  int flash_timer[2];
400 public:
402  void initBitmaps(const char *fname);
403  void initObjTextOffsetY(int y);
404  void initObjValueOffsetY(int y);
405  void initSubspaceTextOffsetY(int y);
406  void initSubspaceValueOffsetY(int y);
407  void initRedAlertTextOffsetY(int y);
408  void initRedAlertValueOffsetY(int y);
410  virtual void render(float frametime);
411  void startFlashNotify(int duration = 1400);
412  bool maybeFlashNotify(bool flash_fast = false);
413  void renderObjective();
414  void renderRedAlert();
415  void renderSubspace();
416  void pageIn();
417  void initialize();
418 };
421 {
422 protected:
434  int line_h;
441 public:
442  HudGaugeDamage();
443  void initBitmaps(const char *fname_top, const char *fname_middle, const char *fname_bottom);
444  void initHeaderOffsets(int x, int y);
445  void initHullIntegOffsets(int x, int y);
446  void initHullIntegValueOffsetX(int x);
447  void initMiddleFrameStartOffsetY(int y);
448  void initSubsysIntegStartOffsets(int x, int y);
449  void initSubsysIntegValueOffsetX(int x);
450  void initBottomBgOffset(int offset);
451  void initLineHeight(int h);
452  void render(float frametime);
453  void pageIn();
454  void initialize();
455 };
458 {
459 protected:
466 public:
467  HudGaugeSupport();
468  void initBitmaps(const char *fname);
469  void initHeaderOffsets(int x, int y);
470  void initTextValueOffsetY(int y);
471  void initTextDockOffsetX(int x);
472  void initTextDockValueOffsetX(int x);
473  void render(float frametime);
474  void pageIn();
475 };
478 {
479 protected:
480 public:
482  bool canRender();
483  void render(float frametime);
484 };
487 {
488 protected:
489 public:
491  void render(float frametime);
492 };
494 class HudGaugePing: public HudGauge
495 {
496 protected:
497 public:
498  HudGaugePing();
499  void render(float frametime);
500 };
503 {
504 public:
506  void render(float frametime);
507 };
510 {
511  hud_frames Marker;
513  int Marker_half[2];
514 public:
516  void initBitmap(const char *fname);
517  void initHalfSize(int w, int h);
518  void render(float frametime);
519 };
521 HudGauge* hud_get_gauge(const char* name);
526 extern int Num_hud_gauge_types;
528 #endif /* __HUD_H__ */
void updateCustomGaugeFrame(int frame_offset)
Definition: hud.cpp:409
GLenum GLsizei GLenum format
Definition: Gl.h:1509
SCP_string sexp
Definition: sexp.cpp:25556
int target_x
Definition: hud.h:242
Definition: pstypes.h:324
virtual void initialize()
Definition: hud.cpp:1049
int target_h
Definition: hud.h:241
bool message_gauge
Definition: hud.h:220
int hud_get_draw()
Definition: hud.cpp:1282
void renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy)
Definition: hud.cpp:818
virtual void onFrame(float frametime)
Definition: hud.cpp:637
void updateCustomGaugeCoords(int _x, int _y)
Definition: hud.cpp:399
void render(float frametime)
Render multiplayer text message currently being entered, if any.
Definition: hud.cpp:3761
int target_w
Definition: hud.h:241
hud_frames Objective_display_gauge
Definition: hud.h:389
int disabled_views
Definition: hud.h:221
int hud_gauge_active(int gauge_index)
Determine if the specified HUD gauge should be displayed.
Definition: hud.cpp:3006
void render(float frametime)
Definition: hud.cpp:3853
int hud_anim_render(hud_anim *ha, float frametime, int draw_alpha=0, int loop=1, int hold_last=0, int reverse=0, int resize_mode=GR_RESIZE_FULL, bool mirror=false)
Render out a frame of the targetbox static animation, based on how much time has elapsed.
Definition: hud.cpp:2228
int hud_anim_load(hud_anim *ha)
Load a hud_anim.
Definition: hud.cpp:2193
int hud_disabled_except_messages()
Like hud_disabled(), except messages are still drawn.
Definition: hud.cpp:1297
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
color HUD_color_debug
Definition: hud.cpp:85
bool lock_color
Definition: hud.h:212
int hud_get_dock_time(object *docker_objp)
Get the number of seconds until repair ship will dock with ther player.
Definition: hud.cpp:2582
void startPopUp(int time=4000)
Definition: hud.cpp:568
Definition: hud.cpp:2376
void render(float frametime)
Definition: hud.cpp:2351
int Hud_max_targeting_range
Definition: hud.cpp:99
int line_h
Definition: hud.h:434
int subsys_integ_val_offset_x
Definition: hud.h:432
int canvas_h
Definition: hud.h:240
void setGaugeColor(int bright_index=-4)
Definition: hud.cpp:445
void hud_set_draw(int draw)
Definition: hud.cpp:1276
void hud_toggle_contrast()
Definition: hud.cpp:3682
void initBitmaps(const char *fname_top, const char *fname_middle, const char *fname_bottom)
Definition: hud.cpp:1955
void updateActive(bool show)
Definition: hud.cpp:538
void initValueOffsets(int x, int y)
Definition: hud.cpp:1643
Definition: hud.h:66
bool reticle_follow
Definition: hud.h:214
int hud_gauge_maybe_flash(int gauge_index)
Set the color for a gauge that may be flashing.
Definition: hud.cpp:3167
void hud_render_gauges(int cockpit_display_num=-1)
Definition: hud.cpp:1733
int popUpActive()
Definition: hud.cpp:578
float Pl_target_integrity
Definition: hud.cpp:97
float last_str
Definition: hud.h:51
void HUD_init()
Called each level to initialize HUD systems.
Definition: hud.cpp:1164
void initSubspaceTextOffsetY(int y)
Definition: hud.cpp:3262
Definition: 2d.h:95
void updateColor(int r, int g, int b, int a=255)
Definition: hud.cpp:530
void renderBitmapColor(int frame, int x, int y)
Definition: hud.cpp:752
bool isOffbyDefault()
Definition: hud.cpp:548
void initObjTextOffsetY(int y)
Definition: hud.cpp:3252
int base_h
Definition: hud.h:205
void hud_maybe_render_multi_text()
void initRedAlertTextOffsetY(int y)
Definition: hud.cpp:3272
struct hud_subsys_info hud_subsys_info
virtual void pageIn()
Definition: hud.cpp:1040
void initBitmaps(const char *fname)
Definition: hud.cpp:2442
void hud_set_dim_color()
Set the current color to a dim HUD color (ie low alpha)
Definition: hud.cpp:2937
bool maybeFlashLag(bool flash_fast=false)
Definition: hud.cpp:2461
int textoffset_x
Definition: hud.h:231
struct hud_frames hud_frames
void hud_support_view_start()
Start displaying the support view pop-up. This will remain up until hud_support_view_stop() is called...
Definition: hud.cpp:2540
void setCockpitTarget(const cockpit_display *display)
Definition: hud.cpp:1136
float Player_rearm_eta
Definition: hud.cpp:179
void initCockpitTarget(const char *display_name, int _target_x, int _target_y, int _target_w, int _target_h, int _canvas_w, int _canvas_h)
Definition: hud.cpp:1099
void initBitmaps(const char *fname)
Definition: hud.cpp:2381
void hud_update_frame(float frametime)
Updates HUD systems each frame.
Definition: hud.cpp:1336
int textoffset_y
Definition: hud.h:231
void initTextValueOffsetY(int y)
Definition: hud.cpp:2743
void hud_gauge_popup_start(int gauge_index, int time=4000)
Start a gauge to pop-up.
Definition: hud.cpp:3036
int Num_hud_gauge_types
Definition: hudparse.cpp:152
void renderLine(int x1, int y1, int x2, int y2)
Definition: hud.cpp:850
void hud_add_objective_messsage(int type, int status)
Add objective status on the HUD.
Definition: hud.cpp:3230
void hud_toggle_draw()
Definition: hud.cpp:1270
void initTextValueOffsets(int x, int y)
Definition: hud.cpp:2395
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
int target_y
Definition: hud.h:242
void pageIn()
Definition: hud.cpp:2401
int custom_frame_offset
Definition: hud.h:230
object * objp
Definition: lua.cpp:3105
void initBaseResolution(int w, int h)
Definition: hud.cpp:369
int Damage_flash_timer
Definition: hud.h:436
int hud_disabled()
Checks if HUD disabled.
Definition: hud.cpp:1306
int texture_target
Definition: hud.h:239
hud_frames damage_top
Definition: hud.h:423
void initBitmaps(const char *fname)
Definition: hud.cpp:1649
void renderGradientLine(int x1, int y1, int x2, int y2)
Definition: hud.cpp:873
void initMiddleFrameStartOffsetY(int y)
Definition: hud.cpp:1929
void hud_set_gauge_color(int gauge_index, int bright_index=HUD_C_NONE)
Set the HUD color for the gauge, based on whether it is flashing or not.
Definition: hud.cpp:3095
float time_elapsed
Definition: hud.h:29
void setClip(int x, int y, int w, int h)
Definition: hud.cpp:942
bool maybeFlashNotify(bool flash_fast=false)
Definition: hud.cpp:3309
void hud_stop_looped_engine_sounds()
Called when the game decides to stop all looping sounds.
Definition: hud.cpp:1816
void render(float frametime)
Definition: hud.cpp:1663
GLenum type
Definition: Gl.h:1492
int popup_timer
Definition: hud.h:219
bool flash_status
Definition: hud.h:440
bool flashExpiredSexp()
Definition: hud.cpp:608
virtual void render(float frametime)
Definition: hud.cpp:3331
Definition: hud.h:201
void hud_disable_except_messages(int disable)
Definition: hud.cpp:1288
void initTextOffsets(int x, int y)
Definition: hud.cpp:2389
hud_frames background
Definition: hud.h:460
GLdouble u1
Definition: Glext.h:7779
void initRedAlertValueOffsetY(int y)
Definition: hud.cpp:3277
void updatePopUp(bool pop_up_flag)
Definition: hud.cpp:563
void initTextDockValueOffsetX(int x)
Definition: hud.cpp:2753
int HUD_color_green
Definition: hud.cpp:74
int flash_timer[2]
Definition: hud.h:398
void initFont(int input_font_num)
Definition: hud.cpp:382
char texture_target_fname[MAX_FILENAME_LEN]
Definition: hud.h:238
int next_flash
Definition: hud.h:439
void HUD_init_hud_color_array()
Definition: hud.cpp:208
GLintptr offset
Definition: Glext.h:5497
int flash_duration
Definition: hud.h:223
void hud_support_view_stop(int stop_now=0)
Stop displaying the support view pop-up.
Definition: hud.cpp:2551
int HUD_nose_x
Definition: hud.cpp:94
int text_dock_offset_x
Definition: hud.h:464
HudGauge * hud_get_gauge(const char *name)
Definition: hud.cpp:3721
void resetTimers()
Definition: hud.cpp:592
int hull_integ_val_offset_x
Definition: hud.h:429
void initRenderStatus(bool render)
Definition: hud.cpp:543
GLdouble GLdouble GLdouble r
Definition: Glext.h:5337
struct objective_display_info objective_display_info
int display_offset_x
Definition: hud.h:243
bool sexp_lock_color
Definition: hud.h:213
int Subspace_text_offset_y
Definition: hud.h:393
int first_frame
Definition: hud.h:24
GLboolean GLboolean g
Definition: Glext.h:5781
const char * getCustomGaugeText()
Definition: hud.cpp:394
int font_num
Definition: hud.h:210
void initSubsysIntegStartOffsets(int x, int y)
Definition: hud.cpp:1934
void initSlew(bool slew)
Definition: hud.cpp:377
void render(float frametime)
Definition: hud.cpp:2771
GLboolean GLboolean GLboolean GLboolean a
Definition: Glext.h:5781
void hud_subspace_notify_abort()
Definition: hud.cpp:3489
void initBottomBgOffset(int offset)
Definition: hud.cpp:1945
bool custom_gauge
Definition: hud.h:228
char * name
Definition: hud.h:60
int sx
Definition: hud.h:27
void hud_frames_init(hud_frames *hf)
Initialise the members of the hud_frames struct to default values.
Definition: hud.cpp:2183
char * filename
int num_frames
Definition: hud.h:34
void hud_render_all()
Undertakes main HUD render.
Definition: hud.cpp:1716
int Subspace_text_val_offset_y
Definition: hud.h:394
bool sexp_override
Definition: hud.h:217
int base_w
Definition: hud.h:205
GLfloat v0
Definition: Glext.h:5638
void hud_save_restore_camera_data(int save)
Called to save and restore the 3D camera settings.
Definition: hud.cpp:3656
Definition: hud.cpp:246
void hud_level_close()
Do post mission cleanup of HUD.
Definition: hud.cpp:1229
Definition: hud.cpp:1907
void initHeaderOffsets(int x, int y)
Definition: hud.cpp:1912
void initLineHeight(int h)
Definition: hud.cpp:1950
void hud_show_target_model()
virtual void preprocess()
Definition: hud.cpp:632
int hud_gauge_is_popup(int gauge_index)
Determine if gauge is in pop-up mode or not.
Definition: hud.cpp:3026
void initBitmaps(const char *fname)
Definition: hud.cpp:3282
GLdouble s
Definition: Glext.h:5321
Definition: hud.h:32
int getObjectType()
Definition: hud.cpp:515
matrix eye_orient
Definition: fredrender.cpp:112
int hud_support_find_closest(int objnum)
Locate the closest support ship which is trying to dock with player.
Definition: hud.cpp:2655
int middle_frame_start_offset_y
Definition: hud.h:430
void initObjValueOffsetY(int y)
Definition: hud.cpp:3257
void hud_set_bright_color()
Set the current color to a bright HUD color (ie high alpha)
Definition: hud.cpp:2927
bool off_by_default
Definition: hud.h:216
void hud_set_default_color()
Set the current color to the default HUD color (with default alpha)
Definition: hud.cpp:2918
void resetClip()
Definition: hud.cpp:978
void HUD_init_colors()
Definition: hud.cpp:219
GLdouble GLdouble t
Definition: Glext.h:5329
int header_offsets[2]
Definition: hud.h:427
void renderString(int x, int y, const char *str)
Definition: hud.cpp:665
void render(float frametime)
Definition: hud.cpp:3891
int Objective_text_offset_y
Definition: hud.h:391
const char * getCustomGaugeName()
Definition: hud.cpp:389
int gauge_config
Definition: hud.h:207
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
int radar_target_id_flags
Definition: radarsetup.cpp:69
void HUD_set_clip(int x, int y, int w, int h)
Like gr_set_clip() only it accounts for HUD jittering.
Definition: hud.cpp:3644
Definition: object.h:141
Definition: hud.h:22
void setFont()
Definition: hud.cpp:440
int HUD_contrast
Definition: hud.cpp:79
flag_def_list Hud_gauge_types[]
Definition: hudparse.cpp:99
void hud_gauge_start_flash(int gauge_index)
Call HUD function to flash gauge.
Definition: hud.cpp:3066
void updateSexpOverride(bool sexp)
Definition: hud.cpp:558
GLfloat GLfloat v1
Definition: Glext.h:5639
Definition: 2d.h:682
void hud_set_contrast(int high)
Definition: hud.cpp:3687
void startFlashLag(int duration=1400)
Definition: hud.cpp:2456
struct hud_anim hud_anim
int display_offset_y
Definition: hud.h:243
void renderRect(int x, int y, int w, int h)
Definition: hud.cpp:896
void initSubsysIntegValueOffsetX(int x)
Definition: hud.cpp:1940
int maybeFlashSexp()
Definition: hud.cpp:617
GLuint const GLchar * name
Definition: Glext.h:5608
int canvas_w
Definition: hud.h:240
int first_frame
Definition: hud.h:33
int flash_duration_timestamp
Definition: hud.h:52
void render(float frametime)
Display the kills gauge on the HUD.
Definition: hud.cpp:2409
void renderStringAlignCenter(int x, int y, int area_width, const char *s)
Definition: hud.cpp:716
virtual bool canRender()
Definition: hud.cpp:1059
int num_frames
Definition: hud.h:26
void HUD_get_nose_coordinates(int *x, int *y)
Returns the offset between the player's view vector and the forward vector of the ship in pixels (Swi...
Definition: hud.cpp:3583
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
void pageIn()
Definition: hud.cpp:2451
int HUD_nose_y
Definition: hud.cpp:95
Definition: hud.cpp:3811
bool Damage_flash_bright
Definition: hud.h:437
void pageIn()
Definition: hud.cpp:1983
color gauge_color
Definition: hud.h:206
void HUD_reset_clip()
Like gr_reset_clip() only it accounts for HUD jittering.
Definition: hud.cpp:3633
bool flash_status
Definition: hud.h:225
#define FONT1
Definition: font.h:65
void hud_support_view_abort()
Definition: hud.cpp:2566
Definition: globals.h:15
GLubyte GLubyte GLubyte GLubyte w
Definition: Glext.h:5679
void unsize(int *x, int *y)
Definition: hud.cpp:1012
int position[2]
Definition: hud.h:204
virtual void render(float frametime)
Definition: hud.cpp:642
void initHeaderOffsets(int x, int y)
Definition: hud.cpp:2737
void render(float frametime)
Definition: hud.cpp:1990
int HUD_color_red
Definition: hud.cpp:73
void startFlashSexp()
Definition: hud.cpp:601
void initTextOffsets(int x, int y)
Definition: hud.cpp:1637
bool canRender()
Definition: hud.cpp:3753
bool active
Definition: hud.h:215
float total_time
Definition: hud.h:28
int sy
Definition: hud.h:27
void getPosition(int *x, int *y)
Definition: hud.cpp:363
bool isActive()
Definition: hud.cpp:553
int Red_text_val_offset_y
Definition: hud.h:396
void sexpLockConfigColor(bool lock)
Definition: hud.cpp:525
void resize(int *x, int *y)
Definition: hud.cpp:1026
void initSubspaceValueOffsetY(int y)
Definition: hud.cpp:3267
float HUD_offset_x
Definition: hud.cpp:90
SCP_string custom_text
Definition: hud.h:233
int Header_offsets[2]
Definition: hud.h:462
bool pop_up
Definition: hud.h:218
void renderPrintf(int x, int y, const char *format,...)
Definition: hud.cpp:724
void initHullIntegValueOffsetX(int x)
Definition: hud.cpp:1924
void initialize()
Definition: hud.cpp:1973
int getConfigType()
Definition: hud.cpp:509
#define HUD_C_NONE
Definition: hud.h:161
void hud_show_voice_status()
void render(float frametime)
Definition: hud.cpp:2483
virtual ~HudGauge()
Definition: hud.cpp:355
char filename[MAX_FILENAME_LEN]
Definition: hud.h:23
void hud_anim_init(hud_anim *ha, int sx, int sy, const char *filename)
Initialise the members of the hud_anim struct to default values.
Definition: hud.cpp:2169
color HUD_color_defaults[HUD_NUM_COLOR_LEVELS]
Definition: hud.cpp:84
int hull_integ_offsets[2]
Definition: hud.h:428
void initBitmaps(const char *fname)
Definition: hud.cpp:2758
int gauge_object
Definition: hud.h:208
int bottom_bg_offset
Definition: hud.h:433
void lockConfigColor(bool lock)
Definition: hud.cpp:520
int flash_next
Definition: hud.h:224
hud_frames damage_middle
Definition: hud.h:424
void renderBitmapUv(int frame, int x, int y, int w, int h, float u0, float v0, float u1, float v1)
void hud_set_iff_color(object *objp, int is_bright=0)
Will set the color to the IFF color based on the team.
Definition: hud.cpp:2950
bool setupRenderCanvas(int render_target=-1)
Definition: hud.cpp:1121
char custom_name[NAME_LENGTH]
Definition: hud.h:232
Definition: hud.cpp:2436
struct hud_subsys_damage hud_subsys_damage
void render(float frametime)
Definition: hud.cpp:3780
int text_val_offset_y
Definition: hud.h:463
void initHullIntegOffsets(int x, int y)
Definition: hud.cpp:1918
hud_frames damage_bottom
Definition: hud.h:425
void initPosition(int x, int y)
Definition: hud.cpp:357
hud_frames custom_frame
Definition: hud.h:229
void initTextDockOffsetX(int x)
Definition: hud.cpp:2748
int text_dock_val_offset_x
Definition: hud.h:465
void updateCustomGaugeText(const char *txt)
Definition: hud.cpp:422
void hud_support_view_update()
Definition: hud.cpp:2696
int HUD_draw
Definition: hud.cpp:78
void render(float frametime)
Render multiplayer ping time to the server, if appropriate.
Definition: hud.cpp:3820
color * hud_get_iff_color(object *objp, int is_bright=0)
int HUD_color_alpha
Definition: hud.cpp:76
void initBitmap(const char *fname)
Definition: hud.cpp:3876
int Objective_text_val_offset_y
Definition: hud.h:392
void hud_update_objective_message()
Definition: hud.cpp:3194
void hud_render_preprocess(float frametime)
Render gauges that need to be between a g3_start_frame() and a g3_end_frame()
Definition: hud.cpp:1580
SCP_string default_text
Definition: hud.h:235
void initHalfSize(int w, int h)
Definition: hud.cpp:3885
void HUD_set_offsets(object *viewer_obj, int wiggedy_wack, matrix *eye_orient)
Set the offset values for this render frame.
Definition: hud.cpp:3536
void hud_num_make_mono(char *num_str, int font_num=FONT1)
Convert a number string to use mono-spaced 1 character.
Definition: hud.cpp:2275
void hud_start_text_flash(const char *txt, int t, int interval=200)
Definition: hud.cpp:2304
int subsys_integ_start_offsets[2]
Definition: hud.h:431
int maybeTextFlash()
Definition: hud.cpp:2337
GLint y
Definition: Gl.h:1505
void resetCockpitTarget()
Definition: hud.cpp:1155
SCP_vector< HudGauge * > default_hud_gauges
Definition: hud.cpp:57
void renderCircle(int x, int y, int diameter)
Definition: hud.cpp:919
void pageIn()
Definition: hud.cpp:2766
void startFlashNotify(int duration=1400)
Definition: hud.cpp:3304
void hud_close()
Delete all HUD gauge objects, for all ships.
Definition: hud.cpp:1247
int HUD_color_blue
Definition: hud.cpp:75
void renderBitmap(int x, int y)
Definition: hud.cpp:782
float HUD_offset_y
Definition: hud.cpp:91