2004-08-23 00:15:46 +00:00
/*
Copyright ( C ) 1996 - 1997 Id Software , Inc .
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2005-12-13 02:31:57 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
2013-03-31 04:21:08 +00:00
# include "quakedef.h"
2009-11-04 21:16:50 +00:00
# include "pr_common.h"
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
extern cvar_t sv_nailhack ;
2007-08-30 18:55:44 +00:00
extern cvar_t sv_cullentities_trace ;
extern cvar_t sv_cullplayers_trace ;
2014-01-13 02:42:25 +00:00
extern cvar_t sv_nopvs ;
2004-08-23 00:15:46 +00:00
2014-02-07 08:38:40 +00:00
# define SV_PVS_CAMERAS 16
typedef struct
{
int numents ;
edict_t * ent [ SV_PVS_CAMERAS ] ; //ents in this list are always sent, even if the server thinks that they are invisible.
vec3_t org [ SV_PVS_CAMERAS ] ;
2019-07-02 04:12:20 +00:00
int area [ 1 + SV_PVS_CAMERAS ] ;
2014-02-07 08:38:40 +00:00
2017-06-21 01:24:25 +00:00
pvsbuffer_t pvs ;
2014-02-07 08:38:40 +00:00
} pvscamera_t ;
2016-07-12 00:40:13 +00:00
static void * AllocateBoneSpace ( packet_entities_t * pack , unsigned char bonecount , unsigned int * allocationpos )
{
size_t space = bonecount * sizeof ( short ) * 7 ;
void * r ;
if ( pack - > bonedatacur + space > pack - > bonedatamax )
{ //expand the storage as needed. messy, but whatever.
pack - > bonedatamax = pack - > bonedatacur + space ;
pack - > bonedata = BZ_Realloc ( pack - > bonedata , pack - > bonedatamax ) ;
}
r = pack - > bonedata + pack - > bonedatacur ;
* allocationpos = pack - > bonedatacur ;
pack - > bonedatacur + = space ;
return r ;
}
2014-02-07 08:38:40 +00:00
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The PVS must include a small area around the client to allow head bobbing
or other small motion on the client side . Otherwise , a bob might cause an
entity that should be visible to not show up , especially when the bob
crosses a waterline .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
2018-12-28 00:04:36 +00:00
static int needcleanup ;
2004-08-23 00:15:46 +00:00
2009-06-21 17:45:33 +00:00
//int fatbytes;
2004-08-23 00:15:46 +00:00
2019-02-16 19:09:07 +00:00
void SV_ExpandNackFrames ( client_t * client , int require , client_frame_t * * currentframeptr )
2016-07-12 00:40:13 +00:00
{
client_frame_t * newframes ;
char * ptr ;
int i ;
2017-05-28 15:42:32 +00:00
int maxlog = require * 2 ; /*this is the max number of ents updated per frame. we can't track more, so...*/
if ( maxlog > client - > max_net_ents )
maxlog = client - > max_net_ents ;
2016-07-12 00:40:13 +00:00
ptr = Z_Malloc ( sizeof ( client_frame_t ) * UPDATE_BACKUP +
sizeof ( * client - > pendingdeltabits ) * client - > max_net_ents +
sizeof ( * client - > pendingcsqcbits ) * client - > max_net_ents +
2017-05-28 15:42:32 +00:00
sizeof ( newframes [ i ] . resend ) * maxlog * UPDATE_BACKUP ) ;
2016-07-12 00:40:13 +00:00
newframes = ( void * ) ptr ;
memcpy ( newframes , client - > frameunion . frames , sizeof ( client_frame_t ) * UPDATE_BACKUP ) ;
ptr + = sizeof ( client_frame_t ) * UPDATE_BACKUP ;
memcpy ( ptr , client - > pendingdeltabits , sizeof ( * client - > pendingdeltabits ) * client - > max_net_ents ) ;
client - > pendingdeltabits = ( void * ) ptr ;
ptr + = sizeof ( * client - > pendingdeltabits ) * client - > max_net_ents ;
memcpy ( ptr , client - > pendingcsqcbits , sizeof ( * client - > pendingcsqcbits ) * client - > max_net_ents ) ;
client - > pendingcsqcbits = ( void * ) ptr ;
ptr + = sizeof ( * client - > pendingcsqcbits ) * client - > max_net_ents ;
for ( i = 0 ; i < UPDATE_BACKUP ; i + + )
{
2017-05-28 15:42:32 +00:00
newframes [ i ] . maxresend = maxlog ;
newframes [ i ] . qwentities . max_entities = 0 ;
2016-07-12 00:40:13 +00:00
newframes [ i ] . resend = ( void * ) ptr ;
2017-05-28 15:42:32 +00:00
newframes [ i ] . numresend = client - > frameunion . frames [ i ] . numresend ;
memcpy ( newframes [ i ] . resend , client - > frameunion . frames [ i ] . resend , sizeof ( newframes [ i ] . resend ) * newframes [ i ] . numresend ) ;
2016-07-12 00:40:13 +00:00
newframes [ i ] . senttime = realtime ;
}
Z_Free ( client - > frameunion . frames ) ;
2019-02-16 19:09:07 +00:00
//if you're calling this then its because you're currently generating new frame data, and its a problem if that changes from under you. fix it up for the caller (so they can't forget to do so)
* currentframeptr = newframes + ( * currentframeptr - client - > frameunion . frames ) ;
2016-07-12 00:40:13 +00:00
client - > frameunion . frames = newframes ;
}
2004-08-23 00:15:46 +00:00
//=============================================================================
// because there can be a lot of nails, there is a special
// network protocol for them
# define MAX_NAILS 32
2018-12-28 00:04:36 +00:00
static edict_t * nails [ MAX_NAILS ] ;
static int numnails ;
static int nailcount = 0 ;
2004-08-23 00:15:46 +00:00
extern int sv_nailmodel , sv_supernailmodel , sv_playermodel ;
2013-03-12 22:47:42 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
qboolean demonails ;
2013-03-12 22:47:42 +00:00
# endif
2004-08-23 00:15:46 +00:00
2020-05-14 15:50:26 +00:00
static edict_t * * csqcent /*[csqcmaxents]*/ ;
static size_t csqcmaxents ;
static size_t csqcnuments ;
2005-02-12 18:56:04 +00:00
2004-08-23 00:15:46 +00:00
qboolean SV_AddNailUpdate ( edict_t * ent )
{
2005-03-28 00:11:59 +00:00
if ( ent - > v - > modelindex ! = sv_nailmodel
& & ent - > v - > modelindex ! = sv_supernailmodel )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
return false ; //must be a nail
2013-12-23 21:33:40 +00:00
if ( sv_nailhack . value | | ( host_client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
return false ; //'nailhack' is named because of a qizmo-publicised binary hack to disable svc_nails. replacementdeltas also trims much of the state so we may as well use it.
//should probably also detect qizmo specifically - its trajectory stuff beats svc_nails.
if ( ent - > v - > origin [ 0 ] < = - 4096 | | ent - > v - > origin [ 0 ] > = 4096 | |
ent - > v - > origin [ 1 ] < = - 4096 | | ent - > v - > origin [ 1 ] > = 4096 | |
ent - > v - > origin [ 2 ] < = - 4096 | | ent - > v - > origin [ 2 ] > = 4096 )
return ! ( host_client - > fteprotocolextensions & PEXT_FLOATCOORDS ) ; //outside the bounds of the nails protocol. just swallow it if it can't be sent anyway.
2004-08-23 00:15:46 +00:00
2013-03-12 22:47:42 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2005-05-20 03:32:53 +00:00
demonails = false ;
2013-03-12 22:47:42 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( numnails = = MAX_NAILS )
return true ;
nails [ numnails ] = ent ;
numnails + + ;
return true ;
}
2013-03-12 22:47:42 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
qboolean SV_DemoNailUpdate ( int i )
{
demonails = true ;
if ( numnails = = MAX_NAILS )
return true ;
nails [ numnails ] = ( edict_t * ) i ;
numnails + + ;
return true ;
}
2013-03-12 22:47:42 +00:00
# endif
2004-08-23 00:15:46 +00:00
void SV_EmitNailUpdate ( sizebuf_t * msg , qboolean recorder )
{
2005-12-13 02:31:57 +00:00
qbyte bits [ 6 ] ; // [48 bits] xyzpy 12 12 12 4 8
2004-08-23 00:15:46 +00:00
int n , i ;
edict_t * ent ;
int x , y , z , p , yaw ;
if ( ! numnails )
return ;
if ( recorder )
MSG_WriteByte ( msg , svc_nails2 ) ;
else
MSG_WriteByte ( msg , svc_nails ) ;
MSG_WriteByte ( msg , numnails ) ;
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( demonails )
{
for ( n = 0 ; n < numnails ; n + + )
{
i = ( int ) ( nails [ n ] ) ;
if ( recorder ) {
if ( ! sv . demospikes [ i ] . id ) {
if ( ! ( ( + + nailcount ) & 255 ) ) nailcount + + ;
sv . demospikes [ i ] . id = nailcount & 255 ;
}
MSG_WriteByte ( msg , ( qbyte ) sv . demospikes [ i ] . id ) ;
}
x = ( int ) ( sv . demospikes [ i ] . org [ 0 ] + 4096 ) > > 1 ;
y = ( int ) ( sv . demospikes [ i ] . org [ 1 ] + 4096 ) > > 1 ;
z = ( int ) ( sv . demospikes [ i ] . org [ 2 ] + 4096 ) > > 1 ;
p = ( int ) ( sv . demospikes [ i ] . pitch ) & 15 ;
yaw = ( int ) ( sv . demospikes [ i ] . yaw ) & 255 ;
bits [ 0 ] = x ;
bits [ 1 ] = ( x > > 8 ) | ( y < < 4 ) ;
bits [ 2 ] = ( y > > 4 ) ;
bits [ 3 ] = z ;
bits [ 4 ] = ( z > > 8 ) | ( p < < 4 ) ;
bits [ 5 ] = yaw ;
for ( i = 0 ; i < 6 ; i + + )
MSG_WriteByte ( msg , bits [ i ] ) ;
}
return ;
}
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
for ( n = 0 ; n < numnails ; n + + )
{
ent = nails [ n ] ;
if ( recorder ) {
2005-03-28 00:11:59 +00:00
if ( ! ent - > v - > colormap ) {
2004-08-23 00:15:46 +00:00
if ( ! ( ( + + nailcount ) & 255 ) ) nailcount + + ;
2005-03-28 00:11:59 +00:00
ent - > v - > colormap = nailcount & 255 ;
2004-08-23 00:15:46 +00:00
}
2005-03-28 00:11:59 +00:00
MSG_WriteByte ( msg , ( qbyte ) ent - > v - > colormap ) ;
2004-08-23 00:15:46 +00:00
}
2005-03-28 00:11:59 +00:00
x = ( int ) ( ent - > v - > origin [ 0 ] + 4096 ) > > 1 ;
y = ( int ) ( ent - > v - > origin [ 1 ] + 4096 ) > > 1 ;
z = ( int ) ( ent - > v - > origin [ 2 ] + 4096 ) > > 1 ;
p = ( int ) ( 16 * ent - > v - > angles [ 0 ] / 360 ) & 15 ;
yaw = ( int ) ( 256 * ent - > v - > angles [ 1 ] / 360 ) & 255 ;
2004-08-23 00:15:46 +00:00
2011-06-29 18:39:11 +00:00
bits [ 0 ] = x & 0xff ;
bits [ 1 ] = ( ( x > > 8 ) | ( y < < 4 ) ) & 0xff ;
bits [ 2 ] = ( y > > 4 ) & 0xff ;
bits [ 3 ] = z & 0xff ;
bits [ 4 ] = ( ( z > > 8 ) | ( p < < 4 ) ) & 0xff ;
bits [ 5 ] = yaw & 0xff ;
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 6 ; i + + )
MSG_WriteByte ( msg , bits [ i ] ) ;
}
}
2005-02-28 07:16:19 +00:00
//=============================================================================
//this is the bit of the code that sends the csqc entity deltas out.
//whenever the entity in question has a newer version than we sent to the client, we need to resend.
//So, we track the outgoing sequence that an entity was sent in, and the version.
//Upon detection of a dropped packet, we resend all entities who were last sent in that packet.
//When an entities' last sent version doesn't match the current version, we send.
static qboolean SV_AddCSQCUpdate ( client_t * client , edict_t * ent )
{
# ifndef PEXT_CSQC
return false ;
# else
2017-07-28 01:49:25 +00:00
if ( ! ent - > xv - > SendEntity )
2005-02-28 07:16:19 +00:00
return false ;
2017-07-28 01:49:25 +00:00
if ( ! ( client - > csqcactive ) )
2005-02-28 07:16:19 +00:00
return false ;
2020-05-14 15:50:26 +00:00
if ( csqcnuments > = csqcmaxents )
Z_ReallocElements ( ( void * * ) & csqcent , & csqcmaxents , csqcnuments + 1024 , sizeof ( * csqcent ) ) ;
2005-02-28 07:16:19 +00:00
csqcent [ csqcnuments + + ] = ent ;
return true ;
# endif
}
sizebuf_t csqcmsgbuffer ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
static void SV_EmitDeltaEntIndex ( sizebuf_t * msg , unsigned int entnum , qboolean remove , qboolean big )
{
unsigned int rflag = remove ? 0x8000 : 0 ;
if ( big )
{
if ( entnum > = 0x4000 )
{
MSG_WriteShort ( msg , ( entnum & 0x3fff ) | 0x4000 | rflag ) ;
MSG_WriteByte ( msg , entnum > > 14 ) ;
}
else
MSG_WriteShort ( msg , entnum | rflag ) ;
}
else
MSG_WriteShort ( msg , entnum | rflag ) ;
}
2012-07-05 19:42:36 +00:00
void SV_EmitCSQCUpdate ( client_t * client , sizebuf_t * msg , qbyte svcnumber )
2005-02-12 18:56:04 +00:00
{
2005-02-28 07:16:19 +00:00
# ifdef PEXT_CSQC
2020-01-09 15:35:40 +00:00
static float throttle ;
qbyte messagebuffer [ MAX_OVERALLMSGLEN ] ;
2005-02-28 07:16:19 +00:00
int en ;
int currentsequence = client - > netchan . outgoing_sequence ;
2009-03-03 01:52:30 +00:00
globalvars_t * pr_globals ;
2005-02-28 07:16:19 +00:00
edict_t * ent ;
qboolean writtenheader = false ;
2011-08-16 04:12:15 +00:00
int viewerent ;
2016-07-12 00:40:13 +00:00
int entnum ;
2017-05-28 15:42:32 +00:00
client_frame_t * frame = & client - > frameunion . frames [ currentsequence & UPDATE_MASK ] ;
int lognum = frame - > numresend ;
2021-10-05 05:04:59 +00:00
quint64_t bits ;
2016-07-12 00:40:13 +00:00
2017-05-28 15:42:32 +00:00
struct resendinfo_s * resend = frame - > resend ;
int maxlog = frame - > maxresend ;
2005-02-28 07:16:19 +00:00
2008-11-09 22:29:28 +00:00
//we don't check that we got some already - because this is delta compressed!
2005-02-28 07:16:19 +00:00
2016-07-12 00:40:13 +00:00
if ( ! client - > csqcactive | | ! svprogfuncs | | ! client - > pendingcsqcbits )
2005-02-28 07:16:19 +00:00
return ;
2009-03-03 01:52:30 +00:00
pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
2011-08-16 04:12:15 +00:00
if ( client - > edict )
viewerent = EDICT_TO_PROG ( svprogfuncs , client - > edict ) ;
else
viewerent = 0 ; /*for mvds, its as if world is looking*/
2005-02-28 07:16:19 +00:00
//FIXME: prioritise the list of csqc ents somehow
csqcmsgbuffer . data = messagebuffer ;
csqcmsgbuffer . maxsize = sizeof ( messagebuffer ) ;
csqcmsgbuffer . packing = msg - > packing ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
csqcmsgbuffer . prim = msg - > prim ;
2005-02-28 07:16:19 +00:00
2020-09-08 05:11:09 +00:00
if ( sv_csqcdebug . ival )
svcnumber = svcfte_csqcentities_sized ;
2016-07-12 00:40:13 +00:00
for ( en = 0 , entnum = 0 ; en < csqcnuments ; en + + , entnum + + )
2005-02-28 07:16:19 +00:00
{
ent = csqcent [ en ] ;
2016-07-12 00:40:13 +00:00
//add any entity removes on ents leading up to this entity
for ( ; entnum < ent - > entnum ; entnum + + )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
{
2016-07-12 00:40:13 +00:00
if ( client - > pendingcsqcbits [ entnum ] & ( SENDFLAGS_PRESENT | SENDFLAGS_REMOVED ) )
{
if ( ! ( client - > pendingcsqcbits [ entnum ] & SENDFLAGS_REMOVED ) )
{ //while the entity has NOREMOVE, only remove it if the remove is a resend
2018-12-04 06:04:47 +00:00
if ( ( int ) EDICT_NUM_PB ( svprogfuncs , entnum ) - > xv - > pvsflags & PVSF_NOREMOVE )
2016-07-12 00:40:13 +00:00
continue ;
}
if ( msg - > cursize + 5 > = msg - > maxsize )
break ; //we're overflowing, try removing next frame instead.
if ( lognum > maxlog )
{
2019-02-19 06:49:03 +00:00
if ( maxlog = = client - > max_net_ents )
break ;
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , lognum + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
maxlog = frame - > maxresend ;
2016-07-12 00:40:13 +00:00
}
resend [ lognum ] . entnum = entnum ;
resend [ lognum ] . bits = 0 ;
resend [ lognum ] . flags = SENDFLAGS_REMOVED ;
lognum + + ;
if ( ! writtenheader )
{
writtenheader = true ;
MSG_WriteByte ( msg , svcnumber ) ;
}
SV_EmitDeltaEntIndex ( msg , entnum , true , client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ;
// Con_Printf("Sending remove 2 packet\n");
client - > pendingcsqcbits [ entnum ] = 0 ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2016-07-12 00:40:13 +00:00
if ( client - > pendingcsqcbits [ entnum ] = = SENDFLAGS_PRESENT )
continue ; //nothing changed
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
2016-07-12 00:40:13 +00:00
if ( client - > pendingcsqcbits [ entnum ] & SENDFLAGS_REMOVED )
2008-11-09 22:29:28 +00:00
{
2016-07-12 00:40:13 +00:00
//we lost a remove, but it got readded since.
//make sure all is resent
client - > pendingcsqcbits [ entnum ] = SENDFLAGS_USABLE ;
2008-11-09 22:29:28 +00:00
}
2016-07-12 00:40:13 +00:00
if ( ! ( client - > pendingcsqcbits [ entnum ] & SENDFLAGS_PRESENT ) )
client - > pendingcsqcbits [ entnum ] = SENDFLAGS_USABLE ; //this entity appears new. make sure its fully transmitted.
2005-02-28 07:16:19 +00:00
2021-10-05 05:04:59 +00:00
bits = client - > pendingcsqcbits [ entnum ] ;
client - > pendingcsqcbits [ entnum ] = 0 ;
2005-02-28 07:16:19 +00:00
csqcmsgbuffer . cursize = 0 ;
csqcmsgbuffer . currentbit = 0 ;
2016-07-12 00:40:13 +00:00
2005-02-28 07:16:19 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , ent ) ;
2021-11-19 19:40:25 +00:00
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
{
pr_global_struct - > other = viewerent ;
Q1QVM_SendEntity ( bits ) ;
}
else
# endif
{
//Ask CSQC to write a buffer for it.
G_INT ( OFS_PARM0 ) = viewerent ;
G_FLOAT ( OFS_PARM1 + 0 ) = ( int ) ( ( bits > > ( SENDFLAGS_SHIFT + 0 ) ) & 0xffffff ) ; //each float can only hold 24 bits before it forgets its lower bits.
G_FLOAT ( OFS_PARM1 + 1 ) = ( int ) ( ( bits > > ( SENDFLAGS_SHIFT + 24 ) ) & 0xffffff ) ;
G_FLOAT ( OFS_PARM1 + 2 ) = ( int ) ( ( bits > > ( SENDFLAGS_SHIFT + 48 ) ) & 0xffffff ) ;
PR_ExecuteProgram ( svprogfuncs , ent - > xv - > SendEntity ) ;
}
2005-02-28 07:16:19 +00:00
if ( G_INT ( OFS_RETURN ) ) //0 means not to tell the client about it.
{
2020-01-09 15:35:40 +00:00
//FIXME: don't overflow MAX_DATAGRAM... unless its too big anyway...
2005-02-28 07:16:19 +00:00
if ( msg - > cursize + csqcmsgbuffer . cursize + 5 > = msg - > maxsize )
{
2020-01-09 15:35:40 +00:00
//warn when the message is larger than the user's max size..
if ( csqcmsgbuffer . cursize + 5 > msg - > maxsize )
Con_ThrottlePrintf ( & throttle , 0 , " CSQC update of entity %i(%s) is larger than user %s's maximum datagram size (%u > %u). \n " , entnum , PR_GetString ( svprogfuncs , ent - > v - > classname ) , client - > name , csqcmsgbuffer . cursize , msg - > maxsize - 5 ) ;
2021-10-05 05:04:59 +00:00
client - > pendingcsqcbits [ entnum ] = bits ;
2005-02-28 07:16:19 +00:00
if ( csqcmsgbuffer . cursize < 32 )
break ;
2021-10-05 05:04:59 +00:00
continue ; //might be able to fit a different ent in there.
2005-02-28 07:16:19 +00:00
}
2016-07-12 00:40:13 +00:00
if ( lognum > maxlog )
{
2019-02-19 06:49:03 +00:00
if ( maxlog = = client - > max_net_ents )
2021-10-05 05:04:59 +00:00
{
client - > pendingcsqcbits [ entnum ] = bits ;
2019-02-19 06:49:03 +00:00
break ;
2021-10-05 05:04:59 +00:00
}
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , lognum + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
maxlog = frame - > maxresend ;
2016-07-12 00:40:13 +00:00
}
resend [ lognum ] . entnum = entnum ;
resend [ lognum ] . bits = 0 ;
2021-10-05 05:04:59 +00:00
resend [ lognum ] . flags = SENDFLAGS_PRESENT | bits ;
2016-07-12 00:40:13 +00:00
lognum + + ;
2005-02-28 07:16:19 +00:00
if ( ! writtenheader )
{
writtenheader = true ;
2012-07-05 19:42:36 +00:00
MSG_WriteByte ( msg , svcnumber ) ;
2005-02-28 07:16:19 +00:00
}
2016-07-12 00:40:13 +00:00
SV_EmitDeltaEntIndex ( msg , entnum , false , client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ;
2020-09-08 05:11:09 +00:00
if ( svcnumber = = svcfte_csqcentities_sized ) //optional extra length prefix.
2005-03-20 02:57:11 +00:00
{
if ( ! csqcmsgbuffer . cursize )
2016-07-12 00:40:13 +00:00
Con_Printf ( " Warning: empty csqc packet on %s \n " , PR_GetString ( svprogfuncs , ent - > v - > classname ) ) ;
2005-03-20 02:57:11 +00:00
MSG_WriteShort ( msg , csqcmsgbuffer . cursize ) ;
}
2005-02-28 07:16:19 +00:00
SZ_Write ( msg , csqcmsgbuffer . data , csqcmsgbuffer . cursize ) ;
2021-10-05 05:04:59 +00:00
client - > pendingcsqcbits [ entnum ] | = SENDFLAGS_PRESENT ;
2005-04-16 16:21:27 +00:00
// Con_Printf("Sending update packet %i\n", ent->entnum);
2005-02-28 07:16:19 +00:00
}
2021-10-05 05:04:59 +00:00
else if ( ( bits & SENDFLAGS_PRESENT ) & & ! ( ( int ) ent - > xv - > pvsflags & PVSF_NOREMOVE ) )
2008-11-09 22:29:28 +00:00
{ //Don't want to send, but they have it already
2016-07-12 00:40:13 +00:00
if ( msg - > cursize + 5 > = msg - > maxsize )
2021-10-05 05:04:59 +00:00
{
client - > pendingcsqcbits [ entnum ] = bits ;
2016-07-12 00:40:13 +00:00
break ; //we're overflowing, try removing next frame instead.
2021-10-05 05:04:59 +00:00
}
2016-07-12 00:40:13 +00:00
if ( lognum > maxlog )
{
2019-02-19 06:49:03 +00:00
if ( maxlog = = client - > max_net_ents )
2021-10-05 05:04:59 +00:00
{
client - > pendingcsqcbits [ entnum ] = bits ;
2019-02-19 06:49:03 +00:00
break ;
2021-10-05 05:04:59 +00:00
}
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , lognum + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
maxlog = frame - > maxresend ;
2016-07-12 00:40:13 +00:00
}
resend [ lognum ] . entnum = entnum ;
resend [ lognum ] . bits = 0 ;
resend [ lognum ] . flags = SENDFLAGS_REMOVED ;
lognum + + ;
2005-02-28 07:16:19 +00:00
if ( ! writtenheader )
{
writtenheader = true ;
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( msg , svcnumber ) ;
2005-02-28 07:16:19 +00:00
}
2005-02-12 18:56:04 +00:00
2016-07-12 00:40:13 +00:00
SV_EmitDeltaEntIndex ( msg , entnum , true , client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ;
// Con_Printf("Sending remove 2 packet\n");
2021-10-05 05:04:59 +00:00
// client->pendingcsqcbits[entnum] = 0;
2005-02-28 07:16:19 +00:00
}
}
2016-07-12 00:40:13 +00:00
//and now tail entities
for ( ; entnum < client - > max_net_ents & & entnum < sv . world . num_edicts ; entnum + + )
2005-02-28 07:16:19 +00:00
{
2016-07-12 00:40:13 +00:00
if ( client - > pendingcsqcbits [ entnum ] & ( SENDFLAGS_PRESENT | SENDFLAGS_REMOVED ) )
2005-02-28 07:16:19 +00:00
{
2016-07-12 00:40:13 +00:00
if ( ! ( client - > pendingcsqcbits [ entnum ] & SENDFLAGS_REMOVED ) )
2018-12-04 06:04:47 +00:00
{ //while the original entity has NOREMOVE, only remove it if the remove is a resend
2018-04-06 17:21:15 +00:00
if ( ( int ) EDICT_NUM_PB ( svprogfuncs , entnum ) - > xv - > pvsflags & PVSF_NOREMOVE )
2016-07-12 00:40:13 +00:00
continue ;
}
if ( msg - > cursize + 5 > = msg - > maxsize )
break ; //we're overflowing, try removing next frame instead.
2005-02-28 07:16:19 +00:00
2016-07-12 00:40:13 +00:00
if ( lognum > maxlog )
2005-02-28 07:16:19 +00:00
{
2019-02-19 06:49:03 +00:00
if ( maxlog = = client - > max_net_ents )
break ;
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , lognum + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
maxlog = frame - > maxresend ;
2005-02-28 07:16:19 +00:00
}
2016-07-12 00:40:13 +00:00
resend [ lognum ] . entnum = entnum ;
resend [ lognum ] . bits = 0 ;
resend [ lognum ] . flags = SENDFLAGS_REMOVED ;
lognum + + ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
2016-07-12 00:40:13 +00:00
if ( ! writtenheader )
{
writtenheader = true ;
MSG_WriteByte ( msg , svcnumber ) ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
2016-07-12 00:40:13 +00:00
SV_EmitDeltaEntIndex ( msg , entnum , true , client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ;
// Con_Printf("Sending remove 2 packet\n");
2005-02-28 07:16:19 +00:00
2016-07-12 00:40:13 +00:00
client - > pendingcsqcbits [ entnum ] = 0 ;
2005-02-28 07:16:19 +00:00
}
}
2016-07-12 00:40:13 +00:00
2005-02-28 07:16:19 +00:00
if ( writtenheader )
MSG_WriteShort ( msg , 0 ) ; //a 0 means no more.
csqcnuments = 0 ;
2017-05-28 15:42:32 +00:00
frame - > numresend = lognum ;
2016-07-12 00:40:13 +00:00
2005-02-28 07:16:19 +00:00
//prevent the qc from trying to use it at inopertune times.
csqcmsgbuffer . maxsize = 0 ;
csqcmsgbuffer . data = NULL ;
# endif
}
void SV_CSQC_DroppedPacket ( client_t * client , int sequence )
{
int i ;
2017-05-28 15:42:32 +00:00
client_frame_t * frame ;
2016-10-22 07:06:51 +00:00
if ( ! ISQWCLIENT ( client ) & & ! ISNQCLIENT ( client ) )
return ;
2013-03-17 22:55:38 +00:00
if ( ! client - > frameunion . frames )
{
2013-03-31 04:21:08 +00:00
Con_Printf ( " Server bug: No frames! \n " ) ;
2013-03-17 22:55:38 +00:00
return ;
}
2017-05-28 15:42:32 +00:00
frame = & client - > frameunion . frames [ sequence & UPDATE_MASK ] ;
2013-03-17 22:55:38 +00:00
2012-02-12 05:18:31 +00:00
//skip it if we never generated that frame, to avoid pulling in stale data
2017-05-28 15:42:32 +00:00
if ( frame - > sequence ! = sequence )
2012-02-12 05:18:31 +00:00
{
2012-02-14 15:50:34 +00:00
// Con_Printf("SV: Stale %i\n", sequence);
2012-02-12 05:18:31 +00:00
return ;
}
2015-01-21 18:18:37 +00:00
//lost entities need flagging for a resend
2017-05-28 15:42:32 +00:00
if ( frame - > numresend )
2012-02-12 05:18:31 +00:00
{
2017-05-28 15:42:32 +00:00
struct resendinfo_s * resend = frame - > resend ;
2012-02-14 15:50:34 +00:00
// Con_Printf("SV: Resend %i\n", sequence);
2017-05-28 15:42:32 +00:00
i = frame - > numresend ;
2012-02-12 05:18:31 +00:00
while ( i > 0 )
{
i - - ;
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ resend [ i ] . entnum ] | = resend [ i ] . bits ;
client - > pendingcsqcbits [ resend [ i ] . entnum ] | = resend [ i ] . flags ;
2012-02-12 05:18:31 +00:00
}
2017-05-28 15:42:32 +00:00
frame - > numresend = 0 ; //don't resend the same info twice!
2012-02-12 05:18:31 +00:00
}
2015-01-21 18:18:37 +00:00
//lost stats do too
2017-05-28 15:42:32 +00:00
if ( frame - > numresendstats )
2015-01-21 18:18:37 +00:00
{
client_t * sp ;
2017-05-28 15:42:32 +00:00
unsigned short * n = frame - > resendstats ;
i = frame - > numresendstats ;
2015-01-21 18:18:37 +00:00
while ( i - - > 0 )
{
unsigned short s = n [ i ] ;
if ( s & 0xf000 )
{
sp = client ;
while ( s & 0xf000 )
{
s - = 0x1000 ;
sp = sp - > controlled ;
}
sp - > pendingstats [ s > > 5u ] | = 1u < < ( s & 0x1fu ) ;
}
else
client - > pendingstats [ s > > 5u ] | = 1u < < ( s & 0x1fu ) ;
}
2017-05-28 15:42:32 +00:00
frame - > numresendstats = 0 ;
2015-01-21 18:18:37 +00:00
}
2016-07-12 00:40:13 +00:00
}
2005-03-10 03:55:18 +00:00
2016-07-12 00:40:13 +00:00
void SV_AckEntityFrame ( client_t * cl , int framenum )
{
//any not acked yet are assumed to be lost.
//this may result in packetloss if the client received multiple packets between sending two outgoing packets.
int frame = cl - > lastsequence_acknowledged + 1 ;
if ( framenum > cl - > lastsequence_acknowledged )
cl - > lastsequence_acknowledged = framenum ;
if ( framenum > frame + UPDATE_BACKUP )
framenum = frame + UPDATE_BACKUP ;
# ifdef PEXT_CSQC
for ( ; frame < framenum ; frame + + )
SV_CSQC_DroppedPacket ( cl , frame ) ;
# endif
}
void SV_ReplaceEntityFrame ( client_t * cl , int framenum )
{
//this packet is about to be overwritten, we can't track more.
//we might as well pretend that it got acked, we can't track pings that far back anyway, just make sure it gets flagged as dropped.
//due to how qw sequences are controlled by the client, the server may have skipped some frames. try to handle those too.
int frame = cl - > lastsequence_acknowledged + 1 ;
framenum - = UPDATE_BACKUP ;
if ( framenum > cl - > lastsequence_acknowledged )
cl - > lastsequence_acknowledged = framenum ;
if ( framenum > frame + UPDATE_BACKUP )
framenum = frame + UPDATE_BACKUP ;
2005-03-10 03:55:18 +00:00
2016-07-12 00:40:13 +00:00
# ifdef PEXT_CSQC
for ( ; frame < = framenum ; frame + + )
SV_CSQC_DroppedPacket ( cl , frame ) ;
# endif
2005-02-12 18:56:04 +00:00
}
2016-07-12 00:40:13 +00:00
/*
2005-12-06 02:17:55 +00:00
void SV_CSQC_DropAll ( client_t * client )
{
int i ;
2012-02-12 05:18:31 +00:00
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
{
2013-03-12 22:44:00 +00:00
// Con_Printf("Reset all\n");
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ 0 ] = UF_REMOVE ;
2012-02-12 05:18:31 +00:00
}
2016-07-12 00:40:13 +00:00
if ( client - > csqcactive ) //we don't need this, but it might be a little faster.
{
//FIXME: handle any needed removes
for ( i = 0 ; i < sv . world . num_edicts ; i + + )
client - > pendingcsqcbits [ i ] | = SENDFLAGS_USABLE ; //resend all
}
2015-01-21 18:18:37 +00:00
//we don't know which stats were on the wire, resend all. :(
memset ( client - > pendingstats , 0xff , sizeof ( client - > pendingstats ) ) ;
2005-12-06 02:17:55 +00:00
}
2016-07-12 00:40:13 +00:00
*/
2004-08-23 00:15:46 +00:00
//=============================================================================
/*
= = = = = = = = = = = = = = = = = =
SV_WriteDelta
Writes part of a packetentities message .
Can delta from either a baseline or a previous packet_entity
= = = = = = = = = = = = = = = = = =
*/
2021-08-04 21:16:57 +00:00
void SVQW_WriteDelta ( entity_state_t * from , entity_state_t * to , sizebuf_t * msg , qboolean force , unsigned int protext , unsigned int ezext )
2004-08-23 00:15:46 +00:00
{
# ifdef PROTOCOLEXTENSIONS
int evenmorebits = 0 ;
# endif
int bits ;
int i ;
2006-06-04 18:57:00 +00:00
int fromeffects ;
2009-11-15 03:20:17 +00:00
coorddata coordd [ 3 ] ;
coorddata angled [ 3 ] ;
2021-08-04 21:16:57 +00:00
qbyte coordtype = msg - > prim . coordtype ;
2004-08-23 00:15:46 +00:00
2004-12-08 04:14:52 +00:00
if ( from = = & ( ( edict_t * ) NULL ) - > baseline )
2013-10-29 17:38:22 +00:00
from = & nullentitystate ;
2004-12-08 04:14:52 +00:00
2021-08-04 21:16:57 +00:00
if ( ezext & EZPEXT1_FLOATENTCOORDS )
coordtype = COORDTYPE_FLOAT_32 ;
2004-08-23 00:15:46 +00:00
// send an update
bits = 0 ;
2021-08-04 21:16:57 +00:00
if ( coordtype ! = COORDTYPE_FLOAT_32 )
2004-08-23 00:15:46 +00:00
{
2009-07-18 20:14:10 +00:00
for ( i = 0 ; i < 3 ; i + + )
{
2021-08-04 21:16:57 +00:00
coordd [ i ] = MSG_ToCoord ( to - > origin [ i ] , coordtype ) ;
if ( MSG_ToCoord ( from - > origin [ i ] , coordtype ) . b4 ! = coordd [ i ] . b4 )
2009-07-18 20:14:10 +00:00
bits | = U_ORIGIN1 < < i ;
else
to - > origin [ i ] = from - > origin [ i ] ;
}
}
else
{
for ( i = 0 ; i < 3 ; i + + )
2004-08-23 00:15:46 +00:00
{
2021-08-04 21:16:57 +00:00
coordd [ i ] = MSG_ToCoord ( to - > origin [ i ] , coordtype ) ;
2009-07-18 20:14:10 +00:00
if ( to - > origin [ i ] ! = from - > origin [ i ] )
bits | = U_ORIGIN1 < < i ;
2004-08-23 00:15:46 +00:00
}
}
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
angled [ 0 ] = MSG_ToAngle ( to - > angles [ 0 ] , msg - > prim . anglesize ) ;
if ( MSG_ToAngle ( from - > angles [ 0 ] , msg - > prim . anglesize ) . b4 ! = angled [ 0 ] . b4 )
2004-08-23 00:15:46 +00:00
bits | = U_ANGLE1 ;
2009-11-15 03:20:17 +00:00
else
to - > angles [ 0 ] = from - > angles [ 0 ] ;
2004-08-23 00:15:46 +00:00
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
angled [ 1 ] = MSG_ToAngle ( to - > angles [ 1 ] , msg - > prim . anglesize ) ;
if ( MSG_ToAngle ( from - > angles [ 1 ] , msg - > prim . anglesize ) . b4 ! = angled [ 1 ] . b4 )
2004-08-23 00:15:46 +00:00
bits | = U_ANGLE2 ;
2009-11-15 03:20:17 +00:00
else
to - > angles [ 1 ] = from - > angles [ 1 ] ;
2004-08-23 00:15:46 +00:00
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
angled [ 2 ] = MSG_ToAngle ( to - > angles [ 2 ] , msg - > prim . anglesize ) ;
if ( MSG_ToAngle ( from - > angles [ 2 ] , msg - > prim . anglesize ) . b4 ! = angled [ 2 ] . b4 )
2004-08-23 00:15:46 +00:00
bits | = U_ANGLE3 ;
2009-11-15 03:20:17 +00:00
else
to - > angles [ 2 ] = from - > angles [ 2 ] ;
2004-08-23 00:15:46 +00:00
if ( to - > colormap ! = from - > colormap )
bits | = U_COLORMAP ;
if ( to - > skinnum ! = from - > skinnum )
bits | = U_SKIN ;
if ( to - > frame ! = from - > frame )
bits | = U_FRAME ;
2006-06-04 18:57:00 +00:00
if ( force & & ! ( protext & PEXT_SPAWNSTATIC2 ) )
fromeffects = 0 ; //force is true if we're going from baseline
else //old quakeworld protocols do not include effects in the baseline
fromeffects = from - > effects ; //so old clients will see the effects baseline as 0
2008-11-09 22:29:28 +00:00
if ( ( to - > effects & 0x00ff ) ! = ( fromeffects & 0x00ff ) )
2004-08-23 00:15:46 +00:00
bits | = U_EFFECTS ;
2012-02-06 02:06:23 +00:00
if ( ( to - > effects & 0xff00 ) ! = ( fromeffects & 0xff00 ) & & ( protext & PEXT_DPFLAGS ) )
2005-08-26 22:56:51 +00:00
evenmorebits | = U_EFFECTS16 ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( to - > modelindex ! = from - > modelindex )
2004-08-23 00:15:46 +00:00
{
bits | = U_MODEL ;
if ( to - > modelindex > 255 )
2008-11-09 22:29:28 +00:00
{
2008-12-02 23:05:14 +00:00
if ( protext & PEXT_MODELDBL )
2011-07-30 14:14:56 +00:00
{
if ( to - > modelindex > 512 )
bits & = ~ U_MODEL ;
2008-11-09 22:29:28 +00:00
evenmorebits | = U_MODELDBL ;
2011-07-30 14:14:56 +00:00
}
2008-11-09 22:29:28 +00:00
else
return ;
}
2004-08-23 00:15:46 +00:00
}
# ifdef PROTOCOLEXTENSIONS
# ifdef U_SCALE
2012-02-06 02:06:23 +00:00
if ( to - > scale ! = from - > scale & & ( protext & PEXT_SCALE ) )
2004-08-23 00:15:46 +00:00
evenmorebits | = U_SCALE ;
# endif
# ifdef U_TRANS
2012-02-06 02:06:23 +00:00
if ( to - > trans ! = from - > trans & & ( protext & PEXT_TRANS ) )
2004-08-23 00:15:46 +00:00
evenmorebits | = U_TRANS ;
# endif
# ifdef U_FATNESS
2012-02-06 02:06:23 +00:00
if ( to - > fatness ! = from - > fatness & & ( protext & PEXT_FATNESS ) )
2004-08-23 00:15:46 +00:00
evenmorebits | = U_FATNESS ;
# endif
2012-02-06 02:06:23 +00:00
if ( to - > hexen2flags ! = from - > hexen2flags & & ( protext & PEXT_HEXEN2 ) )
2004-08-23 00:15:46 +00:00
evenmorebits | = U_DRAWFLAGS ;
2012-02-06 02:06:23 +00:00
if ( to - > abslight ! = from - > abslight & & ( protext & PEXT_HEXEN2 ) )
2004-08-23 00:15:46 +00:00
evenmorebits | = U_ABSLIGHT ;
2012-02-06 02:06:23 +00:00
if ( ( to - > colormod [ 0 ] ! = from - > colormod [ 0 ] | | to - > colormod [ 1 ] ! = from - > colormod [ 1 ] | | to - > colormod [ 2 ] ! = from - > colormod [ 2 ] ) & & ( protext & PEXT_COLOURMOD ) )
2006-02-27 00:42:25 +00:00
evenmorebits | = U_COLOURMOD ;
2005-07-01 19:23:00 +00:00
if ( to - > glowsize ! = from - > glowsize )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
to - > dpflags | = RENDER_GLOWTRAIL ;
2005-05-17 02:36:54 +00:00
2012-02-06 02:06:23 +00:00
if ( to - > dpflags ! = from - > dpflags & & ( protext & PEXT_DPFLAGS ) )
2005-05-15 18:49:04 +00:00
evenmorebits | = U_DPFLAGS ;
2017-03-26 01:46:08 +00:00
if ( ( to - > tagentity ! = from - > tagentity | | to - > tagindex ! = from - > tagindex ) & & ( protext & PEXT_SETATTACHMENT ) )
2005-07-01 19:23:00 +00:00
evenmorebits | = U_TAGINFO ;
2012-02-06 02:06:23 +00:00
if ( ( to - > light [ 0 ] ! = from - > light [ 0 ] | | to - > light [ 1 ] ! = from - > light [ 1 ] | | to - > light [ 2 ] ! = from - > light [ 2 ] | | to - > light [ 3 ] ! = from - > light [ 3 ] | | to - > lightstyle ! = from - > lightstyle | | to - > lightpflags ! = from - > lightstyle ) & & ( protext & PEXT_DPFLAGS ) )
2005-08-07 18:08:13 +00:00
evenmorebits | = U_LIGHT ;
2004-08-23 00:15:46 +00:00
# endif
2012-02-12 05:18:31 +00:00
// if (to->solid)
// bits |= U_SOLID;
2004-08-23 00:15:46 +00:00
if ( msg - > cursize + 40 > msg - > maxsize )
{ //not enough space in the buffer, don't send the entity this frame. (not sending means nothing changes, and it takes no bytes!!)
* to = * from ;
return ;
}
//
// write the message
//
if ( ! to - > number )
SV_Error ( " Unset entity number " ) ;
2009-01-30 06:46:21 +00:00
if ( ! bits & & ! evenmorebits & & ! force )
2004-08-23 00:15:46 +00:00
return ; // nothing to send!
2009-01-30 06:46:21 +00:00
# ifdef PROTOCOLEXTENSIONS
if ( to - > number > = 512 )
{
if ( to - > number > = 1024 )
{
if ( to - > number > = 1024 + 512 )
evenmorebits | = U_ENTITYDBL ;
evenmorebits | = U_ENTITYDBL2 ;
if ( to - > number > = 2048 )
2011-10-27 16:16:29 +00:00
return ;
2009-01-30 06:46:21 +00:00
}
else
evenmorebits | = U_ENTITYDBL ;
}
if ( evenmorebits & 0xff00 )
evenmorebits | = U_YETMORE ;
if ( evenmorebits & 0x00ff )
bits | = U_EVENMORE ;
if ( bits & 511 )
bits | = U_MOREBITS ;
# endif
2004-08-23 00:15:46 +00:00
i = ( to - > number & 511 ) | ( bits & ~ 511 ) ;
if ( i & U_REMOVE )
Sys_Error ( " U_REMOVE " ) ;
MSG_WriteShort ( msg , i ) ;
if ( bits & U_MOREBITS )
MSG_WriteByte ( msg , bits & 255 ) ;
# ifdef PROTOCOLEXTENSIONS
if ( bits & U_EVENMORE )
MSG_WriteByte ( msg , evenmorebits & 255 ) ;
if ( evenmorebits & U_YETMORE )
MSG_WriteByte ( msg , ( evenmorebits > > 8 ) & 255 ) ;
# endif
if ( bits & U_MODEL )
MSG_WriteByte ( msg , to - > modelindex & 255 ) ;
2011-07-30 14:14:56 +00:00
else if ( evenmorebits & U_MODELDBL )
MSG_WriteShort ( msg , to - > modelindex ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_FRAME )
MSG_WriteByte ( msg , to - > frame ) ;
if ( bits & U_COLORMAP )
MSG_WriteByte ( msg , to - > colormap ) ;
if ( bits & U_SKIN )
2015-10-11 11:34:58 +00:00
MSG_WriteByte ( msg , to - > skinnum & 0xff ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_EFFECTS )
2005-08-26 22:56:51 +00:00
MSG_WriteByte ( msg , to - > effects & 0x00ff ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ORIGIN1 )
2021-08-04 21:16:57 +00:00
SZ_Write ( msg , & coordd [ 0 ] , ( coordtype & 0xf ) ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ANGLE1 )
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
SZ_Write ( msg , & angled [ 0 ] , msg - > prim . anglesize ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ORIGIN2 )
2021-08-04 21:16:57 +00:00
SZ_Write ( msg , & coordd [ 1 ] , ( coordtype & 0xf ) ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ANGLE2 )
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
SZ_Write ( msg , & angled [ 1 ] , msg - > prim . anglesize ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ORIGIN3 )
2021-08-04 21:16:57 +00:00
SZ_Write ( msg , & coordd [ 2 ] , ( coordtype & 0xf ) ) ;
2004-08-23 00:15:46 +00:00
if ( bits & U_ANGLE3 )
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
SZ_Write ( msg , & angled [ 2 ] , msg - > prim . anglesize ) ;
2004-08-23 00:15:46 +00:00
# ifdef U_SCALE
if ( evenmorebits & U_SCALE )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , ( qbyte ) ( to - > scale ) ) ;
2004-08-23 00:15:46 +00:00
# endif
# ifdef U_TRANS
if ( evenmorebits & U_TRANS )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , ( qbyte ) ( to - > trans ) ) ;
2004-08-23 00:15:46 +00:00
# endif
# ifdef U_FATNESS
if ( evenmorebits & U_FATNESS )
2005-07-01 19:23:00 +00:00
MSG_WriteChar ( msg , to - > fatness ) ;
2004-08-23 00:15:46 +00:00
# endif
if ( evenmorebits & U_DRAWFLAGS )
2005-05-15 18:49:04 +00:00
MSG_WriteByte ( msg , to - > hexen2flags ) ;
2004-08-23 00:15:46 +00:00
if ( evenmorebits & U_ABSLIGHT )
MSG_WriteByte ( msg , to - > abslight ) ;
2005-05-15 18:49:04 +00:00
2006-02-27 00:42:25 +00:00
if ( evenmorebits & U_COLOURMOD )
{
MSG_WriteByte ( msg , to - > colormod [ 0 ] ) ;
MSG_WriteByte ( msg , to - > colormod [ 1 ] ) ;
MSG_WriteByte ( msg , to - > colormod [ 2 ] ) ;
}
2005-05-15 18:49:04 +00:00
if ( evenmorebits & U_DPFLAGS )
MSG_WriteByte ( msg , to - > dpflags ) ;
2005-07-01 19:23:00 +00:00
if ( evenmorebits & U_TAGINFO )
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
MSG_WriteEntity ( msg , to - > tagentity ) ;
2005-07-01 19:23:00 +00:00
MSG_WriteShort ( msg , to - > tagindex ) ;
}
2005-08-07 18:08:13 +00:00
if ( evenmorebits & U_LIGHT )
{
MSG_WriteShort ( msg , to - > light [ 0 ] ) ;
MSG_WriteShort ( msg , to - > light [ 1 ] ) ;
MSG_WriteShort ( msg , to - > light [ 2 ] ) ;
MSG_WriteShort ( msg , to - > light [ 3 ] ) ;
MSG_WriteByte ( msg , to - > lightstyle ) ;
MSG_WriteByte ( msg , to - > lightpflags ) ;
}
2005-08-26 22:56:51 +00:00
if ( evenmorebits & U_EFFECTS16 )
MSG_WriteByte ( msg , ( to - > effects & 0xff00 ) > > 8 ) ;
2004-08-23 00:15:46 +00:00
}
2012-02-12 05:18:31 +00:00
/*special flags which are slightly more compact. these are 'wasted' as part of the delta itself*/
2012-02-14 15:50:34 +00:00
# define UF_REMOVE UF_16BIT /*says we removed the entity in this frame*/
# define UF_MOVETYPE UF_EFFECTS2 /*this flag isn't present in the header itself*/
# define UF_RESET2 UF_EXTEND1 /*so new ents are reset 3 times to avoid weird baselines*/
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
//#define UF_UNUSED UF_EXTEND2 /**/
# define UF_WEAPONFRAME_OLD UF_EXTEND2
2015-02-02 08:01:53 +00:00
# define UF_VIEWANGLES UF_EXTEND3 /**/
2012-02-14 15:50:34 +00:00
static unsigned int SVFTE_DeltaPredCalcBits ( entity_state_t * from , entity_state_t * to )
{
unsigned int bits = 0 ;
if ( from & & from - > u . q1 . pmovetype ! = to - > u . q1 . pmovetype )
bits | = UFP_MOVETYPE ;
if ( to - > u . q1 . movement [ 0 ] )
bits | = UFP_FORWARD ;
if ( to - > u . q1 . movement [ 1 ] )
bits | = UFP_SIDE ;
if ( to - > u . q1 . movement [ 2 ] )
bits | = UFP_UP ;
if ( to - > u . q1 . velocity [ 0 ] )
bits | = UFP_VELOCITYXY ;
if ( to - > u . q1 . velocity [ 1 ] )
bits | = UFP_VELOCITYXY ;
if ( to - > u . q1 . velocity [ 2 ] )
bits | = UFP_VELOCITYZ ;
if ( to - > u . q1 . msec )
bits | = UFP_MSEC ;
return bits ;
}
2012-02-12 05:18:31 +00:00
2016-07-12 00:40:13 +00:00
static unsigned int SVFTE_DeltaCalcBits ( entity_state_t * from , qbyte * frombonedata , entity_state_t * to , qbyte * tobonedata )
2012-02-12 05:18:31 +00:00
{
unsigned int bits = 0 ;
2012-02-14 15:50:34 +00:00
if ( from - > u . q1 . pmovetype ! = to - > u . q1 . pmovetype )
bits | = UF_PREDINFO | UF_MOVETYPE ;
if ( from - > u . q1 . weaponframe ! = to - > u . q1 . weaponframe )
2015-02-02 08:01:53 +00:00
bits | = UF_PREDINFO | UF_WEAPONFRAME_OLD ;
2012-02-12 05:18:31 +00:00
if ( to - > u . q1 . pmovetype )
{
2012-02-14 15:50:34 +00:00
if ( SVFTE_DeltaPredCalcBits ( from , to ) )
bits | = UF_PREDINFO ;
/*moving players get extra data forced upon them which is not deltatracked*/
if ( ( bits & UF_PREDINFO ) & & ( from - > u . q1 . velocity [ 0 ] | | from - > u . q1 . velocity [ 1 ] | | from - > u . q1 . velocity [ 2 ] ) )
{
/*if we've got player movement then write the origin anyway*/
bits | = UF_ORIGINXY | UF_ORIGINZ ;
/*and force angles too, if its not us*/
if ( host_client ! = svs . clients + to - > number - 1 )
bits | = UF_ANGLESXZ | UF_ANGLESY ;
}
2012-02-12 05:18:31 +00:00
}
if ( to - > origin [ 0 ] ! = from - > origin [ 0 ] )
bits | = UF_ORIGINXY ;
if ( to - > origin [ 1 ] ! = from - > origin [ 1 ] )
bits | = UF_ORIGINXY ;
if ( to - > origin [ 2 ] ! = from - > origin [ 2 ] )
bits | = UF_ORIGINZ ;
if ( to - > angles [ 0 ] ! = from - > angles [ 0 ] )
bits | = UF_ANGLESXZ ;
if ( to - > angles [ 1 ] ! = from - > angles [ 1 ] )
bits | = UF_ANGLESY ;
if ( to - > angles [ 2 ] ! = from - > angles [ 2 ] )
bits | = UF_ANGLESXZ ;
if ( to - > modelindex ! = from - > modelindex )
bits | = UF_MODEL ;
if ( to - > frame ! = from - > frame )
bits | = UF_FRAME ;
if ( to - > skinnum ! = from - > skinnum )
bits | = UF_SKIN ;
if ( to - > colormap ! = from - > colormap )
bits | = UF_COLORMAP ;
if ( to - > effects ! = from - > effects )
bits | = UF_EFFECTS ;
if ( to - > dpflags ! = from - > dpflags )
bits | = UF_FLAGS ;
2016-07-12 00:40:13 +00:00
if ( to - > solidsize ! = from - > solidsize )
2012-02-12 05:18:31 +00:00
bits | = UF_SOLID ;
if ( to - > scale ! = from - > scale )
bits | = UF_SCALE ;
if ( to - > trans ! = from - > trans )
bits | = UF_ALPHA ;
if ( to - > fatness ! = from - > fatness )
bits | = UF_FATNESS ;
2016-07-12 00:40:13 +00:00
if ( to - > hexen2flags ! = from - > hexen2flags | | to - > abslight ! = from - > abslight )
2013-03-12 22:35:33 +00:00
bits | = UF_DRAWFLAGS ;
2012-02-12 05:18:31 +00:00
2016-07-12 00:40:13 +00:00
if ( to - > bonecount ! = from - > bonecount | | ( to - > bonecount & & memcmp ( frombonedata + from - > boneoffset , tobonedata + to - > boneoffset , to - > bonecount * sizeof ( short ) * 7 ) ) )
bits | = UF_BONEDATA ;
if ( ! to - > bonecount & & ( to - > basebone ! = from - > basebone | | to - > baseframe ! = from - > baseframe ) )
bits | = UF_BONEDATA ;
2012-02-12 05:18:31 +00:00
if ( to - > colormod [ 0 ] ! = from - > colormod [ 0 ] | | to - > colormod [ 1 ] ! = from - > colormod [ 1 ] | | to - > colormod [ 2 ] ! = from - > colormod [ 2 ] )
bits | = UF_COLORMOD ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( to - > glowsize ! = from - > glowsize | | to - > glowcolour ! = from - > glowcolour | | to - > glowmod [ 0 ] ! = from - > glowmod [ 0 ] | | to - > glowmod [ 1 ] ! = from - > glowmod [ 1 ] | | to - > glowmod [ 2 ] ! = from - > glowmod [ 2 ] )
bits | = UF_GLOW ;
2012-02-12 05:18:31 +00:00
if ( to - > tagentity ! = from - > tagentity | | to - > tagindex ! = from - > tagindex )
bits | = UF_TAGINFO ;
2013-10-29 17:38:22 +00:00
if ( to - > light [ 0 ] ! = from - > light [ 0 ] | | to - > light [ 1 ] ! = from - > light [ 1 ] | | to - > light [ 2 ] ! = from - > light [ 2 ] | | to - > light [ 3 ] ! = from - > light [ 3 ] | | to - > lightstyle ! = from - > lightstyle | | to - > lightpflags ! = from - > lightpflags )
2012-02-12 05:18:31 +00:00
bits | = UF_LIGHT ;
2016-10-22 07:06:51 +00:00
if ( to - > u . q1 . traileffectnum ! = from - > u . q1 . traileffectnum | | to - > u . q1 . emiteffectnum ! = from - > u . q1 . emiteffectnum )
2012-07-05 19:42:36 +00:00
bits | = UF_TRAILEFFECT ;
2013-03-12 22:36:18 +00:00
if ( to - > modelindex2 ! = from - > modelindex2 )
bits | = UF_MODELINDEX2 ;
2012-07-05 19:42:36 +00:00
if ( to - > u . q1 . gravitydir [ 0 ] ! = from - > u . q1 . gravitydir [ 0 ] | | to - > u . q1 . gravitydir [ 1 ] ! = from - > u . q1 . gravitydir [ 1 ] )
bits | = UF_GRAVITYDIR ;
2012-02-12 05:18:31 +00:00
return bits ;
}
2021-08-04 21:16:57 +00:00
static void SVFTE_WriteUpdate ( unsigned int bits , entity_state_t * state , sizebuf_t * msg , unsigned int pext2 , unsigned int ezext1 , qbyte * boneptr )
2012-02-12 05:18:31 +00:00
{
unsigned int predbits = 0 ;
if ( bits & UF_MOVETYPE )
{
bits & = ~ UF_MOVETYPE ;
predbits | = UFP_MOVETYPE ;
}
2015-02-02 08:01:53 +00:00
if ( pext2 & PEXT2_PREDINFO )
2012-02-14 15:50:34 +00:00
{
2015-02-02 08:01:53 +00:00
if ( bits & UF_VIEWANGLES )
{
bits & = ~ UF_VIEWANGLES ;
bits | = UF_PREDINFO ;
predbits | = UFP_VIEWANGLE ;
}
}
else
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( bits & UF_VIEWANGLES )
{
bits & = ~ UF_VIEWANGLES ;
bits | = UF_PREDINFO ;
}
2015-02-02 08:01:53 +00:00
if ( bits & UF_WEAPONFRAME_OLD )
{
bits & = ~ UF_WEAPONFRAME_OLD ;
predbits | = UFP_WEAPONFRAME_OLD ;
}
2012-02-14 15:50:34 +00:00
}
2012-02-12 05:18:31 +00:00
2016-07-12 00:40:13 +00:00
if ( ! ( pext2 & PEXT2_NEWSIZEENCODING ) ) //was added at the same time
bits & = ~ UF_BONEDATA ;
2012-02-12 05:18:31 +00:00
/*check if we need more precision*/
if ( ( bits & UF_MODEL ) & & state - > modelindex > 255 )
bits | = UF_16BIT ;
if ( ( bits & UF_SKIN ) & & state - > skinnum > 255 )
bits | = UF_16BIT ;
if ( ( bits & UF_FRAME ) & & state - > frame > 255 )
bits | = UF_16BIT ;
/*convert effects bits to higher lengths if needed*/
if ( bits & UF_EFFECTS )
{
if ( state - > effects & 0xffff0000 ) /*both*/
bits | = UF_EFFECTS | UF_EFFECTS2 ;
else if ( state - > effects & 0x0000ff00 ) /*2 only*/
bits = ( bits & ~ UF_EFFECTS ) | UF_EFFECTS2 ;
}
if ( bits & 0xff000000 )
bits | = UF_EXTEND3 ;
if ( bits & 0x00ff0000 )
bits | = UF_EXTEND2 ;
if ( bits & 0x0000ff00 )
bits | = UF_EXTEND1 ;
2014-02-07 08:38:40 +00:00
MSG_WriteByte ( msg , ( bits > > 0 ) & 0xff ) ;
2012-02-12 05:18:31 +00:00
if ( bits & UF_EXTEND1 )
2014-02-07 08:38:40 +00:00
MSG_WriteByte ( msg , ( bits > > 8 ) & 0xff ) ;
2012-02-12 05:18:31 +00:00
if ( bits & UF_EXTEND2 )
2014-02-07 08:38:40 +00:00
MSG_WriteByte ( msg , ( bits > > 16 ) & 0xff ) ;
2012-02-12 05:18:31 +00:00
if ( bits & UF_EXTEND3 )
2014-02-07 08:38:40 +00:00
MSG_WriteByte ( msg , ( bits > > 24 ) & 0xff ) ;
2012-02-12 05:18:31 +00:00
if ( bits & UF_FRAME )
{
if ( bits & UF_16BIT )
MSG_WriteShort ( msg , state - > frame ) ;
else
MSG_WriteByte ( msg , state - > frame ) ;
}
2021-08-04 21:16:57 +00:00
if ( ezext1 & EZPEXT1_FLOATENTCOORDS )
2012-02-12 05:18:31 +00:00
{
2021-08-04 21:16:57 +00:00
if ( bits & UF_ORIGINXY )
{
MSG_WriteFloat ( msg , state - > origin [ 0 ] ) ;
MSG_WriteFloat ( msg , state - > origin [ 1 ] ) ;
}
if ( bits & UF_ORIGINZ )
MSG_WriteFloat ( msg , state - > origin [ 2 ] ) ;
}
else
{
if ( bits & UF_ORIGINXY )
{
MSG_WriteCoord ( msg , state - > origin [ 0 ] ) ;
MSG_WriteCoord ( msg , state - > origin [ 1 ] ) ;
}
if ( bits & UF_ORIGINZ )
MSG_WriteCoord ( msg , state - > origin [ 2 ] ) ;
2012-02-12 05:18:31 +00:00
}
2015-02-02 08:01:53 +00:00
if ( ( bits & UF_PREDINFO ) & & ! ( pext2 & PEXT2_PREDINFO ) )
2012-02-12 05:18:31 +00:00
{ /*if we have pred info, use more precise angles*/
if ( bits & UF_ANGLESXZ )
{
MSG_WriteAngle16 ( msg , state - > angles [ 0 ] ) ;
MSG_WriteAngle16 ( msg , state - > angles [ 2 ] ) ;
}
if ( bits & UF_ANGLESY )
MSG_WriteAngle16 ( msg , state - > angles [ 1 ] ) ;
}
else
{
if ( bits & UF_ANGLESXZ )
{
MSG_WriteAngle ( msg , state - > angles [ 0 ] ) ;
MSG_WriteAngle ( msg , state - > angles [ 2 ] ) ;
}
if ( bits & UF_ANGLESY )
MSG_WriteAngle ( msg , state - > angles [ 1 ] ) ;
}
if ( ( bits & ( UF_EFFECTS | UF_EFFECTS2 ) ) = = ( UF_EFFECTS | UF_EFFECTS2 ) )
MSG_WriteLong ( msg , state - > effects ) ;
else if ( bits & UF_EFFECTS2 )
MSG_WriteShort ( msg , state - > effects ) ;
else if ( bits & UF_EFFECTS )
MSG_WriteByte ( msg , state - > effects ) ;
if ( bits & UF_PREDINFO )
{
/*movetype is set above somewhere*/
2012-02-14 15:50:34 +00:00
predbits | = SVFTE_DeltaPredCalcBits ( NULL , state ) ;
2012-02-12 05:18:31 +00:00
MSG_WriteByte ( msg , predbits ) ;
if ( predbits & UFP_FORWARD )
MSG_WriteShort ( msg , state - > u . q1 . movement [ 0 ] ) ;
if ( predbits & UFP_SIDE )
MSG_WriteShort ( msg , state - > u . q1 . movement [ 1 ] ) ;
if ( predbits & UFP_UP )
MSG_WriteShort ( msg , state - > u . q1 . movement [ 2 ] ) ;
if ( predbits & UFP_MOVETYPE )
MSG_WriteByte ( msg , state - > u . q1 . pmovetype ) ;
if ( predbits & UFP_VELOCITYXY )
{
MSG_WriteShort ( msg , state - > u . q1 . velocity [ 0 ] ) ;
MSG_WriteShort ( msg , state - > u . q1 . velocity [ 1 ] ) ;
}
if ( predbits & UFP_VELOCITYZ )
MSG_WriteShort ( msg , state - > u . q1 . velocity [ 2 ] ) ;
if ( predbits & UFP_MSEC )
MSG_WriteByte ( msg , state - > u . q1 . msec ) ;
2015-02-02 08:01:53 +00:00
if ( pext2 & PEXT2_PREDINFO )
{
if ( predbits & UFP_VIEWANGLE )
{ /*if we have pred info, use more precise angles*/
if ( bits & UF_ANGLESXZ )
{
MSG_WriteShort ( msg , state - > u . q1 . vangle [ 0 ] ) ;
MSG_WriteShort ( msg , state - > u . q1 . vangle [ 2 ] ) ;
}
if ( bits & UF_ANGLESY )
MSG_WriteShort ( msg , state - > u . q1 . vangle [ 1 ] ) ;
}
}
else
2012-02-14 15:50:34 +00:00
{
2015-02-02 08:01:53 +00:00
if ( predbits & UFP_WEAPONFRAME_OLD )
2012-02-14 15:50:34 +00:00
{
2015-02-02 08:01:53 +00:00
if ( state - > u . q1 . weaponframe > 127 )
{
MSG_WriteByte ( msg , 128 | ( state - > u . q1 . weaponframe & 127 ) ) ;
MSG_WriteByte ( msg , state - > u . q1 . weaponframe > > 7 ) ;
}
else
MSG_WriteByte ( msg , state - > u . q1 . weaponframe ) ;
2012-02-14 15:50:34 +00:00
}
}
2012-02-12 05:18:31 +00:00
}
if ( bits & UF_MODEL )
{
if ( bits & UF_16BIT )
MSG_WriteShort ( msg , state - > modelindex ) ;
else
MSG_WriteByte ( msg , state - > modelindex ) ;
}
if ( bits & UF_SKIN )
{
if ( bits & UF_16BIT )
MSG_WriteShort ( msg , state - > skinnum ) ;
else
MSG_WriteByte ( msg , state - > skinnum ) ;
}
if ( bits & UF_COLORMAP )
2014-05-30 03:57:30 +00:00
MSG_WriteByte ( msg , state - > colormap & 0xff ) ;
2012-02-12 05:18:31 +00:00
if ( bits & UF_SOLID )
2016-07-12 00:40:13 +00:00
{
if ( pext2 & PEXT2_NEWSIZEENCODING )
{
if ( ! state - > solidsize )
MSG_WriteByte ( msg , 0 ) ;
else if ( state - > solidsize = = ES_SOLID_BSP )
MSG_WriteByte ( msg , 1 ) ;
else if ( state - > solidsize = = ES_SOLID_HULL1 )
MSG_WriteByte ( msg , 2 ) ;
else if ( state - > solidsize = = ES_SOLID_HULL2 )
MSG_WriteByte ( msg , 3 ) ;
else if ( ! ES_SOLID_HAS_EXTRA_BITS ( state - > solidsize ) )
{
MSG_WriteByte ( msg , 16 ) ;
MSG_WriteSize16 ( msg , state - > solidsize ) ;
}
else
{
MSG_WriteByte ( msg , 32 ) ;
MSG_WriteLong ( msg , state - > solidsize ) ;
}
}
else
MSG_WriteSize16 ( msg , state - > solidsize ) ;
}
2012-02-12 05:18:31 +00:00
if ( bits & UF_FLAGS )
MSG_WriteByte ( msg , state - > dpflags ) ;
if ( bits & UF_ALPHA )
MSG_WriteByte ( msg , state - > trans ) ;
if ( bits & UF_SCALE )
MSG_WriteByte ( msg , state - > scale ) ;
2016-07-12 00:40:13 +00:00
if ( bits & UF_BONEDATA )
2013-03-12 22:35:33 +00:00
{
2016-07-12 00:40:13 +00:00
short * bonedata ;
int i ;
qbyte bfl = 0 ;
if ( state - > bonecount & & boneptr )
bfl | = 0x80 ;
if ( state - > basebone | | state - > baseframe )
bfl | = 0x40 ;
MSG_WriteByte ( msg , bfl ) ;
if ( bfl & 0x80 )
{
//this is NOT finalized
MSG_WriteByte ( msg , state - > bonecount ) ;
bonedata = ( short * ) ( boneptr + state - > boneoffset ) ;
for ( i = 0 ; i < state - > bonecount * 7 ; i + + )
MSG_WriteShort ( msg , bonedata [ i ] ) ;
}
if ( bfl & 0x40 )
{
MSG_WriteByte ( msg , state - > basebone ) ;
MSG_WriteShort ( msg , state - > baseframe ) ;
}
2013-03-12 22:35:33 +00:00
}
2012-02-12 05:18:31 +00:00
if ( bits & UF_DRAWFLAGS )
2013-03-12 22:35:33 +00:00
{
2012-02-12 05:18:31 +00:00
MSG_WriteByte ( msg , state - > hexen2flags ) ;
2016-07-12 00:40:13 +00:00
if ( ( state - > hexen2flags & MLS_MASK ) = = MLS_ABSLIGHT )
2013-03-12 22:35:33 +00:00
MSG_WriteByte ( msg , state - > abslight ) ;
}
2012-02-12 05:18:31 +00:00
if ( bits & UF_TAGINFO )
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
MSG_WriteEntity ( msg , state - > tagentity ) ;
2017-06-21 01:24:25 +00:00
MSG_WriteByte ( msg , state - > tagindex & 0xff ) ;
2012-02-12 05:18:31 +00:00
}
if ( bits & UF_LIGHT )
{
MSG_WriteShort ( msg , state - > light [ 0 ] ) ;
MSG_WriteShort ( msg , state - > light [ 1 ] ) ;
MSG_WriteShort ( msg , state - > light [ 2 ] ) ;
MSG_WriteShort ( msg , state - > light [ 3 ] ) ;
MSG_WriteByte ( msg , state - > lightstyle ) ;
MSG_WriteByte ( msg , state - > lightpflags ) ;
}
2012-07-05 19:42:36 +00:00
if ( bits & UF_TRAILEFFECT )
2016-10-22 07:06:51 +00:00
{
if ( state - > u . q1 . emiteffectnum )
{
MSG_WriteShort ( msg , ( state - > u . q1 . traileffectnum & 0x3fff ) | 0x8000 ) ;
MSG_WriteShort ( msg , ( state - > u . q1 . emiteffectnum & 0x3fff ) ) ;
}
else
MSG_WriteShort ( msg , ( state - > u . q1 . traileffectnum & 0x3fff ) ) ;
}
2012-02-12 05:18:31 +00:00
if ( bits & UF_COLORMOD )
{
MSG_WriteByte ( msg , state - > colormod [ 0 ] ) ;
MSG_WriteByte ( msg , state - > colormod [ 1 ] ) ;
MSG_WriteByte ( msg , state - > colormod [ 2 ] ) ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( bits & UF_GLOW )
2012-02-12 05:18:31 +00:00
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
MSG_WriteByte ( msg , state - > glowsize ) ;
MSG_WriteByte ( msg , state - > glowcolour ) ;
2012-02-12 05:18:31 +00:00
MSG_WriteByte ( msg , state - > glowmod [ 0 ] ) ;
MSG_WriteByte ( msg , state - > glowmod [ 1 ] ) ;
MSG_WriteByte ( msg , state - > glowmod [ 2 ] ) ;
}
if ( bits & UF_FATNESS )
MSG_WriteByte ( msg , state - > fatness ) ;
2012-07-05 19:42:36 +00:00
if ( bits & UF_MODELINDEX2 )
{
if ( bits & UF_16BIT )
MSG_WriteShort ( msg , state - > modelindex2 ) ;
else
MSG_WriteByte ( msg , state - > modelindex2 ) ;
}
if ( bits & UF_GRAVITYDIR )
{
MSG_WriteByte ( msg , state - > u . q1 . gravitydir [ 0 ] ) ;
MSG_WriteByte ( msg , state - > u . q1 . gravitydir [ 1 ] ) ;
}
}
/*dump out the delta from baseline (used for baselines and statics, so has no svc)*/
2021-08-04 21:16:57 +00:00
void SVFTE_EmitBaseline ( entity_state_t * to , qboolean numberisimportant , sizebuf_t * msg , unsigned int pext2 , unsigned int ezext )
2012-07-05 19:42:36 +00:00
{
unsigned int bits ;
if ( numberisimportant )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
MSG_WriteEntity ( msg , to - > number ) ;
2016-07-12 00:40:13 +00:00
bits = UF_RESET | SVFTE_DeltaCalcBits ( & nullentitystate , NULL , to , NULL ) ;
2021-08-04 21:16:57 +00:00
SVFTE_WriteUpdate ( bits , to , msg , pext2 , ezext , NULL ) ;
2012-02-12 05:18:31 +00:00
}
/*SVFTE_EmitPacketEntities
Writes changed entities to the client .
Changed ent states will be tracked , even if they ' re not sent just yet , dropped packets will also re - flag dropped delta bits
Only what changed is tracked , via bitmask , its previous value is never tracked .
*/
2016-10-22 07:06:51 +00:00
qboolean SVFTE_EmitPacketEntities ( client_t * client , packet_entities_t * to , sizebuf_t * msg )
2012-02-12 05:18:31 +00:00
{
2012-02-14 15:50:34 +00:00
edict_t * e ;
2012-02-12 05:18:31 +00:00
entity_state_t * o , * n ;
unsigned int i ;
unsigned int j ;
2012-02-14 15:50:34 +00:00
unsigned int bits ;
2016-07-12 00:40:13 +00:00
struct resendinfo_s * resend ;
2012-02-14 15:50:34 +00:00
unsigned int outno , outmax ;
2013-03-12 22:35:33 +00:00
int sequence ;
2016-07-12 00:40:13 +00:00
qbyte * oldbonedata ;
unsigned int maxbonedatasize ;
2016-10-22 07:06:51 +00:00
qboolean overflow = false ;
2018-07-22 11:49:37 +00:00
client_t * cl ;
float age ;
client_frame_t * frame ;
2013-03-12 22:35:33 +00:00
2016-07-12 00:40:13 +00:00
if ( ! client - > pendingdeltabits )
2016-10-22 07:06:51 +00:00
return false ;
2013-03-12 22:35:33 +00:00
2013-10-29 17:38:22 +00:00
if ( client - > delta_sequence < 0 )
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ 0 ] = UF_REMOVE ;
2012-02-12 05:18:31 +00:00
2012-02-14 15:50:34 +00:00
//if we're clearing the list and starting from scratch, just wipe all lingering state
2016-07-12 00:40:13 +00:00
if ( client - > pendingdeltabits [ 0 ] & UF_REMOVE )
2012-02-12 05:18:31 +00:00
{
2013-03-12 22:35:33 +00:00
for ( j = 0 ; j < client - > sentents . num_entities ; j + + )
2012-02-12 05:18:31 +00:00
{
client - > sentents . entities [ j ] . number = 0 ;
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] = 0 ;
2012-02-12 05:18:31 +00:00
}
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ 0 ] = UF_REMOVE ;
2012-02-12 05:18:31 +00:00
}
2012-02-14 15:50:34 +00:00
//expand client's entstate list
2012-02-12 05:18:31 +00:00
if ( to - > num_entities )
{
j = to - > entities [ to - > num_entities - 1 ] . number + 1 ;
if ( j > client - > sentents . max_entities )
{
client - > sentents . entities = BZ_Realloc ( client - > sentents . entities , sizeof ( * client - > sentents . entities ) * j ) ;
memset ( & client - > sentents . entities [ client - > sentents . max_entities ] , 0 , sizeof ( client - > sentents . entities [ 0 ] ) * ( j - client - > sentents . max_entities ) ) ;
client - > sentents . max_entities = j ;
}
2014-01-15 23:28:51 +00:00
while ( j > client - > sentents . num_entities )
2014-02-07 08:38:40 +00:00
{
client - > sentents . entities [ client - > sentents . num_entities ] . number = 0 ;
client - > sentents . num_entities + + ;
}
2012-02-12 05:18:31 +00:00
}
2016-07-12 00:40:13 +00:00
//orphan and regenerate
oldbonedata = client - > sentents . bonedata ;
maxbonedatasize = client - > sentents . bonedatamax ;
if ( client - > sentents . bonedatacur )
{
client - > sentents . bonedata = BZ_Malloc ( maxbonedatasize ) ;
client - > sentents . bonedatacur = 0 ;
client - > sentents . bonedatamax = maxbonedatasize ;
}
else
{
client - > sentents . bonedata = NULL ;
client - > sentents . bonedatacur = 0 ;
client - > sentents . bonedatamax = 0 ;
}
2012-02-14 15:50:34 +00:00
/*figure out the entitys+bits that changed (removed and active)*/
2012-02-12 05:18:31 +00:00
for ( i = 0 , j = 0 ; i < to - > num_entities ; i + + )
{
n = & to - > entities [ i ] ;
/*gaps are dead entities*/
for ( ; j < n - > number ; j + + )
{
o = & client - > sentents . entities [ j ] ;
if ( o - > number )
{
2018-04-06 17:21:15 +00:00
e = EDICT_NUM_PB ( svprogfuncs , o - > number ) ;
2012-02-14 15:50:34 +00:00
if ( ! ( ( int ) e - > xv - > pvsflags & PVSF_NOREMOVE ) )
{
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] = UF_REMOVE ;
2012-02-14 15:50:34 +00:00
o - > number = 0 ; /*dead*/
2016-07-12 00:40:13 +00:00
o - > bonecount = 0 ; /*don't waste cycles*/
}
else if ( o - > bonecount )
{
short * srcbdata = ( short * ) ( oldbonedata + o - > boneoffset ) ;
short * bonedata = AllocateBoneSpace ( & client - > sentents , o - > bonecount , & o - > boneoffset ) ;
memcpy ( bonedata , srcbdata , sizeof ( short ) * 7 * o - > bonecount ) ;
2012-02-14 15:50:34 +00:00
}
2012-02-12 05:18:31 +00:00
}
}
o = & client - > sentents . entities [ j ] ;
if ( ! o - > number )
{
2012-02-14 15:50:34 +00:00
/*flag it for reset, we can add the extra bits later once we get around to sending it*/
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] = UF_RESET | UF_RESET2 ;
2012-02-12 05:18:31 +00:00
}
else
{
2013-03-12 22:35:33 +00:00
//its valid, make sure we don't have a stale/resent remove, and do a cheap reset due to uncertainty.
2016-07-12 00:40:13 +00:00
if ( client - > pendingdeltabits [ j ] & UF_REMOVE )
client - > pendingdeltabits [ j ] = ( client - > pendingdeltabits [ j ] & ~ UF_REMOVE ) | UF_RESET2 ;
client - > pendingdeltabits [ j ] | = SVFTE_DeltaCalcBits ( o , oldbonedata , n , to - > bonedata ) ;
2014-01-15 02:32:13 +00:00
//even if prediction is disabled, we want to force velocity info to be sent for the local player. This is used by view bob and things.
2014-12-02 02:00:41 +00:00
if ( client - > edict & & j = = client - > edict - > entnum & & ( n - > u . q1 . velocity [ 0 ] | | n - > u . q1 . velocity [ 1 ] | | n - > u . q1 . velocity [ 2 ] ) )
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] | = UF_PREDINFO ;
2015-02-02 08:01:53 +00:00
//spectators(and mvds) should be told the actual view angles of the person they're trying to track
if ( j < = sv . allocated_client_slots & & ( ! client - > edict | | j = = client - > spec_track ) )
// if (client->pendingentbits[j])
{
if ( o - > u . q1 . vangle [ 0 ] ! = n - > u . q1 . vangle [ 0 ] | | o - > u . q1 . vangle [ 2 ] ! = n - > u . q1 . vangle [ 2 ] )
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] | = UF_ANGLESXZ ;
2015-02-02 08:01:53 +00:00
if ( o - > u . q1 . vangle [ 1 ] ! = n - > u . q1 . vangle [ 1 ] )
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] | = UF_ANGLESY ;
client - > pendingdeltabits [ j ] | = UF_VIEWANGLES ;
2015-02-02 08:01:53 +00:00
}
2012-02-12 05:18:31 +00:00
}
* o = * n ;
2016-07-12 00:40:13 +00:00
if ( o - > bonecount )
{
short * bonedata = AllocateBoneSpace ( & client - > sentents , o - > bonecount , & o - > boneoffset ) ;
short * srcbdata = ( short * ) ( to - > bonedata + n - > boneoffset ) ;
memcpy ( bonedata , srcbdata , sizeof ( short ) * 7 * o - > bonecount ) ;
}
2012-02-12 05:18:31 +00:00
j + + ;
}
2015-02-02 08:01:53 +00:00
2012-02-12 05:18:31 +00:00
/*gaps are dead entities*/
2013-03-12 22:35:33 +00:00
for ( ; j < client - > sentents . num_entities ; j + + )
2012-02-12 05:18:31 +00:00
{
o = & client - > sentents . entities [ j ] ;
if ( o - > number )
{
2018-04-06 17:21:15 +00:00
e = EDICT_NUM_PB ( svprogfuncs , o - > number ) ;
2012-02-14 15:50:34 +00:00
if ( ! ( ( int ) e - > xv - > pvsflags & PVSF_NOREMOVE ) )
{
2016-07-12 00:40:13 +00:00
client - > pendingdeltabits [ j ] = UF_REMOVE ;
2012-02-14 15:50:34 +00:00
o - > number = 0 ; /*dead*/
2016-07-12 00:40:13 +00:00
o - > bonecount = 0 ; /*don't waste cycles*/
}
else if ( o - > bonecount )
{
short * srcbdata = ( short * ) ( oldbonedata + o - > boneoffset ) ;
short * bonedata = AllocateBoneSpace ( & client - > sentents , o - > bonecount , & o - > boneoffset ) ;
memcpy ( bonedata , srcbdata , sizeof ( short ) * 7 * o - > bonecount ) ;
2012-02-14 15:50:34 +00:00
}
2012-02-12 05:18:31 +00:00
}
}
2016-07-12 00:40:13 +00:00
Z_Free ( oldbonedata ) ;
2016-10-22 07:06:51 +00:00
if ( ISNQCLIENT ( client ) )
sequence = client - > netchan . outgoing_unreliable ;
else
sequence = client - > netchan . incoming_sequence ;
2018-07-22 11:49:37 +00:00
frame = & client - > frameunion . frames [ sequence & UPDATE_MASK ] ;
2016-10-22 07:06:51 +00:00
2012-02-14 15:50:34 +00:00
/*cache frame info*/
2018-07-22 11:49:37 +00:00
resend = frame - > resend ;
2012-02-14 15:50:34 +00:00
outno = 0 ;
2018-07-22 11:49:37 +00:00
outmax = frame - > maxresend ;
2012-02-12 05:18:31 +00:00
2021-08-04 21:16:57 +00:00
if ( client - > fteprotocolextensions2 & PEXT2_VRINPUTS )
{
client_frame_t * ackedframe = & client - > frameunion . frames [ client - > delta_sequence & UPDATE_MASK ] ;
client_t * seat ;
for ( i = 0 , seat = client ; i < MAX_SPLITS & & seat ; i + + , seat = seat - > controlled )
{
if ( ackedframe - > baseanglelocked [ i ] ! = seat - > baseanglelock | |
ackedframe - > baseangles [ i ] [ 0 ] ! = seat - > baseangles [ 0 ] | |
ackedframe - > baseangles [ i ] [ 1 ] ! = seat - > baseangles [ 1 ] | |
ackedframe - > baseangles [ i ] [ 2 ] ! = seat - > baseangles [ 2 ] )
{ //change the base angle, and force the client to it.
//sent every frame its valid for, because we really don't want packetloss here.
int fl = 0 , j ;
for ( j = 0 ; j < 3 ; j + + )
if ( seat - > baseangles [ j ] )
fl | = ( 1u < < j ) ;
if ( ackedframe - > baseanglelocked [ i ] ! = seat - > baseanglelock )
fl | = 8 ;
if ( seat - > seat )
{
MSG_WriteByte ( msg , svcfte_choosesplitclient ) ;
MSG_WriteByte ( msg , seat - > seat ) ;
}
MSG_WriteByte ( msg , svcfte_setanglebase ) ;
MSG_WriteByte ( msg , fl ) ;
for ( j = 0 ; j < 3 ; j + + )
if ( fl & ( 1u < < j ) )
MSG_WriteShort ( msg , seat - > baseangles [ j ] ) ;
}
VectorCopy ( seat - > baseangles , frame - > baseangles [ i ] ) ;
frame - > baseanglelocked [ i ] = seat - > baseanglelock ;
}
}
2019-01-29 07:18:07 +00:00
if ( msg - > cursize + 52 < = msg - > maxsize )
2013-03-12 22:35:33 +00:00
{
2019-01-29 07:18:07 +00:00
/*start writing the packet*/
MSG_WriteByte ( msg , svcfte_updateentities ) ;
if ( ISNQCLIENT ( client ) & & ( client - > fteprotocolextensions2 & PEXT2_PREDINFO ) )
2016-10-22 07:06:51 +00:00
{
2019-01-29 07:18:07 +00:00
MSG_WriteShort ( msg , client - > last_sequence & 0xffff ) ;
2015-11-18 07:37:39 +00:00
}
2019-01-29 07:18:07 +00:00
// Con_Printf("Gen sequence %i\n", sequence);
MSG_WriteFloat ( msg , sv . world . physicstime ) ;
2012-02-12 05:18:31 +00:00
2019-01-29 07:18:07 +00:00
if ( client - > pendingdeltabits [ 0 ] & UF_REMOVE )
{
SV_EmitDeltaEntIndex ( msg , 0 , true , true ) ;
2016-07-12 00:40:13 +00:00
resend [ outno ] . bits = UF_REMOVE ;
2019-01-29 07:18:07 +00:00
resend [ outno ] . flags = 0 ;
resend [ outno + + ] . entnum = 0 ;
client - > pendingdeltabits [ 0 ] & = ~ UF_REMOVE ;
2012-02-12 05:18:31 +00:00
}
2019-01-29 07:18:07 +00:00
for ( j = 1 ; j < client - > sentents . num_entities ; j + + )
2012-02-12 05:18:31 +00:00
{
2019-01-29 07:18:07 +00:00
bits = client - > pendingdeltabits [ j ] ;
if ( ! ( bits & ~ UF_RESET2 ) ) //skip while there's nothing to send (skip reset2 if there's no other changes, its only to reduce chances of the client getting 'new' entities containing just an origin)*/
2017-03-04 19:36:06 +00:00
continue ;
2019-01-29 07:18:07 +00:00
if ( msg - > cursize + 52 > msg - > maxsize )
2012-02-14 15:50:34 +00:00
{
2019-01-29 07:18:07 +00:00
overflow = true ;
break ; /*give up if it gets full. FIXME: bone data is HUGE.*/
2012-02-14 15:50:34 +00:00
}
2019-01-29 07:18:07 +00:00
if ( outno > = outmax )
{ //expand the frames. may need some copying...
2019-02-19 06:49:03 +00:00
if ( outmax = = client - > max_net_ents )
break ;
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , outno + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
outmax = frame - > maxresend ;
2012-02-14 15:50:34 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
2019-01-29 07:18:07 +00:00
if ( bits & UF_REMOVE )
{ //if reset is set, then reset was set eroneously.
SV_EmitDeltaEntIndex ( msg , j , true , true ) ;
resend [ outno ] . bits = UF_REMOVE ;
// Con_Printf("REMOVE %i @ %i\n", j, sequence);
}
else if ( client - > sentents . entities [ j ] . number ) /*only send a new copy of the ent if they actually have one already*/
{
//if we didn't reach the end in the last packet, start at that point to avoid spam
//player slots are exempt from this, so they are in every packet (strictly speaking only the local player 'needs' this, but its nice to have it for high-priority targets too)
if ( j < client - > nextdeltaindex & & j > svs . allocated_client_slots )
continue ;
if ( bits & UF_RESET2 )
{
/*if reset2, then this is the second packet sent to the client and should have a forced reset (but which isn't tracked)*/
resend [ outno ] . bits = bits & ~ UF_RESET2 ;
bits = UF_RESET | SVFTE_DeltaCalcBits ( & EDICT_NUM_PB ( svprogfuncs , j ) - > baseline , NULL , & client - > sentents . entities [ j ] , client - > sentents . bonedata ) ;
// Con_Printf("RESET2 %i @ %i\n", j, sequence);
}
else if ( bits & UF_RESET )
{
/*flag the entity for the next packet, so we always get two resets when it appears, to reduce the effects of packetloss on seeing rockets etc*/
client - > pendingdeltabits [ j ] = UF_RESET2 ;
bits = UF_RESET | SVFTE_DeltaCalcBits ( & EDICT_NUM_PB ( svprogfuncs , j ) - > baseline , NULL , & client - > sentents . entities [ j ] , client - > sentents . bonedata ) ;
resend [ outno ] . bits = UF_RESET ;
// Con_Printf("RESET %i @ %i\n", j, sequence);
}
else
resend [ outno ] . bits = bits ;
2017-03-04 19:36:06 +00:00
2019-01-29 07:18:07 +00:00
SV_EmitDeltaEntIndex ( msg , j , false , true ) ;
2021-08-04 21:16:57 +00:00
SVFTE_WriteUpdate ( bits , & client - > sentents . entities [ j ] , msg , client - > fteprotocolextensions2 , client - > ezprotocolextensions1 , client - > sentents . bonedata ) ;
2019-01-29 07:18:07 +00:00
}
2017-03-04 19:36:06 +00:00
2019-01-29 07:18:07 +00:00
client - > pendingdeltabits [ j ] = 0 ;
resend [ outno ] . flags = 0 ;
resend [ outno + + ] . entnum = j ;
}
MSG_WriteShort ( msg , 0 ) ;
2012-02-12 05:18:31 +00:00
}
2012-02-14 15:50:34 +00:00
2017-03-04 19:36:06 +00:00
if ( j = = client - > sentents . num_entities ) //looks like we sent them all
client - > nextdeltaindex = 0 ; //start afresh with the next packet.
else
client - > nextdeltaindex = j ; //we overflowed or something, start going round-robin
2018-07-22 11:49:37 +00:00
frame - > numresend = outno ;
frame - > sequence = sequence ;
2018-12-28 00:04:36 +00:00
frame - > laggedtime = sv . time ;
2018-07-22 11:49:37 +00:00
for ( i = 0 ; i < to - > num_entities ; i + + )
{
n = & to - > entities [ i ] ;
j = n - > number - 1 ;
if ( j > = sv . allocated_client_slots )
break ; //don't track non-player slots.
cl = & svs . clients [ j ] ;
//states of other players are actually old.
//by the time we receive the other player's move, this stuff will be outdated and we don't know when that will actually be.
//so (cheaply) guess where they're really meant to be if they're running at a lower framerate.
if ( ! cl - > name [ 0 ] | | cl - > protocol = = SCP_BAD ) //is bot
age = 0 ; //= sv.time - sv.world.physicstime; //FIXME
else
age = sv . time - sv . world . physicstime ;
age = bound ( 0 , age , 0.1 ) ;
2018-12-28 00:04:36 +00:00
VectorMA ( n - > origin , ( sv . time - cl - > localtime ) / 8.0 , n - > u . q1 . velocity , frame - > laggedplayer [ j ] . origin ) ;
VectorCopy ( n - > angles , frame - > laggedplayer [ j ] . angles ) ;
2018-07-22 11:49:37 +00:00
//FIXME: add framestate_t info.
2018-12-28 00:04:36 +00:00
frame - > laggedplayer [ j ] . present = true ;
2018-07-22 11:49:37 +00:00
}
2016-10-22 07:06:51 +00:00
return overflow ;
2012-02-12 05:18:31 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = =
2012-02-12 05:18:31 +00:00
SVQW_EmitPacketEntities
2004-08-23 00:15:46 +00:00
Writes a delta update of a packet_entities_t to the message .
2012-02-12 05:18:31 +00:00
deltaing is performed from one set of entity states directly to the next
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = =
*/
2012-02-12 05:18:31 +00:00
void SVQW_EmitPacketEntities ( client_t * client , packet_entities_t * to , sizebuf_t * msg )
2004-08-23 00:15:46 +00:00
{
edict_t * ent ;
client_frame_t * fromframe ;
packet_entities_t * from ;
int oldindex , newindex ;
int oldnum , newnum ;
int oldmax ;
// this is the frame that we are going to delta update from
if ( client - > delta_sequence ! = - 1 )
{
2006-02-17 02:51:59 +00:00
fromframe = & client - > frameunion . frames [ client - > delta_sequence & UPDATE_MASK ] ;
2017-05-28 15:42:32 +00:00
from = & fromframe - > qwentities ;
2004-08-23 00:15:46 +00:00
oldmax = from - > num_entities ;
MSG_WriteByte ( msg , svc_deltapacketentities ) ;
MSG_WriteByte ( msg , client - > delta_sequence ) ;
}
else
{
oldmax = 0 ; // no delta update
from = NULL ;
MSG_WriteByte ( msg , svc_packetentities ) ;
}
newindex = 0 ;
oldindex = 0 ;
//Con_Printf ("---%i to %i ----\n", client->delta_sequence & UPDATE_MASK
// , client->netchan.outgoing_sequence & UPDATE_MASK);
while ( newindex < to - > num_entities | | oldindex < oldmax )
{
newnum = newindex > = to - > num_entities ? 9999 : to - > entities [ newindex ] . number ;
oldnum = oldindex > = oldmax ? 9999 : from - > entities [ oldindex ] . number ;
if ( newnum = = oldnum )
{ // delta update from old position
//Con_Printf ("delta %i\n", newnum);
# ifdef PROTOCOLEXTENSIONS
2021-08-04 21:16:57 +00:00
SVQW_WriteDelta ( & from - > entities [ oldindex ] , & to - > entities [ newindex ] , msg , false , client - > fteprotocolextensions , client - > ezprotocolextensions1 ) ;
2004-08-23 00:15:46 +00:00
# else
2012-02-12 05:18:31 +00:00
SVQW_WriteDelta ( & from - > entities [ oldindex ] , & to - > entities [ newindex ] , msg , false ) ;
2004-08-23 00:15:46 +00:00
# endif
oldindex + + ;
newindex + + ;
continue ;
}
if ( newnum < oldnum )
{ // this is a new entity, send it from the baseline
2009-03-03 01:52:30 +00:00
if ( svprogfuncs )
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_UB ( svprogfuncs , newnum ) ;
2009-03-03 01:52:30 +00:00
else
ent = NULL ;
2004-08-23 00:15:46 +00:00
//Con_Printf ("baseline %i\n", newnum);
# ifdef PROTOCOLEXTENSIONS
2021-08-04 21:16:57 +00:00
SVQW_WriteDelta ( & ent - > baseline , & to - > entities [ newindex ] , msg , true , client - > fteprotocolextensions , client - > ezprotocolextensions1 ) ;
2004-08-23 00:15:46 +00:00
# else
2012-02-12 05:18:31 +00:00
SVQW_WriteDelta ( & ent - > baseline , & to - > entities [ newindex ] , msg , true ) ;
2004-08-23 00:15:46 +00:00
# endif
newindex + + ;
continue ;
}
if ( newnum > oldnum )
{ // the old entity isn't present in the new message
//Con_Printf ("remove %i\n", oldnum);
2009-01-30 06:46:21 +00:00
if ( oldnum > = 512 )
2005-10-19 21:12:49 +00:00
{
//yup, this is expensive.
2012-02-06 02:06:23 +00:00
MSG_WriteShort ( msg , ( oldnum & 511 ) | U_REMOVE | U_MOREBITS ) ;
2005-10-19 21:12:49 +00:00
MSG_WriteByte ( msg , U_EVENMORE ) ;
if ( oldnum > = 1024 )
{
if ( oldnum > = 1024 + 512 )
MSG_WriteByte ( msg , U_ENTITYDBL | U_ENTITYDBL2 ) ;
2009-01-30 06:46:21 +00:00
else
MSG_WriteByte ( msg , U_ENTITYDBL2 ) ;
2005-10-19 21:12:49 +00:00
}
else
MSG_WriteByte ( msg , U_ENTITYDBL ) ;
}
else
2012-02-06 02:06:23 +00:00
MSG_WriteShort ( msg , ( oldnum & 511 ) | U_REMOVE ) ;
2005-10-19 21:12:49 +00:00
2004-08-23 00:15:46 +00:00
oldindex + + ;
continue ;
}
}
2005-10-19 21:12:49 +00:00
if ( newindex > to - > max_entities )
Con_Printf ( " Exceeded max entities \n " ) ;
2004-08-23 00:15:46 +00:00
MSG_WriteShort ( msg , 0 ) ; // end of packetentities
}
2005-06-14 04:52:10 +00:00
# ifdef NQPROT
2016-07-12 00:40:13 +00:00
unsigned int SVDP_CalcDelta ( entity_state_t * from , qbyte * frombonedatabase , entity_state_t * to , qbyte * tobonedatabase )
2005-06-14 04:52:10 +00:00
{
2016-07-12 00:40:13 +00:00
unsigned int bits = 0 ;
//E5_FULLUPDATE is handled elsewhere
//E5_EXTEND* is handled elsewhere
2009-07-18 20:14:10 +00:00
if ( ! VectorEquals ( from - > origin , to - > origin ) )
2005-06-14 04:52:10 +00:00
bits | = E5_ORIGIN ;
2009-07-18 20:14:10 +00:00
if ( ! VectorEquals ( from - > angles , to - > angles ) )
2005-06-14 04:52:10 +00:00
bits | = E5_ANGLES ;
if ( from - > modelindex ! = to - > modelindex )
bits | = E5_MODEL ;
if ( from - > frame ! = to - > frame )
bits | = E5_FRAME ;
if ( from - > skinnum ! = to - > skinnum )
bits | = E5_SKIN ;
if ( from - > effects ! = to - > effects )
bits | = E5_EFFECTS ;
2005-07-01 19:23:00 +00:00
if ( from - > dpflags ! = to - > dpflags )
2005-06-14 04:52:10 +00:00
bits | = E5_FLAGS ;
if ( from - > trans ! = to - > trans )
bits | = E5_ALPHA ;
2005-07-01 19:23:00 +00:00
if ( from - > scale ! = to - > scale )
bits | = E5_SCALE ;
2005-06-14 04:52:10 +00:00
if ( from - > colormap ! = to - > colormap )
bits | = E5_COLORMAP ;
2005-07-01 19:23:00 +00:00
if ( from - > tagentity ! = to - > tagentity | | from - > tagindex ! = to - > tagindex )
bits | = E5_ATTACHMENT ;
2005-08-07 18:08:13 +00:00
if ( from - > light [ 0 ] ! = to - > light [ 0 ] | | from - > light [ 1 ] ! = to - > light [ 1 ] | | from - > light [ 2 ] ! = to - > light [ 2 ] | | from - > light [ 3 ] ! = to - > light [ 3 ] | | from - > lightstyle ! = to - > lightstyle | | from - > lightpflags ! = to - > lightpflags )
bits | = E5_LIGHT ;
2005-07-01 19:23:00 +00:00
if ( from - > glowsize ! = to - > glowsize | | from - > glowcolour ! = to - > glowcolour )
bits | = E5_GLOW ;
2005-10-01 03:09:17 +00:00
if ( from - > colormod [ 0 ] ! = to - > colormod [ 0 ] | | from - > colormod [ 1 ] ! = to - > colormod [ 1 ] | | from - > colormod [ 2 ] ! = to - > colormod [ 2 ] )
bits | = E5_COLORMOD ;
2016-07-12 00:40:13 +00:00
if ( from - > glowmod [ 0 ] ! = to - > glowmod [ 0 ] | | from - > glowmod [ 1 ] ! = to - > glowmod [ 1 ] | | from - > glowmod [ 2 ] ! = to - > glowmod [ 2 ] )
bits | = E5_GLOWMOD ;
if ( to - > bonecount ! = from - > bonecount | | ( to - > bonecount & & ( ! frombonedatabase | | memcmp ( frombonedatabase + from - > boneoffset , tobonedatabase + to - > boneoffset , to - > bonecount * sizeof ( short ) * 7 ) ) ) )
if ( to - > bonecount )
bits | = E5_COMPLEXANIMATION ;
if ( to - > u . q1 . traileffectnum ! = from - > u . q1 . traileffectnum )
bits | = E5_TRAILEFFECTNUM ;
2005-06-14 04:52:10 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ( bits & E5_ORIGIN ) & & ( ! ( to - > dpflags & RENDER_LOWPRECISION ) | | to - > origin [ 0 ] < - 4096 | | to - > origin [ 0 ] > = 4096 | | to - > origin [ 1 ] < - 4096 | | to - > origin [ 1 ] > = 4096 | | to - > origin [ 2 ] < - 4096 | | to - > origin [ 2 ] > = 4096 ) )
2005-06-14 04:52:10 +00:00
bits | = E5_ORIGIN32 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ( bits & E5_ANGLES ) & & ! ( to - > dpflags & RENDER_LOWPRECISION ) )
2005-06-14 04:52:10 +00:00
bits | = E5_ANGLES16 ;
if ( ( bits & E5_MODEL ) & & to - > modelindex > = 256 )
bits | = E5_MODEL16 ;
if ( ( bits & E5_FRAME ) & & to - > frame > = 256 )
bits | = E5_FRAME16 ;
if ( bits & E5_EFFECTS )
{
if ( to - > effects > = 65536 )
bits | = E5_EFFECTS32 ;
else if ( to - > effects > = 256 )
bits | = E5_EFFECTS16 ;
}
2008-11-09 22:29:28 +00:00
2016-07-12 00:40:13 +00:00
return bits ;
}
2017-05-18 10:24:09 +00:00
void SVDP_EmitEntityDelta ( unsigned int bits , entity_state_t * to , sizebuf_t * msg , qbyte * bonedatabase )
2016-07-12 00:40:13 +00:00
{
2017-05-18 10:24:09 +00:00
bits & = ~ E5_SERVERPRIVATE ;
2016-07-12 00:40:13 +00:00
2017-05-18 10:24:09 +00:00
if ( ! bits )
return ;
2016-07-12 00:40:13 +00:00
2005-06-14 04:52:10 +00:00
if ( bits > = 256 )
bits | = E5_EXTEND1 ;
if ( bits > = 65536 )
bits | = E5_EXTEND2 ;
if ( bits > = 16777216 )
bits | = E5_EXTEND3 ;
MSG_WriteShort ( msg , to - > number ) ;
MSG_WriteByte ( msg , bits & 0xFF ) ;
if ( bits & E5_EXTEND1 )
MSG_WriteByte ( msg , ( bits > > 8 ) & 0xFF ) ;
if ( bits & E5_EXTEND2 )
MSG_WriteByte ( msg , ( bits > > 16 ) & 0xFF ) ;
if ( bits & E5_EXTEND3 )
MSG_WriteByte ( msg , ( bits > > 24 ) & 0xFF ) ;
if ( bits & E5_FLAGS )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , to - > dpflags ) ;
2005-06-14 04:52:10 +00:00
if ( bits & E5_ORIGIN )
{
if ( bits & E5_ORIGIN32 )
{
MSG_WriteFloat ( msg , to - > origin [ 0 ] ) ;
MSG_WriteFloat ( msg , to - > origin [ 1 ] ) ;
MSG_WriteFloat ( msg , to - > origin [ 2 ] ) ;
}
else
{
MSG_WriteShort ( msg , to - > origin [ 0 ] * 8 ) ;
MSG_WriteShort ( msg , to - > origin [ 1 ] * 8 ) ;
MSG_WriteShort ( msg , to - > origin [ 2 ] * 8 ) ;
}
}
if ( bits & E5_ANGLES )
{
if ( bits & E5_ANGLES16 )
{
MSG_WriteAngle16 ( msg , to - > angles [ 0 ] ) ;
MSG_WriteAngle16 ( msg , to - > angles [ 1 ] ) ;
MSG_WriteAngle16 ( msg , to - > angles [ 2 ] ) ;
}
else
{
MSG_WriteAngle8 ( msg , to - > angles [ 0 ] ) ;
MSG_WriteAngle8 ( msg , to - > angles [ 1 ] ) ;
MSG_WriteAngle8 ( msg , to - > angles [ 2 ] ) ;
}
}
if ( bits & E5_MODEL )
{
if ( bits & E5_MODEL16 )
MSG_WriteShort ( msg , to - > modelindex ) ;
else
MSG_WriteByte ( msg , to - > modelindex ) ;
}
if ( bits & E5_FRAME )
{
if ( bits & E5_FRAME16 )
MSG_WriteShort ( msg , to - > frame ) ;
else
MSG_WriteByte ( msg , to - > frame ) ;
}
if ( bits & E5_SKIN )
MSG_WriteByte ( msg , to - > skinnum ) ;
if ( bits & E5_EFFECTS )
{
if ( bits & E5_EFFECTS32 )
MSG_WriteLong ( msg , to - > effects ) ;
else if ( bits & E5_EFFECTS16 )
MSG_WriteShort ( msg , to - > effects ) ;
else
MSG_WriteByte ( msg , to - > effects ) ;
}
if ( bits & E5_ALPHA )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , to - > trans ) ;
2005-06-14 04:52:10 +00:00
if ( bits & E5_SCALE )
MSG_WriteByte ( msg , to - > scale ) ;
if ( bits & E5_COLORMAP )
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( msg , to - > colormap & 0xff ) ;
2005-07-01 19:23:00 +00:00
if ( bits & E5_ATTACHMENT )
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
MSG_WriteEntity ( msg , to - > tagentity ) ;
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , to - > tagindex ) ;
}
2005-08-07 18:08:13 +00:00
if ( bits & E5_LIGHT )
{
MSG_WriteShort ( msg , to - > light [ 0 ] ) ;
MSG_WriteShort ( msg , to - > light [ 1 ] ) ;
MSG_WriteShort ( msg , to - > light [ 2 ] ) ;
MSG_WriteShort ( msg , to - > light [ 3 ] ) ;
MSG_WriteByte ( msg , to - > lightstyle ) ;
MSG_WriteByte ( msg , to - > lightpflags ) ;
}
2005-07-01 19:23:00 +00:00
if ( bits & E5_GLOW )
{
MSG_WriteByte ( msg , to - > glowsize ) ;
MSG_WriteByte ( msg , to - > glowcolour ) ;
}
2005-10-01 03:09:17 +00:00
if ( bits & E5_COLORMOD )
{
MSG_WriteByte ( msg , to - > colormod [ 0 ] ) ;
MSG_WriteByte ( msg , to - > colormod [ 1 ] ) ;
MSG_WriteByte ( msg , to - > colormod [ 2 ] ) ;
}
2016-07-12 00:40:13 +00:00
if ( bits & E5_GLOWMOD )
{
MSG_WriteByte ( msg , to - > glowmod [ 0 ] ) ;
MSG_WriteByte ( msg , to - > glowmod [ 1 ] ) ;
MSG_WriteByte ( msg , to - > glowmod [ 2 ] ) ;
}
if ( bits & E5_COMPLEXANIMATION )
{
short * bonedata = ( short * ) ( bonedatabase + to - > boneoffset ) ;
int i ;
MSG_WriteByte ( msg , 4 ) ;
MSG_WriteShort ( msg , to - > modelindex ) ;
MSG_WriteByte ( msg , to - > bonecount ) ;
for ( i = 0 ; i < to - > bonecount * 7 ; i + + )
MSG_WriteShort ( msg , bonedata [ i ] ) ;
}
if ( bits & E5_TRAILEFFECTNUM )
MSG_WriteShort ( msg , to - > u . q1 . traileffectnum ) ;
2005-06-14 04:52:10 +00:00
}
2017-05-28 15:42:32 +00:00
void SVDP_EmitEntitiesUpdate ( client_t * client , client_frame_t * frame , packet_entities_t * to , sizebuf_t * msg )
2005-06-14 04:52:10 +00:00
{
2017-05-28 15:42:32 +00:00
packet_entities_t * cur ;
int newindex ;
int curnum , newnum ;
2017-05-18 10:24:09 +00:00
int j ;
2017-05-28 15:42:32 +00:00
int sequence = client - > netchan . incoming_sequence ;
2005-06-14 04:52:10 +00:00
// this is the frame that we are going to delta update from
2017-05-28 15:42:32 +00:00
cur = & client - > sentents ;
2016-02-15 06:01:17 +00:00
if ( ! client - > netchan . incoming_sequence )
2017-05-28 15:42:32 +00:00
{ //first packet deltas from nothing.
//so make sure we start with nothing
cur - > num_entities = 0 ;
2016-02-15 06:01:17 +00:00
}
2005-07-01 19:23:00 +00:00
2017-05-18 10:24:09 +00:00
if ( to - > num_entities )
{
j = to - > entities [ to - > num_entities - 1 ] . number + 1 ;
2017-05-28 15:42:32 +00:00
if ( j > cur - > max_entities )
2017-05-18 10:24:09 +00:00
{
2017-05-28 15:42:32 +00:00
cur - > entities = BZ_Realloc ( cur - > entities , sizeof ( * cur - > entities ) * j ) ;
memset ( & cur - > entities [ cur - > max_entities ] , 0 , sizeof ( cur - > entities [ 0 ] ) * ( j - cur - > max_entities ) ) ;
cur - > max_entities = j ;
2017-05-18 10:24:09 +00:00
}
2017-05-28 15:42:32 +00:00
while ( j > cur - > num_entities )
2017-05-18 10:24:09 +00:00
{
2017-05-28 15:42:32 +00:00
cur - > entities [ cur - > num_entities ] . number = 0 ;
cur - > num_entities + + ;
2017-05-18 10:24:09 +00:00
}
}
//diff the from+to states, flagging any changed state (which is combined with any state from previous packet loss
newindex = 0 ;
2017-05-28 15:42:32 +00:00
curnum = 0 ;
while ( newindex < to - > num_entities | | curnum < cur - > num_entities )
2017-05-18 10:24:09 +00:00
{
2017-05-28 15:42:32 +00:00
newnum = newindex > = to - > num_entities ? 0x8000 : to - > entities [ newindex ] . number ;
2017-05-18 10:24:09 +00:00
2017-05-28 15:42:32 +00:00
if ( newnum = = curnum )
{
if ( cur - > entities [ curnum ] . number )
{ //regular update
client - > pendingdeltabits [ newnum ] | = SVDP_CalcDelta ( & cur - > entities [ curnum ] , NULL /*cur->bonedata*/ , & to - > entities [ newindex ] , to - > bonedata ) ;
if ( client - > pendingdeltabits [ newnum ] & E5_SERVERREMOVE )
{ //if it got flagged for removal, but its actually a valid entity, then assume that its an outdated remove and just flag it for a full update in case stuff got lost.
client - > pendingdeltabits [ newnum ] & = ~ E5_SERVERREMOVE ;
client - > pendingdeltabits [ newnum ] | = E5_FULLUPDATE ;
}
2017-05-18 10:24:09 +00:00
}
2017-05-28 15:42:32 +00:00
else
{ //this ent is new
//dpp5+ does not use baselines. it just resets from default state.
client - > pendingdeltabits [ newnum ] = E5_FULLUPDATE | SVDP_CalcDelta ( & nullentitystate , NULL , & to - > entities [ newindex ] , to - > bonedata ) ;
}
cur - > entities [ curnum ] = to - > entities [ newindex ] ;
2017-05-18 10:24:09 +00:00
newindex + + ;
}
2017-05-28 15:42:32 +00:00
else if ( cur - > entities [ curnum ] . number )
{ //this entity was apparently removed since last time.
cur - > entities [ curnum ] . number = 0 ;
client - > pendingdeltabits [ curnum ] = E5_SERVERREMOVE ;
}
curnum + + ;
2017-05-18 10:24:09 +00:00
}
2017-05-28 15:42:32 +00:00
to = cur ;
2017-05-18 10:24:09 +00:00
//loop through all ents and send them as required
2005-07-01 19:23:00 +00:00
// Con_Printf ("frame %i\n", client->netchan.incoming_sequence);
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
{
unsigned int bits ;
int outno , outmax = frame - > maxresend ;
struct resendinfo_s * resend = frame - > resend ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2017-05-28 15:42:32 +00:00
MSG_WriteByte ( msg , svcdp_entities ) ;
MSG_WriteLong ( msg , sequence ) ; //sequence for the client to ack (any bits sent in unacked frames will be re-queued)
if ( client - > protocol = = SCP_DARKPLACES7 )
MSG_WriteLong ( msg , client - > last_sequence ) ; //movement sequence that we are acking.
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
client - > netchan . incoming_sequence + + ;
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
//add in the bitmasks of dropped packets.
for ( outno = 0 , j = 1 ; j < to - > num_entities ; j + + )
{
bits = client - > pendingdeltabits [ j ] ;
if ( ! bits )
continue ;
if ( msg - > cursize + 50 > msg - > maxsize )
break ; /*give up if it gets full. FIXME: bone data is HUGE.*/
if ( outno > = outmax )
{ //expand the frames. may need some copying...
2019-02-19 06:49:03 +00:00
if ( outmax = = client - > max_net_ents )
break ;
2019-02-16 19:09:07 +00:00
SV_ExpandNackFrames ( client , outno + 1 , & frame ) ;
2019-02-19 06:49:03 +00:00
resend = frame - > resend ;
outmax = frame - > maxresend ;
2017-05-28 15:42:32 +00:00
}
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
if ( bits & E5_SERVERREMOVE )
{ //if reset is set, then reset was set eroneously.
MSG_WriteShort ( msg , j | 0x8000 ) ;
resend [ outno ] . bits = E5_SERVERREMOVE ;
// Con_Printf("REMOVE %i @ %i\n", j, sequence);
}
else if ( to - > entities [ j ] . number ) /*only send a new copy of the ent if they actually have one already*/
{
//if we didn't reach the end in the last packet, start at that point to avoid spam
//player slots are exempt from this, so they are in every packet (strictly speaking only the local player 'needs' this, but its nice to have it for high-priority targets too)
if ( j < client - > nextdeltaindex & & j > svs . allocated_client_slots )
continue ;
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
if ( bits & E5_FULLUPDATE )
{
/*flag the entity for the next packet, so we always get two resets when it appears, to reduce the effects of packetloss on seeing rockets etc*/
bits = E5_FULLUPDATE | SVDP_CalcDelta ( & nullentitystate , NULL , & to - > entities [ j ] , to - > bonedata ) ;
resend [ outno ] . bits = E5_FULLUPDATE ;
// Con_Printf("RESET %i @ %i\n", j, sequence);
}
else
resend [ outno ] . bits = bits ;
2005-06-14 04:52:10 +00:00
2017-05-28 15:42:32 +00:00
SVDP_EmitEntityDelta ( bits , & to - > entities [ j ] , msg , to - > bonedata ) ;
}
client - > pendingdeltabits [ j ] = 0 ;
resend [ outno ] . flags = 0 ;
resend [ outno + + ] . entnum = j ;
2005-06-14 04:52:10 +00:00
}
2017-05-28 15:42:32 +00:00
MSG_WriteShort ( msg , 0x8000 ) ; //dp5+ uses 'remove world' as a terminator.
frame - > numresend = outno ;
frame - > sequence = sequence ;
if ( j = = to - > num_entities ) //looks like we sent them all
client - > nextdeltaindex = 0 ; //start afresh with the next packet.
else
client - > nextdeltaindex = j ; //we overflowed or something, start going round-robin
2005-06-14 04:52:10 +00:00
}
}
# endif
2004-08-23 00:15:46 +00:00
int SV_HullNumForPlayer ( int h2hull , float * mins , float * maxs )
{
int diff ;
int best ;
int hullnum , i ;
2009-11-04 21:16:50 +00:00
if ( sv . world . worldmodel - > fromgame ! = fg_quake )
2004-08-23 00:15:46 +00:00
{
2011-05-20 04:10:46 +00:00
return - mins [ 2 ] + 32 ; //clients are expected to decide themselves.
2004-08-23 00:15:46 +00:00
}
2004-08-31 23:58:18 +00:00
if ( h2hull )
2011-06-02 05:16:44 +00:00
return ( h2hull - 1 ) | ( mins [ 2 ] ? 0 : 128 ) ;
2004-08-23 00:15:46 +00:00
hullnum = 0 ;
best = 8192 ;
//x/y pos/neg are assumed to be the same magnitute.
//y pos/height are assumed to be different from all the others.
for ( i = 0 ; i < MAX_MAP_HULLSM ; i + + )
{
# define sq(x) ((x)*(x))
2009-11-04 21:16:50 +00:00
diff = sq ( sv . world . worldmodel - > hulls [ i ] . clip_maxs [ 2 ] - maxs [ 2 ] ) +
sq ( sv . world . worldmodel - > hulls [ i ] . clip_mins [ 2 ] - mins [ 2 ] ) +
sq ( sv . world . worldmodel - > hulls [ i ] . clip_maxs [ 0 ] - maxs [ 0 ] ) +
sq ( sv . world . worldmodel - > hulls [ i ] . clip_mins [ 0 ] - mins [ 0 ] ) ;
2004-08-23 00:15:46 +00:00
if ( diff < best )
{
best = diff ;
hullnum = i ;
}
}
return hullnum ;
}
# if 1
typedef struct {
int playernum ;
qboolean onladder ;
usercmd_t * lastcmd ;
int modelindex ;
int frame ;
int weaponframe ;
2009-06-21 17:45:33 +00:00
int vw_index ;
2004-08-23 00:15:46 +00:00
float * angles ;
float * origin ;
float * velocity ;
int effects ;
int skin ;
float * mins ;
float * maxs ;
float scale ;
float transparency ;
float fatness ;
float localtime ;
int health ;
int spectator ; //0=send to a player. 1=non-tracked player, to a spec. 2=tracked player, to a spec(or self)
qboolean isself ;
2019-03-01 22:39:30 +00:00
qboolean onground ;
qboolean solid ;
2021-08-04 21:16:57 +00:00
unsigned int fteext1 ;
unsigned int ezext1 ;
unsigned int zext ;
2004-08-23 00:15:46 +00:00
int hull ;
client_t * cl ;
} clstate_t ;
void SV_WritePlayerToClient ( sizebuf_t * msg , clstate_t * ent )
{
usercmd_t cmd ;
int msec ;
int hullnumber ;
int i ;
int pflags ;
int pm_type , pm_code ;
int zext = ent - > zext ;
pflags = PF_MSEC | PF_COMMAND ;
2005-12-13 02:31:57 +00:00
2004-08-23 00:15:46 +00:00
if ( ent - > modelindex ! = sv_playermodel )
pflags | = PF_MODEL ;
if ( ent - > velocity )
for ( i = 0 ; i < 3 ; i + + )
if ( ent - > velocity [ i ] )
pflags | = PF_VELOCITY1 < < i ;
if ( ent - > effects )
pflags | = PF_EFFECTS ;
if ( ent - > skin | | ent - > modelindex > = 256 )
pflags | = PF_SKINNUM ;
if ( ent - > health < = 0 )
pflags | = PF_DEAD ;
if ( progstype = = PROG_QW )
{
if ( ent - > mins [ 2 ] ! = - 24 )
pflags | = PF_GIB ;
}
else if ( progstype = = PROG_H2 )
{
// if (ent->maxs[2] != 56)
// pflags |= PF_GIB;
}
else
{
if ( ent - > mins [ 2 ] ! = - 24 )
pflags | = PF_GIB ;
}
if ( ent - > isself )
{
if ( ent - > spectator )
pflags & = PF_VELOCITY1 | PF_VELOCITY2 | PF_VELOCITY3 | PF_DEAD | PF_GIB ;
else
{ // don't send a lot of data on personal entity
pflags & = ~ ( PF_MSEC | PF_COMMAND ) ;
if ( ent - > weaponframe )
pflags | = PF_WEAPONFRAME ;
}
}
2005-01-26 03:39:47 +00:00
if ( ent - > spectator = = 2 & & ent - > weaponframe ) //it's not us, but we are spectating, so we need the correct weaponframe
2004-08-23 00:15:46 +00:00
pflags | = PF_WEAPONFRAME ;
2021-08-04 21:16:57 +00:00
if ( ! ent - > isself | | ( ent - > fteext1 & PEXT_SPLITSCREEN ) )
2004-08-23 00:15:46 +00:00
{
# ifdef PEXT_SCALE //this is graphics, not physics
2021-08-04 21:16:57 +00:00
if ( ent - > fteext1 & PEXT_SCALE )
2004-08-23 00:15:46 +00:00
{
2012-01-28 10:30:44 +00:00
if ( ent - > scale & & ent - > scale ! = 1 ) pflags | = PF_SCALE ;
2004-08-23 00:15:46 +00:00
}
# endif
# ifdef PEXT_TRANS
2021-08-04 21:16:57 +00:00
if ( ent - > fteext1 & PEXT_TRANS )
2004-08-23 00:15:46 +00:00
{
2012-01-28 10:30:44 +00:00
if ( ent - > transparency ) pflags | = PF_TRANS ;
2004-08-23 00:15:46 +00:00
}
# endif
# ifdef PEXT_FATNESS
2021-08-04 21:16:57 +00:00
if ( ent - > fteext1 & PEXT_FATNESS )
2004-08-23 00:15:46 +00:00
{
2012-01-28 10:30:44 +00:00
if ( ent - > fatness ) pflags | = PF_FATNESS ;
2004-08-23 00:15:46 +00:00
}
# endif
}
# ifdef PEXT_HULLSIZE
2021-08-04 21:16:57 +00:00
if ( ent - > fteext1 & PEXT_HULLSIZE )
2004-08-23 00:15:46 +00:00
{
hullnumber = SV_HullNumForPlayer ( ent - > hull , ent - > mins , ent - > maxs ) ;
if ( hullnumber ! = 1 )
2005-07-01 19:23:00 +00:00
pflags | = PF_HULLSIZE_Z ;
2004-08-23 00:15:46 +00:00
}
else
hullnumber = 1 ;
# endif
if ( zext & Z_EXT_PM_TYPE )
{
if ( ent - > cl )
{
2004-08-31 23:58:18 +00:00
if ( ent - > cl - > viewent )
pm_type = PMC_NONE ;
else
2015-03-03 00:14:43 +00:00
pm_type = SV_PMTypeForClient ( ent - > cl , ent - > cl - > edict ) ;
2004-08-23 00:15:46 +00:00
switch ( pm_type )
{
case PM_NORMAL : // Z_EXT_PM_TYPE protocol extension
if ( ent - > cl - > jump_held )
pm_code = PMC_NORMAL_JUMP_HELD ; // encode pm_type and jump_held into pm_code
else
pm_code = PMC_NORMAL ;
break ;
case PM_OLD_SPECTATOR :
pm_code = PMC_OLD_SPECTATOR ;
break ;
case PM_SPECTATOR : // Z_EXT_PM_TYPE_NEW protocol extension
pm_code = PMC_SPECTATOR ;
break ;
case PM_FLY :
pm_code = PMC_FLY ;
break ;
case PM_DEAD :
pm_code = PMC_NORMAL ;
break ;
case PM_NONE :
pm_code = PMC_NONE ;
break ;
2012-02-15 13:53:30 +00:00
case PM_WALLWALK :
pm_code = PMC_WALLWALK ;
break ;
2004-08-23 00:15:46 +00:00
default :
2012-02-15 13:53:30 +00:00
// Sys_Error("SV_WritePlayersToClient: unexpected pm_type");
pm_code = PMC_NORMAL ;
break ;
2004-08-23 00:15:46 +00:00
}
}
else
2004-12-06 00:58:19 +00:00
pm_code = ( ent - > zext & Z_EXT_PM_TYPE_NEW ) ? PMC_SPECTATOR : PMC_OLD_SPECTATOR ; //(ent->spectator && ent->isself) ? PMC_OLD_SPECTATOR : PMC_NORMAL;
2004-08-23 00:15:46 +00:00
pflags | = pm_code < < PF_PMC_SHIFT ;
}
2019-03-01 22:39:30 +00:00
if ( ( zext & Z_EXT_PF_ONGROUND ) & & ent - > onground )
pflags | = PF_ONGROUND ;
if ( ( zext & Z_EXT_PF_SOLID ) & & ent - > solid )
pflags | = PF_SOLID ;
2004-08-23 00:15:46 +00:00
MSG_WriteByte ( msg , svc_playerinfo ) ;
MSG_WriteByte ( msg , ent - > playernum ) ;
2021-08-04 21:16:57 +00:00
if ( ent - > fteext1 & ( PEXT_HULLSIZE | PEXT_TRANS | PEXT_SCALE | PEXT_FATNESS ) )
2004-08-23 00:15:46 +00:00
{
2019-03-01 22:39:30 +00:00
if ( pflags & 0xff0000 )
pflags | = PF_EXTRA_PFS ;
MSG_WriteShort ( msg , pflags & 0xffff ) ;
if ( pflags & PF_EXTRA_PFS )
MSG_WriteByte ( msg , ( pflags & 0xff0000 ) > > 16 ) ;
2004-08-23 00:15:46 +00:00
}
2019-03-01 22:39:30 +00:00
else
MSG_WriteShort ( msg , ( pflags & 0x3fff ) | ( ( pflags & 0xc00000 ) > > 8 ) ) ;
2004-08-23 00:15:46 +00:00
//we need to tell the client that it's moved, as it's own origin might not be natural
2004-11-13 17:36:42 +00:00
for ( i = 0 ; i < 3 ; i + + )
2021-08-04 21:16:57 +00:00
{
if ( ent - > ezext1 & EZPEXT1_FLOATENTCOORDS )
MSG_WriteFloat ( msg , ent - > origin [ i ] ) ;
else
MSG_WriteCoord ( msg , ent - > origin [ i ] ) ;
}
2004-08-23 00:15:46 +00:00
MSG_WriteByte ( msg , ent - > frame ) ;
if ( pflags & PF_MSEC )
{
msec = 1000 * ( sv . time - ent - > localtime ) ;
if ( msec < 0 )
msec = 0 ;
if ( msec > 255 )
msec = 255 ;
MSG_WriteByte ( msg , msec ) ;
}
if ( pflags & PF_COMMAND )
{
if ( ent - > lastcmd )
cmd = * ent - > lastcmd ;
else
{
memset ( & cmd , 0 , sizeof ( cmd ) ) ;
2015-10-27 15:20:15 +00:00
cmd . angles [ 0 ] = ( short ) ( ent - > angles [ 0 ] * 65535 / 360.0f ) ;
cmd . angles [ 1 ] = ( short ) ( ent - > angles [ 1 ] * 65535 / 360.0f ) ;
cmd . angles [ 2 ] = ( short ) ( ent - > angles [ 2 ] * 65535 / 360.0f ) ;
2004-08-23 00:15:46 +00:00
}
if ( ent - > health < = 0 )
{ // don't show the corpse looking around...
cmd . angles [ 0 ] = 0 ;
2007-10-14 00:54:29 +00:00
cmd . angles [ 1 ] = ( int ) ( ent - > angles [ 1 ] * 65535 / 360 ) ;
2006-07-02 04:27:56 +00:00
cmd . angles [ 2 ] = 0 ;
2004-08-23 00:15:46 +00:00
}
cmd . buttons = 0 ; // never send buttons
2009-06-21 17:45:33 +00:00
if ( ent - > zext & Z_EXT_VWEP )
cmd . impulse = ent - > vw_index ; // never send impulses
else
cmd . impulse = 0 ;
2004-08-23 00:15:46 +00:00
2021-04-14 05:21:04 +00:00
MSGQW_WriteDeltaUsercmd ( msg , & nullcmd , & cmd ) ;
2004-08-23 00:15:46 +00:00
}
if ( ent - > velocity )
{
for ( i = 0 ; i < 3 ; i + + )
if ( pflags & ( PF_VELOCITY1 < < i ) )
2015-10-27 15:20:15 +00:00
MSG_WriteShort ( msg , ( short ) ( ent - > velocity [ i ] ) ) ;
2004-08-23 00:15:46 +00:00
}
else
{
for ( i = 0 ; i < 3 ; i + + )
if ( pflags & ( PF_VELOCITY1 < < i ) )
MSG_WriteShort ( msg , 0 ) ;
}
2005-01-26 03:39:47 +00:00
2004-08-23 00:15:46 +00:00
if ( pflags & PF_MODEL )
MSG_WriteByte ( msg , ent - > modelindex ) ;
if ( pflags & PF_SKINNUM )
MSG_WriteByte ( msg , ent - > skin | ( ( ( pflags & PF_MODEL ) & & ( ent - > modelindex > = 256 ) ) < < 7 ) ) ;
if ( pflags & PF_EFFECTS )
MSG_WriteByte ( msg , ent - > effects ) ;
if ( pflags & PF_WEAPONFRAME )
MSG_WriteByte ( msg , ent - > weaponframe ) ;
# ifdef PEXT_SCALE
2012-01-28 10:30:44 +00:00
if ( pflags & PF_SCALE )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , ent - > scale * 50 ) ;
2004-08-23 00:15:46 +00:00
# endif
# ifdef PEXT_TRANS
2012-01-28 10:30:44 +00:00
if ( pflags & PF_TRANS )
2005-07-01 19:23:00 +00:00
MSG_WriteByte ( msg , ( qbyte ) ( ent - > transparency * 255 ) ) ;
2004-08-23 00:15:46 +00:00
# endif
# ifdef PEXT_FATNESS
2012-01-28 10:30:44 +00:00
if ( pflags & PF_FATNESS )
MSG_WriteChar ( msg , ent - > fatness ) ;
2004-08-23 00:15:46 +00:00
# endif
# ifdef PEXT_HULLSIZE //shrunken or crouching in halflife levels. (possibly enlarged)
2005-07-01 19:23:00 +00:00
if ( pflags & PF_HULLSIZE_Z )
MSG_WriteChar ( msg , hullnumber + ( ent - > onladder ? 128 : 0 ) ) ; //physics.
2004-08-23 00:15:46 +00:00
# endif
}
# endif
2007-08-30 18:55:44 +00:00
2020-06-12 23:29:58 +00:00
qboolean Cull_Traceline ( float * timestamp , pvscamera_t * cameras , edict_t * seen )
2007-08-30 18:55:44 +00:00
{
int i ;
trace_t tr ;
2020-06-12 23:29:58 +00:00
vec3_t end , amin , size ;
2014-02-07 08:38:40 +00:00
int c ;
2007-08-30 18:55:44 +00:00
if ( seen - > v - > solid = = SOLID_BSP )
2020-06-12 23:29:58 +00:00
return false ; //bsp ents are never culled this way (typically far too large to care, often with large parts inside walls)
2007-08-30 18:55:44 +00:00
2020-06-12 23:29:58 +00:00
if ( timestamp )
2014-02-07 08:38:40 +00:00
{
2020-06-12 23:29:58 +00:00
int tests ;
float delay ;
2007-08-30 18:55:44 +00:00
2020-06-12 23:29:58 +00:00
//temporal cache
//we still need to fire some traces every frame (monte-carlo style), but we don't need to be so desperate as it'll stay visible for a while anyway.
if ( seen - > entnum < = sv . allocated_client_slots )
tests = 8 , delay = 0.2 ;
else
tests = 2 , delay = 1.0 ;
VectorAdd ( seen - > v - > origin , seen - > v - > mins , amin ) ;
VectorSubtract ( seen - > v - > maxs , seen - > v - > mins , size ) ;
for ( c = 0 ; c < cameras - > numents ; c + + )
2014-02-07 08:38:40 +00:00
{
2020-06-12 23:29:58 +00:00
for ( i = 0 ; i < tests ; i + + )
{
end [ 0 ] = amin [ 0 ] + frandom ( ) * size [ 0 ] ;
end [ 1 ] = amin [ 1 ] + frandom ( ) * size [ 1 ] ;
end [ 2 ] = amin [ 2 ] + frandom ( ) * size [ 2 ] ;
if ( ! sv . world . worldmodel - > funcs . NativeTrace ( sv . world . worldmodel , 1 , NULLFRAMESTATE , NULL , cameras - > org [ c ] , end , vec3_origin , vec3_origin , false , FTECONTENTS_SOLID , & tr ) )
{
* timestamp = sv . time + delay ;
return false ; //this trace went through, so don't cull
}
}
}
2007-08-30 18:55:44 +00:00
2020-06-12 23:29:58 +00:00
if ( * timestamp > = sv . time )
return false ;
return true ;
}
else
{
//stage 1: check against their origin
for ( c = 0 ; c < cameras - > numents ; c + + )
{
2014-02-07 08:38:40 +00:00
tr . fraction = 1 ;
2020-06-12 23:29:58 +00:00
if ( ! sv . world . worldmodel - > funcs . NativeTrace ( sv . world . worldmodel , 1 , NULLFRAMESTATE , NULL , cameras - > org [ c ] , seen - > v - > origin , vec3_origin , vec3_origin , false , FTECONTENTS_SOLID , & tr ) )
return false ; //wasn't blocked
}
//stage 2: check against their bbox
for ( c = 0 ; c < cameras - > numents ; c + + )
{
for ( i = 0 ; i < 8 ; i + + )
{
end [ 0 ] = seen - > v - > origin [ 0 ] + ( ( i & 1 ) ? seen - > v - > mins [ 0 ] : seen - > v - > maxs [ 0 ] ) ;
end [ 1 ] = seen - > v - > origin [ 1 ] + ( ( i & 2 ) ? seen - > v - > mins [ 1 ] : seen - > v - > maxs [ 1 ] ) ;
end [ 2 ] = seen - > v - > origin [ 2 ] + ( ( i & 4 ) ? seen - > v - > mins [ 2 ] + 0.1 : seen - > v - > maxs [ 2 ] ) ;
tr . fraction = 1 ;
if ( ! sv . world . worldmodel - > funcs . NativeTrace ( sv . world . worldmodel , 1 , NULLFRAMESTATE , NULL , cameras - > org [ c ] , end , vec3_origin , vec3_origin , false , FTECONTENTS_SOLID , & tr ) )
return false ; //this trace went through, so don't cull
}
2014-02-07 08:38:40 +00:00
}
2007-08-30 18:55:44 +00:00
}
2020-06-12 23:29:58 +00:00
//not visible
2007-08-30 18:55:44 +00:00
return true ;
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2013-05-07 02:08:44 +00:00
void SV_WritePlayersToMVD ( client_t * client , client_frame_t * frame , sizebuf_t * msg )
2004-08-23 00:15:46 +00:00
{
2009-11-15 03:20:17 +00:00
int j ;
2004-08-23 00:15:46 +00:00
client_t * cl ;
edict_t * ent , * vent ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
// int pflags;
2004-08-23 00:15:46 +00:00
demo_frame_t * demo_frame ;
demo_client_t * dcl ;
2013-05-07 02:08:44 +00:00
demo_frame = & demo . frames [ demo . parsecount & DEMO_FRAMES_MASK ] ;
2013-11-22 01:54:26 +00:00
for ( j = 0 , cl = svs . clients , dcl = demo_frame - > clients ; j < svs . allocated_client_slots ; j + + , cl + + , dcl + + )
2013-03-18 00:04:03 +00:00
{
2013-05-07 02:08:44 +00:00
if ( cl - > state ! = cs_spawned )
continue ;
2013-03-18 00:04:03 +00:00
2013-05-07 02:08:44 +00:00
# ifdef SERVER_DEMO_PLAYBACK
if ( sv . demostatevalid )
2004-08-23 00:15:46 +00:00
{
2013-05-07 02:08:44 +00:00
if ( client ! = cl )
2004-08-23 00:15:46 +00:00
continue ;
2013-05-07 02:08:44 +00:00
}
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
ent = cl - > edict ;
vent = ent ;
2004-08-23 00:15:46 +00:00
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# ifdef NQPROT
2013-05-07 02:08:44 +00:00
if ( progstype ! = PROG_QW )
{
if ( ( int ) ent - > v - > effects & EF_MUZZLEFLASH )
2004-08-23 00:15:46 +00:00
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
ent - > v - > effects = ( int ) ent - > v - > effects & ~ EF_MUZZLEFLASH ;
ent - > muzzletime = sv . world . physicstime ;
MSG_WriteByte ( & sv . multicast , svc_muzzleflash ) ;
MSG_WriteEntity ( & sv . multicast , NUM_FOR_EDICT ( svprogfuncs , ent ) ) ;
SV_MulticastProtExt ( ent - > v - > origin , MULTICAST_PHS , pr_global_struct - > dimension_send , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
2013-05-07 02:08:44 +00:00
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# endif
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
if ( SV_AddCSQCUpdate ( client , ent ) )
continue ;
2011-08-16 04:12:15 +00:00
2013-05-07 02:08:44 +00:00
if ( cl - > spectator )
continue ;
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
dcl - > parsecount = demo . parsecount ;
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
VectorCopy ( vent - > v - > origin , dcl - > info . origin ) ;
VectorCopy ( vent - > v - > angles , dcl - > info . angles ) ;
dcl - > info . angles [ 0 ] * = - 3 ;
dcl - > info . angles [ 2 ] = 0 ; // no roll angle
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
if ( ent - > v - > health < = 0 )
{ // don't show the corpse looking around...
dcl - > info . angles [ 0 ] = 0 ;
dcl - > info . angles [ 1 ] = vent - > v - > angles [ 1 ] ;
dcl - > info . angles [ 2 ] = 0 ;
}
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
if ( ent ! = vent )
{
dcl - > info . model = 0 ; //invisible.
dcl - > info . effects = 0 ;
2004-08-23 00:15:46 +00:00
}
2013-05-07 02:08:44 +00:00
else
{
dcl - > info . skinnum = ent - > v - > skin ;
dcl - > info . effects = ent - > v - > effects ;
dcl - > info . weaponframe = ent - > v - > weaponframe ;
dcl - > info . model = ent - > v - > modelindex ;
}
dcl - > sec = sv . time - cl - > localtime ;
dcl - > frame = ent - > v - > frame ;
dcl - > flags = 0 ;
dcl - > cmdtime = cl - > localtime ;
dcl - > fixangle = demo . fixangle [ j ] ;
demo . fixangle [ j ] = 0 ;
if ( ent - > v - > health < = 0 )
dcl - > flags | = DF_DEAD ;
if ( ent - > v - > mins [ 2 ] ! = - 24 )
dcl - > flags | = DF_GIB ;
2004-08-23 00:15:46 +00:00
}
2013-05-07 02:08:44 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
/*
= = = = = = = = = = = = =
SV_WritePlayersToClient
= = = = = = = = = = = = =
*/
2014-02-07 08:38:40 +00:00
void SV_WritePlayersToClient ( client_t * client , client_frame_t * frame , edict_t * clent , pvscamera_t * cameras , sizebuf_t * msg )
2013-05-07 02:08:44 +00:00
{
qboolean isbot ;
int j ;
client_t * cl ;
edict_t * ent , * vent ;
// int pflags;
2004-08-23 00:15:46 +00:00
2013-05-07 02:08:44 +00:00
if ( client - > state < cs_spawned )
{
2013-05-11 05:03:07 +00:00
Con_Printf ( " SV_WritePlayersToClient: not spawned yet \n " ) ;
2013-05-07 02:08:44 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2005-05-26 12:55:34 +00:00
if ( ! ISQWCLIENT ( client ) )
2004-08-23 00:15:46 +00:00
return ;
# endif
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2005-01-26 03:39:47 +00:00
if ( sv . demostatevalid ) //this is a demo
2004-08-23 00:15:46 +00:00
{
2005-01-26 03:39:47 +00:00
usercmd_t cmd ;
vec3_t ang ;
vec3_t org ;
vec3_t vel ;
float lerp ;
2005-01-27 01:53:05 +00:00
float a1 , a2 ;
2009-11-15 03:20:17 +00:00
int i ;
2005-01-26 03:39:47 +00:00
extern vec3_t player_mins , player_maxs ;
clstate_t clst ;
extern float olddemotime , nextdemotime ;
2005-12-13 02:31:57 +00:00
2013-12-02 14:30:30 +00:00
for ( i = 0 ; i < svs . allocated_client_slots ; i + + )
2004-08-23 00:15:46 +00:00
{
2005-01-26 03:39:47 +00:00
//FIXME: Add PVS stuff.
2004-08-23 00:15:46 +00:00
2005-01-26 03:39:47 +00:00
if ( * sv . recordedplayer [ i ] . userinfo ) //if the client was active
2004-08-23 00:15:46 +00:00
{
clst . playernum = i ;
clst . onladder = 0 ;
clst . lastcmd = & cmd ;
clst . modelindex = sv . demostate [ i + 1 ] . modelindex ;
2005-01-26 03:39:47 +00:00
if ( ! clst . modelindex )
continue ;
2004-08-23 00:15:46 +00:00
clst . frame = sv . demostate [ i + 1 ] . frame ;
clst . weaponframe = sv . recordedplayer [ i ] . weaponframe ;
clst . angles = ang ;
clst . origin = org ;
clst . hull = 1 ;
2005-01-26 03:39:47 +00:00
clst . velocity = vel ;
2004-08-23 00:15:46 +00:00
clst . effects = sv . demostate [ i + 1 ] . effects ;
clst . skin = sv . demostate [ i + 1 ] . skinnum ;
clst . mins = player_mins ;
clst . maxs = player_maxs ;
clst . scale = sv . demostate [ i + 1 ] . scale ;
clst . transparency = sv . demostate [ i + 1 ] . trans ;
clst . fatness = sv . demostate [ i + 1 ] . fatness ;
clst . localtime = sv . time ; //sv.recordedplayer[j].updatetime;
clst . health = sv . recordedplayer [ i ] . stats [ STAT_HEALTH ] ;
2005-01-26 03:39:47 +00:00
clst . spectator = 2 ; //so that weaponframes work properly.
2004-08-23 00:15:46 +00:00
clst . isself = false ;
2005-01-26 03:39:47 +00:00
clst . fteext = 0 ; //client->fteprotocolextensions;
clst . zext = 0 ; //client->zquake_extensions;
2004-08-23 00:15:46 +00:00
clst . cl = NULL ;
2009-06-21 17:45:33 +00:00
clst . vw_index = 0 ;
2019-03-01 22:39:30 +00:00
clst . solid = true ;
clst . onground = true ;
2004-08-23 00:15:46 +00:00
2005-01-26 03:39:47 +00:00
lerp = ( realtime - olddemotime ) / ( nextdemotime - olddemotime ) ;
if ( lerp < 0 )
lerp = 0 ;
if ( lerp > 1 )
lerp = 1 ;
for ( j = 0 ; j < 3 ; j + + )
{
2005-01-27 01:53:05 +00:00
a1 = ( 360.0f / 256 ) * sv . recordedplayer [ i ] . oldang [ j ] ;
a2 = ( 360.0f / 256 ) * sv . demostate [ i + 1 ] . angles [ j ] ;
a2 = a2 - a1 ;
if ( a2 > 180 )
a2 - = 360 ;
if ( a2 < - 180 )
a2 + = 360 ;
ang [ j ] = ( a1 + ( a2 ) * lerp ) ;
2005-01-26 03:39:47 +00:00
org [ j ] = sv . recordedplayer [ i ] . oldorg [ j ] + ( sv . demostate [ i + 1 ] . origin [ j ] - sv . recordedplayer [ i ] . oldorg [ j ] ) * lerp ;
2005-12-13 02:31:57 +00:00
2005-01-26 03:39:47 +00:00
vel [ j ] = ( - sv . recordedplayer [ i ] . oldorg [ j ] + sv . demostate [ i + 1 ] . origin [ j ] ) * ( nextdemotime - olddemotime ) ;
}
2004-12-08 04:14:52 +00:00
2004-08-23 00:15:46 +00:00
ang [ 0 ] * = - 3 ;
// ang[0] = ang[1] = ang[2] = 0;
memset ( & cmd , 0 , sizeof ( cmd ) ) ;
cmd . angles [ 0 ] = ang [ 0 ] * 65535 / 360.0f ;
cmd . angles [ 1 ] = ang [ 1 ] * 65535 / 360.0f ;
cmd . angles [ 2 ] = ang [ 2 ] * 65535 / 360.0f ;
cmd . msec = 50 ;
2005-01-26 03:39:47 +00:00
{ vec3_t f , r , u , v ;
2004-08-23 00:15:46 +00:00
AngleVectors ( ang , f , r , u ) ;
2005-01-26 03:39:47 +00:00
VectorCopy ( vel , v ) ;
2004-08-23 00:15:46 +00:00
cmd . forwardmove = DotProduct ( f , v ) ;
cmd . sidemove = DotProduct ( r , v ) ;
cmd . upmove = DotProduct ( u , v ) ;
2005-01-26 03:39:47 +00:00
}
2004-08-23 00:15:46 +00:00
clst . lastcmd = NULL ;
SV_WritePlayerToClient ( msg , & clst ) ;
}
2005-01-26 03:39:47 +00:00
}
//now build the spectator's thingie
memset ( & clst , 0 , sizeof ( clst ) ) ;
clst . fteext = 0 ; //client->fteprotocolextensions;
clst . zext = 0 ; //client->zquake_extensions;
2009-06-21 17:45:33 +00:00
clst . vw_index = 0 ;
2013-12-02 14:30:30 +00:00
clst . playernum = svs . allocated_client_slots - 1 ;
2005-01-26 03:39:47 +00:00
clst . isself = true ;
clst . modelindex = 0 ;
clst . hull = 1 ;
clst . frame = 0 ;
clst . localtime = sv . time ;
clst . mins = player_mins ;
clst . maxs = player_maxs ;
clst . angles = vec3_origin ; //not needed, as the client knows better than us anyway.
clst . origin = client - > specorigin ;
clst . velocity = client - > specvelocity ;
for ( client = client ; client ; client = client - > controller )
{
clst . health = 100 ;
if ( client - > spec_track )
{
clst . weaponframe = sv . recordedplayer [ client - > spec_track - 1 ] . weaponframe ;
clst . spectator = 2 ;
2004-12-08 04:14:52 +00:00
}
2005-01-26 03:39:47 +00:00
else
{
clst . weaponframe = 0 ;
clst . spectator = 1 ;
}
SV_WritePlayerToClient ( msg , & clst ) ;
clst . playernum - - ;
2004-08-23 00:15:46 +00:00
}
2005-01-26 03:39:47 +00:00
return ;
}
2009-11-07 13:29:15 +00:00
# endif
2013-06-23 02:17:02 +00:00
for ( j = 0 , cl = svs . clients ; j < sv . allocated_client_slots & & j < client - > max_net_clients ; j + + , cl + + )
2005-01-26 03:39:47 +00:00
{
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
if ( cl - > state ! = cs_spawned & & ! ( cl - > state = = cs_free & & cl - > name [ 0 ] ) ) //this includes bots, and nq bots
2006-07-02 04:27:56 +00:00
continue ;
2005-01-25 05:01:30 +00:00
2014-06-25 03:53:11 +00:00
if ( ( client - > penalties & BAN_BLIND ) & & client ! = cl )
continue ;
2006-09-26 22:54:27 +00:00
isbot = ( ! cl - > name [ 0 ] | | cl - > protocol = = SCP_BAD ) ;
2005-01-25 05:01:30 +00:00
ent = cl - > edict ;
if ( cl - > viewent & & ent = = clent )
{
2018-04-06 17:21:15 +00:00
vent = EDICT_NUM_UB ( svprogfuncs , cl - > viewent ) ;
2005-01-25 05:01:30 +00:00
if ( ! vent )
vent = ent ;
}
else
vent = ent ;
2005-12-13 02:31:57 +00:00
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# ifdef NQPROT
2004-08-23 00:15:46 +00:00
if ( progstype ! = PROG_QW )
{
2005-04-16 16:21:27 +00:00
if ( progstype = = PROG_H2 & & ( int ) ent - > v - > effects & H2EF_NODRAW & & ent ! = clent )
2004-08-23 00:15:46 +00:00
continue ;
2005-03-28 00:11:59 +00:00
if ( ( int ) ent - > v - > effects & EF_MUZZLEFLASH )
2004-08-23 00:15:46 +00:00
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
ent - > v - > effects = ( int ) ent - > v - > effects & ~ EF_MUZZLEFLASH ;
ent - > muzzletime = sv . world . physicstime ;
MSG_WriteByte ( & sv . multicast , svc_muzzleflash ) ;
MSG_WriteEntity ( & sv . multicast , NUM_FOR_EDICT ( svprogfuncs , ent ) ) ;
SV_MulticastProtExt ( ent - > v - > origin , MULTICAST_PHS , pr_global_struct - > dimension_send , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# endif
2004-08-23 00:15:46 +00:00
// ZOID visibility tracking
if ( ent ! = clent & &
2005-12-13 02:31:57 +00:00
! ( client - > spec_track & & client - > spec_track - 1 = = j ) )
2004-08-23 00:15:46 +00:00
{
if ( cl - > spectator )
continue ;
// ignore if not touching a PV leaf
2019-07-02 04:12:20 +00:00
if ( cameras & & ! sv . world . worldmodel - > funcs . EdictInFatPVS ( sv . world . worldmodel , & ent - > pvsinfo , cameras - > pvs . buffer , & cameras - > numents ) )
2005-08-26 22:56:51 +00:00
continue ;
2004-08-31 23:58:18 +00:00
2007-09-02 19:55:17 +00:00
if ( ! ( ( int ) clent - > xv - > dimension_see & ( ( int ) ent - > xv - > dimension_seen | ( int ) ent - > xv - > dimension_ghost ) ) )
2004-08-31 23:58:18 +00:00
continue ; //not in this dimension - sorry...
2014-02-07 08:38:40 +00:00
if ( cameras & & ( sv_cullplayers_trace . value | | sv_cullentities_trace . value ) )
2020-06-12 23:29:58 +00:00
if ( Cull_Traceline ( NULL , cameras , ent ) )
2007-08-30 18:55:44 +00:00
continue ;
2004-08-23 00:15:46 +00:00
}
2005-02-28 07:16:19 +00:00
if ( SV_AddCSQCUpdate ( client , ent ) )
2005-02-12 18:56:04 +00:00
continue ;
2004-08-23 00:15:46 +00:00
{
clstate_t clst ;
clst . playernum = j ;
2009-04-19 00:50:42 +00:00
clst . onladder = ( int ) ent - > xv - > pmove_flags & PMF_LADDER ;
2004-08-23 00:15:46 +00:00
clst . lastcmd = & cl - > lastcmd ;
2005-03-28 00:11:59 +00:00
clst . modelindex = vent - > v - > modelindex ;
clst . frame = vent - > v - > frame ;
clst . weaponframe = ent - > v - > weaponframe ;
clst . angles = ent - > v - > angles ;
clst . origin = vent - > v - > origin ;
clst . velocity = vent - > v - > velocity ;
clst . effects = ent - > v - > effects ;
2009-06-21 17:45:33 +00:00
clst . vw_index = ent - > xv - > vw_index ;
2019-03-01 22:39:30 +00:00
clst . onground = ( int ) ent - > v - > flags & FL_ONGROUND ;
clst . solid = ent - > v - > solid & & ent - > v - > solid ! = SOLID_CORPSE & & ent - > v - > solid ! = SOLID_TRIGGER ;
2005-03-28 00:11:59 +00:00
2005-04-16 16:21:27 +00:00
if ( progstype = = PROG_H2 & & ( ( int ) vent - > v - > effects & H2EF_NODRAW ) )
2004-08-23 00:15:46 +00:00
{
clst . effects = 0 ;
clst . modelindex = 0 ;
}
2005-03-28 00:11:59 +00:00
clst . skin = vent - > v - > skin ;
clst . mins = vent - > v - > mins ;
2007-09-02 19:55:17 +00:00
clst . hull = vent - > xv - > hull ;
2005-03-28 00:11:59 +00:00
clst . maxs = vent - > v - > maxs ;
2007-09-02 19:55:17 +00:00
clst . scale = vent - > xv - > scale ;
clst . transparency = vent - > xv - > alpha ;
2004-08-31 23:58:18 +00:00
//QSG_DIMENSION_PLANES - if the only shared dimensions are ghost dimensions, Set half alpha.
2007-09-02 19:55:17 +00:00
if ( ( ( int ) clent - > xv - > dimension_see & ( int ) ent - > xv - > dimension_ghost ) )
if ( ! ( ( int ) clent - > xv - > dimension_see & ( ( int ) ent - > xv - > dimension_seen & ~ ( int ) ent - > xv - > dimension_ghost ) ) )
2004-09-04 17:55:12 +00:00
{
2007-09-02 19:55:17 +00:00
if ( ent - > xv - > dimension_ghost_alpha )
clst . transparency * = ent - > xv - > dimension_ghost_alpha ;
2004-09-04 17:55:12 +00:00
else
clst . transparency * = 0.5 ;
}
2004-08-31 23:58:18 +00:00
2007-09-02 19:55:17 +00:00
clst . fatness = vent - > xv - > fatness ;
2004-08-23 00:15:46 +00:00
clst . localtime = cl - > localtime ;
2005-03-28 00:11:59 +00:00
clst . health = ent - > v - > health ;
2004-08-23 00:15:46 +00:00
clst . spectator = 0 ;
2021-08-04 21:16:57 +00:00
clst . fteext1 = client - > fteprotocolextensions ;
clst . ezext1 = client - > ezprotocolextensions1 ;
2004-08-23 00:15:46 +00:00
clst . zext = client - > zquake_extensions ;
clst . cl = cl ;
2007-06-20 00:02:54 +00:00
if ( ent ! = vent | | host_client - > viewent = = j + 1 )
2004-08-23 00:15:46 +00:00
clst . modelindex = 0 ;
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( sv . demostatevalid )
clst . health = 100 ;
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
clst . isself = false ;
2005-01-26 03:39:47 +00:00
if ( ( cl = = client | | cl - > controller = = client ) )
2004-08-23 00:15:46 +00:00
{
clst . isself = true ;
clst . spectator = 0 ;
if ( client - > spectator )
{
2013-05-09 02:18:15 +00:00
if ( client - > spec_track > 0 )
2013-05-07 02:08:44 +00:00
{
2018-04-06 17:21:15 +00:00
edict_t * s = EDICT_NUM_UB ( svprogfuncs , client - > spec_track ) ;
2013-05-07 02:08:44 +00:00
2005-01-26 03:39:47 +00:00
clst . spectator = 2 ;
2013-05-09 02:18:15 +00:00
clst . mins = s - > v - > mins ;
clst . maxs = s - > v - > maxs ;
clst . health = s - > v - > health ;
clst . weaponframe = s - > v - > weaponframe ;
2004-08-23 00:15:46 +00:00
}
else
2005-01-26 03:39:47 +00:00
{
clst . spectator = 1 ;
2004-08-23 00:15:46 +00:00
clst . health = 1 ;
2005-01-26 03:39:47 +00:00
}
2004-08-23 00:15:46 +00:00
}
}
2005-01-26 03:39:47 +00:00
else if ( client - > spectator )
2004-08-23 00:15:46 +00:00
{
clst . health = 100 ;
2007-07-27 21:24:31 +00:00
if ( client - > spec_track = = j + 1 )
2004-08-23 00:15:46 +00:00
clst . spectator = 2 ;
else
clst . spectator = 1 ;
}
if ( isbot )
{
clst . lastcmd = NULL ;
clst . velocity = NULL ;
2009-11-04 21:16:50 +00:00
clst . localtime = sv . time ;
2018-12-28 00:04:36 +00:00
VectorCopy ( clst . origin , frame - > laggedplayer [ j ] . origin ) ;
2004-08-23 00:15:46 +00:00
}
2009-11-04 21:16:50 +00:00
else
{
2018-12-28 00:04:36 +00:00
VectorMA ( clst . origin , ( sv . time - clst . localtime ) , clst . velocity , frame - > laggedplayer [ j ] . origin ) ;
2009-11-04 21:16:50 +00:00
}
2018-12-28 00:04:36 +00:00
VectorCopy ( clst . angles , frame - > laggedplayer [ j ] . angles ) ;
frame - > laggedplayer [ j ] . present = true ;
2004-08-23 00:15:46 +00:00
SV_WritePlayerToClient ( msg , & clst ) ;
}
//FIXME: Name flags
//player is visible, now would be a good time to update what the player is like.
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
/* pflags = 0;
2008-11-29 16:15:04 +00:00
# ifdef PEXT_VWEAP
2007-09-02 19:55:17 +00:00
if ( client - > fteprotocolextensions & PEXT_VWEAP & & client - > otherclientsknown [ j ] . vweap ! = ent - > xv - > vweapmodelindex )
2004-08-23 00:15:46 +00:00
{
pflags | = 1 ;
2007-09-02 19:55:17 +00:00
client - > otherclientsknown [ j ] . vweap = ent - > xv - > vweapmodelindex ;
2004-08-23 00:15:46 +00:00
}
2008-11-29 16:15:04 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( pflags )
{
ClientReliableWrite_Begin ( client , svc_ftesetclientpersist , 10 ) ;
ClientReliableWrite_Short ( client , pflags ) ;
if ( pflags & 1 )
ClientReliableWrite_Short ( client , client - > otherclientsknown [ j ] . vweap ) ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
*/
2004-08-23 00:15:46 +00:00
}
}
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
2008-11-09 22:29:28 +00:00
void SVNQ_EmitEntityState ( sizebuf_t * msg , entity_state_t * ent )
2004-08-23 00:15:46 +00:00
{
2018-04-06 17:21:15 +00:00
edict_t * ed = EDICT_NUM_PB ( svprogfuncs , ent - > number ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
entity_state_t * baseline = & ed - > baseline ;
2004-11-20 00:54:23 +00:00
2005-12-13 02:31:57 +00:00
int i , eff ;
2004-08-23 00:15:46 +00:00
float miss ;
2004-11-20 00:54:23 +00:00
unsigned int bits = 0 ;
2017-01-16 08:13:51 +00:00
int glowsize = 0 , glowcolour = 0 , colourmod = 0 ;
2006-01-28 02:35:40 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
2005-12-13 02:31:57 +00:00
{
2008-11-09 22:29:28 +00:00
miss = ent - > origin [ i ] - baseline - > origin [ i ] ;
2004-08-23 00:15:46 +00:00
if ( miss < - 0.1 | | miss > 0.1 )
bits | = NQU_ORIGIN1 < < i ;
}
2008-11-09 22:29:28 +00:00
if ( ent - > angles [ 0 ] ! = baseline - > angles [ 0 ] )
2004-08-23 00:15:46 +00:00
bits | = NQU_ANGLE1 ;
2005-12-13 02:31:57 +00:00
2008-11-09 22:29:28 +00:00
if ( ent - > angles [ 1 ] ! = baseline - > angles [ 1 ] )
2004-08-23 00:15:46 +00:00
bits | = NQU_ANGLE2 ;
2005-12-13 02:31:57 +00:00
2008-11-09 22:29:28 +00:00
if ( ent - > angles [ 2 ] ! = baseline - > angles [ 2 ] )
2004-08-23 00:15:46 +00:00
bits | = NQU_ANGLE3 ;
2005-12-13 02:31:57 +00:00
2009-07-18 20:14:10 +00:00
if ( ent - > dpflags & RENDER_STEP )
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
bits | = NQU_NOLERP ; // don't mess up the step animation
2004-08-23 00:15:46 +00:00
2012-09-30 05:52:03 +00:00
if ( baseline - > colormap ! = ent - > colormap )
2004-08-23 00:15:46 +00:00
bits | = NQU_COLORMAP ;
2008-11-09 22:29:28 +00:00
if ( baseline - > skinnum ! = ent - > skinnum )
2004-08-23 00:15:46 +00:00
bits | = NQU_SKIN ;
2008-11-09 22:29:28 +00:00
if ( baseline - > frame ! = ent - > frame )
2004-08-23 00:15:46 +00:00
bits | = NQU_FRAME ;
2008-11-09 22:29:28 +00:00
eff = ent - > effects ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( ( baseline - > effects & 0x00ff ) ! = ( ( int ) eff & 0x00ff ) )
2005-12-13 02:31:57 +00:00
bits | = NQU_EFFECTS ;
2004-11-20 00:54:23 +00:00
2008-11-09 22:29:28 +00:00
if ( baseline - > modelindex ! = ent - > modelindex )
2004-08-23 00:15:46 +00:00
bits | = NQU_MODEL ;
2008-11-09 22:29:28 +00:00
if ( ent - > number > = 256 )
2004-08-23 00:15:46 +00:00
bits | = NQU_LONGENTITY ;
2004-11-20 00:54:23 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( host_client - > protocol = = SCP_FITZ666 )
{
if ( baseline - > trans ! = ent - > trans )
bits | = FITZU_ALPHA ;
if ( baseline - > scale ! = ent - > scale )
bits | = RMQU_SCALE ;
if ( ( baseline - > frame & 0xff00 ) ! = ( ent - > frame & 0xff00 ) )
bits | = FITZU_FRAME2 ;
if ( ( baseline - > modelindex & 0xff00 ) ! = ( ent - > modelindex & 0xff00 ) )
bits | = FITZU_MODEL2 ;
if ( baseline - > dpflags & RENDER_STEP )
bits | = FITZU_LERPFINISH ;
2022-01-16 18:41:44 +00:00
if ( host_client - > qex )
{
if ( host_client - > edict = = ed )
{ //only send some bloated things to yourself.
bits | = QE_U_FLOATCOORDS ; //when predicting, you'll need more precision to avoid errors
if ( ed - > v - > flags )
bits | = QE_U_ENTFLAGS ;
}
if ( ed - > v - > solid )
bits | = QE_U_SOLIDTYPE ;
if ( ed - > v - > health )
bits | = QE_U_HEALTH ;
//bits |= QE_U_UNKNOWN26;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2016-07-12 00:40:13 +00:00
else if ( host_client - > protocol = = SCP_BJP3 )
{
2017-01-16 08:13:51 +00:00
//should be nehahra here, but that'll screw up DP, so don't generate anything.
2016-07-12 00:40:13 +00:00
}
2008-11-09 22:29:28 +00:00
#if 0
2017-01-16 08:13:51 +00:00
else if ( host_client - > protocol = = SCP_DARKPLACES6 | | host_client - > protocol = = SCP_DARKPLACES7 )
{
if ( baseline - > trans ! = ent - > trans )
bits | = DPU_ALPHA ;
if ( baseline - > scale ! = ent - > scale )
2005-05-17 02:36:54 +00:00
{
2017-01-16 08:13:51 +00:00
if ( ent - > scale ! = 0 | | baseline - > scale ! = 1 )
2005-05-17 02:36:54 +00:00
bits | = DPU_SCALE ;
}
2004-11-20 00:54:23 +00:00
2017-01-16 08:13:51 +00:00
if ( ent - > modelindex > = 256 ) //as much as protocols can handle
2005-05-26 12:55:34 +00:00
bits | = DPU_MODEL2 ;
2017-01-16 08:13:51 +00:00
if ( ( baseline - > effects & 0xff00 ) ! = ( ( int ) eff & 0xff00 ) )
2004-11-20 00:54:23 +00:00
bits | = DPU_EFFECTS2 ;
2017-01-16 08:13:51 +00:00
if ( ent - > dpflags & RENDER_EXTERIORMODEL )
2005-05-26 12:55:34 +00:00
bits | = DPU_EXTERIORMODEL ;
2017-01-16 08:13:51 +00:00
if ( ent - > dpflags & RENDER_VIEWMODEL )
2005-05-26 12:55:34 +00:00
bits | = DPU_VIEWMODEL ;
2004-11-20 00:54:23 +00:00
2017-01-16 08:13:51 +00:00
glowsize = ent - > glowsize ;
2017-01-24 20:15:14 +00:00
glowcolour = ent - > glowcolour ;
2005-05-19 02:53:03 +00:00
2017-01-16 08:13:51 +00:00
colourmod = ( ( int ) bound ( 0 , ent - > colormod [ 0 ] * ( 7.0f / 32.0f ) , 7 ) < < 5 ) | ( ( int ) bound ( 0 , ent - > colormod [ 1 ] * ( 7.0f / 32.0f ) , 7 ) < < 2 ) | ( ( int ) bound ( 0 , ent - > colormod [ 2 ] * ( 3.0f / 32.0f ) , 3 ) < < 0 ) ;
2006-02-27 00:42:25 +00:00
2004-11-20 00:54:23 +00:00
if ( 0 ! = glowsize )
bits | = DPU_GLOWSIZE ;
if ( 0 ! = glowcolor )
bits | = DPU_GLOWCOLOR ;
2006-02-27 00:42:25 +00:00
if ( 0 ! = colourmod )
bits | = DPU_COLORMOD ;
2004-11-20 00:54:23 +00:00
}
2017-01-16 08:13:51 +00:00
# endif
2005-05-26 12:55:34 +00:00
else
{
2008-11-09 22:29:28 +00:00
if ( ent - > modelindex > = 256 ) //as much as protocols can handle
2005-05-26 12:55:34 +00:00
return ;
2008-11-09 22:29:28 +00:00
if ( ent - > number > = 600 ) //too many for a conventional nq client.
2005-05-26 12:55:34 +00:00
return ;
}
2004-11-20 00:54:23 +00:00
if ( bits & 0xFF000000 )
bits | = DPU_EXTEND2 ;
2005-05-26 12:55:34 +00:00
if ( bits & 0xFF0000 )
bits | = DPU_EXTEND1 ;
if ( bits & 0xFF00 )
bits | = NQU_MOREBITS ;
2004-11-20 00:54:23 +00:00
2004-08-23 00:15:46 +00:00
//
// write the message
//
2014-04-24 01:53:01 +00:00
MSG_WriteByte ( msg , ( bits | NQU_SIGNAL ) & 0xff ) ; //gets caught on 'range error'
2004-11-20 00:54:23 +00:00
2014-04-24 01:53:01 +00:00
if ( bits & NQU_MOREBITS ) MSG_WriteByte ( msg , ( bits > > 8 ) & 0xff ) ;
if ( bits & DPU_EXTEND1 ) MSG_WriteByte ( msg , ( bits > > 16 ) & 0xff ) ;
if ( bits & DPU_EXTEND2 ) MSG_WriteByte ( msg , ( bits > > 24 ) & 0xff ) ;
2004-11-20 00:54:23 +00:00
2004-08-23 00:15:46 +00:00
if ( bits & NQU_LONGENTITY )
2008-11-09 22:29:28 +00:00
MSG_WriteShort ( msg , ent - > number ) ;
2004-08-23 00:15:46 +00:00
else
2008-11-09 22:29:28 +00:00
MSG_WriteByte ( msg , ent - > number ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
if ( bits & NQU_MODEL )
{
if ( host_client - > protocol = = SCP_BJP3 )
MSG_WriteShort ( msg , ent - > modelindex & 0xffff ) ;
else
MSG_WriteByte ( msg , ent - > modelindex & 0xff ) ;
}
2015-12-28 17:41:39 +00:00
if ( bits & NQU_FRAME ) MSG_WriteByte ( msg , ent - > frame & 0xff ) ;
if ( bits & NQU_COLORMAP ) MSG_WriteByte ( msg , ent - > colormap & 0xff ) ;
if ( bits & NQU_SKIN ) MSG_WriteByte ( msg , ent - > skinnum & 0xff ) ;
2005-12-13 02:31:57 +00:00
if ( bits & NQU_EFFECTS ) MSG_WriteByte ( msg , eff & 0x00ff ) ;
2022-01-16 18:41:44 +00:00
if ( host_client - > qex & & ( bits & QE_U_FLOATCOORDS ) )
{
if ( bits & NQU_ORIGIN1 ) MSG_WriteFloat ( msg , ent - > origin [ 0 ] ) ;
if ( bits & NQU_ANGLE1 ) MSG_WriteAngle ( msg , ent - > angles [ 0 ] ) ;
if ( bits & NQU_ORIGIN2 ) MSG_WriteFloat ( msg , ent - > origin [ 1 ] ) ;
if ( bits & NQU_ANGLE2 ) MSG_WriteAngle ( msg , ent - > angles [ 1 ] ) ;
if ( bits & NQU_ORIGIN3 ) MSG_WriteFloat ( msg , ent - > origin [ 2 ] ) ;
if ( bits & NQU_ANGLE3 ) MSG_WriteAngle ( msg , ent - > angles [ 2 ] ) ;
}
else
{
if ( bits & NQU_ORIGIN1 ) MSG_WriteCoord ( msg , ent - > origin [ 0 ] ) ;
if ( bits & NQU_ANGLE1 ) MSG_WriteAngle ( msg , ent - > angles [ 0 ] ) ;
if ( bits & NQU_ORIGIN2 ) MSG_WriteCoord ( msg , ent - > origin [ 1 ] ) ;
if ( bits & NQU_ANGLE2 ) MSG_WriteAngle ( msg , ent - > angles [ 1 ] ) ;
if ( bits & NQU_ORIGIN3 ) MSG_WriteCoord ( msg , ent - > origin [ 2 ] ) ;
if ( bits & NQU_ANGLE3 ) MSG_WriteAngle ( msg , ent - > angles [ 2 ] ) ;
}
2008-11-09 22:29:28 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( host_client - > protocol = = SCP_FITZ666 )
{
2016-10-22 07:06:51 +00:00
if ( bits & FITZU_ALPHA ) MSG_WriteByte ( msg , ( ent - > trans + 1 ) & 0xff ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( bits & RMQU_SCALE ) MSG_WriteByte ( msg , ent - > scale ) ;
if ( bits & FITZU_FRAME2 ) MSG_WriteByte ( msg , ent - > frame > > 8 ) ;
if ( bits & FITZU_MODEL2 ) MSG_WriteByte ( msg , ent - > modelindex > > 8 ) ;
2015-12-28 17:41:39 +00:00
if ( bits & FITZU_LERPFINISH ) MSG_WriteByte ( msg , bound ( 0 , ( int ) ( ( ed - > v - > nextthink - sv . world . physicstime ) * 255 ) , 255 ) ) ;
2022-01-16 18:41:44 +00:00
if ( host_client - > qex )
{
if ( bits & QE_U_SOLIDTYPE ) MSG_WriteByte ( msg , ed - > v - > solid ) ;
if ( bits & QE_U_ENTFLAGS ) MSG_WriteULEB128 ( msg , ed - > v - > flags ) ;
if ( bits & QE_U_HEALTH ) MSG_WriteSignedQEX ( msg , ed - > v - > health ) ;
if ( bits & QE_U_UNKNOWN26 ) MSG_WriteByte ( msg , 0 ) ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2016-07-12 00:40:13 +00:00
else if ( host_client - > protocol = = SCP_BJP3 )
{
}
2017-01-16 08:13:51 +00:00
else if ( host_client - > protocol = = SCP_DARKPLACES6 | | host_client - > protocol = = SCP_DARKPLACES7 )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
{
2015-12-28 17:41:39 +00:00
if ( bits & DPU_ALPHA ) MSG_WriteByte ( msg , ent - > trans ) ;
if ( bits & DPU_SCALE ) MSG_WriteByte ( msg , ent - > scale ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( bits & DPU_EFFECTS2 ) MSG_WriteByte ( msg , eff > > 8 ) ;
if ( bits & DPU_GLOWSIZE ) MSG_WriteByte ( msg , glowsize ) ;
2017-01-24 20:15:14 +00:00
if ( bits & DPU_GLOWCOLOR ) MSG_WriteByte ( msg , glowcolour ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( bits & DPU_COLORMOD ) MSG_WriteByte ( msg , colourmod ) ;
2015-12-28 17:41:39 +00:00
if ( bits & DPU_FRAME2 ) MSG_WriteByte ( msg , ent - > frame > > 8 ) ;
if ( bits & DPU_MODEL2 ) MSG_WriteByte ( msg , ent - > modelindex > > 8 ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2004-08-23 00:15:46 +00:00
}
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
typedef struct gibfilter_s {
struct gibfilter_s * next ;
int modelindex ;
int minframe ;
int maxframe ;
} gibfilter_t ;
2018-12-28 00:04:36 +00:00
static gibfilter_t * gibfilter ;
2012-07-05 19:42:36 +00:00
void SV_GibFilterPurge ( void )
{
gibfilter_t * gf ;
while ( gibfilter )
{
gf = gibfilter ;
gibfilter = gibfilter - > next ;
Z_Free ( gf ) ;
}
}
2008-06-01 22:06:22 +00:00
void SV_GibFilterAdd ( char * modelname , int min , int max , qboolean allowwarn )
2004-08-23 00:15:46 +00:00
{
int i ;
2005-12-13 02:31:57 +00:00
gibfilter_t * gf ;
2004-08-23 00:15:46 +00:00
2006-02-17 02:51:59 +00:00
for ( i = 1 ; sv . strings . model_precache [ i ] ; i + + )
if ( ! strcmp ( sv . strings . model_precache [ i ] , modelname ) )
2004-08-23 00:15:46 +00:00
break ;
2006-02-17 02:51:59 +00:00
if ( ! sv . strings . model_precache [ i ] )
2004-08-23 00:15:46 +00:00
{
2008-06-01 22:06:22 +00:00
if ( allowwarn )
Con_Printf ( " Filtered model \" %s \" was not precached \n " , modelname ) ;
2004-08-23 00:15:46 +00:00
return ; //model not in use.
}
gf = Z_Malloc ( sizeof ( gibfilter_t ) ) ;
gf - > modelindex = i ;
gf - > minframe = ( ( min = = - 1 ) ? 0 : min ) ;
2005-11-26 21:16:48 +00:00
gf - > maxframe = ( ( max = = - 1 ) ? 0x80000000 : max ) ;
2004-08-23 00:15:46 +00:00
gf - > next = gibfilter ;
gibfilter = gf ;
}
void SV_GibFilterInit ( void )
{
char buffer [ 2048 ] ;
char * file ;
int min , max ;
2012-07-05 19:42:36 +00:00
SV_GibFilterPurge ( ) ;
2004-08-23 00:15:46 +00:00
2007-09-02 19:55:17 +00:00
if ( svs . gametype ! = GT_PROGS & & svs . gametype ! = GT_Q1QVM )
2006-01-01 04:14:41 +00:00
return ;
2014-10-05 20:04:11 +00:00
file = COM_LoadStackFile ( " gibfiltr.cfg " , buffer , sizeof ( buffer ) , NULL ) ;
2004-08-23 00:15:46 +00:00
if ( ! file )
{
2005-12-21 07:00:33 +00:00
Con_DPrintf ( " gibfiltr.cfg file was not found. Using defaults \n " ) ;
2008-06-01 22:06:22 +00:00
SV_GibFilterAdd ( " progs/gib1.mdl " , - 1 , - 1 , false ) ;
SV_GibFilterAdd ( " progs/gib2.mdl " , - 1 , - 1 , false ) ;
SV_GibFilterAdd ( " progs/gib3.mdl " , - 1 , - 1 , false ) ;
SV_GibFilterAdd ( " progs/h_player.mdl " , - 1 , - 1 , false ) ;
2015-08-04 15:16:24 +00:00
// SV_GibFilterAdd("progs/player.mdl", 49, 49, false);
// SV_GibFilterAdd("progs/player.mdl", 60, 60, false);
// SV_GibFilterAdd("progs/player.mdl", 69, 69, false);
// SV_GibFilterAdd("progs/player.mdl", 84, 84, false);
// SV_GibFilterAdd("progs/player.mdl", 93, 93, false);
// SV_GibFilterAdd("progs/player.mdl", 102, 102, false);
2004-08-23 00:15:46 +00:00
return ;
}
while ( file )
{
file = COM_Parse ( file ) ;
if ( ! file )
2005-12-13 02:31:57 +00:00
{
2004-08-23 00:15:46 +00:00
return ;
}
min = atoi ( com_token ) ;
file = COM_Parse ( file ) ; //handles nulls nicly
max = atoi ( com_token ) ;
file = COM_Parse ( file ) ;
if ( ! file )
{
Con_Printf ( " Sudden ending to gibfiltr.cfg \n " ) ;
return ;
}
2008-06-01 22:06:22 +00:00
SV_GibFilterAdd ( com_token , min , max , true ) ;
2004-08-23 00:15:46 +00:00
}
}
qboolean SV_GibFilter ( edict_t * ent )
{
2005-03-28 00:11:59 +00:00
int indx = ent - > v - > modelindex ;
int frame = ent - > v - > frame ;
2004-08-23 00:15:46 +00:00
gibfilter_t * gf ;
for ( gf = gibfilter ; gf ; gf = gf - > next )
{
if ( gf - > modelindex = = indx )
if ( frame > = gf - > minframe & & frame < = gf - > maxframe )
return true ;
}
return false ;
}
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
static void SV_Snapshot_Build_Playback ( client_t * client , packet_entities_t * pack )
2004-08-23 00:15:46 +00:00
{
2008-11-09 22:29:28 +00:00
int e ;
2004-08-23 00:15:46 +00:00
entity_state_t * state ;
2008-11-09 22:29:28 +00:00
mvdentity_state_t * dement ;
2004-12-08 04:14:52 +00:00
for ( e = 1 , dement = & sv . demostate [ e ] ; e < = sv . demomaxents ; e + + , dement + + )
2004-08-23 00:15:46 +00:00
{
if ( ! dement - > modelindex )
continue ;
2013-12-02 14:30:30 +00:00
if ( e > = 1 & & e < = svs . allocated_client_slots )
2004-08-23 00:15:46 +00:00
continue ;
if ( pack - > num_entities = = pack - > max_entities )
continue ; // all full
//the entity would mess up the client and possibly disconnect them.
//FIXME: add an option to drop clients... entity fog could be killed in this way.
if ( e > = 512 & & ! ( client - > fteprotocolextensions & PEXT_ENTITYDBL ) )
continue ;
if ( e > = 1024 & & ! ( client - > fteprotocolextensions & PEXT_ENTITYDBL2 ) )
continue ;
2005-06-22 17:10:13 +00:00
// if (dement->modelindex >= 256 && !(client->fteprotocolextensions & PEXT_MODELDBL))
// continue;
2004-08-23 00:15:46 +00:00
state = & pack - > entities [ pack - > num_entities ] ;
pack - > num_entities + + ;
state - > number = e ;
2004-12-06 00:58:19 +00:00
state - > flags = EF_DIMLIGHT ;
2004-08-23 00:15:46 +00:00
VectorCopy ( dement - > origin , state - > origin ) ;
2004-12-08 04:14:52 +00:00
state - > angles [ 0 ] = dement - > angles [ 0 ] * 360.0f / 256 ;
state - > angles [ 1 ] = dement - > angles [ 1 ] * 360.0f / 256 ;
state - > angles [ 2 ] = dement - > angles [ 2 ] * 360.0f / 256 ;
2004-08-23 00:15:46 +00:00
state - > modelindex = dement - > modelindex ;
state - > frame = dement - > frame ;
state - > colormap = dement - > colormap ;
state - > skinnum = dement - > skinnum ;
state - > effects = dement - > effects ;
# ifdef PEXT_SCALE
state - > scale = dement - > scale ;
# endif
# ifdef PEXT_TRANS
state - > trans = dement - > trans ;
# endif
# ifdef PEXT_FATNESS
state - > fatness = dement - > fatness ;
# endif
}
for ( e = 0 ; e < sv . numdemospikes ; e + + )
{
if ( SV_DemoNailUpdate ( e ) )
continue ;
}
2008-11-09 22:29:28 +00:00
}
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
void SV_Snapshot_BuildStateQ1 ( entity_state_t * state , edict_t * ent , client_t * client , packet_entities_t * pack )
2008-11-09 22:29:28 +00:00
{
//builds an entity_state from an entity
//note that client can be null, for building baselines.
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
int i ;
2012-02-12 05:18:31 +00:00
state - > number = NUM_FOR_EDICT ( svprogfuncs , ent ) ;
state - > u . q1 . msec = 0 ;
state - > u . q1 . pmovetype = 0 ;
state - > u . q1 . movement [ 0 ] = 0 ;
state - > u . q1 . movement [ 1 ] = 0 ;
state - > u . q1 . movement [ 2 ] = 0 ;
state - > u . q1 . velocity [ 0 ] = 0 ;
state - > u . q1 . velocity [ 1 ] = 0 ;
state - > u . q1 . velocity [ 2 ] = 0 ;
2012-02-14 15:50:34 +00:00
2015-01-12 12:28:13 +00:00
VectorCopy ( ent - > v - > origin , state - > origin ) ;
VectorCopy ( ent - > v - > angles , state - > angles ) ;
2015-01-21 18:18:37 +00:00
state - > u . q1 . weaponframe = 0 ;
if ( ( state - > number - 1 ) < ( unsigned int ) sv . allocated_client_slots & & ( client = = & svs . clients [ state - > number - 1 ] | | client = = svs . clients [ state - > number - 1 ] . controller | | ( client & & ( ! client - > edict | | client - > spec_track = = state - > number ) ) ) )
if ( ! client | | ! ( client - > fteprotocolextensions2 & PEXT2_PREDINFO ) )
state - > u . q1 . weaponframe = ent - > v - > weaponframe ;
2015-02-02 08:01:53 +00:00
if ( ( state - > number - 1 ) < ( unsigned int ) sv . allocated_client_slots & & ent - > v - > movetype & & client )
2012-02-12 05:18:31 +00:00
{
client_t * cl = & svs . clients [ state - > number - 1 ] ;
if ( cl - > isindependant )
{
state - > u . q1 . pmovetype = ent - > v - > movetype ;
2019-03-01 22:39:30 +00:00
if ( state - > u . q1 . pmovetype & & ( ( int ) ent - > v - > flags & FL_ONGROUND ) & & ( client - > zquake_extensions & Z_EXT_PF_ONGROUND ) )
state - > u . q1 . pmovetype | = 0x80 ;
2019-09-25 20:23:24 +00:00
if ( state - > u . q1 . pmovetype & & ( ( int ) cl - > jump_held ) & & ( client - > zquake_extensions & Z_EXT_PM_TYPE ) )
state - > u . q1 . pmovetype | = 0x40 ;
2012-02-14 15:50:34 +00:00
if ( cl ! = client & & client )
2012-02-12 05:18:31 +00:00
{ /*only generate movement values if the client doesn't already know them...*/
state - > u . q1 . movement [ 0 ] = ent - > xv - > movement [ 0 ] ;
state - > u . q1 . movement [ 1 ] = ent - > xv - > movement [ 1 ] ;
state - > u . q1 . movement [ 2 ] = ent - > xv - > movement [ 2 ] ;
state - > u . q1 . msec = bound ( 0 , 1000 * ( sv . time - cl - > localtime ) , 255 ) ;
}
state - > u . q1 . velocity [ 0 ] = ent - > v - > velocity [ 0 ] * 8 ;
state - > u . q1 . velocity [ 1 ] = ent - > v - > velocity [ 1 ] * 8 ;
state - > u . q1 . velocity [ 2 ] = ent - > v - > velocity [ 2 ] * 8 ;
}
2014-01-15 02:32:13 +00:00
else if ( ent = = cl - > edict )
{
state - > u . q1 . velocity [ 0 ] = ent - > v - > velocity [ 0 ] * 8 ;
state - > u . q1 . velocity [ 1 ] = ent - > v - > velocity [ 1 ] * 8 ;
state - > u . q1 . velocity [ 2 ] = ent - > v - > velocity [ 2 ] * 8 ;
}
2015-01-12 12:28:13 +00:00
//fixme: deal with fixangles
2015-02-02 08:01:53 +00:00
if ( client - > fteprotocolextensions2 & PEXT2_PREDINFO )
2015-01-21 18:18:37 +00:00
{
2015-02-02 08:01:53 +00:00
state - > u . q1 . vangle [ 0 ] = ANGLE2SHORT ( ent - > v - > v_angle [ 0 ] ) ;
state - > u . q1 . vangle [ 1 ] = ANGLE2SHORT ( ent - > v - > v_angle [ 1 ] ) ;
state - > u . q1 . vangle [ 2 ] = ANGLE2SHORT ( ent - > v - > v_angle [ 2 ] ) ;
}
else
{
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
2019-03-01 22:39:30 +00:00
if ( state - > u . q1 . pmovetype & & ( ( state - > u . q1 . pmovetype & 0x7f ) ! = MOVETYPE_TOSS & & ( state - > u . q1 . pmovetype & 0x7f ) ! = MOVETYPE_BOUNCE ) )
2015-02-02 08:01:53 +00:00
{
state - > angles [ 0 ] = ent - > v - > v_angle [ 0 ] / - 3.0 ;
state - > angles [ 1 ] = ent - > v - > v_angle [ 1 ] ;
state - > angles [ 2 ] = ent - > v - > v_angle [ 2 ] ;
}
2015-01-21 18:18:37 +00:00
}
2012-02-12 05:18:31 +00:00
}
2013-03-12 22:53:23 +00:00
if ( client & & client - > edict & & ( ent - > v - > owner = = client - > edict - > entnum ) )
2016-07-12 00:40:13 +00:00
state - > solidsize = 0 ;
2013-03-12 22:53:23 +00:00
else if ( ent - > v - > solid = = SOLID_BSP | | ( ent - > v - > skin < 0 & & ent - > v - > modelindex ) )
2016-07-12 00:40:13 +00:00
state - > solidsize = ES_SOLID_BSP ;
2012-02-12 05:18:31 +00:00
else if ( ent - > v - > solid = = SOLID_BBOX | | ent - > v - > solid = = SOLID_SLIDEBOX | | ent - > v - > skin < 0 )
2016-07-12 00:40:13 +00:00
state - > solidsize = ent - > solidsize ;
2012-02-12 05:18:31 +00:00
else
2016-07-12 00:40:13 +00:00
state - > solidsize = 0 ;
2008-11-09 22:29:28 +00:00
state - > dpflags = 0 ;
if ( ent - > xv - > viewmodelforclient )
{ //this ent would have been filtered out by now if its not ours
//if ent->viewmodelforclient == client then:
state - > dpflags | = RENDER_VIEWMODEL ;
}
2013-06-23 02:17:02 +00:00
state - > colormap = ent - > v - > colormap ;
if ( state - > colormap > = 1024 )
2012-02-12 05:18:31 +00:00
state - > dpflags | = RENDER_COLORMAPPED ;
2013-06-23 02:17:02 +00:00
else if ( client & & state - > colormap > client - > max_net_clients )
state - > colormap = 0 ;
2008-11-09 22:29:28 +00:00
if ( ent - > xv - > exteriormodeltoclient & & client )
{
if ( ent - > xv - > exteriormodeltoclient = = EDICT_TO_PROG ( svprogfuncs , client - > edict ) )
state - > dpflags | = RENDER_EXTERIORMODEL ;
//everyone else sees it normally.
}
2016-10-22 07:06:51 +00:00
if ( ent - > xv - > basebone < 0 )
2016-07-12 00:40:13 +00:00
{
2018-03-24 04:02:09 +00:00
# ifdef SKELETALMODELS
2016-07-12 00:40:13 +00:00
if ( ent - > xv - > skeletonindex & & pack )
{
framestate_t fs ;
fs . skeltype = SKEL_IDENTITY ;
fs . bonecount = 0 ;
2017-01-13 00:39:50 +00:00
skel_lookup ( & sv . world , ent - > xv - > skeletonindex , & fs ) ;
2016-07-12 00:40:13 +00:00
if ( fs . skeltype = = SKEL_RELATIVE & & fs . bonecount )
{
Bones_To_PosQuat4 ( fs . bonecount , fs . bonestate , AllocateBoneSpace ( pack , state - > bonecount = fs . bonecount , & state - > boneoffset ) ) ;
2016-10-22 07:06:51 +00:00
//state->dpflags |= RENDER_COMPLEXANIMATION;
2016-07-12 00:40:13 +00:00
}
}
2018-03-24 04:02:09 +00:00
# endif
2016-07-12 00:40:13 +00:00
}
else
{
state - > basebone = ent - > xv - > basebone ;
state - > baseframe = ent - > xv - > baseframe ;
}
if ( ! ent - > v - > movetype | | ent - > v - > movetype = = MOVETYPE_STEP )
2009-07-18 20:14:10 +00:00
state - > dpflags | = RENDER_STEP ;
2008-11-09 22:29:28 +00:00
state - > modelindex = ent - > v - > modelindex ;
2012-02-12 05:18:31 +00:00
state - > modelindex2 = ent - > xv - > vw_index ;
2008-11-09 22:29:28 +00:00
state - > frame = ent - > v - > frame ;
state - > skinnum = ent - > v - > skin ;
state - > effects = ent - > v - > effects ;
2012-02-14 15:50:34 +00:00
state - > effects | = ( int ) ent - > xv - > modelflags < < 24 ;
2017-02-19 00:15:42 +00:00
# ifdef HEXEN2
2008-11-09 22:29:28 +00:00
state - > hexen2flags = ent - > xv - > drawflags ;
state - > abslight = ( int ) ( ent - > xv - > abslight * 255 ) & 255 ;
2017-02-19 00:15:42 +00:00
# endif
2008-11-09 22:29:28 +00:00
state - > tagentity = ent - > xv - > tag_entity ;
state - > tagindex = ent - > xv - > tag_index ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
state - > light [ 0 ] = ent - > xv - > color [ 0 ] * 1024 ;
state - > light [ 1 ] = ent - > xv - > color [ 1 ] * 1024 ;
state - > light [ 2 ] = ent - > xv - > color [ 2 ] * 1024 ;
2008-11-09 22:29:28 +00:00
state - > light [ 3 ] = ent - > xv - > light_lev ;
state - > lightstyle = ent - > xv - > style ;
state - > lightpflags = ent - > xv - > pflags ;
2012-07-05 19:42:36 +00:00
state - > u . q1 . traileffectnum = ent - > xv - > traileffectnum ;
2016-10-22 07:06:51 +00:00
state - > u . q1 . emiteffectnum = ent - > xv - > emiteffectnum ;
2012-07-05 19:42:36 +00:00
2015-10-27 15:20:15 +00:00
if ( ent - > xv - > gravitydir [ 2 ] = = - 1 )
2012-07-05 19:42:36 +00:00
{
state - > u . q1 . gravitydir [ 0 ] = 0 ;
state - > u . q1 . gravitydir [ 1 ] = 0 ;
}
2015-10-27 15:20:15 +00:00
else if ( ( ! ent - > xv - > gravitydir [ 0 ] & & ! ent - > xv - > gravitydir [ 1 ] & & ! ent - > xv - > gravitydir [ 2 ] ) ) // || (ent->xv->gravitydir[2] == -1))
{
vec3_t ang ;
if ( sv . world . g . defaultgravitydir [ 2 ] = = - 1 )
{
state - > u . q1 . gravitydir [ 0 ] = 0 ;
state - > u . q1 . gravitydir [ 1 ] = 0 ;
}
else
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
VectorAngles ( sv . world . g . defaultgravitydir , NULL , ang , false ) ;
2015-10-27 15:20:15 +00:00
state - > u . q1 . gravitydir [ 0 ] = ( ( ang [ 0 ] / 360 ) * 256 ) - 192 ;
state - > u . q1 . gravitydir [ 1 ] = ( ang [ 1 ] / 360 ) * 256 ;
}
}
2012-07-05 19:42:36 +00:00
else
{
vec3_t ang ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
VectorAngles ( ent - > xv - > gravitydir , NULL , ang , false ) ;
2012-07-05 19:42:36 +00:00
state - > u . q1 . gravitydir [ 0 ] = ( ( ang [ 0 ] / 360 ) * 256 ) - 192 ;
state - > u . q1 . gravitydir [ 1 ] = ( ang [ 1 ] / 360 ) * 256 ;
}
2008-11-09 22:29:28 +00:00
2012-05-10 18:54:07 +00:00
if ( ( ( int ) ent - > v - > flags & FL_CLASS_DEPENDENT ) & & client & & client - > playerclass ) //hexen2 wierdness.
2008-11-09 22:29:28 +00:00
{
char modname [ MAX_QPATH ] ;
Q_strncpyz ( modname , sv . strings . model_precache [ state - > modelindex ] , sizeof ( modname ) ) ;
if ( strlen ( modname ) > 5 )
{
modname [ strlen ( modname ) - 5 ] = client - > playerclass + ' 0 ' ;
state - > modelindex = SV_ModelIndex ( modname ) ;
}
}
2011-10-27 16:16:29 +00:00
if ( state - > effects & DPEF_LOWPRECISION )
2014-02-07 08:38:40 +00:00
state - > effects & = ~ DPEF_LOWPRECISION ; //we don't support it, nor does dp any more. strip it.
2008-11-09 22:29:28 +00:00
if ( state - > effects & EF_FULLBRIGHT ) //wrap the field for fte clients (this is horrible)
state - > hexen2flags | = MLS_FULLBRIGHT ;
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( client & & ! ISQWCLIENT ( client ) )
{
if ( ent - > muzzletime > client - > lastoutgoingphysicstime & & ent - > muzzletime < = ( float ) sv . world . physicstime )
state - > effects | = EF_MUZZLEFLASH ;
if ( client - > spectator & & ! client - > spec_track & & ent = = client - > edict )
state - > modelindex = sv_playermodel ;
}
2021-08-24 06:06:05 +00:00
if ( sv . world . remasterlogic )
{
if ( state - > effects & ( REEF_QUADLIGHT | REEF_PENTLIGHT | REEF_CANDLELIGHT ) )
{ //remap these flags to something new.
unsigned int old = state - > effects ;
state - > effects & = ~ ( REEF_QUADLIGHT | REEF_PENTLIGHT | REEF_CANDLELIGHT ) ;
if ( old & REEF_QUADLIGHT )
state - > effects | = EF_BLUE ;
if ( old & REEF_PENTLIGHT )
state - > effects | = EF_RED ;
if ( old & REEF_CANDLELIGHT )
state - > effects | = 0 ;
}
}
else if ( progstype ! = PROG_QW )
2008-11-09 22:29:28 +00:00
{
2015-08-22 02:59:01 +00:00
if ( progstype = = PROG_TENEBRAE )
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
//tenebrae has some hideous hacks
if ( ! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/w_light.spr " ) | |
! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/b_light.spr " ) | |
! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/s_light.spr " ) | |
! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/flame.mdl " ) | |
! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/flame2.mdl " ) )
2014-10-05 20:04:11 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
//fixme: add some default colours
2014-10-05 20:04:11 +00:00
state - > lightpflags | = PFLAGS_FULLDYNAMIC ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ! state - > light [ 3 ] )
state - > light [ 3 ] = 350 ;
2014-10-05 20:04:11 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ! strcmp ( sv . strings . model_precache [ state - > modelindex ] , " progs/lavaball.mdl " ) )
2016-07-12 00:40:13 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
state - > lightpflags | = PFLAGS_FULLDYNAMIC ;
2016-07-12 00:40:13 +00:00
state - > skinnum = 17 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
state - > light [ 3 ] = 270 ;
2016-07-12 00:40:13 +00:00
}
2014-10-05 20:04:11 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( state - > effects & & client & & ISQWCLIENT ( client ) ) //don't send extra nq effects to a qw client.
2008-11-09 22:29:28 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
//EF_NODRAW doesn't draw the model.
//The client still needs to know about it though, as it might have other effects on it.
if ( progstype = = PROG_H2 )
{
if ( state - > effects = = H2EF_NODRAW )
{
//actually, H2 is pretty lame about this
state - > effects = 0 ;
state - > modelindex = 0 ;
state - > frame = 0 ;
state - > colormap = 0 ;
state - > abslight = 0 ;
state - > skinnum = 0 ;
state - > hexen2flags = 0 ;
}
}
2015-08-22 02:59:01 +00:00
else if ( progstype = = PROG_TENEBRAE )
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( state - > effects & 16 ) //tenebrae's EF_FULLDYNAMIC
{
state - > effects & = ~ 16 ;
state - > lightpflags | = PFLAGS_FULLDYNAMIC ;
}
2015-08-22 02:59:01 +00:00
if ( state - > effects & 32 ) //tenebrae's EF_GREEN
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
state - > effects & = ~ 32 ;
state - > effects | = EF_GREEN ;
}
}
2020-04-19 01:23:32 +00:00
if ( state - > number < = sv . allocated_client_slots ) // clear only client ents
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
if ( state - > effects & NQEF_NODRAW )
state - > modelindex = 0 ;
state - > effects & = ~ ( QWEF_FLAG1 | QWEF_FLAG2 ) ;
2020-04-19 01:23:32 +00:00
}
2014-10-05 20:04:11 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ( state - > effects & EF_DIMLIGHT ) & & ! ( state - > effects & ( EF_RED | EF_BLUE ) ) )
{
int it = ent - > v - > items ;
state - > effects & = ~ EF_DIMLIGHT ;
if ( ( it & ( IT_INVULNERABILITY | IT_QUAD ) ) = = ( IT_INVULNERABILITY | IT_QUAD ) )
state - > effects | = EF_RED | EF_BLUE ;
else if ( it & IT_INVULNERABILITY )
state - > effects | = EF_RED ;
else if ( it & IT_QUAD )
state - > effects | = EF_BLUE ;
else
state - > effects | = EF_DIMLIGHT ;
}
2014-10-05 20:04:11 +00:00
}
2004-08-23 00:15:46 +00:00
}
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( ! ent - > xv - > colormod [ 0 ] & & ! ent - > xv - > colormod [ 1 ] & & ! ent - > xv - > colormod [ 2 ] )
{
state - > colormod [ 0 ] = ( 256 ) / 8 ;
state - > colormod [ 1 ] = ( 256 ) / 8 ;
state - > colormod [ 2 ] = ( 256 ) / 8 ;
}
else
{
i = ent - > xv - > colormod [ 0 ] * ( 256 / 8 ) ; state - > colormod [ 0 ] = bound ( 0 , i , 255 ) ;
i = ent - > xv - > colormod [ 1 ] * ( 256 / 8 ) ; state - > colormod [ 1 ] = bound ( 0 , i , 255 ) ;
i = ent - > xv - > colormod [ 2 ] * ( 256 / 8 ) ; state - > colormod [ 2 ] = bound ( 0 , i , 255 ) ;
}
2012-02-14 15:50:34 +00:00
if ( ! ent - > xv - > glowmod [ 0 ] & & ! ent - > xv - > glowmod [ 1 ] & & ! ent - > xv - > glowmod [ 2 ] )
{
state - > glowmod [ 0 ] = ( 256 / 8 ) ;
state - > glowmod [ 1 ] = ( 256 / 8 ) ;
state - > glowmod [ 2 ] = ( 256 / 8 ) ;
}
else
{
state - > glowmod [ 0 ] = ent - > xv - > glowmod [ 0 ] * ( 256 / 8 ) ;
state - > glowmod [ 1 ] = ent - > xv - > glowmod [ 1 ] * ( 256 / 8 ) ;
state - > glowmod [ 2 ] = ent - > xv - > glowmod [ 2 ] * ( 256 / 8 ) ;
}
2008-11-09 22:29:28 +00:00
state - > glowsize = ent - > xv - > glow_size * 0.25 ;
state - > glowcolour = ent - > xv - > glow_color ;
if ( ent - > xv - > glow_trail )
state - > dpflags | = RENDER_GLOWTRAIL ;
# ifdef PEXT_SCALE
if ( ! ent - > xv - > scale )
state - > scale = 1 * 16 ;
2014-03-30 08:55:06 +00:00
else
2015-09-06 03:30:28 +00:00
state - > scale = bound ( 1 , ent - > xv - > scale * 16 , 255 ) ;
2014-03-30 08:55:06 +00:00
2008-11-09 22:29:28 +00:00
# endif
# ifdef PEXT_TRANS
if ( ! ent - > xv - > alpha )
state - > trans = 255 ;
2014-03-30 08:55:06 +00:00
else
2016-10-22 07:06:51 +00:00
state - > trans = bound ( 1 , ent - > xv - > alpha * 254 , 254 ) ;
2008-11-09 22:29:28 +00:00
//QSG_DIMENSION_PLANES - if the only shared dimensions are ghost dimensions, Set half alpha.
if ( client & & client - > edict )
{
if ( ( ( int ) client - > edict - > xv - > dimension_see & ( int ) ent - > xv - > dimension_ghost ) )
if ( ! ( ( int ) client - > edict - > xv - > dimension_see & ( ( int ) ent - > xv - > dimension_seen & ~ ( int ) ent - > xv - > dimension_ghost ) ) )
{
if ( ent - > xv - > dimension_ghost_alpha )
state - > trans * = ent - > xv - > dimension_ghost_alpha ;
else
state - > trans * = 0.5 ;
}
}
# endif
# ifdef PEXT_FATNESS
2012-01-28 10:30:44 +00:00
state - > fatness = ent - > xv - > fatness ;
2008-11-09 22:29:28 +00:00
# endif
2012-02-12 05:18:31 +00:00
# pragma warningmsg("TODO: Fix attachments for more vanilla clients")
2008-11-09 22:29:28 +00:00
}
2014-02-07 08:38:40 +00:00
void SV_Snapshot_BuildQ1 ( client_t * client , packet_entities_t * pack , pvscamera_t * cameras , edict_t * clent )
2008-11-09 22:29:28 +00:00
{
//pvs and clent can be null, but only if the other is also null
int e , i ;
2014-02-07 08:38:40 +00:00
edict_t * ent , * tracecullent ; //tracecullent is different from ent because attached models cull the parent instead. also, null for entities which are not culled.
2008-11-09 22:29:28 +00:00
entity_state_t * state ;
# define DEPTHOPTIMISE
# ifdef DEPTHOPTIMISE
vec3_t org ;
2012-02-12 05:18:31 +00:00
static float distances [ 32768 ] ;
2008-11-09 22:29:28 +00:00
float dist ;
# endif
globalvars_t * pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
int pvsflags ;
2013-03-12 23:24:15 +00:00
int limit ;
2014-02-07 08:38:40 +00:00
int c , maxc = cameras ? cameras - > numents : 0 ;
2019-02-01 08:29:14 +00:00
client_t * seat ;
2008-11-09 22:29:28 +00:00
2014-02-07 08:38:40 +00:00
//this entity is watching from outside themselves. The client is tricked into thinking that they themselves are in the view ent, and a new dummy ent (the old them) must be spawned.
2019-02-01 08:29:14 +00:00
if ( clent & & ISQWCLIENT ( client ) )
2004-08-23 00:15:46 +00:00
{
2019-02-01 08:29:14 +00:00
for ( seat = client ; seat ; seat = seat - > controlled )
{
edict_t * clent = seat - > edict ;
if ( ! client - > viewent )
continue ;
2008-11-09 22:29:28 +00:00
//FIXME: this hack needs cleaning up
# ifdef DEPTHOPTIMISE
2019-02-01 08:29:14 +00:00
distances [ pack - > num_entities ] = 0 ;
2008-11-09 22:29:28 +00:00
# endif
2019-02-01 08:29:14 +00:00
state = & pack - > entities [ pack - > num_entities ] ;
pack - > num_entities + + ;
2004-08-23 00:15:46 +00:00
2019-02-01 08:29:14 +00:00
SV_Snapshot_BuildStateQ1 ( state , clent , seat , pack ) ;
2004-08-23 00:15:46 +00:00
2019-02-01 08:29:14 +00:00
state - > number = seat - svs . clients + 1 ;
2004-08-23 00:15:46 +00:00
2019-02-01 08:29:14 +00:00
//yeah, I doubt anyone will need this
if ( progstype = = PROG_QW )
2007-06-20 00:02:54 +00:00
{
2019-02-01 08:29:14 +00:00
if ( ( int ) clent - > v - > effects & QWEF_FLAG1 )
{
memcpy ( & pack - > entities [ pack - > num_entities ] , state , sizeof ( * state ) ) ;
state = & pack - > entities [ pack - > num_entities ] ;
pack - > num_entities + + ;
state - > modelindex = SV_ModelIndex ( " progs/flag.mdl " ) ;
state - > frame = 0 ;
state - > number + + ; //yeek
state - > skinnum = 0 ;
}
else if ( ( int ) clent - > v - > effects & QWEF_FLAG2 )
{
memcpy ( & pack - > entities [ pack - > num_entities ] , state , sizeof ( * state ) ) ;
state = & pack - > entities [ pack - > num_entities ] ;
pack - > num_entities + + ;
state - > modelindex = SV_ModelIndex ( " progs/flag.mdl " ) ;
state - > frame = 0 ;
state - > number + + ; //yeek
state - > skinnum = 1 ;
}
2007-06-20 00:02:54 +00:00
}
2004-08-23 00:15:46 +00:00
}
}
2008-11-09 22:29:28 +00:00
2012-02-12 05:18:31 +00:00
/*legacy qw clients get their players separately*/
if ( ISQWCLIENT ( client ) & & ! ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
2013-06-23 02:17:02 +00:00
e = min ( sv . allocated_client_slots + 1 , client - > max_net_clients ) ;
2012-02-12 05:18:31 +00:00
else
e = 1 ;
2008-11-09 22:29:28 +00:00
2014-12-02 02:00:41 +00:00
limit = sv . world . num_edicts ;
if ( client - > max_net_ents < limit )
{
limit = client - > max_net_ents ;
if ( ! ( client - > plimitwarned & PLIMIT_ENTITIES ) )
{
client - > plimitwarned | = PLIMIT_ENTITIES ;
SV_ClientPrintf ( client , PRINT_HIGH , " WARNING: Your client's network protocol only supports %i entities. Please upgrade or enable extensions. \n " , client - > max_net_ents ) ;
}
}
2013-03-12 23:24:15 +00:00
2014-06-25 03:53:11 +00:00
if ( client - > penalties & BAN_BLIND )
{
e = client - > edict - > entnum ;
limit = e + 1 ;
}
2020-06-12 23:29:58 +00:00
if ( sv_cullentities_trace . ival & & client - > lastseen_count < limit )
Z_ReallocElements ( ( void * * ) & client - > lastseen_time , & client - > lastseen_count , limit , sizeof ( client - > lastseen_time ) ) ;
2013-03-12 23:24:15 +00:00
for ( ; e < limit ; e + + )
2004-08-23 00:15:46 +00:00
{
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , e ) ;
2016-07-21 19:27:59 +00:00
if ( ED_ISFREE ( ent ) )
2013-12-23 21:33:40 +00:00
continue ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( ent - > xv - > customizeentityforclient )
{
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , ent ) ;
2010-07-18 08:42:59 +00:00
pr_global_struct - > other = ( clent ? EDICT_TO_PROG ( svprogfuncs , clent ) : 0 ) ;
2008-11-09 22:29:28 +00:00
PR_ExecuteProgram ( svprogfuncs , ent - > xv - > customizeentityforclient ) ;
if ( ! G_FLOAT ( OFS_RETURN ) )
continue ;
}
2004-08-23 00:15:46 +00:00
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# ifdef NQPROT
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
if ( progstype ! = PROG_QW )
{
if ( ( int ) ent - > v - > effects & EF_MUZZLEFLASH )
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
ent - > v - > effects = ( int ) ent - > v - > effects & ~ EF_MUZZLEFLASH ;
ent - > muzzletime = sv . world . physicstime ;
MSG_WriteByte ( & sv . multicast , svc_muzzleflash ) ;
MSG_WriteEntity ( & sv . multicast , NUM_FOR_EDICT ( svprogfuncs , ent ) ) ;
SV_MulticastProtExt ( ent - > v - > origin , MULTICAST_PHS , pr_global_struct - > dimension_send , 0 , 0 ) ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
}
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
# endif
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
2013-12-23 21:33:40 +00:00
pvsflags = ent - > xv - > pvsflags ;
2014-02-07 08:38:40 +00:00
for ( c = 0 ; c < maxc ; c + + )
{
if ( ent = = cameras - > ent [ c ] )
break ;
}
if ( c < maxc )
tracecullent = NULL ;
else if ( ent - > xv - > viewmodelforclient )
2010-07-11 02:22:39 +00:00
{
2010-07-18 08:42:59 +00:00
if ( ent - > xv - > viewmodelforclient ! = ( clent ? EDICT_TO_PROG ( svprogfuncs , clent ) : 0 ) )
2010-07-11 02:22:39 +00:00
continue ;
2013-12-23 21:33:40 +00:00
tracecullent = NULL ;
2010-07-11 02:22:39 +00:00
}
2008-11-09 22:29:28 +00:00
else
{
2017-07-28 01:49:25 +00:00
// many ents are not intended to be networked.
if ( ! ( ent - > xv - > SendEntity & & client - > csqcactive ) & & //if SendEntity is set then its definitely important, even if not visible.
( ! ent - > v - > modelindex | | ! * PR_GetString ( svprogfuncs , ent - > v - > model ) ) & & // also definitely valid if it has a model
! ( ( int ) ent - > xv - > pflags & PFLAGS_FULLDYNAMIC ) & & //needs to be networked if its giving off realtime lights, even when it has no model.
ent - > v - > skin > = 0 ) //ents with negative skins are networked too. eg ladder volumes.
2008-11-09 22:29:28 +00:00
continue ;
2014-02-07 08:38:40 +00:00
if ( cameras ) //self doesn't get a pvs test, to cover teleporters
2004-10-10 06:32:29 +00:00
{
2008-11-09 22:29:28 +00:00
if ( ( int ) ent - > v - > effects & EF_NODEPTHTEST )
2013-12-23 21:33:40 +00:00
tracecullent = NULL ;
2008-11-09 22:29:28 +00:00
else if ( ( pvsflags & PVSF_MODE_MASK ) < PVSF_USEPHS )
2008-05-25 22:23:43 +00:00
{
2008-11-09 22:29:28 +00:00
//branch out to the pvs testing.
2010-07-11 02:22:39 +00:00
if ( ent - > xv - > tag_entity )
2008-11-09 22:29:28 +00:00
{
int c = 10 ;
2013-12-23 21:33:40 +00:00
tracecullent = ent ;
while ( tracecullent - > xv - > tag_entity & & c - - > 0 )
2008-11-09 22:29:28 +00:00
{
2018-04-06 17:21:15 +00:00
tracecullent = EDICT_NUM_UB ( svprogfuncs , tracecullent - > xv - > tag_entity ) ;
2013-12-23 21:33:40 +00:00
}
if ( tracecullent = = clent )
tracecullent = NULL ;
else if ( tracecullent - > xv - > viewmodelforclient )
{
//special hack so viewmodelforclient on the root of the tagged entity overrides pvs
if ( tracecullent - > xv - > viewmodelforclient ! = ( clent ? EDICT_TO_PROG ( svprogfuncs , clent ) : 0 ) )
continue ;
tracecullent = NULL ; //don't tracecull
}
else
{
2019-07-02 04:12:20 +00:00
if ( ! sv . world . worldmodel - > funcs . EdictInFatPVS ( sv . world . worldmodel , & ( ( wedict_t * ) tracecullent ) - > pvsinfo , cameras - > pvs . buffer , cameras - > area ) )
2013-12-23 21:33:40 +00:00
continue ;
2008-11-09 22:29:28 +00:00
}
}
else
{
2019-07-02 04:12:20 +00:00
if ( ! sv . world . worldmodel - > funcs . EdictInFatPVS ( sv . world . worldmodel , & ( ( wedict_t * ) ent ) - > pvsinfo , cameras - > pvs . buffer , cameras - > area ) )
2008-11-09 22:29:28 +00:00
continue ;
2013-12-23 21:33:40 +00:00
tracecullent = ent ;
2008-05-25 22:23:43 +00:00
}
}
2009-11-04 21:16:50 +00:00
else if ( ( pvsflags & PVSF_MODE_MASK ) = = PVSF_USEPHS & & sv . world . worldmodel - > fromgame = = fg_quake )
2008-05-25 22:23:43 +00:00
{
2014-05-23 02:02:51 +00:00
int cluster ;
2008-11-09 22:29:28 +00:00
unsigned char * mask ;
2015-06-14 12:26:01 +00:00
qbyte * phs = sv . world . worldmodel - > phs ;
if ( phs )
2008-11-09 22:29:28 +00:00
{
2014-05-23 02:02:51 +00:00
//FIXME: this lookup should be cachable or something.
if ( client - > edict )
2019-07-02 04:12:20 +00:00
cluster = sv . world . worldmodel - > funcs . ClusterForPoint ( sv . world . worldmodel , client - > edict - > v - > origin , NULL ) ; //ignore areas, can hear through doors.
2014-05-23 02:02:51 +00:00
else
cluster = - 1 ; //mvd
if ( cluster > = 0 )
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
{
2015-06-14 12:26:01 +00:00
mask = phs + cluster * 4 * ( ( sv . world . worldmodel - > numclusters + 31 ) > > 5 ) ;
2014-05-23 02:02:51 +00:00
2019-07-02 04:12:20 +00:00
cluster = sv . world . worldmodel - > funcs . ClusterForPoint ( sv . world . worldmodel , ent - > v - > origin , NULL ) ;
2014-05-23 02:02:51 +00:00
if ( cluster > = 0 & & ! ( mask [ cluster > > 3 ] & ( 1 < < ( cluster & 7 ) ) ) )
{
continue ;
}
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
}
2008-11-09 22:29:28 +00:00
}
2013-12-23 21:33:40 +00:00
tracecullent = NULL ;
2004-10-10 06:32:29 +00:00
}
2013-12-23 21:33:40 +00:00
else
tracecullent = NULL ;
2008-05-25 22:23:43 +00:00
2008-11-09 22:29:28 +00:00
if ( client - > gibfilter & & SV_GibFilter ( ent ) )
2004-10-10 06:32:29 +00:00
continue ;
2019-03-23 07:06:37 +00:00
# ifdef VM_Q1
//mvdsv compat
if ( client - > hideentity & & EDICT_TO_PROG ( svprogfuncs , ent ) = = client - > hideentity )
continue ;
if ( client - > hideplayers & & e < = sv . allocated_client_slots )
continue ;
# endif
2004-10-10 06:32:29 +00:00
}
2013-12-23 21:33:40 +00:00
else
tracecullent = NULL ;
2004-08-23 00:15:46 +00:00
}
2005-05-26 12:55:34 +00:00
2008-11-09 22:29:28 +00:00
//DP_SV_NODRAWONLYTOCLIENT
2007-09-02 19:55:17 +00:00
if ( ent - > xv - > nodrawtoclient ) //DP extension.
2014-05-23 02:02:51 +00:00
if ( client - > edict & & ent - > xv - > nodrawtoclient = = EDICT_TO_PROG ( svprogfuncs , client - > edict ) )
2004-08-23 00:15:46 +00:00
continue ;
2008-11-09 22:29:28 +00:00
//DP_SV_DRAWONLYTOCLIENT
2007-09-02 19:55:17 +00:00
if ( ent - > xv - > drawonlytoclient )
2014-05-23 02:02:51 +00:00
if ( ! client - > edict | | ent - > xv - > drawonlytoclient ! = EDICT_TO_PROG ( svprogfuncs , client - > edict ) )
2004-11-13 17:36:42 +00:00
{
client_t * split ;
for ( split = client - > controlled ; split ; split = split - > controlled )
{
2007-09-02 19:55:17 +00:00
if ( split - > edict - > xv - > view2 = = EDICT_TO_PROG ( svprogfuncs , ent ) )
2004-11-13 17:36:42 +00:00
break ;
}
if ( ! split )
continue ;
}
2004-08-31 23:58:18 +00:00
2004-09-04 17:55:12 +00:00
//QSG_DIMENSION_PLANES
2020-04-19 01:23:32 +00:00
if ( clent ) //don't crash
if ( ! ( ( int ) clent - > xv - > dimension_see & ( ( int ) ent - > xv - > dimension_seen | ( int ) ent - > xv - > dimension_ghost ) ) ) //not able to see it.
if ( c > = maxc ) //always network the player entity though
continue ;
2004-09-04 17:55:12 +00:00
2007-08-30 18:55:44 +00:00
2014-02-07 08:38:40 +00:00
if ( cameras & & tracecullent & & ! ( ( unsigned int ) ent - > v - > effects & ( EF_DIMLIGHT | EF_BLUE | EF_RED | EF_BRIGHTLIGHT | EF_BRIGHTFIELD | EF_NODEPTHTEST ) ) )
2007-08-30 18:55:44 +00:00
{ //more expensive culling
2020-10-26 06:30:35 +00:00
if ( ! ( pvsflags & PVSF_MODE_MASK ) )
if ( ( e < = sv . allocated_client_slots & & sv_cullplayers_trace . value ) | | sv_cullentities_trace . value )
if ( Cull_Traceline ( e < client - > lastseen_count ? & client - > lastseen_time [ e ] : NULL , cameras , tracecullent ) )
continue ;
2007-08-30 18:55:44 +00:00
}
2008-11-09 22:29:28 +00:00
//EXT_CSQC
2005-02-28 07:16:19 +00:00
if ( SV_AddCSQCUpdate ( client , ent ) ) //csqc took it.
2005-02-12 18:56:04 +00:00
continue ;
2005-06-14 04:52:10 +00:00
if ( ISQWCLIENT ( client ) )
2008-11-09 22:29:28 +00:00
{
2005-06-14 04:52:10 +00:00
if ( SV_AddNailUpdate ( ent ) )
continue ; // added to the special update list
2008-11-09 22:29:28 +00:00
}
2004-08-23 00:15:46 +00:00
//the entity would mess up the client and possibly disconnect them.
//FIXME: add an option to drop clients... entity fog could be killed in this way.
2011-10-27 16:16:29 +00:00
if ( e > = client - > max_net_ents )
continue ;
if ( ent - > v - > modelindex > = client - > maxmodels )
continue ;
2004-08-23 00:15:46 +00:00
# ifdef DEPTHOPTIMISE
if ( clent )
{
//find distance based upon absolute mins/maxs so bsps are treated fairly.
2008-11-09 22:29:28 +00:00
//org = clentorg + -0.5*(max+min)
2005-03-28 00:11:59 +00:00
VectorAdd ( ent - > v - > absmin , ent - > v - > absmax , org ) ;
VectorMA ( clent - > v - > origin , - 0.5 , org , org ) ;
2008-11-09 22:29:28 +00:00
dist = DotProduct ( org , org ) ; //Length
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
// if (dist > 1024*1024)
// continue;
2004-08-23 00:15:46 +00:00
// add to the packetentities
if ( pack - > num_entities = = pack - > max_entities )
{
float furthestdist = - 1 ;
int best = - 1 ;
for ( i = 0 ; i < pack - > max_entities ; i + + )
if ( furthestdist < distances [ i ] )
{
furthestdist = distances [ i ] ;
best = i ;
}
if ( furthestdist > dist & & best ! = - 1 )
{
state = & pack - > entities [ best ] ;
// Con_Printf("Dropping ent %s\n", sv.model_precache[state->modelindex]);
memmove ( & distances [ best ] , & distances [ best + 1 ] , sizeof ( * distances ) * ( pack - > num_entities - best - 1 ) ) ;
memmove ( state , state + 1 , sizeof ( * state ) * ( pack - > num_entities - best - 1 ) ) ;
best = pack - > num_entities - 1 ;
distances [ best ] = dist ;
state = & pack - > entities [ best ] ;
}
else
continue ; // all full
}
else
{
state = & pack - > entities [ pack - > num_entities ] ;
distances [ pack - > num_entities ] = dist ;
pack - > num_entities + + ;
}
}
else
# endif
{
// add to the packetentities
if ( pack - > num_entities = = pack - > max_entities )
continue ; // all full
else
{
state = & pack - > entities [ pack - > num_entities ] ;
pack - > num_entities + + ;
}
}
2008-11-09 22:29:28 +00:00
//its not a nail or anything, pack it up and ship it on
2016-07-12 00:40:13 +00:00
SV_Snapshot_BuildStateQ1 ( state , ent , client , pack ) ;
2008-11-09 22:29:28 +00:00
}
}
2005-05-15 18:49:04 +00:00
2020-06-27 19:32:49 +00:00
void SV_AddCameraEntity ( pvscamera_t * cameras , edict_t * ent , pvec3_t viewofs )
2008-11-09 22:29:28 +00:00
{
2014-02-07 08:38:40 +00:00
int i ;
2008-11-09 22:29:28 +00:00
vec3_t org ;
2019-07-02 04:12:20 +00:00
int area ;
2014-02-07 08:38:40 +00:00
for ( i = 0 ; i < cameras - > numents ; i + + )
2012-05-14 01:41:08 +00:00
{
2014-02-07 08:38:40 +00:00
if ( cameras - > ent [ i ] = = ent )
return ; //don't add the same ent multiple times (.view2 or portals that can see themselves through other portals).
2012-05-14 01:41:08 +00:00
}
2014-02-07 08:38:40 +00:00
2019-07-29 05:28:20 +00:00
if ( ent )
{
if ( viewofs )
VectorAdd ( ent - > v - > origin , viewofs , org ) ;
else
VectorCopy ( ent - > v - > origin , org ) ;
}
2014-02-07 08:38:40 +00:00
else
2019-07-29 05:28:20 +00:00
VectorCopy ( viewofs , org ) ;
2014-02-07 08:38:40 +00:00
2019-07-02 04:12:20 +00:00
sv . world . worldmodel - > funcs . ClusterForPoint ( sv . world . worldmodel , org , & area ) ;
for ( i = 1 ; ; i + + )
{
if ( i > cameras - > area [ 0 ] )
{ //reached the end of the known count. add it now.
cameras - > area [ + + cameras - > area [ 0 ] ] = area ;
break ;
}
if ( cameras - > area [ i ] = = area )
break ; //already have a camera in this area, don't make stuff slow with dupes.
}
2017-06-21 01:24:25 +00:00
sv . world . worldmodel - > funcs . FatPVS ( sv . world . worldmodel , org , & cameras - > pvs , cameras - > numents ! = 0 ) ;
2014-02-07 08:38:40 +00:00
if ( cameras - > numents < SV_PVS_CAMERAS )
{
cameras - > ent [ cameras - > numents ] = ent ;
VectorCopy ( org , cameras - > org [ cameras - > numents ] ) ;
cameras - > numents + + ;
}
}
void SV_Snapshot_SetupPVS ( client_t * client , pvscamera_t * camera )
{
2019-07-02 04:12:20 +00:00
camera - > area [ 0 ] = 0 ;
2014-02-07 08:38:40 +00:00
camera - > numents = 0 ;
2008-11-09 22:29:28 +00:00
for ( ; client ; client = client - > controlled )
{
2014-02-07 08:38:40 +00:00
if ( client - > viewent ) //svc_viewentity hack
2018-04-06 17:21:15 +00:00
SV_AddCameraEntity ( camera , EDICT_NUM_UB ( svprogfuncs , client - > viewent ) , client - > edict - > v - > view_ofs ) ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
else
2014-02-07 08:38:40 +00:00
SV_AddCameraEntity ( camera , client - > edict , client - > edict - > v - > view_ofs ) ;
2008-11-09 22:29:28 +00:00
2014-02-07 08:38:40 +00:00
//spectators should always see their targetted player
if ( client - > spec_track )
2018-04-06 17:21:15 +00:00
SV_AddCameraEntity ( camera , EDICT_NUM_UB ( svprogfuncs , client - > spec_track ) , client - > edict - > v - > view_ofs ) ;
2008-11-09 22:29:28 +00:00
2014-02-07 08:38:40 +00:00
//view2 support should always see the extra entity
if ( client - > edict - > xv - > view2 )
SV_AddCameraEntity ( camera , PROG_TO_EDICT ( svprogfuncs , client - > edict - > xv - > view2 ) , NULL ) ;
}
2019-07-29 05:28:20 +00:00
//hack for skyrooms, open up the pvs.
if ( sv . skyroom_pos_known )
SV_AddCameraEntity ( camera , NULL , sv . skyroom_pos ) ;
2008-11-09 22:29:28 +00:00
}
void SV_Snapshot_Clear ( packet_entities_t * pack )
{
pack - > num_entities = 0 ;
csqcnuments = 0 ;
numnails = 0 ;
}
2010-01-21 03:28:52 +00:00
2017-05-18 10:24:09 +00:00
# ifdef QWOVERQ3
2008-11-09 22:29:28 +00:00
/*
= = = = = = = = = = = = =
SVQ3Q1_BuildEntityPacket
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
Builds a temporary q1 style entity packet for a q3 client
= = = = = = = = = = = = =
*/
void SVQ3Q1_BuildEntityPacket ( client_t * client , packet_entities_t * pack )
{
2014-02-07 08:38:40 +00:00
pvscamera_t cameras ;
2008-11-09 22:29:28 +00:00
SV_Snapshot_Clear ( pack ) ;
2014-02-07 08:38:40 +00:00
SV_Snapshot_SetupPVS ( client , & cameras ) ;
SV_Snapshot_BuildQ1 ( client , pack , & cameras , client - > edict ) ;
2008-11-09 22:29:28 +00:00
}
2017-05-18 10:24:09 +00:00
# endif
2006-06-19 21:56:42 +00:00
2008-11-09 22:29:28 +00:00
/*
= = = = = = = = = = = = =
SV_WriteEntitiesToClient
2007-06-20 00:02:54 +00:00
2008-11-09 22:29:28 +00:00
Encodes the current state of the world as
a svc_packetentities messages and possibly
a svc_nails message and
svc_playerinfo messages
= = = = = = = = = = = = =
*/
void SV_WriteEntitiesToClient ( client_t * client , sizebuf_t * msg , qboolean ignorepvs )
{
2018-12-28 00:04:36 +00:00
int i ;
2008-11-09 22:29:28 +00:00
packet_entities_t * pack ;
edict_t * clent ;
client_frame_t * frame ;
2017-06-21 01:24:25 +00:00
pvscamera_t camerasbuf ;
pvscamera_t * cameras = & camerasbuf ;
cameras - > pvs . buffer = alloca ( cameras - > pvs . buffersize = sv . world . worldmodel - > pvsbytes ) ;
2005-05-15 18:49:04 +00:00
2008-11-09 22:29:28 +00:00
// this is the frame we are creating
frame = & client - > frameunion . frames [ client - > netchan . incoming_sequence & UPDATE_MASK ] ;
2018-12-28 00:04:36 +00:00
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
frame - > laggedplayer [ i ] . present = 0 ;
2005-07-01 19:23:00 +00:00
2008-11-09 22:29:28 +00:00
// find the client's PVS
if ( ignorepvs )
2014-02-07 08:38:40 +00:00
{ //mvd...
2008-11-09 22:29:28 +00:00
clent = NULL ;
2014-02-07 08:38:40 +00:00
cameras = NULL ;
2008-11-09 22:29:28 +00:00
}
else
{
clent = client - > edict ;
2014-01-13 02:42:25 +00:00
if ( sv_nopvs . ival )
2014-02-07 08:38:40 +00:00
cameras = NULL ;
2009-03-03 01:52:30 +00:00
# ifdef HLSERVER
2014-01-13 02:42:25 +00:00
else if ( svs . gametype = = GT_HALFLIFE )
2015-10-11 11:34:58 +00:00
SVHL_Snapshot_SetupPVS ( client , cameras - > pvs , sizeof ( cameras - > pvs ) ) ;
2009-03-03 01:52:30 +00:00
# endif
2014-01-13 02:42:25 +00:00
else
2014-02-07 08:38:40 +00:00
SV_Snapshot_SetupPVS ( client , cameras ) ;
2008-11-09 22:29:28 +00:00
}
2005-07-01 19:23:00 +00:00
2008-11-09 22:29:28 +00:00
host_client = client ;
2017-05-28 15:42:32 +00:00
if ( ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) | | ! frame - > qwentities . entities | | ISNQCLIENT ( client ) )
2012-02-12 05:18:31 +00:00
{
pack = & svs . entstatebuffer ;
if ( pack - > max_entities < client - > max_net_ents )
{
pack - > max_entities = client - > max_net_ents ;
pack - > entities = BZ_Realloc ( pack - > entities , sizeof ( * pack - > entities ) * pack - > max_entities ) ;
memset ( pack - > entities , 0 , sizeof ( entity_state_t ) * pack - > max_entities ) ;
}
}
else
2017-05-28 15:42:32 +00:00
pack = & frame - > qwentities ;
2008-11-09 22:29:28 +00:00
SV_Snapshot_Clear ( pack ) ;
2005-05-17 02:36:54 +00:00
2014-03-30 08:55:06 +00:00
if ( ! pack - > entities )
return ;
2008-11-09 22:29:28 +00:00
// put other visible entities into either a packet_entities or a nails message
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2008-11-09 22:29:28 +00:00
if ( sv . demostatevalid ) //generate info from demo stats
{
SV_Snapshot_Build_Playback ( client , pack ) ;
}
else
2009-11-07 13:29:15 +00:00
# endif
2008-11-09 22:29:28 +00:00
{
2009-03-03 01:52:30 +00:00
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
2015-10-11 11:34:58 +00:00
SVHL_Snapshot_Build ( client , pack , cameras - > pvs , clent , ignorepvs ) ;
2009-03-03 01:52:30 +00:00
else
# endif
2014-02-07 08:38:40 +00:00
SV_Snapshot_BuildQ1 ( client , pack , cameras , clent ) ;
2004-08-23 00:15:46 +00:00
}
2008-11-09 22:29:28 +00:00
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2005-07-01 19:23:00 +00:00
if ( ISNQCLIENT ( client ) )
2005-06-14 04:52:10 +00:00
{
2013-03-12 22:35:33 +00:00
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
2005-07-01 19:23:00 +00:00
{
2016-10-22 07:06:51 +00:00
qboolean overflow ;
for ( ; ; )
{
overflow = SVFTE_EmitPacketEntities ( client , pack , msg ) ;
client - > netchan . incoming_sequence + + ;
if ( overflow & & pack = = & svs . entstatebuffer )
{
if ( ! Netchan_CanPacket ( & client - > netchan , SV_RateForClient ( client ) / 2 ) )
break ;
Netchan_Transmit ( & client - > netchan , msg - > cursize , msg - > data , SV_RateForClient ( client ) ) ;
SZ_Clear ( msg ) ;
if ( ! Netchan_CanPacket ( & client - > netchan , SV_RateForClient ( client ) / 2 ) )
break ;
}
else
break ;
}
2005-07-01 19:23:00 +00:00
}
2013-03-12 22:35:33 +00:00
else if ( client - > protocol = = SCP_DARKPLACES6 | | client - > protocol = = SCP_DARKPLACES7 )
2017-05-28 15:42:32 +00:00
SVDP_EmitEntitiesUpdate ( client , frame , pack , msg ) ;
2005-07-01 19:23:00 +00:00
else
{
2018-12-28 00:04:36 +00:00
int e ;
2008-11-09 22:29:28 +00:00
for ( e = 0 ; e < pack - > num_entities ; e + + )
{
2016-07-12 00:40:13 +00:00
if ( pack - > entities [ e ] . number > sv . allocated_client_slots )
break ;
2008-11-09 22:29:28 +00:00
if ( msg - > cursize + 32 > msg - > maxsize )
break ;
SVNQ_EmitEntityState ( msg , & pack - > entities [ e ] ) ;
}
2016-07-12 00:40:13 +00:00
for ( ; e < pack - > num_entities ; e + + )
{
if ( msg - > cursize + 32 + client - > datagram . cursize > msg - > maxsize )
break ;
SVNQ_EmitEntityState ( msg , & pack - > entities [ e ] ) ;
}
2005-07-01 19:23:00 +00:00
client - > netchan . incoming_sequence + + ;
}
2013-03-12 22:35:33 +00:00
SV_EmitCSQCUpdate ( client , msg , svcdp_csqcentities ) ;
2012-02-12 05:18:31 +00:00
}
else
2017-03-04 19:36:06 +00:00
# endif
2012-02-12 05:18:31 +00:00
{
2017-03-04 19:36:06 +00:00
// encode the packet entities as a delta from the
// last packetentities acknowledged by the client
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
2012-02-12 05:18:31 +00:00
{
2017-03-04 19:36:06 +00:00
SVFTE_EmitPacketEntities ( client , pack , msg ) ;
}
else
{
# ifdef QUAKESTATS
// Z_EXT_TIME protocol extension
// every now and then, send an update so that extrapolation
// on client side doesn't stray too far off
if ( ISQWCLIENT ( client ) )
{
2019-03-01 22:39:30 +00:00
if ( ( client - > fteprotocolextensions & PEXT_ACCURATETIMINGS ) & & sv . world . physicstime - client - > nextservertimeupdate > 0 )
2017-03-04 19:36:06 +00:00
{ //the fte pext causes the server to send out accurate timings, allowing for perfect interpolation.
MSG_WriteByte ( msg , svcqw_updatestatlong ) ;
MSG_WriteByte ( msg , STAT_TIME ) ;
MSG_WriteLong ( msg , ( int ) ( sv . world . physicstime * 1000 ) ) ;
2012-02-12 05:18:31 +00:00
2017-03-04 19:36:06 +00:00
client - > nextservertimeupdate = sv . world . physicstime ;
}
2019-03-01 22:39:30 +00:00
else if ( ( client - > zquake_extensions & Z_EXT_SERVERTIME ) & & sv . world . physicstime - client - > nextservertimeupdate > 0 )
2017-03-04 19:36:06 +00:00
{ //the zquake ext causes the server to send out peridoic timings, allowing for moderatly accurate game time.
MSG_WriteByte ( msg , svcqw_updatestatlong ) ;
MSG_WriteByte ( msg , STAT_TIME ) ;
MSG_WriteLong ( msg , ( int ) ( sv . world . physicstime * 1000 ) ) ;
2012-02-12 05:18:31 +00:00
2017-03-04 19:36:06 +00:00
client - > nextservertimeupdate = sv . world . physicstime + 10 ;
}
2012-02-12 05:18:31 +00:00
}
2015-09-01 04:45:15 +00:00
# endif
2012-02-12 05:18:31 +00:00
2017-03-04 19:36:06 +00:00
// send over the players in the PVS
if ( svs . gametype ! = GT_HALFLIFE )
{
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2017-03-04 19:36:06 +00:00
if ( client = = & demo . recorder )
SV_WritePlayersToMVD ( client , frame , msg ) ;
else
2018-09-01 04:18:08 +00:00
# endif
2017-03-04 19:36:06 +00:00
SV_WritePlayersToClient ( client , frame , clent , cameras , msg ) ;
}
2012-02-12 05:18:31 +00:00
2017-03-04 19:36:06 +00:00
SVQW_EmitPacketEntities ( client , pack , msg ) ;
}
2004-08-23 00:15:46 +00:00
2017-03-04 19:36:06 +00:00
SV_EmitCSQCUpdate ( client , msg , svcfte_csqcentities ) ;
2005-02-28 07:16:19 +00:00
2017-03-04 19:36:06 +00:00
// now add the specialized nail update
SV_EmitNailUpdate ( msg , ignorepvs ) ;
}
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
//just goes and makes sure each client tracks all the right SendFlags.
void SV_ProcessSendFlags ( client_t * c )
{
edict_t * ent ;
unsigned int e , h = 0 ;
if ( ! c - > csqcactive | | ! c - > pendingcsqcbits )
return ;
for ( e = 1 ; e < sv . world . num_edicts & & e < c - > max_net_ents ; e + + )
{
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , e ) ;
2016-07-21 19:27:59 +00:00
if ( ED_ISFREE ( ent ) )
2016-07-12 00:40:13 +00:00
continue ;
if ( ent - > xv - > SendFlags )
{
2021-10-05 05:04:59 +00:00
c - > pendingcsqcbits [ e ] | = ( qint64_t ) ent - > xv - > SendFlags < < SENDFLAGS_SHIFT ;
2016-07-12 00:40:13 +00:00
h = e ;
}
}
needcleanup = max ( needcleanup , h ) ;
}
2004-08-23 00:15:46 +00:00
void SV_CleanupEnts ( void )
{
int e ;
edict_t * ent ;
if ( ! needcleanup )
return ;
for ( e = 1 ; e < = needcleanup ; e + + )
{
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , e ) ;
2016-07-12 00:40:13 +00:00
ent - > xv - > SendFlags = 0 ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2016-07-12 00:40:13 +00:00
//this is legacy code. we'll just have to live with the slight delay.
//FIXME: check if Version exists and do it earlier.
if ( ( int ) ent - > xv - > Version ! = sv . csqcentversion [ ent - > entnum ] )
{
2021-08-04 21:16:57 +00:00
ent - > xv - > SendFlags = - 1 ;
2016-07-12 00:40:13 +00:00
sv . csqcentversion [ ent - > entnum ] = ( int ) ent - > xv - > Version ;
}
# endif
2004-08-23 00:15:46 +00:00
}
needcleanup = 0 ;
}
2004-11-29 01:21:00 +00:00
# endif
2010-02-06 01:25:04 +00:00