diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 117ff88225..d834d7462f 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -124,6 +124,10 @@ PrefsManager::PrefsManager() * already here than lots of people asking why songs aren't being displayed. */ m_bHiddenSongs = false; m_bVsync = true; +#ifdef _XBOX + m_bProgressive = false; + m_bPAL = false; +#endif m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST; // StepMania.cpp sets these on first run: @@ -156,6 +160,10 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) return; // could not read config file, load nothing ini.GetValueB( "Options", "Windowed", m_bWindowed ); +#ifdef _XBOX + ini.GetValueB( "Options", "Progressive", m_bProgressive ); + ini.GetValueB( "Options", "PAL", m_bPAL ); +#endif ini.GetValueI( "Options", "DisplayWidth", m_iDisplayWidth ); ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight ); ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth ); @@ -291,6 +299,10 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "DelayedEscape", m_bDelayedEscape ); ini.SetValueB( "Options", "HiddenSongs", m_bHiddenSongs ); ini.SetValueB( "Options", "Vsync", m_bVsync ); +#ifdef _XBOX + ini.SetValueB( "Options", "Progressive", m_bProgressive ); + ini.SetValueB( "Options", "PAL", m_bPAL ); +#endif ini.SetValueB( "Options", "HowToPlay", m_bInstructions ); ini.SetValueB( "Options", "Caution", m_bShowDontDie ); ini.SetValueB( "Options", "SelectGroup", m_bShowSelectGroup ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index ecf6be5d20..246c98db12 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -34,6 +34,10 @@ public: int m_iMovieDecodeMS; bool m_bHiddenSongs; bool m_bVsync; +#ifdef _XBOX + bool m_bProgressive; + bool m_bPAL; +#endif bool m_bDelayedTextureDelete; bool m_bDelayedScreenLoad; bool m_bBannerCache; diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 4e886fc674..215714307e 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -78,7 +78,12 @@ public: bool _vsync, bool _bAntiAliasing, CString _sWindowTitle, - CString _sIconFile ) + CString _sIconFile +#ifdef _XBOX + , bool _progressive + , bool _PAL +#endif + ) { windowed = _windowed; width = _width; @@ -89,6 +94,10 @@ public: bAntiAliasing = _bAntiAliasing; sWindowTitle = _sWindowTitle; sIconFile = _sIconFile; +#ifdef _XBOX + progressive = _progressive; + PAL = _PAL; +#endif } VideoModeParams() {} @@ -99,6 +108,10 @@ public: int rate; bool vsync; bool bAntiAliasing; +#ifdef _XBOX + bool progressive; + bool PAL; +#endif CString sWindowTitle; CString sIconFile; }; diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index 46b384ce59..949eda4703 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -459,24 +459,61 @@ bool RageDisplay_D3D::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) SDL_ShowCursor( p.windowed ); #endif + + ZeroMemory( &g_d3dpp, sizeof(g_d3dpp) ); + +#ifndef _XBOX + + if(p.windowed) + { + g_d3dpp.BackBufferWidth = p.width; + g_d3dpp.BackBufferHeight = p.height; + g_d3dpp.BackBufferFormat = FindBackBufferType( p.windowed, p.bpp ); + g_d3dpp.BackBufferCount = 1; + g_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; + g_d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; + g_d3dpp.hDeviceWindow = NULL; + g_d3dpp.Windowed = p.windowed; + g_d3dpp.EnableAutoDepthStencil = TRUE; + g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; + g_d3dpp.Flags = 0; + g_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + g_d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; + } + else + { + g_d3dpp.BackBufferWidth = p.width; + g_d3dpp.BackBufferHeight = p.height; + g_d3dpp.BackBufferFormat = FindBackBufferType( p.windowed, p.bpp ); + g_d3dpp.BackBufferCount = 1; + g_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; + g_d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; + g_d3dpp.hDeviceWindow = NULL; + g_d3dpp.Windowed = p.windowed; + g_d3dpp.EnableAutoDepthStencil = TRUE; + g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; + g_d3dpp.Flags = 0; + g_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + g_d3dpp.FullScreen_PresentationInterval = p.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; + } + +#else - ZeroMemory( &g_d3dpp, sizeof(g_d3dpp) ); g_d3dpp.BackBufferWidth = p.width; - g_d3dpp.BackBufferHeight = p.height; - g_d3dpp.BackBufferFormat = FindBackBufferType( p.windowed, p.bpp ); - g_d3dpp.BackBufferCount = 1; - g_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; - g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + g_d3dpp.BackBufferHeight = p.height; + g_d3dpp.BackBufferFormat = FindBackBufferType( p.windowed, p.bpp ); + g_d3dpp.BackBufferCount = 1; + g_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; + g_d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; g_d3dpp.hDeviceWindow = NULL; - g_d3dpp.Windowed = p.windowed; - g_d3dpp.EnableAutoDepthStencil = TRUE; - g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; - g_d3dpp.Flags = 0; - g_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + g_d3dpp.Windowed = 0; + g_d3dpp.EnableAutoDepthStencil = TRUE; + g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; + g_d3dpp.Flags = (p.progressive ? D3DPRESENTFLAG_PROGRESSIVE : D3DPRESENTFLAG_INTERLACED) | D3DPRESENTFLAG_10X11PIXELASPECTRATIO; + g_d3dpp.FullScreen_RefreshRateInHz = p.PAL ? 50 : 60; + g_d3dpp.FullScreen_PresentationInterval = p.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; - /* Windowed must always use D3DPRESENT_INTERVAL_DEFAULT. */ - g_d3dpp.FullScreen_PresentationInterval = - (p.windowed || p.vsync) ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE; +#endif LOG->Trace( "Present Parameters: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", g_d3dpp.BackBufferWidth, g_d3dpp.BackBufferHeight, g_d3dpp.BackBufferFormat, diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 4878a7a0ee..9b70750651 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -111,7 +111,12 @@ void ApplyGraphicOptions() PREFSMAN->m_bVsync, PREFSMAN->m_bAntiAliasing, THEME->GetMetric("Common","WindowTitle"), - THEME->GetPathToG("Common window icon") ) ); + THEME->GetPathToG("Common window icon") +#ifdef _XBOX + , PREFSMAN->m_bProgressive + , PREFSMAN->m_bPAL +#endif + ) ); bNeedReload |= TEXTUREMAN->SetPrefs( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iMovieColorDepth, @@ -371,7 +376,12 @@ RageDisplay *CreateDisplay() PREFSMAN->m_bVsync, PREFSMAN->m_bAntiAliasing, THEME->GetMetric("Common","WindowTitle"), - THEME->GetPathToG("Common window icon") ); + THEME->GetPathToG("Common window icon") +#ifdef _XBOX + , PREFSMAN->m_bProgressive + , PREFSMAN->m_bPAL +#endif + ); CString error = "There was an error while initializing your video card.\n\n" " PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n"