Updated SDL2 to the latest Mercurial revision.

This commit is contained in:
Alex Szpakowski
2015-08-22 14:16:20 -03:00
parent 0753e6b560
commit c47a4b56bb
916 changed files with 16588 additions and 22006 deletions
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1356,7 +1356,7 @@ D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer)
}
static int
D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D11_RECT * outRect)
D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D11_RECT * outRect, BOOL includeViewportOffset)
{
D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata;
const int rotation = D3D11_GetRotationForCurrentRenderTarget(renderer);
@@ -1366,6 +1366,12 @@ D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRec
outRect->right = sdlRect->x + sdlRect->w;
outRect->top = sdlRect->y;
outRect->bottom = sdlRect->y + sdlRect->h;
if (includeViewportOffset) {
outRect->left += renderer->viewport.x;
outRect->right += renderer->viewport.x;
outRect->top += renderer->viewport.y;
outRect->bottom += renderer->viewport.y;
}
break;
case DXGI_MODE_ROTATION_ROTATE270:
outRect->left = sdlRect->y;
@@ -2280,7 +2286,7 @@ D3D11_UpdateClipRect(SDL_Renderer * renderer)
ID3D11DeviceContext_RSSetScissorRects(data->d3dContext, 0, NULL);
} else {
D3D11_RECT scissorRect;
if (D3D11_GetViewportAlignedD3DRect(renderer, &renderer->clip_rect, &scissorRect) != 0) {
if (D3D11_GetViewportAlignedD3DRect(renderer, &renderer->clip_rect, &scissorRect, TRUE) != 0) {
/* D3D11_GetViewportAlignedD3DRect will have set the SDL error */
return -1;
}
@@ -2869,7 +2875,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
}
/* Copy the desired portion of the back buffer to the staging texture: */
if (D3D11_GetViewportAlignedD3DRect(renderer, rect, &srcRect) != 0) {
if (D3D11_GetViewportAlignedD3DRect(renderer, rect, &srcRect, FALSE) != 0) {
/* D3D11_GetViewportAlignedD3DRect will have set the SDL error */
goto done;
}
@@ -2916,7 +2922,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
*/
char errorMessage[1024];
SDL_snprintf(errorMessage, sizeof(errorMessage), __FUNCTION__ ", Convert Pixels failed: %s", SDL_GetError());
SDL_SetError(errorMessage);
SDL_SetError("%s", errorMessage);
goto done;
}
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages