Mes recomanacions de cppcheck aplicades
Abans de tocar unes cosetes de strings buits
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user