mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-31 20:11:29 +00:00
fix deep clone not working at times
This commit is contained in:
parent
18c5867d9c
commit
8e17f20de2
1 changed files with 6 additions and 1 deletions
|
@ -1829,19 +1829,24 @@ void DivEngine::deepCloneOrder(bool where) {
|
||||||
warnings="";
|
warnings="";
|
||||||
isBusy.lock();
|
isBusy.lock();
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
|
bool didNotFind=true;
|
||||||
|
logD("channel %d\n",i);
|
||||||
order[i]=song.orders.ord[i][curOrder];
|
order[i]=song.orders.ord[i][curOrder];
|
||||||
// find free slot
|
// find free slot
|
||||||
for (int j=0; j<128; j++) {
|
for (int j=0; j<128; j++) {
|
||||||
|
logD("finding free slot in %d...\n",j);
|
||||||
if (song.pat[i].data[j]==NULL) {
|
if (song.pat[i].data[j]==NULL) {
|
||||||
int origOrd=order[i];
|
int origOrd=order[i];
|
||||||
order[i]=j;
|
order[i]=j;
|
||||||
DivPattern* oldPat=song.pat[i].getPattern(origOrd,false);
|
DivPattern* oldPat=song.pat[i].getPattern(origOrd,false);
|
||||||
DivPattern* pat=song.pat[i].getPattern(j,true);
|
DivPattern* pat=song.pat[i].getPattern(j,true);
|
||||||
memcpy(pat->data,oldPat->data,256*32*sizeof(short));
|
memcpy(pat->data,oldPat->data,256*32*sizeof(short));
|
||||||
|
logD("found at %d\n",j);
|
||||||
|
didNotFind=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (order[i]==song.orders.ord[i][curOrder]) {
|
if (didNotFind) {
|
||||||
addWarning(fmt::sprintf("no free patterns in channel %d!",i));
|
addWarning(fmt::sprintf("no free patterns in channel %d!",i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue