Use MAX() against the difficulty to prevent ratings of 0. Various other style tweaks. Jason: The functions (well, macros) you were looking for are MIN, MAX, and CLAMP.
This commit is contained in:
+10
-23
@@ -1015,18 +1015,16 @@ static bool EnabledIfSet2GlobalMovieSongGroupAndGenre() { return ScreenMiniMenu:
|
|||||||
|
|
||||||
static RString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true )
|
static RString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true )
|
||||||
{
|
{
|
||||||
vector<RString> vsPathsOut;
|
vector<RString> vsPaths;
|
||||||
vector<RString> vsNamesOut;
|
vector<RString> vsNames;
|
||||||
BackgroundUtil::GetGlobalRandomMovies(
|
BackgroundUtil::GetGlobalRandomMovies(
|
||||||
pSong,
|
pSong,
|
||||||
"",
|
"",
|
||||||
vsPathsOut,
|
vsPaths,
|
||||||
vsNamesOut,
|
vsNames,
|
||||||
bTryGenre );
|
bTryGenre );
|
||||||
if( !vsNamesOut.empty() )
|
|
||||||
return vsNamesOut[RandomInt(vsNamesOut.size())];
|
return vsNames.empty() ? RString() : vsNames[RandomInt(vsNames.size())];
|
||||||
else
|
|
||||||
return RString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MenuDef g_InsertTapAttack(
|
static MenuDef g_InsertTapAttack(
|
||||||
@@ -1081,11 +1079,6 @@ static void SetDefaultEditorNoteSkin( size_t num, RString &sNameOut, RString &de
|
|||||||
sNameOut = ssprintf( "EditorNoteSkinP%d", int(num + 1) );
|
sNameOut = ssprintf( "EditorNoteSkinP%d", int(num + 1) );
|
||||||
|
|
||||||
// XXX: We need more supported noteskins.
|
// XXX: We need more supported noteskins.
|
||||||
switch( num )
|
|
||||||
{
|
|
||||||
case 0: defaultValueOut = "default"; return;
|
|
||||||
case 1: defaultValueOut = "default"; return;
|
|
||||||
}
|
|
||||||
defaultValueOut = "default";
|
defaultValueOut = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1120,10 +1113,10 @@ void ScreenEdit::Init()
|
|||||||
CopyToLastSave();
|
CopyToLastSave();
|
||||||
|
|
||||||
m_CurrentAction = MAIN_MENU_CHOICE_INVALID;
|
m_CurrentAction = MAIN_MENU_CHOICE_INVALID;
|
||||||
|
m_InputPlayerNumber = PLAYER_INVALID;
|
||||||
|
|
||||||
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_TwoPlayersSharedSides )
|
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||||
m_InputPlayerNumber = PLAYER_1;
|
m_InputPlayerNumber = PLAYER_1;
|
||||||
else
|
|
||||||
m_InputPlayerNumber = PLAYER_INVALID;
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
GAMESTATE->m_bSideIsJoined[p] = false;
|
GAMESTATE->m_bSideIsJoined[p] = false;
|
||||||
@@ -1138,8 +1131,6 @@ void ScreenEdit::Init()
|
|||||||
if( m_pSong->IsStepsUsingDifferentTiming(m_pSteps) )
|
if( m_pSong->IsStepsUsingDifferentTiming(m_pSteps) )
|
||||||
GAMESTATE->m_bIsUsingStepTiming = true;
|
GAMESTATE->m_bIsUsingStepTiming = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_bReturnToRecordMenuAfterPlay = false;
|
m_bReturnToRecordMenuAfterPlay = false;
|
||||||
m_fBeatToReturnTo = 0;
|
m_fBeatToReturnTo = 0;
|
||||||
|
|
||||||
@@ -1471,6 +1462,7 @@ static int FindAttackAtTime( const AttackArray& attacks, float fStartTime )
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Fix this mess. -Colby
|
||||||
static LocalizedString CURRENT_BEAT("ScreenEdit", "Current beat");
|
static LocalizedString CURRENT_BEAT("ScreenEdit", "Current beat");
|
||||||
static LocalizedString CURRENT_SECOND("ScreenEdit", "Current second");
|
static LocalizedString CURRENT_SECOND("ScreenEdit", "Current second");
|
||||||
static LocalizedString SNAP_TO("ScreenEdit", "Snap to");
|
static LocalizedString SNAP_TO("ScreenEdit", "Snap to");
|
||||||
@@ -4065,12 +4057,7 @@ static void ChangeStepCredit( const RString &sNew )
|
|||||||
static void ChangeStepMeter( const RString &sNew )
|
static void ChangeStepMeter( const RString &sNew )
|
||||||
{
|
{
|
||||||
int diff = StringToInt(sNew);
|
int diff = StringToInt(sNew);
|
||||||
// TODO: What's the clamping function again, and what's our max level?
|
GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(MAX(diff, 1));
|
||||||
if (diff < 1)
|
|
||||||
{
|
|
||||||
diff = 1;
|
|
||||||
}
|
|
||||||
GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(diff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ChangeMainTitle( const RString &sNew )
|
static void ChangeMainTitle( const RString &sNew )
|
||||||
|
|||||||
Reference in New Issue
Block a user