glibc workaround

fix some q2 (demo-)incompatibilities + omissions. rework some effects too (and implement some missing stuff, like flies). more work required.
a hack to hide a well-known bot from q2 player counts in the server browser.
fix some server browser colours.
fixed some lighting issues.
sv_protocol_nq now accepts protocol names.
fix some ezhud issues, like the 'hide all' command.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4995 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2015-12-12 19:25:15 +00:00
parent 71319a8852
commit b1d2179394
43 changed files with 1829 additions and 588 deletions

View file

@ -496,8 +496,27 @@ qboolean CL_GetDemoMessage (void)
}
#ifdef Q2CLIENT
if (cls.demoplayback == DPB_QUAKE2 && (cls.netchan.last_received == realtime || cls.netchan.last_received > realtime-0.1))
return 0;
//q2 uses a fixed 10fps packet rate, even demos enforce it.
if (cls.demoplayback == DPB_QUAKE2)
{
if (cls.timedemo)
{
if (demoframe == host_framecount)
return 0;
demoframe = host_framecount;
}
#if 1
else if (demtime < cl.gametime && cl.gametime)
{
if (demtime <= cl.gametime-1)
demtime = cl.gametime;
return 0;
}
#else
else if (cls.netchan.last_received == realtime || cls.netchan.last_received > realtime-0.1)
return 0;
#endif
}
else
#endif
if (cls.demoplayback == DPB_NETQUAKE && cls.signon == 4/*SIGNONS*/)
@ -526,12 +545,23 @@ qboolean CL_GetDemoMessage (void)
}
demoframe = host_framecount;
}
if (cls.signon < 4)
else if (cls.signon < 4)
demtime = 0;
if (readdemobytes(&demopos, &msglength, 4) != 4)
{
return 0;
}
msglength = LittleLong (msglength);
if (msglength == -1)
{
int tmppos = demopos;
//q2 writes a length of -1 to mark eof. if this peek fails then it really is eof and we shouldn't fail from weird message length checks.
if (readdemobytes(&tmppos, &msglength, 4) != 4)
{
endofdemo = true;
return 0;
}
}
if (cls.demoplayback == DPB_NETQUAKE)
{
for (i=0 ; i<3 ; i++)
@ -543,7 +573,6 @@ qboolean CL_GetDemoMessage (void)
olddemotime = demtime;
msglength = LittleLong (msglength);
if (msglength > MAX_NQMSGLEN)
{
Con_Printf ("Demo message > MAX_MSGLEN");
@ -1736,7 +1765,7 @@ void CL_PlayDemoFile(vfsfile_t *f, char *demoname, qboolean issyspath)
VFS_SEEK(f, start);
len = LittleLong(len);
protocol = LittleLong(protocol);
if (len > 5 && type == svcq2_serverdata && protocol == PROTOCOL_VERSION_Q2)
if (len > 5 && type == svcq2_serverdata && protocol != 0)
{
CL_PlayDemoStream(f, NULL, demoname, issyspath, DPB_QUAKE2, 0);
return;
@ -1824,6 +1853,15 @@ void CL_PlayDemo(char *demoname, qboolean usesystempath)
f = FS_OpenVFS(name, "rb", FS_GAME);
}
if (!f)
{
Q_strncpyz (name, demoname, sizeof(name));
COM_DefaultExtension (name, ".dm2", sizeof(name));
if (usesystempath)
f = VFSOS_Open(name, "rb");
else
f = FS_OpenVFS(name, "rb", FS_GAME);
}
if (!f)
{
Con_Printf ("ERROR: couldn't open \"%s\".\n", demoname);
cls.demonum = -1; // stop demo loop

View file

@ -74,13 +74,6 @@ int CL_TargettedSplit(qboolean nowrap)
mod = cl.splitclients;
if (mod < 1)
return 0;
c = Cmd_Argv(0);
pnum = atoi(c+strlen(c)-1);
if (pnum && !(c[1] == 'b'&&c[2] == 'u' && !atoi(c+strlen(c)-2)))
{
pnum--;
return pnum;
}
if (con_splitmodifier > 0)
return (con_splitmodifier - 1) % mod;
@ -98,12 +91,12 @@ void CL_Split_f(void)
tmp = con_splitmodifier;
if (*c == '+' || *c == '-')
{
con_splitmodifier = c[2];
con_splitmodifier = c[2]-'0';
Cmd_ExecuteString(va("%c%s", *c, Cmd_Args()), Cmd_ExecLevel);
}
else
{
con_splitmodifier = c[1];
con_splitmodifier = c[1]-'0';
Cmd_ExecuteString(Cmd_Args(), Cmd_ExecLevel);
}
con_splitmodifier = tmp;
@ -1448,6 +1441,10 @@ qboolean CLQ2_SendCmd (sizebuf_t *buf)
i = cl.movesequence & UPDATE_MASK;
cmd = &cl.outframes[i].cmd[0];
//q2admin is retarded and kicks you if you get a stall.
if (cmd->msec > 100)
cmd->msec = 100;
if (cls.resendinfo)
{
MSG_WriteByte (&cls.netchan.message, clcq2_userinfo);

View file

@ -776,7 +776,7 @@ void CL_CheckForResend (void)
pext2 = Net_PextMask(2, false);
}
}
else if (!strcmp(cl_loopbackprotocol.string, "fitz")) //actually proquake, because we might as well use the extra angles
else if (!strcmp(cl_loopbackprotocol.string, "fitz") || !strcmp(cl_loopbackprotocol.string, "666") || !strcmp(cl_loopbackprotocol.string, "999"))
{
cls.protocol = CP_NETQUAKE;
cls.protocol_nq = CPNQ_FITZ666;
@ -2593,8 +2593,8 @@ void CL_ConnectionlessPacket (void)
int c;
char adr[MAX_ADR_SIZE];
MSG_BeginReading (msg_nullnetprim);
MSG_ReadLong (); // skip the -1
MSG_BeginReading (msg_nullnetprim);
MSG_ReadLong (); // skip the -1
Cmd_TokenizeString(net_message.data+4, false, false);
@ -2717,10 +2717,27 @@ void CL_ConnectionlessPacket (void)
static netadr_t lastadr;
unsigned int curtime = Sys_Milliseconds();
unsigned long pext = 0, pext2 = 0, huffcrc=0, mtu=0;
Con_TPrintf ("challenge\n");
s = MSG_ReadString ();
COM_Parse(s);
#ifdef Q3CLIENT
if (!strcmp(com_token, "onnectResponse"))
{
connectinfo.protocol = CP_QUAKE3;
goto client_connect;
}
#endif
#ifdef Q2CLIENT
if (!strcmp(com_token, "lient_connect"))
{
connectinfo.protocol = CP_QUAKE2;
goto client_connect;
}
#endif
Con_TPrintf ("challenge\n");
if (!strcmp(com_token, "hallengeResponse"))
{
/*Quake3*/
@ -2791,20 +2808,6 @@ void CL_ConnectionlessPacket (void)
#endif
s+=9;
}
#ifdef Q3CLIENT
else if (!strcmp(com_token, "onnectResponse"))
{
connectinfo.protocol = CP_QUAKE3;
goto client_connect;
}
#endif
#ifdef Q2CLIENT
else if (!strcmp(com_token, "lient_connect"))
{
connectinfo.protocol = CP_QUAKE2;
goto client_connect;
}
#endif
/*no idea, assume a QuakeWorld challenge response ('c' packet)*/
@ -2983,7 +2986,7 @@ void CL_ConnectionlessPacket (void)
if (c == S2C_CONNECTION)
{
connectinfo.protocol = CP_QUAKEWORLD;
#ifdef Q2CLIENT
#if defined(Q2CLIENT) || defined(Q3CLIENT)
client_connect: //fixme: make function
#endif
if (net_from.type == NA_INVALID)
@ -5274,12 +5277,12 @@ void CL_ExecInitialConfigs(char *resetcommand)
Cbuf_Execute (); //make sure any pending console commands are done with. mostly, anyway...
SCR_ShowPic_Clear(true);
Cbuf_AddText("alias restart_ents \"changelevel . .\"\n",RESTRICT_LOCAL);
Cbuf_AddText("alias restart \"changelevel .\"\n",RESTRICT_LOCAL);
Cbuf_AddText("alias startmap_sp \"map start\"\n", RESTRICT_LOCAL);
Cbuf_AddText("unbindall\n", RESTRICT_LOCAL);
Cbuf_AddText("bind volup \"inc volume 0.1\"\n", RESTRICT_LOCAL);
Cbuf_AddText("bind voldown \"inc volume -0.1\"\n", RESTRICT_LOCAL);
Cbuf_AddText("alias restart_ents \"changelevel . .\"\n",RESTRICT_LOCAL);
Cbuf_AddText("alias restart \"changelevel .\"\n",RESTRICT_LOCAL);
Cbuf_AddText("alias startmap_sp \"map start\"\n", RESTRICT_LOCAL);
Cbuf_AddText("cl_warncmd 0\n", RESTRICT_LOCAL);
Cbuf_AddText("cvar_purgedefaults\n", RESTRICT_LOCAL); //reset cvar defaults to their engine-specified values. the tail end of 'exec default.cfg' will update non-cheat defaults to mod-specified values.
Cbuf_AddText("cvarreset *\n", RESTRICT_LOCAL); //reset all cvars to their current (engine) defaults

View file

@ -1019,7 +1019,7 @@ qboolean CL_CheckQ2BspWals(char *file)
{
if (!CL_CheckDLFile(va("textures/%s.wal", tinf[i].texture)))
if (!CL_CheckDLFile(va("textures/%s.tga", tinf[i].texture)))
if (!CL_CheckOrEnqueDownloadFile(tinf[i].texture, NULL, 0))
if (!CL_CheckOrEnqueDownloadFile(va("textures/%s.wal", tinf[i].texture), NULL, 0))
gotone = true;
}
}
@ -3117,9 +3117,9 @@ void CLQ2_ParseServerData (void)
// parse protocol version number
i = MSG_ReadLong ();
// cls.serverProtocol = i;
cls.protocol_q2 = i;
if (i > PROTOCOL_VERSION_Q2 || i < PROTOCOL_VERSION_Q2_MIN)
if (i > PROTOCOL_VERSION_Q2 || i < (cls.demoplayback?PROTOCOL_VERSION_Q2_DEMO_MIN:PROTOCOL_VERSION_Q2_MIN))
Host_EndGame ("Server returned version %i, not %i", i, PROTOCOL_VERSION_Q2);
svcnt = MSG_ReadLong ();
@ -3127,18 +3127,14 @@ void CLQ2_ParseServerData (void)
// game directory
str = MSG_ReadString ();
// strncpy (cl.gamedir, str, sizeof(cl.gamedir)-1);
// set gamedir
if (!*str)
COM_Gamedir("baseq2", NULL);
else
COM_Gamedir(str, NULL);
// if ((*str && (!fs_gamedirvar->string || !*fs_gamedirvar->string || strcmp(fs_gamedirvar->string, str))) || (!*str && (fs_gamedirvar->string || *fs_gamedirvar->string)))
// Cvar_Set("game", str);
Cvar_Get("timescale", "1", 0, "Q2Admin hacks"); //Q2Admin will kick players who have a timescale set to something other than 1
//FTE doesn't actually have a timescale cvar, so create one to fool q2admin.
//FTE doesn't actually have a timescale cvar, so create one to 'fool' q2admin.
//I can't really blame q2admin for rejecting engines that don't have this cvar, as it could have been renamed via a hex-edit.
CL_ClearState ();
@ -4646,7 +4642,14 @@ void CL_ProcessUserInfo (int slot, player_info_t *player)
// If it's us
if (slot == cl.playerview[0].playernum && player->name[0])
{
cl.spectator = player->spectator;
if (cl.spectator != player->spectator)
{
cl.spectator = player->spectator;
for (i = 0; i < cl.splitclients; i++)
{
Cam_Unlock(&cl.playerview[i]);
}
}
// Update the rules since spectators can bypass everything but players can't
CL_CheckServerInfo();
@ -6792,13 +6795,13 @@ void CLQ2_ParseServerMessage (void)
CL_ParseDownload();
break;
case svcq2_playerinfo: //17 // variable
Host_EndGame ("CL_ParseServerMessage: svcq2_playerinfo not implemented");
Host_EndGame ("CL_ParseServerMessage: svcq2_playerinfo not as part of svcq2_frame");
return;
case svcq2_packetentities://18 // [...]
Host_EndGame ("CL_ParseServerMessage: svcq2_packetentities not implemented");
Host_EndGame ("CL_ParseServerMessage: svcq2_packetentities not as part of svcq2_frame");
return;
case svcq2_deltapacketentities://19 // [...]
Host_EndGame ("CL_ParseServerMessage: svcq2_deltapacketentities not implemented");
Host_EndGame ("CL_ParseServerMessage: svcq2_deltapacketentities not as part of svcq2_frame");
return;
case svcq2_frame: //20 (the bastard to implement.)
CLQ2_ParseFrame();

View file

@ -244,7 +244,7 @@ void CLQ2_PredictMovement (void) //q2 doesn't support split clients.
// return;
#ifdef Q2BSPS
if (cl_nopred.value || (cl.q2frame.playerstate.pmove.pm_flags & Q2PMF_NO_PREDICTION))
if (cl_nopred.value || cls.demoplayback || (cl.q2frame.playerstate.pmove.pm_flags & Q2PMF_NO_PREDICTION))
#endif
{ // just set angles
for (i=0 ; i<3 ; i++)
@ -301,13 +301,13 @@ void CLQ2_PredictMovement (void) //q2 doesn't support split clients.
Q2_Pmove (&pm);
}
oldframe = (ack-2) & (UPDATE_MASK);
oldframe = (ack-1) & (UPDATE_MASK);
oldz = cl_predicted_origins[oldframe][2];
step = pm.s.origin[2] - oldz;
if (step > 63 && step < 160 && (pm.s.pm_flags & Q2PMF_ON_GROUND) )
{
cl.predicted_step = step * 0.125;
cl.predicted_step_time = realtime - host_frametime * 0.5;
cl.predicted_step_time = realtime;// - host_frametime;// * 0.5;
}
cl.playerview[0].onground = !!(pm.s.pm_flags & Q2PMF_ON_GROUND);
@ -569,8 +569,12 @@ void CL_CalcClientTime(void)
extern float olddemotime;
cl.servertime = olddemotime;
}
if (cls.protocol != CP_QUAKE3 && (!cl_predict_smooth.ival || (cl_predict_smooth.ival == 2 && !cls.demoplayback)) && cls.demoplayback != DPB_MVD)
{
//q2 has no drifting.
//q3 always drifts.
//nq+qw code can drift
//default is to drift in demos but not live (oh noes! added latency!)
if (cls.protocol == CP_QUAKE2 || (cls.protocol != CP_QUAKE3 && (!cl_predict_smooth.ival || (cl_predict_smooth.ival == 2 && !cls.demoplayback)) && cls.demoplayback != DPB_MVD))
{ //no drift logic
float f;
f = cl.gametime - cl.oldgametime;
if (f > 0.1)
@ -580,7 +584,7 @@ void CL_CalcClientTime(void)
cl.servertime = cl.gametime*f + cl.oldgametime*(1-f);
}
else
{
{ //funky magic drift logic. we be behind the most recent frame in order to attempt to cover network congestions (which is apparently common in germany).
float min, max;
// oldst = cl.servertime;

View file

@ -1741,6 +1741,7 @@ void SCR_DrawLoading (qboolean opaque)
R2D_FillBlock(x+sizex, y, 192-sizex, 16);
}
R2D_ImageColours(1, 1, 1, 1);
Draw_FunString(x+8, y+4, va("Loading %s... %i%%",
(loading_stage == LS_SERVER) ? "server" : "client",
current_loading_size * 100 / total_loading_size));
@ -2663,6 +2664,11 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
SCR_ShowPics_Draw();
}
else if (nohud)
{
SCR_DrawFPS ();
SCR_CheckDrawCenterString ();
}
else if (cl.intermissionmode == IM_NQFINALE)
{
Sbar_FinaleOverlay ();
@ -2677,21 +2683,16 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
}
else
{
if (!nohud)
{
R2D_DrawCrosshair();
R2D_DrawCrosshair();
SCR_DrawNet ();
SCR_DrawDisk();
SCR_DrawFPS ();
SCR_DrawClock();
SCR_DrawGameClock();
SCR_DrawTurtle ();
SCR_DrawPause ();
SCR_ShowPics_Draw();
}
else
SCR_DrawFPS ();
SCR_DrawNet ();
SCR_DrawDisk();
SCR_DrawFPS ();
SCR_DrawClock();
SCR_DrawGameClock();
SCR_DrawTurtle ();
SCR_DrawPause ();
SCR_ShowPics_Draw();
SCR_CheckDrawCenterString ();
}

View file

@ -24,172 +24,113 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
entity_state_t *CL_FindPacketEntity(int num);
#ifdef Q2CLIENT
typedef enum
{
Q2TE_GUNSHOT, //0
Q2TE_BLOOD,
Q2TE_BLASTER,
Q2TE_RAILTRAIL,
Q2TE_SHOTGUN,
Q2TE_EXPLOSION1,
Q2TE_EXPLOSION2,
Q2TE_ROCKET_EXPLOSION,
Q2TE_GRENADE_EXPLOSION,
Q2TE_SPARKS,
Q2TE_SPLASH, //10
Q2TE_BUBBLETRAIL,
Q2TE_SCREEN_SPARKS,
Q2TE_SHIELD_SPARKS,
Q2TE_BULLET_SPARKS,
Q2TE_LASER_SPARKS,
Q2TE_PARASITE_ATTACK,
Q2TE_ROCKET_EXPLOSION_WATER,
Q2TE_GRENADE_EXPLOSION_WATER,
Q2TE_MEDIC_CABLE_ATTACK,
Q2TE_BFG_EXPLOSION, //20
Q2TE_BFG_BIGEXPLOSION,
Q2TE_BOSSTPORT, // used as '22' in a map, so DON'T RENUMBER!!!
Q2TE_BFG_LASER,
Q2TE_GRAPPLE_CABLE,
Q2TE_WELDING_SPARKS,
Q2TE_GREENBLOOD,
Q2TE_BLUEHYPERBLASTER,
Q2TE_PLASMA_EXPLOSION,
Q2TE_TUNNEL_SPARKS,
//ROGUE
Q2TE_BLASTER2, //30
Q2TE_RAILTRAIL2,
Q2TE_FLAME,
Q2TE_LIGHTNING,
Q2TE_DEBUGTRAIL,
Q2TE_PLAIN_EXPLOSION,
Q2TE_FLASHLIGHT,
Q2TE_FORCEWALL,
Q2TE_HEATBEAM,
Q2TE_MONSTER_HEATBEAM,
Q2TE_STEAM, //40
Q2TE_BUBBLETRAIL2,
Q2TE_MOREBLOOD,
Q2TE_HEATBEAM_SPARKS,
Q2TE_HEATBEAM_STEAM,
Q2TE_CHAINFIST_SMOKE,
Q2TE_ELECTRIC_SPARKS,
Q2TE_TRACKER_EXPLOSION,
Q2TE_TELEPORT_EFFECT,
Q2TE_DBALL_GOAL,
Q2TE_WIDOWBEAMOUT, //50
Q2TE_NUKEBLAST,
Q2TE_WIDOWSPLASH,
Q2TE_EXPLOSION1_BIG,
Q2TE_EXPLOSION1_NP,
Q2TE_FLECHETTE,
//ROGUE
//CODERED
CRTE_LEADERBLASTER, //56
CRTE_BLASTER_MUZZLEFLASH,
CRTE_BLUE_MUZZLEFLASH,
CRTE_SMART_MUZZLEFLASH,
CRTE_LEADERFIELD, //60
CRTE_DEATHFIELD,
CRTE_BLASTERBEAM,
CRTE_STAIN,
CRTE_FIRE,
CRTE_CABLEGUT,
CRTE_SMOKE,
//CODERED
Q2TE_MAX
} temp_event_t;
#define Q2SPLASH_UNKNOWN 0
#define Q2SPLASH_SPARKS 1
#define Q2SPLASH_BLUE_WATER 2
#define Q2SPLASH_BROWN_WATER 3
#define Q2SPLASH_SLIME 4
#define Q2SPLASH_LAVA 5
#define Q2SPLASH_BLOOD 6
#define Q2SPLASH_MAX 7
static const char *q2efnames[] =
{
"GUNSHOT",
"BLOOD",
"BLASTER",
"RAILTRAIL",
"SHOTGUN",
"EXPLOSION1",
"EXPLOSION2",
"ROCKET_EXPLOSION",
"GRENADE_EXPLOSION",
"SPARKS",
"SPLASH",
"BUBBLETRAIL",
"SCREEN_SPARKS",
"SHIELD_SPARKS",
"BULLET_SPARKS",
"LASER_SPARKS",
"PARASITE_ATTACK",
"ROCKET_EXPLOSION_WATER",
"GRENADE_EXPLOSION_WATER",
"MEDIC_CABLE_ATTACK",
"BFG_EXPLOSION",
"BFG_BIGEXPLOSION",
"BOSSTPORT",
"BFG_LASER",
"GRAPPLE_CABLE",
"WELDING_SPARKS",
"GREENBLOOD",
"BLUEHYPERBLASTER",
"PLASMA_EXPLOSION",
"TUNNEL_SPARKS",
"BLASTER2",
"RAILTRAIL2",
"FLAME",
"LIGHTNING",
"DEBUGTRAIL",
"PLAIN_EXPLOSION",
"FLASHLIGHT",
"FORCEWALL",
"HEATBEAM",
"MONSTER_HEATBEAM",
"STEAM",
"BUBBLETRAIL2",
"MOREBLOOD",
"HEATBEAM_SPARKS",
"HEATBEAM_STEAM",
"CHAINFIST_SMOKE",
"ELECTRIC_SPARKS",
"TRACKER_EXPLOSION",
"TELEPORT_EFFECT",
"DBALL_GOAL",
"WIDOWBEAMOUT",
"NUKEBLAST",
"WIDOWSPLASH",
"EXPLOSION1_BIG",
"EXPLOSION1_NP",
"FLECHETTE",
"CR_LEADERBLASTER",
"CR_BLASTER_MUZZLEFLASH",
"CR_BLUE_MUZZLEFLASH",
"CR_SMART_MUZZLEFLASH",
"CR_LEADERFIELD",
"CR_DEATHFIELD",
"CR_BLASTERBEAM",
"CR_STAIN",
"CR_FIRE",
"CR_CABLEGUT",
"CR_SMOKE",
"TEQ2_GUNSHOT",
"TEQ2_BLOOD",
"TEQ2_BLASTER",
"TEQ2_RAILTRAIL",
"TEQ2_SHOTGUN",
"TEQ2_EXPLOSION1",
"TEQ2_EXPLOSION2",
"TEQ2_ROCKET_EXPLOSION",
"TEQ2_GRENADE_EXPLOSION",
"TEQ2_SPARKS",
NULL,//"TEQ2_SPLASH",
"TEQ2_BUBBLETRAIL",
"TEQ2_SCREEN_SPARKS",
"TEQ2_SHIELD_SPARKS",
"TEQ2_BULLET_SPARKS",
NULL,//"TEQ2_LASER_SPARKS",
NULL,//"TEQ2_PARASITE_ATTACK",
"TEQ2_ROCKET_EXPLOSION_WATER",
"TEQ2_GRENADE_EXPLOSION_WATER",
NULL,//"TEQ2_MEDIC_CABLE_ATTACK",
"TEQ2_BFG_EXPLOSION",
"TEQ2_BFG_BIGEXPLOSION",
"TEQ2_BOSSTPORT",
NULL,//"TEQ2_BFG_LASER",
NULL,//"TEQ2_GRAPPLE_CABLE",
"TEQ2_WELDING_SPARKS",
"TEQ2_GREENBLOOD",
"TEQ2_BLUEHYPERBLASTER",
"TEQ2_PLASMA_EXPLOSION",
"TEQ2_TUNNEL_SPARKS",
"TEQ2_BLASTER2",
"TEQ2_RAILTRAIL2",
"TEQ2_FLAME",
NULL,//"TEQ2_LIGHTNING",
"TEQ2_DEBUGTRAIL",
"TEQ2_PLAIN_EXPLOSION",
"TEQ2_FLASHLIGHT",
"TEQ2_FORCEWALL",
NULL,//"TEQ2_HEATBEAM",
NULL,//"TEQ2_MONSTER_HEATBEAM",
"TEQ2_STEAM",
"TEQ2_BUBBLETRAIL2",
"TEQ2_MOREBLOOD",
"TEQ2_HEATBEAM_SPARKS",
"TEQ2_HEATBEAM_STEAM",
"TEQ2_CHAINFIST_SMOKE",
"TEQ2_ELECTRIC_SPARKS",
"TEQ2_TRACKER_EXPLOSION",
"TEQ2_TELEPORT_EFFECT",
"TEQ2_DBALL_GOAL",
"TEQ2_WIDOWBEAMOUT",
"TEQ2_NUKEBLAST",
"TEQ2_WIDOWSPLASH",
"TEQ2_EXPLOSION1_BIG",
"TEQ2_EXPLOSION1_NP",
"TEQ2_FLECHETTE",
//q2te_max+
"SPLASH_UNKNOWN",
"SPLASH_SPARKS",
"SPLASH_BLUE_WATER",
"SPLASH_BROWN_WATER",
"SPLASH_SLIME",
"SPLASH_LAVA",
"SPLASH_BLOOD",
NULL,//"TEQ2_CR_LEADERBLASTER",
NULL,//"TEQ2_CR_BLASTER_MUZZLEFLASH",
NULL,//"TEQ2_CR_BLUE_MUZZLEFLASH",
NULL,//"TEQ2_CR_SMART_MUZZLEFLASH",
NULL,//"TEQ2_CR_LEADERFIELD",
NULL,//"TEQ2_CR_DEATHFIELD",
NULL,//"TEQ2_CR_BLASTERBEAM",
NULL,//"TEQ2_CR_STAIN",
NULL,//"TEQ2_CR_FIRE",
NULL,//"TEQ2_CR_CABLEGUT",
NULL,//"TEQ2_CR_SMOKE",
//the rest have no specific value meanings
//slashes block
"te_splashunknown",
"te_splashsparks",
"te_splashbluewater",
"te_splashbrownwater",
"te_splashslime",
"te_splashlava",
"te_splashblood",
"TR_BLASTERTRAIL",
"TR_BLASTERTRAIL2",
"TRQ2_GIB",
"TRQ2_GREENGIB",
"TRQ2_ROCKET",
"TRQ2_GRENADE",
"TR_TRAP",
"TR_FLAG1",
"TR_FLAG2",
"TR_TAGTRAIL",
"TR_TRACKER",
"TR_IONRIPPER",
"TR_PLASMA",
"EF_BFGPARTICLES",
"EF_FLIES",
"EF_TRAP",
"EF_TRACKERSHELL",
"ev_item_respawn",
"ev_player_teleport",
"ev_footstep",
};
int pt_q2[sizeof(q2efnames)/sizeof(q2efnames[0])];
#endif
@ -234,15 +175,6 @@ int
ptqw_blood=P_INVALID,
ptqw_lightningblood=P_INVALID,
ptq2_blood=P_INVALID,
rtq2_railtrail=P_INVALID,
rtq2_blastertrail=P_INVALID,
ptq2_blasterparticles=P_INVALID,
rtq2_bubbletrail=P_INVALID,
rtq2_gib=P_INVALID,
rtq2_rocket=P_INVALID,
rtq2_grenade=P_INVALID,
rtqw_railtrail=P_INVALID,
ptfte_bullet=P_INVALID,
ptfte_superbullet=P_INVALID;
@ -260,8 +192,8 @@ typedef struct {
int ef_impact;
} tentmodels_t;
typedef struct
{
typedef struct beam_s beam_t;
struct beam_s {
tentmodels_t *info;
int entity;
short tag;
@ -279,7 +211,7 @@ typedef struct
// int particlecolour; //some effects have specific colours. which is weird.
trailstate_t *trailstate;
trailstate_t *emitstate;
} beam_t;
};
beam_t *cl_beams;
int cl_beams_max;
@ -316,25 +248,26 @@ static int beams_running;
static tentmodels_t beamtypes[] =
{
{"progs/bolt.mdl", "TE_LIGHTNING1", "TE_LIGHTNING1_END"},
{"progs/bolt2.mdl", "TE_LIGHTNING2", "TE_LIGHTNING2_END"},
{"progs/bolt3.mdl", "TE_LIGHTNING3", "TE_LIGHTNING3_END"},
{"progs/beam.mdl", "te_beam", "te_beam_end"}, //a CTF addition, but has other potential uses, sadly.
{"progs/bolt.mdl", "TE_LIGHTNING1", "TE_LIGHTNING1_END"},
{"progs/bolt2.mdl", "TE_LIGHTNING2", "TE_LIGHTNING2_END"},
{"progs/bolt3.mdl", "TE_LIGHTNING3", "TE_LIGHTNING3_END"},
{"progs/beam.mdl", "te_beam", "te_beam_end"}, //a CTF addition, but has other potential uses, sadly.
{"q2cl_mod_parasite_segment", "te_parasite_attack", "te_parasite_attack_end"},
{"q2cl_mod_grapple_cable", "te_grapple_cable", "te_grapple_cable_end"},
{"models/proj/beam/tris.md2", "te_heatbeam", "te_heatbeam_end"},
{"models/monsters/parasite/segment/tris.md2","te_parasite_attack", "te_parasite_attack_end"},
{"models/ctf/segment/tris.md2", "te_grapple_cable", "te_grapple_cable_end"},
{"models/proj/beam/tris.md2", "te_heatbeam", "te_heatbeam_end"},
{"models/proj/lightning/tris.md2", "TE_LIGHTNING2", "TE_LIGHTNING2_END"},
{"models/stltng2.mdl", "te_stream_lightning_small", NULL},
{"models/stchain.mdl", "te_stream_chain", NULL},
{"models/stsunsf1.mdl", "te_stream_sunstaff1", NULL},
{"models/stsunsf2.mdl", NULL, NULL},
{"models/stsunsf1.mdl", "te_stream_sunstaff2", NULL},
{"models/stlghtng.mdl", "te_stream_lightning", NULL},
{"models/stclrbm.mdl", "te_stream_colorbeam", NULL},
{"models/stice.mdl", "te_stream_icechunks", NULL},
{"models/stmedgaz.mdl", "te_stream_gaze", NULL},
{"models/fambeam.mdl", "te_stream_famine", NULL},
{"models/stltng2.mdl", "te_stream_lightning_small", NULL},
{"models/stchain.mdl", "te_stream_chain", NULL},
{"models/stsunsf1.mdl", "te_stream_sunstaff1", NULL},
{"models/stsunsf2.mdl", NULL, NULL},
{"models/stsunsf1.mdl", "te_stream_sunstaff2", NULL},
{"models/stlghtng.mdl", "te_stream_lightning", NULL},
{"models/stclrbm.mdl", "te_stream_colorbeam", NULL},
{"models/stice.mdl", "te_stream_icechunks", NULL},
{"models/stmedgaz.mdl", "te_stream_gaze", NULL},
{"models/fambeam.mdl", "te_stream_famine", NULL},
};
@ -585,29 +518,37 @@ void CL_RegisterParticles(void)
if (cls.protocol == CP_QUAKE2)
{
for (i = 0; i < sizeof(pt_q2)/sizeof(pt_q2[0]); i++)
pt_q2[i] = P_FindParticleType(va("q2part.TEQ2_%s", q2efnames[i]));
{
if (!q2efnames[i])
{
pt_q2[i] = P_INVALID;
continue;
}
pt_q2[i] = P_FindParticleType(va("q2part.%s", q2efnames[i]));
ptq2_blood = P_FindParticleType("q2part.TEQ2_BLOOD");
#ifdef _DEBUG
if (pt_q2[i] == P_INVALID && pt_q2[0] != P_INVALID)
Con_Printf("effect q2part.%s was not declared\n", q2efnames[i]);
#endif
}
/*ptq2_blood = P_FindParticleType("q2part.TEQ2_BLOOD");
rtq2_railtrail = P_FindParticleType("q2part.TR_RAILTRAIL");
rtq2_blastertrail = P_FindParticleType("q2part.TR_BLASTERTRAIL");
ptq2_blasterparticles = P_FindParticleType("TE_BLASTERPARTICLES");
rtq2_bubbletrail = P_FindParticleType("TE_BUBBLETRAIL");
rtq2_gib = P_FindParticleType("TR_GIB");
rtq2_rocket = P_FindParticleType("TR_ROCKET");
rtq2_grenade = P_FindParticleType("TR_GRENADE");
ptq2_blasterparticles = P_FindParticleType("q2part.TE_BLASTERPARTICLES");
rtq2_bubbletrail = P_FindParticleType("q2part.TE_BUBBLETRAIL");
rtq2_gib = P_FindParticleType("q2part.TR_GIB");
rtq2_rocket = P_FindParticleType("q2part.TR_ROCKET");
rtq2_grenade = P_FindParticleType("q2part.TR_GRENADE");
ptq2_bfgparticles = P_FindParticleType("q2part.TR_BFGPARTICLES");
ptq2_flies = P_FindParticleType("q2part.TR_FLIES");
ptq2_trap = P_FindParticleType("q2part.TR_TRAP");
ptq2_trackershell = P_FindParticleType("q2part.TR_TRACKERSHELL");*/
}
else
{
for (i = 0; i < sizeof(pt_q2)/sizeof(pt_q2[0]); i++)
pt_q2[i] = P_INVALID;
ptq2_blood = P_INVALID;
rtq2_railtrail = P_INVALID;
rtq2_blastertrail = P_INVALID;
ptq2_blasterparticles = P_INVALID;
rtq2_bubbletrail = P_INVALID;
rtq2_gib = P_INVALID;
rtq2_rocket = P_INVALID;
rtq2_grenade = P_INVALID;
}
#endif
@ -805,7 +746,7 @@ beam_t *CL_NewBeam (int entity, int tag, tentmodels_t *btype)
}
#define STREAM_ATTACHED 16
#define STREAM_TRANSLUCENT 32
void CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end) //fixme: use TE_ numbers instead of 0 - 5
beam_t *CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end) //fixme: use TE_ numbers instead of 0 - 5
{
beam_t *b;
@ -824,7 +765,7 @@ void CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end) //fixm
// TODO: add support for those finnicky colored railtrails...
if (P_ParticleTrail(start, end, rtqw_railtrail, -ent, NULL, NULL))
P_ParticleTrailIndex(start, end, 208, 8, NULL);
return;
return NULL;
}
break;
case BT_Q1LIGHTNING2:
@ -886,7 +827,7 @@ void CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end) //fixm
if (!b)
{
Con_Printf ("beam list overflow!\n");
return;
return NULL;
}
b->rflags = RF_NOSHADOW;
@ -904,8 +845,31 @@ void CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end) //fixm
P_RunParticleEffectState (impact, normal, 1, etype, &(b->emitstate));
if (cl_legacystains.ival) Surf_AddStain(end, -10, -10, -10, 20);
}
return b;
}
void CL_ParseBeam (enum beamtype_e tent)
void CL_ParseBeamOffset (enum beamtype_e tent)
{
int ent;
vec3_t start, end, offset;
beam_t *b;
ent = MSGCL_ReadEntity ();
start[0] = MSG_ReadCoord ();
start[1] = MSG_ReadCoord ();
start[2] = MSG_ReadCoord ();
end[0] = MSG_ReadCoord ();
end[1] = MSG_ReadCoord ();
end[2] = MSG_ReadCoord ();
MSG_ReadPos(offset);
b = CL_AddBeam(tent, ent, start, end);
if (b)
VectorCopy(offset, b->offset);
}
beam_t *CL_ParseBeam (enum beamtype_e tent)
{
int ent;
vec3_t start, end;
@ -920,7 +884,7 @@ void CL_ParseBeam (enum beamtype_e tent)
end[1] = MSG_ReadCoord ();
end[2] = MSG_ReadCoord ();
CL_AddBeam(tent, ent, start, end);
return CL_AddBeam(tent, ent, start, end);
}
//finds the latest non-lerped position
@ -1599,8 +1563,7 @@ void CL_ParseTEnt (void)
pos2[2] = MSG_ReadCoord ();
if (P_ParticleTrail(pos, pos2, rtqw_railtrail, 0, NULL, NULL))
if (P_ParticleTrail(pos, pos2, rtq2_railtrail, 0, NULL, NULL))
P_ParticleTrailIndex(pos, pos2, 208, 8, NULL);
P_ParticleTrailIndex(pos, pos2, 208, 8, NULL);
break;
case TEH2_STREAM_LIGHTNING_SMALL:
@ -2311,7 +2274,7 @@ void CL_ParseParticleEffect4 (void)
P_RunParticleEffect4 (org, radius, color, effect, msgcount);
}
void CL_SpawnSpriteEffect(vec3_t org, vec3_t dir, vec3_t orientationup, model_t *model, int startframe, int framecount, float framerate, float alpha, float randspin, float gravity, int traileffect, unsigned int renderflags)
void CL_SpawnSpriteEffect(vec3_t org, vec3_t dir, vec3_t orientationup, model_t *model, int startframe, int framecount, float framerate, float alpha, float randspin, float gravity, int traileffect, unsigned int renderflags, int skinnum)
{
explosion_t *ex;
@ -2321,7 +2284,7 @@ void CL_SpawnSpriteEffect(vec3_t org, vec3_t dir, vec3_t orientationup, model_t
ex->firstframe = startframe;
ex->numframes = framecount;
ex->framerate = framerate;
ex->skinnum = 0;
ex->skinnum = skinnum;
ex->traileffect = traileffect;
ex->flags |= renderflags;
@ -2404,7 +2367,7 @@ void CL_ParseEffect (qboolean effect2)
framerate = MSG_ReadByte();
mod = cl.model_precache[modelindex];
CL_SpawnSpriteEffect(org, NULL, NULL, mod, startframe, framecount, framerate, mod->type==mod_sprite?-1:1, 0, 0, P_INVALID, 0);
CL_SpawnSpriteEffect(org, NULL, NULL, mod, startframe, framecount, framerate, mod->type==mod_sprite?-1:1, 0, 0, P_INVALID, 0, 0);
}
#ifdef Q2CLIENT
@ -2468,6 +2431,7 @@ void Q2S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float
}
void CLQ2_ParseTEnt (void)
{
beam_t *b;
int type;
int pt;
vec3_t pos, pos2, dir;
@ -2480,13 +2444,17 @@ void CLQ2_ParseTEnt (void)
type = MSG_ReadByte ();
if (type < sizeof(q2efnames)/sizeof(q2efnames[0]))
if (type <= Q2TE_MAX)
{
pt = pt_q2[type];
if (pt == P_INVALID && q2efnames[type])
{
Con_Printf("Q2TE legacy code: te %i\n", type);
goto fixme;
}
}
else
pt = P_INVALID;
if (pt == P_INVALID)
goto fixme;
switch (type)
{
case Q2TE_GUNSHOT: //grey tall thing with smoke+sparks
@ -2508,9 +2476,14 @@ void CLQ2_ParseTEnt (void)
MSG_ReadDir (dir);
P_RunParticleEffectType(pos, dir, 1, pt);
break;
case Q2TE_BFG_LASER:
MSG_ReadPos (pos);
MSG_ReadPos (pos2);
CL_Laser(pos, pos2, 0xd0d1d2d3);
break;
case Q2TE_RAILTRAIL: //blue spiral, grey particles
case Q2TE_BUBBLETRAIL: //grey sparse trail, slow riser
case Q2TE_BFG_LASER: //green lazor
// case Q2TE_BFG_LASER: //green laser
case Q2TE_DEBUGTRAIL: //long lived blue trail
case Q2TE_BUBBLETRAIL2: //grey rising trail
case Q2TE_BLUEHYPERBLASTER: //TE_BLASTER without model+light
@ -2544,10 +2517,10 @@ void CLQ2_ParseTEnt (void)
cnt = MSG_ReadByte ();
MSG_ReadPos (pos);
MSG_ReadDir (dir);
r = MSG_ReadByte ();
if (r >= Q2SPLASH_MAX)
r = MSG_ReadByte () + Q2SPLASH_UNKNOWN;
if (r > Q2SPLASH_MAX)
r = Q2SPLASH_UNKNOWN;
pt = pt_q2[Q2TE_MAX + r];
pt = pt_q2[r];
P_RunParticleEffectType(pos, NULL, 1, pt);
break;
@ -2556,27 +2529,42 @@ void CLQ2_ParseTEnt (void)
CL_ParseBeam (BT_Q2PARASITE);
break;
case Q2TE_HEATBEAM:
b = CL_ParseBeam (BT_Q2HEATBEAM); //2, 7, -3
if (b)
{
b->bflags |= STREAM_ATTACHED;
VectorSet(b->offset, 2, 7, -3);
}
break;
case Q2TE_MONSTER_HEATBEAM:
CL_ParseBeam (BT_Q2HEATBEAM);
b = CL_ParseBeam (BT_Q2HEATBEAM);
if (b)
b->bflags |= STREAM_ATTACHED;
break;
case Q2TE_GRAPPLE_CABLE:
CL_ParseBeam (BT_Q2GRAPPLE);
MSG_ReadPos (pos);
CL_ParseBeamOffset (BT_Q2GRAPPLE);
break;
case Q2TE_LIGHTNING:
ent = MSGCL_ReadEntity ();
/*toent =*/ MSGCL_ReadEntity ();
/*toent =*/ MSGCL_ReadEntity (); //ident only.
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
pos2[0] = MSG_ReadCoord ();
pos2[1] = MSG_ReadCoord ();
pos2[2] = MSG_ReadCoord ();
CL_AddBeam(BT_Q1LIGHTNING1, ent, pos, pos2);
CL_AddBeam(BT_Q2LIGHTNING, ent, pos, pos2);
break;
case Q2TE_LASER_SPARKS:
cnt = MSG_ReadByte ();
MSG_ReadPos (pos);
MSG_ReadDir (dir);
color = MSG_ReadByte ();
//FIXME: should use q2's vertical puff thing
P_RunParticleEffect (pos, dir, color, cnt);
break;
/*
case Q2TE_LASER_SPARKS:
@ -2586,8 +2574,6 @@ void CLQ2_ParseTEnt (void)
//Q2TE_RAILTRAIL2, ?
//Q2TE_FLAME, ?
case Q2TE_LIGHTNING:
break;
case Q2TE_FLASHLIGHT:
break;
@ -2603,18 +2589,20 @@ void CLQ2_ParseTEnt (void)
default:
// Con_Printf("CLQ2_ParseTEnt: bad/non-implemented type %i\n", type);
goto fixme;
// Host_EndGame ("CLQ2_ParseTEnt: bad/non-implemented type %i", type);
// break;
}
return;
fixme:
Con_DPrintf("Q2TE legacy code: te %i\n", type);
switch(type)
{
case Q2TE_BLOOD: // bullet hitting flesh
MSG_ReadPos (pos);
MSG_ReadDir (dir);
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blood))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLOOD]))
if (P_RunParticleEffectType(pos, dir, 1, ptqw_blood))
P_RunParticleEffect(pos, dir, 0xe8, 60);
if (cl_legacystains.ival) Surf_AddStain(pos, 0, -10, -10, 40);
@ -2675,7 +2663,7 @@ fixme:
r = MSG_ReadByte ();
if (r > sizeof(q2splash_info)/sizeof(q2splash_info[0]))
r = 0;
if (P_RunParticleEffectTypeString(pos, dir, cnt, q2splash_info[r].name))
if (P_RunParticleEffectType(pos, dir, cnt, pt_q2[Q2SPLASH_UNKNOWN+r]))
P_RunParticleEffect (pos, dir, q2splash_info[r].colour, cnt);
if (r == Q2SPLASH_SPARKS)
{
@ -2701,15 +2689,16 @@ fixme:
case Q2TE_BLUEHYPERBLASTER:
MSG_ReadPos (pos);
MSG_ReadPos (dir);
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
P_RunParticleEffect (pos, dir, 0xe0, 40);
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLUEHYPERBLASTER]))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLASTER]))
P_RunParticleEffect (pos, dir, 0xe0, 40);
break;
case Q2TE_BLASTER: // blaster hitting wall
MSG_ReadPos (pos);
MSG_ReadDir (dir);
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLASTER]))
P_RunParticleEffect (pos, dir, 0xe0, 40);
if (cl_legacystains.ival) Surf_AddStain(pos, 0, -5, -10, 20);
@ -2757,7 +2746,7 @@ fixme:
case Q2TE_RAILTRAIL: // railgun effect
MSG_ReadPos (pos);
MSG_ReadPos (pos2);
if (P_ParticleTrail(pos, pos2, rtq2_railtrail, 0, NULL, NULL))
if (P_ParticleTrail(pos, pos2, pt_q2[Q2TE_RAILTRAIL], 0, NULL, NULL))
P_ParticleTrailIndex(pos, pos2, 0x74, 8, NULL);
Q2S_StartSound (pos, 0, 0, S_PrecacheSound ("weapons/railgf1a.wav"), 1, ATTN_NORM, 0);
break;
@ -2965,13 +2954,13 @@ fixme:
case Q2TE_BUBBLETRAIL:
MSG_ReadPos (pos);
MSG_ReadPos (pos2);
if (P_ParticleTrail(pos, pos2, rtq2_bubbletrail, 0, NULL, NULL))
if (P_ParticleTrail(pos, pos2, pt_q2[Q2TE_BUBBLETRAIL], 0, NULL, NULL))
P_ParticleTrailIndex(pos, pos2, 4, 8, NULL);
break;
case Q2TE_PARASITE_ATTACK:
case Q2TE_MEDIC_CABLE_ATTACK:
CL_ParseBeam (3);
CL_ParseBeam (BT_Q2PARASITE);
break;
case Q2TE_BOSSTPORT: // boss teleporting to station
@ -2981,7 +2970,7 @@ fixme:
break;
case Q2TE_GRAPPLE_CABLE:
CL_ParseBeam (4);
CL_ParseBeam (BT_Q2GRAPPLE);
MSG_ReadPos (pos);
break;
@ -3035,8 +3024,8 @@ fixme:
MSG_ReadPos (pos);
MSG_ReadDir (dir);
if (P_RunParticleEffectTypeString(pos, dir, 1, "te_blaster2"))
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLASTER2]))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLASTER]))
P_RunParticleEffect (pos, dir, 0xd0, 40);
if (cl_legacystains.ival) Surf_AddStain(pos, -10, 0, -10, 20);
@ -3084,8 +3073,8 @@ fixme:
MSG_ReadPos (pos);
MSG_ReadDir (dir);
if (P_RunParticleEffectTypeString(pos, dir, 1, "te_blaster2"))
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_FLECHETTE]))
if (P_RunParticleEffectType(pos, dir, 1, pt_q2[Q2TE_BLASTER]))
P_RunParticleEffect (pos, dir, 0x6f, 40);
if (cl_legacystains.ival) Surf_AddStain(pos, -10, -2, 0, 20);
@ -3131,7 +3120,7 @@ fixme:
case Q2TE_LIGHTNING:
CL_ParseBeam(TE_LIGHTNING1);
CL_ParseBeam(BT_Q1LIGHTNING1);
Q2S_StartSound (pos, 0, 0, S_PrecacheSound("weapons/tesla.wav"), 1, ATTN_NORM, 0);
break;
@ -3368,7 +3357,7 @@ fixme:
case CRTE_BLASTERBEAM:
MSG_ReadPos (pos);
MSG_ReadPos (pos2);
CLQ2_BlasterTrail2 (pos, pos2);
P_ParticleTrail(pos, pos2, P_FindParticleType("q2part.TR_BLASTERTRAIL2"), 0, NULL, NULL);
break;
case CRTE_STAIN:
Host_EndGame ("CLQ2_ParseTEnt: bad/non-implemented type %i", type);
@ -3483,6 +3472,9 @@ void CL_UpdateBeams (void)
// vieworg = pl->origin;
// }
// else
if (cls.protocol == CP_QUAKE2)
vieworg = cl.predicted_origin;
else
vieworg = pv->simorg;
if (cl_truelightning.ival > 1 && cl.movesequence > cl_truelightning.ival)
@ -3541,11 +3533,13 @@ void CL_UpdateBeams (void)
}
}
}
VectorCopy (b->start, org);
}
#ifdef CSQC_DAT
else if ((b->bflags & 1) && b->entity > MAX_EDICTS)
{
CSQC_GetEntityOrigin(b->entity-MAX_EDICTS, b->start);
CSQC_GetEntityOrigin(b->entity-MAX_EDICTS, org);
VectorCopy (b->start, org);
}
#endif
else if (b->bflags & STREAM_ATTACHED)
@ -3554,17 +3548,20 @@ void CL_UpdateBeams (void)
st = CL_FindPacketEntity(b->entity);
if (st)
{
VectorAdd(st->origin, b->offset, b->start);
VectorCopy(st->origin, b->start);
}
else if (b->entity <= cl.allocated_client_slots && b->entity > 0)
{
pl = &cl.inframes[cl.parsecount&UPDATE_MASK].playerstate[b->entity-1];
VectorAdd(pl->origin, b->offset, b->start);
VectorCopy(pl->origin, b->start);
}
VectorCopy (b->start, org);
}
VectorAdd(org, b->offset, org);
// calculate pitch and yaw
VectorSubtract (b->end, b->start, dist);
VectorSubtract (b->end, org, dist);
if (dist[1] == 0 && dist[0] == 0)
{
@ -3587,7 +3584,7 @@ void CL_UpdateBeams (void)
}
if (ruleset_allow_particle_lightning.ival || !type->modelname)
if (type->ef_beam >= 0 && !P_ParticleTrail(b->start, b->end, type->ef_beam, b->entity, NULL, &b->trailstate))
if (type->ef_beam >= 0 && !P_ParticleTrail(org, b->end, type->ef_beam, b->entity, NULL, &b->trailstate))
continue;
if (!type->model)
{
@ -3597,7 +3594,6 @@ void CL_UpdateBeams (void)
}
// add new entities for the lightning
VectorCopy (b->start, org);
d = VectorNormalize(dist);
if(b->bflags & 2)

View file

@ -450,6 +450,8 @@ typedef struct
} protocol_nq;
#define CPNQ_IS_DP (cls.protocol_nq >= CPNQ_DP5)
int protocol_q2;
qboolean resendinfo;
qboolean findtrack;
@ -1087,6 +1089,7 @@ enum beamtype_e
BT_Q2PARASITE,
BT_Q2GRAPPLE,
BT_Q2HEATBEAM,
BT_Q2LIGHTNING,
BT_H2LIGHTNING_SMALL,
BT_H2CHAIN,
@ -1099,7 +1102,8 @@ enum beamtype_e
BT_H2GAZE,
BT_H2FAMINE,
};
void CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end);
typedef struct beam_s beam_t;
beam_t *CL_AddBeam (enum beamtype_e tent, int ent, vec3_t start, vec3_t end);
void CL_ClearState (void);
void CLQ2_ClearState(void);
@ -1249,7 +1253,7 @@ void CL_ParseParticleEffect4 (void);
int CL_TranslateParticleFromServer(int sveffect);
void CL_ParseTrailParticles(void);
void CL_ParsePointParticles(qboolean compact);
void CL_SpawnSpriteEffect(vec3_t org, vec3_t dir, vec3_t orientationup, struct model_s *model, int startframe, int framecount, float framerate, float alpha, float randspin, float gravity, int traileffect, unsigned int renderflags); /*called from the particlesystem*/
void CL_SpawnSpriteEffect(vec3_t org, vec3_t dir, vec3_t orientationup, struct model_s *model, int startframe, int framecount, float framerate, float alpha, float randspin, float gravity, int traileffect, unsigned int renderflags, int skinnum); /*called from the particlesystem*/
//
// cl_ents.c

View file

@ -379,7 +379,7 @@ int CIN_RunCinematic (cinematics_t *cin, qbyte **outdata, int *outwidth, int *ou
}
if (frame > cin->cinematicframe+1)
{
Con_Printf ("Dropped frame: %i > %i\n", frame, cin->cinematicframe+1);
Con_DPrintf ("Dropped frame: %i > %i\n", frame, cin->cinematicframe+1);
cin->cinematictime = realtime*1000 - cin->cinematicframe*1000/14;
}
if (cin->pic)
@ -485,7 +485,7 @@ cinematics_t *CIN_PlayCinematic (char *arg)
cin->cinematicframe = 0;
cin->pic = CIN_ReadNextFrame (cin);
cin->cinematictime = Sys_DoubleTime ()*1000+0.001;
cin->cinematictime = realtime*1000;
}
else
{

View file

@ -77,6 +77,7 @@ float LerpAngle (float a2, float a1, float frac)
#define Q2MAX_STATS 32
void Q2S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float fvol, float attenuation, float timeofs);
typedef struct q2centity_s
{
@ -87,20 +88,117 @@ typedef struct q2centity_s
int serverframe; // if not current, this ent isn't in the frame
trailstate_t *trailstate;
trailstate_t *emitstate;
// float trailcount; // for diminishing grenade trails
vec3_t lerp_origin; // for trails (variable hz)
// int fly_stoptime;
float fly_stoptime;
} q2centity_t;
sfx_t *S_PrecacheSexedSound(int entnum, const char *soundname)
{
if (soundname[0] == '*')
{ //a 'sexed' sound
if (entnum > 0 && entnum <= MAX_CLIENTS)
{
char *model = Info_ValueForKey(cl.players[entnum-1].userinfo, "skin");
char *skin;
skin = strchr(model, '/');
if (skin)
*skin = '\0';
if (*model)
{
sfx_t *sfx = S_PrecacheSound(va("players/%s/%s", model, soundname+1));
if (sfx && sfx->loadstate != SLS_FAILED) //warning: the sound might still be loading (and later fail).
return sfx;
}
}
return S_PrecacheSound(va("players/male/%s", soundname+1));
}
return S_PrecacheSound(soundname);
}
void CLQ2_EntityEvent(entity_state_t *es){};
void CLQ2_EntityEvent(entity_state_t *es)
{
float ATTN_IDLE = 2;
switch (es->u.q2.event)
{
case Q2EV_NONE:
case Q2EV_OTHER_TELEPORT: //inihibits interpolation. not an event in itself.
break;
case Q2EV_ITEM_RESPAWN:
pe->RunParticleEffectState(es->origin, NULL, 1, pt_q2[Q2PT_RESPAWN], NULL);
break;
case Q2EV_PLAYER_TELEPORT:
pe->RunParticleEffectState(es->origin, NULL, 1, pt_q2[Q2PT_PLAYER_TELEPORT], NULL);
break;
case Q2EV_FOOTSTEP:
pe->RunParticleEffectState(es->origin, NULL, 1, pt_q2[Q2PT_FOOTSTEP], NULL);
break;
case Q2EV_FALLSHORT:
Q2S_StartSound (NULL, es->number, CHAN_AUTO, S_PrecacheSound ("player/land1.wav"), 1, ATTN_NORM, 0);
break;
case Q2EV_FALL:
Q2S_StartSound (NULL, es->number, CHAN_AUTO, S_PrecacheSexedSound (es->number, "*fall2.wav"), 1, ATTN_NORM, 0);
break;
case Q2EV_FALLFAR:
Q2S_StartSound (NULL, es->number, CHAN_AUTO, S_PrecacheSexedSound (es->number, "*fall1.wav"), 1, ATTN_NORM, 0);
break;
default:
Con_Printf("event %u not supported\n", es->u.q2.event);
break;
}
};
void CLQ2_TeleporterParticles(entity_state_t *es){};
void CLQ2_Tracker_Shell(vec3_t org){};
void CLQ2_TrapParticles(entity_t *ent){};
void CLQ2_BfgParticles(entity_t *ent){};
void CLQ2_FlyEffect(q2centity_t *ent, vec3_t org){};
void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg){};
/*these are emissive effects (ie: emitted each frame), but they're also mutually exclusive, so sharing emitstate is fine*/
void CLQ2_Tracker_Shell(q2centity_t *ent, vec3_t org)
{
P_EmitEffect (org, pt_q2[Q2PT_TRACKERSHELL], &(ent->emitstate));
};
void CLQ2_BfgParticles(q2centity_t *ent, vec3_t org)
{
P_EmitEffect (org, pt_q2[Q2PT_BFGPARTICLES], &(ent->emitstate));
};
void CLQ2_FlyEffect(q2centity_t *ent, vec3_t org)
{
float starttime, n;
float cltime = cl.time;
int count;
if (cl.paused)
return;
//q2 ramps up to 162 within the first 20 secs, sits at 162 for the next 20, then ramps back down for the 20 after that.
//I have no idea how pvs issues are handled.
if (ent->fly_stoptime < cltime)
{
starttime = cltime;
ent->fly_stoptime = cltime + 60;
}
else
{
starttime = ent->fly_stoptime - 60;
}
n = cltime - starttime;
if (n < 20)
count = n * 162 / 20.0;
else
{
n = ent->fly_stoptime - cltime;
if (n < 20)
count = n * 162 / 20.0;
else
count = 162;
}
if (count < 0)
return;
//these are assumed to be spawned anew
pe->RunParticleEffectState(org, NULL, count, pt_q2[Q2PT_FLIES], &(ent->emitstate));
};
#define MAX_Q2EDICTS 1024
@ -110,7 +208,6 @@ void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg){};
static q2centity_t cl_entities[MAX_Q2EDICTS];
entity_state_t clq2_parse_entities[MAX_PARSE_ENTITIES];
void Q2S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float fvol, float attenuation, float timeofs);
void CL_SmokeAndFlash(vec3_t origin);
void CLQ2_ClearState(void)
@ -764,7 +861,7 @@ static void CLQ2_ParsePacketEntities (q2frame_t *oldframe, q2frame_t *newframe)
oldindex++;
if (oldindex >= oldframe->num_entities)
if (!oldframe || oldindex >= oldframe->num_entities)
oldnum = 99999;
else
{
@ -782,7 +879,7 @@ static void CLQ2_ParsePacketEntities (q2frame_t *oldframe, q2frame_t *newframe)
oldindex++;
if (oldindex >= oldframe->num_entities)
if (!oldframe || oldindex >= oldframe->num_entities)
oldnum = 99999;
else
{
@ -1029,10 +1126,12 @@ void CLQ2_ParseFrame (void)
cl.gametime = cl.q2frame.servertime/1000.f;
cl.gametimemark = realtime;
i = MSG_ReadByte ();
for (j=0 ; j<i ; j++)
cl.outframes[ (cls.netchan.incoming_acknowledged-1-j)&UPDATE_MASK ].latency = -2;
if (cls.protocol_q2 > 26)
{
i = MSG_ReadByte ();
for (j=0 ; j<i ; j++)
cl.outframes[ (cls.netchan.incoming_acknowledged-1-j)&UPDATE_MASK ].latency = -2;
}
if (cl_shownet.value == 3)
Con_Printf (" frame:%i delta:%i\n", cl.q2frame.serverframe, cl.q2frame.deltaframe);
@ -1053,8 +1152,10 @@ void CLQ2_ParseFrame (void)
if (!old->valid)
{ // should never happen
Con_Printf ("Delta from invalid frame (not supposed to happen!).\n");
cl.q2frame.valid = true; // uncompressed frame
old = NULL;
}
if (old->serverframe != cl.q2frame.deltaframe)
else if (old->serverframe != cl.q2frame.deltaframe)
{ // The frame that the server did the delta from
// is too old, so we can't reconstruct it properly.
Con_Printf ("Delta frame too old.\n");
@ -1094,6 +1195,7 @@ void CLQ2_ParseFrame (void)
// save the frame off in the backup array for later delta comparisons
cl.q2frames[cl.q2frame.serverframe & Q2UPDATE_MASK] = cl.q2frame;
cl.parsecount = cl.q2frame.serverframe;
if (cl.q2frame.valid)
{
// getting a valid frame message ends the connection process
@ -1117,6 +1219,8 @@ void CLQ2_ParseFrame (void)
#ifdef Q2BSPS
CLQ2_CheckPredictionError ();
#endif
cl.validsequence = cl.q2frame.serverframe;
}
}
@ -1486,6 +1590,7 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
// add to refresh list
V_AddEntity (&ent);
ent.light_known = false;
ent.customskin = 0;
// color shells generate a seperate entity for the main model
@ -1537,6 +1642,7 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
ent.forcedshader = R_RegisterCustom("q2/shell", SUF_NONE, Shader_DefaultSkinShell, NULL);
ent.fatness = 2;
V_AddEntity (&ent);
ent.fatness = 0;
}
ent.forcedshader = NULL;
@ -1562,21 +1668,16 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
if (skin) *skin = '\0';
i = (s1->skinnum >> 8); // 0 is default weapon model
if (i >= 0 && i < cl.numq2visibleweapons)
ent.model = Mod_ForName(va("players/%s/%s", modelname, cl.q2visibleweapons[i]), MLV_WARN);
/*
ci = &cl.clientinfo[s1->skinnum & 0xff];
i = (s1->skinnum >> 8); // 0 is default weapon model
if (!cl_vwep->value || i > MAX_CLIENTWEAPONMODELS - 1)
if (i < 0 || i >= cl.numq2visibleweapons)
i = 0; //0 is always valid
ent.model = Mod_ForName(va("players/%s/%s", modelname, cl.q2visibleweapons[i]), MLV_WARN);
if (ent.model->loadstate == MLS_FAILED && i)
{
i = 0;
ent.model = ci->weaponmodel[i];
if (!ent.model) {
if (i != 0)
ent.model = ci->weaponmodel[0];
if (!ent.model)
ent.model = cl.baseclientinfo.weaponmodel[0];
ent.model = Mod_ForName(va("players/%s/%s", modelname, cl.q2visibleweapons[i]), MLV_WARN);
}
*/
if (ent.model->loadstate == MLS_FAILED && strcmp(modelname, "male"))
ent.model = Mod_ForName(va("players/%s/%s", "male", cl.q2visibleweapons[i]), MLV_WARN);
}
else
ent.model = cl.model_precache[s1->modelindex2];
@ -1586,16 +1687,18 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
/* if (!Q_strcasecmp (cl.model_name[(s1->modelindex2)], "models/items/shell/tris.md2"))
{
ent.alpha = 0.32;
ent.flags = Q2RF_TRANSLUCENT;
ent.flags |= Q2RF_TRANSLUCENT;
V_AddEntity (&ent);
// make sure these get reset.
ent.flags &= RF_EXTERNALMODEL;
ent.shaderRGBAf[3] = 1;
}
else
*/ // pmm
V_AddEntity (&ent);
//PGM - make sure these get reset.
ent.flags = 0;
ent.shaderRGBAf[3] = 1;
//PGM
V_AddEntity (&ent);
}
if (s1->u.q2.modelindex3)
{
@ -1610,13 +1713,13 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
if ( effects & Q2EF_POWERSCREEN )
{
/* ent.model = cl_mod_powerscreen;
ent.oldframe = 0;
ent.frame = 0;
ent.flags |= (Q2RF_TRANSLUCENT | Q2RF_SHELL_GREEN);
ent.alpha = 0.30;
V_AddLerpEntity (&ent);
*/ }
ent.model = Mod_ForName("models/items/armor/effect/tris.md2", MLV_WARN);
ent.framestate.g[FS_REG].frame[0] = 0;
ent.framestate.g[FS_REG].frame[0] = 0;
ent.flags |= (RF_TRANSLUCENT | Q2RF_SHELL_GREEN);
ent.shaderRGBAf[3] = 0.30;
V_AddEntity (&ent);
}
// add automatic particle trails
if ( (effects&~Q2EF_ROTATE) )
@ -1624,11 +1727,12 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
if (effects & Q2EF_ROCKET)
{
//FIXME: cubemap orientation
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rtq2_rocket, ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_ROCKET], ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_rocket, ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xdc, 4, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.1, 0.05);
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.1, 0.05);
}
}
// PGM - Do not reorder EF_BLASTER and EF_HYPERBLASTER.
// EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
@ -1637,14 +1741,17 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
//PGM
if (effects & Q2EF_TRACKER) // lame... problematic?
{
CLQ2_BlasterTrail2 (cent->lerp_origin, ent.origin);
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_BLASTERTRAIL2], ent.keynum, NULL, &cent->trailstate))
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xd0, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 200, 0, 0.2, 0);
}
else
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rtq2_blastertrail, ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_BLASTERTRAIL], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xe0, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.2, 0);
V_AddLight (ent.keynum, ent.origin, 200, 0.2, 0.2, 0);
}
}
//PGM
}
@ -1657,13 +1764,13 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
}
else if (effects & Q2EF_GIB)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rtq2_gib, ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_GIB], ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_blood, ent.keynum, NULL, &cent->trailstate))
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xe8, 8, &cent->trailstate);
}
else if (effects & Q2EF_GRENADE)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rtq2_grenade, ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_GRENADE], ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_grenade, ent.keynum, NULL, &cent->trailstate))
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 4, 8, &cent->trailstate);
}
@ -1677,7 +1784,7 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
if (effects & Q2EF_ANIM_ALLFAST)
{
CLQ2_BfgParticles (&ent);
CLQ2_BfgParticles (cent, ent.origin);
i = 200;
}
else
@ -1690,29 +1797,33 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
else if (effects & Q2EF_TRAP)
{
ent.origin[2] += 32;
CLQ2_TrapParticles (&ent);
i = (rand()%100) + 100;
V_AddLight (ent.keynum, ent.origin, i, 0.2, 0.16, 0.05);
P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_TRAP], ent.keynum, NULL, &cent->trailstate);
}
else if (effects & Q2EF_FLAG1)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_flag1"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_FLAG1], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 242, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 225, 0.2, 0.05, 0.05);
V_AddLight (ent.keynum, ent.origin, 225, 0.2, 0.05, 0.05);
}
}
else if (effects & Q2EF_FLAG2)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_flag2"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_FLAG2], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 115, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 225, 0.05, 0.05, 0.2);
V_AddLight (ent.keynum, ent.origin, 225, 0.05, 0.05, 0.2);
}
}
//======
//ROGUE
else if (effects & Q2EF_TAGTRAIL)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_tagtrail"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_TAGTRAIL], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 220, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 225, 0.2, 0.2, 0.0);
V_AddLight (ent.keynum, ent.origin, 225, 0.2, 0.2, 0.0);
}
}
else if (effects & Q2EF_TRACKERTRAIL)
{
@ -1727,30 +1838,34 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
}
else
{
CLQ2_Tracker_Shell (cent->lerp_origin);
CLQ2_Tracker_Shell (cent, cent->lerp_origin);
V_AddLight (ent.keynum, ent.origin, 155, -0.2, -0.2, -0.2);
}
}
else if (effects & Q2EF_TRACKER)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_tracker"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_TRACKER], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0, 1, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 200, -0.2, -0.2, -0.2);
V_AddLight (ent.keynum, ent.origin, 200, -0.2, -0.2, -0.2);
}
}
//ROGUE
//======
// RAFAEL
else if (effects & Q2EF_GREENGIB)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_greengib"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_GREENGIB], ent.keynum, NULL, &cent->trailstate))
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 219, 8, &cent->trailstate);
}
// RAFAEL
else if (effects & Q2EF_IONRIPPER)
{
if (P_ParticleTrail(cent->lerp_origin, ent.origin, P_FindParticleType("ef_ionripper"), ent.keynum, NULL, &cent->trailstate))
if (P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_IONRIPPER], ent.keynum, NULL, &cent->trailstate))
{
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 228, 4, &cent->trailstate);
V_AddLight (ent.keynum, ent.origin, 100, 0.2, 0.1, 0.1);
V_AddLight (ent.keynum, ent.origin, 100, 0.2, 0.1, 0.1);
}
}
// RAFAEL
else if (effects & Q2EF_BLUEHYPERBLASTER)
@ -1762,7 +1877,7 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
{
if (effects & Q2EF_ANIM_ALLFAST)
{
P_ParticleTrail(cent->lerp_origin, ent.origin, rtq2_blastertrail, ent.keynum, NULL, &cent->trailstate);
P_ParticleTrail(cent->lerp_origin, ent.origin, pt_q2[Q2RT_PLASMA], ent.keynum, NULL, &cent->trailstate);
}
V_AddLight (ent.keynum, ent.origin, 130, 0.2, 0.1, 0.1);
}
@ -1886,7 +2001,7 @@ void CLQ2_CalcViewValues (void)
lerp = cl.lerpfrac;
// calculate the origin
if (cl.worldmodel && (!cl_nopred.value) && !(cl.q2frame.playerstate.pmove.pm_flags & Q2PMF_NO_PREDICTION))
if (cl.worldmodel && (!cl_nopred.value) && !(cl.q2frame.playerstate.pmove.pm_flags & Q2PMF_NO_PREDICTION) && !cls.demoplayback)
{ // use predicted values
float delta;
@ -1913,7 +2028,7 @@ void CLQ2_CalcViewValues (void)
}
// if not running a demo or on a locked frame, add the local angle movement
if (cl.worldmodel && cl.q2frame.playerstate.pmove.pm_type < Q2PM_DEAD )
if (cl.worldmodel && cl.q2frame.playerstate.pmove.pm_type < Q2PM_DEAD && !cls.demoplayback)
{ // use predicted values
for (i=0 ; i<3 ; i++)
r_refdef.viewangles[i] = cl.predicted_angles[i];
@ -1986,21 +2101,22 @@ void CLQ2_AddEntities (void)
#endif
CL_UpdateTEnts ();
#ifdef _DEBUG
if (chase_active.ival)
{
playerview_t *pv = &cl.playerview[0];
vec3_t axis[3];
vec3_t camorg;
trace_t tr;
// trace_t tr;
AngleVectors(r_refdef.viewangles, axis[0], axis[1], axis[2]);
VectorMA(r_refdef.vieworg, -chase_back.value, axis[0], camorg);
VectorMA(camorg, -chase_up.value, pv->gravitydir, camorg);
// if (cl.worldmodel && cl.worldmodel->funcs.NativeTrace(cl.worldmodel, 0, 0, NULL, r_refdef.vieworg, camorg, vec3_origin, vec3_origin, MASK_WORLDSOLID, &tr))
// if (cl.worldmodel && cl.worldmodel->funcs.NativeTrace(cl.worldmodel, 0, 0, NULL, r_refdef.vieworg, camorg, vec3_origin, vec3_origin, true, MASK_WORLDSOLID, &tr))
VectorCopy(camorg, r_refdef.vieworg);
CL_EditExternalModels(0, NULL, 0);
}
#endif
}
void CL_GetNumberedEntityInfo (int num, float *org, float *ang)

