From 6262a2ac8751b1bfff7becc8cf181ab9dd16bf87 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 27 Jul 2012 17:43:17 +0200 Subject: WINTERMUTE: Use an arbitrary size nearest neighbour scaler for save thumbnails. Thanks to clone2727 --- engines/wintermute/base/gfx/base_image.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'engines/wintermute/base') diff --git a/engines/wintermute/base/gfx/base_image.cpp b/engines/wintermute/base/gfx/base_image.cpp index 628bffff55..3aa21d0f7f 100644 --- a/engines/wintermute/base/gfx/base_image.cpp +++ b/engines/wintermute/base/gfx/base_image.cpp @@ -224,27 +224,15 @@ bool BaseImage::writeBMPToStream(Common::WriteStream *stream) const { ////////////////////////////////////////////////////////////////////////// bool BaseImage::copyFrom(BaseImage *origImage, int newWidth, int newHeight) { -#if 0 - if (_bitmap) { - FreeImage_Unload(_bitmap); - } - - if (NewWidth == 0) { - NewWidth = FreeImage_GetWidth(OrigImage->GetBitmap()); - } - if (NewHeight == 0) { - NewHeight = FreeImage_GetHeight(OrigImage->GetBitmap()); - } + // WME Lite used FILTER_BILINEAR with FreeImage_Rescale here. - _bitmap = FreeImage_Rescale(OrigImage->GetBitmap(), NewWidth, NewHeight, FILTER_BILINEAR); -#endif TransparentSurface temp(*origImage->_surface, false); if (_deletableSurface) { _deletableSurface->free(); delete _deletableSurface; _deletableSurface = NULL; } - _surface = _deletableSurface = temp.scale(newWidth, newHeight); + _surface = _deletableSurface = temp.scaleSafe((uint16)newWidth, (uint16)newHeight); return true; } -- cgit v1.2.3