Don't hold a redundant copy of the NoteData in NoteField. NoteField is
now just a renderer for NoteData. This means we don't have to carefully apply all changes to NoteData to NoteField.
This commit is contained in:
@@ -10,11 +10,6 @@
|
|||||||
|
|
||||||
struct RadarValues;
|
struct RadarValues;
|
||||||
|
|
||||||
struct RowTrack: public pair<int,int>
|
|
||||||
{
|
|
||||||
RowTrack( const HoldNote &hn ): pair<int,int>( hn.iEndRow, hn.iTrack ) { }
|
|
||||||
};
|
|
||||||
|
|
||||||
class NoteDataWithScoring : public NoteData
|
class NoteDataWithScoring : public NoteData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
+19
-14
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
NoteField::NoteField()
|
NoteField::NoteField()
|
||||||
{
|
{
|
||||||
|
m_pNoteData = NULL;
|
||||||
|
|
||||||
m_textMeasureNumber.LoadFromFont( THEME->GetPathToF("Common normal") );
|
m_textMeasureNumber.LoadFromFont( THEME->GetPathToF("Common normal") );
|
||||||
m_textMeasureNumber.SetZoom( 1.0f );
|
m_textMeasureNumber.SetZoom( 1.0f );
|
||||||
|
|
||||||
@@ -57,8 +59,8 @@ void NoteField::CacheNoteSkin( CString skin )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
LOG->Trace("NoteField::CacheNoteSkin: cache %s", skin.c_str() );
|
LOG->Trace("NoteField::CacheNoteSkin: cache %s", skin.c_str() );
|
||||||
NoteDisplayCols *nd = new NoteDisplayCols( GetNumTracks() );
|
NoteDisplayCols *nd = new NoteDisplayCols( m_pNoteData->GetNumTracks() );
|
||||||
for( int c=0; c<GetNumTracks(); c++ )
|
for( int c=0; c<m_pNoteData->GetNumTracks(); c++ )
|
||||||
nd->display[c].Load( c, m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
nd->display[c].Load( c, m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
||||||
nd->m_ReceptorArrowRow.Load( m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
nd->m_ReceptorArrowRow.Load( m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
||||||
nd->m_GhostArrowRow.Load( m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
nd->m_GhostArrowRow.Load( m_pPlayerState, skin, m_fYReverseOffsetPixels );
|
||||||
@@ -101,12 +103,13 @@ void NoteField::CacheAllUsedNoteSkins( bool bDeleteUnused )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NoteField::Load(
|
void NoteField::Load(
|
||||||
const NoteData* pNoteData,
|
const NoteData *pNoteData,
|
||||||
const PlayerState* pPlayerState,
|
const PlayerState* pPlayerState,
|
||||||
int iFirstPixelToDraw,
|
int iFirstPixelToDraw,
|
||||||
int iLastPixelToDraw,
|
int iLastPixelToDraw,
|
||||||
float fYReverseOffsetPixels )
|
float fYReverseOffsetPixels )
|
||||||
{
|
{
|
||||||
|
m_pNoteData = pNoteData;
|
||||||
m_pPlayerState = pPlayerState;
|
m_pPlayerState = pPlayerState;
|
||||||
m_iStartDrawingPixel = iFirstPixelToDraw;
|
m_iStartDrawingPixel = iFirstPixelToDraw;
|
||||||
m_iEndDrawingPixel = iLastPixelToDraw;
|
m_iEndDrawingPixel = iLastPixelToDraw;
|
||||||
@@ -115,10 +118,7 @@ void NoteField::Load(
|
|||||||
m_fPercentFadeToFail = -1;
|
m_fPercentFadeToFail = -1;
|
||||||
m_LastSeenBeatToNoteSkinRev = -1;
|
m_LastSeenBeatToNoteSkinRev = -1;
|
||||||
|
|
||||||
NoteDataWithScoring::Init();
|
ASSERT( m_pNoteData->GetNumTracks() == GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||||
|
|
||||||
this->CopyAll( *pNoteData );
|
|
||||||
ASSERT( GetNumTracks() == GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
|
||||||
|
|
||||||
/* If we're in gameplay, we havn't applied course modifiers yet, so we don't know what
|
/* If we're in gameplay, we havn't applied course modifiers yet, so we don't know what
|
||||||
* note skins we'll need. Don't delete unused skins yet. */
|
* note skins we'll need. Don't delete unused skins yet. */
|
||||||
@@ -543,7 +543,7 @@ void NoteField::DrawPrimitives()
|
|||||||
|
|
||||||
float fSelectedRangeGlow = SCALE( cosf(RageTimer::GetTimeSinceStart()*2), -1, 1, 0.1f, 0.3f );
|
float fSelectedRangeGlow = SCALE( cosf(RageTimer::GetTimeSinceStart()*2), -1, 1, 0.1f, 0.3f );
|
||||||
|
|
||||||
for( int c=0; c<GetNumTracks(); c++ ) // for each arrow column
|
for( int c=0; c<m_pNoteData->GetNumTracks(); c++ ) // for each arrow column
|
||||||
{
|
{
|
||||||
// TODO: Remove use of PlayerNumber.
|
// TODO: Remove use of PlayerNumber.
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
@@ -555,9 +555,9 @@ void NoteField::DrawPrimitives()
|
|||||||
NDMap::iterator CurDisplay = m_BeatToNoteDisplays.begin();
|
NDMap::iterator CurDisplay = m_BeatToNoteDisplays.begin();
|
||||||
ASSERT( CurDisplay != m_BeatToNoteDisplays.end() );
|
ASSERT( CurDisplay != m_BeatToNoteDisplays.end() );
|
||||||
NDMap::iterator NextDisplay = CurDisplay; ++NextDisplay;
|
NDMap::iterator NextDisplay = CurDisplay; ++NextDisplay;
|
||||||
for( int i=0; i < GetNumHoldNotes(); i++ )
|
for( int i=0; i < m_pNoteData->GetNumHoldNotes(); i++ )
|
||||||
{
|
{
|
||||||
const HoldNote &hn = GetHoldNote(i);
|
const HoldNote &hn = m_pNoteData->GetHoldNote(i);
|
||||||
if( hn.iTrack != c ) // this HoldNote doesn't belong to this column
|
if( hn.iTrack != c ) // this HoldNote doesn't belong to this column
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -605,15 +605,20 @@ void NoteField::DrawPrimitives()
|
|||||||
NextDisplay = CurDisplay; ++NextDisplay;
|
NextDisplay = CurDisplay; ++NextDisplay;
|
||||||
|
|
||||||
// draw notes from furthest to closest
|
// draw notes from furthest to closest
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *this, c, i, iFirstIndexToDraw, iLastIndexToDraw )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *m_pNoteData, c, i, iFirstIndexToDraw, iLastIndexToDraw )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNote(c, i);
|
const TapNote &tn = m_pNoteData->GetTapNote(c, i);
|
||||||
if( tn.type == TapNote::empty ) // no note here
|
if( tn.type == TapNote::empty ) // no note here
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
if( tn.type == TapNote::hold_head ) // this is a HoldNote begin marker. Grade it, but don't draw
|
if( tn.type == TapNote::hold_head ) // this is a HoldNote begin marker. Grade it, but don't draw
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
|
/* Don't draw hidden (fully judged) steps. */
|
||||||
|
if( tn.result.bHidden )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
// TRICKY: If boomerang is on, then all notes in the range
|
// TRICKY: If boomerang is on, then all notes in the range
|
||||||
// [iFirstIndexToDraw,iLastIndexToDraw] aren't necessarily visible.
|
// [iFirstIndexToDraw,iLastIndexToDraw] aren't necessarily visible.
|
||||||
// Test every note to make sure it's on screen before drawing
|
// Test every note to make sure it's on screen before drawing
|
||||||
@@ -625,9 +630,9 @@ void NoteField::DrawPrimitives()
|
|||||||
|
|
||||||
// See if there is a hold step that begins on this index.
|
// See if there is a hold step that begins on this index.
|
||||||
bool bHoldNoteBeginsOnThisBeat = false;
|
bool bHoldNoteBeginsOnThisBeat = false;
|
||||||
for( int c2=0; c2<GetNumTracks(); c2++ )
|
for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ )
|
||||||
{
|
{
|
||||||
if( GetTapNote(c2, i).type == TapNote::hold_head)
|
if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head)
|
||||||
{
|
{
|
||||||
bHoldNoteBeginsOnThisBeat = true;
|
bHoldNoteBeginsOnThisBeat = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* NoteField - adds rendering to NoteDataWithScoring */
|
/* NoteField - renders a NoteData */
|
||||||
|
|
||||||
#ifndef NOTEFIELD_H
|
#ifndef NOTE_FIELD_H
|
||||||
#define NOTEFIELD_H
|
#define NOTE_FIELD_H
|
||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "ReceptorArrowRow.h"
|
#include "ReceptorArrowRow.h"
|
||||||
#include "GhostArrowRow.h"
|
#include "GhostArrowRow.h"
|
||||||
|
|
||||||
class NoteField : public NoteDataWithScoring, public ActorFrame
|
class NoteField : public ActorFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoteField();
|
NoteField();
|
||||||
@@ -53,6 +53,8 @@ protected:
|
|||||||
|
|
||||||
void RefreshBeatToNoteSkin();
|
void RefreshBeatToNoteSkin();
|
||||||
|
|
||||||
|
const NoteData *m_pNoteData;
|
||||||
|
|
||||||
float m_fPercentFadeToFail; // -1 of not fading to fail
|
float m_fPercentFadeToFail; // -1 of not fading to fail
|
||||||
|
|
||||||
const PlayerState* m_pPlayerState;
|
const PlayerState* m_pPlayerState;
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ struct TapNoteResult
|
|||||||
* was hit early; positive numbers mean it was hit late. These values are
|
* was hit early; positive numbers mean it was hit late. These values are
|
||||||
* only meaningful for graded taps (tns >= TNS_BOO). */
|
* only meaningful for graded taps (tns >= TNS_BOO). */
|
||||||
float fTapNoteOffset;
|
float fTapNoteOffset;
|
||||||
|
|
||||||
|
/* If the whole row has been judged, all taps on the row will be set to hidden. */
|
||||||
|
bool bHidden;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HoldNoteResult
|
struct HoldNoteResult
|
||||||
|
|||||||
+14
-50
@@ -342,20 +342,9 @@ void Player::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
HoldNote &hn = m_NoteData.GetHoldNote(i);
|
HoldNote &hn = m_NoteData.GetHoldNote(i);
|
||||||
|
|
||||||
/* Find the associated hold note in m_pNoteField. */
|
|
||||||
/* ack: this iterates over all hold notes */
|
|
||||||
int iHN = m_pNoteField->GetMatchingHoldNote( hn );
|
|
||||||
HoldNote &NoteFieldHoldNote = m_pNoteField->GetHoldNote( iHN );
|
|
||||||
|
|
||||||
|
|
||||||
// set hold flags so NoteField can do intelligent drawing
|
// set hold flags so NoteField can do intelligent drawing
|
||||||
hn.bHeld = false;
|
hn.bHeld = false;
|
||||||
hn.bActive = false;
|
hn.bActive = false;
|
||||||
if( m_pNoteField )
|
|
||||||
{
|
|
||||||
NoteFieldHoldNote.bHeld = false;
|
|
||||||
NoteFieldHoldNote.bActive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HoldNoteScore hns = hn.result.hns;
|
HoldNoteScore hns = hn.result.hns;
|
||||||
@@ -386,9 +375,6 @@ void Player::Update( float fDeltaTime )
|
|||||||
/* This hold note is not judged and we stepped on its head. Update iLastHeldRow.
|
/* This hold note is not judged and we stepped on its head. Update iLastHeldRow.
|
||||||
* Do this even if we're a little beyond the end of the hold note, to make sure
|
* Do this even if we're a little beyond the end of the hold note, to make sure
|
||||||
* iLastHeldRow is clamped to iEndRow if the hold note is held all the way. */
|
* iLastHeldRow is clamped to iEndRow if the hold note is held all the way. */
|
||||||
if( m_pNoteField )
|
|
||||||
NoteFieldHoldNote.result.iLastHeldRow = min( iSongRow, hn.iEndRow );
|
|
||||||
|
|
||||||
hn.result.iLastHeldRow = min( iSongRow, hn.iEndRow );
|
hn.result.iLastHeldRow = min( iSongRow, hn.iEndRow );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,11 +384,6 @@ void Player::Update( float fDeltaTime )
|
|||||||
// set hold flag so NoteField can do intelligent drawing
|
// set hold flag so NoteField can do intelligent drawing
|
||||||
hn.bHeld = bIsHoldingButton && bSteppedOnTapNote;
|
hn.bHeld = bIsHoldingButton && bSteppedOnTapNote;
|
||||||
hn.bActive = bSteppedOnTapNote;
|
hn.bActive = bSteppedOnTapNote;
|
||||||
if( m_pNoteField )
|
|
||||||
{
|
|
||||||
NoteFieldHoldNote.bHeld = bIsHoldingButton && bSteppedOnTapNote;
|
|
||||||
NoteFieldHoldNote.bActive = bSteppedOnTapNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( bSteppedOnTapNote && bIsHoldingButton )
|
if( bSteppedOnTapNote && bIsHoldingButton )
|
||||||
{
|
{
|
||||||
@@ -455,12 +436,6 @@ void Player::Update( float fDeltaTime )
|
|||||||
m_ProTimingDisplay.SetJudgment( ms_error, TNS_MISS );
|
m_ProTimingDisplay.SetJudgment( ms_error, TNS_MISS );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_pNoteField )
|
|
||||||
{
|
|
||||||
NoteFieldHoldNote.result.fLife = fLife;
|
|
||||||
NoteFieldHoldNote.result.hns = hns;
|
|
||||||
}
|
|
||||||
|
|
||||||
hn.result.fLife = fLife;
|
hn.result.fLife = fLife;
|
||||||
hn.result.hns = hns;
|
hn.result.hns = hns;
|
||||||
}
|
}
|
||||||
@@ -524,8 +499,6 @@ void Player::ApplyWaitingTransforms()
|
|||||||
GAMESTATE->SetNoteSkinForBeatRange( m_pPlayerState, po.m_sNoteSkin, fStartBeat, fEndBeat );
|
GAMESTATE->SetNoteSkinForBeatRange( m_pPlayerState, po.m_sNoteSkin, fStartBeat, fEndBeat );
|
||||||
|
|
||||||
NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, fStartBeat, fEndBeat );
|
NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, fStartBeat, fEndBeat );
|
||||||
if( m_pNoteField )
|
|
||||||
m_pNoteField->CopyRange( m_NoteData, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), BeatToNoteRow(fStartBeat) );
|
|
||||||
}
|
}
|
||||||
m_pPlayerState->m_ModsToApply.clear();
|
m_pPlayerState->m_ModsToApply.clear();
|
||||||
}
|
}
|
||||||
@@ -763,17 +736,16 @@ void Player::Step( int col, RageTimer tm )
|
|||||||
|
|
||||||
if( m_pCombinedLifeMeter )
|
if( m_pCombinedLifeMeter )
|
||||||
m_pCombinedLifeMeter->ChangeLifeMine( pn );
|
m_pCombinedLifeMeter->ChangeLifeMine( pn );
|
||||||
|
tn.result.bHidden = true;
|
||||||
|
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
||||||
if( m_pNoteField )
|
if( m_pNoteField )
|
||||||
{
|
|
||||||
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
|
||||||
m_pNoteField->DidTapNote( col, score, false );
|
m_pNoteField->DidTapNote( col, score, false );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TapNote::attack:
|
case TapNote::attack:
|
||||||
score = TNS_NONE; // don't score this as anything
|
score = TNS_NONE; // don't score this as anything
|
||||||
if( fSecondsFromPerfect <= ADJUSTED_WINDOW(Attack) )
|
if( fSecondsFromPerfect <= ADJUSTED_WINDOW(Attack) && !tn.result.bHidden )
|
||||||
{
|
{
|
||||||
m_soundAttackLaunch.Play();
|
m_soundAttackLaunch.Play();
|
||||||
|
|
||||||
@@ -798,9 +770,8 @@ void Player::Step( int col, RageTimer tm )
|
|||||||
TapNote tn = m_NoteData.GetTapNote(t, iIndexOverlappingNote);
|
TapNote tn = m_NoteData.GetTapNote(t, iIndexOverlappingNote);
|
||||||
if( tn.type == TapNote::attack )
|
if( tn.type == TapNote::attack )
|
||||||
{
|
{
|
||||||
m_NoteData.SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
tn.result.bHidden = true;
|
||||||
if( m_pNoteField )
|
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
||||||
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -862,13 +833,12 @@ void Player::Step( int col, RageTimer tm )
|
|||||||
|
|
||||||
if( m_pCombinedLifeMeter )
|
if( m_pCombinedLifeMeter )
|
||||||
m_pCombinedLifeMeter->ChangeLifeMine( pn );
|
m_pCombinedLifeMeter->ChangeLifeMine( pn );
|
||||||
|
tn.result.bHidden = true;
|
||||||
|
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
||||||
if( m_pNoteField )
|
if( m_pNoteField )
|
||||||
{
|
|
||||||
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
|
||||||
m_pNoteField->DidTapNote( col, score, false );
|
m_pNoteField->DidTapNote( col, score, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* AI will generate misses here. Don't handle a miss like a regular note because
|
/* AI will generate misses here. Don't handle a miss like a regular note because
|
||||||
* we want the judgment animation to appear delayed. Instead, return early if
|
* we want the judgment animation to appear delayed. Instead, return early if
|
||||||
@@ -904,9 +874,8 @@ void Player::Step( int col, RageTimer tm )
|
|||||||
TapNote tn = m_NoteData.GetTapNote(t, iIndexOverlappingNote);
|
TapNote tn = m_NoteData.GetTapNote(t, iIndexOverlappingNote);
|
||||||
if( tn.type == TapNote::attack )
|
if( tn.type == TapNote::attack )
|
||||||
{
|
{
|
||||||
m_NoteData.SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
tn.result.bHidden = true;
|
||||||
if( m_pNoteField )
|
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
||||||
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -955,6 +924,7 @@ void Player::Step( int col, RageTimer tm )
|
|||||||
|
|
||||||
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
m_NoteData.SetTapNote( col, iIndexOverlappingNote, tn );
|
||||||
|
|
||||||
|
|
||||||
if( m_pPlayerState->m_PlayerController == PC_HUMAN &&
|
if( m_pPlayerState->m_PlayerController == PC_HUMAN &&
|
||||||
score >= TNS_GREAT )
|
score >= TNS_GREAT )
|
||||||
HandleAutosync(fNoteOffset);
|
HandleAutosync(fNoteOffset);
|
||||||
@@ -1074,8 +1044,10 @@ void Player::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
|
|||||||
// If the score is great or better, remove the note from the screen to
|
// If the score is great or better, remove the note from the screen to
|
||||||
// indicate success. (Or always if blind is on.)
|
// indicate success. (Or always if blind is on.)
|
||||||
if( score >= TNS_GREAT || m_pPlayerState->m_PlayerOptions.m_fBlind )
|
if( score >= TNS_GREAT || m_pPlayerState->m_PlayerOptions.m_fBlind )
|
||||||
if( m_pNoteField )
|
{
|
||||||
m_pNoteField->SetTapNote(c, iIndexThatWasSteppedOn, TAP_EMPTY);
|
tn.result.bHidden = true;
|
||||||
|
m_NoteData.SetTapNote( c, iIndexThatWasSteppedOn, tn );
|
||||||
|
}
|
||||||
|
|
||||||
// show the ghost arrow for this column
|
// show the ghost arrow for this column
|
||||||
if (m_pPlayerState->m_PlayerOptions.m_fBlind)
|
if (m_pPlayerState->m_PlayerOptions.m_fBlind)
|
||||||
@@ -1252,14 +1224,6 @@ void Player::RandomizeNotes( int iNoteRow )
|
|||||||
|
|
||||||
m_NoteData.SetTapNote( t, iNewNoteRow, t2 );
|
m_NoteData.SetTapNote( t, iNewNoteRow, t2 );
|
||||||
m_NoteData.SetTapNote( iSwapWith, iNewNoteRow, t1 );
|
m_NoteData.SetTapNote( iSwapWith, iNewNoteRow, t1 );
|
||||||
|
|
||||||
if( m_pNoteField )
|
|
||||||
{
|
|
||||||
const TapNote nft1 = m_pNoteField->GetTapNote( t, iNewNoteRow );
|
|
||||||
const TapNote nft2 = m_pNoteField->GetTapNote( iSwapWith, iNewNoteRow );
|
|
||||||
m_pNoteField->SetTapNote( t, iNewNoteRow, nft2 );
|
|
||||||
m_pNoteField->SetTapNote( iSwapWith, iNewNoteRow, nft1 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -498,15 +498,18 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName )
|
|||||||
|
|
||||||
m_NoteFieldEdit.SetXY( EDIT_X, PLAYER_Y );
|
m_NoteFieldEdit.SetXY( EDIT_X, PLAYER_Y );
|
||||||
m_NoteFieldEdit.SetZoom( 0.5f );
|
m_NoteFieldEdit.SetZoom( 0.5f );
|
||||||
m_NoteFieldEdit.Load( ¬eData, GAMESTATE->m_pPlayerState[PLAYER_1], -240, 800, PLAYER_HEIGHT*2 );
|
m_NoteDataEdit.CopyAll( noteData );
|
||||||
|
|
||||||
|
m_NoteFieldEdit.Load( &m_NoteDataEdit, GAMESTATE->m_pPlayerState[PLAYER_1], -240, 800, PLAYER_HEIGHT*2 );
|
||||||
|
|
||||||
m_rectRecordBack.StretchTo( RectF(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
|
m_rectRecordBack.StretchTo( RectF(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
|
||||||
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );
|
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );
|
||||||
|
|
||||||
m_NoteFieldRecord.SetXY( EDIT_X, PLAYER_Y );
|
m_NoteFieldRecord.SetXY( EDIT_X, PLAYER_Y );
|
||||||
m_NoteFieldRecord.Load( ¬eData, GAMESTATE->m_pPlayerState[PLAYER_1], -150, 350, 350 );
|
m_NoteDataRecord.CopyAll( noteData );
|
||||||
|
m_NoteFieldRecord.Load( &m_NoteDataRecord, GAMESTATE->m_pPlayerState[PLAYER_1], -150, 350, 350 );
|
||||||
|
|
||||||
m_Clipboard.SetNumTracks( m_NoteFieldEdit.GetNumTracks() );
|
m_Clipboard.SetNumTracks( m_NoteDataEdit.GetNumTracks() );
|
||||||
|
|
||||||
|
|
||||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Init(); // don't allow weird options in editor. It doesn't handle reverse well.
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Init(); // don't allow weird options in editor. It doesn't handle reverse well.
|
||||||
@@ -646,7 +649,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
|
|
||||||
// create a new hold note
|
// create a new hold note
|
||||||
HoldNote newHN( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) );
|
HoldNote newHN( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) );
|
||||||
m_NoteFieldRecord.AddHoldNote( newHN );
|
m_NoteDataRecord.AddHoldNote( newHN );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -730,8 +733,8 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
|
|
||||||
void ScreenEdit::UpdateTextInfo()
|
void ScreenEdit::UpdateTextInfo()
|
||||||
{
|
{
|
||||||
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
|
int iNumTapNotes = m_NoteDataEdit.GetNumTapNotes();
|
||||||
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
|
int iNumHoldNotes = m_NoteDataEdit.GetNumHoldNotes();
|
||||||
|
|
||||||
CString sNoteType = NoteTypeToString(m_SnapDisplay.GetNoteType()) + " notes";
|
CString sNoteType = NoteTypeToString(m_SnapDisplay.GetNoteType()) + " notes";
|
||||||
|
|
||||||
@@ -869,35 +872,35 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
|
|
||||||
// Alt + number = input to right half
|
// Alt + number = input to right half
|
||||||
if( EditIsBeingPressed(EDIT_BUTTON_RIGHT_SIDE) )
|
if( EditIsBeingPressed(EDIT_BUTTON_RIGHT_SIDE) )
|
||||||
iCol += m_NoteFieldEdit.GetNumTracks()/2;
|
iCol += m_NoteDataEdit.GetNumTracks()/2;
|
||||||
|
|
||||||
|
|
||||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||||
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
||||||
|
|
||||||
if( iCol >= m_NoteFieldEdit.GetNumTracks() ) // this button is not in the range of columns for this Style
|
if( iCol >= m_NoteDataEdit.GetNumTracks() ) // this button is not in the range of columns for this Style
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// check for to see if the user intended to remove a HoldNote
|
// check for to see if the user intended to remove a HoldNote
|
||||||
for( int i=0; i<m_NoteFieldEdit.GetNumHoldNotes(); i++ ) // for each HoldNote
|
for( int i=0; i<m_NoteDataEdit.GetNumHoldNotes(); i++ ) // for each HoldNote
|
||||||
{
|
{
|
||||||
const HoldNote &hn = m_NoteFieldEdit.GetHoldNote(i);
|
const HoldNote &hn = m_NoteDataEdit.GetHoldNote(i);
|
||||||
if( iCol == hn.iTrack && // the notes correspond
|
if( iCol == hn.iTrack && // the notes correspond
|
||||||
hn.RowIsInRange(iSongIndex) ) // the cursor lies within this HoldNote
|
hn.RowIsInRange(iSongIndex) ) // the cursor lies within this HoldNote
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.RemoveHoldNote( i );
|
m_NoteDataEdit.RemoveHoldNote( i );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_NoteFieldEdit.GetTapNote(iCol, iSongIndex).type != TapNote::empty )
|
if( m_NoteDataEdit.GetTapNote(iCol, iSongIndex).type != TapNote::empty )
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY );
|
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE) )
|
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE) )
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.SetTapNote(iCol, iSongIndex, TAP_ORIGINAL_MINE );
|
m_NoteDataEdit.SetTapNote(iCol, iSongIndex, TAP_ORIGINAL_MINE );
|
||||||
}
|
}
|
||||||
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_ATTACK) )
|
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_ATTACK) )
|
||||||
{
|
{
|
||||||
@@ -906,7 +909,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.SetTapNote(iCol, iSongIndex, TAP_ORIGINAL_TAP );
|
m_NoteDataEdit.SetTapNote(iCol, iSongIndex, TAP_ORIGINAL_TAP );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -967,7 +970,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
fBeatsToMove = -GAMESTATE->m_fSongBeat;
|
fBeatsToMove = -GAMESTATE->m_fSongBeat;
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_SCROLL_END:
|
case EDIT_BUTTON_SCROLL_END:
|
||||||
fBeatsToMove = m_NoteFieldEdit.GetLastBeat() - GAMESTATE->m_fSongBeat;
|
fBeatsToMove = m_NoteDataEdit.GetLastBeat() - GAMESTATE->m_fSongBeat;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -981,9 +984,9 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
|
|
||||||
// Ctrl + number = input to right half
|
// Ctrl + number = input to right half
|
||||||
if( EditIsBeingPressed(EDIT_BUTTON_RIGHT_SIDE) )
|
if( EditIsBeingPressed(EDIT_BUTTON_RIGHT_SIDE) )
|
||||||
iCol += m_NoteFieldEdit.GetNumTracks()/2;
|
iCol += m_NoteDataEdit.GetNumTracks()/2;
|
||||||
|
|
||||||
if( iCol >= m_NoteFieldEdit.GetNumTracks() )
|
if( iCol >= m_NoteDataEdit.GetNumTracks() )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
EditButton b = EditButton(EDIT_BUTTON_COLUMN_0+n);
|
EditButton b = EditButton(EDIT_BUTTON_COLUMN_0+n);
|
||||||
@@ -996,7 +999,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
newHN.iStartRow = max(newHN.iStartRow, 0);
|
newHN.iStartRow = max(newHN.iStartRow, 0);
|
||||||
newHN.iEndRow = max(newHN.iEndRow, 0);
|
newHN.iEndRow = max(newHN.iEndRow, 0);
|
||||||
|
|
||||||
m_NoteFieldEdit.AddHoldNote( newHN );
|
m_NoteDataEdit.AddHoldNote( newHN );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( EditIsBeingPressed(EDIT_BUTTON_SCROLL_SELECT) )
|
if( EditIsBeingPressed(EDIT_BUTTON_SCROLL_SELECT) )
|
||||||
@@ -1097,7 +1100,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
// save current steps
|
// save current steps
|
||||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
pSteps->SetNoteData( m_NoteFieldEdit );
|
pSteps->SetNoteData( m_NoteDataEdit );
|
||||||
|
|
||||||
// Get all Steps of this StepsType
|
// Get all Steps of this StepsType
|
||||||
StepsType st = pSteps->m_StepsType;
|
StepsType st = pSteps->m_StepsType;
|
||||||
@@ -1134,7 +1137,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
|
|
||||||
pSteps = *it;
|
pSteps = *it;
|
||||||
GAMESTATE->m_pCurSteps[PLAYER_1] = m_pSteps = pSteps;
|
GAMESTATE->m_pCurSteps[PLAYER_1] = m_pSteps = pSteps;
|
||||||
pSteps->GetNoteData( m_NoteFieldEdit );
|
pSteps->GetNoteData( m_NoteDataEdit );
|
||||||
SCREENMAN->SystemMessage( ssprintf(
|
SCREENMAN->SystemMessage( ssprintf(
|
||||||
"Switched to %s %s '%s'",
|
"Switched to %s %s '%s'",
|
||||||
GAMEMAN->StepsTypeToString( pSteps->m_StepsType ).c_str(),
|
GAMEMAN->StepsTypeToString( pSteps->m_StepsType ).c_str(),
|
||||||
@@ -1360,7 +1363,7 @@ void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType t
|
|||||||
if( iRow < 0 )
|
if( iRow < 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
m_NoteFieldRecord.SetTapNote(iCol, iRow, TAP_ORIGINAL_TAP);
|
m_NoteDataRecord.SetTapNote(iCol, iRow, TAP_ORIGINAL_TAP);
|
||||||
m_NoteFieldRecord.Step( iCol, TNS_MARVELOUS );
|
m_NoteFieldRecord.Step( iCol, TNS_MARVELOUS );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1465,11 +1468,11 @@ void ScreenEdit::TransitionFromRecordToEdit()
|
|||||||
int rowEnd = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
int rowEnd = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
||||||
|
|
||||||
// delete old TapNotes in the range
|
// delete old TapNotes in the range
|
||||||
m_NoteFieldEdit.ClearRange( rowBegin, rowEnd );
|
m_NoteDataEdit.ClearRange( rowBegin, rowEnd );
|
||||||
|
|
||||||
m_NoteFieldEdit.CopyRange( m_NoteFieldRecord, rowBegin, rowEnd, rowBegin );
|
m_NoteDataEdit.CopyRange( m_NoteDataRecord, rowBegin, rowEnd, rowBegin );
|
||||||
|
|
||||||
m_NoteFieldRecord.ClearAll();
|
m_NoteDataRecord.ClearAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper for SM_DoReloadFromDisk */
|
/* Helper for SM_DoReloadFromDisk */
|
||||||
@@ -1561,7 +1564,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
CString sMods = poChosen.GetString();
|
CString sMods = poChosen.GetString();
|
||||||
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||||
|
|
||||||
m_NoteFieldEdit.SetTapAttackNote( g_iLastInsertAttackTrack, row, sMods, g_fLastInsertAttackDurationSeconds );
|
m_NoteDataEdit.SetTapAttackNote( g_iLastInsertAttackTrack, row, sMods, g_fLastInsertAttackDurationSeconds );
|
||||||
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1606,7 +1609,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
SCREENMAN->SystemMessage( sMessage );
|
SCREENMAN->SystemMessage( sMessage );
|
||||||
|
|
||||||
m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1] = pSteps;
|
m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1] = pSteps;
|
||||||
m_pSteps->GetNoteData( m_NoteFieldEdit );
|
m_pSteps->GetNoteData( m_NoteDataEdit );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1714,28 +1717,28 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers )
|
|||||||
g_EditNotesStatistics.rows[meter].defaultChoice = clamp( pSteps->GetMeter()-1, 0, 14 );
|
g_EditNotesStatistics.rows[meter].defaultChoice = clamp( pSteps->GetMeter()-1, 0, 14 );
|
||||||
g_EditNotesStatistics.rows[predict_meter].choices.resize(1);g_EditNotesStatistics.rows[predict_meter].choices[0] = ssprintf("%f",pSteps->PredictMeter());
|
g_EditNotesStatistics.rows[predict_meter].choices.resize(1);g_EditNotesStatistics.rows[predict_meter].choices[0] = ssprintf("%f",pSteps->PredictMeter());
|
||||||
g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pSteps->GetDescription();
|
g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pSteps->GetDescription();
|
||||||
g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapNotes());
|
g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteDataEdit.GetNumTapNotes());
|
||||||
g_EditNotesStatistics.rows[hold_notes].choices.resize(1); g_EditNotesStatistics.rows[hold_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumHoldNotes());
|
g_EditNotesStatistics.rows[hold_notes].choices.resize(1); g_EditNotesStatistics.rows[hold_notes].choices[0] = ssprintf("%d", m_NoteDataEdit.GetNumHoldNotes());
|
||||||
g_EditNotesStatistics.rows[stream].choices.resize(1); g_EditNotesStatistics.rows[stream].choices[0] = ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteFieldEdit,fMusicSeconds));
|
g_EditNotesStatistics.rows[stream].choices.resize(1); g_EditNotesStatistics.rows[stream].choices[0] = ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteDataEdit,fMusicSeconds));
|
||||||
g_EditNotesStatistics.rows[voltage].choices.resize(1); g_EditNotesStatistics.rows[voltage].choices[0] = ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteFieldEdit,fMusicSeconds));
|
g_EditNotesStatistics.rows[voltage].choices.resize(1); g_EditNotesStatistics.rows[voltage].choices[0] = ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteDataEdit,fMusicSeconds));
|
||||||
|
|
||||||
g_EditNotesStatistics.rows[air].choices.resize(1); g_EditNotesStatistics.rows[air].choices[0] = ssprintf("%f", NoteDataUtil::GetAirRadarValue(m_NoteFieldEdit,fMusicSeconds));
|
g_EditNotesStatistics.rows[air].choices.resize(1); g_EditNotesStatistics.rows[air].choices[0] = ssprintf("%f", NoteDataUtil::GetAirRadarValue(m_NoteDataEdit,fMusicSeconds));
|
||||||
g_EditNotesStatistics.rows[freeze].choices.resize(1); g_EditNotesStatistics.rows[freeze].choices[0] = ssprintf("%f", NoteDataUtil::GetFreezeRadarValue(m_NoteFieldEdit,fMusicSeconds));
|
g_EditNotesStatistics.rows[freeze].choices.resize(1); g_EditNotesStatistics.rows[freeze].choices[0] = ssprintf("%f", NoteDataUtil::GetFreezeRadarValue(m_NoteDataEdit,fMusicSeconds));
|
||||||
g_EditNotesStatistics.rows[chaos].choices.resize(1); g_EditNotesStatistics.rows[chaos].choices[0] = ssprintf("%f", NoteDataUtil::GetChaosRadarValue(m_NoteFieldEdit,fMusicSeconds));
|
g_EditNotesStatistics.rows[chaos].choices.resize(1); g_EditNotesStatistics.rows[chaos].choices[0] = ssprintf("%f", NoteDataUtil::GetChaosRadarValue(m_NoteDataEdit,fMusicSeconds));
|
||||||
SCREENMAN->MiniMenu( &g_EditNotesStatistics, SM_BackFromEditNotesStatistics );
|
SCREENMAN->MiniMenu( &g_EditNotesStatistics, SM_BackFromEditNotesStatistics );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case play_whole_song:
|
case play_whole_song:
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.m_fBeginMarker = 0;
|
m_NoteFieldEdit.m_fBeginMarker = 0;
|
||||||
m_NoteFieldEdit.m_fEndMarker = m_NoteFieldEdit.GetLastBeat();
|
m_NoteFieldEdit.m_fEndMarker = m_NoteDataEdit.GetLastBeat();
|
||||||
HandleAreaMenuChoice( play, NULL );
|
HandleAreaMenuChoice( play, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case play_current_beat_to_end:
|
case play_current_beat_to_end:
|
||||||
{
|
{
|
||||||
m_NoteFieldEdit.m_fBeginMarker = GAMESTATE->m_fSongBeat;
|
m_NoteFieldEdit.m_fBeginMarker = GAMESTATE->m_fSongBeat;
|
||||||
m_NoteFieldEdit.m_fEndMarker = m_NoteFieldEdit.GetLastBeat();
|
m_NoteFieldEdit.m_fEndMarker = m_NoteDataEdit.GetLastBeat();
|
||||||
HandleAreaMenuChoice( play, NULL );
|
HandleAreaMenuChoice( play, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1745,7 +1748,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers )
|
|||||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
|
|
||||||
pSteps->SetNoteData( m_NoteFieldEdit );
|
pSteps->SetNoteData( m_NoteDataEdit );
|
||||||
GAMESTATE->m_pCurSong->Save();
|
GAMESTATE->m_pCurSong->Save();
|
||||||
|
|
||||||
// we shouldn't say we're saving a DWI if we're on any game besides
|
// we shouldn't say we're saving a DWI if we're on any game besides
|
||||||
@@ -1909,7 +1912,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
int iFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
int iFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
||||||
int iLastRow = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
int iLastRow = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
||||||
m_Clipboard.ClearAll();
|
m_Clipboard.ClearAll();
|
||||||
m_Clipboard.CopyRange( m_NoteFieldEdit, iFirstRow, iLastRow );
|
m_Clipboard.CopyRange( m_NoteDataEdit, iFirstRow, iLastRow );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case paste_at_current_beat:
|
case paste_at_current_beat:
|
||||||
@@ -1917,7 +1920,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
int iSrcFirstRow = 0;
|
int iSrcFirstRow = 0;
|
||||||
int iSrcLastRow = BeatToNoteRow( m_Clipboard.GetLastBeat() );
|
int iSrcLastRow = BeatToNoteRow( m_Clipboard.GetLastBeat() );
|
||||||
int iDestFirstRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
int iDestFirstRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||||
m_NoteFieldEdit.CopyRange( m_Clipboard, iSrcFirstRow, iSrcLastRow, iDestFirstRow );
|
m_NoteDataEdit.CopyRange( m_Clipboard, iSrcFirstRow, iSrcLastRow, iDestFirstRow );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case paste_at_begin_marker:
|
case paste_at_begin_marker:
|
||||||
@@ -1926,7 +1929,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
int iSrcFirstRow = 0;
|
int iSrcFirstRow = 0;
|
||||||
int iSrcLastRow = BeatToNoteRow( m_Clipboard.GetLastBeat() );
|
int iSrcLastRow = BeatToNoteRow( m_Clipboard.GetLastBeat() );
|
||||||
int iDestFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
int iDestFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
||||||
m_NoteFieldEdit.CopyRange( m_Clipboard, iSrcFirstRow, iSrcLastRow, iDestFirstRow );
|
m_NoteDataEdit.CopyRange( m_Clipboard, iSrcFirstRow, iSrcLastRow, iDestFirstRow );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case clear:
|
case clear:
|
||||||
@@ -1934,13 +1937,13 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
ASSERT( m_NoteFieldEdit.m_fBeginMarker!=-1 && m_NoteFieldEdit.m_fEndMarker!=-1 );
|
ASSERT( m_NoteFieldEdit.m_fBeginMarker!=-1 && m_NoteFieldEdit.m_fEndMarker!=-1 );
|
||||||
int iFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
int iFirstRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
||||||
int iLastRow = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
int iLastRow = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
||||||
m_NoteFieldEdit.ClearRange( iFirstRow, iLastRow );
|
m_NoteDataEdit.ClearRange( iFirstRow, iLastRow );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case quantize:
|
case quantize:
|
||||||
{
|
{
|
||||||
NoteType nt = (NoteType)iAnswers[c];
|
NoteType nt = (NoteType)iAnswers[c];
|
||||||
NoteDataUtil::SnapToNearestNoteType( m_NoteFieldEdit, nt, nt, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker );
|
NoteDataUtil::SnapToNearestNoteType( m_NoteDataEdit, nt, nt, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case turn:
|
case turn:
|
||||||
@@ -1972,28 +1975,28 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
switch( tt )
|
switch( tt )
|
||||||
{
|
{
|
||||||
case noholds: NoteDataUtil::RemoveHoldNotes( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case noholds: NoteDataUtil::RemoveHoldNotes( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case nomines: NoteDataUtil::RemoveMines( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case nomines: NoteDataUtil::RemoveMines( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case little: NoteDataUtil::Little( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case little: NoteDataUtil::Little( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case wide: NoteDataUtil::Wide( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case wide: NoteDataUtil::Wide( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case big: NoteDataUtil::Big( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case big: NoteDataUtil::Big( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case quick: NoteDataUtil::Quick( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case quick: NoteDataUtil::Quick( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case bmrize: NoteDataUtil::BMRize( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case bmrize: NoteDataUtil::BMRize( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case skippy: NoteDataUtil::Skippy( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case skippy: NoteDataUtil::Skippy( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case mines: NoteDataUtil::AddMines( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case mines: NoteDataUtil::AddMines( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case echo: NoteDataUtil::Echo( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case echo: NoteDataUtil::Echo( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case stomp: NoteDataUtil::Stomp( m_NoteFieldEdit, st, fBeginBeat, fEndBeat ); break;
|
case stomp: NoteDataUtil::Stomp( m_NoteDataEdit, st, fBeginBeat, fEndBeat ); break;
|
||||||
case planted: NoteDataUtil::Planted( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case planted: NoteDataUtil::Planted( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case floored: NoteDataUtil::Floored( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case floored: NoteDataUtil::Floored( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case twister: NoteDataUtil::Twister( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case twister: NoteDataUtil::Twister( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case nojumps: NoteDataUtil::RemoveJumps( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case nojumps: NoteDataUtil::RemoveJumps( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case nohands: NoteDataUtil::RemoveHands( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case nohands: NoteDataUtil::RemoveHands( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
case noquads: NoteDataUtil::RemoveQuads( m_NoteFieldEdit, fBeginBeat, fEndBeat ); break;
|
case noquads: NoteDataUtil::RemoveQuads( m_NoteDataEdit, fBeginBeat, fEndBeat ); break;
|
||||||
default: ASSERT(0);
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bake in the additions
|
// bake in the additions
|
||||||
NoteDataUtil::ConvertAdditionsToRegular( m_NoteFieldEdit );
|
NoteDataUtil::ConvertAdditionsToRegular( m_NoteDataEdit );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case alter:
|
case alter:
|
||||||
@@ -2060,7 +2063,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
float fNewClipboardBeats = fOldClipboardBeats * fScale;
|
float fNewClipboardBeats = fOldClipboardBeats * fScale;
|
||||||
float fDeltaBeats = fNewClipboardBeats - fOldClipboardBeats;
|
float fDeltaBeats = fNewClipboardBeats - fOldClipboardBeats;
|
||||||
float fNewClipboardEndBeat = m_NoteFieldEdit.m_fBeginMarker + fNewClipboardBeats;
|
float fNewClipboardEndBeat = m_NoteFieldEdit.m_fBeginMarker + fNewClipboardBeats;
|
||||||
NoteDataUtil::ShiftRows( m_NoteFieldEdit, m_NoteFieldEdit.m_fBeginMarker, fDeltaBeats );
|
NoteDataUtil::ShiftRows( m_NoteDataEdit, m_NoteFieldEdit.m_fBeginMarker, fDeltaBeats );
|
||||||
m_pSong->m_Timing.ScaleRegion( fScale, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker );
|
m_pSong->m_Timing.ScaleRegion( fScale, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker );
|
||||||
|
|
||||||
HandleAreaMenuChoice( paste_at_begin_marker, NULL );
|
HandleAreaMenuChoice( paste_at_begin_marker, NULL );
|
||||||
@@ -2115,7 +2118,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
/* If we're in course display mode, set that up. */
|
/* If we're in course display mode, set that up. */
|
||||||
SetupCourseAttacks();
|
SetupCourseAttacks();
|
||||||
|
|
||||||
m_Player.Load( m_NoteFieldEdit );
|
m_Player.Load( m_NoteDataEdit );
|
||||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PREFSMAN->m_bAutoPlay?PC_AUTOPLAY:PC_HUMAN;
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PREFSMAN->m_bAutoPlay?PC_AUTOPLAY:PC_HUMAN;
|
||||||
|
|
||||||
m_rectRecordBack.StopTweening();
|
m_rectRecordBack.StopTweening();
|
||||||
@@ -2130,7 +2133,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
* and recalc it. */
|
* and recalc it. */
|
||||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
pSteps->SetNoteData( m_NoteFieldEdit );
|
pSteps->SetNoteData( m_NoteDataEdit );
|
||||||
m_pSong->ReCalculateRadarValuesAndLastBeat();
|
m_pSong->ReCalculateRadarValuesAndLastBeat();
|
||||||
|
|
||||||
m_Background.Unload();
|
m_Background.Unload();
|
||||||
@@ -2162,8 +2165,9 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
GAMESTATE->ResetNoteSkins();
|
GAMESTATE->ResetNoteSkins();
|
||||||
|
|
||||||
// initialize m_NoteFieldRecord
|
// initialize m_NoteFieldRecord
|
||||||
m_NoteFieldRecord.Load( &m_NoteFieldEdit, GAMESTATE->m_pPlayerState[PLAYER_1], -150, 350, 350 );
|
m_NoteDataRecord.SetNumTracks( m_NoteDataEdit.GetNumTracks() );
|
||||||
m_NoteFieldRecord.SetNumTracks( m_NoteFieldEdit.GetNumTracks() );
|
m_NoteDataRecord.CopyAll( m_NoteDataEdit );
|
||||||
|
m_NoteFieldRecord.Load( &m_NoteDataRecord, GAMESTATE->m_pPlayerState[PLAYER_1], -150, 350, 350 );
|
||||||
|
|
||||||
m_rectRecordBack.StopTweening();
|
m_rectRecordBack.StopTweening();
|
||||||
m_rectRecordBack.BeginTweening( 0.5f );
|
m_rectRecordBack.BeginTweening( 0.5f );
|
||||||
@@ -2182,10 +2186,10 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case insert_and_shift:
|
case insert_and_shift:
|
||||||
NoteDataUtil::ShiftRows( m_NoteFieldEdit, GAMESTATE->m_fSongBeat, 1 );
|
NoteDataUtil::ShiftRows( m_NoteDataEdit, GAMESTATE->m_fSongBeat, 1 );
|
||||||
break;
|
break;
|
||||||
case delete_and_shift:
|
case delete_and_shift:
|
||||||
NoteDataUtil::ShiftRows( m_NoteFieldEdit, GAMESTATE->m_fSongBeat, -1 );
|
NoteDataUtil::ShiftRows( m_NoteDataEdit, GAMESTATE->m_fSongBeat, -1 );
|
||||||
break;
|
break;
|
||||||
case shift_pauses_forward:
|
case shift_pauses_forward:
|
||||||
m_pSong->m_Timing.ShiftRows( GAMESTATE->m_fSongBeat, 1 );
|
m_pSong->m_Timing.ShiftRows( GAMESTATE->m_fSongBeat, 1 );
|
||||||
@@ -2203,7 +2207,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
float fStopLength = fMarkerEnd - fMarkerStart;
|
float fStopLength = fMarkerEnd - fMarkerStart;
|
||||||
// be sure not to clobber the row at the start - a row at the end
|
// be sure not to clobber the row at the start - a row at the end
|
||||||
// can be dropped safely, though
|
// can be dropped safely, though
|
||||||
NoteDataUtil::ShiftRows( m_NoteFieldEdit,
|
NoteDataUtil::ShiftRows( m_NoteDataEdit,
|
||||||
m_NoteFieldEdit.m_fBeginMarker + 0.003f,
|
m_NoteFieldEdit.m_fBeginMarker + 0.003f,
|
||||||
(-m_NoteFieldEdit.m_fEndMarker+m_NoteFieldEdit.m_fBeginMarker)
|
(-m_NoteFieldEdit.m_fEndMarker+m_NoteFieldEdit.m_fBeginMarker)
|
||||||
);
|
);
|
||||||
@@ -2258,10 +2262,10 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
|||||||
fStopLength *= fBPMatPause;
|
fStopLength *= fBPMatPause;
|
||||||
fStopLength /= 60;
|
fStopLength /= 60;
|
||||||
// don't move the step from where it is, just move everything later
|
// don't move the step from where it is, just move everything later
|
||||||
m_NoteFieldEdit.ConvertHoldNotesTo2sAnd3s();
|
m_NoteDataEdit.ConvertHoldNotesTo2sAnd3s();
|
||||||
NoteDataUtil::ShiftRows( m_NoteFieldEdit, GAMESTATE->m_fSongBeat + 0.003f, fStopLength );
|
NoteDataUtil::ShiftRows( m_NoteDataEdit, GAMESTATE->m_fSongBeat + 0.003f, fStopLength );
|
||||||
m_pSong->m_Timing.ShiftRows( GAMESTATE->m_fSongBeat + 0.003f, fStopLength );
|
m_pSong->m_Timing.ShiftRows( GAMESTATE->m_fSongBeat + 0.003f, fStopLength );
|
||||||
m_NoteFieldEdit.Convert2sAnd3sToHoldNotes();
|
m_NoteDataEdit.Convert2sAnd3sToHoldNotes();
|
||||||
|
|
||||||
}
|
}
|
||||||
// Hello and welcome to I FEEL STUPID :-)
|
// Hello and welcome to I FEEL STUPID :-)
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ protected:
|
|||||||
Steps* m_pSteps;
|
Steps* m_pSteps;
|
||||||
|
|
||||||
NoteField m_NoteFieldEdit;
|
NoteField m_NoteFieldEdit;
|
||||||
|
NoteDataWithScoring m_NoteDataEdit;
|
||||||
SnapDisplay m_SnapDisplay;
|
SnapDisplay m_SnapDisplay;
|
||||||
|
|
||||||
AutoActor m_sprOverlay;
|
AutoActor m_sprOverlay;
|
||||||
@@ -176,6 +177,7 @@ protected:
|
|||||||
// for MODE_RECORD
|
// for MODE_RECORD
|
||||||
|
|
||||||
NoteField m_NoteFieldRecord;
|
NoteField m_NoteFieldRecord;
|
||||||
|
NoteDataWithScoring m_NoteDataRecord;
|
||||||
|
|
||||||
// for MODE_PLAY
|
// for MODE_PLAY
|
||||||
void SetupCourseAttacks();
|
void SetupCourseAttacks();
|
||||||
|
|||||||
Reference in New Issue
Block a user