diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-12-10 08:29:23 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-12-10 18:38:30 (GMT) |
| commit | bcfea42d18f14ed851936cfe458e7876b9d54a28 (patch) | |
| tree | fedc2a4e6e1460eee5d990478aea4fdfc48103d1 /src | |
| parent | c7d0bf48b614337b29726bc9bca98047031c6cb4 (diff) | |
| download | powder-bcfea42d18f14ed851936cfe458e7876b9d54a28.zip powder-bcfea42d18f14ed851936cfe458e7876b9d54a28.tar.gz | |
Set BIZR/G/S ctype when loading a save, set BIZS ctype in create_part
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 47 | ||||
| -rw-r--r-- | src/powder.c | 2 |
2 files changed, 23 insertions, 26 deletions
@@ -724,35 +724,32 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char if (pmap[y][x]) { k = pmap[y][x]>>8; - memset(parts+k, 0, sizeof(particle)); - parts[k].type = j; - if (j == PT_PHOT) - parts[k].ctype = 0x3fffffff; - if (j == PT_SOAP) - parts[k].ctype = 0; - parts[k].x = (float)x; - parts[k].y = (float)y; - m[(x-x0)+(y-y0)*w] = k+1; - } - else if (i < nf) - { - memset(parts+fp[i], 0, sizeof(particle)); - parts[fp[i]].type = j; - if (j == PT_COAL) - parts[fp[i]].tmp = 50; - if (j == PT_FUSE) - parts[fp[i]].tmp = 50; - if (j == PT_PHOT) - parts[fp[i]].ctype = 0x3fffffff; - if (j == PT_SOAP) - parts[fp[i]].ctype = 0; - parts[fp[i]].x = (float)x; - parts[fp[i]].y = (float)y; - m[(x-x0)+(y-y0)*w] = fp[i]+1; + } + else if (i<nf) + { + k = fp[i]; i++; } else + { m[(x-x0)+(y-y0)*w] = NPART+1; + continue; + } + memset(parts+k, 0, sizeof(particle)); + parts[k].type = j; + if (j == PT_COAL) + parts[k].tmp = 50; + if (j == PT_FUSE) + parts[k].tmp = 50; + if (j == PT_PHOT) + parts[k].ctype = 0x3fffffff; + if (j == PT_SOAP) + parts[k].ctype = 0; + if (j==PT_BIZR || j==PT_BIZRG || j==PT_BIZRS) + parts[k].ctype = 0x47FFFF; + parts[k].x = (float)x; + parts[k].y = (float)y; + m[(x-x0)+(y-y0)*w] = k+1; } } diff --git a/src/powder.c b/src/powder.c index e3d5bef..c683f68 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1070,7 +1070,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a } return -1; } - if (t==PT_BIZR||t==PT_BIZRG) + if (t==PT_BIZR||t==PT_BIZRG||t==PT_BIZRS) parts[i].ctype = 0x47FFFF; //and finally set the pmap/photon maps to the newly created particle if (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC) |
