mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
OpenGL cast to float, not store in double
This commit is contained in:
parent
0672db9e44
commit
f576e61753
1 changed files with 8 additions and 8 deletions
|
@ -1404,7 +1404,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf,
|
|||
|
||||
typedef struct vbo_vertex_s
|
||||
{
|
||||
double x, y, z;
|
||||
float x, y, z;
|
||||
float u, v;
|
||||
unsigned char r, g, b, a;
|
||||
} vbo_vertex_t;
|
||||
|
@ -1448,17 +1448,17 @@ static INT32 lasttex = -1;
|
|||
|
||||
static void SkyVertex(vbo_vertex_t *vbo, int r, int c)
|
||||
{
|
||||
const double radians = (M_PIl / 180.0f);
|
||||
const double scale = 10000.0f;
|
||||
const float radians = (float)(M_PIl / 180.0f);
|
||||
const float scale = 10000.0f;
|
||||
const float maxSideAngle = 60.0f;
|
||||
|
||||
float topAngle = (c / (float)columns * 360.0f);
|
||||
float sideAngle = (maxSideAngle * (rows - r) / rows);
|
||||
double height = sin(sideAngle * radians);
|
||||
double realRadius = scale * cos(sideAngle * radians);
|
||||
double x = realRadius * cos(topAngle * radians);
|
||||
double y = (!yflip) ? scale * height : -scale * height;
|
||||
double z = realRadius * sin(topAngle * radians);
|
||||
float height = (float)(sin(sideAngle * radians));
|
||||
float realRadius = (float)(scale * cos(sideAngle * radians));
|
||||
float x = (float)(realRadius * cos(topAngle * radians));
|
||||
float y = (!yflip) ? scale * height : -scale * height;
|
||||
float z = (float)(realRadius * sin(topAngle * radians));
|
||||
float timesRepeat = (4 * (256.0f / texw));
|
||||
if (fpclassify(timesRepeat) == FP_ZERO)
|
||||
timesRepeat = 1.0f;
|
||||
|
|
Loading…
Reference in a new issue