- added a ddraw_fps debug channel

- checked what Windows does on empty surface description
- fix the GetTextureStageStage call
This commit is contained in:
Lionel Ulmer 2003-07-26 20:33:23 +00:00 committed by Alexandre Julliard
parent 65b4d2dc75
commit 3057315863
3 changed files with 10 additions and 12 deletions

View File

@ -840,7 +840,7 @@ Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface,
{
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;
}

View File

@ -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 @@ inline static Drawable get_drawable( HDC hdc )
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 current_window;
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 @@ static BOOL opengl_flip( LPVOID dev, LPVOID drawable)
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 @@ static BOOL opengl_flip( LPVOID dev, LPVOID drawable)
}
}
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 @@ static BOOL opengl_flip( LPVOID dev, LPVOID drawable)
QueryPerformanceFrequency((LARGE_INTEGER *) &perf_freq);
}
}
#endif
return TRUE;
}

View File

@ -576,6 +576,10 @@ Main_DirectDraw_CreateSurface(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
/* 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 @@ Main_DirectDraw_CreateSurface(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
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);
}