Minor style tweaks

This commit is contained in:
Sam Lantinga 2014-03-10 02:13:44 -07:00
parent 1a35f32b68
commit 965cdf10d4

View file

@ -1130,7 +1130,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
goto done; goto done;
} }
/* Setup render state that doesn't change through the program */ /* Setup render state that doesn't change */
ID3D11DeviceContext_IASetInputLayout(data->d3dContext, data->inputLayout); ID3D11DeviceContext_IASetInputLayout(data->d3dContext, data->inputLayout);
ID3D11DeviceContext_VSSetShader(data->d3dContext, data->vertexShader, NULL, 0); ID3D11DeviceContext_VSSetShader(data->d3dContext, data->vertexShader, NULL, 0);
ID3D11DeviceContext_VSSetConstantBuffers(data->d3dContext, 0, 1, &data->vertexShaderConstants); ID3D11DeviceContext_VSSetConstantBuffers(data->d3dContext, 0, 1, &data->vertexShaderConstants);
@ -1185,8 +1185,7 @@ D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer)
static DXGI_MODE_ROTATION static DXGI_MODE_ROTATION
D3D11_GetCurrentRotation() D3D11_GetCurrentRotation()
{ {
switch (DisplayProperties::CurrentOrientation) switch (DisplayProperties::CurrentOrientation) {
{
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Windows Phone rotations */ /* Windows Phone rotations */
case DisplayOrientations::Landscape: case DisplayOrientations::Landscape:
@ -1458,8 +1457,7 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer)
* To note, the call for this, IDXGISwapChain1::SetRotation, is not necessary * To note, the call for this, IDXGISwapChain1::SetRotation, is not necessary
* on Windows Phone, nor is it supported there. It's only needed in Windows 8/RT. * on Windows Phone, nor is it supported there. It's only needed in Windows 8/RT.
*/ */
if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) {
{
result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation); result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation);
if (FAILED(result)) { if (FAILED(result)) {
WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGISwapChain1::SetRotation", result); WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGISwapChain1::SetRotation", result);
@ -1515,7 +1513,7 @@ D3D11_HandleDeviceLost(SDL_Renderer * renderer)
D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata;
HRESULT result = S_OK; HRESULT result = S_OK;
/* FIXME: Need to release all resources - all texures are invalid! */ /* FIXME: Need to release all resources - all textures are invalid! */
result = D3D11_CreateDeviceResources(renderer); result = D3D11_CreateDeviceResources(renderer);
if (FAILED(result)) { if (FAILED(result)) {
@ -1844,8 +1842,7 @@ D3D11_UpdateViewport(SDL_Renderer * renderer)
* direction of the DXGI_MODE_ROTATION enumeration. * direction of the DXGI_MODE_ROTATION enumeration.
*/ */
Float4X4 projection; Float4X4 projection;
switch (data->rotation) switch (data->rotation) {
{
case DXGI_MODE_ROTATION_IDENTITY: case DXGI_MODE_ROTATION_IDENTITY:
projection = MatrixIdentity(); projection = MatrixIdentity();
break; break;
@ -2466,8 +2463,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
textureMemory.RowPitch, textureMemory.RowPitch,
format, format,
pixels, pixels,
pitch) != 0) pitch) != 0) {
{
/* When SDL_ConvertPixels fails, it'll have already set the format. /* When SDL_ConvertPixels fails, it'll have already set the format.
* Get the error message, and attach some extra data to it. * Get the error message, and attach some extra data to it.
*/ */