Commit 314bd78b authored by Sam Lantinga's avatar Sam Lantinga

Fixed 2048 pixel limitation in DirectX blit code

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40469
parent 2dcc9450
...@@ -1125,10 +1125,10 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1125,10 +1125,10 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
UINT swp_flags; UINT swp_flags;
SDL_resizing = 1; SDL_resizing = 1;
bounds.left = 0; bounds.top = 0;
bounds.top = 0;
bounds.right = video->w;
bounds.bottom = video->h; bounds.bottom = video->h;
bounds.left = 0;
bounds.right = video->w;
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
width = bounds.right-bounds.left; width = bounds.right-bounds.left;
height = bounds.bottom-bounds.top; height = bounds.bottom-bounds.top;
...@@ -1483,10 +1483,10 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1483,10 +1483,10 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
/* Set the size of the window, centering and adjusting */ /* Set the size of the window, centering and adjusting */
SDL_resizing = 1; SDL_resizing = 1;
bounds.left = 0; bounds.top = 0;
bounds.top = 0;
bounds.right = video->w;
bounds.bottom = video->h; bounds.bottom = video->h;
bounds.left = 0;
bounds.right = video->w;
AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0);
width = bounds.right-bounds.left; width = bounds.right-bounds.left;
height = bounds.bottom-bounds.top; height = bounds.bottom-bounds.top;
...@@ -1765,10 +1765,10 @@ static int DX5_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, ...@@ -1765,10 +1765,10 @@ static int DX5_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
/* Set it up.. the desination must have a DDRAW surface */ /* Set it up.. the desination must have a DDRAW surface */
src_surface = src->hwdata->dd_writebuf; src_surface = src->hwdata->dd_writebuf;
dst_surface = dst->hwdata->dd_writebuf; dst_surface = dst->hwdata->dd_writebuf;
rect.top = srcrect->y; rect.top = (LONG)srcrect->y;
rect.bottom = srcrect->y+srcrect->h; rect.bottom = (LONG)srcrect->y+srcrect->h;
rect.left = srcrect->x; rect.left = (LONG)srcrect->x;
rect.right = srcrect->x+srcrect->w; rect.right = (LONG)srcrect->x+srcrect->w;
if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY )
flags = DDBLTFAST_SRCCOLORKEY; flags = DDBLTFAST_SRCCOLORKEY;
else else
...@@ -1858,10 +1858,10 @@ static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 col ...@@ -1858,10 +1858,10 @@ static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 col
fprintf(stderr, "HW accelerated fill at (%d,%d)\n", dstrect->x, dstrect->y); fprintf(stderr, "HW accelerated fill at (%d,%d)\n", dstrect->x, dstrect->y);
#endif #endif
dst_surface = dst->hwdata->dd_writebuf; dst_surface = dst->hwdata->dd_writebuf;
area.top = dstrect->y; area.top = (LONG)dstrect->y;
area.bottom = dstrect->y+dstrect->h; area.bottom = (LONG)dstrect->y+dstrect->h;
area.left = dstrect->x; area.left = (LONG)dstrect->x;
area.right = dstrect->x+dstrect->w; area.right = (LONG)dstrect->x+dstrect->w;
bltfx.dwSize = sizeof(bltfx); bltfx.dwSize = sizeof(bltfx);
#if defined(NONAMELESSUNION) #if defined(NONAMELESSUNION)
bltfx.u5.dwFillColor = color; bltfx.u5.dwFillColor = color;
...@@ -1985,14 +1985,14 @@ void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects) ...@@ -1985,14 +1985,14 @@ void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects)
RECT src, dst; RECT src, dst;
for ( i=0; i<numrects; ++i ) { for ( i=0; i<numrects; ++i ) {
src.top = rects[i].y; src.top = (LONG)rects[i].y;
src.bottom = rects[i].y+rects[i].h; src.bottom = (LONG)rects[i].y+rects[i].h;
src.left = rects[i].x; src.left = (LONG)rects[i].x;
src.right = rects[i].x+rects[i].w; src.right = (LONG)rects[i].x+rects[i].w;
dst.top = SDL_bounds.top+src.top; dst.top = SDL_bounds.top+src.top;
dst.left = SDL_bounds.left+src.left; dst.left = SDL_bounds.left+src.left;
dst.bottom = SDL_bounds.top+src.bottom; dst.bottom = SDL_bounds.top+src.bottom;
dst.right = SDL_bounds.left+src.right; dst.right = SDL_bounds.left+src.right;
result = IDirectDrawSurface3_Blt(SDL_primary, &dst, result = IDirectDrawSurface3_Blt(SDL_primary, &dst,
this->screen->hwdata->dd_surface, &src, this->screen->hwdata->dd_surface, &src,
DDBLT_WAIT, NULL); DDBLT_WAIT, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment