Minor speedup (*foo++, dammit!), some whitespace.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-12-21 16:08:56 +00:00
parent 825b02ad87
commit b5e93ffd6c

View file

@ -79,10 +79,9 @@ static inline byte *
blit_rgb (byte *buf, int count, byte red, byte green, byte blue)
{
while (count--) {
buf[0] = red;
buf[1] = green;
buf[2] = blue;
buf += 3;
*buf++ = red;
*buf++ = green;
*buf++ = blue;
}
return buf;
}
@ -91,11 +90,10 @@ static inline byte *
blit_rgba (byte *buf, int count, byte red, byte green, byte blue, byte alpha)
{
while (count--) {
buf[0] = red;
buf[1] = green;
buf[2] = blue;
buf[3] = alpha;
buf += 4;
*buf++ = red;
*buf++ = green;
*buf++ = blue;
*buf++ = alpha;
}
return buf;
}
@ -103,46 +101,42 @@ blit_rgba (byte *buf, int count, byte red, byte green, byte blue, byte alpha)
static inline byte *
read_bgr (byte *buf, int count, byte **data)
{
byte blue = (*data)[0];
byte green = (*data)[1];
byte red = (*data)[2];
byte blue = *(*data)++;
byte green = *(*data)++;
byte red = *(*data)++;
*data += 3;
return blit_rgb (buf, count, red, green, blue);
}
static inline byte *
read_rgb (byte *buf, int count, byte **data)
{
byte red = (*data)[0];
byte green = (*data)[1];
byte blue = (*data)[2];
byte red = *(*data)++;
byte green = *(*data)++;
byte blue = *(*data)++;
*data += 3;
return blit_rgb (buf, count, red, green, blue);
}
static inline byte *
read_bgra (byte *buf, int count, byte **data)
{
byte blue = (*data)[0];
byte green = (*data)[1];
byte red = (*data)[2];
byte alpha = (*data)[3];
byte blue = *(*data)++;
byte green = *(*data)++;
byte red = *(*data)++;
byte alpha = *(*data)++;
*data += 4;
return blit_rgba (buf, count, red, green, blue, alpha);
}
static inline byte *
read_rgba (byte *buf, int count, byte **data)
{
byte red = (*data)[0];
byte green = (*data)[1];
byte blue = (*data)[2];
byte alpha = (*data)[3];
byte red = *(*data)++;
byte green = *(*data)++;
byte blue = *(*data)++;
byte alpha = *(*data)++;
*data += 4;
return blit_rgba (buf, count, red, green, blue, alpha);
}
@ -261,7 +255,7 @@ LoadTGA (VFile *fin)
}
}
}
done:
done:;
}
Hunk_FreeToLowMark (targa_mark);