afegit pulso de color

This commit is contained in:
2025-11-28 09:00:41 +01:00
parent 836debdc0b
commit 06e9a10c98
4 changed files with 24 additions and 1 deletions
+15 -1
View File
@@ -3,6 +3,7 @@
#include "sdl_manager.hpp"
#include "core/defaults.hpp"
#include "core/rendering/line_renderer.hpp"
#include "game/options.hpp"
#include "project.h"
#include <algorithm>
@@ -277,7 +278,12 @@ void SDLManager::neteja(uint8_t r, uint8_t g, uint8_t b) {
if (!renderer_)
return;
SDL_SetRenderDrawColor(renderer_, r, g, b, 255);
// [MODIFICAT] Usar color oscil·lat del fons en lloc dels paràmetres
(void)r;
(void)g;
(void)b; // Suprimir warnings
SDL_Color bg = color_oscillator_.getCurrentBackgroundColor();
SDL_SetRenderDrawColor(renderer_, bg.r, bg.g, bg.b, 255);
SDL_RenderClear(renderer_);
}
@@ -287,3 +293,11 @@ void SDLManager::presenta() {
SDL_RenderPresent(renderer_);
}
// [NUEVO] Actualitzar colors amb oscil·lació
void SDLManager::updateColors(float delta_time) {
color_oscillator_.update(delta_time);
// Actualitzar color global de línies
Rendering::setLineColor(color_oscillator_.getCurrentLineColor());
}