src/video/cocoa/SDL_cocoavideo.m
changeset 6028 869b6723e1fc
parent 5865 40dfc30cea83
child 6044 35448a5ea044
equal deleted inserted replaced
6027:56185b574d61 6028:869b6723e1fc
   191     pixels = [imgrep bitmapData];
   191     pixels = [imgrep bitmapData];
   192     SDL_memcpy(pixels, converted->pixels, converted->h * converted->pitch);
   192     SDL_memcpy(pixels, converted->pixels, converted->h * converted->pitch);
   193     SDL_FreeSurface(converted);
   193     SDL_FreeSurface(converted);
   194 
   194 
   195     /* Premultiply the alpha channel */
   195     /* Premultiply the alpha channel */
   196     for (i = (converted->h * converted->w); i--; ) {
   196     for (i = (surface->h * surface->w); i--; ) {
   197         Uint8 alpha = pixels[3];
   197         Uint8 alpha = pixels[3];
   198         pixels[0] = (Uint8)(((Uint16)pixels[0] * alpha) / 255);
   198         pixels[0] = (Uint8)(((Uint16)pixels[0] * alpha) / 255);
   199         pixels[1] = (Uint8)(((Uint16)pixels[1] * alpha) / 255);
   199         pixels[1] = (Uint8)(((Uint16)pixels[1] * alpha) / 255);
   200         pixels[2] = (Uint8)(((Uint16)pixels[2] * alpha) / 255);
   200         pixels[2] = (Uint8)(((Uint16)pixels[2] * alpha) / 255);
   201         pixels += 4;
   201         pixels += 4;