From ebd27e8714453c48299c46500aee900910041c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 25 Mar 2018 21:10:53 -0700 Subject: [PATCH] Cleanup. --- include/bx/easing.h | 86 +++++++++++++++++----------------- include/bx/inline/easing.inl | 90 ++++++++++++++++++------------------ 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/include/bx/easing.h b/include/bx/easing.h index 714271f..a59f39a 100644 --- a/include/bx/easing.h +++ b/include/bx/easing.h @@ -97,7 +97,7 @@ namespace bx /// | /// | /// - float easeLinear(float _t); + BX_CONST_FUNC float easeLinear(float _t); /// Step. /// @@ -123,7 +123,7 @@ namespace bx /// | /// | /// - float easeStep(float _t); + BX_CONST_FUNC float easeStep(float _t); /// Smooth step. /// @@ -148,7 +148,7 @@ namespace bx /// | /// | /// - float easeSmoothStep(float _t); + BX_CONST_FUNC float easeSmoothStep(float _t); /// Quad. /// @@ -174,7 +174,7 @@ namespace bx /// | /// | /// - float easeInQuad(float _t); + BX_CONST_FUNC float easeInQuad(float _t); /// Out quad. /// @@ -200,7 +200,7 @@ namespace bx /// | /// | /// - float easeOutQuad(float _t); + BX_CONST_FUNC float easeOutQuad(float _t); /// In out quad. /// @@ -226,7 +226,7 @@ namespace bx /// | /// | /// - float easeInOutQuad(float _t); + BX_CONST_FUNC float easeInOutQuad(float _t); /// Out in quad. /// @@ -252,7 +252,7 @@ namespace bx /// | /// | /// - float easeOutInQuad(float _t); + BX_CONST_FUNC float easeOutInQuad(float _t); /// In cubic. /// @@ -278,7 +278,7 @@ namespace bx /// | /// | /// - float easeInCubic(float _t); + BX_CONST_FUNC float easeInCubic(float _t); /// Out cubic. /// @@ -304,7 +304,7 @@ namespace bx /// | /// | /// - float easeOutCubic(float _t); + BX_CONST_FUNC float easeOutCubic(float _t); /// In out cubic. /// @@ -330,7 +330,7 @@ namespace bx /// | /// | /// - float easeInOutCubic(float _t); + BX_CONST_FUNC float easeInOutCubic(float _t); /// Out in cubic. /// @@ -356,7 +356,7 @@ namespace bx /// | /// | /// - float easeOutInCubic(float _t); + BX_CONST_FUNC float easeOutInCubic(float _t); /// In quart. /// @@ -382,7 +382,7 @@ namespace bx /// | /// | /// - float easeInQuart(float _t); + BX_CONST_FUNC float easeInQuart(float _t); /// Out quart. /// @@ -408,7 +408,7 @@ namespace bx /// | /// | /// - float easeOutQuart(float _t); + BX_CONST_FUNC float easeOutQuart(float _t); /// In out quart. /// @@ -434,7 +434,7 @@ namespace bx /// | /// | /// - float easeInOutQuart(float _t); + BX_CONST_FUNC float easeInOutQuart(float _t); /// Out in quart. /// @@ -460,7 +460,7 @@ namespace bx /// | /// | /// - float easeOutInQuart(float _t); + BX_CONST_FUNC float easeOutInQuart(float _t); /// In quint. /// @@ -486,7 +486,7 @@ namespace bx /// | /// | /// - float easeInQuint(float _t); + BX_CONST_FUNC float easeInQuint(float _t); /// Out quint. /// @@ -512,7 +512,7 @@ namespace bx /// | /// | /// - float easeOutQuint(float _t); + BX_CONST_FUNC float easeOutQuint(float _t); /// In out quint. /// @@ -538,7 +538,7 @@ namespace bx /// | /// | /// - float easeInOutQuint(float _t); + BX_CONST_FUNC float easeInOutQuint(float _t); /// Out in quint. /// @@ -564,7 +564,7 @@ namespace bx /// | /// | /// - float easeOutInQuint(float _t); + BX_CONST_FUNC float easeOutInQuint(float _t); /// In sine. /// @@ -590,7 +590,7 @@ namespace bx /// | /// | /// - float easeInSine(float _t); + BX_CONST_FUNC float easeInSine(float _t); /// Out sine. /// @@ -616,7 +616,7 @@ namespace bx /// | /// | /// - float easeOutSine(float _t); + BX_CONST_FUNC float easeOutSine(float _t); /// In out sine. /// @@ -642,7 +642,7 @@ namespace bx /// | /// | /// - float easeInOutSine(float _t); + BX_CONST_FUNC float easeInOutSine(float _t); /// Out in sine. /// @@ -668,7 +668,7 @@ namespace bx /// | /// | /// - float easeOutInSine(float _t); + BX_CONST_FUNC float easeOutInSine(float _t); /// In exponential. /// @@ -694,7 +694,7 @@ namespace bx /// | /// | /// - float easeInExpo(float _t); + BX_CONST_FUNC float easeInExpo(float _t); /// Out exponential. /// @@ -720,7 +720,7 @@ namespace bx /// | /// | /// - float easeOutExpo(float _t); + BX_CONST_FUNC float easeOutExpo(float _t); /// In out exponential. /// @@ -746,7 +746,7 @@ namespace bx /// | /// | /// - float easeInOutExpo(float _t); + BX_CONST_FUNC float easeInOutExpo(float _t); /// Out in exponential. /// @@ -772,7 +772,7 @@ namespace bx /// | /// | /// - float easeOutInExpo(float _t); + BX_CONST_FUNC float easeOutInExpo(float _t); /// In circle. /// @@ -798,7 +798,7 @@ namespace bx /// | /// | /// - float easeInCirc(float _t); + BX_CONST_FUNC float easeInCirc(float _t); /// Out circle. /// @@ -824,7 +824,7 @@ namespace bx /// | /// | /// - float easeOutCirc(float _t); + BX_CONST_FUNC float easeOutCirc(float _t); /// In out circle. /// @@ -850,7 +850,7 @@ namespace bx /// | /// | /// - float easeInOutCirc(float _t); + BX_CONST_FUNC float easeInOutCirc(float _t); /// Out in circle. /// @@ -876,7 +876,7 @@ namespace bx /// | /// | /// - float easeOutInCirc(float _t); + BX_CONST_FUNC float easeOutInCirc(float _t); /// Out elastic. /// @@ -902,7 +902,7 @@ namespace bx /// | ***** /// | /// - float easeOutElastic(float _t); + BX_CONST_FUNC float easeOutElastic(float _t); /// In elastic. /// @@ -928,7 +928,7 @@ namespace bx /// | /// | /// - float easeInElastic(float _t); + BX_CONST_FUNC float easeInElastic(float _t); /// In out elastic. /// @@ -954,7 +954,7 @@ namespace bx /// | /// | /// - float easeInOutElastic(float _t); + BX_CONST_FUNC float easeInOutElastic(float _t); /// Out in elastic. /// @@ -980,7 +980,7 @@ namespace bx /// | /// | /// - float easeOutInElastic(float _t); + BX_CONST_FUNC float easeOutInElastic(float _t); /// In back. /// @@ -1006,7 +1006,7 @@ namespace bx /// | ****************** /// | /// - float easeInBack(float _t); + BX_CONST_FUNC float easeInBack(float _t); /// Out back. /// @@ -1032,7 +1032,7 @@ namespace bx /// | /// | /// - float easeOutBack(float _t); + BX_CONST_FUNC float easeOutBack(float _t); /// In out back. /// @@ -1058,7 +1058,7 @@ namespace bx /// | /// | /// - float easeInOutBack(float _t); + BX_CONST_FUNC float easeInOutBack(float _t); /// Out in back. /// @@ -1084,7 +1084,7 @@ namespace bx /// | /// | /// - float easeOutInBack(float _t); + BX_CONST_FUNC float easeOutInBack(float _t); /// Out bounce. /// @@ -1110,7 +1110,7 @@ namespace bx /// | /// | /// - float easeOutBounce(float _t); + BX_CONST_FUNC float easeOutBounce(float _t); /// In bounce. /// @@ -1136,7 +1136,7 @@ namespace bx /// | /// | /// - float easeInBounce(float _t); + BX_CONST_FUNC float easeInBounce(float _t); /// In out bounce. /// @@ -1162,7 +1162,7 @@ namespace bx /// | /// | /// - float easeInOutBounce(float _t); + BX_CONST_FUNC float easeInOutBounce(float _t); /// Out in bounce. /// @@ -1188,7 +1188,7 @@ namespace bx /// | /// | /// - float easeOutInBounce(float _t); + BX_CONST_FUNC float easeOutInBounce(float _t); } // namespace bx diff --git a/include/bx/inline/easing.inl b/include/bx/inline/easing.inl index d105d0b..12c237d 100644 --- a/include/bx/inline/easing.inl +++ b/include/bx/inline/easing.inl @@ -10,13 +10,13 @@ namespace bx { template - float easeOut(float _t) + BX_CONST_FUNC float easeOut(float _t) { return 1.0f - ease(1.0f - _t); } template - float easeMix(float _t) + BX_CONST_FUNC float easeMix(float _t) { return _t < 0.5f ? easeFrom0toH(2.0f*_t)*0.5f @@ -24,202 +24,202 @@ namespace bx ; } - inline float easeLinear(float _t) + inline BX_CONST_FUNC float easeLinear(float _t) { return _t; } - inline float easeStep(float _t) + inline BX_CONST_FUNC float easeStep(float _t) { return _t < 0.5f ? 0.0f : 1.0f; } - inline float easeSmoothStep(float _t) + inline BX_CONST_FUNC float easeSmoothStep(float _t) { return square(_t)*(3.0f - 2.0f*_t); } - inline float easeInQuad(float _t) + inline BX_CONST_FUNC float easeInQuad(float _t) { return square(_t); } - inline float easeOutQuad(float _t) + inline BX_CONST_FUNC float easeOutQuad(float _t) { return easeOut(_t); } - inline float easeInOutQuad(float _t) + inline BX_CONST_FUNC float easeInOutQuad(float _t) { return easeMix(_t); } - inline float easeOutInQuad(float _t) + inline BX_CONST_FUNC float easeOutInQuad(float _t) { return easeMix(_t); } - inline float easeInCubic(float _t) + inline BX_CONST_FUNC float easeInCubic(float _t) { return _t*_t*_t; } - inline float easeOutCubic(float _t) + inline BX_CONST_FUNC float easeOutCubic(float _t) { return easeOut(_t); } - inline float easeInOutCubic(float _t) + inline BX_CONST_FUNC float easeInOutCubic(float _t) { return easeMix(_t); } - inline float easeOutInCubic(float _t) + inline BX_CONST_FUNC float easeOutInCubic(float _t) { return easeMix(_t); } - inline float easeInQuart(float _t) + inline BX_CONST_FUNC float easeInQuart(float _t) { return _t*_t*_t*_t; } - inline float easeOutQuart(float _t) + inline BX_CONST_FUNC float easeOutQuart(float _t) { return easeOut(_t); } - inline float easeInOutQuart(float _t) + inline BX_CONST_FUNC float easeInOutQuart(float _t) { return easeMix(_t); } - inline float easeOutInQuart(float _t) + inline BX_CONST_FUNC float easeOutInQuart(float _t) { return easeMix(_t); } - inline float easeInQuint(float _t) + inline BX_CONST_FUNC float easeInQuint(float _t) { return _t*_t*_t*_t*_t; } - inline float easeOutQuint(float _t) + inline BX_CONST_FUNC float easeOutQuint(float _t) { return easeOut(_t); } - inline float easeInOutQuint(float _t) + inline BX_CONST_FUNC float easeInOutQuint(float _t) { return easeMix(_t); } - inline float easeOutInQuint(float _t) + inline BX_CONST_FUNC float easeOutInQuint(float _t) { return easeMix(_t); } - inline float easeInSine(float _t) + inline BX_CONST_FUNC float easeInSine(float _t) { return 1.0f - cos(_t*kPiHalf); } - inline float easeOutSine(float _t) + inline BX_CONST_FUNC float easeOutSine(float _t) { return easeOut(_t); } - inline float easeInOutSine(float _t) + inline BX_CONST_FUNC float easeInOutSine(float _t) { return easeMix(_t); } - inline float easeOutInSine(float _t) + inline BX_CONST_FUNC float easeOutInSine(float _t) { return easeMix(_t); } - inline float easeInExpo(float _t) + inline BX_CONST_FUNC float easeInExpo(float _t) { return pow(2.0f, 10.0f * (_t - 1.0f) ) - 0.001f; } - inline float easeOutExpo(float _t) + inline BX_CONST_FUNC float easeOutExpo(float _t) { return easeOut(_t); } - inline float easeInOutExpo(float _t) + inline BX_CONST_FUNC float easeInOutExpo(float _t) { return easeMix(_t); } - inline float easeOutInExpo(float _t) + inline BX_CONST_FUNC float easeOutInExpo(float _t) { return easeMix(_t); } - inline float easeInCirc(float _t) + inline BX_CONST_FUNC float easeInCirc(float _t) { return -(sqrt(1.0f - _t*_t) - 1.0f); } - inline float easeOutCirc(float _t) + inline BX_CONST_FUNC float easeOutCirc(float _t) { return easeOut(_t); } - inline float easeInOutCirc(float _t) + inline BX_CONST_FUNC float easeInOutCirc(float _t) { return easeMix(_t); } - inline float easeOutInCirc(float _t) + inline BX_CONST_FUNC float easeOutInCirc(float _t) { return easeMix(_t); } - inline float easeOutElastic(float _t) + inline BX_CONST_FUNC float easeOutElastic(float _t) { return pow(2.0f, -10.0f*_t)*sin( (_t-0.3f/4.0f)*(2.0f*kPi)/0.3f) + 1.0f; } - inline float easeInElastic(float _t) + inline BX_CONST_FUNC float easeInElastic(float _t) { return easeOut(_t); } - inline float easeInOutElastic(float _t) + inline BX_CONST_FUNC float easeInOutElastic(float _t) { return easeMix(_t); } - inline float easeOutInElastic(float _t) + inline BX_CONST_FUNC float easeOutInElastic(float _t) { return easeMix(_t); } - inline float easeInBack(float _t) + inline BX_CONST_FUNC float easeInBack(float _t) { return easeInCubic(_t) - _t*sin(_t*kPi); } - inline float easeOutBack(float _t) + inline BX_CONST_FUNC float easeOutBack(float _t) { return easeOut(_t); } - inline float easeInOutBack(float _t) + inline BX_CONST_FUNC float easeInOutBack(float _t) { return easeMix(_t); } - inline float easeOutInBack(float _t) + inline BX_CONST_FUNC float easeOutInBack(float _t) { return easeMix(_t); } - inline float easeOutBounce(float _t) + inline BX_CONST_FUNC float easeOutBounce(float _t) { if (4.0f/11.0f > _t) { @@ -248,17 +248,17 @@ namespace bx ; } - inline float easeInBounce(float _t) + inline BX_CONST_FUNC float easeInBounce(float _t) { return easeOut(_t); } - inline float easeInOutBounce(float _t) + inline BX_CONST_FUNC float easeInOutBounce(float _t) { return easeMix(_t); } - inline float easeOutInBounce(float _t) + inline BX_CONST_FUNC float easeOutInBounce(float _t) { return easeMix(_t); }