From f576e617538ef99c43224df03417163af92037d1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Dec 2019 13:45:07 -0500 Subject: [PATCH] OpenGL cast to float, not store in double --- src/hardware/r_opengl/r_opengl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index ec99eb307..9ac70e96a 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -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;