diff options
author | Tobia Tesan | 2013-06-27 16:27:51 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-07-31 23:58:23 +0200 |
commit | 384dd8da7ef8cc7660607301c36b52645942faf0 (patch) | |
tree | c6068a38ff5217f8fb210a781cb6b7bb363d387d /engines/wintermute/graphics/transparent_surface.h | |
parent | 66ba2ea4558bab4583a7d7bb27e1e254c34f579f (diff) | |
download | scummvm-rg350-384dd8da7ef8cc7660607301c36b52645942faf0.tar.gz scummvm-rg350-384dd8da7ef8cc7660607301c36b52645942faf0.tar.bz2 scummvm-rg350-384dd8da7ef8cc7660607301c36b52645942faf0.zip |
WINTERMUTE: Bilinear scaling.
Refactor scale(), factor out actual mapping algorithm, add bilinear
scaling
Diffstat (limited to 'engines/wintermute/graphics/transparent_surface.h')
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.h | 12 |
1 files changed, 9 insertions, 3 deletions
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: |