mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- allow 90° rotations in skybox sectors.
This commit is contained in:
parent
0a35027f67
commit
8a010ab871
1 changed files with 12 additions and 8 deletions
|
@ -339,33 +339,37 @@ void GLFlat::DrawSkyboxSector(int pass, bool processlights)
|
||||||
}
|
}
|
||||||
|
|
||||||
float z = plane.plane.ZatPoint(0., 0.) + dz;
|
float z = plane.plane.ZatPoint(0., 0.) + dz;
|
||||||
|
static float uvals[] = { 0, 0, 1, 1 };
|
||||||
|
static float vvals[] = { 1, 0, 0, 1 };
|
||||||
|
int rot = -xs_FloorToInt(plane.Angle / 90.f);
|
||||||
|
|
||||||
|
|
||||||
ptr->x = minx;
|
ptr->x = minx;
|
||||||
ptr->z = z;
|
ptr->z = z;
|
||||||
ptr->y = miny;
|
ptr->y = miny;
|
||||||
ptr->u = 0;
|
ptr->u = uvals[rot & 3];
|
||||||
ptr->v = 1;
|
ptr->v = vvals[rot & 3];
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
ptr->x = minx;
|
ptr->x = minx;
|
||||||
ptr->z = z;
|
ptr->z = z;
|
||||||
ptr->y = maxy;
|
ptr->y = maxy;
|
||||||
ptr->u = 0;
|
ptr->u = uvals[(rot + 1) & 3];
|
||||||
ptr->v = 0;
|
ptr->v = vvals[(rot + 1) & 3];
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
ptr->x = maxx;
|
ptr->x = maxx;
|
||||||
ptr->z = z;
|
ptr->z = z;
|
||||||
ptr->y = maxy;
|
ptr->y = maxy;
|
||||||
ptr->u = 1;
|
ptr->u = uvals[(rot + 2) & 3];
|
||||||
ptr->v = 0;
|
ptr->v = vvals[(rot + 2) & 3];
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
ptr->x = maxx;
|
ptr->x = maxx;
|
||||||
ptr->z = z;
|
ptr->z = z;
|
||||||
ptr->y = miny;
|
ptr->y = miny;
|
||||||
ptr->u = 1;
|
ptr->u = uvals[(rot + 3) & 3];
|
||||||
ptr->v = 1;
|
ptr->v = vvals[(rot + 3) & 3];
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
GLRenderer->mVBO->RenderCurrent(ptr, GL_TRIANGLE_FAN);
|
GLRenderer->mVBO->RenderCurrent(ptr, GL_TRIANGLE_FAN);
|
||||||
|
|
Loading…
Reference in a new issue