ScummVM API documentation
graphics_effect.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 GRAPHICS_EFFECT_H_INCLUDED
23#define GRAPHICS_EFFECT_H_INCLUDED
24
25#include "common/list.h"
26#include "common/rect.h"
27#include "graphics/surface.h"
28#include "zvision/zvision.h"
29
30namespace ZVision {
31
32class ZVision;
33
35public:
36
37 GraphicsEffect(ZVision *engine, uint32 key, Common::Rect region, bool ported) : _engine(engine), _key(key), _region(region), _ported(ported) {
38 _surface.create(_region.width(), _region.height(), _engine->_resourcePixelFormat);
39 }
40 virtual ~GraphicsEffect() {}
41
42 uint32 getKey() {
43 return _key;
44 }
45
46 Common::Rect getRegion() {
47 return _region;
48 }
49
50 // If true, effect is applied to the current background image prior to panoramic warping
51 // If false, effect is applied to the effects buffer, which corresponds directly to the working window
52 bool isPort() {
53 return _ported;
54 }
55
56 // Make a copy of supplied surface, draw effect on it, then return that altered surface
57 virtual const Graphics::Surface *draw(const Graphics::Surface &srcSubRect) {
58 return &_surface;
59 }
60
61 virtual void update() {}
62
63protected:
64 ZVision *_engine;
65 uint32 _key;
66 Common::Rect _region;
67 bool _ported;
68 Graphics::Surface _surface;
69
70// Static member functions
71public:
72
73};
74
76 uint32 count;
77 bool inEffect;
78};
79
81
82} // End of namespace ZVision
83
84#endif // GRAPHICS_EFFECT_H_INCLUDED
Definition: list.h:44
Definition: graphics_effect.h:34
Definition: focus_list.h:27
T height() const
Definition: rect.h:218
T width() const
Definition: rect.h:217
Definition: rect.h:536
Definition: surface.h:67
void create(int16 width, int16 height, const PixelFormat &format)
Definition: graphics_effect.h:75