mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
ignore excessive number of openings (#2070)
* remove limit on openings and fix from ZDOOM1.14a * Revert "remove limit on openings and fix from ZDOOM1.14a" * apply Fabian's patch
This commit is contained in:
parent
99c6bdba55
commit
82eb547b96
@ -71,8 +71,8 @@ visplane_t *floorplane, *ceilingplane;
|
||||
|
||||
// killough 8/1/98: set static number of openings to be large enough
|
||||
// (a static limit is okay in this case and avoids difficulties in r_segs.c)
|
||||
static int *openings = NULL;
|
||||
int *lastopening; // [FG] 32-bit integer math
|
||||
int maxopenings;
|
||||
int *openings, *lastopening; // [FG] 32-bit integer math
|
||||
|
||||
// Clip values are the solid pixel bounding the range.
|
||||
// floorclip starts out SCREENHEIGHT
|
||||
@ -128,7 +128,8 @@ void R_InitPlanesRes(void)
|
||||
yslope = Z_Calloc(1, video.height * sizeof(*yslope), PU_RENDERER, NULL);
|
||||
distscale = Z_Calloc(1, video.width * sizeof(*distscale), PU_RENDERER, NULL);
|
||||
|
||||
openings = Z_Calloc(1, video.width * video.height * sizeof(*openings), PU_RENDERER, NULL);
|
||||
maxopenings = video.width * video.height;
|
||||
openings = Z_Calloc(1, maxopenings * sizeof(*openings), PU_RENDERER, NULL);
|
||||
|
||||
xtoskyangle = linearsky ? linearskyangle : xtoviewangle;
|
||||
}
|
||||
|
@ -28,7 +28,8 @@ struct visplane_s;
|
||||
#define PL_SKYFLAT (0x80000000)
|
||||
|
||||
// Visplane related.
|
||||
extern int *lastopening; // [FG] 32-bit integer math
|
||||
extern int maxopenings;
|
||||
extern int *openings, *lastopening; // [FG] 32-bit integer math
|
||||
|
||||
extern int *floorclip, *ceilingclip; // [FG] 32-bit integer math
|
||||
extern fixed_t *yslope, *distscale;
|
||||
|
@ -566,6 +566,13 @@ void R_StoreWallRange(const int start, const int stop)
|
||||
ds_p->curline = curline;
|
||||
rw_stopx = stop+1;
|
||||
|
||||
ptrdiff_t pos = lastopening - openings;
|
||||
size_t need = (rw_stopx - start) * sizeof(*lastopening) + pos;
|
||||
if (need > maxopenings)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// WiggleFix: add this line, in r_segs.c:R_StoreWallRange,
|
||||
// right before calls to R_ScaleFromGlobalAngle
|
||||
R_FixWiggle(frontsector);
|
||||
|
Loading…
x
Reference in New Issue
Block a user