FS2_Open
Open source remastering of the Freespace 2 engine
radardradis.cpp
Go to the documentation of this file.
1 /*
2  * Created by Olivier "LuaPineapple" Hamel for the Freespace 2 Source Code Project.
3  * You may not sell or otherwise commercially exploit the source or things you
4  * create based on the source.
5  *
6  */
7 
8 #include "bmpman/bmpman.h"
9 #include "freespace2/freespace.h"
10 #include "gamesnd/gamesnd.h"
11 #include "globalincs/linklist.h"
12 #include "globalincs/systemvars.h"
13 #include "graphics/font.h"
14 #include "hud/hudwingmanstatus.h"
15 #include "iff_defs/iff_defs.h"
16 #include "io/timer.h"
17 #include "jumpnode/jumpnode.h"
18 #include "localization/localize.h"
19 #include "math/staticrand.h"
20 #include "network/multi.h"
21 #include "object/object.h"
22 #include "playerman/player.h"
23 #include "radar/radardradis.h"
24 #include "radar/radarorb.h"
25 #include "render/3d.h"
26 #include "ship/awacs.h"
27 #include "ship/ship.h"
28 #include "ship/subsysdamage.h"
29 #include "weapon/emp.h"
30 #include "weapon/weapon.h"
31 
32 #define RADIANS_PER_DEGREE (PI / 180.0f)
33 
35 HudGaugeRadar(HUD_OBJECT_RADAR_BSG, 255, 255, 255),
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.20f), sub_y_clip(false)
37 {
38  vm_vec_copy_scale(&sweep_normal_x, &vmd_zero_vector, 1.0f);
39  vm_vec_copy_scale(&sweep_normal_y, &vmd_zero_vector, 1.0f);
40  vm_vec_copy_scale(&sweep_normal_z, &vmd_zero_vector, 1.0f);
41 
42  // init the view perturb matrix
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;
52 
53  // init the orb eye position
54  Orb_eye_position.a1d[0] = 0.0f;
55  Orb_eye_position.a1d[1] = 0.0f;
56  Orb_eye_position.a1d[2] = -2.5f;
57 
58  fx_guides0_0.a1d[0] = -1.0f;
59  fx_guides0_0.a1d[1] = 0.0f;
60  fx_guides0_0.a1d[2] = 0.0f;
61 
62  fx_guides0_1.a1d[0] = 1.0f;
63  fx_guides0_1.a1d[1] = 0.0f;
64  fx_guides0_1.a1d[2] = 0.0f;
65 
66  fx_guides1_0.a1d[0] = 0.0f;
67  fx_guides1_0.a1d[1] = -1.0f;
68  fx_guides1_0.a1d[2] = 0.0f;
69 
70  fx_guides1_1.a1d[0] = 0.0f;
71  fx_guides1_1.a1d[1] = 1.0f;
72  fx_guides1_1.a1d[2] = 0.0f;
73 
74  fx_guides2_0.a1d[0] = 0.0f;
75  fx_guides2_0.a1d[1] = 0.0f;
76  fx_guides2_0.a1d[2] = -1.0f;
77 
78  fx_guides2_1.a1d[0] = 0.0f;
79  fx_guides2_1.a1d[1] = 0.0f;
80  fx_guides2_1.a1d[2] = 1.0f;
81 
82  this->loop_sound_handle = -1;
83 }
84 
85 void HudGaugeRadarDradis::initBitmaps(char* fname_xy, char* fname_xz_yz, char* fname_sweep, char* fname_target_brackets, char* fname_unknown)
86 {
87  xy_plane = bm_load(fname_xy); // Base
88  if ( xy_plane < 0 ) {
89  Warning(LOCATION,"Cannot load hud bitmap: %s\n", fname_xy);
90  }
91 
92  xz_yz_plane = bm_load(fname_xz_yz); // Two vertical cross rings
93  if ( xz_yz_plane < 0 ) {
94  Warning(LOCATION,"Cannot load hud bitmap: %s\n", fname_xz_yz);
95  }
96 
97  sweep_plane = bm_load(fname_sweep); // Sweep lines
98  if ( sweep_plane < 0 ) {
99  Warning(LOCATION,"Cannot load hud bitmap: %s\n", fname_sweep);
100  }
101 
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);
105  }
106 
107  unknown_contact_icon = bm_load(fname_unknown);
108  if ( unknown_contact_icon < 0 ) {
109  Warning(LOCATION,"Cannot load hud bitmap: %s\n", fname_unknown);
110  }
111 }
112 
114 {
115  *pos = b->position;
116  vm_vec_normalize(pos);
117 
118  if (ship_is_tagged(b->objp)) {
119  *alpha = 1.0f;
120  return;
121  }
122 
123  float fade_multi = 1.5f;
124 
125  if (b->objp->type == OBJ_SHIP) {
126  if (Ships[b->objp->instance].flags2 & SF2_STEALTH) {
127  fade_multi *= 2.0f;
128  }
129  }
130 
131  *alpha = 1.0f - (sweep_percent /(PI*2))*fade_multi/2.0f;
132 
133  if (*alpha < 0.0f) {
134  *alpha = 0.0f;
135  }
136 }
137 
138 void HudGaugeRadarDradis::drawContact(vec3d *pnt, int idx, int clr_idx, float dist, float alpha, float scale_factor)
139 {
140  vec3d p;
141  int h, w;
142  vertex vert;
143  float aspect_mp;
144 
145  if ((sub_y_clip && (pnt->xyz.y > 0)) || ((!sub_y_clip) && (pnt->xyz.y <= 0)))
146  return;
147 
148  memset(&vert, 0, sizeof(vert));
149 
151  g3_transfer_vertex(&vert, &p);
152 
153  float sizef = fl_sqrt(vm_vec_dist(&Orb_eye_position, pnt) * 8.0f) * scale_factor;
154 
155  if ( clr_idx >= 0 ) {
156  bm_get_info(clr_idx, &w, &h);
157 
158  if (h == w) {
159  aspect_mp = 1.0f;
160  } else {
161  aspect_mp = (((float) h) / ((float) w));
162  }
163 
165  g3_draw_polygon(&p, &vmd_identity_matrix, sizef/35.0f, aspect_mp*sizef/35.0f, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT);
166  }
167 
168  if ( idx >= 0 ) {
169  bm_get_info(idx, &w, &h);
170 
171  if (h == w) {
172  aspect_mp = 1.0f;
173  } else {
174  aspect_mp = (((float) h) / ((float) w));
175  }
176 
179  }
180 }
181 
182 // radar is damaged, so make blips dance around
184 {
185  float temp_scale;
186  float dist = vm_vec_normalize(pos);
187  vec3d out;
188  float distortion_angle=20;
189 
190  // maybe alter the effect if EMP is active
191  if (emp_active_local())
192  {
193  temp_scale = emp_current_intensity();
194  dist *= frand_range(MAX(0.75f, 0.75f*temp_scale), MIN(1.25f, 1.25f*temp_scale));
195  distortion_angle *= frand_range(-3.0f,3.0f)*frand_range(0.0f, temp_scale);
196 
197  if (dist > 1.0f) dist = 1.0f;
198  if (dist < 0.1f) dist = 0.1f;
199  }
200 
201  vm_vec_random_cone(&out, pos, distortion_angle);
202  vm_vec_scale(&out, dist);
203 
204  drawContact(&out, -1, unknown_contact_icon, b->dist, alpha, 1.0f);
205 }
206 
207 // blip is for a target immune to sensors, so cause to flicker in/out with mild distortion
209 {
210  int flicker_index;
211 
212  float dist=vm_vec_normalize(pos);
213  vec3d out;
214  float distortion_angle=10;
215 
216  if ((b-Blips) & 1)
217  flicker_index=0;
218  else
219  flicker_index=1;
220 
221 
222  if (timestamp_elapsed(Radar_flicker_timer[flicker_index])) {
223  Radar_flicker_timer[flicker_index] = timestamp_rand(50,1000);
224  Radar_flicker_on[flicker_index] ^= 1;
225  }
226 
227  if (!Radar_flicker_on[flicker_index])
228  return;
229 
230  if (rand() & 1)
231  {
232  distortion_angle *= frand_range(0.1f,2.0f);
233  dist *= frand_range(0.75f, 1.25f);
234 
235  if (dist > 1.0f) dist = 1.0f;
236  if (dist < 0.1f) dist = 0.1f;
237  }
238 
239  vm_vec_random_cone(&out,pos,distortion_angle);
240  vm_vec_scale(&out,dist);
241 
242  drawContact(&out, -1, unknown_contact_icon, b->dist, alpha, 1.0f);
243 }
244 
245 // Draw all the active radar blips
246 void HudGaugeRadarDradis::drawBlips(int blip_type, int bright, int distort)
247 {
248  blip *b = NULL;
249  blip *blip_head;
250  vec3d pos;
251  float alpha;
252 
253  Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));
254 
255  //long frametime = timer_get_approx_seconds();
256  // Need to set font.
258 
259  if(bright) {
260  blip_head = &Blip_bright_list[blip_type];
261  } else {
262  blip_head = &Blip_dim_list[blip_type];
263  }
264 
265  float scale_factor = 1.0f;
266 
267  // draw all blips of this type
268  for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
269  {
270  plotBlip(b, &pos, &alpha);
271 
273 
274  scale_factor = 1.0f;
275 
276  // maybe draw cool blip to indicate current target
277  if (b->flags & BLIP_CURRENT_TARGET)
278  {
280  scale_factor *= 1.3f + (sinf(10 * f2fl(Missiontime)) * 0.3f);
281  }
283  if (Missiontime & 8192)
284  continue;
285  }
287  scale_factor *= 1.3f;
288  }
289 
290  alpha = 1.0;
292  drawContact(&pos, -1, target_brackets, b->dist, alpha, scale_factor);
293  }
294  else {
296  }
297 
298  // maybe distort blip
299  if (distort) {
300  blipDrawDistorted(b, &pos, alpha);
301  } else {
302  if (b->flags & BLIP_DRAW_DISTORTED) {
303  blipDrawFlicker(b, &pos, alpha);
304  } else if (b->radar_image_2d >= 0 || b->radar_color_image_2d >= 0) {
305  drawContact(&pos, b->radar_image_2d, b->radar_color_image_2d, b->dist, alpha, scale_factor);
306  } else {
307  drawContact(&pos, -1, unknown_contact_icon, b->dist, alpha, scale_factor);
308  }
309  }
310  }
311 }
312 
314 {
316  gr_set_proj_matrix(.625f * PI_2, i2fl(Radar_radius[0])/i2fl(Radar_radius[1]), 0.001f, 5.0f);
317  gr_set_view_matrix(&Orb_eye_position, &vmd_identity_matrix);
318 
320 }
321 
323 {
326 
327  //hud_save_restore_camera_data(0);
328 
330 }
331 
333 {
334  matrix base_tilt = vmd_identity_matrix;
335  vec3d base_tilt_norm;
336 
337  if ((xy_plane == -1) || (xz_yz_plane == -1))
338  return;
339 
340  g3_start_instance_matrix(&vmd_zero_vector, /*&Player_obj->orient*/&vmd_identity_matrix, true);
341 
342  // Tilt the base disc component of DRADIS-style radar 30 degrees down
343  vm_angle_2_matrix(&base_tilt, PI/6, 0);
344  vm_vec_rotate(&base_tilt_norm, &vmd_y_vector, &base_tilt);
345 
348 
350 
353  g3_done_instance(true);
354 }
355 
357 {
358  if (sweep_plane == -1)
359  return;
360 
361  sweep_percent = (fmod(((float)game_get_overall_frametime() / (float)65536), sweep_duration) / sweep_duration) * PI * 2; // convert to radians from 0 <-> 1
362  float sweep_perc_z = sweep_percent * -0.5f;
363 
364  vec3d sweep_a;
365  vec3d sweep_b;
366  vec3d sweep_c;
367 
368  vm_rot_point_around_line(&sweep_a, &vmd_y_vector, sweep_percent, &vmd_zero_vector, &vmd_z_vector); // Sweep line: XZ
369  vm_rot_point_around_line(&sweep_b, &vmd_y_vector, sweep_percent, &vmd_zero_vector, &vmd_x_vector); // Sweep line: YZ
370  vm_rot_point_around_line(&sweep_c, &vmd_x_vector, sweep_perc_z, &vmd_zero_vector, &vmd_y_vector); // Sweep line: XY
371 
372  vm_vec_copy_scale(&sweep_normal_x, &sweep_a, 1.0f);
373  vm_vec_copy_scale(&sweep_normal_y, &sweep_b, 1.0f);
374 
375  g3_start_instance_matrix(&vmd_zero_vector, /*&Player_obj->orient*/&vmd_identity_matrix, true);
377 
381 
382  float rotation = sweep_percent;
383 
384  vm_rot_point_around_line(&sweep_a, &vmd_y_vector, rotation, &vmd_zero_vector, &vmd_z_vector); // Sweep line: XZ
385  vm_rot_point_around_line(&sweep_b, &vmd_y_vector, rotation, &vmd_zero_vector, &vmd_x_vector); // Sweep line: YZ
386  vm_rot_point_around_line(&sweep_c, &vmd_x_vector,sweep_perc_z, &vmd_zero_vector, &vmd_y_vector); // Sweep line: YZ
387 
389 
393 
394  /*int dist = 90;
395 
396  for(int i = 1; i < dist; i++)
397  {
398  float rotation = sweep_percent - (i * RADIANS_PER_DEGREE);
399  float alpha = (1.0f - (float)((float)i / (float)dist)) * 0.25f;
400 
401  //if (i < 2)
402  //alpha = 1.0f;
403 
404  gr_set_bitmap(sweep_plane, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, alpha);
405 
406  vm_rot_point_around_line(&sweep_a, &vmd_y_vector, rotation, &vmd_zero_vector, &vmd_z_vector); // Sweep line: XZ
407  vm_rot_point_around_line(&sweep_b, &vmd_y_vector, rotation, &vmd_zero_vector, &vmd_x_vector); // Sweep line: YZ
408 
409  g3_draw_polygon(&vmd_zero_vector, &sweep_a, scale, scale, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT); // Sweep line: XZ
410  g3_draw_polygon(&vmd_zero_vector, &sweep_b, scale, scale, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT); // Sweep line: YZ
411 
412  if (i < (dist * 0.5f))
413  {
414  vm_rot_point_around_line(&sweep_c, &vmd_x_vector,sweep_perc_z + (i * RADIANS_PER_DEGREE), &vmd_zero_vector, &vmd_y_vector); // Sweep line: YZ
415  g3_draw_polygon(&vmd_zero_vector, &sweep_c, scale, scale, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT);
416  }
417  }*/
418 
419  g3_done_instance(true);
420 }
421 
423 {
424  matrix base_tilt = vmd_identity_matrix;
425 
426  vm_angle_2_matrix(&base_tilt, -PI/6, 0);
427 
428  for(int is_bright = 0; is_bright < 2; is_bright++) {
429  sub_y_clip = true;
430  g3_start_instance_matrix(&vmd_zero_vector, /*&Player_obj->orient*/&base_tilt, true);
431  drawBlips(BLIP_TYPE_BOMB, is_bright, distort);
432  drawBlips(BLIP_TYPE_JUMP_NODE, is_bright, distort);
433  drawBlips(BLIP_TYPE_NORMAL_SHIP, is_bright, distort);
434  drawBlips(BLIP_TYPE_TAGGED_SHIP, is_bright, distort);
435  drawBlips(BLIP_TYPE_WARPING_SHIP, is_bright, distort);
436  drawBlips(BLIP_TYPE_NAVBUOY_CARGO, is_bright, distort);
437  g3_done_instance(true);
438 
439  drawOutlinesHtl();
440 
441  sub_y_clip = false;
442  g3_start_instance_matrix(&vmd_zero_vector, /*&Player_obj->orient*/&base_tilt, true);
443  drawBlips(BLIP_TYPE_BOMB, is_bright, distort);
444  drawBlips(BLIP_TYPE_JUMP_NODE, is_bright, distort);
445  drawBlips(BLIP_TYPE_NORMAL_SHIP, is_bright, distort);
446  drawBlips(BLIP_TYPE_TAGGED_SHIP, is_bright, distort);
447  drawBlips(BLIP_TYPE_WARPING_SHIP, is_bright, distort);
448  drawBlips(BLIP_TYPE_NAVBUOY_CARGO, is_bright, distort);
449  g3_done_instance(true);
450  }
451 }
452 
453 
454 void HudGaugeRadarDradis::render(float frametime)
455 {
456  float sensors_str;
457  int ok_to_blit_radar;
458 
459  ok_to_blit_radar = 1;
460 
462 
464  sensors_str = MIN_SENSOR_STR_TO_RADAR - 1;
465 
466  // note that on lowest skill level, there is no radar effects due to sensors damage
467  if ((Game_skill_level == 0) || (sensors_str > SENSOR_STR_RADAR_NO_EFFECTS))
468  {
470  Radar_static_next = 0;
471  Radar_death_timer = 0;
473  }
474  else
475  if (sensors_str < MIN_SENSOR_STR_TO_RADAR)
476  {
478  {
480  Radar_static_next = 1;
481  }
482 
484  }
485  else
486  {
487  Radar_death_timer = 0;
488 
489  if (Radar_static_next == 0)
490  Radar_static_next = 1;
491  }
492 
494  ok_to_blit_radar = 0;
495 
496  setupViewHtl();
497 
498  //WMC - This strikes me as a bit hackish
499  bool g3_yourself = !g3_in_frame();
500  if(g3_yourself)
501  g3_start_frame(1);
502 
503  drawSweeps();
504 
506  {
509  }
510 
511  // if the emp effect is active, always draw the radar wackily
512  if (emp_active_local())
514 
515  if (ok_to_blit_radar)
516  {
518  {
519  drawBlipsSorted(1); // passing 1 means to draw distorted
520 
521  if (Radar_static_looping == -1)
523  }
524  else
525  {
526  drawBlipsSorted(0);
527 
528  if (Radar_static_looping != -1)
529  {
532  }
533  }
534  }
535  else
536  {
537  if (Radar_static_looping != -1)
538  {
541  }
542  }
543 
544  if(g3_yourself)
545  g3_end_frame();
546 
547  doneDrawingHtl();
548 }
549 
551 {
552  bm_page_in_texture(xy_plane);
553  bm_page_in_texture(xz_yz_plane);
554  bm_page_in_texture(sweep_plane);
555  bm_page_in_texture(target_brackets);
556  bm_page_in_texture(unknown_contact_icon);
557 }
558 
560 {
561  if (this->m_loop_snd < 0)
562  {
563  return;
564  }
565 
566  if (!this->shouldDoSounds())
567  {
568  if (loop_sound_handle >= 0 && snd_is_playing(loop_sound_handle))
569  {
570  snd_stop(loop_sound_handle);
571  loop_sound_handle = -1;
572  }
573  }
574  else if (this->loop_sound_handle < 0 || !snd_is_playing(this->loop_sound_handle))
575  {
576  loop_sound_handle = snd_play(&Snds[m_loop_snd], 0.0f, loop_sound_volume);
577  }
578 }
579 
581 {
582  if (!this->shouldDoSounds())
583  {
584  return;
585  }
586 
587  if (Missiontime == 0 || Missiontime == Frametime)
588  {
589  // don't play sounds in first frame
590  return;
591  }
592 
593  if (arrival_beep_snd < 0 &&
594  departure_beep_snd < 0 &&
595  m_stealth_arrival_snd < 0 &&
596  stealth_departure_snd < 0)
597  {
598  return;
599  }
600 
601  bool departure_happened = false;
602  bool stealth_departure_happened = false;
603 
604  bool arrival_happened = false;
605  bool stealth_arrival_happened = false;
606 
607  for (int i = 0; i < MAX_SHIPS; i++)
608  {
609  ship * shipp = &Ships[i];
610 
611  if (shipp->objnum >= 0)
612  {
613  if (shipp->radar_visible_since >= 0 || shipp->radar_last_contact >= 0)
614  {
615  if (shipp->radar_visible_since == Missiontime)
616  {
617  if (shipp->radar_current_status == DISTORTED)
618  {
619  stealth_arrival_happened = true;
620  }
621  else
622  {
623  arrival_happened = true;
624  }
625  }
626  else if (shipp->radar_visible_since < 0 && shipp->radar_last_contact == Missiontime)
627  {
628  if (shipp->radar_last_status == DISTORTED)
629  {
630  stealth_departure_happened = true;
631  }
632  else
633  {
634  departure_happened = true;
635  }
636  }
637  }
638  }
639  }
640 
641  if (timestamp_elapsed(arrival_beep_next_check))
642  {
643  if (arrival_beep_snd >= 0 && arrival_happened)
644  {
645  snd_play(&Snds[arrival_beep_snd]);
646 
647  arrival_beep_next_check = timestamp(arrival_beep_delay);
648  }
649  else if (m_stealth_arrival_snd >= 0 && stealth_arrival_happened)
650  {
651  snd_play(&Snds[m_stealth_arrival_snd]);
652 
653  arrival_beep_next_check = timestamp(arrival_beep_delay);
654  }
655 
656  }
657 
658  if (timestamp_elapsed(departure_beep_next_check))
659  {
660  if (departure_beep_snd >= 0 && departure_happened)
661  {
662  snd_play(&Snds[departure_beep_snd]);
663 
664  departure_beep_next_check = timestamp(departure_beep_delay);
665  }
666  else if (stealth_departure_snd >= 0 && stealth_departure_happened)
667  {
668  snd_play(&Snds[stealth_departure_snd]);
669 
670  departure_beep_next_check = timestamp(departure_beep_delay);
671  }
672  }
673 }
674 
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)
676 {
677  this->m_loop_snd = loop_snd;
678  this->loop_sound_handle = -1;
679  this->loop_sound_volume = _loop_snd_volume;
680 
681  this->arrival_beep_snd = arrival_snd;
682  this->departure_beep_snd = departure_snd;
683 
684  this->m_stealth_arrival_snd = stealth_arrival_snd;
685  this->stealth_departure_snd = stealth_departue_snd;
686 
687  this->arrival_beep_delay = fl2i(arrival_delay * 1000.0f);
688  this->departure_beep_delay = fl2i(departure_delay * 1000.0f);
689 }
690 
691 void HudGaugeRadarDradis::onFrame(float frametime)
692 {
693  // Play the specified radar sound
694  this->doLoopSnd();
695 
696  // Play beeps for ship arrival and departure
697  this->doBeeps();
698 }
699 
701 {
703 
704  this->arrival_beep_next_check = timestamp();
705  this->departure_beep_next_check = timestamp();
706 }
707 
709 {
710  if (hud_disabled())
711  return false;
712 
714  return false;
715 
716  return true;
717 }
#define gr_zbuffer_set
Definition: 2d.h:817
int timestamp(int delta_ms)
Definition: timer.cpp:226
fix Frametime
Definition: systemvars.cpp:21
int i
Definition: multi_pxo.cpp:466
fix Missiontime
Definition: systemvars.cpp:19
void plotBlip(blip *b, vec3d *pos, float *alpha)
void render(float frametime)
#define MIN(a, b)
Definition: pstypes.h:296
#define BLIP_TYPE_JUMP_NODE
Definition: radarsetup.h:62
vec3d vmd_z_vector
Definition: vecmat.cpp:27
int objnum
Definition: ship.h:537
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
Visible but not fully.
Definition: radarsetup.h:91
float frand_range(float min, float max)
Return a floating point number in the range min..max.
Definition: floating.cpp:50
SCP_vector< game_snd > Snds
Definition: gamesnd.cpp:19
blip Blips[MAX_BLIPS]
Definition: radarsetup.cpp:76
#define gr_end_view_matrix
Definition: 2d.h:896
float a2d[3][3]
Definition: pstypes.h:119
RadarVisibility radar_current_status
Definition: ship.h:810
blip Blip_bright_list[MAX_BLIP_TYPES]
Definition: radarsetup.cpp:73
#define MAX_SHIPS
Definition: globals.h:37
ubyte g3_transfer_vertex(vertex *dest, const vec3d *src)
Definition: 3dmath.cpp:84
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
Assert(pm!=NULL)
int rad
Definition: radarsetup.h:35
#define SENSOR_STR_RADAR_NO_EFFECTS
Definition: subsysdamage.h:40
Definition: pstypes.h:88
#define VM_EXTERNAL
Definition: systemvars.h:31
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
Definition: bmpman.cpp:769
#define GR_ZBUFF_FULL
Definition: 2d.h:675
int g3_draw_polygon(const vec3d *pos, const matrix *ori, float width, float height, int tmap_flags=TMAP_FLAG_TEXTURED)
Definition: 3ddraw.cpp:310
struct vec3d::@225::@227 xyz
#define TMAP_HTL_3D_UNLIT
Definition: tmapper.h:63
GLclampf f
Definition: Glext.h:7097
#define HUD_OBJECT_RADAR_BSG
Definition: hudparse.h:148
#define GR_ZBUFF_NONE
Definition: 2d.h:672
int snd_is_playing(int sig)
Definition: sound.cpp:1047
vec3d * vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m)
Definition: vecmat.cpp:933
int Radar_radius[2]
Definition: radarsetup.h:105
#define f2fl(fx)
Definition: floating.h:37
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)
int Radar_death_timer
Definition: radarsetup.h:116
void vm_vec_random_cone(vec3d *out, const vec3d *in, float max_angle, const matrix *orient)
Definition: vecmat.cpp:2418
int ship_is_tagged(object *objp)
Definition: ship.cpp:17263
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
int Radar_static_looping
Definition: radarsetup.cpp:34
GLenum GLenum GLenum GLenum GLenum scale
Definition: Glext.h:8503
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
Definition: 2d.cpp:2105
ship * shipp
Definition: lua.cpp:9162
#define TMAP_FLAG_BW_TEXTURE
Definition: tmapper.h:73
color * blip_color
Definition: radarsetup.h:37
#define gr_end_proj_matrix
Definition: 2d.h:894
void setClip(int x, int y, int w, int h)
Definition: hud.cpp:942
void g3_done_instance(bool set_api=false)
Definition: 3dsetup.cpp:341
#define gr_set_view_matrix
Definition: 2d.h:895
#define MIN_SENSOR_STR_TO_RADAR
Definition: subsysdamage.h:41
int instance
Definition: object.h:150
hud gauge static
Definition: gamesnd.h:116
float ship_get_subsystem_strength(ship *shipp, int type)
Definition: ship.cpp:13446
float a1d[3]
Definition: pstypes.h:93
#define GR_ALPHABLEND_FILTER
Definition: 2d.h:349
#define VM_DEAD_VIEW
Definition: systemvars.h:33
#define gr_set_proj_matrix
Definition: 2d.h:893
#define BLIP_DRAW_DISTORTED
Definition: radarsetup.h:80
int radar_image_2d
Definition: radarsetup.h:39
#define BLIP_TYPE_NORMAL_SHIP
Definition: radarsetup.h:67
void vm_vec_scale(vec3d *dest, float s)
Definition: vecmat.cpp:248
matrix * vm_angle_2_matrix(matrix *m, float a, int angle_index)
Definition: vecmat.cpp:768
int Radar_blip_radius_target
Definition: radarsetup.h:111
vec3d position
Definition: radarsetup.h:38
int ship_subsys_disrupted(ship_subsys *ss)
Definition: ship.cpp:9033
#define MAX_BLIP_TYPES
Definition: radarsetup.h:69
virtual void initialize()
Definition: radarsetup.cpp:430
#define w(p)
Definition: modelsinc.h:68
float emp_current_intensity()
Definition: emp.cpp:634
void vm_rot_point_around_line(vec3d *out, const vec3d *in, float angle, const vec3d *line_point, const vec3d *line_dir)
Definition: vecmat.cpp:1395
fix radar_last_contact
Definition: ship.h:807
int snd_play(game_snd *gs, float pan, float vol_scale, int priority, bool is_voice_msg)
Definition: sound.cpp:517
void initBitmaps(char *fname_xy, char *fname_xz_yz, char *fname_sweep, char *fname_target_brackets, char *fname_unknown)
Definition: radardradis.cpp:85
fix game_get_overall_frametime()
Definition: fredstubs.cpp:230
float vm_vec_dist(const vec3d *v0, const vec3d *v1)
Definition: vecmat.cpp:355
int Radar_flicker_timer[NUM_FLICKER_TIMERS]
Definition: radarsetup.h:118
Definition: ship.h:534
int idx
Definition: multiui.cpp:761
object * objp
Definition: radarsetup.h:45
vec3d vmd_y_vector
Definition: vecmat.cpp:26
#define RTIF_PULSATE
Definition: hud.h:85
void blipDrawDistorted(blip *b, vec3d *pos, float alpha)
vec3d vmd_x_vector
Definition: vecmat.cpp:25
int Radar_blip_radius_normal
Definition: radarsetup.h:110
int radar_target_id_flags
Definition: radarsetup.cpp:69
int hud_disabled()
Checks if HUD disabled.
Definition: hud.cpp:1306
ship * Player_ship
Definition: ship.cpp:124
RadarVisibility radar_last_status
Definition: ship.h:809
void vm_vec_copy_scale(vec3d *dest, const vec3d *src, float s)
Definition: vecmat.cpp:257
#define OBJ_SHIP
Definition: object.h:32
float dist
Definition: radarsetup.h:44
#define BLIP_TYPE_WARPING_SHIP
Definition: radarsetup.h:65
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.
Definition: bmpman.cpp:1119
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
ship Ships[MAX_SHIPS]
Definition: ship.cpp:122
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
#define BLIP_TYPE_NAVBUOY_CARGO
Definition: radarsetup.h:63
#define BLIP_TYPE_BOMB
Definition: radarsetup.h:64
#define FONT1
Definition: font.h:65
#define RTIF_BLINK
Definition: hud.h:84
#define RTIF_ENLARGE
Definition: hud.h:86
int position[2]
Definition: hud.h:204
int g3_in_frame()
Definition: 3dsetup.cpp:66
#define SUBSYSTEM_SENSORS
Definition: model.h:59
#define fl2i(fl)
Definition: floating.h:33
void bm_page_in_texture(int bitmapnum, int nframes)
Marks a texture as being used for this level.
Definition: bmpman.cpp:2462
#define g3_end_frame()
Definition: 3d.h:49
void drawBlipsSorted(int distort)
blip Blip_dim_list[MAX_BLIP_TYPES]
Definition: radarsetup.cpp:74
int snd_play_looping(game_snd *gs, float pan, int start_loop, int stop_loop, float vol_scale, int scriptingUpdateVolume)
Definition: sound.cpp:822
#define fl_sqrt(fl)
Definition: floating.h:29
GLfloat GLfloat p
Definition: Glext.h:8373
#define LOCATION
Definition: pstypes.h:245
void g3_start_instance_matrix(const vec3d *pos, const matrix *orient, bool set_api=true)
Definition: 3dsetup.cpp:249
#define TMAP_FLAG_TEXTURED
Definition: tmapper.h:36
int Viewer_mode
Definition: systemvars.cpp:28
#define timestamp_elapsed(stamp)
Definition: timer.h:102
#define PI
Definition: pstypes.h:303
hull_check pos
Definition: lua.cpp:5050
int Game_skill_level
Definition: fredstubs.cpp:170
int Radar_static_next
Definition: radarsetup.h:114
#define i2fl(i)
Definition: floating.h:32
#define BLIP_TYPE_TAGGED_SHIP
Definition: radarsetup.h:66
#define timestamp_rand(a, b)
Definition: timer.h:92
#define GR_BITBLT_MODE_NORMAL
Definition: 2d.h:351
const float PI_2
Definition: pstypes.h:307
uint flags2
Definition: ship.h:645
int emp_active_local()
Definition: emp.cpp:428
int flags
Definition: radarsetup.h:36
int Radar_avail_prev_frame
Definition: radarsetup.h:115
virtual void initialize()
#define MAX(a, b)
Definition: pstypes.h:299
#define VM_OTHER_SHIP
Definition: systemvars.h:35
int Radar_flicker_on[NUM_FLICKER_TIMERS]
Definition: radarsetup.h:119
false
Definition: lua.cpp:6789
#define SF2_STEALTH
Definition: ship.h:485
void snd_stop(int sig)
Definition: sound.cpp:875
#define VM_CHASE
Definition: systemvars.h:34
virtual void onFrame(float frametime)
void gr_set_font(int fontnum)
Definition: font.cpp:566
GLclampf GLclampf GLclampf alpha
Definition: Glext.h:5177
char type
Definition: object.h:146
vec3d vmd_zero_vector
Definition: vecmat.cpp:24
int Radar_static_playing
Definition: radarsetup.h:113
matrix vmd_identity_matrix
Definition: vecmat.cpp:28
int radar_color_image_2d
Definition: radarsetup.h:40
fix radar_visible_since
Definition: ship.h:806
#define g3_start_frame(zbuffer_flag)
Definition: 3d.h:39
float vm_vec_normalize(vec3d *v)
Definition: vecmat.cpp:460
#define BLIP_CURRENT_TARGET
Definition: radarsetup.h:78