mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-08 16:52:10 +00:00
maps: improve texture coordinates
Discussed in https://github.com/yquake2/yquake2/issues/886
This commit is contained in:
parent
e095dc1672
commit
5ea0a76f76
1 changed files with 10 additions and 7 deletions
|
@ -352,10 +352,9 @@ void
|
||||||
Mod_CalcSurfaceExtents(int *surfedges, mvertex_t *vertexes, medge_t *edges,
|
Mod_CalcSurfaceExtents(int *surfedges, mvertex_t *vertexes, medge_t *edges,
|
||||||
msurface_t *s)
|
msurface_t *s)
|
||||||
{
|
{
|
||||||
float mins[2], maxs[2], val;
|
double mins[2], maxs[2];
|
||||||
int i;
|
|
||||||
mtexinfo_t *tex;
|
mtexinfo_t *tex;
|
||||||
int bmins[2], bmaxs[2];
|
int i;
|
||||||
|
|
||||||
mins[0] = mins[1] = 999999;
|
mins[0] = mins[1] = 999999;
|
||||||
maxs[0] = maxs[1] = -99999;
|
maxs[0] = maxs[1] = -99999;
|
||||||
|
@ -380,10 +379,12 @@ Mod_CalcSurfaceExtents(int *surfedges, mvertex_t *vertexes, medge_t *edges,
|
||||||
|
|
||||||
for (j = 0; j < 2; j++)
|
for (j = 0; j < 2; j++)
|
||||||
{
|
{
|
||||||
val = v->position[0] * tex->vecs[j][0] +
|
float val;
|
||||||
v->position[1] * tex->vecs[j][1] +
|
|
||||||
v->position[2] * tex->vecs[j][2] +
|
val = (double)v->position[0] * tex->vecs[j][0] +
|
||||||
tex->vecs[j][3];
|
(double)v->position[1] * tex->vecs[j][1] +
|
||||||
|
(double)v->position[2] * tex->vecs[j][2] +
|
||||||
|
(double)tex->vecs[j][3];
|
||||||
|
|
||||||
if (val < mins[j])
|
if (val < mins[j])
|
||||||
{
|
{
|
||||||
|
@ -399,6 +400,8 @@ Mod_CalcSurfaceExtents(int *surfedges, mvertex_t *vertexes, medge_t *edges,
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
|
int bmins[2], bmaxs[2];
|
||||||
|
|
||||||
bmins[i] = floor(mins[i] / (1 << s->lmshift));
|
bmins[i] = floor(mins[i] / (1 << s->lmshift));
|
||||||
bmaxs[i] = ceil(maxs[i] / (1 << s->lmshift));
|
bmaxs[i] = ceil(maxs[i] / (1 << s->lmshift));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue