2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-02-28 19:40:40 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: PrefsManager
|
|
|
|
|
|
|
|
|
|
Desc: See Header.
|
|
|
|
|
|
2003-02-01 05:39:48 +00:00
|
|
|
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
|
2002-02-28 19:40:40 +00:00
|
|
|
Chris Danford
|
2003-02-01 05:39:48 +00:00
|
|
|
Chris Gomez
|
2002-02-28 19:40:40 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "IniFile.h"
|
2003-02-06 07:32:57 +00:00
|
|
|
#include "NoteSkinManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-07-27 19:29:51 +00:00
|
|
|
#include "RageException.h"
|
2002-08-30 06:18:30 +00:00
|
|
|
#include "RageDisplay.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "RageUtil.h"
|
2003-02-06 07:32:57 +00:00
|
|
|
#include "GameDef.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "AnnouncerManager.h"
|
|
|
|
|
#include "ThemeManager.h"
|
2003-04-13 04:50:08 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-12-13 22:06:30 +00:00
|
|
|
#include "arch/arch.h" /* for default driver specs */
|
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-01-11 04:03:21 +00:00
|
|
|
const float DEFAULT_SOUND_VOLUME = 0.50;
|
2002-02-28 19:40:40 +00:00
|
|
|
|
|
|
|
|
PrefsManager::PrefsManager()
|
|
|
|
|
{
|
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
|
2002-11-11 04:53:31 +00:00
|
|
|
m_iDisplayWidth = 640;
|
|
|
|
|
m_iDisplayHeight = 480;
|
|
|
|
|
m_iDisplayColorDepth = 16;
|
2003-02-02 09:09:29 +00:00
|
|
|
m_iTextureColorDepth = 16; // default to 16 for better preformance on slower cards
|
2003-01-11 20:15:00 +00:00
|
|
|
m_iMaxTextureResolution = 2048;
|
2002-11-12 09:23:50 +00:00
|
|
|
m_iRefreshRate = REFRESH_DEFAULT;
|
2003-02-23 23:29:22 +00:00
|
|
|
m_bIgnoreJoyAxes = true; // ON by default because all USB convertors that are compatible with pads map to buttons
|
2002-07-31 19:40:40 +00:00
|
|
|
m_bOnlyDedicatedMenuButtons = false;
|
2003-02-15 05:15:24 +00:00
|
|
|
#ifdef DEBUG
|
2002-08-19 00:21:54 +00:00
|
|
|
m_bShowStats = true;
|
|
|
|
|
#else
|
2002-08-18 17:48:50 +00:00
|
|
|
m_bShowStats = false;
|
2002-08-19 00:21:54 +00:00
|
|
|
#endif
|
2002-07-11 19:02:26 +00:00
|
|
|
m_BackgroundMode = BGMODE_ANIMATIONS;
|
2003-05-28 04:33:55 +00:00
|
|
|
m_iNumBackgrounds = 8;
|
2002-08-18 16:19:26 +00:00
|
|
|
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;
|
2003-01-11 08:55:21 +00:00
|
|
|
m_fJudgeWindowScale = 1.0f;
|
2003-02-10 22:47:50 +00:00
|
|
|
m_fJudgeWindowMarvelousSeconds = 0.0225f;
|
|
|
|
|
m_fJudgeWindowPerfectSeconds = 0.045f;
|
|
|
|
|
m_fJudgeWindowGreatSeconds = 0.090f;
|
|
|
|
|
m_fJudgeWindowGoodSeconds = 0.135f;
|
|
|
|
|
m_fJudgeWindowBooSeconds = 0.180f;
|
2003-05-31 21:34:07 +00:00
|
|
|
m_fJudgeWindowOKSeconds = 0.250f; // allow enough time to take foot off and put back on
|
2002-07-31 19:40:40 +00:00
|
|
|
m_fLifeDifficultyScale = 1.0f;
|
2002-08-18 16:19:26 +00:00
|
|
|
m_iMovieDecodeMS = 2;
|
2002-08-22 03:35:33 +00:00
|
|
|
m_bDelayedEscape = true;
|
2003-01-11 08:55:21 +00:00
|
|
|
m_bInstructions = true;
|
2002-12-15 10:07:27 +00:00
|
|
|
m_bShowDontDie = true;
|
2002-12-15 10:25:20 +00:00
|
|
|
m_bShowSelectGroup = true;
|
2003-05-20 04:41:47 +00:00
|
|
|
m_bShowNative = true;
|
2002-09-10 09:10:36 +00:00
|
|
|
m_bArcadeOptionsNavigation = false;
|
2003-04-18 23:55:20 +00:00
|
|
|
m_bSoloSingle = false;
|
|
|
|
|
m_bDelayedTextureDelete = true;
|
2003-05-20 04:42:12 +00:00
|
|
|
m_bDelayedScreenLoad = false;
|
2003-06-12 01:35:09 +00:00
|
|
|
m_bBannerCache = true;
|
2003-02-04 03:03:43 +00:00
|
|
|
m_MusicWheelUsesSections = ALWAYS;
|
2003-01-21 06:51:35 +00:00
|
|
|
m_iMusicWheelSwitchSpeed = 10;
|
2003-01-11 08:55:21 +00:00
|
|
|
m_bEasterEggs = true;
|
|
|
|
|
m_bMarvelousTiming = true;
|
2003-04-13 04:50:08 +00:00
|
|
|
m_iCoinMode = COIN_HOME;
|
2003-01-19 04:44:22 +00:00
|
|
|
m_iCoinsPerCredit = 1;
|
|
|
|
|
m_bJointPremium = false;
|
2003-01-18 04:26:25 +00:00
|
|
|
m_iBoostAppPriority = -1;
|
2003-06-05 19:29:27 +00:00
|
|
|
m_bAntiAliasing = false;
|
2003-04-21 22:36:45 +00:00
|
|
|
m_ShowSongOptions = YES;
|
2003-04-11 01:49:57 +00:00
|
|
|
m_bDancePointsForOni = false;
|
2003-03-07 04:47:04 +00:00
|
|
|
m_bTimestamping = false;
|
2003-03-20 10:59:09 +00:00
|
|
|
m_bShowLyrics = true;
|
2003-03-27 01:56:21 +00:00
|
|
|
m_bAutogenMissingTypes = true;
|
|
|
|
|
m_bAutogenGroupCourses = true;
|
2003-04-11 01:49:57 +00:00
|
|
|
m_bBreakComboToGetItem = false;
|
2003-05-05 04:43:11 +00:00
|
|
|
m_bShowDancingCharacters = false;
|
2003-05-09 05:56:05 +00:00
|
|
|
m_fDancePointsAccumulated = 0;
|
|
|
|
|
m_bUseUnlockSystem = false;
|
2003-05-26 09:18:44 +00:00
|
|
|
m_bFirstRun = true;
|
2003-05-28 02:35:05 +00:00
|
|
|
m_bAutoMapJoysticks = true;
|
2003-04-20 00:53:15 +00:00
|
|
|
|
2003-02-22 03:27:54 +00:00
|
|
|
/* 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. */
|
2003-02-01 05:39:48 +00:00
|
|
|
m_bPickExtraStage = false;
|
|
|
|
|
|
2003-02-27 08:38:24 +00:00
|
|
|
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
|
|
|
|
|
m_fMarathonVerSongSeconds = 60*5.f;
|
2003-02-10 05:30:12 +00:00
|
|
|
|
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-06-11 00:10:51 +00:00
|
|
|
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
2003-05-27 01:03:21 +00:00
|
|
|
|
2003-06-10 23:50:31 +00:00
|
|
|
// StepMania.cpp sets these on first run:
|
|
|
|
|
m_sVideoRenderers = "";
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
|
m_iLastSeenMemory = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-01-11 04:03:21 +00:00
|
|
|
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
2003-03-31 21:21:23 +00:00
|
|
|
/* This is experimental: let's see if preloading helps people's skipping.
|
|
|
|
|
* If it doesn't do anything useful, it'll be removed. */
|
|
|
|
|
m_bSoundPreloadAll = false;
|
|
|
|
|
|
2003-05-27 01:03:21 +00:00
|
|
|
m_bAllowUnacceleratedRenderer = false;
|
2003-02-22 00:22:27 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
ReadGlobalPrefsFromDisk( true );
|
2002-02-28 19:40:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PrefsManager::~PrefsManager()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-19 21:51:46 +00:00
|
|
|
void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
|
2002-02-28 19:40:40 +00:00
|
|
|
{
|
|
|
|
|
IniFile ini;
|
2003-04-22 12:16:06 +00:00
|
|
|
ini.SetPath( "Data/StepMania.ini" );
|
2002-05-27 08:23:27 +00:00
|
|
|
if( !ini.ReadFile() )
|
2002-05-20 08:59:37 +00:00
|
|
|
return; // could not read config file, load nothing
|
2002-02-28 19:40:40 +00:00
|
|
|
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueB( "Options", "Windowed", m_bWindowed );
|
2002-11-11 04:53:31 +00:00
|
|
|
ini.GetValueI( "Options", "DisplayWidth", m_iDisplayWidth );
|
|
|
|
|
ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight );
|
|
|
|
|
ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
|
|
|
|
|
ini.GetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth );
|
2003-01-11 20:15:00 +00:00
|
|
|
ini.GetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
|
2002-11-12 09:23:50 +00:00
|
|
|
ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
|
|
|
|
|
ini.GetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
|
|
|
|
|
ini.GetValueB( "Options", "ShowStats", m_bShowStats );
|
|
|
|
|
ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode );
|
2003-05-28 04:33:55 +00:00
|
|
|
ini.GetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds);
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueB( "Options", "ShowDanger", m_bShowDanger );
|
|
|
|
|
ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness );
|
|
|
|
|
ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer );
|
|
|
|
|
ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
|
2003-04-19 19:05:25 +00:00
|
|
|
ini.GetValueB( "Options", "EventMode", m_bEventMode );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.GetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale );
|
2003-01-24 02:43:07 +00:00
|
|
|
ini.GetValueF( "Options", "JudgeWindowMarvelousSeconds",m_fJudgeWindowMarvelousSeconds );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.GetValueF( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds );
|
|
|
|
|
ini.GetValueF( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds );
|
|
|
|
|
ini.GetValueF( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds );
|
2003-01-24 02:43:07 +00:00
|
|
|
ini.GetValueF( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds );
|
2003-02-17 05:33:57 +00:00
|
|
|
ini.GetValueF( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
|
|
|
|
|
ini.GetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS );
|
|
|
|
|
ini.GetValueB( "Options", "DelayedEscape", m_bDelayedEscape );
|
|
|
|
|
ini.GetValueB( "Options", "HiddenSongs", m_bHiddenSongs );
|
|
|
|
|
ini.GetValueB( "Options", "Vsync", m_bVsync );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.GetValueB( "Options", "HowToPlay", m_bInstructions );
|
2002-12-15 10:07:27 +00:00
|
|
|
ini.GetValueB( "Options", "Caution", m_bShowDontDie );
|
2002-12-15 10:25:20 +00:00
|
|
|
ini.GetValueB( "Options", "SelectGroup", m_bShowSelectGroup );
|
2003-05-20 04:41:47 +00:00
|
|
|
ini.GetValueB( "Options", "ShowNative", m_bShowNative );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.GetValueB( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
|
|
|
|
|
ini.GetValue ( "Options", "DWIPath", m_DWIPath );
|
2003-04-18 23:55:20 +00:00
|
|
|
ini.GetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
|
2003-04-25 03:41:38 +00:00
|
|
|
ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
2003-06-11 02:58:13 +00:00
|
|
|
ini.GetValueB( "Options", "BannerCache", m_bBannerCache );
|
2003-02-04 03:03:43 +00:00
|
|
|
ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
|
2003-01-21 06:51:35 +00:00
|
|
|
ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
|
2003-01-19 21:51:46 +00:00
|
|
|
ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs );
|
|
|
|
|
ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
2003-01-11 04:03:21 +00:00
|
|
|
ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
2003-03-31 21:21:23 +00:00
|
|
|
ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll );
|
2003-04-13 04:50:08 +00:00
|
|
|
ini.GetValueI( "Options", "CoinMode", m_iCoinMode );
|
2003-01-19 04:44:22 +00:00
|
|
|
ini.GetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
|
|
|
|
|
ini.GetValueB( "Options", "JointPremium", m_bJointPremium );
|
2003-01-18 04:26:25 +00:00
|
|
|
ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority );
|
2003-02-01 05:39:48 +00:00
|
|
|
ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
|
2003-02-10 05:30:12 +00:00
|
|
|
ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
|
|
|
|
ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
2003-04-21 22:36:45 +00:00
|
|
|
ini.GetValueI( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
|
2003-05-27 01:03:21 +00:00
|
|
|
ini.GetValueB( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
2003-02-27 10:56:37 +00:00
|
|
|
ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle );
|
2003-02-25 11:20:45 +00:00
|
|
|
ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni );
|
2003-03-20 10:59:09 +00:00
|
|
|
ini.GetValueB( "Options", "ShowLyrics", m_bShowLyrics );
|
2003-03-27 01:56:21 +00:00
|
|
|
ini.GetValueB( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes );
|
|
|
|
|
ini.GetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
|
2003-04-01 19:31:27 +00:00
|
|
|
ini.GetValueB( "Options", "Timestamping", m_bTimestamping );
|
2003-04-11 01:49:57 +00:00
|
|
|
ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
|
2003-05-05 04:43:11 +00:00
|
|
|
ini.GetValueB( "Options", "ShowDancingCharacters", m_bShowDancingCharacters );
|
2003-05-17 20:23:12 +00:00
|
|
|
/* XXX: This belongs in the memcard code, not prefs. */
|
|
|
|
|
ini.GetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated );
|
|
|
|
|
ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
|
2003-05-26 09:18:44 +00:00
|
|
|
ini.GetValueB( "Options", "FirstRun", m_bFirstRun );
|
2003-05-28 02:35:05 +00:00
|
|
|
ini.GetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks );
|
2003-06-05 19:29:27 +00:00
|
|
|
ini.GetValue ( "Options", "VideoRenderers", m_sVideoRenderers );
|
2003-06-10 23:50:31 +00:00
|
|
|
ini.GetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
|
ini.GetValue ( "Options", "LastSeenMemory", m_iLastSeenMemory );
|
|
|
|
|
#endif
|
2003-06-05 19:29:27 +00:00
|
|
|
ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
|
2003-02-10 05:30:12 +00:00
|
|
|
|
2002-10-24 20:15:24 +00:00
|
|
|
m_asAdditionalSongFolders.clear();
|
2002-06-27 17:49:10 +00:00
|
|
|
CString sAdditionalSongFolders;
|
2002-08-18 16:19:26 +00:00
|
|
|
ini.GetValue( "Options", "AdditionalSongFolders", sAdditionalSongFolders );
|
|
|
|
|
split( sAdditionalSongFolders, ",", m_asAdditionalSongFolders, true );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
|
|
|
|
if( bSwitchToLastPlayedGame )
|
|
|
|
|
{
|
|
|
|
|
Game game;
|
|
|
|
|
if( ini.GetValueI("Options", "Game", (int&)game) )
|
2002-07-27 19:29:51 +00:00
|
|
|
GAMESTATE->m_CurGame = game;
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
2002-02-28 19:40:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
void PrefsManager::SaveGlobalPrefsToDisk()
|
2002-02-28 19:40:40 +00:00
|
|
|
{
|
|
|
|
|
IniFile ini;
|
2003-04-22 12:16:06 +00:00
|
|
|
ini.SetPath( "Data/StepMania.ini" );
|
2002-04-28 20:42:32 +00:00
|
|
|
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueB( "Options", "Windowed", m_bWindowed );
|
2002-11-11 04:53:31 +00:00
|
|
|
ini.SetValueI( "Options", "DisplayWidth", m_iDisplayWidth );
|
|
|
|
|
ini.SetValueI( "Options", "DisplayHeight", m_iDisplayHeight );
|
|
|
|
|
ini.SetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
|
|
|
|
|
ini.SetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth );
|
2003-01-11 20:15:00 +00:00
|
|
|
ini.SetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
|
2002-11-12 09:23:50 +00:00
|
|
|
ini.SetValueI( "Options", "RefreshRate", m_iRefreshRate );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
|
|
|
|
|
ini.SetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
|
|
|
|
|
ini.SetValueB( "Options", "ShowStats", m_bShowStats );
|
|
|
|
|
ini.SetValueI( "Options", "BackgroundMode", m_BackgroundMode);
|
2003-05-28 04:33:55 +00:00
|
|
|
ini.SetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds);
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueB( "Options", "ShowDanger", m_bShowDanger );
|
|
|
|
|
ini.SetValueF( "Options", "BGBrightness", m_fBGBrightness );
|
|
|
|
|
ini.SetValueB( "Options", "MenuTimer", m_bMenuTimer );
|
|
|
|
|
ini.SetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
|
2003-04-19 19:05:25 +00:00
|
|
|
ini.SetValueB( "Options", "EventMode", m_bEventMode );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueB( "Options", "AutoPlay", m_bAutoPlay );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.SetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale );
|
2003-01-24 02:43:07 +00:00
|
|
|
ini.SetValueF( "Options", "JudgeWindowMarvelousSeconds",m_fJudgeWindowMarvelousSeconds );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.SetValueF( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds );
|
|
|
|
|
ini.SetValueF( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds );
|
|
|
|
|
ini.SetValueF( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds );
|
2003-01-24 02:43:07 +00:00
|
|
|
ini.SetValueF( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds );
|
2003-02-17 05:33:57 +00:00
|
|
|
ini.SetValueF( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
|
|
|
|
|
ini.SetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS );
|
|
|
|
|
ini.SetValueB( "Options", "DelayedEscape", m_bDelayedEscape );
|
|
|
|
|
ini.SetValueB( "Options", "HiddenSongs", m_bHiddenSongs );
|
|
|
|
|
ini.SetValueB( "Options", "Vsync", m_bVsync );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.SetValueB( "Options", "HowToPlay", m_bInstructions );
|
2002-12-15 10:07:27 +00:00
|
|
|
ini.SetValueB( "Options", "Caution", m_bShowDontDie );
|
2002-12-15 10:25:20 +00:00
|
|
|
ini.SetValueB( "Options", "SelectGroup", m_bShowSelectGroup );
|
2003-05-20 04:41:47 +00:00
|
|
|
ini.SetValueB( "Options", "ShowNative", m_bShowNative );
|
2002-09-22 18:18:50 +00:00
|
|
|
ini.SetValueB( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
|
|
|
|
|
ini.SetValue ( "Options", "DWIPath", m_DWIPath );
|
2003-04-18 23:55:20 +00:00
|
|
|
ini.SetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
|
2003-04-25 03:41:38 +00:00
|
|
|
ini.SetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
2003-06-11 02:58:13 +00:00
|
|
|
ini.SetValueB( "Options", "BannerCache", m_bBannerCache );
|
2003-02-04 03:03:43 +00:00
|
|
|
ini.SetValueI( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections );
|
2003-01-21 06:51:35 +00:00
|
|
|
ini.SetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
|
2003-01-11 08:55:21 +00:00
|
|
|
ini.SetValueB( "Options", "EasterEggs", m_bEasterEggs );
|
|
|
|
|
ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
2003-03-31 21:21:23 +00:00
|
|
|
ini.SetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll );
|
2003-04-13 04:50:08 +00:00
|
|
|
ini.SetValueI( "Options", "CoinMode", m_iCoinMode );
|
2003-01-19 04:44:22 +00:00
|
|
|
ini.SetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
|
|
|
|
|
ini.SetValueB( "Options", "JointPremium", m_bJointPremium );
|
2003-01-18 04:26:25 +00:00
|
|
|
ini.SetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority );
|
2003-02-01 05:39:48 +00:00
|
|
|
ini.SetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
|
2003-02-10 05:30:12 +00:00
|
|
|
ini.SetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
|
|
|
|
ini.SetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
2003-04-21 22:36:45 +00:00
|
|
|
ini.SetValueI( "Options", "ShowSongOptions", m_ShowSongOptions );
|
2003-05-27 01:03:21 +00:00
|
|
|
ini.SetValueB( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
2003-02-27 10:56:37 +00:00
|
|
|
ini.SetValueB( "Options", "SoloSingle", m_bSoloSingle );
|
2003-02-25 11:20:45 +00:00
|
|
|
ini.SetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni );
|
2003-03-20 10:59:09 +00:00
|
|
|
ini.SetValueB( "Options", "ShowLyrics", m_bShowLyrics );
|
2003-03-27 01:56:21 +00:00
|
|
|
ini.SetValueB( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes );
|
|
|
|
|
ini.SetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses );
|
2003-03-07 04:47:04 +00:00
|
|
|
ini.SetValueB( "Options", "Timestamping", m_bTimestamping );
|
2003-04-11 01:49:57 +00:00
|
|
|
ini.SetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem );
|
2003-05-05 04:43:11 +00:00
|
|
|
ini.SetValueB( "Options", "ShowDancingCharacters", m_bShowDancingCharacters );
|
2003-05-17 20:23:12 +00:00
|
|
|
ini.SetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated );
|
|
|
|
|
ini.SetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
|
2003-05-26 09:18:44 +00:00
|
|
|
ini.SetValueB( "Options", "FirstRun", m_bFirstRun );
|
2003-05-28 02:35:05 +00:00
|
|
|
ini.SetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks );
|
2003-06-05 19:29:27 +00:00
|
|
|
ini.SetValue ( "Options", "VideoRenderers", m_sVideoRenderers );
|
|
|
|
|
ini.SetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
|
2003-06-10 23:50:31 +00:00
|
|
|
#if defined(WIN32)
|
|
|
|
|
ini.SetValue ( "Options", "LastSeenMemory", m_iLastSeenMemory );
|
|
|
|
|
#endif
|
2003-06-05 19:29:27 +00:00
|
|
|
ini.SetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
|
2003-02-22 00:22:27 +00:00
|
|
|
|
2003-01-18 03:54:41 +00:00
|
|
|
/* Only write these if they aren't the default. This ensures that we can change
|
2002-12-21 07:33:28 +00:00
|
|
|
* the default and have it take effect for everyone (except people who
|
|
|
|
|
* tweaked this value). */
|
2003-01-19 21:51:46 +00:00
|
|
|
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)
|
|
|
|
|
ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
|
|
|
|
|
2002-02-28 19:40:40 +00:00
|
|
|
|
2002-08-18 16:19:26 +00:00
|
|
|
ini.SetValue( "Options", "AdditionalSongFolders", join(",", m_asAdditionalSongFolders) );
|
2002-06-27 17:49:10 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
ini.SetValueI( "Options", "Game", GAMESTATE->m_CurGame );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-02-28 19:40:40 +00:00
|
|
|
ini.WriteFile();
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
void PrefsManager::ReadGamePrefsFromDisk()
|
2002-05-29 09:47:24 +00:00
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
if( !GAMESTATE )
|
|
|
|
|
return;
|
2002-05-29 09:47:24 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
IniFile ini;
|
2003-04-22 12:16:06 +00:00
|
|
|
ini.SetPath( "Data/GamePrefs.ini" );
|
2002-08-19 00:21:54 +00:00
|
|
|
ini.ReadFile(); // it's OK if this fails
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-02-22 00:12:45 +00:00
|
|
|
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-08-19 00:21:54 +00:00
|
|
|
// if these calls fail, the three strings will keep the initial values set above.
|
2003-01-18 03:54:41 +00:00
|
|
|
ini.GetValue( sGameName, "Announcer", sAnnouncer );
|
|
|
|
|
ini.GetValue( sGameName, "Theme", sTheme );
|
2003-06-25 05:02:42 +00:00
|
|
|
ini.GetValue( sGameName, "DefaultModifiers",m_sDefaultModifiers );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-08-19 00:21:54 +00:00
|
|
|
// it's OK to call these functions with names that don't exist.
|
2002-07-23 01:41:40 +00:00
|
|
|
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
|
|
|
|
|
THEME->SwitchTheme( sTheme );
|
2003-02-22 00:12:45 +00:00
|
|
|
|
2003-06-25 05:02:42 +00:00
|
|
|
// XXX: ?
|
|
|
|
|
// if(NOTESKIN->DoesNoteSkinExist(sNoteSkin))
|
|
|
|
|
// m_sDefaultNoteSkin = sNoteSkin;
|
|
|
|
|
// else
|
|
|
|
|
// m_sDefaultNoteSkin = "default";
|
2003-02-22 00:12:45 +00:00
|
|
|
|
2003-02-17 12:19:42 +00:00
|
|
|
// NOTESKIN->SwitchNoteSkin( sNoteSkin );
|
2002-05-19 01:59:48 +00:00
|
|
|
}
|
2002-02-28 19:40:40 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
void PrefsManager::SaveGamePrefsToDisk()
|
2002-03-31 07:55:25 +00:00
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
if( !GAMESTATE )
|
|
|
|
|
return;
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
IniFile ini;
|
2003-04-22 12:16:06 +00:00
|
|
|
ini.SetPath( "Data/GamePrefs.ini" );
|
2003-01-18 03:54:41 +00:00
|
|
|
ini.ReadFile(); // it's OK if this fails
|
2002-03-31 07:55:25 +00:00
|
|
|
|
2003-01-18 03:54:41 +00:00
|
|
|
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
|
|
|
|
|
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
|
2003-06-25 05:02:42 +00:00
|
|
|
ini.SetValue( sGameName, "DefaultModifiers",m_sDefaultModifiers );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
ini.WriteFile();
|
2002-03-31 07:55:25 +00:00
|
|
|
}
|
2002-07-27 19:29:51 +00:00
|
|
|
|