Skip to content

Commit

Permalink
WiP: qtv
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvensson committed Jan 13, 2025
1 parent cbfb75f commit 09c09b6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/sv_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,31 @@ void SV_MVD_SendInitialGamestate(mvddest_t* dest)

MSG_WriteByte(&buf, svc_serverdata);

#ifdef FTE_PEXT_256PACKETENTITIES
demo.recorder.fteprotocolextensions |= FTE_PEXT_256PACKETENTITIES;
#endif
#ifdef FTE_PEXT_MODELDBL
demo.recorder.fteprotocolextensions |= FTE_PEXT_MODELDBL;
#endif
#ifdef FTE_PEXT_ENTITYDBL
demo.recorder.fteprotocolextensions |= FTE_PEXT_ENTITYDBL;
#endif
#ifdef FTE_PEXT_ENTITYDBL2
demo.recorder.fteprotocolextensions |= FTE_PEXT_ENTITYDBL2;
#endif
#ifdef FTE_PEXT_SPAWNSTATIC2
demo.recorder.fteprotocolextensions |= FTE_PEXT_SPAWNSTATIC2;
#endif
#ifdef FTE_PEXT_TRANS
demo.recorder.fteprotocolextensions |= FTE_PEXT_TRANS;
#endif
#ifdef FTE_PEXT_COLOURMOD
demo.recorder.fteprotocolextensions |= FTE_PEXT_COLOURMOD;
#endif
#ifdef FTE_PEXT2_VOICECHAT
demo.recorder.fteprotocolextensions2 |= FTE_PEXT2_VOICECHAT;
#endif

#ifdef FTE_PEXT_FLOATCOORDS
//fix up extensions to match sv_bigcoords correctly. sorry for old clients not working.
if (msg_coordsize == 4)
Expand Down Expand Up @@ -1322,8 +1347,15 @@ void SV_MVD_SendInitialGamestate(mvddest_t* dest)
MSG_WriteByte (&buf, n);
SV_WriteRecordMVDMessage (&buf);
SZ_Clear (&buf);
MSG_WriteByte (&buf, svc_modellist);
MSG_WriteByte (&buf, n + 1);
if (n + 1 > 0xff)
{
MSG_WriteByte (&buf, svc_fte_modellistshort);
MSG_WriteShort (&buf, n + 1);
} else
{
MSG_WriteByte (&buf, svc_modellist);
MSG_WriteByte (&buf, n + 1);
}
}
n++;
s = sv.model_precache[n+1];
Expand Down
8 changes: 8 additions & 0 deletions src/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ static void SV_CreateBaseline (void)
svent->e.baseline.colormap = 0;
svent->e.baseline.modelindex = svent->v->modelindex;
}
#ifdef FTE_PEXT_TRANS
svent->e.baseline.trans = svent->xv.alpha >= 1.0f ? 0 : bound(0, (byte)(svent->xv.alpha * 254.0), 254);
#endif
#ifdef FTE_PEXT_COLOURMOD
svent->e.baseline.colourmod[0] = bound(0, svent->xv.colourmod[0] * (256.0f / 8.0f), 255);
svent->e.baseline.colourmod[1] = bound(0, svent->xv.colourmod[1] * (256.0f / 8.0f), 255);
svent->e.baseline.colourmod[2] = bound(0, svent->xv.colourmod[2] * (256.0f / 8.0f), 255);
#endif
}
sv.num_baseline_edicts = sv.num_edicts;
}
Expand Down

0 comments on commit 09c09b6

Please sign in to comment.