Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
9a0c885e
Commit
9a0c885e
authored
Jan 21, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Get rid of ICOM_INTERFACE.
parent
ad171b14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
152 additions
and
213 deletions
+152
-213
clipper.c
dlls/ddraw/clipper.c
+3
-5
ddcomimpl.h
dlls/ddraw/ddcomimpl.h
+3
-7
ddraw.c
dlls/ddraw/ddraw.c
+29
-43
ddraw_thunks.c
dlls/ddraw/ddraw_thunks.c
+4
-4
device.c
dlls/ddraw/device.c
+0
-0
direct3d.c
dlls/ddraw/direct3d.c
+0
-0
executebuffer.c
dlls/ddraw/executebuffer.c
+12
-14
gamma.c
dlls/ddraw/gamma.c
+3
-5
light.c
dlls/ddraw/light.c
+3
-3
main.c
dlls/ddraw/main.c
+16
-20
material.c
dlls/ddraw/material.c
+8
-9
parent.c
dlls/ddraw/parent.c
+3
-4
surface.c
dlls/ddraw/surface.c
+26
-34
texture.c
dlls/ddraw/texture.c
+9
-13
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+14
-28
viewport.c
dlls/ddraw/viewport.c
+19
-24
No files found.
dlls/ddraw/clipper.c
View file @
9a0c885e
...
...
@@ -62,14 +62,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
static
HRESULT
WINAPI
IDirectDrawClipperImpl_QueryInterface
(
LPDIRECTDRAWCLIPPER
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IDirectDrawClipperImpl
*
This
=
(
IDirectDrawClipperImpl
*
)
iface
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectDrawClipper
,
riid
))
{
*
ppvObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawClipper
);
InterlockedIncrement
(
&
This
->
ref
)
;
return
S_OK
;
IUnknown_AddRef
(
iface
);
*
ppvObj
=
iface
;
return
S_OK
;
}
else
{
...
...
dlls/ddraw/ddcomimpl.h
View file @
9a0c885e
...
...
@@ -38,11 +38,7 @@
#define ICOM_THIS_FROM(impltype, ifacename, ifaceptr) \
impltype* This = ICOM_OBJECT(impltype, ifacename, ifaceptr)
/* Given an object and interface name, returns a pointer to that interface. */
#define ICOM_INTERFACE(implobj, iface) \
((iface *)(implobj == NULL ? NULL :&((implobj)->ICOM_VFIELD_MULTI_NAME(iface))))
#define COM_INTERFACE_CAST(impltype, ifnamefrom, ifnameto, ifaceptr) \
ICOM_INTERFACE(ICOM_OBJECT(impltype, ifnamefrom, ifaceptr), ifnameto)
#define COM_INTERFACE_CAST(impltype, ifnamefrom, ifnameto, ifaceptr) \
((ifaceptr) ? (ifnameto *)&(((impltype *)((char *)(ifaceptr) \
- ICOM_VFIELD_OFFSET(impltype, ifnamefrom)))->ICOM_VFIELD_MULTI_NAME(ifnameto)) : NULL)
#endif
/* _DDCOMIMPL_H_ */
dlls/ddraw/ddraw.c
View file @
9a0c885e
This diff is collapsed.
Click to expand it.
dlls/ddraw/ddraw_thunks.c
View file @
9a0c885e
...
...
@@ -1126,7 +1126,7 @@ IDirectDrawImpl_Initialize(LPDIRECTDRAW iface, LPGUID pGUID)
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw
,
iface
);
HRESULT
ret_value
;
ret_value
=
IDirectDraw7_Initialize
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
)
,
pGUID
);
ret_value
=
IDirectDraw7_Initialize
(
(
IDirectDraw7
*
)
This
,
pGUID
);
return
ret_value
;
}
...
...
@@ -1137,7 +1137,7 @@ IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID)
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw2
,
iface
);
HRESULT
ret_value
;
ret_value
=
IDirectDraw7_Initialize
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
)
,
pGUID
);
ret_value
=
IDirectDraw7_Initialize
(
(
IDirectDraw7
*
)
This
,
pGUID
);
return
ret_value
;
}
...
...
@@ -1148,7 +1148,7 @@ IDirectDraw3Impl_Initialize(LPDIRECTDRAW3 iface, LPGUID pGUID)
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw3
,
iface
);
HRESULT
ret_value
;
ret_value
=
IDirectDraw7_Initialize
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
)
,
pGUID
);
ret_value
=
IDirectDraw7_Initialize
(
(
IDirectDraw7
*
)
This
,
pGUID
);
return
ret_value
;
}
...
...
@@ -1159,7 +1159,7 @@ IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID)
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw4
,
iface
);
HRESULT
ret_value
;
ret_value
=
IDirectDraw7_Initialize
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
)
,
pGUID
);
ret_value
=
IDirectDraw7_Initialize
(
(
IDirectDraw7
*
)
This
,
pGUID
);
return
ret_value
;
}
...
...
dlls/ddraw/device.c
View file @
9a0c885e
This diff is collapsed.
Click to expand it.
dlls/ddraw/direct3d.c
View file @
9a0c885e
This diff is collapsed.
Click to expand it.
dlls/ddraw/executebuffer.c
View file @
9a0c885e
...
...
@@ -175,8 +175,8 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
IWineD3DDevice_SetRenderState
(
lpDevice
->
wineD3DDevice
,
WINED3DRS_COLORKEYENABLE
,
1
);
IDirect3DDevice7_DrawIndexedPrimitive
(
ICOM_INTERFACE
(
lpDevice
,
IDirect3DDevice7
)
,
D3DPT_TRIANGLELIST
,
D3DFVF_TLVERTEX
,
tl_vx
,
0
,
This
->
indices
,
count
*
3
,
0
);
IDirect3DDevice7_DrawIndexedPrimitive
(
(
IDirect3DDevice7
*
)
lpDevice
,
D3DPT_TRIANGLELIST
,
D3DFVF_TLVERTEX
,
tl_vx
,
0
,
This
->
indices
,
count
*
3
,
0
);
}
break
;
case
D3DOP_MATRIXLOAD
:
...
...
@@ -233,8 +233,8 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
lpDevice
->
view
=
ci
->
u2
.
dwArg
[
0
];
if
(
ci
->
u1
.
drstRenderStateType
==
D3DTRANSFORMSTATE_PROJECTION
)
lpDevice
->
proj
=
ci
->
u2
.
dwArg
[
0
];
IDirect3DDevice7_SetTransform
(
ICOM_INTERFACE
(
lpDevice
,
IDirect3DDevice7
)
,
ci
->
u1
.
drstRenderStateType
,
(
LPD3DMATRIX
)
lpDevice
->
Handles
[
ci
->
u2
.
dwArg
[
0
]
-
1
].
ptr
);
IDirect3DDevice7_SetTransform
(
(
IDirect3DDevice7
*
)
lpDevice
,
ci
->
u1
.
drstRenderStateType
,
(
LPD3DMATRIX
)
lpDevice
->
Handles
[
ci
->
u2
.
dwArg
[
0
]
-
1
].
ptr
);
}
instr
+=
size
;
}
...
...
@@ -303,8 +303,7 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
break
;
}
IDirect3DDevice7_SetRenderState
(
ICOM_INTERFACE
(
lpDevice
,
IDirect3DDevice7
),
rs
,
ci
->
u2
.
dwArg
[
0
]);
IDirect3DDevice7_SetRenderState
((
IDirect3DDevice7
*
)
lpDevice
,
rs
,
ci
->
u2
.
dwArg
[
0
]);
}
instr
+=
size
;
...
...
@@ -313,13 +312,13 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
case
D3DOP_STATERENDER
:
{
int
i
;
IDirect3DDevice2
*
d3d_device2
=
(
IDirect3DDevice2
*
)
&
lpDevice
->
IDirect3DDevice2_vtbl
;
TRACE
(
"STATERENDER (%d)
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
LPD3DSTATE
ci
=
(
LPD3DSTATE
)
instr
;
IDirect3DDevice2_SetRenderState
(
ICOM_INTERFACE
(
lpDevice
,
IDirect3DDevice2
),
ci
->
u1
.
drstRenderStateType
,
ci
->
u2
.
dwArg
[
0
]);
IDirect3DDevice2_SetRenderState
(
d3d_device2
,
ci
->
u1
.
drstRenderStateType
,
ci
->
u2
.
dwArg
[
0
]);
instr
+=
size
;
}
...
...
@@ -592,24 +591,23 @@ IDirect3DExecuteBufferImpl_QueryInterface(IDirect3DExecuteBuffer *iface,
REFIID
riid
,
void
**
obj
)
{
ICOM_THIS_FROM
(
IDirect3DExecuteBufferImpl
,
IDirect3DExecuteBuffer
,
iface
);
TRACE
(
"(%p/%p)->(%s,%p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
{
IDirect3DExecuteBuffer_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DExecuteBuffer
)
);
IDirect3DExecuteBuffer_AddRef
(
iface
);
*
obj
=
iface
;
TRACE
(
" Creating IUnknown interface at %p.
\n
"
,
*
obj
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DExecuteBuffer
,
riid
)
)
{
IDirect3DExecuteBuffer_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DExecuteBuffer
)
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirect3DExecuteBuffer
)
;
IDirect3DExecuteBuffer_AddRef
(
iface
);
*
obj
=
iface
;
TRACE
(
" Creating IDirect3DExecuteBuffer interface %p
\n
"
,
*
obj
);
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
"
,
iface
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
...
...
dlls/ddraw/gamma.c
View file @
9a0c885e
...
...
@@ -67,9 +67,7 @@ IDirectDrawGammaControlImpl_QueryInterface(IDirectDrawGammaControl *iface, REFII
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawGammaControl
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->(%s,%p): Thunking to IDirectDrawSurface7
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
return
IDirectDrawSurface7_QueryInterface
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
),
riid
,
obj
);
return
IDirectDrawSurface7_QueryInterface
((
IDirectDrawSurface7
*
)
This
,
riid
,
obj
);
}
/**********************************************************
...
...
@@ -87,7 +85,7 @@ IDirectDrawGammaControlImpl_AddRef(IDirectDrawGammaControl *iface)
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawGammaControl
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->() Thunking to IDirectDrawSurface7
\n
"
,
This
);
return
IDirectDrawSurface7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
);
return
IDirectDrawSurface7_AddRef
(
(
IDirectDrawSurface7
*
)
This
);
}
/**********************************************************
...
...
@@ -105,7 +103,7 @@ IDirectDrawGammaControlImpl_Release(IDirectDrawGammaControl *iface)
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawGammaControl
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->() Thunking to IDirectDrawSurface7
\n
"
,
This
);
return
IDirectDrawSurface7_Release
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
);
return
IDirectDrawSurface7_Release
(
(
IDirectDrawSurface7
*
)
This
);
}
/**********************************************************
...
...
dlls/ddraw/light.c
View file @
9a0c885e
...
...
@@ -256,7 +256,7 @@ void light_update(IDirect3DLightImpl* This)
return
;
device
=
This
->
active_viewport
->
active_device
;
IDirect3DDevice7_SetLight
(
ICOM_INTERFACE
(
device
,
IDirect3DDevice7
)
,
This
->
dwLightIndex
,
&
(
This
->
light7
));
IDirect3DDevice7_SetLight
(
(
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
&
(
This
->
light7
));
}
/*****************************************************************************
...
...
@@ -278,7 +278,7 @@ void light_activate(IDirect3DLightImpl* This)
light_update
(
This
);
/* If was not active, activate it */
if
((
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
==
0
)
{
IDirect3DDevice7_LightEnable
(
ICOM_INTERFACE
(
device
,
IDirect3DDevice7
)
,
This
->
dwLightIndex
,
TRUE
);
IDirect3DDevice7_LightEnable
(
(
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
TRUE
);
This
->
light
.
dwFlags
|=
D3DLIGHT_ACTIVE
;
}
}
...
...
@@ -302,7 +302,7 @@ void light_desactivate(IDirect3DLightImpl* This)
/* If was not active, activate it */
if
((
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
!=
0
)
{
IDirect3DDevice7_LightEnable
(
ICOM_INTERFACE
(
device
,
IDirect3DDevice7
)
,
This
->
dwLightIndex
,
FALSE
);
IDirect3DDevice7_LightEnable
(
(
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
FALSE
);
This
->
light
.
dwFlags
&=
~
D3DLIGHT_ACTIVE
;
}
}
...
...
dlls/ddraw/main.c
View file @
9a0c885e
...
...
@@ -233,8 +233,7 @@ DDRAW_Create(const GUID *guid,
* initialized
*/
hr
=
IWineD3D_CreateDevice
(
wineD3D
,
0
/* D3D_ADAPTER_DEFAULT */
,
devicetype
,
NULL
/* FocusWindow, don't know yet */
,
0
/* BehaviorFlags */
,
(
IUnknown
*
)
ICOM_INTERFACE
(
This
,
IDirectDraw7
),
(
IWineD3DDeviceParent
*
)
&
This
->
device_parent_vtbl
,
&
wineD3DDevice
);
0
/* BehaviorFlags */
,
(
IUnknown
*
)
This
,
(
IWineD3DDeviceParent
*
)
&
This
->
device_parent_vtbl
,
&
wineD3DDevice
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create a wineD3DDevice, result = %x
\n
"
,
hr
);
...
...
@@ -283,7 +282,7 @@ DDRAW_Create(const GUID *guid,
/* Call QueryInterface to get the pointer to the requested interface. This also initializes
* The required refcount
*/
hr
=
IDirectDraw7_QueryInterface
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
)
,
iid
,
DD
);
hr
=
IDirectDraw7_QueryInterface
(
(
IDirectDraw7
*
)
This
,
iid
,
DD
);
if
(
SUCCEEDED
(
hr
))
return
DD_OK
;
err_out:
...
...
@@ -705,7 +704,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
factory
->
pfnCreateInstance
=
object_creation
[
i
].
pfnCreateInstance
;
*
ppv
=
ICOM_INTERFACE
(
factory
,
IClassFactory
)
;
*
ppv
=
factory
;
return
S_OK
;
}
...
...
@@ -899,11 +898,11 @@ DllMain(HINSTANCE hInstDLL,
WARN
(
"DDraw %p has a refcount of %d
\n
"
,
ddraw
,
ddraw
->
ref7
+
ddraw
->
ref4
+
ddraw
->
ref3
+
ddraw
->
ref2
+
ddraw
->
ref1
);
/* Add references to each interface to avoid freeing them unexpectedly */
IDirectDraw_AddRef
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw
)
);
IDirectDraw2_AddRef
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw2
)
);
IDirectDraw3_AddRef
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw3
)
);
IDirectDraw4_AddRef
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw4
)
);
IDirectDraw7_AddRef
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw7
)
);
IDirectDraw_AddRef
(
(
IDirectDraw
*
)
&
ddraw
->
IDirectDraw_vtbl
);
IDirectDraw2_AddRef
(
(
IDirectDraw2
*
)
&
ddraw
->
IDirectDraw2_vtbl
);
IDirectDraw3_AddRef
(
(
IDirectDraw3
*
)
&
ddraw
->
IDirectDraw3_vtbl
);
IDirectDraw4_AddRef
(
(
IDirectDraw4
*
)
&
ddraw
->
IDirectDraw4_vtbl
);
IDirectDraw7_AddRef
(
(
IDirectDraw7
*
)
ddraw
);
/* Does a D3D device exist? Destroy it
* TODO: Destroy all Vertex buffers, Lights, Materials
...
...
@@ -912,7 +911,7 @@ DllMain(HINSTANCE hInstDLL,
if
(
ddraw
->
d3ddevice
)
{
WARN
(
"DDraw %p has d3ddevice %p attached
\n
"
,
ddraw
,
ddraw
->
d3ddevice
);
while
(
IDirect3DDevice7_Release
(
ICOM_INTERFACE
(
ddraw
->
d3ddevice
,
IDirect3DDevice7
)
));
while
(
IDirect3DDevice7_Release
(
(
IDirect3DDevice7
*
)
ddraw
->
d3ddevice
));
}
/* Try to release the objects
...
...
@@ -922,11 +921,8 @@ DllMain(HINSTANCE hInstDLL,
desc
.
dwSize
=
sizeof
(
desc
);
for
(
i
=
0
;
i
<=
1
;
i
++
)
{
hr
=
IDirectDraw7_EnumSurfaces
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw7
),
DDENUMSURFACES_ALL
,
&
desc
,
ddraw
,
DestroyCallback
);
hr
=
IDirectDraw7_EnumSurfaces
((
IDirectDraw7
*
)
ddraw
,
DDENUMSURFACES_ALL
,
&
desc
,
ddraw
,
DestroyCallback
);
if
(
hr
!=
D3D_OK
)
ERR
(
"(%p) EnumSurfaces failed, prepare for trouble
\n
"
,
ddraw
);
}
...
...
@@ -938,11 +934,11 @@ DllMain(HINSTANCE hInstDLL,
/* Release all hanging references to destroy the objects. This
* restores the screen mode too
*/
while
(
IDirectDraw_Release
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw
)
));
while
(
IDirectDraw2_Release
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw2
)
));
while
(
IDirectDraw3_Release
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw3
)
));
while
(
IDirectDraw4_Release
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw4
)
));
while
(
IDirectDraw7_Release
(
ICOM_INTERFACE
(
ddraw
,
IDirectDraw7
)
));
while
(
IDirectDraw_Release
(
(
IDirectDraw
*
)
&
ddraw
->
IDirectDraw_vtbl
));
while
(
IDirectDraw2_Release
(
(
IDirectDraw2
*
)
&
ddraw
->
IDirectDraw2_vtbl
));
while
(
IDirectDraw3_Release
(
(
IDirectDraw3
*
)
&
ddraw
->
IDirectDraw3_vtbl
));
while
(
IDirectDraw4_Release
(
(
IDirectDraw4
*
)
&
ddraw
->
IDirectDraw4_vtbl
));
while
(
IDirectDraw7_Release
(
(
IDirectDraw7
*
)
ddraw
));
}
}
}
...
...
dlls/ddraw/material.c
View file @
9a0c885e
...
...
@@ -80,26 +80,26 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
*
obp
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
{
I
Direct3DMaterial_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DMaterial
)
);
I
Unknown_AddRef
(
iface
);
*
obp
=
iface
;
TRACE
(
" Creating IUnknown interface at %p.
\n
"
,
*
obp
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial
,
riid
)
)
{
IDirect3DMaterial_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DMaterial
)
);
*
obp
=
ICOM_INTERFACE
(
This
,
IDirect3DMaterial
)
;
IDirect3DMaterial_AddRef
(
(
IDirect3DMaterial
*
)
&
This
->
IDirect3DMaterial_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial_vtbl
;
TRACE
(
" Creating IDirect3DMaterial interface %p
\n
"
,
*
obp
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial2
,
riid
)
)
{
IDirect3DMaterial_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DMaterial
)
);
*
obp
=
ICOM_INTERFACE
(
This
,
IDirect3DMaterial2
)
;
IDirect3DMaterial_AddRef
(
(
IDirect3DMaterial2
*
)
&
This
->
IDirect3DMaterial2_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial2_vtbl
;
TRACE
(
" Creating IDirect3DMaterial2 interface %p
\n
"
,
*
obp
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial3
,
riid
)
)
{
IDirect3DMaterial_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DMaterial
)
);
*
obp
=
ICOM_INTERFACE
(
This
,
IDirect3DMaterial3
)
;
IDirect3DMaterial_AddRef
(
(
IDirect3DMaterial2
*
)
&
This
->
IDirect3DMaterial3_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial3_vtbl
;
TRACE
(
" Creating IDirect3DMaterial3 interface %p
\n
"
,
*
obp
);
return
S_OK
;
}
...
...
@@ -465,8 +465,7 @@ void material_activate(IDirect3DMaterialImpl* This)
d3d7mat
.
u3
.
emissive
=
This
->
mat
.
u3
.
emissive
;
d3d7mat
.
u4
.
power
=
This
->
mat
.
u4
.
power
;
IDirect3DDevice7_SetMaterial
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice7
),
&
d3d7mat
);
IDirect3DDevice7_SetMaterial
((
IDirect3DDevice7
*
)
This
->
active_device
,
&
d3d7mat
);
}
const
IDirect3DMaterial3Vtbl
IDirect3DMaterial3_Vtbl
=
...
...
dlls/ddraw/parent.c
View file @
9a0c885e
...
...
@@ -68,15 +68,14 @@ IParentImpl_QueryInterface(IParent *iface,
REFIID
riid
,
void
**
obj
)
{
ICOM_THIS_FROM
(
IParentImpl
,
IParent
,
iface
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IParent
,
riid
)
)
{
*
obj
=
ICOM_INTERFACE
(
This
,
IParent
)
;
IParent_AddRef
(
ICOM_INTERFACE
(
This
,
IParent
)
);
*
obj
=
iface
;
IParent_AddRef
(
iface
);
return
DD_OK
;
}
return
E_NOINTERFACE
;
...
...
dlls/ddraw/surface.c
View file @
9a0c885e
...
...
@@ -89,7 +89,7 @@ IDirectDrawSurfaceImpl_QueryInterface(IDirectDrawSurface7 *iface,
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawSurface4
)
)
{
IUnknown_AddRef
(
iface
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
;
*
obj
=
iface
;
TRACE
(
"(%p) returning IDirectDrawSurface7 interface at %p
\n
"
,
This
,
*
obj
);
return
S_OK
;
}
...
...
@@ -98,14 +98,14 @@ IDirectDrawSurfaceImpl_QueryInterface(IDirectDrawSurface7 *iface,
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawSurface
)
)
{
IUnknown_AddRef
(
iface
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface3
)
;
*
obj
=
&
This
->
IDirectDrawSurface3_vtbl
;
TRACE
(
"(%p) returning IDirectDrawSurface3 interface at %p
\n
"
,
This
,
*
obj
);
return
S_OK
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IDirectDrawGammaControl
)
)
{
IUnknown_AddRef
(
iface
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirectDrawGammaControl
)
;
*
obj
=
&
This
->
IDirectDrawGammaControl_vtbl
;
TRACE
(
"(%p) returning IDirectDrawGammaControl interface at %p
\n
"
,
This
,
*
obj
);
return
S_OK
;
}
...
...
@@ -116,10 +116,7 @@ IDirectDrawSurfaceImpl_QueryInterface(IDirectDrawSurface7 *iface,
IDirect3DDevice7
*
d3d
;
/* Call into IDirect3D7 for creation */
IDirect3D7_CreateDevice
(
ICOM_INTERFACE
(
This
->
ddraw
,
IDirect3D7
),
riid
,
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
),
&
d3d
);
IDirect3D7_CreateDevice
((
IDirect3D7
*
)
&
This
->
ddraw
->
IDirect3D7_vtbl
,
riid
,
(
IDirectDrawSurface7
*
)
This
,
&
d3d
);
*
obj
=
COM_INTERFACE_CAST
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
IDirect3DDevice
,
d3d
);
TRACE
(
"(%p) Returning IDirect3DDevice interface at %p
\n
"
,
This
,
*
obj
);
...
...
@@ -131,12 +128,12 @@ IDirectDrawSurfaceImpl_QueryInterface(IDirectDrawSurface7 *iface,
{
if
(
IsEqualGUID
(
&
IID_IDirect3DTexture
,
riid
))
{
*
obj
=
ICOM_INTERFACE
(
This
,
IDirect3DTexture
)
;
*
obj
=
&
This
->
IDirect3DTexture_vtbl
;
TRACE
(
" returning Direct3DTexture interface at %p.
\n
"
,
*
obj
);
}
else
{
*
obj
=
ICOM_INTERFACE
(
This
,
IDirect3DTexture2
)
;
*
obj
=
&
This
->
IDirect3DTexture2_vtbl
;
TRACE
(
" returning Direct3DTexture2 interface at %p.
\n
"
,
*
obj
);
}
IUnknown_AddRef
(
(
IUnknown
*
)
*
obj
);
...
...
@@ -200,8 +197,8 @@ void IDirectDrawSurfaceImpl_Destroy(IDirectDrawSurfaceImpl *This)
* is called, because the refcount is held. It looks like the app released()
* it often enough to force this
*/
IDirectDrawSurface7
*
root
=
ICOM_INTERFACE
(
This
->
first_attached
,
IDirectDrawSurface7
)
;
IDirectDrawSurface7
*
detach
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
;
IDirectDrawSurface7
*
root
=
(
IDirectDrawSurface7
*
)
This
->
first_attached
;
IDirectDrawSurface7
*
detach
=
(
IDirectDrawSurface7
*
)
This
;
FIXME
(
"(%p) Freeing a surface that is attached to surface %p
\n
"
,
This
,
This
->
first_attached
);
...
...
@@ -214,8 +211,8 @@ void IDirectDrawSurfaceImpl_Destroy(IDirectDrawSurfaceImpl *This)
while
(
This
->
next_attached
!=
NULL
)
{
IDirectDrawSurface7
*
root
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
;
IDirectDrawSurface7
*
detach
=
ICOM_INTERFACE
(
This
->
next_attached
,
IDirectDrawSurface7
)
;
IDirectDrawSurface7
*
root
=
(
IDirectDrawSurface7
*
)
This
;
IDirectDrawSurface7
*
detach
=
(
IDirectDrawSurface7
*
)
This
->
next_attached
;
if
(
IDirectDrawSurface7_DeleteAttachedSurface
(
root
,
0
,
detach
)
!=
DD_OK
)
{
...
...
@@ -400,8 +397,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
}
/* The refcount test shows that the palette is detached when the surface is destroyed */
IDirectDrawSurface7_SetPalette
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
),
NULL
);
IDirectDrawSurface7_SetPalette
((
IDirectDrawSurface7
*
)
This
,
NULL
);
/* Loop through all complex attached surfaces,
* and destroy them.
...
...
@@ -515,7 +511,7 @@ IDirectDrawSurfaceImpl_GetAttachedSurface(IDirectDrawSurface7 *iface,
TRACE
(
"(%p): Returning surface %p
\n
"
,
This
,
surf
);
TRACE
(
"(%p): mipmapcount=%d
\n
"
,
This
,
surf
->
mipmap_level
);
*
Surface
=
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
;
*
Surface
=
(
IDirectDrawSurface7
*
)
surf
;
IDirectDrawSurface7_AddRef
(
*
Surface
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
@@ -540,7 +536,7 @@ IDirectDrawSurfaceImpl_GetAttachedSurface(IDirectDrawSurface7 *iface,
((
surf
->
surface_desc
.
ddsCaps
.
dwCaps2
&
our_caps
.
dwCaps2
)
==
our_caps
.
dwCaps2
))
{
TRACE
(
"(%p): Returning surface %p
\n
"
,
This
,
surf
);
*
Surface
=
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
;
*
Surface
=
(
IDirectDrawSurface7
*
)
surf
;
IDirectDrawSurface7_AddRef
(
*
Surface
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
@@ -927,7 +923,7 @@ IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurfaceImpl *This,
/* MSDN:
* "This method increments the reference count of the surface being attached."
*/
IDirectDrawSurface7_AddRef
(
ICOM_INTERFACE
(
Surf
,
IDirectDrawSurface7
)
);
IDirectDrawSurface7_AddRef
(
(
IDirectDrawSurface7
*
)
Surf
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
}
...
...
@@ -1397,10 +1393,10 @@ IDirectDrawSurfaceImpl_EnumAttachedSurfaces(IDirectDrawSurface7 *iface,
surf
=
This
->
complex_array
[
i
];
if
(
!
surf
)
break
;
IDirectDrawSurface7_AddRef
(
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
);
IDirectDrawSurface7_AddRef
(
(
IDirectDrawSurface7
*
)
surf
);
desc
=
surf
->
surface_desc
;
/* check: != DDENUMRET_OK or == DDENUMRET_CANCEL? */
if
(
cb
(
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
,
&
desc
,
context
)
==
DDENUMRET_CANCEL
)
if
(
cb
(
(
IDirectDrawSurface7
*
)
surf
,
&
desc
,
context
)
==
DDENUMRET_CANCEL
)
{
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
@@ -1409,10 +1405,10 @@ IDirectDrawSurfaceImpl_EnumAttachedSurfaces(IDirectDrawSurface7 *iface,
for
(
surf
=
This
->
next_attached
;
surf
!=
NULL
;
surf
=
surf
->
next_attached
)
{
IDirectDrawSurface7_AddRef
(
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
);
IDirectDrawSurface7_AddRef
(
(
IDirectDrawSurface7
*
)
surf
);
desc
=
surf
->
surface_desc
;
/* check: != DDENUMRET_OK or == DDENUMRET_CANCEL? */
if
(
cb
(
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
)
,
&
desc
,
context
)
==
DDENUMRET_CANCEL
)
if
(
cb
(
(
IDirectDrawSurface7
*
)
surf
,
&
desc
,
context
)
==
DDENUMRET_CANCEL
)
{
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
@@ -1938,26 +1934,23 @@ IDirectDrawSurfaceImpl_GetDDInterface(IDirectDrawSurface7 *iface,
switch
(
This
->
version
)
{
case
7
:
*
((
IDirectDraw7
**
)
DD
)
=
ICOM_INTERFACE
(
This
->
ddraw
,
IDirectDraw7
);
IDirectDraw7_AddRef
(
*
(
IDirectDraw7
**
)
DD
);
*
DD
=
This
->
ddraw
;
break
;
case
4
:
*
((
IDirectDraw4
**
)
DD
)
=
ICOM_INTERFACE
(
This
->
ddraw
,
IDirectDraw4
);
IDirectDraw4_AddRef
(
*
(
IDirectDraw4
**
)
DD
);
*
DD
=
&
This
->
ddraw
->
IDirectDraw4_vtbl
;
break
;
case
2
:
*
((
IDirectDraw2
**
)
DD
)
=
ICOM_INTERFACE
(
This
->
ddraw
,
IDirectDraw2
);
IDirectDraw_AddRef
(
*
(
IDirectDraw2
**
)
DD
);
*
DD
=
&
This
->
ddraw
->
IDirectDraw2_vtbl
;
break
;
case
1
:
*
((
IDirectDraw
**
)
DD
)
=
ICOM_INTERFACE
(
This
->
ddraw
,
IDirectDraw
);
IDirectDraw_AddRef
(
*
(
IDirectDraw
**
)
DD
);
*
DD
=
&
This
->
ddraw
->
IDirectDraw_vtbl
;
break
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
DD
);
return
DD_OK
;
}
...
...
@@ -2189,7 +2182,7 @@ IDirectDrawSurfaceImpl_GetClipper(IDirectDrawSurface7 *iface,
return
DDERR_NOCLIPPERATTACHED
;
}
*
Clipper
=
ICOM_INTERFACE
(
This
->
clipper
,
IDirectDrawClipper
)
;
*
Clipper
=
(
IDirectDrawClipper
*
)
This
->
clipper
;
IDirectDrawClipper_AddRef
(
*
Clipper
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
@@ -2229,7 +2222,7 @@ IDirectDrawSurfaceImpl_SetClipper(IDirectDrawSurface7 *iface,
if
(
Clipper
!=
NULL
)
IDirectDrawClipper_AddRef
(
Clipper
);
if
(
oldClipper
)
IDirectDrawClipper_Release
(
ICOM_INTERFACE
(
oldClipper
,
IDirectDrawClipper
)
);
IDirectDrawClipper_Release
(
(
IDirectDrawClipper
*
)
oldClipper
);
hr
=
IWineD3DSurface_SetClipper
(
This
->
WineD3DSurface
,
This
->
clipper
?
This
->
clipper
->
wineD3DClipper
:
NULL
);
...
...
@@ -2591,8 +2584,7 @@ IDirectDrawSurfaceImpl_SetPalette(IDirectDrawSurface7 *iface,
{
IDirectDrawSurface7
*
attach
;
HRESULT
hr
;
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
ICOM_INTERFACE
(
surf
,
IDirectDrawSurface7
),
&
caps2
,
&
attach
);
hr
=
IDirectDrawSurface7_GetAttachedSurface
((
IDirectDrawSurface7
*
)
surf
,
&
caps2
,
&
attach
);
if
(
hr
!=
DD_OK
)
{
break
;
...
...
dlls/ddraw/texture.c
View file @
9a0c885e
...
...
@@ -55,9 +55,7 @@ Thunk_IDirect3DTextureImpl_2_QueryInterface(IDirect3DTexture2 *iface,
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirect3DTexture2
,
iface
);
TRACE
(
"(%p)->(%s,%p) thunking to IDirectDrawSurface7 interface.
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
return
IDirectDrawSurface7_QueryInterface
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
),
riid
,
obj
);
return
IDirectDrawSurface7_QueryInterface
((
IDirectDrawSurface7
*
)
This
,
riid
,
obj
);
}
static
HRESULT
WINAPI
...
...
@@ -68,9 +66,7 @@ Thunk_IDirect3DTextureImpl_1_QueryInterface(IDirect3DTexture *iface,
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirect3DTexture
,
iface
);
TRACE
(
"(%p)->(%s,%p) thunking to IDirectDrawSurface7 interface.
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
return
IDirectDrawSurface7_QueryInterface
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
),
riid
,
obj
);
return
IDirectDrawSurface7_QueryInterface
((
IDirectDrawSurface7
*
)
This
,
riid
,
obj
);
}
static
ULONG
WINAPI
...
...
@@ -79,7 +75,7 @@ Thunk_IDirect3DTextureImpl_2_AddRef(IDirect3DTexture2 *iface)
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirect3DTexture2
,
iface
);
TRACE
(
"(%p)->() thunking to IDirectDrawSurface7 interface.
\n
"
,
This
);
return
IDirectDrawSurface7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
);
return
IDirectDrawSurface7_AddRef
(
(
IDirectDrawSurface7
*
)
This
);
}
static
ULONG
WINAPI
...
...
@@ -97,7 +93,7 @@ Thunk_IDirect3DTextureImpl_2_Release(IDirect3DTexture2 *iface)
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirect3DTexture2
,
iface
);
TRACE
(
"(%p)->() thunking to IDirectDrawSurface7 interface.
\n
"
,
This
);
return
IDirectDrawSurface7_Release
(
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
)
);
return
IDirectDrawSurface7_Release
(
(
IDirectDrawSurface7
*
)
This
);
}
...
...
@@ -242,11 +238,12 @@ Thunk_IDirect3DTextureImpl_1_GetHandle(IDirect3DTexture *iface,
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirect3DTexture
,
iface
);
IDirect3DDeviceImpl
*
d3d
=
ICOM_OBJECT
(
IDirect3DDeviceImpl
,
IDirect3DDevice
,
lpDirect3DDevice
);
IDirect3DTexture2
*
d3d_texture2
=
(
IDirect3DTexture2
*
)
&
This
->
IDirect3DTexture2_vtbl
;
IDirect3DDevice2
*
d3d_device2
=
(
IDirect3DDevice2
*
)
&
d3d
->
IDirect3DDevice2_vtbl
;
TRACE_
(
ddraw_thunk
)(
"(%p)->(%p,%p) thunking to IDirect3DTexture2 interface.
\n
"
,
This
,
d3d
,
lpHandle
);
return
IDirect3DTexture2_GetHandle
(
ICOM_INTERFACE
(
This
,
IDirect3DTexture2
),
ICOM_INTERFACE
(
d3d
,
IDirect3DDevice2
),
lpHandle
);
return
IDirect3DTexture2_GetHandle
(
d3d_texture2
,
d3d_device2
,
lpHandle
);
}
...
...
@@ -267,8 +264,7 @@ get_sub_mimaplevel(IDirectDrawSurfaceImpl *tex_ptr)
IDirectDrawSurfaceImpl
*
surf_ptr
;
HRESULT
hr
;
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
ICOM_INTERFACE
(
tex_ptr
,
IDirectDrawSurface7
),
&
mipmap_caps
,
&
next_level
);
hr
=
IDirectDrawSurface7_GetAttachedSurface
((
IDirectDrawSurface7
*
)
tex_ptr
,
&
mipmap_caps
,
&
next_level
);
if
(
FAILED
(
hr
))
return
NULL
;
surf_ptr
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
next_level
);
...
...
dlls/ddraw/vertexbuffer.c
View file @
9a0c885e
...
...
@@ -77,22 +77,22 @@ IDirect3DVertexBufferImpl_QueryInterface(IDirect3DVertexBuffer7 *iface,
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
)
{
I
Direct3DVertexBuffer7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
I
Unknown_AddRef
(
iface
);
*
obj
=
iface
;
TRACE
(
" Creating IUnknown interface at %p.
\n
"
,
*
obj
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DVertexBuffer
,
riid
)
)
{
I
Direct3DVertexBuffer7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer
)
;
I
Unknown_AddRef
(
iface
);
*
obj
=
&
This
->
IDirect3DVertexBuffer_vtbl
;
TRACE
(
" Creating IDirect3DVertexBuffer interface %p
\n
"
,
*
obj
);
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DVertexBuffer7
,
riid
)
)
{
I
Direct3DVertexBuffer7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
*
obj
=
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
;
I
Unknown_AddRef
(
iface
);
*
obj
=
iface
;
TRACE
(
" Creating IDirect3DVertexBuffer7 interface %p
\n
"
,
*
obj
);
return
S_OK
;
}
...
...
@@ -108,9 +108,7 @@ Thunk_IDirect3DVertexBufferImpl_1_QueryInterface(IDirect3DVertexBuffer *iface,
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->(%s,%p) thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
return
IDirect3DVertexBuffer7_QueryInterface
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
),
riid
,
obj
);
return
IDirect3DVertexBuffer7_QueryInterface
((
IDirect3DVertexBuffer7
*
)
This
,
riid
,
obj
);
}
/*****************************************************************************
...
...
@@ -139,7 +137,7 @@ Thunk_IDirect3DVertexBufferImpl_1_AddRef(IDirect3DVertexBuffer *iface)
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->() thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
);
return
IDirect3DVertexBuffer7_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
return
IDirect3DVertexBuffer7_AddRef
(
(
IDirect3DVertexBuffer7
*
)
This
);
}
...
...
@@ -204,7 +202,7 @@ Thunk_IDirect3DVertexBufferImpl_1_Release(IDirect3DVertexBuffer *iface)
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->() thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
);
return
IDirect3DVertexBuffer7_Release
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
return
IDirect3DVertexBuffer7_Release
(
(
IDirect3DVertexBuffer7
*
)
This
);
}
/*****************************************************************************
...
...
@@ -274,10 +272,7 @@ Thunk_IDirect3DVertexBufferImpl_1_Lock(IDirect3DVertexBuffer *iface,
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->(%08x,%p,%p) thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
,
Flags
,
Data
,
Size
);
return
IDirect3DVertexBuffer7_Lock
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
),
Flags
,
Data
,
Size
);
return
IDirect3DVertexBuffer7_Lock
((
IDirect3DVertexBuffer7
*
)
This
,
Flags
,
Data
,
Size
);
}
/*****************************************************************************
...
...
@@ -309,7 +304,7 @@ Thunk_IDirect3DVertexBufferImpl_1_Unlock(IDirect3DVertexBuffer *iface)
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->() thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
);
return
IDirect3DVertexBuffer7_Unlock
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
)
);
return
IDirect3DVertexBuffer7_Unlock
(
(
IDirect3DVertexBuffer7
*
)
This
);
}
...
...
@@ -424,14 +419,8 @@ Thunk_IDirect3DVertexBufferImpl_1_ProcessVertices(IDirect3DVertexBuffer *iface,
TRACE_
(
ddraw_thunk
)(
"(%p)->(%08x,%08x,%08x,%p,%08x,%p,%08x) thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
,
VertexOp
,
DestIndex
,
Count
,
Src
,
SrcIndex
,
D3D
,
Flags
);
return
IDirect3DVertexBuffer7_ProcessVertices
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
),
VertexOp
,
DestIndex
,
Count
,
ICOM_INTERFACE
(
Src
,
IDirect3DVertexBuffer7
),
SrcIndex
,
ICOM_INTERFACE
(
D3D
,
IDirect3DDevice7
),
Flags
);
return
IDirect3DVertexBuffer7_ProcessVertices
((
IDirect3DVertexBuffer7
*
)
This
,
VertexOp
,
DestIndex
,
Count
,
(
IDirect3DVertexBuffer7
*
)
Src
,
SrcIndex
,
(
IDirect3DDevice7
*
)
D3D
,
Flags
);
}
/*****************************************************************************
...
...
@@ -484,8 +473,7 @@ Thunk_IDirect3DVertexBufferImpl_1_GetVertexBufferDesc(IDirect3DVertexBuffer *ifa
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer
,
iface
);
TRACE_
(
ddraw_thunk
)(
"(%p)->(%p) thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
,
Desc
);
return
IDirect3DVertexBuffer7_GetVertexBufferDesc
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
),
Desc
);
return
IDirect3DVertexBuffer7_GetVertexBufferDesc
((
IDirect3DVertexBuffer7
*
)
This
,
Desc
);
}
...
...
@@ -536,9 +524,7 @@ Thunk_IDirect3DVertexBufferImpl_1_Optimize(IDirect3DVertexBuffer *iface,
IDirect3DDeviceImpl
*
D3D
=
ICOM_OBJECT
(
IDirect3DDeviceImpl
,
IDirect3DDevice3
,
D3DDevice
);
TRACE_
(
ddraw_thunk
)(
"(%p)->(%p,%08x) thunking to IDirect3DVertexBuffer7 interface.
\n
"
,
This
,
D3D
,
Flags
);
return
IDirect3DVertexBuffer7_Optimize
(
ICOM_INTERFACE
(
This
,
IDirect3DVertexBuffer7
),
ICOM_INTERFACE
(
D3D
,
IDirect3DDevice7
),
Flags
);
return
IDirect3DVertexBuffer7_Optimize
((
IDirect3DVertexBuffer7
*
)
This
,
(
IDirect3DDevice7
*
)
D3D
,
Flags
);
}
/*****************************************************************************
...
...
dlls/ddraw/viewport.c
View file @
9a0c885e
...
...
@@ -86,7 +86,7 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
}
/* And also set the viewport */
IDirect3DDevice7_SetViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice7
)
,
&
vp
);
IDirect3DDevice7_SetViewport
(
(
IDirect3DDevice7
*
)
This
->
active_device
,
&
vp
);
}
/*****************************************************************************
...
...
@@ -148,8 +148,7 @@ IDirect3DViewportImpl_QueryInterface(IDirect3DViewport3 *iface,
REFIID
riid
,
void
**
obp
)
{
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obp
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
obp
);
*
obp
=
NULL
;
...
...
@@ -157,12 +156,12 @@ IDirect3DViewportImpl_QueryInterface(IDirect3DViewport3 *iface,
IsEqualGUID
(
&
IID_IDirect3DViewport
,
riid
)
||
IsEqualGUID
(
&
IID_IDirect3DViewport2
,
riid
)
||
IsEqualGUID
(
&
IID_IDirect3DViewport3
,
riid
)
)
{
IDirect3DViewport3_AddRef
(
ICOM_INTERFACE
(
This
,
IDirect3DViewport3
)
);
*
obp
=
ICOM_INTERFACE
(
This
,
IDirect3DViewport3
)
;
IDirect3DViewport3_AddRef
(
iface
);
*
obp
=
iface
;
TRACE
(
" Creating IDirect3DViewport1/2/3 interface %p
\n
"
,
*
obp
);
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
"
,
iface
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
...
...
@@ -312,7 +311,8 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
This
->
viewports
.
vp1
.
dvMaxZ
=
1
.
0
;
if
(
This
->
active_device
)
{
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
),
&
current_viewport
);
IDirect3DDevice3
*
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
if
(
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
)
==
This
)
This
->
activate
(
This
,
FALSE
);
...
...
@@ -668,12 +668,14 @@ IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
DWORD
color
=
0x00000000
;
HRESULT
hr
;
LPDIRECT3DVIEWPORT3
current_viewport
;
IDirect3DDevice3
*
d3d_device3
;
TRACE
(
"(%p/%p)->(%08x,%p,%08x)
\n
"
,
This
,
iface
,
dwCount
,
lpRects
,
dwFlags
);
if
(
This
->
active_device
==
NULL
)
{
ERR
(
" Trying to clear a viewport not attached to a device !
\n
"
);
return
D3DERR_VIEWPORTHASNODEVICE
;
}
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
EnterCriticalSection
(
&
ddraw_cs
);
if
(
dwFlags
&
D3DCLEAR_TARGET
)
{
...
...
@@ -692,15 +694,10 @@ IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
afterwards. */
This
->
activate
(
This
,
TRUE
);
hr
=
IDirect3DDevice7_Clear
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice7
),
dwCount
,
lpRects
,
dwFlags
&
(
D3DCLEAR_ZBUFFER
|
D3DCLEAR_TARGET
),
color
,
1
.
0
,
0x00000000
);
hr
=
IDirect3DDevice7_Clear
((
IDirect3DDevice7
*
)
This
->
active_device
,
dwCount
,
lpRects
,
dwFlags
&
(
D3DCLEAR_ZBUFFER
|
D3DCLEAR_TARGET
),
color
,
1
.
0
,
0x00000000
);
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
)
,
&
current_viewport
);
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
IDirect3DViewportImpl
*
vp
=
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
);
vp
->
activate
(
vp
,
TRUE
);
...
...
@@ -915,7 +912,8 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
memcpy
(
&
(
This
->
viewports
.
vp2
),
lpData
,
lpData
->
dwSize
);
if
(
This
->
active_device
)
{
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
),
&
current_viewport
);
IDirect3DDevice3
*
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
if
(
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
)
==
This
)
This
->
activate
(
This
,
FALSE
);
...
...
@@ -1003,6 +1001,7 @@ IDirect3DViewportImpl_Clear2(IDirect3DViewport3 *iface,
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
HRESULT
hr
;
LPDIRECT3DVIEWPORT3
current_viewport
;
IDirect3DDevice3
*
d3d_device3
;
TRACE
(
"(%p)->(%08x,%p,%08x,%08x,%f,%08x)
\n
"
,
This
,
dwCount
,
lpRects
,
dwFlags
,
dwColor
,
dvZ
,
dwStencil
);
EnterCriticalSection
(
&
ddraw_cs
);
...
...
@@ -1011,18 +1010,14 @@ IDirect3DViewportImpl_Clear2(IDirect3DViewport3 *iface,
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3DERR_VIEWPORTHASNODEVICE
;
}
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
/* Need to temporarily activate viewport to clear it. Previously active one will be restored
afterwards. */
This
->
activate
(
This
,
TRUE
);
hr
=
IDirect3DDevice7_Clear
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice7
),
dwCount
,
lpRects
,
dwFlags
,
dwColor
,
dvZ
,
dwStencil
);
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
),
&
current_viewport
);
hr
=
IDirect3DDevice7_Clear
((
IDirect3DDevice7
*
)
This
->
active_device
,
dwCount
,
lpRects
,
dwFlags
,
dwColor
,
dvZ
,
dwStencil
);
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
IDirect3DViewportImpl
*
vp
=
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
);
vp
->
activate
(
vp
,
TRUE
);
...
...
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