Skip to content

Commit

Permalink
Added R_GetLineForSide
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 12, 2003
1 parent 81a3574 commit a7f112e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doomsday/Include/r_util.h
Expand Up @@ -9,7 +9,7 @@ int R_PointOnSegSide (fixed_t x, fixed_t y, seg_t *line);
angle_t R_PointToAngle (fixed_t x, fixed_t y);
angle_t R_PointToAngle2 (fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
fixed_t R_PointToDist (fixed_t x, fixed_t y);
subsector_t *R_PointInSubsector (fixed_t x, fixed_t y);

subsector_t* R_PointInSubsector (fixed_t x, fixed_t y);
line_t* R_GetLineForSide(int sideNumber);

#endif
21 changes: 21 additions & 0 deletions doomsday/Src/r_util.c
Expand Up @@ -247,3 +247,24 @@ subsector_t *R_PointInSubsector (fixed_t x, fixed_t y)
return SUBSECTOR_PTR(nodenum & ~NF_SUBSECTOR);
}

//===========================================================================
// R_GetLineForSide
//===========================================================================
line_t *R_GetLineForSide(int sideNumber)
{
side_t *side = SIDE_PTR(sideNumber);
sector_t *sector = side->sector;
int i;

// Do all sides have a sector? (Possibly...)
if(!sector) return NULL;

for(i = 0; i < sector->linecount; i++)
if(sector->lines[i]->sidenum[0] == sideNumber
|| sector->lines[i]->sidenum[1] == sideNumber)
{
return sector->lines[i];
}

return NULL;
}

0 comments on commit a7f112e

Please sign in to comment.