mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
Make polymer impervious to corrupt maps (for the tenth time..). Fixes bug 2869996.
git-svn-id: https://svn.eduke32.com/eduke32@1550 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a8cbeaa0f7
commit
20cade406c
1 changed files with 12 additions and 10 deletions
|
@ -1322,7 +1322,7 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
|
|
||||||
// if we have a level boundary somewhere in the sector,
|
// if we have a level boundary somewhere in the sector,
|
||||||
// consider these walls as visportals
|
// consider these walls as visportals
|
||||||
if (wall[sec->wallptr + i].nextsector == -1)
|
if (wall[sec->wallptr + i].nextsector < 0)
|
||||||
doquery = 1;
|
doquery = 1;
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
|
@ -1332,7 +1332,7 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
i = sec->wallnum-1;
|
i = sec->wallnum-1;
|
||||||
while (i >= 0)
|
while (i >= 0)
|
||||||
{
|
{
|
||||||
if ((wall[sec->wallptr + i].nextsector != -1) &&
|
if ((wall[sec->wallptr + i].nextsector >= 0) &&
|
||||||
(wallvisible(globalposx, globalposy, sec->wallptr + i)) &&
|
(wallvisible(globalposx, globalposy, sec->wallptr + i)) &&
|
||||||
(polymer_planeinfrustum(&prwalls[sec->wallptr + i]->mask, frustum)))
|
(polymer_planeinfrustum(&prwalls[sec->wallptr + i]->mask, frustum)))
|
||||||
{
|
{
|
||||||
|
@ -2927,7 +2927,9 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
// it also works, bitches
|
// it also works, bitches
|
||||||
sec = §or[sectofwall];
|
sec = §or[sectofwall];
|
||||||
|
|
||||||
if (sectofwall < 0 || sectofwall > numsectors || wallnum < 0 || wallnum > numwalls || sec->wallptr > wallnum)
|
if (sectofwall < 0 || sectofwall > numsectors ||
|
||||||
|
wallnum < 0 || wallnum > numwalls ||
|
||||||
|
sec->wallptr > wallnum || wallnum >= (sec->wallptr + sec->wallnum))
|
||||||
return; // yay, corrupt map
|
return; // yay, corrupt map
|
||||||
|
|
||||||
wal = &wall[wallnum];
|
wal = &wall[wallnum];
|
||||||
|
@ -3023,7 +3025,7 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
Bmemcpy(&w->wall.buffer[10], &s->ceil.buffer[(wal->point2 - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
Bmemcpy(&w->wall.buffer[10], &s->ceil.buffer[(wal->point2 - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
||||||
Bmemcpy(&w->wall.buffer[15], &s->ceil.buffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
Bmemcpy(&w->wall.buffer[15], &s->ceil.buffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
||||||
|
|
||||||
if (wal->nextsector == -1)
|
if (wal->nextsector < 0)
|
||||||
curpicnum = wallpicnum;
|
curpicnum = wallpicnum;
|
||||||
else
|
else
|
||||||
curpicnum = walloverpicnum;
|
curpicnum = walloverpicnum;
|
||||||
|
@ -3035,7 +3037,7 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
else
|
else
|
||||||
yref = sec->ceilingz;
|
yref = sec->ceilingz;
|
||||||
|
|
||||||
if ((wal->cstat & 32) && (wal->nextsector != -1))
|
if ((wal->cstat & 32) && (wal->nextsector >= 0))
|
||||||
{
|
{
|
||||||
if ((!(wal->cstat & 2) && (wal->cstat & 4)) || ((wal->cstat & 2) && (wall[nwallnum].cstat & 4)))
|
if ((!(wal->cstat & 2) && (wal->cstat & 4)) || ((wal->cstat & 2) && (wall[nwallnum].cstat & 4)))
|
||||||
yref = sec->ceilingz;
|
yref = sec->ceilingz;
|
||||||
|
@ -3287,7 +3289,7 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wal->nextsector == -1)
|
if (wal->nextsector < 0)
|
||||||
Bmemcpy(w->mask.buffer, w->wall.buffer, sizeof(GLfloat) * 4 * 5);
|
Bmemcpy(w->mask.buffer, w->wall.buffer, sizeof(GLfloat) * 4 * 5);
|
||||||
|
|
||||||
Bmemcpy(w->bigportal, &s->floor.buffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
Bmemcpy(w->bigportal, &s->floor.buffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3);
|
||||||
|
@ -3355,11 +3357,11 @@ static void polymer_drawwall(int16_t sectnum, int16_t wallnum)
|
||||||
polymer_drawplane(&w->over);
|
polymer_drawplane(&w->over);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((wall[wallnum].cstat & 32) && (wall[wallnum].nextsector != -1))
|
if ((wall[wallnum].cstat & 32) && (wall[wallnum].nextsector >= 0))
|
||||||
polymer_drawplane(&w->mask);
|
polymer_drawplane(&w->mask);
|
||||||
|
|
||||||
if ((sector[sectnum].ceilingstat & 1) &&
|
if ((sector[sectnum].ceilingstat & 1) &&
|
||||||
((wall[wallnum].nextsector == -1) ||
|
((wall[wallnum].nextsector < 0) ||
|
||||||
!(sector[wall[wallnum].nextsector].ceilingstat & 1)))
|
!(sector[wall[wallnum].nextsector].ceilingstat & 1)))
|
||||||
{
|
{
|
||||||
bglColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
bglColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||||
|
@ -3535,7 +3537,7 @@ static inline void polymer_pokesector(int16_t sectnum)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((wal->nextsector != -1) && (!prsectors[wal->nextsector]->flags.uptodate))
|
if ((wal->nextsector >= 0) && (!prsectors[wal->nextsector]->flags.uptodate))
|
||||||
polymer_updatesector(wal->nextsector);
|
polymer_updatesector(wal->nextsector);
|
||||||
if (!prwalls[sec->wallptr + i]->flags.uptodate)
|
if (!prwalls[sec->wallptr + i]->flags.uptodate)
|
||||||
polymer_updatewall(sec->wallptr + i);
|
polymer_updatewall(sec->wallptr + i);
|
||||||
|
@ -5216,7 +5218,7 @@ static inline void polymer_culllight(int16_t lighti)
|
||||||
|
|
||||||
polymer_addplanelight(&w->mask, lighti);
|
polymer_addplanelight(&w->mask, lighti);
|
||||||
|
|
||||||
if ((wall[sec->wallptr + i].nextsector != -1) &&
|
if ((wall[sec->wallptr + i].nextsector >= 0) &&
|
||||||
(!drawingstate[wall[sec->wallptr + i].nextsector])) {
|
(!drawingstate[wall[sec->wallptr + i].nextsector])) {
|
||||||
drawingstate[wall[sec->wallptr + i].nextsector] = 1;
|
drawingstate[wall[sec->wallptr + i].nextsector] = 1;
|
||||||
sectorqueue[back] = wall[sec->wallptr + i].nextsector;
|
sectorqueue[back] = wall[sec->wallptr + i].nextsector;
|
||||||
|
|
Loading…
Reference in a new issue