Warn if using software OpenGL, sound driver now falls back to WaveOut by default
This commit is contained in:
@@ -83,7 +83,7 @@ PrefsManager::PrefsManager()
|
|||||||
m_bHiddenSongs = false;
|
m_bHiddenSongs = false;
|
||||||
m_bVsync = true;
|
m_bVsync = true;
|
||||||
|
|
||||||
m_bSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
||||||
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
||||||
|
|
||||||
ReadGlobalPrefsFromDisk( true );
|
ReadGlobalPrefsFromDisk( true );
|
||||||
@@ -93,7 +93,7 @@ PrefsManager::~PrefsManager()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
|
void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
|
||||||
{
|
{
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.SetPath( "StepMania.ini" );
|
ini.SetPath( "StepMania.ini" );
|
||||||
@@ -136,7 +136,7 @@ PrefsManager::~PrefsManager()
|
|||||||
ini.GetValueB( "Options", "CoinOpMode", m_bCoinOpMode );
|
ini.GetValueB( "Options", "CoinOpMode", m_bCoinOpMode );
|
||||||
ini.GetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections );
|
ini.GetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections );
|
||||||
ini.GetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast );
|
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", "EasterEggs", m_bEasterEggs );
|
||||||
ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
||||||
ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
||||||
@@ -199,7 +199,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
|
|||||||
ini.SetValueI( "Options", "UnloadTextureDelaySeconds", m_iUnloadTextureDelaySeconds );
|
ini.SetValueI( "Options", "UnloadTextureDelaySeconds", m_iUnloadTextureDelaySeconds );
|
||||||
ini.SetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections );
|
ini.SetValueB( "Options", "MusicWheelUsesSections", m_bMusicWheelUsesSections );
|
||||||
ini.SetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast );
|
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", "EasterEggs", m_bEasterEggs );
|
||||||
ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
||||||
ini.SetValueI( "Options", "CoinMode", (int&)m_CoinMode );
|
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
|
/* 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
|
* the default and have it take effect for everyone (except people who
|
||||||
* tweaked this value). */
|
* tweaked this value). */
|
||||||
if(m_bSoundDrivers != DEFAULT_SOUND_DRIVER_LIST)
|
if(m_sSoundDrivers != DEFAULT_SOUND_DRIVER_LIST)
|
||||||
ini.SetValue ( "Options", "SoundDrivers", m_bSoundDrivers );
|
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
||||||
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
||||||
ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
CStringArray m_asAdditionalSongFolders;
|
CStringArray m_asAdditionalSongFolders;
|
||||||
CString m_DWIPath;
|
CString m_DWIPath;
|
||||||
|
|
||||||
CString m_bSoundDrivers;
|
CString m_sSoundDrivers;
|
||||||
float m_fSoundVolume;
|
float m_fSoundVolume;
|
||||||
|
|
||||||
void ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame );
|
void ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame );
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ void GetGLExtensions(set<string> &ext)
|
|||||||
|
|
||||||
for(unsigned i = 0; i < lst.size(); ++i)
|
for(unsigned i = 0; i < lst.size(); ++i)
|
||||||
ext.insert(lst[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 )
|
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 Vendor: %s", glGetString(GL_VENDOR));
|
||||||
LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER));
|
LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER));
|
||||||
LOG->Info("OGL Version: %s", glGetString(GL_VERSION));
|
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
|
/* 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);
|
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()
|
void RageDisplay::SetupOpenGL()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public:
|
|||||||
RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
||||||
~RageDisplay();
|
~RageDisplay();
|
||||||
|
|
||||||
|
bool IsSoftwareRenderer();
|
||||||
|
|
||||||
bool SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
bool SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
||||||
|
|
||||||
/* Call this when the resolution has been changed externally: */
|
/* Call this when the resolution has been changed externally: */
|
||||||
|
|||||||
@@ -87,27 +87,26 @@ void ScreenManager::Update( float fDeltaTime )
|
|||||||
|
|
||||||
EmptyDeleteQueue();
|
EmptyDeleteQueue();
|
||||||
|
|
||||||
// Update all windows in the stack
|
// Only update the topmost screen on 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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* 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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ int main(int argc, char* argv[])
|
|||||||
PREFSMAN = new PrefsManager;
|
PREFSMAN = new PrefsManager;
|
||||||
GAMEMAN = new GameManager;
|
GAMEMAN = new GameManager;
|
||||||
THEME = new ThemeManager;
|
THEME = new ThemeManager;
|
||||||
SOUNDMAN = new RageSoundManager(PREFSMAN->m_bSoundDrivers);
|
SOUNDMAN = new RageSoundManager(PREFSMAN->m_sSoundDrivers);
|
||||||
SOUNDMAN->SetPrefs(PREFSMAN->m_fSoundVolume);
|
SOUNDMAN->SetPrefs(PREFSMAN->m_fSoundVolume);
|
||||||
ANNOUNCER = new AnnouncerManager;
|
ANNOUNCER = new AnnouncerManager;
|
||||||
INPUTFILTER = new InputFilter;
|
INPUTFILTER = new InputFilter;
|
||||||
@@ -315,6 +315,19 @@ int main(int argc, char* argv[])
|
|||||||
BoostAppPri();
|
BoostAppPri();
|
||||||
|
|
||||||
ResetGame();
|
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. */
|
/* Run the main loop. */
|
||||||
GameLoop();
|
GameLoop();
|
||||||
|
|||||||
@@ -344,6 +344,8 @@ abort:
|
|||||||
sFileName.GetString(),
|
sFileName.GetString(),
|
||||||
GetThemeDirFromName(m_sCurThemeName).GetString(),
|
GetThemeDirFromName(m_sCurThemeName).GetString(),
|
||||||
GetThemeDirFromName(BASE_THEME_NAME).GetString() );
|
GetThemeDirFromName(BASE_THEME_NAME).GetString() );
|
||||||
|
|
||||||
|
return ""; // shut VC6 up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ RageSoundDriver *MakeRageSoundDriver(CString drivers);
|
|||||||
|
|
||||||
/* Define the default list of sound drivers for each arch. */
|
/* Define the default list of sound drivers for each arch. */
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#define DEFAULT_SOUND_DRIVER_LIST "DirectSound,DirectSound-sw"
|
#define DEFAULT_SOUND_DRIVER_LIST "DirectSound,DirectSound-sw,WaveOut"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user