GOB: use infix operator++ on Pixel iterators where possible

This commit is contained in:
Simon Delamarre 2022-10-29 00:43:38 +02:00 committed by Eugene Sandulenko
parent a2dbc6beba
commit eb61c14d5c
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
6 changed files with 10 additions and 10 deletions

View File

@ -1028,7 +1028,7 @@ void Draw_Fascination::drawWinTrace(int16 left, int16 top, int16 width, int16 he
Pixel pixelTop = _frontSurface->get(left, top);
Pixel pixelBottom = _frontSurface->get(left, bottom);
for (int16 i = 0; i < width; i++, pixelTop++, pixelBottom++) {
for (int16 i = 0; i < width; i++, ++pixelTop, ++pixelBottom) {
pixelTop.set((pixelTop.get() + 128) & 0xFF);
pixelBottom.set((pixelBottom.get() + 128) & 0xFF);
}

View File

@ -375,12 +375,12 @@ void Surface::blit(const Surface &from, int16 left, int16 top, int16 right, int1
if (yAxisReflection) {
srcRow += width - 1;
for (uint16 i = 0; i < width; i++, dstRow++, srcRow--)
for (uint16 i = 0; i < width; i++, ++dstRow, --srcRow)
if (srcRow.get() != ((uint32) transp))
dstRow.set(srcRow.get());
}
else {
for (uint16 i = 0; i < width; i++, dstRow++, srcRow++)
for (uint16 i = 0; i < width; i++, ++dstRow, ++srcRow)
if (srcRow.get() != ((uint32) transp))
dstRow.set(srcRow.get());
}

View File

@ -125,7 +125,7 @@ void Font::drawLetter(Surface &surf, uint8 c, uint16 x, uint16 y,
dst.set(color2);
}
dst++;
++dst;
data <<= 1;
}
@ -327,7 +327,7 @@ void Video::drawPacked(byte *sprBuf, int16 width, int16 height,
if (!transp || val)
dst.set(val);
dst++;
++dst;
curx++;
if (curx == destRight) {
dst += dest.getWidth() + x - curx;

View File

@ -84,7 +84,7 @@ char Video_v1::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
temp = *srcPtr++;
if ((temp != 0) || (transp == 0))
destPtr.set(temp);
destPtr++;
++destPtr;
curWidth++;
if (curWidth >= srcWidth) {
curWidth = 0;
@ -112,7 +112,7 @@ char Video_v1::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
temp = memBuffer[(offset + counter2) % 4096];
if ((temp != 0) || (transp == 0))
destPtr.set(temp);
destPtr++;
++destPtr;
curWidth++;
if (curWidth >= srcWidth) {

View File

@ -94,7 +94,7 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
if ((temp != 0) || (transp == 0))
destPtr.set(temp);
destPtr++;
++destPtr;
curWidth++;
if (curWidth >= srcWidth) {
@ -128,7 +128,7 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
if ((temp != 0) || (transp == 0))
destPtr.set(temp);
destPtr++;
++destPtr;
curWidth++;
if (curWidth >= srcWidth) {

View File

@ -124,7 +124,7 @@ void Video_v6::drawYUV(Surface &destDesc, int16 x, int16 y,
int nextChromaLine = (i < ((height - 1) & ~3) ) ? dataWidth : 0;
for (int j = 0; j < width; j++, dstRow++) {
for (int j = 0; j < width; j++, ++dstRow) {
int nextChromaColumn = (j < ((width - 1) & ~3)) ? 1 : 0;