use actual Clamp()
This commit is contained in:
parent
cea50c1ab1
commit
fcb7588724
|
@ -3,6 +3,7 @@ using System.Windows.Forms;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
@ -34,10 +35,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
MemStateGapDividerNumeric.Maximum = Statable.SaveStateBinary().Length / 1024 / 2 + 1;
|
||||
MemStateGapDividerNumeric.Minimum = Statable.SaveStateBinary().Length / 1024 / 16;
|
||||
|
||||
// props to .net for this amazing Clamp() implementation
|
||||
MemStateGapDividerNumeric.Value = Math.Min(Math.Max(_settings.MemStateGapDivider,
|
||||
MemStateGapDividerNumeric.Minimum), MemStateGapDividerNumeric.Maximum);
|
||||
MemStateGapDividerNumeric.Value = NumberExtensions.Clamp(_settings.MemStateGapDivider,
|
||||
MemStateGapDividerNumeric.Minimum, MemStateGapDividerNumeric.Maximum);
|
||||
|
||||
FileStateGapNumeric.Value = _settings.FileStateGap;
|
||||
SavestateSizeLabel.Text = Math.Round(_stateSizeMb, 2).ToString() + " MB";
|
||||
|
|
Loading…
Reference in New Issue