Commit pa que Mon arregle el codi mentre em dutxe

This commit is contained in:
2024-10-09 21:48:01 +02:00
parent 3c1dcad3ab
commit f2fa216b0d
34 changed files with 862 additions and 1218 deletions

View File

@@ -128,7 +128,7 @@ void Notify::update()
}
}
notifications[i].sprite->setRect(notifications[i].rect);
notifications[i].sprite->setPos(notifications[i].rect);
}
clearFinishedNotifications();
@@ -225,7 +225,7 @@ void Notify::showText(std::string text1, std::string text2, int icon)
n.rect = {despH, yPos, width, height};
// Crea la textura
n.texture = new Texture(renderer);
n.texture = std::make_shared<Texture>(renderer);
n.texture->createBlank(width, height, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET);
n.texture->setBlendMode(SDL_BLENDMODE_BLEND);
@@ -258,7 +258,7 @@ void Notify::showText(std::string text1, std::string text2, int icon)
// Dibuja el icono de la notificación
if (hasIcons && icon >= 0 && numTexts == 2)
{
auto sp = std::make_unique<Sprite>((SDL_Rect){0, 0, iconSize, iconSize}, iconTexture.get());
auto sp = std::make_unique<Sprite>((SDL_Rect){0, 0, iconSize, iconSize}, iconTexture);
sp->setPos({paddingIn, paddingIn, iconSize, iconSize});
sp->setSpriteClip({iconSize * (icon % 10), iconSize * (icon / 10), iconSize, iconSize});
sp->render();
@@ -280,7 +280,7 @@ void Notify::showText(std::string text1, std::string text2, int icon)
SDL_SetRenderTarget(renderer, nullptr);
// Crea el sprite de la notificación
n.sprite = new Sprite(n.rect, n.texture);
n.sprite = std::make_shared<Sprite>(n.rect, n.texture);
// Deja la notificación invisible
n.texture->setAlpha(0);