Transició a surface: vaig per title.cpp

This commit is contained in:
2025-03-02 21:56:19 +01:00
parent db3a0d7263
commit 8f1d1df5d6
27 changed files with 416 additions and 490 deletions

View File

@@ -1,17 +1,17 @@
#include "notifier.h"
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_render.h> // for SDL_RenderFillRect, SDL_RenderClear
#include <algorithm> // for remove_if
#include <string> // for string, basic_string
#include <vector> // for vector
#include "jail_audio.h" // for JA_PlaySound
#include "options.h" // for Options, options, OptionsNotification
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TEXT_CENTER, TEXT_COLOR
#include "texture.h" // for Texture
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_render.h> // for SDL_RenderFillRect, SDL_RenderClear
#include <algorithm> // for remove_if
#include <string> // for string, basic_string
#include <vector> // for vector
#include "jail_audio.h" // for JA_PlaySound
#include "options.h" // for Options, options, OptionsNotification
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "s_sprite.h" // for Sprite
#include "text.h" // for Text, TEXT_CENTER, TEXT_COLOR
#include "surface.h" // for Texture
// [SINGLETON]
Notifier *Notifier::notifier_ = nullptr;
@@ -36,7 +36,7 @@ Notifier *Notifier::get()
// Constructor
Notifier::Notifier(const std::string &icon_file, const std::string &text)
: icon_texture_(!icon_file.empty() ? Resource::get()->getTexture(icon_file) : nullptr),
: icon_texture_(!icon_file.empty() ? Resource::get()->getSurface(icon_file) : nullptr),
text_(Resource::get()->getText(text)),
bg_color_(options.notifications.color),
wait_time_(150),