diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-07-25 19:04:41 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-07-26 17:28:06 (GMT) |
| commit | cbe1e0b0730fe1c5c05d1cd223219c7a05a647f6 (patch) | |
| tree | dadb777f5550e31a0016525e00791707410b251d /src | |
| parent | 647e29a31afc399d828574953f161b745de7031d (diff) | |
| download | powder-cbe1e0b0730fe1c5c05d1cd223219c7a05a647f6.zip powder-cbe1e0b0730fe1c5c05d1cd223219c7a05a647f6.tar.gz | |
Fix LIFE sampling and HUD
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -2631,6 +2631,7 @@ int main(int argc, char *argv[]) if (y>0 && y<sdl_scale*YRES && x>0 && x<sdl_scale*XRES) { int cr; //cr is particle under mouse, for drawing HUD information + char nametext[50]; if (photons[y/sdl_scale][x/sdl_scale]) { cr = photons[y/sdl_scale][x/sdl_scale]; } else { @@ -2638,7 +2639,11 @@ int main(int argc, char *argv[]) } if (!((cr>>8)>=NPART || !cr)) { - if (DEBUG_MODE) + if ((cr&0xFF)==PT_LIFE && parts[cr>>8].ctype>=0 && parts[cr>>8].ctype<NGOLALT) + { + sprintf(nametext, "%s (%s)", ptypes[cr&0xFF].name, gmenu[parts[cr>>8].ctype].name); + } + else if (DEBUG_MODE) { int tctype = parts[cr>>8].ctype; if ((cr&0xFF)==PT_PIPE) @@ -2648,13 +2653,23 @@ int main(int argc, char *argv[]) } if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT) 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(nametext, "%s (%s)", ptypes[cr&0xFF].name, ptypes[tctype].name); + } + else + { + strcpy(nametext, ptypes[cr&0xFF].name); + } + if (DEBUG_MODE) + { + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", nametext, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); sprintf(coordtext, "#%d, X:%d Y:%d", cr>>8, x/sdl_scale, y/sdl_scale); - } else { + } + else + { #ifdef BETA - 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", nametext, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].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", nametext, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f); #endif } if ((cr&0xFF)==PT_PHOT) wavelength_gfx = parts[cr>>8].ctype; @@ -3211,6 +3226,8 @@ int main(int argc, char *argv[]) if (!((cr>>8)>=NPART || !cr)) { c = sl = cr&0xFF; + if (c==PT_LIFE) + c = sl = (parts[cr>>8].ctype << 8) | c; } else { |
