Ja es pot "enner llour neim". Falta decidir quin de tots els dissenys m'agrada mes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "utils.h"
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <stdlib.h> // for free, malloc
|
||||
struct JA_Music_t;
|
||||
struct JA_Sound_t;
|
||||
|
||||
@@ -288,4 +288,22 @@ color_t DarkenColor(color_t color, int amount)
|
||||
newColor.g = std::max(0, (int)color.g - amount);
|
||||
newColor.b = std::max(0, (int)color.b - amount);
|
||||
return newColor;
|
||||
}
|
||||
|
||||
// Quita los espacioes en un string
|
||||
std::string trim(const std::string &str)
|
||||
{
|
||||
auto start = str.begin();
|
||||
while (start != str.end() && std::isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
|
||||
auto end = str.end();
|
||||
do
|
||||
{
|
||||
end--;
|
||||
} while (std::distance(start, end) > 0 && std::isspace(*end));
|
||||
|
||||
return std::string(start, end + 1);
|
||||
}
|
||||
Reference in New Issue
Block a user