PageRenderTime 22ms CodeModel.GetById 8ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/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
26#include <common.hh>
27
28#include <color.hh>
29#include <particle.hh>
30#include <resources.hh>
31#include <skyrocket.hh>
32#include <vector.hh>
33
34class Fountain : public Particle {
35private:
36	RGBColor _RGB;
37	float _brightness;
38
39	float _starTimer;
40public:
41	Fountain() : Particle(
42		Vector(
43			Common::randomFloat(300.0f) - 150.0f,
44			5.0f,
45			Common::randomFloat(300.0f) - 150.0f
46		), Vector(), 0.0f, Common::randomFloat(5.0f) + 10.0f
47	), _RGB(Particle::randomColor()), _brightness(0.0f), _starTimer(0.0f) {
48		if (Hack::volume > 0.0f) {
49			if (Common::randomInt(2))
50				Resources::Sounds::launch1->play(_pos);
51			else
52				Resources::Sounds::launch2->play(_pos);
53		}
54	}
55
56	void update();
57	void updateCameraOnly();
58	void draw() const;
59};
60
61#endif // _FOUNTAIN_HH