Fix loading of some sky textures.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2003-12-23 22:24:48 +00:00
parent 1be98dcf08
commit 9dbb8335f6

View file

@ -114,7 +114,7 @@ void
R_LoadSkys (const char *skyname) R_LoadSkys (const char *skyname)
{ {
const char *name; const char *name;
int i, j; int i; // j
if (strcasecmp (skyname, "none") == 0) { if (strcasecmp (skyname, "none") == 0) {
skyloaded = false; skyloaded = false;
@ -139,12 +139,13 @@ R_LoadSkys (const char *skyname)
} }
qfglTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, targa->width, qfglTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, targa->width,
targa->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, targa->height, 0, targa->format, GL_UNSIGNED_BYTE,
&targa->data); &targa->data);
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#if 0
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
// set the texture coords to be 1/2 pixel in from the edge // set the texture coords to be 1/2 pixel in from the edge
if (skyvec[i][j][0] < 0.5) if (skyvec[i][j][0] < 0.5)
@ -157,6 +158,7 @@ R_LoadSkys (const char *skyname)
else else
skyvec[i][j][1] = 1 - 0.5 / targa->height; skyvec[i][j][1] = 1 - 0.5 / targa->height;
} }
#endif
} }
if (!skyloaded) if (!skyloaded)
Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname); Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname);