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 : OSNOW2.CPP
22 // Description : Class Snow
23 // Ownership : Gilbert
24
25 #include <OSNOW.h>
26 #include <OVGABUF.h>
27 #include <ALL.h>
28
29 //------------ Begin of function Snow::set_bound ---------//
set_bound(int x1,int y1,int x2,int y2)30 void Snow::set_bound(int x1, int y1, int x2, int y2)
31 {
32 for(int i = 0; i < SNOW_LAYERS; ++i)
33 {
34 layer[i].set_bound(x1, y1, x2, y2);
35 }
36 }
37 //------------ End of function Snow::set_bound ---------//
38
39 //------------ Begin of function Snow::init ---------//
init(double s,char animSpeed)40 void Snow::init(double s, char animSpeed)
41 {
42 for(int i = 0; i < SNOW_LAYERS; ++i)
43 {
44 // slower the snow, denser
45 layer[i].init( 15 + 10*i + animSpeed, 20 + 10*i + animSpeed, 3+i*2, i+2, i/2, s, animSpeed);
46 }
47 }
48 //------------ End of function Snow::init ---------//
49
50 //------------ Begin of function Snow::fall ---------//
fall()51 void Snow::fall()
52 {
53 for(int i = 0; i < SNOW_LAYERS; ++i)
54 {
55 layer[i].fall();
56 }
57 }
58 //------------ End of function Snow::fall ---------//
59
60 //------------ Begin of function Snow::draw_step ---------//
draw_step(VgaBuf * vgabuf)61 void Snow::draw_step(VgaBuf *vgabuf)
62 {
63 for(int i = 0; i < SNOW_LAYERS; ++i)
64 {
65 layer[i].draw_step(vgabuf);
66 }
67 }
68 //------------ End of function Snow::draw_step ---------//
69