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
This commit is contained in:
Paul Gilbert 2014-12-18 21:52:59 -05:00
parent 95aa9a13a6
commit 93bbe3a45e

View File

@ -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) {