distangle = ANG90 - offsetangle;
hyp = R_PointToDist (curline->v1->x, curline->v1->y); sineval = finesine[distangle>>ANGLETOFINESHIFT]; rw_distance = FixedMul (hyp, sineval);
ds_p->x1 = rw_x = start; ds_p->x2 = stop; ds_p->curline = curline; rw_stopx = stop+1;
// calculate scale at both ends and step ds_p->scale1 = rw_scale =
R_ScaleFromGlobalAngle (viewangle + xtoviewangle[start]);
if (stop > start )
{
ds_p->scale2 = R_ScaleFromGlobalAngle (viewangle + xtoviewangle[stop]); ds_p->scalestep = rw_scalestep =
(ds_p->scale2 - rw_scale) / (stop-start);
}
else
{
// UNUSED: try to fix the stretched line bug
#if 0
if (rw_distance < FRACUNIT/2)
{
fixed_t |
trx,try; |
fixed_t |
gxt,gyt; |
trx = curline->v1->x - viewx; try = curline->v1->y - viewy;
gxt = FixedMul(trx,viewcos); gyt = -FixedMul(try,viewsin);
ds_p->scale1 = FixedDiv(projection, gxt-gyt)<<detailshift;
}
#endif
ds_p->scale2 = ds_p->scale1;
}
//calculate texture boundaries
//and decide if floor / ceiling marks are needed worldtop = frontsector->ceilingheight - viewz; worldbottom = frontsector->floorheight - viewz;
midtexture = toptexture = bottomtexture = maskedtexture = 0; ds_p->maskedtexturecol = NULL;
if (!backsector)
{
// single sided line
midtexture = texturetranslation[sidedef->midtexture];
// a single sided line is terminal, so it must mark ends markfloor = markceiling = true;
if (linedef->flags & ML_DONTPEGBOTTOM)
{
vtop = frontsector->floorheight + textureheight[sidedef->midtexture];
// bottom of texture at bottom rw_midtexturemid = vtop - viewz;
}
else
{
// top of texture at top