13 Dec 2016

This commit is contained in:
g-cont 2016-12-13 00:00:00 +03:00 committed by Alibek Omarov
parent 3179cba8ef
commit 6a56cd9b7e
24 changed files with 315 additions and 221 deletions

View File

@ -1,3 +1,59 @@
build 3597
Engine: implemenantion of generic extension of BSP file format. Some extra lumps used by mods to get a new features like terrains, improved lighting etc
Engine: rewrite PVS system for variable PVS radius that can be used as FAT pvs or FAT phs without recalculating vis-array
Engine: starting to implement a new global feature that called HOST_FIXED_FRAMERATE to get client and server with constant fps (xash-based mods only)
Render: some unsed funcs from RenderAPI was replaced with usefully funcs. Backward compatibility stay keep on
Render: added few function in RenderAPI for SDLash3D by Albatross request
Render: get support for loading multi-layered textures (for potential landscape implemenantion)
Client: added two funcs into engine interface for custom interpolation on the client
Server: allow to write map lums on a server to store userdata (physic collision, ai nodegraph as example). Works with extended BSP format only
Server: physic interface was updated and expanded to get more control over player and entities simulation
Client: demo protocol was changed to 2 ( allow comment in demo header)
Client: demo playing is now using interpolation of client view angles
Client: fixup some issues on demo playback
Client: fix broken parametric entities (rockets in TFC as example) in multiplayer
Client: net graph implementation like in GoldSrc
Client: fixup ugly "un-duck" effect while after changing level (see for example transition from c0a0b to c0a0c)
Client: clean-up and rewrite predicting code to get more compatibility for original prediction
Client: handle colon separately for client version of COM_ParseFile (like in goldsrc)
Client: finalize NETAPI. Now it can handle servers list from a master server (and display on a built-in client browser of course)
GameUI: fixup color-strings that sended across network as server names or player names
Client: texturebrower and overview mode now is not affected to player moving in world
Client: accumulate pmove entities right after handling delta's not after world rendering
Client: change master server address and request to actual
Client: exclude dead bodies from solid objects in pmove processing
Engine: fixup wad parsing from "wad" string in worldspawn settings (broken in previous version)
Client: new style of displaying FPS counter
Network: remove compression routine (very low efficiency)
Client: fix muzzleflashes decoding from an studio animation event
Engine: fix crash\hanging while trying to play AVI-file when codec is not-installed
Client: change color handle for viewbeams (remove color normalization)
Render: rewrite waves on water surfaces, uses table sin, increase speed and look close GoldSrc
Render: completely rewrite texture loader, remove obsolete code, added support for multi-layered textures and float textures, fix errors
Render: now "gl_texturemode" is obsolete and removed. Use "gl_texture_nearest" cvar instead
Render: improved doble-cloud layering sky for Quake. reduce parallax distorsion
Render: completely rewrite OpenGL loader. Remove obsolete extensions, fixup some errors
Render: moved lightstyle animation from render frame loop to client frame loop (to prevent execute lightstyle animation on multipass viewing)
Client: fixup studio culling on models with non-default scaling (large models in SoHL)
Sound: change DSP code to get DSP effects like in original GoldSrc
Sound: rewite sound PHS code. Now it can be useful
Sound: first implenantion of raw-channels manager (in future this will be used for a custom video playing in xash-based mods and voice stream)
Sound: sentence sounds now can be freed after playing (and saves some memory)
Client: get VGUI backend to implement of lastest version of vgui.dll
Engine: sort commands and cvars in alpha-bethical order. Include scripting functions from SDLash3D
Console: now map list show an extension or type of various map and mapstats check level for transparent water support
Console: replace the console buffer with effectively circular buffer (up to 1mb messages)
FS: do complete revision of filesystem code, remove WAD2 support
ImageLib: fix crash in quantizer while image is completely black
Server: ignore sounds from pmove code when prediction is enabled
Server: change userinfo handling, fixup info send to all the clients
Server: fixup player animtion timings
Server: enable cl_msglevel to filter up unneeded messages
Server: restart server right if circular buffer pointer was exceeded 32-bit limit value
Server: fixup player think timings
build 3366
Render: get support for custom DXT encoding (custom renderers only)

View File

@ -51,7 +51,6 @@
#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc.
#define FL_CUSTOMVIEW (1<<27) // Entity has a custom viewing from specified point (trigger_camera, portal, monitor etc)
#define FL_CUSTOMENTITY (1<<29) // This is a custom entity
#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client

View File

@ -65,7 +65,7 @@ typedef struct cldll_func_s
int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback );
void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void (*pfnUpdateEntityState)( cl_entity_t *ent, entity_state_t *newstate, int noInterp ); // custom interp
void (*pfnInterpolateEntity)( cl_entity_t *ent );
void (*pfnInterpolateEntity)( cl_entity_t *ent, float lerpFrac );
} cldll_func_t;
#endif//CDLL_EXP_H

View File

