Skip to content

Commit

Permalink
Fixed: Fakeradio edge shadow polys were being rendered for the rotati…
Browse files Browse the repository at this point in the history
…ng "gears" in jHexen MAP14.
  • Loading branch information
danij committed Mar 25, 2007
1 parent 3ca303a commit e581d14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_data.h
Expand Up @@ -186,7 +186,7 @@ typedef struct linkmobj_s {
#define SHPF_FRONTSIDE 0x1

typedef struct shadowpoly_s {
struct line_s *line;
struct seg_s *seg;
struct subsector_s *ssec;
short flags;
ushort visframe; // Last visible frame (for rendering).
Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/portable/src/r_shadow.c
Expand Up @@ -140,7 +140,7 @@ void R_ShadowDelta(pvec2_t delta, line_t *line, sector_t *frontSector)

side_t *R_GetShadowLineSide(shadowpoly_t *poly)
{
return (poly->line->sides[poly->flags & SHPF_FRONTSIDE ? FRONT : BACK]);
return (poly->seg->linedef->sides[poly->flags & SHPF_FRONTSIDE ? FRONT : BACK]);
}

line_t *R_GetShadowNeighbor(shadowpoly_t *poly, boolean left, boolean back)
Expand All @@ -158,7 +158,7 @@ sector_t *R_GetShadowSector(shadowpoly_t *poly, uint pln, boolean getLinked)
{
if(getLinked)
return R_GetLinkedSector(poly->ssec, pln);
return (poly->line->sec[poly->flags & SHPF_FRONTSIDE ? FRONT : BACK]);
return (poly->seg->linedef->sec[poly->flags & SHPF_FRONTSIDE ? FRONT : BACK]);
}

/**
Expand All @@ -181,7 +181,7 @@ boolean R_ShadowCornerDeltas(pvec2_t left, pvec2_t right, shadowpoly_t *poly,
line_t *neighbor;

// The line itself.
R_ShadowDelta(leftCorner ? right : left, poly->line, sector);
R_ShadowDelta(leftCorner ? right : left, poly->seg->linedef, sector);

// The (back)neighbour.
if(NULL == (neighbor = R_GetShadowNeighbor(poly, leftCorner, back)))
Expand Down Expand Up @@ -465,7 +465,7 @@ void R_ResolveOverlaps(shadowpoly_t *polys, uint count, sector_t *sector)
{
//if(i == k) continue;
line = sector->Lines[k];
if(polys[i].line == line)
if(polys[i].seg->linedef == line)
continue;

if(line->selfrefhackroot)
Expand Down Expand Up @@ -568,7 +568,7 @@ uint R_MakeShadowEdges(shadowpoly_t *storage)
// Get a new shadow poly.
poly = allocator++;

poly->line = line;
poly->seg = seg;
poly->ssec = ssec;
poly->flags = (frontside ? SHPF_FRONTSIDE : 0);
poly->visframe = framecount - 1;
Expand Down
7 changes: 6 additions & 1 deletion doomsday/engine/portable/src/rend_fakeradio.c
Expand Up @@ -1357,6 +1357,11 @@ BEGIN_PROF( PROF_RADIO_SUBSECTOR );

// Now it will be rendered.
shadow = link->poly;

// Unless seg is part of a polyobject.
if(shadow->seg->flags & SEGF_POLYOBJ)
continue;

shadow->visframe = (ushort) framecount;

// Determine the openness of the line and its neighbors. If
Expand Down Expand Up @@ -1384,7 +1389,7 @@ BEGIN_PROF( PROF_RADIO_SUBSECTOR );
if(M_DotProduct(vec, suf->normal) < 0)
continue;

line = shadow->line;
line = shadow->seg->linedef;
if(line->L_backsector)
{
side = (shadow->flags & SHPF_FRONTSIDE) == 0;
Expand Down

0 comments on commit e581d14

Please sign in to comment.