From 0c125efb15822d0c7aefa5c51a97b65021870db5 Mon Sep 17 00:00:00 2001 From: ? Date: Tue, 26 Feb 2019 20:19:19 +0100 Subject: [PATCH] 3d:: nice fire --- graph.cpp | 17 +++++++++++++++-- hyper.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/graph.cpp b/graph.cpp index 1c06229b..d2bbdde2 100644 --- a/graph.cpp +++ b/graph.cpp @@ -4621,6 +4621,15 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { } } else if(c->wall == waNone) ; + else if(isFire(c)) { + int r = ticks - lastt; + r += rand() % 5 + 1; + r /= 5; + while(r--) { + drawParticleSpeed(c, wcol, 75 + rand() % 75); + } + } + else error = true; } @@ -5290,9 +5299,13 @@ void drawFlash(cell *c) { void drawBigFlash(cell *c) { flashes.push_back(flashdata(ticks, 2000, c, 0xC0FF00, 0)); } -void drawParticle(cell *c, color_t col, int maxspeed) { + +void drawParticleSpeed(cell *c, color_t col, int speed) { if(vid.particles && !confusingGeometry()) - flashes.push_back(flashdata(ticks, rand() % 16, c, col, 1+rand() % maxspeed)); + flashes.push_back(flashdata(ticks, rand() % 16, c, col, speed)); + } +void drawParticle(cell *c, color_t col, int maxspeed) { + drawParticleSpeed(c, col, 1 + rand() % maxspeed); } void drawParticles(cell *c, color_t col, int qty, int maxspeed) { if(vid.particles) diff --git a/hyper.h b/hyper.h index 20ff6a18..279554cc 100644 --- a/hyper.h +++ b/hyper.h @@ -967,6 +967,7 @@ void resetmusic(); void drawFlash(cell* c); void drawBigFlash(cell* c); +void drawParticleSpeed(cell *c, color_t col, int speed); void drawParticle(cell *c, color_t col, int maxspeed = 100); void drawParticles(cell *c, color_t col, int qty, int maxspeed = 100); void drawFireParticles(cell *c, int qty, int maxspeed = 100);