mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
add gl_lightmap_shift (needs to handle renderer swap), fix linux building
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2086 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
09998a6f7a
commit
e82a8ac9aa
3 changed files with 36 additions and 27 deletions
|
@ -246,6 +246,7 @@ cvar_t r_menutint = SCVAR("r_menutint", "0.68 0.4 0.13");
|
||||||
cvar_t gl_schematics = SCVAR("gl_schematics","0");
|
cvar_t gl_schematics = SCVAR("gl_schematics","0");
|
||||||
cvar_t gl_ztrick = SCVAR("gl_ztrick","0");
|
cvar_t gl_ztrick = SCVAR("gl_ztrick","0");
|
||||||
cvar_t gl_lerpimages = SCVAR("gl_lerpimages", "1");
|
cvar_t gl_lerpimages = SCVAR("gl_lerpimages", "1");
|
||||||
|
cvar_t gl_lightmap_shift = SCVARF("gl_lightmap_shift", "0", CVAR_ARCHIVE | CVAR_LATCH);
|
||||||
extern cvar_t r_waterlayers;
|
extern cvar_t r_waterlayers;
|
||||||
cvar_t gl_triplebuffer = SCVARF("gl_triplebuffer", "1", CVAR_ARCHIVE);
|
cvar_t gl_triplebuffer = SCVARF("gl_triplebuffer", "1", CVAR_ARCHIVE);
|
||||||
cvar_t vid_hardwaregamma = SCVARF("vid_hardwaregamma", "1", CVAR_ARCHIVE);
|
cvar_t vid_hardwaregamma = SCVARF("vid_hardwaregamma", "1", CVAR_ARCHIVE);
|
||||||
|
@ -364,6 +365,8 @@ void GLRenderer_Init(void)
|
||||||
|
|
||||||
Cvar_Register (&gl_mylumassuck, GLRENDEREROPTIONS);
|
Cvar_Register (&gl_mylumassuck, GLRENDEREROPTIONS);
|
||||||
|
|
||||||
|
Cvar_Register (&gl_lightmap_shift, GLRENDEREROPTIONS);
|
||||||
|
|
||||||
R_BloomRegister();
|
R_BloomRegister();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -724,6 +724,7 @@ void GLR_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest, stmap *
|
||||||
unsigned *bl;
|
unsigned *bl;
|
||||||
qboolean isstained;
|
qboolean isstained;
|
||||||
extern cvar_t r_ambient;
|
extern cvar_t r_ambient;
|
||||||
|
extern cvar_t gl_lightmap_shift;
|
||||||
#ifdef PEXT_LIGHTSTYLECOL
|
#ifdef PEXT_LIGHTSTYLECOL
|
||||||
unsigned *blg;
|
unsigned *blg;
|
||||||
unsigned *blb;
|
unsigned *blb;
|
||||||
|
@ -732,6 +733,14 @@ void GLR_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest, stmap *
|
||||||
int cr, cg, cb;
|
int cr, cg, cb;
|
||||||
#endif
|
#endif
|
||||||
int stride = LMBLOCK_WIDTH*lightmap_bytes;
|
int stride = LMBLOCK_WIDTH*lightmap_bytes;
|
||||||
|
int shift;
|
||||||
|
|
||||||
|
if (gl_lightmap_shift.value >= 2)
|
||||||
|
shift = 9;
|
||||||
|
else if (gl_lightmap_shift.value == 1)
|
||||||
|
shift = 8;
|
||||||
|
else
|
||||||
|
shift = 7;
|
||||||
|
|
||||||
surf->cached_dlight = (surf->dlightframe == r_framecount);
|
surf->cached_dlight = (surf->dlightframe == r_framecount);
|
||||||
|
|
||||||
|
@ -1000,13 +1009,12 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
r = *bl++;
|
r = *bl++;
|
||||||
r >>= 7;
|
|
||||||
|
|
||||||
g = *blg++;
|
g = *blg++;
|
||||||
g >>= 7;
|
|
||||||
|
|
||||||
b = *blb++;
|
b = *blb++;
|
||||||
b >>= 7;
|
|
||||||
|
r >>= shift;
|
||||||
|
g >>= shift;
|
||||||
|
b >>= shift;
|
||||||
|
|
||||||
if (isstained) // merge in stain
|
if (isstained) // merge in stain
|
||||||
{
|
{
|
||||||
|
@ -1158,13 +1166,12 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
r = *bl++;
|
r = *bl++;
|
||||||
r >>= 7;
|
|
||||||
|
|
||||||
g = *blg++;
|
g = *blg++;
|
||||||
g >>= 7;
|
|
||||||
|
|
||||||
b = *blb++;
|
b = *blb++;
|
||||||
b >>= 7;
|
|
||||||
|
r >>= shift;
|
||||||
|
g >>= shift;
|
||||||
|
b >>= shift;
|
||||||
|
|
||||||
if (isstained) // merge in stain
|
if (isstained) // merge in stain
|
||||||
{
|
{
|
||||||
|
@ -1263,7 +1270,7 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
t = *bl++;
|
t = *bl++;
|
||||||
t >>= 7;
|
t >>= shift;
|
||||||
if (t > 255)
|
if (t > 255)
|
||||||
t = 255;
|
t = 255;
|
||||||
dest[3] = 255-t;
|
dest[3] = 255-t;
|
||||||
|
@ -1281,7 +1288,7 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
t = *bl++;
|
t = *bl++;
|
||||||
t >>= 7;
|
t >>= shift;
|
||||||
if (t > 255)
|
if (t > 255)
|
||||||
t = 255;
|
t = 255;
|
||||||
dest[j] = 255-t;
|
dest[j] = 255-t;
|
||||||
|
@ -1353,13 +1360,12 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
r = *bl++;
|
r = *bl++;
|
||||||
r >>= 7;
|
|
||||||
|
|
||||||
g = *blg++;
|
g = *blg++;
|
||||||
g >>= 7;
|
|
||||||
|
|
||||||
b = *blb++;
|
b = *blb++;
|
||||||
b >>= 7;
|
|
||||||
|
r >>= shift;
|
||||||
|
g >>= shift;
|
||||||
|
b >>= shift;
|
||||||
|
|
||||||
if (isstained) // merge in stain
|
if (isstained) // merge in stain
|
||||||
{
|
{
|
||||||
|
@ -1511,13 +1517,12 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
r = *bl++;
|
r = *bl++;
|
||||||
r >>= 7;
|
|
||||||
|
|
||||||
g = *blg++;
|
g = *blg++;
|
||||||
g >>= 7;
|
|
||||||
|
|
||||||
b = *blb++;
|
b = *blb++;
|
||||||
b >>= 7;
|
|
||||||
|
r >>= shift;
|
||||||
|
g >>= shift;
|
||||||
|
b >>= shift;
|
||||||
|
|
||||||
if (isstained) // merge in stain
|
if (isstained) // merge in stain
|
||||||
{
|
{
|
||||||
|
@ -1616,7 +1621,7 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
t = *bl++;
|
t = *bl++;
|
||||||
t >>= 7;
|
t >>= shift;
|
||||||
if (t > 255)
|
if (t > 255)
|
||||||
t = 255;
|
t = 255;
|
||||||
dest[3] = t;
|
dest[3] = t;
|
||||||
|
@ -1634,7 +1639,7 @@ store:
|
||||||
for (j=0 ; j<smax ; j++)
|
for (j=0 ; j<smax ; j++)
|
||||||
{
|
{
|
||||||
t = *bl++;
|
t = *bl++;
|
||||||
t >>= 7;
|
t >>= shift;
|
||||||
if (t > 255)
|
if (t > 255)
|
||||||
t = 255;
|
t = 255;
|
||||||
dest[j] = t;
|
dest[j] = t;
|
||||||
|
|
|
@ -691,6 +691,7 @@ printf("%8x\n", (int)vid_dpy);
|
||||||
extern qbyte gammatable[256];
|
extern qbyte gammatable[256];
|
||||||
int j, i;
|
int j, i;
|
||||||
float f;
|
float f;
|
||||||
|
int r, g, b;
|
||||||
unsigned short *data;
|
unsigned short *data;
|
||||||
unsigned char *pal = host_basepal;
|
unsigned char *pal = host_basepal;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue