Skip to content
Snippets Groups Projects
Commit a1b2a0a3 authored by Nev3r's avatar Nev3r
Browse files

Properly take skybox viewpoint angle into account.

parent ae699762
No related branches found
No related tags found
No related merge requests found
...@@ -279,6 +279,7 @@ void Portal_AddSkybox (const visplane_t* plane) ...@@ -279,6 +279,7 @@ void Portal_AddSkybox (const visplane_t* plane)
if (skyboxmo[1]) if (skyboxmo[1])
{ {
fixed_t x = 0, y = 0; fixed_t x = 0, y = 0;
angle_t ang = skyboxmo[0]->angle>>ANGLETOFINESHIFT;
if (mh->skybox_scalex > 0) if (mh->skybox_scalex > 0)
x = (viewx - skyboxmo[1]->x) / mh->skybox_scalex; x = (viewx - skyboxmo[1]->x) / mh->skybox_scalex;
...@@ -290,8 +291,9 @@ void Portal_AddSkybox (const visplane_t* plane) ...@@ -290,8 +291,9 @@ void Portal_AddSkybox (const visplane_t* plane)
else if (mh->skybox_scaley < 0) else if (mh->skybox_scaley < 0)
y = (viewy - skyboxmo[1]->y) * -mh->skybox_scaley; y = (viewy - skyboxmo[1]->y) * -mh->skybox_scaley;
portal->viewx += x; // Apply transform to account for the skybox viewport angle.
portal->viewy += y; portal->viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang));
portal->viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang));
} }
if (mh->skybox_scalez > 0) if (mh->skybox_scalez > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment