effectRows -> effectCols
i don't know why did I call it "rows"
This commit is contained in:
parent
9eaf600b4b
commit
3306e853d1
|
|
@ -140,7 +140,7 @@ void DivEngine::walkSong(int& loopOrder, int& loopRow, int& loopEnd) {
|
||||||
for (int j=nextRow; j<song.patLen; j++) {
|
for (int j=nextRow; j<song.patLen; j++) {
|
||||||
nextRow=0;
|
nextRow=0;
|
||||||
for (int k=0; k<chans; k++) {
|
for (int k=0; k<chans; k++) {
|
||||||
for (int l=0; l<song.pat[k].effectRows; l++) {
|
for (int l=0; l<song.pat[k].effectCols; l++) {
|
||||||
effectVal=pat[k]->data[j][5+(l<<1)];
|
effectVal=pat[k]->data[j][5+(l<<1)];
|
||||||
if (effectVal<0) effectVal=0;
|
if (effectVal<0) effectVal=0;
|
||||||
if (pat[k]->data[j][4+(l<<1)]==0x0d) {
|
if (pat[k]->data[j][4+(l<<1)]==0x0d) {
|
||||||
|
|
|
||||||
|
|
@ -637,14 +637,14 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
for (int i=0; i<getChannelCount(ds.system[0]); i++) {
|
for (int i=0; i<getChannelCount(ds.system[0]); i++) {
|
||||||
DivChannelData& chan=ds.pat[i];
|
DivChannelData& chan=ds.pat[i];
|
||||||
if (ds.version<0x0a) {
|
if (ds.version<0x0a) {
|
||||||
chan.effectRows=1;
|
chan.effectCols=1;
|
||||||
} else {
|
} else {
|
||||||
chan.effectRows=reader.readC();
|
chan.effectCols=reader.readC();
|
||||||
}
|
}
|
||||||
logD("%d fx rows: %d",i,chan.effectRows);
|
logD("%d fx rows: %d",i,chan.effectCols);
|
||||||
if (chan.effectRows>4 || chan.effectRows<1) {
|
if (chan.effectCols>4 || chan.effectCols<1) {
|
||||||
logE("invalid effect row count %d. are you sure everything is ok?",chan.effectRows);
|
logE("invalid effect column count %d. are you sure everything is ok?",chan.effectCols);
|
||||||
lastError="file is corrupt or unreadable at effect rows";
|
lastError="file is corrupt or unreadable at effect columns";
|
||||||
delete[] file;
|
delete[] file;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -694,7 +694,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
pat->data[k][3]=(pat->data[k][3]&3)*5;
|
pat->data[k][3]=(pat->data[k][3]&3)*5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int l=0; l<chan.effectRows; l++) {
|
for (int l=0; l<chan.effectCols; l++) {
|
||||||
// effect
|
// effect
|
||||||
pat->data[k][4+(l<<1)]=reader.readS();
|
pat->data[k][4+(l<<1)]=reader.readS();
|
||||||
pat->data[k][5+(l<<1)]=reader.readS();
|
pat->data[k][5+(l<<1)]=reader.readS();
|
||||||
|
|
@ -1291,10 +1291,10 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<tchans; i++) {
|
for (int i=0; i<tchans; i++) {
|
||||||
ds.pat[i].effectRows=reader.readC();
|
ds.pat[i].effectCols=reader.readC();
|
||||||
if (ds.pat[i].effectRows<1 || ds.pat[i].effectRows>8) {
|
if (ds.pat[i].effectCols<1 || ds.pat[i].effectCols>8) {
|
||||||
logE("channel %d has zero or too many effect columns! (%d)",i,ds.pat[i].effectRows);
|
logE("channel %d has zero or too many effect columns! (%d)",i,ds.pat[i].effectCols);
|
||||||
lastError=fmt::sprintf("channel %d has too many effect columns! (%d)",i,ds.pat[i].effectRows);
|
lastError=fmt::sprintf("channel %d has too many effect columns! (%d)",i,ds.pat[i].effectCols);
|
||||||
delete[] file;
|
delete[] file;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1565,7 +1565,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
pat->data[j][1]=reader.readS();
|
pat->data[j][1]=reader.readS();
|
||||||
pat->data[j][2]=reader.readS();
|
pat->data[j][2]=reader.readS();
|
||||||
pat->data[j][3]=reader.readS();
|
pat->data[j][3]=reader.readS();
|
||||||
for (int k=0; k<ds.pat[chan].effectRows; k++) {
|
for (int k=0; k<ds.pat[chan].effectCols; k++) {
|
||||||
pat->data[j][4+(k<<1)]=reader.readS();
|
pat->data[j][4+(k<<1)]=reader.readS();
|
||||||
pat->data[j][5+(k<<1)]=reader.readS();
|
pat->data[j][5+(k<<1)]=reader.readS();
|
||||||
}
|
}
|
||||||
|
|
@ -1960,7 +1960,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ds.pat[ch].effectRows=fxCols;
|
ds.pat[ch].effectCols=fxCols;
|
||||||
}
|
}
|
||||||
|
|
||||||
ds.pal=false;
|
ds.pal=false;
|
||||||
|
|
@ -1977,7 +1977,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
|
||||||
ds.chanShortName[i]=fmt::sprintf("C%d",i+1);
|
ds.chanShortName[i]=fmt::sprintf("C%d",i+1);
|
||||||
}
|
}
|
||||||
for(int i=chCount; i<ds.systemLen*4; i++) {
|
for(int i=chCount; i<ds.systemLen*4; i++) {
|
||||||
ds.pat[i].effectRows=1;
|
ds.pat[i].effectCols=1;
|
||||||
ds.chanShow[i]=false;
|
ds.chanShow[i]=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2281,7 +2281,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
w->writeC(song.pat[i].effectRows);
|
w->writeC(song.pat[i].effectCols);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
|
|
@ -2371,7 +2371,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
w->writeS(pat->data[j][1]); // octave
|
w->writeS(pat->data[j][1]); // octave
|
||||||
w->writeS(pat->data[j][2]); // instrument
|
w->writeS(pat->data[j][2]); // instrument
|
||||||
w->writeS(pat->data[j][3]); // volume
|
w->writeS(pat->data[j][3]); // volume
|
||||||
w->write(&pat->data[j][4],2*song.pat[i>>16].effectRows*2); // effects
|
w->write(&pat->data[j][4],2*song.pat[i>>16].effectCols*2); // effects
|
||||||
}
|
}
|
||||||
|
|
||||||
w->writeString(pat->name,false);
|
w->writeString(pat->name,false);
|
||||||
|
|
@ -2717,7 +2717,7 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<getChannelCount(sys); i++) {
|
for (int i=0; i<getChannelCount(sys); i++) {
|
||||||
w->writeC(song.pat[i].effectRows);
|
w->writeC(song.pat[i].effectCols);
|
||||||
|
|
||||||
for (int j=0; j<song.ordersLen; j++) {
|
for (int j=0; j<song.ordersLen; j++) {
|
||||||
DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][j],false);
|
DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][j],false);
|
||||||
|
|
@ -2725,7 +2725,7 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
w->writeS(pat->data[k][0]); // note
|
w->writeS(pat->data[k][0]); // note
|
||||||
w->writeS(pat->data[k][1]); // octave
|
w->writeS(pat->data[k][1]); // octave
|
||||||
w->writeS(pat->data[k][3]); // volume
|
w->writeS(pat->data[k][3]); // volume
|
||||||
w->write(&pat->data[k][4],2*song.pat[i].effectRows*2); // effects
|
w->write(&pat->data[k][4],2*song.pat[i].effectCols*2); // effects
|
||||||
w->writeS(pat->data[k][2]); // instrument
|
w->writeS(pat->data[k][2]); // instrument
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,6 @@ SafeReader* DivPattern::compile(int len, int fxRows) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DivChannelData::DivChannelData():
|
DivChannelData::DivChannelData():
|
||||||
effectRows(1) {
|
effectCols(1) {
|
||||||
memset(data,0,256*sizeof(void*));
|
memset(data,0,256*sizeof(void*));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ struct DivPattern {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DivChannelData {
|
struct DivChannelData {
|
||||||
unsigned char effectRows;
|
unsigned char effectCols;
|
||||||
// data goes as follows: data[ROW][TYPE]
|
// data goes as follows: data[ROW][TYPE]
|
||||||
// TYPE is:
|
// TYPE is:
|
||||||
// 0: note
|
// 0: note
|
||||||
|
|
|
||||||
|
|
@ -910,7 +910,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
int whatRow=afterDelay?chan[i].delayRow:curRow;
|
int whatRow=afterDelay?chan[i].delayRow:curRow;
|
||||||
DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][whatOrder],false);
|
DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][whatOrder],false);
|
||||||
// pre effects
|
// pre effects
|
||||||
if (!afterDelay) for (int j=0; j<song.pat[i].effectRows; j++) {
|
if (!afterDelay) for (int j=0; j<song.pat[i].effectCols; j++) {
|
||||||
short effect=pat->data[whatRow][4+(j<<1)];
|
short effect=pat->data[whatRow][4+(j<<1)];
|
||||||
short effectVal=pat->data[whatRow][5+(j<<1)];
|
short effectVal=pat->data[whatRow][5+(j<<1)];
|
||||||
|
|
||||||
|
|
@ -1019,7 +1019,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
bool calledPorta=false;
|
bool calledPorta=false;
|
||||||
|
|
||||||
// effects
|
// effects
|
||||||
for (int j=0; j<song.pat[i].effectRows; j++) {
|
for (int j=0; j<song.pat[i].effectCols; j++) {
|
||||||
short effect=pat->data[whatRow][4+(j<<1)];
|
short effect=pat->data[whatRow][4+(j<<1)];
|
||||||
short effectVal=pat->data[whatRow][5+(j<<1)];
|
short effectVal=pat->data[whatRow][5+(j<<1)];
|
||||||
|
|
||||||
|
|
@ -1338,7 +1338,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
chan[i].noteOnInhibit=false;
|
chan[i].noteOnInhibit=false;
|
||||||
|
|
||||||
// post effects
|
// post effects
|
||||||
for (int j=0; j<song.pat[i].effectRows; j++) {
|
for (int j=0; j<song.pat[i].effectCols; j++) {
|
||||||
short effect=pat->data[whatRow][4+(j<<1)];
|
short effect=pat->data[whatRow][4+(j<<1)];
|
||||||
short effectVal=pat->data[whatRow][5+(j<<1)];
|
short effectVal=pat->data[whatRow][5+(j<<1)];
|
||||||
|
|
||||||
|
|
@ -1375,7 +1375,7 @@ void DivEngine::nextRow() {
|
||||||
snprintf(pb2,4095,"\x1b[0;36m%.2x",pat->data[curRow][2]);
|
snprintf(pb2,4095,"\x1b[0;36m%.2x",pat->data[curRow][2]);
|
||||||
strcat(pb3,pb2);
|
strcat(pb3,pb2);
|
||||||
}
|
}
|
||||||
for (int j=0; j<song.pat[i].effectRows; j++) {
|
for (int j=0; j<song.pat[i].effectCols; j++) {
|
||||||
if (pat->data[curRow][4+(j<<1)]==-1) {
|
if (pat->data[curRow][4+(j<<1)]==-1) {
|
||||||
strcat(pb3,"\x1b[m--");
|
strcat(pb3,"\x1b[m--");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1449,7 +1449,7 @@ void DivEngine::nextRow() {
|
||||||
if (song.oneTickCut) {
|
if (song.oneTickCut) {
|
||||||
bool doPrepareCut=true;
|
bool doPrepareCut=true;
|
||||||
|
|
||||||
for (int j=0; j<song.pat[i].effectRows; j++) {
|
for (int j=0; j<song.pat[i].effectCols; j++) {
|
||||||
if (pat->data[curRow][4+(j<<1)]==0x03) {
|
if (pat->data[curRow][4+(j<<1)]==0x03) {
|
||||||
doPrepareCut=false;
|
doPrepareCut=false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ void FurnaceGUI::finishSelection() {
|
||||||
selStart.xFine=0;
|
selStart.xFine=0;
|
||||||
}
|
}
|
||||||
if (e->song.chanCollapse[selEnd.xCoarse]) {
|
if (e->song.chanCollapse[selEnd.xCoarse]) {
|
||||||
selEnd.xFine=2+e->song.pat[cursor.xCoarse].effectRows*2;
|
selEnd.xFine=2+e->song.pat[cursor.xCoarse].effectCols*2;
|
||||||
}
|
}
|
||||||
|
|
||||||
e->setMidiBaseChan(cursor.xCoarse);
|
e->setMidiBaseChan(cursor.xCoarse);
|
||||||
|
|
@ -105,7 +105,7 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) {
|
||||||
demandScrollX=true;
|
demandScrollX=true;
|
||||||
if (x>0) {
|
if (x>0) {
|
||||||
for (int i=0; i<x; i++) {
|
for (int i=0; i<x; i++) {
|
||||||
if (++cursor.xFine>=(e->song.chanCollapse[cursor.xCoarse]?1:(3+e->song.pat[cursor.xCoarse].effectRows*2))) {
|
if (++cursor.xFine>=(e->song.chanCollapse[cursor.xCoarse]?1:(3+e->song.pat[cursor.xCoarse].effectCols*2))) {
|
||||||
cursor.xFine=0;
|
cursor.xFine=0;
|
||||||
if (++cursor.xCoarse>=lastChannel) {
|
if (++cursor.xCoarse>=lastChannel) {
|
||||||
if (settings.wrapHorizontal!=0 && !select) {
|
if (settings.wrapHorizontal!=0 && !select) {
|
||||||
|
|
@ -113,7 +113,7 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) {
|
||||||
if (settings.wrapHorizontal==2) y++;
|
if (settings.wrapHorizontal==2) y++;
|
||||||
} else {
|
} else {
|
||||||
cursor.xCoarse=lastChannel-1;
|
cursor.xCoarse=lastChannel-1;
|
||||||
cursor.xFine=e->song.chanCollapse[cursor.xCoarse]?0:(2+e->song.pat[cursor.xCoarse].effectRows*2);
|
cursor.xFine=e->song.chanCollapse[cursor.xCoarse]?0:(2+e->song.pat[cursor.xCoarse].effectCols*2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (!e->song.chanShow[cursor.xCoarse]) {
|
while (!e->song.chanShow[cursor.xCoarse]) {
|
||||||
|
|
@ -129,7 +129,7 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) {
|
||||||
if (--cursor.xCoarse<firstChannel) {
|
if (--cursor.xCoarse<firstChannel) {
|
||||||
if (settings.wrapHorizontal!=0 && !select) {
|
if (settings.wrapHorizontal!=0 && !select) {
|
||||||
cursor.xCoarse=lastChannel-1;
|
cursor.xCoarse=lastChannel-1;
|
||||||
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectRows*2;
|
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectCols*2;
|
||||||
if (settings.wrapHorizontal==2) y--;
|
if (settings.wrapHorizontal==2) y--;
|
||||||
} else {
|
} else {
|
||||||
cursor.xCoarse=firstChannel;
|
cursor.xCoarse=firstChannel;
|
||||||
|
|
@ -143,7 +143,7 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) {
|
||||||
if (e->song.chanCollapse[cursor.xCoarse]) {
|
if (e->song.chanCollapse[cursor.xCoarse]) {
|
||||||
cursor.xFine=0;
|
cursor.xFine=0;
|
||||||
} else {
|
} else {
|
||||||
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectRows*2;
|
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectCols*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -271,7 +271,7 @@ void FurnaceGUI::moveCursorBottom(bool select) {
|
||||||
DETERMINE_LAST;
|
DETERMINE_LAST;
|
||||||
cursor.xCoarse=lastChannel-1;
|
cursor.xCoarse=lastChannel-1;
|
||||||
if (cursor.xCoarse<0) cursor.xCoarse=0;
|
if (cursor.xCoarse<0) cursor.xCoarse=0;
|
||||||
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectRows*2;
|
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectCols*2;
|
||||||
demandScrollX=true;
|
demandScrollX=true;
|
||||||
} else {
|
} else {
|
||||||
cursor.y=e->song.patLen-1;
|
cursor.y=e->song.patLen-1;
|
||||||
|
|
|
||||||
|
|
@ -462,13 +462,13 @@ void FurnaceGUI::doAction(int what) {
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_PAT_INCREASE_COLUMNS:
|
case GUI_ACTION_PAT_INCREASE_COLUMNS:
|
||||||
if (cursor.xCoarse<0 || cursor.xCoarse>=e->getTotalChannelCount()) break;
|
if (cursor.xCoarse<0 || cursor.xCoarse>=e->getTotalChannelCount()) break;
|
||||||
e->song.pat[cursor.xCoarse].effectRows++;
|
e->song.pat[cursor.xCoarse].effectCols++;
|
||||||
if (e->song.pat[cursor.xCoarse].effectRows>8) e->song.pat[cursor.xCoarse].effectRows=8;
|
if (e->song.pat[cursor.xCoarse].effectCols>8) e->song.pat[cursor.xCoarse].effectCols=8;
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_PAT_DECREASE_COLUMNS:
|
case GUI_ACTION_PAT_DECREASE_COLUMNS:
|
||||||
if (cursor.xCoarse<0 || cursor.xCoarse>=e->getTotalChannelCount()) break;
|
if (cursor.xCoarse<0 || cursor.xCoarse>=e->getTotalChannelCount()) break;
|
||||||
e->song.pat[cursor.xCoarse].effectRows--;
|
e->song.pat[cursor.xCoarse].effectCols--;
|
||||||
if (e->song.pat[cursor.xCoarse].effectRows<1) e->song.pat[cursor.xCoarse].effectRows=1;
|
if (e->song.pat[cursor.xCoarse].effectCols<1) e->song.pat[cursor.xCoarse].effectCols=1;
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_PAT_INTERPOLATE:
|
case GUI_ACTION_PAT_INTERPOLATE:
|
||||||
doInterpolate();
|
doInterpolate();
|
||||||
|
|
|
||||||
|
|
@ -137,12 +137,12 @@ void FurnaceGUI::makeUndo(ActionType action) {
|
||||||
void FurnaceGUI::doSelectAll() {
|
void FurnaceGUI::doSelectAll() {
|
||||||
finishSelection();
|
finishSelection();
|
||||||
curNibble=false;
|
curNibble=false;
|
||||||
if (selStart.xFine==0 && selEnd.xFine==2+e->song.pat[selEnd.xCoarse].effectRows*2) {
|
if (selStart.xFine==0 && selEnd.xFine==2+e->song.pat[selEnd.xCoarse].effectCols*2) {
|
||||||
if (selStart.y==0 && selEnd.y==e->song.patLen-1) { // select entire pattern
|
if (selStart.y==0 && selEnd.y==e->song.patLen-1) { // select entire pattern
|
||||||
selStart.xCoarse=0;
|
selStart.xCoarse=0;
|
||||||
selStart.xFine=0;
|
selStart.xFine=0;
|
||||||
selEnd.xCoarse=e->getTotalChannelCount()-1;
|
selEnd.xCoarse=e->getTotalChannelCount()-1;
|
||||||
selEnd.xFine=2+e->song.pat[selEnd.xCoarse].effectRows*2;
|
selEnd.xFine=2+e->song.pat[selEnd.xCoarse].effectCols*2;
|
||||||
} else { // select entire column
|
} else { // select entire column
|
||||||
selStart.y=0;
|
selStart.y=0;
|
||||||
selEnd.y=e->song.patLen-1;
|
selEnd.y=e->song.patLen-1;
|
||||||
|
|
@ -153,14 +153,14 @@ void FurnaceGUI::doSelectAll() {
|
||||||
// find row position
|
// find row position
|
||||||
for (SelectionPoint i; i.xCoarse!=selStart.xCoarse || i.xFine!=selStart.xFine; selStartX++) {
|
for (SelectionPoint i; i.xCoarse!=selStart.xCoarse || i.xFine!=selStart.xFine; selStartX++) {
|
||||||
i.xFine++;
|
i.xFine++;
|
||||||
if (i.xFine>=3+e->song.pat[i.xCoarse].effectRows*2) {
|
if (i.xFine>=3+e->song.pat[i.xCoarse].effectCols*2) {
|
||||||
i.xFine=0;
|
i.xFine=0;
|
||||||
i.xCoarse++;
|
i.xCoarse++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (SelectionPoint i; i.xCoarse!=selEnd.xCoarse || i.xFine!=selEnd.xFine; selEndX++) {
|
for (SelectionPoint i; i.xCoarse!=selEnd.xCoarse || i.xFine!=selEnd.xFine; selEndX++) {
|
||||||
i.xFine++;
|
i.xFine++;
|
||||||
if (i.xFine>=3+e->song.pat[i.xCoarse].effectRows*2) {
|
if (i.xFine>=3+e->song.pat[i.xCoarse].effectCols*2) {
|
||||||
i.xFine=0;
|
i.xFine=0;
|
||||||
i.xCoarse++;
|
i.xCoarse++;
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +172,7 @@ void FurnaceGUI::doSelectAll() {
|
||||||
selEnd.y=e->song.patLen-1;
|
selEnd.y=e->song.patLen-1;
|
||||||
} else { // left-right
|
} else { // left-right
|
||||||
selStart.xFine=0;
|
selStart.xFine=0;
|
||||||
selEnd.xFine=2+e->song.pat[selEnd.xCoarse].effectRows*2;
|
selEnd.xFine=2+e->song.pat[selEnd.xCoarse].effectCols*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +200,7 @@ void FurnaceGUI::doDelete() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskDelete,iFine);
|
maskOut(opMaskDelete,iFine);
|
||||||
for (int j=selStart.y; j<=selEnd.y; j++) {
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
|
|
@ -237,7 +237,7 @@ void FurnaceGUI::doPullDelete() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskPullDelete,iFine);
|
maskOut(opMaskPullDelete,iFine);
|
||||||
for (int j=selStart.y; j<e->song.patLen; j++) {
|
for (int j=selStart.y; j<e->song.patLen; j++) {
|
||||||
if (j<e->song.patLen-1) {
|
if (j<e->song.patLen-1) {
|
||||||
|
|
@ -269,7 +269,7 @@ void FurnaceGUI::doInsert() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskInsert,iFine);
|
maskOut(opMaskInsert,iFine);
|
||||||
for (int j=e->song.patLen-1; j>=selStart.y; j--) {
|
for (int j=e->song.patLen-1; j>=selStart.y; j--) {
|
||||||
if (j==selStart.y) {
|
if (j==selStart.y) {
|
||||||
|
|
@ -301,7 +301,7 @@ void FurnaceGUI::doTranspose(int amount, OperationMask& mask) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(mask,iFine);
|
maskOut(mask,iFine);
|
||||||
for (int j=selStart.y; j<=selEnd.y; j++) {
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
|
|
@ -369,7 +369,7 @@ void FurnaceGUI::doCopy(bool cut) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
clipboard+=noteNameNormal(pat->data[j][0],pat->data[j][1]);
|
clipboard+=noteNameNormal(pat->data[j][0],pat->data[j][1]);
|
||||||
if (cut) {
|
if (cut) {
|
||||||
|
|
@ -530,7 +530,7 @@ void FurnaceGUI::doPaste(PasteMode mode) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mode!=GUI_PASTE_MODE_MIX_BG || pat->data[j][iFine+1]==-1) {
|
if (mode!=GUI_PASTE_MODE_MIX_BG || pat->data[j][iFine+1]==-1) {
|
||||||
if (iFine<(3+e->song.pat[iCoarse].effectRows*2)) pat->data[j][iFine+1]=val;
|
if (iFine<(3+e->song.pat[iCoarse].effectCols*2)) pat->data[j][iFine+1]=val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -589,7 +589,7 @@ void FurnaceGUI::doInterpolate() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskInterpolate,iFine);
|
maskOut(opMaskInterpolate,iFine);
|
||||||
points.clear();
|
points.clear();
|
||||||
if (iFine!=0) {
|
if (iFine!=0) {
|
||||||
|
|
@ -648,7 +648,7 @@ void FurnaceGUI::doFade(int p0, int p1, bool mode) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskFade,iFine);
|
maskOut(opMaskFade,iFine);
|
||||||
if (iFine!=0) {
|
if (iFine!=0) {
|
||||||
int absoluteTop=255;
|
int absoluteTop=255;
|
||||||
|
|
@ -686,7 +686,7 @@ void FurnaceGUI::doInvertValues() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskInvertVal,iFine);
|
maskOut(opMaskInvertVal,iFine);
|
||||||
if (iFine!=0) {
|
if (iFine!=0) {
|
||||||
int top=255;
|
int top=255;
|
||||||
|
|
@ -717,7 +717,7 @@ void FurnaceGUI::doScale(float top) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskScale,iFine);
|
maskOut(opMaskScale,iFine);
|
||||||
if (iFine!=0) {
|
if (iFine!=0) {
|
||||||
int absoluteTop=255;
|
int absoluteTop=255;
|
||||||
|
|
@ -748,7 +748,7 @@ void FurnaceGUI::doRandomize(int bottom, int top, bool mode) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskRandomize,iFine);
|
maskOut(opMaskRandomize,iFine);
|
||||||
if (iFine!=0) {
|
if (iFine!=0) {
|
||||||
int absoluteTop=255;
|
int absoluteTop=255;
|
||||||
|
|
@ -794,7 +794,7 @@ void FurnaceGUI::doFlip() {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskFlip,iFine);
|
maskOut(opMaskFlip,iFine);
|
||||||
for (int j=selStart.y; j<=selEnd.y; j++) {
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
|
|
@ -825,7 +825,7 @@ void FurnaceGUI::doCollapse(int divider) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskCollapseExpand,iFine);
|
maskOut(opMaskCollapseExpand,iFine);
|
||||||
for (int j=selStart.y; j<=selEnd.y; j++) {
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
|
|
@ -882,7 +882,7 @@ void FurnaceGUI::doExpand(int multiplier) {
|
||||||
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
if (!e->song.chanShow[iCoarse]) continue;
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true);
|
||||||
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
for (; iFine<3+e->song.pat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
maskOut(opMaskCollapseExpand,iFine);
|
maskOut(opMaskCollapseExpand,iFine);
|
||||||
for (int j=selStart.y; j<=selEnd.y; j++) {
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
if (iFine==0) {
|
if (iFine==0) {
|
||||||
|
|
|
||||||
|
|
@ -1003,7 +1003,7 @@ void FurnaceGUI::valueInput(int num, bool direct, int target) {
|
||||||
editAdvance();
|
editAdvance();
|
||||||
} else {
|
} else {
|
||||||
if (settings.effectCursorDir==2) {
|
if (settings.effectCursorDir==2) {
|
||||||
if (++cursor.xFine>=(3+(e->song.pat[cursor.xCoarse].effectRows*2))) {
|
if (++cursor.xFine>=(3+(e->song.pat[cursor.xCoarse].effectCols*2))) {
|
||||||
cursor.xFine=3;
|
cursor.xFine=3;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
// effects
|
// effects
|
||||||
for (int k=0; k<e->song.pat[j].effectRows; k++) {
|
for (int k=0; k<e->song.pat[j].effectCols; k++) {
|
||||||
int index=4+(k<<1);
|
int index=4+(k<<1);
|
||||||
bool selectedEffect=selectedRow && (j32+index-1>=sel1XSum && j32+index-1<=sel2XSum);
|
bool selectedEffect=selectedRow && (j32+index-1>=sel1XSum && j32+index-1<=sel2XSum);
|
||||||
bool selectedEffectVal=selectedRow && (j32+index>=sel1XSum && j32+index<=sel2XSum);
|
bool selectedEffectVal=selectedRow && (j32+index>=sel1XSum && j32+index<=sel2XSum);
|
||||||
|
|
@ -427,7 +427,7 @@ void FurnaceGUI::drawPattern() {
|
||||||
displayTooltip=true;
|
displayTooltip=true;
|
||||||
} else {
|
} else {
|
||||||
const char* chName=e->getChannelName(i);
|
const char* chName=e->getChannelName(i);
|
||||||
size_t chNameLimit=6+4*e->song.pat[i].effectRows;
|
size_t chNameLimit=6+4*e->song.pat[i].effectCols;
|
||||||
if (strlen(chName)>chNameLimit) {
|
if (strlen(chName)>chNameLimit) {
|
||||||
String shortChName=chName;
|
String shortChName=chName;
|
||||||
shortChName.resize(chNameLimit-3);
|
shortChName.resize(chNameLimit-3);
|
||||||
|
|
@ -524,18 +524,18 @@ void FurnaceGUI::drawPattern() {
|
||||||
if (!e->song.chanCollapse[i]) {
|
if (!e->song.chanCollapse[i]) {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
snprintf(chanID,2048,"<##_LCH%d",i);
|
snprintf(chanID,2048,"<##_LCH%d",i);
|
||||||
ImGui::BeginDisabled(e->song.pat[i].effectRows<=1);
|
ImGui::BeginDisabled(e->song.pat[i].effectCols<=1);
|
||||||
if (ImGui::SmallButton(chanID)) {
|
if (ImGui::SmallButton(chanID)) {
|
||||||
e->song.pat[i].effectRows--;
|
e->song.pat[i].effectCols--;
|
||||||
if (e->song.pat[i].effectRows<1) e->song.pat[i].effectRows=1;
|
if (e->song.pat[i].effectCols<1) e->song.pat[i].effectCols=1;
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::BeginDisabled(e->song.pat[i].effectRows>=8);
|
ImGui::BeginDisabled(e->song.pat[i].effectCols>=8);
|
||||||
snprintf(chanID,2048,">##_RCH%d",i);
|
snprintf(chanID,2048,">##_RCH%d",i);
|
||||||
if (ImGui::SmallButton(chanID)) {
|
if (ImGui::SmallButton(chanID)) {
|
||||||
e->song.pat[i].effectRows++;
|
e->song.pat[i].effectCols++;
|
||||||
if (e->song.pat[i].effectRows>8) e->song.pat[i].effectRows=8;
|
if (e->song.pat[i].effectCols>8) e->song.pat[i].effectCols=8;
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue