1 /*
2  * Seven Kingdoms: Ancient Adversaries
3  *
4  * Copyright 1997,1998 Enlight Software Ltd.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 // Filename    : OSNOW.H
22 // Description : header file for class SnowLayer
23 // Ownership   : Gilbert
24 
25 #ifndef __OSNOW_H
26 #define __OSNOW_H
27 
28 //------------ Define constant -------------//
29 
30 #define SNOW_LAYERS 4
31 
32 //--------- Define class SnowLayer ----------//
33 
34 class VgaBuf;
35 
36 class SnowLayer
37 {
38 public:
39 	int	bound_x1, bound_y1, bound_x2, bound_y2;
40 	short	h_sep, v_sep;			// horizontal/vertical separation of each snow
41 	short	fall_speed;				// falling speed
42 	short	amplitude;				// amplitude of random shift
43 	short	radius;					// radius of each snow
44 	short slide_speed;			// horizontal speed
45 	short period;					// no. of row to draw, maximum 1000
46 	char	blind_site;
47 	char	anim_speed;				// animation speed range from 1 to 10
48 	char	anim_phase;
49 
50 private:
51 	int	snow_x, snow_y;		// location of any snow;
52 	unsigned seed;
53 	unsigned random(unsigned);
54 
55 public:
56 	void	set_bound(int x1, int y1, int x2, int y2);
57 	void	init(short h, short v, short speed, short amp, short r, double s,
58 			char animSpeed = 100, short initPeriod = 1000);
59 
60 
61 	void	fall();
62 	void	draw_step(VgaBuf *);
63 
64 };
65 
66 //----------- Define class Snow ------------//
67 
68 class Snow
69 {
70 public:
71 	SnowLayer layer[SNOW_LAYERS];
72 
73 public:
74 	void	set_bound(int x1, int y1, int x2, int y2);
75 	void	init(double slope, char animSpeed);				// animSpeed from 1 to 10
76 	void	fall();
77 	void	draw_step(VgaBuf *vgabuf);
78 };
79 
80 //------------------------------------------//
81 
82 #endif