aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-31 17:02:11 +0000
committerFilippos Karapetis2009-10-31 17:02:11 +0000
commit2b29b53b473af96e910066ce090e526dc0a5fb62 (patch)
tree20ebb85ed1f71dad04904ceb03b0a98ddf860197 /engines
parent6fd5fdcf7ba66daf6e1de53efe2197a75afcaada (diff)
downloadscummvm-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.cpp11
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++;
}
}
}