diff --git a/source/core/rendering/sdl_manager.cpp b/source/core/rendering/sdl_manager.cpp index 3bf8060..ffecacb 100644 --- a/source/core/rendering/sdl_manager.cpp +++ b/source/core/rendering/sdl_manager.cpp @@ -13,6 +13,7 @@ #include "core/defaults.hpp" #include "core/input/mouse.hpp" #include "core/rendering/coordinate_transform.hpp" +#include "core/system/notifier.hpp" #include "project.h" namespace { @@ -215,7 +216,9 @@ void SDLManager::increaseWindowSize() { } float new_zoom = zoom_factor_ + Defaults::Window::ZOOM_INCREMENT; applyZoom(new_zoom); - std::cout << "F2: Zoom aumentat a " << zoom_factor_ << "x" << '\n'; + if (auto* notifier = System::Notifier::get(); notifier != nullptr) { + notifier->notifyInfo(std::format("ZOOM: {:.1f}X", zoom_factor_)); + } } void SDLManager::decreaseWindowSize() { @@ -224,7 +227,9 @@ void SDLManager::decreaseWindowSize() { } float new_zoom = zoom_factor_ - Defaults::Window::ZOOM_INCREMENT; applyZoom(new_zoom); - std::cout << "F1: Zoom reduït a " << zoom_factor_ << "x" << '\n'; + if (auto* notifier = System::Notifier::get(); notifier != nullptr) { + notifier->notifyInfo(std::format("ZOOM: {:.1f}X", zoom_factor_)); + } } void SDLManager::applyWindowSize(int new_width, int new_height) { @@ -262,18 +267,18 @@ void SDLManager::toggleFullscreen() { // comportament depèn del mode que tingués la finestra anteriorment. SDL_SetWindowFullscreenMode(finestra_, nullptr); SDL_SetWindowFullscreen(finestra_, true); - std::cout << "F3: Fullscreen activat (guardada: " - << windowed_width_ << "x" << windowed_height_ << ")" << '\n'; } else { is_fullscreen_ = false; SDL_SetWindowFullscreen(finestra_, false); applyWindowSize(windowed_width_, windowed_height_); - std::cout << "F3: Fullscreen desactivat (restaurada: " - << windowed_width_ << "x" << windowed_height_ << ")" << '\n'; } cfg_->window.fullscreen = is_fullscreen_; Mouse::setForceHidden(is_fullscreen_); + + if (auto* notifier = System::Notifier::get(); notifier != nullptr) { + notifier->notifyInfo(is_fullscreen_ ? "PANTALLA COMPLETA" : "MODE FINESTRA"); + } } auto SDLManager::handleWindowEvent(const SDL_Event& event) -> bool { @@ -325,6 +330,9 @@ void SDLManager::toggleVSync() { if (on_persist_) { on_persist_(); } + if (auto* notifier = System::Notifier::get(); notifier != nullptr) { + notifier->notifyInfo(cfg_->rendering.vsync != 0 ? "VSYNC ACTIU" : "VSYNC INACTIU"); + } } void SDLManager::toggleAntialias() { @@ -332,5 +340,7 @@ void SDLManager::toggleAntialias() { gpu_renderer_.setAntialias(cfg_->rendering.antialias != 0); // No persistim: l'AA és toggleable runtime però el seu estat no es // guarda al YAML de moment (decisió volgudament conservadora). - std::cout << "F5: AA " << (cfg_->rendering.antialias != 0 ? "ON" : "OFF") << '\n'; + if (auto* notifier = System::Notifier::get(); notifier != nullptr) { + notifier->notifyInfo(cfg_->rendering.antialias != 0 ? "AA ACTIU" : "AA INACTIU"); + } }