View file

@ -66,7 +66,7 @@ cvar_t con_notify_w = SCVAR("con_notify_w","1");
cvar_t con_centernotify = SCVAR("con_centernotify", "0");
cvar_t con_displaypossibilities = SCVAR("con_displaypossibilities", "1");
cvar_t con_maxlines = SCVAR("con_maxlines", "1024");
cvar_t cl_chatmode = SCVAR("cl_chatmode", "2");
cvar_t cl_chatmode = CVARD("cl_chatmode", "2", "0(nq) - everything is assumed to be a console command. prefix with 'say', or just use a messagemode bind\n1(q3) - everything is assumed to be chat, unless its prefixed with a /\n2(qw) - anything explicitly recognised as a command will be used as a command, anything unrecognised will be a chat message.\n/ prefix is supported in all cases.\nctrl held when pressing enter always makes any implicit chat into team chat instead.");
cvar_t con_numnotifylines_chat = CVAR("con_numnotifylines_chat", "8");
cvar_t con_notifytime_chat = CVAR("con_notifytime_chat", "8");
cvar_t con_separatechat = CVAR("con_separatechat", "0");
@ -532,6 +532,8 @@ Con_Clear_f
*/
void Con_Clear_f (void)
{
if (Cmd_IsInsecure())
return;
Con_ClearCon(&con_main);
}

