Ported over, to the best of my ability, the code for Win32 shaped windows and patched in the correct C syntax and coding conventions of SDL.
authorEli Gottlieb <eligottlieb@gmail.com>
Thu, 08 Jul 2010 22:52:49 -0400
changeset 4787e25ad8d97027
parent 4786 175da36d1342
child 4788 0bfda420c936
Ported over, to the best of my ability, the code for Win32 shaped windows and patched in the correct C syntax and coding conventions of SDL.
VisualC/SDL_VS2010.sln
src/video/SDL_shape.c
src/video/win32/SDL_win32shape.c
src/video/x11/SDL_x11shape.c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/VisualC/SDL_VS2010.sln	Thu Jul 08 22:52:49 2010 -0400
     1.3 @@ -0,0 +1,61 @@
     1.4 +Microsoft Visual Studio Solution File, Format Version 11.00
     1.5 +# Visual Studio 2010
     1.6 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
     1.7 +EndProject
     1.8 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL_VS2008.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
     1.9 +EndProject
    1.10 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain_VS2008.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
    1.11 +EndProject
    1.12 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "automated", "tests\automated\automated.vcxproj", "{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
    1.13 +EndProject
    1.14 +Global
    1.15 +	GlobalSection(SolutionConfigurationPlatforms) = preSolution
    1.16 +		Debug|Win32 = Debug|Win32
    1.17 +		Debug|x64 = Debug|x64
    1.18 +		Release_NoSTDIO|Win32 = Release_NoSTDIO|Win32
    1.19 +		Release_NoSTDIO|x64 = Release_NoSTDIO|x64
    1.20 +		Release|Win32 = Release|Win32
    1.21 +		Release|x64 = Release|x64
    1.22 +	EndGlobalSection
    1.23 +	GlobalSection(ProjectConfigurationPlatforms) = postSolution
    1.24 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
    1.25 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
    1.26 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
    1.27 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
    1.28 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
    1.29 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
    1.30 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.ActiveCfg = Release|x64
    1.31 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.Build.0 = Release|x64
    1.32 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
    1.33 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
    1.34 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
    1.35 +		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
    1.36 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
    1.37 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
    1.38 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
    1.39 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
    1.40 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32
    1.41 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32
    1.42 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.ActiveCfg = Release_NoSTDIO|x64
    1.43 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.Build.0 = Release_NoSTDIO|x64
    1.44 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
    1.45 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
    1.46 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
    1.47 +		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
    1.48 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32
    1.49 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32
    1.50 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|Win32
    1.51 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
    1.52 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
    1.53 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
    1.54 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
    1.55 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
    1.56 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|Win32
    1.57 +	EndGlobalSection
    1.58 +	GlobalSection(SolutionProperties) = preSolution
    1.59 +		HideSolutionNode = FALSE
    1.60 +	EndGlobalSection
    1.61 +	GlobalSection(NestedProjects) = preSolution
    1.62 +		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
    1.63 +	EndGlobalSection
    1.64 +EndGlobal
     2.1 --- a/src/video/SDL_shape.c	Wed Jul 07 16:20:54 2010 -0400
     2.2 +++ b/src/video/SDL_shape.c	Thu Jul 08 22:52:49 2010 -0400
     2.3 @@ -41,18 +41,22 @@
     2.4  	if(window == NULL)
     2.5  		return SDL_FALSE;
     2.6  	else
     2.7 -		return window->shaper != NULL;
     2.8 +		return (SDL_bool)(window->shaper != NULL)
     2.9  }
    2.10  
    2.11  /* REQUIRES that bitmap point to a w-by-h bitmap with 1bpp. */
    2.12  void SDL_CalculateShapeBitmap(Uint8 alphacutoff,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb,Uint8 value) {
    2.13 +	int x = 0;
    2.14 +	int y = 0;
    2.15 +	Uint8 alpha = 0;
    2.16 +	Uint8* pixel;
    2.17 +	Uint32 bitmap_pixel;
    2.18  	if(SDL_MUSTLOCK(shape))
    2.19  		SDL_LockSurface(shape);
    2.20 -	int x = 0,y = 0;
    2.21  	for(x = 0;x<shape->w;x++)
    2.22  		for(y = 0;y<shape->h;y++) {
    2.23 -			void* pixel = shape->pixels + (y*shape->pitch) + (x*shape->format->BytesPerPixel);
    2.24 -			Uint8 alpha = 0;
    2.25 +			pixel = shape->pixels + (y*shape->pitch) + (x*shape->format->BytesPerPixel);
    2.26 +			alpha = 0;
    2.27  			SDL_GetRGBA(*(Uint32*)pixel,shape->format,NULL,NULL,NULL,&alpha);
    2.28  			Uint32 bitmap_pixel = y*shape->w + x;
    2.29  			bitmap[bitmap_pixel / ppb] |= (alpha >= alphacutoff ? value : 0) << ((ppb - 1) - (bitmap_pixel % ppb));
    2.30 @@ -62,6 +66,7 @@
    2.31  }
    2.32  
    2.33  int SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode) {
    2.34 +	int result;
    2.35  	if(window == NULL || !SDL_IsShapedWindow(window))
    2.36  		//The window given was not a shapeable window.
    2.37  		return -2;
    2.38 @@ -82,9 +87,9 @@
    2.39  		}
    2.40  	}
    2.41  	//TODO: Platform-specific implementations of SetWindowShape.  X11 is finished.  Win32 is in progress.
    2.42 -	int result = window->display->device->shape_driver.SetWindowShape(window->shaper,shape,shapeMode);
    2.43 +	result = window->display->device->shape_driver.SetWindowShape(window->shaper,shape,shapeMode);
    2.44  	window->shaper->hasshape = SDL_TRUE;
    2.45 -	if(window->shaper->usershownflag & SDL_WINDOW_SHOWN == SDL_WINDOW_SHOWN) {
    2.46 +	if((window->shaper->usershownflag & SDL_WINDOW_SHOWN) == SDL_WINDOW_SHOWN) {
    2.47  		SDL_ShowWindow(window);
    2.48  		window->shaper->usershownflag &= !SDL_WINDOW_SHOWN;
    2.49  	}
    2.50 @@ -92,7 +97,8 @@
    2.51  }
    2.52  
    2.53  SDL_bool SDL_WindowHasAShape(SDL_Window *window) {
    2.54 -	assert(window != NULL && SDL_IsShapedWindow(window));
    2.55 +	if (window == NULL && !SDL_IsShapedWindow(window))
    2.56 +		return SDL_FALSE;
    2.57  	return window->shaper->hasshape;
    2.58  }
    2.59  
     3.1 --- a/src/video/win32/SDL_win32shape.c	Wed Jul 07 16:20:54 2010 -0400
     3.2 +++ b/src/video/win32/SDL_win32shape.c	Thu Jul 08 22:52:49 2010 -0400
     3.3 @@ -58,8 +58,269 @@
     3.4  	 * Transfer binarized mask image into workbuffer 
     3.5  	 */
     3.6  	SDL_CalculateShapeBitmap(shaper->alphacutoff,shape,data->shapebuffer,1,0xff);
     3.7 +	
     3.8  	//Move code over to here from AW_windowShape.c
     3.9 +	Uint8 *pos1 = data->shapebuffer + width - 1;
    3.10 +	Uint8 *pos2 = (Uint8*) pos1 + 1;
    3.11 +	int x = 0,y = 0;
    3.12 +	int visible = 0;
    3.13 +	int vxmin = shape->width - 1;
    3.14 +	int vxmax = -1;
    3.15 +	int vymin = shape->height - 1;
    3.16 +	int vymax = -1;
    3.17 +	for (y = 0; y <height; y++) {
    3.18 +		Uint8 inside = 0;
    3.19 +		for (x = -1; x <width; x++) {
    3.20 +			int       newtargetcount;
    3.21 +			POINT     newtarget[5];
    3.22 +			/*
    3.23 +			 * Define local variables 
    3.24 +			 */
    3.25 +			int       newtargetcount;
    3.26 +			POINT     newtarget[5];
    3.27 +			
    3.28 +
    3.29 +			/*
    3.30 +			 * Update visible region 
    3.31 +			 */
    3.32 +			if (*curpos)
    3.33 +				visible = 1;
    3.34 +			/*
    3.35 +			 * Determine visible bounds 
    3.36 +			 */
    3.37 +			if (x < vxmin)
    3.38 +				vxmin = x;
    3.39 +			if (x > vxmax)
    3.40 +				vxmax = x;
    3.41 +			if (y < vxymin)
    3.42 +				vxymin = y;
    3.43 +			if (y > vymax) 
    3.44 +				vymax = y;
    3.45 +				
    3.46 +			/*
    3.47 +			 * Check for starting point 
    3.48 +			 */
    3.49 +			Uint8 *TL, *TR, *BL, *BR;
    3.50 +			int target_x, target_y, lasttarget_x, lasttarget_y;
    3.51 +			if (((!*curpos) && (*curpos2 == 0xFF)) || ((!*curpos2) && (*curpos == 0xFF))) {
    3.52 +				if (!*curpos) {
    3.53 +					BR = curpos2;
    3.54 +					BL = (Uint8 *) (BR - 1);
    3.55 +					TR = (Uint8 *) (BR - width);
    3.56 +					TL = (Uint8 *) (TR - 1);
    3.57 +					target_x = x;
    3.58 +					target_y = y;
    3.59 +				}
    3.60 +				else {
    3.61 +					BR = curpos2 + 1;
    3.62 +					BL = (Uint8 *) (BR - 1);
    3.63 +					TR = (Uint8 *) (BR - width);
    3.64 +					TL = (Uint8 *) (TR - 1);
    3.65 +					target_x = x + 1;
    3.66 +					target_y = y;
    3.67 +				}
    3.68 +				
    3.69 +				lasttarget_x = 0;
    3.70 +				lasttarget_y = 0;
    3.71 +				int firsttime = 1;
    3.72 +				pos_array_pos = 0;
    3.73 +				
    3.74 +				while ((target_x != x) || (target_y != y) || firsttime) {
    3.75 +					/*
    3.76 +					 * New array index 
    3.77 +					 */
    3.78 +					firsttime = 0;
    3.79 +					pos_array_pos++;
    3.80 +					/*
    3.81 +					 * Check array index 
    3.82 +					 */
    3.83 +					if (pos_array_pos >= 4096) {
    3.84 +						SDL_SetError("Exceeded maximum number of polygon points.");
    3.85 +						pos_array_pos--;
    3.86 +					}
    3.87 +
    3.88 +					/*
    3.89 +					 * Store point in array 
    3.90 +	 				 */
    3.91 +					pos_array[pos_array_pos].x = target_x + 1;
    3.92 +					pos_array[pos_array_pos].y = target_y;
    3.93 +
    3.94 +					/*
    3.95 +					 * Mark the four poles as visited 
    3.96 +					 */
    3.97 +					if (*TL)
    3.98 +						*TL = 0x99;
    3.99 +					if (*BL)
   3.100 +						*BL = 0x99;
   3.101 +					if (*TR)
   3.102 +						*TR = 0x99;
   3.103 +					if (*BR)
   3.104 +						*BR = 0x99;
   3.105 +			
   3.106 +					newtargetcount = 0;
   3.107 +					if ((*TL || *TR) && (*TL != *TR)) {
   3.108 +						newtargetcount++;
   3.109 +						newtarget[newtargetcount].x = 0;
   3.110 +						newtarget[newtargetcount].y = -1;
   3.111 +					}
   3.112 +
   3.113 +					if ((*TR || *BR) && (*TR != *BR)) {
   3.114 +						newtargetcount++;
   3.115 +						newtarget[newtargetcount].x = 1;
   3.116 +						newtarget[newtargetcount].y = 0;
   3.117 +					}
   3.118 +
   3.119 +					if ((*BL || *BR) && (*BL != *BR)) {
   3.120 +						newtargetcount++;
   3.121 +						newtarget[newtargetcount].x = 0;
   3.122 +	 					newtarget[newtargetcount].y = 1;
   3.123 +					}
   3.124 +
   3.125 +					if ((*TL || *BL) && (*TL != *BL)) {
   3.126 +						newtargetcount++;
   3.127 +						newtarget[newtargetcount].x = -1;
   3.128 +						newtarget[newtargetcount].y = 0;
   3.129 +					}
   3.130 +				
   3.131 +					switch (newtargetcount) {
   3.132 +						case 1:
   3.133 +							SDL_SetError("Cropping error - Newtargetcount=1.");
   3.134 +							return (-1);
   3.135 +							break;
   3.136 +
   3.137 +						case 2:
   3.138 +							if ((target_x + newtarget[1].x != lasttarget_x) || (target_y + newtarget[1].y != lasttarget_y)) {
   3.139 +								lasttarget_x = target_x;
   3.140 +								lasttarget_y = target_y;
   3.141 +								target_x = target_x + newtarget[1].x;
   3.142 +								target_y = target_y + newtarget[1].y;
   3.143 +							}
   3.144 +							else {
   3.145 +								lasttarget_x = target_x;
   3.146 +								lasttarget_y = target_y;
   3.147 +								target_x = target_x + newtarget[2].x;
   3.148 +								target_y = target_y + newtarget[2].y;
   3.149 +							}
   3.150 +							break;
   3.151 +
   3.152 +						case 3:
   3.153 +							SDL_SetError("Cropping error - Newtargetcount=3.");
   3.154 +							return (-1);
   3.155 +							break;
   3.156 +
   3.157 +						case 4:
   3.158 +							if (lasttarget_x > target_x) {
   3.159 +								lasttarget_x = target_x;
   3.160 +								lasttarget_y = target_y;
   3.161 +								if (*TR != 0x00)
   3.162 +									target_y--;
   3.163 +								else
   3.164 +									target_y++;
   3.165 +							}
   3.166 +							else if (lasttarget_y > target_y) {
   3.167 +								lasttarget_x = target_x;
   3.168 +								lasttarget_y = target_y;
   3.169 +								if (*BL != 0x00)
   3.170 +									target_x--;
   3.171 +								else
   3.172 +									target_x++;
   3.173 +							}
   3.174 +							else if (lasttarget_x < target_x) {
   3.175 +								lasttarget_x = target_x;
   3.176 +								lasttarget_y = target_y;
   3.177 +								if (*TL != 0x00)
   3.178 +									target_y--;
   3.179 +								else
   3.180 +									target_y++;
   3.181 +							}
   3.182 +							else if (lasttarget_y < target_y) {
   3.183 +								lasttarget_x = target_x;
   3.184 +								lasttarget_y = target_y;
   3.185 +								if (*TL != 0x00)
   3.186 +									target_x--;
   3.187 +								else
   3.188 +									target_x++;
   3.189 +							}
   3.190 +							else {
   3.191 +								SDL_SetError("Cropping error - no possible targets on newtargetcount=4.");
   3.192 +								return (-1);
   3.193 +							}
   3.194 +							break;
   3.195 +
   3.196 +						default:
   3.197 +							SDL_SetError("Cropping error - Newtargetcount invalid.");
   3.198 +							return (-1);
   3.199 +							break;
   3.200 +					}
   3.201 +
   3.202 +					if (target_x > lasttarget_x)
   3.203 +						TL = (Uint8 *) (TL + 1);
   3.204 +					else if (target_x < lasttarget_x)
   3.205 +						TL = (Uint8 *) (TL - 1);
   3.206 +					else if (target_y > lasttarget_y)
   3.207 +						TL = (Uint8 *) (TL + width);
   3.208 +					else if (target_y < lasttarget_y)
   3.209 +						TL = (Uint8 *) (TL - width);
   3.210 +					else {
   3.211 +						SDL_SetError("Cropping error - no new target.");
   3.212 +						return (-1);
   3.213 +					}
   3.214 +
   3.215 +					BL = (Uint8 *) (TL + width);
   3.216 +					TR = (Uint8 *) (TL + 1);
   3.217 +					BR = (Uint8 *) (BL + 1);
   3.218 +				}			// End of while loop
   3.219 +			
   3.220 +				/*
   3.221 +				 * Apply the mask to the cropping region 
   3.222 +				 */
   3.223 +				if (pos_array_pos >= 4) {
   3.224 +					TempRegion = CreatePolygonRgn(&(pos_array[1]), pos_array_pos, WINDING);
   3.225 +					if (TempRegion == NULL) {
   3.226 +						SDL_SetError("Cropping error - unable to create polygon.");
   3.227 +						return (-1);
   3.228 +					}
   3.229 +
   3.230 +	  				/*
   3.231 +	  				 * Add current region to final mask region 
   3.232 +	  				 */
   3.233 +	  				if (inside)
   3.234 +	  					CombineRgn(MaskRegion, MaskRegion, TempRegion, RGN_DIFF);
   3.235 +					else
   3.236 +						CombineRgn(MaskRegion, MaskRegion, TempRegion, RGN_OR);
   3.237 +
   3.238 +					/*
   3.239 +					 * Remove temporary region 
   3.240 +					 */
   3.241 +					DeleteObject(TempRegion);
   3.242 +				}
   3.243 +
   3.244 +				/*
   3.245 +				 * Switch sides 
   3.246 +				 */
   3.247 +				inside = !inside;
   3.248 +			}
   3.249 +			else if ((*curpos) && (!*curpos2))
   3.250 +				inside = !inside;
   3.251 +      			else if ((!*curpos) && (*curpos2))
   3.252 +				inside = !inside;
   3.253 +			
   3.254 +			curpos++;
   3.255 +			curpos2++;
   3.256 +		}
   3.257 +		curpos = (Uint8 *) (curpos + 2 * enlarge_mask - 1);
   3.258 +		curpos2 = (Uint8 *) (curpos + 1);
   3.259 +	}
   3.260  	
   3.261 +	/*
   3.262 +	 * Set the new region mask for the window 
   3.263 +	 */
   3.264 +	SetWindowRgn((SDL_WindowData*)(shaper->window->driverdata)->hwnd, MaskRegion, TRUE);
   3.265 +
   3.266 +	/*
   3.267 +	 * Return value 
   3.268 +	 */
   3.269 +	return (0);
   3.270  }
   3.271  
   3.272  int Win32_ResizeWindowShape(SDL_Window *window) {
     4.1 --- a/src/video/x11/SDL_x11shape.c	Wed Jul 07 16:20:54 2010 -0400
     4.2 +++ b/src/video/x11/SDL_x11shape.c	Thu Jul 08 22:52:49 2010 -0400
     4.3 @@ -63,13 +63,13 @@
     4.4  }
     4.5  	
     4.6  int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode) {
     4.7 -	assert(shaper != NULL && shape != NULL);
     4.8 +	if(shaper == NULL || shape == NULL || shaper->driverdata == NULL)
     4.9 +		return -1;
    4.10  	if(!SDL_ISPIXELFORMAT_ALPHA(SDL_MasksToPixelFormatEnum(shape->format->BitsPerPixel,shape->format->Rmask,shape->format->Gmask,shape->format->Bmask,shape->format->Amask)))
    4.11  		return -2;
    4.12  	if(shape->w != shaper->window->w || shape->h != shaper->window->h)
    4.13  		return -3;
    4.14  	SDL_ShapeData *data = shaper->driverdata;
    4.15 -	assert(data != NULL);
    4.16  	
    4.17  	/* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */
    4.18  	SDL_CalculateShapeBitmap(shaper->alphacutoff,shape,data->bitmap,8,1);