23 Mar 2011

This commit is contained in:
g-cont 2011-03-23 00:00:00 +03:00 committed by Alibek Omarov
parent b22f91358d
commit db7b00229d
16 changed files with 61 additions and 39 deletions

View File

@ -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
}

View File

@ -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 );

View File

@ -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[] =
{

View File

@ -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

View File

@ -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" );

View File

@ -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);

View File

@ -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();

View File

@ -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 );

View File

@ -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 );

View File

@ -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

View File

@ -2576,7 +2576,7 @@ static void pfnEngineFprintf( FILE *pfile, char *szFmt, ... )
/*
=============
pfnPvAllocEntPrivateData
pfnBuildSoundMsg
=============
*/

View File

@ -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" );

View File

@ -73,6 +73,8 @@ void SV_CheckAllEnts( void )
e->pvPrivateData = NULL;
continue;
}
SV_CheckVelocity( e );
}
}

View File

@ -1,5 +1,5 @@
//=======================================================================
// Copyright XashXT Group 2007 ©
// Copyright XashXT Group 2011 ©
// game.cpp -- executable to run Xash Engine
//=======================================================================

Binary file not shown.

Binary file not shown.