diff options
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/graphics.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 048d07241f..4d8a3b79a5 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1321,32 +1321,22 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp, byte byteVal; int xc = 0; - // Loop through sequences of bytes to skip or output while ((byteVal = *srcP) != 253) { ++srcP; int width = READ_LE_UINT16(srcP); + srcP += 2; - if (byteVal != 254) { - // Skip over output bytes - tempDestP += width; - xc += width; - } else { - // Output byte range - while (width-- > 0) { - // Get the next byte - byteVal = *spriteP; + if (byteVal == 254) { + // Copy pixel range + for (int xv = 0; xv < width; ++xv, ++xc, ++spriteP, ++tempDestP) { if (clip_y == 0 && xc >= clip_x && xc < clip_x1) - // Not clipped, so display it - *tempDestP = byteVal; - - // Move to next pixel - xc++; - ++srcP; - ++tempDestP; + *tempDestP = *spriteP; } + } else { + // Skip over bytes + tempDestP += width; + xc += width; } - - srcP += 2; } if (clip_y > 0) |