light: lightsurf_t: remove texorg member

This commit is contained in:
Eric Wasylishen 2022-10-30 19:40:26 -06:00
parent 728fafde8c
commit 383266762d
2 changed files with 3 additions and 13 deletions

View File

@ -78,11 +78,6 @@ public:
const img::texture *suntexture_value;
};
struct texorg_t
{
qmat4x4f texSpaceToWorld;
};
class modelinfo_t;
namespace settings
{
@ -136,8 +131,6 @@ struct lightsurf_t
*/
std::vector<uint8_t> pvs;
/* stuff used by CalcPoint */
texorg_t texorg;
int width, height;
/* for lit water. receive light from either front or back. */

View File

@ -374,9 +374,9 @@ static position_t PositionSamplePointOnFace(
return position_t(face, point, pointNormal);
}
constexpr qvec3d TexCoordToWorld(vec_t s, vec_t t, const texorg_t *texorg)
constexpr qvec3d TexCoordToWorld(vec_t s, vec_t t, const qmat4x4f &texSpaceToWorld)
{
return (texorg->texSpaceToWorld * qvec4f(s, t, /* one "unit" in front of surface */ 1.0, 1.0)).xyz();
return (texSpaceToWorld * qvec4f(s, t, /* one "unit" in front of surface */ 1.0, 1.0)).xyz();
}
/*
@ -417,7 +417,7 @@ static void CalcPoints(
const vec_t us = starts + s * st_step;
const vec_t ut = startt + t * st_step;
point = TexCoordToWorld(us, ut, &surf->texorg);
point = TexCoordToWorld(us, ut, surf->extents.texCoordToWorldMatrix);
// do this before correcting the point, so we can wrap around the inside of pipes
const bool phongshaded = (surf->curved && cfg.phongallowed.value());
@ -695,9 +695,6 @@ static std::unique_ptr<lightsurf_t> Lightsurf_Init(const modelinfo_t *modelinfo,
plane = bsp->dplanes[face->planenum];
}
/* Set up the texorg for coordinate transformation */
lightsurf->texorg.texSpaceToWorld = spaceToWorld;
const mtexinfo_t *tex = &bsp->texinfo[face->texinfo];
lightsurf->snormal = qv::normalize(tex->vecs.row(0).xyz());
lightsurf->tnormal = -qv::normalize(tex->vecs.row(1).xyz());