From d7e7cb53e49f0bf7b2160f5a37d9ff84f185924d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 19 Dec 2003 03:18:52 +0000 Subject: [PATCH] Implementing Glenn's Suggestion --- stepmania/src/Steps.cpp | 50 ++++++++++------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 70a68ea7e5..34718fcd82 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -8,6 +8,7 @@ Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford Glenn Maynard + David Wilson ----------------------------------------------------------------------------- */ @@ -112,50 +113,23 @@ void Steps::GetSMNoteData( CString ¬es_comp_out, CString &attacks_comp_out ) float Steps::PredictMeter() const { - /* Tip: try this, instead: - const float RadarFactors[NUM_RADAR_CATEGORIES] = - { - 10.1f, 5.27f,-0.905f, -1.10f, 2.86f, - 0,0,0,0,0 - }; + float pMeter = 0.775f; + + const float RadarCoeffs[NUM_RADAR_CATEGORIES] = + { 10.1f, 5.27f,-0.905f, -1.10f, 2.86f, + 0,0,0,0,0 }; for( int r = 0; r < NUM_RADAR_CATEGORIES; ++r ) - pMeter += this->GetRadarValues()[r] * RadarFactors[r]; - - const float DifficultyBias[NUM_DIFFICULTIES] = - { - -1, -0.877f, 0, 0.722f, 0.722f - }; - pMeter += DifficultyBias[this->GetDifficulty()]; - */ - - // Coefficients - const float BETA_ZERO = 0.775f; - const float STREAM = 10.1f; - const float VOLTAGE = 5.27f; - const float AIR = -0.905f; - const float FREEZE = -1.10f; - const float CHAOS = 2.86f; - const float HEAVY = 0.722f; - const float LIGHT = -0.877f; - const float SXV = -6.35f; // Square/Voltage Interaction Varible - const float CSQUARE = -2.58f; - + pMeter += this->GetRadarValues()[r] * RadarCoeffs[r]; + + const float DifficultyCoeffs[NUM_DIFFICULTIES] = + { -0.877f, -0.877f, 0, 0.722f, 0.722f }; + pMeter += DifficultyCoeffs[this->GetDifficulty()] + // Init non-radar values const float SV = this->GetRadarValues()[RADAR_STREAM] * this->GetRadarValues()[RADAR_VOLTAGE]; const float ChaosSquare = this->GetRadarValues()[RADAR_CHAOS] * this->GetRadarValues()[RADAR_CHAOS]; - - float pMeter = BETA_ZERO; - pMeter += STREAM * this->GetRadarValues()[RADAR_STREAM]; - pMeter += VOLTAGE * this->GetRadarValues()[RADAR_VOLTAGE]; - pMeter += AIR * this->GetRadarValues()[RADAR_AIR]; - pMeter += FREEZE * this->GetRadarValues()[RADAR_FREEZE]; - pMeter += CHAOS * this->GetRadarValues()[RADAR_CHAOS]; pMeter += SXV * SV; pMeter += CSQUARE * ChaosSquare; - if( this->GetDifficulty() == DIFFICULTY_HARD ) - pMeter += HEAVY; - if( this->GetDifficulty() == DIFFICULTY_EASY ) - pMeter += LIGHT; return pMeter; }