From 2b29b53b473af96e910066ce090e526dc0a5fb62 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 31 Oct 2009 17:02:11 +0000 Subject: Slight optimization to the 2x scaler svn-id: r45566 --- engines/sci/gui/gui_screen.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'engines') 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++; } } } -- cgit v1.2.3