comparison src/video/SDL_shape.c @ 4846:4f1573996a65

Fixed a bug in X11 shaping that refused to use color-key mode.
author Eli Gottlieb <eligottlieb@gmail.com>
date Tue, 10 Aug 2010 16:10:26 -0400
parents 0998d1b5dd23
children 4201864f77e7 40b46225e3cf
comparison
equal deleted inserted replaced
4845:61cb2d20a46f 4846:4f1573996a65
102 case(ShapeModeReverseBinarizeAlpha): 102 case(ShapeModeReverseBinarizeAlpha):
103 mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0); 103 mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0);
104 break; 104 break;
105 case(ShapeModeColorKey): 105 case(ShapeModeColorKey):
106 key = mode.parameters.colorKey; 106 key = mode.parameters.colorKey;
107 mask_value = ((key.r != r && key.g != g && key.b != b) ? 1 : 0); 107 mask_value = ((key.r != r || key.g != g || key.b != b) ? 1 : 0);
108 break; 108 break;
109 } 109 }
110 bitmap[bitmap_pixel / ppb] |= mask_value << (7 - ((ppb - 1) - (bitmap_pixel % ppb))); 110 bitmap[bitmap_pixel / ppb] |= mask_value << (7 - ((ppb - 1) - (bitmap_pixel % ppb)));
111 } 111 }
112 } 112 }
235 //Invalid shape argument. 235 //Invalid shape argument.
236 return SDL_INVALID_SHAPE_ARGUMENT; 236 return SDL_INVALID_SHAPE_ARGUMENT;
237 237
238 if(shapeMode != NULL) 238 if(shapeMode != NULL)
239 window->shaper->mode = *shapeMode; 239 window->shaper->mode = *shapeMode;
240 //TODO: Platform-specific implementations of SetWindowShape. X11 is finished. Win32 is finished. Debugging is in progress on both.
241 result = window->display->device->shape_driver.SetWindowShape(window->shaper,shape,shapeMode); 240 result = window->display->device->shape_driver.SetWindowShape(window->shaper,shape,shapeMode);
242 window->shaper->hasshape = SDL_TRUE; 241 window->shaper->hasshape = SDL_TRUE;
243 if((window->shaper->usershownflag & SDL_WINDOW_SHOWN) == SDL_WINDOW_SHOWN) { 242 if((window->shaper->usershownflag & SDL_WINDOW_SHOWN) == SDL_WINDOW_SHOWN) {
244 SDL_ShowWindow(window); 243 SDL_ShowWindow(window);
245 window->shaper->usershownflag &= !SDL_WINDOW_SHOWN; 244 window->shaper->usershownflag &= !SDL_WINDOW_SHOWN;