aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/graphics/render_manager.cpp
diff options
context:
space:
mode:
authorMarisa-Chan2014-08-27 14:57:35 +0700
committerMarisa-Chan2014-08-27 14:57:35 +0700
commit21d6fddab43ff4adbd8c8b3d10b110576c197108 (patch)
treec90ecc7de8ce1afb4480f65156675d4417d889e3 /engines/zvision/graphics/render_manager.cpp
parent2cfef440d7a9d3f50ebddd3e662175c0e0bd4e94 (diff)
downloadscummvm-rg350-21d6fddab43ff4adbd8c8b3d10b110576c197108.tar.gz
scummvm-rg350-21d6fddab43ff4adbd8c8b3d10b110576c197108.tar.bz2
scummvm-rg350-21d6fddab43ff4adbd8c8b3d10b110576c197108.zip
ZVISION: Added scaled blitter to bkg
Diffstat (limited to 'engines/zvision/graphics/render_manager.cpp')
-rw-r--r--engines/zvision/graphics/render_manager.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index c89444df13..5aa0d752d0 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -565,6 +565,32 @@ void RenderManager::blitSurfaceToBkg(const Graphics::Surface &src, int x, int y,
_bkgDirtyRect.extend(dirty);
}
+void RenderManager::blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect) {
+ if (src.w == _dstRect.width() && src.h == _dstRect.height())
+ blitSurfaceToBkg(src, _dstRect.left, _dstRect.top);
+ else {
+ Graphics::Surface *tmp = new Graphics::Surface;
+ tmp->create(_dstRect.width(), _dstRect.height(), src.format);
+ scaleBuffer(src.getPixels(), tmp->getPixels(), src.w, src.h, src.format.bytesPerPixel, _dstRect.width(), _dstRect.height());
+ blitSurfaceToBkg(*tmp, _dstRect.left, _dstRect.top);
+ tmp->free();
+ delete tmp;
+ }
+}
+
+void RenderManager::blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, uint32 colorkey) {
+ if (src.w == _dstRect.width() && src.h == _dstRect.height())
+ blitSurfaceToBkg(src, _dstRect.left, _dstRect.top, colorkey);
+ else {
+ Graphics::Surface *tmp = new Graphics::Surface;
+ tmp->create(_dstRect.width(), _dstRect.height(), src.format);
+ scaleBuffer(src.getPixels(), tmp->getPixels(), src.w, src.h, src.format.bytesPerPixel, _dstRect.width(), _dstRect.height());
+ blitSurfaceToBkg(*tmp, _dstRect.left, _dstRect.top, colorkey);
+ tmp->free();
+ delete tmp;
+ }
+}
+
void RenderManager::blitSurfaceToMenu(const Graphics::Surface &src, int x, int y) {
Common::Rect empt;
blitSurfaceToSurface(src, empt, _menuWnd, x, y);