moo, pointers are cool

This commit is contained in:
codeimp 2008-09-28 22:34:09 +00:00
parent 1dad4b68c6
commit 10cf14540d

View file

@ -211,11 +211,11 @@ namespace CodeImp.DoomBuilder.Rendering
// This applies color-correction over a block of pixel data // This applies color-correction over a block of pixel data
internal unsafe void ApplColorCorrection(PixelColor* pixels, int numpixels) internal unsafe void ApplColorCorrection(PixelColor* pixels, int numpixels)
{ {
for(int i = 0; i < numpixels; i++) for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--)
{ {
pixels[i].r = correctiontable[pixels[i].r]; cp->r = correctiontable[cp->r];
pixels[i].g = correctiontable[pixels[i].g]; cp->g = correctiontable[cp->g];
pixels[i].b = correctiontable[pixels[i].b]; cp->b = correctiontable[cp->b];
} }
} }