test/testshape.c
changeset 4817 c68e7490e4cf
parent 4816 eb433f0d2ac5
child 4837 2e446923c9fb
     1.1 --- a/test/testshape.c	Fri Jul 30 18:04:21 2010 -0400
     1.2 +++ b/test/testshape.c	Sun Aug 01 21:10:42 2010 -0400
     1.3 @@ -43,7 +43,7 @@
     1.4  	Uint8 num_pictures;
     1.5  	LoadedPicture* pictures;
     1.6  	int i, j;
     1.7 -	SDL_PixelFormat* format;
     1.8 +	SDL_PixelFormat* format = NULL;
     1.9  	Uint32 format_enum;
    1.10  	SDL_Window *window;
    1.11  	SDL_Color black = {0,0,0,0xff};
    1.12 @@ -52,8 +52,8 @@
    1.13  	int should_exit = 0;
    1.14  	unsigned int current_picture;
    1.15  	int button_down;
    1.16 -	Uint32 pixelFormat;
    1.17 -	int access;
    1.18 +	Uint32 pixelFormat = 0;
    1.19 +	int access = 0;
    1.20  	SDL_Rect texture_dimensions;;
    1.21  
    1.22  	if(argc < 2) {
    1.23 @@ -84,8 +84,7 @@
    1.24  		}
    1.25  
    1.26  		format = pictures[i].surface->format;
    1.27 -		format_enum = SDL_MasksToPixelFormatEnum (format->BitsPerPixel,format->Rmask,format->Gmask, format->Bmask,format->Amask);
    1.28 -		if(SDL_ISPIXELFORMAT_ALPHA(format_enum)) {
    1.29 +		if(format->Amask != 0) {
    1.30  			pictures[i].mode.mode = ShapeModeBinarizeAlpha;
    1.31  			pictures[i].mode.parameters.binarizationCutoff = 1;
    1.32  		}
    1.33 @@ -139,7 +138,6 @@
    1.34  	event_pending = SDL_PollEvent(&event);
    1.35  	current_picture = 0;
    1.36  	button_down = 0;
    1.37 -	format = 0,access = 0;
    1.38  	texture_dimensions.h = 0;
    1.39  	texture_dimensions.w = 0;
    1.40  	texture_dimensions.x = 0;