diff options
author | Travis Howell | 2002-11-13 04:52:35 +0000 |
---|---|---|
committer | Travis Howell | 2002-11-13 04:52:35 +0000 |
commit | 7886f1fd1cc6b4dd67569e31b9946a6d14fb0a5f (patch) | |
tree | 7ed26f2c25f64f53148e6c927275f4cc90aebcf6 /simon/midi.cpp | |
parent | 40be9c68319018c6e4513e5e2a1d74dd869f2d34 (diff) | |
download | scummvm-rg350-7886f1fd1cc6b4dd67569e31b9946a6d14fb0a5f.tar.gz scummvm-rg350-7886f1fd1cc6b4dd67569e31b9946a6d14fb0a5f.tar.bz2 scummvm-rg350-7886f1fd1cc6b4dd67569e31b9946a6d14fb0a5f.zip |
Change last ugly hack to make it a little better
svn-id: r5526
Diffstat (limited to 'simon/midi.cpp')
-rw-r--r-- | simon/midi.cpp | 78 |
1 files changed, 5 insertions, 73 deletions
diff --git a/simon/midi.cpp b/simon/midi.cpp index 50c4709b8c..4c956cb18b 100644 --- a/simon/midi.cpp +++ b/simon/midi.cpp @@ -90,79 +90,11 @@ void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music) } else { //FIXME We currently don't know how to find out music track size for GMF midi format // So we use music files sizes minues header for now to allow looping - if (music == 0) - t->data_size = 8900; - if (music == 1) - t->data_size = 12166; - if (music == 2) - t->data_size = 2848; - if (music == 3) - t->data_size = 3442; - if (music == 4) - t->data_size = 4034; - if (music == 5) - t->data_size = 4508; - if (music == 6) - t->data_size = 7064; - if (music == 7) - t->data_size = 9730; - if (music == 8) - t->data_size = 6014; - if (music == 9) - t->data_size = 4742; - if (music == 10) - t->data_size = 3138; - if (music == 11) - t->data_size = 6570; - if (music == 12) - t->data_size = 5384; - if (music == 13) - t->data_size = 8909; - if (music == 14) - t->data_size = 6457; - if (music == 15) - t->data_size = 16321; - if (music == 16) - t->data_size = 2742; - if (music == 17) - t->data_size = 8968; - if (music == 18) - t->data_size = 4804; - if (music == 19) - t->data_size = 8442; - if (music == 20) - t->data_size = 7717; - if (music == 21) - t->data_size = 9444; - if (music == 22) - t->data_size = 5800; - if (music == 23) - t->data_size = 1381; - if (music == 24) - t->data_size = 5660; - if (music == 25) - t->data_size = 6684; - if (music == 26) - t->data_size = 2456; - if (music == 27) - t->data_size = 4744; - if (music == 28) - t->data_size = 2455; - if (music == 29) - t->data_size = 1177; - if (music == 30) - t->data_size = 1232; - if (music == 31) - t->data_size = 17256; - if (music == 32) - t->data_size = 5103; - if (music == 33) - t->data_size = 8794; - if (music == 34) - t->data_size = 4884; - if (music == 35) - t->data_size = 16; - t->data_size = t->data_size - 8; + int music_data_size[] = {8900, 12166, 2848, 3442, 4034, 4508, 7064, 9730, 6014, 4742, 3138, + 6570, 5384, 8909, 6457, 16321, 2742, 8968, 4804, 8442, 7717, + 9444, 5800, 1381, 5660, 6684, 2456, 4744, 2455, 1177, 1232, + 17256, 5103, 8794, 4884, 16}; + t->data_size = music_data_size[music] - 8; } t->data_ptr = (byte *)calloc(t->data_size, 1); |