mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-01-21 23:50:58 +00:00
re-indent
This commit is contained in:
parent
c60c3892e5
commit
2070b1a5a1
1 changed files with 148 additions and 157 deletions
|
@ -68,14 +68,14 @@ R_LoadSkys
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" };
|
char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" };
|
||||||
void R_LoadSkys (char * skyname)
|
void
|
||||||
|
R_LoadSkys (char *skyname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QFile *f;
|
QFile *f;
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
||||||
if (stricmp (skyname, "none") == 0)
|
if (stricmp (skyname, "none") == 0) {
|
||||||
{
|
|
||||||
skyloaded = false;
|
skyloaded = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,8 @@ void R_LoadSkys (char * skyname)
|
||||||
}
|
}
|
||||||
targa_rgba = LoadTGA (f);
|
targa_rgba = LoadTGA (f);
|
||||||
|
|
||||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, targa_rgba);
|
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, 256, 256, 0, GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE, targa_rgba);
|
||||||
|
|
||||||
free (targa_rgba);
|
free (targa_rgba);
|
||||||
|
|
||||||
|
@ -102,8 +103,7 @@ void R_LoadSkys (char * skyname)
|
||||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
}
|
}
|
||||||
if (!skyloaded)
|
if (!skyloaded)
|
||||||
Con_Printf ("Unable to load skybox %s, using normal sky\n",
|
Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname);
|
||||||
skyname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -114,8 +114,7 @@ R_SkyBoxPolyVec(vec5_t v)
|
||||||
// t = t * (254.0/256.0) + (1.0/256.0);
|
// t = t * (254.0/256.0) + (1.0/256.0);
|
||||||
glTexCoord2fv (v);
|
glTexCoord2fv (v);
|
||||||
glVertex3f (r_refdef.vieworg[0] + v[2],
|
glVertex3f (r_refdef.vieworg[0] + v[2],
|
||||||
r_refdef.vieworg[1] + v[3],
|
r_refdef.vieworg[1] + v[3], r_refdef.vieworg[2] + v[4]);
|
||||||
r_refdef.vieworg[2] + v[4]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ftc(x) (x * (254.0/256.0) + (1.0/256.0))
|
#define ftc(x) (x * (254.0/256.0) + (1.0/256.0))
|
||||||
|
@ -174,8 +173,7 @@ R_DrawSkyBox (void)
|
||||||
|
|
||||||
glDisable (GL_DEPTH_TEST);
|
glDisable (GL_DEPTH_TEST);
|
||||||
glDepthRange (gldepthmax, gldepthmax);
|
glDepthRange (gldepthmax, gldepthmax);
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++) {
|
||||||
{
|
|
||||||
glBindTexture (GL_TEXTURE_2D, SKY_TEX + i);
|
glBindTexture (GL_TEXTURE_2D, SKY_TEX + i);
|
||||||
glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
for (j = 0; j < 4; j++)
|
for (j = 0; j < 4; j++)
|
||||||
|
@ -196,8 +194,7 @@ R_DrawSkyLayer (float s)
|
||||||
float x, y, a1x, a1y, a2x, a2y;
|
float x, y, a1x, a1y, a2x, a2y;
|
||||||
vec3_t v;
|
vec3_t v;
|
||||||
|
|
||||||
for (a = 0; a < 16; a++)
|
for (a = 0; a < 16; a++) {
|
||||||
{
|
|
||||||
a1x = bubble_costable[a * 2];
|
a1x = bubble_costable[a * 2];
|
||||||
a1y = -bubble_sintable[a * 2];
|
a1y = -bubble_sintable[a * 2];
|
||||||
a2x = bubble_costable[(a + 1) * 2];
|
a2x = bubble_costable[(a + 1) * 2];
|
||||||
|
@ -206,10 +203,8 @@ R_DrawSkyLayer (float s)
|
||||||
glBegin (GL_TRIANGLE_STRIP);
|
glBegin (GL_TRIANGLE_STRIP);
|
||||||
glTexCoord2f (0.5 + s * (1.0 / 128.0), 0.5 + s * (1.0 / 128.0));
|
glTexCoord2f (0.5 + s * (1.0 / 128.0), 0.5 + s * (1.0 / 128.0));
|
||||||
glVertex3f (r_refdef.vieworg[0],
|
glVertex3f (r_refdef.vieworg[0],
|
||||||
r_refdef.vieworg[1],
|
r_refdef.vieworg[1], r_refdef.vieworg[2] + domescale[2]);
|
||||||
r_refdef.vieworg[2]+domescale[2]);
|
for (b = 1; b < 8; b++) {
|
||||||
for (b = 1; b < 8; b++)
|
|
||||||
{
|
|
||||||
x = bubble_costable[b * 2 + 16];
|
x = bubble_costable[b * 2 + 16];
|
||||||
y = -bubble_sintable[b * 2 + 16];
|
y = -bubble_sintable[b * 2 + 16];
|
||||||
|
|
||||||
|
@ -219,8 +214,7 @@ R_DrawSkyLayer (float s)
|
||||||
glTexCoord2f ((v[0] + s) * (1.0 / 128.0),
|
glTexCoord2f ((v[0] + s) * (1.0 / 128.0),
|
||||||
(v[1] + s) * (1.0 / 128.0));
|
(v[1] + s) * (1.0 / 128.0));
|
||||||
glVertex3f (v[0] + r_refdef.vieworg[0],
|
glVertex3f (v[0] + r_refdef.vieworg[0],
|
||||||
v[1] + r_refdef.vieworg[1],
|
v[1] + r_refdef.vieworg[1], v[2] + r_refdef.vieworg[2]);
|
||||||
v[2] + r_refdef.vieworg[2]);
|
|
||||||
|
|
||||||
v[0] = a2x * x * domescale[0];
|
v[0] = a2x * x * domescale[0];
|
||||||
v[1] = a2y * x * domescale[1];
|
v[1] = a2y * x * domescale[1];
|
||||||
|
@ -228,13 +222,11 @@ R_DrawSkyLayer (float s)
|
||||||
glTexCoord2f ((v[0] + s) * (1.0 / 128.0),
|
glTexCoord2f ((v[0] + s) * (1.0 / 128.0),
|
||||||
(v[1] + s) * (1.0 / 128.0));
|
(v[1] + s) * (1.0 / 128.0));
|
||||||
glVertex3f (v[0] + r_refdef.vieworg[0],
|
glVertex3f (v[0] + r_refdef.vieworg[0],
|
||||||
v[1] + r_refdef.vieworg[1],
|
v[1] + r_refdef.vieworg[1], v[2] + r_refdef.vieworg[2]);
|
||||||
v[2] + r_refdef.vieworg[2]);
|
|
||||||
}
|
}
|
||||||
glTexCoord2f (0.5 + s * (1.0 / 128.0), 0.5 + s * (1.0 / 128.0));
|
glTexCoord2f (0.5 + s * (1.0 / 128.0), 0.5 + s * (1.0 / 128.0));
|
||||||
glVertex3f (r_refdef.vieworg[0],
|
glVertex3f (r_refdef.vieworg[0],
|
||||||
r_refdef.vieworg[1],
|
r_refdef.vieworg[1], r_refdef.vieworg[2] - domescale[2]);
|
||||||
r_refdef.vieworg[2]-domescale[2]);
|
|
||||||
glEnd ();
|
glEnd ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,13 +279,12 @@ R_DrawSky ( void )
|
||||||
//===============================================================
|
//===============================================================
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
|
||||||
R_InitSky
|
R_InitSky
|
||||||
|
|
||||||
A sky texture is 256*128, with the right side being a masked overlay
|
A sky texture is 256*128, with the right side being a masked overlay
|
||||||
==============
|
|
||||||
*/
|
*/
|
||||||
void R_InitSky (texture_t *mt)
|
void
|
||||||
|
R_InitSky (texture_t *mt)
|
||||||
{
|
{
|
||||||
int i, j, p;
|
int i, j, p;
|
||||||
byte *src;
|
byte *src;
|
||||||
|
@ -309,8 +300,7 @@ void R_InitSky (texture_t *mt)
|
||||||
|
|
||||||
r = g = b = 0;
|
r = g = b = 0;
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
for (j=0 ; j<128 ; j++)
|
for (j = 0; j < 128; j++) {
|
||||||
{
|
|
||||||
p = src[i * 256 + j + 128];
|
p = src[i * 256 + j + 128];
|
||||||
rgba = &d_8to24table[p];
|
rgba = &d_8to24table[p];
|
||||||
trans[(i * 128) + j] = *rgba;
|
trans[(i * 128) + j] = *rgba;
|
||||||
|
@ -328,14 +318,14 @@ void R_InitSky (texture_t *mt)
|
||||||
if (!solidskytexture)
|
if (!solidskytexture)
|
||||||
solidskytexture = texture_extension_number++;
|
solidskytexture = texture_extension_number++;
|
||||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans);
|
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, 128, 128, 0, GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE, trans);
|
||||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
for (j=0 ; j<128 ; j++)
|
for (j = 0; j < 128; j++) {
|
||||||
{
|
|
||||||
p = src[i * 256 + j];
|
p = src[i * 256 + j];
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
trans[(i * 128) + j] = transpix;
|
trans[(i * 128) + j] = transpix;
|
||||||
|
@ -346,7 +336,8 @@ void R_InitSky (texture_t *mt)
|
||||||
if (!alphaskytexture)
|
if (!alphaskytexture)
|
||||||
alphaskytexture = texture_extension_number++;
|
alphaskytexture = texture_extension_number++;
|
||||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans);
|
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 128, 128, 0, GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE, trans);
|
||||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue