diff --git a/src/save.c b/src/save.c index 781ed1575..09dfc1a51 100644 --- a/src/save.c +++ b/src/save.c @@ -229,9 +229,44 @@ pixel *prerender_save_OPS(void *save, int size, int *width, int *height) partsData[i] = PT_DMND; //Replace all invalid elements with diamond //Draw type - vidBuf[(fullY+y)*fullW+(fullX+x)] = ptypes[partsData[i]].pcolors; - i+=3; //Skip Type an Descriptor - + if (partsData[i]==PT_STKM || partsData[i]==PT_STKM2 || partsData[i]==PT_FIGH) + { + pixel lc, hc=PIXRGB(255, 224, 178); + if (partsData[i]==PT_STKM || partsData[i]==PT_FIGH) lc = PIXRGB(255, 255, 255); + else lc = PIXRGB(100, 100, 255); + //only need to check upper bound of y coord - lower bounds and x= partsDataLen) goto fail; partsptr[newIndex].tmp2 = partsData[i++]; } + + if ((player.spwn == 1 && partsptr[newIndex].type==PT_STKM) || (player2.spwn == 1 && partsptr[newIndex].type==PT_STKM2)) + { + partsptr[newIndex].type = PT_NONE; + } + else if (partsptr[newIndex].type == PT_STKM) + { + STKM_init_legs(&player, newIndex); + player.spwn = 1; + player.elem = PT_DUST; + } + else if (partsptr[newIndex].type == PT_STKM2) + { + STKM_init_legs(&player2, newIndex); + player2.spwn = 1; + player2.elem = PT_DUST; + } + else if (partsptr[newIndex].type == PT_FIGH) + { + unsigned char fcount = 0; + while (fcount < 100 && fcount < (fighcount+1) && fighters[fcount].spwn==1) fcount++; + if (fcount < 100 && fighters[fcount].spwn==0) + { + partsptr[newIndex].tmp = fcount; + fighters[fcount].spwn = 1; + fighters[fcount].elem = PT_DUST; + fighcount++; + STKM_init_legs(&(fighters[fcount]), newIndex); + } + } + if (!ptypes[partsptr[newIndex].type].enabled) + partsptr[newIndex].type = PT_NONE; } } } @@ -1309,12 +1376,22 @@ pixel *prerender_save_PSv(void *save, int size, int *width, int *height) if (j==PT_STKM || j==PT_FIGH) lc = PIXRGB(255, 255, 255); else lc = PIXRGB(100, 100, 255); //only need to check upper bound of y coord - lower bounds and x