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
Branches
Tags
Loading
......@@ -279,6 +279,7 @@ void Portal_AddSkybox (const visplane_t* plane)
if (skyboxmo[1])
{
fixed_t x = 0, y = 0;
angle_t ang = skyboxmo[0]->angle>>ANGLETOFINESHIFT;
if (mh->skybox_scalex > 0)
x = (viewx - skyboxmo[1]->x) / mh->skybox_scalex;
......@@ -290,8 +291,9 @@ void Portal_AddSkybox (const visplane_t* plane)
else if (mh->skybox_scaley < 0)
y = (viewy - skyboxmo[1]->y) * -mh->skybox_scaley;
portal->viewx += x;
portal->viewy += y;
// Apply transform to account for the skybox viewport angle.
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment