File: weather.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 (100 lines) | stat: -rw-r--r-- 2,210 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
/*
			Weather Preset Data Structures
 */

#ifndef WEATHER_H
#define WEATHER_H

#include <sys/types.h>
#include "obj.h"

/*
 *	Weather Data:
 */
typedef struct {

	/* Name of this weather setting. */
	char		*name;

	/* Sky and horizon gradient colors. */
	sar_color_struct	sky_nominal_color,
				sky_brighten_color,
				sky_darken_color;

	/* Celestial tint colors. */
	sar_color_struct	star_low_color,
				star_high_color,
				sun_low_color,
				sun_high_color,
				moon_low_color,
				moon_high_color;

	/* Atmoshere minimal distance from camera, a value of 0.5
	 * would be half of the distance and 0.9 would be really close
	 * up to the camera (very foggy)
	 */
	float		atmosphere_dist_coeff;

	/* Atmosphere density, gets more dense as value approaches
	 * 1.0
	 */
	float		atmosphere_density_coeff;

	/* Density of rain, 0.0 for no rain, 0.5 for moderate, 1.0
	 * for densest rain
	 */
	float		rain_density_coeff;

	/* Cloud layers that will be created into the scene, note that
	 * there are no visual models loaded on these cloud layer
	 * structures.
	 */
	sar_cloud_layer_struct **cloud_layer;
	int		total_cloud_layers;

	/* `Billboard' clouds, clouds that appear as `billboard objects'
	 * in a repeating tiled region across the scene.
	 */
	sar_cloud_bb_struct **cloud_bb;
	int		total_cloud_bbs;

} sar_weather_data_entry_struct;

#define SAR_WAATHER_DATA_ENTRY(p)	((sar_weather_data_entry_struct *)(p))


/*
 *	Contains a list of preset weather data structures.
 */
typedef struct {

	void *core_ptr;		/* Pointer back to core. */

	sar_weather_data_entry_struct **preset;
	int total_presets;

} sar_weather_data_struct;

#define SAR_WEATHER_DATA(p)	((sar_weather_data_struct *)(p))


/* In weather.c. */
extern sar_weather_data_struct *SARWeatherPresetsInit(void *core_ptr);
extern void SARWeatherPresetsShutdown(sar_weather_data_struct *w);

extern void SARWeatherEntryDelete(
	sar_weather_data_struct *w, sar_weather_data_entry_struct *entry
);

extern void SARWeatherSetScenePreset(
	sar_weather_data_struct *w, sar_scene_struct *scene,
	const char *name
);

/* In weatherio.c. */
extern int SARWeatherLoadFromFile(
	sar_weather_data_struct *w, const char *filename
);


#endif	/* WEATHER_H */