light: CalcPoints: use faceextents_t::LMCoordToWorld
This commit is contained in:
parent
f3cc0907c8
commit
9edadf93cd
|
|
@ -388,9 +388,10 @@ static void CalcPoints(
|
||||||
|
|
||||||
surf->width = surf->extents.width() * light_options.extra.value();
|
surf->width = surf->extents.width() * light_options.extra.value();
|
||||||
surf->height = surf->extents.height() * light_options.extra.value();
|
surf->height = surf->extents.height() * light_options.extra.value();
|
||||||
const float starts = (surf->extents.texmins[0] - 0.5 + (0.5 / light_options.extra.value())) * surf->lightmapscale;
|
|
||||||
const float startt = (surf->extents.texmins[1] - 0.5 + (0.5 / light_options.extra.value())) * surf->lightmapscale;
|
const float starts = -0.5 + (0.5 / light_options.extra.value());
|
||||||
const float st_step = surf->lightmapscale / light_options.extra.value();
|
const float startt = -0.5 + (0.5 / light_options.extra.value());
|
||||||
|
const float st_step = 1.0f / light_options.extra.value();
|
||||||
|
|
||||||
/* Allocate surf->points */
|
/* Allocate surf->points */
|
||||||
size_t num_points = surf->width * surf->height;
|
size_t num_points = surf->width * surf->height;
|
||||||
|
|
@ -412,7 +413,7 @@ static void CalcPoints(
|
||||||
const vec_t us = starts + s * st_step;
|
const vec_t us = starts + s * st_step;
|
||||||
const vec_t ut = startt + t * st_step;
|
const vec_t ut = startt + t * st_step;
|
||||||
|
|
||||||
point = surf->extents.texCoordToWorld(qvec2f(us, ut)) +
|
point = surf->extents.LMCoordToWorld(qvec2f(us, ut)) +
|
||||||
surf->plane.normal; // one unit in front of face
|
surf->plane.normal; // one unit in front of face
|
||||||
|
|
||||||
// do this before correcting the point, so we can wrap around the inside of pipes
|
// do this before correcting the point, so we can wrap around the inside of pipes
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ static void LoadTestmap(const std::filesystem::path &name, std::vector<std::stri
|
||||||
{
|
{
|
||||||
std::vector<std::string> light_args{
|
std::vector<std::string> light_args{
|
||||||
"", // the exe path, which we're ignoring in this case
|
"", // the exe path, which we're ignoring in this case
|
||||||
|
"-extra",
|
||||||
bsp_path.string()
|
bsp_path.string()
|
||||||
};
|
};
|
||||||
light_main(light_args);
|
light_main(light_args);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue