Mes recomanacions de cppcheck aplicades

Abans de tocar unes cosetes de strings buits
This commit is contained in:
2024-10-13 13:49:00 +02:00
parent b2122ac239
commit 46b19ee82f
22 changed files with 995 additions and 1062 deletions

View File

@@ -11,21 +11,18 @@
// Constructor
Notify::Notify(SDL_Renderer *renderer, std::string iconFile, std::string bitmapFile, std::string textFile, std::string soundFile)
: renderer(renderer)
: renderer(renderer),
text(std::make_unique<Text>(bitmapFile, textFile, renderer)),
bgColor(param.notification.color),
waitTime(150),
stack(false),
sound(JA_LoadSound(soundFile.c_str()))
{
// Inicializa variables
bgColor = param.notification.color;
waitTime = 150;
stack = false;
hasIcons = iconFile == "" ? false : true;
hasIcons = !iconFile.empty();
// Crea objetos
if (hasIcons)
{
iconTexture = std::make_unique<Texture>(renderer, iconFile);
}
text = std::make_unique<Text>(bitmapFile, textFile, renderer);
sound = JA_LoadSound(soundFile.c_str());
iconTexture = hasIcons ? std::make_unique<Texture>(renderer, iconFile) : nullptr;
}
// Destructor