Files
itgmania212121/stepmania/src/PrefsManager.cpp
T

858 lines
43 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-02-28 19:40:40 +00:00
#include "PrefsManager.h"
#include "IniFile.h"
2002-07-23 01:41:40 +00:00
#include "GameState.h"
#include "RageDisplay.h"
#include "RageUtil.h"
2002-12-13 22:06:30 +00:00
#include "arch/arch.h" /* for default driver specs */
2003-09-25 01:37:56 +00:00
#include "RageSoundReader_Resample.h" /* for ResampleQuality */
2003-11-01 22:04:43 +00:00
#include "RageFile.h"
#include "ProductInfo.h"
#include "GameConstantsAndTypes.h"
2002-02-28 19:40:40 +00:00
2003-12-10 09:26:05 +00:00
#define STEPMANIA_INI_PATH "Data/StepMania.ini"
#define STATIC_INI_PATH "Data/Static.ini"
2002-02-28 19:40:40 +00:00
2002-05-27 08:23:27 +00:00
PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program
2002-02-28 19:40:40 +00:00
2003-11-02 21:05:59 +00:00
const float DEFAULT_SOUND_VOLUME = 1.00f;
2003-11-16 04:45:12 +00:00
const CString DEFAULT_LIGHTS_DRIVER = "Null";
2002-02-28 19:40:40 +00:00
2003-10-16 08:55:32 +00:00
bool g_bAutoRestart = false;
2002-02-28 19:40:40 +00:00
PrefsManager::PrefsManager()
{
Init();
ReadGlobalPrefsFromDisk();
}
void PrefsManager::Init()
2002-02-28 19:40:40 +00:00
{
2003-02-15 05:15:24 +00:00
#ifdef DEBUG
2002-08-17 06:44:04 +00:00
m_bWindowed = true;
#else
2002-05-28 20:01:22 +00:00
m_bWindowed = false;
2002-08-17 06:44:04 +00:00
#endif
m_iDisplayWidth = 640;
m_iDisplayHeight = 480;
m_iDisplayColorDepth = 16;
m_iTextureColorDepth = 16; // default to 16 for better preformance on slower cards
2003-07-09 02:28:56 +00:00
m_iMovieColorDepth = 16;
2003-01-11 20:15:00 +00:00
m_iMaxTextureResolution = 2048;
2002-11-12 09:23:50 +00:00
m_iRefreshRate = REFRESH_DEFAULT;
m_bOnlyDedicatedMenuButtons = false;
2004-06-18 11:02:40 +00:00
m_bCelShadeModels = false; // Work-In-Progress.. disable by default.
2004-07-28 16:04:19 +00:00
m_fConstantUpdateDeltaSeconds = 0;
2003-02-15 05:15:24 +00:00
#ifdef DEBUG
m_bShowStats = true;
#else
m_bShowStats = false;
#endif
2003-11-13 00:39:36 +00:00
m_bShowBanners = true ;
2002-07-11 19:02:26 +00:00
m_BackgroundMode = BGMODE_ANIMATIONS;
m_iNumBackgrounds = 8;
m_bShowDanger = true;
2002-07-11 19:02:26 +00:00
m_fBGBrightness = 0.8f;
m_bMenuTimer = true;
2002-05-27 08:23:27 +00:00
m_iNumArcadeStages = 3;
2003-04-19 19:05:25 +00:00
m_bEventMode = false;
2002-06-24 22:04:31 +00:00
m_bAutoPlay = false;
m_fJudgeWindowScale = 1.0f;
m_fJudgeWindowAdd = 0;
2003-11-11 07:36:28 +00:00
m_fLifeDifficultyScale = 1.0f;
m_fJudgeWindowSecondsMarvelous = 0.0225f;
m_fJudgeWindowSecondsPerfect = 0.045f;
m_fJudgeWindowSecondsGreat = 0.090f;
m_fJudgeWindowSecondsGood = 0.135f;
m_fJudgeWindowSecondsBoo = 0.180f;
m_fJudgeWindowSecondsOK = 0.250f; // allow enough time to take foot off and put back on
m_fJudgeWindowSecondsMine = 0.090f; // same as great
m_fJudgeWindowSecondsAttack = 0.135f;
2004-01-20 07:09:44 +00:00
m_fLifeDeltaPercentChangeMarvelous = +0.008f;
m_fLifeDeltaPercentChangePerfect = +0.008f;
m_fLifeDeltaPercentChangeGreat = +0.004f;
m_fLifeDeltaPercentChangeGood = +0.000f;
m_fLifeDeltaPercentChangeBoo = -0.040f;
m_fLifeDeltaPercentChangeMiss = -0.080f;
m_fLifeDeltaPercentChangeHitMine = -0.160f;
m_fLifeDeltaPercentChangeOK = +0.008f;
m_fLifeDeltaPercentChangeNG = -0.080f;
m_fTugMeterPercentChangeMarvelous = +0.010f;
m_fTugMeterPercentChangePerfect = +0.008f;
m_fTugMeterPercentChangeGreat = +0.004f;
m_fTugMeterPercentChangeGood = +0.000f;
m_fTugMeterPercentChangeBoo = -0.010f;
m_fTugMeterPercentChangeMiss = -0.020f;
m_fTugMeterPercentChangeHitMine = -0.040f;
m_fTugMeterPercentChangeOK = +0.008f;
m_fTugMeterPercentChangeNG = -0.020f;
2004-01-11 23:33:56 +00:00
2003-10-13 00:06:49 +00:00
m_iRegenComboAfterFail = 10; // cumulative
m_iRegenComboAfterMiss = 5; // cumulative
m_iMaxRegenComboAfterFail = 10;
m_iMaxRegenComboAfterMiss = 10;
2003-10-13 03:20:05 +00:00
m_bTwoPlayerRecovery = true;
2004-01-11 23:33:56 +00:00
m_bMercifulDrain = true;
2004-06-26 17:28:02 +00:00
m_bMinimum1FullSongInCourses = false;
2004-01-20 07:09:44 +00:00
m_iPercentScoreWeightMarvelous = 3;
m_iPercentScoreWeightPerfect = 2;
m_iPercentScoreWeightGreat = 1;
m_iPercentScoreWeightGood = 0;
m_iPercentScoreWeightBoo = 0;
m_iPercentScoreWeightMiss = 0;
m_iPercentScoreWeightOK = 3;
m_iPercentScoreWeightNG = 0;
m_iPercentScoreWeightHitMine = -2;
m_iGradeWeightMarvelous = 2;
m_iGradeWeightPerfect = 2;
m_iGradeWeightGreat = 1;
m_iGradeWeightGood = 0;
m_iGradeWeightBoo = -4;
m_iGradeWeightMiss = -8;
m_iGradeWeightHitMine = -8;
m_iGradeWeightOK = 6;
m_iGradeWeightNG = 0;
m_iNumGradeTiersUsed = 7;
2004-01-20 03:32:48 +00:00
for( int i=0; i<NUM_GRADE_TIERS; i++ )
2004-03-13 18:35:25 +00:00
m_fGradePercent[i] = 0;
m_fGradePercent[GRADE_TIER_1] = 1.0f;
m_fGradePercent[GRADE_TIER_2] = 1.0f;
m_fGradePercent[GRADE_TIER_3] = 0.93f; // AA
m_fGradePercent[GRADE_TIER_4] = 0.80f; // A
m_fGradePercent[GRADE_TIER_5] = 0.65f; // B
m_fGradePercent[GRADE_TIER_6] = 0.45f; // C
m_fGradePercent[GRADE_TIER_7] = -99999; // D
m_bGradeTier02IsAllPerfects = true;
2004-01-11 23:33:56 +00:00
2004-01-20 07:09:44 +00:00
m_fSuperMeterPercentChangeMarvelous = +0.05f;
m_fSuperMeterPercentChangePerfect = +0.04f;
m_fSuperMeterPercentChangeGreat = +0.02f;
m_fSuperMeterPercentChangeGood = +0.00f;
m_fSuperMeterPercentChangeBoo = -0.00f;
m_fSuperMeterPercentChangeMiss = -0.20f;
m_fSuperMeterPercentChangeHitMine = -0.40f;
m_fSuperMeterPercentChangeOK = +0.04f;
m_fSuperMeterPercentChangeNG = -0.20f;
2004-01-11 23:33:56 +00:00
m_bMercifulSuperMeter = true;
2002-08-22 03:35:33 +00:00
m_bDelayedEscape = true;
m_bInstructions = true;
m_bShowDontDie = true;
m_bShowSelectGroup = true;
2003-05-20 04:41:47 +00:00
m_bShowNative = true;
m_bArcadeOptionsNavigation = false;
2003-04-18 23:55:20 +00:00
m_bSoloSingle = false;
m_bDelayedTextureDelete = true;
m_bTexturePreload = false;
2003-05-20 04:42:12 +00:00
m_bDelayedScreenLoad = false;
m_bDelayedModelDelete = false;
2003-11-25 22:56:48 +00:00
m_BannerCache = BNCACHE_LOW_RES;
2004-03-28 01:28:32 +00:00
m_bFastLoad = true;
m_MusicWheelUsesSections = ALWAYS;
2003-01-21 06:51:35 +00:00
m_iMusicWheelSwitchSpeed = 10;
m_bEasterEggs = true;
m_iMarvelousTiming = 2;
m_iCoinMode = COIN_HOME;
2003-01-19 04:44:22 +00:00
m_iCoinsPerCredit = 1;
2003-11-09 01:09:35 +00:00
m_Premium = NO_PREMIUM;
2004-05-07 08:08:11 +00:00
m_bDelayedCreditsReconcile = false;
2003-01-18 04:26:25 +00:00
m_iBoostAppPriority = -1;
2003-12-20 21:29:55 +00:00
m_bSmoothLines = false;
2003-04-21 22:36:45 +00:00
m_ShowSongOptions = YES;
m_bDancePointsForOni = false;
2003-10-05 05:18:48 +00:00
m_bPercentageScoring = false;
m_fMinPercentageForMachineSongHighScore = 0.5f;
2004-08-01 01:36:51 +00:00
m_fMinPercentageForMachineCourseHighScore = 0.001f; // don't save course scores with 0 percentage
2004-03-28 20:08:43 +00:00
m_bDisqualification = false;
m_bShowLyrics = true;
2004-02-10 21:10:23 +00:00
m_bAutogenSteps = true;
m_bAutogenGroupCourses = true;
m_bBreakComboToGetItem = false;
2004-01-21 01:33:29 +00:00
m_bLockCourseDifficulties = true;
m_ShowDancingCharacters = CO_OFF;
m_bUseUnlockSystem = false;
m_bFirstRun = true;
m_bAutoMapOnJoyChange = true;
m_fGlobalOffsetSeconds = 0;
2003-08-20 09:17:56 +00:00
m_bShowBeginnerHelper = false;
2003-09-29 12:32:12 +00:00
m_bEndlessBreakEnabled = true;
m_iEndlessNumStagesUntilBreak = 5;
m_iEndlessBreakLength = 5;
2004-03-15 02:32:51 +00:00
m_bDisableScreenSaver = true;
2003-08-20 17:54:26 +00:00
2003-07-29 12:42:38 +00:00
// set to 0 so people aren't shocked at first
m_iProgressiveLifebar = 0;
m_iProgressiveNonstopLifebar = 0;
2003-07-31 15:07:48 +00:00
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;
m_bMoveRandomToEnd = false;
2004-06-02 07:07:12 +00:00
m_bSubSortByNumSteps = false;
m_iScoringType = SCORING_MAX2;
m_iGetRankingName = RANKING_ON;
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
m_fMarathonVerSongSeconds = 60*5.f;
2002-08-30 04:28:12 +00:00
/* 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. */
m_bHiddenSongs = false;
2002-09-03 00:22:19 +00:00
m_bVsync = true;
2003-08-19 08:01:15 +00:00
m_sLanguage = ""; // ThemeManager will deal with this invalid language
2003-10-11 07:47:34 +00:00
m_iCenterImageTranslateX = 0;
m_iCenterImageTranslateY = 0;
m_fCenterImageScaleX = 1;
m_fCenterImageScaleY = 1;
m_iAttractSoundFrequency = 1;
2003-10-19 05:49:53 +00:00
m_bAllowExtraStage = true;
2004-03-01 02:45:29 +00:00
m_bHideDefaultNoteSkin = false;
m_iMaxHighScoresPerListForMachine = 10;
m_iMaxHighScoresPerListForPlayer = 3;
m_fPadStickSeconds = 0;
m_bForceMipMaps = false;
2004-05-18 09:05:21 +00:00
m_bTrilinearFiltering = false;
m_bAnisotropicFiltering = false;
2003-10-16 08:55:32 +00:00
g_bAutoRestart = false;
m_bSignProfileData = false;
m_bEditorShowBGChangesPlay = false;
/* XXX: Set these defaults for individual consoles using VideoCardDefaults.ini. */
2004-05-23 23:24:44 +00:00
m_bPAL = false;
#ifdef _XBOX
m_bInterlaced = true;
2004-02-21 00:14:38 +00:00
m_fScreenPosX = 0;
m_fScreenPosY = 0;
m_fScreenWidth = 640;
m_fScreenHeight = 480;
#else
m_bInterlaced = false;
#endif
2004-02-21 00:14:38 +00:00
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
2003-12-02 20:52:10 +00:00
/* Number of frames to write ahead; usually 44100 frames per second.
* (Number of millisec would be more flexible, but it's more useful to
* specify numbers directly.) This is purely a troubleshooting option
* and is not honored by all sound drivers. */
m_iSoundWriteAhead = 0;
2004-07-17 21:22:36 +00:00
m_iSoundDevice = "";
2004-02-21 00:14:38 +00:00
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
m_iSoundResampleQuality = RageSoundReader_Resample::RESAMP_NORMAL;
2003-09-02 04:51:36 +00:00
m_sMovieDrivers = DEFAULT_MOVIE_DRIVER_LIST;
2003-08-20 17:54:26 +00:00
// StepMania.cpp sets these on first run:
m_sVideoRenderers = "";
#if defined(WIN32)
m_iLastSeenMemory = 0;
#endif
2003-11-16 04:45:12 +00:00
m_sLightsDriver = DEFAULT_LIGHTS_DRIVER;
2004-05-20 19:05:37 +00:00
m_sLightsStepsDifficulty = "medium";
m_bBlinkGameplayButtonLightsOnNote = false;
m_bAllowUnacceleratedRenderer = false;
2003-07-13 20:21:04 +00:00
m_bThreadedInput = true;
2004-04-08 20:36:44 +00:00
m_bThreadedMovieDecode = true;
2003-12-18 21:16:43 +00:00
m_bScreenTestMode = false;
2004-02-16 05:35:06 +00:00
m_sMachineName = "NoName";
2003-07-07 03:51:20 +00:00
m_sIgnoredMessageWindows = "";
2003-08-20 17:54:26 +00:00
m_sCoursesToShowRanking = "";
2004-02-27 00:56:51 +00:00
m_bLogToDisk = true;
m_bForceLogFlush = false;
#ifdef DEBUG
m_bShowLogOutput = true;
#else
m_bShowLogOutput = false;
#endif
m_bTimestamping = false;
2004-01-17 23:22:08 +00:00
m_bLogSkips = false;
m_bLogCheckpoints = false;
2004-02-15 22:56:51 +00:00
m_bShowLoadingWindow = true;
2004-06-06 01:50:21 +00:00
m_bMemoryCards = false;
FOREACH_PlayerNumber( p )
{
m_iMemoryCardUsbBus[p] = -1;
m_iMemoryCardUsbPort[p] = -1;
m_iMemoryCardUsbLevel[p] = -1;
}
m_sMemoryCardProfileSubdir = PRODUCT_NAME;
m_iProductID = 1;
2002-02-28 19:40:40 +00:00
}
PrefsManager::~PrefsManager()
{
}
2003-10-08 08:01:41 +00:00
void PrefsManager::ReadGlobalPrefsFromDisk()
2002-02-28 19:40:40 +00:00
{
ReadPrefsFromFile( STEPMANIA_INI_PATH );
2004-05-27 02:54:32 +00:00
/* Static preferences always override StepMania.ini. */
ReadStaticPrefsFromDisk();
}
2003-10-08 08:01:41 +00:00
void PrefsManager::ReadStaticPrefsFromDisk()
{
2003-10-08 08:01:41 +00:00
/* Load this on top of the regular INI; if it exists, any settings listed
* in it will override user settings. */
ReadPrefsFromFile( STATIC_INI_PATH );
}
void PrefsManager::ReadPrefsFromFile( CString sIni )
{
IniFile ini;
2004-05-23 02:27:51 +00:00
ini.ReadFile( sIni );
2002-02-28 19:40:40 +00:00
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "Windowed", m_bWindowed );
ini.GetValue( "Options", "Interlaced", m_bInterlaced );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "PAL", m_bPAL );
2004-05-23 23:24:44 +00:00
#ifdef _XBOX
2003-11-13 00:39:36 +00:00
ini.GetValue( "Options", "ScreenPosX", m_fScreenPosX );
ini.GetValue( "Options", "ScreenPosY", m_fScreenPosY );
ini.GetValue( "Options", "ScreenWidth", m_fScreenWidth );
ini.GetValue( "Options", "ScreenHeight", m_fScreenHeight );
#endif
2004-06-18 11:02:40 +00:00
ini.GetValue( "Options", "CelShadeModels", m_bCelShadeModels );
2004-07-28 16:04:19 +00:00
ini.GetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "DisplayWidth", m_iDisplayWidth );
ini.GetValue( "Options", "DisplayHeight", m_iDisplayHeight );
ini.GetValue( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
ini.GetValue( "Options", "TextureColorDepth", m_iTextureColorDepth );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "MovieColorDepth", m_iMovieColorDepth );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "RefreshRate", m_iRefreshRate );
ini.GetValue( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ShowStats", m_bShowStats );
2003-11-13 00:39:36 +00:00
ini.GetValue( "Options", "ShowBanners", m_bShowBanners );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "BackgroundMode", (int&)m_BackgroundMode );
ini.GetValue( "Options", "NumBackgrounds", m_iNumBackgrounds);
ini.GetValue( "Options", "ShowDanger", m_bShowDanger );
ini.GetValue( "Options", "BGBrightness", m_fBGBrightness );
ini.GetValue( "Options", "MenuTimer", m_bMenuTimer );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "NumArcadeStages", m_iNumArcadeStages );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "EventMode", m_bEventMode );
ini.GetValue( "Options", "AutoPlay", m_bAutoPlay );
ini.GetValue( "Options", "JudgeWindowScale", m_fJudgeWindowScale );
ini.GetValue( "Options", "JudgeWindowAdd", m_fJudgeWindowAdd );
2004-01-20 07:09:44 +00:00
ini.GetValue( "Options", "JudgeWindowSecondsMarvelous", m_fJudgeWindowSecondsMarvelous );
ini.GetValue( "Options", "JudgeWindowSecondsPerfect", m_fJudgeWindowSecondsPerfect );
ini.GetValue( "Options", "JudgeWindowSecondsGreat", m_fJudgeWindowSecondsGreat );
ini.GetValue( "Options", "JudgeWindowSecondsGood", m_fJudgeWindowSecondsGood );
ini.GetValue( "Options", "JudgeWindowSecondsBoo", m_fJudgeWindowSecondsBoo );
ini.GetValue( "Options", "JudgeWindowSecondsOK", m_fJudgeWindowSecondsOK );
ini.GetValue( "Options", "JudgeWindowSecondsMine", m_fJudgeWindowSecondsMine );
ini.GetValue( "Options", "JudgeWindowSecondsAttack", m_fJudgeWindowSecondsAttack );
ini.GetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
2004-01-20 07:09:44 +00:00
ini.GetValue( "Options", "LifeDeltaPercentChangeMarvelous", m_fLifeDeltaPercentChangeMarvelous );
ini.GetValue( "Options", "LifeDeltaPercentChangePerfect", m_fLifeDeltaPercentChangePerfect );
ini.GetValue( "Options", "LifeDeltaPercentChangeGreat", m_fLifeDeltaPercentChangeGreat );
ini.GetValue( "Options", "LifeDeltaPercentChangeGood", m_fLifeDeltaPercentChangeGood );
ini.GetValue( "Options", "LifeDeltaPercentChangeBoo", m_fLifeDeltaPercentChangeBoo );
ini.GetValue( "Options", "LifeDeltaPercentChangeMiss", m_fLifeDeltaPercentChangeMiss );
ini.GetValue( "Options", "LifeDeltaPercentChangeHitMine", m_fLifeDeltaPercentChangeHitMine );
ini.GetValue( "Options", "LifeDeltaPercentChangeOK", m_fLifeDeltaPercentChangeOK );
ini.GetValue( "Options", "LifeDeltaPercentChangeNG", m_fLifeDeltaPercentChangeNG );
ini.GetValue( "Options", "TugMeterPercentChangeMarvelous", m_fTugMeterPercentChangeMarvelous );
ini.GetValue( "Options", "TugMeterPercentChangePerfect", m_fTugMeterPercentChangePerfect );
ini.GetValue( "Options", "TugMeterPercentChangeGreat", m_fTugMeterPercentChangeGreat );
ini.GetValue( "Options", "TugMeterPercentChangeGood", m_fTugMeterPercentChangeGood );
ini.GetValue( "Options", "TugMeterPercentChangeBoo", m_fTugMeterPercentChangeBoo );
ini.GetValue( "Options", "TugMeterPercentChangeMiss", m_fTugMeterPercentChangeMiss );
ini.GetValue( "Options", "TugMeterPercentChangeHitMine", m_fTugMeterPercentChangeHitMine );
ini.GetValue( "Options", "TugMeterPercentChangeOK", m_fTugMeterPercentChangeOK );
ini.GetValue( "Options", "TugMeterPercentChangeNG", m_fTugMeterPercentChangeNG );
2003-10-13 00:06:49 +00:00
ini.GetValue( "Options", "RegenComboAfterFail", m_iRegenComboAfterFail );
ini.GetValue( "Options", "RegenComboAfterMiss", m_iRegenComboAfterMiss );
ini.GetValue( "Options", "MaxRegenComboAfterFail", m_iMaxRegenComboAfterFail );
ini.GetValue( "Options", "MaxRegenComboAfterMiss", m_iMaxRegenComboAfterMiss );
2003-10-13 03:20:05 +00:00
ini.GetValue( "Options", "TwoPlayerRecovery", m_bTwoPlayerRecovery );
2004-01-11 23:33:56 +00:00
ini.GetValue( "Options", "MercifulDrain", m_bMercifulDrain );
2004-06-26 17:28:02 +00:00
ini.GetValue( "Options", "Minimum1FullSongInCourses", m_bMinimum1FullSongInCourses );
2004-01-20 07:09:44 +00:00
ini.GetValue( "Options", "PercentScoreWeightMarvelous", m_iPercentScoreWeightMarvelous );
ini.GetValue( "Options", "PercentScoreWeightPerfect", m_iPercentScoreWeightPerfect );
ini.GetValue( "Options", "PercentScoreWeightGreat", m_iPercentScoreWeightGreat );
ini.GetValue( "Options", "PercentScoreWeightGood", m_iPercentScoreWeightGood );
ini.GetValue( "Options", "PercentScoreWeightBoo", m_iPercentScoreWeightBoo );
ini.GetValue( "Options", "PercentScoreWeightMiss", m_iPercentScoreWeightMiss );
ini.GetValue( "Options", "PercentScoreWeightOK", m_iPercentScoreWeightOK );
ini.GetValue( "Options", "PercentScoreWeightNG", m_iPercentScoreWeightNG );
ini.GetValue( "Options", "PercentScoreWeightHitMine", m_iPercentScoreWeightHitMine );
ini.GetValue( "Options", "GradeWeightMarvelous", m_iGradeWeightMarvelous );
ini.GetValue( "Options", "GradeWeightPerfect", m_iGradeWeightPerfect );
ini.GetValue( "Options", "GradeWeightGreat", m_iGradeWeightGreat );
ini.GetValue( "Options", "GradeWeightGood", m_iGradeWeightGood );
ini.GetValue( "Options", "GradeWeightBoo", m_iGradeWeightBoo );
ini.GetValue( "Options", "GradeWeightMiss", m_iGradeWeightMiss );
ini.GetValue( "Options", "GradeWeightHitMine", m_iGradeWeightHitMine );
ini.GetValue( "Options", "GradeWeightOK", m_iGradeWeightOK );
ini.GetValue( "Options", "GradeWeightNG", m_iGradeWeightNG );
ini.GetValue( "Options", "NumGradeTiersUsed", m_iNumGradeTiersUsed );
2004-01-20 03:32:48 +00:00
for( int g=0; g<NUM_GRADE_TIERS; g++ )
{
Grade grade = (Grade)g;
CString s = GradeToString( grade );
2004-03-13 18:35:25 +00:00
ini.GetValue( "Options", "GradePercent"+s, m_fGradePercent[g] );
2004-01-20 03:32:48 +00:00
}
2004-01-20 07:09:44 +00:00
ini.GetValue( "Options", "GradeTier02IsAllPerfects", m_bGradeTier02IsAllPerfects );
ini.GetValue( "Options", "SuperMeterPercentChangeMarvelous",m_fSuperMeterPercentChangeMarvelous );
ini.GetValue( "Options", "SuperMeterPercentChangePerfect", m_fSuperMeterPercentChangePerfect );
ini.GetValue( "Options", "SuperMeterPercentChangeGreat", m_fSuperMeterPercentChangeGreat );
ini.GetValue( "Options", "SuperMeterPercentChangeGood", m_fSuperMeterPercentChangeGood );
ini.GetValue( "Options", "SuperMeterPercentChangeBoo", m_fSuperMeterPercentChangeBoo );
ini.GetValue( "Options", "SuperMeterPercentChangeMiss", m_fSuperMeterPercentChangeMiss );
ini.GetValue( "Options", "SuperMeterPercentChangeHitMine", m_fSuperMeterPercentChangeHitMine );
ini.GetValue( "Options", "SuperMeterPercentChangeOK", m_fSuperMeterPercentChangeOK );
ini.GetValue( "Options", "SuperMeterPercentChangeNG", m_fSuperMeterPercentChangeNG );
2004-01-11 23:33:56 +00:00
ini.GetValue( "Options", "MercifulSuperMeter", m_bMercifulSuperMeter );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "DelayedEscape", m_bDelayedEscape );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "HiddenSongs", m_bHiddenSongs );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "Vsync", m_bVsync );
ini.GetValue( "Options", "HowToPlay", m_bInstructions );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "Caution", m_bShowDontDie );
ini.GetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ShowNative", m_bShowNative );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.GetValue( "Options", "TexturePreload", m_bTexturePreload );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.GetValue( "Options", "DelayedModelDelete", m_bDelayedModelDelete );
2003-11-25 22:56:48 +00:00
ini.GetValue( "Options", "BannerCache", (int&)m_BannerCache );
2003-12-31 09:32:21 +00:00
ini.GetValue( "Options", "FastLoad", m_bFastLoad );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
ini.GetValue( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
ini.GetValue( "Options", "SoundDrivers", m_sSoundDrivers );
2003-12-02 20:52:10 +00:00
ini.GetValue( "Options", "SoundWriteAhead", m_iSoundWriteAhead );
2004-07-17 21:22:36 +00:00
ini.GetValue( "Options", "SoundDevice", m_iSoundDevice );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "MovieDrivers", m_sMovieDrivers );
ini.GetValue( "Options", "EasterEggs", m_bEasterEggs );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming );
ini.GetValue( "Options", "SoundVolume", m_fSoundVolume );
2003-11-16 04:45:12 +00:00
ini.GetValue( "Options", "LightsDriver", m_sLightsDriver );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
ini.GetValue( "Options", "CoinMode", m_iCoinMode );
ini.GetValue( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
m_iCoinsPerCredit = max(m_iCoinsPerCredit, 1);
2003-11-09 01:09:35 +00:00
ini.GetValue( "Options", "Premium", (int&)m_Premium );
2004-05-07 08:08:11 +00:00
ini.GetValue( "Options", "DelayedCreditsReconcile", m_bDelayedCreditsReconcile );
2003-10-02 02:03:29 +00:00
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 );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
2004-05-20 19:05:37 +00:00
ini.GetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
ini.GetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
ini.GetValue( "Options", "ThreadedInput", m_bThreadedInput );
2004-04-02 23:14:29 +00:00
ini.GetValue( "Options", "ThreadedMovieDecode", m_bThreadedMovieDecode );
2003-12-18 21:16:43 +00:00
ini.GetValue( "Options", "ScreenTestMode", m_bScreenTestMode );
2004-02-16 05:35:06 +00:00
ini.GetValue( "Options", "MachineName", m_sMachineName );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows );
ini.GetValue( "Options", "SoloSingle", m_bSoloSingle );
ini.GetValue( "Options", "DancePointsForOni", m_bDancePointsForOni );
2003-10-05 05:18:48 +00:00
ini.GetValue( "Options", "PercentageScoring", m_bPercentageScoring );
ini.GetValue( "Options", "MinPercentageForMachineSongHighScore", m_fMinPercentageForMachineSongHighScore );
ini.GetValue( "Options", "MinPercentageForMachineCourseHighScore", m_fMinPercentageForMachineCourseHighScore );
2004-03-28 20:08:43 +00:00
ini.GetValue( "Options", "Disqualification", m_bDisqualification );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ShowLyrics", m_bShowLyrics );
2004-02-10 21:10:23 +00:00
ini.GetValue( "Options", "AutogenSteps", m_bAutogenSteps );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
ini.GetValue( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
2004-01-21 01:33:29 +00:00
ini.GetValue( "Options", "LockCourseDifficulties", m_bLockCourseDifficulties );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder );
ini.GetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd );
2004-06-02 07:07:12 +00:00
ini.GetValue( "Options", "SubSortByNumSteps", m_bSubSortByNumSteps );
2003-10-02 02:03:29 +00:00
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "ScoringType", (int&)m_iScoringType );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ProgressiveLifebar", m_iProgressiveLifebar );
ini.GetValue( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar );
2003-10-02 02:03:29 +00:00
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "FirstRun", m_bFirstRun );
ini.GetValue( "Options", "AutoMapJoysticks", m_bAutoMapOnJoyChange );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "VideoRenderers", m_sVideoRenderers );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
ini.GetValue( "Options", "LastSeenInputDevices", m_sLastSeenInputDevices );
#if defined(WIN32)
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "LastSeenMemory", m_iLastSeenMemory );
#endif
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
ini.GetValue( "Options", "GetRankingName", (int&)m_iGetRankingName);
2004-06-02 07:07:12 +00:00
ini.GetValue( "Options", "SmoothLines", m_bSmoothLines );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper );
ini.GetValue( "Options", "Language", m_sLanguage );
2003-10-02 02:11:47 +00:00
ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
ini.GetValue( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak );
2003-10-02 02:03:29 +00:00
ini.GetValue( "Options", "EndlessBreakLength", m_iEndlessBreakLength );
2004-02-17 07:16:58 +00:00
ini.GetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.GetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.GetValue( "Options", "ProductID", m_iProductID );
2004-06-06 01:50:21 +00:00
ini.GetValue( "Options", "MemoryCards", m_bMemoryCards );
FOREACH_PlayerNumber( p )
2003-11-01 22:04:43 +00:00
{
2003-12-07 08:19:10 +00:00
ini.GetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
ini.GetValue( "Options", ssprintf("MemoryCardOsMountPointP%d",p+1), m_sMemoryCardOsMountPoint[p] );
FixSlashesInPlace( m_sMemoryCardOsMountPoint[p] );
ini.GetValue( "Options", ssprintf("MemoryCardUsbBusP%d",p+1), m_iMemoryCardUsbBus[p] );
ini.GetValue( "Options", ssprintf("MemoryCardUsbPortP%d",p+1), m_iMemoryCardUsbPort[p] );
ini.GetValue( "Options", ssprintf("MemoryCardUsbLevelP%d",p+1), m_iMemoryCardUsbLevel[p] );
2003-11-01 22:04:43 +00:00
}
2003-07-18 08:04:47 +00:00
2003-10-11 07:47:34 +00:00
ini.GetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
ini.GetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY );
ini.GetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX );
ini.GetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
2003-12-28 19:46:50 +00:00
ini.GetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
2003-10-19 05:49:53 +00:00
ini.GetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
2004-03-01 02:45:29 +00:00
ini.GetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
ini.GetValue( "Options", "MaxHighScoresPerListForMachine", m_iMaxHighScoresPerListForMachine );
ini.GetValue( "Options", "MaxHighScoresPerListForPlayer", m_iMaxHighScoresPerListForPlayer );
ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
ini.GetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
2004-05-18 09:05:21 +00:00
ini.GetValue( "Options", "TrilinearFiltering", m_bTrilinearFiltering );
ini.GetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering );
2003-10-16 08:55:32 +00:00
ini.GetValue( "Options", "AutoRestart", g_bAutoRestart );
ini.GetValue( "Options", "SignProfileData", m_bSignProfileData );
ini.GetValue( "Editor", "ShowBGChangesPlay", m_bEditorShowBGChangesPlay );
ini.GetValue( "Options", "AdditionalSongFolders", m_sAdditionalSongFolders );
ini.GetValue( "Options", "AdditionalFolders", m_sAdditionalFolders );
FixSlashesInPlace(m_sAdditionalSongFolders);
FixSlashesInPlace(m_sAdditionalFolders);
2004-02-27 00:56:51 +00:00
ini.GetValue( "Debug", "LogToDisk", m_bLogToDisk );
ini.GetValue( "Debug", "ForceLogFlush", m_bForceLogFlush );
ini.GetValue( "Debug", "ShowLogOutput", m_bShowLogOutput );
ini.GetValue( "Debug", "Timestamping", m_bTimestamping );
2004-01-17 23:22:08 +00:00
ini.GetValue( "Debug", "LogSkips", m_bLogSkips );
ini.GetValue( "Debug", "LogCheckpoints", m_bLogCheckpoints );
2004-02-15 22:56:51 +00:00
ini.GetValue( "Debug", "ShowLoadingWindow", m_bShowLoadingWindow );
2002-02-28 19:40:40 +00:00
}
2003-10-05 05:18:48 +00:00
void PrefsManager::SaveGlobalPrefsToDisk() const
2002-02-28 19:40:40 +00:00
{
IniFile ini;
2002-04-28 20:42:32 +00:00
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "Windowed", m_bWindowed );
2004-06-18 11:02:40 +00:00
ini.SetValue( "Options", "CelShadeModels", m_bCelShadeModels );
2004-07-28 16:04:19 +00:00
ini.SetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "DisplayWidth", m_iDisplayWidth );
ini.SetValue( "Options", "DisplayHeight", m_iDisplayHeight );
ini.SetValue( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
ini.SetValue( "Options", "TextureColorDepth", m_iTextureColorDepth );
ini.SetValue( "Options", "MovieColorDepth", m_iMovieColorDepth );
ini.SetValue( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
ini.SetValue( "Options", "RefreshRate", m_iRefreshRate );
ini.SetValue( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
ini.SetValue( "Options", "ShowStats", m_bShowStats );
2003-11-13 00:39:36 +00:00
ini.SetValue( "Options", "ShowBanners", m_bShowBanners );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "BackgroundMode", m_BackgroundMode);
ini.SetValue( "Options", "NumBackgrounds", m_iNumBackgrounds);
ini.SetValue( "Options", "ShowDanger", m_bShowDanger );
ini.SetValue( "Options", "BGBrightness", m_fBGBrightness );
ini.SetValue( "Options", "MenuTimer", m_bMenuTimer );
ini.SetValue( "Options", "NumArcadeStages", m_iNumArcadeStages );
ini.SetValue( "Options", "EventMode", m_bEventMode );
ini.SetValue( "Options", "AutoPlay", m_bAutoPlay );
ini.SetValue( "Options", "JudgeWindowScale", m_fJudgeWindowScale );
ini.SetValue( "Options", "JudgeWindowAdd", m_fJudgeWindowAdd );
2004-01-20 07:09:44 +00:00
ini.SetValue( "Options", "JudgeWindowSecondsMarvelous", m_fJudgeWindowSecondsMarvelous );
ini.SetValue( "Options", "JudgeWindowSecondsPerfect", m_fJudgeWindowSecondsPerfect );
ini.SetValue( "Options", "JudgeWindowSecondsGreat", m_fJudgeWindowSecondsGreat );
ini.SetValue( "Options", "JudgeWindowSecondsGood", m_fJudgeWindowSecondsGood );
ini.SetValue( "Options", "JudgeWindowSecondsBoo", m_fJudgeWindowSecondsBoo );
ini.SetValue( "Options", "JudgeWindowSecondsOK", m_fJudgeWindowSecondsOK );
ini.SetValue( "Options", "JudgeWindowSecondsMine", m_fJudgeWindowSecondsMine );
ini.SetValue( "Options", "JudgeWindowSecondsAttack", m_fJudgeWindowSecondsAttack );
ini.SetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
2004-01-20 07:09:44 +00:00
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", "TugMeterPercentChangeMarvelous", m_fTugMeterPercentChangeMarvelous );
ini.SetValue( "Options", "TugMeterPercentChangePerfect", m_fTugMeterPercentChangePerfect );
ini.SetValue( "Options", "TugMeterPercentChangeGreat", m_fTugMeterPercentChangeGreat );
ini.SetValue( "Options", "TugMeterPercentChangeGood", m_fTugMeterPercentChangeGood );
ini.SetValue( "Options", "TugMeterPercentChangeBoo", m_fTugMeterPercentChangeBoo );
ini.SetValue( "Options", "TugMeterPercentChangeMiss", m_fTugMeterPercentChangeMiss );
ini.SetValue( "Options", "TugMeterPercentChangeHitMine", m_fTugMeterPercentChangeHitMine );
ini.SetValue( "Options", "TugMeterPercentChangeOK", m_fTugMeterPercentChangeOK );
ini.SetValue( "Options", "TugMeterPercentChangeNG", m_fTugMeterPercentChangeNG );
2003-10-13 00:06:49 +00:00
ini.SetValue( "Options", "RegenComboAfterFail", m_iRegenComboAfterFail );
ini.SetValue( "Options", "RegenComboAfterMiss", m_iRegenComboAfterMiss );
ini.SetValue( "Options", "MaxRegenComboAfterFail", m_iMaxRegenComboAfterFail );
ini.SetValue( "Options", "MaxRegenComboAfterMiss", m_iMaxRegenComboAfterMiss );
2003-10-13 03:20:05 +00:00
ini.SetValue( "Options", "TwoPlayerRecovery", m_bTwoPlayerRecovery );
2004-01-11 23:33:56 +00:00
ini.SetValue( "Options", "MercifulDrain", m_bMercifulDrain );
2004-06-26 17:28:02 +00:00
ini.SetValue( "Options", "Minimum1FullSongInCourses", m_bMinimum1FullSongInCourses );
2004-01-20 07:09:44 +00:00
ini.SetValue( "Options", "PercentScoreWeightMarvelous", m_iPercentScoreWeightMarvelous );
ini.SetValue( "Options", "PercentScoreWeightPerfect", m_iPercentScoreWeightPerfect );
ini.SetValue( "Options", "PercentScoreWeightGreat", m_iPercentScoreWeightGreat );
ini.SetValue( "Options", "PercentScoreWeightGood", m_iPercentScoreWeightGood );
ini.SetValue( "Options", "PercentScoreWeightBoo", m_iPercentScoreWeightBoo );
ini.SetValue( "Options", "PercentScoreWeightMiss", m_iPercentScoreWeightMiss );
ini.SetValue( "Options", "PercentScoreWeightOK", m_iPercentScoreWeightOK );
ini.SetValue( "Options", "PercentScoreWeightNG", m_iPercentScoreWeightNG );
ini.SetValue( "Options", "PercentScoreWeightHitMine", m_iPercentScoreWeightHitMine );
ini.SetValue( "Options", "GradeWeightMarvelous", m_iGradeWeightMarvelous );
ini.SetValue( "Options", "GradeWeightPerfect", m_iGradeWeightPerfect );
ini.SetValue( "Options", "GradeWeightGreat", m_iGradeWeightGreat );
ini.SetValue( "Options", "GradeWeightGood", m_iGradeWeightGood );
ini.SetValue( "Options", "GradeWeightBoo", m_iGradeWeightBoo );
ini.SetValue( "Options", "GradeWeightMiss", m_iGradeWeightMiss );
ini.SetValue( "Options", "GradeWeightHitMine", m_iGradeWeightHitMine );
ini.SetValue( "Options", "GradeWeightOK", m_iGradeWeightOK );
ini.SetValue( "Options", "GradeWeightNG", m_iGradeWeightNG );
ini.SetValue( "Options", "NumGradeTiersUsed", m_iNumGradeTiersUsed );
2004-01-20 03:32:48 +00:00
for( int g=0; g<NUM_GRADE_TIERS; g++ )
{
Grade grade = (Grade)g;
CString s = GradeToString( grade );
2004-03-13 18:35:25 +00:00
ini.SetValue( "Options", "GradePercentTier"+s, m_fGradePercent[g] );
2004-01-20 03:32:48 +00:00
}
2004-01-20 07:09:44 +00:00
ini.SetValue( "Options", "GradeTier02IsAllPerfects", m_bGradeTier02IsAllPerfects );
ini.SetValue( "Options", "SuperMeterPercentChangeMarvelous",m_fSuperMeterPercentChangeMarvelous );
ini.SetValue( "Options", "SuperMeterPercentChangePerfect", m_fSuperMeterPercentChangePerfect );
ini.SetValue( "Options", "SuperMeterPercentChangeGreat", m_fSuperMeterPercentChangeGreat );
ini.SetValue( "Options", "SuperMeterPercentChangeGood", m_fSuperMeterPercentChangeGood );
ini.SetValue( "Options", "SuperMeterPercentChangeBoo", m_fSuperMeterPercentChangeBoo );
ini.SetValue( "Options", "SuperMeterPercentChangeMiss", m_fSuperMeterPercentChangeMiss );
ini.SetValue( "Options", "SuperMeterPercentChangeHitMine", m_fSuperMeterPercentChangeHitMine );
ini.SetValue( "Options", "SuperMeterPercentChangeOK", m_fSuperMeterPercentChangeOK );
ini.SetValue( "Options", "SuperMeterPercentChangeNG", m_fSuperMeterPercentChangeNG );
2004-01-11 23:33:56 +00:00
ini.SetValue( "Options", "MercifulSuperMeter", m_bMercifulSuperMeter );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "DelayedEscape", m_bDelayedEscape );
ini.SetValue( "Options", "HiddenSongs", m_bHiddenSongs );
ini.SetValue( "Options", "Vsync", m_bVsync );
ini.SetValue( "Options", "Interlaced", m_bInterlaced );
ini.SetValue( "Options", "PAL", m_bPAL );
2004-05-23 23:24:44 +00:00
#ifdef _XBOX
2003-11-13 00:39:36 +00:00
ini.SetValue( "Options", "ScreenPosX", m_fScreenPosX );
ini.SetValue( "Options", "ScreenPosY", m_fScreenPosY );
ini.SetValue( "Options", "ScreenWidth", m_fScreenWidth );
ini.SetValue( "Options", "ScreenHeight", m_fScreenHeight );
#endif
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "HowToPlay", m_bInstructions );
ini.SetValue( "Options", "Caution", m_bShowDontDie );
ini.SetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup );
ini.SetValue( "Options", "ShowNative", m_bShowNative );
ini.SetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
ini.SetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.SetValue( "Options", "TexturePreload", m_bTexturePreload );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.SetValue( "Options", "DelayedModelDelete", m_bDelayedModelDelete );
2003-11-25 22:56:48 +00:00
ini.SetValue( "Options", "BannerCache", m_BannerCache );
2003-12-31 09:32:21 +00:00
ini.SetValue( "Options", "FastLoad", m_bFastLoad );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections );
ini.SetValue( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
ini.SetValue( "Options", "EasterEggs", m_bEasterEggs );
ini.SetValue( "Options", "MarvelousTiming", m_iMarvelousTiming );
ini.SetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
ini.SetValue( "Options", "CoinMode", m_iCoinMode );
ini.SetValue( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
2003-11-09 01:09:35 +00:00
ini.SetValue( "Options", "Premium", m_Premium );
2004-05-07 08:08:11 +00:00
ini.SetValue( "Options", "DelayedCreditsReconcile", m_bDelayedCreditsReconcile );
2003-10-02 02:11:47 +00:00
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 );
2004-05-20 19:05:37 +00:00
ini.SetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
ini.SetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
ini.SetValue( "Options", "ThreadedInput", m_bThreadedInput );
2004-04-02 23:14:29 +00:00
ini.SetValue( "Options", "ThreadedMovieDecode", m_bThreadedMovieDecode );
2003-12-18 21:16:43 +00:00
ini.SetValue( "Options", "ScreenTestMode", m_bScreenTestMode );
2004-02-16 05:35:06 +00:00
ini.SetValue( "Options", "MachineName", m_sMachineName );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows );
ini.SetValue( "Options", "SoloSingle", m_bSoloSingle );
ini.SetValue( "Options", "DancePointsForOni", m_bDancePointsForOni );
2003-10-05 05:18:48 +00:00
ini.SetValue( "Options", "PercentageScoring", m_bPercentageScoring );
ini.SetValue( "Options", "MinPercentageForMachineSongHighScore", m_fMinPercentageForMachineSongHighScore );
ini.SetValue( "Options", "MinPercentageForMachineCourseHighScore", m_fMinPercentageForMachineCourseHighScore );
2004-03-28 20:08:43 +00:00
ini.SetValue( "Options", "Disqualification", m_bDisqualification );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "ShowLyrics", m_bShowLyrics );
2004-02-10 21:10:23 +00:00
ini.SetValue( "Options", "AutogenSteps", m_bAutogenSteps );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
ini.SetValue( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
2004-01-21 01:33:29 +00:00
ini.SetValue( "Options", "LockCourseDifficulties", m_bLockCourseDifficulties );
2003-10-02 02:11:47 +00:00
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 );
#if defined(WIN32)
ini.SetValue( "Options", "LastSeenMemory", m_iLastSeenMemory );
#endif
ini.SetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
ini.SetValue( "Options", "GetRankingName", m_iGetRankingName);
2004-06-02 07:07:12 +00:00
ini.SetValue( "Options", "SmoothLines", m_bSmoothLines );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.SetValue( "Options", "CourseSortOrder", m_iCourseSortOrder );
ini.SetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd );
2004-06-02 07:07:12 +00:00
ini.SetValue( "Options", "SubSortByNumSteps", m_bSubSortByNumSteps );
2003-10-02 02:11:47 +00:00
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 );
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
ini.SetValue( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak );
ini.SetValue( "Options", "EndlessBreakLength", m_iEndlessBreakLength );
2004-02-17 07:16:58 +00:00
ini.SetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.SetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.SetValue( "Options", "ProductID", m_iProductID );
2004-06-06 01:50:21 +00:00
ini.SetValue( "Options", "MemoryCards", m_bMemoryCards );
FOREACH_PlayerNumber( p )
2003-11-01 22:04:43 +00:00
{
2003-12-07 08:19:10 +00:00
ini.SetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
ini.SetValue( "Options", ssprintf("MemoryCardOsMountPointP%d",p+1), m_sMemoryCardOsMountPoint[p] );
ini.SetValue( "Options", ssprintf("MemoryCardUsbBusP%d",p+1), m_iMemoryCardUsbBus[p] );
ini.SetValue( "Options", ssprintf("MemoryCardUsbPortP%d",p+1), m_iMemoryCardUsbPort[p] );
ini.SetValue( "Options", ssprintf("MemoryCardUsbLevelP%d",p+1), m_iMemoryCardUsbLevel[p] );
2003-11-01 22:04:43 +00:00
}
2003-10-11 07:47:34 +00:00
ini.SetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
ini.SetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY );
ini.SetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX );
ini.SetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
2003-12-28 19:46:50 +00:00
ini.SetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
2003-10-19 05:49:53 +00:00
ini.SetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
2004-03-01 02:45:29 +00:00
ini.SetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
ini.SetValue( "Options", "MaxHighScoresPerListForMachine", m_iMaxHighScoresPerListForMachine );
ini.SetValue( "Options", "MaxHighScoresPerListForPlayer", m_iMaxHighScoresPerListForPlayer );
ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
ini.SetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
2004-05-18 09:05:21 +00:00
ini.SetValue( "Options", "TrilinearFiltering", m_bTrilinearFiltering );
ini.SetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering );
2003-10-16 08:55:32 +00:00
ini.SetValue( "Options", "AutoRestart", g_bAutoRestart );
ini.SetValue( "Options", "SignProfileData", m_bSignProfileData );
2003-12-02 20:52:10 +00:00
ini.SetValue( "Options", "SoundWriteAhead", m_iSoundWriteAhead );
2004-07-17 21:22:36 +00:00
ini.SetValue( "Options", "SoundDevice", m_iSoundDevice );
2003-10-11 07:47:34 +00:00
ini.SetValue( "Editor", "ShowBGChangesPlay", m_bEditorShowBGChangesPlay );
/* 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_sSoundDrivers != DEFAULT_SOUND_DRIVER_LIST)
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
2003-01-11 04:03:21 +00:00
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
2003-10-02 02:11:47 +00:00
ini.SetValue( "Options", "SoundVolume", m_fSoundVolume );
2003-11-16 04:45:12 +00:00
if(m_sLightsDriver != DEFAULT_LIGHTS_DRIVER)
ini.SetValue( "Options", "LightsDriver", m_sLightsDriver );
2003-09-02 04:51:36 +00:00
if(m_sMovieDrivers != DEFAULT_MOVIE_DRIVER_LIST)
ini.SetValue ( "Options", "MovieDrivers", m_sMovieDrivers );
2002-02-28 19:40:40 +00:00
ini.SetValue( "Options", "AdditionalSongFolders", m_sAdditionalSongFolders);
ini.SetValue( "Options", "AdditionalFolders", m_sAdditionalFolders);
2002-06-27 17:49:10 +00:00
2004-02-27 00:56:51 +00:00
ini.SetValue( "Debug", "LogToDisk", m_bLogToDisk );
ini.SetValue( "Debug", "ForceLogFlush", m_bForceLogFlush );
ini.SetValue( "Debug", "ShowLogOutput", m_bShowLogOutput );
ini.SetValue( "Debug", "Timestamping", m_bTimestamping );
2004-01-17 23:22:08 +00:00
ini.SetValue( "Debug", "LogSkips", m_bLogSkips );
ini.SetValue( "Debug", "LogCheckpoints", m_bLogCheckpoints );
2004-02-15 22:56:51 +00:00
ini.SetValue( "Debug", "ShowLoadingWindow", m_bShowLoadingWindow );
2004-05-23 02:27:51 +00:00
ini.WriteFile( STEPMANIA_INI_PATH );
2002-02-28 19:40:40 +00:00
}
void PrefsManager::ResetToFactoryDefaults()
{
Init();
ReadStaticPrefsFromDisk();
SaveGlobalPrefsToDisk();
m_bFirstRun = false;
}
2004-06-08 01:24:17 +00:00
int PrefsManager::GetCoinMode()
{
if( m_bEventMode && m_iCoinMode == COIN_PAY )
return COIN_FREE;
else
return m_iCoinMode;
}
PrefsManager::Premium PrefsManager::GetPremium()
{
if(m_bEventMode)
return NO_PREMIUM;
else
return m_Premium;
}
2004-06-08 01:24:17 +00:00
/*
* (c) 2001-2004 Chris Danford, Chris Gomez
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/