MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SetRange

Method SetRange

Descent3/ConfigItem.cpp:1019–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017 va_end(marker);
1018}
1019void ConfigItem::SetRange(int min, int max, int range) {
1020 if (!m_bAlive)
1021 return;
1022 ASSERT(m_iType == CIT_SLIDER);
1023 ASSERT(m_iValueType == CIV_INT);
1024 ASSERT(max > min);
1025 ASSERT((m_iCurrentValue >= min) && (m_iCurrentValue <= max));
1026
1027 m_fMin = min;
1028 m_fMax = max;
1029 m_sList[0]->SetRange(range + 1);
1030 m_fUnit = ((float)max - min) / ((float)range);
1031
1032 // figure out how far in is the position
1033 m_sList[0]->SetPos((int)(((float)(m_iInitial - min)) / m_fUnit));
1034}
1035
1036void ConfigItem::SetRange(float min, float max, int range) {
1037 if (!m_bAlive)

Callers

nothing calls this directly

Calls 1

SetPosMethod · 0.45

Tested by

no test coverage detected