ddraw: Set active_device in AddViewport.
This commit is contained in:
parent
6a48e405db
commit
3e237c6199
|
@ -817,6 +817,8 @@ IDirect3DDeviceImpl_3_AddViewport(IDirect3DDevice3 *iface,
|
|||
EnterCriticalSection(&ddraw_cs);
|
||||
vp->next = This->viewport_list;
|
||||
This->viewport_list = vp;
|
||||
vp->active_device = This; /* Viewport must be usable for Clear() after AddViewport,
|
||||
so set active_device here. */
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
return D3D_OK;
|
||||
|
|
|
@ -312,10 +312,12 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
|
|||
This->viewports.vp1.dvMaxZ = 1.0;
|
||||
|
||||
if (This->active_device) {
|
||||
IDirect3DDevice3_GetCurrentViewport(ICOM_INTERFACE(This->active_device, IDirect3DDevice3), ¤t_viewport);
|
||||
if (ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, current_viewport) == This)
|
||||
This->activate(This, FALSE);
|
||||
if(current_viewport) IDirect3DViewport3_Release(current_viewport);
|
||||
IDirect3DDevice3_GetCurrentViewport(ICOM_INTERFACE(This->active_device, IDirect3DDevice3), ¤t_viewport);
|
||||
if (current_viewport) {
|
||||
if (ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, current_viewport) == This)
|
||||
This->activate(This, FALSE);
|
||||
IDirect3DViewport3_Release(current_viewport);
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
|
@ -900,10 +902,12 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
|
|||
memcpy(&(This->viewports.vp2), lpData, lpData->dwSize);
|
||||
|
||||
if (This->active_device) {
|
||||
IDirect3DDevice3_GetCurrentViewport(ICOM_INTERFACE(This->active_device, IDirect3DDevice3), ¤t_viewport);
|
||||
if (ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, current_viewport) == This)
|
||||
This->activate(This, FALSE);
|
||||
IDirect3DViewport3_Release(current_viewport);
|
||||
IDirect3DDevice3_GetCurrentViewport(ICOM_INTERFACE(This->active_device, IDirect3DDevice3), ¤t_viewport);
|
||||
if (current_viewport) {
|
||||
if (ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, current_viewport) == This)
|
||||
This->activate(This, FALSE);
|
||||
IDirect3DViewport3_Release(current_viewport);
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue