limit particle emission to 50 fps

This commit is contained in:
ac-stef
2014-01-28 16:01:21 +01:00
parent 6f5635917f
commit 0ff8fafb5f
+5 -1
View File
@@ -196,6 +196,10 @@ void cursorupdate() // called every frame fr
const float GRIDS = 2.0f;
const int GRIDM = 0x7;
static int lastsparkle = 0;
bool sparkletime = lastmillis - lastsparkle >= 20;
if(sparkletime) lastsparkle = lastmillis - (lastmillis%20); // clip adding sparklies at 50 fps
// render editing grid
if(showgrid)
@@ -210,7 +214,7 @@ void cursorupdate() // called every frame fr
float h2 = sheight(s, SWS(s,1,0,sfactor), z);
float h3 = sheight(s, SWS(s,1,1,sfactor), z);
float h4 = sheight(s, SWS(s,0,1,sfactor), z);
if(s->tag & (TAGCLIP|TAGPLCLIP)) particle_cube(s->tag & TAGCLIP ? PART_EPICKUP : PART_EMODEL, tagnum, taglife, ix, iy);
if(sparkletime && s->tag & (TAGCLIP|TAGPLCLIP)) particle_cube(s->tag & TAGCLIP ? PART_EPICKUP : PART_EMODEL, tagnum, taglife, ix, iy);
if(s->tag) linestyle(GRIDW, 0xFF, 0x40, 0x40);
else if(s->type==FHF || s->type==CHF) linestyle(GRIDW, 0x80, 0xFF, 0x80);
else linestyle(GRIDW, 0x80, 0x80, 0x80);