aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 310dc68c..d1cfe6b0 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -343,20 +343,22 @@ static struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize,
Hrtf->evCount = evCount;
/* Set up pointers to storage following the main HRTF struct. */
- _azCount = (ALubyte*)(base + offset); Hrtf->azCount = _azCount;
+ _azCount = (ALubyte*)(base + offset);
offset += sizeof(_azCount[0])*evCount;
offset = RoundUp(offset, sizeof(ALushort)); /* Align for ushort fields */
- _evOffset = (ALushort*)(base + offset); Hrtf->evOffset = _evOffset;
+ _evOffset = (ALushort*)(base + offset);
offset += sizeof(_evOffset[0])*evCount;
offset = RoundUp(offset, 16); /* Align for coefficients using SIMD */
- _coeffs = (ALfloat(*)[2])(base + offset); Hrtf->coeffs = _coeffs;
+ _coeffs = (ALfloat(*)[2])(base + offset);
offset += sizeof(_coeffs[0])*irSize*irCount;
- _delays = (ALubyte(*)[2])(base + offset); Hrtf->delays = _delays;
+ _delays = (ALubyte(*)[2])(base + offset);
offset += sizeof(_delays[0])*irCount;
+ assert(offset == total);
+
/* Copy input data to storage. */
for(i = 0;i < evCount;i++) _azCount[i] = azCount[i];
for(i = 0;i < evCount;i++) _evOffset[i] = evOffset[i];
@@ -371,7 +373,11 @@ static struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize,
_delays[i][1] = delays[i][1];
}
- assert(offset == total);
+ /* Finally, assign the storage pointers. */
+ Hrtf->azCount = _azCount;
+ Hrtf->evOffset = _evOffset;
+ Hrtf->coeffs = _coeffs;
+ Hrtf->delays = _delays;
}
return Hrtf;