ScummVM API documentation
flashingimage.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_FLASHING_IMAGE_H
23 #define STARK_VISUAL_FLASHING_IMAGE_H
24 
25 #include "engines/stark/visual/visual.h"
26 
27 #include "common/array.h"
28 #include "common/rect.h"
29 
30 #include "graphics/pixelformat.h"
31 
32 #include "math/vector2d.h"
33 
34 namespace Graphics {
35 struct Surface;
36 }
37 
38 namespace Stark {
39 
40 namespace Gfx {
41 class Driver;
42 class SurfaceRenderer;
43 class Bitmap;
44 }
45 
51 class VisualFlashingImage : public Visual {
52 public:
53  static const VisualType TYPE = Visual::kFlashingImage;
54 
55  explicit VisualFlashingImage(Gfx::Driver *gfx);
56  ~VisualFlashingImage() override;
57 
59  void initFromSurface(const Graphics::Surface *surface, uint originalWidth, uint originalHeight);
60 
62  void render(const Common::Point &position);
63 
64 private:
65  void updateFadeLevel();
66 
67  Gfx::Driver *_gfx;
68  Gfx::SurfaceRenderer *_surfaceRenderer;
69  Gfx::Bitmap *_bitmap;
70 
71  uint _originalWidth;
72  uint _originalHeight;
73 
74  int _flashingTimeRemaining;
75  float _fadeLevel;
76  bool _fadeLevelIncreasing;
77  static const float _fadeValueMax;
78 
79 };
80 
81 } // End of namespace Stark
82 
83 #endif // STARK_VISUAL_FLASHING_IMAGE_H
Definition: surface.h:67
Definition: visual.h:29
Definition: surfacerenderer.h:36
Definition: driver.h:44
Definition: console.h:27
Definition: bitmap.h:38
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: flashingimage.h:51