Skip to content

Commit

Permalink
Fixed incomplete initialization of a plane's surface_t in R_NewPlaneF…
Browse files Browse the repository at this point in the history
…orSector.
  • Loading branch information
danij committed Nov 3, 2008
1 parent 271c42e commit 2107730
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions doomsday/engine/portable/src/r_world.c
Expand Up @@ -566,18 +566,10 @@ plane_t* R_NewPlaneForSector(sector_t* sec)
plane->type = PLN_MID;
plane->planeID = sec->planeCount-1;

suf = &plane->surface;

// Setup header for DMU.
suf->header.type = DMU_SURFACE;

// Initialize the surface.
suf->flags = suf->oldFlags = 0;
suf->decorations = NULL;
suf->numDecorations = 0;
suf->frameFlags = 0;
suf->normal[VX] = suf->oldNormal[VX] = 0;
suf->normal[VY] = suf->oldNormal[VY] = 0;
memset(&plane->surface, 0, sizeof(plane->surface));
suf = &plane->surface;
suf->header.type = DMU_SURFACE; // Setup header for DMU.
suf->normal[VZ] = suf->oldNormal[VZ] = 1;
// \todo The initial material should be the "unknown" material.
Surface_SetMaterial(suf, NULL);
Expand Down Expand Up @@ -1181,7 +1173,6 @@ linedef_t *R_FindSolidLineNeighbor(const sector_t *sector,
lineowner_t *cown = own->link[!antiClockwise];
linedef_t *other = cown->lineDef;
int side;
boolean skip = false;

if(other == line)
return NULL;
Expand Down Expand Up @@ -1883,9 +1874,17 @@ void R_UpdateSector(sector_t* sec, boolean forceUpdate)
(plane->PS_material && (plane->PS_material->flags & MATF_GLOW)))
{
R_MaterialGetColor(plane->PS_material, plane->glowRGB);







hasGlow = true;
}


if(hasGlow)
{
plane->glow = 4; // Default height factor is 4
Expand Down

0 comments on commit 2107730

Please sign in to comment.