implement chip cloning/duplication
muwahahaha
This commit is contained in:
parent
f0bf58eef2
commit
b972e54a7e
|
@ -6,8 +6,12 @@ the **chip manager** window allows you to manage chips, including adding, changi
|
||||||
|
|
||||||
**Preserve channel order**: make existing pattern data stay in place even when chips are rearranged. when turned off, pattern data will be arranged to match (the default, and usually desired behavior).
|
**Preserve channel order**: make existing pattern data stay in place even when chips are rearranged. when turned off, pattern data will be arranged to match (the default, and usually desired behavior).
|
||||||
|
|
||||||
|
**Clone channel data**: when cloning chips, also copy patterns, pattern names, channel names and other parameters to the clone.
|
||||||
|
|
||||||
to move a chip around, click and drag the  button to the left.
|
to move a chip around, click and drag the  button to the left.
|
||||||
|
|
||||||
|
to duplicate a chip, click the **Clone** button.
|
||||||
|
|
||||||
to replace a chip with a different one, click the **Change** button. this will display the chip selector.
|
to replace a chip with a different one, click the **Change** button. this will display the chip selector.
|
||||||
|
|
||||||
to remove a chip, click the  button.
|
to remove a chip, click the  button.
|
||||||
|
|
|
@ -1158,7 +1158,33 @@ bool DivEngine::duplicateSystem(int index, bool pat, bool end) {
|
||||||
|
|
||||||
// duplicate patterns
|
// duplicate patterns
|
||||||
if (pat) {
|
if (pat) {
|
||||||
|
int srcChan=0;
|
||||||
|
int destChan=0;
|
||||||
|
for (int i=0; i<index; i++) {
|
||||||
|
srcChan+=getChannelCount(song.system[i]);
|
||||||
|
}
|
||||||
|
for (int i=0; i<song.systemLen-1; i++) {
|
||||||
|
destChan+=getChannelCount(song.system[i]);
|
||||||
|
}
|
||||||
|
for (DivSubSong* i: song.subsong) {
|
||||||
|
for (int j=0; j<getChannelCount(song.system[index]); j++) {
|
||||||
|
i->pat[destChan+j].effectCols=i->pat[srcChan+j].effectCols;
|
||||||
|
i->chanShow[destChan+j]=i->chanShow[srcChan+j];
|
||||||
|
i->chanShowChanOsc[destChan+j]=i->chanShowChanOsc[srcChan+j];
|
||||||
|
i->chanCollapse[destChan+j]=i->chanCollapse[srcChan+j];
|
||||||
|
i->chanName[destChan+j]=i->chanName[srcChan+j];
|
||||||
|
i->chanShortName[destChan+j]=i->chanShortName[srcChan+j];
|
||||||
|
for (int k=0; k<DIV_MAX_PATTERNS; k++) {
|
||||||
|
if (i->pat[srcChan+j].data[k]!=NULL) {
|
||||||
|
i->pat[srcChan+j].data[k]->copyOn(i->pat[destChan+j].getPattern(k,true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int k=0; k<DIV_MAX_PATTERNS; k++) {
|
||||||
|
i->orders.ord[destChan+j][k]=i->orders.ord[srcChan+j][k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
renderSamples();
|
renderSamples();
|
||||||
|
|
|
@ -7318,6 +7318,7 @@ FurnaceGUI::FurnaceGUI():
|
||||||
displayPalette(false),
|
displayPalette(false),
|
||||||
fullScreen(false),
|
fullScreen(false),
|
||||||
preserveChanPos(false),
|
preserveChanPos(false),
|
||||||
|
sysDupCloneChannels(true),
|
||||||
wantScrollList(false),
|
wantScrollList(false),
|
||||||
noteInputPoly(true),
|
noteInputPoly(true),
|
||||||
notifyWaveChange(false),
|
notifyWaveChange(false),
|
||||||
|
|
|
@ -1503,7 +1503,7 @@ class FurnaceGUI {
|
||||||
bool vgmExportDirectStream, displayInsTypeList, displayWaveSizeList;
|
bool vgmExportDirectStream, displayInsTypeList, displayWaveSizeList;
|
||||||
bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed;
|
bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed;
|
||||||
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
|
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
|
||||||
bool displayNew, displayExport, displayPalette, fullScreen, preserveChanPos, wantScrollList, noteInputPoly, notifyWaveChange;
|
bool displayNew, displayExport, displayPalette, fullScreen, preserveChanPos, sysDupCloneChannels, wantScrollList, noteInputPoly, notifyWaveChange;
|
||||||
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
|
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
|
||||||
bool mobileEdit;
|
bool mobileEdit;
|
||||||
bool killGraphics;
|
bool killGraphics;
|
||||||
|
|
|
@ -40,6 +40,8 @@ void FurnaceGUI::drawSysManager() {
|
||||||
}
|
}
|
||||||
if (ImGui::Begin("Chip Manager",&sysManagerOpen,globalWinFlags)) {
|
if (ImGui::Begin("Chip Manager",&sysManagerOpen,globalWinFlags)) {
|
||||||
ImGui::Checkbox("Preserve channel order",&preserveChanPos);
|
ImGui::Checkbox("Preserve channel order",&preserveChanPos);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Checkbox("Clone channel data",&sysDupCloneChannels);
|
||||||
if (ImGui::BeginTable("SystemList",3)) {
|
if (ImGui::BeginTable("SystemList",3)) {
|
||||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed);
|
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed);
|
||||||
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch);
|
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch);
|
||||||
|
@ -84,7 +86,7 @@ void FurnaceGUI::drawSysManager() {
|
||||||
}
|
}
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (ImGui::Button("Clone##SysDup")) {
|
if (ImGui::Button("Clone##SysDup")) {
|
||||||
if (!e->duplicateSystem(i)) {
|
if (!e->duplicateSystem(i,sysDupCloneChannels)) {
|
||||||
showError("cannot clone chip! ("+e->getLastError()+")");
|
showError("cannot clone chip! ("+e->getLastError()+")");
|
||||||
} else {
|
} else {
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
|
|
Loading…
Reference in a new issue