diff options
| author | Cracker64 <cracker642@gmail.com> | 2011-01-18 00:11:30 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2011-01-18 00:11:30 (GMT) |
| commit | e1eeaf9e9a1cd5f500cc262e871d36a341782eca (patch) | |
| tree | 5f1fe3073265bc67fc7477252cac0ad80ca8aba7 /src/main.c | |
| parent | 926450a9a3db03d0abd1afcff4ea0269415c0ced (diff) | |
| download | powder-e1eeaf9e9a1cd5f500cc262e871d36a341782eca.zip powder-e1eeaf9e9a1cd5f500cc262e871d36a341782eca.tar.gz | |
test with increased element limit, there seems to be no performace decrease to me anyway. element limit of 4096
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -496,7 +496,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - pmap[y][x] = (i<<8)|1; + pmap[y][x] = (i<<12)|1; } else fp[nf++] = i; @@ -573,7 +573,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { if(pmap[y][x]) { - k = pmap[y][x]>>8; + k = pmap[y][x]>>12; parts[k].type = j; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; @@ -1747,28 +1747,28 @@ int main(int argc, char *argv[]) }else{ cr = pmap[y/sdl_scale][x/sdl_scale]; } - if(!((cr>>8)>=NPART || !cr)) + if(!((cr>>12)>=NPART || !cr)) { #ifdef BETA if(DEBUG_MODE) { - int tctype = parts[cr>>8].ctype; + int tctype = parts[cr>>12].ctype; if(tctype>=PT_NUM) tctype = 0; - sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); - //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f, parts[cr>>12].life); + //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFFF].name, ptypes[parts[cr>>12].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f, parts[cr>>12].life); } else - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f, parts[cr>>12].life); #else if(DEBUG_MODE) { - int tctype = parts[cr>>8].ctype; + int tctype = parts[cr>>12].ctype; if(tctype>=PT_NUM) tctype = 0; - sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d,tmp: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life,parts[cr>>8].tmp); - //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d,tmp: %d", ptypes[cr&0xFFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f, parts[cr>>12].life,parts[cr>>12].tmp); + //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFFF].name, ptypes[parts[cr>>12].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f, parts[cr>>12].life); } else { - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>12].temp-273.15f); } #endif } @@ -2076,6 +2076,9 @@ int main(int argc, char *argv[]) memset(bmap, 0, sizeof(bmap)); memset(emap, 0, sizeof(emap)); memset(parts, 0, sizeof(particle)*NPART); + memset(photons, 0,sizeof(photons)); + memset(wireless, 0, sizeof(wireless)); + memset(gol2, 0, sizeof(gol2)); for(i=0; i<NPART-1; i++) parts[i].life = i+1; parts[NPART-1].life = -1; @@ -2132,10 +2135,7 @@ int main(int argc, char *argv[]) if(x>=19 && x<=35 && svf_last && svf_open && !bq){ //int tpval = sys_pause; parse_save(svf_last, svf_lsize, 1, 0, 0); - for(j= 0;j<99;j++){ //reset wifi on reload - wireless[j][0] = 0; - wireless[j][1] = 0; - } + memset(wireless, 0, sizeof(wireless)); //sys_pause = tpval; } if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) @@ -2235,9 +2235,9 @@ int main(int argc, char *argv[]) { int cr; cr = pmap[y][x]; - if(!((cr>>8)>=NPART || !cr)) + if(!((cr>>12)>=NPART || !cr)) { - c = sl = cr&0xFF; + c = sl = cr&0xFFF; } else { |
