deprecate step_uni in favour of steps

This seems to be the newer naming system
This commit is contained in:
Marcin
2025-01-18 19:15:07 +00:00
parent 4ca0c536af
commit 6c0e3e9460
8 changed files with 38 additions and 81 deletions

View File

@@ -232,9 +232,12 @@ glmc_vec3_mixc(vec3 from, vec3 to, float t, vec3 dest) {
glmc_vec3_lerpc(from, to, t, dest);
}
CGLM_EXPORT
/* DEPRECATED */
CGLM_INLINE
void
glmc_vec3_step_uni(float edge, vec3 x, vec3 dest);
glmc_vec3_step_uni(float edge, vec3 x, vec3 dest) {
glmc_vec3_steps(edge, x, dest);
}
CGLM_EXPORT
void

View File

@@ -205,9 +205,12 @@ glmc_vec4_mixc(vec4 from, vec4 to, float t, vec4 dest) {
glmc_vec4_lerpc(from, to, t, dest);
}
CGLM_EXPORT
/* DEPRECATED */
CGLM_INLINE
void
glmc_vec4_step_uni(float edge, vec4 x, vec4 dest);
glmc_vec4_step_uni(float edge, vec4 x, vec4 dest) {
glmc_vec4_steps(edge, x, dest);
}
CGLM_EXPORT
void

View File

