optimize Stats.xml size: Allow theme to turn off writing off certain RadarValues

This commit is contained in:
Chris Danford
2004-08-28 22:10:06 +00:00
parent 685a43af5e
commit 73b99e583a
2 changed files with 17 additions and 2 deletions
+4
View File
@@ -4710,3 +4710,7 @@ InternetRankingViewGuidUrl=
ProductTitle=StepMania
FooterText=generated by StepMania
FooterLink=http://www.stepmania.com
[RadarValues]
WriteComplexValues=1
WriteSimpleValues=1
+13 -2
View File
@@ -3,7 +3,10 @@
#include "ThemeManager.h"
#include "RageUtil.h"
#include "XmlFile.h"
#include "ThemeManager.h"
#define WRITE_COMPLEX_VALUES THEME->GetMetricB("RadarValues","WriteComplexValues")
#define WRITE_SIMPLE_VALUES THEME->GetMetricB("RadarValues","WriteSimpleValues")
RadarValues::RadarValues()
{
@@ -31,9 +34,15 @@ XNode* RadarValues::CreateNode() const
FOREACH_RadarCategory( rc )
{
if( rc >= RADAR_NUM_TAPS_AND_HOLDS )
pNode->AppendChild( RadarCategoryToString(rc), (int)m_fValues[rc] );
{
if( WRITE_SIMPLE_VALUES )
pNode->AppendChild( RadarCategoryToString(rc), (int)m_fValues[rc] );
}
else
pNode->AppendChild( RadarCategoryToString(rc), m_fValues[rc] );
{
if( WRITE_COMPLEX_VALUES )
pNode->AppendChild( RadarCategoryToString(rc), m_fValues[rc] );
}
}
return pNode;
@@ -43,6 +52,8 @@ void RadarValues::LoadFromNode( const XNode* pNode )
{
ASSERT( pNode->name == "RadarValues" );
Zero();
CString s;
FOREACH_RadarCategory( rc )