Añadidas funciones de suavizado a utils.cpp
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <algorithm> // for max, min
|
#include <algorithm> // for max, min
|
||||||
#include <cctype> // for isspace
|
#include <cctype> // for isspace
|
||||||
#include <iterator> // for distance
|
#include <iterator> // for distance
|
||||||
|
#include <cmath>
|
||||||
struct JA_Music_t; // lines 3-3
|
struct JA_Music_t; // lines 3-3
|
||||||
struct JA_Sound_t; // lines 4-4
|
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));
|
} while (std::distance(start, end) > 0 && std::isspace(*end));
|
||||||
|
|
||||||
return std::string(start, end + 1);
|
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);
|
||||||
}
|
}
|
||||||
@@ -305,6 +305,12 @@ color_t DarkenColor(color_t color, int amount);
|
|||||||
// Quita los espacioes en un string
|
// Quita los espacioes en un string
|
||||||
std::string trim(const std::string &str);
|
std::string trim(const std::string &str);
|
||||||
|
|
||||||
|
// Función de suavizado
|
||||||
|
double easeOutQuint(double t);
|
||||||
|
|
||||||
|
// Función de suavizado
|
||||||
|
double easeInOutSine(double t);
|
||||||
|
|
||||||
// Colores
|
// Colores
|
||||||
extern const color_t bgColor;
|
extern const color_t bgColor;
|
||||||
extern const color_t noColor;
|
extern const color_t noColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user