diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 305387da..bc49be28 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -1647,11 +1647,14 @@ void CL_Init( void ) CL_InitLocal(); R_Init(); // init renderer - S_Init(); // init sound if( !CL_LoadProgs( va( "%s/client.dll", GI->dll_path ))) Host_Error( "can't initialize client.dll\n" ); + // NOTE: hlfx has nasty hack with SetWindowHook which do mouse lag + // we must initialize sound after loading client.dll to avoid it + S_Init(); // init sound + cls.initialized = true; cl.maxclients = 1; // allow to drawing player in menu } diff --git a/engine/client/gl_studio.c b/engine/client/gl_studio.c index cc0f2813..b16ac42d 100644 --- a/engine/client/gl_studio.c +++ b/engine/client/gl_studio.c @@ -1187,7 +1187,7 @@ static void R_StudioSaveBones( void ) for( i = 0; i < m_pStudioHeader->numbones; i++ ) { - strcpy( g_nCachedBoneNames[i], pbones[i].name ); + Q_strcpy( g_nCachedBoneNames[i], pbones[i].name ); Matrix3x4_Copy( g_rgCachedBonesTransform[i], g_bonestransform[i] ); Matrix3x4_Copy( g_rgCachedLightTransform[i], g_lighttransform[i] ); } @@ -1886,7 +1886,7 @@ static model_t *R_StudioSetupPlayerModel( int index ) } if( !info->model[0] ) return NULL; - if( !stricmp( info->model, "player" )) Q_strncpy( modelpath, "models/player.mdl", sizeof( modelpath )); + if( !Q_stricmp( info->model, "player" )) Q_strncpy( modelpath, "models/player.mdl", sizeof( modelpath )); else Q_snprintf( modelpath, sizeof( modelpath ), "models/player/%s/%s.mdl", info->model, info->model ); return Mod_ForName( modelpath, false ); diff --git a/engine/client/s_backend.c b/engine/client/s_backend.c index d627551b..c34e15b2 100644 --- a/engine/client/s_backend.c +++ b/engine/client/s_backend.c @@ -9,7 +9,7 @@ #define iDirectSoundCreate( a, b, c ) pDirectSoundCreate( a, b, c ) -static HRESULT ( _stdcall *pDirectSoundCreate)(GUID* lpGUID, LPDIRECTSOUND* lplpDS, IUnknown* pUnkOuter ); +static HRESULT ( _stdcall *pDirectSoundCreate)(GUID* lpGUID, LPDIRECTSOUND* lpDS, IUnknown* pUnkOuter ); static dllfunc_t dsound_funcs[] = { diff --git a/engine/client/vgui/utlrbtree.h b/engine/client/vgui/utlrbtree.h index 5eadd9b4..69efcdde 100644 --- a/engine/client/vgui/utlrbtree.h +++ b/engine/client/vgui/utlrbtree.h @@ -32,8 +32,8 @@ public: //------------------------------------- -inline bool StringLessThan( const char * const &lhs, const char * const &rhs) { return ( strcmp( lhs, rhs) < 0 ); } -inline bool CaselessStringLessThan( const char * const &lhs, const char * const &rhs ) { return ( stricmp( lhs, rhs) < 0 ); } +inline bool StringLessThan( const char * const &lhs, const char * const &rhs) { return ( Q_strcmp( lhs, rhs) < 0 ); } +inline bool CaselessStringLessThan( const char * const &lhs, const char * const &rhs ) { return ( Q_stricmp( lhs, rhs) < 0 ); } //------------------------------------- // inline these two templates to stop multiple definitions of the same code diff --git a/engine/common/avikit.c b/engine/common/avikit.c index 0a3b87b6..758b7299 100644 --- a/engine/common/avikit.c +++ b/engine/common/avikit.c @@ -625,6 +625,12 @@ movie_state_t *AVI_GetState( int num ) qboolean AVI_Initailize( void ) { + if( Sys_CheckParm( "-noavi" )) + { + MsgDev( D_INFO, "AVI: Disabled\n" ); + return false; + } + if( !Sys_LoadLibrary( &avifile_dll )) { MsgDev( D_ERROR, "AVI_Initailize: failed\n" ); diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 71a7bd62..df309952 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -491,7 +491,7 @@ void Cmd_RemoveCommand (const char *cmd_name) { cmd = *back; if (!cmd ) return; - if (!strcmp( cmd_name, cmd->name )) + if (!Q_strcmp( cmd_name, cmd->name )) { *back = cmd->next; if(cmd->name) Mem_Free(cmd->name); diff --git a/engine/common/host.c b/engine/common/host.c index 30b6a88b..71c8f022 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -761,6 +761,17 @@ int EXPORT Host_Main( const char *progname, int bChangeGame, pfnChangeGame func NET_Init(); Netchan_Init(); + // allow to change game from the console + if( pChangeGame != NULL ) + { + Cmd_AddCommand( "game", Host_ChangeGame_f, "change game" ); + Cvar_Get( "host_allow_changegame", "1", CVAR_READ_ONLY, "allows to change games" ); + } + else + { + Cvar_Get( "host_allow_changegame", "0", CVAR_READ_ONLY, "allows to change games" ); + } + SV_Init(); CL_Init(); @@ -781,17 +792,6 @@ int EXPORT Host_Main( const char *progname, int bChangeGame, pfnChangeGame func Cbuf_AddText( "exec config.cfg\n" ); } - // allow to change game from the console - if( pChangeGame != NULL ) - { - Cmd_AddCommand( "game", Host_ChangeGame_f, "change game" ); - Cvar_Get( "host_allow_changegame", "1", CVAR_READ_ONLY, "allows to change games" ); - } - else - { - Cvar_Get( "host_allow_changegame", "0", CVAR_READ_ONLY, "allows to change games" ); - } - host.errorframe = 0; Cbuf_Execute(); diff --git a/engine/common/input.c b/engine/common/input.c index 0aefa0e2..edbf6400 100644 --- a/engine/common/input.c +++ b/engine/common/input.c @@ -268,7 +268,9 @@ void IN_DeactivateMouse( void ) clgame.dllFuncs.IN_DeactivateMouse(); } else if( in_restore_spi ) + { SystemParametersInfo( SPI_SETMOUSE, 0, in_originalmouseparms, 0 ); + } in_mouseactive = false; ClipCursor( NULL ); diff --git a/engine/common/model.c b/engine/common/model.c index 047beb54..14307bc3 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -487,7 +487,17 @@ static void Mod_LoadTextures( const dlump_t *l ) for( i = 0; i < loadmodel->numtextures; i++ ) { - if( in->dataofs[i] == -1 ) continue; // missed + if( in->dataofs[i] == -1 ) + { + // create default texture (some mods requires this) + tx = Mem_Alloc( loadmodel->mempool, sizeof( *tx )); + loadmodel->textures[i] = tx; + + Q_strncpy( tx->name, "*default", sizeof( tx->name )); + tx->gl_texturenum = tr.defaultTexture; + tx->width = tx->height = 16; + continue; // missed + } mt = (mip_t *)((byte *)in + in->dataofs[i] ); @@ -828,6 +838,8 @@ static void Mod_LoadSurfaces( const dlump_t *l ) for( i = 0; i < count; i++, in++, out++, info++ ) { + texture_t *tex; + if(( in->firstedge + in->numedges ) > loadmodel->numsurfedges ) { MsgDev( D_ERROR, "Bad surface %i from %i\n", i, count ); @@ -842,29 +854,25 @@ static void Mod_LoadSurfaces( const dlump_t *l ) out->plane = loadmodel->planes + in->planenum; out->texinfo = loadmodel->texinfo + in->texinfo; - // some DMC maps have bad textures - if( out->texinfo->texture ) - { - texture_t *tex = out->texinfo->texture; + tex = out->texinfo->texture; - if( !Q_strncmp( tex->name, "sky", 3 )) - out->flags |= (SURF_DRAWTILED|SURF_DRAWSKY); + if( !Q_strncmp( tex->name, "sky", 3 )) + out->flags |= (SURF_DRAWTILED|SURF_DRAWSKY); - if( tex->name[0] == '*' || tex->name[0] == '!' ) - out->flags |= (SURF_DRAWTURB|SURF_DRAWTILED); + if( tex->name[0] == '*' || tex->name[0] == '!' ) + out->flags |= (SURF_DRAWTURB|SURF_DRAWTILED); - if( !Q_strnicmp( tex->name, "water", 5 )) - out->flags |= (SURF_DRAWTURB|SURF_DRAWTILED|SURF_NOCULL); + if( !Q_strnicmp( tex->name, "water", 5 )) + out->flags |= (SURF_DRAWTURB|SURF_DRAWTILED|SURF_NOCULL); - if( !Q_strnicmp( tex->name, "scroll", 6 )) - out->flags |= SURF_CONVEYOR; + if( !Q_strnicmp( tex->name, "scroll", 6 )) + out->flags |= SURF_CONVEYOR; - if( tex->name[0] == '{' ) - out->flags |= SURF_TRANSPARENT; + if( tex->name[0] == '{' ) + out->flags |= SURF_TRANSPARENT; - if( out->texinfo->flags & TEX_SPECIAL ) - out->flags |= SURF_DRAWTILED; - } + if( out->texinfo->flags & TEX_SPECIAL ) + out->flags |= SURF_DRAWTILED; Mod_CalcSurfaceBounds( out, info ); Mod_CalcSurfaceExtents( out ); diff --git a/engine/server/server.h b/engine/server/server.h index a5d4175f..594407bc 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -425,6 +425,7 @@ void SV_FreeOldEntities( void ); qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker ); // for EntityInSolid checks qboolean SV_TestPlayerPosition( edict_t *ent ); // for PlayerInSolid checks void SV_Impact( edict_t *e1, trace_t *trace ); +void SV_CheckAllEnts( void ); // // sv_move.c diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 8550fd63..458cf1f6 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -2576,7 +2576,7 @@ static void pfnEngineFprintf( FILE *pfile, char *szFmt, ... ) /* ============= -pfnPvAllocEntPrivateData +pfnBuildSoundMsg ============= */ diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index f91e2b40..a194c030 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -643,7 +643,7 @@ void SV_Init( void ) sv_spectatormaxspeed = Cvar_Get( "sv_spectatormaxspeed", "500", CVAR_PHYSICINFO, "spectator maxspeed" ); sv_waterfriction = Cvar_Get( "sv_waterfriction", "1", CVAR_PHYSICINFO, "how fast you slow down in water" ); sv_wateraccelerate = Cvar_Get( "sv_wateraccelerate", "10", CVAR_PHYSICINFO, "rate at which a player accelerates to sv_maxspeed while in the water" ); - sv_rollangle = Cvar_Get( "sv_rollangle", "2", CVAR_PHYSICINFO, "how much to tilt the view when strafing" ); + sv_rollangle = Cvar_Get( "sv_rollangle", "0", CVAR_PHYSICINFO, "how much to tilt the view when strafing" ); sv_rollspeed = Cvar_Get( "sv_rollspeed", "200", CVAR_PHYSICINFO, "how much strafing is necessary to tilt the view" ); sv_airaccelerate = Cvar_Get("sv_airaccelerate", "10", CVAR_PHYSICINFO, "player accellerate in air" ); sv_maxvelocity = Cvar_Get( "sv_maxvelocity", "2000", CVAR_PHYSICINFO, "max world velocity" ); diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 52bfec0b..cd1d8100 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -73,6 +73,8 @@ void SV_CheckAllEnts( void ) e->pvPrivateData = NULL; continue; } + + SV_CheckVelocity( e ); } } diff --git a/game_launch/game.cpp b/game_launch/game.cpp index ea9195c5..ef99a882 100644 --- a/game_launch/game.cpp +++ b/game_launch/game.cpp @@ -1,5 +1,5 @@ //======================================================================= -// Copyright XashXT Group 2007 © +// Copyright XashXT Group 2011 © // game.cpp -- executable to run Xash Engine //======================================================================= diff --git a/game_launch/game.ncb b/game_launch/game.ncb index 54983feb..25a4c713 100644 Binary files a/game_launch/game.ncb and b/game_launch/game.ncb differ diff --git a/game_launch/game.opt b/game_launch/game.opt index e04cb49e..cf5a84e3 100644 Binary files a/game_launch/game.opt and b/game_launch/game.opt differ