From 1cdf7fa55fbe1c6e830db4ba142dc829bccad4e7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 25 Nov 2001 07:41:17 +0000 Subject: [PATCH] clean up the math for id skys a little. doesn't fix the sillyness, but that's caused by the deliberate texuture wrapping and I think gl isn't coping well with that when the texture coords wind up getting swapped due to the wrap. --- libs/video/renderer/gl/gl_sky_clip.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/video/renderer/gl/gl_sky_clip.c b/libs/video/renderer/gl/gl_sky_clip.c index 8ce7f705c..4edfed923 100644 --- a/libs/video/renderer/gl/gl_sky_clip.c +++ b/libs/video/renderer/gl/gl_sky_clip.c @@ -661,13 +661,13 @@ EmitSkyPolys (float speedscale, msurface_t *fa) dir[2] *= 3; // flatten the sphere length = DotProduct (dir, dir); - length = (6 * 63) / sqrt (length); + length = 2.95 / sqrt (length); dir[0] *= length; dir[1] *= length; - s = (speedscale + dir[0]) * (1.0 / 128.0); - t = (speedscale + dir[1]) * (1.0 / 128.0); + s = speedscale + dir[0]; + t = speedscale + dir[1]; qfglTexCoord2f (s, t); qfglVertex3fv (v); @@ -745,8 +745,8 @@ draw_id_sky_polys (msurface_t *sky_chain) msurface_t *sc = sky_chain; float speedscale; - speedscale = r_realtime * 8; - speedscale -= (int)speedscale & ~127 ; + speedscale = r_realtime / 16; + speedscale -= floor (speedscale); qfglBindTexture (GL_TEXTURE_2D, solidskytexture); while (sc) { @@ -757,8 +757,8 @@ draw_id_sky_polys (msurface_t *sky_chain) if (gl_skymultipass->int_val) { sc = sky_chain; - speedscale = r_realtime * 16; - speedscale -= (int)speedscale & ~127 ; + speedscale = r_realtime / 8; + speedscale -= floor (speedscale); qfglBindTexture (GL_TEXTURE_2D, alphaskytexture); while (sc) {