FS2_Open
Open source remastering of the Freespace 2 engine
hudreticle.h
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 */
9 
10 
11 
12 #ifndef _HUDRETICLE_H
13 #define _HUDRETICLE_H
14 
15 #include "hud/hud.h"
16 
17 class player;
18 struct weapon_info;
19 
22 
23 #define NUM_WEAPON_LINK_MODES 5
24 #define LINK_ONE_PRIMARY 0
25 #define LINK_TWO_PRIMARY 1
26 #define LINK_ONE_SECONDARY 2
27 #define LINK_TWO_SECONDARY 3
28 #define LINK_THREE_SECONDARY 4
29 
30 struct firepoint {
32  int active;
33 };
34 
36 {
37 protected:
41 
45 public:
47  void render(float frametime);
48  void initBitmaps(char *fname);
49  void pageIn();
50  void initFirepointDisplay(bool firepoint, int scaleX, int scaleY, int size);
51  void getFirepointStatus();
52 };
53 
55 {
56 protected:
58 
59  int Bottom_offset_y; // Hud_throttle_bottom_y[Hud_reticle_style][gr_screen.res]
60  int throttle_h; // Hud_throttle_h[gr_screen.res]
61  int throttle_w; // Hud_throttle_frame_w[gr_screen.res]
62  int throttle_aburn_h; // Hud_throttle_aburn_h[gr_screen.res]
63 
64  int Max_speed_offsets[2]; // Max_speed_coords[gr_screen.res][0] Max_speed_coords[gr_screen.res][1]
66 
67  int Zero_speed_offsets[2]; // Zero_speed_coords[gr_screen.res][0] Zero_speed_coords[gr_screen.res][1]
69 
70  int Orbit_center_offsets[2]; // Hud_reticle_center[gr_screen.res][0] Hud_reticle_center[gr_screen.res][1]
71  int orbit_radius; // Outer_circle_radius[gr_screen.res]
72  bool orbit;
73 
77 
78  int Glide_offsets[2];
80 
84 
86 public:
88  void initThrottleStartY(int y);
89  void initThrottleSizes(int w, int h); // throttle_w will be implicitly figured out using bm_get_info
90  void initAburnHeight(int h);
91  void initMaxSpeedOffsets(int x, int y, bool show);
92  void initZeroSpeedOffsets(int x, int y, bool show);
93  void initOrbitCenterOffsets(int x, int y, bool orbiting);
94  void initOrbitRadius(int radius);
95  void initTargetSpeedOffsets(int x, int y, bool show, bool percent);
96  void initGlideOffsets(int x, int y, bool custom);
97  void initMatchSpeedOffsets(int x, int y, bool custom);
98  void showBackground(bool show);
99  void initBitmaps(char *fname);
100 
101  void render(float frametime);
102  void renderThrottleSpeed(float current_speed, int y_end);
103  void renderThrottleLine(int y);
104  void renderThrottleForeground(int y_end);
105  void renderThrottleBackground(int y_end);
106 
107  void pageIn();
108 };
109 
111 {
112 protected:
113  hud_frames threat_arc; // The right arc if FS2 style reticle. Top arc if FS1 style reticle
114 
117 
120 
123 
126 public:
128  void initBitmaps(char *fname_arc, char *fname_laser, char *fname_lock);
129  void initLaserWarnOffsets(int x, int y);
130  void initLockWarnOffsets(int x, int y);
131  void render(float frametime);
132  void initialize();
133  void pageIn();
134  void renderLaserThreat();
135  void renderLockThreat();
136 };
137 
139 {
140 protected:
142 
145 public:
147  void init1PrimaryOffsets(int x, int y);
148  void init2PrimaryOffsets(int x, int y);
149  void init1SecondaryOffsets(int x, int y);
150  void init2SecondaryOffsets(int x, int y);
151  void init3SecondaryOffsets(int x, int y);
152  void initBitmaps(char *fname_arc,
153  char *fname_primary_link_1,
154  char *fname_primary_link_2,
155  char *fname_secondary_link_1,
156  char *fname_secondary_link_2,
157  char *fname_secondary_link_3);
158  void render(float frametime);
159  void pageIn();
160 };
161 
162 void hud_init_reticle();
163 void hud_update_reticle( player *pp );
164 
169 
170 
171 
172 #endif
int Hud_reticle_center[GR_NUM_RESOLUTIONS][2]
Definition: hudreticle.cpp:64
bool Use_custom_glide
Definition: hudreticle.h:79
int Orbit_center_offsets[2]
Definition: hudreticle.h:70
vec2d xy
Definition: hudreticle.h:31
void init1PrimaryOffsets(int x, int y)
Definition: hudreticle.cpp:773
void hud_draw_outer_reticle()
void initGlideOffsets(int x, int y, bool custom)
Definition: hudreticle.cpp:409
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
void initFirepointDisplay(bool firepoint, int scaleX, int scaleY, int size)
Definition: hudreticle.cpp:241
bool Show_target_speed
Definition: hudreticle.h:75
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
SCP_vector< firepoint > fp
Definition: hudreticle.h:40
void render(float frametime)
Definition: hudreticle.cpp:851
hud_frames throttle_frames
Definition: hudreticle.h:57
int active
Definition: hudreticle.h:32
bool Use_custom_match_speed
Definition: hudreticle.h:82
int Max_speed_offsets[2]
Definition: hudreticle.h:64
int firepoint_scale_y
Definition: hudreticle.h:44
void renderThrottleLine(int y)
Definition: hudreticle.cpp:614
hud_frames crosshair
Definition: hudreticle.h:38
GLsizeiptr size
Definition: Glext.h:5496
void renderThrottleSpeed(float current_speed, int y_end)
Definition: hudreticle.cpp:556
void initBitmaps(char *fname_arc, char *fname_primary_link_1, char *fname_primary_link_2, char *fname_secondary_link_1, char *fname_secondary_link_2, char *fname_secondary_link_3)
Definition: hudreticle.cpp:803
Definition: hud.h:201
void initAburnHeight(int h)
Definition: hudreticle.cpp:365
void renderThrottleBackground(int y_end)
Definition: hudreticle.cpp:639
void render(float frametime)
Definition: hudreticle.cpp:447
Definition: player.h:85
void initThrottleSizes(int w, int h)
Definition: hudreticle.cpp:359
void initLaserWarnOffsets(int x, int y)
Definition: hudreticle.cpp:657
void init2SecondaryOffsets(int x, int y)
Definition: hudreticle.cpp:791
hud_frames weapon_linking_modes[NUM_WEAPON_LINK_MODES]
Definition: hudreticle.h:143
void initOrbitRadius(int radius)
Definition: hudreticle.cpp:391
#define NUM_WEAPON_LINK_MODES
Definition: hudreticle.h:23
Definition: hud.h:32
void hud_draw_throttle_gauge()
int Zero_speed_offsets[2]
Definition: hudreticle.h:67
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
unsigned char ubyte
Definition: pstypes.h:62
void init2PrimaryOffsets(int x, int y)
Definition: hudreticle.cpp:779
int Target_speed_offsets[2]
Definition: hudreticle.h:74
void render(float frametime)
Definition: hudreticle.cpp:248
int firepoint_scale_x
Definition: hudreticle.h:43
void initLockWarnOffsets(int x, int y)
Definition: hudreticle.cpp:663
void initMatchSpeedOffsets(int x, int y, bool custom)
Definition: hudreticle.cpp:416
void init3SecondaryOffsets(int x, int y)
Definition: hudreticle.cpp:797
void init1SecondaryOffsets(int x, int y)
Definition: hudreticle.cpp:785
GLubyte GLubyte GLubyte GLubyte w
Definition: Glext.h:5679
int Match_speed_offsets[2]
Definition: hudreticle.h:81
Definition: pstypes.h:106
ubyte Match_speed_icon
Definition: hudreticle.h:83
bool Show_background
Definition: hudreticle.h:85
void initZeroSpeedOffsets(int x, int y, bool show)
Definition: hudreticle.cpp:377
void initBitmaps(char *fname)
Definition: hudreticle.cpp:233
void getFirepointStatus()
Definition: hudreticle.cpp:278
int Weapon_link_offsets[NUM_WEAPON_LINK_MODES][2]
Definition: hudreticle.h:144
void hud_draw_target_throttle_gauge()
void initBitmaps(char *fname_arc, char *fname_laser, char *fname_lock)
Definition: hudreticle.cpp:669
void renderThrottleForeground(int y_end)
Definition: hudreticle.cpp:626
void initOrbitCenterOffsets(int x, int y, bool orbiting)
Definition: hudreticle.cpp:384
void hud_draw_center_reticle()
void initBitmaps(char *fname)
Definition: hudreticle.cpp:433
bool firepoint_display
Definition: hudreticle.h:39
void showBackground(bool show)
Definition: hudreticle.cpp:404
void render(float frametime)
Definition: hudreticle.cpp:705
void initMaxSpeedOffsets(int x, int y, bool show)
Definition: hudreticle.cpp:370
void hud_update_reticle(player *pp)
Definition: hudreticle.cpp:960
GLint y
Definition: Gl.h:1505
void initThrottleStartY(int y)
Definition: hudreticle.cpp:354
void hud_init_reticle()
Definition: hudreticle.cpp:949
void initTargetSpeedOffsets(int x, int y, bool show, bool percent)
Definition: hudreticle.cpp:396
int Glide_offsets[2]
Definition: hudreticle.h:78
int Outer_circle_radius[GR_NUM_RESOLUTIONS]
Definition: hudreticle.cpp:59