diff options
Diffstat (limited to 'engines/zvision/graphics')
-rw-r--r-- | engines/zvision/graphics/effects/fog.h | 6 | ||||
-rw-r--r-- | engines/zvision/graphics/effects/wave.cpp | 148 | ||||
-rw-r--r-- | engines/zvision/graphics/effects/wave.h | 6 | ||||
-rw-r--r-- | engines/zvision/graphics/render_manager.cpp | 89 | ||||
-rw-r--r-- | engines/zvision/graphics/render_manager.h | 120 |
5 files changed, 205 insertions, 164 deletions
diff --git a/engines/zvision/graphics/effects/fog.h b/engines/zvision/graphics/effects/fog.h index 62dd1f9473..45d6f9596d 100644 --- a/engines/zvision/graphics/effects/fog.h +++ b/engines/zvision/graphics/effects/fog.h @@ -20,8 +20,8 @@ * */ -#ifndef FOGFX_H_INCLUDED -#define FOGFX_H_INCLUDED +#ifndef ZVISION_FOG_H +#define ZVISION_FOG_H #include "zvision/graphics/effect.h" @@ -49,4 +49,4 @@ private: }; } // End of namespace ZVision -#endif // FOGFX_H_INCLUDED +#endif // ZVISION_FOG_H diff --git a/engines/zvision/graphics/effects/wave.cpp b/engines/zvision/graphics/effects/wave.cpp index 88239f3cad..9f2fbb285c 100644 --- a/engines/zvision/graphics/effects/wave.cpp +++ b/engines/zvision/graphics/effects/wave.cpp @@ -30,32 +30,32 @@ namespace ZVision { -WaveFx::WaveFx(ZVision *engine, uint32 key, Common::Rect region, bool ported, int16 frames, int16 s_x, int16 s_y, float ampl, float waveln, float spd): +WaveFx::WaveFx(ZVision *engine, uint32 key, Common::Rect region, bool ported, int16 frames, int16 centerX, int16 centerY, float ampl, float waveln, float spd): Effect(engine, key, region, ported) { _frame = 0; - _frame_cnt = frames; + _frameCount = frames; - _ampls.resize(_frame_cnt); - _hw = _region.width() / 2; - _hh = _region.height() / 2; + _ampls.resize(_frameCount); + _halfWidth = _region.width() / 2; + _halfHeight = _region.height() / 2; - int32 frmsize = _hw * _hh; + int32 frmsize = _halfWidth * _halfHeight; float phase = 0; - int16 w_4 = _hw / 2; - int16 h_4 = _hh / 2; + int16 quarterWidth = _halfWidth / 2; + int16 quarterHeight = _halfHeight / 2; - for (int16 i = 0; i < _frame_cnt; i++) { + for (int16 i = 0; i < _frameCount; i++) { _ampls[i].resize(frmsize); - for (int16 y = 0; y < _hh; y++) - for (int16 x = 0; x < _hw; x++) { - int16 dx = (x - w_4); - int16 dy = (y - h_4); + for (int16 y = 0; y < _halfHeight; y++) + for (int16 x = 0; x < _halfWidth; x++) { + int16 dx = (x - quarterWidth); + int16 dy = (y - quarterHeight); - _ampls[i][x + y * _hw] = ampl * sin(sqrt(dx * dx / (float)s_x + dy * dy / (float)s_y) / (-waveln * 3.1415926) + phase); + _ampls[i][x + y * _halfWidth] = ampl * sin(sqrt(dx * dx / (float)centerX + dy * dy / (float)centerY) / (-waveln * 3.1415926) + phase); } phase += spd; } @@ -68,66 +68,66 @@ WaveFx::~WaveFx() { } const Graphics::Surface *WaveFx::draw(const Graphics::Surface &srcSubRect) { - for (int16 y = 0; y < _hh; y++) { + for (int16 y = 0; y < _halfHeight; y++) { uint16 *abc = (uint16 *)_surface.getBasePtr(0, y); - uint16 *abc2 = (uint16 *)_surface.getBasePtr(0, _hh + y); - uint16 *abc3 = (uint16 *)_surface.getBasePtr(_hw, y); - uint16 *abc4 = (uint16 *)_surface.getBasePtr(_hw, _hh + y); - - for (int16 x = 0; x < _hw; x++) { - int8 amnt = _ampls[_frame][x + _hw * y]; - - int16 n_x = x + amnt; - int16 n_y = y + amnt; - - if (n_x < 0) - n_x = 0; - if (n_x >= _region.width()) - n_x = _region.width() - 1; - if (n_y < 0) - n_y = 0; - if (n_y >= _region.height()) - n_y = _region.height() - 1; - *abc = *(const uint16 *)srcSubRect.getBasePtr(n_x, n_y); - - n_x = x + amnt + _hw; - n_y = y + amnt; - - if (n_x < 0) - n_x = 0; - if (n_x >= _region.width()) - n_x = _region.width() - 1; - if (n_y < 0) - n_y = 0; - if (n_y >= _region.height()) - n_y = _region.height() - 1; - *abc3 = *(const uint16 *)srcSubRect.getBasePtr(n_x, n_y); - - n_x = x + amnt; - n_y = y + amnt + _hh; - - if (n_x < 0) - n_x = 0; - if (n_x >= _region.width()) - n_x = _region.width() - 1; - if (n_y < 0) - n_y = 0; - if (n_y >= _region.height()) - n_y = _region.height() - 1; - *abc2 = *(const uint16 *)srcSubRect.getBasePtr(n_x, n_y); - - n_x = x + amnt + _hw; - n_y = y + amnt + _hh; - - if (n_x < 0) - n_x = 0; - if (n_x >= _region.width()) - n_x = _region.width() - 1; - if (n_y < 0) - n_y = 0; - if (n_y >= _region.height()) - n_y = _region.height() - 1; - *abc4 = *(const uint16 *)srcSubRect.getBasePtr(n_x, n_y); + uint16 *abc2 = (uint16 *)_surface.getBasePtr(0, _halfHeight + y); + uint16 *abc3 = (uint16 *)_surface.getBasePtr(_halfWidth, y); + uint16 *abc4 = (uint16 *)_surface.getBasePtr(_halfWidth, _halfHeight + y); + + for (int16 x = 0; x < _halfWidth; x++) { + int8 amnt = _ampls[_frame][x + _halfWidth * y]; + + int16 nX = x + amnt; + int16 nY = y + amnt; + + if (nX < 0) + nX = 0; + if (nX >= _region.width()) + nX = _region.width() - 1; + if (nY < 0) + nY = 0; + if (nY >= _region.height()) + nY = _region.height() - 1; + *abc = *(const uint16 *)srcSubRect.getBasePtr(nX, nY); + + nX = x + amnt + _halfWidth; + nY = y + amnt; + + if (nX < 0) + nX = 0; + if (nX >= _region.width()) + nX = _region.width() - 1; + if (nY < 0) + nY = 0; + if (nY >= _region.height()) + nY = _region.height() - 1; + *abc3 = *(const uint16 *)srcSubRect.getBasePtr(nX, nY); + + nX = x + amnt; + nY = y + amnt + _halfHeight; + + if (nX < 0) + nX = 0; + if (nX >= _region.width()) + nX = _region.width() - 1; + if (nY < 0) + nY = 0; + if (nY >= _region.height()) + nY = _region.height() - 1; + *abc2 = *(const uint16 *)srcSubRect.getBasePtr(nX, nY); + + nX = x + amnt + _halfWidth; + nY = y + amnt + _halfHeight; + + if (nX < 0) + nX = 0; + if (nX >= _region.width()) + nX = _region.width() - 1; + if (nY < 0) + nY = 0; + if (nY >= _region.height()) + nY = _region.height() - 1; + *abc4 = *(const uint16 *)srcSubRect.getBasePtr(nX, nY); abc++; abc2++; @@ -140,7 +140,7 @@ const Graphics::Surface *WaveFx::draw(const Graphics::Surface &srcSubRect) { } void WaveFx::update() { - _frame = (_frame + 1) % _frame_cnt; + _frame = (_frame + 1) % _frameCount; } } // End of namespace ZVision diff --git a/engines/zvision/graphics/effects/wave.h b/engines/zvision/graphics/effects/wave.h index 0046dfceec..2e813ed5b6 100644 --- a/engines/zvision/graphics/effects/wave.h +++ b/engines/zvision/graphics/effects/wave.h @@ -33,7 +33,7 @@ class ZVision; class WaveFx : public Effect { public: - WaveFx(ZVision *engine, uint32 key, Common::Rect region, bool ported, int16 frames, int16 s_x, int16 s_y, float ampl, float waveln, float spd); + WaveFx(ZVision *engine, uint32 key, Common::Rect region, bool ported, int16 frames, int16 centerX, int16 centerY, float ampl, float waveln, float spd); ~WaveFx(); const Graphics::Surface *draw(const Graphics::Surface &srcSubRect); @@ -42,8 +42,8 @@ public: private: int16 _frame; - int16 _frame_cnt; - int16 _hw, _hh; + int16 _frameCount; + int16 _halfWidth, _halfHeight; Common::Array< Common::Array< int8 > > _ampls; }; } // End of namespace ZVision diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp index 3e146939e3..05f8dec937 100644 --- a/engines/zvision/graphics/render_manager.cpp +++ b/engines/zvision/graphics/render_manager.cpp @@ -78,6 +78,7 @@ RenderManager::~RenderManager() { void RenderManager::renderBackbufferToScreen() { Graphics::Surface *out = &_outWnd; Graphics::Surface *in = &_wrkWnd; + Common::Rect outWndDirtyRect; if (!_effects.empty()) { bool copied = false; @@ -114,22 +115,20 @@ void RenderManager::renderBackbufferToScreen() { if (!_wrkWndDirtyRect.isEmpty()) { _renderTable.mutateImage(&_outWnd, in); out = &_outWnd; - _outWndDirtyRect = Common::Rect(_wrkWidth, _wrkHeight); + outWndDirtyRect = Common::Rect(_wrkWidth, _wrkHeight); } } else { out = in; - _outWndDirtyRect = _wrkWndDirtyRect; + outWndDirtyRect = _wrkWndDirtyRect; } - if (!_outWndDirtyRect.isEmpty()) { - _system->copyRectToScreen(out->getBasePtr(_outWndDirtyRect.left, _outWndDirtyRect.top), out->pitch, - _outWndDirtyRect.left + _workingWindow.left, - _outWndDirtyRect.top + _workingWindow.top, - _outWndDirtyRect.width(), - _outWndDirtyRect.height()); - - _outWndDirtyRect = Common::Rect(); + if (!outWndDirtyRect.isEmpty()) { + _system->copyRectToScreen(out->getBasePtr(outWndDirtyRect.left, outWndDirtyRect.top), out->pitch, + outWndDirtyRect.left + _workingWindow.left, + outWndDirtyRect.top + _workingWindow.top, + outWndDirtyRect.width(), + outWndDirtyRect.height()); } } @@ -472,7 +471,7 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com return; // Copy srcRect from src surface to dst surface - const byte *src_buf = (const byte *)src.getBasePtr(srcRect.left, srcRect.top); + const byte *srcBuffer = (const byte *)src.getBasePtr(srcRect.left, srcRect.top); int xx = _x; int yy = _y; @@ -485,15 +484,15 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com if (_x >= dst.w || _y >= dst.h) return; - byte *dst_buf = (byte *)dst.getBasePtr(xx, yy); + byte *dstBuffer = (byte *)dst.getBasePtr(xx, yy); int32 w = srcRect.width(); int32 h = srcRect.height(); for (int32 y = 0; y < h; y++) { - memcpy(dst_buf, src_buf, w * src.format.bytesPerPixel); - src_buf += src.pitch; - dst_buf += dst.pitch; + memcpy(dstBuffer, srcBuffer, w * src.format.bytesPerPixel); + srcBuffer += src.pitch; + dstBuffer += dst.pitch; } } @@ -517,7 +516,7 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com uint32 _keycolor = colorkey & ((1 << (src.format.bytesPerPixel << 3)) - 1); // Copy srcRect from src surface to dst surface - const byte *src_buf = (const byte *)src.getBasePtr(srcRect.left, srcRect.top); + const byte *srcBuffer = (const byte *)src.getBasePtr(srcRect.left, srcRect.top); int xx = _x; int yy = _y; @@ -530,7 +529,7 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com if (_x >= dst.w || _y >= dst.h) return; - byte *dst_buf = (byte *)dst.getBasePtr(xx, yy); + byte *dstBuffer = (byte *)dst.getBasePtr(xx, yy); int32 w = srcRect.width(); int32 h = srcRect.height(); @@ -538,37 +537,37 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com for (int32 y = 0; y < h; y++) { switch (src.format.bytesPerPixel) { case 1: { - const uint *src_tmp = (const uint *)src_buf; - uint *dst_tmp = (uint *)dst_buf; + const uint *srcTemp = (const uint *)srcBuffer; + uint *dstTemp = (uint *)dstBuffer; for (int32 x = 0; x < w; x++) { - if (*src_tmp != _keycolor) - *dst_tmp = *src_tmp; - src_tmp++; - dst_tmp++; + if (*srcTemp != _keycolor) + *dstTemp = *srcTemp; + srcTemp++; + dstTemp++; } } break; case 2: { - const uint16 *src_tmp = (const uint16 *)src_buf; - uint16 *dst_tmp = (uint16 *)dst_buf; + const uint16 *srcTemp = (const uint16 *)srcBuffer; + uint16 *dstTemp = (uint16 *)dstBuffer; for (int32 x = 0; x < w; x++) { - if (*src_tmp != _keycolor) - *dst_tmp = *src_tmp; - src_tmp++; - dst_tmp++; + if (*srcTemp != _keycolor) + *dstTemp = *srcTemp; + srcTemp++; + dstTemp++; } } break; case 4: { - const uint32 *src_tmp = (const uint32 *)src_buf; - uint32 *dst_tmp = (uint32 *)dst_buf; + const uint32 *srcTemp = (const uint32 *)srcBuffer; + uint32 *dstTemp = (uint32 *)dstBuffer; for (int32 x = 0; x < w; x++) { - if (*src_tmp != _keycolor) - *dst_tmp = *src_tmp; - src_tmp++; - dst_tmp++; + if (*srcTemp != _keycolor) + *dstTemp = *srcTemp; + srcTemp++; + dstTemp++; } } break; @@ -576,8 +575,8 @@ void RenderManager::blitSurfaceToSurface(const Graphics::Surface &src, const Com default: break; } - src_buf += src.pitch; - dst_buf += dst.pitch; + srcBuffer += src.pitch; + dstBuffer += dst.pitch; } } @@ -796,7 +795,7 @@ uint16 RenderManager::createSubArea(const Common::Rect &area) { sub.redraw = false; sub.timer = -1; sub.todelete = false; - sub._r = area; + sub.r = area; _subsList[_subid] = sub; @@ -810,8 +809,8 @@ uint16 RenderManager::createSubArea() { sub.redraw = false; sub.timer = -1; sub.todelete = false; - sub._r = Common::Rect(_subWndRect.left, _subWndRect.top, _subWndRect.right, _subWndRect.bottom); - sub._r.translate(-_workingWindow.left, -_workingWindow.top); + sub.r = Common::Rect(_subWndRect.left, _subWndRect.top, _subWndRect.right, _subWndRect.bottom); + sub.r.translate(-_workingWindow.left, -_workingWindow.top); _subsList[_subid] = sub; @@ -831,7 +830,7 @@ void RenderManager::deleteSubArea(uint16 id, int16 delay) { void RenderManager::updateSubArea(uint16 id, const Common::String &txt) { if (_subsList.contains(id)) { oneSub *sub = &_subsList[id]; - sub->_txt = txt; + sub->txt = txt; sub->redraw = true; } } @@ -857,11 +856,11 @@ void RenderManager::processSubs(uint16 deltatime) { for (subMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) { oneSub *sub = &it->_value; - if (sub->_txt.size()) { + if (sub->txt.size()) { Graphics::Surface *rndr = new Graphics::Surface(); - rndr->create(sub->_r.width(), sub->_r.height(), _pixelFormat); - _engine->getTextRenderer()->drawTxtInOneLine(sub->_txt, *rndr); - blitSurfaceToSurface(*rndr, _subWnd, sub->_r.left - _subWndRect.left + _workingWindow.left, sub->_r.top - _subWndRect.top + _workingWindow.top); + rndr->create(sub->r.width(), sub->r.height(), _pixelFormat); + _engine->getTextRenderer()->drawTxtInOneLine(sub->txt, *rndr); + blitSurfaceToSurface(*rndr, _subWnd, sub->r.left - _subWndRect.left + _workingWindow.left, sub->r.top - _subWndRect.top + _workingWindow.top); rndr->free(); delete rndr; } diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index d34ecf8ce0..7723c3d0f3 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -54,21 +54,13 @@ public: private: struct oneSub { - Common::Rect _r; - Common::String _txt; + Common::Rect r; + Common::String txt; int16 timer; bool todelete; bool redraw; }; -// struct AlphaDataEntry { -// Graphics::Surface *data; -// uint16 alphaColor; -// uint16 destX; -// uint16 destY; -// uint16 width; -// uint16 height; -// }; -// + typedef Common::HashMap<uint16, oneSub> subMap; typedef Common::List<Effect *> effectsList; @@ -82,37 +74,25 @@ private: Common::Rect _wrkWndDirtyRect; + // A buffer for mutate image by tilt or panorama renderers Graphics::Surface _outWnd; - Common::Rect _outWndDirtyRect; - Common::Rect _bkgDirtyRect; + // A buffer for subtitles Graphics::Surface _subWnd; Common::Rect _subWndDirtyRect; + // A buffer for menu drawing Graphics::Surface _menuWnd; Common::Rect _menuWndDirtyRect; + // A buffer used for apply graphics effects Graphics::Surface _effectWnd; - // A buffer the exact same size as the workingWindow - // This buffer stores everything un-warped, then does a warp at the end of the frame - //Graphics::Surface _workingWindowBuffer; - // A buffer representing the entire screen. Any graphical updates are first done with this buffer - // before actually being blitted to the screen - //Graphics::Surface _backBuffer; - // A list of Alpha Entries that need to be blitted to the backbuffer - //AlphaEntryMap _alphaDataEntries; - - // A rectangle representing the portion of the working window where the pixels have been changed since last frame - //Common::Rect _workingWindowDirtyRect; - // A rectangle representing the portion of the backbuffer where the pixels have been changed since last frame - //Common::Rect _backBufferDirtyRect; - /** Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() */ const int _wrkWidth; /** Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() */ @@ -129,13 +109,16 @@ private: */ const Common::Rect _workingWindow; + // Recatangle for subtitles area Common::Rect _subWndRect; + // Recatangle for menu area Common::Rect _menuWndRect; /** Used to warp the background image */ RenderTable _renderTable; + // A buffer for background image Graphics::Surface _curBkg; /** The (x1,y1) coordinates of the subRectangle of the background that is currently displayed on the screen */ int16 _bkgOff; @@ -144,18 +127,13 @@ private: /** The height of the current background image */ uint16 _bkgHeight; + // Internal subtitles counter uint16 _subid; + // Subtitle list subMap _subsList; - /** - * The "velocity" at which the background image is panning. We actually store the inverse of velocity (ms/pixel instead of pixels/ms) - * because it allows you to accumulate whole pixels 'steps' instead of rounding pixels every frame - */ - //int _backgroundInverseVelocity; - /** Holds any 'leftover' milliseconds between frames */ - //uint _accumulatedVelocityMilliseconds; - + // Visual effects list effectsList _effects; public: @@ -178,13 +156,22 @@ public: /** * Blits the image or a portion of the image to the background. * - * @param fileName Name of the image file - * @param destinationX X position where the image should be put. Coords are in working window space, not screen space! - * @param destinationY Y position where the image should be put. Coords are in working window space, not screen space! + * @param fileName Name of the image file + * @param destX X position where the image should be put. Coords are in working window space, not screen space! + * @param destY Y position where the image should be put. Coords are in working window space, not screen space! * @param colorkey Transparent color */ void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, uint32 colorkey); + /** + * Blits the image or a portion of the image to the background. + * + * @param fileName Name of the image file + * @param destX X position where the image should be put. Coords are in working window space, not screen space! + * @param destY Y position where the image should be put. Coords are in working window space, not screen space! + * @param keyX X position of transparent color + * @param keyY Y position of transparent color + */ void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, int16 keyX, int16 keyY); /** @@ -215,7 +202,10 @@ public: */ const Common::Point screenSpaceToImageSpace(const Common::Point &point); + // Return pointer of RenderTable object RenderTable *getRenderTable(); + + // Return current background offset uint32 getCurrentBackgroundOffset(); /** @@ -229,39 +219,64 @@ public: */ static Graphics::Surface *tranposeSurface(const Graphics::Surface *surface); + // Scale buffer (nearest) void scaleBuffer(const void *src, void *dst, uint32 srcWidth, uint32 srcHeight, byte bytesPerPixel, uint32 dstWidth, uint32 dstHeight); - + // Blitting surface-to-surface methods void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int x, int y); void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int _x, int _y, uint32 colorkey); void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y); void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y, uint32 colorkey); + + // Blitting surface-to-background methods void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y); void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y, uint32 colorkey); + + // Blitting surface-to-background methods with scale void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect); void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, uint32 colorkey); + + // Blitting surface-to-menu methods void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y); void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, uint32 colorkey); + // Subtitles methods + + // Create subtitle area and return ID uint16 createSubArea(const Common::Rect &area); uint16 createSubArea(); + + // Delete subtitle by ID void deleteSubArea(uint16 id); void deleteSubArea(uint16 id, int16 delay); + + // Update subtitle area void updateSubArea(uint16 id, const Common::String &txt); + + // Processing subtitles void processSubs(uint16 deltatime); + + // Return background size Common::Point getBkgSize(); + // Return portion of background as new surface Graphics::Surface *getBkgRect(Common::Rect &rect); + + // Load image into new surface Graphics::Surface *loadImage(const char *file); Graphics::Surface *loadImage(Common::String &file); Graphics::Surface *loadImage(const char *file, bool transposed); Graphics::Surface *loadImage(Common::String &file, bool transposed); + // Clear whole/area of menu surface void clearMenuSurface(); void clearMenuSurface(const Common::Rect &r); + + // Copy menu buffer to screen void renderMenuToScreen(); + // Copy needed portion of background surface to workingWindow surface void prepareBkg(); /** @@ -275,17 +290,44 @@ public: * @param destination A reference to the Surface to store the pixel data in */ void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination); + + /** + * Reads an image file pixel data into a Surface buffer. In the process + * it converts the pixel data from RGB 555 to RGB 565. Also, if the image + * is transposed, it will un-transpose the pixel data. The function will + * call destination::create() if the dimensions of destination do not match + * up with the dimensions of the image. + * + * @param fileName The name of a .tga file + * @param destination A reference to the Surface to store the pixel data in + * @param transposed Transpose flag + */ void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination, bool transposed); + // Add visual effect to effects list void addEffect(Effect *_effect); + + // Delete effect(s) by ID (ID equal to slot of action:region that create this effect) void deleteEffect(uint32 ID); + + // Create "mask" for effects - (color +/- depth) will be selected as not transparent. Like color selection + // xy - base color + // depth - +/- of base color + // rect - rectangle where select pixels + // minD - if not NULL will recieve real bottom border of depth + // maxD - if not NULL will recieve real top border of depth EffectMap *makeEffectMap(const Common::Point &xy, int16 depth, const Common::Rect &rect, int8 *minD, int8 *maxD); + + // Create "mask" for effects by simple transparent color EffectMap *makeEffectMap(const Graphics::Surface &surf, uint16 transp); + // Return background rectangle in screen coordinates Common::Rect bkgRectToScreen(const Common::Rect &src); + // Mark whole background surface as dirty void markDirty(); + // Fille background surface by color void bkgFill(uint8 r, uint8 g, uint8 b); }; |