aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/image/renderedimage.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-01-30 20:36:17 +0000
committerFilippos Karapetis2011-01-30 20:36:17 +0000
commit9d6e398e74348d397e99915b20d96cd06e69ed15 (patch)
treeef408ac40a76f8d25db3097d56192d2592faa2d0 /engines/sword25/gfx/image/renderedimage.cpp
parent2e42c2d11d27ae51431a7c287fab061fca38e23c (diff)
downloadscummvm-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/renderedimage.cpp')
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp24
1 files changed, 24 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