FS2_Open
Open source remastering of the Freespace 2 engine
radarorb.cpp
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 
13 #include "bmpman/bmpman.h"
14 #include "freespace2/freespace.h"
15 #include "gamesnd/gamesnd.h"
16 #include "globalincs/linklist.h"
17 #include "graphics/font.h"
18 #include "iff_defs/iff_defs.h"
19 #include "io/timer.h"
20 #include "jumpnode/jumpnode.h"
21 #include "localization/localize.h"
22 #include "network/multi.h"
23 #include "object/object.h"
24 #include "playerman/player.h"
25 #include "radar/radarorb.h"
26 #include "render/3d.h"
27 #include "ship/awacs.h"
28 #include "ship/ship.h"
29 #include "ship/subsysdamage.h"
30 #include "weapon/emp.h"
31 #include "weapon/weapon.h"
32 
34 
35 extern int radar_target_id_flags;
36 
37 extern int Cmdline_nohtl;
38 
42 
43 //special view matrix to get the orb rotating the correct way
44 static matrix view_perturb = { { { { { { 1.0f, 0.0f, 0.0f } } },
45  { { { 0.0f, -1.0f, 0.0f } } },
46  { { { 0.0f, 0.0f, -1.0f } } } } } };
47 
48 static vec3d Orb_eye_position = { { { 0.0f, 0.0f, -3.0f } } };
49 
51 HudGaugeRadar(HUD_OBJECT_RADAR_ORB, 255, 255, 255)
52 {
53  int i;
54  float s,c;
55 
56  memset(orb_ring_xy, 0, sizeof(orb_ring_xy));
57  memset(orb_ring_xz, 0, sizeof(orb_ring_xz));
58  memset(orb_ring_yz, 0, sizeof(orb_ring_yz));
59 
60  for (i=0; i < NUM_ORB_RING_SLICES; i++)
61  {
62  s=sinf(float(i*PI2)/NUM_ORB_RING_SLICES);
63  c=cosf(float(i*PI2)/NUM_ORB_RING_SLICES);
64 
65  orb_ring_xy[i].xyz.x = c;
66  orb_ring_xy[i].xyz.y = s;
67 
68  orb_ring_yz[i].xyz.y = c;
69  orb_ring_yz[i].xyz.z = s;
70 
71  orb_ring_xz[i].xyz.x = c;
72  orb_ring_xz[i].xyz.z = s;
73  }
74 
75  gr_init_alphacolor(&Orb_color_orange, 192, 96, 32, 192);
76  gr_init_alphacolor(&Orb_color_teal, 48, 160, 96, 192);
77  gr_init_alphacolor(&Orb_color_purple, 112, 16, 192, 192);
78  gr_init_alphacolor(&Orb_crosshairs, 255, 255,255, 192);
79 }
80 
82 {
83  Radar_center_offsets[0] = x;
84  Radar_center_offsets[1] = y;
85 }
86 
88 {
89  Radar_gauge.first_frame = bm_load_animation(fname, &Radar_gauge.num_frames);
90  if ( Radar_gauge.first_frame < 0 ) {
91  Warning(LOCATION,"Cannot load hud ani: %s\n", fname);
92  }
93 }
94 
96 {
97  *scaled_pos = b->position;
98 
99  if (IS_VEC_NULL_SQ_SAFE(scaled_pos)) {
100  vm_vec_make(scaled_pos, 1.0f, 0.0f, 0.0f);
101  } else {
102  vm_vec_normalize(scaled_pos);
103  }
104 
105  float scale = b->dist / Radar_bright_range;
106  if (scale > 1.25f) scale = 1.25f;
107  if (scale < .75f) scale = .75f;
108 
109  vm_vec_scale(scaled_pos, scale);
110 }
111 
113 {
114  vertex verts[2];
115  vec3d p;
116 
117  p=*pnt;
118  vm_vec_normalize(&p);
119 
120  g3_rotate_vertex(&verts[0], &p);
121  g3_project_vertex(&verts[0]);
122 
123  g3_rotate_vertex(&verts[1], pnt);
124  g3_project_vertex(&verts[1]);
125 
126  float size = fl_sqrt(vm_vec_dist(&Orb_eye_position, pnt) * 8.0f);
127  if (size < i2fl(rad)) size = i2fl(rad);
128 
129  if (rad == Radar_blip_radius_target)
130  {
131  g3_draw_sphere(&verts[1],size/100.0f);
132  }
133  else
134  {
135  g3_draw_sphere(&verts[1],size/300.0f);
136  }
137 
138  g3_draw_line(&verts[0],&verts[1]);
139 }
140 
142 {
143  vec3d p;
144 
145  p=*pnt;
146 
147  vm_vec_normalize(&p);
148 
149  float size = fl_sqrt(vm_vec_dist(&Orb_eye_position, pnt) * 8.0f);
150  if (size < i2fl(rad)) size = i2fl(rad);
151 
152  if (rad == Radar_blip_radius_target)
153  {
155  // use mask to make the darn thing work faster
156  size *= 1.3f + (sinf(10 * f2fl(Missiontime)) * 0.3f);
157  }
159  if (Missiontime & 8192)
160  return;
161  }
162  g3_draw_htl_sphere(pnt,size/100.0f);
163  }
164  else
165  {
166  g3_draw_htl_sphere(pnt,size/300.0f);
167  }
168 
169  g3_draw_htl_line(&p,pnt);
170 }
171 
172 // radar is damaged, so make blips dance around
174 {
175  float scale;
176  float dist=vm_vec_normalize(pos);
177  vec3d out;
178  float distortion_angle=20;
179 
180  // maybe alter the effect if EMP is active
181  if(emp_active_local()){
182  scale = emp_current_intensity();
183  distortion_angle *= frand_range(-3.0f,3.0f)*frand_range(0.0f, scale);
184  dist *= frand_range(MAX(0.75f, 0.75f*scale), MIN(1.25f, 1.25f*scale));
185 
186  if (dist > 1.25f) dist = 1.25f;
187  if (dist < 0.75f) dist = 0.75f;
188  }
189 
190  vm_vec_random_cone(&out,pos,distortion_angle);
191  vm_vec_scale(&out,dist);
192 
193  if (Cmdline_nohtl)
194  {
195  drawContact(&out,b->rad);
196  }
197  else
198  {
199  drawContactHtl(&out,b->rad);
200  }
201 }
202 
203 // blip is for a target immune to sensors, so cause to flicker in/out with mild distortion
205 {
206  int flicker_index;
207 
208  float dist=vm_vec_normalize(pos);
209  vec3d out;
210  float distortion_angle=10;
211 
212  if ( (b-Blips) & 1 ) {
213  flicker_index=0;
214  } else {
215  flicker_index=1;
216  }
217 
218  if ( timestamp_elapsed(Radar_flicker_timer[flicker_index]) ) {
219  Radar_flicker_timer[flicker_index] = timestamp_rand(50,1000);
220  Radar_flicker_on[flicker_index] ^= 1;
221  }
222 
223  if ( !Radar_flicker_on[flicker_index] ) {
224  return;
225  }
226 
227  if ( rand() & 1 ) {
228 
229  distortion_angle *= frand_range(0.1f,2.0f);
230  dist *= frand_range(0.75f, 1.25f);
231 
232  if (dist > 1.25f) dist = 1.25f;
233  if (dist < 0.75f) dist = 0.75f;
234  }
235 
236  vm_vec_random_cone(&out,pos,distortion_angle);
237  vm_vec_scale(&out,dist);
238 
239  if (Cmdline_nohtl)
240  {
241  drawContact(&out,b->rad);
242  }
243  else
244  {
245  drawContactHtl(&out,b->rad);
246  }
247 }
248 
249 // Draw all the active radar blips
250 void HudGaugeRadarOrb::drawBlips(int blip_type, int bright, int distort)
251 {
252  blip *b = NULL;
253  blip *blip_head = NULL;
254  vec3d pos;
255 
256  Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));
257 
258 
259  // Need to set font.
261 
262 
263  // get the appropriate blip list
264  if (bright)
265  blip_head = &Blip_bright_list[blip_type];
266  else
267  blip_head = &Blip_dim_list[blip_type];
268 
269 
270  // draw all blips of this type
271  for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
272  {
274  plotBlip(b, &pos);
275 
276  // maybe draw cool blip to indicate current target
277  if (b->flags & BLIP_CURRENT_TARGET)
278  {
280  target_position = pos;
281  }
282  else
283  {
285  }
286 
287  // maybe distort blip
288  if (distort)
289  {
290  blipDrawDistorted(b, &pos);
291  }
292  else if (b->flags & BLIP_DRAW_DISTORTED)
293  {
294  blipDrawFlicker(b, &pos);
295  }
296  else
297  {
298  if (Cmdline_nohtl)
299  {
300  drawContact(&pos,b->rad);
301  }
302  else if (b->radar_image_2d >= 0 || b->radar_color_image_2d >= 0)
303  {
305  }
306  else
307  {
308  drawContactHtl(&pos,b->rad);
309  }
310  }
311  }
312 }
313 
315 {
316  g3_start_instance_matrix(&vmd_zero_vector, &view_perturb, false);
317 
318  vm_vec_zero(&target_position);
319  // draw dim blips first, then bright blips
320  for (int is_bright = 0; is_bright < 2; is_bright++)
321  {
322  drawBlips(BLIP_TYPE_JUMP_NODE, is_bright, distort);
323  drawBlips(BLIP_TYPE_WARPING_SHIP, is_bright, distort);
324  drawBlips(BLIP_TYPE_NAVBUOY_CARGO, is_bright, distort);
325  drawBlips(BLIP_TYPE_NORMAL_SHIP, is_bright, distort);
326  drawBlips(BLIP_TYPE_BOMB, is_bright, distort);
327  drawBlips(BLIP_TYPE_TAGGED_SHIP, is_bright, distort);
328  }
329 
331  drawCrosshairs(target_position);
332  }
333 
334  g3_done_instance(false);
335 }
336 
338 {
339  g3_done_instance(false);
340  g3_end_frame();
341  g3_start_frame(0);
343  resetClip();
344 }
345 
347 {
350  resetClip();
352 }
353 
355 {
356  int i;
357  vertex center;
358 // vertex extents[6];
359  vertex proj_orb_lines_xy[NUM_ORB_RING_SLICES];
360  vertex proj_orb_lines_xz[NUM_ORB_RING_SLICES];
361  vertex proj_orb_lines_yz[NUM_ORB_RING_SLICES];
362 
363  g3_start_instance_matrix(&vmd_zero_vector, &view_perturb, false);
365 
367  g3_rotate_vertex(&proj_orb_lines_xy[0], &orb_ring_xy[0]);
368  g3_rotate_vertex(&proj_orb_lines_yz[0], &orb_ring_yz[0]);
369  g3_rotate_vertex(&proj_orb_lines_xz[0], &orb_ring_xz[0]);
370 
371  g3_project_vertex(&center);
372  gr_set_color(255,255,255);
373  g3_draw_sphere(&center, .05f);
374 
375  g3_project_vertex(&proj_orb_lines_xy[0]);
376  g3_project_vertex(&proj_orb_lines_yz[0]);
377  g3_project_vertex(&proj_orb_lines_xz[0]);
378 
379  for (i=1; i < NUM_ORB_RING_SLICES; i++)
380  {
381  g3_rotate_vertex(&proj_orb_lines_xy[i], &orb_ring_xy[i]);
382  g3_rotate_vertex(&proj_orb_lines_yz[i], &orb_ring_yz[i]);
383  g3_rotate_vertex(&proj_orb_lines_xz[i], &orb_ring_xz[i]);
384 
385  g3_project_vertex(&proj_orb_lines_xy[i]);
386  g3_project_vertex(&proj_orb_lines_yz[i]);
387  g3_project_vertex(&proj_orb_lines_xz[i]);
388 
389  gr_set_color(192,96,32);
390  g3_draw_sphere(&proj_orb_lines_xy[i-1], .01f);
391  g3_draw_sphere(&proj_orb_lines_xz[i-1], .01f);
392  g3_draw_line(&proj_orb_lines_xy[i-1],&proj_orb_lines_xy[i]);
393  g3_draw_line(&proj_orb_lines_xz[i-1],&proj_orb_lines_xz[i]);
394 
395  gr_set_color(112,16,192);
396  g3_draw_sphere(&proj_orb_lines_yz[i-1], .01f);
397  g3_draw_line(&proj_orb_lines_yz[i-1],&proj_orb_lines_yz[i]);
398  }
399 
400  g3_done_instance(false);
401 }
402 
404 {
405  Assert(pt);
407 
408  vec3d new_pt;
409  vec3d fvec = { { { 0.0f, 0.0f, 1.0f } } };
410 
411  vm_vec_unrotate(&new_pt, pt, &Player_obj->orient);
412  vm_vec_normalize(&new_pt);
413 
414  float dot = vm_vec_dot(&fvec, &new_pt);
415  float angle = fabs(acosf(dot));
416  int alpha = int(angle*192.0f/PI);
417 
418  return alpha;
419 }
420 
422 {
423  int i, last = NUM_ORB_RING_SLICES - 1;
424 
425  g3_start_instance_matrix(&vmd_zero_vector, &view_perturb, true);
427 
428  gr_set_color(255, 255, 255);
430 
431  gr_set_line_width(2.0f);
432 
433  for (i = 0; i < NUM_ORB_RING_SLICES; i++)
434  {
435  gr_init_alphacolor(&Orb_color_orange, 192, 96, 32, calcAlpha(&orb_ring_xy[last]));
436  gr_set_color_fast(&Orb_color_orange);
437  g3_draw_htl_line(&orb_ring_xy[last],&orb_ring_xy[i]);
438 
439  gr_init_alphacolor(&Orb_color_teal, 48, 160, 96, calcAlpha(&orb_ring_xz[last]));
440  gr_set_color_fast(&Orb_color_teal);
441  g3_draw_htl_line(&orb_ring_xz[last],&orb_ring_xz[i]);
442 
443  gr_init_alphacolor(&Orb_color_purple, 112, 16, 192, calcAlpha(&orb_ring_yz[last]));
444  gr_set_color_fast(&Orb_color_purple);
445  g3_draw_htl_line(&orb_ring_yz[last],&orb_ring_yz[i]);
446 
447  last = i;
448  }
449 
450  gr_set_line_width(1.0f);
451 
452  g3_done_instance(true);
453  g3_done_instance(true);
454 }
455 
456 void HudGaugeRadarOrb::render(float frametime)
457 {
458  float sensors_str;
459  int ok_to_blit_radar;
460 
461  //WMC - This strikes me as a bit hackish
462  bool g3_yourself = !g3_in_frame();
463  if(g3_yourself)
464  g3_start_frame(1);
465 
466  ok_to_blit_radar = 1;
467 
469 
471  sensors_str = MIN_SENSOR_STR_TO_RADAR-1;
472  }
473 
474  // note that on lowest skill level, there is no radar effects due to sensors damage
475  if ( (Game_skill_level == 0) || (sensors_str > SENSOR_STR_RADAR_NO_EFFECTS) ) {
477  Radar_static_next = 0;
478  Radar_death_timer = 0;
480  } else if ( sensors_str < MIN_SENSOR_STR_TO_RADAR ) {
481  if ( Radar_avail_prev_frame ) {
483  Radar_static_next = 1;
484  }
486  } else {
487  Radar_death_timer = 0;
488  if ( Radar_static_next == 0 )
489  Radar_static_next = 1;
490  }
491 
493  ok_to_blit_radar = 0;
494  }
495 
496  setGaugeColor();
497  blitGauge();
498  drawRange();
499 
500  if (Cmdline_nohtl)
501  {
502  setupView();
503  drawOutlines();
504  }
505  else
506  {
507  setupViewHtl();
508  drawOutlinesHtl();
509  }
510 
511 
515  }
516 
517  // if the emp effect is active, always draw the radar wackily
518  if(emp_active_local()){
520  }
521 
522  if ( ok_to_blit_radar ) {
523  if ( Radar_static_playing ) {
524  drawBlipsSorted(1); // passing 1 means to draw distorted
525  if ( Radar_static_looping == -1 ) {
527  }
528  } else {
529  drawBlipsSorted(0);
530  if ( Radar_static_looping != -1 ) {
533  }
534  }
535  } else {
536  if ( Radar_static_looping != -1 ) {
539  }
540  }
541 
542  if (Cmdline_nohtl)
543  {
544  doneDrawing();
545  }
546  else
547  {
548  doneDrawingHtl();
549  }
550 
551  if(g3_yourself)
552  g3_end_frame();
553 }
554 
556 {
557  SPECMAP = -1;
558  GLOWMAP = -1;
559 
560  renderBitmap(Radar_gauge.first_frame+1, position[0], position[1] );
561 }
562 
564 {
565  bm_page_in_aabitmap( Radar_gauge.first_frame, Radar_gauge.num_frames );
566 }
567 
568 void HudGaugeRadarOrb::drawContactImage(vec3d *pnt, int rad, int idx, int clr_idx, float mult)
569 {
570  int tmap_flags = 0;
571  int h, w;
572  float aspect_mp;
573 
574  // need to get bitmap info
575  bm_get_info(idx, &w, &h);
576 
577  Assert(w > 0);
578 
579  // get multiplier
580  if (h == w) {
581  aspect_mp = 1.0f;
582  } else {
583  aspect_mp = (((float) h) / ((float) w));
584  }
585 
587 
588  float sizef = fl_sqrt(vm_vec_dist(&Orb_eye_position, pnt) * 8.0f);
589 
590  // might need checks unless the targeted blip is always wanted to be larger
591  float radius = (float) Radar_blip_radius_normal;
592 
593  if (sizef < radius)
594  sizef = radius;
595 
596  //Make so no evil things happen
597  Assert(mult > 0.0f);
598 
599  //modify size according to value from tables
600  sizef *= mult;
601 
602  // animate the targeted icon - option 1 of highlighting the targets
603  if ( rad == Radar_blip_radius_target ) {
605  // use mask to make the darn thing work faster
606  sizef *= 1.3f + (sinf(10 * f2fl(Missiontime)) * 0.3f);
607  }
609  if (Missiontime & 8192)
610  return;
611  }
613  sizef *= 1.3f;
614  }
615  }
616 
618 
619  if ( idx >= 0 ) {
620  g3_draw_polygon(pnt, &vmd_identity_matrix, sizef/35.0f, aspect_mp*sizef/35.0f, tmap_flags);
621  }
622 
623  if ( clr_idx >= 0 ) {
624  g3_draw_polygon(pnt, &vmd_identity_matrix, sizef/35.0f, aspect_mp*sizef/35.0f, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT);
625  }
626 }
627 
629 {
630  int i,j,m;
631  vec3d pnt_end, pnt_start;
632 
633  gr_set_color_fast(&Orb_crosshairs);
634 
635  for(i = 0; i < 2; i++) {
636  m = (i * 2) - 1;
637  pnt_end = pnt_start = pnt;
638  pnt_start.xyz.x += (float) m*0.05f;
639  pnt_end.xyz.x += (float) m*0.15f;
640  g3_draw_htl_line(&pnt_start, &pnt_end);
641  }
642  for(j = 0; j < 2; j++) {
643  m = (j * 2) - 1;
644  pnt_end = pnt_start = pnt;
645  pnt_start.xyz.y += (float) m*0.05f;
646  pnt_end.xyz.y += (float) m*0.15f;
647  g3_draw_htl_line(&pnt_start, &pnt_end);
648  }
649 }
650 
651 extern void hud_save_restore_camera_data(int);
652 extern float View_zoom;
653 
655 {
657 
658  g3_end_frame();
659 
660  int w,h;
661  bm_get_info(Radar_gauge.first_frame,&w, &h, NULL, NULL, NULL);
662 
663  setClip(position[0], position[1],w, h);
664  g3_start_frame(1);
665 
666  float old_zoom=View_zoom;
667  View_zoom=.75;
668 
669  g3_set_view_matrix( &Orb_eye_position, &vmd_identity_matrix, View_zoom);
670 
671  View_zoom=old_zoom;
672 }
673 
675 {
676  int w,h;
677  bm_get_info(Radar_gauge.first_frame,&w, &h, NULL, NULL, NULL);
678 
679  setClip(position[0],
680  position[1],
681  w, h);
682 
683  gr_set_proj_matrix( .625f * PI_2, float(w)/float(h), 0.001f, 5.0f);
684  gr_set_view_matrix( &Orb_eye_position, &vmd_identity_matrix );
685 
687 }
float Radar_bright_range
Definition: radarsetup.cpp:79
void blipDrawDistorted(blip *b, vec3d *pos)
Definition: radarorb.cpp:173
void drawCrosshairs(vec3d pnt)
Definition: radarorb.cpp:628
#define gr_zbuffer_set
Definition: 2d.h:817
int timestamp(int delta_ms)
Definition: timer.cpp:226
int i
Definition: multi_pxo.cpp:466
fix Missiontime
Definition: systemvars.cpp:19
#define MIN(a, b)
Definition: pstypes.h:296
#define BLIP_TYPE_JUMP_NODE
Definition: radarsetup.h:62
vec3d orb_ring_xy[NUM_ORB_RING_SLICES]
Definition: radarorb.cpp:40
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
void hud_save_restore_camera_data(int)
Called to save and restore the 3D camera settings.
Definition: hud.cpp:3656
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
blip Blip_bright_list[MAX_BLIP_TYPES]
Definition: radarsetup.cpp:73
void setGaugeColor(int bright_index=-4)
Definition: hud.cpp:445
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
void gr_init_alphacolor(color *clr, int r, int g, int b, int alpha, int type)
Definition: 2d.cpp:1173
float radar_projection_size
Definition: radarsetup.h:42
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
#define MAX_RADAR_LEVELS
Definition: radarsetup.h:52
GLclampf f
Definition: Glext.h:7097
#define GR_ZBUFF_NONE
Definition: 2d.h:672
int radar_target_id_flags
Definition: radarsetup.cpp:69
#define gr_set_line_width
Definition: 2d.h:938
#define f2fl(fx)
Definition: floating.h:37
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
#define HUD_OBJECT_RADAR_ORB
Definition: hudparse.h:145
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
int g3_draw_line(vertex *p0, vertex *p1)
Definition: 3ddraw.cpp:112
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
GLsizeiptr size
Definition: Glext.h:5496
void g3_draw_htl_sphere(const vec3d *position, float radius)
Definition: 3ddraw.cpp:1984
#define TMAP_FLAG_BW_TEXTURE
Definition: tmapper.h:73
color * blip_color
Definition: radarsetup.h:37
void setClip(int x, int y, int w, int h)
Definition: hud.cpp:942
#define gr_end_proj_matrix
Definition: 2d.h:894
int Cmdline_nohtl
Definition: cmdline.cpp:438
int bm_load_animation(const char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
Loads a bitmap sequance so we can draw with it.
Definition: bmpman.cpp:1420
#define IS_VEC_NULL_SQ_SAFE(v)
Definition: vecmat.h:24
void drawOutlines()
Definition: radarorb.cpp:354
float View_zoom
Definition: 3dsetup.cpp:30
void g3_done_instance(bool set_api=false)
Definition: 3dsetup.cpp:341
void gr_set_color(int r, int g, int b)
Definition: 2d.cpp:1188
GLfloat angle
Definition: Glext.h:10324
#define gr_set_view_matrix
Definition: 2d.h:895
#define MIN_SENSOR_STR_TO_RADAR
Definition: subsysdamage.h:41
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void initBitmaps(char *fname)
Definition: radarorb.cpp:87
hud gauge static
Definition: gamesnd.h:116
void drawContactImage(vec3d *pnt, int rad, int idx, int clr_idx, float mult)
Definition: radarorb.cpp:568
float ship_get_subsystem_strength(ship *shipp, int type)
Definition: ship.cpp:13446
const float PI2
Definition: pstypes.h:305
#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
int g3_draw_sphere(vertex *pnt, float rad)
Definition: 3ddraw.cpp:475
void blipDrawFlicker(blip *b, vec3d *pos)
Definition: radarorb.cpp:204
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
void g3_set_view_matrix(const vec3d *view_pos, const matrix *view_matrix, float zoom)
Definition: 3dsetup.cpp:152
#define MAX_BLIP_TYPES
Definition: radarsetup.h:69
int num_frames
Definition: hud.h:34
int GLOWMAP
References a map that is a fully lit version of its index -Bobboau.
Definition: bmpman.cpp:57
void doneDrawingHtl()
Definition: radarorb.cpp:346
#define NUM_ORB_RING_SLICES
Definition: radarorb.h:24
#define w(p)
Definition: modelsinc.h:68
float emp_current_intensity()
Definition: emp.cpp:634
vec3d orb_ring_xz[NUM_ORB_RING_SLICES]
Definition: radarorb.cpp:41
rcol Radar_color_rgb[MAX_RADAR_COLORS][MAX_RADAR_LEVELS]
Definition: radarsetup.cpp:36
ubyte g3_rotate_vertex(vertex *dest, const vec3d *src)
Definition: 3dmath.cpp:97
#define RTIF_CROSSHAIRS
Definition: hud.h:83
GLdouble s
Definition: Glext.h:5321
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
void drawContact(vec3d *pnt, int rad)
Definition: radarorb.cpp:112
void drawRange()
Definition: radarsetup.cpp:467
int idx
Definition: multiui.cpp:761
int g3_project_vertex(vertex *point)
Definition: 3dmath.cpp:202
void resetClip()
Definition: hud.cpp:978
#define RTIF_PULSATE
Definition: hud.h:85
vec3d * vm_vec_unrotate(vec3d *dest, const vec3d *src, const matrix *m)
Definition: vecmat.cpp:959
int Radar_blip_radius_normal
Definition: radarsetup.h:110
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
#define vm_vec_zero(v)
Definition: vecmat.h:37
ship * Player_ship
Definition: ship.cpp:124
#define vm_vec_make(v, _x, _y, _z)
Definition: vecmat.h:48
matrix orient
Definition: object.h:153
float dist
Definition: radarsetup.h:44
void drawContactHtl(vec3d *pnt, int rad)
Definition: radarorb.cpp:141
int first_frame
Definition: hud.h:33
void drawBlips(int blip_type, int bright, int distort)
Definition: radarorb.cpp:250
#define BLIP_TYPE_WARPING_SHIP
Definition: radarsetup.h:65
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
void drawBlipsSorted(int distort)
Definition: radarorb.cpp:314
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
#define BLIP_TYPE_NAVBUOY_CARGO
Definition: radarsetup.h:63
#define BLIP_TYPE_BOMB
Definition: radarsetup.h:64
void render(float frametime)
Definition: radarorb.cpp:456
#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 calcAlpha(vec3d *pt)
Definition: radarorb.cpp:403
void bm_page_in_aabitmap(int bitmapnum, int nframes)
Marks a texture as being used for this level, and is anti-aliased.
Definition: bmpman.cpp:2354
int g3_in_frame()
Definition: 3dsetup.cpp:66
#define SUBSYSTEM_SENSORS
Definition: model.h:59
#define g3_end_frame()
Definition: 3d.h:49
void doneDrawing()
Definition: radarorb.cpp:337
void initCenterOffsets(float x, float y)
Definition: radarorb.cpp:81
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
#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
const GLfloat * m
Definition: Glext.h:10319
int Radar_static_next
Definition: radarsetup.h:114
float vm_vec_dot(const vec3d *v0, const vec3d *v1)
Definition: vecmat.cpp:312
#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
object * Player_obj
Definition: object.cpp:56
int SPECMAP
References a map that is for specular mapping -Bobboau.
Definition: bmpman.cpp:58
int emp_active_local()
Definition: emp.cpp:428
int flags
Definition: radarsetup.h:36
int Radar_avail_prev_frame
Definition: radarsetup.h:115
#define MAX(a, b)
Definition: pstypes.h:299
int Radar_flicker_on[NUM_FLICKER_TIMERS]
Definition: radarsetup.h:119
#define GR_ALPHABLEND_NONE
Definition: 2d.h:348
void snd_stop(int sig)
Definition: sound.cpp:875
void plotBlip(blip *b, vec3d *scaled_pos)
Definition: radarorb.cpp:95
void gr_set_font(int fontnum)
Definition: font.cpp:566
GLclampf GLclampf GLclampf alpha
Definition: Glext.h:5177
vec3d vmd_zero_vector
Definition: vecmat.cpp:24
int Radar_static_playing
Definition: radarsetup.h:113
void drawOutlinesHtl()
Definition: radarorb.cpp:421
matrix vmd_identity_matrix
Definition: vecmat.cpp:28
int radar_color_image_2d
Definition: radarsetup.h:40
const GLubyte * c
Definition: Glext.h:8376
GLint y
Definition: Gl.h:1505
void setupViewHtl()
Definition: radarorb.cpp:674
#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
#define MAX_RADAR_COLORS
Definition: radarsetup.h:51
void renderBitmap(int x, int y)
Definition: hud.cpp:782
void g3_draw_htl_line(const vec3d *start, const vec3d *end)
Definition: 3ddraw.cpp:1975
vec3d orb_ring_yz[NUM_ORB_RING_SLICES]
Definition: radarorb.cpp:39