File: sardraw.h

package info (click to toggle)
searchandrescue 0.8.2-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,656 kB
  • ctags: 6,111
  • sloc: ansic: 89,072; cpp: 7,691; sh: 90; makefile: 80
file content (145 lines) | stat: -rw-r--r-- 3,874 bytes parent folder | download | duplicates (6)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
	                   Scene & Object Drawing
 */

#ifndef SARDRAW_H
#define SARDRAW_H

#include "gw.h"
#include "obj.h"
#include "sar.h"

/*
 *	Drawing context:
 *
 *	This structure is passed around in the SARDraw*() functions
 *	starting from SARDraw() or SARDrawMap(), it contains values
 *	that other SARDraw*() functions can conviently obtain and
 *	modify while sharing with other SARDraw*() functions.
 */
typedef struct {

	sar_core_struct		*core_ptr;	/* Core */
	sar_option_struct	*option;	/* Options (read-only) */
	sar_scene_struct	*scene;		/* Scene */
	sar_object_struct	**object;	/* Objects list */
	int			total_objects;
	gw_display_struct	*display;	/* Graphics Wrapper */
	gctl_struct		*gctl;		/* Game Controller */

	int		width,		/* Size of the GL Context in pixels */
			height;

	float		visibility_max;	/* Far Clip, in meters */
	float		view_aspect;	/* Width / height (with the aspect
					 * offset applied) */
	float		fovz_um;	/* Field Of View in unit meters
					 * about the Z axis, this is a
					 * coefficient that produces the width
					 * of the viewport at any given
					 * distance away from it, where:
				         * view_width_m = distance_m *
					 * fovz_um */

	Boolean		camera_in_cockpit,	/* Camera in cockpit hint */
			ear_in_cockpit,		/* Ear in cockpit hint */
			flir;			/* FLIR (night vision) hint */

	sar_camera_ref	camera_ref;
	sar_position_struct	camera_pos;
	sar_direction_struct	camera_dir;

	float		map_dxm,	/* Map view visible size, in meters */
			map_dym;

	sar_position_struct	primary_light_pos;

	GLfloat			sky_color[3],
				atmosphere_color[3],
				light_color[3];	/* Scene light color (not sun) */

	sar_cloud_layer_struct	*lowest_cloud_layer_ptr,
				*highest_cloud_layer_ptr;

	sar_object_struct	*player_obj_cockpit_ptr;

	sar_flight_model_type	player_flight_model_type;
	int		player_wheel_brakes;	/* 0 = off
						 * 1 = on
						 * 2 = parking */
	Boolean		player_air_brakes,
			player_autopilot,
			player_stall,
			player_overspeed;

} sar_dc_struct;

#define SAR_DC(p)		((sar_dc_struct *)(p))


/* sardrawhelipad. */
extern void SARDrawHelipad(
	sar_dc_struct *dc, sar_object_struct *obj_ptr,
	sar_object_helipad_struct *helipad,
	float distance
);
extern void SARDrawHelipadMap(
	sar_dc_struct *dc, sar_object_struct *obj_ptr,
	sar_object_helipad_struct *helipad,
	float icon_len
);

/* sardrawhuman.c */
extern void SARDrawHumanIterate(
	sar_dc_struct *dc,
	float height, float mass,
	sar_human_flags flags,
	const sar_color_struct *palette,	/* Human colors */
	int water_ripple_tex_num,
	sar_grad_anim_t anim_pos
);
extern void SARDrawHuman(
	sar_dc_struct *dc, sar_object_struct *obj_ptr,
	sar_object_human_struct *human
);

/* sardrawrunway.c */
extern void SARDrawRunway(
	sar_dc_struct *dc, sar_object_struct *obj_ptr,
	sar_object_runway_struct *runway,
	float distance
);
extern void SARDrawRunwayMap(
	sar_dc_struct *dc, sar_object_struct *obj_ptr,
	sar_object_runway_struct *runway,
	float icon_len
);

/* sardrawmessages.c */
extern void SARDrawHelp(sar_dc_struct *dc);
extern void SARDrawMessages(sar_dc_struct *dc);
extern void SARDrawBanner(sar_dc_struct *dc);
extern void SARDrawCameraRefTitle(sar_dc_struct *dc);
extern void SARDrawControlMessages(sar_dc_struct *dc);

/* sardrawutils.c */
extern void SARDrawGetDirFromPos(
	const sar_position_struct *pos1, const sar_position_struct *pos2,
	sar_direction_struct *dir_rtn
);
extern void SARDrawSetColor(const sar_color_struct *c);
extern void SARDrawSetColorFLIRTemperature(float t);
extern void SARDrawBoxNS(float x_len, float y_len, float z_len);
extern void SARDrawBoxBaseNS(
	float x_len, float y_len, float z_len,
	Boolean draw_base
);

/* sardraw.c */
extern void SARDraw(sar_core_struct *core_ptr);
extern void SARDrawMap(
	sar_core_struct *core_ptr,
	Boolean draw_for_gcc, Boolean draw_for_ghc, int gcc_obj_num
);

#endif	/* SARDRAW_H */