GUI: use best wave size when adding wave
or display a menu TODO: fix non-32×32 wave being messed up
This commit is contained in:
parent
0daf52ffe0
commit
bd7e57cea8
3 changed files with 71 additions and 2 deletions
|
|
@ -717,16 +717,45 @@ void FurnaceGUI::doAction(int what) {
|
|||
insListDir=!insListDir;
|
||||
break;
|
||||
|
||||
case GUI_ACTION_WAVE_LIST_ADD:
|
||||
case GUI_ACTION_WAVE_LIST_ADD: {
|
||||
waveSizeList.clear();
|
||||
for (int i=0; i<e->song.systemLen; i++) {
|
||||
const DivSysDef* sysDef=e->getSystemDef(e->song.system[i]);
|
||||
if (sysDef==NULL) continue;
|
||||
|
||||
if (sysDef->waveHeight==0) continue;
|
||||
if (sysDef->waveWidth==0) {
|
||||
// add three preset sizes
|
||||
waveSizeList.push_back(FurnaceGUIWaveSizeEntry(32,sysDef->waveHeight,sysDef->name));
|
||||
waveSizeList.push_back(FurnaceGUIWaveSizeEntry(64,sysDef->waveHeight,sysDef->name));
|
||||
waveSizeList.push_back(FurnaceGUIWaveSizeEntry(128,sysDef->waveHeight,sysDef->name));
|
||||
} else {
|
||||
waveSizeList.push_back(FurnaceGUIWaveSizeEntry(sysDef->waveWidth,sysDef->waveHeight,sysDef->name));
|
||||
}
|
||||
}
|
||||
|
||||
int finalWidth=32;
|
||||
int finalHeight=32;
|
||||
if (waveSizeList.size()==1) {
|
||||
finalWidth=waveSizeList[0].width;
|
||||
finalHeight=waveSizeList[0].height;
|
||||
} else if (waveSizeList.size()>1) {
|
||||
displayWaveSizeList=true;
|
||||
break;
|
||||
}
|
||||
|
||||
curWave=e->addWave();
|
||||
if (curWave==-1) {
|
||||
showError("too many wavetables!");
|
||||
} else {
|
||||
wantScrollList=true;
|
||||
e->song.wave[curWave]->len=finalWidth;
|
||||
e->song.wave[curWave]->max=finalHeight-1;
|
||||
MARK_MODIFIED;
|
||||
RESET_WAVE_MACRO_ZOOM;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GUI_ACTION_WAVE_LIST_DUPLICATE:
|
||||
if (curWave>=0 && curWave<(int)e->song.wave.size()) {
|
||||
int prevWave=curWave;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue