diff --git a/polymer/build/src/engine.c b/polymer/build/src/engine.c index 85f976a1a..495954b1b 100644 --- a/polymer/build/src/engine.c +++ b/polymer/build/src/engine.c @@ -5978,15 +5978,15 @@ int sameside(_equation* eq, _point2d* p1, _point2d* p2) void drawpeel(int peel) { bglBindTexture(GL_TEXTURE_RECTANGLE, peels[peel]); - bglBegin(GL_QUADS); - bglTexCoord2f(0.0f, 0.0f); - bglVertex2f(-1.0f, -1.0f); - bglTexCoord2f(xdim, 0.0f); - bglVertex2f(1.0f, -1.0f); - bglTexCoord2f(xdim, ydim); - bglVertex2f(1.0f, 1.0f); - bglTexCoord2f(0.0f, ydim); - bglVertex2f(-1.0f, 1.0f); + bglBegin(GL_QUADS); + bglTexCoord2f(0.0f, 0.0f); + bglVertex2f(-1.0f, -1.0f); + bglTexCoord2f(xdim, 0.0f); + bglVertex2f(1.0f, -1.0f); + bglTexCoord2f(xdim, ydim); + bglVertex2f(1.0f, 1.0f); + bglTexCoord2f(0.0f, ydim); + bglVertex2f(-1.0f, 1.0f); bglEnd(); } #endif @@ -6218,7 +6218,7 @@ else if (i == (r_peelscount - 1)) bglEnable(GL_BLEND); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, peelfbos[i]); + bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, peelfbos[i]); bglPushAttrib(GL_VIEWPORT_BIT); bglViewport(0, 0, xdim, ydim); @@ -7301,9 +7301,12 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz, { short fil, i, j, numsprites, ts; long tl; - sectortype tsect; - walltype twall; - spritetype tspri; + sectortype tsect[MAXSECTORS]; + walltype twall[MAXWALLS]; + spritetype tspri[MAXSPRITES]; + sectortype *sec; + walltype *wal; + spritetype *spri; if ((fil = Bopen(filename,BO_BINARY|BO_TRUNC|BO_CREAT|BO_WRONLY,BS_IREAD|BS_IWRITE)) == -1) return(-1); @@ -7333,66 +7336,72 @@ long saveboard(char *filename, long *daposx, long *daposy, long *daposz, ts = B_LITTLE16(numsectors); Bwrite(fil,&ts,2); for (i=0; iwallptr = B_LITTLE16(sec->wallptr); + sec->wallnum = B_LITTLE16(sec->wallnum); + sec->ceilingz = B_LITTLE32(sec->ceilingz); + sec->floorz = B_LITTLE32(sec->floorz); + sec->ceilingstat = B_LITTLE16(sec->ceilingstat); + sec->floorstat = B_LITTLE16(sec->floorstat); + sec->ceilingpicnum = B_LITTLE16(sec->ceilingpicnum); + sec->ceilingheinum = B_LITTLE16(sec->ceilingheinum); + sec->floorpicnum = B_LITTLE16(sec->floorpicnum); + sec->floorheinum = B_LITTLE16(sec->floorheinum); + sec->lotag = B_LITTLE16(sec->lotag); + sec->hitag = B_LITTLE16(sec->hitag); + sec->extra = B_LITTLE16(sec->extra); } + Bwrite(fil,&tsect[0],sizeof(sectortype) * numsectors); + ts = B_LITTLE16(numwalls); Bwrite(fil,&ts,2); for (i=0; ix = B_LITTLE32(wal->x); + wal->y = B_LITTLE32(wal->y); + wal->point2 = B_LITTLE16(wal->point2); + wal->nextwall = B_LITTLE16(wal->nextwall); + wal->nextsector = B_LITTLE16(wal->nextsector); + wal->cstat = B_LITTLE16(wal->cstat); + wal->picnum = B_LITTLE16(wal->picnum); + wal->overpicnum = B_LITTLE16(wal->overpicnum); + wal->lotag = B_LITTLE16(wal->lotag); + wal->hitag = B_LITTLE16(wal->hitag); + wal->extra = B_LITTLE16(wal->extra); } + Bwrite(fil,&twall[0],sizeof(walltype) * numwalls); + ts = B_LITTLE16(numsprites); Bwrite(fil,&ts,2); for (j=0;jx = B_LITTLE32(spri->x); + spri->y = B_LITTLE32(spri->y); + spri->z = B_LITTLE32(spri->z); + spri->cstat = B_LITTLE16(spri->cstat); + spri->picnum = B_LITTLE16(spri->picnum); + spri->sectnum = B_LITTLE16(spri->sectnum); + spri->statnum = B_LITTLE16(spri->statnum); + spri->ang = B_LITTLE16(spri->ang); + spri->owner = B_LITTLE16(spri->owner); + spri->xvel = B_LITTLE16(spri->xvel); + spri->yvel = B_LITTLE16(spri->yvel); + spri->zvel = B_LITTLE16(spri->zvel); + spri->lotag = B_LITTLE16(spri->lotag); + spri->hitag = B_LITTLE16(spri->hitag); + spri->extra = B_LITTLE16(spri->extra); } } + Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites); + Bclose(fil); return(0); }