effectRows -> effectCols
i don't know why did I call it "rows"
This commit is contained in:
parent
9eaf600b4b
commit
3306e853d1
10 changed files with 64 additions and 64 deletions
|
|
@ -140,7 +140,7 @@ void DivEngine::walkSong(int& loopOrder, int& loopRow, int& loopEnd) {
|
|||
for (int j=nextRow; j<song.patLen; j++) {
|
||||
nextRow=0;
|
||||
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)];
|
||||
if (effectVal<0) effectVal=0;
|
||||
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++) {
|
||||
DivChannelData& chan=ds.pat[i];
|
||||
if (ds.version<0x0a) {
|
||||
chan.effectRows=1;
|
||||
chan.effectCols=1;
|
||||
} else {
|
||||
chan.effectRows=reader.readC();
|
||||
chan.effectCols=reader.readC();
|
||||
}
|
||||
logD("%d fx rows: %d",i,chan.effectRows);
|
||||
if (chan.effectRows>4 || chan.effectRows<1) {
|
||||
logE("invalid effect row count %d. are you sure everything is ok?",chan.effectRows);
|
||||
lastError="file is corrupt or unreadable at effect rows";
|
||||
logD("%d fx rows: %d",i,chan.effectCols);
|
||||
if (chan.effectCols>4 || chan.effectCols<1) {
|
||||
logE("invalid effect column count %d. are you sure everything is ok?",chan.effectCols);
|
||||
lastError="file is corrupt or unreadable at effect columns";
|
||||
delete[] file;
|
||||
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;
|
||||
}
|
||||
}
|
||||
for (int l=0; l<chan.effectRows; l++) {
|
||||
for (int l=0; l<chan.effectCols; l++) {
|
||||
// effect
|
||||
pat->data[k][4+(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++) {
|
||||
ds.pat[i].effectRows=reader.readC();
|
||||
if (ds.pat[i].effectRows<1 || ds.pat[i].effectRows>8) {
|
||||
logE("channel %d has zero or 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].effectRows);
|
||||
ds.pat[i].effectCols=reader.readC();
|
||||
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].effectCols);
|
||||
lastError=fmt::sprintf("channel %d has too many effect columns! (%d)",i,ds.pat[i].effectCols);
|
||||
delete[] file;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1565,7 +1565,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
pat->data[j][1]=reader.readS();
|
||||
pat->data[j][2]=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][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;
|
||||
|
|
@ -1977,7 +1977,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
|
|||
ds.chanShortName[i]=fmt::sprintf("C%d",i+1);
|
||||
}
|
||||
for(int i=chCount; i<ds.systemLen*4; i++) {
|
||||
ds.pat[i].effectRows=1;
|
||||
ds.pat[i].effectCols=1;
|
||||
ds.chanShow[i]=false;
|
||||
}
|
||||
|
||||
|
|
@ -2281,7 +2281,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
|||
}
|
||||
|
||||
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++) {
|
||||
|
|
@ -2371,7 +2371,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
|||
w->writeS(pat->data[j][1]); // octave
|
||||
w->writeS(pat->data[j][2]); // instrument
|
||||
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);
|
||||
|
|
@ -2717,7 +2717,7 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
|||
}
|
||||
|
||||
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++) {
|
||||
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][1]); // octave
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,6 @@ SafeReader* DivPattern::compile(int len, int fxRows) {
|
|||
}
|
||||
|
||||
DivChannelData::DivChannelData():
|
||||
effectRows(1) {
|
||||
effectCols(1) {
|
||||
memset(data,0,256*sizeof(void*));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct DivPattern {
|
|||
};
|
||||
|
||||
struct DivChannelData {
|
||||
unsigned char effectRows;
|
||||
unsigned char effectCols;
|
||||
// data goes as follows: data[ROW][TYPE]
|
||||
// TYPE is:
|
||||
// 0: note
|
||||
|
|
|
|||
|
|
@ -910,7 +910,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
int whatRow=afterDelay?chan[i].delayRow:curRow;
|
||||
DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][whatOrder],false);
|
||||
// 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 effectVal=pat->data[whatRow][5+(j<<1)];
|
||||
|
||||
|
|
@ -1019,7 +1019,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
bool calledPorta=false;
|
||||
|
||||
// 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 effectVal=pat->data[whatRow][5+(j<<1)];
|
||||
|
||||
|
|
@ -1338,7 +1338,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
chan[i].noteOnInhibit=false;
|
||||
|
||||
// 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 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]);
|
||||
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) {
|
||||
strcat(pb3,"\x1b[m--");
|
||||
} else {
|
||||
|
|
@ -1449,7 +1449,7 @@ void DivEngine::nextRow() {
|
|||
if (song.oneTickCut) {
|
||||
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) {
|
||||
doPrepareCut=false;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue