diff options
author | Eugene Sandulenko | 2010-06-15 10:17:34 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-06-15 10:17:34 +0000 |
commit | c933bec975e7d8e176884312a257472a6358fea1 (patch) | |
tree | aacb1fc48cfda70b6918b0c2362dd6cc96270908 /engines/drascula/graphics.cpp | |
parent | d577d863ce4cee58b973e3a1cb461ad339e91c61 (diff) | |
download | scummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.tar.gz scummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.tar.bz2 scummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.zip |
Drascula: Optimized blitting code.
svn-id: r49700
Diffstat (limited to 'engines/drascula/graphics.cpp')
-rw-r--r-- | engines/drascula/graphics.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 00399816da..03c866857f 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -190,10 +190,16 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width, dest += xdes + ydes * 320; src += xorg + yorg * 320; - for (y = 0; y < height; y++) - for (x = 0; x < width; x++) - if (src[x + y * 320] != 255) - dest[x + y * 320] = src[x + y * 320]; + int ptr = 0; + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + if (src[ptr] != 255) + dest[ptr] = src[ptr]; + ptr++; + } + ptr += 320 - width; + } + } void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer) { |