mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
allow loading 1.0 .dmw
This commit is contained in:
parent
8f03964fbb
commit
fd00b1a815
1 changed files with 9 additions and 1 deletions
|
@ -1632,7 +1632,15 @@ bool DivEngine::addWaveFromFile(const char* path) {
|
|||
reader.seek(0,SEEK_SET);
|
||||
int len=reader.readI();
|
||||
wave->max=(unsigned char)reader.readC();
|
||||
if (reader.size()==(size_t)(len+5)) {
|
||||
if (wave->max==255) { // new wavetable format
|
||||
unsigned char waveVersion=reader.readC();
|
||||
logI("reading modern .dmw...\n");
|
||||
logD("wave version %d\n",waveVersion);
|
||||
wave->max=reader.readC();
|
||||
for (int i=0; i<len; i++) {
|
||||
wave->data[i]=reader.readI();
|
||||
}
|
||||
} else if (reader.size()==(size_t)(len+5)) {
|
||||
// read as .dmw
|
||||
logI("reading .dmw...\n");
|
||||
if (len>256) len=256;
|
||||
|
|
Loading…
Reference in a new issue