aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-26 22:10:41 -0800
committerChris Robinson <[email protected]>2013-12-26 22:10:41 -0800
commitcc30c5754fa43f21833dc59d212bfb5aa42628de (patch)
treed2199d95643a30483d9b3d91bcdc6575053f61f1 /Alc
parentd5f687b2faddaa9a173b387fe07192be5dfbb6c9 (diff)
Remove the generator list
Diffstat (limited to 'Alc')
-rw-r--r--Alc/midi/base.c60
1 files changed, 11 insertions, 49 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c
index cd6293d2..6449d7fc 100644
--- a/Alc/midi/base.c
+++ b/Alc/midi/base.c
@@ -252,14 +252,6 @@ void ALfontsound_Construct(ALfontsound *self)
self->MinVelocity = 0;
self->MaxVelocity = 127;
- self->Generators = NULL;
- self->NumGenerators = 0;
- self->GeneratorsMax = 0;
-
- self->Modulators = NULL;
- self->NumModulators = 0;
- self->ModulatorsMax = 0;
-
self->Start = 0;
self->End = 0;
self->LoopStart = 0;
@@ -267,59 +259,29 @@ void ALfontsound_Construct(ALfontsound *self)
self->SampleRate = 0;
self->PitchKey = 0;
self->PitchCorrection = 0;
- self->SampleLink = 0;
self->SampleType = AL_NONE;
+ self->Link = NULL;
- self->id = 0;
-}
-
-void ALfontsound_Destruct(ALfontsound *self)
-{
- free(self->Modulators);
self->Modulators = NULL;
self->NumModulators = 0;
self->ModulatorsMax = 0;
- free(self->Generators);
- self->Generators = NULL;
- self->NumGenerators = 0;
- self->GeneratorsMax = 0;
-
- FreeThunkEntry(self->id);
self->id = 0;
}
-ALenum ALfontsound_addGenerator(ALfontsound *self, ALenum generator, ALint value)
+void ALfontsound_Destruct(ALfontsound *self)
{
- ALsizei i;
- for(i = 0;i < self->NumGenerators;i++)
- {
- if(self->Generators[i].Generator == generator)
- {
- self->Generators[i].Value = value;
- return AL_NO_ERROR;
- }
- }
-
- if(self->NumGenerators == self->GeneratorsMax)
- {
- ALsizei newmax = 0;
- ALvoid *temp = NULL;
-
- newmax = (self->GeneratorsMax ? self->GeneratorsMax<<1 : 1);
- if(newmax > self->GeneratorsMax)
- temp = realloc(self->Generators, newmax * sizeof(ALsfgenerator));
- if(!temp) return AL_OUT_OF_MEMORY;
-
- self->Generators = temp;
- self->GeneratorsMax = newmax;
- }
+ FreeThunkEntry(self->id);
+ self->id = 0;
- self->Generators[self->NumGenerators].Generator = generator;
- self->Generators[self->NumGenerators].Value = value;
- self->NumGenerators++;
+ if(self->Link)
+ DecrementRef(&self->Link->ref);
+ self->Link = NULL;
- return AL_NO_ERROR;
+ free(self->Modulators);
+ self->Modulators = NULL;
+ self->NumModulators = 0;
+ self->ModulatorsMax = 0;
}
ALenum ALfontsound_addModulator(ALfontsound *self, ALenum sourceop, ALenum destop, ALint amount, ALenum amtsourceop, ALenum transop)