mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Parallax the parallax skies (bug 2783074).
git-svn-id: https://svn.eduke32.com/eduke32@1374 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
72721c1663
commit
3cd91a1832
1 changed files with 18 additions and 2 deletions
|
@ -775,8 +775,9 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
||||||
{
|
{
|
||||||
int16_t cursectnum;
|
int16_t cursectnum;
|
||||||
int32_t i, cursectflorz, cursectceilz;
|
int32_t i, cursectflorz, cursectceilz;
|
||||||
float ang, tiltang;
|
float skyhoriz, ang, tiltang;
|
||||||
float pos[3];
|
float pos[3];
|
||||||
|
pthtyp* pth;
|
||||||
|
|
||||||
if (!rendmode) return;
|
if (!rendmode) return;
|
||||||
|
|
||||||
|
@ -809,11 +810,26 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
||||||
if (pr_shadows && lightcount && (pr_shadowcount > 0))
|
if (pr_shadows && lightcount && (pr_shadowcount > 0))
|
||||||
polymer_prepareshadows();
|
polymer_prepareshadows();
|
||||||
|
|
||||||
|
// hack for parallax skies
|
||||||
|
skyhoriz = horizang;
|
||||||
|
if (skyhoriz < -180.0f)
|
||||||
|
skyhoriz += 360.0f;
|
||||||
|
|
||||||
|
drawingskybox = 1;
|
||||||
|
pth = gltexcache(cursky,0,0);
|
||||||
|
drawingskybox = 0;
|
||||||
|
|
||||||
|
// if it's not a skybox, make the sky parallax
|
||||||
|
// the angle factor is computed from eyeballed values
|
||||||
|
// need to recompute it if we ever change the max horiz amplitude
|
||||||
|
if (!pth || !(pth->flags & 4))
|
||||||
|
skyhoriz /= 4.3027;
|
||||||
|
|
||||||
bglMatrixMode(GL_MODELVIEW);
|
bglMatrixMode(GL_MODELVIEW);
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
|
|
||||||
bglRotatef(tiltang, 0.0f, 0.0f, -1.0f);
|
bglRotatef(tiltang, 0.0f, 0.0f, -1.0f);
|
||||||
bglRotatef(horizang, 1.0f, 0.0f, 0.0f);
|
bglRotatef(skyhoriz, 1.0f, 0.0f, 0.0f);
|
||||||
bglRotatef(ang, 0.0f, 1.0f, 0.0f);
|
bglRotatef(ang, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
||||||
bglScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f);
|
bglScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f);
|
||||||
|
|
Loading…
Reference in a new issue