...I went this far back by mistake?
This commit is contained in:
+14
-14
@@ -56,8 +56,8 @@ static ThemeMetric<float> DRUNK_OFFSET_FREQUENCY( "ArrowEffects", "DrunkOffsetFr
|
||||
static ThemeMetric<float> DRUNK_ARROW_MAGNITUDE( "ArrowEffects", "DrunkArrowMagnitude" );
|
||||
static ThemeMetric<float> BEAT_OFFSET_HEIGHT( "ArrowEffects", "BeatOffsetHeight" );
|
||||
static ThemeMetric<float> BEAT_PI_HEIGHT( "ArrowEffects", "BeatPIHeight" );
|
||||
static ThemeMetric<float> MINI_PERCENT_BASE( "ArrowEffects", "MiniPercentBase" );
|
||||
static ThemeMetric<float> MINI_PERCENT_GATE( "ArrowEffects", "MiniPercentGate" );
|
||||
static ThemeMetric<float> TINY_PERCENT_BASE( "ArrowEffects", "TinyPercentBase" );
|
||||
static ThemeMetric<float> TINY_PERCENT_GATE( "ArrowEffects", "TinyPercentGate" );
|
||||
static ThemeMetric<bool> DIZZY_HOLD_HEADS( "ArrowEffects", "DizzyHoldHeads" );
|
||||
|
||||
float ArrowGetPercentVisible( const PlayerState* pPlayerState, float fYPosWithoutReverse );
|
||||
@@ -345,8 +345,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
||||
static void ArrowGetReverseShiftAndScale( const PlayerState* pPlayerState, int iCol, float fYReverseOffsetPixels, float &fShiftOut, float &fScaleOut )
|
||||
{
|
||||
// XXX: Hack: we need to scale the reverse shift by the zoom.
|
||||
float fTinyPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY];
|
||||
float fZoom = 1 - fTinyPercent*0.5f;
|
||||
float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI];
|
||||
float fZoom = 1 - fMiniPercent*0.5f;
|
||||
|
||||
// don't divide by 0
|
||||
if( fabsf(fZoom) < 0.01 )
|
||||
@@ -489,12 +489,12 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
|
||||
fPixelOffsetFromCenter += pCols[iColNum].fXOffset;
|
||||
|
||||
if( fEffects[PlayerOptions::EFFECT_MINI] != 0 )
|
||||
if( fEffects[PlayerOptions::EFFECT_TINY] != 0 )
|
||||
{
|
||||
// Allow Mini to pull tracks together, but not to push them apart.
|
||||
float fMiniPercent = fEffects[PlayerOptions::EFFECT_MINI];
|
||||
fMiniPercent = min( powf(MINI_PERCENT_BASE, fMiniPercent), (float)MINI_PERCENT_GATE );
|
||||
fPixelOffsetFromCenter *= fMiniPercent;
|
||||
// Allow Tiny to pull tracks together, but not to push them apart.
|
||||
float fTinyPercent = fEffects[PlayerOptions::EFFECT_TINY];
|
||||
fTinyPercent = min( powf(TINY_PERCENT_BASE, fTinyPercent), (float)TINY_PERCENT_GATE );
|
||||
fPixelOffsetFromCenter *= fTinyPercent;
|
||||
}
|
||||
|
||||
return fPixelOffsetFromCenter;
|
||||
@@ -565,7 +565,7 @@ static float GetCenterLine( const PlayerState* pPlayerState )
|
||||
{
|
||||
/* Another mini hack: if EFFECT_MINI is on, then our center line is at
|
||||
* eg. 320, not 160. */
|
||||
const float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY];
|
||||
const float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI];
|
||||
const float fZoom = 1 - fMiniPercent*0.5f;
|
||||
return CENTER_LINE_Y / fZoom;
|
||||
}
|
||||
@@ -741,11 +741,11 @@ float ArrowEffects::GetZoom( const PlayerState* pPlayerState )
|
||||
(GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) )
|
||||
fZoom *= 0.6f;
|
||||
|
||||
float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI];
|
||||
if( fMiniPercent != 0 )
|
||||
float fTinyPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY];
|
||||
if( fTinyPercent != 0 )
|
||||
{
|
||||
fMiniPercent = powf( 0.5f, fMiniPercent );
|
||||
fZoom *= fMiniPercent;
|
||||
fTinyPercent = powf( 0.5f, fTinyPercent );
|
||||
fZoom *= fTinyPercent;
|
||||
}
|
||||
return fZoom;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ Character* CharacterManager::GetDefaultCharacter()
|
||||
}
|
||||
|
||||
/* We always have the default character. */
|
||||
ASSERT(0);
|
||||
FAIL_M("There must be a default character available!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -152,6 +152,13 @@ public:
|
||||
LuaHelpers::CreateTableFromArray(vChars, L);
|
||||
return 1;
|
||||
}
|
||||
static int GetCharacterCount(T* p, lua_State *L)
|
||||
{
|
||||
vector<Character*> chars;
|
||||
p->GetCharacters(chars);
|
||||
lua_pushnumber(L, chars.size());
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaCharacterManager()
|
||||
{
|
||||
@@ -159,6 +166,7 @@ public:
|
||||
// sm-ssc adds:
|
||||
ADD_METHOD( GetRandomCharacter );
|
||||
ADD_METHOD( GetAllCharacters );
|
||||
ADD_METHOD( GetCharacterCount );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,19 +1,24 @@
|
||||
/* CharacterManager - Manage characters. */
|
||||
|
||||
#ifndef CHARACTER_MANAGER_H
|
||||
#define CHARACTER_MANAGER_H
|
||||
|
||||
class Character;
|
||||
struct lua_State;
|
||||
|
||||
/** @brief Manage all of the Characters. */
|
||||
class CharacterManager
|
||||
{
|
||||
public:
|
||||
/** @brief Set up the character manager. */
|
||||
CharacterManager();
|
||||
/** @brief Destroy the character manager. */
|
||||
~CharacterManager();
|
||||
|
||||
void GetCharacters( vector<Character*> &vpCharactersOut );
|
||||
/** @brief Get one installed character at random.
|
||||
* @return The random character. */
|
||||
Character* GetRandomCharacter();
|
||||
/** @brief Get the character assigned as the default.
|
||||
* @return The default character. */
|
||||
Character* GetDefaultCharacter();
|
||||
Character* GetCharacterFromID( RString sCharacterID );
|
||||
|
||||
|
||||
+17
-12
@@ -332,7 +332,7 @@ static const Style g_Style_Dance_Couple_Edit =
|
||||
false, // m_bUsedForHowToPlay
|
||||
"couple-edit", // m_szName
|
||||
StepsType_dance_couple, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
StyleType_OnePlayerTwoSides, // m_StyleType
|
||||
8, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
@@ -357,8 +357,8 @@ static const Style g_Style_Dance_Couple_Edit =
|
||||
},
|
||||
},
|
||||
{ // m_iInputColumn[NUM_GameController][NUM_GameButton]
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, Style::END_MAPPING },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, Style::END_MAPPING },
|
||||
{ 0, 3, 2, 1, Style::END_MAPPING },
|
||||
{ 4, 7, 6, 5, Style::END_MAPPING },
|
||||
},
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
@@ -770,7 +770,7 @@ static const Style g_Style_Pump_Couple_Edit =
|
||||
false, // m_bUsedForHowToPlay
|
||||
"couple-edit", // m_szName
|
||||
StepsType_pump_couple, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
StyleType_OnePlayerTwoSides, // m_StyleType
|
||||
10, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
@@ -786,19 +786,24 @@ static const Style g_Style_Pump_Couple_Edit =
|
||||
{ TRACK_10, +PUMP_COL_SPACING*5.0f+4, NULL },
|
||||
},
|
||||
{ // PLAYER_2
|
||||
{ TRACK_1, -PUMP_COL_SPACING*2.0f, NULL },
|
||||
{ TRACK_2, -PUMP_COL_SPACING*1.0f, NULL },
|
||||
{ TRACK_3, +PUMP_COL_SPACING*0.0f, NULL },
|
||||
{ TRACK_4, +PUMP_COL_SPACING*1.0f, NULL },
|
||||
{ TRACK_5, +PUMP_COL_SPACING*2.0f, NULL },
|
||||
{ TRACK_1, -PUMP_COL_SPACING*5.0f-4, NULL },
|
||||
{ TRACK_2, -PUMP_COL_SPACING*4.0f-4, NULL },
|
||||
{ TRACK_3, -PUMP_COL_SPACING*3.0f-4, NULL },
|
||||
{ TRACK_4, -PUMP_COL_SPACING*2.0f-4, NULL },
|
||||
{ TRACK_5, -PUMP_COL_SPACING*1.0f-4, NULL },
|
||||
{ TRACK_6, +PUMP_COL_SPACING*1.0f+4, NULL },
|
||||
{ TRACK_7, +PUMP_COL_SPACING*2.0f+4, NULL },
|
||||
{ TRACK_8, +PUMP_COL_SPACING*3.0f+4, NULL },
|
||||
{ TRACK_9, +PUMP_COL_SPACING*4.0f+4, NULL },
|
||||
{ TRACK_10, +PUMP_COL_SPACING*5.0f+4, NULL },
|
||||
},
|
||||
},
|
||||
{ // m_iInputColumn[NUM_GameController][NUM_GameButton]
|
||||
{ 1, 3, 2, 0, 4, 6, 8, 7, 5, 9, Style::END_MAPPING },
|
||||
{ 1, 3, 2, 0, 4, 6, 8, 7, 5, 9, Style::END_MAPPING },
|
||||
{ 1, 3, 2, 0, 4, Style::END_MAPPING },
|
||||
{ 6, 8, 7, 5, 9, Style::END_MAPPING },
|
||||
},
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4
|
||||
2,1,3,0,4, 2+5,1+5,3+5,0+5,4+5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
|
||||
+1
-1
@@ -817,7 +817,7 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
float fDrawScale = 1;
|
||||
fDrawScale *= 1 + 0.5f * fabsf( current_po.m_fPerspectiveTilt );
|
||||
fDrawScale *= 1 + fabsf( current_po.m_fEffects[PlayerOptions::EFFECT_TINY] );
|
||||
fDrawScale *= 1 + fabsf( current_po.m_fEffects[PlayerOptions::EFFECT_MINI] );
|
||||
|
||||
iDrawDistanceAfterTargetsPixels = (int)(iDrawDistanceAfterTargetsPixels * fDrawScale);
|
||||
iDrawDistanceBeforeTargetsPixels = (int)(iDrawDistanceBeforeTargetsPixels * fDrawScale);
|
||||
|
||||
+2
-2
@@ -867,7 +867,7 @@ void Player::Update( float fDeltaTime )
|
||||
Actor::TweenState::MakeWeightedAverage( m_pActorWithComboPosition->DestTweenState(), ts1, ts2, fPercentCentered );
|
||||
}
|
||||
|
||||
float fNoteFieldZoom = 1 - fTinyPercent*0.5f;
|
||||
float fNoteFieldZoom = 1 - fMiniPercent*0.5f;
|
||||
if( m_pNoteField )
|
||||
m_pNoteField->SetZoom( fNoteFieldZoom );
|
||||
if( m_pActorWithJudgmentPosition != NULL )
|
||||
@@ -1488,7 +1488,7 @@ void Player::DrawPrimitives()
|
||||
|
||||
float fTiltDegrees = SCALE(fTilt,-1.f,+1.f,+30,-30) * (bReverse?-1:1);
|
||||
|
||||
float fZoom = SCALE( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY], 0.f, 1.f, 1.f, 0.5f );
|
||||
float fZoom = SCALE( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI], 0.f, 1.f, 1.f, 0.5f );
|
||||
if( fTilt > 0 )
|
||||
fZoom *= SCALE( fTilt, 0.f, 1.f, 1.f, 0.9f );
|
||||
else
|
||||
|
||||
@@ -61,7 +61,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
|
||||
|
||||
APPROACH( fTimeSpacing );
|
||||
APPROACH( fScrollSpeed );
|
||||
APPROACH( fMaxScrollBPM );
|
||||
//APPROACH( fMaxScrollBPM );
|
||||
fapproach( m_fScrollBPM, other.m_fScrollBPM, fDeltaSeconds * other.m_SpeedfScrollBPM*150 );
|
||||
for( int i=0; i<NUM_ACCELS; i++ )
|
||||
APPROACH( fAccels[i] );
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@
|
||||
!define PRODUCT_ID "StepMania"
|
||||
!define PRODUCT_VER "v5.0 Preview 2"
|
||||
!define PRODUCT_DISPLAY "${PRODUCT_ID} ${PRODUCT_VER}"
|
||||
!define PRODUCT_BITMAP "ssc"
|
||||
!define PRODUCT_BITMAP "sm5"
|
||||
|
||||
!define PRODUCT_URL "http://www.stepmania.com/"
|
||||
!define UPDATES_URL "http://www.stepmania.com/"
|
||||
!define UPDATES_URL "http://code.google.com/p/sm-ssc/downloads/list"
|
||||
|
||||
;!define INSTALL_EXTERNAL_PCKS
|
||||
;!define INSTALL_INTERNAL_PCKS
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ int MersenneTwister::operator()()
|
||||
|
||||
void fapproach( float& val, float other_val, float to_move )
|
||||
{
|
||||
ASSERT_M( to_move >= 0, ssprintf("to_move: %f", to_move) );
|
||||
ASSERT_M( to_move >= 0, ssprintf("to_move: %f < 0", to_move) );
|
||||
if( val == other_val )
|
||||
return;
|
||||
float fDelta = other_val - val;
|
||||
|
||||
+85
-4
@@ -568,6 +568,12 @@ static MenuDef g_AlterMenu(
|
||||
MenuRowDef(ScreenEdit::convert_to_warp, "Convert selection to warp", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::convert_to_fake, "Convert selection to fake", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::routine_invert_notes, "Invert notes' player", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::routine_mirror_1_to_2, "Mirror Player 1 to 2", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::routine_mirror_2_to_1, "Mirror Player 2 to 1", true,
|
||||
EditMode_Full, true, true, 0, NULL )
|
||||
);
|
||||
|
||||
@@ -1759,6 +1765,10 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isRoutine = (m_InputPlayerNumber != PLAYER_INVALID);
|
||||
g_AlterMenu.rows[routine_invert_notes].bEnabled = isRoutine;
|
||||
g_AlterMenu.rows[routine_mirror_1_to_2].bEnabled = isRoutine;
|
||||
g_AlterMenu.rows[routine_mirror_2_to_1].bEnabled = isRoutine;
|
||||
EditMiniMenu(&g_AlterMenu, SM_BackFromAlterMenu);
|
||||
}
|
||||
break;
|
||||
@@ -2723,7 +2733,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
ASSERT( pSteps );
|
||||
pSteps->SetNoteData( m_NoteDataEdit );
|
||||
m_pSong->ReCalculateRadarValuesAndLastBeat();
|
||||
m_pSong->ReCalculateRadarValuesAndLastSecond();
|
||||
|
||||
m_Background.Unload();
|
||||
m_Background.LoadFromSong( m_pSong );
|
||||
@@ -3128,8 +3138,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
if (ScreenMiniMenu::s_iLastRowCode == ScreenEdit::remove )
|
||||
{
|
||||
ASSERT(iAttack >= 0);
|
||||
attacks.erase(attacks.begin() + iAttack);
|
||||
if (iAttack > 0)
|
||||
attacks.erase(attacks.begin() + iAttack);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4059,7 +4069,78 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
|
||||
SetDirty(true);
|
||||
break;
|
||||
}
|
||||
|
||||
case routine_invert_notes:
|
||||
{
|
||||
NoteData &nd = this->m_NoteDataEdit;
|
||||
NoteField &nf = this->m_NoteFieldEdit;
|
||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(nd, r,
|
||||
nf.m_iBeginMarker,
|
||||
nf.m_iEndMarker)
|
||||
{
|
||||
for (int t = 0; t < nd.GetNumTracks(); t++)
|
||||
{
|
||||
const TapNote &tn = nd.GetTapNote(t, r);
|
||||
if (tn.type != TapNote::empty)
|
||||
{
|
||||
TapNote nTap = tn;
|
||||
nTap.pn = (tn.pn == PLAYER_1 ?
|
||||
PLAYER_2 : PLAYER_1);
|
||||
m_NoteDataEdit.SetTapNote(t, r, nTap);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case routine_mirror_1_to_2:
|
||||
case routine_mirror_2_to_1:
|
||||
{
|
||||
PlayerNumber oPN = (c == routine_mirror_1_to_2 ?
|
||||
PLAYER_1 : PLAYER_2);
|
||||
PlayerNumber nPN = (c == routine_mirror_1_to_2 ?
|
||||
PLAYER_2 : PLAYER_1);
|
||||
int nTrack = -1;
|
||||
NoteData &nd = this->m_NoteDataEdit;
|
||||
NoteField &nf = this->m_NoteFieldEdit;
|
||||
int tracks = nd.GetNumTracks();
|
||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(nd, r,
|
||||
nf.m_iBeginMarker,
|
||||
nf.m_iEndMarker)
|
||||
{
|
||||
for (int t = 0; t < tracks; t++)
|
||||
{
|
||||
const TapNote &tn = nd.GetTapNote(t, r);
|
||||
if (tn.type != TapNote::empty && tn.pn == oPN)
|
||||
{
|
||||
TapNote nTap = tn;
|
||||
nTap.pn = nPN;
|
||||
StepsType curType = GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType;
|
||||
if (curType == StepsType_dance_routine)
|
||||
{
|
||||
nTrack = tracks - t - 1;
|
||||
}
|
||||
else if (curType == StepsType_pump_routine)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case 0: nTrack = 8; break;
|
||||
case 1: nTrack = 9; break;
|
||||
case 2: nTrack = 7; break;
|
||||
case 3: nTrack = 5; break;
|
||||
case 4: nTrack = 6; break;
|
||||
case 5: nTrack = 3; break;
|
||||
case 6: nTrack = 4; break;
|
||||
case 7: nTrack = 2; break;
|
||||
case 8: nTrack = 0; break;
|
||||
case 9: nTrack = 1; break;
|
||||
default: FAIL_M(ssprintf("Invalid column %d for pump-routine", t)); break;
|
||||
}
|
||||
}
|
||||
m_NoteDataEdit.SetTapNote(nTrack, r, nTap);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-15
@@ -390,23 +390,27 @@ public:
|
||||
void HandleMainMenuChoice( MainMenuChoice c ) { const vector<int> v; HandleMainMenuChoice( c, v ); }
|
||||
MainMenuChoice m_CurrentAction;
|
||||
|
||||
/** @brief How does one alter a selection of NoteData? */
|
||||
enum AlterMenuChoice
|
||||
{
|
||||
cut,
|
||||
copy,
|
||||
clear,
|
||||
quantize,
|
||||
turn,
|
||||
transform,
|
||||
alter,
|
||||
tempo,
|
||||
play,
|
||||
record,
|
||||
preview_designation,
|
||||
convert_to_pause,
|
||||
convert_to_delay,
|
||||
convert_to_warp,
|
||||
convert_to_fake,
|
||||
cut, /**< Cut the notes. */
|
||||
copy, /**< Copy the notes. */
|
||||
clear, /**< Erase the notes, without putting them in the clipboard. */
|
||||
quantize, /**< Sync the notes to an exact level. */
|
||||
turn, /**< Rotate the notes. */
|
||||
transform, /**< Activate a specific mod. */
|
||||
alter, /**< Perform other transformations. */
|
||||
tempo, /**< Modify the tempo of the notes. */
|
||||
play, /**< Play the notes in the range. */
|
||||
record, /**< Record new notes in the range. */
|
||||
preview_designation, /**< Set the area as the music preview. */
|
||||
convert_to_pause, /**< Convert the range into a StopSegment. */
|
||||
convert_to_delay, /**< Convert the range into a DelaySegment. */
|
||||
convert_to_warp, /**< Convert the range into a WarpSegment. */
|
||||
convert_to_fake, /**< Convert the range into a FakeSegment. */
|
||||
routine_invert_notes, /**< Switch which player hits the note. */
|
||||
routine_mirror_1_to_2, /**< Mirror Player 1's notes for Player 2. */
|
||||
routine_mirror_2_to_1, /**< Mirror Player 2's notes for Player 1. */
|
||||
NUM_ALTER_MENU_CHOICES
|
||||
|
||||
};
|
||||
|
||||
@@ -194,7 +194,7 @@ void ScreenJukebox::Init()
|
||||
PO_GROUP_CALL( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, Init );
|
||||
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fScrollSpeed, .25f );
|
||||
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fPerspectiveTilt, -1.0f );
|
||||
PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fEffects, PlayerOptions::EFFECT_MINI, 1.0f );
|
||||
PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fEffects, PlayerOptions::EFFECT_TINY, 1.0f );
|
||||
}
|
||||
SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, SongOptions::LIFE_BATTERY );
|
||||
}
|
||||
|
||||
+224
-57
@@ -283,7 +283,11 @@ bool Song::LoadFromSongDir( RString sDir )
|
||||
|
||||
if( bUseCache )
|
||||
{
|
||||
// LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() );
|
||||
/*
|
||||
LOG->Trace("Loading '%s' from cache file '%s'.",
|
||||
m_sSongDir.c_str(),
|
||||
GetCacheFilePath().c_str());
|
||||
*/
|
||||
SSCLoader loaderSSC;
|
||||
bool bLoadedFromSSC = loaderSSC.LoadFromSimfile( sCacheFilePath, *this, true );
|
||||
if( !bLoadedFromSSC )
|
||||
@@ -379,13 +383,13 @@ bool Song::ReloadFromSongDir( RString sDir )
|
||||
FOREACH_ENUM( StepsType, i )
|
||||
m_vpStepsByType[i].clear();
|
||||
|
||||
// Then we copy as many Steps as possible on top of the old pointers.
|
||||
// The only pointers that change are pointers to Steps that are not in the
|
||||
// reverted file, which we delete, and pointers to Steps that are in the
|
||||
// reverted file but not the original *this, which we create new copies of.
|
||||
// We have to go through these hoops because many places assume the Steps
|
||||
// pointers don't change - even though there are other ways they can change,
|
||||
// such as deleting a Steps via the editor.
|
||||
/* Then we copy as many Steps as possible on top of the old pointers.
|
||||
* The only pointers that change are pointers to Steps that are not in the
|
||||
* reverted file, which we delete, and pointers to Steps that are in the
|
||||
* reverted file but not the original *this, which we create new copies of.
|
||||
* We have to go through these hoops because many places assume the Steps
|
||||
* pointers don't change - even though there are other ways they can change,
|
||||
* such as deleting a Steps via the editor. */
|
||||
for( vector<Steps*>::const_iterator itOld = vOldSteps.begin(); itOld != vOldSteps.end(); ++itOld )
|
||||
{
|
||||
StepsID id;
|
||||
@@ -512,12 +516,18 @@ void Song::TidyUpData( bool bFromCache )
|
||||
else // ! HasMusic()
|
||||
{
|
||||
m_fMusicLengthSeconds = 100; // guess
|
||||
LOG->UserLog( "Song", GetSongDir(), "has no music file; guessing at %f seconds", m_fMusicLengthSeconds );
|
||||
LOG->UserLog("Song",
|
||||
GetSongDir(),
|
||||
"has no music file; guessing at %f seconds",
|
||||
m_fMusicLengthSeconds);
|
||||
}
|
||||
|
||||
if( m_fMusicLengthSeconds < 0 )
|
||||
{
|
||||
LOG->UserLog( "Sound file", GetMusicPath(), "has a negative length %f.", m_fMusicLengthSeconds );
|
||||
LOG->UserLog("Sound file",
|
||||
GetMusicPath(),
|
||||
"has a negative length %f.",
|
||||
m_fMusicLengthSeconds);
|
||||
m_fMusicLengthSeconds = 0;
|
||||
}
|
||||
|
||||
@@ -530,7 +540,7 @@ void Song::TidyUpData( bool bFromCache )
|
||||
|
||||
/* Generate these before we autogen notes, so the new notes can inherit
|
||||
* their source's values. */
|
||||
ReCalculateRadarValuesAndLastBeat( bFromCache );
|
||||
ReCalculateRadarValuesAndLastSecond( bFromCache );
|
||||
|
||||
Trim( m_sMainTitle );
|
||||
Trim( m_sSubTitle );
|
||||
@@ -538,7 +548,8 @@ void Song::TidyUpData( bool bFromCache )
|
||||
|
||||
// Fall back on the song directory name.
|
||||
if( m_sMainTitle == "" )
|
||||
NotesLoader::GetMainAndSubTitlesFromFullTitle( Basename(this->GetSongDir()), m_sMainTitle, m_sSubTitle );
|
||||
NotesLoader::GetMainAndSubTitlesFromFullTitle(Basename(this->GetSongDir()),
|
||||
m_sMainTitle, m_sSubTitle );
|
||||
|
||||
if( m_sArtist == "" )
|
||||
m_sArtist = "Unknown artist";
|
||||
@@ -652,7 +663,8 @@ void Song::TidyUpData( bool bFromCache )
|
||||
m_sLyricsFile = arrayLyricFiles[0];
|
||||
}
|
||||
|
||||
// Now, For the images we still haven't found, look at the image dimensions of the remaining unclassified images.
|
||||
/* Now, For the images we still haven't found,
|
||||
* look at the image dimensions of the remaining unclassified images. */
|
||||
vector<RString> arrayImages;
|
||||
GetImageDirListing( m_sSongDir + "*", arrayImages );
|
||||
|
||||
@@ -763,7 +775,12 @@ void Song::TidyUpData( bool bFromCache )
|
||||
/* Use this->GetBeatFromElapsedTime(0) instead of 0 to start when the
|
||||
* music starts. */
|
||||
if( arrayPossibleMovies.size() == 1 )
|
||||
this->AddBackgroundChange( BACKGROUND_LAYER_1, BackgroundChange(0,arrayPossibleMovies[0],"",1.f,SBE_StretchNoLoop) );
|
||||
this->AddBackgroundChange(BACKGROUND_LAYER_1,
|
||||
BackgroundChange(0,
|
||||
arrayPossibleMovies[0],
|
||||
"",
|
||||
1.f,
|
||||
SBE_StretchNoLoop));
|
||||
}
|
||||
|
||||
|
||||
@@ -836,12 +853,14 @@ void Song::TranslateTitles()
|
||||
static TitleSubst tsub("Songs");
|
||||
|
||||
TitleFields title;
|
||||
title.LoadFromStrings( m_sMainTitle, m_sSubTitle, m_sArtist, m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit );
|
||||
title.LoadFromStrings(m_sMainTitle, m_sSubTitle, m_sArtist,
|
||||
m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit );
|
||||
tsub.Subst( title );
|
||||
title.SaveToStrings( m_sMainTitle, m_sSubTitle, m_sArtist, m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit );
|
||||
title.SaveToStrings(m_sMainTitle, m_sSubTitle, m_sArtist,
|
||||
m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit );
|
||||
}
|
||||
|
||||
void Song::ReCalculateRadarValuesAndLastBeat( bool bFromCache )
|
||||
void Song::ReCalculateRadarValuesAndLastSecond( bool bFromCache )
|
||||
{
|
||||
if( bFromCache && this->GetFirstSecond() >= 0 && this->GetLastSecond() > 0 )
|
||||
{
|
||||
@@ -852,7 +871,8 @@ void Song::ReCalculateRadarValuesAndLastBeat( bool bFromCache )
|
||||
}
|
||||
|
||||
float localFirst = FLT_MAX; // inf
|
||||
float localLast = this->specifiedLastSecond; // Make sure we're at least as long as the specified amount.
|
||||
// Make sure we're at least as long as the specified amount below.
|
||||
float localLast = this->specifiedLastSecond;
|
||||
|
||||
for( unsigned i=0; i<m_vpSteps.size(); i++ )
|
||||
{
|
||||
@@ -915,7 +935,7 @@ void Song::Save()
|
||||
{
|
||||
LOG->Trace( "Song::SaveToSongFile()" );
|
||||
|
||||
ReCalculateRadarValuesAndLastBeat();
|
||||
ReCalculateRadarValuesAndLastSecond();
|
||||
TranslateTitles();
|
||||
|
||||
// TODO: Figure out a better way to save to Song's timing data.
|
||||
@@ -1222,14 +1242,26 @@ bool Song::HasMusic() const
|
||||
|
||||
return m_sMusicFile != "" && IsAFile(GetMusicPath());
|
||||
}
|
||||
bool Song::HasBanner() const {return m_sBannerFile != "" && IsAFile(GetBannerPath()); }
|
||||
bool Song::HasBanner() const
|
||||
{
|
||||
return m_sBannerFile != "" && IsAFile(GetBannerPath());
|
||||
}
|
||||
bool Song::HasInstrumentTrack( InstrumentTrack it ) const
|
||||
{
|
||||
return m_sInstrumentTrackFile[it] != "" && IsAFile(GetInstrumentTrackPath(it));
|
||||
return m_sInstrumentTrackFile[it] != "" && IsAFile(GetInstrumentTrackPath(it));
|
||||
}
|
||||
bool Song::HasLyrics() const
|
||||
{
|
||||
return m_sLyricsFile != "" && IsAFile(GetLyricsPath());
|
||||
}
|
||||
bool Song::HasBackground() const
|
||||
{
|
||||
return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath());
|
||||
}
|
||||
bool Song::HasCDTitle() const
|
||||
{
|
||||
return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath());
|
||||
}
|
||||
bool Song::HasLyrics() const {return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); }
|
||||
bool Song::HasBackground() const {return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); }
|
||||
bool Song::HasCDTitle() const {return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); }
|
||||
bool Song::HasBGChanges() const
|
||||
{
|
||||
FOREACH_BackgroundLayer( i )
|
||||
@@ -1526,16 +1558,46 @@ bool Song::IsMarathon() const
|
||||
class LunaSong: public Luna<Song>
|
||||
{
|
||||
public:
|
||||
static int GetDisplayFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayFullTitle() ); return 1; }
|
||||
static int GetTranslitFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitFullTitle() ); return 1; }
|
||||
static int GetDisplayMainTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayMainTitle() ); return 1; }
|
||||
static int GetTranslitMainTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitMainTitle() ); return 1; }
|
||||
static int GetDisplaySubTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplaySubTitle() ); return 1; }
|
||||
static int GetTranslitSubTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitSubTitle() ); return 1; }
|
||||
static int GetDisplayArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayArtist() ); return 1; }
|
||||
static int GetTranslitArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitArtist() ); return 1; }
|
||||
static int GetGenre( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGenre ); return 1; }
|
||||
static int GetOrigin( T* p, lua_State *L ) { lua_pushstring(L, p->m_sOrigin ); return 1; }
|
||||
static int GetDisplayFullTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetDisplayFullTitle() ); return 1;
|
||||
}
|
||||
static int GetTranslitFullTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetTranslitFullTitle() ); return 1;
|
||||
}
|
||||
static int GetDisplayMainTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetDisplayMainTitle() ); return 1;
|
||||
}
|
||||
static int GetTranslitMainTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetTranslitMainTitle() ); return 1;
|
||||
}
|
||||
static int GetDisplaySubTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetDisplaySubTitle() ); return 1;
|
||||
}
|
||||
static int GetTranslitSubTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetTranslitSubTitle() ); return 1;
|
||||
}
|
||||
static int GetDisplayArtist( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetDisplayArtist() ); return 1;
|
||||
}
|
||||
static int GetTranslitArtist( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetTranslitArtist() ); return 1;
|
||||
}
|
||||
static int GetGenre( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->m_sGenre ); return 1;
|
||||
}
|
||||
static int GetOrigin( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->m_sOrigin ); return 1;
|
||||
}
|
||||
static int GetAllSteps( T* p, lua_State *L )
|
||||
{
|
||||
const vector<Steps*> &v = p->GetAllSteps();
|
||||
@@ -1549,9 +1611,29 @@ public:
|
||||
LuaHelpers::CreateTableFromArray<Steps*>( v, L );
|
||||
return 1;
|
||||
}
|
||||
static int GetSongDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongDir() ); return 1; }
|
||||
static int GetMusicPath( T* p, lua_State *L ) { RString s = p->GetMusicPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; }
|
||||
static int GetBannerPath( T* p, lua_State *L ) { RString s = p->GetBannerPath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; }
|
||||
static int GetSongDir( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetSongDir() );
|
||||
return 1;
|
||||
}
|
||||
static int GetMusicPath( T* p, lua_State *L )
|
||||
{
|
||||
RString s = p->GetMusicPath();
|
||||
if( !s.empty() )
|
||||
lua_pushstring(L, s);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetBannerPath( T* p, lua_State *L )
|
||||
{
|
||||
RString s = p->GetBannerPath();
|
||||
if( !s.empty() )
|
||||
lua_pushstring(L, s);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetBackgroundPath( T* p, lua_State *L )
|
||||
{
|
||||
RString s = p->GetBackgroundPath();
|
||||
@@ -1561,15 +1643,59 @@ public:
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetCDTitlePath( T* p, lua_State *L ) { RString s = p->GetCDTitlePath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; }
|
||||
static int GetLyricsPath( T* p, lua_State *L ) { RString s = p->GetLyricsPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; }
|
||||
static int GetSongFilePath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongFilePath() ); return 1; }
|
||||
static int IsTutorial( T* p, lua_State *L ) { lua_pushboolean(L, p->IsTutorial()); return 1; }
|
||||
static int IsEnabled( T* p, lua_State *L ) { lua_pushboolean(L, p->GetEnabled()); return 1; }
|
||||
static int GetGroupName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGroupName); return 1; }
|
||||
static int MusicLengthSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_fMusicLengthSeconds); return 1; }
|
||||
static int IsLong( T* p, lua_State *L ) { lua_pushboolean(L, p->IsLong()); return 1; }
|
||||
static int IsMarathon( T* p, lua_State *L ) { lua_pushboolean(L, p->IsMarathon()); return 1; }
|
||||
static int GetCDTitlePath( T* p, lua_State *L )
|
||||
{
|
||||
RString s = p->GetCDTitlePath();
|
||||
if( !s.empty() )
|
||||
lua_pushstring(L, s);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetLyricsPath( T* p, lua_State *L )
|
||||
{
|
||||
RString s = p->GetLyricsPath();
|
||||
if( !s.empty() )
|
||||
lua_pushstring(L, s);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetSongFilePath( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->GetSongFilePath() );
|
||||
return 1;
|
||||
}
|
||||
static int IsTutorial( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->IsTutorial());
|
||||
return 1;
|
||||
}
|
||||
static int IsEnabled( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->GetEnabled());
|
||||
return 1;
|
||||
}
|
||||
static int GetGroupName( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushstring(L, p->m_sGroupName);
|
||||
return 1;
|
||||
}
|
||||
static int MusicLengthSeconds( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushnumber(L, p->m_fMusicLengthSeconds);
|
||||
return 1;
|
||||
}
|
||||
static int IsLong( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->IsLong());
|
||||
return 1;
|
||||
}
|
||||
static int IsMarathon( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->IsMarathon());
|
||||
return 1;
|
||||
}
|
||||
static int HasStepsType( T* p, lua_State *L )
|
||||
{
|
||||
StepsType st = Enum::Check<StepsType>(L, 1);
|
||||
@@ -1583,7 +1709,8 @@ public:
|
||||
lua_pushboolean( L, p->HasStepsTypeAndDifficulty(st, dc) );
|
||||
return 1;
|
||||
}
|
||||
// TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in a SongUtil Lua table and a method of Steps.
|
||||
/* TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in
|
||||
* a SongUtil Lua table and a method of Steps. */
|
||||
static int GetOneSteps( T* p, lua_State *L )
|
||||
{
|
||||
StepsType st = Enum::Check<StepsType>(L, 1);
|
||||
@@ -1601,14 +1728,42 @@ public:
|
||||
return 1;
|
||||
}
|
||||
// has functions
|
||||
static int HasMusic( T* p, lua_State *L ) { lua_pushboolean(L, p->HasMusic()); return 1; }
|
||||
static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner()); return 1; }
|
||||
static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground()); return 1; }
|
||||
static int HasCDTitle( T* p, lua_State *L ) { lua_pushboolean(L, p->HasCDTitle()); return 1; }
|
||||
static int HasBGChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBGChanges()); return 1; }
|
||||
static int HasLyrics( T* p, lua_State *L ) { lua_pushboolean(L, p->HasLyrics()); return 1; }
|
||||
static int HasMusic( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasMusic());
|
||||
return 1;
|
||||
}
|
||||
static int HasBanner( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasBanner());
|
||||
return 1;
|
||||
}
|
||||
static int HasBackground( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasBackground());
|
||||
return 1;
|
||||
}
|
||||
static int HasCDTitle( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasCDTitle());
|
||||
return 1;
|
||||
}
|
||||
static int HasBGChanges( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasBGChanges());
|
||||
return 1;
|
||||
}
|
||||
static int HasLyrics( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasLyrics());
|
||||
return 1;
|
||||
}
|
||||
// functions that AJ loves
|
||||
static int HasSignificantBPMChangesOrStops( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSignificantBpmChangesOrStops()); return 1; }
|
||||
static int HasSignificantBPMChangesOrStops( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasSignificantBpmChangesOrStops());
|
||||
return 1;
|
||||
}
|
||||
static int HasEdits( T* p, lua_State *L )
|
||||
{
|
||||
StepsType st = Enum::Check<StepsType>(L, 1);
|
||||
@@ -1621,8 +1776,16 @@ public:
|
||||
lua_pushboolean(L, p->IsEasy( st ));
|
||||
return 1;
|
||||
}
|
||||
static int GetStepsSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->GetStepsSeconds()); return 1; }
|
||||
static int NormallyDisplayed( T* p, lua_State *L ){ lua_pushboolean(L, p->NormallyDisplayed()); return 1; }
|
||||
static int GetStepsSeconds( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushnumber(L, p->GetStepsSeconds());
|
||||
return 1;
|
||||
}
|
||||
static int NormallyDisplayed( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->NormallyDisplayed());
|
||||
return 1;
|
||||
}
|
||||
static int GetFirstSecond(T* p, lua_State *L)
|
||||
{
|
||||
lua_pushnumber(L, p->GetFirstSecond());
|
||||
@@ -1643,7 +1806,11 @@ public:
|
||||
lua_pushnumber(L, p->GetLastBeat());
|
||||
return 1;
|
||||
}
|
||||
static int HasAttacks( T* p, lua_State *L ) { lua_pushboolean(L, p->HasAttacks()); return 1; }
|
||||
static int HasAttacks( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->HasAttacks());
|
||||
return 1;
|
||||
}
|
||||
static int GetDisplayBpms( T* p, lua_State *L )
|
||||
{
|
||||
DisplayBpms temp;
|
||||
|
||||
+2
-2
@@ -103,10 +103,10 @@ public:
|
||||
void TidyUpData( bool bFromCache = false );
|
||||
|
||||
/**
|
||||
* @brief Get the new radar values, and determine the last beat at the same time.
|
||||
* @brief Get the new radar values, and determine the last second at the same time.
|
||||
*
|
||||
* This is called by TidyUpData, after saving the Song. */
|
||||
void ReCalculateRadarValuesAndLastBeat( bool bFromCache = false );
|
||||
void ReCalculateRadarValuesAndLastSecond( bool bFromCache = false );
|
||||
/**
|
||||
* @brief Translate any titles that aren't in english.
|
||||
*
|
||||
|
||||
@@ -372,7 +372,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=".;"..\extern\lua-5.1\src";ffmpeg\modern_working\include;BaseClasses;..\extern\jsoncpp\include;"..\extern\glew-1.5.8\include";..\extern\pcre;"..\extern\mad-0.15.1b";..\extern\libpng\include;..\extern\libjpeg;..\extern\zlib;..\extern\vorbis"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINDOWS;RELEASE;GLEW_STATIC"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,GLEW_STATIC"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="0"
|
||||
|
||||
+10
-4
@@ -250,18 +250,24 @@ void SpeedSegment::SetUnit(const int i)
|
||||
this->unit = static_cast<unsigned short>(i);
|
||||
}
|
||||
|
||||
void SpeedSegment::Scale( int start, int length, int newLength )
|
||||
void SpeedSegment::Scale( int start, int oldLength, int newLength )
|
||||
{
|
||||
if( GetUnit() == 0 )
|
||||
{
|
||||
// XXX: this function is duplicated, there should be a better way
|
||||
float startBeat = GetBeat();
|
||||
float endBeat = startBeat + GetLength();
|
||||
float newStartBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), startBeat );
|
||||
float newEndBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), endBeat );
|
||||
float newStartBeat = ScalePosition(NoteRowToBeat(start),
|
||||
NoteRowToBeat(oldLength),
|
||||
NoteRowToBeat(newLength),
|
||||
startBeat);
|
||||
float newEndBeat = ScalePosition(NoteRowToBeat(start),
|
||||
NoteRowToBeat(oldLength),
|
||||
NoteRowToBeat(newLength),
|
||||
endBeat);
|
||||
SetLength( newEndBeat - newStartBeat );
|
||||
}
|
||||
TimingSegment<SpeedSegment>::Scale( start, length, newLength );
|
||||
TimingSegment<SpeedSegment>::Scale( start, oldLength, newLength );
|
||||
}
|
||||
|
||||
bool SpeedSegment::operator<( const SpeedSegment &other ) const
|
||||
|
||||
Reference in New Issue
Block a user