Skip to content

Commit

Permalink
fix IT "empty pattern" loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukunda Johnson committed Apr 30, 2009
1 parent 82af2fc commit b98cdc1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 14 additions & 1 deletion source/it.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,18 @@ int Load_IT_SampleData( Sample* samp, u16 cwmt )
return 0;
}

int Empty_IT_Pattern( Pattern *patt ) {

int x;
memset( patt, 0, sizeof( Pattern ) );
patt->nrows = 64;
for( x = 0; x < patt->nrows*MAX_CHANNELS; x++ ) {
patt->data[x].note = 250; // special clears for vol&note
patt->data[x].vol = 255;
}
return ERR_NONE;
}

int Load_IT_Pattern( Pattern* patt )
{
int x;
Expand Down Expand Up @@ -657,7 +669,8 @@ int Load_IT( MAS_Module* itm, bool verbose )
}
else
{
memset( &itm->patterns[x], 0, sizeof( Pattern ) );
Empty_IT_Pattern( &itm->patterns[x] );
//memset( &itm->patterns[x], 0, sizeof( Pattern ) );
}
}

Expand Down
4 changes: 3 additions & 1 deletion source/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
#include "defs.h"
#include "mas.h"
#include "simple.h"
#include "files.h"
#include "samplefix.h"

// OMG CREDITS TO CODA, LOOK AT THIS AWESOME COED
// cREDITS TO CODA, LOOK AT THIS AWESOME CODES
u32 readbits(u8* buffer, unsigned int pos, unsigned int size) {
u32 result=0;
u32 i;
Expand Down Expand Up @@ -62,6 +63,7 @@ int get_ext( char* filename )
break;
}
//a = tolower( filename[strl-1] ) | (tolower( filename[strl-1] )<<8) | tolower( filename[strl-2]<<16 ) | tolower( filename[strl-3]<<24 );

switch( a )
{
case 'mod':
Expand Down

0 comments on commit b98cdc1

Please sign in to comment.