Fixed 2048 pixel limitation in DirectX blit code
authorSam Lantinga <slouken@libsdl.org>
Sat, 24 Aug 2002 17:15:45 +0000
changeset 4680b0c2e63eb27
parent 467 e7194ff2ef3f
child 469 a1284fd544aa
Fixed 2048 pixel limitation in DirectX blit code
src/video/windx5/SDL_dx5video.c
     1.1 --- a/src/video/windx5/SDL_dx5video.c	Sat Aug 24 16:27:33 2002 +0000
     1.2 +++ b/src/video/windx5/SDL_dx5video.c	Sat Aug 24 17:15:45 2002 +0000
     1.3 @@ -1125,10 +1125,10 @@
     1.4  			UINT swp_flags;
     1.5  
     1.6  			SDL_resizing = 1;
     1.7 -			bounds.left = 0;
     1.8 -			bounds.top = 0;
     1.9 -			bounds.right = video->w;
    1.10 +			bounds.top    = 0;
    1.11  			bounds.bottom = video->h;
    1.12 +			bounds.left   = 0;
    1.13 +			bounds.right  = video->w;
    1.14  			AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
    1.15  			width = bounds.right-bounds.left;
    1.16  			height = bounds.bottom-bounds.top;
    1.17 @@ -1483,10 +1483,10 @@
    1.18  
    1.19  		/* Set the size of the window, centering and adjusting */
    1.20  		SDL_resizing = 1;
    1.21 -		bounds.left = 0;
    1.22 -		bounds.top = 0;
    1.23 -		bounds.right = video->w;
    1.24 +		bounds.top    = 0;
    1.25  		bounds.bottom = video->h;
    1.26 +		bounds.left   = 0;
    1.27 +		bounds.right  = video->w;
    1.28  		AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
    1.29  		width = bounds.right-bounds.left;
    1.30  		height = bounds.bottom-bounds.top;
    1.31 @@ -1765,10 +1765,10 @@
    1.32  	/* Set it up.. the desination must have a DDRAW surface */
    1.33  	src_surface = src->hwdata->dd_writebuf;
    1.34  	dst_surface = dst->hwdata->dd_writebuf;
    1.35 -	rect.top    = srcrect->y;
    1.36 -	rect.bottom = srcrect->y+srcrect->h;
    1.37 -	rect.left   = srcrect->x;
    1.38 -	rect.right  = srcrect->x+srcrect->w;
    1.39 +	rect.top    = (LONG)srcrect->y;
    1.40 +	rect.bottom = (LONG)srcrect->y+srcrect->h;
    1.41 +	rect.left   = (LONG)srcrect->x;
    1.42 +	rect.right  = (LONG)srcrect->x+srcrect->w;
    1.43  	if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY )
    1.44  		flags = DDBLTFAST_SRCCOLORKEY;
    1.45  	else
    1.46 @@ -1858,10 +1858,10 @@
    1.47   fprintf(stderr, "HW accelerated fill at (%d,%d)\n", dstrect->x, dstrect->y);
    1.48  #endif
    1.49  	dst_surface = dst->hwdata->dd_writebuf;
    1.50 -	area.top = dstrect->y;
    1.51 -	area.bottom = dstrect->y+dstrect->h;
    1.52 -	area.left = dstrect->x;
    1.53 -	area.right = dstrect->x+dstrect->w;
    1.54 +	area.top    = (LONG)dstrect->y;
    1.55 +	area.bottom = (LONG)dstrect->y+dstrect->h;
    1.56 +	area.left   = (LONG)dstrect->x;
    1.57 +	area.right  = (LONG)dstrect->x+dstrect->w;
    1.58  	bltfx.dwSize = sizeof(bltfx);
    1.59  #if defined(NONAMELESSUNION)
    1.60  	bltfx.u5.dwFillColor = color;
    1.61 @@ -1985,14 +1985,14 @@
    1.62  	RECT src, dst;
    1.63  
    1.64  	for ( i=0; i<numrects; ++i ) {
    1.65 -		src.top = rects[i].y;
    1.66 -		src.bottom = rects[i].y+rects[i].h;
    1.67 -		src.left = rects[i].x;
    1.68 -		src.right = rects[i].x+rects[i].w;
    1.69 -		dst.top = SDL_bounds.top+src.top;
    1.70 -		dst.left = SDL_bounds.left+src.left;
    1.71 +		src.top    = (LONG)rects[i].y;
    1.72 +		src.bottom = (LONG)rects[i].y+rects[i].h;
    1.73 +		src.left   = (LONG)rects[i].x;
    1.74 +		src.right  = (LONG)rects[i].x+rects[i].w;
    1.75 +		dst.top    = SDL_bounds.top+src.top;
    1.76 +		dst.left   = SDL_bounds.left+src.left;
    1.77  		dst.bottom = SDL_bounds.top+src.bottom;
    1.78 -		dst.right = SDL_bounds.left+src.right;
    1.79 +		dst.right  = SDL_bounds.left+src.right;
    1.80  		result = IDirectDrawSurface3_Blt(SDL_primary, &dst, 
    1.81  					this->screen->hwdata->dd_surface, &src,
    1.82  							DDBLT_WAIT, NULL);