aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/glk_api.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-10-24 22:31:04 -0700
committerPaul Gilbert2019-10-26 11:13:29 -0700
commit4332df2bda8d8f3942d81db3051f780d2f1bf02a (patch)
tree23783787748e81ad08e27df44480314d3e0c535a /engines/glk/glk_api.cpp
parent07c8437e268b12c0633495579f56c4e08e8ef7d2 (diff)
downloadscummvm-rg350-4332df2bda8d8f3942d81db3051f780d2f1bf02a.tar.gz
scummvm-rg350-4332df2bda8d8f3942d81db3051f780d2f1bf02a.tar.bz2
scummvm-rg350-4332df2bda8d8f3942d81db3051f780d2f1bf02a.zip
GLK: LEVEL9: Allow for future graphic scaling
Diffstat (limited to 'engines/glk/glk_api.cpp')
-rw-r--r--engines/glk/glk_api.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index 6d34e3a6e1..ba05988e86 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -930,15 +930,19 @@ bool GlkAPI::glk_image_draw_scaled(winid_t win, const Graphics::Surface &image,
if (!win) {
warning("image_draw_scaled: invalid ref");
} else if (g_conf->_graphics) {
- GraphicsWindow *gfxWin = dynamic_cast<GraphicsWindow *>(win);
+ if (image.w == width && image.h == height) {
+ return glk_image_draw(win, image, transColor, xp, yp);
- Graphics::ManagedSurface s(width, height);
- s.clear(transColor);
- s.transBlitFrom(image, Common::Rect(0, 0, image.w, image.h),
- Common::Rect(0, 0, width, height), transColor);
+ } else {
+ GraphicsWindow *gfxWin = dynamic_cast<GraphicsWindow *>(win);
- if (gfxWin)
- gfxWin->drawPicture(s, transColor, xp, yp, s.w, s.h);
+ Graphics::ManagedSurface s(width, height, image.format);
+ s.transBlitFrom(image, Common::Rect(0, 0, image.w, image.h),
+ Common::Rect(0, 0, width, height));
+
+ if (gfxWin)
+ gfxWin->drawPicture(s, transColor, xp, yp, s.w, s.h);
+ }
}
return true;