aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:17:34 +0000
committerEugene Sandulenko2010-06-15 10:17:34 +0000
commitc933bec975e7d8e176884312a257472a6358fea1 (patch)
treeaacb1fc48cfda70b6918b0c2362dd6cc96270908
parentd577d863ce4cee58b973e3a1cb461ad339e91c61 (diff)
downloadscummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.tar.gz
scummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.tar.bz2
scummvm-rg350-c933bec975e7d8e176884312a257472a6358fea1.zip
Drascula: Optimized blitting code.
svn-id: r49700
-rw-r--r--engines/drascula/graphics.cpp14
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) {