diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index a8e87b809c..12ca10e9c8 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -83,7 +83,7 @@ PrefsManager::PrefsManager() m_bHiddenSongs = false; m_bVsync = true; - m_bSoundDrivers = DEFAULT_SOUND_DRIVER_LIST; + m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST; m_fSoundVolume = DEFAULT_SOUND_VOLUME; ReadGlobalPrefsFromDisk( true ); @@ -93,7 +93,7 @@ PrefsManager::~PrefsManager() { } - void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) +void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) { IniFile ini; ini.SetPath( "StepMania.ini" ); @@ -136,7 +136,7 @@ PrefsManager::~PrefsManager() ini.GetValueB( "Options", "CoinOpMode", m_bCoinOpMode ); ini.GetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections ); ini.GetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast ); - ini.GetValue ( "Options", "SoundDrivers", m_bSoundDrivers ); + ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); @@ -199,7 +199,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueI( "Options", "UnloadTextureDelaySeconds", m_iUnloadTextureDelaySeconds ); ini.SetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections ); ini.SetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast ); - ini.SetValue ( "Options", "SoundDrivers", m_bSoundDrivers ); + ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); ini.SetValueB( "Options", "EasterEggs", m_bEasterEggs ); ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); ini.SetValueI( "Options", "CoinMode", (int&)m_CoinMode ); @@ -210,8 +210,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() /* Only write these if they aren't the default. This ensures that we can change * the default and have it take effect for everyone (except people who * tweaked this value). */ - if(m_bSoundDrivers != DEFAULT_SOUND_DRIVER_LIST) - ini.SetValue ( "Options", "SoundDrivers", m_bSoundDrivers ); + if(m_sSoundDrivers != DEFAULT_SOUND_DRIVER_LIST) + ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); if(m_fSoundVolume != DEFAULT_SOUND_VOLUME) ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 54ee70f443..0b3e4ec144 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -68,7 +68,7 @@ public: CStringArray m_asAdditionalSongFolders; CString m_DWIPath; - CString m_bSoundDrivers; + CString m_sSoundDrivers; float m_fSoundVolume; void ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ); diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index bdb39aeb38..c7ec7ecbfb 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -63,7 +63,6 @@ void GetGLExtensions(set &ext) for(unsigned i = 0; i < lst.size(); ++i) ext.insert(lst[i]); - LOG->Trace("OpenGL extensions: %s", buf); } RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync ) @@ -81,6 +80,9 @@ RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rat LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR)); LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER)); LOG->Info("OGL Version: %s", glGetString(GL_VERSION)); + LOG->Info("OGL Extensions: %s", glGetString(GL_EXTENSIONS)); + if( IsSoftwareRenderer() ) + LOG->Warn("This is a software renderer!"); /* Log this, so if people complain that the radar looks bad on their @@ -95,6 +97,13 @@ RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rat LOG->Trace("Point size granularity: %f", m_oglspecs->point_granularity); } +bool RageDisplay::IsSoftwareRenderer() +{ + return + ( stricmp((const char*)glGetString(GL_VENDOR),"Microsoft Corporation")==0 ) && + ( stricmp((const char*)glGetString(GL_RENDERER),"GDI Generic")==0 ); +} + void RageDisplay::SetupOpenGL() { /* diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 1fe067e40d..3bdcb0fb7d 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -29,6 +29,8 @@ public: RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync ); ~RageDisplay(); + bool IsSoftwareRenderer(); + bool SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync ); /* Call this when the resolution has been changed externally: */ diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 94aa7e4ff3..e2412c6c59 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -87,27 +87,26 @@ void ScreenManager::Update( float fDeltaTime ) EmptyDeleteQueue(); - // Update all windows in the stack - for( unsigned i=0; iIsFirstUpdate() ) - m_ScreenStack[i]->Update( 0 ); - else - m_ScreenStack[i]->Update( fDeltaTime ); - } + // Only update the topmost screen on the stack. + /* Screens take some time to load. If we don't do this, then screens + * receive an initial update that includes all of the time they spent + * loading, which will chop off their tweens. + * + * We don't want to simply cap update times; for example, the stage + * screen sets a 4 second timer, preps the gameplay screen, and then + * displays the prepped screen after the timer runs out; this lets the + * load time be masked (as long as the load takes less than 4 seconds). + * If we cap that large update delta from the screen load, the update + * to load the new screen will come after 4 seconds plus the load time. + * + * So, let's just drop the first update for every screen. + */ + Screen* pScreen = m_ScreenStack[m_ScreenStack.size()-1]; + if( pScreen->IsFirstUpdate() ) + pScreen->Update( 0 ); + else + pScreen->Update( fDeltaTime ); } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 963512c2f1..ac1c7b27c7 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -271,7 +271,7 @@ int main(int argc, char* argv[]) PREFSMAN = new PrefsManager; GAMEMAN = new GameManager; THEME = new ThemeManager; - SOUNDMAN = new RageSoundManager(PREFSMAN->m_bSoundDrivers); + SOUNDMAN = new RageSoundManager(PREFSMAN->m_sSoundDrivers); SOUNDMAN->SetPrefs(PREFSMAN->m_fSoundVolume); ANNOUNCER = new AnnouncerManager; INPUTFILTER = new InputFilter; @@ -315,6 +315,19 @@ int main(int argc, char* argv[]) BoostAppPri(); ResetGame(); + if( DISPLAY->IsSoftwareRenderer() ) + SCREENMAN->Prompt( + SM_None, + "OpenGL hardware acceleration\n" + "was not detected.\n\n" + "StepMania will use the Microsoft\n" + "software OpenGL renderer.\n" + "However, the game is not playable\n" + "with this software renderer.\n" + "Please install the latest video\n" + "driver from your graphics card vendor\n" + "to enable OpenGL hardware acceleration." + ); /* Run the main loop. */ GameLoop(); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 83e38ec60d..6e1b5faf1f 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -344,6 +344,8 @@ abort: sFileName.GetString(), GetThemeDirFromName(m_sCurThemeName).GetString(), GetThemeDirFromName(BASE_THEME_NAME).GetString() ); + + return ""; // shut VC6 up } diff --git a/stepmania/src/arch/arch.h b/stepmania/src/arch/arch.h index 793174fdd9..670f0acb6a 100644 --- a/stepmania/src/arch/arch.h +++ b/stepmania/src/arch/arch.h @@ -12,7 +12,7 @@ RageSoundDriver *MakeRageSoundDriver(CString drivers); /* Define the default list of sound drivers for each arch. */ #if defined(WIN32) -#define DEFAULT_SOUND_DRIVER_LIST "DirectSound,DirectSound-sw" +#define DEFAULT_SOUND_DRIVER_LIST "DirectSound,DirectSound-sw,WaveOut" #endif #endif