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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef GRAPHICS_EFFECT_H_INCLUDED 24 #define GRAPHICS_EFFECT_H_INCLUDED 25 26 #include "common/rect.h" 27 #include "common/list.h" 28 #include "graphics/surface.h" 29 30 #include "zvision/zvision.h" 31 32 namespace ZVision { 33 34 class ZVision; 35 36 class GraphicsEffect { 37 public: 38 GraphicsEffect(ZVision * engine,uint32 key,Common::Rect region,bool ported)39 GraphicsEffect(ZVision *engine, uint32 key, Common::Rect region, bool ported) : _engine(engine), _key(key), _region(region), _ported(ported) { 40 _surface.create(_region.width(), _region.height(), _engine->_resourcePixelFormat); 41 } ~GraphicsEffect()42 virtual ~GraphicsEffect() {} 43 getKey()44 uint32 getKey() { 45 return _key; 46 } 47 getRegion()48 Common::Rect getRegion() { 49 return _region; 50 } 51 isPort()52 bool isPort() { 53 return _ported; 54 } 55 draw(const Graphics::Surface & srcSubRect)56 virtual const Graphics::Surface *draw(const Graphics::Surface &srcSubRect) { 57 return &_surface; 58 } 59 update()60 virtual void update() {} 61 62 protected: 63 ZVision *_engine; 64 uint32 _key; 65 Common::Rect _region; 66 bool _ported; 67 Graphics::Surface _surface; 68 69 // Static member functions 70 public: 71 72 }; 73 74 struct EffectMapUnit { 75 uint32 count; 76 bool inEffect; 77 }; 78 79 typedef Common::List<EffectMapUnit> EffectMap; 80 81 } // End of namespace ZVision 82 83 #endif // GRAPHICS_EFFECT_H_INCLUDED 84