#include "global.h" /* ----------------------------------------------------------------------------- Class: GrooveGraph Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "GrooveGraph.h" #include "RageUtil.h" #include "PrefsManager.h" #include "RageBitmapTexture.h" #include "GameConstantsAndTypes.h" #include "ThemeManager.h" #include "Notes.h" #include "RageDisplay.h" #include "song.h" #include "GameState.h" #include "StyleDef.h" #include const float GRAPH_EDGE_WIDTH = 2; GrooveGraph::GrooveGraph() { for( int c=0; cAddChild( &m_Mountains[c] ); m_sprLabels[c].Load( THEME->GetPathToG("GrooveGraph labels 1x5") ); m_sprLabels[c].StopAnimating(); m_sprLabels[c].SetState( c ); m_sprLabels[c].SetXY( fX, +10 ); this->AddChild( &m_sprLabels[c] ); } } void GrooveGraph::SetFromSong( Song* pSong ) { float fValues[NUM_RADAR_CATEGORIES][NUM_DIFFICULTIES]; for( int i=0; iGetNotes( GAMESTATE->GetCurrentStyleDef()->m_NotesType, (Difficulty)i ); const float* fRadarValues = pNotes ? pNotes->GetRadarValues() : NULL; for( int j=0; jSetTexture( NULL ); DISPLAY->SetTextureModeModulate(); RageVertex v[3]; for( int i=NUM_DIFFICULTIES-1; i>=0; i-- ) { float fValue = m_fValuesOld[i] + (m_fValuesNew[i]-m_fValuesOld[i]) * m_PercentTowardNew; v[0].p = RageVector3( -30, -30, 0 ); v[1].p = RageVector3( 30, -30, 0 ); v[2].p = RageVector3( 0, -30+60*fValue, 0 ); v[0].c = v[1].c = v[2].c = g_DifficultyColors[i]; } DISPLAY->DrawFan( v, 3 ); switch( PREFSMAN->m_iPolygonRadar ) { case 0: DISPLAY->DrawLoop_LinesAndPoints( v, 3, 2 ); break; case 1: DISPLAY->DrawLoop_Polys( v, 3, 2 ); break; default: case -1: DISPLAY->DrawLoop( v, 3, 2 ); break; } }