From defe19193961dbbec098e42406fa98b5f4db21f6 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 17 Jan 2006 01:45:39 +0000 Subject: [PATCH] simplify --- stepmania/src/RageDisplay_D3D.cpp | 40 +------------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index 96e5443208..22b38f6e08 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -58,7 +58,6 @@ D3DDISPLAYMODE g_DesktopMode; D3DPRESENT_PARAMETERS g_d3dpp; int g_ModelMatrixCnt=0; TextureUnit g_currentTextureUnit = TextureUnit_1; -static int g_iActualRefreshRateInHz = 60; static bool g_bSphereMapping[NUM_TextureUnit] = { false, false }; /* Direct3D doesn't associate a palette with textures. @@ -589,43 +588,6 @@ CString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDevi else p.rate = g_d3dpp.FullScreen_RefreshRateInHz; } -#ifndef _XBOX - - /* Find the refresh rate. */ - { - DEVMODE dm; - ZERO( dm ); - dm.dmSize = sizeof(dm); - if( EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm) ) - { - /* - * On a nForce 2 IGP on Windows 98, dm.dmDisplayFrequency sometimes - * (but not always) is 0. - * - * MSDN: When you call the EnumDisplaySettings function, the - * dmDisplayFrequency member may return with the value 0 or 1. - * These values represent the display hardware's default refresh rate. - * This default rate is typically set by switches on a display card or - * computer motherboard, or by a configuration program that does not - * use Win32 display functions such as ChangeDisplaySettings. - */ - if( dm.dmDisplayFrequency == 0 || dm.dmDisplayFrequency == 1 ) - { - g_iActualRefreshRateInHz = 60; - LOG->Warn( "EnumDisplaySettings doesn't know what the refresh rate is. %d %d %d", dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel ); - } - else - { - g_iActualRefreshRateInHz = dm.dmDisplayFrequency; - } - } - else - { - g_iActualRefreshRateInHz = 60; - LOG->Warn( "%s", werr_ssprintf(GetLastError(), "EnumDisplaySettings failed").c_str() ); - } - } -#endif /* Call this again after changing the display mode. If we're going to a window * from fullscreen, the first call can't set a larger window than the old fullscreen @@ -695,7 +657,7 @@ void RageDisplay_D3D::EndFrame() { g_pd3dDevice->EndScene(); - FrameLimitBeforeVsync( g_iActualRefreshRateInHz ); + FrameLimitBeforeVsync( GetActualVideoModeParams().rate ); g_pd3dDevice->Present( 0, 0, 0, 0 ); FrameLimitAfterVsync();