ScummVM API documentation
fireflies.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef STARK_VISUAL_EFFECTS_FIREFLIES_H
23 #define STARK_VISUAL_EFFECTS_FIREFLIES_H
24 
25 #include "engines/stark/visual/effects/effect.h"
26 
27 #include "common/array.h"
28 #include "common/rect.h"
29 
30 namespace Stark {
31 
32 namespace Gfx {
33 class Driver;
34 class SurfaceRenderer;
35 }
36 
41 public:
42  static const VisualType TYPE = Visual::kEffectFirefly;
43 
44  explicit VisualEffectFireFlies(Gfx::Driver *gfx, const Common::Point &size);
45  ~VisualEffectFireFlies() override;
46 
48  void setParams(const Common::String &params);
49 
51  void render(const Common::Point &position);
52 
53 private:
54 
55  struct Frame {
56  float weight1;
57  float weight2;
58  float weight3;
59  float weight4;
60  uint32 color;
61  };
62 
63  struct FireFly {
64  Common::Point currentPosition;
65  uint32 currentFrame;
66  Common::Point point1;
67  Common::Point point2;
68  Common::Point point3;
69  Common::Point point4;
70  };
71 
72  // Parameters
73  uint _fireFlyCount;
74  byte _mainColorR;
75  byte _mainColorG;
76  byte _mainColorB;
77 
78  // State
79  Common::Array<Frame> _frames;
80  Common::Array<FireFly> _fireFlies;
81 
82  void update();
83  void drawFireFly(const FireFly &fly);
84 };
85 
86 } // End of namespace Stark
87 
88 #endif // STARK_VISUAL_EFFECTS_FIREFLIES_H
Definition: str.h:59
Definition: effect.h:48
Definition: driver.h:44
Definition: console.h:27
Definition: rect.h:45
Definition: fireflies.h:40