aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-15 08:38:25 -0800
committerChris Robinson <[email protected]>2018-01-15 08:38:25 -0800
commit44795b8614564ea65ae864419dedaa610742350c (patch)
tree28c46736fe024730817ae375e15866c0314b1317
parent5acb2e5165abcfdc61bc8d4702425923343c07df (diff)
Assign the HRTF storage pointers separately
-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;