mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 22:51:11 +00:00
GLK: LEVEL9: Allow for future graphic scaling
This commit is contained in:
parent
07c8437e26
commit
4332df2bda
@ -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;
|
||||
|
@ -2000,7 +2000,8 @@ static void gln_graphics_paint_everything(winid_t glk_window, Colour palette[],
|
||||
}
|
||||
}
|
||||
|
||||
g_vm->glk_image_draw(glk_window, s, (uint)-1, x_offset, y_offset);
|
||||
g_vm->glk_image_draw_scaled(glk_window, s, (uint)-1, x_offset, y_offset,
|
||||
width * GLN_GRAPHICS_PIXEL, height * GLN_GRAPHICS_PIXEL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user