Skip to content

Commit

Permalink
rename CEnvelope::ValueRange and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Marmare314 committed Oct 7, 2023
1 parent 0d4d593 commit 63da1ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/game/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5314,7 +5314,7 @@ void CEditor::UpdateZoomEnvelopeY(const CUIRect &View)

void CEditor::ResetZoomEnvelope(const std::shared_ptr<CEnvelope> &pEnvelope, int ActiveChannels)
{
auto [Bottom, Top] = pEnvelope->GetValueRange(ActiveChannels);
auto [Bottom, Top] = pEnvelope->ValueRange(ActiveChannels);
float EndTime = pEnvelope->EndTime();
float ValueRange = absolute(Top - Bottom);

Expand Down
2 changes: 1 addition & 1 deletion src/game/editor/mapitems/envelope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void CEnvelope::Resort()
}
}

std::pair<float, float> CEnvelope::GetValueRange(int ChannelMask)
std::pair<float, float> CEnvelope::ValueRange(int ChannelMask)
{
float Top = -std::numeric_limits<float>::infinity();
float Bottom = std::numeric_limits<float>::infinity();
Expand Down
6 changes: 4 additions & 2 deletions src/game/editor/mapitems/envelope.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <game/client/render.h>

#include "base/color.h"
#include "envelope_point.h"

class CEnvelope
Expand All @@ -22,10 +21,13 @@ class CEnvelope
explicit CEnvelope(EType Type);
explicit CEnvelope(int NumChannels);

std::pair<float, float> GetValueRange(int ChannelMask);
// Get the range of the values in the envelope (including tangent handles)
std::pair<float, float> ValueRange(int ChannelMask);

void Eval(float Time, float &Volume);
void Eval(float Time, CTransform &CTransform);
void Eval(float Time, ColorRGBA &Color);

void AddPoint(float Time, float Volume);
void AddPoint(float Time, CTransform Transform);
void AddPoint(float Time, ColorRGBA Color);
Expand Down

0 comments on commit 63da1ae

Please sign in to comment.