aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index 9ec8573a87..73797f20f3 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -447,8 +447,14 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, Rect32 *newRect,
bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {
_loaded = true;
- _surface->free();
- _surface->copyFrom(surface);
+ if (surface.format == _surface->format && surface.w == _surface->w && surface.h == _surface->h) {
+ const byte *src = (const byte*) surface.getBasePtr(0, 0);
+ byte *dst = (byte*) _surface->getBasePtr(0, 0);
+ memcpy(dst, src, surface.pitch * surface.h);
+ } else {
+ _surface->free();
+ _surface->copyFrom(surface);
+ }
if (hasAlpha) {
_alphaType = TransparentSurface::ALPHA_FULL;
} else {