Use NEW_OBJ in a few more places

This commit is contained in:
Chris Robinson 2015-10-20 11:20:15 -07:00
parent acb37edc4f
commit d9a77a7edc
3 changed files with 5 additions and 8 deletions

View File

@ -64,13 +64,13 @@ static void DSynth_process(DSynth *self, ALuint SamplesToDo, ALfloatBUFFERSIZE*r
MidiSynth *DSynth_create(ALCdevice *device)
{
DSynth *synth = DSynth_New(sizeof(*synth));
DSynth *synth;
NEW_OBJ(synth, DSynth)(device);
if(!synth)
{
ERR("Failed to allocate DSynth\n");
return NULL;
}
memset(synth, 0, sizeof(*synth));
DSynth_Construct(synth, device);
return STATIC_CAST(MidiSynth, synth);
}

View File

@ -908,14 +908,12 @@ MidiSynth *FSynth_create(ALCdevice *device)
if(!LoadFSynth())
return NULL;
synth = FSynth_New(sizeof(*synth));
NEW_OBJ(synth, FSynth)(device);
if(!synth)
{
ERR("Failed to allocate FSynth\n");
return NULL;
}
memset(synth, 0, sizeof(*synth));
FSynth_Construct(synth, device);
if(FSynth_init(synth, device) == AL_FALSE)
{

View File

@ -129,12 +129,11 @@ MidiSynth *SSynth_create(ALCdevice *device)
return NULL;
}
synth = SSynth_New(sizeof(*synth));
NEW_OBJ(synth, SSynth)(device);
if(!synth)
{
ERR("Failed to allocate SSynth\n");
return NULL;
}
SSynth_Construct(synth, device);
return STATIC_CAST(MidiSynth, synth);
}