diff options
Diffstat (limited to 'engines/wintermute/graphics')
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.h | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index 9319899495..11aeb26821 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -29,11 +29,11 @@ namespace Wintermute { -byte *TransparentSurface::_lookup = NULL; +byte *TransparentSurface::_lookup = nullptr; void TransparentSurface::destroyLookup() { - delete _lookup; - _lookup = NULL; + delete[] _lookup; + _lookup = nullptr; } TransparentSurface::TransparentSurface() : Surface(), _enableAlphaBlit(true) {} @@ -219,8 +219,8 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p #endif Graphics::Surface *img; - Graphics::Surface *imgScaled = NULL; - byte *savedPixels = NULL; + Graphics::Surface *imgScaled = nullptr; + byte *savedPixels = nullptr; if ((width != srcImage.w) || (height != srcImage.h)) { // Scale the image img = imgScaled = srcImage.scale(width, height); @@ -394,6 +394,8 @@ TransparentSurface *TransparentSurface::scale(const Common::Rect &srcRect, const // dstRect(x, y) = srcRect(x * srcW / dstW, y * srcH / dstH); TransparentSurface *target = new TransparentSurface(); + assert(format.bytesPerPixel == 4); + int srcW = srcRect.width(); int srcH = srcRect.height(); int dstW = dstRect.width(); diff --git a/engines/wintermute/graphics/transparent_surface.h b/engines/wintermute/graphics/transparent_surface.h index 8b00dccbd9..dc079a1fbc 100644 --- a/engines/wintermute/graphics/transparent_surface.h +++ b/engines/wintermute/graphics/transparent_surface.h @@ -98,7 +98,7 @@ struct TransparentSurface : public Graphics::Surface { Common::Rect blit(Graphics::Surface &target, int posX = 0, int posY = 0, int flipping = FLIP_NONE, - Common::Rect *pPartRect = NULL, + Common::Rect *pPartRect = nullptr, 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); |