GUI: clamp waves to max value

This commit is contained in:
tildearrow 2022-03-11 17:00:57 -05:00
parent ab3884e5aa
commit cb3c4e2302

View file

@ -1885,6 +1885,7 @@ void FurnaceGUI::drawWaveEdit() {
modified=true; modified=true;
} }
for (int i=0; i<wave->len; i++) { for (int i=0; i<wave->len; i++) {
if (wave->data[i]>wave->max) wave->data[i]=wave->max;
wavePreview[i]=wave->data[i]; wavePreview[i]=wave->data[i];
} }
if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1]; if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1];