diff --git a/includes/save.h b/includes/save.h index 6f1a31bff..42fec97e7 100644 --- a/includes/save.h +++ b/includes/save.h @@ -36,8 +36,6 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c //Old save parsers, readers pixel *prerender_save_PSv(void *save, int size, int *width, int *height); -void *build_save_PSv(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr); - int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]); #endif diff --git a/src/powder.c b/src/powder.c index 827995c8f..8515040d7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -905,216 +905,239 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a parts[i].tmp = 0; parts[i].tmp2 = 0; } - if (t==PT_LIGH && p==-2) - { - switch (gravityMode) - { - default: - case 0: - parts[i].tmp= 270+rand()%40-20; - break; - case 1: - parts[i].tmp = rand()%360; - break; - case 2: - parts[i].tmp = atan2(x-XCNTR, y-YCNTR)*(180.0f/M_PI)+90; - } - parts[i].tmp2 = 4; - } - if (t==PT_SOAP) - { - parts[i].tmp = -1; - parts[i].tmp2 = -1; - } //now set various properties that we want at spawn. - if (t==PT_ACID || t==PT_CAUS) - { - parts[i].life = 75; - } - /*Testing - if(t==PT_WOOD){ - parts[i].life = 150; - } - End Testing*/ - if (t==PT_WARP) { - parts[i].life = rand()%95+70; - } - if (t==PT_FUSE) { - parts[i].life = 50; - parts[i].tmp = 50; - } /*if (ptypes[t].properties&PROP_LIFE) { int r; for (r = 0; r255) i=255; - d[p++] = i; - } - for (y=by0; y255) i=255; - d[p++] = i; - } - - // save the particle map - for (i=0; i=orig_x0 && x=orig_y0 && y255) x=255; - if (y<0) y=0; - if (y>255) y=255; - d[p++] = x; - d[p++] = y; - } - } - for (j=0; j>8); - d[p++] = (ttlife&0x00FF); - } - } - for (j=0; j>8); - d[p++] = (tttmp&0x00FF); - } - } - for (j=0; j>24; - } - } - for (j=0; j>16; - } - } - for (j=0; j>8; - } - } - for (j=0; j>8); - d[p++] = (tttemp&0x00FF); - } - } - for (j=0; j=orig_x0 && signs[i].x=orig_y0 && signs[i].y=orig_x0 && signs[i].x=orig_y0 && signs[i].y>8; - d[p++] = (signs[i].y-y0); - d[p++] = (signs[i].y-y0)>>8; - d[p++] = signs[i].ju; - x = strlen(signs[i].text); - d[p++] = x; - memcpy(d+p, signs[i].text, x); - p+=x; - } - - i = (p*101+99)/100 + 612; - c = malloc(i); - - //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures - //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error - - c[0] = 0x50; //0x66; - c[1] = 0x53; //0x75; - c[2] = 0x76; //0x43; - c[3] = legacy_enable|((sys_pause<<1)&0x02)|((gravityMode<<2)&0x0C)|((airMode<<4)&0x70)|((ngrav_enable<<7)&0x80); - c[4] = SAVE_VERSION; - c[5] = CELL; - c[6] = bw; - c[7] = bh; - c[8] = p; - c[9] = p >> 8; - c[10] = p >> 16; - c[11] = p >> 24; - - i -= 12; - - if (BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK) - { - free(d); - free(c); - free(m); - return NULL; - } - free(d); - free(m); - - *size = i+12; - return c; -} - int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]) { unsigned char *d=NULL,*c=save;