Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b1a385db
Commit
b1a385db
authored
Sep 08, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Remove some stray tabs.
parent
955858e9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
136 additions
and
130 deletions
+136
-130
clipper.c
dlls/ddraw/clipper.c
+4
-6
device.c
dlls/ddraw/device.c
+3
-3
light.c
dlls/ddraw/light.c
+3
-3
main.c
dlls/ddraw/main.c
+7
-7
material.c
dlls/ddraw/material.c
+13
-17
palette.c
dlls/ddraw/palette.c
+1
-2
dsurface.c
dlls/ddraw/tests/dsurface.c
+45
-34
utils.c
dlls/ddraw/utils.c
+2
-2
viewport.c
dlls/ddraw/viewport.c
+58
-56
No files found.
dlls/ddraw/clipper.c
View file @
b1a385db
...
@@ -52,17 +52,15 @@ static HRESULT WINAPI IDirectDrawClipperImpl_QueryInterface(
...
@@ -52,17 +52,15 @@ static HRESULT WINAPI IDirectDrawClipperImpl_QueryInterface(
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppvObj
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppvObj
);
if
(
IsEqualGUID
(
&
IID_I
Unknown
,
riid
)
if
(
IsEqualGUID
(
&
IID_I
DirectDrawClipper
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectDrawClipper
,
riid
))
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
{
IUnknown_AddRef
(
iface
);
IUnknown_AddRef
(
iface
);
*
ppvObj
=
iface
;
*
ppvObj
=
iface
;
return
S_OK
;
return
S_OK
;
}
}
else
{
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
}
/*****************************************************************************
/*****************************************************************************
...
...
dlls/ddraw/device.c
View file @
b1a385db
...
@@ -3094,7 +3094,7 @@ IDirect3DDeviceImpl_3_SetLightState(IDirect3DDevice3 *iface,
...
@@ -3094,7 +3094,7 @@ IDirect3DDeviceImpl_3_SetLightState(IDirect3DDevice3 *iface,
{
{
case
D3DLIGHTSTATE_AMBIENT
:
/* 2 */
case
D3DLIGHTSTATE_AMBIENT
:
/* 2 */
rs
=
D3DRENDERSTATE_AMBIENT
;
rs
=
D3DRENDERSTATE_AMBIENT
;
break
;
break
;
case
D3DLIGHTSTATE_FOGMODE
:
/* 4 */
case
D3DLIGHTSTATE_FOGMODE
:
/* 4 */
rs
=
D3DRENDERSTATE_FOGVERTEXMODE
;
rs
=
D3DRENDERSTATE_FOGVERTEXMODE
;
break
;
break
;
...
@@ -3190,7 +3190,7 @@ IDirect3DDeviceImpl_3_GetLightState(IDirect3DDevice3 *iface,
...
@@ -3190,7 +3190,7 @@ IDirect3DDeviceImpl_3_GetLightState(IDirect3DDevice3 *iface,
{
{
case
D3DLIGHTSTATE_AMBIENT
:
/* 2 */
case
D3DLIGHTSTATE_AMBIENT
:
/* 2 */
rs
=
D3DRENDERSTATE_AMBIENT
;
rs
=
D3DRENDERSTATE_AMBIENT
;
break
;
break
;
case
D3DLIGHTSTATE_FOGMODE
:
/* 4 */
case
D3DLIGHTSTATE_FOGMODE
:
/* 4 */
rs
=
D3DRENDERSTATE_FOGVERTEXMODE
;
rs
=
D3DRENDERSTATE_FOGVERTEXMODE
;
break
;
break
;
...
@@ -6161,7 +6161,7 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
...
@@ -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.
/* 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
* 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. */
* warnings in wined3d. */
if
(
!
palette_missing
)
if
(
!
palette_missing
)
hr
=
IWineD3DDevice_UpdateSurface
(
device
->
wineD3DDevice
,
src_level
->
WineD3DSurface
,
&
rect
,
dest_level
->
WineD3DSurface
,
hr
=
IWineD3DDevice_UpdateSurface
(
device
->
wineD3DDevice
,
src_level
->
WineD3DSurface
,
&
rect
,
dest_level
->
WineD3DSurface
,
&
point
);
&
point
);
...
...
dlls/ddraw/light.c
View file @
b1a385db
...
@@ -156,7 +156,7 @@ IDirect3DLightImpl_Release(IDirect3DLight *iface)
...
@@ -156,7 +156,7 @@ IDirect3DLightImpl_Release(IDirect3DLight *iface)
if
(
!
ref
)
{
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
0
;
}
}
return
ref
;
return
ref
;
}
}
...
@@ -219,7 +219,7 @@ IDirect3DLightImpl_SetLight(IDirect3DLight *iface,
...
@@ -219,7 +219,7 @@ IDirect3DLightImpl_SetLight(IDirect3DLight *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" Light definition :
\n
"
);
TRACE
(
" Light definition :
\n
"
);
dump_light
((
LPD3DLIGHT2
)
lpLight
);
dump_light
((
LPD3DLIGHT2
)
lpLight
);
}
}
if
(
(
lpLight
->
dltType
==
0
)
||
(
lpLight
->
dltType
>
D3DLIGHT_PARALLELPOINT
)
)
if
(
(
lpLight
->
dltType
==
0
)
||
(
lpLight
->
dltType
>
D3DLIGHT_PARALLELPOINT
)
)
...
@@ -277,7 +277,7 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface,
...
@@ -277,7 +277,7 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" Returning light definition :
\n
"
);
TRACE
(
" Returning light definition :
\n
"
);
dump_light
(
&
This
->
light
);
dump_light
(
&
This
->
light
);
}
}
EnterCriticalSection
(
&
ddraw_cs
);
EnterCriticalSection
(
&
ddraw_cs
);
...
...
dlls/ddraw/main.c
View file @
b1a385db
...
@@ -687,20 +687,20 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
...
@@ -687,20 +687,20 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
TRACE
(
"rclsid %s, riid %s, object %p.
\n
"
,
TRACE
(
"rclsid %s, riid %s, object %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
!
IsEqualGUID
(
&
IID_IClassFactory
,
riid
)
if
(
!
IsEqualGUID
(
&
IID_IClassFactory
,
riid
)
&&
!
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
&&
!
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
for
(
i
=
0
;
i
<
sizeof
(
object_creation
)
/
sizeof
(
object_creation
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
object_creation
)
/
sizeof
(
object_creation
[
0
]);
i
++
)
{
{
if
(
IsEqualGUID
(
object_creation
[
i
].
clsid
,
rclsid
))
if
(
IsEqualGUID
(
object_creation
[
i
].
clsid
,
rclsid
))
break
;
break
;
}
}
if
(
i
==
sizeof
(
object_creation
)
/
sizeof
(
object_creation
[
0
]))
if
(
i
==
sizeof
(
object_creation
)
/
sizeof
(
object_creation
[
0
]))
{
{
FIXME
(
"%s: no class found.
\n
"
,
debugstr_guid
(
rclsid
));
FIXME
(
"%s: no class found.
\n
"
,
debugstr_guid
(
rclsid
));
return
CLASS_E_CLASSNOTAVAILABLE
;
return
CLASS_E_CLASSNOTAVAILABLE
;
}
}
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
...
...
dlls/ddraw/material.c
View file @
b1a385db
...
@@ -73,27 +73,27 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
...
@@ -73,27 +73,27 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
{
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
{
IUnknown_AddRef
(
iface
);
IUnknown_AddRef
(
iface
);
*
obp
=
iface
;
*
obp
=
iface
;
TRACE
(
" Creating IUnknown interface at %p.
\n
"
,
*
obp
);
TRACE
(
" Creating IUnknown interface at %p.
\n
"
,
*
obp
);
return
S_OK
;
return
S_OK
;
}
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial
,
riid
)
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial
,
riid
)
)
{
IDirect3DMaterial_AddRef
((
IDirect3DMaterial
*
)
&
This
->
IDirect3DMaterial_vtbl
);
IDirect3DMaterial_AddRef
((
IDirect3DMaterial
*
)
&
This
->
IDirect3DMaterial_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial_vtbl
;
*
obp
=
&
This
->
IDirect3DMaterial_vtbl
;
TRACE
(
" Creating IDirect3DMaterial interface %p
\n
"
,
*
obp
);
TRACE
(
" Creating IDirect3DMaterial interface %p
\n
"
,
*
obp
);
return
S_OK
;
return
S_OK
;
}
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial2
,
riid
)
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial2
,
riid
)
)
{
IDirect3DMaterial_AddRef
((
IDirect3DMaterial2
*
)
&
This
->
IDirect3DMaterial2_vtbl
);
IDirect3DMaterial_AddRef
((
IDirect3DMaterial2
*
)
&
This
->
IDirect3DMaterial2_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial2_vtbl
;
*
obp
=
&
This
->
IDirect3DMaterial2_vtbl
;
TRACE
(
" Creating IDirect3DMaterial2 interface %p
\n
"
,
*
obp
);
TRACE
(
" Creating IDirect3DMaterial2 interface %p
\n
"
,
*
obp
);
return
S_OK
;
return
S_OK
;
}
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial3
,
riid
)
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial3
,
riid
)
)
{
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
This
);
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
This
);
*
obp
=
This
;
*
obp
=
This
;
TRACE
(
" Creating IDirect3DMaterial3 interface %p
\n
"
,
*
obp
);
TRACE
(
" Creating IDirect3DMaterial3 interface %p
\n
"
,
*
obp
);
return
S_OK
;
return
S_OK
;
}
}
FIXME
(
"(%p): interface for IID %s NOT found!
\n
"
,
This
,
debugstr_guid
(
riid
));
FIXME
(
"(%p): interface for IID %s NOT found!
\n
"
,
This
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
...
@@ -326,10 +326,8 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
...
@@ -326,10 +326,8 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
return
D3D_OK
;
return
D3D_OK
;
}
}
static
HRESULT
WINAPI
static
HRESULT
WINAPI
Thunk_IDirect3DMaterialImpl_2_GetHandle
(
IDirect3DMaterial2
*
iface
,
Thunk_IDirect3DMaterialImpl_2_GetHandle
(
LPDIRECT3DMATERIAL2
iface
,
IDirect3DDevice2
*
lpDirect3DDevice2
,
D3DMATERIALHANDLE
*
lpHandle
)
LPDIRECT3DDEVICE2
lpDirect3DDevice2
,
LPD3DMATERIALHANDLE
lpHandle
)
{
{
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice2
,
lpHandle
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice2
,
lpHandle
);
...
@@ -337,10 +335,8 @@ Thunk_IDirect3DMaterialImpl_2_GetHandle(LPDIRECT3DMATERIAL2 iface,
...
@@ -337,10 +335,8 @@ Thunk_IDirect3DMaterialImpl_2_GetHandle(LPDIRECT3DMATERIAL2 iface,
(
IDirect3DDevice3
*
)
&
device_from_device2
(
lpDirect3DDevice2
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
(
IDirect3DDevice3
*
)
&
device_from_device2
(
lpDirect3DDevice2
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
}
}
static
HRESULT
WINAPI
static
HRESULT
WINAPI
Thunk_IDirect3DMaterialImpl_1_GetHandle
(
IDirect3DMaterial
*
iface
,
Thunk_IDirect3DMaterialImpl_1_GetHandle
(
LPDIRECT3DMATERIAL
iface
,
IDirect3DDevice
*
lpDirect3DDevice
,
D3DMATERIALHANDLE
*
lpHandle
)
LPDIRECT3DDEVICE
lpDirect3DDevice
,
LPD3DMATERIALHANDLE
lpHandle
)
{
{
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice
,
lpHandle
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice
,
lpHandle
);
...
...
dlls/ddraw/palette.c
View file @
b1a385db
/* DirectDraw - IDirectPalette base interface
/*
*
* Copyright 2006 Stefan Dösinger
* Copyright 2006 Stefan Dösinger
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
...
dlls/ddraw/tests/dsurface.c
View file @
b1a385db
...
@@ -77,9 +77,10 @@ static void MipMapCreationTest(void)
...
@@ -77,9 +77,10 @@ static void MipMapCreationTest(void)
ddsd
.
dwHeight
=
32
;
ddsd
.
dwHeight
=
32
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
/* Check the number of created mipmaps */
/* Check the number of created mipmaps */
...
@@ -107,9 +108,10 @@ static void MipMapCreationTest(void)
...
@@ -107,9 +108,10 @@ static void MipMapCreationTest(void)
ddsd
.
dwHeight
=
32
;
ddsd
.
dwHeight
=
32
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
/* Check the number of created mipmaps */
/* Check the number of created mipmaps */
memset
(
&
ddsd
,
0
,
sizeof
(
DDSURFACEDESC
));
memset
(
&
ddsd
,
0
,
sizeof
(
DDSURFACEDESC
));
...
@@ -139,9 +141,10 @@ static void MipMapCreationTest(void)
...
@@ -139,9 +141,10 @@ static void MipMapCreationTest(void)
ddsd
.
dwHeight
=
32
;
ddsd
.
dwHeight
=
32
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
/* Check the number of created mipmaps */
/* Check the number of created mipmaps */
...
@@ -170,9 +173,10 @@ static void MipMapCreationTest(void)
...
@@ -170,9 +173,10 @@ static void MipMapCreationTest(void)
ddsd
.
dwHeight
=
64
;
ddsd
.
dwHeight
=
64
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSMipMapTest
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
/* Check the number of created mipmaps */
/* Check the number of created mipmaps */
...
@@ -234,9 +238,10 @@ static void SrcColorKey32BlitTest(void)
...
@@ -234,9 +238,10 @@ static void SrcColorKey32BlitTest(void)
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x0000FF
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x0000FF
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDst
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDst
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
ddsd
.
dwFlags
|=
DDSD_CKSRCBLT
;
ddsd
.
dwFlags
|=
DDSD_CKSRCBLT
;
...
@@ -244,9 +249,10 @@ static void SrcColorKey32BlitTest(void)
...
@@ -244,9 +249,10 @@ static void SrcColorKey32BlitTest(void)
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
=
0xFF00FF
;
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
=
0xFF00FF
;
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpSrc
,
NULL
);
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpSrc
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
FAILED
(
rc
))
{
if
(
FAILED
(
rc
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
rc
=
IDirectDrawSurface_Lock
(
lpDst
,
NULL
,
&
ddsd2
,
DDLOCK_WAIT
,
NULL
);
rc
=
IDirectDrawSurface_Lock
(
lpDst
,
NULL
,
&
ddsd2
,
DDLOCK_WAIT
,
NULL
);
...
@@ -1862,10 +1868,11 @@ static void test_lockrect_invalid(void)
...
@@ -1862,10 +1868,11 @@ static void test_lockrect_invalid(void)
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
surface_desc
,
&
surface
,
NULL
);
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"CreateSurface failed (0x%08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateSurface failed (0x%08x)
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
skip
(
"failed to create surface
\n
"
);
{
continue
;
skip
(
"failed to create surface
\n
"
);
}
continue
;
}
for
(
i
=
0
;
i
<
(
sizeof
(
valid
)
/
sizeof
(
*
valid
));
++
i
)
for
(
i
=
0
;
i
<
(
sizeof
(
valid
)
/
sizeof
(
*
valid
));
++
i
)
{
{
...
@@ -1951,9 +1958,10 @@ static void CompressedTest(void)
...
@@ -1951,9 +1958,10 @@ static void CompressedTest(void)
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
...
@@ -1975,9 +1983,10 @@ static void CompressedTest(void)
...
@@ -1975,9 +1983,10 @@ static void CompressedTest(void)
U4
(
ddsd
).
ddpfPixelFormat
.
dwFourCC
=
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'3'
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFourCC
=
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'3'
);
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
...
@@ -1998,9 +2007,10 @@ static void CompressedTest(void)
...
@@ -1998,9 +2007,10 @@ static void CompressedTest(void)
U4
(
ddsd
).
ddpfPixelFormat
.
dwFourCC
=
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'5'
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFourCC
=
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'5'
);
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
hr
=
IDirectDraw7_CreateSurface
(
dd7
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
skip
(
"failed to create surface
\n
"
);
{
return
;
skip
(
"failed to create surface
\n
"
);
return
;
}
}
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
...
@@ -2699,9 +2709,10 @@ static void PaletteTest(void)
...
@@ -2699,9 +2709,10 @@ static void PaletteTest(void)
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x0000FF
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x0000FF
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpSurf
,
NULL
);
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpSurf
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
skip
(
"failed to create surface
\n
"
);
{
goto
err
;
skip
(
"failed to create surface
\n
"
);
goto
err
;
}
}
hr
=
IDirectDrawSurface_SetPalette
(
lpSurf
,
palette
);
hr
=
IDirectDrawSurface_SetPalette
(
lpSurf
,
palette
);
...
...
dlls/ddraw/utils.c
View file @
b1a385db
...
@@ -598,7 +598,7 @@ enum wined3d_format_id PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat
...
@@ -598,7 +598,7 @@ enum wined3d_format_id PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat
}
}
if
(
DDPixelFormat
->
dwFourCC
==
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'5'
))
if
(
DDPixelFormat
->
dwFourCC
==
MAKEFOURCC
(
'D'
,
'X'
,
'T'
,
'5'
))
{
{
return
WINED3DFMT_DXT5
;
return
WINED3DFMT_DXT5
;
}
}
if
(
DDPixelFormat
->
dwFourCC
==
MAKEFOURCC
(
'G'
,
'R'
,
'G'
,
'B'
))
if
(
DDPixelFormat
->
dwFourCC
==
MAKEFOURCC
(
'G'
,
'R'
,
'G'
,
'B'
))
{
{
...
@@ -664,7 +664,7 @@ DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *ddck)
...
@@ -664,7 +664,7 @@ DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *ddck)
static
void
DDRAW_dump_flags_nolf
(
DWORD
flags
,
const
flag_info
*
names
,
static
void
DDRAW_dump_flags_nolf
(
DWORD
flags
,
const
flag_info
*
names
,
size_t
num_names
)
size_t
num_names
)
{
{
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
num_names
;
i
++
)
for
(
i
=
0
;
i
<
num_names
;
i
++
)
if
((
flags
&
names
[
i
].
val
)
||
/* standard flag value */
if
((
flags
&
names
[
i
].
val
)
||
/* standard flag value */
...
...
dlls/ddraw/viewport.c
View file @
b1a385db
...
@@ -52,20 +52,23 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
...
@@ -52,20 +52,23 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
}
}
/* And copy the values in the structure used by the device */
/* 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
.
dwX
=
This
->
viewports
.
vp2
.
dwX
;
vp
.
dwY
=
This
->
viewports
.
vp2
.
dwY
;
vp
.
dwY
=
This
->
viewports
.
vp2
.
dwY
;
vp
.
dwHeight
=
This
->
viewports
.
vp2
.
dwHeight
;
vp
.
dwHeight
=
This
->
viewports
.
vp2
.
dwHeight
;
vp
.
dwWidth
=
This
->
viewports
.
vp2
.
dwWidth
;
vp
.
dwWidth
=
This
->
viewports
.
vp2
.
dwWidth
;
vp
.
dvMinZ
=
This
->
viewports
.
vp2
.
dvMinZ
;
vp
.
dvMinZ
=
This
->
viewports
.
vp2
.
dvMinZ
;
vp
.
dvMaxZ
=
This
->
viewports
.
vp2
.
dvMaxZ
;
vp
.
dvMaxZ
=
This
->
viewports
.
vp2
.
dvMaxZ
;
}
else
{
}
else
{
vp
.
dwX
=
This
->
viewports
.
vp1
.
dwX
;
vp
.
dwX
=
This
->
viewports
.
vp1
.
dwX
;
vp
.
dwY
=
This
->
viewports
.
vp1
.
dwY
;
vp
.
dwY
=
This
->
viewports
.
vp1
.
dwY
;
vp
.
dwHeight
=
This
->
viewports
.
vp1
.
dwHeight
;
vp
.
dwHeight
=
This
->
viewports
.
vp1
.
dwHeight
;
vp
.
dwWidth
=
This
->
viewports
.
vp1
.
dwWidth
;
vp
.
dwWidth
=
This
->
viewports
.
vp1
.
dwWidth
;
vp
.
dvMinZ
=
This
->
viewports
.
vp1
.
dvMinZ
;
vp
.
dvMinZ
=
This
->
viewports
.
vp1
.
dvMinZ
;
vp
.
dvMaxZ
=
This
->
viewports
.
vp1
.
dvMaxZ
;
vp
.
dvMaxZ
=
This
->
viewports
.
vp1
.
dvMaxZ
;
}
}
/* And also set the viewport */
/* And also set the viewport */
...
@@ -81,29 +84,29 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
...
@@ -81,29 +84,29 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
static
void
_dump_D3DVIEWPORT
(
const
D3DVIEWPORT
*
lpvp
)
static
void
_dump_D3DVIEWPORT
(
const
D3DVIEWPORT
*
lpvp
)
{
{
TRACE
(
" - dwSize = %d dwX = %d dwY = %d
\n
"
,
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
"
,
TRACE
(
" - dwWidth = %d dwHeight = %d
\n
"
,
lpvp
->
dwWidth
,
lpvp
->
dwHeight
);
lpvp
->
dwWidth
,
lpvp
->
dwHeight
);
TRACE
(
" - dvScaleX = %f dvScaleY = %f
\n
"
,
TRACE
(
" - dvScaleX = %f dvScaleY = %f
\n
"
,
lpvp
->
dvScaleX
,
lpvp
->
dvScaleY
);
lpvp
->
dvScaleX
,
lpvp
->
dvScaleY
);
TRACE
(
" - dvMaxX = %f dvMaxY = %f
\n
"
,
TRACE
(
" - dvMaxX = %f dvMaxY = %f
\n
"
,
lpvp
->
dvMaxX
,
lpvp
->
dvMaxY
);
lpvp
->
dvMaxX
,
lpvp
->
dvMaxY
);
TRACE
(
" - dvMinZ = %f dvMaxZ = %f
\n
"
,
TRACE
(
" - dvMinZ = %f dvMaxZ = %f
\n
"
,
lpvp
->
dvMinZ
,
lpvp
->
dvMaxZ
);
lpvp
->
dvMinZ
,
lpvp
->
dvMaxZ
);
}
}
static
void
_dump_D3DVIEWPORT2
(
const
D3DVIEWPORT2
*
lpvp
)
static
void
_dump_D3DVIEWPORT2
(
const
D3DVIEWPORT2
*
lpvp
)
{
{
TRACE
(
" - dwSize = %d dwX = %d dwY = %d
\n
"
,
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
"
,
TRACE
(
" - dwWidth = %d dwHeight = %d
\n
"
,
lpvp
->
dwWidth
,
lpvp
->
dwHeight
);
lpvp
->
dwWidth
,
lpvp
->
dwHeight
);
TRACE
(
" - dvClipX = %f dvClipY = %f
\n
"
,
TRACE
(
" - dvClipX = %f dvClipY = %f
\n
"
,
lpvp
->
dvClipX
,
lpvp
->
dvClipY
);
lpvp
->
dvClipX
,
lpvp
->
dvClipY
);
TRACE
(
" - dvClipWidth = %f dvClipHeight = %f
\n
"
,
TRACE
(
" - dvClipWidth = %f dvClipHeight = %f
\n
"
,
lpvp
->
dvClipWidth
,
lpvp
->
dvClipHeight
);
lpvp
->
dvClipWidth
,
lpvp
->
dvClipHeight
);
TRACE
(
" - dvMinZ = %f dvMaxZ = %f
\n
"
,
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)
...
@@ -126,25 +129,23 @@ static void _dump_D3DVIEWPORT2(const D3DVIEWPORT2 *lpvp)
* E_NOINTERFACE if the requested interface wasn't found
* E_NOINTERFACE if the requested interface wasn't found
*
*
*****************************************************************************/
*****************************************************************************/
static
HRESULT
WINAPI
static
HRESULT
WINAPI
IDirect3DViewportImpl_QueryInterface
(
IDirect3DViewport3
*
iface
,
REFIID
riid
,
void
**
object
)
IDirect3DViewportImpl_QueryInterface
(
IDirect3DViewport3
*
iface
,
REFIID
riid
,
void
**
obp
)
{
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obp
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
*
obp
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
if
(
IsEqualGUID
(
&
IID_IDirect3DViewport3
,
riid
)
IsEqualGUID
(
&
IID_IDirect3DViewport
,
riid
)
||
||
IsEqualGUID
(
&
IID_IDirect3DViewport2
,
riid
)
IsEqualGUID
(
&
IID_IDirect3DViewport2
,
riid
)
||
||
IsEqualGUID
(
&
IID_IDirect3DViewport
,
riid
)
IsEqualGUID
(
&
IID_IDirect3DViewport3
,
riid
)
)
{
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
IDirect3DViewport3_AddRef
(
iface
);
IDirect3DViewport3_AddRef
(
iface
);
*
obp
=
iface
;
*
object
=
iface
;
TRACE
(
" Creating IDirect3DViewport1/2/3 interface %p
\n
"
,
*
obp
);
return
S_OK
;
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
;
return
E_NOINTERFACE
;
}
}
...
@@ -187,7 +188,7 @@ IDirect3DViewportImpl_Release(IDirect3DViewport3 *iface)
...
@@ -187,7 +188,7 @@ IDirect3DViewportImpl_Release(IDirect3DViewport3 *iface)
if
(
!
ref
)
{
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
0
;
}
}
return
ref
;
return
ref
;
}
}
...
@@ -263,7 +264,7 @@ IDirect3DViewportImpl_GetViewport(IDirect3DViewport3 *iface,
...
@@ -263,7 +264,7 @@ IDirect3DViewportImpl_GetViewport(IDirect3DViewport3 *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" returning D3DVIEWPORT :
\n
"
);
TRACE
(
" returning D3DVIEWPORT :
\n
"
);
_dump_D3DVIEWPORT
(
lpData
);
_dump_D3DVIEWPORT
(
lpData
);
}
}
LeaveCriticalSection
(
&
ddraw_cs
);
LeaveCriticalSection
(
&
ddraw_cs
);
...
@@ -295,7 +296,7 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
...
@@ -295,7 +296,7 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" getting D3DVIEWPORT :
\n
"
);
TRACE
(
" getting D3DVIEWPORT :
\n
"
);
_dump_D3DVIEWPORT
(
lpData
);
_dump_D3DVIEWPORT
(
lpData
);
}
}
EnterCriticalSection
(
&
ddraw_cs
);
EnterCriticalSection
(
&
ddraw_cs
);
...
@@ -669,7 +670,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
...
@@ -669,7 +670,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
if
(
This
->
active_device
==
NULL
)
{
if
(
This
->
active_device
==
NULL
)
{
ERR
(
" Trying to clear a viewport not attached to a device !
\n
"
);
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
;
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
...
@@ -738,9 +739,10 @@ IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
...
@@ -738,9 +739,10 @@ IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
}
}
/* Find a light number and update both light and viewports objects accordingly */
/* Find a light number and update both light and viewports objects accordingly */
while
(
map
&
1
)
{
while
(
map
&
1
)
map
>>=
1
;
{
i
++
;
map
>>=
1
;
++
i
;
}
}
lpDirect3DLightImpl
->
dwLightIndex
=
i
;
lpDirect3DLightImpl
->
dwLightIndex
=
i
;
This
->
num_lights
++
;
This
->
num_lights
++
;
...
@@ -791,18 +793,18 @@ IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *iface,
...
@@ -791,18 +793,18 @@ IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *iface,
if
(
cur_light
==
lpDirect3DLightImpl
)
if
(
cur_light
==
lpDirect3DLightImpl
)
{
{
light_deactivate
(
lpDirect3DLightImpl
);
light_deactivate
(
lpDirect3DLightImpl
);
if
(
prev_light
==
NULL
)
This
->
lights
=
cur_light
->
next
;
if
(
!
prev_light
)
This
->
lights
=
cur_light
->
next
;
else
prev_light
->
next
=
cur_light
->
next
;
else
prev_light
->
next
=
cur_light
->
next
;
/* Detach the light to the viewport
*/
/* Detach the light from the viewport.
*/
cur_light
->
active_viewport
=
NULL
;
cur_light
->
active_viewport
=
NULL
;
IDirect3DLight_Release
(
(
IDirect3DLight
*
)
cur_light
);
IDirect3DLight_Release
((
IDirect3DLight
*
)
cur_light
);
This
->
num_lights
--
;
--
This
->
num_lights
;
This
->
map_lights
&=
~
(
1
<<
lpDirect3DLightImpl
->
dwLightIndex
);
This
->
map_lights
&=
~
(
1
<<
lpDirect3DLightImpl
->
dwLightIndex
);
LeaveCriticalSection
(
&
ddraw_cs
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
return
D3D_OK
;
}
}
prev_light
=
cur_light
;
prev_light
=
cur_light
;
cur_light
=
cur_light
->
next
;
cur_light
=
cur_light
->
next
;
}
}
LeaveCriticalSection
(
&
ddraw_cs
);
LeaveCriticalSection
(
&
ddraw_cs
);
...
@@ -933,7 +935,7 @@ IDirect3DViewportImpl_GetViewport2(IDirect3DViewport3 *iface,
...
@@ -933,7 +935,7 @@ IDirect3DViewportImpl_GetViewport2(IDirect3DViewport3 *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" returning D3DVIEWPORT2 :
\n
"
);
TRACE
(
" returning D3DVIEWPORT2 :
\n
"
);
_dump_D3DVIEWPORT2
(
lpData
);
_dump_D3DVIEWPORT2
(
lpData
);
}
}
LeaveCriticalSection
(
&
ddraw_cs
);
LeaveCriticalSection
(
&
ddraw_cs
);
...
@@ -964,7 +966,7 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
...
@@ -964,7 +966,7 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
if
(
TRACE_ON
(
ddraw
))
if
(
TRACE_ON
(
ddraw
))
{
{
TRACE
(
" getting D3DVIEWPORT2 :
\n
"
);
TRACE
(
" getting D3DVIEWPORT2 :
\n
"
);
_dump_D3DVIEWPORT2
(
lpData
);
_dump_D3DVIEWPORT2
(
lpData
);
}
}
EnterCriticalSection
(
&
ddraw_cs
);
EnterCriticalSection
(
&
ddraw_cs
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment