Fixed the MVD crash bugs, and added mvd splitscreen support (cl_splitscreen).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1080 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-06-07 04:40:16 +00:00
parent 3aeebf7a82
commit 4b006a8412
2 changed files with 44 additions and 15 deletions
engine/client

View file

@ -1888,6 +1888,24 @@ void CL_ParsePlayerinfo (void)
state->pm_type = PM_NORMAL; state->pm_type = PM_NORMAL;
TP_ParsePlayerInfo(oldstate, state, info); TP_ParsePlayerInfo(oldstate, state, info);
if (cl.splitclients < MAX_SPLITS)
{
extern cvar_t cl_splitscreen;
if (cl.splitclients < cl_splitscreen.value+1)
{
for (i = 0; i < cl.splitclients; i++)
if (autocam[i] && spec_track[i] == num)
return;
if (i == cl.splitclients)
{
autocam[cl.splitclients] = CAM_TRACK;
spec_track[cl.splitclients] = num;
cl.splitclients++;
}
}
}
return; return;
} }

View file

@ -650,7 +650,7 @@ void CL_UpdatePrydonCursor(float cursor_screen[2], vec3_t cursor_start, vec3_t c
// CL_SelectTraceLine(cursor_start, cursor_end, cursor_impact, entnum); // CL_SelectTraceLine(cursor_start, cursor_end, cursor_impact, entnum);
// makes sparks where cursor is // makes sparks where cursor is
//CL_SparkShower(cl.cmd.cursor_impact, cl.cmd.cursor_normal, 5, 0); //CL_SparkShower(cl.cmd.cursor_impact, cl.cmd.cursor_normal, 5, 0);
P_RunParticleEffectType(cursor_impact, vec3_origin, 1, 0); // P_RunParticleEffectType(cursor_impact, vec3_origin, 1, 0);
//P_ParticleTrail(cursor_start, cursor_impact, 0, NULL); //P_ParticleTrail(cursor_start, cursor_impact, 0, NULL);
} }
@ -1031,9 +1031,19 @@ void CL_SendCmd (float frametime)
{ {
if (cls.demoplayback == DPB_MVD) if (cls.demoplayback == DPB_MVD)
{ {
extern cvar_t cl_splitscreen;
i = cls.netchan.outgoing_sequence & UPDATE_MASK; i = cls.netchan.outgoing_sequence & UPDATE_MASK;
cl.frames[i].senttime = realtime; // we haven't gotten a reply yet cl.frames[i].senttime = realtime; // we haven't gotten a reply yet
cl.frames[i].receivedtime = -1; // we haven't gotten a reply yet cl.frames[i].receivedtime = -1; // we haven't gotten a reply yet
if (cl.splitclients > cl_splitscreen.value+1)
{
cl.splitclients = cl_splitscreen.value+1;
if (cl.splitclients < 1)
cl.splitclients = 1;
}
for (plnum = 0; plnum < cl.splitclients; plnum++)
{
cmd = &cl.frames[i].cmd[0]; cmd = &cl.frames[i].cmd[0];
memset(cmd, 0, sizeof(*cmd)); memset(cmd, 0, sizeof(*cmd));
@ -1042,18 +1052,19 @@ void CL_SendCmd (float frametime)
CL_AdjustAngles (plnum); CL_AdjustAngles (plnum);
// get basic movement from keyboard // get basic movement from keyboard
CL_BaseMove (cmd, 0, 1, 1); CL_BaseMove (cmd, plnum, 1, 1);
// allow mice or other external controllers to add to the move // allow mice or other external controllers to add to the move
IN_Move (cmd, 0); IN_Move (cmd, plnum);
// if we are spectator, try autocam // if we are spectator, try autocam
if (cl.spectator) if (cl.spectator)
Cam_Track(0, cmd); Cam_Track(plnum, cmd);
CL_FinishMove(cmd, (int)(frametime*1000), 0); CL_FinishMove(cmd, (int)(frametime*1000), plnum);
Cam_FinishMove(0, cmd); Cam_FinishMove(plnum, cmd);
}
cls.netchan.outgoing_sequence++; cls.netchan.outgoing_sequence++;
} }