diff options
author | Eugene Sandulenko | 2016-02-09 10:11:45 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:13:05 +0100 |
commit | a31cfff9d6da18a219ec6861755219f92bc5427b (patch) | |
tree | ebe5d4690573a67d65862f734c4decf81f57c956 /engines | |
parent | 7dd3874a4379e0f7a52c392f09e6816a9f9303c8 (diff) | |
download | scummvm-rg350-a31cfff9d6da18a219ec6861755219f92bc5427b.tar.gz scummvm-rg350-a31cfff9d6da18a219ec6861755219f92bc5427b.tar.bz2 scummvm-rg350-a31cfff9d6da18a219ec6861755219f92bc5427b.zip |
WAGE: Let compiler optimize %8's
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/design.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 2acd872812..63721f68ae 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -184,8 +184,10 @@ void drawPixel(int x, int y, int color, void *data) { if (p->thickness == 1) { if (x >= 0 && x < p->surface->w && y >= 0 && y < p->surface->h) { - *((byte *)p->surface->getBasePtr(x, y)) = - (pat[y % 8] & (1 << (7 - x % 8))) ? + uint xu = (uint)x; // for letting compiler optimize it + uint yu = (uint)y; + *((byte *)p->surface->getBasePtr(xu, yu)) = + (pat[yu % 8] & (1 << (7 - xu % 8))) ? color : kColorWhite; } } else { @@ -196,10 +198,13 @@ void drawPixel(int x, int y, int color, void *data) { for (y = y1; y < y2; y++) for (x = x1; x < x2; x++) - if (x >= 0 && x < p->surface->w && y >= 0 && y < p->surface->h) - *((byte *)p->surface->getBasePtr(x, y)) = - (pat[y % 8] & (1 << (7 - x % 8))) ? + if (x >= 0 && x < p->surface->w && y >= 0 && y < p->surface->h) { + uint xu = (uint)x; // for letting compiler optimize it + uint yu = (uint)y; + *((byte *)p->surface->getBasePtr(xu, yu)) = + (pat[yu % 8] & (1 << (7 - xu % 8))) ? color : kColorWhite; + } } } |