Skip to content

Commit e1816a2

Browse files
committed
math: Remove normalize() functions; they aren't used anymore.
1 parent 04f317b commit e1816a2

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

mojoal.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,19 +1761,6 @@ static ALfloat magnitude(const ALfloat *v)
17611761
/* technically, the inital part on this is just a dot product of itself. */
17621762
return SDL_sqrtf((v[0] * v[0]) + (v[1] * v[1]) + (v[2] * v[2]));
17631763
}
1764-
1765-
/* https://www.khanacademy.org/computing/computer-programming/programming-natural-simulations/programming-vectors/a/vector-magnitude-normalization */
1766-
static void normalize(ALfloat *v)
1767-
{
1768-
const ALfloat mag = magnitude(v);
1769-
if (mag == 0.0f) {
1770-
v[0] = v[1] = v[2] = 0.0f;
1771-
} else {
1772-
v[0] /= mag;
1773-
v[1] /= mag;
1774-
v[2] /= mag;
1775-
}
1776-
}
17771764
#endif
17781765

17791766
#if defined(SDL_SSE_INTRINSICS)
@@ -1801,15 +1788,6 @@ static ALfloat SDL_TARGETING("sse") magnitude_sse(const __m128 v)
18011788
{
18021789
return SDL_sqrtf(dotproduct_sse(v, v));
18031790
}
1804-
1805-
static __m128 SDL_TARGETING("sse") normalize_sse(const __m128 v)
1806-
{
1807-
const ALfloat mag = magnitude_sse(v);
1808-
if (mag == 0.0f) {
1809-
return _mm_setzero_ps();
1810-
}
1811-
return _mm_div_ps(v, _mm_set_ps1(mag));
1812-
}
18131791
#endif
18141792

18151793
#if defined(SDL_NEON_INTRINSICS)
@@ -1835,15 +1813,6 @@ static ALfloat SDL_TARGETING("neon") magnitude_neon(const float32x4_t v)
18351813
{
18361814
return SDL_sqrtf(dotproduct_neon(v, v));
18371815
}
1838-
1839-
static float32x4_t SDL_TARGETING("neon") normalize_neon(const float32x4_t v)
1840-
{
1841-
const ALfloat mag = magnitude_neon(v);
1842-
if (mag == 0.0f) {
1843-
return vdupq_n_f32(0.0f);
1844-
}
1845-
return vmulq_f32(v, vdupq_n_f32(1.0f / mag));
1846-
}
18471816
#endif
18481817

18491818

0 commit comments

Comments
 (0)