From 9b3c25227a298d946ce357868c434ce21f8ef14c Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Wed, 23 Feb 2011 09:55:50 +0800 Subject: [PATCH] Reduce GoL lag --- src/powder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/powder.c b/src/powder.c index 78562b8fb..ba2cd175b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1353,10 +1353,12 @@ void update_particles_i(pixel *vid, int start, int inc) if (r && parts[r>>8].tmp<=0) parts[r>>8].type = PT_NONE;//using kill_part makes it not work } + for( z = 0;z<=NGOL;z++) + gol2[nx][ny][z] = 0;//this improves performance A LOT compared to the memset, i was getting ~23 more fps with this. } if (createdsomething) GENERATION ++; - memset(gol2, 0, sizeof(gol2)); + //memset(gol2, 0, sizeof(gol2)); } if (ISWIRE==1) {