code cleanups

This commit is contained in:
zicodxx 2006-05-05 14:14:55 +00:00
parent 5f7dab24d2
commit 6a9c15ac25
2 changed files with 7 additions and 12 deletions

View file

@ -297,7 +297,7 @@ static void reset_tracks(struct hmp_file *hmp)
hmp->cur_time=0; hmp->cur_time=0;
} }
extern int non_loop; extern int loop;
static void _stdcall midi_callback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { static void _stdcall midi_callback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) {
MIDIHDR *mhdr; MIDIHDR *mhdr;
@ -316,12 +316,11 @@ static void _stdcall midi_callback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD
if (!hmp->stop) { if (!hmp->stop) {
while (fill_buffer(hmp) == HMP_EOF) { while (fill_buffer(hmp) == HMP_EOF) {
if (non_loop) if (loop)
{
hmp->stop = 1; // ZICO - FIXME
} else {
hmp->stop = 0; hmp->stop = 0;
} else
hmp->stop = 1;
reset_tracks(hmp); reset_tracks(hmp);
} }
if ((rc = midiStreamOut(hmp->hmidi, hmp->evbuf, if ((rc = midiStreamOut(hmp->hmidi, hmp->evbuf,

View file

@ -107,17 +107,13 @@ void songs_init()
#endif #endif
} }
int non_loop; int loop;
void songs_play_song( int songnum, int repeat ) void songs_play_song( int songnum, int repeat )
{ {
if ( !Songs_initialized ) songs_init(); if ( !Songs_initialized ) songs_init();
if (!repeat) { loop=repeat;
non_loop = 1;
} else {
non_loop = 0;
}
digi_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, repeat ); digi_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, repeat );
} }