Warn if using software OpenGL, sound driver now falls back to WaveOut by default

This commit is contained in:
Chris Danford
2003-01-19 21:51:46 +00:00
parent a851b03677
commit e2a91a79a9
8 changed files with 55 additions and 30 deletions
+6 -6
View File
@@ -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 );
+1 -1
View File
@@ -68,7 +68,7 @@ public:
CStringArray m_asAdditionalSongFolders;
CString m_DWIPath;
CString m_bSoundDrivers;
CString m_sSoundDrivers;
float m_fSoundVolume;
void ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame );
+10 -1
View File
@@ -63,7 +63,6 @@ void GetGLExtensions(set<string> &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()
{
/*
+2
View File
@@ -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: */
+19 -20
View File
@@ -87,27 +87,26 @@ void ScreenManager::Update( float fDeltaTime )
EmptyDeleteQueue();
// Update all windows in the stack
for( unsigned i=0; i<m_ScreenStack.size(); i++ ) {
/* 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.
*/
if( m_ScreenStack[i]->IsFirstUpdate() )
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 );
}
+14 -1
View File
@@ -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();
+2
View File
@@ -344,6 +344,8 @@ abort:
sFileName.GetString(),
GetThemeDirFromName(m_sCurThemeName).GetString(),
GetThemeDirFromName(BASE_THEME_NAME).GetString() );
return ""; // shut VC6 up
}
+1 -1
View File
@@ -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