/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.hh

http://github.com/xbmc/xbmc · C++ Header · 61 lines · 33 code · 6 blank · 22 comment · 2 complexity · 18b337c91c6364b4dd732cc2ff90566d MD5 · raw file

  1. /*
  2. * Really Slick XScreenSavers
  3. * Copyright (C) 2002-2006 Michael Chapman
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. *****************************************************************************
  19. *
  20. * This is a Linux port of the Really Slick Screensavers,
  21. * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
  22. */
  23. #ifndef _FOUNTAIN_HH
  24. #define _FOUNTAIN_HH
  25. #include <common.hh>
  26. #include <color.hh>
  27. #include <particle.hh>
  28. #include <resources.hh>
  29. #include <skyrocket.hh>
  30. #include <vector.hh>
  31. class Fountain : public Particle {
  32. private:
  33. RGBColor _RGB;
  34. float _brightness;
  35. float _starTimer;
  36. public:
  37. Fountain() : Particle(
  38. Vector(
  39. Common::randomFloat(300.0f) - 150.0f,
  40. 5.0f,
  41. Common::randomFloat(300.0f) - 150.0f
  42. ), Vector(), 0.0f, Common::randomFloat(5.0f) + 10.0f
  43. ), _RGB(Particle::randomColor()), _brightness(0.0f), _starTimer(0.0f) {
  44. if (Hack::volume > 0.0f) {
  45. if (Common::randomInt(2))
  46. Resources::Sounds::launch1->play(_pos);
  47. else
  48. Resources::Sounds::launch2->play(_pos);
  49. }
  50. }
  51. void update();
  52. void updateCameraOnly();
  53. void draw() const;
  54. };
  55. #endif // _FOUNTAIN_HH