wine/dlls/wined3d device.c

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 7 05:12:38 CST 2005


ChangeSet ID:	21133
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/07 05:12:38

Modified files:
	dlls/wined3d   : device.c 

Log message:
	Oliver Stieber <oliver_stieber at yahoo.co.uk>
	Prevent SetFVF from clearing down the vertex declaration of the FVF is
	zero. This is required for Prince of Persia, The sands of time.

Patch: http://cvs.winehq.org/patch.py?id=21133

Old revision  New revision  Changes     Path
 1.93          1.94          +10 -6      wine/dlls/wined3d/device.c

Index: wine/dlls/wined3d/device.c
diff -u -p wine/dlls/wined3d/device.c:1.93 wine/dlls/wined3d/device.c:1.94
--- wine/dlls/wined3d/device.c:1.93	7 Nov 2005 11:12:38 -0000
+++ wine/dlls/wined3d/device.c	7 Nov 2005 11:12:38 -0000
@@ -1650,6 +1650,7 @@ UINT WINAPI IWineD3DDeviceImpl_GetAvaila
  *****/
 HRESULT WINAPI IWineD3DDeviceImpl_SetFVF(IWineD3DDevice *iface, DWORD fvf) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
+    HRESULT hr = D3D_OK;
 
     /* Update the current state block */
     This->updateStateBlock->fvf              = fvf;
@@ -1657,13 +1658,16 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetFVF
     This->updateStateBlock->set.fvf          = TRUE;
 
     TRACE("(%p) : FVF Shader FVF set to %lx\n", This, fvf);
-    /* clear down the vertex declaration
-     NOTE: Axis and Allies doesn't work properly otherwise
-     (may be a stateblock problem though!)
-    */
-    /* No difference if recording or not */
-    return IWineD3DDevice_SetVertexDeclaration(iface, NULL);
 
+    if (0 != fvf) {
+        /* clear down the vertex declaration
+         NOTE: Axis and Allies doesn't work properly otherwise
+         (may be a stateblock problem though!)
+        */
+      hr = IWineD3DDevice_SetVertexDeclaration(iface, NULL);
+    }
+
+    return hr;
 }
 
 



More information about the wine-cvs mailing list