Browse Source

ref_soft: Fix crash on x86

pull/2/head
mittorn 6 years ago
parent
commit
a2e689aba3
  1. 9
      r_local.h
  2. 3
      r_main.c
  3. 4
      r_rast.c

9
r_local.h

@ -779,11 +779,11 @@ extern cvar_t *r_showhull; @@ -779,11 +779,11 @@ extern cvar_t *r_showhull;
#define DS_SPAN_LIST_END -128
#define NUMSTACKEDGES 4000
#define NUMSTACKEDGES 2000
#define MINEDGES NUMSTACKEDGES
#define NUMSTACKSURFACES 2000
#define NUMSTACKSURFACES 1000
#define MINSURFACES NUMSTACKSURFACES
#define MAXSPANS 6000
#define MAXSPANS 3000
// flags in finalvert_t.flags
#define ALIAS_LEFT_CLIP 0x0001
@ -1256,6 +1256,9 @@ void TransformVector (vec3_t in, vec3_t out); @@ -1256,6 +1256,9 @@ void TransformVector (vec3_t in, vec3_t out);
void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf);
void R_RenderFace (msurface_t *fa, int clipflags);
#if id386
#error aaa
#endif
//
// engine callbacks

3
r_main.c

@ -1216,6 +1216,7 @@ void R_EdgeDrawing (void) @@ -1216,6 +1216,7 @@ void R_EdgeDrawing (void)
surf_max = &surfaces[r_cnumsurfs];
// surface 0 doesn't really exist; it's just a dummy because index 0
// is used to indicate no edge attached to surface
memset(&surfaces[0], 0, sizeof(surf_t));
surfaces--;
R_SurfacePatch ();
}
@ -1596,7 +1597,7 @@ void R_NewMap (void) @@ -1596,7 +1597,7 @@ void R_NewMap (void)
if (r_cnumsurfs > NUMSTACKSURFACES)
{
surfaces = malloc (r_cnumsurfs * sizeof(surf_t));
surfaces = Mem_Calloc (r_temppool, r_cnumsurfs * sizeof(surf_t));
surface_p = surfaces;
surf_max = &surfaces[r_cnumsurfs];
r_surfsonstack = false;

4
r_rast.c

@ -726,7 +726,7 @@ void R_RenderFace (msurface_t *fa, int clipflags) @@ -726,7 +726,7 @@ void R_RenderFace (msurface_t *fa, int clipflags)
surface_p->msurf = fa;
surface_p->nearzi = r_nearzi;
surface_p->flags = fa->flags;
//surface_p->insubmodel = insubmodel;
surface_p->insubmodel = false;
surface_p->spanstate = 0;
surface_p->entity = RI.currententity;
surface_p->key = r_currentkey++;
@ -847,7 +847,7 @@ void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf) @@ -847,7 +847,7 @@ void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
surface_p->msurf = psurf;
surface_p->nearzi = r_nearzi;
surface_p->flags = psurf->flags;
surface_p->insubmodel = true;
surface_p->insubmodel = false; //true;
surface_p->spanstate = 0;
surface_p->entity = RI.currententity;
surface_p->key = r_currentbkey;

Loading…
Cancel
Save