ScummVM API documentation
bubbles.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_BUBBLES_H
23 #define STARK_VISUAL_EFFECTS_BUBBLES_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::kEffectBubbles;
43 
44  explicit VisualEffectBubbles(Gfx::Driver *gfx, const Common::Point &size);
45  ~VisualEffectBubbles() override;
46 
48  void setParams(const Common::String &params);
49 
51  void render(const Common::Point &position);
52 
53 private:
54 
55  enum Kind {
56  kSmall = 1,
57  kLarge = 2,
58  kRandom = 3
59  };
60 
61  struct Bubble {
62  Common::Point position;
63  Kind kind;
64  };
65 
66  // Parameters
67  uint _bubbleCount;
68  Kind _kind;
69  int _sourcePositionRatioX;
70  int _maxVerticalSpeed;
71  int _maxHorizontalSpeed;
72  byte _mainColorR;
73  byte _mainColorG;
74  byte _mainColorB;
75 
76  // State
77  Common::Point _sourcePosition;
78  uint32 _mainColor;
79  uint32 _darkColor;
80  Common::Array<Bubble> _bubbles;
81 
82  void update();
83  void drawBubble(const Bubble &bubble) const;
84  void drawSmallBubble(const Bubble &bubble) const;
85  void drawLargeBubble(const Bubble &bubble) const;
86 };
87 
88 } // End of namespace Stark
89 
90 #endif // STARK_VISUAL_EFFECTS_BUBBLES_H
Definition: str.h:59
Definition: effect.h:48
Definition: driver.h:44
Definition: console.h:27
Definition: rect.h:45
Definition: bubbles.h:40