OSNOW2.cpp 1.9 KB

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