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 <cstdlib>
#include <iostream>
#include "core/defaults.hpp"
#include "core/graphics/shape_loader.hpp"
#include "core/rendering/shape_renderer.hpp"
#include "game/constants.hpp"
@@ -19,7 +20,8 @@ Enemic::Enemic(SDL_Renderer* renderer)
velocitat_(0.0f),
drotacio_(0.0f),
rotacio_(0.0f),
esta_(false) {
esta_(false),
brightness_(Defaults::Brightness::ENEMIC) {
// [NUEVO] Carregar forma compartida des de fitxer
forma_ = Graphics::ShapeLoader::load("enemy_pentagon.shp");
@@ -79,7 +81,7 @@ void Enemic::actualitzar(float delta_time) {
void Enemic::dibuixar() const {
if (esta_ && forma_) {
// [NUEVO] Usar render_shape en lloc de rota_pol
Rendering::render_shape(renderer_, forma_, centre_, rotacio_, 1.0f, true);
Rendering::render_shape(renderer_, forma_, centre_, rotacio_, 1.0f, true, 1.0f, brightness_);
}
}