mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-20 16:00:44 +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
a0c21069fa
commit
7b0736e208
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;
|
float wu, wv, temp;
|
||||||
vec3_t end;
|
vec3_t end;
|
||||||
|
int half_width = vid.width >> 1;
|
||||||
|
int half_height = vid.height >> 1;
|
||||||
|
|
||||||
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
||||||
temp = (float) r_refdef.vrect.width;
|
temp = (float) r_refdef.vrect.width;
|
||||||
else
|
else
|
||||||
temp = (float) r_refdef.vrect.height;
|
temp = (float) r_refdef.vrect.height;
|
||||||
|
|
||||||
wu = 8192.0 * (float) (u - (vid.width >> 1)) / temp;
|
wu = 8192.0 * (float) (u - half_width) / temp;
|
||||||
wv = 8192.0 * (float) ((vid.height >> 1) - v) / temp;
|
wv = 8192.0 * (float) (half_height - v) / temp;
|
||||||
|
|
||||||
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
||||||
end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1];
|
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;
|
float wu, wv, temp;
|
||||||
vec3_t end;
|
vec3_t end;
|
||||||
|
int half_width = vid.width >> 1;
|
||||||
|
int half_height = vid.height >> 1;
|
||||||
|
|
||||||
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
if (r_refdef.vrect.width >= r_refdef.vrect.height)
|
||||||
temp = (float) r_refdef.vrect.width;
|
temp = (float) r_refdef.vrect.width;
|
||||||
else
|
else
|
||||||
temp = (float) r_refdef.vrect.height;
|
temp = (float) r_refdef.vrect.height;
|
||||||
|
|
||||||
wu = 8192.0 * (float) (u - (vid.width >> 1)) / temp;
|
wu = 8192.0 * (float) (u - half_width) / temp;
|
||||||
wv = 8192.0 * (float) ((vid.height >> 1) - v) / temp;
|
wv = 8192.0 * (float) (half_height - v) / temp;
|
||||||
|
|
||||||
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0];
|
||||||
end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1];
|
end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1];
|
||||||
|
|
Loading…
Reference in a new issue