From 93bbe3a45e4d9a6542b93ec9747bc0c6031054ae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 18 Dec 2014 21:52:59 -0500 Subject: [PATCH] ACCESS: Manually implement ASurface::copyFrom for performance The original called Surface::copyFrom, which keeps recreating the dest surface with each copy. This version simply copies the image --- engines/access/asurface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 27e73a06400f..38af7add0051 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -252,7 +252,11 @@ void ASurface::transCopyFrom(ASurface &src) { } void ASurface::copyFrom(Graphics::Surface &src) { - Graphics::Surface::copyFrom(src); + for (int y = 0; y < src.h; ++y) { + const byte *srcP = (const byte *)src.getBasePtr(0, y); + byte *destP = (byte *)getBasePtr(0, y); + Common::copy(srcP, srcP + src.w, destP); + } } void ASurface::copyBuffer(Graphics::Surface *src) {