[Scummvm-cvs-logs] SF.net SVN: scummvm: [33062] scummvm/trunk/engines/agos/gfx.cpp
tramboi at users.sourceforge.net
tramboi at users.sourceforge.net
Mon Jul 14 22:34:31 CEST 2008
Revision: 33062
http://scummvm.svn.sourceforge.net/scummvm/?rev=33062&view=rev
Author: tramboi
Date: 2008-07-14 13:34:31 -0700 (Mon, 14 Jul 2008)
Log Message:
-----------
Register spilling avoided in AGOS background drawing (and 2x unrolling)
Modified Paths:
--------------
scummvm/trunk/engines/agos/gfx.cpp
Modified: scummvm/trunk/engines/agos/gfx.cpp
===================================================================
--- scummvm/trunk/engines/agos/gfx.cpp 2008-07-14 19:14:26 UTC (rev 33061)
+++ scummvm/trunk/engines/agos/gfx.cpp 2008-07-14 20:34:31 UTC (rev 33062)
@@ -744,10 +744,6 @@
}
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 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list