ScummVM API documentation
fish.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_FISH_H
23 #define STARK_VISUAL_EFFECTS_FISH_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::kEffectFish;
43 
44  explicit VisualEffectFish(Gfx::Driver *gfx, const Common::Point &size);
45  ~VisualEffectFish() 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  };
61 
62  struct Fish {
63  Common::Point currentPosition;
64  Common::Point previousPosition;
65  Common::Point point1;
66  Common::Point point2;
67  Common::Point point3;
68  Common::Point point4;
69  };
70 
71  // Parameters
72  uint _fishCount;
73  int _fishPathWidthRatio;
74  int _fishPathHeightRatio;
75  int _fishPathWidth;
76  int _fishPathHeight;
77  int _masterPathWidth;
78  int _masterPathHeight;
79  byte _mainColorR;
80  byte _mainColorG;
81  byte _mainColorB;
82  uint32 _mainColor;
83  uint32 _otherColor;
84  uint _numFrames;
85  uint _maxRadius;
86 
87  // State
88  uint32 _currentFrame;
89  Common::Array<Frame> _frames;
90  Common::Array<Fish> _fishList;
91  Fish _masterPath;
92 
93  void update();
94  void drawFish(const Fish &fish);
95 };
96 
97 } // End of namespace Stark
98 
99 #endif // STARK_VISUAL_EFFECTS_FISH_H
Definition: str.h:59
Definition: effect.h:48
Definition: fish.h:40
Definition: driver.h:44
Definition: console.h:27
Definition: rect.h:45