no message
This commit is contained in:
@@ -17,13 +17,68 @@
|
||||
|
||||
PrefsManager* PREFS = NULL; // global and accessable from anywhere in our program
|
||||
|
||||
|
||||
|
||||
GraphicProfileOptions GRAPHIC_OPTIONS[NUM_GRAPHIC_PROFILES] =
|
||||
{
|
||||
{ // PROFILE_SUPER_LOW
|
||||
"Super Low",
|
||||
320,
|
||||
240,
|
||||
256,
|
||||
16,
|
||||
16,
|
||||
false,
|
||||
false,
|
||||
},
|
||||
{ // PROFILE_LOW
|
||||
"Low",
|
||||
400,
|
||||
300,
|
||||
256,
|
||||
16,
|
||||
16,
|
||||
false,
|
||||
true,
|
||||
},
|
||||
{ // PROFILE_MEDIUM
|
||||
"Medium",
|
||||
640,
|
||||
480,
|
||||
512,
|
||||
16,
|
||||
16,
|
||||
false,
|
||||
true,
|
||||
},
|
||||
{ // PROFILE_HIGH
|
||||
"High",
|
||||
640,
|
||||
480,
|
||||
1024,
|
||||
16,
|
||||
32,
|
||||
true,
|
||||
true,
|
||||
},
|
||||
{ // PROFILE_CUSTOM
|
||||
"Custom",
|
||||
640,
|
||||
480,
|
||||
512,
|
||||
16,
|
||||
16,
|
||||
false,
|
||||
true,
|
||||
},
|
||||
};
|
||||
|
||||
PrefsManager::PrefsManager()
|
||||
{
|
||||
m_SongSortOrder = SORT_GROUP;
|
||||
m_iCurrentStage = 1;
|
||||
m_GameMode = GAME_MODE_ARCADE;
|
||||
|
||||
m_bWindowed = false;
|
||||
m_GraphicProfile = PROFILE_MEDIUM;
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_PreferredDifficultyClass[p] = CLASS_EASY;
|
||||
@@ -39,6 +94,18 @@ PrefsManager::~PrefsManager()
|
||||
}
|
||||
|
||||
|
||||
GraphicProfileOptions* PrefsManager::GetCustomGraphicProfileOptions()
|
||||
{
|
||||
return &GRAPHIC_OPTIONS[PROFILE_CUSTOM];
|
||||
}
|
||||
|
||||
|
||||
GraphicProfileOptions* PrefsManager::GetCurrentGraphicProfileOptions()
|
||||
{
|
||||
return &GRAPHIC_OPTIONS[m_GraphicProfile];
|
||||
}
|
||||
|
||||
|
||||
void PrefsManager::ReadPrefsFromDisk()
|
||||
{
|
||||
IniFile ini;
|
||||
@@ -74,23 +141,25 @@ void PrefsManager::ReadPrefsFromDisk()
|
||||
{
|
||||
pKey->GetNextAssoc( pos, name_string, value_string );
|
||||
|
||||
if( name_string == "Windowed" ) m_GraphicOptions.m_bWindowed = ( value_string == "1" );
|
||||
if( name_string == "Windowed" ) m_bWindowed = ( value_string == "1" );
|
||||
if( name_string == "Profile" )
|
||||
{
|
||||
if( value_string == "super low" ) m_GraphicOptions.m_Profile = PROFILE_SUPER_LOW;
|
||||
else if( value_string == "low" ) m_GraphicOptions.m_Profile = PROFILE_LOW;
|
||||
else if( value_string == "medium" ) m_GraphicOptions.m_Profile = PROFILE_MEDIUM;
|
||||
else if( value_string == "high" ) m_GraphicOptions.m_Profile = PROFILE_HIGH;
|
||||
else if( value_string == "custom" ) m_GraphicOptions.m_Profile = PROFILE_CUSTOM;
|
||||
else m_GraphicOptions.m_Profile = PROFILE_MEDIUM;
|
||||
if( value_string == "super low" ) m_GraphicProfile = PROFILE_SUPER_LOW;
|
||||
else if( value_string == "low" ) m_GraphicProfile = PROFILE_LOW;
|
||||
else if( value_string == "medium" ) m_GraphicProfile = PROFILE_MEDIUM;
|
||||
else if( value_string == "high" ) m_GraphicProfile = PROFILE_HIGH;
|
||||
else if( value_string == "custom" ) m_GraphicProfile = PROFILE_CUSTOM;
|
||||
else m_GraphicProfile = PROFILE_MEDIUM;
|
||||
}
|
||||
if( name_string == "Resolution" ) m_GraphicOptions.m_iResolution = atoi( value_string );
|
||||
if( name_string == "MaxTextureSize" ) m_GraphicOptions.m_iMaxTextureSize = atoi( value_string );
|
||||
if( name_string == "DisplayColor" ) m_GraphicOptions.m_iDisplayColor = atoi( value_string );
|
||||
if( name_string == "TextureColor" ) m_GraphicOptions.m_iTextureColor = atoi( value_string );
|
||||
if( name_string == "Shadows" ) m_GraphicOptions.m_bShadows = ( value_string == "1" );
|
||||
if( name_string == "30fpsLock" ) m_GraphicOptions.m_b30fpsLock = ( value_string == "1" );
|
||||
if( name_string == "Backgrounds" ) m_GraphicOptions.m_bBackgrounds = ( value_string == "1" );
|
||||
|
||||
GraphicProfileOptions* pGPO = GetCustomGraphicProfileOptions();
|
||||
if( name_string == "Width" ) pGPO->m_dwWidth = atoi( value_string );
|
||||
if( name_string == "Height" ) pGPO->m_dwHeight = atoi( value_string );
|
||||
if( name_string == "MaxTextureSize" ) pGPO->m_dwMaxTextureSize = atoi( value_string );
|
||||
if( name_string == "DisplayColor" ) pGPO->m_dwDisplayColor = atoi( value_string );
|
||||
if( name_string == "TextureColor" ) pGPO->m_dwTextureColor = atoi( value_string );
|
||||
if( name_string == "Shadows" ) pGPO->m_bShadows = ( value_string == "1" );
|
||||
if( name_string == "Backgrounds" ) pGPO->m_bBackgrounds = ( value_string == "1" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +174,8 @@ void PrefsManager::SavePrefsToDisk()
|
||||
|
||||
|
||||
// save the GameOptions
|
||||
ini.SetValue( "GraphicOptions", "Windowed", m_GraphicOptions.m_bWindowed ? "1":"0" );
|
||||
switch( m_GraphicOptions.m_Profile )
|
||||
ini.SetValue( "GraphicOptions", "Windowed", m_bWindowed ? "1":"0" );
|
||||
switch( m_GraphicProfile )
|
||||
{
|
||||
case PROFILE_SUPER_LOW: ini.SetValue( "GraphicOptions", "Profile", "super low" ); break;
|
||||
case PROFILE_LOW: ini.SetValue( "GraphicOptions", "Profile", "low" ); break;
|
||||
@@ -115,13 +184,17 @@ void PrefsManager::SavePrefsToDisk()
|
||||
case PROFILE_CUSTOM: ini.SetValue( "GraphicOptions", "Profile", "custom" ); break;
|
||||
default: ASSERT( false );
|
||||
}
|
||||
ini.SetValue( "GraphicOptions", "Resolution", ssprintf("%d", m_GraphicOptions.m_iResolution) );
|
||||
ini.SetValue( "GraphicOptions", "MaxTextureSize", ssprintf("%d", m_GraphicOptions.m_iMaxTextureSize) );
|
||||
ini.SetValue( "GraphicOptions", "DisplayColor", ssprintf("%d", m_GraphicOptions.m_iDisplayColor) );
|
||||
ini.SetValue( "GraphicOptions", "TextureColor", ssprintf("%d", m_GraphicOptions.m_iTextureColor) );
|
||||
ini.SetValue( "GraphicOptions", "Shadows", m_GraphicOptions.m_bShadows ? "1":"0" );
|
||||
ini.SetValue( "GraphicOptions", "30fpsLock", m_GraphicOptions.m_b30fpsLock ? "1":"0" );
|
||||
ini.SetValue( "GraphicOptions", "Backgrounds", m_GraphicOptions.m_bBackgrounds ? "1":"0" );
|
||||
|
||||
|
||||
GraphicProfileOptions* pGPO = GetCustomGraphicProfileOptions();
|
||||
|
||||
ini.SetValue( "GraphicOptions", "Width", ssprintf("%d", pGPO->m_dwWidth) );
|
||||
ini.SetValue( "GraphicOptions", "Height", ssprintf("%d", pGPO->m_dwWidth) );
|
||||
ini.SetValue( "GraphicOptions", "MaxTextureSize", ssprintf("%d", pGPO->m_dwMaxTextureSize) );
|
||||
ini.SetValue( "GraphicOptions", "DisplayColor", ssprintf("%d", pGPO->m_dwDisplayColor) );
|
||||
ini.SetValue( "GraphicOptions", "TextureColor", ssprintf("%d", pGPO->m_dwTextureColor) );
|
||||
ini.SetValue( "GraphicOptions", "Shadows", pGPO->m_bShadows ? "1":"0" );
|
||||
ini.SetValue( "GraphicOptions", "Backgrounds", pGPO->m_bBackgrounds ? "1":"0" );
|
||||
|
||||
|
||||
ini.SetValue( "GameOptions", "IgnoreJoyAxes", m_GameOptions.m_bIgnoreJoyAxes ? "1":"0" );
|
||||
|
||||
Reference in New Issue
Block a user