aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2008-07-14 20:34:31 +0000
committerBertrand Augereau2008-07-14 20:34:31 +0000
commit9c91f091ff7a389da31534bce99908ba4e856163 (patch)
tree4a25e2fcaf144683d9f3ffd86a8623411861c96b /engines
parentc25c406c00175155f635aa1e1d37adb5e37cdb4c (diff)
downloadscummvm-rg350-9c91f091ff7a389da31534bce99908ba4e856163.tar.gz
scummvm-rg350-9c91f091ff7a389da31534bce99908ba4e856163.tar.bz2
scummvm-rg350-9c91f091ff7a389da31534bce99908ba4e856163.zip
Register spilling avoided in AGOS background drawing (and 2x unrolling)
svn-id: r33062
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/gfx.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index c014413bdc..2d7d6641dc 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -744,10 +744,6 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) {
}
void AGOSEngine::drawBackGroundImage(VC10_state *state) {
- const byte *src;
- byte *dst;
- uint h, i;
-
state->width = _screenWidth;
if (_window3Flag == 1) {
state->width = 0;
@@ -755,15 +751,19 @@ void AGOSEngine::drawBackGroundImage(VC10_state *state) {
state->y_skip = 0;
}
- src = state->srcPtr + (state->width * state->y_skip) + (state->x_skip * 8);
- dst = state->surf_addr;
+ const byte* src = state->srcPtr + (state->width * state->y_skip) + (state->x_skip * 8);
+ byte* dst = state->surf_addr;
state->draw_width *= 2;
- h = state->draw_height;
+ uint h = state->draw_height;
+ const uint w = state->draw_width;
+ const byte paletteMod = state->paletteMod;
do {
- for (i = 0; i != state->draw_width; i++)
- dst[i] = src[i] + state->paletteMod;
+ for (uint i = 0; i != w; i+=2) {
+ dst[i] = src[i] + paletteMod;
+ dst[i+1] = src[i+1] + paletteMod;
+ }
dst += state->surf_pitch;
src += state->width;
} while (--h);