[D3D] Some small fixes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
 - added a ddraw_fps debug channel
 - checked what Windows does on empty surface description
 - fix the GetTextureStageStage call

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- dlls/ddraw_CVS/d3ddevice/main.c	Fri Jun  6 21:24:12 2003
+++ dlls/ddraw/d3ddevice/main.c	Fri Jul 25 22:20:22 2003
@@ -840,7 +840,7 @@
 {
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
     TRACE("(%p/%p)->(%08lx,%08x,%p)\n", This, iface, dwStage, d3dTexStageStateType, lpdwState);
-    if (lpdwState && (dwStage < 8) && d3dTexStageStateType && (d3dTexStageStateType < HIGHEST_TEXTURE_STAGE_STATE) ) {
+    if (lpdwState && (dwStage < 8) && d3dTexStageStateType && (d3dTexStageStateType <= HIGHEST_TEXTURE_STAGE_STATE) ) {
         *lpdwState = This->state_block.texture_stage_state[dwStage][d3dTexStageStateType-1];
 	return DD_OK;
     }
--- dlls/ddraw_CVS/d3ddevice/mesa.c	Fri Jul 25 22:39:00 2003
+++ dlls/ddraw/d3ddevice/mesa.c	Fri Jul 25 22:21:46 2003
@@ -38,8 +38,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
 WINE_DECLARE_DEBUG_CHANNEL(ddraw_geom);
-
-#undef COMPUTE_FPS
+WINE_DECLARE_DEBUG_CHANNEL(ddraw_fps);
 
 /* x11drv GDI escapes */
 #define X11DRV_ESCAPE 6789
@@ -211,8 +210,7 @@
     return drawable;
 }
 
-#ifdef COMPUTE_FPS
-
+/* This is unnecessarely complicated :-) */
 #define MEASUREMENT_WINDOW 5
 #define NUMBER_OF_WINDOWS 10
 
@@ -223,8 +221,6 @@
 static unsigned int measurements_in_window;
 static unsigned int valid_windows;
 
-#endif
-
 static BOOL opengl_flip( LPVOID dev, LPVOID drawable)
 {
     IDirect3DDeviceImpl *d3d_dev = (IDirect3DDeviceImpl *) dev;
@@ -240,8 +236,7 @@
     glXSwapBuffers(gl_d3d_dev->display, (Drawable)drawable);
     LEAVE_GL();
 
-#ifdef COMPUTE_FPS
-    {
+    if (TRACE_ON(ddraw_fps)) {
 	LONGLONG current_time;
 	LONGLONG frame_duration;
 	QueryPerformanceCounter((LARGE_INTEGER *) &current_time);
@@ -274,7 +269,7 @@
 		    }
 		}
 
-		DPRINTF("FPS : %9.5f\n", (double) (perf_freq * tot_meas) / (double) total_time);
+		TRACE_(ddraw_fps)(" %9.5f\n", (double) (perf_freq * tot_meas) / (double) total_time);
 		
 		if (current_window >= NUMBER_OF_WINDOWS) {
 		    current_window = 0;
@@ -291,7 +286,6 @@
 	    QueryPerformanceFrequency((LARGE_INTEGER *) &perf_freq);
 	}
     }
-#endif
     
     return TRUE;
 }
--- dlls/ddraw_CVS/ddraw/main.c	Wed Jun 18 23:14:02 2003
+++ dlls/ddraw/ddraw/main.c	Sun Jul 13 20:45:34 2003
@@ -576,6 +576,10 @@
 	/* DVIDEO.DLL does forget the DDSD_CAPS flag ... *sigh* */
     	pDDSD->dwFlags |= DDSD_CAPS;
     }
+    if (pDDSD->ddsCaps.dwCaps == 0) {
+	/* This has been checked on real Windows */
+	pDDSD->ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
+    }
 
     if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) {
         /* If the surface is of the 'alloconload' type, ignore the LPSURFACE field */
@@ -616,7 +620,7 @@
     else
     {
 	/* Otherwise, assume offscreenplain surface */
-	FIXME("App didn't request a valid surface type - assuming offscreenplain\n");
+	TRACE("App didn't request a valid surface type - assuming offscreenplain\n");
 	hr = create_offscreen(This, pDDSD, ppSurf, pUnkOuter);
     }
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux