Commit b1a385db authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Remove some stray tabs.

parent 955858e9
......@@ -52,17 +52,15 @@ static HRESULT WINAPI IDirectDrawClipperImpl_QueryInterface(
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), ppvObj);
if (IsEqualGUID(&IID_IUnknown, riid)
|| IsEqualGUID(&IID_IDirectDrawClipper, riid))
if (IsEqualGUID(&IID_IDirectDrawClipper, riid)
|| IsEqualGUID(&IID_IUnknown, riid))
{
IUnknown_AddRef(iface);
*ppvObj = iface;
return S_OK;
}
else
{
return E_NOINTERFACE;
}
return E_NOINTERFACE;
}
/*****************************************************************************
......
......@@ -3094,7 +3094,7 @@ IDirect3DDeviceImpl_3_SetLightState(IDirect3DDevice3 *iface,
{
case D3DLIGHTSTATE_AMBIENT: /* 2 */
rs = D3DRENDERSTATE_AMBIENT;
break;
break;
case D3DLIGHTSTATE_FOGMODE: /* 4 */
rs = D3DRENDERSTATE_FOGVERTEXMODE;
break;
......@@ -3190,7 +3190,7 @@ IDirect3DDeviceImpl_3_GetLightState(IDirect3DDevice3 *iface,
{
case D3DLIGHTSTATE_AMBIENT: /* 2 */
rs = D3DRENDERSTATE_AMBIENT;
break;
break;
case D3DLIGHTSTATE_FOGMODE: /* 4 */
rs = D3DRENDERSTATE_FOGVERTEXMODE;
break;
......@@ -6161,7 +6161,7 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
/* Try UpdateSurface that may perform a more direct opengl loading. But skip this if destination is paletted texture and has no palette.
* Some games like Sacrifice set palette after Load, and it is a waste of effort to try to load texture without palette and generates
* warnings in wined3d. */
if (!palette_missing)
if (!palette_missing)
hr = IWineD3DDevice_UpdateSurface(device->wineD3DDevice, src_level->WineD3DSurface, &rect, dest_level->WineD3DSurface,
&point);
......
......@@ -156,7 +156,7 @@ IDirect3DLightImpl_Release(IDirect3DLight *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
return 0;
return 0;
}
return ref;
}
......@@ -219,7 +219,7 @@ IDirect3DLightImpl_SetLight(IDirect3DLight *iface,
if (TRACE_ON(ddraw))
{
TRACE(" Light definition :\n");
dump_light((LPD3DLIGHT2) lpLight);
dump_light((LPD3DLIGHT2) lpLight);
}
if ( (lpLight->dltType == 0) || (lpLight->dltType > D3DLIGHT_PARALLELPOINT) )
......@@ -277,7 +277,7 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface,
if (TRACE_ON(ddraw))
{
TRACE(" Returning light definition :\n");
dump_light(&This->light);
dump_light(&This->light);
}
EnterCriticalSection(&ddraw_cs);
......
......@@ -687,20 +687,20 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
TRACE("rclsid %s, riid %s, object %p.\n",
debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( !IsEqualGUID( &IID_IClassFactory, riid )
&& ! IsEqualGUID( &IID_IUnknown, riid) )
return E_NOINTERFACE;
if (!IsEqualGUID(&IID_IClassFactory, riid)
&& !IsEqualGUID(&IID_IUnknown, riid))
return E_NOINTERFACE;
for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
{
if (IsEqualGUID(object_creation[i].clsid, rclsid))
break;
if (IsEqualGUID(object_creation[i].clsid, rclsid))
break;
}
if (i == sizeof(object_creation)/sizeof(object_creation[0]))
{
FIXME("%s: no class found.\n", debugstr_guid(rclsid));
return CLASS_E_CLASSNOTAVAILABLE;
FIXME("%s: no class found.\n", debugstr_guid(rclsid));
return CLASS_E_CLASSNOTAVAILABLE;
}
factory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*factory));
......
......@@ -73,27 +73,27 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
if ( IsEqualGUID( &IID_IUnknown, riid ) ) {
IUnknown_AddRef(iface);
*obp = iface;
TRACE(" Creating IUnknown interface at %p.\n", *obp);
return S_OK;
*obp = iface;
TRACE(" Creating IUnknown interface at %p.\n", *obp);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirect3DMaterial, riid ) ) {
IDirect3DMaterial_AddRef((IDirect3DMaterial *)&This->IDirect3DMaterial_vtbl);
*obp = &This->IDirect3DMaterial_vtbl;
TRACE(" Creating IDirect3DMaterial interface %p\n", *obp);
return S_OK;
TRACE(" Creating IDirect3DMaterial interface %p\n", *obp);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirect3DMaterial2, riid ) ) {
IDirect3DMaterial_AddRef((IDirect3DMaterial2 *)&This->IDirect3DMaterial2_vtbl);
*obp = &This->IDirect3DMaterial2_vtbl;
TRACE(" Creating IDirect3DMaterial2 interface %p\n", *obp);
return S_OK;
TRACE(" Creating IDirect3DMaterial2 interface %p\n", *obp);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirect3DMaterial3, riid ) ) {
IDirect3DMaterial3_AddRef((IDirect3DMaterial3 *)This);
*obp = This;
TRACE(" Creating IDirect3DMaterial3 interface %p\n", *obp);
return S_OK;
TRACE(" Creating IDirect3DMaterial3 interface %p\n", *obp);
return S_OK;
}
FIXME("(%p): interface for IID %s NOT found!\n", This, debugstr_guid(riid));
return E_NOINTERFACE;
......@@ -326,10 +326,8 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
return D3D_OK;
}
static HRESULT WINAPI
Thunk_IDirect3DMaterialImpl_2_GetHandle(LPDIRECT3DMATERIAL2 iface,
LPDIRECT3DDEVICE2 lpDirect3DDevice2,
LPD3DMATERIALHANDLE lpHandle)
static HRESULT WINAPI Thunk_IDirect3DMaterialImpl_2_GetHandle(IDirect3DMaterial2 *iface,
IDirect3DDevice2 *lpDirect3DDevice2, D3DMATERIALHANDLE *lpHandle)
{
TRACE("iface %p, device %p, handle %p.\n", iface, lpDirect3DDevice2, lpHandle);
......@@ -337,10 +335,8 @@ Thunk_IDirect3DMaterialImpl_2_GetHandle(LPDIRECT3DMATERIAL2 iface,
(IDirect3DDevice3 *)&device_from_device2(lpDirect3DDevice2)->IDirect3DDevice3_vtbl : NULL, lpHandle);
}
static HRESULT WINAPI
Thunk_IDirect3DMaterialImpl_1_GetHandle(LPDIRECT3DMATERIAL iface,
LPDIRECT3DDEVICE lpDirect3DDevice,
LPD3DMATERIALHANDLE lpHandle)
static HRESULT WINAPI Thunk_IDirect3DMaterialImpl_1_GetHandle(IDirect3DMaterial *iface,
IDirect3DDevice *lpDirect3DDevice, D3DMATERIALHANDLE *lpHandle)
{
TRACE("iface %p, device %p, handle %p.\n", iface, lpDirect3DDevice, lpHandle);
......
/* DirectDraw - IDirectPalette base interface
*
/*
* Copyright 2006 Stefan Dösinger
*
* This library is free software; you can redistribute it and/or
......
......@@ -77,9 +77,10 @@ static void MipMapCreationTest(void)
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
/* Check the number of created mipmaps */
......@@ -107,9 +108,10 @@ static void MipMapCreationTest(void)
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
/* Check the number of created mipmaps */
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
......@@ -139,9 +141,10 @@ static void MipMapCreationTest(void)
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
/* Check the number of created mipmaps */
......@@ -170,9 +173,10 @@ static void MipMapCreationTest(void)
ddsd.dwHeight = 64;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
/* Check the number of created mipmaps */
......@@ -234,9 +238,10 @@ static void SrcColorKey32BlitTest(void)
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDst, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
ddsd.dwFlags |= DDSD_CKSRCBLT;
......@@ -244,9 +249,10 @@ static void SrcColorKey32BlitTest(void)
ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0xFF00FF;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSrc, NULL);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
if (FAILED(rc)) {
skip("failed to create surface\n");
return;
if (FAILED(rc))
{
skip("failed to create surface\n");
return;
}
rc = IDirectDrawSurface_Lock(lpDst, NULL, &ddsd2, DDLOCK_WAIT, NULL);
......@@ -1862,10 +1868,11 @@ static void test_lockrect_invalid(void)
hr = IDirectDraw_CreateSurface(lpDD, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "CreateSurface failed (0x%08x)\n", hr);
if (FAILED(hr)) {
skip("failed to create surface\n");
continue;
}
if (FAILED(hr))
{
skip("failed to create surface\n");
continue;
}
for (i = 0; i < (sizeof(valid) / sizeof(*valid)); ++i)
{
......@@ -1951,9 +1958,10 @@ static void CompressedTest(void)
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "CreateSurface returned %08x\n", hr);
if (FAILED(hr)) {
skip("failed to create surface\n");
return;
if (FAILED(hr))
{
skip("failed to create surface\n");
return;
}
memset(&ddsd2, 0, sizeof(ddsd2));
......@@ -1975,9 +1983,10 @@ static void CompressedTest(void)
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "CreateSurface returned %08x\n", hr);
if (FAILED(hr)) {
skip("failed to create surface\n");
return;
if (FAILED(hr))
{
skip("failed to create surface\n");
return;
}
memset(&ddsd2, 0, sizeof(ddsd2));
......@@ -1998,9 +2007,10 @@ static void CompressedTest(void)
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "CreateSurface returned %08x\n", hr);
if (FAILED(hr)) {
skip("failed to create surface\n");
return;
if (FAILED(hr))
{
skip("failed to create surface\n");
return;
}
memset(&ddsd2, 0, sizeof(ddsd2));
......@@ -2699,9 +2709,10 @@ static void PaletteTest(void)
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurf, NULL);
ok(hr==DD_OK, "CreateSurface returned: %x\n",hr);
if (FAILED(hr)) {
skip("failed to create surface\n");
goto err;
if (FAILED(hr))
{
skip("failed to create surface\n");
goto err;
}
hr = IDirectDrawSurface_SetPalette(lpSurf, palette);
......
......@@ -598,7 +598,7 @@ enum wined3d_format_id PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat
}
if(DDPixelFormat->dwFourCC == MAKEFOURCC('D', 'X', 'T', '5'))
{
return WINED3DFMT_DXT5;
return WINED3DFMT_DXT5;
}
if(DDPixelFormat->dwFourCC == MAKEFOURCC('G', 'R', 'G', 'B'))
{
......@@ -664,7 +664,7 @@ DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *ddck)
static void DDRAW_dump_flags_nolf(DWORD flags, const flag_info* names,
size_t num_names)
{
unsigned int i;
unsigned int i;
for (i=0; i < num_names; i++)
if ((flags & names[i].val) || /* standard flag value */
......
......@@ -52,20 +52,23 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
}
/* And copy the values in the structure used by the device */
if (This->use_vp2) {
if (This->use_vp2)
{
vp.dwX = This->viewports.vp2.dwX;
vp.dwY = This->viewports.vp2.dwY;
vp.dwHeight = This->viewports.vp2.dwHeight;
vp.dwWidth = This->viewports.vp2.dwWidth;
vp.dvMinZ = This->viewports.vp2.dvMinZ;
vp.dvMaxZ = This->viewports.vp2.dvMaxZ;
} else {
vp.dwY = This->viewports.vp2.dwY;
vp.dwHeight = This->viewports.vp2.dwHeight;
vp.dwWidth = This->viewports.vp2.dwWidth;
vp.dvMinZ = This->viewports.vp2.dvMinZ;
vp.dvMaxZ = This->viewports.vp2.dvMaxZ;
}
else
{
vp.dwX = This->viewports.vp1.dwX;
vp.dwY = This->viewports.vp1.dwY;
vp.dwHeight = This->viewports.vp1.dwHeight;
vp.dwWidth = This->viewports.vp1.dwWidth;
vp.dvMinZ = This->viewports.vp1.dvMinZ;
vp.dvMaxZ = This->viewports.vp1.dvMaxZ;
vp.dwY = This->viewports.vp1.dwY;
vp.dwHeight = This->viewports.vp1.dwHeight;
vp.dwWidth = This->viewports.vp1.dwWidth;
vp.dvMinZ = This->viewports.vp1.dvMinZ;
vp.dvMaxZ = This->viewports.vp1.dvMaxZ;
}
/* And also set the viewport */
......@@ -81,29 +84,29 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
static void _dump_D3DVIEWPORT(const D3DVIEWPORT *lpvp)
{
TRACE(" - dwSize = %d dwX = %d dwY = %d\n",
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
TRACE(" - dwWidth = %d dwHeight = %d\n",
lpvp->dwWidth, lpvp->dwHeight);
lpvp->dwWidth, lpvp->dwHeight);
TRACE(" - dvScaleX = %f dvScaleY = %f\n",
lpvp->dvScaleX, lpvp->dvScaleY);
lpvp->dvScaleX, lpvp->dvScaleY);
TRACE(" - dvMaxX = %f dvMaxY = %f\n",
lpvp->dvMaxX, lpvp->dvMaxY);
lpvp->dvMaxX, lpvp->dvMaxY);
TRACE(" - dvMinZ = %f dvMaxZ = %f\n",
lpvp->dvMinZ, lpvp->dvMaxZ);
lpvp->dvMinZ, lpvp->dvMaxZ);
}
static void _dump_D3DVIEWPORT2(const D3DVIEWPORT2 *lpvp)
{
TRACE(" - dwSize = %d dwX = %d dwY = %d\n",
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
TRACE(" - dwWidth = %d dwHeight = %d\n",
lpvp->dwWidth, lpvp->dwHeight);
lpvp->dwWidth, lpvp->dwHeight);
TRACE(" - dvClipX = %f dvClipY = %f\n",
lpvp->dvClipX, lpvp->dvClipY);
lpvp->dvClipX, lpvp->dvClipY);
TRACE(" - dvClipWidth = %f dvClipHeight = %f\n",
lpvp->dvClipWidth, lpvp->dvClipHeight);
lpvp->dvClipWidth, lpvp->dvClipHeight);
TRACE(" - dvMinZ = %f dvMaxZ = %f\n",
lpvp->dvMinZ, lpvp->dvMaxZ);
lpvp->dvMinZ, lpvp->dvMaxZ);
}
/*****************************************************************************
......@@ -126,25 +129,23 @@ static void _dump_D3DVIEWPORT2(const D3DVIEWPORT2 *lpvp)
* E_NOINTERFACE if the requested interface wasn't found
*
*****************************************************************************/
static HRESULT WINAPI
IDirect3DViewportImpl_QueryInterface(IDirect3DViewport3 *iface,
REFIID riid,
void **obp)
static HRESULT WINAPI IDirect3DViewportImpl_QueryInterface(IDirect3DViewport3 *iface, REFIID riid, void **object)
{
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), obp);
*obp = NULL;
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
if ( IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IDirect3DViewport, riid) ||
IsEqualGUID(&IID_IDirect3DViewport2, riid) ||
IsEqualGUID(&IID_IDirect3DViewport3, riid) ) {
if (IsEqualGUID(&IID_IDirect3DViewport3, riid)
|| IsEqualGUID(&IID_IDirect3DViewport2, riid)
|| IsEqualGUID(&IID_IDirect3DViewport, riid)
|| IsEqualGUID(&IID_IUnknown, riid))
{
IDirect3DViewport3_AddRef(iface);
*obp = iface;
TRACE(" Creating IDirect3DViewport1/2/3 interface %p\n", *obp);
return S_OK;
*object = iface;
return S_OK;
}
FIXME("(%p): interface for IID %s NOT found!\n", iface, debugstr_guid(riid));
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*object = NULL;
return E_NOINTERFACE;
}
......@@ -187,7 +188,7 @@ IDirect3DViewportImpl_Release(IDirect3DViewport3 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
return 0;
return 0;
}
return ref;
}
......@@ -263,7 +264,7 @@ IDirect3DViewportImpl_GetViewport(IDirect3DViewport3 *iface,
if (TRACE_ON(ddraw))
{
TRACE(" returning D3DVIEWPORT :\n");
_dump_D3DVIEWPORT(lpData);
_dump_D3DVIEWPORT(lpData);
}
LeaveCriticalSection(&ddraw_cs);
......@@ -295,7 +296,7 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
if (TRACE_ON(ddraw))
{
TRACE(" getting D3DVIEWPORT :\n");
_dump_D3DVIEWPORT(lpData);
_dump_D3DVIEWPORT(lpData);
}
EnterCriticalSection(&ddraw_cs);
......@@ -669,7 +670,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
if (This->active_device == NULL) {
ERR(" Trying to clear a viewport not attached to a device !\n");
return D3DERR_VIEWPORTHASNODEVICE;
return D3DERR_VIEWPORTHASNODEVICE;
}
d3d_device3 = (IDirect3DDevice3 *)&This->active_device->IDirect3DDevice3_vtbl;
......@@ -738,9 +739,10 @@ IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
}
/* Find a light number and update both light and viewports objects accordingly */
while(map&1) {
map>>=1;
i++;
while (map & 1)
{
map >>= 1;
++i;
}
lpDirect3DLightImpl->dwLightIndex = i;
This->num_lights++;
......@@ -791,18 +793,18 @@ IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *iface,
if (cur_light == lpDirect3DLightImpl)
{
light_deactivate(lpDirect3DLightImpl);
if (prev_light == NULL) This->lights = cur_light->next;
else prev_light->next = cur_light->next;
/* Detach the light to the viewport */
cur_light->active_viewport = NULL;
IDirect3DLight_Release( (IDirect3DLight *)cur_light );
This->num_lights--;
This->map_lights &= ~(1<<lpDirect3DLightImpl->dwLightIndex);
if (!prev_light) This->lights = cur_light->next;
else prev_light->next = cur_light->next;
/* Detach the light from the viewport. */
cur_light->active_viewport = NULL;
IDirect3DLight_Release((IDirect3DLight *)cur_light);
--This->num_lights;
This->map_lights &= ~(1 << lpDirect3DLightImpl->dwLightIndex);
LeaveCriticalSection(&ddraw_cs);
return D3D_OK;
}
prev_light = cur_light;
cur_light = cur_light->next;
}
prev_light = cur_light;
cur_light = cur_light->next;
}
LeaveCriticalSection(&ddraw_cs);
......@@ -933,7 +935,7 @@ IDirect3DViewportImpl_GetViewport2(IDirect3DViewport3 *iface,
if (TRACE_ON(ddraw))
{
TRACE(" returning D3DVIEWPORT2 :\n");
_dump_D3DVIEWPORT2(lpData);
_dump_D3DVIEWPORT2(lpData);
}
LeaveCriticalSection(&ddraw_cs);
......@@ -964,7 +966,7 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
if (TRACE_ON(ddraw))
{
TRACE(" getting D3DVIEWPORT2 :\n");
_dump_D3DVIEWPORT2(lpData);
_dump_D3DVIEWPORT2(lpData);
}
EnterCriticalSection(&ddraw_cs);
......
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