mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@572 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bfa60e6851
commit
6ae3aa2831
1 changed files with 106 additions and 67 deletions
|
@ -7301,9 +7301,9 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz,
|
|||
{
|
||||
short fil, i, j, numsprites, ts;
|
||||
long tl;
|
||||
sectortype tsect[MAXSECTORS];
|
||||
walltype twall[MAXWALLS];
|
||||
spritetype tspri[MAXSPRITES];
|
||||
sectortype *tsect = NULL;
|
||||
walltype *twall = NULL;
|
||||
spritetype *tspri = NULL;
|
||||
sectortype *sec;
|
||||
walltype *wal;
|
||||
spritetype *spri;
|
||||
|
@ -7335,8 +7335,17 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz,
|
|||
ts = B_LITTLE16(*dacursectnum); Bwrite(fil,&ts,2);
|
||||
|
||||
ts = B_LITTLE16(numsectors); Bwrite(fil,&ts,2);
|
||||
|
||||
while (1)
|
||||
{
|
||||
tsect = (sectortype *)Bmalloc(sizeof(sectortype) * numsectors);
|
||||
|
||||
if (tsect == NULL)
|
||||
break;
|
||||
|
||||
Bmemcpy(&tsect[0], §or[0], sizeof(sectortype) * numsectors);
|
||||
|
||||
for (i=0; i<numsectors; i++) {
|
||||
Bmemcpy(&tsect[i], §or[i], sizeof(sectortype));
|
||||
sec = &tsect[i];
|
||||
sec->wallptr = B_LITTLE16(sec->wallptr);
|
||||
sec->wallnum = B_LITTLE16(sec->wallnum);
|
||||
|
@ -7354,10 +7363,18 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz,
|
|||
}
|
||||
|
||||
Bwrite(fil,&tsect[0],sizeof(sectortype) * numsectors);
|
||||
Bfree(tsect);
|
||||
|
||||
ts = B_LITTLE16(numwalls); Bwrite(fil,&ts,2);
|
||||
|
||||
twall = (walltype *)Bmalloc(sizeof(walltype) * numwalls);
|
||||
|
||||
if (twall == NULL)
|
||||
break;
|
||||
|
||||
Bmemcpy(&twall[0], &wall[0], sizeof(walltype) * numwalls);
|
||||
|
||||
for (i=0; i<numwalls; i++) {
|
||||
Bmemcpy(&twall[i], &wall[i], sizeof(walltype));
|
||||
wal = &twall[i];
|
||||
wal->x = B_LITTLE32(wal->x);
|
||||
wal->y = B_LITTLE32(wal->y);
|
||||
|
@ -7373,14 +7390,21 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz,
|
|||
}
|
||||
|
||||
Bwrite(fil,&twall[0],sizeof(walltype) * numwalls);
|
||||
Bfree(twall);
|
||||
|
||||
ts = B_LITTLE16(numsprites); Bwrite(fil,&ts,2);
|
||||
|
||||
tspri = (spritetype *)Bmalloc(sizeof(spritetype) * numsprites);
|
||||
|
||||
if (tspri == NULL)
|
||||
break;
|
||||
|
||||
Bmemcpy(&tspri[0], &sprite[0], sizeof(spritetype) * numsprites);
|
||||
|
||||
for (j=0;j<MAXSPRITES;j++)
|
||||
{
|
||||
if (sprite[j].statnum != MAXSTATUS)
|
||||
{
|
||||
Bmemcpy(&tspri[j], &sprite[j], sizeof(spritetype));
|
||||
spri = &tspri[j];
|
||||
spri->x = B_LITTLE32(spri->x);
|
||||
spri->y = B_LITTLE32(spri->y);
|
||||
|
@ -7401,11 +7425,26 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz,
|
|||
}
|
||||
|
||||
Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites);
|
||||
Bfree(tspri);
|
||||
|
||||
Bclose(fil);
|
||||
return(0);
|
||||
}
|
||||
|
||||
Bclose(fil);
|
||||
|
||||
if (tsect != NULL)
|
||||
Bfree(tsect);
|
||||
|
||||
if (twall != NULL)
|
||||
Bfree(twall);
|
||||
|
||||
if (tspri != NULL)
|
||||
Bfree(tspri);
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// setgamemode
|
||||
|
|
Loading…
Reference in a new issue