fixed menu bug

added some extra quake particle effects to the 'high' set, including some lights. I wonder how many people will complain.
tried to fix up coronas a bit to make them more robust.
fix stepping issue at high framerates.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4639 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-04-13 04:23:13 +00:00
parent faeb62f4ee
commit 8b9ad6a48e
21 changed files with 433 additions and 142 deletions

View File

@ -405,7 +405,7 @@ void Cam_Track(playerview_t *pv, usercmd_t *cmd)
if (cl_hightrack.value && !pv->cam_locked)
Cam_CheckHighTarget(pv);
if (!pv->cam_auto || cls.state != ca_active)
if (!pv->cam_auto || cls.state != ca_active || cl.worldmodel || cl.worldmodel->needload)
return;
if (pv->cam_locked && (!cl.players[pv->cam_spec_track].name[0] || cl.players[pv->cam_spec_track].spectator))

View File

@ -127,7 +127,7 @@ static void CL_ClearDlight(dlight_t *dl, int key)
dl->color[0] = 1;
dl->color[1] = 1;
dl->color[2] = 1;
dl->corona = bound(0, r_flashblend.value * 0.25, 1);
dl->corona = bound(0, 1 * 0.25, 1);
dl->coronascale = bound(0, r_flashblendscale.value, 1);
#ifdef RTLIGHTS
dl->lightcolourscales[0] = r_shadow_realtime_dlight_ambient.value;
@ -795,10 +795,13 @@ void CLFTE_ParseEntities(void)
newp->servertime = MSG_ReadFloat();
cl.oldgametime = cl.gametime;
cl.oldgametimemark = cl.gametimemark;
cl.gametime = newp->servertime;
cl.gametimemark = realtime;
if (cl.gametime != newp->servertime)
{
cl.oldgametime = cl.gametime;
cl.oldgametimemark = cl.gametimemark;
cl.gametime = newp->servertime;
cl.gametimemark = realtime;
}
/*clear all entities*/
newp->num_entities = 0;
@ -2869,9 +2872,9 @@ static void CL_TransitionPacketEntities(int newsequence, packet_entities_t *newp
snew = &newpack->entities[newpnum];
sold = NULL;
for ( ; oldpnum<oldpack->num_entities ; oldpnum++)
for ( ; oldpnum<oldpack->num_entities ; oldpnum)
{
sold = &oldpack->entities[oldpnum];
sold = &oldpack->entities[oldpnum++];
if (sold->number >= snew->number)
{
if (sold->number > snew->number)

View File

@ -38,6 +38,7 @@ cvar_t cl_sparemsec = CVARC("cl_sparemsec", "10", CL_SpareMsec_Callback);
cvar_t cl_queueimpulses = CVAR("cl_queueimpulses", "0");
cvar_t cl_smartjump = CVAR("cl_smartjump", "1");
cvar_t cl_run = CVARD("cl_run", "0", "Enables autorun, inverting the state of the +speed key.");
cvar_t cl_fastaccel = CVARD("cl_fastaccel", "1", "Begin moving at full speed instantly, instead of waiting a frame or so.");
cvar_t cl_prydoncursor = CVAR("cl_prydoncursor", ""); //for dp protocol
cvar_t cl_instantrotate = CVARF("cl_instantrotate", "1", CVAR_SEMICHEAT);
@ -408,10 +409,12 @@ Returns 0.25 if a key was pressed and released during the frame,
1.0 if held for the entire time
===============
*/
float CL_KeyState (kbutton_t *key, int pnum)
float CL_KeyState (kbutton_t *key, int pnum, qboolean noslowstart)
{
float val;
qboolean impulsedown, impulseup, down;
noslowstart = noslowstart && cl_fastaccel.ival;
impulsedown = key->state[pnum] & 2;
impulseup = key->state[pnum] & 4;
@ -421,7 +424,7 @@ float CL_KeyState (kbutton_t *key, int pnum)
if (impulsedown && !impulseup)
{
if (down)
val = 0.5; // pressed and held this frame
val = noslowstart?1.0:0.5; // pressed and held this frame
else
val = 0; // I_Error ();
}
@ -531,8 +534,8 @@ void CL_AdjustAngles (int pnum, double frametime)
quant = cl_yawspeed.ival;
if (cl.fpd & FPD_LIMIT_YAW || !ruleset_allow_frj.ival)
quant = bound(-900, quant, 900);
cl.playerview[pnum].viewanglechange[YAW] -= speed*quant * CL_KeyState (&in_right, pnum);
cl.playerview[pnum].viewanglechange[YAW] += speed*quant * CL_KeyState (&in_left, pnum);
cl.playerview[pnum].viewanglechange[YAW] -= speed*quant * CL_KeyState (&in_right, pnum, false);
cl.playerview[pnum].viewanglechange[YAW] += speed*quant * CL_KeyState (&in_left, pnum, false);
}
if (in_klook.state[pnum] & 1)
{
@ -540,12 +543,12 @@ void CL_AdjustAngles (int pnum, double frametime)
quant = cl_pitchspeed.ival;
if (cl.fpd & FPD_LIMIT_PITCH || !ruleset_allow_frj.ival)
quant = bound(-700, quant, 700);
cl.playerview[pnum].viewanglechange[PITCH] -= speed*quant * CL_KeyState (&in_forward, pnum);
cl.playerview[pnum].viewanglechange[PITCH] += speed*quant * CL_KeyState (&in_back, pnum);
cl.playerview[pnum].viewanglechange[PITCH] -= speed*quant * CL_KeyState (&in_forward, pnum, false);
cl.playerview[pnum].viewanglechange[PITCH] += speed*quant * CL_KeyState (&in_back, pnum, false);
}
up = CL_KeyState (&in_lookup, pnum);
down = CL_KeyState(&in_lookdown, pnum);
up = CL_KeyState (&in_lookup, pnum, false);
down = CL_KeyState(&in_lookdown, pnum, false);
quant = cl_pitchspeed.ival;
if (!ruleset_allow_frj.ival)
@ -576,22 +579,22 @@ void CL_BaseMove (usercmd_t *cmd, int pnum, float extra, float wantfps)
if (in_strafe.state[pnum] & 1)
{
cmd->sidemove += scale*cl_sidespeed.value * CL_KeyState (&in_right, pnum);
cmd->sidemove -= scale*cl_sidespeed.value * CL_KeyState (&in_left, pnum);
cmd->sidemove += scale*cl_sidespeed.value * CL_KeyState (&in_right, pnum, true);
cmd->sidemove -= scale*cl_sidespeed.value * CL_KeyState (&in_left, pnum, true);
}
cmd->sidemove += scale*cl_sidespeed.value * CL_KeyState (&in_moveright, pnum);
cmd->sidemove -= scale*cl_sidespeed.value * CL_KeyState (&in_moveleft, pnum);
cmd->sidemove += scale*cl_sidespeed.value * CL_KeyState (&in_moveright, pnum, true);
cmd->sidemove -= scale*cl_sidespeed.value * CL_KeyState (&in_moveleft, pnum, true);
if(in_xflip.ival) cmd->sidemove *= -1;
cmd->upmove += scale*cl_upspeed.value * CL_KeyState (&in_up, pnum);
cmd->upmove -= scale*cl_upspeed.value * CL_KeyState (&in_down, pnum);
cmd->upmove += scale*cl_upspeed.value * CL_KeyState (&in_up, pnum, true);
cmd->upmove -= scale*cl_upspeed.value * CL_KeyState (&in_down, pnum, true);
if (! (in_klook.state[pnum] & 1) )
{
cmd->forwardmove += scale*cl_forwardspeed.value * CL_KeyState (&in_forward, pnum);
cmd->forwardmove -= scale*(*cl_backspeed.string?cl_backspeed.value:cl_forwardspeed.value) * CL_KeyState (&in_back, pnum);
cmd->forwardmove += scale*cl_forwardspeed.value * CL_KeyState (&in_forward, pnum, true);
cmd->forwardmove -= scale*(*cl_backspeed.string?cl_backspeed.value:cl_forwardspeed.value) * CL_KeyState (&in_back, pnum, true);
}
}
@ -1910,6 +1913,7 @@ void CL_InitInput (void)
Cmd_AddCommand("in_restart", IN_Restart);
Cmd_AddCommand("sendcvar", CL_SendCvar_f);
Cvar_Register (&cl_fastaccel, inputnetworkcvargroup);
Cvar_Register (&in_xflip, inputnetworkcvargroup);
Cvar_Register (&cl_nodelta, inputnetworkcvargroup);

View File

@ -786,6 +786,7 @@ void CL_CheckForResend (void)
}
else
CL_ConnectToDarkPlaces("", &connectinfo.adr);
connectinfo.trying = false;
}
else
CL_SendConnectPacket (NULL, 8192-16, pext1, pext2, false);
@ -4592,7 +4593,7 @@ void CL_StartCinematicOrMenu(void)
#ifndef CLIENTONLY
if (!sv.state)
#endif
if (!cls.demoinfile && !cls.state && !Media_PlayingFullScreen())
if (!cls.demoinfile && !cls.state && !*cls.servername && !Media_PlayingFullScreen())
{
int ol_depth;
int idcin_depth;
@ -4621,7 +4622,7 @@ void CL_StartCinematicOrMenu(void)
}
#endif
if (!cls.demoinfile && !*cls.servername && !Media_Playing())
if (!cls.demoinfile && !cls.state && !*cls.servername && !Media_PlayingFullScreen())
{
#ifndef CLIENTONLY
if (!sv.state)
@ -4713,8 +4714,8 @@ void CL_ExecInitialConfigs(char *resetcommand)
//if the renderer is already up and running, be prepared to reload content to match the new conback/font/etc
if (qrenderer != QR_NONE)
Cbuf_AddText ("vid_reload\n", RESTRICT_LOCAL);
if (Key_Dest_Has(kdm_menu))
Cbuf_AddText ("closemenu\ntogglemenu\n", RESTRICT_LOCAL); //make sure the menu has the right content loaded.
// if (Key_Dest_Has(kdm_menu))
// Cbuf_AddText ("closemenu\ntogglemenu\n", RESTRICT_LOCAL); //make sure the menu has the right content loaded.
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to

View File

@ -4463,15 +4463,16 @@ void CL_MuzzleFlash (int destsplit)
dl->radius = 200 + (rand()&31);
dl->minlight = 32;
dl->die = cl.time + 0.5;
dl->die = cl.time + 0.1;
dl->color[0] = 1.3;
dl->color[1] = 0.9;
dl->color[2] = 0.5;
dl->color[1] = 1.3;
dl->color[2] = 1.3;
dl->channelfade[0] = 1.5;
dl->channelfade[1] = 0.75;
dl->channelfade[2] = 0.375;
dl->decay = 500;
dl->lightcolourscales[2] = 4;
}
#ifdef Q2CLIENT

