From 73b99e583a4abca838aa4fa34b170a28e5e1ad34 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 28 Aug 2004 22:10:06 +0000 Subject: [PATCH] optimize Stats.xml size: Allow theme to turn off writing off certain RadarValues --- stepmania/Themes/default/metrics.ini | 4 ++++ stepmania/src/RadarValues.cpp | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 2c8ad6e8b1..e0bad3962d 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -4710,3 +4710,7 @@ InternetRankingViewGuidUrl= ProductTitle=StepMania FooterText=generated by StepMania FooterLink=http://www.stepmania.com + +[RadarValues] +WriteComplexValues=1 +WriteSimpleValues=1 \ No newline at end of file diff --git a/stepmania/src/RadarValues.cpp b/stepmania/src/RadarValues.cpp index 0ee343f1db..9052994061 100644 --- a/stepmania/src/RadarValues.cpp +++ b/stepmania/src/RadarValues.cpp @@ -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 )