Small fixes and tweeks.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3940 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-12-26 15:19:13 +00:00
parent 29cfd270b9
commit 9e4edb8a9a
32 changed files with 517 additions and 162 deletions

View file

@ -118,6 +118,8 @@ static void CL_ClearDlight(dlight_t *dl, int key)
dl->color[0] = 1;
dl->color[1] = 1;
dl->color[2] = 1;
dl->corona = r_flashblend.value;
dl->coronascale = r_flashblendscale.value;
// if (r_shadow_realtime_dlight_shadowmap.value)
// dl->flags |= LFLAG_SHADOWMAP;
}
@ -134,6 +136,7 @@ dlight_t *CL_AllocSlight(void)
dl = &cl_dlights[rtlights_max++];
CL_ClearDlight(dl, 0);
dl->corona = 0;
return dl;
}

View file

@ -122,12 +122,12 @@ cvar_t cl_enemychatsound = CVAR("cl_enemychatsound", "misc/talk.wav");
cvar_t cl_teamchatsound = CVAR("cl_teamchatsound", "misc/talk.wav");
cvar_t r_torch = CVARF("r_torch", "0", CVAR_CHEAT);
cvar_t r_rocketlight = CVARC("r_rocketlight", "1", Cvar_Limiter_ZeroToOne_Callback);
cvar_t r_rocketlight = CVARFC("r_rocketlight", "1", CVAR_ARCHIVE, Cvar_Limiter_ZeroToOne_Callback);
cvar_t r_lightflicker = CVAR("r_lightflicker", "1");
cvar_t cl_r2g = CVAR("cl_r2g", "0");
cvar_t cl_r2g = CVARF("cl_r2g", "0", CVAR_ARCHIVE);
cvar_t r_powerupglow = CVAR("r_powerupglow", "1");
cvar_t v_powerupshell = CVAR("v_powerupshell", "0");
cvar_t cl_gibfilter = CVAR("cl_gibfilter", "0");
cvar_t v_powerupshell = CVARF("v_powerupshell", "0", CVAR_ARCHIVE);
cvar_t cl_gibfilter = CVARF("cl_gibfilter", "0", CVAR_ARCHIVE);
cvar_t cl_deadbodyfilter = CVAR("cl_deadbodyfilter", "0");
cvar_t cl_gunx = SCVAR("cl_gunx", "0");
@ -146,7 +146,7 @@ cvar_t requiredownloads = CVARFD("requiredownloads","1", CVAR_ARCHIVE, "0=join t
cvar_t cl_muzzleflash = SCVAR("cl_muzzleflash", "1");
cvar_t cl_item_bobbing = SCVAR("cl_model_bobbing", "0");
cvar_t cl_item_bobbing = CVARF("cl_model_bobbing", "0", CVAR_ARCHIVE);
cvar_t cl_countpendingpl = SCVAR("cl_countpendingpl", "0");
cvar_t cl_standardchat = SCVARF("cl_standardchat", "0", CVAR_ARCHIVE);
@ -3078,7 +3078,7 @@ void CL_Fog_f(void)
else
{
cl.fog_density = atof(Cmd_Argv(1));
if (Cmd_Argc() > 5)
if (Cmd_Argc() >= 5)
{
cl.fog_colour[0] = atof(Cmd_Argv(2));
cl.fog_colour[1] = atof(Cmd_Argv(3));

View file

@ -6155,7 +6155,7 @@ void CLNQ_ParseServerMessage (void)
Cmd_ExecuteString("bf", RESTRICT_SERVER);
break;
case svcfitz_fog:
cl.fog_density = MSG_ReadByte();
cl.fog_density = MSG_ReadByte()/255.0f;
cl.fog_colour[0] = MSG_ReadByte()/255.0f;
cl.fog_colour[1] = MSG_ReadByte()/255.0f;
cl.fog_colour[2] = MSG_ReadByte()/255.0f;

View file

@ -223,8 +223,8 @@ sfx_t *cl_sfx_ric2;
sfx_t *cl_sfx_ric3;
sfx_t *cl_sfx_r_exp3;
cvar_t cl_expsprite = CVAR("cl_expsprite", "0");
cvar_t r_explosionlight = CVARC("r_explosionlight", "1", Cvar_Limiter_ZeroToOne_Callback);
cvar_t cl_expsprite = CVARF("cl_expsprite", "0", CVAR_ARCHIVE);
cvar_t r_explosionlight = CVARFC("r_explosionlight", "1", CVAR_ARCHIVE, Cvar_Limiter_ZeroToOne_Callback);
cvar_t cl_truelightning = CVARF("cl_truelightning", "0", CVAR_SEMICHEAT);
cvar_t cl_beam_trace = CVAR("cl_beam_trace", "0");

View file

@ -270,11 +270,13 @@ typedef struct dlight_s
float coronascale;
unsigned int flags;
char cubemapname[64];
//the following are used for rendering (client code should clear on create)
qboolean rebuildcache;
struct shadowmesh_s *worldshadowmesh;
texid_t stexture;
texid_t cubetexture;
struct {
float updatetime;
} face [6];

View file

@ -143,7 +143,6 @@ void Draw_BigFontString(int x, int y, const char *text)
if (!p)
return;
if (qrenderer == QR_OPENGL)
{ //a hack for scaling
p->width = 20*8;
p->height = 20*8;

View file

@ -719,7 +719,7 @@ void M_Menu_Textures_f (void)
NULL
};
extern cvar_t gl_load24bit, gl_specular, gl_detail, gl_compress, gl_picmip, gl_picmip2d, gl_max_size, r_drawflat;
extern cvar_t gl_load24bit, gl_specular, gl_detail, gl_compress, gl_picmip, gl_picmip2d, gl_max_size, r_drawflat, r_glsl_offsetmapping;
extern cvar_t gl_texture_anisotropic_filtering, gl_texturemode, gl_texturemode2d;
int y;
menubulk_t bulk[] =
@ -735,6 +735,7 @@ void M_Menu_Textures_f (void)
MB_CHECKBOXCVAR("Deluxemapping", r_deluxemapping, 0),
MB_CHECKBOXCVAR("Specular Highlights", gl_specular, 0),
MB_CHECKBOXCVAR("Detail Textures", gl_detail, 0),
MB_CHECKBOXCVAR("offsetmapping", r_glsl_offsetmapping, 0),
MB_SPACING(4),
MB_CHECKBOXCVAR("Texture Compression", gl_compress, 0), // merge the save compressed tex options into here?
MB_SLIDER("3D Picmip", gl_picmip, 0, 16, 1, NULL),

View file

@ -1263,12 +1263,19 @@ void MasterInfo_ProcessHTTPJSON(struct dl_download *dl)
{
int len;
char *buf;
if (dl->file)
{
len = VFS_GETLEN(dl->file);
buf = malloc(len + 1);
VFS_READ(dl->file, buf, len);
buf[len] = 0;
jsonnode(0, buf);
free(buf);
}
else
{
Con_Printf("Unable to query master at \"%s\"\n", dl->url);
}
}
// wrapper functions for the different server types

View file

@ -711,6 +711,7 @@ static void QCBUILTIN PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *p
static void QCBUILTIN PF_R_DynamicLight_Set(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *s;
dlight_t *l;
unsigned int lno = G_FLOAT(OFS_PARM0);
int field = G_FLOAT(OFS_PARM1);
@ -749,6 +750,20 @@ static void QCBUILTIN PF_R_DynamicLight_Set(progfuncs_t *prinst, struct globalva
case lfield_fov:
l->fov = G_FLOAT(OFS_PARM2);
break;
case lfield_corona:
l->corona = G_FLOAT(OFS_PARM2);
break;
case lfield_coronascale:
l->coronascale = G_FLOAT(OFS_PARM2);
break;
case lfield_cubemapname:
s = PR_GetStringOfs(prinst, OFS_PARM2);
Q_strncpyz(l->cubemapname, s, sizeof(l->cubemapname));
if (*l->cubemapname)
l->cubetexture = R_LoadReplacementTexture(l->cubemapname, "", IF_CUBEMAP);
else
l->cubetexture = r_nulltex;
break;
default:
break;
}
@ -790,6 +805,15 @@ static void QCBUILTIN PF_R_DynamicLight_Get(progfuncs_t *prinst, struct globalva
case lfield_fov:
G_FLOAT(OFS_RETURN) = l->fov;
break;
case lfield_corona:
G_FLOAT(OFS_RETURN) = l->corona;
break;
case lfield_coronascale:
G_FLOAT(OFS_RETURN) = l->coronascale;
break;
case lfield_cubemapname:
RETURN_TSTRING(l->cubemapname);
break;
default:
G_INT(OFS_RETURN) = 0;
break;
@ -801,18 +825,24 @@ static void QCBUILTIN PF_R_DynamicLight_Add(progfuncs_t *prinst, struct globalva
float *org = G_VECTOR(OFS_PARM0);
float radius = G_FLOAT(OFS_PARM1);
float *rgb = G_VECTOR(OFS_PARM2);
// float style = G_FLOAT(OFS_PARM3);
// char *cubemapname = G_STRING(OFS_PARM4);
// float pflags = G_FLOAT(OFS_PARM5);
float style = (*prinst->callargc > 3)?G_FLOAT(OFS_PARM3):0;
char *cubemapname = (*prinst->callargc > 4)?PR_GetStringOfs(prinst, OFS_PARM4):"";
int pflags = (*prinst->callargc > 5)?G_FLOAT(OFS_PARM5):PFLAGS_CORONA;
csqcedict_t *self;
wedict_t *self = PROG_TO_WEDICT(prinst, *csqcg.self);
dlight_t *dl;
//if the org matches self, then attach it.
self = (csqcedict_t*)PROG_TO_EDICT(prinst, *csqcg.self);
if (VectorCompare(self->v->origin, org))
G_FLOAT(OFS_RETURN) = V_AddLight(-self->entnum, org, radius, rgb[0]/5, rgb[1]/5, rgb[2]/5);
dl = CL_NewDlightRGB (VectorCompare(self->v->origin, org)?-self->entnum:0, org, radius, -0.1, rgb[0], rgb[1], rgb[2]);
if (pflags & PFLAGS_NOSHADOW)
dl->flags |= LFLAG_NOSHADOWS;
if (pflags & PFLAGS_CORONA)
dl->corona = 1;
else
G_FLOAT(OFS_RETURN) = V_AddLight(0, org, radius, rgb[0]/5, rgb[1]/5, rgb[2]/5);
dl->corona = 0;
G_FLOAT(OFS_RETURN) = dl - cl_dlights;
}
static void QCBUILTIN PF_R_AddEntityMask(progfuncs_t *prinst, struct globalvars_s *pr_globals)

View file

@ -129,14 +129,14 @@ extern cvar_t r_bouncysparks;
extern cvar_t r_part_rain;
extern cvar_t r_bloodstains;
extern cvar_t gl_part_flame;
cvar_t r_part_rain_quantity = CVAR("r_part_rain_quantity", "1");
cvar_t r_part_rain_quantity = CVARF("r_part_rain_quantity", "1", CVAR_ARCHIVE);
cvar_t r_particle_tracelimit = CVARD("r_particle_tracelimit", "200", "Number of traces to allow per frame for particle physics.");
cvar_t r_particle_tracelimit = CVARFD("r_particle_tracelimit", "200", CVAR_ARCHIVE, "Number of traces to allow per frame for particle physics.");
cvar_t r_part_sparks = CVAR("r_part_sparks", "1");
cvar_t r_part_sparks_trifan = CVAR("r_part_sparks_trifan", "1");
cvar_t r_part_sparks_textured = CVAR("r_part_sparks_textured", "1");
cvar_t r_part_beams = CVAR("r_part_beams", "1");
cvar_t r_part_contentswitch = CVARD("r_part_contentswitch", "1", "Enable particle effects to change based on content (ex. water).");
cvar_t r_part_contentswitch = CVARFD("r_part_contentswitch", "1", CVAR_ARCHIVE, "Enable particle effects to change based on content (ex. water).");
particleengine_t *pe;

View file

@ -435,7 +435,7 @@ static void Surf_AddDynamicLightNorms (msurface_t *surf)
local[0] -= surf->texturemins[0];
local[1] -= surf->texturemins[1];
a = 256*(cl_dlights[lnum].color[0]*1.5 + cl_dlights[lnum].color[1]*2.95 + cl_dlights[lnum].color[2]*0.55);
a = 256*(cl_dlights[lnum].color[0]*NTSC_RED + cl_dlights[lnum].color[1]*NTSC_GREEN + cl_dlights[lnum].color[2]*NTSC_BLUE);
for (t = 0 ; t<tmax ; t++)
{
@ -510,9 +510,9 @@ static void Surf_AddDynamicLightsColours (msurface_t *surf)
local[0] -= surf->texturemins[0];
local[1] -= surf->texturemins[1];
r = cl_dlights[lnum].color[0]*3*256;
g = cl_dlights[lnum].color[1]*3*256;
b = cl_dlights[lnum].color[2]*3*256;
r = cl_dlights[lnum].color[0]*256;
g = cl_dlights[lnum].color[1]*256;
b = cl_dlights[lnum].color[2]*256;
/* if (cl_dlights[lnum].type == 1) //a wierd effect.
{

View file

@ -157,9 +157,7 @@ typedef struct
float m_projection[16];
float m_view[16];
vec3_t gfog_rgb;
float gfog_density;
float gfog_alpha;
vec4_t gfog_rgbd;
vrect_t pxrect; /*vrect, but in pixels rather than virtual coords*/
qboolean externalview; /*draw external models and not viewmodels*/

View file

@ -51,8 +51,8 @@ cvar_t cl_cursor = CVAR ("cl_cursor", "");
cvar_t cl_cursorsize = CVAR ("cl_cursorsize", "32");
cvar_t cl_cursorbias = CVAR ("cl_cursorbias", "4");
cvar_t gl_nocolors = CVAR ("gl_nocolors", "0");
cvar_t gl_part_flame = CVARD ("gl_part_flame", "1", "Enable particle emitting from models. Mainly used for torch and flame effects.");
cvar_t gl_nocolors = CVARF ("gl_nocolors", "0", CVAR_ARCHIVE);
cvar_t gl_part_flame = CVARFD ("gl_part_flame", "1", CVAR_ARCHIVE, "Enable particle emitting from models. Mainly used for torch and flame effects.");
//opengl library, blank means try default.
static cvar_t gl_driver = CVARF ("gl_driver", "",
@ -64,22 +64,22 @@ cvar_t mod_md3flags = CVAR ("mod_md3flags", "1");
cvar_t r_ambient = CVARF ("r_ambient", "0",
CVAR_CHEAT);
cvar_t r_bloodstains = CVAR ("r_bloodstains", "1");
cvar_t r_bloodstains = CVARF ("r_bloodstains", "1", CVAR_ARCHIVE);
cvar_t r_bouncysparks = CVARFD ("r_bouncysparks", "0",
CVAR_ARCHIVE,
"Enables particle interaction with world surfaces, allowing for bouncy particles.");
cvar_t r_drawentities = CVAR ("r_drawentities", "1");
cvar_t r_drawflat = CVARF ("r_drawflat", "0",
CVAR_SEMICHEAT | CVAR_RENDERERCALLBACK | CVAR_SHADERSYSTEM);
CVAR_ARCHIVE | CVAR_SEMICHEAT | CVAR_RENDERERCALLBACK | CVAR_SHADERSYSTEM);
cvar_t gl_miptexLevel = CVAR ("gl_miptexLevel", "0");
cvar_t r_drawviewmodel = CVAR ("r_drawviewmodel", "1");
cvar_t r_drawviewmodel = CVARF ("r_drawviewmodel", "1", CVAR_ARCHIVE);
cvar_t r_drawviewmodelinvis = CVAR ("r_drawviewmodelinvis", "0");
cvar_t r_dynamic = CVARF ("r_dynamic", IFMINIMAL("0","1"),
CVAR_ARCHIVE);
cvar_t r_fastturb = CVARF ("r_fastturb", "0",
CVAR_SHADERSYSTEM);
cvar_t r_fastsky = CVARF ("r_fastsky", "0",
CVAR_SHADERSYSTEM);
CVAR_ARCHIVE | CVAR_SHADERSYSTEM);
cvar_t r_fastskycolour = CVARF ("r_fastskycolour", "0",
CVAR_RENDERERCALLBACK|CVAR_SHADERSYSTEM);
cvar_t r_fb_bmodels = CVARAF("r_fb_bmodels", "1",
@ -101,16 +101,16 @@ cvar_t r_fullbright = SCVARF ("r_fullbright", "0",
cvar_t r_fullbrightSkins = SCVARF ("r_fullbrightSkins", "0.8", /*don't default to 1, as it looks a little ugly (too bright), but don't default to 0 either because then you're handicapped in the dark*/
CVAR_SEMICHEAT|CVAR_SHADERSYSTEM);
cvar_t r_lightmap_saturation = SCVAR ("r_lightmap_saturation", "1");
cvar_t r_lightstylesmooth = SCVAR ("r_lightstylesmooth", "0");
cvar_t r_lightstylesmooth = CVARF ("r_lightstylesmooth", "0", CVAR_ARCHIVE);
cvar_t r_lightstylesmooth_limit = SCVAR ("r_lightstylesmooth_limit", "2");
cvar_t r_lightstylespeed = SCVAR ("r_lightstylespeed", "10");
cvar_t r_loadlits = SCVAR ("r_loadlit", "1");
cvar_t r_menutint = SCVARF ("r_menutint", "0.68 0.4 0.13",
CVAR_RENDERERCALLBACK);
cvar_t r_netgraph = SCVAR ("r_netgraph", "0");
cvar_t r_nolerp = SCVAR ("r_nolerp", "0");
cvar_t r_nolightdir = SCVAR ("r_nolightdir", "0");
cvar_t r_novis = SCVAR ("r_novis", "0");
cvar_t r_nolerp = CVARF ("r_nolerp", "0", CVAR_ARCHIVE);
cvar_t r_nolightdir = CVARF ("r_nolightdir", "0", CVAR_ARCHIVE);
cvar_t r_novis = CVARF ("r_novis", "0", CVAR_ARCHIVE);
cvar_t r_part_rain = CVARFD ("r_part_rain", "0",
CVAR_ARCHIVE,
"Enable particle effects to emit off of surfaces. Mainly used for weather or lava/slime effects.");
@ -127,7 +127,7 @@ cvar_t r_wallcolour = CVARAF ("r_wallcolour", "255 255 255",
cvar_t r_walltexture = CVARF ("r_walltexture", "",
CVAR_RENDERERCALLBACK|CVAR_SHADERSYSTEM); //FIXME: broken
cvar_t r_wateralpha = CVARF ("r_wateralpha", "1",
CVAR_SHADERSYSTEM);
CVAR_ARCHIVE | CVAR_SHADERSYSTEM);
cvar_t r_waterwarp = CVARF ("r_waterwarp", "1",
CVAR_ARCHIVE);
@ -237,7 +237,7 @@ cvar_t gl_detailscale = CVAR ("gl_detailscale", "5");
cvar_t gl_font = CVARF ("gl_font", "",
CVAR_RENDERERCALLBACK);
cvar_t gl_lateswap = CVAR ("gl_lateswap", "0");
cvar_t gl_lerpimages = CVAR ("gl_lerpimages", "1");
cvar_t gl_lerpimages = CVARF ("gl_lerpimages", "1", CVAR_ARCHIVE);
//cvar_t gl_lightmapmode = SCVARF("gl_lightmapmode", "",
// CVAR_ARCHIVE);
cvar_t gl_load24bit = SCVARF ("gl_load24bit", "1",
@ -262,8 +262,8 @@ cvar_t gl_overbright = CVARFC ("gl_overbright", "1",
Surf_RebuildLightmap_Callback);
cvar_t gl_overbright_all = SCVARF ("gl_overbright_all", "0",
CVAR_ARCHIVE);
cvar_t gl_picmip = SCVAR ("gl_picmip", "0");
cvar_t gl_picmip2d = SCVAR ("gl_picmip2d", "0");
cvar_t gl_picmip = CVARF ("gl_picmip", "0", CVAR_ARCHIVE);
cvar_t gl_picmip2d = CVARF ("gl_picmip2d", "0", CVAR_ARCHIVE);
cvar_t gl_nohwblend = SCVAR ("gl_nohwblend","1");
cvar_t gl_savecompressedtex = SCVAR ("gl_savecompressedtex", "0");
cvar_t gl_schematics = SCVAR ("gl_schematics", "0");
@ -272,7 +272,7 @@ cvar_t gl_smoothcrosshair = SCVAR ("gl_smoothcrosshair", "1");
cvar_t gl_maxdist = SCVAR("gl_maxdist", "8192");
#ifdef SPECULAR
cvar_t gl_specular = SCVAR ("gl_specular", "0");
cvar_t gl_specular = CVARF ("gl_specular", "1", CVAR_ARCHIVE);
#endif
// The callbacks are not in D3D yet (also ugly way of seperating this)
@ -302,8 +302,8 @@ cvar_t r_lightprepass = CVARFD("r_lightprepass", "0", CVAR_SHADERSYSTEM, "E
cvar_t r_shadow_bumpscale_basetexture = SCVAR ("r_shadow_bumpscale_basetexture", "4");
cvar_t r_shadow_bumpscale_bumpmap = SCVAR ("r_shadow_bumpscale_bumpmap", "10");
cvar_t r_glsl_offsetmapping = SCVAR ("r_glsl_offsetmapping", "0");
cvar_t r_glsl_offsetmapping_scale = SCVAR ("r_glsl_offsetmapping_scale", "0.04");
cvar_t r_glsl_offsetmapping = CVARF ("r_glsl_offsetmapping", "0", CVAR_ARCHIVE);
cvar_t r_glsl_offsetmapping_scale = CVAR ("r_glsl_offsetmapping_scale", "0.04");
cvar_t r_shadow_realtime_world = SCVARF ("r_shadow_realtime_world", "0", CVAR_ARCHIVE);
cvar_t r_shadow_realtime_world_shadows = SCVARF ("r_shadow_realtime_world_shadows", "1", CVAR_ARCHIVE);

View file

@ -64,12 +64,12 @@ cvar_t bgmvolume = CVARFD( "musicvolume", "0", CVAR_ARCHIVE,
cvar_t volume = CVARFD( "volume", "0.7", CVAR_ARCHIVE,
"Main volume level for all engine sound.");
cvar_t nosound = CVARD( "nosound", "0",
cvar_t nosound = CVARFD( "nosound", "0", CVAR_ARCHIVE,
"Disable all sound from the engine.");
cvar_t precache = CVARAF( "s_precache", "1",
"precache", 0);
cvar_t loadas8bit = CVARAFD( "s_loadas8bit", "0",
"loadas8bit", 0,
"loadas8bit", CVAR_ARCHIVE,
"Downsample sounds on load as lower quality 8-bit sound.");
cvar_t ambient_level = CVARAF( "s_ambientlevel", "0.3",
"ambient_level", 0);
@ -116,11 +116,11 @@ static void S_Voip_Play_Callback(cvar_t *var, char *oldval);
cvar_t cl_voip_send = CVARD("cl_voip_send", "0", "Sends voice-over-ip data to the server whenever it is set");
cvar_t cl_voip_vad_threshhold = CVARD("cl_voip_vad_threshhold", "15", "This is the threshhold for voice-activation-detection when sending voip data");
cvar_t cl_voip_vad_delay = CVARD("cl_voip_vad_delay", "0.3", "Keeps sending voice data for this many seconds after voice activation would normally stop");
cvar_t cl_voip_capturingvol = CVARD("cl_voip_capturingvol", "0.5", "Volume multiplier applied while capturing, to avoid your audio from being heard by others");
cvar_t cl_voip_showmeter = CVARD("cl_voip_showmeter", "1", "Shows your speech volume above the hud. 0=hide, 1=show when transmitting, 2=ignore voice-activation disable");
cvar_t cl_voip_capturingvol = CVARAFD("cl_voip_capturingvol", "0.5", NULL, CVAR_ARCHIVE, "Volume multiplier applied while capturing, to avoid your audio from being heard by others");
cvar_t cl_voip_showmeter = CVARAFD("cl_voip_showmeter", "1", NULL, CVAR_ARCHIVE, "Shows your speech volume above the hud. 0=hide, 1=show when transmitting, 2=ignore voice-activation disable");
cvar_t cl_voip_play = CVARCD("cl_voip_play", "1", S_Voip_Play_Callback, "Enables voip playback.");
cvar_t cl_voip_micamp = CVARD("cl_voip_micamp", "2", "Amplifies your microphone when using voip.");
cvar_t cl_voip_play = CVARAFDC("cl_voip_play", "1", NULL, CVAR_ARCHIVE, "Enables voip playback.", S_Voip_Play_Callback);
cvar_t cl_voip_micamp = CVARAFDC("cl_voip_micamp", "2", NULL, CVAR_ARCHIVE, "Amplifies your microphone when using voip.", 0);
#endif
extern vfsfile_t *rawwritefile;

View file

@ -67,7 +67,7 @@ cvar_t v_iroll_level = SCVAR("v_iroll_level", "0.1");
cvar_t v_ipitch_level = SCVAR("v_ipitch_level", "0.3");
cvar_t v_idlescale = SCVAR("v_idlescale", "0");
cvar_t crosshair = SCVARF("crosshair", "0", CVAR_ARCHIVE);
cvar_t crosshair = SCVARF("crosshair", "1", CVAR_ARCHIVE);
cvar_t crosshaircolor = SCVARF("crosshaircolor", "255 255 255", CVAR_ARCHIVE);
cvar_t crosshairsize = SCVARF("crosshairsize", "8", CVAR_ARCHIVE);
@ -78,7 +78,7 @@ cvar_t crosshairimage = SCVAR("crosshairimage", "");
cvar_t crosshairalpha = SCVAR("crosshairalpha", "1");
cvar_t gl_cshiftpercent = SCVAR("gl_cshiftpercent", "100");
cvar_t gl_cshiftenabled = SCVAR("gl_polyblend", "1");
cvar_t gl_cshiftenabled = CVARF("gl_polyblend", "1", CVAR_ARCHIVE);
cvar_t v_bonusflash = SCVAR("v_bonusflash", "1");
@ -993,9 +993,8 @@ void V_CalcRefdef (int pnum)
#endif
r_refdef.gfog_density = cl.fog_density;
r_refdef.gfog_alpha = cl.fog_density?1:0;//cl.fog_alpha;
VectorCopy(cl.fog_colour, r_refdef.gfog_rgb);
VectorCopy(cl.fog_colour, r_refdef.gfog_rgbd);
r_refdef.gfog_rgbd[3] = cl.fog_density / 64;
// view is the weapon model (only visible from inside body)
view = &cl.viewent[pnum];

View file

@ -1521,7 +1521,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, galiasinfo_t *inf, int surfnum, ent
meshcache.usebonepose = NULL;
if (inf->ofs_skel_xyz && !inf->ofs_skel_weight)
{
meshcache.usebonepose = false;
meshcache.usebonepose = NULL;
mesh->xyz_array = (vecV_t*)((char*)inf + inf->ofs_skel_xyz);
mesh->normals_array = (vec3_t*)((char*)inf + inf->ofs_skel_norm);
mesh->snormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_svect);

View file

@ -1597,9 +1597,9 @@ static void World_ODE_Frame_JointFromEntity(world_t *world, wedict_t *ed)
//Con_Printf("made new joint %i\n", (int) (ed - prog->edicts));
dJointSetData(j, (void *) ed);
if(enemy)
b1 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, enemy))->ode.ode_body);
b1 = (dBodyID)((WEDICT_NUM(world->progs, enemy))->ode.ode_body);
if(aiment)
b2 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, aiment))->ode.ode_body);
b2 = (dBodyID)((WEDICT_NUM(world->progs, aiment))->ode.ode_body);
dJointAttach(j, b1, b2);
switch(jointtype)
@ -1866,6 +1866,12 @@ static void World_ODE_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
if (movetype != MOVETYPE_PHYSICS)
massval = 1.0f;
// get friction from entity
if (ed->xv->friction)
ed->ode.ode_friction = ed->xv->friction;
else
ed->ode.ode_friction = 1.0;
// check if we need to create or replace the geom
if (!ed->ode.ode_physics
|| !VectorCompare(ed->ode.ode_mins, entmins)
@ -2198,6 +2204,7 @@ static void VARGS nearCallback (void *data, dGeomID o1, dGeomID o2)
float bouncestop1 = 60.0f / 800.0f;
float bouncefactor2 = 0.0f;
float bouncestop2 = 60.0f / 800.0f;
float erp;
dVector3 grav;
wedict_t *ed1, *ed2;
@ -2289,6 +2296,8 @@ static void VARGS nearCallback (void *data, dGeomID o1, dGeomID o2)
dWorldGetGravity(world->ode.ode_world, grav);
bouncestop1 *= fabs(grav[2]);
erp = (DotProduct(ed1->v->velocity, ed1->v->velocity) > DotProduct(ed2->v->velocity, ed2->v->velocity)) ? ed1->xv->erp : ed2->xv->erp;
// add these contact points to the simulation
for (i = 0;i < numcontacts;i++)
{
@ -2296,8 +2305,8 @@ static void VARGS nearCallback (void *data, dGeomID o1, dGeomID o2)
(physics_ode_contact_erp.value != -1 ? dContactSoftERP : 0) |
(physics_ode_contact_cfm.value != -1 ? dContactSoftCFM : 0) |
(bouncefactor1 > 0 ? dContactBounce : 0);
contact[i].surface.mu = physics_ode_contact_mu.value;
contact[i].surface.soft_erp = physics_ode_contact_erp.value;
contact[i].surface.mu = physics_ode_contact_mu.value * ed1->ode.ode_friction * ed2->ode.ode_friction;
contact[i].surface.soft_erp = physics_ode_contact_erp.value + erp;
contact[i].surface.soft_cfm = physics_ode_contact_cfm.value;
contact[i].surface.bounce = bouncefactor1;
contact[i].surface.bounce_vel = bouncestop1;

View file

@ -449,5 +449,8 @@ enum lightfield_e
lfield_flags=3,
lfield_style=4,
lfield_angles=5,
lfield_fov=6
lfield_fov=6,
lfield_corona=7,
lfield_coronascale=8,
lfield_cubemapname=9
};

View file

@ -2,7 +2,6 @@
#ifdef D3DQUAKE
#include "shader.h"
#include "shader.h"
#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
#define HMONITOR_DECLARED
DECLARE_HANDLE(HMONITOR);

View file

@ -1648,7 +1648,7 @@
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
WholeProgramOptimization="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"

View file

@ -19406,6 +19406,10 @@
RelativePath="..\common\pr_bgcmd.c"
>
</File>
<File
RelativePath="..\client\pr_skelobj.c"
>
</File>
<File
RelativePath="..\common\q1bsp.c"
>
@ -30667,6 +30671,7 @@
</FileConfiguration>
<FileConfiguration
Name="MinGLDebug_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30685,6 +30690,7 @@
</FileConfiguration>
<FileConfiguration
Name="D3DDebug_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30703,6 +30709,7 @@
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30721,6 +30728,7 @@
</FileConfiguration>
<FileConfiguration
Name="GLDebug_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30759,6 +30767,7 @@
</FileConfiguration>
<FileConfiguration
Name="MRelease_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30797,6 +30806,7 @@
</FileConfiguration>
<FileConfiguration
Name="MDebug_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30815,6 +30825,7 @@
</FileConfiguration>
<FileConfiguration
Name="GLRelease_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30833,6 +30844,7 @@
</FileConfiguration>
<FileConfiguration
Name="D3DRelease_SDL|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -30841,6 +30853,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\gl\gl_vidsdl.c"
>
</File>
<File
RelativePath="..\gl\glmod_doom.c"
>

View file

@ -20,6 +20,7 @@
extern cvar_t gl_overbright;
#if 0
#define LIGHTPASS_GLSL_SHARED "\
varying vec2 tcbase;\n\
varying vec3 lightvector;\n\
@ -241,26 +242,11 @@ char *defaultglsl2program =
LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT
;
//!!permu LOWER
//!!permu UPPER
#endif
static const char LIGHTPASS_SHADER[] = "\
{\n\
program\n\
{\n\
!!permu BUMP\n\
!!permu SPECULAR\n\
!!permu FULLBRIGHT\n\
!!permu OFFSETMAPPING\n\
!!permu SKELETAL\n\
!!permu FOG\n\
#define LIGHTPASS\n\
%s\n\
}\n\
\
param opt cvarf r_glsl_offsetmapping_bias offsetmapping_bias\n\
param opt cvarf r_glsl_offsetmapping_scale offsetmapping_scale\n\
\
program rtlight%s\n\
{\n\
map $diffuse\n\
blendfunc add\n\
@ -274,19 +260,16 @@ static const char LIGHTPASS_SHADER[] = "\
}";
static const char PCFPASS_SHADER[] = "\
{\n\
program rtlight#PCF%s\n"/*\
program\n\
{\n\
#define LIGHTPASS\n\
//#define CUBE\n\
#define PCF\n\
%s%s\n\
}\n\
}\n*/"\
\
//incoming fragment\n\
\
param opt cvarf r_glsl_offsetmapping_scale offsetmapping_scale\n\
\
//eye pos\n\
/*eye pos*/\n\
param opt entmatrix entmatrix\n\
\
{\n\
@ -1063,20 +1046,20 @@ static float *FTableForFunc ( unsigned int func )
void Shader_LightPass_Std(char *shortname, shader_t *s, const void *args)
{
char shadertext[8192*2];
sprintf(shadertext, LIGHTPASS_SHADER, defaultglsl2program);
sprintf(shadertext, LIGHTPASS_SHADER, "");
// FS_WriteFile("shader/lightpass.shader.builtin", shadertext, strlen(shadertext), FS_GAMEONLY);
Shader_DefaultScript(shortname, s, shadertext);
}
void Shader_LightPass_PCF(char *shortname, shader_t *s, const void *args)
{
char shadertext[8192*2];
sprintf(shadertext, PCFPASS_SHADER, "", defaultglsl2program);
sprintf(shadertext, PCFPASS_SHADER, "");
Shader_DefaultScript(shortname, s, shadertext);
}
void Shader_LightPass_Spot(char *shortname, shader_t *s, const void *args)
{
char shadertext[8192*2];
sprintf(shadertext, PCFPASS_SHADER, "#define SPOT\n", defaultglsl2program);
sprintf(shadertext, PCFPASS_SHADER, "#SPOT");
Shader_DefaultScript(shortname, s, shadertext);
}
@ -2520,6 +2503,13 @@ static unsigned int BE_Program_Set_Attribute(const shaderprogparm_t *p, unsigned
}
break;
case SP_E_LMSCALE:
if (shaderstate.curentity->model && shaderstate.curentity->model->engineflags & MDLF_NEEDOVERBRIGHT)
qglUniform1fARB(p->handle[perm], 1<<bound(0, gl_overbright.ival, 2));
else
qglUniform1fARB(p->handle[perm], 1.0f);
break;
case SP_E_GLOWMOD:
qglUniform3fvARB(p->handle[perm], 1, (GLfloat*)shaderstate.curentity->glowmod);
break;
@ -2598,7 +2588,7 @@ static unsigned int BE_Program_Set_Attribute(const shaderprogparm_t *p, unsigned
qglUniform3fvARB(p->handle[perm], 1, shaderstate.lightcolours);
break;
case SP_W_FOG:
qglUniform4fvARB(p->handle[perm], 1, r_refdef.gfog_rgb);
qglUniform4fvARB(p->handle[perm], 1, r_refdef.gfog_rgbd);
break;
case SP_V_EYEPOS:
qglUniform3fvARB(p->handle[perm], 1, r_origin);
@ -2696,7 +2686,7 @@ static void BE_RenderMeshProgram(const shader_t *shader, const shaderpass_t *pas
perm |= PERMUTATION_LOWER;
if (TEXVALID(shaderstate.curtexnums->upperoverlay) && p->handle[perm|PERMUTATION_UPPER].glsl)
perm |= PERMUTATION_UPPER;
if (r_refdef.gfog_alpha && p->handle[perm|PERMUTATION_FOG].glsl)
if (r_refdef.gfog_rgbd[3] && p->handle[perm|PERMUTATION_FOG].glsl)
perm |= PERMUTATION_FOG;
if (r_glsl_offsetmapping.ival && TEXVALID(shaderstate.curtexnums->bump) && p->handle[perm|PERMUTATION_OFFSET].glsl)
perm |= PERMUTATION_OFFSET;

View file

@ -398,16 +398,10 @@ void R_SetupGL (void)
// MYgluPerspective (yfov, screenaspect, 4, 4096);
Matrix4x4_CM_Projection_Far(r_refdef.m_projection, fov_x, fov_y, gl_mindist.value, gl_maxdist.value);
if (gl_config.arb_depth_clamp)
qglEnable(GL_DEPTH_CLAMP_ARB);
}
else
{
Matrix4x4_CM_Projection_Inf(r_refdef.m_projection, fov_x, fov_y, gl_mindist.value);
if (gl_config.arb_depth_clamp)
qglDisable(GL_DEPTH_CLAMP_ARB);
}
}
else

View file

@ -853,15 +853,18 @@ static void R_LoadRTLights(void)
VectorCopy(org, dl->origin);
dl->radius = radius;
VectorCopy(rgb, dl->color);
dl->corona = corona;
dl->coronascale = coronascale;
dl->die = 0;
dl->flags = flags;
/*if (*cubename)
{
dl->fov = 90;
dl->flags |= LFLAG_SHADOWMAP;
}*/
AngleVectors(angles, dl->axis[0], dl->axis[1], dl->axis[2]);
Q_strncpyz(dl->cubemapname, cubename, sizeof(dl->cubemapname));
if (*dl->cubemapname)
dl->cubetexture = R_LoadReplacementTexture(dl->cubemapname, "", IF_CUBEMAP);
else
dl->cubetexture = r_nulltex;
dl->style = style+1;
}
file = end+1;

View file

@ -1083,7 +1083,6 @@ struct sbuiltin_s
},
/*draws a wall, with lightmap.*/
{QR_OPENGL/*ES*/, 100, "defaultwall",
"!!cvarf gl_overbright\n"
"#ifdef VERTEX_SHADER\n"
"attribute vec2 v_texcoord;\n"
"attribute vec2 v_lmcoord;\n"
@ -1104,26 +1103,43 @@ struct sbuiltin_s
//"uniform sampler2D s_t3;\n" /*tex_deluxmap*/
//"uniform sampler2D s_t4;\n" /*tex_fullbright*/
"varying mediump vec2 tc, lm;\n"
"uniform mediump float cvar_gl_overbright;\n"
"uniform mediump float e_lmscale;\n"
"void main ()\n"
"{\n"
" mediump float scale = exp2(floor(clamp(cvar_gl_overbright, 0.0, 2.0)));\n"
" gl_FragColor = texture2D(s_t0, tc) * texture2D(s_t1, lm) * vec4(scale, scale, scale, 1);\n"
" gl_FragColor = texture2D(s_t0, tc) * texture2D(s_t1, lm) * vec4(e_lmscale, e_lmscale, e_lmscale, 1);\n"
"}\n"
"#endif\n"
},
{QR_OPENGL, 110, "defaultwall",
"!!cvarf gl_overbright\n"
"!!permu OFFSETMAPPING\n"
"!!permu FULLBRIGHT\n"
"!!permu FOG\n"
"!!cvarf r_glsl_offsetmapping_scale\n"
"#include \"sys/fog.h\"\n"
"#if defined(OFFSETMAPPING)\n"
"varying vec3 eyevector;\n"
"#endif\n"
"#ifdef VERTEX_SHADER\n"
"attribute vec2 v_texcoord;\n"
"attribute vec2 v_lmcoord;\n"
"varying vec2 tc, lm;\n"
"#if defined(OFFSETMAPPING)\n"
"uniform vec3 e_eyepos;\n"
"attribute vec3 v_normal;\n"
"attribute vec3 v_svector;\n"
"attribute vec3 v_tvector;\n"
"#endif\n"
"void main ()\n"
"{\n"
"#if defined(OFFSETMAPPING)\n"
"vec3 eyeminusvertex = e_eyepos - v_position.xyz;\n"
"eyevector.x = dot(eyeminusvertex, v_svector.xyz);\n"
"eyevector.y = -dot(eyeminusvertex, v_tvector.xyz);\n"
"eyevector.z = dot(eyeminusvertex, v_normal.xyz);\n"
"#endif\n"
" tc = v_texcoord;\n"
" lm = v_lmcoord;\n"
" gl_Position = ftetransform();\n"
@ -1133,21 +1149,44 @@ struct sbuiltin_s
"#ifdef FRAGMENT_SHADER\n"
"uniform sampler2D s_t0;\n" /*tex_diffuse*/
"uniform sampler2D s_t1;\n" /*tex_lightmap*/
//"uniform sampler2D s_t2;\n" /*tex_normalmap*/
"#ifdef OFFSETMAPPING\n"
"uniform sampler2D s_t2;\n" /*tex_normalmap*/
"#endif\n"
//"uniform sampler2D s_t3;\n" /*tex_deluxmap*/
//"uniform sampler2D s_t4;\n" /*tex_fullbright*/
"#ifdef FULLBRIGHT\n"
"uniform sampler2D s_t4;\n" /*tex_fullbright*/
"#endif\n"
"varying vec2 tc, lm;\n"
"uniform float cvar_gl_overbright;\n"
"uniform float e_lmscale;\n"
"#ifdef OFFSETMAPPING\n"
"uniform float cvar_r_glsl_offsetmapping_scale;\n"
"#endif\n"
"void main ()\n"
"{\n"
" float scale = exp2(floor(clamp(cvar_gl_overbright, 0.0, 2.0)));\n"
" gl_FragColor = fog4(texture2D(s_t0, tc) * texture2D(s_t1, lm) * vec4(scale, scale, scale, 1));\n"
"#ifdef OFFSETMAPPING\n"
"vec2 OffsetVector = normalize(eyevector).xy * cvar_r_glsl_offsetmapping_scale * vec2(1, -1);\n"
"vec2 tcoffsetmap = tc;\n"
"#define tc tcoffsetmap\n"
"tc += OffsetVector;\n"
"OffsetVector *= 0.333;\n"
"tc -= OffsetVector * texture2D(s_t2, tc).w;\n"
"tc -= OffsetVector * texture2D(s_t2, tc).w;\n"
"tc -= OffsetVector * texture2D(s_t2, tc).w;\n"
"#endif\n"
" gl_FragColor = texture2D(s_t0, tc) * texture2D(s_t1, lm) * vec4(e_lmscale, e_lmscale, e_lmscale, 1);\n"
"#ifdef FULLBRIGHT\n"
" gl_FragColor.rgb += texture2D(s_t4, tc).rgb;\n"
"#endif\n"
"#ifdef FOG\n"
"gl_FragColor = fog4(gl_FragColor);\n"
"#endif\n"
"}\n"
"#endif\n"
},
{QR_OPENGL, 110, "drawflat_wall",
"!!cvarf gl_overbright\n"
"!!cvarv r_floorcolor\n"
"!!cvarv r_wallcolor\n"
"!!permu FOG\n"
@ -1159,12 +1198,11 @@ struct sbuiltin_s
"varying vec2 lm;\n"
"uniform vec3 cvar_r_wallcolor;\n"
"uniform vec3 cvar_r_floorcolor;\n"
"uniform float cvar_gl_overbright;\n"
"uniform float e_lmscale;\n"
"void main ()\n"
"{\n"
" float scale = exp2(floor(clamp(cvar_gl_overbright, 0.0, 2.0))) / 255.0;\n"
" col = scale * vec4((v_normal.z < 0.73)?cvar_r_wallcolor:cvar_r_floorcolor, 1.0);\n"
" col = vec4(e_lmscale/255.0 * ((v_normal.z < 0.73)?cvar_r_wallcolor:cvar_r_floorcolor), 1.0);\n"
" lm = v_lmcoord;\n"
" gl_Position = ftetransform();\n"
"}\n"
@ -1653,7 +1691,6 @@ struct sbuiltin_s
"#endif\n"
},
{QR_OPENGL, 110, "lpp_wall",
"!!cvarf gl_overbright\n"
"varying vec2 tc, lm;\n"
"varying vec4 tf;\n"
"#ifdef VERTEX_SHADER\n"
@ -1675,11 +1712,10 @@ struct sbuiltin_s
//"uniform sampler2D s_t3;\n" /*tex_normalmap*/
//"uniform sampler2D s_t4;\n" /*tex_deluxmap*/
//"uniform sampler2D s_t5;\n" /*tex_fullbright*/
"uniform float cvar_gl_overbright;\n"
"uniform float e_lmscale;\n"
"void main ()\n"
"{\n"
"float lmscale = exp2(floor(clamp(cvar_gl_overbright, 0.0, 2.0)));\n"
//"gl_FragColor = texture2D(s_t0, tc) * texture2D(s_t1, lm) * vec4(scale, scale, scale, 1.0);\n"
"vec2 nst;\n"
@ -1822,6 +1858,229 @@ struct sbuiltin_s
"}\n"
"#endif\n"
},
{QR_OPENGL, 110, "rtlight",
/*
texture units:
s0=diffuse, s1=normal, s2=specular, s3=shadowmap
custom modifiers:
PCF(shadowmap)
*/
"!!permu BUMP\n"
"!!permu SPECULAR\n"
"!!permu OFFSETMAPPING\n"
"!!permu SKELETAL\n"
"!!permu FOG\n"
"!!cvarf r_glsl_offsetmapping_scale\n"
"varying vec2 tcbase;\n"
"varying vec3 lightvector;\n"
"#if defined(SPECULAR) || defined(OFFSETMAPPING)\n"
"varying vec3 eyevector;\n"
"#endif\n"
"#ifdef PCF\n"
"varying vec4 vshadowcoord;\n"
"uniform mat4 entmatrix;\n"
"#endif\n"
"#ifdef VERTEX_SHADER\n"
"#include \"sys/skeletal.h\"\n"
"uniform vec3 l_lightposition;\n"
"attribute vec2 v_texcoord;\n"
"#if defined(SPECULAR) || defined(OFFSETMAPPING)\n"
"uniform vec3 e_eyepos;\n"
"#endif\n"
"void main ()\n"
"{\n"
"vec3 n, s, t, w;\n"
"gl_Position = skeletaltransform_wnst(w,n,s,t);\n"
"tcbase = v_texcoord; //pass the texture coords straight through\n"
"vec3 lightminusvertex = l_lightposition - w.xyz;\n"
"lightvector.x = dot(lightminusvertex, s.xyz);\n"
"lightvector.y = dot(lightminusvertex, t.xyz);\n"
"lightvector.z = dot(lightminusvertex, n.xyz);\n"
"#if defined(SPECULAR)||defined(OFFSETMAPPING)\n"
"vec3 eyeminusvertex = e_eyepos - w.xyz;\n"
"eyevector.x = dot(eyeminusvertex, s.xyz);\n"
"eyevector.y = -dot(eyeminusvertex, t.xyz);\n"
"eyevector.z = dot(eyeminusvertex, n.xyz);\n"
"#endif\n"
"#if defined(PCF) || defined(SPOT) || defined(PROJECTION)\n"
"vshadowcoord = gl_TextureMatrix[7] * (entmatrix*vec4(w.xyz, 1.0));\n"
"#endif\n"
"}\n"
"#endif\n"
/*this is full 4*4 PCF, with an added attempt at prenumbra*/
/*the offset consts are 1/(imagesize*2) */
#define PCF16P(f) "\
float xPixelOffset = (1.0+shadowcoord.b/l_lightradius)/texx;\
float yPixelOffset = (1.0+shadowcoord.b/l_lightradius)/texy;\
float s = 0.0;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.5 * xPixelOffset * shadowcoord.w, -1.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.5 * xPixelOffset * shadowcoord.w, -0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.5 * xPixelOffset * shadowcoord.w, 0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.5 * xPixelOffset * shadowcoord.w, 1.1 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
s += "f"Proj(s_t7, shadowcoord + vec4(-0.5 * xPixelOffset * shadowcoord.w, -1.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-0.5 * xPixelOffset * shadowcoord.w, -0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-0.5 * xPixelOffset * shadowcoord.w, 0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-0.5 * xPixelOffset * shadowcoord.w, 1.1 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
s += "f"Proj(s_t7, shadowcoord + vec4(0.5 * xPixelOffset * shadowcoord.w, -1.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.5 * xPixelOffset * shadowcoord.w, -0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.5 * xPixelOffset * shadowcoord.w, 0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.5 * xPixelOffset * shadowcoord.w, 1.1 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
s += "f"Proj(s_t7, shadowcoord + vec4(1.5 * xPixelOffset * shadowcoord.w, -1.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.5 * xPixelOffset * shadowcoord.w, -0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.5 * xPixelOffset * shadowcoord.w, 0.5 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.5 * xPixelOffset * shadowcoord.w, 1.1 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
colorscale *= s/5.0;\n\
"
/*this is pcf 3*3*/
/*the offset consts are 1/(imagesize*2) */
#define PCF9(f) "\
const float xPixelOffset = 1.0/texx;\
const float yPixelOffset = 1.0/texy;\
float s = 0.0;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.0 * xPixelOffset * shadowcoord.w, -1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.0 * xPixelOffset * shadowcoord.w, 0.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.0 * xPixelOffset * shadowcoord.w, 1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
s += "f"Proj(s_t7, shadowcoord + vec4(0.0 * xPixelOffset * shadowcoord.w, -1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.0 * xPixelOffset * shadowcoord.w, 0.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.0 * xPixelOffset * shadowcoord.w, 1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
\
s += "f"Proj(s_t7, shadowcoord + vec4(1.0 * xPixelOffset * shadowcoord.w, -1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.0 * xPixelOffset * shadowcoord.w, 0.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.0 * xPixelOffset * shadowcoord.w, 1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
colorscale *= s/9.0;\n\
"
/*this is a lazy form of pcf. take 5 samples in an x*/
/*the offset consts are 1/(imagesize*2) */
#define PCF5(f) "\
float xPixelOffset = 1.0/texx;\
float yPixelOffset = 1.0/texy;\
float s = 0.0;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.0 * xPixelOffset * shadowcoord.w, -1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(-1.0 * xPixelOffset * shadowcoord.w, 1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(0.0 * xPixelOffset * shadowcoord.w, 0.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.0 * xPixelOffset * shadowcoord.w, -1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
s += "f"Proj(s_t7, shadowcoord + vec4(1.0 * xPixelOffset * shadowcoord.w, 1.0 * yPixelOffset * shadowcoord.w, 0.05, 0.0)).r;\n\
colorscale *= s/5.0;\n\
"
/*this is unfiltered*/
#define PCF1(f) "\
colorscale *= "f"Proj(shadowmap, shadowcoord).r;\n"
"#ifdef FRAGMENT_SHADER\n"
"#include \"sys/fog.h\"\n"
"uniform sampler2D s_t0;\n"/*base texture*/
"#if defined(BUMP) || defined(SPECULAR) || defined(OFFSETMAPPING)\n"
"uniform sampler2D s_t1;\n"/*normalmap/height texture*/
"#endif\n"
"#ifdef SPECULAR\n"
"uniform sampler2D s_t2;\n"/*specularmap texture*/
"#endif\n"
"#ifdef PROJECTION\n"
"uniform sampler2D s_t3;\n"/*projected texture*/
"#endif\n"
"#ifdef PCF\n"
"#ifdef CUBE\n"
"uniform samplerCubeShadow s_t7;\n"
"#else\n"
"uniform sampler2DShadow s_t7;\n"
"#endif\n"
"#endif\n"
"uniform float l_lightradius;\n"
"uniform vec3 l_lightcolour;\n"
"#ifdef OFFSETMAPPING\n"
"uniform float cvar_r_glsl_offsetmapping_scale;\n"
"#endif\n"
"void main ()\n"
"{\n"
"#ifdef OFFSETMAPPING\n"
"vec2 OffsetVector = normalize(eyevector).xy * cvar_r_glsl_offsetmapping_scale * vec2(1, -1);\n"
"vec2 tcoffsetmap = tcbase;\n"
"#define tcbase tcoffsetmap\n"
"tcbase += OffsetVector;\n"
"OffsetVector *= 0.333;\n"
"tcbase -= OffsetVector * texture2D(s_t1, tcbase).w;\n"
"tcbase -= OffsetVector * texture2D(s_t1, tcbase).w;\n"
"tcbase -= OffsetVector * texture2D(s_t1, tcbase).w;\n"
"#endif\n"
"#ifdef BUMP\n"
"vec3 bases = vec3(texture2D(s_t0, tcbase));\n"
"#else\n"
"vec3 diff = vec3(texture2D(s_t0, tcbase));\n"
"#endif\n"
"#if defined(BUMP) || defined(SPECULAR)\n"
"vec3 bumps = vec3(texture2D(s_t1, tcbase)) * 2.0 - 1.0;\n"
"#endif\n"
"#ifdef SPECULAR\n"
"vec3 specs = vec3(texture2D(s_t2, tcbase));\n"
"#endif\n"
"vec3 nl = normalize(lightvector);\n"
"float colorscale = max(1.0 - dot(lightvector, lightvector)/(l_lightradius*l_lightradius), 0.0);\n"
"#ifdef BUMP\n"
"vec3 diff;\n"
"diff = bases * max(dot(bumps, nl), 0.0);\n"
"#endif\n"
"#ifdef SPECULAR\n"
"vec3 halfdir = (normalize(eyevector) + normalize(lightvector))/2.0;\n"
"float dv = dot(halfdir, bumps);\n"
"diff += pow(dv, 8.0) * specs;\n"
"#endif\n"
"#ifdef PCF\n"
"#if defined(SPOT)\n"
"const float texx = 512.0;\n"
"const float texy = 512.0;\n"
"vec4 shadowcoord = vshadowcoord;\n"
"#else\n"
"const float texx = 512.0;\n"
"const float texy = 512.0;\n"
"vec4 shadowcoord;\n"
"shadowcoord.zw = vshadowcoord.zw;\n"
"shadowcoord.xy = vshadowcoord.xy;\n"
"#endif\n"
"#ifdef CUBE\n"
PCF9("shadowCube") /*valid are 1,5,9*/
"#else\n"
PCF9("shadow2D") /*valid are 1,5,9*/
"#endif\n"
"#endif\n"
"#if defined(SPOT)\n"
/*Actually, this isn't correct*/
"if (shadowcoord.w < 0.0) discard;\n"
"vec2 spot = ((shadowcoord.st)/shadowcoord.w - 0.5)*2.0;colorscale*=1.0-(dot(spot,spot));\n"
"#endif\n"
"#if defined(PROJECTION)\n"
"l_lightcolour *= texture2d(s_t3, shadowcoord);\n"
"#endif\n"
"gl_FragColor.rgb = fog3additive(diff*colorscale*l_lightcolour);\n"
"}\n"
"#endif\n"
},
#endif
#ifdef D3DQUAKE
@ -2014,11 +2273,19 @@ static program_t *Shader_LoadGeneric(char *name, int qrtype)
}
else
{
int matchlen;
char *h = strchr(name, '#');
if (h)
matchlen = h - name;
else
matchlen = strlen(name) + 1;
for (i = 0; *sbuiltins[i].name; i++)
{
if (sbuiltins[i].qrtype == qrenderer && !strcmp(sbuiltins[i].name, name))
if (sbuiltins[i].qrtype == qrenderer && !strncmp(sbuiltins[i].name, name, matchlen))
{
#ifdef GLQUAKE
if (qrenderer == QR_OPENGL)
{
if (gl_config.gles)
{
if (sbuiltins[i].apiver != 100)
@ -2029,6 +2296,7 @@ static program_t *Shader_LoadGeneric(char *name, int qrtype)
if (sbuiltins[i].apiver == 100)
continue;
}
}
#endif
Shader_LoadPermutations(name, &g->prog, sbuiltins[i].body, sbuiltins[i].qrtype, sbuiltins[i].apiver);
@ -2109,6 +2377,7 @@ struct shader_field_names_s shader_field_names[] =
{"w_fog", SP_W_FOG},
/*ent properties*/
{"e_lmscale", SP_E_LMSCALE}, /*overbright shifting*/
{"e_origin", SP_E_ORIGIN},
{"e_time", SP_E_TIME},
{"e_eyepos", SP_E_EYEPOS},
@ -4877,9 +5146,6 @@ void Shader_Default2D(char *shortname, shader_t *s, const void *genargs)
unsigned char data[4*4] = {0};
TEXASSIGN(s->defaulttextures.base, R_LoadTexture8("black", 4, 4, data, 0, 0));
s->flags |= SHADER_NOIMAGE;
s->width = 64;
s->height = 64;
}
else
{
@ -5225,7 +5491,26 @@ cin_t *R_ShaderFindCinematic(char *name)
shader_t *R_RegisterPic (char *name)
{
return &r_shaders[R_LoadShader (name, Shader_Default2D, NULL)];
shader_t *shader;
/*don't get confused by other shaders*/
image_width = 64;
image_height = 64;
shader = &r_shaders[R_LoadShader (name, Shader_Default2D, NULL)];
/*worth a try*/
if (shader->width <= 0)
shader->width = image_width;
if (shader->height <= 0)
shader->height = image_height;
/*last ditch attempt*/
if (shader->width <= 0)
shader->width = 64;
if (shader->height <= 0)
shader->height = 64;
return shader;
}
shader_t *R_RegisterShader (char *name, const char *shaderscript)

View file

@ -2333,6 +2333,8 @@ static qboolean Sh_DrawStencilLight(dlight_t *dl, vec3_t colour, qbyte *vvis)
}
#endif
//our stencil writes.
if (gl_config.arb_depth_clamp)
qglEnable(GL_DEPTH_CLAMP_ARB);
#if 0 //def _DEBUG
// if (r_shadows.value == 666) //testing (visible shadow volumes)
@ -2420,6 +2422,8 @@ static qboolean Sh_DrawStencilLight(dlight_t *dl, vec3_t colour, qbyte *vvis)
qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
qglStencilFunc(GL_EQUAL, sref, ~0);
}
if (gl_config.arb_depth_clamp)
qglDisable(GL_DEPTH_CLAMP_ARB);
//end stencil writing.
#if 0 //draw the stencil stuff to the red channel
@ -2689,18 +2693,9 @@ void Sh_DrawLights(qbyte *vis, batch_t **mbatches)
if (!(dl->flags & ignoreflags))
continue;
if (dl->die)
{
colour[0] = dl->color[0]*10;
colour[1] = dl->color[1]*10;
colour[2] = dl->color[2]*10;
}
else
{
colour[0] = dl->color[0];
colour[1] = dl->color[1];
colour[2] = dl->color[2];
}
if (dl->style)
{
if (cl_lightstyle[dl->style-1].colour & 1)

View file

@ -179,7 +179,6 @@ qlpMTex2FUNC qglMultiTexCoord2fARB;
lpMTexFUNC qglMTexCoord2fSGIS;
lpSelTexFUNC qglSelectTextureSGIS;
int mtexid0;
int mtexid1;
//ati_truform
FTEPFNGLPNTRIANGLESIATIPROC qglPNTrianglesiATI;
@ -380,7 +379,6 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
qglMTexCoord2fSGIS = NULL;
qglSelectTextureSGIS = NULL;
mtexid0 = 0;
mtexid1 = 0;
//no GL_ATI_separate_stencil
qglStencilOpSeparateATI = NULL;
@ -443,7 +441,6 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
qglClientActiveTextureARB = (void *) getglext("glClientActiveTexture");
qglSelectTextureSGIS = qglActiveTextureARB;
mtexid0 = GL_TEXTURE0_ARB;
mtexid1 = GL_TEXTURE1_ARB;
}
else if (GL_CheckExtension("GL_ARB_multitexture") && !COM_CheckParm("-noamtex"))
{ //ARB multitexture is the popular choice.
@ -459,7 +456,6 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
qglSelectTextureSGIS = qglActiveTextureARB;
mtexid0 = GL_TEXTURE0_ARB;
mtexid1 = GL_TEXTURE1_ARB;
if (!qglActiveTextureARB || !qglClientActiveTextureARB || !qglMultiTexCoord2fARB)
{
@ -485,7 +481,6 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
gl_mtexable = true;
mtexid0 = GL_TEXTURE0_SGIS;
mtexid1 = GL_TEXTURE1_SGIS;
}
if (GL_CheckExtension("GL_EXT_stencil_wrap"))
@ -496,8 +491,9 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
if (GL_CheckExtension("GL_EXT_stencil_two_side"))
qglActiveStencilFaceEXT = (void *) getglext("glActiveStencilFaceEXT");
if (GL_CheckExtension("GL_ARB_depth_clamp") || GL_CheckExtension("GL_NV_depth_clamp"))
gl_config.arb_depth_clamp = true;
/*not enabled - its only useful for shadow volumes, but (on nvidia) it affects the depth values even when not clamped which results in shadow z-fighting. best rely upon infinite projection matricies instead*/
// if (GL_CheckExtension("GL_ARB_depth_clamp") || GL_CheckExtension("GL_NV_depth_clamp"))
// gl_config.arb_depth_clamp = true;
if (GL_CheckExtension("GL_ARB_texture_compression"))
{
@ -967,6 +963,25 @@ GLhandleARB GLSlang_CreateShader (char *name, int ver, char **precompilerconstan
shader = qglCreateShaderObjectARB(shadertype);
if (1)//gl_workaround_ati_shadersource.ival)
{
char *combined;
int totallen = 1;
for (i = 0; i < strings; i++)
totallen += length[i];
combined = malloc(totallen);
totallen = 0;
combined[totallen] = 0;
for (i = 0; i < strings; i++)
{
memcpy(combined + totallen, prstrings[i], length[i]);
totallen += length[i];
combined[totallen] = 0;
}
qglShaderSourceARB(shader, 1, &combined, NULL);
free(combined);
}
else
qglShaderSourceARB(shader, strings, prstrings, length);
qglCompileShaderARB(shader);
@ -1051,6 +1066,8 @@ GLhandleARB GLSlang_CreateProgramObject (GLhandleARB vert, GLhandleARB frag)
qglGetProgramInfoLog_(program, sizeof(str), NULL, str);
Con_Printf("Program link error: %s\n", str);
qglDeleteProgramObject_(program);
return (GLhandleARB)0;
}
return program;

View file

@ -304,7 +304,6 @@ extern int gl_mtexarbable; //max texture units
extern qboolean gl_mtexable;
extern int mtexid0;
extern int mtexid1;
extern qboolean gl_mtexable;

View file

@ -281,6 +281,7 @@ typedef struct {
SP_FIRSTUNIFORM, //never set
/*entity properties*/
SP_E_LMSCALE,
SP_E_ORIGIN,
SP_E_COLOURS,
SP_E_COLOURSIDENT,

View file

@ -231,7 +231,7 @@ static qboolean HTTP_DL_Work(struct dl_download *dl)
dl->file = FS_OpenTemp();
if (!dl->file)
{
Con_Printf("HTTP: Couldn't open file %s\n", dl->localname);
Con_Printf("HTTP: Couldn't open file \"%s\"\n", dl->localname);
dl->status = DL_FAILED;
return false;
}

View file

@ -5145,6 +5145,8 @@ void QCBUILTIN PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_global
o = G_VECTOR(OFS_PARM0);
to = G_FLOAT(OFS_PARM1);
NPP_Flush();
SV_Multicast (o, to);
}

View file

@ -200,6 +200,8 @@ and the extension fields are added on the end and can have extra vm-specific stu
comfieldfloat(skeletonindex) /*FTE_CSQC_SKELETONOBJECTS*/\
comfieldvector(colormod)\
comfieldfloat(pmove_flags)/*EXT_CSQC_1*/\
comfieldfloat(friction)/*DP_...PHYSICS*/\
comfieldfloat(erp)/*DP_...PHYSICS*/\
comfieldfloat(jointtype)/*DP_...PHYSICS*/\
comfieldfloat(mass)/*DP_...PHYSICS*/\
comfieldfloat(bouncefactor)/*DP_...PHYSICS*/\
@ -385,6 +387,7 @@ typedef struct {
vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
float ode_offsetmatrix[16];
float ode_offsetimatrix[16];
float ode_friction;
int ode_joint_type;
int ode_joint_enemy;
int ode_joint_aiment;