Añadida función para pasar cadenas a mayúsculas
This commit is contained in:
@@ -566,7 +566,23 @@ std::string toLower(std::string str)
|
||||
lower[i] = (c >= 65 && c <= 90) ? c + 32 : c;
|
||||
}
|
||||
lower[str.size()] = 0;
|
||||
std::string nova(lower);
|
||||
std::string result(lower);
|
||||
free(lower);
|
||||
return nova;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Convierte una cadena a mayúsculas
|
||||
std::string toUpper(std::string str)
|
||||
{
|
||||
const char *original = str.c_str();
|
||||
char *upper = (char *)malloc(str.size() + 1);
|
||||
for (int i = 0; i < (int)str.size(); ++i)
|
||||
{
|
||||
char c = original[i];
|
||||
upper[i] = (c >= 97 && c <= 122) ? c - 32 : c;
|
||||
}
|
||||
upper[str.size()] = 0;
|
||||
std::string result(upper);
|
||||
free(upper);
|
||||
return result;
|
||||
}
|
||||
@@ -200,4 +200,7 @@ bool colorAreEqual(color_t color1, color_t color2);
|
||||
// Convierte una cadena a minusculas
|
||||
std::string toLower(std::string str);
|
||||
|
||||
// Convierte una cadena a mayúsculas
|
||||
std::string toUpper(std::string str);
|
||||
|
||||
#endif
|
||||
@@ -440,7 +440,7 @@ void Title::createCheevosTexture()
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
// Escribe la lista de logros en la textura
|
||||
const std::string cheevosOwner = options->online.jailerID == "" ? "LOCAL ACHIEVEMENTS" : "ACHIEVEMENTS FOR " + options->online.jailerID;
|
||||
const std::string cheevosOwner = options->online.jailerID == "" ? "LOCAL ACHIEVEMENTS" : "ACHIEVEMENTS FOR " + toUpper(options->online.jailerID);
|
||||
const std::string cheevosListCaption = cheevosOwner + " (" + std::to_string(cheevos->unlocked()) + " / " + std::to_string(cheevos->count()) + ")";
|
||||
infoText->writeDX(TXT_CENTER | TXT_COLOR, cheevosTexture->getWidth() / 2, 2, cheevosListCaption, 1, stringToColor(options->palette, "bright_green"));
|
||||
int pos = 11;
|
||||
|
||||
Reference in New Issue
Block a user