From 44cb59f3832030ebf50a335c46b4fb27ffa9b11c Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 15 Sep 2008 00:45:18 +0000 Subject: [PATCH] edit sparkly fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2604 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 00c7e5b6..d0e84494 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -31,14 +31,20 @@ void renderent(entity &e) void renderentities() { - if(editmode) + if(editmode && !reflecting && !refracting && !stenciling) { - loopv(ents) + static int lastsparkle = 0; + if(lastmillis - lastsparkle >= 20) { - entity &e = ents[i]; - if(e.type==NOTUSED) continue; - vec v(e.x, e.y, e.z); - particle_splash(2, 2, 40, v); + lastsparkle = lastmillis - (lastmillis%20); + loopv(ents) + { + entity &e = ents[i]; + if(e.type==NOTUSED) continue; + vec v(e.x, e.y, e.z); + if(vec(v).sub(camera1->o).dot(camdir) < 0) continue; + particle_splash(2, 2, 40, v); + } } } loopv(ents) @@ -52,7 +58,7 @@ void renderentities() } else if(isitem(e.type)) { - if((!OUTBORD(e.x, e.y) && e.spawned) | editmode) + if((!OUTBORD(e.x, e.y) && e.spawned) || editmode) { renderent(e); }