@@ -68,7 +68,6 @@
CGLM_INLINE vec3s glms_vec3_lerpc(vec3s from, vec3s to, float t);
CGLM_INLINE vec3s glms_vec3_mix(vec3s from, vec3s to, float t);
CGLM_INLINE vec3s glms_vec3_mixc(vec3s from, vec3s to, float t);
CGLM_INLINE vec3s glms_vec3_step_uni(float edge, vec3s x);
CGLM_INLINE vec3s glms_vec3_step(vec3s edge, vec3s x);
CGLM_INLINE vec3s glms_vec3_smoothstep_uni(float edge0, float edge1, vec3s x);
CGLM_INLINE vec3s glms_vec3_smoothstep(vec3s edge0, vec3s edge1, vec3s x);
@@ -84,6 +83,9 @@
CGLM_INLINE vec3s glms_cross(vec3s a, vec3s b);
CGLM_INLINE float glms_dot(vec3s a, vec3s b);
CGLM_INLINE vec3s glms_normalize(vec3s v);
Deprecated:
glms_vec3_step_uni --> use glms_vec3_steps
*/
#ifndef cglms_vec3s_h
@@ -95,6 +97,9 @@
#include "../vec3.h"
#include "vec3-ext.h"
/* DEPRECATED! */
#define glms_vec3_step_uni(edge, x) glms_vec3_steps(edge, x)
#define GLMS_VEC3_ONE_INIT {GLM_VEC3_ONE_INIT}
#define GLMS_VEC3_ZERO_INIT {GLM_VEC3_ZERO_INIT}
@@ -910,21 +915,6 @@ glms_vec3_(mixc)(vec3s from, vec3s to, float t) {
return r;
}
/*!
* @brief threshold function (unidimensional)
*
* @param[in] edge threshold
* @param[in] x value to test against threshold
* @returns 0.0 if x < edge, else 1.0
*/
CGLM_INLINE
vec3s
glms_vec3_(step_uni)(float edge, vec3s x) {
vec3s r;
glm_vec3_step_uni(edge, x.raw, r.raw);
return r;
}
/*!
* @brief threshold function
*

View File

@@ -58,7 +58,6 @@
CGLM_INLINE vec4s glms_vec4_lerpc(vec4s from, vec4s to, float t);
CGLM_INLINE vec4s glms_vec4_mix(vec4s from, vec4s to, float t);
CGLM_INLINE vec4s glms_vec4_mixc(vec4s from, vec4s to, float t);
CGLM_INLINE vec4s glms_vec4_step_uni(float edge, vec4s x);
CGLM_INLINE vec4s glms_vec4_step(vec4s edge, vec4s x);
CGLM_INLINE vec4s glms_vec4_smoothstep_uni(float edge0, float edge1, vec4s x);
CGLM_INLINE vec4s glms_vec4_smoothstep(vec4s edge0, vec4s edge1, vec4s x);
@@ -69,6 +68,9 @@
CGLM_INLINE vec4s glms_vec4_make(float * restrict src);
CGLM_INLINE vec4s glms_vec4_reflect(vec4s v, vec4s n);
CGLM_INLINE bool glms_vec4_refract(vec4s v, vec4s n, float eta, vec4s *dest)
Deprecated:
glms_vec4_step_uni --> use glms_vec4_steps
*/
#ifndef cglms_vec4s_h
@@ -80,6 +82,9 @@
#include "../vec4.h"
#include "vec4-ext.h"
/* DEPRECATED! */
#define glms_vec4_step_uni(edge, x) glms_vec4_steps(edge, x)
#define GLMS_VEC4_ONE_INIT {GLM_VEC4_ONE_INIT}
#define GLMS_VEC4_BLACK_INIT {GLM_VEC4_BLACK_INIT}
#define GLMS_VEC4_ZERO_INIT {GLM_VEC4_ZERO_INIT}
@@ -786,21 +791,6 @@ glms_vec4_(mixc)(vec4s from, vec4s to, float t) {
return r;
}
/*!
* @brief threshold function (unidimensional)
*
* @param[in] edge threshold
* @param[in] x value to test against threshold
* @returns 0.0 if x < edge, else 1.0
*/
CGLM_INLINE
vec4s
glms_vec4_(step_uni)(float edge, vec4s x) {
vec4s r;
glm_vec4_step_uni(edge, x.raw, r.raw);
return r;
}
/*!
* @brief threshold function
*

View File

@@ -72,7 +72,6 @@
CGLM_INLINE void glm_vec3_lerpc(vec3 from, vec3 to, float t, vec3 dest);
CGLM_INLINE void glm_vec3_mix(vec3 from, vec3 to, float t, vec3 dest);
CGLM_INLINE void glm_vec3_mixc(vec3 from, vec3 to, float t, vec3 dest);
CGLM_INLINE void glm_vec3_step_uni(float edge, vec3 x, vec3 dest);
CGLM_INLINE void glm_vec3_step(vec3 edge, vec3 x, vec3 dest);
CGLM_INLINE void glm_vec3_smoothstep_uni(float edge0, float edge1, vec3 x, vec3 dest);
CGLM_INLINE void glm_vec3_smoothstep(vec3 edge0, vec3 edge1, vec3 x, vec3 dest);
@@ -97,6 +96,7 @@
glm_vec3_inv
glm_vec3_inv_to
glm_vec3_mulv
glm_vec3_step_uni --> use glm_vec3_steps
*/
#ifndef cglm_vec3_h
@@ -114,6 +114,7 @@
#define glm_vec3_inv(v) glm_vec3_negate(v)
#define glm_vec3_inv_to(v, dest) glm_vec3_negate_to(v, dest)
#define glm_vec3_mulv(a, b, d) glm_vec3_mul(a, b, d)
#define glm_vec3_step_uni(edge, x, dest) glm_vec3_steps(edge, x, dest)
#define GLM_VEC3_ONE_INIT {1.0f, 1.0f, 1.0f}
#define GLM_VEC3_ZERO_INIT {0.0f, 0.0f, 0.0f}
@@ -1012,21 +1013,6 @@ glm_vec3_mixc(vec3 from, vec3 to, float t, vec3 dest) {
glm_vec3_lerpc(from, to, t, dest);
}
/*!
* @brief threshold function (unidimensional)
*
* @param[in] edge threshold
* @param[in] x value to test against threshold
* @param[out] dest destination
*/
CGLM_INLINE
void
glm_vec3_step_uni(float edge, vec3 x, vec3 dest) {
dest[0] = glm_step(edge, x[0]);
dest[1] = glm_step(edge, x[1]);
dest[2] = glm_step(edge, x[2]);
}
/*!
* @brief threshold function
*

View File

@@ -57,7 +57,6 @@
CGLM_INLINE void glm_vec4_clamp(vec4 v, float minVal, float maxVal);
CGLM_INLINE void glm_vec4_lerp(vec4 from, vec4 to, float t, vec4 dest);
CGLM_INLINE void glm_vec4_lerpc(vec4 from, vec4 to, float t, vec4 dest);
CGLM_INLINE void glm_vec4_step_uni(float edge, vec4 x, vec4 dest);
CGLM_INLINE void glm_vec4_step(vec4 edge, vec4 x, vec4 dest);
CGLM_INLINE void glm_vec4_smoothstep_uni(float edge0, float edge1, vec4 x, vec4 dest);
CGLM_INLINE void glm_vec4_smoothstep(vec4 edge0, vec4 edge1, vec4 x, vec4 dest);
@@ -75,6 +74,7 @@
glm_vec4_inv
glm_vec4_inv_to
glm_vec4_mulv
glm_vec4_step_uni --> use glm_vec4_steps
*/
#ifndef cglm_vec4_h
@@ -92,6 +92,7 @@
#define glm_vec4_inv(v) glm_vec4_negate(v)
#define glm_vec4_inv_to(v, dest) glm_vec4_negate_to(v, dest)
#define glm_vec4_mulv(a, b, d) glm_vec4_mul(a, b, d)
#define glm_vec4_step_uni(edge, x, dest) glm_vec4_steps(edge, x, dest)
#define GLM_VEC4_ONE_INIT {1.0f, 1.0f, 1.0f, 1.0f}
#define GLM_VEC4_BLACK_INIT {0.0f, 0.0f, 0.0f, 1.0f}
@@ -1148,22 +1149,6 @@ glm_vec4_mixc(vec4 from, vec4 to, float t, vec4 dest) {
glm_vec4_lerpc(from, to, t, dest);
}
/*!
* @brief threshold function (unidimensional)
*
* @param[in] edge threshold
* @param[in] x value to test against threshold
* @param[out] dest destination
*/
CGLM_INLINE
void
glm_vec4_step_uni(float edge, vec4 x, vec4 dest) {
dest[0] = glm_step(edge, x[0]);
dest[1] = glm_step(edge, x[1]);
dest[2] = glm_step(edge, x[2]);
dest[3] = glm_step(edge, x[3]);
}
/*!
* @brief threshold function
*

View File

@@ -308,12 +308,6 @@ glmc_vec3_lerpc(vec3 from, vec3 to, float t, vec3 dest) {
glm_vec3_lerpc(from, to, t, dest);
}
CGLM_EXPORT
void
glmc_vec3_step_uni(float edge, vec3 x, vec3 dest) {
glm_vec3_step_uni(edge, x, dest);
}
CGLM_EXPORT
void
glmc_vec3_step(vec3 edge, vec3 x, vec3 dest) {
@@ -454,6 +448,18 @@ glmc_vec3_mods(vec3 v, float s, vec3 dest) {
glm_vec3_mods(v, s, dest);
}
CGLM_EXPORT
void
glmc_vec3_steps(float edge, vec3 v, vec3 dest) {
glm_vec3_steps(edge, v, dest);
}
CGLM_EXPORT
void
glmc_vec3_stepr(vec3 edge, float v, vec3 dest) {
glm_vec3_stepr(edge, v, dest);
}
CGLM_EXPORT
float
glmc_vec3_hadd(vec3 v) {

View File

@@ -266,12 +266,6 @@ glmc_vec4_lerpc(vec4 from, vec4 to, float t, vec4 dest) {
glm_vec4_lerpc(from, to, t, dest);
}
CGLM_EXPORT
void
glmc_vec4_step_uni(float edge, vec4 x, vec4 dest) {
glm_vec4_step_uni(edge, x, dest);
}
CGLM_EXPORT
void
glmc_vec4_step(vec4 edge, vec4 x, vec4 dest) {