OSNOW.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 : OSNOW.H
  21. // Description : header file for class SnowLayer
  22. // Ownership : Gilbert
  23. #ifndef __OSNOW_H
  24. #define __OSNOW_H
  25. //------------ Define constant -------------//
  26. #define SNOW_LAYERS 4
  27. //--------- Define class SnowLayer ----------//
  28. class VgaBuf;
  29. class SnowLayer
  30. {
  31. public:
  32. int bound_x1, bound_y1, bound_x2, bound_y2;
  33. short h_sep, v_sep; // horizontal/vertical separation of each snow
  34. short fall_speed; // falling speed
  35. short amplitude; // amplitude of random shift
  36. short radius; // radius of each snow
  37. short slide_speed; // horizontal speed
  38. short period; // no. of row to draw, maximum 1000
  39. char blind_site;
  40. char anim_speed; // animation speed range from 1 to 10
  41. char anim_phase;
  42. private:
  43. int snow_x, snow_y; // location of any snow;
  44. unsigned seed;
  45. unsigned random(unsigned);
  46. public:
  47. void set_bound(int x1, int y1, int x2, int y2);
  48. void init(short h, short v, short speed, short amp, short r, double s,
  49. char animSpeed = 100, short initPeriod = 1000);
  50. void fall();
  51. void draw_step(VgaBuf *);
  52. };
  53. //----------- Define class Snow ------------//
  54. class Snow
  55. {
  56. public:
  57. SnowLayer layer[SNOW_LAYERS];
  58. public:
  59. void set_bound(int x1, int y1, int x2, int y2);
  60. void init(double slope, char animSpeed); // animSpeed from 1 to 10
  61. void fall();
  62. void draw_step(VgaBuf *vgabuf);
  63. };
  64. //------------------------------------------//
  65. #endif