conver more to use Preference

This commit is contained in:
Chris Danford
2005-04-28 08:27:40 +00:00
parent f47ebefa90
commit 0938d9d9a7
18 changed files with 185 additions and 319 deletions
+5 -5
View File
@@ -233,7 +233,7 @@ CString Background::CreateRandomBGA( CString sPreferredSubDir )
if( sPreferredSubDir.Right(1) != "/" )
sPreferredSubDir += '/';
if( PREFSMAN->m_iBackgroundMode == PrefsManager::BGMODE_OFF )
if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_OFF )
return "";
/* If we already have enough random BGAs loaded, use them round-robin. */
@@ -250,10 +250,10 @@ CString Background::CreateRandomBGA( CString sPreferredSubDir )
CStringArray arrayPaths;
for( int i=0; i<2; i++ )
{
switch( PREFSMAN->m_iBackgroundMode )
switch( PREFSMAN->m_BackgroundMode )
{
default:
FAIL_M( ssprintf("Invalid BackgroundMode: %i", (int)PREFSMAN->m_iBackgroundMode) );
FAIL_M( ssprintf("Invalid BackgroundMode: %i", (PrefsManager::BackgroundMode)PREFSMAN->m_BackgroundMode) );
break;
case PrefsManager::BGMODE_ANIMATIONS:
@@ -308,7 +308,7 @@ CString Background::CreateRandomBGA( CString sPreferredSubDir )
}
Actor *ret;
switch( PREFSMAN->m_iBackgroundMode )
switch( PREFSMAN->m_BackgroundMode )
{
case PrefsManager::BGMODE_ANIMATIONS:
{
@@ -319,7 +319,7 @@ CString Background::CreateRandomBGA( CString sPreferredSubDir )
}
case PrefsManager::BGMODE_MOVIEVIS: ret = MakeVisualization( file ); break;
case PrefsManager::BGMODE_RANDOMMOVIES: ret = MakeMovie( file ); break;
default: FAIL_M( ssprintf("%i", (int) PREFSMAN->m_iBackgroundMode) );
default: FAIL_M( ssprintf("%i", (int) PREFSMAN->m_BackgroundMode) );
}
m_BGAnimations[file] = ret;
+1 -1
View File
@@ -20,7 +20,7 @@ Banner::Banner()
void Banner::CacheGlobalBanners()
{
if( PREFSMAN->m_iBannerCache == PrefsManager::BNCACHE_OFF )
if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_OFF )
return;
TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","all music")) );
+8 -8
View File
@@ -63,7 +63,7 @@ void BannerCache::Demand()
if( g_iDemandRefcount > 1 )
return;
if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
return;
FOREACH_Child( &BannerData, p )
@@ -91,7 +91,7 @@ void BannerCache::Undemand()
if( g_iDemandRefcount != 0 )
return;
if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
return;
UnloadAllBanners();
@@ -105,8 +105,8 @@ void BannerCache::LoadBanner( CString BannerPath )
{
if( BannerPath == "" )
return; // nothing to do
if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_PRELOAD &&
PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_PRELOAD &&
PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
return;
/* Load it. */
@@ -327,8 +327,8 @@ static inline int closest( int num, int n1, int n2 )
* load the cache file, too. (This is done at startup.) */
void BannerCache::CacheBanner( CString BannerPath )
{
if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_PRELOAD &&
PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_PRELOAD &&
PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND )
return;
CHECKPOINT_M( BannerPath );
@@ -346,7 +346,7 @@ void BannerCache::CacheBanner( CString BannerPath )
CurFullHash == FullHash )
{
/* It's identical. Just load it, if in preload. */
if( PREFSMAN->m_iBannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD )
if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD )
LoadBanner( BannerPath );
return;
@@ -476,7 +476,7 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
g_BannerPathToImage.erase(BannerPath);
}
if( PREFSMAN->m_iBannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD )
if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD )
{
/* Keep it; we're just going to load it anyway. */
g_BannerPathToImage[BannerPath] = img;
+1 -1
View File
@@ -120,7 +120,7 @@ bool FadingBanner::LoadFromCachedBanner( const CString &path )
* which will cause the fade-in to be further delayed. */
RageTextureID ID;
bool bLowRes = (PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_FULL);
bool bLowRes = (PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL);
if( !bLowRes )
{
ID = Sprite::SongBannerTexture( path );
+2 -2
View File
@@ -958,7 +958,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
bTriedToCopy = true;
CString sFromDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDITS_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDITS_SUBDIR;
int iNumAttempted = 0;
int iNumSuccessful = 0;
@@ -999,7 +999,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
bTriedToCopy = true;
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDITS_SUBDIR;
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDITS_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_SUBDIR;
int iNumAttempted = 0;
+7 -7
View File
@@ -403,7 +403,7 @@ static int GetNumStagesForCurrentSong()
* if a long/marathon song is selected explicitly in the theme with a GameCommand,
* and PREFSMAN->m_iNumArcadeStages is less than the number of stages that
* song takes. */
int iNumStagesLeft = PREFSMAN->m_iNumArcadeStages - GAMESTATE->m_iCurrentStageIndex;
int iNumStagesLeft = PREFSMAN->m_iSongsPerPlay - GAMESTATE->m_iCurrentStageIndex;
iNumStagesOfThisSong = min( iNumStagesOfThisSong, iNumStagesLeft );
iNumStagesOfThisSong = max( iNumStagesOfThisSong, 1 );
@@ -692,7 +692,7 @@ int GameState::GetNumStagesLeft() const
return 1;
if( GAMESTATE->IsEventMode() )
return 999;
return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex;
return PREFSMAN->m_iSongsPerPlay - m_iCurrentStageIndex;
}
bool GameState::IsFinalStage() const
@@ -707,21 +707,21 @@ bool GameState::IsFinalStage() const
int iPredictedStageForCurSong = GetNumStagesForCurrentSong();
if( iPredictedStageForCurSong == -1 )
iPredictedStageForCurSong = 1;
return m_iCurrentStageIndex + iPredictedStageForCurSong == PREFSMAN->m_iNumArcadeStages;
return m_iCurrentStageIndex + iPredictedStageForCurSong == PREFSMAN->m_iSongsPerPlay;
}
bool GameState::IsExtraStage() const
{
if( GAMESTATE->IsEventMode() )
return false;
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages;
return m_iCurrentStageIndex == PREFSMAN->m_iSongsPerPlay;
}
bool GameState::IsExtraStage2() const
{
if( GAMESTATE->IsEventMode() )
return false;
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages+1;
return m_iCurrentStageIndex == PREFSMAN->m_iSongsPerPlay+1;
}
CString GameState::GetStageText() const
@@ -749,7 +749,7 @@ void GameState::GetAllStageTexts( CStringArray &out ) const
out.push_back( "final" );
out.push_back( "extra1" );
out.push_back( "extra2" );
for( int stage = 0; stage < PREFSMAN->m_iNumArcadeStages; ++stage )
for( int stage = 0; stage < PREFSMAN->m_iSongsPerPlay; ++stage )
out.push_back( ssprintf("%d",stage+1) );
}
@@ -1321,7 +1321,7 @@ SongOptions::FailType GameState::GetPlayerFailType( PlayerNumber pn ) const
bool GameState::ShowMarvelous() const
{
switch( PREFSMAN->m_iMarvelousTiming )
switch( PREFSMAN->m_MarvelousTiming )
{
case PrefsManager::MARVELOUS_NEVER: return false;
case PrefsManager::MARVELOUS_COURSES_ONLY: return IsCourseMode();
+1 -1
View File
@@ -253,7 +253,7 @@ void MusicWheel::Load( CString sType )
// checking for event mode shouldn't be necessary here
// but someone mentioned it does it sometimes.
if( GAMESTATE->m_pCurSong != NULL &&
SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong ) + GAMESTATE->m_iCurrentStageIndex > PREFSMAN->m_iNumArcadeStages
SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong ) + GAMESTATE->m_iCurrentStageIndex > PREFSMAN->m_iSongsPerPlay
&& !GAMESTATE->IsEventMode()
&& !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
{
+17 -9
View File
@@ -41,28 +41,36 @@ void IPreference::SetFromStack( lua_State *L )
lua_pop( L, 1 );
}
#define READFROM_AND_WRITETO( type ) \
#define READFROM_AND_WRITETO( type, cast ) \
void Preference<type>::FromString( const CString &s ) \
{ \
::FromString( s, m_currentValue ); \
::FromString( s, (cast)m_currentValue ); \
} \
CString Preference<type>::ToString() const \
{ \
return ::ToString( m_currentValue ); \
return ::ToString( (cast)m_currentValue ); \
} \
void Preference<type>::PushValue( lua_State *L ) const \
{ \
LuaHelpers::PushStack( m_currentValue, L ); \
LuaHelpers::PushStack( (cast)m_currentValue, L ); \
} \
void Preference<type>::SetFromStack( lua_State *L ) \
{ \
LuaHelpers::PopStack( m_currentValue, L ); \
LuaHelpers::PopStack( (cast)m_currentValue, L ); \
}
READFROM_AND_WRITETO( int )
READFROM_AND_WRITETO( float )
READFROM_AND_WRITETO( bool )
READFROM_AND_WRITETO( CString )
READFROM_AND_WRITETO( int, int )
READFROM_AND_WRITETO( float, float )
READFROM_AND_WRITETO( bool, bool )
READFROM_AND_WRITETO( CString, CString )
READFROM_AND_WRITETO( PrefsManager::BackgroundMode, int& )
READFROM_AND_WRITETO( PrefsManager::BannerCache, int& )
READFROM_AND_WRITETO( PrefsManager::MusicWheelUsesSections, int& )
READFROM_AND_WRITETO( PrefsManager::MarvelousTiming, int& )
READFROM_AND_WRITETO( CoinMode, int& )
READFROM_AND_WRITETO( Premium, int& )
READFROM_AND_WRITETO( PrefsManager::Maybe, int& )
READFROM_AND_WRITETO( PrefsManager::CharacterOption, int& )
void IPreference::ReadFrom( const IniFile &ini )
{
+59 -183
View File
@@ -68,16 +68,10 @@ PrefsManager::PrefsManager() :
m_iMaxTextureResolution ( Options, "MaxTextureResolution", 2048 ),
m_iRefreshRate ( Options, "RefreshRate", REFRESH_DEFAULT ),
m_fDisplayAspectRatio ( Options, "DisplayAspectRatio", 4/3.0f ),
m_bShowStats ( Options, "ShowStats",
#ifdef DEBUG
true
#else
false
#endif
),
m_bShowStats ( Options, "ShowStats", false ),
m_bShowBanners ( Options, "ShowBanners", true ),
m_iBackgroundMode ( Options, "BackgroundMode", BGMODE_ANIMATIONS ),
m_BackgroundMode ( Options, "BackgroundMode", BGMODE_ANIMATIONS ),
m_iNumBackgrounds ( Options, "NumBackgrounds", 8 ),
m_fBGBrightness ( Options, "BGBrightness", 0.8f ),
m_bHiddenSongs ( Options, "HiddenSongs", false ), /* I'd rather get occasional people asking for support for this even though it's already here than lots of people asking why songs aren't being displayed. */
@@ -89,7 +83,7 @@ PrefsManager::PrefsManager() :
m_bTexturePreload ( Options, "TexturePreload", false ),
m_bDelayedScreenLoad ( Options, "DelayedScreenLoad", false ),
m_bDelayedModelDelete ( Options, "DelayedModelDelete", false ),
m_iBannerCache ( Options, "BannerCache", BNCACHE_LOW_RES_PRELOAD ),
m_BannerCache ( Options, "BannerCache", BNCACHE_LOW_RES_PRELOAD ),
m_bPalettedBannerCache ( Options, "PalettedBannerCache", false ),
m_bFastLoad ( Options, "FastLoad", true ),
@@ -192,11 +186,63 @@ PrefsManager::PrefsManager() :
m_MusicWheelUsesSections ( Options, "MusicWheelUsesSections", ALWAYS ),
m_iMusicWheelSwitchSpeed ( Options, "MusicWheelSwitchSpeed", 10 ),
m_bEasterEggs ( Options, "EasterEggs", true ),
m_iMarvelousTiming ( Options, "MarvelousTiming", MARVELOUS_EVERYWHERE ),
m_MarvelousTiming ( Options, "MarvelousTiming", MARVELOUS_EVERYWHERE ),
m_bEventMode ( Options, "EventMode", false ),
m_iCoinsPerCredit ( Options, "CoinsPerCredit", 1 ),
m_iNumArcadeStages ( Options, "SongsPerPlay", 3 ),
m_fGlobalOffsetSeconds ( Options, "GlobalOffsetSeconds", 0 )
m_iSongsPerPlay ( Options, "SongsPerPlay", 3 ),
m_CoinMode ( Options, "CoinMode", COIN_HOME ),
m_Premium ( Options, "Premium", PREMIUM_NONE ),
m_bDelayedCreditsReconcile ( Options, "DelayedCreditsReconcile", false ),
m_bPickExtraStage ( Options, "PickExtraStage", false ),
m_bComboContinuesBetweenSongs ( Options, "ComboContinuesBetweenSongs",false ),
m_fLongVerSongSeconds ( Options, "LongVerSongSeconds", 60*2.5f ), // Dynamite Rave is 2:55
m_fMarathonVerSongSeconds ( Options, "MarathonVerSongSeconds", 60*5.f ),
m_ShowSongOptions ( Options, "ShowSongOptions", YES ),
m_bSoloSingle ( Options, "SoloSingle", false ),
m_bDancePointsForOni ( Options, "DancePointsForOni", false ),
m_bPercentageScoring ( Options, "PercentageScoring", false ),
m_fMinPercentageForMachineSongHighScore ( Options, "MinPercentageForMachineSongHighScore", 0.5f ),
m_fMinPercentageForMachineCourseHighScore ( Options, "MinPercentageForMachineCourseHighScore", 0.0001f ), // don't save course scores with 0 percentage
m_bDisqualification ( Options, "Disqualification", false ),
m_bShowLyrics ( Options, "ShowLyrics", true ),
m_bAutogenSteps ( Options, "AutogenSteps", true ),
m_bAutogenGroupCourses ( Options, "AutogenGroupCourses", true ),
m_bBreakComboToGetItem ( Options, "BreakComboToGetItem", false ),
m_bLockCourseDifficulties ( Options, "LockCourseDifficulties", true ),
m_ShowDancingCharacters ( Options, "ShowDancingCharacters", CO_OFF ),
m_bUseUnlockSystem ( Options, "UseUnlockSystem", false ),
m_bFirstRun ( Options, "FirstRun", true ),
m_bAutoMapOnJoyChange ( Options, "AutoMapOnJoyChange", true ),
m_fGlobalOffsetSeconds ( Options, "GlobalOffsetSeconds", 0 ),
m_iProgressiveLifebar ( Options, "ProgressiveLifebar", 0 ),
m_iProgressiveStageLifebar ( Options, "ProgressiveStageLifebar", 0 ),
m_iProgressiveNonstopLifebar ( Options, "ProgressiveNonstopLifebar", 0 ),
m_bShowBeginnerHelper ( Options, "ShowBeginnerHelper", false ),
m_bEndlessBreakEnabled ( Options, "EndlessBreakEnabled", true ),
m_iEndlessNumStagesUntilBreak ( Options, "EndlessNumStagesUntilBreak",5 ),
m_iEndlessBreakLength ( Options, "EndlessBreakLength", 5 ),
m_bDisableScreenSaver ( Options, "DisableScreenSaver", true ),
m_sLanguage ( Options, "Language", "" ), // ThemeManager will deal with this invalid language
m_sMemoryCardProfileSubdir ( Options, "MemoryCardProfileSubdir", PRODUCT_NAME ),
m_iProductID ( Options, "ProductID", 1 ),
m_bMemoryCards ( Options, "MemoryCards", false ),
m_iCenterImageTranslateX ( Options, "CenterImageTranslateX", 0 ),
m_iCenterImageTranslateY ( Options, "CenterImageTranslateY", 0 ),
m_fCenterImageAddWidth ( Options, "CenterImageAddWidth", 0 ),
m_fCenterImageAddHeight ( Options, "CenterImageAddHeight", 0 ),
m_iAttractSoundFrequency ( Options, "AttractSoundFrequency", 1 ),
m_bAllowExtraStage ( Options, "AllowExtraStage", true ),
m_bHideDefaultNoteSkin ( Options, "HideDefaultNoteSkin", false ),
m_iMaxHighScoresPerListForMachine ( Options, "MaxHighScoresPerListForMachine", 10 ),
m_iMaxHighScoresPerListForPlayer ( Options, "MaxHighScoresPerListForPlayer", 3 ),
m_iMaxRecentScoresForMachine ( Options, "MaxRecentScoresForMachine", 100 ),
m_iMaxRecentScoresForPlayer ( Options, "MaxRecentScoresForPlayer", 20 ),
m_bAllowMultipleHighScoreWithSameName ( Options, "AllowMultipleHighScoreWithSameName", true ),
m_bCelShadeModels ( Options, "CelShadeModels", false ) // Work-In-Progress.. disable by default.
{
Init();
ReadGlobalPrefsFromDisk();
@@ -204,47 +250,10 @@ PrefsManager::PrefsManager() :
void PrefsManager::Init()
{
m_bCelShadeModels = false; // Work-In-Progress.. disable by default.
m_fConstantUpdateDeltaSeconds = 0;
m_bSoloSingle = false;
m_CoinMode = COIN_HOME;
m_Premium = PREMIUM_NONE;
m_bDelayedCreditsReconcile = false;
m_iBoostAppPriority = -1;
m_bSmoothLines = false;
m_ShowSongOptions = YES;
m_bDancePointsForOni = false;
m_bPercentageScoring = false;
m_fMinPercentageForMachineSongHighScore = 0.5f;
m_fMinPercentageForMachineCourseHighScore = 0.0001f; // don't save course scores with 0 percentage
m_bDisqualification = false;
m_bShowLyrics = true;
m_bAutogenSteps = true;
m_bAutogenGroupCourses = true;
m_bBreakComboToGetItem = false;
m_bLockCourseDifficulties = true;
m_ShowDancingCharacters = CO_OFF;
m_bUseUnlockSystem = false;
m_bFirstRun = true;
m_bAutoMapOnJoyChange = true;
m_bShowBeginnerHelper = false;
m_bEndlessBreakEnabled = true;
m_iEndlessNumStagesUntilBreak = 5;
m_iEndlessBreakLength = 5;
m_bDisableScreenSaver = true;
// set to 0 so people aren't shocked at first
m_iProgressiveLifebar = 0;
m_iProgressiveNonstopLifebar = 0;
m_iProgressiveStageLifebar = 0;
/* DDR Extreme-style extra stage support.
* Default off so people used to the current behavior (or those with extra
* stage CRS files) don't get it changed around on them. */
m_bPickExtraStage = false;
m_bComboContinuesBetweenSongs = false;
// default to old sort order
m_iCourseSortOrder = COURSE_SORT_SONGS;
@@ -254,25 +263,7 @@ void PrefsManager::Init()
m_iGetRankingName = RANKING_ON;
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
m_fMarathonVerSongSeconds = 60*5.f;
m_sLanguage = ""; // ThemeManager will deal with this invalid language
m_iCenterImageTranslateX = 0;
m_iCenterImageTranslateY = 0;
m_fCenterImageAddWidth = 0;
m_fCenterImageAddHeight = 0;
m_iAttractSoundFrequency = 1;
m_bAllowExtraStage = true;
m_bHideDefaultNoteSkin = false;
m_iMaxHighScoresPerListForMachine = 10;
m_iMaxHighScoresPerListForPlayer = 3;
m_iMaxRecentScoresForMachine = 100;
m_iMaxRecentScoresForPlayer = 20;
m_bAllowMultipleHighScoreWithSameName = true;
m_fPadStickSeconds = 0;
m_bForceMipMaps = false;
m_bTrilinearFiltering = false;
@@ -326,8 +317,6 @@ void PrefsManager::Init()
m_bLogCheckpoints = false;
m_bShowLoadingWindow = true;
m_bMemoryCards = false;
FOREACH_PlayerNumber( p )
{
m_iMemoryCardUsbBus[p] = -1;
@@ -335,9 +324,6 @@ void PrefsManager::Init()
m_iMemoryCardUsbLevel[p] = -1;
}
m_sMemoryCardProfileSubdir = PRODUCT_NAME;
m_iProductID = 1;
#if defined(XBOX)
m_bEnableVirtualMemory = true;
m_iPageFileSize = 384;
@@ -383,7 +369,6 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
{
ini.GetValue( "Options", "CelShadeModels", m_bCelShadeModels );
ini.GetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds );
ini.GetValue( "Options", "SoundDrivers", m_sSoundDrivers );
@@ -394,18 +379,10 @@ void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
ini.GetValue( "Options", "SoundVolume", m_fSoundVolume );
ini.GetValue( "Options", "LightsDriver", m_sLightsDriver );
ini.GetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
ini.GetValue( "Options", "CoinMode", (int&)m_CoinMode );
m_iCoinsPerCredit = max( (int)m_iCoinsPerCredit, 1);
ini.GetValue( "Options", "Premium", (int&)m_Premium );
ini.GetValue( "Options", "DelayedCreditsReconcile", m_bDelayedCreditsReconcile );
ini.GetValue( "Options", "BoostAppPriority", m_iBoostAppPriority );
ini.GetValue( "Options", "PickExtraStage", m_bPickExtraStage );
ini.GetValue( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs );
ini.GetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.GetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
ini.GetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
ini.GetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
@@ -414,18 +391,6 @@ void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
ini.GetValue( "Options", "ScreenTestMode", m_bScreenTestMode );
ini.GetValue( "Options", "MachineName", m_sMachineName );
ini.GetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows );
ini.GetValue( "Options", "SoloSingle", m_bSoloSingle );
ini.GetValue( "Options", "DancePointsForOni", m_bDancePointsForOni );
ini.GetValue( "Options", "PercentageScoring", m_bPercentageScoring );
ini.GetValue( "Options", "MinPercentageForMachineSongHighScore", m_fMinPercentageForMachineSongHighScore );
ini.GetValue( "Options", "MinPercentageForMachineCourseHighScore", m_fMinPercentageForMachineCourseHighScore );
ini.GetValue( "Options", "Disqualification", m_bDisqualification );
ini.GetValue( "Options", "ShowLyrics", m_bShowLyrics );
ini.GetValue( "Options", "AutogenSteps", m_bAutogenSteps );
ini.GetValue( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
ini.GetValue( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
ini.GetValue( "Options", "LockCourseDifficulties", m_bLockCourseDifficulties );
ini.GetValue( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters );
ini.GetValue( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder );
ini.GetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd );
@@ -433,14 +398,6 @@ void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
ini.GetValue( "Options", "ScoringType", (int&)m_iScoringType );
ini.GetValue( "Options", "ProgressiveLifebar", m_iProgressiveLifebar );
ini.GetValue( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar );
ini.GetValue( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar );
ini.GetValue( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
ini.GetValue( "Options", "FirstRun", m_bFirstRun );
ini.GetValue( "Options", "AutoMapJoysticks", m_bAutoMapOnJoyChange );
ini.GetValue( "Options", "VideoRenderers", m_sVideoRenderers );
ini.GetValue( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
ini.GetValue( "Options", "LastSeenInputDevices", m_sLastSeenInputDevices );
@@ -450,16 +407,7 @@ void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
ini.GetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
ini.GetValue( "Options", "GetRankingName", (int&)m_iGetRankingName);
ini.GetValue( "Options", "SmoothLines", m_bSmoothLines );
ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper );
ini.GetValue( "Options", "Language", m_sLanguage );
ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
ini.GetValue( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak );
ini.GetValue( "Options", "EndlessBreakLength", m_iEndlessBreakLength );
ini.GetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.GetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.GetValue( "Options", "ProductID", m_iProductID );
ini.GetValue( "Options", "MemoryCards", m_bMemoryCards );
FOREACH_PlayerNumber( p )
{
ini.GetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
@@ -470,18 +418,6 @@ void PrefsManager::ReadGlobalPrefsFromIni( const IniFile &ini )
ini.GetValue( "Options", ssprintf("MemoryCardUsbLevelP%d",p+1), m_iMemoryCardUsbLevel[p] );
}
ini.GetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
ini.GetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY );
ini.GetValue( "Options", "CenterImageAddWidth", m_fCenterImageAddWidth );
ini.GetValue( "Options", "CenterImageAddHeight", m_fCenterImageAddHeight );
ini.GetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
ini.GetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
ini.GetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
ini.GetValue( "Options", "MaxHighScoresPerListForMachine", m_iMaxHighScoresPerListForMachine );
ini.GetValue( "Options", "MaxHighScoresPerListForPlayer", m_iMaxHighScoresPerListForPlayer );
ini.GetValue( "Options", "MaxRecentScoresForMachine", m_iMaxRecentScoresForMachine );
ini.GetValue( "Options", "MaxRecentScoresForPlayer", m_iMaxRecentScoresForPlayer );
ini.GetValue( "Options", "AllowMultipleHighScoreWithSameName", m_bAllowMultipleHighScoreWithSameName );
ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
ini.GetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
ini.GetValue( "Options", "TrilinearFiltering", m_bTrilinearFiltering );
@@ -525,9 +461,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
{
ini.SetValue( "Options", "CelShadeModels", m_bCelShadeModels );
ini.SetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds );
ini.SetValue( "Options", "BackgroundMode", m_iBackgroundMode);
ini.SetValue( "Options", "BackgroundMode", m_BackgroundMode);
ini.SetValue( "Options", "NumBackgrounds", m_iNumBackgrounds);
ini.SetValue( "Options", "BGBrightness", m_fBGBrightness );
@@ -543,15 +478,6 @@ void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
ini.SetValue( "Options", "JudgeWindowSecondsMine", m_fJudgeWindowSecondsMine );
ini.SetValue( "Options", "JudgeWindowSecondsAttack", m_fJudgeWindowSecondsAttack );
ini.SetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
ini.SetValue( "Options", "LifeDeltaPercentChangeMarvelous", m_fLifeDeltaPercentChangeMarvelous );
ini.SetValue( "Options", "LifeDeltaPercentChangePerfect", m_fLifeDeltaPercentChangePerfect );
ini.SetValue( "Options", "LifeDeltaPercentChangeGreat", m_fLifeDeltaPercentChangeGreat );
ini.SetValue( "Options", "LifeDeltaPercentChangeGood", m_fLifeDeltaPercentChangeGood );
ini.SetValue( "Options", "LifeDeltaPercentChangeBoo", m_fLifeDeltaPercentChangeBoo );
ini.SetValue( "Options", "LifeDeltaPercentChangeMiss", m_fLifeDeltaPercentChangeMiss );
ini.SetValue( "Options", "LifeDeltaPercentChangeHitMine", m_fLifeDeltaPercentChangeHitMine );
ini.SetValue( "Options", "LifeDeltaPercentChangeOK", m_fLifeDeltaPercentChangeOK );
ini.SetValue( "Options", "LifeDeltaPercentChangeNG", m_fLifeDeltaPercentChangeNG );
ini.SetValue( "Options", "HiddenSongs", m_bHiddenSongs );
ini.SetValue( "Options", "Vsync", m_bVsync );
@@ -562,19 +488,9 @@ void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
ini.SetValue( "Options", "TexturePreload", m_bTexturePreload );
ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.SetValue( "Options", "DelayedModelDelete", m_bDelayedModelDelete );
ini.SetValue( "Options", "BannerCache", m_iBannerCache );
ini.SetValue( "Options", "PalettedBannerCache", m_bPalettedBannerCache );
ini.SetValue( "Options", "FastLoad", m_bFastLoad );
ini.SetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
ini.SetValue( "Options", "CoinMode", m_CoinMode );
ini.SetValue( "Options", "Premium", m_Premium );
ini.SetValue( "Options", "DelayedCreditsReconcile", m_bDelayedCreditsReconcile );
ini.SetValue( "Options", "BoostAppPriority", m_iBoostAppPriority );
ini.SetValue( "Options", "PickExtraStage", m_bPickExtraStage );
ini.SetValue( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs );
ini.SetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.SetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
ini.SetValue( "Options", "ShowSongOptions", m_ShowSongOptions );
ini.SetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
ini.SetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
ini.SetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
@@ -583,21 +499,6 @@ void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
ini.SetValue( "Options", "ScreenTestMode", m_bScreenTestMode );
ini.SetValue( "Options", "MachineName", m_sMachineName );
ini.SetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows );
ini.SetValue( "Options", "SoloSingle", m_bSoloSingle );
ini.SetValue( "Options", "DancePointsForOni", m_bDancePointsForOni );
ini.SetValue( "Options", "PercentageScoring", m_bPercentageScoring );
ini.SetValue( "Options", "MinPercentageForMachineSongHighScore", m_fMinPercentageForMachineSongHighScore );
ini.SetValue( "Options", "MinPercentageForMachineCourseHighScore", m_fMinPercentageForMachineCourseHighScore );
ini.SetValue( "Options", "Disqualification", m_bDisqualification );
ini.SetValue( "Options", "ShowLyrics", m_bShowLyrics );
ini.SetValue( "Options", "AutogenSteps", m_bAutogenSteps );
ini.SetValue( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
ini.SetValue( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
ini.SetValue( "Options", "LockCourseDifficulties", m_bLockCourseDifficulties );
ini.SetValue( "Options", "ShowDancingCharacters", m_ShowDancingCharacters );
ini.SetValue( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
ini.SetValue( "Options", "FirstRun", m_bFirstRun );
ini.SetValue( "Options", "AutoMapJoysticks", m_bAutoMapOnJoyChange );
ini.SetValue( "Options", "VideoRenderers", m_sVideoRenderers );
ini.SetValue( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
ini.SetValue( "Options", "LastSeenInputDevices", m_sLastSeenInputDevices );
@@ -614,19 +515,6 @@ void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
ini.SetValue( "Options", "ScoringType", m_iScoringType );
ini.SetValue( "Options", "ProgressiveLifebar", m_iProgressiveLifebar );
ini.SetValue( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar );
ini.SetValue( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar );
ini.SetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper );
ini.SetValue( "Options", "Language", m_sLanguage );
ini.SetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
ini.SetValue( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak );
ini.SetValue( "Options", "EndlessBreakLength", m_iEndlessBreakLength );
ini.SetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.SetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.SetValue( "Options", "ProductID", m_iProductID );
ini.SetValue( "Options", "MemoryCards", m_bMemoryCards );
FOREACH_PlayerNumber( p )
{
ini.SetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
@@ -636,18 +524,6 @@ void PrefsManager::SaveGlobalPrefsToIni( IniFile &ini ) const
ini.SetValue( "Options", ssprintf("MemoryCardUsbLevelP%d",p+1), m_iMemoryCardUsbLevel[p] );
}
ini.SetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
ini.SetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY );
ini.SetValue( "Options", "CenterImageAddWidth", m_fCenterImageAddWidth );
ini.SetValue( "Options", "CenterImageAddHeight", m_fCenterImageAddHeight );
ini.SetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
ini.SetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
ini.SetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
ini.SetValue( "Options", "MaxHighScoresPerListForMachine", m_iMaxHighScoresPerListForMachine );
ini.SetValue( "Options", "MaxHighScoresPerListForPlayer", m_iMaxHighScoresPerListForPlayer );
ini.SetValue( "Options", "MaxRecentScoresForMachine", m_iMaxRecentScoresForMachine );
ini.SetValue( "Options", "MaxRecentScoresForPlayer", m_iMaxRecentScoresForPlayer );
ini.SetValue( "Options", "AllowMultipleHighScoreWithSameName", m_bAllowMultipleHighScoreWithSameName );
ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
ini.SetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
ini.SetValue( "Options", "TrilinearFiltering", m_bTrilinearFiltering );
+61 -60
View File
@@ -31,8 +31,8 @@ public:
Preference<bool> m_bShowStats;
Preference<bool> m_bShowBanners;
enum { BGMODE_OFF, BGMODE_ANIMATIONS, BGMODE_MOVIEVIS, BGMODE_RANDOMMOVIES };
Preference<int> m_iBackgroundMode;
enum BackgroundMode { BGMODE_OFF, BGMODE_ANIMATIONS, BGMODE_MOVIEVIS, BGMODE_RANDOMMOVIES };
Preference<BackgroundMode> m_BackgroundMode;
Preference<int> m_iNumBackgrounds;
Preference<float> m_fBGBrightness;
Preference<bool> m_bHiddenSongs;
@@ -43,11 +43,12 @@ public:
Preference<bool> m_bTexturePreload;
Preference<bool> m_bDelayedScreenLoad;
Preference<bool> m_bDelayedModelDelete;
enum { BNCACHE_OFF,
enum BannerCache {
BNCACHE_OFF,
BNCACHE_LOW_RES_PRELOAD, // preload low-res on start
BNCACHE_LOW_RES_LOAD_ON_DEMAND, // preload low-res on screen load
BNCACHE_FULL };
Preference<int> m_iBannerCache;
Preference<BannerCache> m_BannerCache;
Preference<bool> m_bPalettedBannerCache;
Preference<bool> m_bFastLoad;
@@ -154,74 +155,74 @@ public:
Preference<bool> m_bShowNativeLanguage;
Preference<bool> m_bArcadeOptionsNavigation;
enum MusicWheelUsesSections { NEVER, ALWAYS, ABC_ONLY };
Preference<int> m_MusicWheelUsesSections;
Preference<MusicWheelUsesSections> m_MusicWheelUsesSections;
Preference<int> m_iMusicWheelSwitchSpeed;
Preference<bool> m_bEasterEggs;
enum MarvelousTiming { MARVELOUS_NEVER, MARVELOUS_COURSES_ONLY, MARVELOUS_EVERYWHERE };
Preference<int> m_iMarvelousTiming;
Preference<MarvelousTiming> m_MarvelousTiming;
Preference<bool> m_bEventMode;
Preference<int> m_iCoinsPerCredit;
Preference<int> m_iNumArcadeStages;
Preference<int> m_iSongsPerPlay;
// These options have weird interactions depending on m_bEventMode,
// so wrap them.
CoinMode m_CoinMode;
Premium m_Premium;
Preference<CoinMode> m_CoinMode;
Preference<Premium> m_Premium;
bool m_bDelayedCreditsReconcile;
bool m_bPickExtraStage;
bool m_bComboContinuesBetweenSongs;
float m_fLongVerSongSeconds;
float m_fMarathonVerSongSeconds;
Preference<bool> m_bDelayedCreditsReconcile;
Preference<bool> m_bPickExtraStage; // DDR Extreme-style extra stage support.
Preference<bool> m_bComboContinuesBetweenSongs;
Preference<float> m_fLongVerSongSeconds;
Preference<float> m_fMarathonVerSongSeconds;
enum Maybe { ASK = -1, NO = 0, YES = 1 };
Maybe m_ShowSongOptions;
bool m_bSoloSingle;
bool m_bDancePointsForOni; //DDR-Extreme style dance points instead of max2 percent
bool m_bPercentageScoring;
float m_fMinPercentageForMachineSongHighScore;
float m_fMinPercentageForMachineCourseHighScore;
bool m_bDisqualification;
bool m_bShowLyrics;
bool m_bAutogenSteps;
bool m_bAutogenGroupCourses;
bool m_bBreakComboToGetItem;
bool m_bLockCourseDifficulties;
Preference<Maybe> m_ShowSongOptions;
Preference<bool> m_bSoloSingle;
Preference<bool> m_bDancePointsForOni; //DDR-Extreme style dance points instead of max2 percent
Preference<bool> m_bPercentageScoring;
Preference<float> m_fMinPercentageForMachineSongHighScore;
Preference<float> m_fMinPercentageForMachineCourseHighScore;
Preference<bool> m_bDisqualification;
Preference<bool> m_bShowLyrics;
Preference<bool> m_bAutogenSteps;
Preference<bool> m_bAutogenGroupCourses;
Preference<bool> m_bBreakComboToGetItem;
Preference<bool> m_bLockCourseDifficulties;
enum CharacterOption { CO_OFF = 0, CO_RANDOM = 1, CO_SELECT = 2};
CharacterOption m_ShowDancingCharacters;
bool m_bUseUnlockSystem;
bool m_bFirstRun;
bool m_bAutoMapOnJoyChange;
Preference<CharacterOption> m_ShowDancingCharacters;
Preference<bool> m_bUseUnlockSystem;
Preference<bool> m_bFirstRun;
Preference<bool> m_bAutoMapOnJoyChange;
Preference<float> m_fGlobalOffsetSeconds;
int m_iProgressiveLifebar;
int m_iProgressiveStageLifebar;
int m_iProgressiveNonstopLifebar;
bool m_bShowBeginnerHelper;
bool m_bEndlessBreakEnabled;
int m_iEndlessNumStagesUntilBreak;
int m_iEndlessBreakLength;
bool m_bDisableScreenSaver;
CString m_sLanguage;
CString m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile
int m_iProductID; // Saved in HighScore to track what software version a score came from.
CString m_sDefaultLocalProfileID[NUM_PLAYERS];
bool m_bMemoryCards;
CString m_sMemoryCardOsMountPoint[NUM_PLAYERS]; // if set, always use the device that mounts to this point
int m_iMemoryCardUsbBus[NUM_PLAYERS]; // look for this bus when assigning cards. -1 = match any
int m_iMemoryCardUsbPort[NUM_PLAYERS]; // look for this port when assigning cards. -1 = match any
int m_iMemoryCardUsbLevel[NUM_PLAYERS]; // look for this level when assigning cards. -1 = match any
int m_iCenterImageTranslateX;
int m_iCenterImageTranslateY;
int m_fCenterImageAddWidth;
int m_fCenterImageAddHeight;
int m_iAttractSoundFrequency; // 0 = never, 1 = every time
bool m_bAllowExtraStage;
bool m_bHideDefaultNoteSkin;
int m_iMaxHighScoresPerListForMachine;
int m_iMaxHighScoresPerListForPlayer;
int m_iMaxRecentScoresForMachine;
int m_iMaxRecentScoresForPlayer;
bool m_bAllowMultipleHighScoreWithSameName;
bool m_bCelShadeModels;
Preference<int> m_iProgressiveLifebar;
Preference<int> m_iProgressiveStageLifebar;
Preference<int> m_iProgressiveNonstopLifebar;
Preference<bool> m_bShowBeginnerHelper;
Preference<bool> m_bEndlessBreakEnabled;
Preference<int> m_iEndlessNumStagesUntilBreak;
Preference<int> m_iEndlessBreakLength;
Preference<bool> m_bDisableScreenSaver;
Preference<CString> m_sLanguage;
Preference<CString> m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile
Preference<int> m_iProductID; // Saved in HighScore to track what software version a score came from.
CString m_sDefaultLocalProfileID[NUM_PLAYERS];
Preference<bool> m_bMemoryCards;
CString m_sMemoryCardOsMountPoint[NUM_PLAYERS]; // if set, always use the device that mounts to this point
int m_iMemoryCardUsbBus[NUM_PLAYERS]; // look for this bus when assigning cards. -1 = match any
int m_iMemoryCardUsbPort[NUM_PLAYERS]; // look for this port when assigning cards. -1 = match any
int m_iMemoryCardUsbLevel[NUM_PLAYERS]; // look for this level when assigning cards. -1 = match any
Preference<int> m_iCenterImageTranslateX;
Preference<int> m_iCenterImageTranslateY;
Preference<int> m_fCenterImageAddWidth;
Preference<int> m_fCenterImageAddHeight;
Preference<int> m_iAttractSoundFrequency; // 0 = never, 1 = every time
Preference<bool> m_bAllowExtraStage;
Preference<bool> m_bHideDefaultNoteSkin;
Preference<int> m_iMaxHighScoresPerListForMachine;
Preference<int> m_iMaxHighScoresPerListForPlayer;
Preference<int> m_iMaxRecentScoresForMachine;
Preference<int> m_iMaxRecentScoresForPlayer;
Preference<bool> m_bAllowMultipleHighScoreWithSameName;
Preference<bool> m_bCelShadeModels;
/* experimental: force a specific update rate. This prevents big
* animation jumps on frame skips. */
+1 -1
View File
@@ -180,7 +180,7 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
/* If we imported a profile fallback directory, change the memory card
* directory back to the preferred directory: never write over imported
* scores. */
m_sProfileDir[pn] = MEM_CARD_MOUNT_POINT[pn] + PREFSMAN->m_sMemoryCardProfileSubdir + "/";
m_sProfileDir[pn] = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/";
/* Load edits from all fallback directories, newest first. */
for( unsigned i = 0; i < asDirsToTry.size(); ++i )
+6 -4
View File
@@ -56,8 +56,10 @@ void ScreenCenterImage::Input( const DeviceInput& DeviceI, const InputEventType
{
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == KEY_SPACE )
{
PREFSMAN->m_iCenterImageTranslateX = PREFSMAN->m_iCenterImageTranslateY = 0;
PREFSMAN->m_fCenterImageAddWidth = PREFSMAN->m_fCenterImageAddHeight = 0;
PREFSMAN->m_iCenterImageTranslateX = 0;
PREFSMAN->m_iCenterImageTranslateY = 0;
PREFSMAN->m_fCenterImageAddWidth = 0;
PREFSMAN->m_fCenterImageAddHeight = 0;
return;
}
@@ -152,7 +154,7 @@ void ScreenCenterImage::Input( const DeviceInput& DeviceI, const InputEventType
void ScreenCenterImage::Move( Axis axis, float fDelta )
{
int *piValues[4] =
Preference<int> *piValues[4] =
{
&PREFSMAN->m_iCenterImageTranslateX,
&PREFSMAN->m_iCenterImageTranslateY,
@@ -160,7 +162,7 @@ void ScreenCenterImage::Move( Axis axis, float fDelta )
&PREFSMAN->m_fCenterImageAddHeight
};
*piValues[axis] += lrintf( fDelta );
*piValues[axis] = *piValues[axis] + lrintf( fDelta );
DISPLAY->ChangeCentering(
PREFSMAN->m_iCenterImageTranslateX,
+1 -1
View File
@@ -934,7 +934,7 @@ void ScreenGameplay::LoadNextSong()
{
m_pLifeMeter[p]->UpdateNonstopLifebar(
GAMESTATE->GetStageIndex(),
PREFSMAN->m_iNumArcadeStages,
PREFSMAN->m_iSongsPerPlay,
PREFSMAN->m_iProgressiveStageLifebar);
}
if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP )
+11 -32
View File
@@ -76,34 +76,15 @@ static void MoveMap( int &sel, T &opt, bool ToSel, const T *mapping, unsigned cn
* MoveMap for a generic preference.
* TODO: make this templated.
*/
static void MoveMap( int &sel, IPreference &pOption, bool ToSel, const float *mapping, unsigned cnt )
template <class T>
static void MoveMap( int &sel, Preference<T> &pOption, bool ToSel, const T *mapping, unsigned cnt )
{
if( ToSel )
{
/* opt -> sel. Find the closest entry in mapping. */
CString sStr = pOption.ToString();
float fValue = strtof( sStr, NULL );
sel = FindClosestEntry( fValue, mapping, cnt );
sel = FindClosestEntry( (T)pOption, mapping, cnt );
} else {
/* sel -> opt */
CString sStr = ssprintf( "%f", mapping[sel] );
pOption.FromString( sStr );
}
}
static void MoveMap( int &sel, IPreference &pOption, bool ToSel, const int *mapping, unsigned cnt )
{
if( ToSel )
{
/* opt -> sel. Find the closest entry in mapping. */
CString sStr = pOption.ToString();
int iValue = atoi( sStr );
sel = FindClosestEntry( iValue, mapping, cnt );
} else {
/* sel -> opt */
CString sStr = ssprintf( "%i", mapping[sel] );
pOption.FromString( sStr );
pOption = mapping[sel];
}
}
@@ -332,8 +313,8 @@ MOVE( UnlockSystem, PREFSMAN->m_bUseUnlockSystem );
static void MarvelousTiming( int &sel, bool ToSel, const ConfOption *pConfOption )
{
const int mapping[] = { PrefsManager::MARVELOUS_NEVER, PrefsManager::MARVELOUS_COURSES_ONLY, PrefsManager::MARVELOUS_EVERYWHERE };
MoveMap( sel, PREFSMAN->m_iMarvelousTiming, ToSel, mapping, ARRAYSIZE(mapping) );
const PrefsManager::MarvelousTiming mapping[] = { PrefsManager::MARVELOUS_NEVER, PrefsManager::MARVELOUS_COURSES_ONLY, PrefsManager::MARVELOUS_EVERYWHERE };
MoveMap( sel, PREFSMAN->m_MarvelousTiming, ToSel, mapping, ARRAYSIZE(mapping) );
}
static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -362,16 +343,14 @@ static void PremiumM( int &sel, bool ToSel, const ConfOption *pConfOption )
static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption )
{
IPreference *pPref = PREFSMAN->GetPreferenceByName( pConfOption->name );
ASSERT( pPref != NULL );
const float mapping[] = { 1,2,3,4,5,6,7 };
MoveMap( sel, *pPref, ToSel, mapping, ARRAYSIZE(mapping) );
const int mapping[] = { 1,2,3,4,5,6,7 };
MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAYSIZE(mapping) );
}
static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pConfOption )
{
const float mapping[] = { 1,2,3,4,5,6,7,8 };
MoveMap( sel, PREFSMAN->m_iNumArcadeStages, ToSel, mapping, ARRAYSIZE(mapping) );
const int mapping[] = { 1,2,3,4,5,6,7,8 };
MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAYSIZE(mapping) );
if( ToSel && PREFSMAN->m_bEventMode )
sel = 7;
+1 -1
View File
@@ -84,7 +84,7 @@ void ScreenTitleMenu::Init()
CString sText =
GAMESTATE->IsEventMode() ?
CString("event mode") :
ssprintf( "%d %s%s max", PREFSMAN->m_iNumArcadeStages.Value(), MAX_STAGES_TEXT.c_str(), (PREFSMAN->m_iNumArcadeStages>1)?"s":"" );
ssprintf( "%d %s%s max", PREFSMAN->m_iSongsPerPlay.Value(), MAX_STAGES_TEXT.c_str(), (PREFSMAN->m_iSongsPerPlay>1)?"s":"" );
m_textMaxStages.SetText( sText );
this->AddChild( &m_textMaxStages );
SET_XY_AND_ON_COMMAND( m_textMaxStages );
+1 -1
View File
@@ -282,7 +282,7 @@ bool Song::LoadFromSongDir( CString sDir )
}
/* Load the cached banners, if it's not loaded already. */
if( PREFSMAN->m_iBannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD && m_bHasBanner )
if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_LOW_RES_PRELOAD && m_bHasBanner )
BANNERCACHE->LoadBanner( GetBannerPath() );
/* Add AutoGen pointers. (These aren't cached.) */
+1 -1
View File
@@ -283,7 +283,7 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
void SongManager::PreloadSongImages()
{
ASSERT( TEXTUREMAN );
if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_FULL )
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL )
return;
const vector<Song*> &songs = SONGMAN->GetAllSongs();
+1 -1
View File
@@ -392,7 +392,7 @@ static void CheckSettings()
/* Preloaded banners takes about 9k per song. Although it's smaller than the
* actual song data, it still adds up with a lot of songs. Disable it for 64-meg
* systems. */
PREFSMAN->m_iBannerCache = LowMemory ? PrefsManager::BNCACHE_OFF:PrefsManager::BNCACHE_LOW_RES_PRELOAD;
PREFSMAN->m_BannerCache = LowMemory ? PrefsManager::BNCACHE_OFF:PrefsManager::BNCACHE_LOW_RES_PRELOAD;
PREFSMAN->SaveGlobalPrefsToDisk();
#endif