@ -400,7 +400,9 @@ void CL_ParseEvent( sizebuf_t *msg )
if( VectorIsNull( args.velocity ))
VectorCopy( state->velocity, args.velocity );
}
}
COM_NormalizeAngles( args.angles );
}
else if( state )
{
if( VectorIsNull( args.origin ))

View File

@ -139,6 +139,9 @@ int CL_InterpolateModel( cl_entity_t *e )
if( cl.predicted.moving && cl.predicted.onground == e->index )
return 1;
if( e->curstate.starttime != 0.0f && e->curstate.impacttime != 0.0f )
return 1; // don't interpolate parametric entities
t = cl.time - cl_interp->value;
CL_FindInterpolationUpdates( e, t, &ph0, &ph1, NULL );
@ -1159,7 +1162,7 @@ void CL_AddPacketEntities( frame_t *frame )
continue;
if( clgame.dllFuncs.pfnInterpolateEntity != NULL )
clgame.dllFuncs.pfnInterpolateEntity( ent );
clgame.dllFuncs.pfnInterpolateEntity( ent, cl.lerpFrac );
else CL_UpdateEntityFields( ent );
if( ent->player ) entityType = ET_PLAYER;

View File

@ -66,9 +66,9 @@ NetGraph_DrawLine
CL_FillRGBA shortcut
==========
*/
static void NetGraph_DrawRect( wrect_t *rect, byte colors[3], byte alpha )
static void NetGraph_DrawRect( wrect_t *rect, byte colors[4] )
{
CL_FillRGBA( rect->left, rect->top, rect->right, rect->bottom, colors[0], colors[1], colors[2], alpha );
CL_FillRGBA( rect->left, rect->top, rect->right, rect->bottom, colors[0], colors[1], colors[2], colors[3] );
}
/*
@ -106,11 +106,12 @@ NetGraph_GetFrameData
get frame data info, like chokes, packet losses, also update graph, packet and cmdinfo
==========
*/
void NetGraph_GetFrameData( int *choke_count, int *loss_count, int *biggest_message, float *latency, int *latency_count )
void NetGraph_GetFrameData( int *biggest_message, float *latency, int *latency_count )
{
int i;
int i, choke_count = 0, loss_count = 0;
float loss, choke;
*choke_count = *loss_count = *biggest_message = *latency_count = 0;
*biggest_message = *latency_count = 0;
*latency = 0.0f;
for( i = cls.netchan.incoming_sequence - CL_UPDATE_BACKUP + 1; i <= cls.netchan.incoming_sequence; i++ )
@ -121,21 +122,26 @@ void NetGraph_GetFrameData( int *choke_count, int *loss_count, int *biggest_mess
p->choked = f->receivedtime == -2.0f ? true : false;
if( p->choked )
(*choke_count)++;
choke_count++;
if( !f->valid || f->receivedtime == -2.0f )
if( !f->valid || f->receivedtime == -2.0 )
{
p->latency = 9998; // broken delta
else if( f->receivedtime == -1 )
}
else if( f->receivedtime == -1.0 )
{
p->latency = 9999; // dropped
loss_count++;
}
else
{
int frame_latency = min( 1.0f, f->latency );
int frame_latency = Q_min( 1.0f, f->latency );
p->latency = (( frame_latency + 0.1 ) / 1.1 ) * ( net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2 );
if( i > cls.netchan.incoming_sequence - NUM_LATENCY_SAMPLES )
{
*latency += 1000.0f * f->latency;
(*latency_count)++;
latency_count++;
}
}
@ -151,6 +157,14 @@ void NetGraph_GetFrameData( int *choke_count, int *loss_count, int *biggest_mess
netstat_cmdinfo[i & NET_TIMINGS_MASK].sent = cl.commands[i & CL_UPDATE_MASK].heldback ? false : true;
netstat_cmdinfo[i & NET_TIMINGS_MASK].size = cl.commands[i & CL_UPDATE_MASK].sendsize;
}
// packet loss
loss = 100.0 * (float)loss_count / CL_UPDATE_BACKUP;
packet_loss = PACKETLOSS_AVG_FRAC * packet_loss + ( 1.0 - PACKETLOSS_AVG_FRAC ) * loss;
// packet choke
choke = 100.0 * (float)choke_count / CL_UPDATE_BACKUP;
packet_choke = PACKETCHOKE_AVG_FRAC * packet_choke + ( 1.0 - PACKETCHOKE_AVG_FRAC ) * choke;
}
/*
@ -159,10 +173,10 @@ NetGraph_DrawTimes
===========
*/
void NetGraph_DrawTimes( wrect_t rect, struct cmdinfo_t *cmdinfo, int x, int w )
void NetGraph_DrawTimes( wrect_t rect, int x, int w )
{
int i, j, extrap_point = NETGRAPH_LERP_HEIGHT / 3, a, h;
POINT pt = { max( x + w - 1 - 25, 1 ), max( rect.top + rect.bottom - 4 - NETGRAPH_LERP_HEIGHT + 1, 1 ) };
POINT pt = { Q_max( x + w - 1 - 25, 1 ), Q_max( rect.top + rect.bottom - 4 - NETGRAPH_LERP_HEIGHT + 1, 1 ) };
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
wrect_t fill;
@ -171,7 +185,7 @@ void NetGraph_DrawTimes( wrect_t rect, struct cmdinfo_t *cmdinfo, int x, int w )
for( a = 0; a < w; a++ )
{
i = ( cls.netchan.outgoing_sequence - a ) & NET_TIMINGS_MASK;
h = ( cmdinfo[i].cmd_lerp / 3.0f ) * NETGRAPH_LERP_HEIGHT;
h = ( netstat_cmdinfo[i].cmd_lerp / 3.0f ) * NETGRAPH_LERP_HEIGHT;
fill.left = x + w - a - 1;
fill.right = fill.bottom = 1;
@ -186,7 +200,8 @@ void NetGraph_DrawTimes( wrect_t rect, struct cmdinfo_t *cmdinfo, int x, int w )
for( j = start; j < h; j++ )
{
NetGraph_DrawRect( &fill, netcolors[j + extrap_point], 255 );
memcpy( colors, netcolors[j + extrap_point], sizeof( byte ) * 3 );
NetGraph_DrawRect( &fill, colors );
fill.top--;
}
}
@ -199,7 +214,8 @@ void NetGraph_DrawTimes( wrect_t rect, struct cmdinfo_t *cmdinfo, int x, int w )
for( j = 0; j < h; j++ )
{
NetGraph_DrawRect( &fill, netcolors[j + oldh], 255 );
memcpy( colors, netcolors[j + oldh], sizeof( byte ) * 3 );
NetGraph_DrawRect( &fill, colors );
fill.top--;
}
}
@ -210,7 +226,7 @@ void NetGraph_DrawTimes( wrect_t rect, struct cmdinfo_t *cmdinfo, int x, int w )
fill.top = rect.top + rect.bottom - 3;
if( !cmdinfo[i].sent )
if( !netstat_cmdinfo[i].sent )
CL_FillRGBA( fill.left, fill.top, fill.right, fill.bottom, 255, 0, 0, 255 );
}
}
@ -239,25 +255,22 @@ NetGraph_DrawTextFields
===========
*/
void NetGraph_DrawTextFields( int x, int y, int count, float avg, float *framerate, int packet_loss, int packet_choke )
void NetGraph_DrawTextFields( int x, int y, int count, float avg, int packet_loss, int packet_choke )
{
static int lastout;
float latency;
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
static int lastout;
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
int i = ( cls.netchan.outgoing_sequence - 1 ) & NET_TIMINGS_MASK;
float latency = count > 0 ? Q_max( 0, avg / count - 0.5 * host.frametime - 1000.0 / cl_updaterate->value ) : 0;
float framerate = 1.0 / host.realframetime;
latency = count > 0 ? max( 0, avg / count - 0.5 * host.frametime - 1000.0 / cl_updaterate->value ) : 0;
*framerate = 0.5 * host.realframetime + 0.5 * *framerate;
Con_DrawString( x, y - net_graphheight->integer, va( "%.1ffps" , 0.5 / *framerate ), colors );
Con_DrawString( x, y - net_graphheight->integer, va( "%.1ffps" , framerate ), colors );
Con_DrawString( x + 75, y - net_graphheight->integer, va( "%i ms" , (int)latency ), colors );
Con_DrawString( x + 150, y - net_graphheight->integer, va( "%i/s" , cl_updaterate->integer ), colors );
if( netstat_cmdinfo[( cls.netchan.outgoing_sequence - 1 ) & NET_TIMINGS_MASK].size )
lastout = netstat_cmdinfo[( cls.netchan.outgoing_sequence - 1 ) & NET_TIMINGS_MASK].size;
if( netstat_cmdinfo[i].size )
lastout = netstat_cmdinfo[i].size;
Con_DrawString( x, y - net_graphheight->integer + 15, va( "in : %i %.2f k/s", netstat_graph[cls.netchan.incoming_sequence & NET_TIMINGS_MASK].msgbytes, cls.netchan.flow[FLOW_INCOMING].avgkbytespersec ), colors );
Con_DrawString( x, y - net_graphheight->integer + 15, va( "in : %i %.2f k/s", netstat_graph[i].msgbytes, cls.netchan.flow[FLOW_INCOMING].avgkbytespersec ), colors );
Con_DrawString( x, y - net_graphheight->integer + 30, va( "out: %i %.2f k/s", lastout, cls.netchan.flow[FLOW_OUTGOING].avgkbytespersec ), colors );
@ -272,19 +285,20 @@ NetGraph_DrawDataSegment
===========
*/
int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte alpha )
int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte a )
{
int h = bytes / net_scale->value;
byte colors[3] = { r, g, b };
byte colors[4] = { r, g, b, a };
fill->top -= h;
if( net_graphfillsegments->integer )
fill->bottom = h;
else
fill->bottom = 1;
else fill->bottom = 1;
if( fill->top > 1 )
{
NetGraph_DrawRect( fill, colors, alpha );
NetGraph_DrawRect( fill, colors );
return 1;
}
return 0;
@ -297,36 +311,31 @@ NetGraph_ColorForHeight
color based on packet latency
===========
*/
void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[3], byte *alpha, int *ping )
void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[4], int *ping )
{
switch( packet->latency )
{
case 9999:
memcpy( color, netcolors[0], sizeof( byte ) * 3 ); // dropped
memcpy( color, netcolors[0], sizeof( byte ) * 4 ); // dropped
*ping = 0;
*alpha = netcolors[0][3];
break;
case 9998:
memcpy( color, netcolors[1], sizeof( byte ) * 3 ); // invalid
*alpha = netcolors[1][3];
memcpy( color, netcolors[1], sizeof( byte ) * 4 ); // invalid
*ping = 0;
break;
case 9997:
memcpy( color, netcolors[2], sizeof( byte ) * 3 ); // skipped
*alpha = netcolors[2][3];
memcpy( color, netcolors[2], sizeof( byte ) * 4 ); // skipped
*ping = 0;
break;
default:
*ping = 1;
if( packet->choked )
{
memcpy( color, netcolors[3], sizeof( byte ) * 3 );
*alpha = netcolors[3][3];
memcpy( color, netcolors[3], sizeof( byte ) * 4 );
}
else
{
memcpy( color, netcolors[4], sizeof( byte ) * 3 );
*alpha = netcolors[4][3];
memcpy( color, netcolors[4], sizeof( byte ) * 4 );
}
}
}
@ -340,15 +349,15 @@ NetGraph_DrawDataUsage
void NetGraph_DrawDataUsage( int x, int y, int w, int maxmsgbytes )
{
int a, i, h, lastvalidh = 0, ping;
byte color[3], alpha;
wrect_t fill = { 0 };
byte color[4];
for( a = 0; a < w; a++ )
{
i = (cls.netchan.incoming_sequence - a) & NET_TIMINGS_MASK;
h = netstat_packet_latency[i].latency;
NetGraph_ColorForHeight( &netstat_packet_latency[i], color, &alpha, &ping );
NetGraph_ColorForHeight( &netstat_packet_latency[i], color, &ping );
if( !ping ) h = lastvalidh;
else lastvalidh = h;
@ -361,23 +370,23 @@ void NetGraph_DrawDataUsage( int x, int y, int w, int maxmsgbytes )
fill.right = 1;
fill.bottom = ping ? 1: h;
NetGraph_DrawRect( &fill, color, alpha );
NetGraph_DrawRect( &fill, color );
fill.top = y;
fill.bottom = 1;
color[0] = 0; color[1] = 255; color[2] = 0;
color[0] = 0; color[1] = 255; color[2] = 0; color[3] = 160;
NetGraph_DrawRect( &fill, color, 160 );
NetGraph_DrawRect( &fill, color );
if( net_graph->integer < 2 )
continue;
fill.top = y - net_graphheight->value - 1;
fill.bottom = 1;
color[0] = color[1] = color[2] = 255;
color[0] = color[1] = color[2] = color[3] = 255;
NetGraph_DrawRect( &fill, color, 255 );
NetGraph_DrawRect( &fill, color );
fill.top -= 1;
@ -405,26 +414,56 @@ void NetGraph_DrawDataUsage( int x, int y, int w, int maxmsgbytes )
if( !NetGraph_DrawDataSegment( &fill, netstat_graph[i].usr, 200, 200, 200, 128 ))
continue;
// special case for maximum usage
// special case for absolute usage
h = netstat_graph[i].msgbytes / net_scale->value;
color[0] = color[1] = color[2] = 240;
if( net_graphfillsegments->integer )
fill.bottom = h;
else fill.bottom = 1;
color[0] = color[1] = color[2] = 240; color[3] = 255;
fill.bottom = 1;
fill.top = y - net_graphheight->value - 1 - h;
if( fill.top < 2 ) continue;
NetGraph_DrawRect( &fill, color, 255 );
NetGraph_DrawRect( &fill, color );
}
if( net_graph->integer >= 2 )
NetGraph_DrawHatches( x, y - net_graphheight->value - 1, maxmsgbytes );
}
/*
===========
NetGraph_GetScreenPos
===========
*/
void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
{
rect->left = rect->top = 0;
rect->right = clgame.scrInfo.iWidth;
rect->bottom = clgame.scrInfo.iHeight;
*w = Q_min( NET_TIMINGS, net_graphwidth->integer );
if( rect->right < *w + 10 )
*w = rect->right - 10;
// detect x and y position
switch( net_graphpos->integer )
{
case 1: // right sided
*x = rect->left + rect->right - 5 - *w;
break;
case 2: // center
*x = rect->left + ( rect->right - 10 - *w ) / 2;
break;
default: // left sided
*x = rect->left + 5;
break;
}
*y = rect->bottom + rect->top - NETGRAPH_LERP_HEIGHT - 5;
}
/*
===========
SCR_DrawNetGraph
@ -433,11 +472,11 @@ SCR_DrawNetGraph
*/
void SCR_DrawNetGraph( void )
{
wrect_t rect = { 0, clgame.scrInfo.iWidth, 0, clgame.scrInfo.iHeight };
float loss = 0, choke = 0, avg_ping = 0;
int loss_count = 0, choke_count = 0, ping_count = 0, maxmsgbytes = 0;
int w = min( NET_TIMINGS, net_graphwidth->integer ), x, y;
float framerate = 0;
wrect_t rect;
float avg_ping;
int ping_count;
int maxmsgbytes;
int w, x, y;
if( !net_graph->integer )
return;
@ -445,41 +484,17 @@ void SCR_DrawNetGraph( void )
if( net_scale->value <= 0 )
Cvar_SetFloat( "net_scale", 0.1f );
if( rect.right < w + 10 )
w = rect.right - 10;
NetGraph_GetScreenPos( &rect, &w, &x, &y );
NetGraph_GetFrameData( &choke_count, &loss_count, &maxmsgbytes, &avg_ping, &ping_count );
// packet loss
loss = 100.0 * (float)loss_count / CL_UPDATE_BACKUP;
packet_loss = PACKETLOSS_AVG_FRAC * packet_loss + ( 1.0 - PACKETLOSS_AVG_FRAC ) * loss;
// packet choke
choke = 100.0 * (float)choke_count / CL_UPDATE_BACKUP;
packet_choke = PACKETCHOKE_AVG_FRAC * packet_choke + ( 1.0 - PACKETCHOKE_AVG_FRAC ) * choke;
// detect x and y position
switch( net_graphpos->integer )
{
case 1: // right sided
x = rect.left + rect.right - 5 - w;
break;
case 2: // center
x = rect.left + ( rect.right - 10 - w ) / 2;
break;
default: // left sided
x = rect.left + 5;
break;
}
y = rect.bottom + rect.top - NETGRAPH_LERP_HEIGHT - 5;
NetGraph_GetFrameData( &maxmsgbytes, &avg_ping, &ping_count );
if( net_graph->integer < 3 )
{
NetGraph_DrawTimes( rect, netstat_cmdinfo, x, w );
NetGraph_DrawTimes( rect, x, w );
NetGraph_DrawDataUsage( x, y, w, maxmsgbytes );
}
NetGraph_DrawTextFields( x, y, ping_count, avg_ping, &framerate, packet_loss, packet_choke );
NetGraph_DrawTextFields( x, y, ping_count, avg_ping, packet_loss, packet_choke );
}
void CL_InitNetgraph( void )

