Skip to content

Commit

Permalink
ACCESS: Manually implement ASurface::copyFrom for performance
Browse files Browse the repository at this point in the history
The original called Surface::copyFrom, which keeps recreating the
dest surface with each copy. This version simply copies the image
  • Loading branch information
dreammaster committed Dec 19, 2014
1 parent 95aa9a1 commit 93bbe3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engines/access/asurface.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 93bbe3a

Please sign in to comment.