diff --git a/graphics.c b/graphics.c index 1e5fd5d68..0a83db58c 100644 --- a/graphics.c +++ b/graphics.c @@ -1431,9 +1431,9 @@ void draw_parts(pixel *vid) if(cmode == 3||cmode==4 || cmode==6) { vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); - cg = parts[i].tmp/5; - cb = parts[i].ctype/5; - cr = parts[i].flags/5; + cg = parts[i].tmp/4; + cb = parts[i].ctype/4; + cr = parts[i].flags/4; x = nx/CELL; y = ny/CELL; cg += fire_g[y][x]; diff --git a/main.c b/main.c index 5da2ce0ca..b9d188fbd 100644 --- a/main.c +++ b/main.c @@ -311,10 +311,30 @@ void *build_save(int *size, int x0, int y0, int w, int h) i = m[j]; if(i) { - unsigned char tttemp = (unsigned char)((parts[i-1].temp+(-MIN_TEMP))/((MAX_TEMP+(-MIN_TEMP))/255)); + if(cracker) + { + int z; + int temp1 = 0; + int temp = parts[i-1].temp; + int temp2 = temp; + for(z = 15;z>=8;z--) + { + if(temp>0&&temp>=powf(2,z)) + { + temp1 += powf(2,z-8); + temp -= powf(2,z); + } + } + d[p++] = (char)temp1; + d[p++] = (char)temp2; + } + else + { + unsigned char tttemp = (unsigned char)((parts[i-1].temp+(-MIN_TEMP))/((MAX_TEMP+(-MIN_TEMP))/255)); + d[p++] = tttemp; + } //if(tttemp<0) tttemp=0; //if(tttemp>255) tttemp=255; - d[p++] = tttemp; } } for(j=0; j> 16; c[11] = p >> 24; + i -= 12; if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK) @@ -468,7 +489,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) if(d[p]) { bmap[y][x] = d[p]; - if(cracker) + if(!cracker) { if(bmap[y][x]==1) bmap[y][x]=11; @@ -620,16 +641,33 @@ int parse_save(void *save, int size, int replace, int x0, int y0) goto corrupt; } if(i <= NPART) - { - if(ver>=42){ + { + if(cracker) + { + int z; + int q = 0; + int temp1 = d[p++]; + int temp2 = d[p++]; + for(z = 7;z>=0;z--) + { + if(temp1>0&&temp1>=powf(2,z)) + { + q += powf(2,z+8); + temp1 -= powf(2,z); + } + } + + parts[i-1].temp = temp2 + q + 0.15; + } + else if(ver>=42){ parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; } else { - parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273; + parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273.15; } } else { - p++; + p += 2; } } else diff --git a/powder.c b/powder.c index d6e808b42..08f67c681 100644 --- a/powder.c +++ b/powder.c @@ -1936,32 +1936,32 @@ player[23] = 1; int w = (rand()%255+1); int e = (rand()%255+1); for(nx=-1; nx<2; nx++) - for(ny=-2; ny<3; ny++) - if(x+nx>=0 && y+ny>0 && - x+nx=rand()%8) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx=rand()%8) { - create_part(-1, x+nx, y+ny , PT_DUST); - pv[y/CELL][x/CELL] += 2.00f*CFDS; - a= pmap[y+ny][x+nx]; - if(parts[a>>8].type==PT_DUST) - { - parts[a>>8].vy = -(rand()%10-1); - parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[a>>8].life= rand()%75+35; - parts[a>>8].tmp=q; - parts[a>>8].flags=w; - parts[a>>8].ctype=e; - parts[a>>8].temp= rand()%20+600; - } + if(!pmap[y+ny][x+nx]) + { + create_part(-1, x+nx, y+ny , PT_DUST); + pv[y/CELL][x/CELL] += 2.00f*CFDS; + a= pmap[y+ny][x+nx]; + if(parts[a>>8].type==PT_DUST) + { + parts[a>>8].vy = -(rand()%10-1); + parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[a>>8].life= rand()%75+35; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; + parts[a>>8].temp= rand()%20+600; + } + } } + } - - } - parts[i].type=PT_NONE; + parts[i].type=PT_NONE; } } if(t==PT_DUST&&!parts[i].life==0) @@ -2450,12 +2450,12 @@ void update_particles(pixel *vid) for(j=0; j>1)&1; i