View file

@ -95,6 +95,7 @@ static void SL_DrawColumnTitle (int *x, int y, int xlen, int mx, char *str, qboo
*filldraw = true;
R2D_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, 1.0);
R2D_FillBlock(xmin, y, xlen, 8);
R2D_ImageColours(1,1,1,1);
}
Draw_FunStringWidth(xmin, y, str, xlen, false, false);
@ -291,6 +292,7 @@ static void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu)
}
R2D_FillBlock(0, y, ths->common.width, 8);
R2D_ImageColours(1,1,1,1);
if (sb_showtimelimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->tl), 3*8, false, false); x-=4*8;}
if (sb_showfraglimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->fl), 3*8, false, false); x-=4*8;}
if (sb_showplayers.value) {Draw_FunStringWidth((x-5*8), y, va("%2i/%2i", si->numhumans, si->maxplayers), 5*8, false, false); x-=6*8;}
@ -877,6 +879,7 @@ static void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu)
R2D_ImageColours(0.35, 0.35, 0.55, 1.0);
R2D_FillBlock(x, y, 8, 8);
R2D_ImageColours(1,1,1,1);
}
if (keydown[K_MOUSE1])

View file

@ -2674,18 +2674,23 @@ enum uploadfmt pbo_format;
#endif
int pbo_oldest;
#define CAPTUREDRIVERDESC_DEFAULT "raw"
#define CAPTURECODECDESC_DEFAULT "tga"
#ifdef WINAVI
#define CAPTUREDRIVERDESC_AVI "avi: capture directly to avi (capturecodec should be a fourcc value).\n"
#define CAPTURECODECDESC_AVI "With (win)avi, this should be a fourcc code like divx or xvid, may be blank for raw video.\n"
#else
#define CAPTUREDRIVERDESC_AVI
#define CAPTURECODECDESC_AVI
#endif
qboolean capturepaused;
extern cvar_t vid_conautoscale;
cvar_t capturerate = CVAR("capturerate", "30");
cvar_t capturewidth = CVARD("capturedemowidth", "0", "When using capturedemo, this specifies the width of the FBO image used.");
cvar_t captureheight = CVARD("capturedemoheight", "0", "When using capturedemo, this specifies the width of the FBO image used.");
#if 0//defined(WINAVI)
cvar_t capturedriver = CVARD("capturedriver", "avi", "The driver to use to capture the demo. avformat can be supported via a plugin.\navi: capture directly to avi (capturecodec should be a fourcc value).\nraw: capture to a series of screenshots.");
cvar_t capturecodec = CVAR("capturecodec", "divx");
#else
cvar_t capturedriver = CVARD("capturedriver", "raw", "The driver to use to capture the demo. avformat can be supported via a plugin.\nraw: capture to a series of screenshots.");
cvar_t capturecodec = CVARD("capturecodec", "tga", "the compression/encoding codec to use. With raw capturing, this should be one of tga,png,jpg,pcx (ie: screenshot extensions).\nWith (win)avi, this should be a fourcc code like divx or xvid.");
#endif
cvar_t capturerate = CVARD("capturerate", "30", "The framerate of the video to capture");
cvar_t capturewidth = CVARD("capturedemowidth", "0", "When using capturedemo, this specifies the width of the FBO image used. Can be larger than your physical monitor.");
cvar_t captureheight = CVARD("capturedemoheight", "0", "When using capturedemo, this specifies the height of the FBO image used.");
cvar_t capturedriver = CVARD("capturedriver", CAPTUREDRIVERDESC_DEFAULT, "The driver to use to capture the demo. avformat can be supported via a plugin.\n"CAPTUREDRIVERDESC_AVI"raw: capture to a series of screenshots.");
cvar_t capturecodec = CVARD("capturecodec", CAPTURECODECDESC_DEFAULT, "the compression/encoding codec to use.\n"CAPTURECODECDESC_AVI"With raw capturing, this should be one of tga,png,jpg,pcx (ie: screenshot extensions).");
cvar_t capturesound = CVARD("capturesound", "1", "Enables the capturing of game voice. If not using capturedemo, this can be combined with cl_voip_test to capture your own voice.");
cvar_t capturesoundchannels = CVAR("capturesoundchannels", "1");
cvar_t capturesoundbits = CVAR("capturesoundbits", "8");
@ -3593,7 +3598,12 @@ void CL_PlayDemo(char *demoname, qboolean usesystempath);
void Media_RecordDemo_f(void)
{
if (Cmd_Argc() < 2)
{
Con_Printf( "capturedemo demoname outputname\n"
"captures a demo to video frames using offline rendering for smoother results\n"
"see also: apropos capture\n");
return;
}
if (Cmd_FromGamecode())
return;

View file

@ -3042,7 +3042,10 @@ int CL_ReadServerInfo(char *msg, enum masterprotocol_e prototype, qboolean favor
MasterInfo_AddPlayer(&info->adr, details.players[clnum].name, details.players[clnum].ping, details.players[clnum].frags, details.players[clnum].topc*4 | details.players[clnum].botc, details.players[clnum].skin, details.players[clnum].team);
if (details.players[clnum].ping == 807 || !strncmp(details.players[clnum].name, "BOT:", 4))
//807 excludes the numerous bot names on some annoying qwtf server
//BOT: excludes fte's botclients (which always have a bot: prefix)
//WallFly is some q2 bot
if (details.players[clnum].ping == 807 || !strncmp(details.players[clnum].name, "BOT:", 4) || !strncmp(details.players[clnum].name, "WallFly", 7))
info->numbots++;
else if (details.players[clnum].isspec)
info->numspectators++;

View file

@ -182,9 +182,10 @@ typedef struct {
char name[MAX_QPATH];
model_t *model;
float framestart;
float frameend;
float framecount;
float framerate;
float alpha;
int skin;
int traileffect;
unsigned int rflags;
#define RF_USEORIENTATION Q2RF_CUSTOMSKIN //private flag
@ -1244,11 +1245,13 @@ void P_ParticleEffect_f(void)
else if (!strcmp(var, "alpha"))
ptype->alpha = atof(value);
#ifndef NOLEGACY
else if (!strcmp(var, "alphachange"))
{
Con_DPrintf("%s.%s: alphachange is deprecated, use alphadelta\n", ptype->config, ptype->name);
ptype->alphachange = atof(value);
}
#endif
else if (!strcmp(var, "alphadelta"))
{
ptype->alphachange = atof(value);
@ -1269,11 +1272,13 @@ void P_ParticleEffect_f(void)
ptype->randdie = mx-mn;
}
}
#ifndef NOLEGACY
else if (!strcmp(var, "diesubrand"))
{
Con_DPrintf("%s.%s: diesubrand is deprecated, use die with two arguments\n", ptype->config, ptype->name);
ptype->randdie = atof(value);
}
#endif
else if (!strcmp(var, "randomvel"))
{
@ -1395,9 +1400,10 @@ parsefluid:
mod = &ptype->models[ptype->nummodels++];
mod->framestart = 0;
mod->frameend = 1;
mod->framecount = 1;
mod->framerate = 10;
mod->alpha = 1;
mod->skin = 0;
mod->traileffect = P_INVALID;
mod->rflags = RF_NOSHADOW;
@ -1411,12 +1417,21 @@ parsefluid:
{
e = Cmd_Argv(p);
if (!Q_strncasecmp(e, "framestart=", 11))
if (!Q_strncasecmp(e, "frame=", 6))
{
mod->framestart = atof(e+6);
mod->framecount = 1;
}
else if (!Q_strncasecmp(e, "framestart=", 11))
mod->framestart = atof(e+11);
else if (!Q_strncasecmp(e, "frameend=", 9))
mod->frameend = atof(e+9);
else if (!Q_strncasecmp(e, "frameend=", 9)) //misnomer.
mod->framecount = atof(e+9);
else if (!Q_strncasecmp(e, "frames=", 7))
mod->framecount = atof(e+7);
else if (!Q_strncasecmp(e, "framerate=", 10))
mod->framerate = atof(e+10);
else if (!Q_strncasecmp(e, "skin=", 5))
mod->skin = atoi(e+5);
else if (!Q_strncasecmp(e, "alpha=", 6))
mod->alpha = atof(e+6);
else if (!Q_strncasecmp(e, "trail=", 6))
@ -1443,7 +1458,7 @@ parsefluid:
else
{
mod->framestart = atof(Cmd_Argv(2));
mod->frameend = atof(Cmd_Argv(3));
mod->framecount = atof(Cmd_Argv(3));
mod->framerate = atof(Cmd_Argv(4));
mod->alpha = atof(Cmd_Argv(5));
if (*Cmd_Argv(6))
@ -1636,7 +1651,13 @@ parsefluid:
else if (!strcmp(value, "uniformcircle"))
ptype->spawnmode = SM_UNICIRCLE;
else if (!strcmp(value, "syncfield"))
{
ptype->spawnmode = SM_FIELD;
#ifndef NOLEGACY
ptype->spawnparam1 = 16;
ptype->spawnparam2 = 0;
#endif
}
else if (!strcmp(value, "distball"))
ptype->spawnmode = SM_DISTBALL;
else
@ -1667,11 +1688,13 @@ parsefluid:
ptype->looks.type = PT_NORMAL;
settype = true;
}
#ifndef NOLEGACY
else if (!strcmp(var, "isbeam"))
{
Con_DPrintf("%s.%s: isbeam is deprecated, use type beam\n", ptype->config, ptype->name);
ptype->looks.type = PT_BEAM;
}
#endif
else if (!strcmp(var, "spawntime"))
ptype->spawntime = atof(value);
else if (!strcmp(var, "spawnchance"))
@ -1705,6 +1728,7 @@ parsefluid:
else if (!strcmp(var, "emitstart"))
ptype->emitstart = atof(value);
#ifndef NOLEGACY
// old names
else if (!strcmp(var, "areaspread"))
{
@ -1726,6 +1750,7 @@ parsefluid:
Con_DPrintf("%s.%s: offsetspreadvert is deprecated, use spawnvel\n", ptype->config, ptype->name);
ptype->spawnvelvert = atof(value);
}
#endif
// current names
else if (!strcmp(var, "spawnorg"))
@ -1743,13 +1768,21 @@ parsefluid:
ptype->spawnvelvert = atof(Cmd_Argv(2));
}
#ifndef NOLEGACY
// spawn mode param fields
else if (!strcmp(var, "spawnparam1"))
{
ptype->spawnparam1 = atof(value);
Con_DPrintf("%s.%s: 'spawnparam1' is deprecated, use 'spawnmode foo X'\n", ptype->config, ptype->name);
}
else if (!strcmp(var, "spawnparam2"))
{
ptype->spawnparam2 = atof(value);
Con_DPrintf("%s.%s: 'spawnparam2' is deprecated, use 'spawnmode foo X Y'\n", ptype->config, ptype->name);
}
/* else if (!strcmp(var, "spawnparam3"))
ptype->spawnparam3 = atof(value); */
#endif
else if (!strcmp(var, "up"))
ptype->orgbias[2] = atof(value);
@ -1757,11 +1790,13 @@ parsefluid:
{
if (!strcmp(value, "none"))
ptype->rampmode = RAMP_NONE;
#ifndef NOLEGACY
else if (!strcmp(value, "absolute"))
{
Con_DPrintf("%s.%s: 'rampmode absolute' is deprecated, use 'rampmode nearest'\n", ptype->config, ptype->name);
ptype->rampmode = RAMP_NEAREST;
}
#endif
else if (!strcmp(value, "nearest"))
ptype->rampmode = RAMP_NEAREST;
else if (!strcmp(value, "lerp")) //don't use the name 'linear'. ramps are there to avoid linear...
@ -2066,7 +2101,24 @@ qboolean PScript_Query(int typenum, int body, char *outstr, int outstrlen)
for (i = 0; i < ptype->nummodels; i++)
{
Q_strncatz(outstr, va("model \"%s\" %g %g %g %g \"%s\"\n", ptype->models[i].name, ptype->models[i].framestart, ptype->models[i].frameend, ptype->models[i].framerate, ptype->models[i].alpha, ptype->models[i].traileffect==P_INVALID?"":part_type[ptype->models[i].traileffect].name), outstrlen);
Q_strncatz(outstr, va("model \"%s\" framestart=%g frames=%g framerate=%g alpha=%g skin=%i",
ptype->models[i].name, ptype->models[i].framestart, ptype->models[i].framecount, ptype->models[i].framerate, ptype->models[i].alpha, ptype->models[i].skin
), outstrlen);
if (ptype->models[i].traileffect!=P_INVALID)
Q_strncatz(outstr, va(" trail=%s", part_type[ptype->models[i].traileffect].name), outstrlen);
if (ptype->models[i].rflags&RF_USEORIENTATION)
Q_strncatz(outstr, " orient", outstrlen);
if (ptype->models[i].rflags&RF_ADDITIVE)
Q_strncatz(outstr, " additive", outstrlen);
if (ptype->models[i].rflags&RF_TRANSLUCENT)
Q_strncatz(outstr, " transparent", outstrlen);
if (ptype->models[i].rflags&Q2RF_FULLBRIGHT)
Q_strncatz(outstr, " fullbright", outstrlen);
if (ptype->models[i].rflags&RF_NOSHADOW)
Q_strncatz(outstr, " noshadow", outstrlen);
else
Q_strncatz(outstr, " shadow", outstrlen);
Q_strncatz(outstr, "\n", outstrlen);
}
for (i = 0; i < ptype->numsounds; i++)
{
@ -3650,17 +3702,22 @@ static void PScript_ApplyOrgVel(vec3_t oorg, vec3_t ovel, vec3_t eforg, vec3_t e
VectorScale(ofsvec, ptype->areaspread, arsvec);
break;
case SM_FIELD:
arsvec[0] = cl.time * (avelocities[i][0] + m);
arsvec[1] = cl.time * (avelocities[i][1] + m);
arsvec[0] = (cl.time * avelocities[i][0]) + m;
arsvec[1] = (cl.time * avelocities[i][1]) + m;
arsvec[2] = cos(arsvec[1]);
ofsvec[0] = arsvec[2]*cos(arsvec[0]);
ofsvec[1] = arsvec[2]*sin(arsvec[0]);
ofsvec[2] = -sin(arsvec[1]);
arsvec[0] = r_avertexnormals[j][0]*ptype->areaspread + ofsvec[0]*BEAMLENGTH;
arsvec[1] = r_avertexnormals[j][1]*ptype->areaspread + ofsvec[1]*BEAMLENGTH;
arsvec[2] = r_avertexnormals[j][2]*ptype->areaspreadvert + ofsvec[2]*BEAMLENGTH;
// arsvec[0] = r_avertexnormals[j][0]*ptype->areaspread + ofsvec[0]*BEAMLENGTH;
// arsvec[1] = r_avertexnormals[j][1]*ptype->areaspread + ofsvec[1]*BEAMLENGTH;
// arsvec[2] = r_avertexnormals[j][2]*ptype->areaspreadvert + ofsvec[2]*BEAMLENGTH;
l = ptype->spawnparam2 * sin(cl.time+j+m);
arsvec[0] = r_avertexnormals[j][0]*(ptype->areaspread+l) + ofsvec[0]*ptype->spawnparam1;
arsvec[1] = r_avertexnormals[j][1]*(ptype->areaspread+l) + ofsvec[1]*ptype->spawnparam1;
arsvec[2] = r_avertexnormals[j][2]*(ptype->areaspreadvert+l) + ofsvec[2]*ptype->spawnparam1;
VectorNormalize(ofsvec);
@ -3762,7 +3819,7 @@ static void PScript_EffectSpawned(part_type_t *ptype, vec3_t org, vec3_t axis[3]
{
vec3_t morg, mdir;
PScript_ApplyOrgVel(morg, mdir, org, axis[0], i, count, ptype);
CL_SpawnSpriteEffect(morg, mdir, (mod->rflags&RF_USEORIENTATION)?axis[2]:NULL, mod->model, mod->framestart, (mod->frameend?mod->frameend:(mod->model->numframes - mod->framestart)), mod->framerate?mod->framerate:10, mod->alpha?mod->alpha:1, ptype->rotationmin*180/M_PI, ptype->gravity, mod->traileffect, mod->rflags & ~RF_USEORIENTATION);
CL_SpawnSpriteEffect(morg, mdir, (mod->rflags&RF_USEORIENTATION)?axis[2]:NULL, mod->model, mod->framestart, (mod->framecount?mod->framecount:(mod->model->numframes - mod->framestart)), mod->framerate?mod->framerate:10, mod->alpha?mod->alpha:1, ptype->rotationmin*180/M_PI, ptype->gravity, mod->traileffect, mod->rflags & ~RF_USEORIENTATION, mod->skin);
}
}
}
@ -4139,11 +4196,8 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
}
/*this is a hack, use countextra=1, count=0*/
if (!ptype->die && ptype->count == 1 && ptype->countrand == 0)
{
i = 0;
if (!ptype->die && ptype->count == 1 && ptype->countrand == 0 && pcount < 1)
pcount = 1;
}
// particle spawning loop
for (i = 0; i < pcount; i++)
@ -4299,17 +4353,22 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
VectorScale(ofsvec, ptype->areaspread, arsvec);
break;
case SM_FIELD:
arsvec[0] = cl.time * (avelocities[i][0] + m);
arsvec[1] = cl.time * (avelocities[i][1] + m);
arsvec[0] = (cl.time * avelocities[i][0]) + m;
arsvec[1] = (cl.time * avelocities[i][1]) + m;
arsvec[2] = cos(arsvec[1]);
ofsvec[0] = arsvec[2]*cos(arsvec[0]);
ofsvec[1] = arsvec[2]*sin(arsvec[0]);
ofsvec[2] = -sin(arsvec[1]);
arsvec[0] = r_avertexnormals[j][0]*ptype->areaspread + ofsvec[0]*BEAMLENGTH;
arsvec[1] = r_avertexnormals[j][1]*ptype->areaspread + ofsvec[1]*BEAMLENGTH;
arsvec[2] = r_avertexnormals[j][2]*ptype->areaspreadvert + ofsvec[2]*BEAMLENGTH;
// arsvec[0] = r_avertexnormals[j][0]*ptype->areaspread + ofsvec[0]*BEAMLENGTH;
// arsvec[1] = r_avertexnormals[j][1]*ptype->areaspread + ofsvec[1]*BEAMLENGTH;
// arsvec[2] = r_avertexnormals[j][2]*ptype->areaspreadvert + ofsvec[2]*BEAMLENGTH;
orgadd = ptype->spawnparam2 * sin(cl.time+j+m);
arsvec[0] = r_avertexnormals[j][0]*(ptype->areaspread+orgadd) + ofsvec[0]*ptype->spawnparam1;
arsvec[1] = r_avertexnormals[j][1]*(ptype->areaspread+orgadd) + ofsvec[1]*ptype->spawnparam1;
arsvec[2] = r_avertexnormals[j][2]*(ptype->areaspreadvert+orgadd) + ofsvec[2]*ptype->spawnparam1;
VectorNormalize(ofsvec);
@ -4374,8 +4433,7 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
VectorMA(p->vel, ofsvec[1]*ptype->spawnvel, axis[1], p->vel);
VectorMA(p->vel, veladd+ofsvec[2]*ptype->spawnvelvert, axis[2], p->vel);
VectorCopy(org, p->org);
VectorMA(p->org, arsvec[0], axis[0], p->org);
VectorMA(org, arsvec[0], axis[0], p->org);
VectorMA(p->org, arsvec[1], axis[1], p->org);
VectorMA(p->org, orgadd+arsvec[2], axis[2], p->org);
#else
@ -6138,6 +6196,22 @@ static void PScript_DrawParticleTypes (void)
{
if (scenetri)
{
if (cl_numstrisvert - scenetri->firstvert >= MAX_INDICIES-6)
{
//generate a new mesh if the old one overflowed. yay smc...
if (cl_numstris == cl_maxstris)
{
cl_maxstris+=8;
cl_stris = BZ_Realloc(cl_stris, sizeof(*cl_stris)*cl_maxstris);
}
scenetri = &cl_stris[cl_numstris++];
scenetri->shader = scenetri[-1].shader;
scenetri->firstidx = cl_numstrisidx;
scenetri->firstvert = cl_numstrisvert;
scenetri->flags = scenetri[-1].flags;
scenetri->numvert = 0;
scenetri->numidx = 0;
}
tdraw(scenetri, p, type->slooks);
}
else if (pdraw)

View file

@ -3456,7 +3456,7 @@ void QCBUILTIN PF_cl_effect(pubprogfuncs_t *prinst, struct globalvars_s *pr_glob
mdl = Mod_ForName(name, MLV_WARN);
if (mdl)
CL_SpawnSpriteEffect(org, NULL, NULL, mdl, startframe, endframe, framerate, mdl->type==mod_sprite?-1:1, 0, 0, P_INVALID, 0);
CL_SpawnSpriteEffect(org, NULL, NULL, mdl, startframe, endframe, framerate, mdl->type==mod_sprite?-1:1, 0, 0, P_INVALID, 0, 0);
else
Con_Printf("PF_cl_effect: Couldn't load model %s\n", name);
}

View file

@ -3422,6 +3422,9 @@ char *particle_set_h2part =
#ifdef Q2CLIENT
char *particle_set_q2part =
//model "name" framestart= frames= framerate= alpha= trail= orient additive transparent fullbright shadow noshadow
"r_part namespace q2part\n"
"r_part pe_default\n"
@ -3454,6 +3457,10 @@ char *particle_set_q2part =
"scalefactor 0.8\n"
"colorindex 0xe0\n"
"}\n"
"r_part te_splashunknown\n"
"{\n"
"assoc te_splashsparks\n"
"}\n"
"r_part teq2_sparks\n"
"{\n"
"texture \"classicparticle\"\n"
@ -3546,11 +3553,51 @@ char *particle_set_q2part =
"}\n"
//teq2_shield_sparks
//teq2_screen_sparks
//teq2_laser_sparks
"r_part teq2_shield_sparks\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 40\n"
"colorindex 0xb0\n"
"scale 1\n"
"alpha 1\n"
"die 0.3 0.8\n"
"randomvel 20\n"
"orgadd 0 31\n"
"spawnorg 4\n"
"gravity 40\n"
"scalefactor 0.8\n"
"}\n"
"r_part teq2_screen_sparks\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 40\n"
"colorindex 0xd0\n"
"scale 1\n"
"alpha 1\n"
"die 0.3 0.8\n"
"randomvel 20\n"
"orgadd 0 31\n"
"spawnorg 4\n"
"gravity 40\n"
"scalefactor 0.8\n"
"}\n"
"r_part teq2_bullet_sparks\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 6\n"
"colorindex 0xe0\n"
"scale 1\n"
"alpha 1\n"
"die 0.3 0.8\n"
"randomvel 20\n"
"orgadd 0 31\n"
"spawnorg 4\n"
"gravity 40\n"
"scalefactor 0.8\n"
"}\n"
"r_part q2_smoke\n"
"{\n"
@ -3648,6 +3695,28 @@ char *particle_set_q2part =
"lightshadows 0\n"
"sound \"weapons/lashit.wav\" 1 1 0 0\n"
"}\n"
"r_part teq2_blaster2\n"
"{ //green version.\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 60\n"
"scale 1\n"
"alpha 1\n"
"die 0.3 0.8\n"
"randomvel 40\n"
"orgadd 0 15\n"
"veladd 30\n"
"spawnorg 4\n"
"gravity 40\n"
"scalefactor 0.8\n"
"colorindex 0xd0 7\n"
"assoc q2_blasterpuff /*the model*/\n"
"lightradius 150\n"
"lightradiusfade 400\n"
"lightrgb 0.05 1.0 0.05\n"
"lightshadows 0\n"
"sound \"weapons/lashit.wav\" 1 1 0 0\n"
"}\n"
"r_part TR_BLASTERTRAIL\n"
"{\n"
"texture \"classicparticle\"\n"
@ -3662,6 +3731,21 @@ char *particle_set_q2part =
"colorindex 0xe0\n"
"}\n"
//green version
"r_part TR_BLASTERTRAIL2\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"scale 0.5\n"
"alpha 1\n"
"scalefactor 0.8\n"
"step 5\n"
"spawnorg 1\n"
"randomvel 5\n"
"die 0.3 0.5\n"
"colorindex 0xd0\n"
"}\n"
"r_part teq2_bubbletrail\n"
"{\n"
@ -3678,7 +3762,7 @@ char *particle_set_q2part =
"colorindex 4 7\n"
"}\n"
"r_part TR_RAILTRAIL\n"
"r_part TEQ2_RAILTRAIL\n"
"{\n"
/*blue spiral*/
"texture \"classicparticle\"\n"
@ -3695,7 +3779,7 @@ char *particle_set_q2part =
"sound \"weapons/railgf1a.wav\" 1 1 0 0\n"
"}\n"
"r_part +TR_RAILTRAIL\n"
"r_part +TEQ2_RAILTRAIL\n"
"{\n"
/*grey filler*/
"texture \"classicparticle\"\n"
@ -3709,6 +3793,308 @@ char *particle_set_q2part =
"die 0.6 0.8\n"
"colorindex 0 15\n"
"}\n"
//regular explosion particles
"r_part std_explosion_particles\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 256\n"
"scale 4\n"
"alpha 0.4\n"
"die 1 0.625\n"
"spawnmode ball\n"
"spawnorg 16\n"
"spawnvel 192\n"
"scalefactor 0.8\n"
"gravity 40\n"
"colorindex 0xe0 7\n"
"}\n"
"r_part teq2_explosion1_big\n"
"{\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/rocklx1a.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode2/tris.md2\" framestart=0 frames=15 skin=-1 transparent fullbright noshadow\n"
"model \"models/objects/r_explode2/tris.md2\" framestart=15 frames=15 skin=-1 transparent fullbright noshadow\n"
"}\n"
"r_part teq2_explosion1_np\n"
"{\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/rocklx1a.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode/tris.md2\" framestart=0 frames=15 skin=-1 fullbright noshadow\n"
"model \"models/objects/r_explode/tris.md2\" framestart=15 frames=150 skin=-1 fullbright noshadow\n"
"}\n"
"r_part teq2_explosion1\n"
"{\n"
"assoc teq2_rocket_explosion\n"
"}\n"
"r_part teq2_rocket_explosion\n"
"{\n"
"assoc std_explosion_particles\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/rocklx1a.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode/tris.md2\" framestart=0 frames=15 skin=-1 fullbright noshadow\n"
"model \"models/objects/r_explode/tris.md2\" framestart=15 frames=15 skin=-1 fullbright noshadow\n"
"}\n"
"r_part teq2_rocket_explosion_water\n"
"{\n"
"assoc std_explosion_particles\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/xpld_wat.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode/tris.md2\" framestart=0 frames=15 skin=-1 fullbright noshadow\n"
"model \"models/objects/r_explode/tris.md2\" framestart=15 frames=15 skin=-1 fullbright noshadow\n"
"}\n"
"r_part teq2_explosion2\n"
"{\n"
"assoc teq2_grenade_explosion\n"
"}\n"
"r_part teq2_grenade_explosion\n"
"{\n"
"assoc std_explosion_particles\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/grenlx1a.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode/tris.md2\" framestart=30 frames=19 skin=-1 fullbright noshadow\n"
"}\n"
"r_part teq2_grenade_explosion_water\n"
"{\n"
"assoc std_explosion_particles\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 1.0 0.5 0.4\n"
"lightrgbfade 0.36 0.19 0.19\n"
"sound \"weapons/xpld_wat.wav\" 1 1 0 0\n"
"model \"models/objects/r_explode/tris.md2\" framestart=30 frames=19 skin=-1 fullbright noshadow\n"
"}\n"
"r_part trq2_rocket\n"
"{\n"
"texture \"particles/quake\"\n"
"step 8\n"
"scale 4\n"
"die 1.0 1.2\n"
"colorindex 0xdc 3\n"
"spawnorg 1\n"
"spawnvel 20\n"
"gravity 40\n"
"assoc trq2_grenade\n"
"}\n"
"r_part trq2_grenade\n"
"{\n"
"texture \"particles/quake\"\n"
"step 3\n"
"scale 4\n"
"die 1.0 1.2\n"
"colorindex 0x4 7\n"
"spawnorg 1\n"
"spawnvel 5\n"
"gravity -20\n"
"}\n"
"r_part trq2_gib\n"
"{\n"
"assoc tr_gib\n"
"}\n"
//FIXME: implement
"r_part trq2_greengib\n"
"{\n"
"assoc tr_gib\n"
"}\n"
"r_part TR_PLASMA\n"
"{\n"
"assoc TR_BLASTERTRAIL\n"
"}\n"
//FIXME: add particles
"r_part tr_ionripper\n"
"{\n"
"lighttime 0\n"
"lightradius 100\n"
"lightrgb 1.0 0.5 0.5\n"
"}\n"
//FIXME: add particles
"r_part tr_tracker\n"
"{\n"
"lighttime 0\n"
"lightradius 200\n"
"lightrgb -1.0 -1.0 -1.0\n"
"}\n"
//FIXME: add particles
"r_part tr_tagtrail\n"
"{\n"
"lighttime 0\n"
"lightradius 225\n"
"lightrgb 1.0 1.0 0.0\n"
"}\n"
//flags do NOT use coronas, because it obscures the holding player's skin colour
"r_part tr_flag1\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"step 5\n"
"scale 1\n"
"alpha 1\n"
"die 1.0 0.8\n"
"spawnorg 16\n"
"spawnvel 5\n"
"veladd 32\n"
"scalefactor 0\n"
"colorindex 0xf2\n"
"lighttime 0\n"
"lightcorona 0.0 0.0\n"
"lightradius 225\n"
"lightrgb 1.0 0.25 0.25\n"
"}\n"
"r_part tr_flag2\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"step 5\n"
"scale 1\n"
"alpha 1\n"
"die 1.0 0.8\n"
"spawnorg 16\n"
"spawnvel 5\n"
"veladd 32\n"
"scalefactor 0\n"
"colorindex 0x73\n"
"lighttime 0\n"
"lightcorona 0.0 0.0\n"
"lightradius 225\n"
"lightrgb 0.25 0.25 1.0\n"
"}\n"
//FIXME: add particles
"r_part tr_trap\n"
"{\n"
"lighttime 0\n"
"lightradius 100 200\n"
"lightrgb 1.0 0.8 0.25\n"
"}\n"
"r_part EF_FLIES\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 1\n"
"scale 0.5\n"
"alpha 1\n"
"die 0\n"
"spawnmode syncfield 16 64\n"
"spawnorg 0\n"
"scalefactor 0\n"
"colorindex 0\n"
"}\n"
"r_part EF_BFGPARTICLES\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 0 0 162\n"
"scale 0.5\n"
"alpha 1\n"
"die 0\n"
"spawnmode syncfield 16 64\n"
"spawnorg 0\n"
"scalefactor 0\n"
"colorindex 0xd0 7\n"
"}\n"
"r_part ev_item_respawn\n"
"{\n"
"sound \"items/respawn1.wav\" 1 2 0 0 1\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 64\n"
"scale 1\n"
"alpha 1\n"
"die 1.3 1\n"
"randomvel 8\n"
"orgadd 0 31\n"
"spawnorg 8\n"
"gravity 8\n"
"scalefactor 0.8\n"
"colorindex 0xd4 3\n"
"}\n"
"r_part ev_player_teleport\n"
"{\n"
"sound \"misc/tele1.wav\" 1 2 0 0 1\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 96\n"
"scale 1\n"
"alpha 1\n"
"die 0.3 0.4\n"
"randomvel 8\n"
"orgadd 0 31\n"
"spawnmode telebox 0 4\n"
"spawnorg 32 48\n"
"gravity 40\n"
"scalefactor 0.8\n"
"colorindex 0x07 7\n"
"}\n"
"r_part ev_footstep\n"
"{\n"
"sound \"player/step1.wav\" 1 1 0 0 1\n"
"sound \"player/step2.wav\" 1 1 0 0 1\n"
"sound \"player/step3.wav\" 1 1 0 0 1\n"
"sound \"player/step4.wav\" 1 1 0 0 1\n"
"}\n"
//central explosion
"r_part teq2_bfg_bigexplosion\n"
"{\n"
"texture \"classicparticle\"\n"
"tcoords 0 0 16 16 32\n"
"count 256\n"
"scale 1\n"
"alpha 1\n"
"die 0.625 1\n"
"spawnmode ball\n"
"spawnorg 16\n"
"spawnvel 192\n"
"scalefactor 0.8\n"
"gravity 40\n"
"colorindex 0xd0 7\n"
"}\n"
//splashed onto an entity
"r_part teq2_bfg_explosion\n"
"{\n"
"lighttime 0.5\n"
"lightradius 350\n"
"lightradiusfade 300\n"
"lightrgb 0.0 1.0 0.0\n"
"lightrgbfade 0.0 0.0 0.0\n"
"sound \"weapons/xpld_wat.wav\" 1 1 0 0\n"
"model \"sprites/s_bfg2.sp2\" framestart=0 frameend=4 alpha=0.3 transparent fullbright noshadow\n"
"}\n"
;
#endif

View file

@ -503,20 +503,6 @@ struct texture_s *R_TextureAnimation_Q2 (struct texture_s *base); //mostly depre
void RQ_Init(void);
void RQ_Shutdown(void);
void CLQ2_EntityEvent(entity_state_t *es);
void CLQ2_TeleporterParticles(entity_state_t *es);
void CLQ2_IonripperTrail(vec3_t oldorg, vec3_t neworg);
void CLQ2_TrackerTrail(vec3_t oldorg, vec3_t neworg, int flags);
void CLQ2_Tracker_Shell(vec3_t org);
void CLQ2_TagTrail(vec3_t oldorg, vec3_t neworg, int flags);
void CLQ2_FlagTrail(vec3_t oldorg, vec3_t neworg, int flags);
void CLQ2_TrapParticles(entity_t *ent);
void CLQ2_BfgParticles(entity_t *ent);
struct q2centity_s;
void CLQ2_FlyEffect(struct q2centity_s *ent, vec3_t org);
void CLQ2_DiminishingTrail(vec3_t oldorg, vec3_t neworg, struct q2centity_s *ent, unsigned int effects);
void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg);
void WritePCXfile (const char *filename, enum fs_relative fsroot, qbyte *data, int width, int height, int rowbytes, qbyte *palette, qboolean upload); //data is 8bit.
qbyte *ReadPCXFile(qbyte *buf, int length, int *width, int *height);
qbyte *ReadTargaFile(qbyte *buf, int length, int *width, int *height, qboolean *hasalpha, int asgrey);

View file

@ -249,7 +249,7 @@ cvar_t vid_width = CVARFD ("vid_width", "0",
CVAR_ARCHIVE | CVAR_RENDERERLATCH, "The screen width to attempt to use, in physical pixels. 0 means use desktop resolution.");
cvar_t r_stereo_separation = CVARD("r_stereo_separation", "4", "How far your eyes are apart, in quake units. A non-zero value will enable stereoscoping rendering. You might need some of them retro 3d glasses. Hardware support is recommended, see r_stereo_context.");
cvar_t r_stereo_method = CVARD("r_stereo_method", "0", "Value 0 = Off.\nValue 1 = Attempt hardware acceleration. Requires vid_restart.\nValue 2 = red/cyan.\nValue 3 = red/blue.\nValue 4=red/green.\nValue 5=eye strain.");
cvar_t r_stereo_method = CVARFD("r_stereo_method", "0", CVAR_ARCHIVE, "Value 0 = Off.\nValue 1 = Attempt hardware acceleration. Requires vid_restart.\nValue 2 = red/cyan.\nValue 3 = red/blue.\nValue 4=red/green.\nValue 5=eye strain.");
extern cvar_t r_dodgytgafiles;
extern cvar_t r_dodgypcxfiles;

View file

@ -457,7 +457,7 @@ void Sbar_ExecuteLayoutString (char *s)
Draw_FunString (x+32, y+16, va("Ping: %i", ping));
Draw_FunString (x+32, y+24, va("Time: %i", time));
p = R2D_SafeCachePic(va("players/%s_i.pcx", cl.players[value].qwskin->name));
p = R2D_SafeCachePic(va("players/%s_i.pcx", Info_ValueForKey(cl.players[value].userinfo, "skin")));
if (!p || !R_GetShaderSizes(p, NULL, NULL, false)) //display a default if the icon couldn't be found.
p = R2D_SafeCachePic("players/male/grunt_i.pcx");
R2D_ScalePic (x, y, 32, 32, p);
@ -2174,7 +2174,7 @@ void Sbar_DrawScoreboard (void)
if (cl.players[t].statsf[STAT_HEALTH] <= 0)
deadcount++;
}
else if (cl.playerview[pnum].statsf[STAT_HEALTH] <= 0)
else if (!cl.spectator && cl.playerview[pnum].statsf[STAT_HEALTH] <= 0)
deadcount++;
}
@ -3003,6 +3003,7 @@ void Sbar_TeamOverlay (void)
// Electro's scoreboard eyecandy: Draw the title row background
R2D_ImagePaletteColour (1, scr_scoreboard_fillalpha.value);
R2D_FillBlock(startx - 2, y, rank_width - 3, 9);
R2D_ImageColours (1,1,1,1);
}
#define COLUMN(title, cwidth, code) Draw_FunString(x, y, title), x+=cwidth + 8;

View file

@ -100,7 +100,7 @@ cvar_t v_viewheight = SCVAR("v_viewheight", "0");
cvar_t v_projectionmode = SCVAR("v_projectionmode", "0");
cvar_t scr_autoid = CVARD("scr_autoid", "1", "Display nametags above all players while spectating.");
cvar_t scr_autoid_team = CVARD("scr_autoid_team", "1", "Display nametags above team members (regardless of occlusion).");
cvar_t scr_autoid_team = CVARD("scr_autoid_team", "1", "Display nametags above team members. 0: off. 1: display with half-alpha if occluded. 2: hide when occluded.");
cvar_t scr_autoid_health = CVARD("scr_autoid_health", "1", "Display health as part of nametags (when known).");
cvar_t scr_autoid_armour = CVARD("scr_autoid_armor", "1", "Display armour as part of nametags (when known).");
cvar_t scr_autoid_weapon = CVARD("scr_autoid_weapon", "1", "Display the player's best weapon as part of their nametag (when known).");
@ -1631,6 +1631,8 @@ static void SCR_DrawAutoID(vec3_t org, player_info_t *pl, qboolean isteam)
textflags = scr_autoid_enemycolour.ival << CON_FGSHIFT;
if (obscured)
{
if (scr_autoid_team.ival == 2)
return;
textflags |= CON_HALFALPHA;
alpha = 0.25;
}
@ -1769,6 +1771,8 @@ void R_DrawNameTags(void)
if (r_projection.ival) //we don't actually know how to transform the points unless the projection is coded in advance. and it isn't.
return;
if (cls.protocol == CP_QUAKE2)
return; //FIXME: q2 has its own ent logic, which messes stuff up here.
if (r_showfields.ival && cls.allow_cheats)
{
@ -1805,7 +1809,10 @@ void R_DrawNameTags(void)
state = &pak->entities[i];
mod = cl.model_precache[state->modelindex];
VectorInterpolate(mod->mins, 0.5, mod->maxs, org);
if (mod && mod->loadstate == MLS_LOADED)
VectorInterpolate(mod->mins, 0.5, mod->maxs, org);
else
VectorClear(org);
VectorAdd(org, state->origin, org);
if (Matrix4x4_CM_Project(org, screenspace, r_refdef.viewangles, r_refdef.vieworg, r_refdef.fov_x, r_refdef.fov_y))
{

View file

@ -616,6 +616,15 @@ void Cmd_Exec_f (void)
else
Q_strncpyz(name, Cmd_Argv(1), sizeof(name));
if (!strncmp(name, "../", 3) || !strncmp(name, "..\\", 3) || !strncmp(name, "./", 2) || !strncmp(name, ".\\", 2))
{ //filesystem will correctly block this (and more), but it does look dodgy when servers try doing this dodgy shit anyway.
if (Cmd_IsInsecure())
Con_TPrintf ("exec: %s is an invalid path (from server)\n", name);
else
Con_TPrintf ("exec: %s is an invalid path\n", name);
return;
}
if (!FS_FLocateFile(name, FSLF_IFFOUND, &loc) && !FS_FLocateFile(va("%s.cfg", name), FSLF_IFFOUND, &loc))
{
Con_TPrintf ("couldn't exec %s\n", name);

View file

@ -73,6 +73,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#endif
/*
glibc SUCKS. 64bit glibc is depending upon glibc 2.14 because of some implementation-defined copy direction change that breaks flash.
or something.
anyway, the actual interface is the same. the old version might be slower, but when updating glibc generally results in also installing systemd, requiring the new version is NOT an option.
*/
#if defined(__GNUC__) && defined(__LP64__)
#include <features.h> /* for glibc version */
#if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 14)
__asm__(".symver oldmemcpy,memcpy@GLIBC_2.2.5");
__attribute__ ((visibility ("hidden"))) void *memcpy(void *__restrict dst, const void *__restrict src, size_t len)
{
return oldmemcpy(dst,src,len);
}
#endif
#endif
/*end glibc workaround*/
#define NUM_SAFE_ARGVS 6
usercmd_t nullcmd; // guarenteed to be zero

View file

@ -1724,7 +1724,7 @@ void FTENET_Loop_Close(ftenet_generic_connection_t *con)
Z_Free(con);
}
static ftenet_generic_connection_t *FTENET_Loop_EstablishConnection(qboolean isserver, const char *address)
static ftenet_generic_connection_t *FTENET_Loop_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
ftenet_generic_connection_t *newcon;
int sock;
@ -1764,22 +1764,22 @@ ftenet_connections_t *FTENET_CreateCollection(qboolean listen)
col->islisten = listen;
return col;
}
static ftenet_generic_connection_t *FTENET_Loop_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_UDP4_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TLS4Connect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TLS6Connect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_Loop_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_UDP4_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_TLS4Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
static ftenet_generic_connection_t *FTENET_TLS6Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
#ifdef USEIPX
static ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
#endif
#ifdef HAVE_WEBSOCKCL
static ftenet_generic_connection_t *FTENET_WebSocket_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_WebSocket_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
#endif
static ftenet_generic_connection_t *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
#ifdef HAVE_NATPMP
static ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address, netadr_t adr);
#endif
#ifdef HAVE_NATPMP
@ -2015,12 +2015,10 @@ void FTENET_NATPMP_Close(struct ftenet_generic_connection_s *con)
Z_Free(con);
}
//qboolean Net_OpenUDPPort(char *privateip, int privateport, char *publicip, size_t publiciplen, int *publicport);
ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address, netadr_t pmpadr)
{
pmpcon_t *pmp;
netadr_t pmpadr;
NET_PortToAdr(NA_IP, address, &pmpadr);
if (pmpadr.type == NA_NATPMP)
pmpadr.type = NA_IP;
if (pmpadr.type != NA_IP)
@ -2045,7 +2043,7 @@ ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver
}
#endif
qboolean FTENET_AddToCollection_Ptr(ftenet_connections_t *col, const char *name, const char *address, ftenet_generic_connection_t *(*establish)(qboolean isserver, const char *address), qboolean islisten)
static qboolean FTENET_AddToCollection_Ptr(ftenet_connections_t *col, const char *name, ftenet_generic_connection_t *(*establish)(qboolean isserver, const char *address, netadr_t adr), qboolean islisten, const char *address, netadr_t *adr)
{
int count = 0;
int i;
@ -2060,10 +2058,10 @@ qboolean FTENET_AddToCollection_Ptr(ftenet_connections_t *col, const char *name,
if (col->conn[i])
if (col->conn[i]->name && !strcmp(col->conn[i]->name, name))
{
if (address && *address)
if (adr && adr->type != NA_INVALID && islisten)
if (col->conn[i]->ChangeLocalAddress)
{
if (col->conn[i]->ChangeLocalAddress(col->conn[i], address))
if (col->conn[i]->ChangeLocalAddress(col->conn[i], adr))
return true;
}
@ -2073,22 +2071,18 @@ qboolean FTENET_AddToCollection_Ptr(ftenet_connections_t *col, const char *name,
}
}
if (address && *address && establish)
if (adr && establish)
{
for (i = 0; i < MAX_CONNECTIONS; i++)
{
if (!col->conn[i])
{
address = COM_Parse(address);
col->conn[i] = establish(islisten, com_token);
col->conn[i] = establish(islisten, address, *adr);
if (!col->conn[i])
break;
if (name)
Q_strncpyz(col->conn[i]->name, name, sizeof(col->conn[i]->name));
count++;
if (address && *address)
continue;
break;
}
}
@ -2097,7 +2091,7 @@ qboolean FTENET_AddToCollection_Ptr(ftenet_connections_t *col, const char *name,
}
qboolean FTENET_AddToCollection(ftenet_connections_t *col, const char *name, const char *address, netadrtype_t addrtype, qboolean islisten)
{
ftenet_generic_connection_t *(*establish)(qboolean isserver, const char *address) = NULL;
ftenet_generic_connection_t *(*establish)(qboolean isserver, const char *address, netadr_t adr) = NULL;
netadr_t adr;
//resolve the address to something sane so we can determine the address type and thus the connection type to use
@ -2148,7 +2142,7 @@ qboolean FTENET_AddToCollection(ftenet_connections_t *col, const char *name, con
#endif
}
return FTENET_AddToCollection_Ptr(col, name, address, establish, islisten);
return FTENET_AddToCollection_Ptr(col, name, establish, islisten, address, &adr);
}
void FTENET_CloseCollection(ftenet_connections_t *col)
@ -2611,7 +2605,16 @@ qboolean NET_PortToAdr (int adrfamily, const char *s, netadr_t *a)
return false;
}
ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, int protocol, qboolean isserver, const char *address)
/*just here to prevent the client from spamming new sockets, which can be a problem with certain q2 servers*/
qboolean FTENET_Generic_ChangeLocalAddress(struct ftenet_generic_connection_s *con, netadr_t *adr)
{
if (adr->type == con->addrtype[0] || adr->type == con->addrtype[1])
if (adr->port == 0)
return true; //they want to use addr_any. it doesn't matter one jot which port we're currently listening on then.
return false;
}
ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, int protocol, qboolean isserver, const char *address, netadr_t adr)
{
#ifndef HAVE_PACKET
return NULL;
@ -2622,7 +2625,6 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
unsigned long _true = true;
SOCKET newsocket = INVALID_SOCKET;
int temp;
netadr_t adr;
struct sockaddr_qstorage qs;
int family;
int port;
@ -2630,10 +2632,10 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
int bufsz;
qboolean hybrid = false;
if (!NET_PortToAdr(adrfamily, address, &adr))
if (adr.type != adrfamily)
{
Con_Printf("unable to resolve local address %s\n", address);
if (adr.type == NA_INVALID)
Con_Printf("unable to resolve local address %s\n", address);
return NULL; //couldn't resolve the name
}
temp = NetadrToSockadr(&adr, &qs);
@ -2735,6 +2737,7 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
newcon->GetPacket = FTENET_Generic_GetPacket;
newcon->SendPacket = FTENET_Generic_SendPacket;
newcon->Close = FTENET_Generic_Close;
newcon->ChangeLocalAddress = FTENET_Generic_ChangeLocalAddress;
newcon->islisten = isserver;
if (hybrid)
@ -2761,21 +2764,21 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
}
#ifdef IPPROTO_IPV6
ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_Generic_EstablishConnection(NA_IPV6, IPPROTO_UDP, isserver, address);
return FTENET_Generic_EstablishConnection(NA_IPV6, IPPROTO_UDP, isserver, address, adr);
}
#endif
#ifdef HAVE_IPV4
ftenet_generic_connection_t *FTENET_UDP4_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_UDP4_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_Generic_EstablishConnection(NA_IP, IPPROTO_UDP, isserver, address);
return FTENET_Generic_EstablishConnection(NA_IP, IPPROTO_UDP, isserver, address, adr);
}
#endif
#ifdef USEIPX
ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_Generic_EstablishConnection(NA_IPX, NSPROTO_IPX, isserver, address);
return FTENET_Generic_EstablishConnection(NA_IPX, NSPROTO_IPX, isserver, address, adr);
}
#endif
@ -3829,21 +3832,21 @@ ftenet_generic_connection_t *FTENET_TCPConnect_EstablishConnection(int affamily,
}
#ifdef IPPROTO_IPV6
ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_TCPConnect_EstablishConnection(NA_TCPV6, isserver, address);
}
ftenet_generic_connection_t *FTENET_TLS6Connect_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_TLS6Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_TCPConnect_EstablishConnection(NA_TLSV6, isserver, address);
}
#endif
ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_TCPConnect_EstablishConnection(NA_TCP, isserver, address);
}
ftenet_generic_connection_t *FTENET_TLS4Connect_EstablishConnection(qboolean isserver, const char *address)
ftenet_generic_connection_t *FTENET_TLS4Connect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
return FTENET_TCPConnect_EstablishConnection(NA_TLSV4, isserver, address);
}
@ -4397,11 +4400,10 @@ void FTENET_IRCConnect_Close(ftenet_generic_connection_t *gcon)
FTENET_Generic_Close(gcon);
}
struct ftenet_generic_connection_s *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address)
struct ftenet_generic_connection_s *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{
//this is written to support either ipv4 or ipv6, depending on the remote addr.
ftenet_ircconnect_connection_t *newcon;
netadr_t adr;
if (!NET_StringToAdr(address, 6667, &adr))
return NULL; //couldn't resolve the name

View file

@ -254,7 +254,7 @@ typedef struct ftenet_generic_connection_s {
char name[MAX_QPATH];
int (*GetLocalAddresses)(struct ftenet_generic_connection_s *con, unsigned int *adrflags, netadr_t *addresses, int maxaddresses);
qboolean (*ChangeLocalAddress)(struct ftenet_generic_connection_s *con, const char *newaddress);
qboolean (*ChangeLocalAddress)(struct ftenet_generic_connection_s *con, netadr_t *newadr);
qboolean (*GetPacket)(struct ftenet_generic_connection_s *con);
qboolean (*SendPacket)(struct ftenet_generic_connection_s *con, int length, const void *data, netadr_t *to);
void (*Close)(struct ftenet_generic_connection_s *con);

View file

@ -40,21 +40,132 @@ extern int
ptqw_blood,
ptqw_lightningblood,
#ifdef Q2CLIENT
ptq2_blood,
rtq2_railtrail,
rtq2_blastertrail,
ptq2_blasterparticles,
rtq2_bubbletrail,
rtq2_gib,
rtq2_rocket,
rtq2_grenade,
#endif
rtqw_railtrail, //common to zquake/fuhquake/fte
ptfte_bullet,
ptfte_superbullet;
#ifdef Q2CLIENT
/*WARNING: must match cl_tent.c*/
typedef enum
{
/*MUST start with standard q2 te effects*/
Q2TE_GUNSHOT = 0, //0
Q2TE_BLOOD,
Q2TE_BLASTER,
Q2TE_RAILTRAIL,
Q2TE_SHOTGUN,
Q2TE_EXPLOSION1,
Q2TE_EXPLOSION2,
Q2TE_ROCKET_EXPLOSION,
Q2TE_GRENADE_EXPLOSION,
Q2TE_SPARKS,
Q2TE_SPLASH, //10
Q2TE_BUBBLETRAIL,
Q2TE_SCREEN_SPARKS,
Q2TE_SHIELD_SPARKS,
Q2TE_BULLET_SPARKS,
Q2TE_LASER_SPARKS,
Q2TE_PARASITE_ATTACK,
Q2TE_ROCKET_EXPLOSION_WATER,
Q2TE_GRENADE_EXPLOSION_WATER,
Q2TE_MEDIC_CABLE_ATTACK,
Q2TE_BFG_EXPLOSION, //20
Q2TE_BFG_BIGEXPLOSION,
Q2TE_BOSSTPORT, // used as '22' in a map, so DON'T RENUMBER!!!
Q2TE_BFG_LASER,
Q2TE_GRAPPLE_CABLE,
Q2TE_WELDING_SPARKS,
Q2TE_GREENBLOOD,
Q2TE_BLUEHYPERBLASTER,
Q2TE_PLASMA_EXPLOSION,
Q2TE_TUNNEL_SPARKS,
//ROGUE
Q2TE_BLASTER2, //30
Q2TE_RAILTRAIL2,
Q2TE_FLAME,
Q2TE_LIGHTNING,
Q2TE_DEBUGTRAIL,
Q2TE_PLAIN_EXPLOSION,
Q2TE_FLASHLIGHT,
Q2TE_FORCEWALL,
Q2TE_HEATBEAM,
Q2TE_MONSTER_HEATBEAM,
Q2TE_STEAM, //40
Q2TE_BUBBLETRAIL2,
Q2TE_MOREBLOOD,
Q2TE_HEATBEAM_SPARKS,
Q2TE_HEATBEAM_STEAM,
Q2TE_CHAINFIST_SMOKE,
Q2TE_ELECTRIC_SPARKS,
Q2TE_TRACKER_EXPLOSION,
Q2TE_TELEPORT_EFFECT,
Q2TE_DBALL_GOAL,
Q2TE_WIDOWBEAMOUT, //50
Q2TE_NUKEBLAST,
Q2TE_WIDOWSPLASH,
Q2TE_EXPLOSION1_BIG,
Q2TE_EXPLOSION1_NP,
Q2TE_FLECHETTE,
//ROGUE
//CODERED
CRTE_LEADERBLASTER, //56
CRTE_BLASTER_MUZZLEFLASH,
CRTE_BLUE_MUZZLEFLASH,
CRTE_SMART_MUZZLEFLASH,
CRTE_LEADERFIELD, //60
CRTE_DEATHFIELD,
CRTE_BLASTERBEAM,
CRTE_STAIN,
CRTE_FIRE,
CRTE_CABLEGUT,
CRTE_SMOKE,
//CODERED
#define Q2TE_MAX CRTE_SMOKE
/*splashes are somewhat special, but are dynamically indexed*/
Q2SPLASH_UNKNOWN, //0
Q2SPLASH_SPARKS, //1
Q2SPLASH_BLUE_WATER, //2
Q2SPLASH_BROWN_WATER, //3
Q2SPLASH_SLIME, //4
Q2SPLASH_LAVA, //5
Q2SPLASH_BLOOD, //6
#define Q2SPLASH_MAX Q2SPLASH_BLOOD
/*free form*/
/*WARNING: must match cl_tent.c*/
Q2RT_BLASTERTRAIL,
Q2RT_BLASTERTRAIL2,
Q2RT_GIB,
Q2RT_GREENGIB,
Q2RT_ROCKET,
Q2RT_GRENADE,
Q2RT_TRAP,
Q2RT_FLAG1,
Q2RT_FLAG2,
Q2RT_TAGTRAIL,
Q2RT_TRACKER,
Q2RT_IONRIPPER,
Q2RT_PLASMA,
Q2PT_BFGPARTICLES,
Q2PT_FLIES,
Q2PT_TRAP,
Q2PT_TRACKERSHELL,
Q2PT_RESPAWN,
Q2PT_PLAYER_TELEPORT,
Q2PT_FOOTSTEP
} q2particleeffects_t;
extern int pt_q2[];
#endif
struct beamseg_s;
typedef struct trailstate_s {

View file

@ -106,6 +106,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PROTOCOL_INFO_GUID (('G'<<0) + ('U'<<8) + ('I'<<16) + ('D' << 24)) //globally 'unique' client id info.
#define PROTOCOL_VERSION_QW 28
#define PROTOCOL_VERSION_Q2_DEMO_MIN 26
#define PROTOCOL_VERSION_Q2_MIN 31
#define PROTOCOL_VERSION_Q2 34

View file

@ -1118,7 +1118,7 @@ qintptr_t VARGS VM_Call(vm_t *vm, qintptr_t instruction, ...)
arg[3]=va_arg(argptr, qintptr_t);
arg[4]=va_arg(argptr, qintptr_t);
arg[5]=va_arg(argptr, qintptr_t);
arg[6]=va_arg(argptr, qintptr_t);
arg[6]=va_arg(argptr, qintptr_t);
arg[7]=va_arg(argptr, qintptr_t);
va_end(argptr);

View file

@ -298,6 +298,7 @@ typedef struct heightmap_s
char groundshadername[MAX_QPATH];
char defaultwatershader[MAX_QPATH]; //typically the name of the ocean or whatever.
unsigned int culldistance;
qboolean forcedefault;
float defaultwaterheight;
float defaultgroundheight;
char defaultgroundtexture[MAX_QPATH];
@ -2016,7 +2017,7 @@ static hmsection_t *Terr_GetSection(heightmap_t *hm, int x, int y, unsigned int
COM_MainThreadFlush(); //make sure any associated lightmaps also got read+handled
//if it failed, generate a default (for editing)
if (section->loadstate == TSLS_FAILED && (flags & TGS_DEFAULTONFAIL))
if (section->loadstate == TSLS_FAILED && ((flags & TGS_DEFAULTONFAIL) || hm->forcedefault))
{
section->flags = (section->flags & ~TSF_EDITED);
section->loadstate = TSLS_LOADED;
@ -3824,10 +3825,9 @@ static void Heightmap_Trace_Square(hmtrace_t *tr, int tx, int ty)
sx = tx/(SECTHEIGHTSIZE-1);
sy = ty/(SECTHEIGHTSIZE-1);
if (sx < tr->hm->firstsegx || sx >= tr->hm->maxsegx)
return;//s = NULL;
else if (sy < tr->hm->firstsegy || sy >= tr->hm->maxsegy)
return;//s = NULL;
if (sx < tr->hm->firstsegx || sx >= tr->hm->maxsegx ||
sy < tr->hm->firstsegy || sy >= tr->hm->maxsegy)
s = NULL;
else
s = Terr_GetSection(tr->hm, sx, sy, TGS_TRYLOAD|TGS_WAITLOAD|TGS_ANYSTATE);
@ -5169,6 +5169,7 @@ void Terr_ParseEntityLump(char *data, heightmap_t *heightmap)
heightmap->sectionsize = 1024;
heightmap->mode = HMM_TERRAIN;
heightmap->culldistance = 4096*4096;
heightmap->forcedefault = false;
heightmap->defaultgroundheight = 0;
heightmap->defaultwaterheight = 0;
@ -5198,6 +5199,8 @@ void Terr_ParseEntityLump(char *data, heightmap_t *heightmap)
heightmap->maxsegx = atoi(value);
else if (!strcmp("maxysegment", key))
heightmap->maxsegy = atoi(value);
else if (!strcmp("forcedefault", key))
heightmap->forcedefault = !!atoi(value);
else if (!strcmp("defaultwaterheight", key))
heightmap->defaultwaterheight = atof(value);
else if (!strcmp("defaultgroundheight", key))

View file

@ -1674,7 +1674,12 @@ void Mod_LoadLighting (model_t *loadmodel, qbyte *mod_base, lump_t *l, qboolean
if (interleaveddeluxe)
samples >>= 1;
if (!samples)
return;
{
litdata = Q1BSPX_FindLump("RGBLIGHTING", &samples);
samples /= 3;
if (!samples)
return;
}
#ifndef SERVERONLY
if (!litdata && r_loadlits.value)
@ -1941,7 +1946,7 @@ void Mod_LoadLighting (model_t *loadmodel, qbyte *mod_base, lump_t *l, qboolean
}
#endif
if (!overrides->shifts)
if (overrides && !overrides->shifts)
{
int size;
overrides->shifts = Q1BSPX_FindLump("LMSHIFT", &size);

View file

@ -135,10 +135,10 @@ void GLSCR_UpdateScreen (void)
{
M_Draw(0);
V_UpdatePalette (false);
R2D_BrightenScreen();
#if defined(_WIN32) && defined(GLQUAKE)
Media_RecordFrame();
#endif
R2D_BrightenScreen();
if (R2D_Flush)
R2D_Flush();
GL_Set2D (false);

View file

@ -1,3 +1,6 @@
//model "name" framestart= frames= framerate= alpha= trail= orient additive transparent fullbright shadow noshadow
r_part namespace q2part
r_part pe_default
@ -30,6 +33,10 @@ r_part te_splashsparks
scalefactor 0.8
colorindex 0xe0
}
r_part te_splashunknown
{
assoc te_splashsparks
}
r_part teq2_sparks
{
texture "classicparticle"
@ -122,11 +129,51 @@ r_part te_splashblood
}
//teq2_shield_sparks
//teq2_screen_sparks
//teq2_laser_sparks
r_part teq2_shield_sparks
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 40
colorindex 0xb0
scale 1
alpha 1
die 0.3 0.8
randomvel 20
orgadd 0 31
spawnorg 4
gravity 40
scalefactor 0.8
}
r_part teq2_screen_sparks
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 40
colorindex 0xd0
scale 1
alpha 1
die 0.3 0.8
randomvel 20
orgadd 0 31
spawnorg 4
gravity 40
scalefactor 0.8
}
r_part teq2_bullet_sparks
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 6
colorindex 0xe0
scale 1
alpha 1
die 0.3 0.8
randomvel 20
orgadd 0 31
spawnorg 4
gravity 40
scalefactor 0.8
}
r_part q2_smoke
{
@ -224,6 +271,28 @@ r_part teq2_blaster
lightshadows 0
sound "weapons/lashit.wav" 1 1 0 0
}
r_part teq2_blaster2
{ //green version.
texture "classicparticle"
tcoords 0 0 16 16 32
count 60
scale 1
alpha 1
die 0.3 0.8
randomvel 40
orgadd 0 15
veladd 30
spawnorg 4
gravity 40
scalefactor 0.8
colorindex 0xd0 7
assoc q2_blasterpuff /*the model*/
lightradius 150
lightradiusfade 400
lightrgb 0.05 1.0 0.05
lightshadows 0
sound "weapons/lashit.wav" 1 1 0 0
}
r_part TR_BLASTERTRAIL
{
texture "classicparticle"
@ -238,6 +307,21 @@ r_part TR_BLASTERTRAIL
colorindex 0xe0
}
//green version
r_part TR_BLASTERTRAIL2
{
texture "classicparticle"
tcoords 0 0 16 16 32
scale 0.5
alpha 1
scalefactor 0.8
step 5
spawnorg 1
randomvel 5
die 0.3 0.5
colorindex 0xd0
}
r_part teq2_bubbletrail
{
@ -254,7 +338,7 @@ r_part teq2_bubbletrail
colorindex 4 7
}
r_part TR_RAILTRAIL
r_part TEQ2_RAILTRAIL
{
/*blue spiral*/
texture "classicparticle"
@ -271,7 +355,7 @@ r_part TR_RAILTRAIL
sound "weapons/railgf1a.wav" 1 1 0 0
}
r_part +TR_RAILTRAIL
r_part +TEQ2_RAILTRAIL
{
/*grey filler*/
texture "classicparticle"
@ -285,3 +369,305 @@ r_part +TR_RAILTRAIL
die 0.6 0.8
colorindex 0 15
}
//regular explosion particles
r_part std_explosion_particles
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 256
scale 4
alpha 0.4
die 1 0.625
spawnmode ball
spawnorg 16
spawnvel 192
scalefactor 0.8
gravity 40
colorindex 0xe0 7
}
r_part teq2_explosion1_big
{
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/rocklx1a.wav" 1 1 0 0
model "models/objects/r_explode2/tris.md2" framestart=0 frames=15 skin=-1 transparent fullbright noshadow
model "models/objects/r_explode2/tris.md2" framestart=15 frames=15 skin=-1 transparent fullbright noshadow
}
r_part teq2_explosion1_np
{
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/rocklx1a.wav" 1 1 0 0
model "models/objects/r_explode/tris.md2" framestart=0 frames=15 skin=-1 fullbright noshadow
model "models/objects/r_explode/tris.md2" framestart=15 frames=150 skin=-1 fullbright noshadow
}
r_part teq2_explosion1
{
assoc teq2_rocket_explosion
}
r_part teq2_rocket_explosion
{
assoc std_explosion_particles
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/rocklx1a.wav" 1 1 0 0
model "models/objects/r_explode/tris.md2" framestart=0 frames=15 skin=-1 fullbright noshadow
model "models/objects/r_explode/tris.md2" framestart=15 frames=15 skin=-1 fullbright noshadow
}
r_part teq2_rocket_explosion_water
{
assoc std_explosion_particles
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/xpld_wat.wav" 1 1 0 0
model "models/objects/r_explode/tris.md2" framestart=0 frames=15 skin=-1 fullbright noshadow
model "models/objects/r_explode/tris.md2" framestart=15 frames=15 skin=-1 fullbright noshadow
}
r_part teq2_explosion2
{
assoc teq2_grenade_explosion
}
r_part teq2_grenade_explosion
{
assoc std_explosion_particles
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/grenlx1a.wav" 1 1 0 0
model "models/objects/r_explode/tris.md2" framestart=30 frames=19 skin=-1 fullbright noshadow
}
r_part teq2_grenade_explosion_water
{
assoc std_explosion_particles
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 1.0 0.5 0.4
lightrgbfade 0.36 0.19 0.19
sound "weapons/xpld_wat.wav" 1 1 0 0
model "models/objects/r_explode/tris.md2" framestart=30 frames=19 skin=-1 fullbright noshadow
}
r_part trq2_rocket
{
texture "particles/quake"
step 8
scale 4
die 1.0 1.2
colorindex 0xdc 3
spawnorg 1
spawnvel 20
gravity 40
assoc trq2_grenade
}
r_part trq2_grenade
{
texture "particles/quake"
step 3
scale 4
die 1.0 1.2
colorindex 0x4 7
spawnorg 1
spawnvel 5
gravity -20
}
r_part trq2_gib
{
assoc tr_gib
}
//FIXME: implement
r_part trq2_greengib
{
assoc tr_gib
}
r_part TR_PLASMA
{
assoc TR_BLASTERTRAIL
}
//FIXME: add particles
r_part tr_ionripper
{
lighttime 0
lightradius 100
lightrgb 1.0 0.5 0.5
}
//FIXME: add particles
r_part tr_tracker
{
lighttime 0
lightradius 200
lightrgb -1.0 -1.0 -1.0
}
//FIXME: add particles
r_part tr_tagtrail
{
lighttime 0
lightradius 225
lightrgb 1.0 1.0 0.0
}
//flags do NOT use coronas, because it obscures the holding player's skin colour
r_part tr_flag1
{
texture "classicparticle"
tcoords 0 0 16 16 32
step 5
scale 1
alpha 1
die 1.0 0.8
spawnorg 16
spawnvel 5
veladd 32
scalefactor 0
colorindex 0xf2
lighttime 0
lightcorona 0.0 0.0
lightradius 225
lightrgb 1.0 0.25 0.25
}
r_part tr_flag2
{
texture "classicparticle"
tcoords 0 0 16 16 32
step 5
scale 1
alpha 1
die 1.0 0.8
spawnorg 16
spawnvel 5
veladd 32
scalefactor 0
colorindex 0x73
lighttime 0
lightcorona 0.0 0.0
lightradius 225
lightrgb 0.25 0.25 1.0
}
//FIXME: add particles
r_part tr_trap
{
lighttime 0
lightradius 100 200
lightrgb 1.0 0.8 0.25
}
r_part EF_FLIES
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 1
scale 0.5
alpha 1
die 0
spawnmode syncfield 16 64
spawnorg 0
scalefactor 0
colorindex 0
}
r_part EF_BFGPARTICLES
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 0 0 162
scale 0.5
alpha 1
die 0
spawnmode syncfield 16 64
spawnorg 0
scalefactor 0
colorindex 0xd0 7
}
r_part ev_item_respawn
{
sound "items/respawn1.wav" 1 2 0 0 1
texture "classicparticle"
tcoords 0 0 16 16 32
count 64
scale 1
alpha 1
die 1.3 1
randomvel 8
orgadd 0 31
spawnorg 8
gravity 8
scalefactor 0.8
colorindex 0xd4 3
}
r_part ev_player_teleport
{
sound "misc/tele1.wav" 1 2 0 0 1
texture "classicparticle"
tcoords 0 0 16 16 32
count 96
scale 1
alpha 1
die 0.3 0.4
randomvel 8
orgadd 0 31
spawnmode telebox 0 4
spawnorg 32 48
gravity 40
scalefactor 0.8
colorindex 0x07 7
}
r_part ev_footstep
{
sound "player/step1.wav" 1 1 0 0 1
sound "player/step2.wav" 1 1 0 0 1
sound "player/step3.wav" 1 1 0 0 1
sound "player/step4.wav" 1 1 0 0 1
}
//central explosion
r_part teq2_bfg_bigexplosion
{
texture "classicparticle"
tcoords 0 0 16 16 32
count 256
scale 1
alpha 1
die 0.625 1
spawnmode ball
spawnorg 16
spawnvel 192
scalefactor 0.8
gravity 40
colorindex 0xd0 7
}
//splashed onto an entity
r_part teq2_bfg_explosion
{
lighttime 0.5
lightradius 350
lightradiusfade 300
lightrgb 0.0 1.0 0.0
lightrgbfade 0.0 0.0 0.0
sound "weapons/xpld_wat.wav" 1 1 0 0
model "sprites/s_bfg2.sp2" framestart=0 frameend=4 alpha=0.3 transparent fullbright noshadow
}

View file

@ -10936,7 +10936,7 @@ QCC_function_t *QCC_PR_ParseImmediateStatements (QCC_def_t *def, QCC_type_t *typ
{
if (!*pr_parm_names[u])
QCC_PR_ParseError(ERR_PARAMWITHNONAME, "Parameter is not named");
parm = QCC_PR_GetSRef (type->params[u].type, pr_parm_names[u], pr_scope, true, 0, false);
parm = QCC_PR_GetSRef (type->params[u].type, pr_parm_names[u], pr_scope, 2, 0, false);
parm.sym->used = true; //make sure system parameters get seen by the engine, even if the names are stripped..
parm.sym->referenced = true;
QCC_FreeTemp(parm);
@ -10948,7 +10948,7 @@ QCC_function_t *QCC_PR_ParseImmediateStatements (QCC_def_t *def, QCC_type_t *typ
{
if (!*pr_parm_names[u])
QCC_PR_ParseError(ERR_PARAMWITHNONAME, "Parameter is not named");
parm = QCC_PR_GetSRef (type->params[u].type, pr_parm_names[u], pr_scope, true, 0, false);
parm = QCC_PR_GetSRef (type->params[u].type, pr_parm_names[u], pr_scope, 2, 0, false);
parm.sym->referenced = true;
if (!extra_parms[u - MAX_PARMS].sym)
@ -11767,10 +11767,13 @@ QCC_def_t *QCC_PR_DummyDef(QCC_type_t *type, char *name, QCC_function_t *scope,
PR_GetDef
If type is NULL, it will match any type
If allocate is true, a new def will be allocated if it can't be found
If arraysize=0, its not an array and has 1 element.
If arraysize>0, its an array and requires array notation
If arraysize<0, its an array with undefined size - GetDef will fail if its not already allocated.
If allocate is 0, will only get the def
If allocate is 1, a new def will be allocated if it can't be found
If allocate is 2, a new def will be allocated, and it'll error if there's a dupe with scope (for ensuring that arguments are created properly)
============
*/
@ -11836,6 +11839,8 @@ QCC_def_t *QCC_PR_GetDef (QCC_type_t *type, char *name, struct QCC_function_s *s
QCC_PR_ParseErrorPrintDef (ERR_TYPEMISMATCHARRAYSIZE, def, "Array sizes for redecleration of %s do not match",name);
if (allocate && scope)
{
if (allocate == 2)
QCC_PR_ParseErrorPrintDef (ERR_TYPEMISMATCHREDEC, def, "Duplicate definition of %s.", name);
QCC_PR_ParseWarning (WARN_DUPLICATEDEFINITION, "%s duplicate definition ignored", name);
QCC_PR_ParsePrintDef(WARN_DUPLICATEDEFINITION, def);
// if (!scope)
@ -11916,6 +11921,8 @@ QCC_def_t *QCC_PR_GetDef (QCC_type_t *type, char *name, struct QCC_function_s *s
QCC_PR_ParseErrorPrintDef(ERR_TYPEMISMATCHARRAYSIZE, def, "Array sizes for redecleration of %s do not match",name);
if (allocate && scope)
{
if (allocate == 2)
QCC_PR_ParseErrorPrintDef (ERR_TYPEMISMATCHREDEC, def, "Duplicate definition of %s.", name);
if (pr_scope)
{ //warn? or would that be pointless?
def = pHash_GetNext(&globalstable, name, def);

View file

@ -3782,31 +3782,32 @@ static LRESULT CALLBACK MainWndProc(HWND hWnd,UINT message,
rootmenu = CreateMenu();
AppendMenu(rootmenu, MF_POPUP, (UINT_PTR)(m = CreateMenu()), "&File");
AppendMenu(m, 0, IDM_OPENNEW, "Open new file ");
AppendMenu(m, 0, IDM_SAVE, "&Save Ctrl+S ");
AppendMenu(m, 0, IDM_RECOMPILE, "&Recompile Ctrl+R ");
// AppendMenu(m, 0, IDM_FIND, "&Find");
AppendMenu(m, 0, IDM_UNDO, "Undo Ctrl+Z");
AppendMenu(m, 0, IDM_REDO, "Redo Ctrl+Y");
AppendMenu(m, 0, IDM_OPENNEW, "Open new file ");
AppendMenu(m, 0, IDM_SAVE, "&Save\tCtrl+S ");
AppendMenu(m, 0, IDM_RECOMPILE, "&Recompile\tCtrl+R ");
// AppendMenu(m, 0, IDM_FIND, "&Find");
AppendMenu(m, 0, IDM_UNDO, "Undo\tCtrl+Z");
AppendMenu(m, 0, IDM_REDO, "Redo\tCtrl+Y");
AppendMenu(rootmenu, MF_POPUP, (UINT_PTR)(m = CreateMenu()), "&Navigation");
AppendMenu(m, 0, IDM_GOTODEF, "Go to definition\tF12");
AppendMenu(m, 0, IDM_OPENDOCU, "Open selected file");
AppendMenu(m, 0, IDM_OUTPUT_WINDOW, "Show Output Window\tF6");
AppendMenu(m, 0, IDM_GOTODEF, "Go to definition\tF12");
AppendMenu(m, 0, IDM_GREP, "Grep for selection\tCtrl+G");
AppendMenu(m, 0, IDM_OPENDOCU, "Open selected file");
AppendMenu(m, 0, IDM_OUTPUT_WINDOW, "Show Output Window\tF6");
AppendMenu(m, (fl_extramargins?MF_CHECKED:MF_UNCHECKED), IDM_SHOWLINENUMBERS, "Show Line Numbers");
AppendMenu(rootmenu, MF_POPUP, (UINT_PTR)(m = windowmenu = CreateMenu()), "&Window");
AppendMenu(m, 0, IDM_CASCADE, "Cascade");
AppendMenu(m, 0, IDM_TILE_HORIZ, "Tile Horizontally");
AppendMenu(m, 0, IDM_TILE_VERT, "Tile Vertically");
AppendMenu(m, 0, IDM_CASCADE, "Cascade");
AppendMenu(m, 0, IDM_TILE_HORIZ, "Tile Horizontally");
AppendMenu(m, 0, IDM_TILE_VERT, "Tile Vertically");
AppendMenu(rootmenu, MF_POPUP, (UINT_PTR)(m = CreateMenu()), "&Debug");
AppendMenu(m, 0, IDM_DEBUG_REBUILD, "Rebuild\tF7");
AppendMenu(m, 0, IDM_DEBUG_SETNEXT, "Set Next Statement\tF8");
AppendMenu(m, 0, IDM_DEBUG_RUN, "Run/Resume\tF5");
AppendMenu(m, 0, IDM_DEBUG_STEPOVER, "Step Over\tF10");
AppendMenu(m, 0, IDM_DEBUG_STEPINTO, "Step Into\tF11");
AppendMenu(m, 0, IDM_DEBUG_STEPOUT, "Step Out\tShift-F11");
AppendMenu(m, 0, IDM_DEBUG_TOGGLEBREAK, "Set Breakpoint\tF9");
AppendMenu(m, 0, IDM_DEBUG_REBUILD, "Rebuild\tF7");
AppendMenu(m, 0, IDM_DEBUG_SETNEXT, "Set Next Statement\tF8");
AppendMenu(m, 0, IDM_DEBUG_RUN, "Run/Resume\tF5");
AppendMenu(m, 0, IDM_DEBUG_STEPOVER, "Step Over\tF10");
AppendMenu(m, 0, IDM_DEBUG_STEPINTO, "Step Into\tF11");
AppendMenu(m, 0, IDM_DEBUG_STEPOUT, "Step Out\tShift-F11");
AppendMenu(m, 0, IDM_DEBUG_TOGGLEBREAK, "Set Breakpoint\tF9");
AppendMenu(rootmenu, MF_POPUP, (UINT_PTR)(m = CreateMenu()), "&Help");
AppendMenu(m, 0, IDM_ABOUT, "About");
AppendMenu(m, 0, IDM_ABOUT, "About");
SetMenu(hWnd, rootmenu);

View file

@ -18,6 +18,9 @@ char enginebinary[MAX_PATH];
char enginebasedir[MAX_PATH];
char enginecommandline[8192];
char *GUIReadFile(const char *fname, void *buffer, int blen, size_t *sz);
int GUIFileSize(const char *fname);
int qccpersisthunk = 1;
int Grep(char *filename, char *string)
{
@ -25,15 +28,29 @@ int Grep(char *filename, char *string)
char *last, *found, *linestart;
int line = 1;
int sz;
int caseinsens = 0;
int szlen = caseinsens?strlen(string)+1:0;
char *buf;
if (!filename)
return foundcount;
sz = QCC_RawFileSize(filename);
sz = GUIFileSize(filename);
if (sz <= 0)
return foundcount;
buf = malloc(sz+1);
buf = malloc(sz+1 + szlen);
buf[sz] = 0;
QCC_ReadFile(filename, buf, sz, NULL);
GUIReadFile(filename, buf, sz, NULL);
if (caseinsens)
{
memcpy(buf+sz+1, string, szlen);
string = buf+sz+1+szlen;
for (found = buf; found < string; found++)
{
if (*found >= 'A' && *found <= 'Z')
*found = *found-'A' + 'a';
}
string = buf+sz+1;
}
linestart = last = found = buf;
while ((found = strstr(found, string)))

View file

@ -823,10 +823,29 @@ void NPP_NQFlush(void)
buffer[1] = TEQW_EXPLOSIONNOSPRITE;
}
break;
case TENQ_BEAM:
requireextension = PEXT_TE_BULLET;
//should translate it to lightning or something for old clients
buffer[1] = TEQW_BEAM;
break;
case TENQ_EXPLOSION2: //happens with rogue.
//bufferlen -= 2; //trim the colour
//buffer[1] = TE_EXPLOSION;
buffer[1] = TEQW_EXPLOSION2;
requireextension = PEXT_TE_BULLET;
if (writedest == &sv.datagram || writedest == &sv.multicast)
{
vec3_t org;
coorddata cd;
memcpy(&cd, &buffer[2+destprim->coordsize*0], destprim->coordsize);
org[0] = MSG_FromCoord(cd, destprim->coordsize);
memcpy(&cd, &buffer[2+destprim->coordsize*1], destprim->coordsize);
org[1] = MSG_FromCoord(cd, destprim->coordsize);
memcpy(&cd, &buffer[2+destprim->coordsize*2], destprim->coordsize);
org[2] = MSG_FromCoord(cd, destprim->coordsize);
buffer[1] = TE_EXPLOSION; //use a generic crappy explosion
SZ_Write(&sv.multicast, buffer, bufferlen-2); //trim the two trailing colour bytes
SV_MulticastProtExt(org, multicasttype, pr_global_struct->dimension_send, 0, requireextension);
}
buffer[1] = TEQW_EXPLOSION2; //TENQ_EXPLOSION2 conflicts with TEQW_BLOOD
break;
}
break;
@ -1128,8 +1147,6 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
switch(data)
{
case TENQ_BEAM:
data = TEQW_BEAM; //QW doesn't do te_beam. Replace with lightning1.
//fallthrough
case TE_LIGHTNING1:
case TE_LIGHTNING2:
case TE_LIGHTNING3:
@ -1171,7 +1188,6 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
ignoreprotocol = true;
break;
case TENQ_EXPLOSION2:
data = TEQW_EXPLOSION2;
protocollen = sizeof(qbyte)*4 + destprim->coordsize*3;
multicastpos=2;
multicasttype=MULTICAST_PHS;

View file

@ -3956,7 +3956,7 @@ void QCBUILTIN PF_precache_vwep_model (pubprogfuncs_t *prinst, struct globalvars
{
if (sv.state != ss_loading)
{
Con_Printf("PF_precache_vwep_model: not spawning\n");
Con_Printf("PF_precache_vwep_model: not spawn-time\n");
G_FLOAT(OFS_RETURN) = 0;
return;
}

View file

@ -2337,7 +2337,15 @@ client_t *SVC_DirectConnect(void)
if (protocol >= SCP_NETQUAKE && protocol < SCP_DARKPLACES6)
{ //NQ protocols lack stuff like protocol extensions.
//its the wild west where nothing is known about the client and everything breaks.
switch(sv_protocol_nq.ival)
if (!strcmp(sv_protocol_nq.string, "fitz"))
protocol = SCP_FITZ666;
else if (!strcmp(sv_protocol_nq.string, "dp6"))
protocol = SCP_DARKPLACES6;
else if (!strcmp(sv_protocol_nq.string, "dp7"))
protocol = SCP_DARKPLACES6;
else if (!strcmp(sv_protocol_nq.string, "id") || !strcmp(sv_protocol_nq.string, "vanilla"))
protocol = (protocol==SCP_PROQUAKE)?SCP_PROQUAKE:SCP_NETQUAKE;
else switch(sv_protocol_nq.ival)
{
case RMQ_PROTOCOL_VERSION:
case FITZ_PROTOCOL_VERSION:
@ -5136,12 +5144,22 @@ void SV_Demo_Init(void);
void SV_ExecInitialConfigs(char *defaultexec)
{
Cbuf_AddText("cvar_purgedefaults\n", RESTRICT_LOCAL); //reset cvar defaults to their engine-specified values. the tail end of 'exec default.cfg' will update non-cheat defaults to mod-specified values.
Cbuf_AddText("cvarreset *\n", RESTRICT_LOCAL); //reset all cvars to their current (engine) defaults
Cbuf_AddText("alias restart \"changelevel .\"\n",RESTRICT_LOCAL);
Cbuf_AddText(defaultexec, RESTRICT_LOCAL);
Cbuf_AddText("\n", RESTRICT_LOCAL);
if (COM_FileSize("server.cfg") != -1)
Cbuf_InsertText ("exec server.cfg\nexec ftesrv.cfg\n", RESTRICT_LOCAL, false);
Cbuf_AddText ("cl_warncmd 1\nexec server.cfg\nexec ftesrv.cfg\n", RESTRICT_LOCAL);
else if (COM_FileSize("quake.rc") != -1)
Cbuf_InsertText ("cl_warncmd 0\nexec quake.rc\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL, false);
Cbuf_AddText ("cl_warncmd 0\nexec quake.rc\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL);
#ifdef HEXEN2
else if (COM_FileSize("hexen.rc") != -1) //fixme: some kind of priority thing.
Cbuf_AddText ("cl_warncmd 0\nexec hexen.rc\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL);
#endif
else
Cbuf_InsertText ("cl_warncmd 0\nexec default.cfg\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL, false);
Cbuf_AddText ("cl_warncmd 0\nexec default.cfg\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL);
// process command line arguments
Cbuf_Execute ();

View file

@ -55,7 +55,7 @@ cvar_t sv_cheatspeedchecktime = CVARD("sv_cheatspeedchecktime", "30", "The inter
#endif
cvar_t sv_playermodelchecks = CVAR("sv_playermodelchecks", "0");
cvar_t sv_ping_ignorepl = CVARD("sv_ping_ignorepl", "0", "If 1, ping times reported for players will ignore the effects of packetloss on ping times. 0 is slightly more honest, but less useful for connection diagnosis.");
cvar_t sv_protocol_nq = CVARD("sv_protocol_nq", "0", "Specifies the default protocol to use for new NQ clients. Supported values are\n0 = autodetect\n15 = vanilla\n666 = fitzquake\n999 = rmq protocol\nThe sv_bigcoords cvar forces upgrades as required.");
cvar_t sv_protocol_nq = CVARD("sv_protocol_nq", "", "Specifies the default protocol to use for new NQ clients. Supported values are\n0 = autodetect\n15 = vanilla\n666 = fitzquake\n999 = rmq protocol\nThe sv_bigcoords cvar forces upgrades as required.");
cvar_t sv_minpitch = CVARAFD("minpitch", "", "sv_minpitch", CVAR_SERVERINFO, "Assumed to be -70");
cvar_t sv_maxpitch = CVARAFD("maxpitch", "", "sv_maxpitch", CVAR_SERVERINFO, "Assumed to be 80");
@ -288,7 +288,7 @@ void SV_New_f (void)
*/
if (svs.netprim.coordsize > 2 && !(host_client->fteprotocolextensions & PEXT_FLOATCOORDS))
{
SV_ClientPrintf(host_client, 2, "\n\n\n\nSorry, but your client does not appear to support FTE's bigcoords\nFTE users will need to set cl_nopext to 0 and then reconnect, or to upgrade\n");
SV_ClientPrintf(host_client, 2, "\n\n\n\nPlease set cl_nopext to 0 and then reconnect.\nIf that doesn't work, please update your engine - "ENGINEWEBSITE"\n");
Con_Printf("%s does not support bigcoords\n", host_client->name);
host_client->drop = true;
return;
@ -5597,7 +5597,7 @@ ucmd_t ucmdsq2[] = {
// {"topten", Rank_ListTop10_f, true},
//#endif
{"drop", SV_Drop_f, true},
//quakeworld uses 'drop', quake2 commonly uses that to chuck items away / to a friend.
{"disconnect", SV_Drop_f, true},
{NULL, NULL}

View file

@ -16,6 +16,15 @@ cvar_t *scr_newHud;
BUILTINR(cvar_t*, Cvar_GetNVFDG, (const char *name, const char *defaultval, unsigned int flags, const char *description, const char *groupname));
#undef ARGNAMES
char *Cmd_Argv(int arg)
{
static char buf[4][128];
if (arg >= 4)
return "";
pCmd_Argv(arg, buf[arg], sizeof(buf[arg]));
return buf[arg];
}
float infofloat(char *info, char *findkey, float def);
void Draw_SetOverallAlpha(float a)
@ -90,11 +99,11 @@ void Draw_EZString(float x, float y, char *str, float scale, qboolean red)
#define Draw_STransPic Draw_SPic
void Draw_Character(float x, float y, unsigned int ch)
{
pDraw_Character(x, y, ch);
pDraw_Character(x, y, 0xe000|ch);
}
void Draw_SCharacter(float x, float y, unsigned int ch, float scale)
{
pDraw_CharacterH(x, y, 8*scale, 0, ch);
pDraw_CharacterH(x, y, 8*scale, 0, 0xe000|ch);
}
void SCR_DrawWadString(float x, float y, float scale, char *str)

View file

@ -11,7 +11,6 @@
#define Cvar_SetValue(var,val) pCvar_SetFloat(var->name,val)
#define Cvar_Set(var,val) pCvar_SetString(var->name,val)
#define Cmd_Argc pCmd_Argc
#define Cmd_Argv(x) ""
#define Cbuf_AddText(x) pCmd_AddText(x,false)
#define Sys_Error(x) pSys_Error(x)
#define Q_calloc calloc

View file

@ -75,6 +75,7 @@ void HUD_Plus_f(void)
{
char *t;
hud_t *hud;
char buf[64];
if (Cmd_Argc() < 1)
return;
@ -1121,12 +1122,15 @@ qbool HUD_PrepareDraw(hud_t *hud, int width, int height, // In.
y += hud->pos_y->value;
// Draw frame.
HUD_DrawFrame(hud, x, y, width, height);
if (ret_x)
{
// Draw frame.
HUD_DrawFrame(hud, x, y, width, height);
// Assign values.
*ret_x = x + frame_left;
*ret_y = y + frame_top;
// Assign values.
*ret_x = x + frame_left;
*ret_y = y + frame_top;
}
// Remember values for children.
hud->lx = x + frame_left;

View file

@ -6359,21 +6359,23 @@ void SCR_HUD_DrawOwnFrags(hud_t *hud)
strcpy(ownfragtext, "Engine does not support OwnFrags");
age = 0;
}
width = strlen(ownfragtext);
width = strlen(ownfragtext)*8;
width *= hud_ownfrags_scale->value;
height *= hud_ownfrags_scale->value;
if (age >= hud_ownfrags_timeout->value)
width = 0;
alpha = 2 - age / hud_ownfrags_timeout->value * 2;
alpha = bound(0, alpha, 1);
if (!HUD_PrepareDraw(hud, width, height, &x, &y))
return;
if (!width)
{
HUD_PrepareDraw(hud, width, height, NULL, NULL);
return;
if (age >= hud_ownfrags_timeout->value)
}
if (!HUD_PrepareDraw(hud, width, height, &x, &y))
return;
pDraw_Colour4f(1, 1, 1, alpha);