afegit nivell de brillo per shape

This commit is contained in:
2025-12-02 22:11:17 +01:00
parent 98c90e6075
commit d6b2e97777
7 changed files with 20 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
#include <iostream>
#include "core/audio/audio.hpp"
#include "core/defaults.hpp"
#include "core/graphics/shape_loader.hpp"
#include "core/rendering/shape_renderer.hpp"
#include "game/constants.hpp"
@@ -17,7 +18,8 @@ Bala::Bala(SDL_Renderer* renderer)
centre_({0.0f, 0.0f}),
angle_(0.0f),
velocitat_(0.0f),
esta_(false) {
esta_(false),
brightness_(Defaults::Brightness::BALA) {
// [NUEVO] Carregar forma compartida des de fitxer
forma_ = Graphics::ShapeLoader::load("bullet.shp");
@@ -66,7 +68,7 @@ void Bala::dibuixar() const {
if (esta_ && forma_) {
// [NUEVO] Usar render_shape en lloc de rota_pol
// Les bales no roten visualment (angle sempre 0.0f)
Rendering::render_shape(renderer_, forma_, centre_, 0.0f, 1.0f, true);
Rendering::render_shape(renderer_, forma_, centre_, 0.0f, 1.0f, true, 1.0f, brightness_);
}
}