File: radardradis.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (95 lines) | stat: -rw-r--r-- 2,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * Created by Olivier "LuaPineapple" Hamel for the Freespace 2 Source Code Project.
 * You may not sell or otherwise commercially exploit the source or things you
 * create based on the source.
 *
 */


#ifndef _RADAR_DRADIS_H
#define _RADAR_DRADIS_H

#include "globalincs/pstypes.h"
#include "radar/radarsetup.h"

class object;
struct blip;
struct color;

class HudGaugeRadarDradis: public HudGaugeRadar
{
	// bitmap IDs of the textures used to render DRADIS
	int xy_plane;
	int xz_yz_plane;
	int sweep_plane;
	int target_brackets;
	int unknown_contact_icon;

	int sweep_duration; // in milliseconds
	float sweep_angle;

	matrix view_perturb;
	vec3d Orb_eye_position;

	vec3d fx_guides0_0;
	vec3d fx_guides0_1;

	vec3d fx_guides1_0;
	vec3d fx_guides1_1;

	vec3d fx_guides2_0;
	vec3d fx_guides2_1;

	vec3d sweep_normal_x;
	vec3d sweep_normal_y;
	vec3d sweep_normal_z;

	float scale;

	bool sub_y_clip;

	sound_handle loop_sound_handle;
	gamesnd_id m_loop_snd;
	float loop_sound_volume;

	gamesnd_id arrival_beep_snd;
	gamesnd_id departure_beep_snd;

	gamesnd_id stealth_arrival_snd;
	gamesnd_id stealth_departure_snd;

	int arrival_beep_delay;
	int departure_beep_delay;

	TIMESTAMP arrival_beep_next_check;
	TIMESTAMP departure_beep_next_check;
protected:
	bool shouldDoSounds();
public:
	HudGaugeRadarDradis();
	void initBitmaps(char* fname_xy, char* fname_xz_yz, char* fname_sweep, char* fname_target_brackets, char* fname_unknown);
	void initSound(gamesnd_id loop_snd, float _loop_sound_volume,  gamesnd_id arrival_snd, gamesnd_id departure_snd, gamesnd_id _stealth_arrival_snd, gamesnd_id _stealth_departure_snd, float arrival_delay, float departure_delay);

	void blipDrawDistorted(blip *b, vec3d *pos, float alpha);
	void blipDrawFlicker(blip *b, vec3d *pos, float alpha);
	void drawBlips(int blip_type, int bright, int distort);
	void drawBlipsSorted(int distort);
	void drawContact(vec3d *pnt, int idx, int clr_idx, float dist, float alpha, float scale_factor);
	void drawSweeps();
	void doneDrawingHtl();
	void drawOutlinesHtl();
	void setupViewHtl();
	void render(float frametime) override;
	void pageIn() override;
	void plotBlip(blip* b, vec3d *pos, float *alpha);

	void onFrame(float frametime) override;
	void initialize() override;

	// Sound specific functions
	void doLoopSnd();
	void doBeeps();
};

#endif