24 Aug 2017
This commit is contained in:
parent
b11b79d08a
commit
3f4827918e
|
@ -1027,7 +1027,7 @@ void R_AliasLighting( float *lv, const vec3_t normal )
|
|||
|
||||
illum += g_alias.shadelight;
|
||||
|
||||
r = r_studio_lambert->value;
|
||||
r = SHADE_LAMBERT;
|
||||
|
||||
// do modified hemispherical lighting
|
||||
if( r <= 1.0f )
|
||||
|
|
|
@ -38,6 +38,7 @@ extern byte *r_temppool;
|
|||
#define MAX_DECAL_SURFS 4096
|
||||
|
||||
#define SHADEDOT_QUANT 16 // precalculated dot products for quantized angles
|
||||
#define SHADE_LAMBERT 1.495f
|
||||
|
||||
// refparams
|
||||
#define RP_NONE 0
|
||||
|
|
|
@ -105,7 +105,6 @@ typedef struct
|
|||
} studio_draw_state_t;
|
||||
|
||||
// studio-related cvars
|
||||
convar_t *r_studio_lambert;
|
||||
convar_t *r_studio_sort_textures;
|
||||
convar_t *r_drawviewmodel;
|
||||
convar_t *cl_righthand = NULL;
|
||||
|
@ -133,7 +132,6 @@ R_StudioInit
|
|||
*/
|
||||
void R_StudioInit( void )
|
||||
{
|
||||
r_studio_lambert = Cvar_Get( "r_studio_lambert", "1.5", FCVAR_ARCHIVE, "half-lambert value" );
|
||||
cl_himodels = Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
|
||||
r_studio_sort_textures = Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
|
||||
r_drawviewmodel = Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
|
||||
|
@ -1973,7 +1971,7 @@ void R_StudioLighting( float *lv, int bone, int flags, vec3_t normal )
|
|||
|
||||
illum += g_studio.shadelight;
|
||||
|
||||
r = r_studio_lambert->value;
|
||||
r = SHADE_LAMBERT;
|
||||
|
||||
// do modified hemispherical lighting
|
||||
if( r <= 1.0f )
|
||||
|
|
|
@ -227,7 +227,6 @@ void Cbuf_ExecStuffCmds( void )
|
|||
// no reason to run the commandline arguments twice
|
||||
if( !host.stuffcmds_pending )
|
||||
return;
|
||||
|
||||
build[0] = 0;
|
||||
|
||||
for( i = 0; i < host.argc; i++ )
|
||||
|
|
|
@ -261,6 +261,7 @@ void listdirectory( stringlist_t *list, const char *path )
|
|||
|
||||
// start a new chain with the the first name
|
||||
stringlistappend( list, n_file.name );
|
||||
|
||||
// iterate through the directory
|
||||
while( _findnext( hFile, &n_file ) == 0 )
|
||||
stringlistappend( list, n_file.name );
|
||||
|
@ -296,6 +297,7 @@ static dpackfile_t* FS_AddFileToPack( const char* name, pack_t* pack, long offse
|
|||
// look for the slot we should put that file into (binary search)
|
||||
left = 0;
|
||||
right = pack->numfiles - 1;
|
||||
|
||||
while( left <= right )
|
||||
{
|
||||
int diff;
|
||||
|
@ -408,7 +410,6 @@ void FS_FileBase( const char *in, char *out )
|
|||
end = len-1; // no '.', copy to end
|
||||
else end--; // found ',', copy to left of '.'
|
||||
|
||||
|
||||
// scan backward for '/'
|
||||
start = len - 1;
|
||||
|
||||
|
@ -797,6 +798,7 @@ void FS_ClearSearchPath( void )
|
|||
Mem_Free( search->pack->files );
|
||||
Mem_Free( search->pack );
|
||||
}
|
||||
|
||||
if( search->wad )
|
||||
{
|
||||
W_Close( search->wad );
|
||||
|
@ -1606,6 +1608,7 @@ static file_t* FS_SysOpen( const char* filepath, const char* mode )
|
|||
file->ungetc = EOF;
|
||||
|
||||
file->handle = open( filepath, mod|opt, 0666 );
|
||||
|
||||
if( file->handle < 0 )
|
||||
{
|
||||
Mem_Free( file );
|
||||
|
@ -1621,7 +1624,6 @@ static file_t* FS_SysOpen( const char* filepath, const char* mode )
|
|||
return file;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
FS_OpenPackedFile
|
||||
|
@ -1773,6 +1775,7 @@ static searchpath_t *FS_FindFile( const char *name, int* index, qboolean gamedir
|
|||
FS_FileBase( name, shortname );
|
||||
|
||||
lump = W_FindLump( search->wad, shortname, type );
|
||||
|
||||
if( lump )
|
||||
{
|
||||
if( index )
|
||||
|
@ -1783,7 +1786,9 @@ static searchpath_t *FS_FindFile( const char *name, int* index, qboolean gamedir
|
|||
else
|
||||
{
|
||||
char netpath[MAX_SYSPATH];
|
||||
|
||||
Q_sprintf( netpath, "%s%s", search->filename, name );
|
||||
|
||||
if( FS_SysFileExists( netpath ))
|
||||
{
|
||||
if( index != NULL ) *index = -1;
|
||||
|
@ -1952,6 +1957,7 @@ long FS_Write( file_t *file, const void *data, size_t datasize )
|
|||
// write the buffer and update the position
|
||||
result = write( file->handle, data, (long)datasize );
|
||||
file->position = lseek( file->handle, 0, SEEK_CUR );
|
||||
|
||||
if( file->real_length < file->position )
|
||||
file->real_length = file->position;
|
||||
|
||||
|
@ -2155,8 +2161,10 @@ int FS_Gets( file_t *file, byte *string, size_t bufsize )
|
|||
while( 1 )
|
||||
{
|
||||
c = FS_Getc( file );
|
||||
|
||||
if( c == '\r' || c == '\n' || c < 0 )
|
||||
break;
|
||||
|
||||
if( end < bufsize - 1 )
|
||||
string[end++] = c;
|
||||
}
|
||||
|
@ -2166,6 +2174,7 @@ int FS_Gets( file_t *file, byte *string, size_t bufsize )
|
|||
if( c == '\r' )
|
||||
{
|
||||
c = FS_Getc( file );
|
||||
|
||||
if( c != '\n' )
|
||||
FS_UnGetc( file, (byte)c );
|
||||
}
|
||||
|
@ -2359,6 +2368,7 @@ void FS_StripExtension( char *path )
|
|||
if( path[length] == '/' || path[length] == '\\' || path[length] == ':' )
|
||||
return; // no extension
|
||||
}
|
||||
|
||||
if( length ) path[length] = 0;
|
||||
}
|
||||
|
||||
|
@ -2381,6 +2391,7 @@ void FS_DefaultExtension( char *path, const char *extension )
|
|||
if( *src == '.' ) return;
|
||||
src--;
|
||||
}
|
||||
|
||||
Q_strcat( path, extension );
|
||||
}
|
||||
|
||||
|
@ -2540,6 +2551,7 @@ long FS_FileSize( const char *filename, qboolean gamedironly )
|
|||
length = FS_Tell( fp );
|
||||
FS_Close( fp );
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -2583,6 +2595,7 @@ long FS_FileTime( const char *filename, qboolean gamedironly )
|
|||
Q_sprintf( path, "%s%s", search->filename, filename );
|
||||
return FS_SysFileTime( path );
|
||||
}
|
||||
|
||||
return -1; // doesn't exist
|
||||
}
|
||||
|
||||
|
@ -2736,6 +2749,7 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
|
|||
if( resultlistindex == resultlist.numstrings )
|
||||
stringlistappend( &resultlist, temp );
|
||||
}
|
||||
|
||||
// strip off one path element at a time until empty
|
||||
// this way directories are added to the listing if they match the pattern
|
||||
slash = Q_strrchr( temp, '/' );
|
||||
|
@ -2783,6 +2797,7 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
|
|||
|
||||
// look through all the wad file elements
|
||||
wad = searchpath->wad;
|
||||
|
||||
for( i = 0; i < wad->numlumps; i++ )
|
||||
{
|
||||
// if type not matching, we already have no chance ...
|
||||
|
@ -2833,9 +2848,11 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
|
|||
Q_sprintf( netpath, "%s%s", searchpath->filename, basepath );
|
||||
stringlistinit( &dirlist );
|
||||
listdirectory( &dirlist, netpath );
|
||||
|
||||
for( dirlistindex = 0; dirlistindex < dirlist.numstrings; dirlistindex++ )
|
||||
{
|
||||
Q_sprintf( temp, "%s%s", basepath, dirlist.strings[dirlistindex] );
|
||||
|
||||
if( matchpattern( temp, (char *)pattern, true ))
|
||||
{
|
||||
for( resultlistindex = 0; resultlistindex < resultlist.numstrings; resultlistindex++ )
|
||||
|
@ -3159,6 +3176,7 @@ byte *W_ReadLump( wfile_t *wad, dlumpinfo_t *lump, long *lumpsizeptr )
|
|||
|
||||
buf = (byte *)Mem_Alloc( wad->mempool, lump->disksize );
|
||||
size = FS_Read( wad->handle, buf, lump->disksize );
|
||||
|
||||
if( size < lump->disksize )
|
||||
{
|
||||
MsgDev( D_WARN, "W_ReadLump: %s is probably corrupted\n", lump->name );
|
||||
|
|
|
@ -894,7 +894,7 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame )
|
|||
|
||||
// share developer level across all dlls
|
||||
Q_snprintf( dev_level, sizeof( dev_level ), "%i", host.developer );
|
||||
Cvar_Get( "developer", dev_level, 0, "current developer level" );
|
||||
Cvar_Get( "developer", dev_level, FCVAR_READ_ONLY, "current developer level" );
|
||||
Cmd_AddCommand( "exec", Host_Exec_f, "execute a script file" );
|
||||
Cmd_AddCommand( "memlist", Host_MemStats_f, "prints memory pool information" );
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
--------------------Configuration: engine - Win32 Release--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\WINDOWS\TEMP\RSP6457.bat" with contents
|
||||
Creating temporary file "C:\WINDOWS\TEMP\RSP6975.bat" with contents
|
||||
[
|
||||
@echo off
|
||||
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Xash3D\xash.dll"
|
||||
|
@ -14,7 +14,7 @@ copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Paranoia2\xash.dll"
|
|||
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Area51\xash.dll"
|
||||
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Quake\xash.dll"
|
||||
]
|
||||
Creating command line "C:\WINDOWS\TEMP\RSP6457.bat"
|
||||
Creating command line "C:\WINDOWS\TEMP\RSP6975.bat"
|
||||
<h3>Output Window</h3>
|
||||
Performing Custom Build Step on \Xash3D\src_main\temp\engine\!release\xash.dll
|
||||
‘ª®¯¨à®¢ ® ä ©«®¢: 1.
|
||||
|
|
|
@ -417,6 +417,8 @@ extern convar_t sv_skyname;
|
|||
extern convar_t sv_skyspeed;
|
||||
extern convar_t sv_skyangle;
|
||||
extern convar_t sv_consistency;
|
||||
extern convar_t sv_spawntime;
|
||||
extern convar_t sv_changetime;
|
||||
extern convar_t deathmatch;
|
||||
extern convar_t skill;
|
||||
extern convar_t coop;
|
||||
|
|
|
@ -310,14 +310,21 @@ void SV_ActivateServer( void )
|
|||
// Activate the DLL server code
|
||||
svgame.dllFuncs.pfnServerActivate( svgame.edicts, svgame.numEntities, svgame.globals->maxClients );
|
||||
|
||||
numFrames = (sv.loadgame) ? 1 : 2;
|
||||
if( !sv.loadgame || svgame.globals->changelevel )
|
||||
if( sv.loadgame || svgame.globals->changelevel )
|
||||
{
|
||||
sv.frametime = bound( 0.001, sv_changetime.value, 0.1 );
|
||||
numFrames = 1;
|
||||
}
|
||||
else if( svs.maxclients <= 1 )
|
||||
{
|
||||
sv.frametime = bound( 0.1, sv_spawntime.value, 0.8 );
|
||||
numFrames = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
sv.frametime = 0.1f;
|
||||
|
||||
// GoldSrc rules
|
||||
// NOTE: this stuff is breaking sound from func_rotating in multiplayer
|
||||
// e.g. ambience\boomer.wav on snark_pit.bsp
|
||||
numFrames *= Q_min( svs.maxclients, 8 );
|
||||
numFrames = 8;
|
||||
}
|
||||
|
||||
// run some frames to allow everything to settle
|
||||
for( i = 0; i < numFrames; i++ )
|
||||
|
|
|
@ -95,6 +95,9 @@ CVAR_DEFINE_AUTO( sv_skydir_z, "1", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "sky rotation
|
|||
CVAR_DEFINE_AUTO( sv_skyangle, "0", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "skybox rotational angle (in degrees)" );
|
||||
CVAR_DEFINE_AUTO( sv_skyspeed, "0", 0, "skybox rotational speed" );
|
||||
|
||||
CVAR_DEFINE( sv_spawntime, "host_spawntime", "0.8", FCVAR_ARCHIVE, "host.frametime on spawn new map (force to 0.1 if have problems or crashes)" );
|
||||
CVAR_DEFINE( sv_changetime, "host_changetime", "0.001", FCVAR_ARCHIVE, "host.frametime on changelevel (force to 0.1 if have player stucks)" );
|
||||
|
||||
// obsolete cvars which we should keep because game DLL's will be relies on it
|
||||
CVAR_DEFINE_AUTO( showtriggers, "0", FCVAR_LATCH, "debug cvar shows triggers" );
|
||||
CVAR_DEFINE_AUTO( sv_airmove, "1", FCVAR_SERVER, "obsolete, compatibility issues" );
|
||||
|
@ -779,6 +782,9 @@ void SV_Init( void )
|
|||
sv_novis = Cvar_Get( "sv_novis", "0", 0, "force to ignore server visibility" );
|
||||
sv_hostmap = Cvar_Get( "hostmap", GI->startmap, 0, "keep name of last entered map" );
|
||||
|
||||
Cvar_RegisterVariable (&sv_spawntime);
|
||||
Cvar_RegisterVariable (&sv_changetime);
|
||||
|
||||
Cvar_RegisterVariable (&violence_ablood);
|
||||
Cvar_RegisterVariable (&violence_hblood);
|
||||
Cvar_RegisterVariable (&violence_agibs);
|
||||
|
|
|
@ -780,7 +780,7 @@ SV_PushEntity
|
|||
Does not change the entities velocity at all
|
||||
============
|
||||
*/
|
||||
trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int *blocked )
|
||||
trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int *blocked, float flDamage )
|
||||
{
|
||||
trace_t trace;
|
||||
qboolean monsterClip;
|
||||
|
@ -818,7 +818,7 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
|
|||
if( blocked )
|
||||
{
|
||||
// more accuracy blocking code
|
||||
if( FBitSet( host.features, ENGINE_PHYSICS_PUSHER_EXT ))
|
||||
if( flDamage <= 0.0f )
|
||||
*blocked = !VectorCompare( ent->v.origin, end ); // can't move full distance
|
||||
else *blocked = true;
|
||||
}
|
||||
|
@ -966,7 +966,7 @@ static edict_t *SV_PushMove( edict_t *pusher, float movetime )
|
|||
|
||||
// try moving the contacted entity
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
SV_PushEntity( check, lmove, vec3_origin, &block );
|
||||
SV_PushEntity( check, lmove, vec3_origin, &block, pusher->v.dmg );
|
||||
pusher->v.solid = oldsolid;
|
||||
|
||||
// if it is still inside the pusher, block
|
||||
|
@ -1099,7 +1099,7 @@ static edict_t *SV_PushRotate( edict_t *pusher, float movetime )
|
|||
|
||||
// try moving the contacted entity
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
SV_PushEntity( check, lmove, amove, &block );
|
||||
SV_PushEntity( check, lmove, amove, &block, pusher->v.dmg );
|
||||
pusher->v.solid = oldsolid;
|
||||
|
||||
// pushed entity blocked by wall
|
||||
|
@ -1487,7 +1487,7 @@ void SV_Physics_Toss( edict_t *ent )
|
|||
|
||||
VectorSubtract( ent->v.velocity, ent->v.basevelocity, ent->v.velocity );
|
||||
|
||||
trace = SV_PushEntity( ent, move, vec3_origin, NULL );
|
||||
trace = SV_PushEntity( ent, move, vec3_origin, NULL, 0.0f );
|
||||
if( ent->free ) return;
|
||||
|
||||
SV_CheckVelocity( ent );
|
||||
|
@ -1541,7 +1541,7 @@ void SV_Physics_Toss( edict_t *ent )
|
|||
{
|
||||
VectorScale( ent->v.velocity, (1.0f - trace.fraction) * sv.frametime * 0.9f, move );
|
||||
VectorMA( move, (1.0f - trace.fraction) * sv.frametime * 0.9f, ent->v.basevelocity, move );
|
||||
trace = SV_PushEntity( ent, move, vec3_origin, NULL );
|
||||
trace = SV_PushEntity( ent, move, vec3_origin, NULL, 0.0f );
|
||||
if( ent->free ) return;
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue