mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 16:41:09 +00:00
- fixed WildMidi.
This commit is contained in:
parent
4369220335
commit
32e1605e17
3 changed files with 12 additions and 3 deletions
|
@ -75,10 +75,10 @@ unsigned char *_WM_BufferFile(SoundFontReaderInterface *reader, const char *file
|
|||
|
||||
fp->seek(0, SEEK_SET);
|
||||
fp->read(data, fsize);
|
||||
if (fullname)* fullname = fp->filename;
|
||||
fp->close();
|
||||
data[fsize] = 0;
|
||||
*size = (long)fsize;
|
||||
if (fullname) *fullname = fp->filename;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -635,7 +635,7 @@ int Instruments::LoadConfig(const char *config_parm)
|
|||
// This part was rewritten because the original depended on a header that was GPL'd.
|
||||
dir_end = strrchr(config_file, '/');
|
||||
#ifdef _WIN32
|
||||
const char *dir_end2 = strrchr(config_file.c, '\\');
|
||||
const char *dir_end2 = strrchr(config_file, '\\');
|
||||
if (dir_end2 > dir_end) dir_end = dir_end2;
|
||||
#endif
|
||||
|
||||
|
@ -1323,6 +1323,13 @@ void Instruments::load_patch(struct _mdi *mdi, unsigned short patchid)
|
|||
tmp_patch->inuse_count++;
|
||||
}
|
||||
|
||||
Instruments::~Instruments()
|
||||
{
|
||||
FreePatches();
|
||||
delete sfreader;
|
||||
}
|
||||
|
||||
|
||||
static struct _sample *get_sample_data(struct _patch *sample_patch, unsigned long int freq)
|
||||
{
|
||||
struct _sample *last_sample = NULL;
|
||||
|
@ -2517,6 +2524,7 @@ int Renderer::SetOption(int options, int setting)
|
|||
Renderer::Renderer(Instruments *instr, unsigned mixOpt)
|
||||
{
|
||||
init_gauss();
|
||||
instruments = instr;
|
||||
WM_MixerOptions = mixOpt;
|
||||
handle = NewMidi();
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ struct Instruments
|
|||
sfreader = reader;
|
||||
_WM_SampleRate = samplerate;
|
||||
}
|
||||
~Instruments();
|
||||
|
||||
int LoadConfig(const char *config_file);
|
||||
int load_sample(struct _patch *sample_patch);
|
||||
|
|
Loading…
Reference in a new issue