mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- encountered a strange crash that after changing a map, InSubsector was not NULL and pointing to invalid data. So let's better NULL this variable explicitly each time a render loop is started.
This commit is contained in:
parent
4ebdcb7b6d
commit
e11a0986ce
3 changed files with 8 additions and 2 deletions
|
@ -101,7 +101,7 @@ WORD MirrorFlags;
|
|||
TArray<PortalDrawseg> WallPortals(1000); // note: this array needs to go away as reallocation can cause crashes.
|
||||
|
||||
|
||||
static subsector_t *InSubsector;
|
||||
subsector_t *InSubsector;
|
||||
|
||||
CVAR (Bool, r_drawflat, false, 0) // [RH] Don't texture segs?
|
||||
|
||||
|
|
|
@ -86,6 +86,8 @@ static void R_ShutdownRenderer();
|
|||
extern short *openings;
|
||||
extern bool r_fakingunderwater;
|
||||
extern "C" int fuzzviewheight;
|
||||
extern subsector_t *InSubsector;
|
||||
extern bool r_showviewer;
|
||||
|
||||
|
||||
// PRIVATE DATA DECLARATIONS -----------------------------------------------
|
||||
|
@ -93,7 +95,6 @@ extern "C" int fuzzviewheight;
|
|||
static float CurrentVisibility = 8.f;
|
||||
static fixed_t MaxVisForWall;
|
||||
static fixed_t MaxVisForFloor;
|
||||
extern bool r_showviewer;
|
||||
bool r_dontmaplines;
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
@ -772,6 +773,7 @@ void R_EnterPortal (PortalDrawseg* pds, int depth)
|
|||
memcpy (ceilingclip + pds->x1, &pds->ceilingclip[0], pds->len*sizeof(*ceilingclip));
|
||||
memcpy (floorclip + pds->x1, &pds->floorclip[0], pds->len*sizeof(*floorclip));
|
||||
|
||||
InSubsector = NULL;
|
||||
R_RenderBSPNode (nodes + numnodes - 1);
|
||||
R_3D_ResetClip(); // reset clips (floor/ceiling)
|
||||
|
||||
|
@ -916,6 +918,7 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
|
|||
}
|
||||
// Link the polyobjects right before drawing the scene to reduce the amounts of calls to this function
|
||||
PO_LinkToSubsectors();
|
||||
InSubsector = NULL;
|
||||
R_RenderBSPNode (nodes + numnodes - 1); // The head node is the last node output.
|
||||
R_3D_ResetClip(); // reset clips (floor/ceiling)
|
||||
camera->renderflags = savedflags;
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
//EXTERN_CVAR (Int, tx)
|
||||
//EXTERN_CVAR (Int, ty)
|
||||
|
||||
extern subsector_t *InSubsector;
|
||||
|
||||
static void R_DrawSkyStriped (visplane_t *pl);
|
||||
|
||||
planefunction_t floorfunc;
|
||||
|
@ -1314,6 +1316,7 @@ void R_DrawSkyBoxes ()
|
|||
viewzStack.Push (viewz);
|
||||
visplaneStack.Push (pl);
|
||||
|
||||
InSubsector = NULL;
|
||||
R_RenderBSPNode (nodes + numnodes - 1);
|
||||
R_3D_ResetClip(); // reset clips (floor/ceiling)
|
||||
R_DrawPlanes ();
|
||||
|
|
Loading…
Reference in a new issue