demo: El efecto de fuego ocupa toda la pantalla
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -58,7 +58,7 @@ int gradBreathDirection = 0; // Indica si gradCurrentColor crece o decrece
|
||||
|
||||
// Variables para el efecto de fuego
|
||||
const int fireScreenWidth = 320; // Ancho del efecto de fuego
|
||||
const int fireScreenHeight = 180; // Alto del efecto de fuego
|
||||
const int fireScreenHeight = 243; // Alto del efecto de fuego
|
||||
int fire[fireScreenHeight][fireScreenWidth]; // Buffer con el fuego
|
||||
ColorRGB palette[256]; // Paleta de color para el fuego
|
||||
const int fireDesp = 240 - fireScreenHeight + 3; // Fila donde comienza a dibujarse el efecto de fuego
|
||||
@@ -541,7 +541,7 @@ void renderGradient()
|
||||
// Dibuja el efecto de fuego
|
||||
void renderFire()
|
||||
{
|
||||
for (int y = 0; y < fireScreenHeight; ++y)
|
||||
for (int y = 0; y < fireScreenHeight - 3; ++y)
|
||||
for (int x = 0; x < fireScreenWidth; ++x)
|
||||
{
|
||||
const ColorRGB c = palette[std::min(255, std::max(0, fire[y][x]))];
|
||||
|
||||
Reference in New Issue
Block a user