mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Fixed bottom walls switch and improved texture coordinate generation.
git-svn-id: https://svn.eduke32.com/eduke32@315 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
96c035d63b
commit
fb8c39689e
3 changed files with 32 additions and 36 deletions
|
@ -8466,16 +8466,6 @@ void dragpoint(short pointhighlight, long dax, long day)
|
||||||
wall[pointhighlight].x = dax;
|
wall[pointhighlight].x = dax;
|
||||||
wall[pointhighlight].y = day;
|
wall[pointhighlight].y = day;
|
||||||
|
|
||||||
if ((rendmode == 4) && 0)
|
|
||||||
{
|
|
||||||
tempshort = wall[pointhighlight].nextwall;
|
|
||||||
if (tempshort >= 0)
|
|
||||||
{
|
|
||||||
prsectors[wall[pointhighlight].nextsector]->controlstate |= 2;
|
|
||||||
prsectors[wall[tempshort].nextsector]->controlstate |= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cnt = MAXWALLS;
|
cnt = MAXWALLS;
|
||||||
tempshort = pointhighlight; //search points CCW
|
tempshort = pointhighlight; //search points CCW
|
||||||
do
|
do
|
||||||
|
|
|
@ -328,12 +328,12 @@ int polymer_updatesector(short sectnum)
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < sec->wallnum)
|
while (i < sec->wallnum)
|
||||||
{
|
{
|
||||||
if ((-wal->x != s->verts[(i*3)+2]) || 0)
|
if ((-wal->x != s->verts[(i*3)+2]))
|
||||||
{
|
{
|
||||||
s->verts[(i*3)+2] = s->floorbuffer[(i*5)+2] = s->ceilbuffer[(i*5)+2] = -wal->x;
|
s->verts[(i*3)+2] = s->floorbuffer[(i*5)+2] = s->ceilbuffer[(i*5)+2] = -wal->x;
|
||||||
s->controlstate |= 2;
|
s->controlstate |= 2;
|
||||||
}
|
}
|
||||||
if ((wal->y != s->verts[i*3]) || 0)
|
if ((wal->y != s->verts[i*3]))
|
||||||
{
|
{
|
||||||
s->verts[i*3] = s->floorbuffer[i*5] = s->ceilbuffer[i*5] = wal->y;
|
s->verts[i*3] = s->floorbuffer[i*5] = s->ceilbuffer[i*5] = wal->y;
|
||||||
s->controlstate |= 2;
|
s->controlstate |= 2;
|
||||||
|
@ -611,13 +611,14 @@ int polymer_initwall(short wallnum)
|
||||||
void polymer_updatewall(short wallnum)
|
void polymer_updatewall(short wallnum)
|
||||||
{
|
{
|
||||||
short nwallnum, nnwallnum, curpicnum;
|
short nwallnum, nnwallnum, curpicnum;
|
||||||
|
char curxpanning, curypanning;
|
||||||
walltype *wal;
|
walltype *wal;
|
||||||
sectortype *sec, *nsec;
|
sectortype *sec, *nsec;
|
||||||
_prwall *w;
|
_prwall *w;
|
||||||
_prsector *s, *ns;
|
_prsector *s, *ns;
|
||||||
pthtyp* pth;
|
pthtyp* pth;
|
||||||
long xref[2], yref, xdif, ydif, dist;
|
long xref, yref, xdif, ydif;
|
||||||
float ypancoef;
|
float ypancoef, dist;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
wal = &wall[wallnum];
|
wal = &wall[wallnum];
|
||||||
|
@ -634,15 +635,9 @@ void polymer_updatewall(short wallnum)
|
||||||
w->wallcolor[3] = 1.0f;
|
w->wallcolor[3] = 1.0f;
|
||||||
|
|
||||||
if (wal->cstat & 8)
|
if (wal->cstat & 8)
|
||||||
{
|
xref = 1;
|
||||||
xref[0] = wall[wal->point2].x;
|
|
||||||
xref[1] = wall[wal->point2].y;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
xref = 0;
|
||||||
xref[0] = wal->x;
|
|
||||||
xref[1] = wal->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wal->nextsector == -1)
|
if (wal->nextsector == -1)
|
||||||
{
|
{
|
||||||
|
@ -685,9 +680,10 @@ void polymer_updatewall(short wallnum)
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
xdif = xref[0] + w->wallbuffer[(i * 5) + 2];
|
if ((i == 0) || (i == 3))
|
||||||
ydif = xref[1] - w->wallbuffer[(i * 5)];
|
dist = xref;
|
||||||
dist = ((xdif * xdif) + (ydif * ydif)) != 0;
|
else
|
||||||
|
dist = (xref == 0);
|
||||||
|
|
||||||
w->wallbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->wallbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->wallbuffer[(i * 5) + 4] = (-(float)(yref + w->wallbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wallbuffer[(i * 5) + 4] = (-(float)(yref + w->wallbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
@ -716,9 +712,17 @@ void polymer_updatewall(short wallnum)
|
||||||
memcpy(&w->wallbuffer[15], &ns->floorbuffer[(nnwallnum - nsec->wallptr) * 5], sizeof(GLfloat) * 3);
|
memcpy(&w->wallbuffer[15], &ns->floorbuffer[(nnwallnum - nsec->wallptr) * 5], sizeof(GLfloat) * 3);
|
||||||
|
|
||||||
if (wal->cstat & 2)
|
if (wal->cstat & 2)
|
||||||
|
{
|
||||||
curpicnum = wall[nwallnum].picnum;
|
curpicnum = wall[nwallnum].picnum;
|
||||||
|
curxpanning = wall[nwallnum].xpanning;
|
||||||
|
curypanning = wall[nwallnum].ypanning;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
curpicnum = wal->picnum;
|
curpicnum = wal->picnum;
|
||||||
|
curxpanning = wal->xpanning;
|
||||||
|
curypanning = wal->ypanning;
|
||||||
|
}
|
||||||
|
|
||||||
if (picanm[curpicnum]&192) curpicnum += animateoffs(curpicnum,wallnum+16384);
|
if (picanm[curpicnum]&192) curpicnum += animateoffs(curpicnum,wallnum+16384);
|
||||||
|
|
||||||
|
@ -734,17 +738,17 @@ void polymer_updatewall(short wallnum)
|
||||||
w->wallcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
|
w->wallcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wal->cstat & 4)
|
if ((!(wal->cstat & 2) && (wal->cstat & 4)) || ((wal->cstat & 2) && (wall[nwallnum].cstat & 4)))
|
||||||
yref = sec->ceilingz;
|
yref = sec->ceilingz;
|
||||||
else
|
else
|
||||||
yref = nsec->floorz;
|
yref = nsec->floorz;
|
||||||
|
|
||||||
if (wal->ypanning)
|
if (curypanning)
|
||||||
{
|
{
|
||||||
ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
||||||
if (ypancoef < tilesizy[curpicnum])
|
if (ypancoef < tilesizy[curpicnum])
|
||||||
ypancoef *= 2;
|
ypancoef *= 2;
|
||||||
ypancoef *= (float)(wal->ypanning) / (256.0f * (float)(tilesizy[curpicnum]));
|
ypancoef *= (float)(curypanning) / (256.0f * (float)(tilesizy[curpicnum]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ypancoef = 0;
|
ypancoef = 0;
|
||||||
|
@ -752,11 +756,12 @@ void polymer_updatewall(short wallnum)
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
xdif = xref[0] + w->wallbuffer[(i * 5) + 2];
|
if ((i == 0) || (i == 3))
|
||||||
ydif = xref[1] - w->wallbuffer[(i * 5)];
|
dist = xref;
|
||||||
dist = ((xdif * xdif) + (ydif * ydif)) != 0;
|
else
|
||||||
|
dist = (xref == 0);
|
||||||
|
|
||||||
w->wallbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->wallbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + curxpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->wallbuffer[(i * 5) + 4] = (-(float)(yref + w->wallbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wallbuffer[(i * 5) + 4] = (-(float)(yref + w->wallbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
||||||
if (wal->cstat & 256) w->wallbuffer[(i * 5) + 4] = -w->wallbuffer[(i * 5) + 4];
|
if (wal->cstat & 256) w->wallbuffer[(i * 5) + 4] = -w->wallbuffer[(i * 5) + 4];
|
||||||
|
@ -819,9 +824,10 @@ void polymer_updatewall(short wallnum)
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
xdif = xref[0] + w->overbuffer[(i * 5) + 2];
|
if ((i == 0) || (i == 3))
|
||||||
ydif = xref[1] - w->overbuffer[(i * 5)];
|
dist = xref;
|
||||||
dist = ((xdif * xdif) + (ydif * ydif)) != 0;
|
else
|
||||||
|
dist = (xref == 0);
|
||||||
|
|
||||||
w->overbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->overbuffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->overbuffer[(i * 5) + 4] = (-(float)(yref + w->overbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->overbuffer[(i * 5) + 4] = (-(float)(yref + w->overbuffer[(i * 5) + 1]) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue