diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-01 16:59:52 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-01 16:59:52 (GMT) |
| commit | 218c14c5ea91e14a378a7d9b81b7a8b0efa6848a (patch) | |
| tree | 5ec8c1138d986c81c5145392aa2bec3146cea391 /src/elements | |
| parent | 18990e97468e9ac088b8a1448e7fcfc2895516f0 (diff) | |
| download | powder-218c14c5ea91e14a378a7d9b81b7a8b0efa6848a.zip powder-218c14c5ea91e14a378a7d9b81b7a8b0efa6848a.tar.gz | |
Better scattering for QRTZ
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/phot.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/elements/phot.c b/src/elements/phot.c index b465029..d353feb 100644 --- a/src/elements/phot.c +++ b/src/elements/phot.c @@ -40,17 +40,13 @@ int update_PHOT(UPDATE_FUNC_ARGS) { } } r = pmap[y][x]; - if((r&0xFF) == PT_QRTZ && r) + if((r&0xFF) == PT_QRTZ && r)// && parts[i].ctype==0x3FFFFFFF) { - int t1, t2, t3; - parts[i].vx += ((float)(rand()%1000-500))/1000.0f; - parts[i].vy += ((float)(rand()%1000-500))/1000.0f; - t1 = (parts[i].ctype & 0x0000FF)+(rand()%5)-2; - t2 = ((parts[i].ctype & 0x00FF00)>>8)+(rand()%5)-2; - t3 = ((parts[i].ctype & 0xFF0000)>>16)+(rand()%5)-2; - parts[i].ctype = (parts[i].ctype & 0xFF000000) | (t3<<16) | (t2<<8) | t1; - - + float a = (rand()%360)*3.14159f/180.0f; + parts[i].vx = 3.0f*cosf(a); + parts[i].vy = 3.0f*sinf(a); + parts[i].ctype = 0x1F<<(rand()%26); + parts[i].life++; //Delay death } //r = pmap[y][x]; //rt = r&0xFF; |
