From 9754c568365040034cc7125d6010e94bec00defe Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 27 Jan 2001 21:50:51 +0000 Subject: [PATCH] remove the seams from the skybox --- source/gl_sky_clip.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/source/gl_sky_clip.c b/source/gl_sky_clip.c index 845bf17..e34919f 100644 --- a/source/gl_sky_clip.c +++ b/source/gl_sky_clip.c @@ -46,6 +46,8 @@ extern qboolean skyloaded; extern vec5_t skyvec[6][4]; +#define BOX_WIDTH 2056 + /* cube face to sky texture offset conversion */ static const int skytex_offs[] = { 3, 0, 4, 1, 2, 5 }; @@ -227,28 +229,28 @@ set_vertex (struct box_def *box, int face, int ind, vec3_t v) VectorAdd (v, r_refdef.vieworg, box->face[face].poly.verts[ind]); switch (face) { case 0: - box->face[face].poly.verts[ind][3] = (1024 - v[1]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 - v[2]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 - v[1] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 - v[2] + 4) / BOX_WIDTH; break; case 1: - box->face[face].poly.verts[ind][3] = (1024 + v[0]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 - v[2]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 + v[0] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 - v[2] + 4) / BOX_WIDTH; break; case 2: - box->face[face].poly.verts[ind][3] = (1024 + v[0]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 + v[1]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 + v[0] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 + v[1] + 4) / BOX_WIDTH; break; case 3: - box->face[face].poly.verts[ind][3] = (1024 + v[1]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 - v[2]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 + v[1] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 - v[2] + 4) / BOX_WIDTH; break; case 4: - box->face[face].poly.verts[ind][3] = (1024 - v[0]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 - v[2]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 - v[0] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 - v[2] + 4) / BOX_WIDTH; break; case 5: - box->face[face].poly.verts[ind][3] = (1024 + v[0]) / 2048; - box->face[face].poly.verts[ind][4] = (1024 - v[1]) / 2048; + box->face[face].poly.verts[ind][3] = (1024 + v[0] + 4) / BOX_WIDTH; + box->face[face].poly.verts[ind][4] = (1024 - v[1] + 4) / BOX_WIDTH; break; } }