From a722d7a396e4cad8caa5bfa8bfed47a6ec59a016 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Thu, 19 Jan 2012 03:07:56 +0800 Subject: [PATCH] Change wifi so that it always takes one frame to transmit --- src/elements/wifi.c | 5 +++-- src/powder.c | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/elements/wifi.c b/src/elements/wifi.c index 3e87fefa9..55d151d3c 100644 --- a/src/elements/wifi.c +++ b/src/elements/wifi.c @@ -12,6 +12,8 @@ int update_WIFI(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if (!r) continue; + // wireless[][0] - whether channel is active on this frame + // wireless[][1] - whether channel should be active on next frame if (wireless[parts[i].tmp][0]) { if (((r&0xFF)==PT_NSCN||(r&0xFF)==PT_PSCN||(r&0xFF)==PT_INWR)&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) @@ -25,9 +27,8 @@ int update_WIFI(UPDATE_FUNC_ARGS) { { if ((r&0xFF)==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3) { - wireless[parts[i].tmp][0] = 1; wireless[parts[i].tmp][1] = 1; - ISWIRE = 1; + ISWIRE = 2; } } } diff --git a/src/powder.c b/src/powder.c index 6360529b8..2f427595f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1697,15 +1697,14 @@ void update_particles_i(pixel *vid, int start, int inc) GENERATION ++; //memset(gol2, 0, sizeof(gol2)); } - if (ISWIRE==1)//wifi channel reseting + if (ISWIRE>0)//wifi channel reseting { for ( q = 0; q<(int)(MAX_TEMP-73.15f)/100+2; q++) - if (!wireless[q][1]) - { - wireless[q][0] = 0; - } - else - wireless[q][1] = 0; + { + wireless[q][0] = wireless[q][1]; + wireless[q][1] = 0; + } + ISWIRE--; } for (i=0; i<=parts_lastActiveIndex; i++) if (parts[i].type)