mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-02 09:31:12 +00:00
Remove gl_doublebright, remove fractional overbrights, clean up init a bit,
uglify init a bit. Stuff for taniwha to look at. Nothing to see here, move along.
This commit is contained in:
parent
c4807a095d
commit
b7df0b5278
6 changed files with 111 additions and 147 deletions
|
@ -30,6 +30,7 @@
|
||||||
#define __QF_GL_rmain_h
|
#define __QF_GL_rmain_h
|
||||||
|
|
||||||
#include "QF/qtypes.h"
|
#include "QF/qtypes.h"
|
||||||
|
#include "QF/cvar.h"
|
||||||
|
|
||||||
extern qboolean envmap;
|
extern qboolean envmap;
|
||||||
extern int c_brush_polys, c_alias_polys;
|
extern int c_brush_polys, c_alias_polys;
|
||||||
|
@ -39,6 +40,8 @@ extern float modelalpha;
|
||||||
extern vec3_t shadecolor;
|
extern vec3_t shadecolor;
|
||||||
extern vec3_t lightspot;
|
extern vec3_t lightspot;
|
||||||
|
|
||||||
|
extern void gl_multitexture_f (cvar_t *var);
|
||||||
|
|
||||||
void glrmain_init (void);
|
void glrmain_init (void);
|
||||||
void R_RotateForEntity (struct entity_s *e);
|
void R_RotateForEntity (struct entity_s *e);
|
||||||
|
|
||||||
|
|
|
@ -41,13 +41,14 @@ extern int gl_mtex_active_tmus;
|
||||||
extern qboolean gl_mtex_capable;
|
extern qboolean gl_mtex_capable;
|
||||||
extern qboolean gl_mtex_fullbright;
|
extern qboolean gl_mtex_fullbright;
|
||||||
extern GLenum gl_mtex_enum;
|
extern GLenum gl_mtex_enum;
|
||||||
extern int use_bgra;
|
|
||||||
//extern int use_tmus;
|
|
||||||
extern qboolean gl_combine_capable;
|
extern qboolean gl_combine_capable;
|
||||||
extern float gldepthmin, gldepthmax;
|
extern float rgb_scale;
|
||||||
extern int texture_extension_number;
|
extern int texture_extension_number;
|
||||||
extern int tess;
|
|
||||||
extern qboolean gl_feature_mach64;
|
extern qboolean gl_feature_mach64;
|
||||||
|
extern float gldepthmin, gldepthmax;
|
||||||
|
extern int use_bgra;
|
||||||
|
extern int tess;
|
||||||
|
|
||||||
void GL_EndRendering (void);
|
void GL_EndRendering (void);
|
||||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||||
|
|
|
@ -19,7 +19,6 @@ extern struct cvar_s *gl_conspin;
|
||||||
extern struct cvar_s *gl_constretch;
|
extern struct cvar_s *gl_constretch;
|
||||||
extern struct cvar_s *gl_dlight_polyblend;
|
extern struct cvar_s *gl_dlight_polyblend;
|
||||||
extern struct cvar_s *gl_dlight_smooth;
|
extern struct cvar_s *gl_dlight_smooth;
|
||||||
extern struct cvar_s *gl_doublebright;
|
|
||||||
extern struct cvar_s *gl_fb_bmodels;
|
extern struct cvar_s *gl_fb_bmodels;
|
||||||
extern struct cvar_s *gl_fb_models;
|
extern struct cvar_s *gl_fb_models;
|
||||||
extern struct cvar_s *gl_keeptjunctions;
|
extern struct cvar_s *gl_keeptjunctions;
|
||||||
|
|
|
@ -42,6 +42,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "QF/console.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
@ -75,10 +76,12 @@ qboolean lightmap_modified[MAX_GLTEXTURES];
|
||||||
glpoly_t *lightmap_polys[MAX_LIGHTMAPS];
|
glpoly_t *lightmap_polys[MAX_LIGHTMAPS];
|
||||||
glRect_t lightmap_rectchange[MAX_LIGHTMAPS];
|
glRect_t lightmap_rectchange[MAX_LIGHTMAPS];
|
||||||
|
|
||||||
static int lshift = 8, lshift2 = 9;
|
static int lmshift = 7;
|
||||||
|
|
||||||
void (*R_BuildLightMap) (msurface_t *surf);
|
void (*R_BuildLightMap) (msurface_t *surf);
|
||||||
|
|
||||||
|
extern void gl_multitexture_f (cvar_t *var);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gl_lightmap_init (void)
|
gl_lightmap_init (void)
|
||||||
|
@ -292,19 +295,10 @@ R_BuildLightMap_1 (msurface_t *surf)
|
||||||
dest = lightmaps[surf->lightmaptexturenum]
|
dest = lightmaps[surf->lightmaptexturenum]
|
||||||
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
||||||
|
|
||||||
if (lshift2) {
|
for (i = 0; i < tmax; i++, dest += stride) {
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
for (j = smax; j; j--) {
|
||||||
for (j = smax; j; j--) {
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
|
||||||
for (j = smax; j; j--) {
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -362,27 +356,14 @@ R_BuildLightMap_3 (msurface_t *surf)
|
||||||
dest = lightmaps[surf->lightmaptexturenum]
|
dest = lightmaps[surf->lightmaptexturenum]
|
||||||
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
||||||
|
|
||||||
if (lshift2) {
|
for (i = 0; i < tmax; i++, dest += stride) {
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
for (j = 0; j < smax; j++) {
|
||||||
for (j = 0; j < smax; j++) {
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
|
||||||
for (j = 0; j < smax; j++) {
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,29 +421,15 @@ R_BuildLightMap_4 (msurface_t *surf)
|
||||||
dest = lightmaps[surf->lightmaptexturenum]
|
dest = lightmaps[surf->lightmaptexturenum]
|
||||||
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
|
||||||
|
|
||||||
if (lshift2) {
|
for (i = 0; i < tmax; i++, dest += stride) {
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
for (j = 0; j < smax; j++) {
|
||||||
for (j = 0; j < smax; j++) {
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
*dest++ = min (*bl >> lmshift, 255);
|
||||||
*dest++ = min ((*bl >> lshift) + (*bl >> lshift2), 255);
|
bl++;
|
||||||
bl++;
|
*dest++ = 255;
|
||||||
*dest++ = 255;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < tmax; i++, dest += stride) {
|
|
||||||
for (j = 0; j < smax; j++) {
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
*dest++ = min (*bl >> lshift, 255);
|
|
||||||
bl++;
|
|
||||||
*dest++ = 255;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -573,28 +540,44 @@ gl_overbright_f (cvar_t *var)
|
||||||
if (!R_BuildLightMap)
|
if (!R_BuildLightMap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (var->int_val) {
|
if (var->int_val) {
|
||||||
case 2:
|
if (!gl_combine_capable && gl_mtex_capable) {
|
||||||
lshift = 8;
|
Con_Printf ("Warning: gl_overbright has no effect with "
|
||||||
lshift2 = 0;
|
"gl_multitexture enabled if you don't have "
|
||||||
break;
|
"GL_COMBINE support in your driver.\n");
|
||||||
case 1:
|
lm_src_blend = GL_ZERO;
|
||||||
lshift = 8;
|
lm_dest_blend = GL_SRC_COLOR;
|
||||||
lshift2 = 9;
|
lmshift = 7;
|
||||||
break;
|
rgb_scale = 1.0;
|
||||||
default:
|
} else {
|
||||||
lshift = 7;
|
lm_src_blend = GL_DST_COLOR;
|
||||||
lshift2 = 0;
|
lm_dest_blend = GL_SRC_COLOR;
|
||||||
break;
|
|
||||||
}
|
switch (var->int_val) {
|
||||||
if (gl_doublebright) {
|
case 2:
|
||||||
if (gl_doublebright->int_val) {
|
lmshift = 9;
|
||||||
lshift++;
|
rgb_scale = 4.0;
|
||||||
if (lshift2)
|
break;
|
||||||
lshift2++;
|
case 1:
|
||||||
|
lmshift = 8;
|
||||||
|
rgb_scale = 2.0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
lmshift = 7;
|
||||||
|
rgb_scale = 1.0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
lm_src_blend = GL_ZERO;
|
||||||
|
lm_dest_blend = GL_SRC_COLOR;
|
||||||
|
lmshift = 7;
|
||||||
|
rgb_scale = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gl_multitexture)
|
||||||
|
gl_multitexture_f (gl_multitexture);
|
||||||
|
|
||||||
for (i = 0; i < r_numvisedicts; i++) {
|
for (i = 0; i < r_numvisedicts; i++) {
|
||||||
m = r_visedicts[i]->model;
|
m = r_visedicts[i]->model;
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,10 @@ glrmain_init (void)
|
||||||
gldepthmax = 1;
|
gldepthmax = 1;
|
||||||
qfglDepthFunc (GL_LEQUAL);
|
qfglDepthFunc (GL_LEQUAL);
|
||||||
qfglDepthRange (gldepthmin, gldepthmax);
|
qfglDepthRange (gldepthmin, gldepthmax);
|
||||||
|
if (gl_multitexture)
|
||||||
|
gl_multitexture_f (gl_multitexture);
|
||||||
|
if (gl_overbright)
|
||||||
|
gl_overbright_f (gl_overbright);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -280,10 +284,10 @@ R_DrawEntitiesOnList (void)
|
||||||
// up in every R_DrawAliasModel()!
|
// up in every R_DrawAliasModel()!
|
||||||
qglActiveTexture (gl_mtex_enum + 1);
|
qglActiveTexture (gl_mtex_enum + 1);
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
if (gl_combine_capable && gl_doublebright->int_val) {
|
if (gl_combine_capable && gl_overbright->int_val) {
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2.0);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE, rgb_scale);
|
||||||
} else {
|
} else {
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
}
|
}
|
||||||
|
@ -327,10 +331,10 @@ R_DrawViewModel (void)
|
||||||
// up in every R_DrawAliasModel()!
|
// up in every R_DrawAliasModel()!
|
||||||
qglActiveTexture (gl_mtex_enum + 1);
|
qglActiveTexture (gl_mtex_enum + 1);
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
if (gl_combine_capable && gl_doublebright->int_val) {
|
if (gl_combine_capable && gl_overbright->int_val) {
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2.0);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE, rgb_scale);
|
||||||
} else {
|
} else {
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ static __attribute__ ((unused)) const char rcsid[] =
|
||||||
#include "QF/input.h"
|
#include "QF/input.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/quakefs.h"
|
#include "QF/quakefs.h"
|
||||||
#include "r_cvar.h" // FIXME: for gl_overbright_f
|
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
@ -58,6 +57,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
|
#include "r_cvar.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
|
|
||||||
#define WARP_WIDTH 320
|
#define WARP_WIDTH 320
|
||||||
|
@ -88,7 +88,7 @@ int gl_filter_max = GL_LINEAR;
|
||||||
float gldepthmin, gldepthmax;
|
float gldepthmin, gldepthmax;
|
||||||
|
|
||||||
// Multitexture
|
// Multitexture
|
||||||
static qboolean gl_mtex_capable = false;
|
qboolean gl_mtex_capable = false;
|
||||||
static int gl_mtex_tmus = 0;
|
static int gl_mtex_tmus = 0;
|
||||||
GLenum gl_mtex_enum;
|
GLenum gl_mtex_enum;
|
||||||
int gl_mtex_active_tmus = 0;
|
int gl_mtex_active_tmus = 0;
|
||||||
|
@ -97,6 +97,7 @@ qboolean gl_mtex_fullbright = false;
|
||||||
// Combine
|
// Combine
|
||||||
qboolean gl_combine_capable = false;
|
qboolean gl_combine_capable = false;
|
||||||
int lm_src_blend, lm_dest_blend;
|
int lm_src_blend, lm_dest_blend;
|
||||||
|
float rgb_scale = 1.0;
|
||||||
|
|
||||||
QF_glColorTableEXT qglColorTableEXT = NULL;
|
QF_glColorTableEXT qglColorTableEXT = NULL;
|
||||||
qboolean is8bit = false;
|
qboolean is8bit = false;
|
||||||
|
@ -119,6 +120,8 @@ cvar_t *gl_screenshot_byte_swap;
|
||||||
cvar_t *vid_mode;
|
cvar_t *vid_mode;
|
||||||
cvar_t *vid_use8bit;
|
cvar_t *vid_use8bit;
|
||||||
|
|
||||||
|
void gl_multitexture_f (cvar_t *var);
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gl_max_size_f (cvar_t *var)
|
gl_max_size_f (cvar_t *var)
|
||||||
|
@ -137,31 +140,6 @@ gl_max_size_f (cvar_t *var)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gl_doublebright_f (cvar_t *var)
|
|
||||||
{
|
|
||||||
if (!var)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (var->int_val) {
|
|
||||||
if (!gl_combine_capable && gl_mtex_capable) {
|
|
||||||
Con_Printf ("Warning: gl_doublebright has no effect with "
|
|
||||||
"gl_multitexture enabled if you don't have "
|
|
||||||
"GL_COMBINE_ARB support in your driver.\n");
|
|
||||||
lm_src_blend = GL_ZERO;
|
|
||||||
lm_dest_blend = GL_SRC_COLOR;
|
|
||||||
} else {
|
|
||||||
lm_src_blend = GL_DST_COLOR;
|
|
||||||
lm_dest_blend = GL_SRC_COLOR;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lm_src_blend = GL_ZERO;
|
|
||||||
lm_dest_blend = GL_SRC_COLOR;
|
|
||||||
}
|
|
||||||
if (gl_overbright)
|
|
||||||
gl_overbright_f (gl_overbright);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gl_textures_bgra_f (cvar_t *var)
|
gl_textures_bgra_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +166,7 @@ gl_fb_bmodels_f (cvar_t *var)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
gl_multitexture_f (cvar_t *var)
|
gl_multitexture_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
if (!var)
|
if (!var)
|
||||||
|
@ -201,6 +179,12 @@ gl_multitexture_f (cvar_t *var)
|
||||||
if (gl_fb_bmodels->int_val) {
|
if (gl_fb_bmodels->int_val) {
|
||||||
if (gl_mtex_tmus >= 3) {
|
if (gl_mtex_tmus >= 3) {
|
||||||
gl_mtex_fullbright = true;
|
gl_mtex_fullbright = true;
|
||||||
|
|
||||||
|
qglActiveTexture (gl_mtex_enum + 2);
|
||||||
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
|
||||||
|
GL_DECAL);
|
||||||
|
qfglDisable (GL_TEXTURE_2D);
|
||||||
} else {
|
} else {
|
||||||
gl_mtex_fullbright = false;
|
gl_mtex_fullbright = false;
|
||||||
Con_Printf ("Not enough TMUs for BSP fullbrights.\n");
|
Con_Printf ("Not enough TMUs for BSP fullbrights.\n");
|
||||||
|
@ -209,6 +193,25 @@ gl_multitexture_f (cvar_t *var)
|
||||||
} else {
|
} else {
|
||||||
gl_mtex_fullbright = false;
|
gl_mtex_fullbright = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lightmaps
|
||||||
|
qglActiveTexture (gl_mtex_enum + 1);
|
||||||
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
|
if (gl_overbright) {
|
||||||
|
if (gl_combine_capable && gl_overbright->int_val) {
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE, rgb_scale);
|
||||||
|
} else {
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
}
|
||||||
|
qfglDisable (GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
// Base Texture
|
||||||
|
qglActiveTexture (gl_mtex_enum + 0);
|
||||||
} else {
|
} else {
|
||||||
gl_mtex_active_tmus = 0;
|
gl_mtex_active_tmus = 0;
|
||||||
gl_mtex_fullbright = false;
|
gl_mtex_fullbright = false;
|
||||||
|
@ -248,10 +251,6 @@ GL_Common_Init_Cvars (void)
|
||||||
gl_textures_bgra = Cvar_Get ("gl_textures_bgra", "0", CVAR_ROM,
|
gl_textures_bgra = Cvar_Get ("gl_textures_bgra", "0", CVAR_ROM,
|
||||||
gl_textures_bgra_f, "If set to 1, try to use "
|
gl_textures_bgra_f, "If set to 1, try to use "
|
||||||
"BGR & BGRA textures instead of RGB & RGBA.");
|
"BGR & BGRA textures instead of RGB & RGBA.");
|
||||||
gl_doublebright = Cvar_Get ("gl_doublebright", "1", CVAR_ARCHIVE,
|
|
||||||
gl_doublebright_f, "Use different lighting "
|
|
||||||
"algorithm to increase brightness of map "
|
|
||||||
"surfaces.");
|
|
||||||
gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE,
|
gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE,
|
||||||
gl_fb_bmodels_f, "Toggles fullbright color "
|
gl_fb_bmodels_f, "Toggles fullbright color "
|
||||||
"support for bmodels");
|
"support for bmodels");
|
||||||
|
@ -529,31 +528,6 @@ GL_Init_Common (void)
|
||||||
CheckTruFormExtensions ();
|
CheckTruFormExtensions ();
|
||||||
GL_Common_Init_Cvars ();
|
GL_Common_Init_Cvars ();
|
||||||
CheckVertexArraySize ();
|
CheckVertexArraySize ();
|
||||||
|
|
||||||
if (gl_mtex_capable) {
|
|
||||||
// Fullbrights
|
|
||||||
if (gl_mtex_tmus >= 3) {
|
|
||||||
qglActiveTexture (gl_mtex_enum + 2);
|
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
|
||||||
qfglDisable (GL_TEXTURE_2D);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lightmaps
|
|
||||||
qglActiveTexture (gl_mtex_enum + 1);
|
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
|
||||||
if (gl_combine_capable && gl_doublebright->int_val) {
|
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2.0);
|
|
||||||
} else {
|
|
||||||
qfglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
|
||||||
}
|
|
||||||
qfglDisable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
// Base Texture
|
|
||||||
qglActiveTexture (gl_mtex_enum + 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue