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

ddraw: Remove a useless viewport callback.

parent 14399f61
......@@ -4533,7 +4533,6 @@ static HRESULT WINAPI d3d3_CreateViewport(IDirect3D3 *iface, IDirect3DViewport3
object->ref = 1;
object->ddraw = ddraw_from_d3d3(iface);
object->use_vp2 = 0xff;
object->activate = viewport_activate;
TRACE("Created viewport %p.\n", object);
*viewport = (IDirect3DViewport3 *)object;
......
......@@ -585,9 +585,6 @@ struct IDirect3DViewportImpl
D3DVIEWPORT2 vp2;
} viewports;
/* Activation function */
void (*activate)(IDirect3DViewportImpl*, BOOL);
/* Field used to chain viewports together */
IDirect3DViewportImpl *next;
......
......@@ -1872,7 +1872,7 @@ IDirect3DDeviceImpl_3_SetCurrentViewport(IDirect3DDevice3 *iface,
/* Activate this viewport */
This->current_viewport->active_device = This;
This->current_viewport->activate(This->current_viewport, FALSE);
viewport_activate(This->current_viewport, FALSE);
LeaveCriticalSection(&ddraw_cs);
return D3D_OK;
......
......@@ -103,7 +103,7 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
/* Activate the viewport */
lpViewport->active_device = lpDevice;
lpViewport->activate(lpViewport, FALSE);
viewport_activate(lpViewport, FALSE);
TRACE("ExecuteData :\n");
if (TRACE_ON(d3d7))
......
......@@ -325,8 +325,9 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
if (This->active_device) {
IDirect3DDevice3 *d3d_device3 = (IDirect3DDevice3 *)&This->active_device->IDirect3DDevice3_vtbl;
IDirect3DDevice3_GetCurrentViewport(d3d_device3, &current_viewport);
if (current_viewport) {
if ((IDirect3DViewportImpl *)current_viewport == This) This->activate(This, FALSE);
if (current_viewport)
{
if ((IDirect3DViewportImpl *)current_viewport == This) viewport_activate(This, FALSE);
IDirect3DViewport3_Release(current_viewport);
}
}
......@@ -697,7 +698,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
/* Need to temporarily activate viewport to clear it. Previously active one will be restored
afterwards. */
This->activate(This, TRUE);
viewport_activate(This, TRUE);
hr = IDirect3DDevice7_Clear((IDirect3DDevice7 *)This->active_device, dwCount, lpRects,
dwFlags & (D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET), color, 1.0, 0x00000000);
......@@ -705,7 +706,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
IDirect3DDevice3_GetCurrentViewport(d3d_device3, &current_viewport);
if(current_viewport) {
IDirect3DViewportImpl *vp = (IDirect3DViewportImpl *)current_viewport;
vp->activate(vp, TRUE);
viewport_activate(vp, TRUE);
IDirect3DViewport3_Release(current_viewport);
}
......@@ -978,8 +979,9 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
if (This->active_device) {
IDirect3DDevice3 *d3d_device3 = (IDirect3DDevice3 *)&This->active_device->IDirect3DDevice3_vtbl;
IDirect3DDevice3_GetCurrentViewport(d3d_device3, &current_viewport);
if (current_viewport) {
if ((IDirect3DViewportImpl *)current_viewport == This) This->activate(This, FALSE);
if (current_viewport)
{
if ((IDirect3DViewportImpl *)current_viewport == This) viewport_activate(This, FALSE);
IDirect3DViewport3_Release(current_viewport);
}
}
......@@ -1074,16 +1076,16 @@ IDirect3DViewportImpl_Clear2(IDirect3DViewport3 *iface,
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);
/* Need to temporarily activate viewport to clear it. Previously active
* one will be restored afterwards. */
viewport_activate(This, TRUE);
hr = IDirect3DDevice7_Clear((IDirect3DDevice7 *)This->active_device,
dwCount, lpRects, dwFlags, dwColor, dvZ, dwStencil);
IDirect3DDevice3_GetCurrentViewport(d3d_device3, &current_viewport);
if(current_viewport) {
IDirect3DViewportImpl *vp = (IDirect3DViewportImpl *)current_viewport;
vp->activate(vp, TRUE);
viewport_activate(vp, TRUE);
IDirect3DViewport3_Release(current_viewport);
}
LeaveCriticalSection(&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