From 0ff8fafb5f9c199634a717e02c1087b06f566a00 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 28 Jan 2014 16:01:21 +0100 Subject: [PATCH] limit particle emission to 50 fps --- source/src/editing.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 8e723092..fd2dbf94 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -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);