diff options
author | Filippos Karapetis | 2011-01-30 20:36:17 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-01-30 20:36:17 +0000 |
commit | 9d6e398e74348d397e99915b20d96cd06e69ed15 (patch) | |
tree | ef408ac40a76f8d25db3097d56192d2592faa2d0 /engines/sword25/gfx/image | |
parent | 2e42c2d11d27ae51431a7c287fab061fca38e23c (diff) | |
download | scummvm-rg350-9d6e398e74348d397e99915b20d96cd06e69ed15.tar.gz scummvm-rg350-9d6e398e74348d397e99915b20d96cd06e69ed15.tar.bz2 scummvm-rg350-9d6e398e74348d397e99915b20d96cd06e69ed15.zip |
SWORD25: Added alternative code for video frame blitting (currently disabled)
svn-id: r55664
Diffstat (limited to 'engines/sword25/gfx/image')
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.cpp | 24 | ||||
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.h | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index d4f493d43c..0d2ffb5aee 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -337,6 +337,30 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe return true; } +void RenderedImage::copyDirectly(int posX, int posY) { + byte *data = _data; + int w = _width; + int h = _height; + + // Handle off-screen clipping + if (posY < 0) { + h = MAX(0, (int)_height - -posY); + data = (byte *)_data + _width * -posY; + posY = 0; + } + + if (posX < 0) { + w = MAX(0, (int)_width - -posX); + data = (byte *)_data + (-posX * 4); + posX = 0; + } + + w = CLIP((int)w, 0, (int)MAX((int)_backSurface->w - posX, 0)); + h = CLIP((int)h, 0, (int)MAX((int)_backSurface->h - posY, 0)); + + g_system->copyRectToScreen(data, _backSurface->pitch, posX, posY, w, h); +} + /** * Scales a passed surface, creating a new surface with the result * @param srcImage Source image to scale diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h index a9f2f1823c..0375c7acbe 100644 --- a/engines/sword25/gfx/image/renderedimage.h +++ b/engines/sword25/gfx/image/renderedimage.h @@ -72,6 +72,8 @@ public: return GraphicEngine::CF_ARGB32; } + void copyDirectly(int posX, int posY); + virtual bool blit(int posX = 0, int posY = 0, int flipping = Image::FLIP_NONE, Common::Rect *pPartRect = NULL, @@ -105,6 +107,7 @@ public: } static Graphics::Surface *scale(const Graphics::Surface &srcImage, int xSize, int ySize); + private: byte *_data; int _width; |