Remove DepthScale and DepthOrg from FWallTmapVals

This commit is contained in:
Randy Heit 2014-08-07 22:58:11 -05:00
parent 891b3da103
commit bf0856aef5
3 changed files with 3 additions and 11 deletions

View file

@ -821,7 +821,6 @@ void FWallTmapVals::InitFromWallCoords(const FWallCoords *wallc)
InvZorg = (float)(wallc->tx1 - wallc->tx2) * centerx; InvZorg = (float)(wallc->tx1 - wallc->tx2) * centerx;
InvZstep = (float)(wallc->ty2 - wallc->ty1); InvZstep = (float)(wallc->ty2 - wallc->ty1);
} }
InitDepth();
} }
void FWallTmapVals::InitFromLine(int tx1, int ty1, int tx2, int ty2) void FWallTmapVals::InitFromLine(int tx1, int ty1, int tx2, int ty2)
@ -841,13 +840,6 @@ void FWallTmapVals::InitFromLine(int tx1, int ty1, int tx2, int ty2)
UoverZstep = (float)(-fully1); UoverZstep = (float)(-fully1);
InvZorg = (float)(fullx1 - fullx2) * centerx; InvZorg = (float)(fullx1 - fullx2) * centerx;
InvZstep = (float)(fully2 - fully1); InvZstep = (float)(fully2 - fully1);
InitDepth();
}
void FWallTmapVals::InitDepth()
{
DepthScale = InvZstep * WallTMapScale2;
DepthOrg = -UoverZstep * WallTMapScale2;
} }
// //

View file

@ -44,13 +44,11 @@ struct FWallCoords
struct FWallTmapVals struct FWallTmapVals
{ {
float DepthOrg, DepthScale;
float UoverZorg, UoverZstep; float UoverZorg, UoverZstep;
float InvZorg, InvZstep; float InvZorg, InvZstep;
void InitFromWallCoords(const FWallCoords *wallc); void InitFromWallCoords(const FWallCoords *wallc);
void InitFromLine(int x1, int y1, int x2, int y2); void InitFromLine(int x1, int y1, int x2, int y2);
void InitDepth();
}; };
extern FWallCoords WallC; extern FWallCoords WallC;

View file

@ -2893,6 +2893,8 @@ void PrepWall (fixed_t *swall, fixed_t *lwall, fixed_t walxrepeat, int x1, int x
{ // swall = scale, lwall = texturecolumn { // swall = scale, lwall = texturecolumn
double top, bot, i; double top, bot, i;
double xrepeat = fabs((double)walxrepeat); double xrepeat = fabs((double)walxrepeat);
double depth_scale = WallT.InvZstep * WallTMapScale2;
double depth_org = -WallT.UoverZstep * WallTMapScale2;
i = x1 - centerx; i = x1 - centerx;
top = WallT.UoverZorg + WallT.UoverZstep * i; top = WallT.UoverZorg + WallT.UoverZstep * i;
@ -2909,7 +2911,7 @@ void PrepWall (fixed_t *swall, fixed_t *lwall, fixed_t walxrepeat, int x1, int x
{ {
lwall[x] = xs_RoundToInt(frac * xrepeat); lwall[x] = xs_RoundToInt(frac * xrepeat);
} }
swall[x] = xs_RoundToInt(frac * WallT.DepthScale + WallT.DepthOrg); swall[x] = xs_RoundToInt(frac * depth_scale + depth_org);
top += WallT.UoverZstep; top += WallT.UoverZstep;
bot += WallT.InvZstep; bot += WallT.InvZstep;
} }