diff --git a/source/utils.cpp b/source/utils.cpp index 50b85d3..38c66ab 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -3,6 +3,7 @@ #include // for max, min #include // for isspace #include // for distance +#include struct JA_Music_t; // lines 3-3 struct JA_Sound_t; // lines 4-4 @@ -309,4 +310,15 @@ std::string trim(const std::string &str) } while (std::distance(start, end) > 0 && std::isspace(*end)); return std::string(start, end + 1); +} + +// Función de suavizado +double easeOutQuint(double t) +{ + return 1 - std::pow(1 - t, 5); +} + +// Función de suavizado +double easeInOutSine(double t) { + return -0.5 * (std::cos(M_PI * t) - 1); } \ No newline at end of file diff --git a/source/utils.h b/source/utils.h index 98b1729..54ea480 100644 --- a/source/utils.h +++ b/source/utils.h @@ -305,6 +305,12 @@ color_t DarkenColor(color_t color, int amount); // Quita los espacioes en un string std::string trim(const std::string &str); +// Función de suavizado +double easeOutQuint(double t); + +// Función de suavizado +double easeInOutSine(double t); + // Colores extern const color_t bgColor; extern const color_t noColor;