} viewports;
/* Activation function */
- void (*activate)(IDirect3DViewportImpl*);
+ void (*activate)(IDirect3DViewportImpl*, BOOL);
/* Field used to chain viewports together */
IDirect3DViewportImpl *next;
const IDirect3DViewport3Vtbl IDirect3DViewport3_Vtbl;
/* Helper functions */
-void viewport_activate(IDirect3DViewportImpl* This);
+void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights);
/*****************************************************************************
* IDirect3DExecuteBuffer - Wraps to D3D7
/* Activate this viewport */
This->current_viewport->active_device = This;
- This->current_viewport->activate(This->current_viewport);
+ This->current_viewport->activate(This->current_viewport, FALSE);
LeaveCriticalSection(&ddraw_cs);
return D3D_OK;
* activates the viewport using IDirect3DDevice7::SetViewport
*
*****************************************************************************/
-void viewport_activate(IDirect3DViewportImpl* This) {
+void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
IDirect3DLightImpl* light;
D3DVIEWPORT7 vp;
-
- /* Activate all the lights associated with this context */
- light = This->lights;
- while (light != NULL) {
- light->activate(light);
- light = light->next;
+ if (!ignore_lights) {
+ /* Activate all the lights associated with this context */
+ light = This->lights;
+
+ while (light != NULL) {
+ light->activate(light);
+ light = light->next;
+ }
}
/* And copy the values in the structure used by the device */
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);
+ This->activate(This, FALSE);
if(current_viewport) IDirect3DViewport3_Release(current_viewport);
}
LeaveCriticalSection(&ddraw_cs);
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);
+ This->activate(This, FALSE);
IDirect3DViewport3_Release(current_viewport);
}
LeaveCriticalSection(&ddraw_cs);