TPT: Change wifi so that it always takes one frame to transmit a722d7a396

This commit is contained in:
Simon Robertshaw 2012-04-17 17:18:35 +01:00
parent ca1690efe1
commit a3e97d51d1
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 (sim->wireless[parts[i].tmp][0]) if (sim->wireless[parts[i].tmp][0])
{ {
if (((r&0xFF)==PT_NSCN||(r&0xFF)==PT_PSCN||(r&0xFF)==PT_INWR)&&parts[r>>8].life==0 && sim->wireless[parts[i].tmp][0]) if (((r&0xFF)==PT_NSCN||(r&0xFF)==PT_PSCN||(r&0xFF)==PT_INWR)&&parts[r>>8].life==0 && sim->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)
{ {
sim->wireless[parts[i].tmp][0] = 1;
sim->wireless[parts[i].tmp][1] = 1; sim->wireless[parts[i].tmp][1] = 1;
//ISWIRE = 1; sim->ISWIRE = 2;
} }
} }
} }

View File

@ -2401,15 +2401,14 @@ void Simulation::update_particles_i(int start, int inc)
} }
//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] = wireless[q][1];
wireless[q][0] = 0; wireless[q][1] = 0;
} }
else ISWIRE--;
wireless[q][1] = 0;
} }
for (i=0; i<=parts_lastActiveIndex; i++) for (i=0; i<=parts_lastActiveIndex; i++)
if (parts[i].type) if (parts[i].type)