feat(firework): halo neon per partícula amb color de glow propi (explosió enemic: línia blanca + halo daurat)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "core/rendering/line_renderer.hpp"
|
||||
|
||||
#include "core/defaults.hpp"
|
||||
#include "core/defaults/effects.hpp"
|
||||
|
||||
namespace Rendering {
|
||||
|
||||
@@ -46,6 +47,27 @@ namespace Rendering {
|
||||
renderer->pushLine(FX1, FY1, FX2, FY2, W, R, G, B, alpha);
|
||||
}
|
||||
|
||||
void lineaGlow(Renderer* renderer,
|
||||
int x1,
|
||||
int y1,
|
||||
int x2,
|
||||
int y2,
|
||||
float brightness,
|
||||
float thickness,
|
||||
SDL_Color color,
|
||||
SDL_Color glow_color) {
|
||||
// Color dels passes de halo: si glow_color té alpha>0, l'usem;
|
||||
// altrament fem servir el color de la línia.
|
||||
const SDL_Color HALO_COLOR = (glow_color.a > 0) ? glow_color : color;
|
||||
|
||||
for (const auto& pass : Defaults::FX::Glow::Line::PASSES) {
|
||||
const bool IS_CORE = pass.thickness < 0.0F;
|
||||
const float PASS_T = IS_CORE ? thickness : pass.thickness;
|
||||
const SDL_Color PASS_C = IS_CORE ? color : HALO_COLOR;
|
||||
linea(renderer, x1, y1, x2, y2, brightness, PASS_T, PASS_C, pass.alpha);
|
||||
}
|
||||
}
|
||||
|
||||
void setLineColor(SDL_Color color) { g_current_line_color = color; }
|
||||
|
||||
auto getLineColor() -> SDL_Color { return g_current_line_color; }
|
||||
|
||||
Reference in New Issue
Block a user