diff options
Diffstat (limited to 'sword2/driver/render.cpp')
-rw-r--r-- | sword2/driver/render.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index 7e05fa9919..5252453004 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -821,9 +821,8 @@ void Graphics::closeBackgroundLayer(void) { } -void Graphics::plotYUV(unsigned char * lut, int width, int height, uint8_t * const * dat) -{ - uint8 *buf = _buffer + (40+(400-height)/2) * RENDERWIDE + (640-width)/2; +void Graphics::plotYUV(byte *lut, int width, int height, byte *const *dat) { + byte *buf = _buffer + (40 + (400 - height) / 2) * RENDERWIDE + (640 - width) / 2; int x, y; @@ -831,17 +830,17 @@ void Graphics::plotYUV(unsigned char * lut, int width, int height, uint8_t * con int cpos = 0; int linepos = 0; - for (y = 0; y < height; y+=2) { - for (x = 0; x < width; x+=2) { - int i = ((((dat[2][cpos]+ROUNDADD)>>SHIFT) * BITDEPTH) + ((dat[1][cpos]+ROUNDADD)>>SHIFT)) * BITDEPTH; + for (y = 0; y < height; y += 2) { + for (x = 0; x < width; x += 2) { + int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * BITDEPTH) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * BITDEPTH; cpos++; - buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)]; - buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)]; - buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)]; - buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)]; + buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)]; + buf[RENDERWIDE + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)]; + buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)]; + buf[RENDERWIDE + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)]; } - linepos += (2*RENDERWIDE-width); + linepos += (2 * RENDERWIDE - width); ypos += width; } } |