View File

@ -431,7 +431,7 @@ void CL_PredictUsercmd (int pnum, int entnum, player_state_t *from, player_state
//Used when cl_nopred is 1 to determine whether we are on ground, otherwise stepup smoothing code produces ugly jump physics
void CL_CatagorizePosition (playerview_t *pv)
void CL_CatagorizePosition (playerview_t *pv, float *org)
{
if (cl.spectator)
{
@ -439,7 +439,7 @@ void CL_CatagorizePosition (playerview_t *pv)
return;
}
VectorClear (pmove.velocity);
VectorCopy (pv->simorg, pmove.origin);
VectorCopy (org, pmove.origin);
pmove.numtouch = 0;
PM_CategorizePosition ();
pv->onground = pmove.onground;
@ -497,7 +497,7 @@ void CL_CalcCrouch (playerview_t *pv)
// in air or moving down
pv->oldz = orgz;
pv->crouch += host_frametime * 150;
if (orgz - pv->oldz <= 0)
if (orgz - pv->oldz < 0)
pv->crouch -= orgz - pv->oldz; //if the view moved down, remove that amount from our crouching to avoid unneeded bobbing
if (pv->crouch > 0)
pv->crouch = 0;
@ -805,7 +805,7 @@ void CL_PredictMovePNum (int seat)
usercmd_t *cmdto;
double fromtime, totime;
int oldphysent;
double simtime;
double simtime; //this is server time if nopred is set (lerp-only), and local time if we're predicting
extern cvar_t cl_netfps;
lerpents_t *le;
qboolean nopred;
@ -999,6 +999,8 @@ void CL_PredictMovePNum (int seat)
if (pe->entities[i].number == pv->viewentity)
{
CL_EntStateToPlayerState(fromstate, &pe->entities[i]);
if (nopred)
fromtime -= (pe->entities[i].u.q1.msec / 1000.0f); //correct the time to match stale players
break;
}
}
@ -1008,14 +1010,13 @@ void CL_PredictMovePNum (int seat)
if (pe->entities[i].number == pv->viewentity)
{
CL_EntStateToPlayerState(tostate, &pe->entities[i]);
if (nopred)
totime -= (pe->entities[i].u.q1.msec / 1000.0f); //correct the time to match stale players. FIXME: this can push the simtime into the 'future' resulting in stuttering
if (cls.fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
{
cl.players[pv->playernum].stats[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
cl.players[pv->playernum].statsf[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
pv->stats[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
pv->statsf[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
//putting weapon frames in there was probably a stupid idea.
pv->stats[STAT_WEAPONFRAME] = cl.players[pv->playernum].stats[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
pv->statsf[STAT_WEAPONFRAME] = cl.players[pv->playernum].statsf[STAT_WEAPONFRAME] = pe->entities[i].u.q1.weaponframe;
pv->pmovetype = tostate->pm_type;
}
break;
@ -1150,9 +1151,8 @@ void CL_PredictMovePNum (int seat)
}
}
}
CL_CatagorizePosition(pv);
}
CL_CatagorizePosition(pv, tostate->origin);
if (le)
{

View File

@ -951,7 +951,7 @@ void CL_WriteToServer (usercmd_t *cmd);
void CL_BaseMove (usercmd_t *cmd, int pnum, float extra, float wantfps);
float CL_KeyState (kbutton_t *key, int pnum);
float CL_KeyState (kbutton_t *key, int pnum, qboolean noslowstart);
char *Key_KeynumToString (int keynum);
int Key_StringToKeynum (const char *str, int *modifier);
char *Key_GetBinding(int keynum);
@ -1370,7 +1370,6 @@ qboolean Media_PlayingFullScreen(void);
void Media_Init(void);
qboolean Media_PlayFilm(char *name, qboolean enqueue);
qboolean Media_StopFilm(qboolean all);
qboolean Media_Playing(void);
struct cin_s *Media_StartCin(char *name);
texid_tf Media_UpdateForShader(cin_t *cin);
void Media_ShutdownCin(cin_t *cin);

View File

@ -2451,13 +2451,6 @@ cin_t *Media_StartCin(char *name)
return cin;
}
qboolean Media_Playing(void)
{
if (videoshader)
return true;
return false;
}
struct pendingfilms_s
{
struct pendingfilms_s *next;

View File

@ -2760,30 +2760,31 @@ static qboolean Mods_AddMod(void *usr, ftemanifest_t *man)
void M_Menu_Mods_f (void)
{
modmenu_t *mods;
modmenu_t mods;
menucustom_t *c;
menu_t *menu;
Key_Dest_Add(kdm_menu);
menu = M_CreateMenu(sizeof(modmenu_t));
mods = menu->data;
MC_AddPicture(menu, 16, 4, 32, 144, "gfx/qplaque.lmp");
MC_AddCenterPicture(menu, 0, 24, "gfx/p_option.lmp");
memset(&mods, 0, sizeof(mods));
FS_EnumerateKnownGames(Mods_AddMod, &mods);
c = MC_AddCustom(menu, 64, 32, mods, 0);
menu->cursoritem = (menuoption_t*)c;
c->draw = Mods_Draw;
c->key = Mods_Key;
menu->remove = Mods_Remove;
FS_EnumerateKnownGames(Mods_AddMod, menu->data);
if (mods->nummanifests == 1)
if (mods.nummanifests == 1)
{
ftemanifest_t *man = mods->manifests[0];
mods->manifests[0] = NULL;
M_RemoveMenu(menu);
FS_ChangeGame(man, true);
FS_ChangeGame(mods.manifests[0], true);
Z_Free(mods.manifests);
}
else
{
Key_Dest_Add(kdm_menu);
menu = M_CreateMenu(sizeof(modmenu_t));
*(modmenu_t*)menu->data = mods;
MC_AddPicture(menu, 16, 4, 32, 144, "gfx/qplaque.lmp");
MC_AddCenterPicture(menu, 0, 24, "gfx/p_option.lmp");
c = MC_AddCustom(menu, 64, 32, menu->data, 0);
menu->cursoritem = (menuoption_t*)c;
c->draw = Mods_Draw;
c->key = Mods_Key;
menu->remove = Mods_Remove;
}
}

View File

@ -263,6 +263,8 @@ typedef struct part_type_s {
float dl_radius;
float dl_time;
vec4_t dl_decay;
float dl_corona_intensity;
float dl_corona_scale;
//PT_NODLSHADOW
int dl_cubemapnum;
vec3_t stain_rgb;
@ -825,8 +827,10 @@ static void P_ResetToDefaults(part_type_t *ptype)
ptype->rotationstartmin = -M_PI; //start with a random angle
ptype->rotationstartrand = M_PI-ptype->rotationstartmin;
ptype->spawnchance = 1;
ptype->dl_time = 5000;
ptype->dl_time = 0;
VectorSet(ptype->dl_rgb, 1, 1, 1);
ptype->dl_corona_intensity = 1;
ptype->dl_corona_scale = 0.5;
ptype->randsmax = 1;
ptype->s2 = 1;
@ -1208,7 +1212,7 @@ static void P_ParticleEffect_f(void)
else if (!strcmp(var, "blue"))
ptype->rgb[2] = atof(value)/255;
else if (!strcmp(var, "rgb"))
{
{ //byte version
ptype->rgb[0] = ptype->rgb[1] = ptype->rgb[2] = atof(value)/255;
if (Cmd_Argc()>3)
{
@ -1216,6 +1220,15 @@ static void P_ParticleEffect_f(void)
ptype->rgb[2] = atof(Cmd_Argv(3))/255;
}
}
else if (!strcmp(var, "rgbf"))
{ //float version
ptype->rgb[0] = ptype->rgb[1] = ptype->rgb[2] = atof(value);
if (Cmd_Argc()>3)
{
ptype->rgb[1] = atof(Cmd_Argv(2));
ptype->rgb[2] = atof(Cmd_Argv(3));
}
}
else if (!strcmp(var, "reddelta"))
{
@ -1236,7 +1249,7 @@ static void P_ParticleEffect_f(void)
ptype->rgbchangetime = ptype->die;
}
else if (!strcmp(var, "rgbdelta"))
{
{ //byte version
ptype->rgbchange[0] = ptype->rgbchange[1] = ptype->rgbchange[2] = atof(value)/255;
if (Cmd_Argc()>3)
{
@ -1246,6 +1259,17 @@ static void P_ParticleEffect_f(void)
if (!ptype->rgbchangetime)
ptype->rgbchangetime = ptype->die;
}
else if (!strcmp(var, "rgbdeltaf"))
{ //float version
ptype->rgbchange[0] = ptype->rgbchange[1] = ptype->rgbchange[2] = atof(value);
if (Cmd_Argc()>3)
{
ptype->rgbchange[1] = atof(Cmd_Argv(2));
ptype->rgbchange[2] = atof(Cmd_Argv(3));
}
if (!ptype->rgbchangetime)
ptype->rgbchangetime = ptype->die;
}
else if (!strcmp(var, "rgbdeltatime"))
ptype->rgbchangetime = atof(value);
@ -1256,7 +1280,7 @@ static void P_ParticleEffect_f(void)
else if (!strcmp(var, "bluerand"))
ptype->rgbrand[2] = atof(value)/255;
else if (!strcmp(var, "rgbrand"))
{
{ //byte version
ptype->rgbrand[0] = ptype->rgbrand[1] = ptype->rgbrand[2] = atof(value)/255;
if (Cmd_Argc()>3)
{
@ -1264,6 +1288,15 @@ static void P_ParticleEffect_f(void)
ptype->rgbrand[2] = atof(Cmd_Argv(3))/255;
}
}
else if (!strcmp(var, "rgbrandf"))
{ //float version
ptype->rgbrand[0] = ptype->rgbrand[1] = ptype->rgbrand[2] = atof(value);
if (Cmd_Argc()>3)
{
ptype->rgbrand[1] = atof(Cmd_Argv(2));
ptype->rgbrand[2] = atof(Cmd_Argv(3));
}
}
else if (!strcmp(var, "rgbrandsync"))
{
@ -1569,8 +1602,15 @@ static void P_ParticleEffect_f(void)
ptype->dl_decay[1] = atof(Cmd_Argv(2));
ptype->dl_decay[2] = atof(Cmd_Argv(3));
}
else if (!strcmp(var, "lightcorona"))
{
ptype->dl_corona_intensity = atof(value);
ptype->dl_corona_scale = atof(Cmd_Argv(2));
}
else if (!strcmp(var, "lighttime"))
ptype->dl_time = atof(value);
else if (!strcmp(var, "lightshadows"))
ptype->flags = (ptype->flags & ~PT_NODLSHADOW) | (atof(value)?0:PT_NODLSHADOW);
else if (!strcmp(var, "lightcubemap"))
ptype->dl_cubemapnum = atoi(value);
else if (!strcmp(var, "spawnstain"))
@ -1738,6 +1778,7 @@ qboolean PScript_Query(int typenum, int body, char *outstr, int outstrlen)
Q_strncatz(outstr, va("lighttime %g\n", ptype->dl_time), outstrlen);
Q_strncatz(outstr, va("lightshadows %g\n", (ptype->flags & PT_NODLSHADOW)?0.0f:1.0f), outstrlen);
Q_strncatz(outstr, va("lightcubemap %i\n", ptype->dl_cubemapnum), outstrlen);
Q_strncatz(outstr, va("lightcorona %g %g\n", ptype->dl_corona_intensity, ptype->dl_corona_scale), outstrlen);
}
if (ptype->stain_radius)
Q_strncatz(outstr, va("spawnstain %g %g %g %g\n", ptype->stain_radius, ptype->stain_rgb[0], ptype->stain_rgb[1], ptype->stain_rgb[2]), outstrlen);
@ -2252,6 +2293,11 @@ static void P_ImportEffectInfo_f(void)
ptype->flags = (ptype->flags & ~PT_NODLSHADOW) | (!atoi(arg[1])?PT_NODLSHADOW:0);
else if (!strcmp(arg[0], "lightcubemapnum") && args == 2)
ptype->dl_cubemapnum = atoi(arg[1]);
else if (!strcmp(arg[0], "lightcorona") && args == 3)
{
ptype->dl_corona_intensity = atof(arg[1]);
ptype->dl_corona_scale = atof(arg[2]);
}
#if 1
else if (!strcmp(arg[0], "staincolor") && args == 3)
Con_DPrintf("Particle effect %s not supported\n", arg[0]);
@ -3201,10 +3247,12 @@ static void PScript_EffectSpawned(part_type_t *ptype, vec3_t org, vec3_t dir, in
if (ptype->dl_radius)
{
dlight_t *dl = CL_NewDlight(dlkey, org, ptype->dl_radius, ptype->dl_time, ptype->dl_rgb[0], ptype->dl_rgb[1], ptype->dl_rgb[2]);
dl->channelfade[0] = ptype->dl_decay[0];
dl->channelfade[1] = ptype->dl_decay[1];
dl->channelfade[2] = ptype->dl_decay[2];
dl->decay = ptype->dl_decay[3];
dl->channelfade[0] = ptype->dl_decay[0];
dl->channelfade[1] = ptype->dl_decay[1];
dl->channelfade[2] = ptype->dl_decay[2];
dl->decay = ptype->dl_decay[3];
dl->corona = ptype->dl_corona_intensity;
dl->coronascale = ptype->dl_corona_scale;
if (ptype->flags & PT_NODLSHADOW)
dl->flags |= LFLAG_NOSHADOWS;
if (ptype->dl_cubemapnum)

View File

@ -1437,7 +1437,7 @@ void rag_updatedeltaent(entity_t *ent, lerpents_t *le)
skorel.numbones = sko->numbones;
//FIXME: provide some way for the animation to auto-trigger ragdoll (so framegroups can work automagically)
if ((ent->framestate.g[FS_REG].frame[0] & 32767) || (ent->framestate.g[FS_REG].frame[1] & 32767))
if ((ent->framestate.g[FS_REG].frame[0] & 0x8000) || (ent->framestate.g[FS_REG].frame[1] & 0x8000))
sko->numanimated = 0;
else if (sko->doll)
sko->numanimated = sko->doll->numdefaultanimated;
@ -1445,6 +1445,8 @@ void rag_updatedeltaent(entity_t *ent, lerpents_t *le)
skorel.model = sko->model;
if (sko->numanimated || sko->doll != mod->dollinfo)
{
// sko->type = SKEL_ABSOLUTE;
// Alias_ForceConvertBoneData(skorel.type, skorel.bonematrix, skorel.numbones, bones, sko->type, sko->bonematrix, sko->numbones);
skel_copy_toabs(sko, &skorel, 0, sko->numbones);
}

View File

@ -1645,11 +1645,14 @@ char *particle_set_high =
"blend add\n"
"spawnmode spiral\n"
"spawnvel -50\n"
"lighttime 0\n"
"lightshadows 0\n"
"lightradius 150\n"
"lightrgb 0.75 0.37 0.18\n"
"}\n"
/////////////////////////////////////////
//vore missiles
"r_part tr_vorespike\n"
"{\n"
"texture \"particles/fteparticlefont.tga\"\n"
@ -1666,18 +1669,90 @@ char *particle_set_high =
"friction 0\n"
"scalefactor 1\n"
"blend add\n"
"lighttime 0\n"
"lightshadows 0\n"
"lightradius 150\n"
"lightrgb 0.75 0.37 0.75\n"
"}\n"
//rygel's pack sucks
"r_trail \"progs/v_spike.mdl\" tr_vorespike\n"
//enforcer laser effect
"r_part tr_enforcerlaser\n"
"{\n"
"type texturedspark\n"
"texture \"particles/fteparticlefont.tga\"\n"
"tcoords 1 97 95 191 256\n"
"scale 15\n"
"step 4\n"
"alpha 0.3\n"
"die 0.5\n"
"rgb 255 69 0\n"
"veladd -32\n"
"spawnmode spiral\n"
"spawnvel 16\n"
"randomvel 32\n"
"friction 0\n"
"scalefactor 1\n"
"blend add\n"
"lighttime 0.2\n"
"lightshadows 0\n"
"lightradius 150\n"
"lightrgb 1 0.27 0\n"
"lightrgbfade 5 1 0\n"
"lightcorona 2 0.25\n"
"}\n"
"r_trail \"progs/laser.mdl\" tr_enforcerlaser\n"
/////////////////////////////////////////
//scrag missiles. just use the default trail cos we're lazy
//r_part tr_wizspike
//{
//}
"r_part tr_wizspike\n"
"{\n"
"texture \"particles/fteparticlefont.tga\"\n"
"tcoords 1 97 95 191 256\n"
"scale 15\n"
"step 1\n"
"alpha 0.6\n"
"die 0.2\n"
"rgb 25 200 25\n"
"veladd 0\n"
"randomvel 2\n"
"friction 4\n"
"scalefactor 0.825\n"
"spawnmode spiral\n"
"spawnvel 25\n"
"blend add\n"
"lighttime 0\n"
"lightshadows 0\n"
"lightradius 150\n"
"lightrgb 0.1 0.7 0.1\n"
"}\n"
"r_part shambercharging\n"
"{\n"
"spawnmode ball\n"
"count 200\n"
"spawnorg 128\n"
"spawnvel -256\n"
"texture \"particles/fteparticlefont.tga\"\n"
"tcoords 1 1 63 63 256 2 64\n"
"scale 4\n"
"alpha 1\n"
"die 0.5\n"
"orgadd -64\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 100 100 250\n"
"rgbrand 0 0 0\n"
"gravity 0\n"
"scalefactor 0.4\n"
"lighttime 0\n"
"lightshadows 0\n"
"lightradius 400\n"
"lightrgb 2 2 2\n"
"}\n"
"r_effect progs/s_light.mdl shambercharging 0\n"
"r_part te_blood\n"
"{\n"
@ -1691,19 +1766,13 @@ char *particle_set_high =
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 64 128 128\n"
"rgbdelta -64 -128 -128\n"
"rgb 32 64 64\n"
"rgbdelta -32 -64 -64\n"
"gravity 200\n"
"scalefactor 0.8\n"
// scaledelta -10
"}\n"
"r_part pe_73\n"
"{\n"
"assoc te_blood\n"
"}\n"
"r_part te_lightningblood\n"
"r_part high.pe_73\n"
"{\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
@ -1715,8 +1784,43 @@ char *particle_set_high =
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 0 128 128\n"
"rgbdelta 0 -128 -128\n"
"rgb 32 64 64\n"
"rgbdelta -32 -64 -64\n"
"gravity 200\n"
"scalefactor 0.8\n"
"}\n"
"r_part te_lightningblood\n"
"{\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
"count 1\n"
"scale 32\n"
"alpha 0\n"
"die 1\n"
"randomvel 32\n"
"veladd 5\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 64 128 128\n"
"rgbdelta -64 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
"}\n"
"r_part high.pe_225\n"
"{\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
"count 0.5\n"
"scale 32\n"
"alpha 0\n"
"die 1\n"
"randomvel 32\n"
"veladd 5\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 64 128 128\n"
"rgbdelta -64 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
"}\n"

View File

@ -2732,6 +2732,12 @@ void Surf_BuildModelLightmaps (model_t *m)
int j;
lightmapinfo_t *lm, *dlm;
qbyte *deluxemap;
if (*m->name == '*')
{
if (!cl.worldmodel || cl.worldmodel->needload)
return;
}
//fixup surface lightmaps, and paint
for (i=0; i<m->nummodelsurfaces; i++)
{

View File

@ -164,8 +164,8 @@ cvar_t scr_conalpha = CVARC ("scr_conalpha", "0.7",
cvar_t scr_consize = CVAR ("scr_consize", "0.5");
cvar_t scr_conspeed = CVAR ("scr_conspeed", "2000");
// 10 - 170
cvar_t scr_fov = CVARFC("fov", "90",
CVAR_ARCHIVE,
cvar_t scr_fov = CVARFDC("fov", "108",
CVAR_ARCHIVE, "field of vision, 1-170 degrees, standard fov is 90, nquake.",
SCR_Fov_Callback);
cvar_t scr_printspeed = SCVAR ("scr_printspeed", "8");
cvar_t scr_showpause = SCVAR ("showpause", "1");

View File

@ -857,6 +857,7 @@ struct
const float *usebonepose;
int bonecount;
#endif
qboolean usebones;
vecV_t *acoords1;
vecV_t *acoords2;
@ -1279,7 +1280,7 @@ int Alias_BlendBoneData(galiasinfo_t *inf, framestate_t *fstate, float *result,
{
skellerps_t lerps[FS_COUNT], *lerp;
size_t bone, endbone = 0;
size_t numgroups = Alias_FindRawSkelData(inf, fstate, lerps, 0, inf->numbones);
size_t numgroups = Alias_FindRawSkelData(inf, fstate, lerps, firstbone, lastbone);
float *pose, *matrix;
int k, b;
@ -1593,7 +1594,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
if (meshcache.ent == e)
{
if (meshcache.vertgroup == inf->shares_verts && meshcache.ent == e)
if (meshcache.vertgroup == inf->shares_verts && meshcache.ent == e && usebones == meshcache.usebones)
{
mesh->xyz_array = meshcache.acoords1;
mesh->xyz2_array = meshcache.acoords2;
@ -1608,7 +1609,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
}
}
#else
if (usebones && meshcache.bonecachetype != -1)
if (usebones)
{
mesh->bonenums = inf->ofs_skel_idx;
mesh->boneweights = inf->ofs_skel_weight;
@ -1651,6 +1652,8 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
*vbop = NULL;
if (inf->ofs_skel_xyz && !inf->ofs_skel_weight)
{
usebones = false;
//if we have skeletal xyz info, but no skeletal weights, then its a partial model that cannot possibly be animated.
meshcache.usebonepose = NULL;
mesh->xyz_array = inf->ofs_skel_xyz;
@ -1729,6 +1732,8 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
else
#endif
{
usebones = false;
frame1 = e->framestate.g[FS_REG].frame[0];
frame2 = e->framestate.g[FS_REG].frame[1];
lerp = e->framestate.g[FS_REG].lerpfrac;
@ -1853,6 +1858,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
meshcache.vbop = *vbop;
#ifdef SKELETALMODELS
meshcache.usebones = usebones;
if (usebones)
{
mesh->bonenums = inf->ofs_skel_idx;

View File

@ -882,6 +882,10 @@ qboolean Q1BSP_Trace(model_t *model, int forcehullnum, int frame, vec3_t axis[3]
// calculate an offset value to center the origin
VectorSubtract (hull->clip_mins, mins, offset);
// offset[0] = 0;
// offset[1] = 0;
if (axis)
{
vec3_t tmp;

View File

@ -604,8 +604,8 @@ static shader_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, e
return shader; //the shader can do its own colourmapping.
if (shader->prog && shader->prog->permu[PERMUTATION_UPPERLOWER].handle.glsl && !h2playertranslations)
{ //this shader can do permutations. this means we can generate only a black image, with separate top+bottom textures.
tc = 0xff000000;
bc = 0xff000000;
tc = 0xfe000000;
bc = 0xfe000000;
generateupperlower = true;
}
}

View File

@ -27,6 +27,9 @@ extern qbyte *draw_chars; // 8*8 graphic characters
static texid_t netgraphtexture; // netgraph texture
static shader_t *netgraphshader;
static int timehistory[NET_TIMINGS];
static int findex;
#define NET_GRAPHHEIGHT 32
static qbyte ngraph_texels[NET_GRAPHHEIGHT][NET_TIMINGS];
@ -99,11 +102,25 @@ void R_NetGraph (void)
unsigned ngraph_pixels[NET_GRAPHHEIGHT][NET_TIMINGS];
x = 0;
lost = CL_CalcNet(r_netgraph.value);
for (a=0 ; a<NET_TIMINGS ; a++)
if (r_netgraph.value < 0)
{
i = (cl.movesequence-a) & NET_TIMINGSMASK;
R_LineGraph (NET_TIMINGS-1-a, packet_latency[i]);
lost = -1;
if (!cl.paused)
timehistory[++findex&NET_TIMINGSMASK] = (cl.currentpackentities?(cl.currentpackentities->servertime - cl.servertime)*NET_GRAPHHEIGHT*5:0);
for (a=0 ; a<NET_TIMINGS ; a++)
{
i = (findex-a) & NET_TIMINGSMASK;
R_LineGraph (NET_TIMINGS-1-a, timehistory[i]<0?10000:timehistory[i]);
}
}
else
{
lost = CL_CalcNet(r_netgraph.value);
for (a=0 ; a<NET_TIMINGS ; a++)
{
i = (cl.movesequence-a) & NET_TIMINGSMASK;
R_LineGraph (NET_TIMINGS-1-a, packet_latency[i]);
}
}
// now load the netgraph texture into gl and draw it
@ -132,9 +149,6 @@ void R_FrameTimeGraph (int frametime)
int a, x, i, y;
unsigned ngraph_pixels[NET_GRAPHHEIGHT][NET_TIMINGS];
static int timehistory[NET_TIMINGS];
static int findex;
timehistory[findex++&NET_TIMINGSMASK] = frametime;
x = 0;

View File

@ -281,6 +281,7 @@ void R_RenderDlights (void)
unsigned int beflags = 0;
float intensity, cscale;
qboolean coronastyle;
qboolean flashstyle;
if (!r_coronas.value && !r_flashblend.value)
return;
@ -297,22 +298,22 @@ void R_RenderDlights (void)
if (l->corona <= 0)
continue;
if (l->flags & LFLAG_FLASHBLEND)
{
if (!r_flashblend.value)
continue;
//dlights emitting from the local player are not visible as flashblends
if (l->key == r_refdef.playerview->viewentity)
continue; //was a glow
if (l->key == -(r_refdef.playerview->viewentity))
continue; //was a muzzleflash
coronastyle = false;
}
else
coronastyle = true;
//dlights emitting from the local player are not visible as flashblends
if (l->key == r_refdef.playerview->viewentity)
continue; //was a glow
if (l->key == -(r_refdef.playerview->viewentity))
continue; //was a muzzleflash
coronastyle = (l->flags & (LFLAG_NORMALMODE|LFLAG_REALTIMEMODE));
flashstyle = ((l->flags & LFLAG_FLASHBLEND) && r_flashblend.ival);
if (!coronastyle && !flashstyle)
continue;
if (coronastyle && flashstyle)
flashstyle = false;
cscale = l->coronascale;
intensity = l->corona * 0.25;
intensity = l->corona;// * 0.25;
if (coronastyle)
intensity *= r_coronas.value;
else

View File

@ -348,11 +348,14 @@ r_part tr_knightspike
blend add
spawnmode spiral
spawnvel -50
lighttime 0
lightshadows 0
lightradius 150
lightrgb 0.75 0.37 0.18
}
/////////////////////////////////////////
//vore missiles
r_part tr_vorespike
{
texture "particles/fteparticlefont.tga"
@ -369,18 +372,90 @@ r_part tr_vorespike
friction 0
scalefactor 1
blend add
lighttime 0
lightshadows 0
lightradius 150
lightrgb 0.75 0.37 0.75
}
//rygel's pack sucks
r_trail "progs/v_spike.mdl" tr_vorespike
//enforcer laser effect
r_part tr_enforcerlaser
{
type texturedspark
texture "particles/fteparticlefont.tga"
tcoords 1 97 95 191 256
scale 15
step 4
alpha 0.3
die 0.5
rgb 255 69 0
veladd -32
spawnmode spiral
spawnvel 16
randomvel 32
friction 0
scalefactor 1
blend add
lighttime 0.2
lightshadows 0
lightradius 150
lightrgb 1 0.27 0
lightrgbfade 5 1 0
lightcorona 2 0.25
}
r_trail "progs/laser.mdl" tr_enforcerlaser
/////////////////////////////////////////
//scrag missiles. just use the default trail cos we're lazy
//r_part tr_wizspike
//{
//}
r_part tr_wizspike
{
texture "particles/fteparticlefont.tga"
tcoords 1 97 95 191 256
scale 15
step 1
alpha 0.6
die 0.2
rgb 25 200 25
veladd 0
randomvel 2
friction 4
scalefactor 0.825
spawnmode spiral
spawnvel 25
blend add
lighttime 0
lightshadows 0
lightradius 150
lightrgb 0.1 0.7 0.1
}
r_part shambercharging
{
spawnmode ball
count 200
spawnorg 128
spawnvel -256
texture "particles/fteparticlefont.tga"
tcoords 1 1 63 63 256 2 64
scale 4
alpha 1
die 0.5
orgadd -64
rotationspeed 90
rotationstart 0 360
rgb 100 100 250
rgbrand 0 0 0
gravity 0
scalefactor 0.4
lighttime 0
lightshadows 0
lightradius 400
lightrgb 2 2 2
}
r_effect progs/s_light.mdl shambercharging 0
r_part te_blood
{
@ -394,19 +469,13 @@ r_part te_blood
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 64 128 128
rgbdelta -64 -128 -128
rgb 32 64 64
rgbdelta -32 -64 -64
gravity 200
scalefactor 0.8
// scaledelta -10
}
r_part pe_73
{
assoc te_blood
}
r_part te_lightningblood
r_part high.pe_73
{
texture fte_bloodparticle
blend subtract
@ -418,8 +487,43 @@ r_part te_lightningblood
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 0 128 128
rgbdelta 0 -128 -128
rgb 32 64 64
rgbdelta -32 -64 -64
gravity 200
scalefactor 0.8
}
r_part te_lightningblood
{
texture fte_bloodparticle
blend subtract
count 1
scale 32
alpha 0
die 1
randomvel 32
veladd 5
rotationspeed 90
rotationstart 0 360
rgb 64 128 128
rgbdelta -64 -128 -128
gravity 200
scalefactor 0.8
}
r_part high.pe_225
{
texture fte_bloodparticle
blend subtract
count 0.5
scale 32
alpha 0
die 1
randomvel 32
veladd 5
rotationspeed 90
rotationstart 0 360
rgb 64 128 128
rgbdelta -64 -128 -128
gravity 200
scalefactor 0.8
}

View File

@ -1619,7 +1619,7 @@ void NPP_QWFlush(void)
org[0] = (*(short*)&buffer[multicastpos])/8.0f;
org[1] = (*(short*)&buffer[multicastpos+2])/8.0f;
org[2] = (*(short*)&buffer[multicastpos+4])/8.0f;
count = buffer[2]*20;
count = bound(0, buffer[2]*20, 255);
if (minortype == TEQW_LIGHTNINGBLOOD)
colour = 225;
else