32 #define RADIANS_PER_DEGREE (PI / 180.0f)
36 xy_plane(-1), xz_yz_plane(-1), sweep_plane(-1), target_brackets(-1), unknown_contact_icon(-1), sweep_duration(6.0), sweep_percent(0.0),
scale(1.20
f), sub_y_clip(
false)
43 view_perturb.
a2d[0][0] = 1.0f;
44 view_perturb.
a2d[0][1] = 0.0f;
45 view_perturb.
a2d[0][2] = 0.0f;
46 view_perturb.
a2d[1][0] = 0.0f;
47 view_perturb.
a2d[1][1] = -1.0f;
48 view_perturb.
a2d[1][2] = 0.0f;
49 view_perturb.
a2d[2][0] = 0.0f;
50 view_perturb.
a2d[2][1] = 0.0f;
51 view_perturb.
a2d[2][2] = 1.0f;
54 Orb_eye_position.
a1d[0] = 0.0f;
55 Orb_eye_position.
a1d[1] = 0.0f;
56 Orb_eye_position.
a1d[2] = -2.5f;
58 fx_guides0_0.
a1d[0] = -1.0f;
59 fx_guides0_0.
a1d[1] = 0.0f;
60 fx_guides0_0.
a1d[2] = 0.0f;
62 fx_guides0_1.
a1d[0] = 1.0f;
63 fx_guides0_1.
a1d[1] = 0.0f;
64 fx_guides0_1.
a1d[2] = 0.0f;
66 fx_guides1_0.
a1d[0] = 0.0f;
67 fx_guides1_0.
a1d[1] = -1.0f;
68 fx_guides1_0.
a1d[2] = 0.0f;
70 fx_guides1_1.
a1d[0] = 0.0f;
71 fx_guides1_1.
a1d[1] = 1.0f;
72 fx_guides1_1.
a1d[2] = 0.0f;
74 fx_guides2_0.
a1d[0] = 0.0f;
75 fx_guides2_0.
a1d[1] = 0.0f;
76 fx_guides2_0.
a1d[2] = -1.0f;
78 fx_guides2_1.
a1d[0] = 0.0f;
79 fx_guides2_1.
a1d[1] = 0.0f;
80 fx_guides2_1.
a1d[2] = 1.0f;
82 this->loop_sound_handle = -1;
92 xz_yz_plane =
bm_load(fname_xz_yz);
93 if ( xz_yz_plane < 0 ) {
97 sweep_plane =
bm_load(fname_sweep);
98 if ( sweep_plane < 0 ) {
102 target_brackets =
bm_load(fname_target_brackets);
103 if ( target_brackets < 0 ) {
104 Warning(
LOCATION,
"Cannot load hud bitmap: %s\n", fname_target_brackets);
107 unknown_contact_icon =
bm_load(fname_unknown);
108 if ( unknown_contact_icon < 0 ) {
123 float fade_multi = 1.5f;
131 *alpha = 1.0f - (sweep_percent /(
PI*2))*fade_multi/2.0f;
145 if ((sub_y_clip && (pnt->
xyz.y > 0)) || ((!sub_y_clip) && (pnt->
xyz.y <= 0)))
148 memset(&vert, 0,
sizeof(vert));
155 if ( clr_idx >= 0 ) {
188 float distortion_angle=20;
197 if (dist > 1.0
f) dist = 1.0f;
198 if (dist < 0.1
f) dist = 0.1f;
214 float distortion_angle=10;
235 if (dist > 1.0
f) dist = 1.0f;
236 if (dist < 0.1
f) dist = 0.1f;
265 float scale_factor = 1.0f;
287 scale_factor *= 1.3f;
307 drawContact(&pos, -1, unknown_contact_icon, b->
dist, alpha, scale_factor);
335 vec3d base_tilt_norm;
337 if ((xy_plane == -1) || (xz_yz_plane == -1))
358 if (sweep_plane == -1)
362 float sweep_perc_z = sweep_percent * -0.5f;
382 float rotation = sweep_percent;
428 for(
int is_bright = 0; is_bright < 2; is_bright++) {
457 int ok_to_blit_radar;
459 ok_to_blit_radar = 1;
494 ok_to_blit_radar = 0;
515 if (ok_to_blit_radar)
561 if (this->m_loop_snd < 0)
571 loop_sound_handle = -1;
574 else if (this->loop_sound_handle < 0 || !
snd_is_playing(this->loop_sound_handle))
576 loop_sound_handle =
snd_play(&
Snds[m_loop_snd], 0.0
f, loop_sound_volume);
593 if (arrival_beep_snd < 0 &&
594 departure_beep_snd < 0 &&
595 m_stealth_arrival_snd < 0 &&
596 stealth_departure_snd < 0)
601 bool departure_happened =
false;
602 bool stealth_departure_happened =
false;
604 bool arrival_happened =
false;
605 bool stealth_arrival_happened =
false;
619 stealth_arrival_happened =
true;
623 arrival_happened =
true;
630 stealth_departure_happened =
true;
634 departure_happened =
true;
643 if (arrival_beep_snd >= 0 && arrival_happened)
647 arrival_beep_next_check =
timestamp(arrival_beep_delay);
649 else if (m_stealth_arrival_snd >= 0 && stealth_arrival_happened)
653 arrival_beep_next_check =
timestamp(arrival_beep_delay);
660 if (departure_beep_snd >= 0 && departure_happened)
664 departure_beep_next_check =
timestamp(departure_beep_delay);
666 else if (stealth_departure_snd >= 0 && stealth_departure_happened)
670 departure_beep_next_check =
timestamp(departure_beep_delay);
675 void HudGaugeRadarDradis::initSound(
int loop_snd,
float _loop_snd_volume,
int arrival_snd,
int departure_snd,
int stealth_arrival_snd,
int stealth_departue_snd,
float arrival_delay,
float departure_delay)
677 this->m_loop_snd = loop_snd;
678 this->loop_sound_handle = -1;
679 this->loop_sound_volume = _loop_snd_volume;
681 this->arrival_beep_snd = arrival_snd;
682 this->departure_beep_snd = departure_snd;
684 this->m_stealth_arrival_snd = stealth_arrival_snd;
685 this->stealth_departure_snd = stealth_departue_snd;
687 this->arrival_beep_delay =
fl2i(arrival_delay * 1000.0
f);
688 this->departure_beep_delay =
fl2i(departure_delay * 1000.0f);
704 this->arrival_beep_next_check =
timestamp();
705 this->departure_beep_next_check =
timestamp();
int timestamp(int delta_ms)
void plotBlip(blip *b, vec3d *pos, float *alpha)
void render(float frametime)
#define BLIP_TYPE_JUMP_NODE
GLfloat GLfloat GLfloat GLfloat h
float frand_range(float min, float max)
Return a floating point number in the range min..max.
SCP_vector< game_snd > Snds
#define gr_end_view_matrix
RadarVisibility radar_current_status
blip Blip_bright_list[MAX_BLIP_TYPES]
ubyte g3_transfer_vertex(vertex *dest, const vec3d *src)
void drawBlips(int blip_type, int bright, int distort)
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
#define SENSOR_STR_RADAR_NO_EFFECTS
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
int g3_draw_polygon(const vec3d *pos, const matrix *ori, float width, float height, int tmap_flags=TMAP_FLAG_TEXTURED)
struct vec3d::@225::@227 xyz
#define TMAP_HTL_3D_UNLIT
#define HUD_OBJECT_RADAR_BSG
int snd_is_playing(int sig)
vec3d * vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m)
#define END_OF_LIST(head)
void initSound(int loop_snd, float _loop_sound_volume, int arrival_snd, int departue_snd, int stealth_arrival_snd, int stealth_departue_snd, float arrival_delay, float departure_delay)
void vm_vec_random_cone(vec3d *out, const vec3d *in, float max_angle, const matrix *orient)
int ship_is_tagged(object *objp)
void gr_set_color_fast(color *dst)
GLenum GLenum GLenum GLenum GLenum scale
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
#define TMAP_FLAG_BW_TEXTURE
#define gr_end_proj_matrix
void setClip(int x, int y, int w, int h)
void g3_done_instance(bool set_api=false)
#define gr_set_view_matrix
#define MIN_SENSOR_STR_TO_RADAR
float ship_get_subsystem_strength(ship *shipp, int type)
#define GR_ALPHABLEND_FILTER
#define gr_set_proj_matrix
#define BLIP_DRAW_DISTORTED
#define BLIP_TYPE_NORMAL_SHIP
void vm_vec_scale(vec3d *dest, float s)
matrix * vm_angle_2_matrix(matrix *m, float a, int angle_index)
int Radar_blip_radius_target
int ship_subsys_disrupted(ship_subsys *ss)
virtual void initialize()
float emp_current_intensity()
void vm_rot_point_around_line(vec3d *out, const vec3d *in, float angle, const vec3d *line_point, const vec3d *line_dir)
int snd_play(game_snd *gs, float pan, float vol_scale, int priority, bool is_voice_msg)
void initBitmaps(char *fname_xy, char *fname_xz_yz, char *fname_sweep, char *fname_target_brackets, char *fname_unknown)
fix game_get_overall_frametime()
float vm_vec_dist(const vec3d *v0, const vec3d *v1)
int Radar_flicker_timer[NUM_FLICKER_TIMERS]
void blipDrawDistorted(blip *b, vec3d *pos, float alpha)
int Radar_blip_radius_normal
int radar_target_id_flags
int hud_disabled()
Checks if HUD disabled.
RadarVisibility radar_last_status
void vm_vec_copy_scale(vec3d *dest, const vec3d *src, float s)
#define BLIP_TYPE_WARPING_SHIP
void blipDrawFlicker(blip *b, vec3d *pos, float alpha)
void drawContact(vec3d *pnt, int idx, int clr_idx, float dist, float alpha, float scale_factor)
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
GLboolean GLboolean GLboolean b
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
#define BLIP_TYPE_NAVBUOY_CARGO
#define SUBSYSTEM_SENSORS
void bm_page_in_texture(int bitmapnum, int nframes)
Marks a texture as being used for this level.
void drawBlipsSorted(int distort)
blip Blip_dim_list[MAX_BLIP_TYPES]
int snd_play_looping(game_snd *gs, float pan, int start_loop, int stop_loop, float vol_scale, int scriptingUpdateVolume)
void g3_start_instance_matrix(const vec3d *pos, const matrix *orient, bool set_api=true)
#define TMAP_FLAG_TEXTURED
#define timestamp_elapsed(stamp)
#define BLIP_TYPE_TAGGED_SHIP
#define timestamp_rand(a, b)
#define GR_BITBLT_MODE_NORMAL
int Radar_avail_prev_frame
virtual void initialize()
int Radar_flicker_on[NUM_FLICKER_TIMERS]
virtual void onFrame(float frametime)
void gr_set_font(int fontnum)
GLclampf GLclampf GLclampf alpha
matrix vmd_identity_matrix
#define g3_start_frame(zbuffer_flag)
float vm_vec_normalize(vec3d *v)
#define BLIP_CURRENT_TARGET