diff --git a/src/save.c b/src/save.c index 089b90ae9..c56bdd319 100644 --- a/src/save.c +++ b/src/save.c @@ -52,11 +52,42 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char return 1; } +int change_wall(int wt) +{ + if (wt == 1) + return WL_WALL; + else if (wt == 2) + return WL_DESTROYALL; + else if (wt == 3) + return WL_ALLOWLIQUID; + else if (wt == 4) + return WL_FAN; + else if (wt == 5) + return WL_STREAM; + else if (wt == 6) + return WL_DETECT; + else if (wt == 7) + return WL_EWALL; + else if (wt == 8) + return WL_WALLELEC; + else if (wt == 9) + return WL_ALLOWAIR; + else if (wt == 10) + return WL_ALLOWSOLID; + else if (wt == 11) + return WL_ALLOWALLELEC; + else if (wt == 12) + return WL_EHOLE; + else if (wt == 13) + return WL_ALLOWGAS; + return wt; +} + pixel *prerender_save_OPS(void *save, int size, int *width, int *height) { unsigned char * inputData = save, *bsonData = NULL, *partsData = NULL, *partsPosData = NULL, *wallData = NULL; int inputDataLen = size, bsonDataLen = 0, partsDataLen, partsPosDataLen, wallDataLen; - int i, x, y, j; + int i, x, y, j, wt, pc, gc; int blockX, blockY, blockW, blockH, fullX, fullY, fullW, fullH; int bsonInitialised = 0; pixel * vidBuf = NULL; @@ -177,14 +208,65 @@ pixel *prerender_save_OPS(void *save, int size, int *width, int *height) { if(wallData[y*blockW+x]) { - for(i = 0; i < CELL; i++) + wt = wallData[y*blockW+x]; + pc = wtypes[wt-UI_ACTUALSTART].colour; + gc = wtypes[wt-UI_ACTUALSTART].eglow; + if (wtypes[wt-UI_ACTUALSTART].drawstyle==1) { - for(j = 0; j < CELL; j++) - { - vidBuf[(fullY+i+(y*CELL))*fullW+(fullX+j+(x*CELL))] = PIXPACK(0xCCCCCC); - } + for (i=0; i>1)&1; j= fanDataLen) { @@ -1222,7 +1305,7 @@ fin: pixel *prerender_save_PSv(void *save, int size, int *width, int *height) { unsigned char *d,*c=save; - int i,j,k,x,y,rx,ry,p=0; + int i,j,k,x,y,rx,ry,p=0, wt, pc, gc; int bw,bh,w,h,new_format = 0; pixel *fb; @@ -1269,93 +1352,68 @@ pixel *prerender_save_PSv(void *save, int size, int *width, int *height) for (y=0; y>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; j