Resource: treballant en la visualització de la càrrega de recursos

This commit is contained in:
2025-06-10 18:42:14 +02:00
parent 6b30e4c927
commit 02b111e4fd
6 changed files with 208 additions and 101 deletions

View File

@@ -35,7 +35,12 @@ Screen *Screen::get() { return Screen::instance_; }
// Constructor
Screen::Screen()
: src_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)}),
: window_(nullptr),
renderer_(nullptr),
game_canvas_(nullptr),
service_menu_(nullptr),
notifier_(nullptr),
src_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)}),
dst_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)})
{
// Arranca SDL VIDEO, crea la ventana y el renderizador
@@ -173,8 +178,10 @@ void Screen::update()
fps_.calculate(SDL_GetTicks());
shake_effect_.update(src_rect_, dst_rect_);
flash_effect_.update();
serviceMenu_->update();
notifier_->update();
if (service_menu_)
service_menu_->update();
if (notifier_)
notifier_->update();
Mouse::updateCursorVisibility();
}
@@ -279,8 +286,10 @@ void Screen::renderOverlays()
renderShake();
renderFlash();
renderAttenuate();
serviceMenu_->render();
notifier_->render();
if (service_menu_)
service_menu_->render();
if (notifier_)
notifier_->render();
#ifdef DEBUG
renderInfo();
#endif
@@ -409,7 +418,7 @@ void Screen::toggleVSync()
// Obtiene los punteros a los singletones
void Screen::getSingletons()
{
serviceMenu_ = ServiceMenu::get();
service_menu_ = ServiceMenu::get();
notifier_ = Notifier::get();
}