17 Oct 2018
This commit is contained in:
parent
b78a1e6ea3
commit
a5b75dd44e
|
@ -1597,27 +1597,21 @@ Return to looping demos
|
||||||
*/
|
*/
|
||||||
void CL_Demos_f( void )
|
void CL_Demos_f( void )
|
||||||
{
|
{
|
||||||
// demos is starting up...
|
|
||||||
if( cls.demos_pending )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( cls.key_dest != key_menu )
|
if( cls.key_dest != key_menu )
|
||||||
{
|
{
|
||||||
Con_Printf( "'demos' is not valid from the console\n" );
|
Con_Printf( "'demos' is not valid from the console\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// demos loop are not running
|
||||||
|
if( cls.olddemonum == -1 )
|
||||||
|
return;
|
||||||
|
|
||||||
cls.demonum = cls.olddemonum;
|
cls.demonum = cls.olddemonum;
|
||||||
|
|
||||||
if( cls.demonum == -1 )
|
// run demos loop in background mode
|
||||||
cls.demonum = 0;
|
|
||||||
|
|
||||||
if( !SV_Active() && !cls.demoplayback )
|
if( !SV_Active() && !cls.demoplayback )
|
||||||
{
|
|
||||||
// run demos loop in background mode
|
|
||||||
cls.changedemo = true;
|
|
||||||
CL_NextDemo ();
|
CL_NextDemo ();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -967,6 +967,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
|
||||||
cl.frames[cl.parsecountmod].graphdata.sound += MSG_GetNumBytesRead( msg ) - bufStart;
|
cl.frames[cl.parsecountmod].graphdata.sound += MSG_GetNumBytesRead( msg ) - bufStart;
|
||||||
break;
|
break;
|
||||||
case svc_time:
|
case svc_time:
|
||||||
|
Cbuf_AddText( "\n" ); // new frame was started
|
||||||
CL_ParseServerTime( msg );
|
CL_ParseServerTime( msg );
|
||||||
break;
|
break;
|
||||||
case svc_print:
|
case svc_print:
|
||||||
|
|
|
@ -334,6 +334,7 @@ void V_RenderView( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
R_RenderFrame( &rvp );
|
R_RenderFrame( &rvp );
|
||||||
|
S_UpdateFrame( &rvp );
|
||||||
viewnum++;
|
viewnum++;
|
||||||
|
|
||||||
} while( rp.nextView );
|
} while( rp.nextView );
|
||||||
|
|
|
@ -1680,7 +1680,7 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(( light.r + light.g + light.b ) == 0 )
|
if(( light.r + light.g + light.b ) < 32 ) // TESTTEST
|
||||||
{
|
{
|
||||||
colorVec gcolor;
|
colorVec gcolor;
|
||||||
float grad[4];
|
float grad[4];
|
||||||
|
|
|
@ -135,15 +135,17 @@ wavdata_t *S_LoadSound( sfx_t *sfx )
|
||||||
return sfx->cache;
|
return sfx->cache;
|
||||||
|
|
||||||
if( !COM_CheckString( sfx->name ))
|
if( !COM_CheckString( sfx->name ))
|
||||||
{
|
|
||||||
// debug
|
|
||||||
Con_Printf( "S_LoadSound: sfx %d has NULL name\n", sfx - s_knownSfx );
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
// load it from disk
|
// load it from disk
|
||||||
if( Q_stricmp( sfx->name, "*default" ))
|
if( Q_stricmp( sfx->name, "*default" ))
|
||||||
sc = FS_LoadSound( sfx->name, NULL, 0 );
|
{
|
||||||
|
// load it from disk
|
||||||
|
if( sfx->name[0] == '*' )
|
||||||
|
sc = FS_LoadSound( sfx->name + 1, NULL, 0 );
|
||||||
|
else sc = FS_LoadSound( sfx->name, NULL, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
if( !sc ) sc = S_CreateDefaultSound();
|
if( !sc ) sc = S_CreateDefaultSound();
|
||||||
|
|
||||||
if( sc->rate < SOUND_11k ) // some bad sounds
|
if( sc->rate < SOUND_11k ) // some bad sounds
|
||||||
|
@ -301,7 +303,7 @@ void S_EndRegistration( void )
|
||||||
// free any sounds not from this registration sequence
|
// free any sounds not from this registration sequence
|
||||||
for( i = 0, sfx = s_knownSfx; i < s_numSfx; i++, sfx++ )
|
for( i = 0, sfx = s_knownSfx; i < s_numSfx; i++, sfx++ )
|
||||||
{
|
{
|
||||||
if( !sfx->name[0] || sfx->name[0] == '*' )
|
if( !sfx->name[0] || !Q_stricmp( sfx->name, "*default" ))
|
||||||
continue; // don't release default sound
|
continue; // don't release default sound
|
||||||
|
|
||||||
if( sfx->servercount != s_registration_sequence )
|
if( sfx->servercount != s_registration_sequence )
|
||||||
|
|
|
@ -1944,6 +1944,23 @@ void S_ExtraUpdate( void )
|
||||||
S_UpdateChannels ();
|
S_UpdateChannels ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
============
|
||||||
|
S_UpdateFrame
|
||||||
|
|
||||||
|
update listener position
|
||||||
|
============
|
||||||
|
*/
|
||||||
|
void S_UpdateFrame( ref_viewpass_t *rvp )
|
||||||
|
{
|
||||||
|
if( !FBitSet( rvp->flags, RF_DRAW_WORLD ) || FBitSet( rvp->flags, RF_ONLY_CLIENTDRAW ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
VectorCopy( rvp->vieworigin, s_listener.origin );
|
||||||
|
AngleVectors( rvp->viewangles, s_listener.forward, s_listener.right, s_listener.up );
|
||||||
|
s_listener.entnum = rvp->viewentity; // can be camera entity too
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
SND_UpdateSound
|
SND_UpdateSound
|
||||||
|
@ -1968,17 +1985,13 @@ void SND_UpdateSound( void )
|
||||||
// release raw-channels that no longer used more than 10 secs
|
// release raw-channels that no longer used more than 10 secs
|
||||||
S_FreeIdleRawChannels();
|
S_FreeIdleRawChannels();
|
||||||
|
|
||||||
s_listener.entnum = cl.viewentity; // can be camera entity too
|
VectorCopy( cl.simvel, s_listener.velocity );
|
||||||
s_listener.frametime = (cl.time - cl.oldtime);
|
s_listener.frametime = (cl.time - cl.oldtime);
|
||||||
s_listener.waterlevel = cl.local.waterlevel;
|
s_listener.waterlevel = cl.local.waterlevel;
|
||||||
s_listener.active = CL_IsInGame();
|
s_listener.active = CL_IsInGame();
|
||||||
s_listener.inmenu = CL_IsInMenu();
|
s_listener.inmenu = CL_IsInMenu();
|
||||||
s_listener.paused = cl.paused;
|
s_listener.paused = cl.paused;
|
||||||
|
|
||||||
VectorCopy( RI.vieworg, s_listener.origin );
|
|
||||||
VectorCopy( cl.simvel, s_listener.velocity );
|
|
||||||
AngleVectors( RI.viewangles, s_listener.forward, s_listener.right, s_listener.up );
|
|
||||||
|
|
||||||
if( cl.worldmodel != NULL )
|
if( cl.worldmodel != NULL )
|
||||||
Mod_FatPVS( s_listener.origin, FATPHS_RADIUS, s_listener.pasbytes, world.visbytes, false, !s_phs->value );
|
Mod_FatPVS( s_listener.origin, FATPHS_RADIUS, s_listener.pasbytes, world.visbytes, false, !s_phs->value );
|
||||||
|
|
||||||
|
|
|
@ -320,6 +320,7 @@ sfx_t *S_GetSfxByHandle( sound_t handle );
|
||||||
rawchan_t *S_FindRawChannel( int entnum, qboolean create );
|
rawchan_t *S_FindRawChannel( int entnum, qboolean create );
|
||||||
void S_RawSamples( uint samples, uint rate, word width, word channels, const byte *data, int entnum );
|
void S_RawSamples( uint samples, uint rate, word width, word channels, const byte *data, int entnum );
|
||||||
void S_StopSound( int entnum, int channel, const char *soundname );
|
void S_StopSound( int entnum, int channel, const char *soundname );
|
||||||
|
void S_UpdateFrame( struct ref_viewpass_s *rvp );
|
||||||
uint S_GetRawSamplesLength( int entnum );
|
uint S_GetRawSamplesLength( int entnum );
|
||||||
void S_ClearRawChannel( int entnum );
|
void S_ClearRawChannel( int entnum );
|
||||||
void S_StopAllSounds( qboolean ambient );
|
void S_StopAllSounds( qboolean ambient );
|
||||||
|
|
|
@ -23,7 +23,7 @@ static char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||||
int Q_buildnum( void )
|
int Q_buildnum( void )
|
||||||
{
|
{
|
||||||
// do not touch this! Only author of Xash3D can increase buildnumbers!
|
// do not touch this! Only author of Xash3D can increase buildnumbers!
|
||||||
#if 0
|
#if 1
|
||||||
int m = 0, d = 0, y = 0;
|
int m = 0, d = 0, y = 0;
|
||||||
static int b = 0;
|
static int b = 0;
|
||||||
|
|
||||||
|
|
|
@ -973,12 +973,14 @@ void Cmd_ExecuteString( char *text )
|
||||||
if( host.type == HOST_NORMAL )
|
if( host.type == HOST_NORMAL )
|
||||||
{
|
{
|
||||||
if( cls.state >= ca_connected )
|
if( cls.state >= ca_connected )
|
||||||
|
{
|
||||||
Cmd_ForwardToServer();
|
Cmd_ForwardToServer();
|
||||||
}
|
}
|
||||||
else if( text[0] != '@' && host.type == HOST_NORMAL )
|
else if( text[0] != '@' && Cvar_VariableInteger( "host_gameloaded" ))
|
||||||
{
|
{
|
||||||
// commands with leading '@' are hidden system commands
|
// commands with leading '@' are hidden system commands
|
||||||
Con_Printf( S_WARN "Unknown command \"%s\"\n", text );
|
Con_Printf( S_WARN "Unknown command \"%s\"\n", text );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -930,6 +930,7 @@ void SV_DrawDebugTriangles( void );
|
||||||
void SV_DrawOrthoTriangles( void );
|
void SV_DrawOrthoTriangles( void );
|
||||||
double CL_GetDemoFramerate( void );
|
double CL_GetDemoFramerate( void );
|
||||||
qboolean UI_CreditsActive( void );
|
qboolean UI_CreditsActive( void );
|
||||||
|
void CL_StopPlayback( void );
|
||||||
void CL_ExtraUpdate( void );
|
void CL_ExtraUpdate( void );
|
||||||
int CL_GetMaxClients( void );
|
int CL_GetMaxClients( void );
|
||||||
int SV_GetMaxClients( void );
|
int SV_GetMaxClients( void );
|
||||||
|
|
|
@ -805,6 +805,7 @@ qboolean Cmd_CheckMapsList( qboolean fRefresh )
|
||||||
autocomplete_list_t cmd_list[] =
|
autocomplete_list_t cmd_list[] =
|
||||||
{
|
{
|
||||||
{ "map_background", Cmd_GetMapList },
|
{ "map_background", Cmd_GetMapList },
|
||||||
|
{ "changelevel2", Cmd_GetMapList },
|
||||||
{ "changelevel", Cmd_GetMapList },
|
{ "changelevel", Cmd_GetMapList },
|
||||||
{ "playdemo", Cmd_GetDemoList, },
|
{ "playdemo", Cmd_GetDemoList, },
|
||||||
{ "timedemo", Cmd_GetDemoList, },
|
{ "timedemo", Cmd_GetDemoList, },
|
||||||
|
|
|
@ -570,7 +570,6 @@ int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list ar
|
||||||
__except( EXCEPTION_EXECUTE_HANDLER )
|
__except( EXCEPTION_EXECUTE_HANDLER )
|
||||||
{
|
{
|
||||||
Q_strncpy( buffer, "^1sprintf throw exception^7\n", buffersize );
|
Q_strncpy( buffer, "^1sprintf throw exception^7\n", buffersize );
|
||||||
// memset( buffer, 0, buffersize );
|
|
||||||
result = buffersize;
|
result = buffersize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ static void listlowercase( stringlist_t *list )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void listdirectory( stringlist_t *list, const char *path )
|
static void listdirectory( stringlist_t *list, const char *path, int lower )
|
||||||
{
|
{
|
||||||
char pattern[4096];
|
char pattern[4096];
|
||||||
struct _finddata_t n_file;
|
struct _finddata_t n_file;
|
||||||
|
@ -277,7 +277,7 @@ static void listdirectory( stringlist_t *list, const char *path )
|
||||||
_findclose( hFile );
|
_findclose( hFile );
|
||||||
|
|
||||||
// g-cont. disabled for some reasons
|
// g-cont. disabled for some reasons
|
||||||
// listlowercase( list );
|
if( lower ) listlowercase( list );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -616,7 +616,7 @@ void FS_AddGameDirectory( const char *dir, int flags )
|
||||||
Q_strncpy( fs_writedir, dir, sizeof( fs_writedir ));
|
Q_strncpy( fs_writedir, dir, sizeof( fs_writedir ));
|
||||||
|
|
||||||
stringlistinit( &list );
|
stringlistinit( &list );
|
||||||
listdirectory( &list, dir );
|
listdirectory( &list, dir, true );
|
||||||
stringlistsort( &list );
|
stringlistsort( &list );
|
||||||
|
|
||||||
// add any PAK package in the directory
|
// add any PAK package in the directory
|
||||||
|
@ -1370,7 +1370,7 @@ void FS_Init( void )
|
||||||
|
|
||||||
// ignore commandlineoption "-game" for other stuff
|
// ignore commandlineoption "-game" for other stuff
|
||||||
stringlistinit( &dirs );
|
stringlistinit( &dirs );
|
||||||
listdirectory( &dirs, "./" );
|
listdirectory( &dirs, "./", true );
|
||||||
stringlistsort( &dirs );
|
stringlistsort( &dirs );
|
||||||
SI.numgames = 0;
|
SI.numgames = 0;
|
||||||
|
|
||||||
|
@ -2698,7 +2698,7 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
|
||||||
// get a directory listing and look at each name
|
// get a directory listing and look at each name
|
||||||
Q_sprintf( netpath, "%s%s", searchpath->filename, basepath );
|
Q_sprintf( netpath, "%s%s", searchpath->filename, basepath );
|
||||||
stringlistinit( &dirlist );
|
stringlistinit( &dirlist );
|
||||||
listdirectory( &dirlist, netpath );
|
listdirectory( &dirlist, netpath, false );
|
||||||
|
|
||||||
for( dirlistindex = 0; dirlistindex < dirlist.numstrings; dirlistindex++ )
|
for( dirlistindex = 0; dirlistindex < dirlist.numstrings; dirlistindex++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -647,7 +647,8 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( *in == ' ' )
|
// now we found cmdline
|
||||||
|
if( *in == ' ' && ( in[1] == '+' || in[1] == '-' ))
|
||||||
{
|
{
|
||||||
parse_cmdline = true;
|
parse_cmdline = true;
|
||||||
*out++ = '\0';
|
*out++ = '\0';
|
||||||
|
@ -663,8 +664,12 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame )
|
||||||
|
|
||||||
host.mempool = Mem_AllocPool( "Zone Engine" );
|
host.mempool = Mem_AllocPool( "Zone Engine" );
|
||||||
|
|
||||||
|
// get name of executable
|
||||||
|
if( GetModuleFileName( NULL, szTemp, sizeof( szTemp )))
|
||||||
|
COM_FileBase( szTemp, SI.exeName );
|
||||||
|
|
||||||
// HACKHACK: Quake console is always allowed
|
// HACKHACK: Quake console is always allowed
|
||||||
if( Sys_CheckParm( "-console" ) || !Q_stricmp( progname, "id1" ))
|
if( Sys_CheckParm( "-console" ) || !Q_stricmp( SI.exeName, "quake" ))
|
||||||
host.allow_console = true;
|
host.allow_console = true;
|
||||||
|
|
||||||
if( Sys_CheckParm( "-dev" ))
|
if( Sys_CheckParm( "-dev" ))
|
||||||
|
@ -682,10 +687,6 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame )
|
||||||
host.type = HOST_NORMAL; // predict state
|
host.type = HOST_NORMAL; // predict state
|
||||||
host.con_showalways = true;
|
host.con_showalways = true;
|
||||||
|
|
||||||
// we can specified custom name, from Sys_NewInstance
|
|
||||||
if( GetModuleFileName( NULL, szTemp, sizeof( szTemp )))
|
|
||||||
COM_FileBase( szTemp, SI.exeName );
|
|
||||||
|
|
||||||
COM_ExtractFilePath( szTemp, szRootPath );
|
COM_ExtractFilePath( szTemp, szRootPath );
|
||||||
if( Q_stricmp( host.rootdir, szRootPath ))
|
if( Q_stricmp( host.rootdir, szRootPath ))
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ static byte scan_to_key[128] =
|
||||||
K_SHIFT,'\\','z','x','c','v','b','n','m',',','.','/',K_SHIFT,
|
K_SHIFT,'\\','z','x','c','v','b','n','m',',','.','/',K_SHIFT,
|
||||||
'*',K_ALT,' ',K_CAPSLOCK,
|
'*',K_ALT,' ',K_CAPSLOCK,
|
||||||
K_F1,K_F2,K_F3,K_F4,K_F5,K_F6,K_F7,K_F8,K_F9,K_F10,
|
K_F1,K_F2,K_F3,K_F4,K_F5,K_F6,K_F7,K_F8,K_F9,K_F10,
|
||||||
K_PAUSE,0,K_HOME,K_UPARROW,K_PGUP,K_KP_MINUS,K_LEFTARROW,K_KP_5,
|
K_PAUSE,K_SCROLLOCK,K_HOME,K_UPARROW,K_PGUP,K_KP_MINUS,K_LEFTARROW,K_KP_5,
|
||||||
K_RIGHTARROW,K_KP_PLUS,K_END,K_DOWNARROW,K_PGDN,K_INS,K_DEL,
|
K_RIGHTARROW,K_KP_PLUS,K_END,K_DOWNARROW,K_PGDN,K_INS,K_DEL,
|
||||||
0,0,0,K_F11,K_F12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,K_F11,K_F12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||||
|
|
|
@ -49,6 +49,7 @@ keyname_t keynames[] =
|
||||||
{"CTRL", K_CTRL, "+attack" },
|
{"CTRL", K_CTRL, "+attack" },
|
||||||
{"SHIFT", K_SHIFT, "+speed" },
|
{"SHIFT", K_SHIFT, "+speed" },
|
||||||
{"CAPSLOCK", K_CAPSLOCK, "" },
|
{"CAPSLOCK", K_CAPSLOCK, "" },
|
||||||
|
{"SCROLLOCK", K_SCROLLOCK, "" },
|
||||||
{"F1", K_F1, "cmd help" },
|
{"F1", K_F1, "cmd help" },
|
||||||
{"F2", K_F2, "menu_savegame" },
|
{"F2", K_F2, "menu_savegame" },
|
||||||
{"F3", K_F3, "menu_loadgame" },
|
{"F3", K_F3, "menu_loadgame" },
|
||||||
|
@ -202,7 +203,7 @@ const char *Key_KeynumToString( int keynum )
|
||||||
if ( keynum < 0 || keynum > 255 ) return "<OUT OF RANGE>";
|
if ( keynum < 0 || keynum > 255 ) return "<OUT OF RANGE>";
|
||||||
|
|
||||||
// check for printable ascii (don't use quote)
|
// check for printable ascii (don't use quote)
|
||||||
if( keynum > 32 && keynum < 127 && keynum != '"' && keynum != ';' )
|
if( keynum > 32 && keynum < 127 && keynum != '"' && keynum != ';' && keynum != K_SCROLLOCK )
|
||||||
{
|
{
|
||||||
tinystr[0] = keynum;
|
tinystr[0] = keynum;
|
||||||
tinystr[1] = 0;
|
tinystr[1] = 0;
|
||||||
|
@ -419,8 +420,10 @@ void Key_WriteBindings( file_t *f )
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < 256; i++ )
|
||||||
{
|
{
|
||||||
if( keys[i].binding && keys[i].binding[0] )
|
if( !COM_CheckString( keys[i].binding ))
|
||||||
FS_Printf( f, "bind %s \"%s\"\n", Key_KeynumToString( i ), keys[i].binding );
|
continue;
|
||||||
|
|
||||||
|
FS_Printf( f, "bind %s \"%s\"\n", Key_KeynumToString( i ), keys[i].binding );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,8 +439,10 @@ void Key_Bindlist_f( void )
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < 256; i++ )
|
||||||
{
|
{
|
||||||
if( keys[i].binding && keys[i].binding[0] )
|
if( !COM_CheckString( keys[i].binding ))
|
||||||
Con_Printf( "%s \"%s\"\n", Key_KeynumToString( i ), keys[i].binding );
|
continue;
|
||||||
|
|
||||||
|
Con_Printf( "%s \"%s\"\n", Key_KeynumToString( i ), keys[i].binding );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ load_internal:
|
||||||
}
|
}
|
||||||
|
|
||||||
if( filename[0] != '#' )
|
if( filename[0] != '#' )
|
||||||
Con_Reportf( S_WARN "FS_LoadSound: couldn't load \"%s\"\n", loadname );
|
Con_DPrintf( S_WARN "FS_LoadSound: couldn't load \"%s\"\n", loadname );
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#define K_ENTER 13
|
#define K_ENTER 13
|
||||||
#define K_ESCAPE 27
|
#define K_ESCAPE 27
|
||||||
#define K_SPACE 32
|
#define K_SPACE 32
|
||||||
|
#define K_SCROLLOCK 70
|
||||||
|
|
||||||
// normal keys should be passed as lowercased ascii
|
// normal keys should be passed as lowercased ascii
|
||||||
|
|
||||||
|
|
|
@ -584,6 +584,7 @@ void SV_PlaybackEventFull( int flags, const edict_t *pInvoker, word eventindex,
|
||||||
void SV_PlaybackReliableEvent( sizebuf_t *msg, word eventindex, float delay, event_args_t *args );
|
void SV_PlaybackReliableEvent( sizebuf_t *msg, word eventindex, float delay, event_args_t *args );
|
||||||
int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample, int vol, float attn, int flags, int pitch, const vec3_t pos );
|
int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample, int vol, float attn, int flags, int pitch, const vec3_t pos );
|
||||||
qboolean SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax );
|
qboolean SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax );
|
||||||
|
void SV_QueueChangeLevel( const char *level, const char *landname );
|
||||||
void SV_WriteEntityPatch( const char *filename );
|
void SV_WriteEntityPatch( const char *filename );
|
||||||
float SV_AngleMod( float ideal, float current, float speed );
|
float SV_AngleMod( float ideal, float current, float speed );
|
||||||
void SV_SpawnEntities( const char *mapname );
|
void SV_SpawnEntities( const char *mapname );
|
||||||
|
|
|
@ -1232,13 +1232,13 @@ void SV_PutClientInServer( sv_client_t *cl )
|
||||||
SetBits( ent->v.flags, FL_GODMODE|FL_NOTARGET );
|
SetBits( ent->v.flags, FL_GODMODE|FL_NOTARGET );
|
||||||
|
|
||||||
cl->pViewEntity = NULL; // reset pViewEntity
|
cl->pViewEntity = NULL; // reset pViewEntity
|
||||||
|
}
|
||||||
|
|
||||||
if( svgame.globals->cdAudioTrack )
|
if( svgame.globals->cdAudioTrack )
|
||||||
{
|
{
|
||||||
MSG_BeginServerCmd( &msg, svc_stufftext );
|
MSG_BeginServerCmd( &msg, svc_stufftext );
|
||||||
MSG_WriteString( &msg, va( "cd loop %3d\n", svgame.globals->cdAudioTrack ));
|
MSG_WriteString( &msg, va( "cd loop %3d\n", svgame.globals->cdAudioTrack ));
|
||||||
svgame.globals->cdAudioTrack = 0;
|
svgame.globals->cdAudioTrack = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HACKS_RELATED_HLMODS
|
#ifdef HACKS_RELATED_HLMODS
|
||||||
|
|
|
@ -440,6 +440,42 @@ void SV_Reload_f( void )
|
||||||
COM_LoadLevel( sv_hostmap->string, false );
|
COM_LoadLevel( sv_hostmap->string, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==================
|
||||||
|
SV_ChangeLevel_f
|
||||||
|
|
||||||
|
classic change level
|
||||||
|
==================
|
||||||
|
*/
|
||||||
|
void SV_ChangeLevel_f( void )
|
||||||
|
{
|
||||||
|
if( Cmd_Argc() != 2 )
|
||||||
|
{
|
||||||
|
Con_Printf( S_USAGE "changelevel <mapname>\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SV_QueueChangeLevel( Cmd_Argv( 1 ), NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==================
|
||||||
|
SV_ChangeLevel2_f
|
||||||
|
|
||||||
|
smooth change level
|
||||||
|
==================
|
||||||
|
*/
|
||||||
|
void SV_ChangeLevel2_f( void )
|
||||||
|
{
|
||||||
|
if( Cmd_Argc() != 3 )
|
||||||
|
{
|
||||||
|
Con_Printf( S_USAGE "changelevel2 <mapname> <landmark>\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SV_QueueChangeLevel( Cmd_Argv( 1 ), Cmd_Argv( 2 ));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
SV_Kick_f
|
SV_Kick_f
|
||||||
|
@ -802,6 +838,7 @@ void SV_InitHostCommands( void )
|
||||||
Cmd_AddCommand( "load", SV_Load_f, "load a saved game file" );
|
Cmd_AddCommand( "load", SV_Load_f, "load a saved game file" );
|
||||||
Cmd_AddCommand( "loadquick", SV_QuickLoad_f, "load a quick-saved game file" );
|
Cmd_AddCommand( "loadquick", SV_QuickLoad_f, "load a quick-saved game file" );
|
||||||
Cmd_AddCommand( "reload", SV_Reload_f, "continue from latest save or restart level" );
|
Cmd_AddCommand( "reload", SV_Reload_f, "continue from latest save or restart level" );
|
||||||
|
Cmd_AddCommand( "killsave", SV_DeleteSave_f, "delete a saved game file and saveshot" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -824,13 +861,14 @@ void SV_InitOperatorCommands( void )
|
||||||
Cmd_AddCommand( "edict_usage", SV_EdictUsage_f, "show info about edicts usage" );
|
Cmd_AddCommand( "edict_usage", SV_EdictUsage_f, "show info about edicts usage" );
|
||||||
Cmd_AddCommand( "entity_info", SV_EntityInfo_f, "show more info about edicts" );
|
Cmd_AddCommand( "entity_info", SV_EntityInfo_f, "show more info about edicts" );
|
||||||
Cmd_AddCommand( "shutdownserver", SV_KillServer_f, "shutdown current server" );
|
Cmd_AddCommand( "shutdownserver", SV_KillServer_f, "shutdown current server" );
|
||||||
|
Cmd_AddCommand( "changelevel", SV_ChangeLevel_f, "change level" );
|
||||||
|
Cmd_AddCommand( "changelevel2", SV_ChangeLevel2_f, "smooth change level" );
|
||||||
|
|
||||||
if( host.type == HOST_NORMAL )
|
if( host.type == HOST_NORMAL )
|
||||||
{
|
{
|
||||||
Cmd_AddCommand( "save", SV_Save_f, "save the game to a file" );
|
Cmd_AddCommand( "save", SV_Save_f, "save the game to a file" );
|
||||||
Cmd_AddCommand( "savequick", SV_QuickSave_f, "save the game to the quicksave" );
|
Cmd_AddCommand( "savequick", SV_QuickSave_f, "save the game to the quicksave" );
|
||||||
Cmd_AddCommand( "autosave", SV_AutoSave_f, "save the game to 'autosave' file" );
|
Cmd_AddCommand( "autosave", SV_AutoSave_f, "save the game to 'autosave' file" );
|
||||||
Cmd_AddCommand( "killsave", SV_DeleteSave_f, "delete a saved game file and saveshot" );
|
|
||||||
}
|
}
|
||||||
else if( host.type == HOST_DEDICATED )
|
else if( host.type == HOST_DEDICATED )
|
||||||
{
|
{
|
||||||
|
@ -857,12 +895,13 @@ void SV_KillOperatorCommands( void )
|
||||||
Cmd_RemoveCommand( "edict_usage" );
|
Cmd_RemoveCommand( "edict_usage" );
|
||||||
Cmd_RemoveCommand( "entity_info" );
|
Cmd_RemoveCommand( "entity_info" );
|
||||||
Cmd_RemoveCommand( "shutdownserver" );
|
Cmd_RemoveCommand( "shutdownserver" );
|
||||||
|
Cmd_RemoveCommand( "changelevel" );
|
||||||
|
Cmd_RemoveCommand( "changelevel2" );
|
||||||
|
|
||||||
if( host.type == HOST_NORMAL )
|
if( host.type == HOST_NORMAL )
|
||||||
{
|
{
|
||||||
Cmd_RemoveCommand( "save" );
|
Cmd_RemoveCommand( "save" );
|
||||||
Cmd_RemoveCommand( "savequick" );
|
Cmd_RemoveCommand( "savequick" );
|
||||||
Cmd_RemoveCommand( "killsave" );
|
|
||||||
Cmd_RemoveCommand( "autosave" );
|
Cmd_RemoveCommand( "autosave" );
|
||||||
}
|
}
|
||||||
else if( host.type == HOST_DEDICATED )
|
else if( host.type == HOST_DEDICATED )
|
||||||
|
|
|
@ -658,6 +658,91 @@ qboolean SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============
|
||||||
|
SV_ChangeLevel
|
||||||
|
|
||||||
|
Issue changing level
|
||||||
|
=============
|
||||||
|
*/
|
||||||
|
void SV_QueueChangeLevel( const char *level, const char *landname )
|
||||||
|
{
|
||||||
|
int flags, smooth = false;
|
||||||
|
char mapname[MAX_QPATH];
|
||||||
|
char *spawn_entity;
|
||||||
|
|
||||||
|
// hold mapname to other place
|
||||||
|
Q_strncpy( mapname, level, sizeof( mapname ));
|
||||||
|
COM_StripExtension( mapname );
|
||||||
|
|
||||||
|
if( COM_CheckString( landname ))
|
||||||
|
smooth = true;
|
||||||
|
|
||||||
|
// determine spawn entity classname
|
||||||
|
if( svs.maxclients == 1 )
|
||||||
|
spawn_entity = GI->sp_entity;
|
||||||
|
else spawn_entity = GI->mp_entity;
|
||||||
|
|
||||||
|
flags = SV_MapIsValid( mapname, spawn_entity, landname );
|
||||||
|
|
||||||
|
if( FBitSet( flags, MAP_INVALID_VERSION ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "changelevel: %s is invalid or not supported\n", mapname );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !FBitSet( flags, MAP_IS_EXIST ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "changelevel: map %s doesn't exist\n", mapname );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( smooth && !FBitSet( flags, MAP_HAS_LANDMARK ))
|
||||||
|
{
|
||||||
|
if( sv_validate_changelevel->value )
|
||||||
|
{
|
||||||
|
// NOTE: we find valid map but specified landmark it's doesn't exist
|
||||||
|
// run simple changelevel like in q1, throw warning
|
||||||
|
Con_Printf( S_WARN "changelevel: %s doesn't contain landmark [%s]. smooth transition was disabled\n", mapname, landname );
|
||||||
|
smooth = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( svs.maxclients > 1 )
|
||||||
|
smooth = false; // multiplayer doesn't support smooth transition
|
||||||
|
|
||||||
|
if( smooth && !Q_stricmp( sv.name, level ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "can't changelevel with same map. Ignored.\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !smooth && !FBitSet( flags, MAP_HAS_SPAWNPOINT ))
|
||||||
|
{
|
||||||
|
if( sv_validate_changelevel->value )
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "changelevel: %s doesn't have a valid spawnpoint. Ignored.\n", mapname );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bad changelevel position invoke enables in one-way transition
|
||||||
|
if( sv.framecount < 15 )
|
||||||
|
{
|
||||||
|
if( sv_validate_changelevel->value )
|
||||||
|
{
|
||||||
|
Con_Printf( S_WARN "an infinite changelevel was detected and will be disabled until a next save\\restore\n" );
|
||||||
|
return; // lock with svs.spawncount here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SV_SkipUpdates ();
|
||||||
|
|
||||||
|
// changelevel will be executed on a next frame
|
||||||
|
if( smooth ) COM_ChangeLevel( mapname, landname, sv.background ); // Smoothed Half-Life changelevel
|
||||||
|
else COM_ChangeLevel( mapname, NULL, sv.background ); // Classic Quake changlevel
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==============
|
==============
|
||||||
SV_WriteEntityPatch
|
SV_WriteEntityPatch
|
||||||
|
@ -1312,11 +1397,8 @@ pfnChangeLevel
|
||||||
*/
|
*/
|
||||||
void pfnChangeLevel( const char *level, const char *landmark )
|
void pfnChangeLevel( const char *level, const char *landmark )
|
||||||
{
|
{
|
||||||
int flags, smooth = false;
|
|
||||||
static uint last_spawncount = 0;
|
static uint last_spawncount = 0;
|
||||||
char mapname[MAX_QPATH];
|
|
||||||
char landname[MAX_QPATH];
|
char landname[MAX_QPATH];
|
||||||
char *spawn_entity;
|
|
||||||
char *text;
|
char *text;
|
||||||
|
|
||||||
if( !COM_CheckString( level ) || sv.state != ss_active )
|
if( !COM_CheckString( level ) || sv.state != ss_active )
|
||||||
|
@ -1326,10 +1408,6 @@ void pfnChangeLevel( const char *level, const char *landmark )
|
||||||
if( svs.spawncount == last_spawncount )
|
if( svs.spawncount == last_spawncount )
|
||||||
return;
|
return;
|
||||||
last_spawncount = svs.spawncount;
|
last_spawncount = svs.spawncount;
|
||||||
|
|
||||||
// hold mapname to other place
|
|
||||||
Q_strncpy( mapname, level, sizeof( mapname ));
|
|
||||||
COM_StripExtension( mapname );
|
|
||||||
landname[0] ='\0';
|
landname[0] ='\0';
|
||||||
|
|
||||||
#ifdef HACKS_RELATED_HLMODS
|
#ifdef HACKS_RELATED_HLMODS
|
||||||
|
@ -1346,72 +1424,7 @@ void pfnChangeLevel( const char *level, const char *landmark )
|
||||||
#else
|
#else
|
||||||
Q_strncpy( landname, landmark, sizeof( landname ));
|
Q_strncpy( landname, landmark, sizeof( landname ));
|
||||||
#endif
|
#endif
|
||||||
if( COM_CheckString( landname ))
|
SV_QueueChangeLevel( level, landname );
|
||||||
smooth = true;
|
|
||||||
|
|
||||||
// determine spawn entity classname
|
|
||||||
if( svs.maxclients == 1 )
|
|
||||||
spawn_entity = GI->sp_entity;
|
|
||||||
else spawn_entity = GI->mp_entity;
|
|
||||||
|
|
||||||
flags = SV_MapIsValid( mapname, spawn_entity, landname );
|
|
||||||
|
|
||||||
if( FBitSet( flags, MAP_INVALID_VERSION ))
|
|
||||||
{
|
|
||||||
Con_Printf( S_ERROR "changelevel: %s is invalid or not supported\n", mapname );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !FBitSet( flags, MAP_IS_EXIST ))
|
|
||||||
{
|
|
||||||
Con_Printf( S_ERROR "changelevel: map %s doesn't exist\n", mapname );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( smooth && !FBitSet( flags, MAP_HAS_LANDMARK ))
|
|
||||||
{
|
|
||||||
if( sv_validate_changelevel->value )
|
|
||||||
{
|
|
||||||
// NOTE: we find valid map but specified landmark it's doesn't exist
|
|
||||||
// run simple changelevel like in q1, throw warning
|
|
||||||
Con_Printf( S_WARN "changelevel: %s doesn't contain landmark [%s]. smooth transition was disabled\n", mapname, landname );
|
|
||||||
smooth = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( svs.maxclients > 1 )
|
|
||||||
smooth = false; // multiplayer doesn't support smooth transition
|
|
||||||
|
|
||||||
if( smooth && !Q_stricmp( sv.name, level ))
|
|
||||||
{
|
|
||||||
Con_Printf( S_ERROR "can't changelevel with same map. Ignored.\n" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !smooth && !FBitSet( flags, MAP_HAS_SPAWNPOINT ))
|
|
||||||
{
|
|
||||||
if( sv_validate_changelevel->value )
|
|
||||||
{
|
|
||||||
Con_Printf( S_ERROR "changelevel: %s doesn't have a valid spawnpoint. Ignored.\n", mapname );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// bad changelevel position invoke enables in one-way transition
|
|
||||||
if( sv.framecount < 15 )
|
|
||||||
{
|
|
||||||
if( sv_validate_changelevel->value )
|
|
||||||
{
|
|
||||||
Con_Printf( S_WARN "an infinite changelevel was detected and will be disabled until a next save\\restore\n" );
|
|
||||||
return; // lock with svs.spawncount here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SV_SkipUpdates ();
|
|
||||||
|
|
||||||
// changelevel will be executed on a next frame
|
|
||||||
if( smooth ) COM_ChangeLevel( mapname, landname, sv.background ); // Smoothed Half-Life changelevel
|
|
||||||
else COM_ChangeLevel( mapname, NULL, sv.background ); // Classic Quake changlevel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2022,6 +2035,9 @@ int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// TESTTEST
|
||||||
|
if( *sample == '*' ) chan = CHAN_AUTO;
|
||||||
|
|
||||||
// precache_sound can be used twice: cache sounds when loading
|
// precache_sound can be used twice: cache sounds when loading
|
||||||
// and return sound index when server is active
|
// and return sound index when server is active
|
||||||
sound_idx = SV_SoundIndex( sample );
|
sound_idx = SV_SoundIndex( sample );
|
||||||
|
@ -4598,8 +4614,11 @@ qboolean SV_ParseEdict( char **pfile, edict_t *ent )
|
||||||
}
|
}
|
||||||
|
|
||||||
// no reason to keep this data
|
// no reason to keep this data
|
||||||
Mem_Free( pkvd[i].szKeyName );
|
if( Mem_IsAllocatedExt( host.mempool, pkvd[i].szKeyName ))
|
||||||
Mem_Free( pkvd[i].szValue );
|
Mem_Free( pkvd[i].szKeyName );
|
||||||
|
|
||||||
|
if( Mem_IsAllocatedExt( host.mempool, pkvd[i].szValue ))
|
||||||
|
Mem_Free( pkvd[i].szValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( classname )
|
if( classname )
|
||||||
|
|
|
@ -671,6 +671,7 @@ void SV_ShutdownGame( void )
|
||||||
|
|
||||||
SV_FinalMessage( "", true );
|
SV_FinalMessage( "", true );
|
||||||
S_StopBackgroundTrack();
|
S_StopBackgroundTrack();
|
||||||
|
CL_StopPlayback(); // stop demo too
|
||||||
|
|
||||||
if( GameState->newGame )
|
if( GameState->newGame )
|
||||||
{
|
{
|
||||||
|
|
|
@ -780,6 +780,7 @@ 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, float flDamage )
|
trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int *blocked, float flDamage )
|
||||||
{
|
{
|
||||||
trace_t trace;
|
trace_t trace;
|
||||||
|
qboolean monsterBlock;
|
||||||
qboolean monsterClip;
|
qboolean monsterClip;
|
||||||
int type;
|
int type;
|
||||||
vec3_t end;
|
vec3_t end;
|
||||||
|
@ -812,10 +813,14 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
|
||||||
|
|
||||||
SV_LinkEdict( ent, true );
|
SV_LinkEdict( ent, true );
|
||||||
|
|
||||||
|
if( ent->v.movetype == MOVETYPE_WALK || ent->v.movetype == MOVETYPE_STEP || ent->v.movetype == MOVETYPE_PUSHSTEP )
|
||||||
|
monsterBlock = true;
|
||||||
|
else monsterBlock = false;
|
||||||
|
|
||||||
if( blocked )
|
if( blocked )
|
||||||
{
|
{
|
||||||
// more accuracy blocking code
|
// more accuracy blocking code
|
||||||
if( flDamage <= 0.0f && FBitSet( host.features, ENGINE_PHYSICS_PUSHER_EXT ))
|
if( monsterBlock )
|
||||||
*blocked = !VectorCompareEpsilon( ent->v.origin, end, ON_EPSILON ); // can't move full distance
|
*blocked = !VectorCompareEpsilon( ent->v.origin, end, ON_EPSILON ); // can't move full distance
|
||||||
else *blocked = true;
|
else *blocked = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ static void UI_CustomGame_Callback( void *self, int event )
|
||||||
case ID_YES:
|
case ID_YES:
|
||||||
// restart all engine systems with new game
|
// restart all engine systems with new game
|
||||||
char cmd[128];
|
char cmd[128];
|
||||||
sprintf( cmd, "game %s\n", uiCustomGame.modsDir[uiCustomGame.modList.curItem] );
|
sprintf( cmd, "game \"%s\"\n", uiCustomGame.modsDir[uiCustomGame.modList.curItem] );
|
||||||
CLIENT_COMMAND( FALSE, cmd );
|
CLIENT_COMMAND( FALSE, cmd );
|
||||||
UI_EndGameDialog();
|
UI_EndGameDialog();
|
||||||
break;
|
break;
|
||||||
|
|
Reference in New Issue