mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[sw,sw32] Fix broken software skies
All for an unfortunate unsigned promotion. I guess I just wasn't testing the software renderers enough.
This commit is contained in:
parent
d75726dd22
commit
981fcca76d
2 changed files with 8 additions and 4 deletions
|
@ -42,14 +42,16 @@ D_Sky_uv_To_st (int u, int v, fixed16_t *s, fixed16_t *t)
|
|||
{
|
||||
float wu, wv, temp;
|
||||
vec3_t end;
|
||||
int half_width = vid.width >> 1;
|
||||
int half_height = vid.height >> 1;
|
||||
|
||||
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
||||
temp = (float) r_refdef.vrect.width;
|
||||
else
|
||||
temp = (float) r_refdef.vrect.height;
|
||||
|
||||
wu = 8192.0 * (float) (u - (vid.width >> 1)) / temp;
|
||||
wv = 8192.0 * (float) ((vid.height >> 1) - v) / temp;
|
||||
wu = 8192.0 * (float) (u - half_width) / temp;
|
||||
wv = 8192.0 * (float) (half_height - v) / temp;
|
||||
|
||||
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
||||
end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1];
|
||||
|
|
|
@ -47,14 +47,16 @@ D_Sky_uv_To_st (int u, int v, fixed16_t *s, fixed16_t *t)
|
|||
{
|
||||
float wu, wv, temp;
|
||||
vec3_t end;
|
||||
int half_width = vid.width >> 1;
|
||||
int half_height = vid.height >> 1;
|
||||
|
||||
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
||||
temp = (float) r_refdef.vrect.width;
|
||||
else
|
||||
temp = (float) r_refdef.vrect.height;
|
||||
|
||||
wu = 8192.0 * (float) (u - (vid.width >> 1)) / temp;
|
||||
wv = 8192.0 * (float) ((vid.height >> 1) - v) / temp;
|
||||
wu = 8192.0 * (float) (u - half_width) / temp;
|
||||
wv = 8192.0 * (float) (half_height - v) / temp;
|
||||
|
||||
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
||||
end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1];
|
||||
|
|
Loading…
Reference in a new issue