diff options
author | Filippos Karapetis | 2009-10-31 17:02:11 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-31 17:02:11 +0000 |
commit | 2b29b53b473af96e910066ce090e526dc0a5fb62 (patch) | |
tree | 20ebb85ed1f71dad04904ceb03b0a98ddf860197 /engines | |
parent | 6fd5fdcf7ba66daf6e1de53efe2197a75afcaada (diff) | |
download | scummvm-rg350-2b29b53b473af96e910066ce090e526dc0a5fb62.tar.gz scummvm-rg350-2b29b53b473af96e910066ce090e526dc0a5fb62.tar.bz2 scummvm-rg350-2b29b53b473af96e910066ce090e526dc0a5fb62.zip |
Slight optimization to the 2x scaler
svn-id: r45566
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gui/gui_screen.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index 5fe037dd42..b993684080 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -495,15 +495,16 @@ void SciGuiScreen::debugShowMap(int mapNo) { void SciGuiScreen::scale2x(byte *src, byte *dst, int16 srcWidth, int16 srcHeight) { int newWidth = srcWidth * 2; + byte *srcPtr = src; for (int y = 0; y < srcHeight; y++) { for (int x = 0; x < srcWidth; x++) { int destOffset = y * 2 * newWidth + x * 2; - int color = src[y * srcWidth + x]; - dst[destOffset] = color; - dst[destOffset + 1] = color; - dst[destOffset + newWidth] = color; - dst[destOffset + newWidth + 1] = color; + dst[destOffset] = *srcPtr; + dst[destOffset + 1] = *srcPtr; + dst[destOffset + newWidth] = *srcPtr; + dst[destOffset + newWidth + 1] = *srcPtr; + srcPtr++; } } } |