git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@542 83fadc84-e282...
authorPatrick McIlroy <itgpmc@gmail.com>
Tue, 11 Nov 2008 05:58:08 +0000 (05:58 +0000)
committerPatrick McIlroy <itgpmc@gmail.com>
Tue, 11 Nov 2008 05:58:08 +0000 (05:58 +0000)
src/Combo.cpp
src/GraphDisplay.cpp
src/GraphDisplay.h
src/PlayerStageStats.cpp
src/PlayerStageStats.h
src/ScreenEvaluation.cpp

index d9a1eba..ffd7664 100755 (executable)
@@ -6,6 +6,7 @@
 #include "song.h"
 #include "Command.h"
 #include "PlayerState.h"
+#include "RageLog.h"
 
 Combo::Combo()
 {
@@ -128,21 +129,41 @@ void Combo::SetCombo( int iCombo, int iMisses )
        {
                if( m_pPlayerStageStats->FullComboOfScore(TNS_MARVELOUS) )
                {
+                       if ( !m_pPlayerStageStats->bFlag_FFC )
+                       {
+                               m_pPlayerStageStats->fFullFantasticComboBegin = GAMESTATE->m_fMusicSeconds;
+                               m_pPlayerStageStats->bFlag_FFC = true;
+                       }
                        sprLabel->RunCommands( FULL_COMBO_MARVELOUSES_COMMAND );
                        m_textNumber.RunCommands( FULL_COMBO_MARVELOUSES_COMMAND );
                }
                else if( bPastMidpoint && m_pPlayerStageStats->FullComboOfScore(TNS_PERFECT) )
                {
+                       if ( !m_pPlayerStageStats->bFlag_FEC )
+                       {
+                               m_pPlayerStageStats->fFullExcellentComboBegin = GAMESTATE->m_fMusicSeconds;
+                               m_pPlayerStageStats->bFlag_FEC = true;
+                       }
                        sprLabel->RunCommands( FULL_COMBO_PERFECTS_COMMAND );
                        m_textNumber.RunCommands( FULL_COMBO_PERFECTS_COMMAND );
                }
                else if( bPastMidpoint && m_pPlayerStageStats->FullComboOfScore(TNS_GREAT) )
                {
+                       if ( !m_pPlayerStageStats->bFlag_FGC )
+                       {
+                               m_pPlayerStageStats->fFullGreatComboBegin = GAMESTATE->m_fMusicSeconds;
+                               m_pPlayerStageStats->bFlag_FGC = true;
+                       }
                        sprLabel->RunCommands( FULL_COMBO_GREATS_COMMAND );
                        m_textNumber.RunCommands( FULL_COMBO_GREATS_COMMAND );
                }
                else
                {
+                       if ( !m_pPlayerStageStats->bFlag_PulsateEnd )
+                       {
+                               m_pPlayerStageStats->fPulsatingComboEnd = GAMESTATE->m_fMusicSeconds;
+                               m_pPlayerStageStats->bFlag_PulsateEnd = true;
+                       }
                        sprLabel->RunCommands( FULL_COMBO_BROKEN_COMMAND );
                        m_textNumber.RunCommands( FULL_COMBO_BROKEN_COMMAND );
                }
index 6fbaa8f..d2fd18a 100755 (executable)
@@ -7,12 +7,17 @@
 #include "StageStats.h"
 #include "Foreach.h"
 #include "song.h"
+#include "RageLog.h"
 
 //#define DIVIDE_LINE_WIDTH                    THEME->GetMetricI(m_sName,"TexturedBottomHalf")
 
 GraphDisplay::GraphDisplay()
 {
        m_pTexture = NULL;
+
+       m_iFFCPoint = -1;
+       m_iFECPoint = -1;
+       m_iFGCPoint = -1;
 }
 
 
@@ -62,6 +67,26 @@ void GraphDisplay::LoadFromStageStats( const StageStats &ss, const PlayerStageSt
                CLAMP( m_DestValues[i], 0.f, 1.f );
        UpdateVerts();
 
+       LOG->Debug( "pss.bFlag_FFC (%s): %f", pss.bFlag_FFC ? "true":"false", pss.fFullFantasticComboBegin );
+       LOG->Debug( "pss.bFlag_FEC (%s): %f", pss.bFlag_FEC ? "true":"false", pss.fFullExcellentComboBegin );
+       LOG->Debug( "pss.bFlag_FGC (%s): %f", pss.bFlag_FGC ? "true":"false", pss.fFullGreatComboBegin );
+       LOG->Debug( "pss.bFlag_PulsateEnd (%s): %f", pss.bFlag_PulsateEnd ? "true":"false", pss.fPulsatingComboEnd );
+
+       if ( pss.bFlag_FFC && pss.fFullFantasticComboBegin > -1.0f )
+               m_iFFCPoint = ( pss.fFullFantasticComboBegin * VALUE_RESOLUTION ) / fTotalStepSeconds;
+       if ( pss.bFlag_FEC && pss.fFullExcellentComboBegin > -1.0f )
+               m_iFECPoint = ( pss.fFullExcellentComboBegin * VALUE_RESOLUTION ) / fTotalStepSeconds;
+       if ( pss.bFlag_FGC && pss.fFullGreatComboBegin > -1.0f )
+               m_iFGCPoint = ( pss.fFullGreatComboBegin * VALUE_RESOLUTION ) / fTotalStepSeconds;
+       if ( pss.bFlag_PulsateEnd )
+               m_iPulseStopPoint = ( pss.fPulsatingComboEnd * VALUE_RESOLUTION ) / fTotalStepSeconds;
+       else
+               m_iPulseStopPoint = VALUE_RESOLUTION - 1;
+
+       LOG->Debug( "m_iFFCPoint: %d", m_iFFCPoint );
+       LOG->Debug( "m_iFECPoint: %d", m_iFECPoint );
+       LOG->Debug( "m_iFGCPoint: %d", m_iFGCPoint );
+       LOG->Debug( "m_iPulseStopPoint: %d", m_iPulseStopPoint );
 
        //
        // Show song boundaries
@@ -136,6 +161,24 @@ void GraphDisplay::UpdateVerts()
        for( int i = 0; i < 4*NumSlices; ++i )
                m_Slices[i].c = RageColor(1,1,1,1);
 
+       // TODO: Theme   --infamouspat
+       // these values were taken from the official ITG2 theme
+       if ( m_iFFCPoint > -1 )
+       {
+               for( int i = m_iFFCPoint; i < 4*m_iPulseStopPoint; ++i )
+                       m_Slices[i].c = RageColor(.580f,.922f,.996f,1);
+       }
+       if ( m_iFECPoint > -1 )
+       {
+               for( int i = m_iFECPoint; i < 4*m_iPulseStopPoint; ++i )
+                       m_Slices[i].c = RageColor(.992f,.835f,.6f,1);
+       }
+       if ( m_iFGCPoint > -1 )
+       {
+               for( int i = m_iFGCPoint; i < 4*m_iPulseStopPoint; ++i )
+                       m_Slices[i].c = RageColor(.04f,1.0f,.06f,1);
+       }
+
        for( int i = 0; i < NumSlices; ++i )
        {
                const float Left = SCALE( float(i), 0.0f, float(NumSlices), m_quadVertices.left, m_quadVertices.right );
index 96cf80c..81fdda8 100755 (executable)
@@ -36,6 +36,12 @@ private:
 
        vector<AutoActor*> m_vpSongBoundaries;
        AutoActor m_sprJustBarely;
+
+       // OpenITG: resolution points for colorized FFC/FEC graph
+       int m_iFFCPoint;
+       int m_iFECPoint;
+       int m_iFGCPoint;
+       int m_iPulseStopPoint;
 };
 
 #endif
index 7b21255..b65310b 100755 (executable)
@@ -23,6 +23,17 @@ void PlayerStageStats::Init()
        bFailed = false;
        bFailedEarlier = false;
        bGaveUp = false;
+
+       bFlag_FFC = false;
+       bFlag_FEC = false;
+       bFlag_FGC = false;
+       bFlag_PulsateEnd = false;
+
+       fFullFantasticComboBegin = -1.0f;
+       fFullExcellentComboBegin = -1.0f;
+       fFullGreatComboBegin = -1.0f;
+       fPulsatingComboEnd = -1.0f;
+
        iPossibleDancePoints = iCurPossibleDancePoints = iActualDancePoints = 0;
        iPossibleGradePoints = 0;
        iCurCombo = iMaxCombo = iCurMissCombo = iScore = iBonus = iMaxScore = iCurMaxScore = 0;
@@ -56,6 +67,18 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other )
        iCurPossibleDancePoints += other.iCurPossibleDancePoints;
        iPossibleGradePoints += other.iPossibleGradePoints;
        
+/*
+       bFlag_FFC |= other.bFlag_FFC;
+       bFlag_FEC |= other.bFlag_FEC;
+       bFlag_FGC |= other.bFlag_FGC;
+       bFlag_PulsateEnd |= other.bFlag_PulsateEnd;
+
+       fFullFantasticComboBegin = other.fFullFantasticComboBegin;
+       fFullExcellentComboBegin = other.fFullExcellentComboBegin;
+       fFullGreatComboBegin = other.fFullGreatComboBegin;
+       fPulsatingComboEnd = other.fPulsatingComboEnd;
+*/
+
        for( int t=0; t<NUM_TAP_NOTE_SCORES; t++ )
                iTapNoteScores[t] += other.iTapNoteScores[t];
        for( int h=0; h<NUM_HOLD_NOTE_SCORES; h++ )
index ab91bea..2d4e82a 100755 (executable)
@@ -56,6 +56,13 @@ struct PlayerStageStats
        int             iTotalError;
        float   fLifeRemainingSeconds;  // used in survival
 
+       bool    bFlag_FFC, bFlag_FEC, bFlag_FGC, bFlag_PulsateEnd;
+
+       float   fFullFantasticComboBegin;
+       float   fFullExcellentComboBegin;
+       float   fFullGreatComboBegin;
+       float   fPulsatingComboEnd;
+
        // workout
        float   fCaloriesBurned;
 
index ef8961d..e799c70 100755 (executable)
@@ -440,6 +440,11 @@ void ScreenEvaluation::Init()
        {
                FOREACH_EnabledPlayer( p )
                {
+                       LOG->Debug("P%d: fFullFantasticComboBegin: %f", (int)(p+1), stageStats.m_player[p].fFullFantasticComboBegin);
+                       LOG->Debug("P%d: fFullExcellentComboBegin: %f", (int)(p+1), stageStats.m_player[p].fFullExcellentComboBegin);
+                       LOG->Debug("P%d: fFullGreatComboBegin: %f", (int)(p+1), stageStats.m_player[p].fFullGreatComboBegin);
+                       LOG->Debug("P%d: fPulsatingComboEnd: %f", (int)(p+1), stageStats.m_player[p].fPulsatingComboEnd);
+
                        m_sprGraphFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("graph frame p%d",p+1)) );
                        m_sprGraphFrame[p]->SetName( ssprintf("GraphFrameP%d",p+1) );
                        SET_XY_AND_ON_COMMAND( m_sprGraphFrame[p] );