real fix for options

This commit is contained in:
Glenn Maynard
2004-12-07 09:22:38 +00:00
parent f7bb6ef29e
commit dbb52c70d7
2 changed files with 52 additions and 47 deletions
+5
View File
@@ -63,6 +63,11 @@ public:
m_currentValue = m_defaultValue; m_currentValue = m_defaultValue;
} }
T &Value()
{
return m_currentValue;
}
operator const T () const operator const T () const
{ {
return m_currentValue; return m_currentValue;
+47 -47
View File
@@ -214,60 +214,60 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption
} }
/* Appearance options */ /* Appearance options */
MOVE( Instructions, (bool&)PREFSMAN->m_bShowInstructions ); MOVE( Instructions, PREFSMAN->m_bShowInstructions );
MOVE( Caution, (bool&)PREFSMAN->m_bShowCaution ); MOVE( Caution, PREFSMAN->m_bShowCaution );
MOVE( OniScoreDisplay, (bool&)PREFSMAN->m_bDancePointsForOni ); MOVE( OniScoreDisplay, PREFSMAN->m_bDancePointsForOni );
MOVE( SongGroup, (bool&)PREFSMAN->m_bShowSelectGroup ); MOVE( SongGroup, PREFSMAN->m_bShowSelectGroup );
MOVE( WheelSections, PREFSMAN->m_MusicWheelUsesSections ); MOVE( WheelSections, PREFSMAN->m_MusicWheelUsesSections );
MOVE( CourseSort, PREFSMAN->m_iCourseSortOrder ); MOVE( CourseSort, PREFSMAN->m_iCourseSortOrder );
MOVE( RandomAtEnd, (bool&)PREFSMAN->m_bMoveRandomToEnd ); MOVE( RandomAtEnd, PREFSMAN->m_bMoveRandomToEnd );
MOVE( Translations, (bool&)PREFSMAN->m_bShowNativeLanguage ); MOVE( Translations, PREFSMAN->m_bShowNativeLanguage );
MOVE( Lyrics, (bool&)PREFSMAN->m_bShowLyrics ); MOVE( Lyrics, PREFSMAN->m_bShowLyrics );
/* Misc. options */ /* Misc. options */
MOVE( AutogenSteps, (bool&)PREFSMAN->m_bAutogenSteps ); MOVE( AutogenSteps, PREFSMAN->m_bAutogenSteps );
MOVE( AutogenGroupCourses, (bool&)PREFSMAN->m_bAutogenGroupCourses ); MOVE( AutogenGroupCourses, PREFSMAN->m_bAutogenGroupCourses );
MOVE( FastLoad, (bool&)PREFSMAN->m_bFastLoad ); MOVE( FastLoad, PREFSMAN->m_bFastLoad.Value() );
/* Background options */ /* Background options */
MOVE( BackgroundMode, (int&)PREFSMAN->m_iBackgroundMode ); MOVE( BackgroundMode, PREFSMAN->m_iBackgroundMode.Value() );
MOVE( ShowDanger, (bool&)PREFSMAN->m_bShowDanger ); MOVE( ShowDanger, PREFSMAN->m_bShowDanger.Value() );
MOVE( DancingCharacters, PREFSMAN->m_ShowDancingCharacters ); MOVE( DancingCharacters, PREFSMAN->m_ShowDancingCharacters );
MOVE( BeginnerHelper, (bool&)PREFSMAN->m_bShowBeginnerHelper ); MOVE( BeginnerHelper, PREFSMAN->m_bShowBeginnerHelper );
static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption ) static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
MoveMap( sel, (float&)PREFSMAN->m_fBGBrightness, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fBGBrightness.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption ) static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 5,10,15,20 }; const int mapping[] = { 5,10,15,20 };
MoveMap( sel, (int&)PREFSMAN->m_iNumBackgrounds, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iNumBackgrounds.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Input options */ /* Input options */
MOVE( AutoMapOnJoyChange, (bool&)PREFSMAN->m_bAutoMapOnJoyChange ); MOVE( AutoMapOnJoyChange, PREFSMAN->m_bAutoMapOnJoyChange );
MOVE( MenuButtons, (bool&)PREFSMAN->m_bOnlyDedicatedMenuButtons ); MOVE( MenuButtons, PREFSMAN->m_bOnlyDedicatedMenuButtons.Value() );
MOVE( AutoPlay, (bool&)PREFSMAN->m_bAutoPlay ); MOVE( AutoPlay, PREFSMAN->m_bAutoPlay );
MOVE( BackDelayed, (bool&)PREFSMAN->m_bDelayedBack ); MOVE( BackDelayed, PREFSMAN->m_bDelayedBack );
MOVE( OptionsNavigation, (bool&)PREFSMAN->m_bArcadeOptionsNavigation ); MOVE( OptionsNavigation, PREFSMAN->m_bArcadeOptionsNavigation );
static void WheelSpeed( int &sel, bool ToSel, const ConfOption *pConfOption ) static void WheelSpeed( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 5, 10, 15, 25 }; const int mapping[] = { 5, 10, 15, 25 };
MoveMap( sel, (int&)PREFSMAN->m_iMusicWheelSwitchSpeed, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iMusicWheelSwitchSpeed, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Gameplay options */ /* Gameplay options */
MOVE( SoloSingles, (bool&)PREFSMAN->m_bSoloSingle ); MOVE( SoloSingles, PREFSMAN->m_bSoloSingle );
MOVE( HiddenSongs, (bool&)PREFSMAN->m_bHiddenSongs ); MOVE( HiddenSongs, PREFSMAN->m_bHiddenSongs.Value() );
MOVE( EasterEggs, (bool&)PREFSMAN->m_bEasterEggs ); MOVE( EasterEggs, PREFSMAN->m_bEasterEggs );
MOVE( MarvelousTiming, PREFSMAN->m_iMarvelousTiming ); MOVE( MarvelousTiming, PREFSMAN->m_iMarvelousTiming );
MOVE( AllowExtraStage, (bool&)PREFSMAN->m_bAllowExtraStage ); MOVE( AllowExtraStage, PREFSMAN->m_bAllowExtraStage );
MOVE( PickExtraStage, (bool&)PREFSMAN->m_bPickExtraStage ); MOVE( PickExtraStage, PREFSMAN->m_bPickExtraStage );
MOVE( UnlockSystem, (bool&)PREFSMAN->m_bUseUnlockSystem ); MOVE( UnlockSystem, PREFSMAN->m_bUseUnlockSystem );
/* Coin options */ /* Coin options */
MOVE( CoinMode, PREFSMAN->m_iCoinMode ); MOVE( CoinMode, PREFSMAN->m_iCoinMode );
@@ -275,13 +275,13 @@ MOVE( CoinMode, PREFSMAN->m_iCoinMode );
static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption ) static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2 }; const int mapping[] = { 1,2 };
MoveMap( sel, (int&)PREFSMAN->m_iCoinMode, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iCoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption ) static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2,3,4,5,6,7,8 }; const int mapping[] = { 1,2,3,4,5,6,7,8 };
MoveMap( sel, (int&)PREFSMAN->m_iCoinsPerCredit, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iCoinsPerCredit, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void Premium( int &sel, bool ToSel, const ConfOption *pConfOption ) static void Premium( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -293,24 +293,24 @@ static void Premium( int &sel, bool ToSel, const ConfOption *pConfOption )
static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption ) static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2,3,4,5,6,7 }; const int mapping[] = { 1,2,3,4,5,6,7 };
MoveMap( sel, (int&)PREFSMAN->m_iNumArcadeStages, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iNumArcadeStages, ToSel, mapping, ARRAYSIZE(mapping) );
} }
MOVE( EventMode, (bool&)PREFSMAN->m_bEventMode ); MOVE( EventMode, PREFSMAN->m_bEventMode );
/* Machine options */ /* Machine options */
MOVE( MenuTimer, (bool&)PREFSMAN->m_bMenuTimer ); MOVE( MenuTimer, PREFSMAN->m_bMenuTimer.Value() );
MOVE( ScoringType, PREFSMAN->m_iScoringType ); MOVE( ScoringType, PREFSMAN->m_iScoringType );
static void JudgeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) static void JudgeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f }; const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f };
MoveMap( sel, (float&)PREFSMAN->m_fJudgeWindowScale, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fJudgeWindowScale.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f }; const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f };
MoveMap( sel, (float&)PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption ) static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -356,13 +356,13 @@ MOVE( ProgressiveStageLifebar, PREFSMAN->m_iProgressiveStageLifebar );
MOVE( ProgressiveNonstopLifebar, PREFSMAN->m_iProgressiveNonstopLifebar ); MOVE( ProgressiveNonstopLifebar, PREFSMAN->m_iProgressiveNonstopLifebar );
/* Graphic options */ /* Graphic options */
MOVE( DisplayMode, (bool&)PREFSMAN->m_bWindowed ); MOVE( DisplayMode, PREFSMAN->m_bWindowed.Value() );
MOVE( WaitForVsync, (bool&)PREFSMAN->m_bVsync ); MOVE( WaitForVsync, PREFSMAN->m_bVsync.Value() );
MOVE( ShowStats, (bool&)PREFSMAN->m_bShowStats ); MOVE( ShowBanners, PREFSMAN->m_bShowBanners.Value() );
MOVE( ShowBanners, (bool&)PREFSMAN->m_bShowBanners ); MOVE( ShowStats, PREFSMAN->m_bShowStats.Value() );
MOVE( KeepTexturesInMemory, (bool&)PREFSMAN->m_bDelayedTextureDelete ); MOVE( KeepTexturesInMemory, PREFSMAN->m_bDelayedTextureDelete.Value() );
MOVE( CelShadeModels, (bool&)PREFSMAN->m_bCelShadeModels ); MOVE( CelShadeModels, PREFSMAN->m_bCelShadeModels );
MOVE( SmoothLines, (bool&)PREFSMAN->m_bSmoothLines ); MOVE( SmoothLines, PREFSMAN->m_bSmoothLines );
struct res_t struct res_t
{ {
@@ -407,31 +407,31 @@ static void DisplayResolution( int &sel, bool ToSel, const ConfOption *pConfOpti
static void DisplayColor( int &sel, bool ToSel, const ConfOption *pConfOption ) static void DisplayColor( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, (int&)PREFSMAN->m_iDisplayColorDepth, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iDisplayColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void TextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption ) static void TextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 256,512,1024,2048 }; const int mapping[] = { 256,512,1024,2048 };
MoveMap( sel, (int&)PREFSMAN->m_iMaxTextureResolution, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iMaxTextureResolution.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void TextureColor( int &sel, bool ToSel, const ConfOption *pConfOption ) static void TextureColor( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, (int&)PREFSMAN->m_iTextureColorDepth, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iTextureColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void MovieColor( int &sel, bool ToSel, const ConfOption *pConfOption ) static void MovieColor( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, (int&)PREFSMAN->m_iMovieColorDepth, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iMovieColorDepth.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption ) static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 }; const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 };
MoveMap( sel, (int&)PREFSMAN->m_iRefreshRate, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iRefreshRate.Value(), ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Sound options */ /* Sound options */
@@ -441,7 +441,7 @@ MOVE( AttractSoundFrequency,PREFSMAN->m_iAttractSoundFrequency );
static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption ) static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
MoveMap( sel, (float&)PREFSMAN->m_fSoundVolume, ToSel, mapping, ARRAYSIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fSoundVolume, ToSel, mapping, ARRAYSIZE(mapping) );
} }