Revert "Eliminados todos los std:: del código"

This reverts commit 4a2d27dc59.
This commit is contained in:
2023-09-16 16:44:15 +02:00
parent 4a2d27dc59
commit 0ea7eb0b9c
35 changed files with 504 additions and 539 deletions

View File

@@ -35,7 +35,7 @@ GameOver::GameOver(SDL_Renderer *renderer, Screen *screen, Resource *resource, A
tvSprite->setPosY(30);
// Inicializa el vector de colores
const vector<string> colorList = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
const std::vector<std::string> colorList = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
for (auto cl : colorList)
{
colors.push_back(stringToColor(options->palette, cl));
@@ -104,8 +104,8 @@ void GameOver::render()
renderSprites();
// Escribe el texto con las habitaciones y los items
const string itemsTxt = to_string(options->stats.items / 100) + to_string((options->stats.items % 100) / 10) + to_string(options->stats.items % 10);
const string roomsTxt = to_string(options->stats.rooms / 100) + to_string((options->stats.rooms % 100) / 10) + to_string(options->stats.rooms % 10);
const std::string itemsTxt = std::to_string(options->stats.items / 100) + std::to_string((options->stats.items % 100) / 10) + std::to_string(options->stats.items % 10);
const std::string roomsTxt = std::to_string(options->stats.rooms / 100) + std::to_string((options->stats.rooms % 100) / 10) + std::to_string(options->stats.rooms % 10);
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, y + 80, "ITEMS: " + itemsTxt, 1, color);
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, y + 90, "ROOMS: " + roomsTxt, 1, color);
@@ -185,13 +185,13 @@ void GameOver::updateColor()
if (counter < half)
{
const float step = min(counter, fadeLenght) / (float)fadeLenght;
const float step = std::min(counter, fadeLenght) / (float)fadeLenght;
const int index = (colors.size() - 1) - int((colors.size() - 1) * step);
color = colors[index];
}
else
{
const float step = min(max(counter, iniFade) - iniFade, fadeLenght) / (float)fadeLenght;
const float step = std::min(std::max(counter, iniFade) - iniFade, fadeLenght) / (float)fadeLenght;
const int index = (colors.size() - 1) * step;
color = colors[index];
}