From 384dd8da7ef8cc7660607301c36b52645942faf0 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Thu, 27 Jun 2013 16:27:51 +0200 Subject: WINTERMUTE: Bilinear scaling. Refactor scale(), factor out actual mapping algorithm, add bilinear scaling --- engines/wintermute/graphics/transparent_surface.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'engines/wintermute/graphics/transparent_surface.h') diff --git a/engines/wintermute/graphics/transparent_surface.h b/engines/wintermute/graphics/transparent_surface.h index dc079a1fbc..0f48054d7c 100644 --- a/engines/wintermute/graphics/transparent_surface.h +++ b/engines/wintermute/graphics/transparent_surface.h @@ -24,6 +24,10 @@ #include "graphics/surface.h" + +#define FAST_TRANSFORM 0 + + /* * This code is based on Broken Sword 2.5 engine * @@ -49,6 +53,9 @@ struct TransparentSurface : public Graphics::Surface { void setColorKey(char r, char g, char b); void disableColorKey(); + static void bilinearCopy(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst); + static void nearestCopy(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst); + // Enums /** @brief The possible flipping parameters for the blit methode. @@ -102,9 +109,8 @@ struct TransparentSurface : public Graphics::Surface { uint color = BS_ARGB(255, 255, 255, 255), int width = -1, int height = -1); void applyColorKey(uint8 r, uint8 g, uint8 b, bool overwriteAlpha = false); - // The following scale-code supports arbitrary scaling (i.e. no repeats of column 0 at the end of lines) - TransparentSurface *scale(uint16 newWidth, uint16 newHeight) const; - TransparentSurface *scale(const Common::Rect &srcRect, const Common::Rect &dstRect) const; + + TransparentSurface *scale (uint16 newWidth, uint16 newHeight) const; static byte *_lookup; static void destroyLookup(); private: -- cgit v1.2.3