Change wifi so that it always takes one frame to transmit

This commit is contained in:
jacksonmj 2012-01-19 03:07:56 +08:00 committed by Simon Robertshaw
parent 6bdc05cc40
commit a722d7a396
2 changed files with 9 additions and 9 deletions

View File

@ -12,6 +12,8 @@ int update_WIFI(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if (!r) if (!r)
continue; 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 (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]) 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) 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; wireless[parts[i].tmp][1] = 1;
ISWIRE = 1; ISWIRE = 2;
} }
} }
} }

View File

@ -1697,16 +1697,15 @@ void update_particles_i(pixel *vid, int start, int inc)
GENERATION ++; GENERATION ++;
//memset(gol2, 0, sizeof(gol2)); //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++) for ( q = 0; q<(int)(MAX_TEMP-73.15f)/100+2; q++)
if (!wireless[q][1])
{ {
wireless[q][0] = 0; wireless[q][0] = wireless[q][1];
}
else
wireless[q][1] = 0; wireless[q][1] = 0;
} }
ISWIRE--;
}
for (i=0; i<=parts_lastActiveIndex; i++) for (i=0; i<=parts_lastActiveIndex; i++)
if (parts[i].type) if (parts[i].type)
{ {