View File

@ -1583,12 +1583,14 @@ void CL_ParseServerMessage( sizebuf_t *msg )
break;
case svc_restoresound:
CL_ParseRestoreSoundPacket( msg );
cl.frames[cl.parsecountmod].graphdata.sound += MSG_GetNumBytesRead( msg ) - bufStart;
break;
case svc_spawnstatic:
CL_ParseStaticEntity( msg );
break;
case svc_ambientsound:
CL_ParseSoundPacket( msg, true );
cl.frames[cl.parsecountmod].graphdata.sound += MSG_GetNumBytesRead( msg ) - bufStart;
break;
case svc_crosshairangle:
CL_ParseCrosshairAngle( msg );

View File

@ -29,6 +29,8 @@ GNU General Public License for more details.
#define STEREODLY 3
#define MAX_STEREO_DELAY 0.1f
#define REVERB_XFADE 32
#define MAXDLY (STEREODLY + 1)
#define MAXLP 10
#define MAXPRESETS ARRAYSIZE( rgsxpre )
@ -116,6 +118,7 @@ const sx_preset_t rgsxpre[] =
convar_t *dsp_off; // disable dsp
convar_t *roomwater_type; // water room_type
convar_t *room_type; // current room type
convar_t *hisound; // DSP quality
// underwater/special fx modulations
convar_t *sxmod_mod;
@ -135,15 +138,16 @@ convar_t *sxdly_feedback; // cycles
convar_t *sxdly_delay; // current delay in seconds
convar_t *dsp_room; // for compability
int idsp_dma_speed;
int idsp_room;
int room_typeprev;
// routines
int sxamodl, sxamodr; // amplitude modulation values
int sxamodlt, sxamodrt; // modulation targets
int sxhires, sxhiresprev;
int sxmod1, sxmod2;
int sxmod1cur, sxmod2cur;
int sxmod1, sxmod2;
int sxhires;
portable_samplepair_t *paintto = NULL;
@ -177,15 +181,17 @@ Starts sound crackling system
*/
void SX_Init( void )
{
memset( rgsxdly, 0, sizeof( rgsxdly ) );
memset( rgsxlp, 0, sizeof( rgsxlp ) );
memset( rgsxdly, 0, sizeof( rgsxdly ));
memset( rgsxlp, 0, sizeof( rgsxlp ));
sxamodr = sxamodl = sxamodrt = sxamodlt = 255;
idsp_dma_speed = SOUND_11k;
sxhires = sxhiresprev = 0;
hisound = Cvar_Get( "room_hires", "2", CVAR_ARCHIVE, "dsp quality. 1 for 22k, 2 for 44k(recommended) and 3 for 96k" );
sxhires = 2;
sxmod1cur = sxmod1 = 350 * ( SOUND_DMA_SPEED / SOUND_11k );
sxmod2cur = sxmod2 = 450 * ( SOUND_DMA_SPEED / SOUND_11k );
sxmod1cur = sxmod1 = 350 * ( idsp_dma_speed / SOUND_11k );
sxmod2cur = sxmod2 = 450 * ( idsp_dma_speed / SOUND_11k );
dsp_off = Cvar_Get( "dsp_off", "0", 0, "disable DSP processing" );
roomwater_type = Cvar_Get( "waterroom_type", "14", 0, "water room type" );
@ -265,7 +271,7 @@ int DLY_Init( int idelay, float delay )
DLY_Free( idelay ); // free dly if it's allocated
cur = &rgsxdly[idelay];
cur->cdelaysamplesmax = ((int)(delay * SOUND_DMA_SPEED) << sxhires) + 1;
cur->cdelaysamplesmax = ((int)(delay * idsp_dma_speed) << sxhires) + 1;
cur->lpdelayline = (int *)Z_Malloc( cur->cdelaysamplesmax * sizeof( int ));
cur->xfade = 0;
@ -322,8 +328,8 @@ void DLY_CheckNewStereoDelayVal( void )
{
int samples;
delay = min( delay, MAX_STEREO_DELAY );
samples = (int)(delay * SOUND_DMA_SPEED) << sxhires;
delay = Q_min( delay, MAX_STEREO_DELAY );
samples = (int)(delay * idsp_dma_speed) << sxhires;
// re-init dly
if( !dly->lpdelayline )
@ -399,10 +405,10 @@ void DLY_DoStereoDelay( int count )
}
// save left value to delay line
dly->lpdelayline[dly->idelayinput] = paint->left;
dly->lpdelayline[dly->idelayinput] = CLIP( paint->left );
// paint new delay value
paint->left = CLIP(delay);
paint->left = delay;
}
else
{
@ -435,7 +441,7 @@ void DLY_CheckNewDelayVal( void )
else
{
delay = min( delay, MAX_MONO_DELAY );
dly->delaysamples = (int)(delay * SOUND_DMA_SPEED) << sxhires;
dly->delaysamples = (int)(delay * idsp_dma_speed) << sxhires;
// init dly
if( !dly->lpdelayline )
@ -485,8 +491,7 @@ void DLY_DoDelay( int count )
if( delay || paint->left || paint->right )
{
// calculate delayed value from average
int val = (( paint->left + paint->right ) / 2 ) +
(( dly->delayfeedback * delay ) >> 8);
int val = (( paint->left + paint->right ) >> 1 ) + (( dly->delayfeedback * delay ) >> 8);
val = CLIP( val );
if( dly->lp ) // lowpass
@ -524,8 +529,8 @@ void RVB_SetUpDly( int pos, float delay, int kmod )
{
int samples;
delay = min( delay, MAX_REVERB_DELAY );
samples = (int)(delay * SOUND_DMA_SPEED) << sxhires;
delay = Q_min( delay, MAX_REVERB_DELAY );
samples = (int)(delay * idsp_dma_speed) << sxhires;
if( !rgsxdly[pos].lpdelayline )
{
@ -533,7 +538,7 @@ void RVB_SetUpDly( int pos, float delay, int kmod )
DLY_Init( pos, MAX_REVERB_DELAY );
}
rgsxdly[pos].modcur = rgsxdly[pos].mod = (int)(kmod * SOUND_DMA_SPEED / SOUND_11k) << sxhires;
rgsxdly[pos].modcur = rgsxdly[pos].mod = (int)(kmod * idsp_dma_speed / SOUND_11k) << sxhires;
// set up crossfade, if delay has changed
if( rgsxdly[pos].delaysamples != samples )
@ -603,15 +608,20 @@ int RVB_DoReverbForOneDly( dly_t *dly, const int vlr, const portable_samplepair_
if( dly->xfade || delay || samplepair->left || samplepair->right )
{
// modulate delay rate
if( !dly->xfade && !dly->modcur && dly->mod )
if( !dly->mod )
{
dly->idelayoutputxf = dly->idelayoutput + ((Com_RandomLong( 0, 255 ) * delay) >> 9 );
dly->idelayoutputxf %= dly->cdelaysamplesmax;
if( dly->idelayoutputxf >= dly->cdelaysamplesmax )
dly->idelayoutputxf -= dly->cdelaysamplesmax;
dly->xfade = REVERB_XFADE;
}
if( dly->xfade )
{
samplexf = (dly->lpdelayline[dly->idelayoutputxf] * (32 - dly->xfade)) / 32;
delay = delay * dly->xfade / 32 + samplexf;
samplexf = (dly->lpdelayline[dly->idelayoutputxf] * (REVERB_XFADE - dly->xfade)) / REVERB_XFADE;
delay = ((delay * dly->xfade) / REVERB_XFADE) + samplexf;
if( ++dly->idelayoutputxf >= dly->cdelaysamplesmax )
dly->idelayoutputxf = 0;
@ -620,22 +630,29 @@ int RVB_DoReverbForOneDly( dly_t *dly, const int vlr, const portable_samplepair_
dly->idelayoutput = dly->idelayoutputxf;
}
val = delay ? vlr + ((dly->delayfeedback * delay) >> 8) : vlr;
val = CLIP( val );
if( delay )
{
val = vlr + ( ( dly->delayfeedback * delay ) >> 8 );
val = CLIP( val );
}
else
val = vlr;
if( dly->lp )
{
valt = (dly->lp0 + val) >> 1;
dly->lp0 = val;
}
else valt = val;
else
valt = val;
voutm = dly->lpdelayline[dly->idelayinput] = valt;
}
else
{
voutm = dly->lpdelayline[dly->idelayinput] = 0;
dly->lp0 = dly->lp1 = 0;
dly->lp0 = 0;
}
DLY_MovePointer( dly );
@ -658,7 +675,7 @@ void RVB_DoReverb( int count )
portable_samplepair_t *paint = paintto;
int vlr, voutm;
if( !dly1->lpdelayline || !count )
if( !dly1->lpdelayline )
return;
for( ; count; count--, paint++ )
@ -668,10 +685,10 @@ void RVB_DoReverb( int count )
voutm = RVB_DoReverbForOneDly( dly1, vlr, paint );
voutm += RVB_DoReverbForOneDly( dly2, vlr, paint );
voutm = 11 * voutm >> 6;
voutm = (11 * voutm) >> 6;
paint->left = CLIP( paint->left + voutm);
paint->right = CLIP( paint->right + voutm);
paint->left = CLIP( paint->left + voutm );
paint->right = CLIP( paint->right + voutm );
}
}
@ -689,8 +706,6 @@ void RVB_DoAMod( int count )
if( !sxmod_lowpass->integer && !sxmod_mod->integer )
return;
if( !count ) return;
for( ; count; count--, paint++ )
{
portable_samplepair_t res = *paint;
@ -758,11 +773,11 @@ DSP_Process
*/
void DSP_Process( int idsp, portable_samplepair_t *pbfront, int sampleCount )
{
if( dsp_off->value != 0.0f )
if( dsp_off->integer )
return;
// HACKHACK: don't process while in menu
if( cls.key_dest == key_menu )
if( cls.key_dest == key_menu || !sampleCount )
return;
// preset is already installed by CheckNewDspPresets
@ -822,9 +837,6 @@ CheckNewDspPresets
*/
void CheckNewDspPresets( void )
{
sxhires = 1;
sxhiresprev = 1;
if( dsp_off->value != 0.0f )
return;
@ -832,6 +844,12 @@ void CheckNewDspPresets( void )
idsp_room = roomwater_type->value;
else idsp_room = room_type->value;
if( hisound->modified )
{
sxhires = hisound->integer;
hisound->modified = false;
}
if( idsp_room == room_typeprev && idsp_room == 0 )
return;

View File

@ -231,7 +231,8 @@ generic method to fill rectangle
*/
void VGUI_DrawQuad( const vpoint_t *ul, const vpoint_t *lr )
{
ASSERT( ul != NULL && lr != NULL );
Assert( ul != NULL );
Assert( lr != NULL );
pglBegin( GL_QUADS );
pglTexCoord2f( ul->coord[0], ul->coord[1] );

View File

@ -217,9 +217,9 @@ KeyCode VGUI_MapKey( int keyCode )
{
VGUI_InitKeyTranslationTable();
if( keyCode < 0 || keyCode >= sizeof( s_pVirtualKeyTrans ) / sizeof( s_pVirtualKeyTrans[0] ))
if( keyCode < 0 || keyCode >= ARRAYSIZE( s_pVirtualKeyTrans ))
{
Assert( false );
Assert( 0 );
return (KeyCode)-1;
}
else
@ -238,12 +238,14 @@ LONG VGUI_SurfaceWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
return 0;
panel = (CEnginePanel *)VGui_GetPanel();
surface = panel->getSurfaceBase();
pApp = panel->getApp();
ASSERT( panel != NULL );
ASSERT( pApp != NULL );
surface = panel->getSurfaceBase();
ASSERT( surface != NULL );
pApp = panel->getApp();
ASSERT( pApp != NULL );
switch( uMsg )
{
case WM_SETCURSOR:
@ -284,7 +286,7 @@ LONG VGUI_SurfaceWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if(!( lParam & ( 1 << 30 )))
if( !FBitSet( lParam, BIT( 30 )))
pApp->internalKeyPressed( VGUI_MapKey( wParam ), surface );
pApp->internalKeyTyped( VGUI_MapKey( wParam ), surface );
break;

View File

@ -163,7 +163,6 @@ protected:
int _drawTextPos[2];
int _drawColor[4];
int _drawTextColor[4];
bool _allowSetTextPos;
friend class App;
friend class Panel;
};

View File

@ -139,8 +139,6 @@ qboolean AVI_ACMConvertAudio( movie_state_t *Avi )
dword dest_length;
short bits;
ASSERT( Avi != NULL );
// WMA codecs, both versions - they simply don't work.
if( Avi->audio_header->wFormatTag == 0x160 || Avi->audio_header->wFormatTag == 0x161 )
{
@ -249,8 +247,6 @@ qboolean AVI_ACMConvertAudio( movie_state_t *Avi )
qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *duration )
{
ASSERT( Avi != NULL );
if( !Avi->active )
return false;
@ -269,8 +265,6 @@ qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *du
// returns a unique frame identifier
long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
{
ASSERT( Avi != NULL );
if( !Avi->active )
return 0;
@ -284,8 +278,6 @@ byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame )
byte *frame_raw, *tmp;
int i;
ASSERT( Avi != NULL );
if( !Avi->active ) return NULL;
if( frame >= Avi->video_frames )
@ -310,8 +302,6 @@ byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame )
qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info )
{
ASSERT( Avi != NULL );
if( !Avi->active || Avi->audio_stream == NULL || snd_info == NULL )
{
return false;
@ -335,8 +325,6 @@ qboolean AVI_SeekPosition( movie_state_t *Avi, dword offset )
{
int breaker;
ASSERT( Avi != NULL );
if( offset < Avi->cpa_blockoffset ) // well, shit. we can't seek backwards... restart
{
if( Avi->cpa_blockoffset - offset < 500000 )
@ -384,10 +372,8 @@ qboolean AVI_SeekPosition( movie_state_t *Avi, dword offset )
// get a chunk of audio from the stream (in bytes)
long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long length )
{
int i;
long result = 0;
ASSERT( Avi != NULL );
int i;
// zero data past the end of the file
if( offset + length > Avi->audio_length )
@ -457,8 +443,6 @@ long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long l
void AVI_CloseVideo( movie_state_t *Avi )
{
ASSERT( Avi != NULL );
if( Avi->active )
{
pAVIStreamGetFrameClose( Avi->video_getframe );
@ -494,8 +478,6 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
long opened_streams = 0;
LONG hr;
ASSERT( Avi != NULL );
// default state: non-working.
Avi->active = false;
Avi->quiet = quiet;

View File

@ -23,7 +23,7 @@ static char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int Q_buildnum( void )
{
// do not touch this! Only author of Xash3D can increase buildnumbers!
#if 1
#if 0
int m = 0, d = 0, y = 0;
static int b = 0;
@ -48,6 +48,6 @@ int Q_buildnum( void )
return b;
#else
return 3521;
return 3598;
#endif
}

View File

@ -448,6 +448,25 @@ void COM_FreeFile( void *buffer )
free( buffer );
}
/*
=============
COM_NormalizeAngles
=============
*/
void COM_NormalizeAngles( vec3_t angles )
{
int i;
for( i = 0; i < 3; i++ )
{
if( angles[i] > 180.0f )
angles[i] -= 360.0f;
else if( angles[i] < -180.0f )
angles[i] += 360.0f;
}
}
/*
=============
pfnGetModelType

View File

@ -386,6 +386,7 @@ file_t *FS_OpenFile( const char *path, long *filesizeptr, qboolean gamedironly )
byte *FS_LoadFile( const char *path, long *filesizeptr, qboolean gamedironly );
qboolean FS_WriteFile( const char *filename, const void *data, long len );
qboolean COM_ParseVector( char **pfile, float *v, size_t size );
void COM_NormalizeAngles( vec3_t angles );
int COM_FileSize( const char *filename );
void COM_FixSlashes( char *pname );
void COM_FreeFile( void *buffer );

View File

@ -526,8 +526,6 @@ static void Con_LoadConsoleFont( int fontNumber, cl_font_t *font )
{
int fontWidth;
ASSERT( font != NULL );
if( font->valid ) return; // already loaded
// loading conchars
@ -1480,7 +1478,7 @@ void Field_DrawInputLine( int x, int y, field_t *edit )
drawLen = len - prestep;
// extract <drawLen> characters from the field at <prestep>
ASSERT( drawLen < MAX_SYSPATH );
drawLen = Q_min( drawLen, MAX_SYSPATH - 1 );
memcpy( str, edit->buffer + prestep, drawLen );
str[drawLen] = 0;

View File

@ -235,7 +235,7 @@ void Host_Exec_f( void )
}
// don't execute listenserver.cfg in singleplayer
if( !Q_stricmp( Cvar_VariableString( "lservercfgfile" ), Cmd_Argv( 1 )))
if( !Q_stricmp( Cvar_VariableString( "lservercfgfile" ), Cmd_Argv( 1 )))
{
if( Cvar_VariableInteger( "maxplayers" ) == 1 )
return;

View File

@ -208,8 +208,6 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
mstudiobbox_t *phitbox;
int i, j;
ASSERT( numhitboxes );
*numhitboxes = 0; // assume error
if( mod_studiocache->integer )
@ -230,8 +228,6 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
mod_studiohdr = Mod_Extradata( model );
if( !mod_studiohdr ) return NULL; // probably not a studiomodel
ASSERT( pBlendAPI != NULL );
VectorCopy( angles, angles2 );
if( !( host.features & ENGINE_COMPENSATE_QUAKE_BUG ))
@ -745,8 +741,6 @@ void Mod_StudioGetAttachment( const edict_t *e, int iAttachment, float *origin,
if( mod_studiohdr->numattachments <= 0 )
return;
ASSERT( pBlendAPI != NULL );
if( mod_studiohdr->numattachments > MAXSTUDIOATTACHMENTS )
{
mod_studiohdr->numattachments = MAXSTUDIOATTACHMENTS; // reduce it
@ -794,8 +788,6 @@ void Mod_GetBonePosition( const edict_t *e, int iBone, float *origin, float *ang
mod_studiohdr = (studiohdr_t *)Mod_Extradata( mod );
if( !mod_studiohdr ) return;
ASSERT( pBlendAPI != NULL );
pBlendAPI->SV_StudioSetupBones( mod, e->v.frame, e->v.sequence, e->v.angles, e->v.origin,
e->v.controller, e->v.blending, iBone, e );

View File

@ -275,8 +275,8 @@ void MSG_WriteBitFloat( sizebuf_t *sb, float val )
{
long intVal;
ASSERT( sizeof( long ) == sizeof( float ));
ASSERT( sizeof( float ) == 4 );
Assert( sizeof( long ) == sizeof( float ));
Assert( sizeof( float ) == 4 );
intVal = *((long *)&val );
MSG_WriteUBitLong( sb, intVal, 32 );
@ -368,7 +368,7 @@ uint MSG_ReadUBitLong( sizebuf_t *sb, int numbits )
return 0;
}
ASSERT( numbits > 0 && numbits <= 32 );
Assert( numbits > 0 && numbits <= 32 );
// Read the current dword.
idword1 = sb->iCurBit >> 5;
@ -401,8 +401,8 @@ float MSG_ReadBitFloat( sizebuf_t *sb )
long val;
int bit, byte;
ASSERT( sizeof( float ) == sizeof( long ));
ASSERT( sizeof( float ) == 4 );
Assert( sizeof( float ) == sizeof( long ));
Assert( sizeof( float ) == 4 );
if( MSG_Overflow( sb, 32 ))
return 0.0f;
@ -547,7 +547,8 @@ dword MSG_ReadDword( sizebuf_t *sb )
float MSG_ReadFloat( sizebuf_t *sb )
{
float ret;
ASSERT( sizeof( ret ) == 4 );
Assert( sizeof( ret ) == 4 );
MSG_ReadBits( sb, &ret, 32 );

View File

@ -375,7 +375,7 @@ void Delta_CustomEncode( delta_info_t *dt, const void *from, const void *to )
{
int i;
ASSERT( dt != NULL );
Assert( dt != NULL );
// set all fields is active by default
for( i = 0; i < dt->numFields; i++ )
@ -424,7 +424,7 @@ qboolean Delta_AddField( const char *pStructName, const char *pName, int flags,
// get the delta struct
dt = Delta_FindStruct( pStructName );
ASSERT( dt != NULL );
Assert( dt != NULL );
// check for coexisting field
for( i = 0, pField = dt->pFields; i < dt->numFields; i++, pField++ )
@ -472,16 +472,16 @@ void Delta_WriteTableField( sizebuf_t *msg, int tableIndex, const delta_t *pFiel
int nameIndex;
delta_info_t *dt;
ASSERT( pField );
Assert( pField );
if( !pField->name || !*pField->name )
return; // not initialized ?
dt = Delta_FindStructByIndex( tableIndex );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
nameIndex = Delta_IndexForFieldInfo( dt->pInfo, pField->name );
ASSERT( nameIndex >= 0 && nameIndex < dt->maxFields );
Assert( nameIndex >= 0 && nameIndex < dt->maxFields );
MSG_WriteByte( msg, svc_deltatable );
MSG_WriteUBitLong( msg, tableIndex, 4 ); // assume we support 16 network tables
@ -516,10 +516,10 @@ void Delta_ParseTableField( sizebuf_t *msg )
tableIndex = MSG_ReadUBitLong( msg, 4 );
dt = Delta_FindStructByIndex( tableIndex );
ASSERT( dt != NULL );
Assert( dt != NULL );
nameIndex = MSG_ReadUBitLong( msg, 8 ); // read field name index
ASSERT( nameIndex >= 0 && nameIndex < dt->maxFields );
Assert( nameIndex >= 0 && nameIndex < dt->maxFields );
pName = dt->pInfo[nameIndex].name;
flags = MSG_ReadUBitLong( msg, 10 );
bits = MSG_ReadUBitLong( msg, 5 ) + 1;
@ -695,7 +695,7 @@ void Delta_ParseTable( char **delta_script, delta_info_t *dt, const char *encode
// assume we have handled '{'
while(( *delta_script = COM_ParseFile( *delta_script, token )) != NULL )
{
ASSERT( dt->numFields <= dt->maxFields );
Assert( dt->numFields <= dt->maxFields );
if( !Q_strcmp( token, "DEFINE_DELTA" ))
{
@ -789,7 +789,7 @@ void Delta_Init( void )
dt = Delta_FindStruct( "movevars_t" );
ASSERT( dt != NULL );
Assert( dt != NULL );
if( dt->bInitialized ) return; // "movevars_t" already specified by user
// create movevars_t delta internal
@ -971,9 +971,9 @@ qboolean Delta_CompareField( delta_t *pField, void *from, void *to, float timeba
float val_a, val_b;
int fromF, toF;
ASSERT( pField );
ASSERT( from );
ASSERT( to );
Assert( pField );
Assert( from );
Assert( to );
if( pField->bInactive )
return true;
@ -1184,7 +1184,7 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
bChanged = MSG_ReadOneBit( msg );
ASSERT( pField->multiplier != 0.0f );
Assert( pField->multiplier != 0.0f );
if( pField->flags & DT_BYTE )
{
@ -1315,10 +1315,10 @@ void MSG_WriteDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to )
int i;
dt = Delta_FindStruct( "usercmd_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// activate fields and call custom encode func
Delta_CustomEncode( dt, from, to );
@ -1342,10 +1342,10 @@ void MSG_ReadDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to )
int i;
dt = Delta_FindStruct( "usercmd_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
*to = *from;
@ -1375,10 +1375,10 @@ void MSG_WriteDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to )
int i;
dt = Delta_FindStruct( "event_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// activate fields and call custom encode func
Delta_CustomEncode( dt, from, to );
@ -1402,10 +1402,10 @@ void MSG_ReadDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to )
int i;
dt = Delta_FindStruct( "event_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
*to = *from;
@ -1431,10 +1431,10 @@ qboolean MSG_WriteDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *t
int numChanges = 0;
dt = Delta_FindStruct( "movevars_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
startBit = msg->iCurBit;
@ -1466,10 +1466,10 @@ void MSG_ReadDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *to )
int i;
dt = Delta_FindStruct( "movevars_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
*to = *from;
@ -1502,10 +1502,10 @@ void MSG_WriteClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to,
int i;
dt = Delta_FindStruct( "clientdata_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// activate fields and call custom encode func
Delta_CustomEncode( dt, from, to );
@ -1531,10 +1531,10 @@ void MSG_ReadClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, f
int i;
dt = Delta_FindStruct( "clientdata_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
*to = *from;
@ -1568,10 +1568,10 @@ void MSG_WriteWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to
int numChanges = 0;
dt = Delta_FindStruct( "weapon_data_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// activate fields and call custom encode func
Delta_CustomEncode( dt, from, to );
@ -1606,10 +1606,10 @@ void MSG_ReadWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to,
int i;
dt = Delta_FindStruct( "weapon_data_t" );
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
*to = *from;
@ -1697,10 +1697,10 @@ void MSG_WriteDeltaEntity( entity_state_t *from, entity_state_t *to, sizebuf_t *
dt = Delta_FindStruct( "custom_entity_state_t" );
}
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// activate fields and call custom encode func
Delta_CustomEncode( dt, from, to );
@ -1780,10 +1780,10 @@ qboolean MSG_ReadDeltaEntity( sizebuf_t *msg, entity_state_t *from, entity_state
dt = Delta_FindStruct( "custom_entity_state_t" );
}
ASSERT( dt && dt->bInitialized );
Assert( dt && dt->bInitialized );
pField = dt->pFields;
ASSERT( pField );
Assert( pField );
// process fields
for( i = 0; i < dt->numFields; i++, pField++ )

View File

@ -117,7 +117,8 @@ hull_t *PM_HullForBsp( physent_t *pe, playermove_t *pmove, float *offset )
{
hull_t *hull;
ASSERT( pe && pe->model != NULL );
Assert( pe != NULL );
Assert( pe->model != NULL );
switch( pmove->usehull )
{
@ -135,7 +136,7 @@ hull_t *PM_HullForBsp( physent_t *pe, playermove_t *pmove, float *offset )
break;
}
ASSERT( hull != NULL );
Assert( hull != NULL );
// force to use hull0 because other hulls doesn't exist for water
if( pe->model->flags & MODEL_LIQUID && pe->solid != SOLID_TRIGGER )

View File

@ -218,7 +218,7 @@ long Stream_ReadMPG( stream_t *stream, long needBytes, void *buffer )
mpeg_t *mpg;
mpg = (mpeg_t *)stream->ptr;
ASSERT( mpg != NULL );
Assert( mpg != NULL );
while( 1 )
{

View File

@ -881,7 +881,7 @@ void SV_EstablishTimeBase( sv_client_t *cl, usercmd_t *cmds, int dropped, int nu
for( ; numcmds > 0; numcmds-- )
runcmd_time += cmds[numcmds - 1].msec / 1000.0;
cl->timebase = sv.time + cl->cl_updaterate - runcmd_time;
cl->timebase = sv.frametime + svgame.globals->time - runcmd_time;
}
/*

View File

@ -389,8 +389,11 @@ void SV_ActivateServer( void )
// listenserver is executed on every map change in multiplayer
if( host.type != HOST_DEDICATED )
{
#if 0
// temporare disable because it's broken TFC multiplayer
char *plservercfgfile = Cvar_VariableString( "lservercfgfile" );
if( *plservercfgfile ) Cbuf_AddText( va( "exec %s\n", plservercfgfile ));
#endif
}
if( public_server->integer )